From 09b41bcb00ad0bafed3179893fe874c9f239d0ad Mon Sep 17 00:00:00 2001 From: pjrm Date: Sun, 4 May 2008 12:26:23 +0000 Subject: [PATCH] Address string-literal-to-char* warning: Make gm_read_error global var point to const char. --- src/trace/potrace/greymap.cpp | 10 +++++----- src/trace/potrace/greymap.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/trace/potrace/greymap.cpp b/src/trace/potrace/greymap.cpp index 53c703aa4..646ecc3a5 100644 --- a/src/trace/potrace/greymap.cpp +++ b/src/trace/potrace/greymap.cpp @@ -161,16 +161,16 @@ static int readbit(FILE *f) { /* ---------------------------------------------------------------------- */ -/* read a PNM stream: P1-P6 format (see pnm(5)), or a BMP stream, and +char const *gm_read_error = NULL; + +/** Read a PNM stream: P1-P6 format (see pnm(5)), or a BMP stream, and convert the output to a greymap. Return greymap in *gmp. Return 0 on success, -1 on error with errno set, -2 on bad file format (with error message in gm_read_error), and 1 on premature end of file, -3 on empty file (including files with only whitespace and comments), -4 if wrong magic number. If the return value is >=0, *gmp is - valid. */ - -char *gm_read_error = NULL; - + valid. + */ int gm_read(FILE *f, greymap_t **gmp) { int magic[2]; diff --git a/src/trace/potrace/greymap.h b/src/trace/potrace/greymap.h index 05e01667d..059fec4e4 100644 --- a/src/trace/potrace/greymap.h +++ b/src/trace/potrace/greymap.h @@ -45,7 +45,7 @@ typedef struct greymap_s greymap_t; #define GM_MODE_POSITIVE 3 #define GM_MODE_NEGATIVE 4 -extern char *gm_read_error; +extern char const *gm_read_error; greymap_t *gm_new(int w, int h); greymap_t *gm_dup(greymap_t *gm); -- 2.30.2