# HG changeset patch # User Matti Hamalainen # Date 1503105902 -10800 # Node ID e03f20d0f7859b369217add82ee91fdcc3bc97af # Parent fd442faa705fd6453208a6e7b8c3ceed7f789ebf Constify. diff -r fd442faa705f -r e03f20d0f785 src/libgfx.c --- a/src/libgfx.c Sat Aug 19 03:57:15 2017 +0300 +++ b/src/libgfx.c Sat Aug 19 04:25:02 2017 +0300 @@ -133,7 +133,7 @@ } -int dmWriteImageData(DMImage *img, void *cbdata, int (*writeRowCB)(void *, Uint8 *, size_t), const DMImageConvSpec *spec) +int dmWriteImageData(DMImage *img, void *cbdata, int (*writeRowCB)(void *, const Uint8 *, const size_t), const DMImageConvSpec *spec) { int x, y, yscale, xscale, res = 0, rowSize, rowWidth; Uint8 *row = NULL; @@ -329,7 +329,7 @@ } -static int dmWritePPMRow(void *cbdata, Uint8 *row, size_t len) +static int dmWritePPMRow(void *cbdata, const Uint8 *row, const size_t len) { if (fwrite(row, sizeof(Uint8), len, (FILE *) cbdata) == len) return DMERR_OK; @@ -376,7 +376,7 @@ #ifdef DM_USE_LIBPNG -static int dmWritePNGRow(void *cbdata, Uint8 *row, size_t len) +static int dmWritePNGRow(void *cbdata, const Uint8 *row, const size_t len) { png_structp png_ptr = cbdata; (void) len; @@ -749,7 +749,7 @@ // Returns one byte from row buffer (of length len) at offset soffs, // OR zero if the offset is outside buffer. -static inline Uint8 dmPCXGetByte(Uint8 *row, const size_t len, const size_t soffs) +static inline Uint8 dmPCXGetByte(const Uint8 *row, const size_t len, const size_t soffs) { return (soffs < len) ? row[soffs] : 0; } @@ -793,7 +793,7 @@ } -static int dmWritePCXRow(void *cbdata, Uint8 *row, size_t len) +static int dmWritePCXRow(void *cbdata, const Uint8 *row, const size_t len) { DMPCXData *pcx = (DMPCXData *) cbdata; int err; diff -r fd442faa705f -r e03f20d0f785 src/libgfx.h --- a/src/libgfx.h Sat Aug 19 03:57:15 2017 +0300 +++ b/src/libgfx.h Sat Aug 19 04:25:02 2017 +0300 @@ -104,7 +104,7 @@ BOOL dmCompareColor(const DMColor *c1, const DMColor *c2, BOOL alpha); -int dmWriteImageData(DMImage *img, void *cbdata, int (*writeRowCB)(void *, Uint8 *, size_t), const DMImageConvSpec *spec); +int dmWriteImageData(DMImage *img, void *cbdata, int (*writeRowCB)(void *, const Uint8 *, const size_t), const DMImageConvSpec *spec); int dmWriteIFFMasterRAWPalette(FILE *fp, DMImage *img, int ncolors, const char *indent, const char *type); int dmWriteRAWImageFILE(FILE *fp, DMImage *img, const DMImageConvSpec *spec);