Fixed minor compiler warnings (unused/uninitialized vars)

This commit is contained in:
bnnm 2016-12-27 16:33:10 +01:00
parent 08a1a50ccb
commit e06ddd0076
8 changed files with 37 additions and 32 deletions

View File

@ -7,8 +7,7 @@ VGMSTREAM * init_vgmstream_bcstm(STREAMFILE *streamFile) {
coding_t coding_type;
off_t info_offset, seek_offset, data_offset, regn_offset, pdat_offset;
size_t info_size, seek_size, data_size, regn_size, pdat_size;
off_t info_offset = 0, seek_offset = 0, data_offset = 0;
uint16_t temp_id;
int codec_number;
int channel_count;
@ -35,23 +34,23 @@ VGMSTREAM * init_vgmstream_bcstm(STREAMFILE *streamFile) {
switch(temp_id) {
case 0x4000:
info_offset = read_32bitLE(0x18 + i * 0xc, streamFile);
info_size = read_32bitLE(0x1c + i * 0xc, streamFile);
/* size_t info_size = read_32bitLE(0x1c + i * 0xc, streamFile); */
break;
case 0x4001:
seek_offset = read_32bitLE(0x18 + i * 0xc, streamFile);
seek_size = read_32bitLE(0x1c + i * 0xc, streamFile);
/* size_t seek_size = read_32bitLE(0x1c + i * 0xc, streamFile); */
break;
case 0x4002:
data_offset = read_32bitLE(0x18 + i * 0xc, streamFile);
data_size = read_32bitLE(0x1c + i * 0xc, streamFile);
/* size_t data_size = read_32bitLE(0x1c + i * 0xc, streamFile); */
break;
case 0x4003:
regn_offset = read_32bitLE(0x18 + i * 0xc, streamFile);
regn_size = read_32bitLE(0x1c + i * 0xc, streamFile);
/* off_t regn_offset = read_32bitLE(0x18 + i * 0xc, streamFile); */
/* size_t regn_size = read_32bitLE(0x1c + i * 0xc, streamFile); */
break;
case 0x4004:
pdat_offset = read_32bitLE(0x18 + i * 0xc, streamFile);
pdat_size = read_32bitLE(0x1c + i * 0xc, streamFile);
/* off_t pdat_offset = read_32bitLE(0x18 + i * 0xc, streamFile); */
/* size_t pdat_size = read_32bitLE(0x1c + i * 0xc, streamFile); */
break;
default:
break;
@ -62,6 +61,7 @@ VGMSTREAM * init_vgmstream_bcstm(STREAMFILE *streamFile) {
/* check type details */
if (info_offset == 0) goto fail;
codec_number = read_8bit(info_offset + 0x20, streamFile);
loop_flag = read_8bit(info_offset + 0x21, streamFile);
channel_count = read_8bit(info_offset + 0x22, streamFile);
@ -74,6 +74,7 @@ VGMSTREAM * init_vgmstream_bcstm(STREAMFILE *streamFile) {
coding_type = coding_PCM16LE;
break;
case 2:
if (seek_offset == 0) goto fail;
if ((uint32_t)read_32bitBE(seek_offset, streamFile) != 0x5345454B) { /* "SEEK" If this header doesn't exist, assuming that the file is IMA */
ima = 1;
coding_type = coding_INT_IMA;
@ -157,10 +158,13 @@ VGMSTREAM * init_vgmstream_bcstm(STREAMFILE *streamFile) {
}
}
if (ima) // No SEEK (ADPC) header, so just start where the SEEK header is supposed to be.
if (ima) { // No SEEK (ADPC) header, so just start where the SEEK header is supposed to be.
if (seek_offset == 0) goto fail;
start_offset = seek_offset;
else
} else {
if (data_offset == 0) goto fail;
start_offset = data_offset + 0x20;
}

View File

@ -8,8 +8,7 @@ VGMSTREAM * init_vgmstream_bfstm(STREAMFILE *streamFile) {
coding_t coding_type;
off_t info_offset, seek_offset, data_offset, regn_offset, pdat_offset;
size_t info_size, seek_size, data_size, regn_size, pdat_size;
off_t info_offset = 0, seek_offset = 0, data_offset = 0;
uint16_t temp_id;
int codec_number;
int channel_count;
@ -17,7 +16,6 @@ VGMSTREAM * init_vgmstream_bfstm(STREAMFILE *streamFile) {
int i, j;
int ima = 0;
off_t start_offset;
int founddata;
off_t tempoffset1;
int section_count;
@ -39,23 +37,23 @@ VGMSTREAM * init_vgmstream_bfstm(STREAMFILE *streamFile) {
switch(temp_id) {
case 0x4000:
info_offset = read_32bitBE(0x18 + i * 0xc, streamFile);
info_size = read_32bitBE(0x1c + i * 0xc, streamFile);
/* size_t info_size = read_32bitBE(0x1c + i * 0xc, streamFile); */
break;
case 0x4001:
seek_offset = read_32bitBE(0x18 + i * 0xc, streamFile);
seek_size = read_32bitBE(0x1c + i * 0xc, streamFile);
/* size_t seek_size = read_32bitBE(0x1c + i * 0xc, streamFile); */
break;
case 0x4002:
data_offset = read_32bitBE(0x18 + i * 0xc, streamFile);
data_size = read_32bitBE(0x1c + i * 0xc, streamFile);
/* size_t data_size = read_32bitBE(0x1c + i * 0xc, streamFile); */
break;
case 0x4003:
regn_offset = read_32bitBE(0x18 + i * 0xc, streamFile);
regn_size = read_32bitBE(0x1c + i * 0xc, streamFile);
/* off_t regn_offset = read_32bitBE(0x18 + i * 0xc, streamFile); */
/* size_t regn_size = read_32bitBE(0x1c + i * 0xc, streamFile); */
break;
case 0x4004:
pdat_offset = read_32bitBE(0x18 + i * 0xc, streamFile);
pdat_size = read_32bitBE(0x1c + i * 0xc, streamFile);
/* off_t pdat_offset = read_32bitBE(0x18 + i * 0xc, streamFile); */
/* size_t pdat_size = read_32bitBE(0x1c + i * 0xc, streamFile); */
break;
default:
break;
@ -63,6 +61,7 @@ VGMSTREAM * init_vgmstream_bfstm(STREAMFILE *streamFile) {
}
if (info_offset == 0) goto fail;
if ((uint32_t)read_32bitBE(info_offset, streamFile) != 0x494E464F) /* "INFO" */
goto fail;
@ -152,10 +151,13 @@ VGMSTREAM * init_vgmstream_bfstm(STREAMFILE *streamFile) {
}
}
if (ima) // No SEEK (ADPC) header, so just start where the SEEK header is supposed to be.
if (ima) { // No SEEK (ADPC) header, so just start where the SEEK header is supposed to be.
if (seek_offset == 0) goto fail;
start_offset = seek_offset;
else
} else {
if (data_offset == 0) goto fail;
start_offset = data_offset + 0x20;
}

View File

@ -7,7 +7,7 @@ VGMSTREAM * init_vgmstream_bfwav(STREAMFILE *streamFile) {
coding_t coding_type;
int ima = 0;
/*int ima = 0;*/
int nsmbu_flag = 0;
int32_t(*read_32bit)(off_t, STREAMFILE*) = read_32bitBE;
int16_t(*read_16bit)(off_t, STREAMFILE*) = read_16bitBE;

View File

@ -8,7 +8,6 @@ Wii U boot sound file for each game/app.
VGMSTREAM * init_vgmstream_btsnd(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[PATH_LIMIT];
coding_t coding_type;
int channel_count = 2;
int loop_flag;
off_t start_offset = 0x8;

View File

@ -15,7 +15,7 @@ VGMSTREAM * init_vgmstream_fsb5(STREAMFILE *streamFile) {
int NumSamples;
int ChannelCount;
int SampleRate;
int DSPInfoStart;
int DSPInfoStart = 0;
int SampleHeaderStart, SampleHeaderLength, NameTableLength, SampleDataLength, CodingID, SampleMode;
int ExtraFlag, ExtraFlagStart, ExtraFlagType, ExtraFlagSize, ExtraFlagEnd;

View File

@ -7,7 +7,7 @@ VGMSTREAM * init_vgmstream_g1l(STREAMFILE *streamFile) {
coding_t coding_type;
off_t head_offset;
/*off_t head_offset;*/
int channel_count;
int loop_flag;

View File

@ -2686,9 +2686,9 @@ VGMSTREAM * init_vgmstream_ngc_dsp_csmp(STREAMFILE *streamFile) {
goto fail;
if (header.loop_flag) {
off_t loop_off;
// off_t loop_off;
/* check loop predictor/scale */
loop_off = header.loop_start_offset/16*8;
// loop_off = header.loop_start_offset/16*8;
/* Retro doesn't seem to abide by this */
// if (header.loop_ps != (uint8_t)read_8bit(current_offset + start_offset+loop_off,streamFile))
// goto fail;

View File

@ -10,8 +10,8 @@ VGMSTREAM * init_vgmstream_ps3_klbs(STREAMFILE *streamFile)
size_t fileLength;
off_t readOffset = 0;
off_t start_offset;
off_t loop_start_offset;
off_t loop_end_offset;
off_t loop_start_offset = 0;
off_t loop_end_offset = 0;
uint8_t testBuffer[0x10];
int loop_flag = 0;