Rearranged playptmod a bit and fixed some warnings

CQTexperiment
Chris Moeller 2013-10-22 10:48:57 -07:00
parent 231112389d
commit 64149aa8c5
1 changed files with 18 additions and 19 deletions

View File

@ -1062,7 +1062,7 @@ int playptmod_LoadMem(void *_p, const unsigned char *buf, unsigned long bufLengt
int lateVerSTKFlag; int lateVerSTKFlag;
int numSamples; int numSamples;
int tmp; int tmp;
unsigned int tempOffset; unsigned long tempOffset;
modnote_t *note; modnote_t *note;
MODULE_SAMPLE *s; MODULE_SAMPLE *s;
BUF *fmodule; BUF *fmodule;
@ -1345,8 +1345,6 @@ int playptmod_LoadMem(void *_p, const unsigned char *buf, unsigned long bufLengt
{ {
s->reallength = s->length; s->reallength = s->length;
bufread(tempSample + j, 1, s->length - j, fmodule); bufread(tempSample + j, 1, s->length - j, fmodule);
}
if (s->length > 8) if (s->length > 8)
{ {
for (j = 0; j < (s->length - 8); ++j) for (j = 0; j < (s->length - 8); ++j)
@ -1367,6 +1365,7 @@ int playptmod_LoadMem(void *_p, const unsigned char *buf, unsigned long bufLengt
++smpDat8; ++smpDat8;
} }
} }
}
sampleOffset += s->length; sampleOffset += s->length;
p->source->head.totalSampleSize += s->length; p->source->head.totalSampleSize += s->length;
@ -1401,8 +1400,8 @@ int playptmod_LoadMem(void *_p, const unsigned char *buf, unsigned long bufLengt
if (s->reallength < s->length) if (s->reallength < s->length)
{ {
const signed char * compressionTable = tempSample + 5; const signed char * compressionTable = (const signed char *) tempSample + 5;
const unsigned char * adpcmData = tempSample + 5 + 16; const unsigned char * adpcmData = (const unsigned char *) tempSample + 5 + 16;
int delta = 0; int delta = 0;
bufread(tempSample, 1, s->reallength, fmodule); bufread(tempSample, 1, s->reallength, fmodule);
for ( j = 0; j < s->length; ++j ) for ( j = 0; j < s->length; ++j )