# HG changeset patch # User Matti Hamalainen # Date 1503424553 -10800 # Node ID f2fd1ad84829287e9ecd4c1497bb16fac4ebc2ae # Parent ae2ba8cb510f7ed70a6fb93e1bc57d6a5da3bc89 Constify and move effect conversion back to where it was. diff -r ae2ba8cb510f -r f2fd1ad84829 tools/xm2jss.c --- a/tools/xm2jss.c Tue Aug 22 17:15:22 2017 +0300 +++ b/tools/xm2jss.c Tue Aug 22 20:55:53 2017 +0300 @@ -732,9 +732,10 @@ /* Scan given pattern for used instruments and channels. - * Also checks if the pattern is empty and convert certain effects. + * Also checks if the pattern is empty. */ -void scanPattern(JSSModule *module, JSSPattern *pattern, int npattern, BOOL *usedExtInstruments, BOOL *usedChannels, BOOL *empty) +void scanPattern(const JSSModule *module, const JSSPattern *pattern, + const int npattern, BOOL *usedExtInstruments, BOOL *usedChannels, BOOL *empty) { JSSNote *n = pattern->data; *empty = FALSE; @@ -743,8 +744,6 @@ for (int row = 0; row < pattern->nrows; row++) for (int channel = 0; channel < pattern->nchannels; channel++, n++) { - char effect; - // Is the instrument set? if (n->instrument != jsetNotSet) { @@ -768,20 +767,6 @@ usedChannels[channel] = TRUE; *empty = FALSE; } - - // Convert certain effects - JMPGETEFFECT(effect, n->effect); - switch (effect) - { - case 'C': // Cxx = Set volume - if (n->volume == jsetNotSet) - { - n->volume = n->param; - n->effect = jsetNotSet; - n->param = jsetNotSet; - } - break; - } } } @@ -1120,6 +1105,21 @@ n->instrument + 1); } } + + // Convert certain effects + char effect; + JMPGETEFFECT(effect, n->effect); + switch (effect) + { + case 'C': // Cxx = Set volume + if (n->volume == jsetNotSet) + { + n->volume = n->param; + n->effect = jsetNotSet; + n->param = jsetNotSet; + } + break; + } } }