# HG changeset patch # User Matti Hamalainen # Date 1425563892 -7200 # Node ID 1f2cfa0119aa2a12fe85c7f619d60c681b8e7f59 # Parent b52905e2788ebcfb339b7d5d1f05b6e2d5eae35c Cosmetics. diff -r b52905e2788e -r 1f2cfa0119aa tools/xm2jss.c --- a/tools/xm2jss.c Thu Mar 05 15:48:33 2015 +0200 +++ b/tools/xm2jss.c Thu Mar 05 15:58:12 2015 +0200 @@ -195,7 +195,8 @@ Uint8 tmp; if (note->note == jsetNotSet) tmp = 0; - else if (note->note == jsetNoteOff) + else + if (note->note == jsetNoteOff) tmp = 127; else tmp = note->note + 1; @@ -364,12 +365,15 @@ JSFOREACHNOTE1; if (note->note == jsetNotSet) tmp = 0; - else if (note->note == jsetNoteOff) + else + if (note->note == jsetNoteOff) tmp = 127; else tmp = note->note + 1; + if (tmp > 0x7f) JSSERROR(DMERR_BOUNDS, DMERR_BOUNDS, "Note value out of bounds %d > 0x7f.\n", tmp); + JSPUTBYTE(tmp); JSFOREACHNOTE2; @@ -428,7 +432,7 @@ if (m == NULL) JSSERROR(DMERR_NULLPTR, DMERR_NULLPTR, "Module pointer was NULL\n"); - if ((m->nchannels < 1) || (m->npatterns < 1) || (m->norders < 1)) + if (m->nchannels < 1 || m->npatterns < 1 || m->norders < 1) JSSERROR(DMERR_BOUNDS, DMERR_BOUNDS, "Module had invalid values (nchannels=%i, npatterns=%i, norders=%i)\n", m->nchannels, m->npatterns, m->norders);