# HG changeset patch # User Matti Hamalainen # Date 1425564122 -7200 # Node ID 0ee6ba7b3e4a1aaf72267711391d59b9a59cef97 # Parent aa6c3af36008d4d5bf1f3826e9e308b06b5daa99 Rename variables. diff -r aa6c3af36008 -r 0ee6ba7b3e4a minijss/jloadjss.c --- a/minijss/jloadjss.c Thu Mar 05 15:58:52 2015 +0200 +++ b/minijss/jloadjss.c Thu Mar 05 16:02:02 2015 +0200 @@ -27,30 +27,30 @@ #if defined(JM_SUP_PATMODE_1) || defined(JM_SUP_PATMODE_3) -static int jssGetConvertedNote(DMResource *inFile, JSSNote *note) +static int jssGetConvertedNote(DMResource *inFile, JSSNote *pnote) { Uint8 tmp; JSGETBYTE(&tmp); if (tmp == 127) - note->note = jsetNoteOff; + pnote->note = jsetNoteOff; else if (tmp == 0) - note->note = jsetNotSet; + pnote->note = jsetNotSet; else - note->note = tmp - 1; + pnote->note = tmp - 1; JSGETBYTE(&tmp); - note->instrument = (tmp > 0) ? tmp - 1 : jsetNotSet; + pnote->instrument = (tmp > 0) ? tmp - 1 : jsetNotSet; JSGETBYTE(&tmp); - note->volume = (tmp > 0) ? tmp - 1 : jsetNotSet; + pnote->volume = (tmp > 0) ? tmp - 1 : jsetNotSet; JSGETBYTE(&tmp); - note->effect = (tmp > 0) ? tmp - 1 : jsetNotSet; + pnote->effect = (tmp > 0) ? tmp - 1 : jsetNotSet; JSGETBYTE(&tmp); - note->param = (tmp == 0 && note->effect == jsetNotSet) ? jsetNotSet : tmp; + pnote->param = (tmp == 0 && pnote->effect == jsetNotSet) ? jsetNotSet : tmp; return DMERR_OK; } @@ -58,7 +58,7 @@ #if defined(JM_SUP_PATMODE_2) || defined(JM_SUP_PATMODE_4) -static int jssGetCompressedNote(DMResource *inFile, JSSNote *note) +static int jssGetCompressedNote(DMResource *inFile, JSSNote *pnote) { Uint8 packb, tmp; @@ -69,34 +69,34 @@ { JSGETBYTE(&tmp); if (tmp == 127) - note->note = jsetNoteOff; + pnote->note = jsetNoteOff; else - note->note = tmp; + pnote->note = tmp; } if (packb & COMP_INSTRUMENT) { JSGETBYTE(&tmp); - note->instrument = tmp; + pnote->instrument = tmp; } if (packb & COMP_VOLUME) { JSGETBYTE(&tmp); - note->volume = tmp; + pnote->volume = tmp; } if (packb & COMP_EFFECT) { JSGETBYTE(&tmp); - note->effect = tmp; - note->param = 0; + pnote->effect = tmp; + pnote->param = 0; } if (packb & COMP_PARAM) { JSGETBYTE(&tmp); - note->param = tmp; + pnote->param = tmp; } } else @@ -104,24 +104,24 @@ tmp = packb; if (tmp == 127) - note->note = jsetNoteOff; + pnote->note = jsetNoteOff; else if (tmp == 0) - note->note = jsetNotSet; + pnote->note = jsetNotSet; else - note->note = tmp - 1; + pnote->note = tmp - 1; JSGETBYTE(&tmp); - note->instrument = (tmp > 0) ? tmp - 1 : jsetNotSet; + pnote->instrument = (tmp > 0) ? tmp - 1 : jsetNotSet; JSGETBYTE(&tmp); - note->volume = (tmp > 0) ? tmp - 1 : jsetNotSet; + pnote->volume = (tmp > 0) ? tmp - 1 : jsetNotSet; JSGETBYTE(&tmp); - note->effect = (tmp > 0) ? tmp - 1 : jsetNotSet; + pnote->effect = (tmp > 0) ? tmp - 1 : jsetNotSet; JSGETBYTE(&tmp); - note->param = (tmp == 0 && note->effect == jsetNotSet) ? jsetNotSet : tmp; + pnote->param = (tmp == 0 && pnote->effect == jsetNotSet) ? jsetNotSet : tmp; } return DMERR_OK; @@ -140,10 +140,11 @@ for (row = 0; row < pattern->nrows; row++) for (channel = 0; channel < pattern->nchannels; channel++) { - JSSNote *note = &pattern->data[(pattern->nchannels * row) + channel]; - int res = jssGetCompressedNote(inFile, note); + JSSNote *pnote = &pattern->data[(pattern->nchannels * row) + channel]; + int res = jssGetCompressedNote(inFile, pnote); if (res != DMERR_OK) - JSSERROR(res, res, "Error uncompressing note on row=%d, chn=%d\n", row, channel); + JSSERROR(res, res, "Error uncompressing note on row=%d, chn=%d\n", + row, channel); } return DMERR_OK; @@ -162,10 +163,11 @@ for (channel = 0; channel < pattern->nchannels; channel++) for (row = 0; row < pattern->nrows; row++) { - JSSNote *note = &pattern->data[(pattern->nchannels * row) + channel]; - int res = jssGetCompressedNote(inFile, note); + JSSNote *pnote = &pattern->data[(pattern->nchannels * row) + channel]; + int res = jssGetCompressedNote(inFile, pnote); if (res != DMERR_OK) - JSSERROR(res, res, "Error uncompressing note on row=%d, chn=%d\n", row, channel); + JSSERROR(res, res, "Error uncompressing note on row=%d, chn=%d\n", + row, channel); } return DMERR_OK; @@ -184,10 +186,11 @@ for (row = 0; row < pattern->nrows; row++) for (channel = 0; channel < pattern->nchannels; channel++) { - JSSNote *note = &pattern->data[(pattern->nchannels * row) + channel]; - int res = jssGetConvertedNote(inFile, note); + JSSNote *pnote = &pattern->data[(pattern->nchannels * row) + channel]; + int res = jssGetConvertedNote(inFile, pnote); if (res != DMERR_OK) - JSSERROR(res, res, "Error converting note on row=%d, chn=%d\n", row, channel); + JSSERROR(res, res, "Error converting note on row=%d, chn=%d\n", + row, channel); } return DMERR_OK; @@ -206,10 +209,11 @@ for (channel = 0; channel < pattern->nchannels; channel++) for (row = 0; row < pattern->nrows; row++) { - JSSNote *note = &pattern->data[(pattern->nchannels * row) + channel]; - int res = jssGetConvertedNote(inFile, note); + JSSNote *pnote = &pattern->data[(pattern->nchannels * row) + channel]; + int res = jssGetConvertedNote(inFile, pnote); if (res != DMERR_OK) - JSSERROR(res, res, "Error converting note on row=%d, chn=%d\n", row, channel); + JSSERROR(res, res, "Error converting note on row=%d, chn=%d\n", + row, channel); } return DMERR_OK; @@ -225,7 +229,7 @@ #define JSFOREACHNOTE1 \ for (channel = 0; channel < pattern->nchannels; channel++) \ for (row = 0; row < pattern->nrows; row++) { \ - JSSNote *note = pattern->data + (pattern->nchannels * row) + channel; + JSSNote *pnote = pattern->data + (pattern->nchannels * row) + channel; #define JSFOREACHNOTE2 } @@ -240,31 +244,31 @@ JSFOREACHNOTE1 JSGETBYTE(&tmp); if (tmp == 0) - note->note = jsetNotSet; + pnote->note = jsetNotSet; else if (tmp == 127) - note->note = jsetNoteOff; + pnote->note = jsetNoteOff; else - note->note = tmp - 1; + pnote->note = tmp - 1; JSFOREACHNOTE2 JSFOREACHNOTE1 JSGETBYTE(&tmp); - note->instrument = (tmp > 0) ? tmp - 1 : jsetNotSet; + pnote->instrument = (tmp > 0) ? tmp - 1 : jsetNotSet; JSFOREACHNOTE2 JSFOREACHNOTE1 JSGETBYTE(&tmp); - note->volume = (tmp > 0) ? tmp - 1 : jsetNotSet; + pnote->volume = (tmp > 0) ? tmp - 1 : jsetNotSet; JSFOREACHNOTE2 JSFOREACHNOTE1 JSGETBYTE(&tmp); - note->effect = (tmp > 0) ? tmp - 1 : jsetNotSet; + pnote->effect = (tmp > 0) ? tmp - 1 : jsetNotSet; JSFOREACHNOTE2 JSFOREACHNOTE1 JSGETBYTE(&tmp); - note->param = (tmp == 0 && note->effect == jsetNotSet) ? jsetNotSet : tmp; + pnote->param = (tmp == 0 && pnote->effect == jsetNotSet) ? jsetNotSet : tmp; JSFOREACHNOTE2 return DMERR_OK;