Skip to content

Commit 500711c

Browse files
committed
Revert making for loop variable permanent.
- Apply less changes to original code
1 parent 3a8b61e commit 500711c

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/load_it.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ BOOL CSoundFile::ReadIT(const BYTE *lpStream, DWORD dwMemLength)
159159
DWORD patpos[MAX_PATTERNS];
160160
BYTE chnmask[64];//, channels_used[64]
161161
MODCOMMAND lastvalue[64];
162-
UINT j;
163162

164163
if ((!lpStream) || (dwMemLength < sizeof(ITFILEHEADER))) return FALSE;
165164
ITFILEHEADER pifh = *(ITFILEHEADER *)lpStream;
@@ -232,7 +231,7 @@ BOOL CSoundFile::ReadIT(const BYTE *lpStream, DWORD dwMemLength)
232231
if (inspossize > MAX_INSTRUMENTS) inspossize = MAX_INSTRUMENTS;
233232
inspossize <<= 2;
234233
memcpy(inspos, lpStream+dwMemPos, inspossize);
235-
for (j=0; j < (inspossize>>2); j++) {
234+
for (UINT j=0; j < (inspossize>>2); j++) {
236235
inspos[j] = bswapLE32(inspos[j]);
237236
}
238237
dwMemPos += pifh.insnum * 4;
@@ -242,7 +241,7 @@ BOOL CSoundFile::ReadIT(const BYTE *lpStream, DWORD dwMemLength)
242241
if (smppossize > MAX_SAMPLES) smppossize = MAX_SAMPLES;
243242
smppossize <<= 2;
244243
memcpy(smppos, lpStream+dwMemPos, smppossize);
245-
for (j=0; j < (smppossize>>2); j++) {
244+
for (UINT j=0; j < (smppossize>>2); j++) {
246245
smppos[j] = bswapLE32(smppos[j]);
247246
}
248247
dwMemPos += pifh.smpnum * 4;
@@ -252,7 +251,7 @@ BOOL CSoundFile::ReadIT(const BYTE *lpStream, DWORD dwMemLength)
252251
if (patpossize > MAX_PATTERNS) patpossize = MAX_PATTERNS;
253252
patpossize <<= 2;
254253
memcpy(patpos, lpStream+dwMemPos, patpossize);
255-
for (j=0; j < (patpossize>>2); j++) {
254+
for (UINT j=0; j < (patpossize>>2); j++) {
256255
patpos[j] = bswapLE32(patpos[j]);
257256
}
258257
dwMemPos += pifh.patnum * 4;

src/sndfile.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,18 +1393,17 @@ UINT CSoundFile::ReadSample(MODINSTRUMENT *pIns, UINT nFlags, LPCSTR lpMemFile,
13931393
// PTM 8bit delta to 16-bit sample
13941394
case RS_PTM8DTO16:
13951395
{
1396-
UINT j;
13971396
len = pIns->nLength * 2;
13981397
if (len > dwMemLength) break;
13991398
int8_t *pSample = (int8_t *)pIns->pSample;
14001399
int8_t delta8 = 0;
1401-
for (j=0; j<len; j++)
1400+
for (UINT j=0; j<len; j++)
14021401
{
14031402
delta8 += lpMemFile[j];
14041403
*pSample++ = delta8;
14051404
}
14061405
uint16_t *pSampleW = (uint16_t *)pIns->pSample;
1407-
for (j=0; j<len; j+=2) // swaparoni!
1406+
for (UINT j=0; j<len; j+=2) // swaparoni!
14081407
{
14091408
uint16_t rawSample = *pSampleW;
14101409
*pSampleW++ = bswapLE16(rawSample);

0 commit comments

Comments
 (0)