Mercurial > hg > dmlib
changeset 866:49fc8d8a0b9c
Re-do some portability things.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 08 Jan 2015 03:41:35 +0200 |
parents | fc5bd0ccc260 |
children | 56e12109b936 |
files | tests/fptest.c tools/data2inc.c |
diffstat | 2 files changed, 17 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/fptest.c Mon Jan 05 23:10:49 2015 +0200 +++ b/tests/fptest.c Thu Jan 08 03:41:35 2015 +0200 @@ -39,9 +39,9 @@ "SDL byte order = %s (%d)\n\n", s, SDL_BYTEORDER); printf( - "sizeof(DMFixedPoint) = %zd bytes\n" - "sizeof(DMFixedPoint.dw) = %zd bytes (should be %d)\n" - "sizeof(DMFixedPoint.w[0]) = %zd bytes (should be %d)\n", + "sizeof(DMFixedPoint) = %" PRId64 " bytes\n" + "sizeof(DMFixedPoint.dw) = %" PRId64 " bytes (should be %d)\n" + "sizeof(DMFixedPoint.w[0]) = %" PRId64 " bytes (should be %d)\n", sizeof(a), sizeof(a.dw), FP_DW_SIZE, sizeof(a.w[0]), FP_W0_SIZE);
--- a/tools/data2inc.c Mon Jan 05 23:10:49 2015 +0200 +++ b/tools/data2inc.c Thu Jan 08 03:41:35 2015 +0200 @@ -34,9 +34,9 @@ void (*writeHeader) (FILE *, char *) = NULL; -void (*writeDecl) (FILE *, size_t, char *) = NULL; -void (*writeData) (FILE *, Uint8 *, size_t) = NULL; -void (*writeFooter) (FILE *, size_t, char *) = NULL; +void (*writeDecl) (FILE *, unsigned int, char *) = NULL; +void (*writeData) (FILE *, Uint8 *, unsigned int) = NULL; +void (*writeFooter) (FILE *, unsigned int, char *) = NULL; static const DMOptArg optList[] = @@ -153,16 +153,16 @@ dmProgName, dmProgVersion); } -void writeDecl_ASM(FILE * f, size_t len, char *name) +void writeDecl_ASM(FILE * f, unsigned int len, char *name) { if (optExtraData) - fprintf(f, "%s_size = %zu\n", name, len); + fprintf(f, "%s_size = %u\n", name, len); fprintf(f, "%s:\n", name); } -void writeData_ASM(FILE * f, Uint8 * buf, size_t len) +void writeData_ASM(FILE * f, Uint8 * buf, unsigned int len) { - size_t i; + unsigned int i; fprintf(f, "%s ", optDataType); for (i = 0; i < len; i++) @@ -187,7 +187,7 @@ } } -void writeFooter_ASM(FILE * f, size_t len, char *name) +void writeFooter_ASM(FILE * f, unsigned int len, char *name) { (void) len; if (optExtraData) @@ -210,18 +210,18 @@ dmProgName, dmProgVersion); } -void writeDecl_C(FILE * f, size_t len, char *name) +void writeDecl_C(FILE * f, unsigned int len, char *name) { - fprintf(f, "%s %s[%zu] = {\n", + fprintf(f, "%s %s[%u] = {\n", optDataType, name, len); - printf("extern %s %s[%zu];\n", + printf("extern %s %s[%u];\n", optDataType, name, len); } -void writeData_C(FILE * f, Uint8 * buf, size_t len) +void writeData_C(FILE * f, Uint8 * buf, unsigned int len) { - size_t i; + unsigned int i; for (i = 0; i < len; i++) { @@ -244,7 +244,7 @@ } } -void writeFooter_C(FILE * f, size_t len, char *name) +void writeFooter_C(FILE * f, unsigned int len, char *name) { (void) len; (void) name;