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