Mercurial > hg > batmud > maputils
changeset 1762:a35b392a40ce
Use uint8_t instead of unsigned char.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 21 Oct 2017 11:47:00 +0300 |
parents | cf0369e8aeff |
children | 253a1fd1fc82 |
files | map2ppm.c |
diffstat | 1 files changed, 7 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/map2ppm.c Fri Oct 20 19:27:42 2017 +0300 +++ b/map2ppm.c Sat Oct 21 11:47:00 2017 +0300 @@ -143,10 +143,10 @@ } -int writeImageData(MapBlock *map, void *cbdata, BOOL (*writeRowCB)(void *, unsigned char *, size_t), int scale) +int writeImageData(MapBlock *map, void *cbdata, BOOL (*writeRowCB)(void *, uint8_t *, size_t), int scale) { int x, y, yscale, xscale, res = 0; - unsigned char *row = NULL; + uint8_t *row = NULL; /* Allocate memory for row buffer */ if ((row = th_malloc(map->width * 3 * scale + 16)) == NULL) @@ -157,13 +157,13 @@ for (y = 0; y < map->height; y++) { - unsigned char *ptr = row; + uint8_t *ptr = row; for (x = 0; x < map->width; x++) { int qr, qg, qb, c; qr = 255; qg = qb = 0; - c = (unsigned char) map->data[(y * map->scansize) + x]; + c = (uint8_t) map->data[(y * map->scansize) + x]; if (optInputIsDiff) { @@ -226,9 +226,9 @@ } -BOOL writePPMRow(void *cbdata, unsigned char *row, size_t len) +BOOL writePPMRow(void *cbdata, uint8_t *row, size_t len) { - return fwrite(row, sizeof(unsigned char), len, (FILE *) cbdata) == len; + return fwrite(row, sizeof(uint8_t), len, (FILE *) cbdata) == len; } @@ -245,7 +245,7 @@ #ifdef HAVE_LIBPNG -BOOL writePNGRow(void *cbdata, unsigned char *row, size_t len) +BOOL writePNGRow(void *cbdata, uint8_t *row, size_t len) { png_structp png_ptr = cbdata; (void) len;