Changes in uspace/lib/trackmod/xm.c [16bfcd3:b7fd2a0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/trackmod/xm.c
r16bfcd3 rb7fd2a0 53 53 * @return EOK on success, EIO on format error, ENOMEM if out of memory. 54 54 */ 55 static int trackmod_xm_load_order_list(xm_hdr_t *xm_hdr, trackmod_module_t *module)55 static errno_t trackmod_xm_load_order_list(xm_hdr_t *xm_hdr, trackmod_module_t *module) 56 56 { 57 int rc;57 errno_t rc; 58 58 size_t i; 59 59 … … 94 94 * @return EOK on success, EINVAL if there is error in the coded data. 95 95 */ 96 static int trackmod_xm_decode_pattern(uint8_t *data, size_t dsize,96 static errno_t trackmod_xm_decode_pattern(uint8_t *data, size_t dsize, 97 97 trackmod_pattern_t *pattern) 98 98 { … … 162 162 * @return EOK on success, EIO on format error, ENOMEM if out of memory. 163 163 */ 164 static int trackmod_xm_load_patterns(FILE *f, trackmod_module_t *module)164 static errno_t trackmod_xm_load_patterns(FILE *f, trackmod_module_t *module) 165 165 { 166 166 size_t i; … … 173 173 uint8_t *buf = NULL; 174 174 long seek_amount; 175 int rc; 175 errno_t rc; 176 int ret; 176 177 177 178 module->pattern = calloc(sizeof(trackmod_pattern_t), module->patterns); … … 182 183 183 184 for (i = 0; i < module->patterns; i++) { 184 r c= fread(&pattern, 1, sizeof(xm_pattern_t), f);185 if (r c!= sizeof(xm_pattern_t)) {185 ret = fread(&pattern, 1, sizeof(xm_pattern_t), f); 186 if (ret != sizeof(xm_pattern_t)) { 186 187 rc = EIO; 187 188 goto error; … … 280 281 * @return EOK on success, EIO on format error, ENOMEM if out of memory. 281 282 */ 282 static int trackmod_xm_load_instruments(xm_hdr_t *xm_hdr, FILE *f,283 static errno_t trackmod_xm_load_instruments(xm_hdr_t *xm_hdr, FILE *f, 283 284 trackmod_module_t *module) 284 285 { … … 296 297 void *smp_data; 297 298 long pos; 298 int rc; 299 errno_t rc; 300 int ret; 299 301 300 302 module->instrs = uint16_t_le2host(xm_hdr->instruments); … … 305 307 for (i = 0; i < module->instrs; i++) { 306 308 pos = ftell(f); 307 r c= fread(&instr, 1, sizeof(xm_instr_t), f);308 if (r c!= sizeof(xm_instr_t)) {309 ret = fread(&instr, 1, sizeof(xm_instr_t), f); 310 if (ret != sizeof(xm_instr_t)) { 309 311 rc = EIO; 310 312 goto error; … … 315 317 316 318 if (samples > 0) { 317 r c= fread(&instrx, 1, sizeof(xm_instr_ext_t), f);318 if (r c!= sizeof(xm_instr_ext_t)) {319 ret = fread(&instrx, 1, sizeof(xm_instr_ext_t), f); 320 if (ret != sizeof(xm_instr_ext_t)) { 319 321 rc = EIO; 320 322 goto error; … … 346 348 pos = ftell(f); 347 349 348 r c= fread(&smp, 1, sizeof(xm_smp_t), f);349 if (r c!= sizeof(xm_smp_t)) {350 ret = fread(&smp, 1, sizeof(xm_smp_t), f); 351 if (ret != sizeof(xm_smp_t)) { 350 352 rc = EIO; 351 353 goto error; … … 420 422 * or if any error is found in the format of the file. 421 423 */ 422 int trackmod_xm_load(char *fname, trackmod_module_t **rmodule)424 errno_t trackmod_xm_load(char *fname, trackmod_module_t **rmodule) 423 425 { 424 426 FILE *f = NULL; … … 427 429 size_t nread; 428 430 size_t hdr_size; 429 int rc;431 errno_t rc; 430 432 431 433 f = fopen(fname, "rb");
Note:
See TracChangeset
for help on using the changeset viewer.