Mercurial > hg > dmlib
comparison minijss/jloadjss.c @ 1129:e466d10dae6d
Change API of jssDecodeSample{8,16}() functions to return dmlib error codes
instead of plain boolean value. Change some of the relevant places to use
this return value.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 04 Mar 2015 06:31:54 +0200 |
parents | e22d4ceb6414 |
children | aa3738b121d1 |
comparison
equal
deleted
inserted
replaced
1128:0194c8a26aa8 | 1129:e466d10dae6d |
---|---|
483 { | 483 { |
484 JSSInstrument *inst = module->instruments[index]; | 484 JSSInstrument *inst = module->instruments[index]; |
485 | 485 |
486 if (inst && inst->hasData) | 486 if (inst && inst->hasData) |
487 { | 487 { |
488 int ret; | |
488 size_t sz; | 489 size_t sz; |
489 | 490 |
490 // Calculate data size | 491 // Calculate data size |
491 if (inst->flags & jsf16bit) | 492 if (inst->flags & jsf16bit) |
492 sz = inst->size * sizeof(Uint16); | 493 sz = inst->size * sizeof(Uint16); |
507 "Could not read sample data for #%d\n", index); | 508 "Could not read sample data for #%d\n", index); |
508 } | 509 } |
509 | 510 |
510 // Convert, if needed | 511 // Convert, if needed |
511 if (inst->flags & jsf16bit) | 512 if (inst->flags & jsf16bit) |
512 jssDecodeSample16(inst->data, inst->size, inst->convFlags); | 513 ret = jssDecodeSample16(inst->data, inst->size, inst->convFlags); |
513 else | 514 else |
514 jssDecodeSample8(inst->data, inst->size, inst->convFlags); | 515 ret = jssDecodeSample8(inst->data, inst->size, inst->convFlags); |
516 | |
517 if (ret != DMERR_OK) | |
518 { | |
519 JSSERROR(ret, ret, | |
520 "Failed to decode sample data for #%d\n", index); | |
521 } | |
515 } | 522 } |
516 } | 523 } |
517 #else | 524 #else |
518 # warning Not including JSSMOD sample loading! | 525 # warning Not including JSSMOD sample loading! |
519 #endif // JM_SUP_SAMPLES | 526 #endif // JM_SUP_SAMPLES |