# HG changeset patch # User Matti Hamalainen # Date 1503182316 -10800 # Node ID eb3f883f4acb5e058e6d6d0ce9152591d0eb3ca4 # Parent 4eb394c9e682f8a4fe15c33022e976840b03b141 Cleanups. diff -r 4eb394c9e682 -r eb3f883f4acb tools/xm2jss.c --- a/tools/xm2jss.c Sun Aug 20 01:20:56 2017 +0300 +++ b/tools/xm2jss.c Sun Aug 20 01:38:36 2017 +0300 @@ -63,15 +63,13 @@ void argShowHelp() { - int i; - dmPrintBanner(stdout, dmProgName, "[options] "); dmArgsPrintHelp(stdout, optList, optListN, 0); printf("\n" "Pattern storage modes:\n"); - for (i = 1; i < PATMODE_LAST; i++) + for (int i = 1; i < PATMODE_LAST; i++) printf(" %d = %s\n", i, patModeTable[i-1]); printf( @@ -425,7 +423,6 @@ static BOOL jssMODWriteEnvelope(FILE *outFile, JSSEnvelope *env, const char *name, const int ninst) { - int i; BOOL ok = dm_fwrite_byte(outFile, env->flags) && dm_fwrite_byte(outFile, env->npoints) && @@ -433,7 +430,7 @@ dm_fwrite_byte(outFile, env->loopS) && dm_fwrite_byte(outFile, env->loopE); - for (i = 0; ok && i < env->npoints; i++) + for (int i = 0; ok && i < env->npoints; i++) { ok = dm_fwrite_le16(outFile, env->points[i].frame) && @@ -622,7 +619,6 @@ if (module->extInstruments[index] != NULL) { JSSExtInstrument *einst = module->extInstruments[index]; - int i; BOOL ok = dm_fwrite_byte(outFile, einst->nsamples) && @@ -632,7 +628,7 @@ dm_fwrite_le16(outFile, einst->vibratoRate) && dm_fwrite_le16(outFile, einst->fadeOut); - for (i = 0; ok && i < jsetNNotes; i++) + for (int i = 0; ok && i < jsetNNotes; i++) { int snum = einst->sNumForNotes[i]; Uint32 tmp = (snum != jsetNotSet) ? snum + 1 : 0; @@ -734,17 +730,16 @@ /* Scan given pattern for used instruments and channels. - * Also checks if the pattern is emty. + * Also checks if the pattern is empty. */ void scanPattern(JSSModule *module, JSSPattern *pattern, int npattern, BOOL *usedExtInstruments, BOOL *usedChannels, BOOL *empty) { - int row, channel; JSSNote *n = pattern->data; *empty = FALSE; // Check all notes in this pattern to see what instruments are used - for (row = 0; row < pattern->nrows; row++) - for (channel = 0; channel < pattern->nchannels; channel++, n++) + for (int row = 0; row < pattern->nrows; row++) + for (int channel = 0; channel < pattern->nchannels; channel++, n++) { if (n->instrument != jsetNotSet) { @@ -1064,6 +1059,7 @@ JMPGETEFFECT(effect, n->effect); + // Convert certain effects switch (effect) { case 'C': // Cxx = Set volume