Fix compiler warnings.

This commit is contained in:
Erik de Castro Lopo
2012-02-01 19:58:09 +11:00
parent 6b3b137099
commit 8bbbf56403
4 changed files with 6 additions and 8 deletions

View File

@@ -275,7 +275,6 @@ static FLAC__bool get_sample_info_wave(EncoderSession *e, encode_options_t optio
FLAC__uint16 x; FLAC__uint16 x;
FLAC__uint32 xx, data_bytes; FLAC__uint32 xx, data_bytes;
FLAC__uint16 wFormatTag; /* wFormatTag word from the 'fmt ' chunk */ FLAC__uint16 wFormatTag; /* wFormatTag word from the 'fmt ' chunk */
unsigned block_align;
if(got_fmt_chunk) { if(got_fmt_chunk) {
flac__utils_printf(stderr, 1, "%s: ERROR: file has multiple 'fmt ' chunks\n", e->inbasefilename); flac__utils_printf(stderr, 1, "%s: ERROR: file has multiple 'fmt ' chunks\n", e->inbasefilename);
@@ -368,7 +367,7 @@ static FLAC__bool get_sample_info_wave(EncoderSession *e, encode_options_t optio
/* block align */ /* block align */
if(!read_uint16(e->fin, /*big_endian=*/false, &x, e->inbasefilename)) if(!read_uint16(e->fin, /*big_endian=*/false, &x, e->inbasefilename))
return false; return false;
block_align = (unsigned)x;
/* bits per sample */ /* bits per sample */
if(!read_uint16(e->fin, /*big_endian=*/false, &x, e->inbasefilename)) if(!read_uint16(e->fin, /*big_endian=*/false, &x, e->inbasefilename))
return false; return false;

View File

@@ -112,7 +112,7 @@ void FLAC__lpc_compute_autocorrelation(const FLAC__real data[], unsigned data_le
void FLAC__lpc_compute_lp_coefficients(const FLAC__real autoc[], unsigned *max_order, FLAC__real lp_coeff[][FLAC__MAX_LPC_ORDER], FLAC__double error[]) void FLAC__lpc_compute_lp_coefficients(const FLAC__real autoc[], unsigned *max_order, FLAC__real lp_coeff[][FLAC__MAX_LPC_ORDER], FLAC__double error[])
{ {
unsigned i, j; unsigned i, j;
FLAC__double r, err, ref[FLAC__MAX_LPC_ORDER], lpc[FLAC__MAX_LPC_ORDER]; FLAC__double r, err, lpc[FLAC__MAX_LPC_ORDER];
FLAC__ASSERT(0 != max_order); FLAC__ASSERT(0 != max_order);
FLAC__ASSERT(0 < *max_order); FLAC__ASSERT(0 < *max_order);
@@ -126,7 +126,6 @@ void FLAC__lpc_compute_lp_coefficients(const FLAC__real autoc[], unsigned *max_o
r = -autoc[i+1]; r = -autoc[i+1];
for(j = 0; j < i; j++) for(j = 0; j < i; j++)
r -= lpc[j] * autoc[i-j]; r -= lpc[j] * autoc[i-j];
ref[i] = (r/=err);
/* Update LPC coefficients and total error. */ /* Update LPC coefficients and total error. */
lpc[i]=r; lpc[i]=r;

View File

@@ -147,13 +147,13 @@ static unsigned long totsamp;
static double lsum; static double lsum;
static double rsum; static double rsum;
static int freqindex; static int freqindex;
#ifndef __sun #if 0
static Uint32_t A [(size_t)(STEPS_per_dB * MAX_dB)]; static Uint32_t A [(size_t)(STEPS_per_dB * MAX_dB)];
static Uint32_t B [(size_t)(STEPS_per_dB * MAX_dB)]; static Uint32_t B [(size_t)(STEPS_per_dB * MAX_dB)];
#else #else
/* [JEC] Solaris Forte compiler doesn't like float calc in array indices */ /* [JEC] Solaris Forte compiler doesn't like float calc in array indices */
static Uint32_t A [12000]; static Uint32_t A [120 * 100];
static Uint32_t B [12000]; static Uint32_t B [120 * 100];
#endif #endif
/* for each filter: /* for each filter:

View File

@@ -111,7 +111,7 @@ static int do_cuesheet(const char *infilename, unsigned sample_rate, FLAC__bool
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
FLAC__uint64 lead_out_offset; FLAC__uint64 lead_out_offset;
unsigned sample_rate; unsigned sample_rate = 48000;
FLAC__bool is_cdda = false; FLAC__bool is_cdda = false;
const char *usage = "usage: test_cuesheet cuesheet_file lead_out_offset [ [ sample_rate ] cdda ]\n"; const char *usage = "usage: test_cuesheet cuesheet_file lead_out_offset [ [ sample_rate ] cdda ]\n";