fix a warning and fix a possible crash on 64-bit arch

master
Rob Sykes 2013-01-05 13:35:24 +00:00
parent 85e7ab58d9
commit caf7d62572
1 changed files with 2 additions and 3 deletions

View File

@ -19,7 +19,6 @@ typedef struct soxr SRC_STATE;
#include "soxr-lsr.h"
#include "rint.h"
soxr_error_t src_simple(io_t * p, unsigned id, int channels)
{
size_t idone, odone;
@ -52,7 +51,7 @@ soxr_t src_callback_new(soxr_input_fn_t fn, unsigned id, int channels, SRC_ERROR
soxr = soxr_create(0, 0, (unsigned)channels, &error, 0, &q_spec, &r_spec);
if (soxr)
error = soxr_set_input_fn(soxr, fn, p, 0);
*(int *)error0 = (int)(long)error;
*(int *)error0 = (int)(ptrdiff_t)error;
return soxr;
}
@ -105,7 +104,7 @@ static char const * const names[] = {"LSR best sinc", "LSR medium sinc", "LSR fa
char const * src_get_name(unsigned n) {return n < 5u + !getenv("SOXR_LSR_STRICT")? names[n] : 0;}
char const * src_get_description(unsigned id) {return src_get_name(id);}
char const * src_get_version(void) {return soxr_version();}
char const * src_strerror(soxr_error_t error) {return error == (soxr_error_t)1? "Placeholder." : soxr_strerror(error);}
char const * src_strerror(soxr_error_t error) {return error == (soxr_error_t)1? "Placeholder." : sizeof(int) >= sizeof(char *)? soxr_strerror(error) : "error";}
int src_is_valid_ratio(double oi_ratio) {return getenv("SOXR_LSR_STRICT")? oi_ratio >= 1./256 && oi_ratio <= 256 : oi_ratio > 0;}
soxr_error_t src_error(soxr_t p) {return soxr_error(p);}
soxr_error_t src_reset(soxr_t p) {return soxr_clear(p);}