# HG changeset patch # User Matti Hamalainen # Date 1367627157 -10800 # Node ID fe5910d6df829b6fc6b01a037ab6aa641638e30a # Parent ab645f4cb8faeb0fd0485036778946fd71ef55ab# Parent b136ddc4070bb047dec2dbd93dd18b7b71e2e8a5 Merged. diff -r ab645f4cb8fa -r fe5910d6df82 minijss/jssmod.c --- a/minijss/jssmod.c Sat May 04 03:25:51 2013 +0300 +++ b/minijss/jssmod.c Sat May 04 03:25:57 2013 +0300 @@ -99,7 +99,8 @@ { p = *sdata; t = ((p >> 8) & 0xff) | ((p & 0xff) << 8); - } else + } + else t = *sdata; if (ops & jsampDelta) @@ -182,7 +183,8 @@ { p = *sdata; t = ((p >> 8) & 0xff) | ((p & 0xff) << 8); - } else + } + else t = *sdata; if (ops & jsampDelta) @@ -218,6 +220,7 @@ return DMERR_OK; } + /* Converts the given module in preparation for playing it. * This involves sample format conversion (8 to 16 bit, etc.) * @@ -304,7 +307,7 @@ // Free patterns for (i = 0; i < module->npatterns; i++) { - if (module->patterns[i]) + if (module->patterns[i] != NULL) { JSSPattern *pat = module->patterns[i]; dmFree(pat->data); @@ -325,7 +328,7 @@ // Free instruments for (i = 0; i < module->ninstruments; i++) { - if (module->instruments[i]) + if (module->instruments[i] != NULL) { JSSInstrument *inst = module->instruments[i]; #ifndef JSS_LIGHT @@ -340,7 +343,7 @@ // Free extended instruments for (i = 0; i < module->nextInstruments; i++) { - if (module->extInstruments[i]) + if (module->extInstruments[i] != NULL) { JSSExtInstrument *ext = module->extInstruments[i]; #ifndef JSS_LIGHT @@ -366,9 +369,9 @@ /* Allocates and initializes a internal pattern structure. */ -JSSPattern *jssAllocatePattern(int nrows, int nchannels) +JSSPattern *jssAllocatePattern(const int nrows, const int nchannels) { - int i, j; + int row, chn; JSSPattern *res; JSSNote *pnote; @@ -395,9 +398,9 @@ res->nchannels = nchannels; pnote = res->data; - for (j = 0; j < nrows; j++) + for (row = 0; row < nrows; row++) { - for (i = 0; i < nchannels; i++) + for (chn = 0; chn < nchannels; chn++) { pnote->note = pnote->instrument = pnote->volume = pnote->effect = pnote->param = jsetNotSet; diff -r ab645f4cb8fa -r fe5910d6df82 minijss/jssmod.h --- a/minijss/jssmod.h Sat May 04 03:25:51 2013 +0300 +++ b/minijss/jssmod.h Sat May 04 03:25:57 2013 +0300 @@ -296,7 +296,7 @@ int jssConvertModuleForPlaying(JSSModule *module); JSSModule * jssAllocateModule(void); int jssFreeModule(JSSModule *); -JSSPattern * jssAllocatePattern(int, int); +JSSPattern * jssAllocatePattern(const int, const int); JSSInstrument * jssAllocateInstrument(void); JSSExtInstrument * jssAllocateExtInstrument(void);