From 64149aa8c5499219288c88873a3717867c9169da Mon Sep 17 00:00:00 2001 From: Chris Moeller Date: Tue, 22 Oct 2013 10:48:57 -0700 Subject: [PATCH] Rearranged playptmod a bit and fixed some warnings --- Frameworks/playptmod/playptmod/playptmod.c | 37 +++++++++++----------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/Frameworks/playptmod/playptmod/playptmod.c b/Frameworks/playptmod/playptmod/playptmod.c index 5959efa18..74efc334f 100644 --- a/Frameworks/playptmod/playptmod/playptmod.c +++ b/Frameworks/playptmod/playptmod/playptmod.c @@ -1062,7 +1062,7 @@ int playptmod_LoadMem(void *_p, const unsigned char *buf, unsigned long bufLengt int lateVerSTKFlag; int numSamples; int tmp; - unsigned int tempOffset; + unsigned long tempOffset; modnote_t *note; MODULE_SAMPLE *s; BUF *fmodule; @@ -1345,29 +1345,28 @@ int playptmod_LoadMem(void *_p, const unsigned char *buf, unsigned long bufLengt { s->reallength = s->length; bufread(tempSample + j, 1, s->length - j, fmodule); - } - - if (s->length > 8) - { - for (j = 0; j < (s->length - 8); ++j) + if (s->length > 8) { - if (memcmp(smpDat8, "8SVXVHDR", 8) == 0) - iffHdrFound = 1; - - if (iffHdrFound) + for (j = 0; j < (s->length - 8); ++j) { - if (memcmp(smpDat8, "BODY", 4) == 0) + if (memcmp(smpDat8, "8SVXVHDR", 8) == 0) + iffHdrFound = 1; + + if (iffHdrFound) { - s->iffSize = j + 8; - s->length -= s->iffSize; - break; + if (memcmp(smpDat8, "BODY", 4) == 0) + { + s->iffSize = j + 8; + s->length -= s->iffSize; + break; + } } + + ++smpDat8; } - - ++smpDat8; } } - + sampleOffset += 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) { - const signed char * compressionTable = tempSample + 5; - const unsigned char * adpcmData = tempSample + 5 + 16; + const signed char * compressionTable = (const signed char *) tempSample + 5; + const unsigned char * adpcmData = (const unsigned char *) tempSample + 5 + 16; int delta = 0; bufread(tempSample, 1, s->reallength, fmodule); for ( j = 0; j < s->length; ++j )