Mercurial > hg > sidinfo
diff sidlib.c @ 230:1e860046a4cc
Cleanups.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 03 Jan 2020 13:11:29 +0200 |
parents | 1962b236d596 |
children | bb8ce494267b |
line wrap: on
line diff
--- a/sidlib.c Fri Jan 03 12:04:51 2020 +0200 +++ b/sidlib.c Fri Jan 03 13:11:29 2020 +0200 @@ -8,8 +8,8 @@ #include "th_string.h" -#define SIDLIB_DB_MAGIC "SIDLibDB" -#define SIDLIB_DB_VERSION 0x0100 +#define SIDLIB_DB_MAGIC "SIDLibDB" +#define SIDLIB_DB_VERSION 0x0100 typedef struct @@ -54,18 +54,18 @@ BOOL ret = FALSE, first = TRUE; size_t read; - if ((data = (uint8_t *) th_malloc(SIDLIB_PSID_BUFFER_SIZE)) == NULL) + if ((data = (uint8_t *) th_malloc(SIDLIB_BUFFER_SIZE)) == NULL) { th_io_error(ctx, THERR_MALLOC, "Error allocating temporary data buffer of %d bytes.\n", - SIDLIB_PSID_BUFFER_SIZE); + SIDLIB_BUFFER_SIZE); goto error; } psid->dataSize = 0; do { - read = thfread(data, sizeof(uint8_t), SIDLIB_PSID_BUFFER_SIZE, ctx); + read = thfread(data, sizeof(uint8_t), SIDLIB_BUFFER_SIZE, ctx); psid->dataSize += read; // If load address is 0 in header and we have the first block, grab it @@ -443,15 +443,15 @@ { char *line = NULL; - if ((line = th_malloc(SIDLIB_PSID_BUFFER_SIZE)) == NULL) + if ((line = th_malloc(SIDLIB_BUFFER_SIZE)) == NULL) { th_io_error(ctx, THERR_MALLOC, "Error allocating temporary data buffer of %d bytes.\n", - SIDLIB_PSID_BUFFER_SIZE); + SIDLIB_BUFFER_SIZE); return ctx->status; } - while (thfgets(line, SIDLIB_PSID_BUFFER_SIZE, ctx) != NULL) + while (thfgets(line, SIDLIB_BUFFER_SIZE, ctx) != NULL) { SIDLibSLDBNode *tmnode; size_t pos = 0;