comparison tools/xm2jss.c @ 1194:1f2cfa0119aa

Cosmetics.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 05 Mar 2015 15:58:12 +0200
parents 848a88ce7a57
children 4d27c4ec8d4d
comparison
equal deleted inserted replaced
1193:b52905e2788e 1194:1f2cfa0119aa
193 static int jssConvertNote(Uint8 *patBuf, const size_t patBufSize, size_t *patSize, const JSSNote *note) 193 static int jssConvertNote(Uint8 *patBuf, const size_t patBufSize, size_t *patSize, const JSSNote *note)
194 { 194 {
195 Uint8 tmp; 195 Uint8 tmp;
196 if (note->note == jsetNotSet) 196 if (note->note == jsetNotSet)
197 tmp = 0; 197 tmp = 0;
198 else if (note->note == jsetNoteOff) 198 else
199 if (note->note == jsetNoteOff)
199 tmp = 127; 200 tmp = 127;
200 else 201 else
201 tmp = note->note + 1; 202 tmp = note->note + 1;
202 203
203 if (tmp > 0x7f) 204 if (tmp > 0x7f)
362 *patSize = 0; 363 *patSize = 0;
363 364
364 JSFOREACHNOTE1; 365 JSFOREACHNOTE1;
365 if (note->note == jsetNotSet) 366 if (note->note == jsetNotSet)
366 tmp = 0; 367 tmp = 0;
367 else if (note->note == jsetNoteOff) 368 else
369 if (note->note == jsetNoteOff)
368 tmp = 127; 370 tmp = 127;
369 else 371 else
370 tmp = note->note + 1; 372 tmp = note->note + 1;
373
371 if (tmp > 0x7f) 374 if (tmp > 0x7f)
372 JSSERROR(DMERR_BOUNDS, DMERR_BOUNDS, "Note value out of bounds %d > 0x7f.\n", tmp); 375 JSSERROR(DMERR_BOUNDS, DMERR_BOUNDS, "Note value out of bounds %d > 0x7f.\n", tmp);
376
373 JSPUTBYTE(tmp); 377 JSPUTBYTE(tmp);
374 JSFOREACHNOTE2; 378 JSFOREACHNOTE2;
375 379
376 JSFOREACHNOTE1; 380 JSFOREACHNOTE1;
377 JSCONVPUT(note->instrument, "Instrument"); 381 JSCONVPUT(note->instrument, "Instrument");
426 430
427 // Check the module 431 // Check the module
428 if (m == NULL) 432 if (m == NULL)
429 JSSERROR(DMERR_NULLPTR, DMERR_NULLPTR, "Module pointer was NULL\n"); 433 JSSERROR(DMERR_NULLPTR, DMERR_NULLPTR, "Module pointer was NULL\n");
430 434
431 if ((m->nchannels < 1) || (m->npatterns < 1) || (m->norders < 1)) 435 if (m->nchannels < 1 || m->npatterns < 1 || m->norders < 1)
432 JSSERROR(DMERR_BOUNDS, DMERR_BOUNDS, 436 JSSERROR(DMERR_BOUNDS, DMERR_BOUNDS,
433 "Module had invalid values (nchannels=%i, npatterns=%i, norders=%i)\n", 437 "Module had invalid values (nchannels=%i, npatterns=%i, norders=%i)\n",
434 m->nchannels, m->npatterns, m->norders); 438 m->nchannels, m->npatterns, m->norders);
435 439
436 // Create the JSSMOD header 440 // Create the JSSMOD header