changeset 1301:e03f20d0f785

Constify.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 19 Aug 2017 04:25:02 +0300
parents fd442faa705f
children 38614c07c2e2
files src/libgfx.c src/libgfx.h
diffstat 2 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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;
--- 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);