From: Christophe CURIS <[email protected]>

This name is not modified by the callee functions (and it should
not be anyway), so let's make it official in the internal functions
---
 wrlib/imgformat.h |   14 +++++++-------
 wrlib/jpeg.c      |    2 +-
 wrlib/load.c      |    8 ++++----
 wrlib/nxpm.c      |    2 +-
 wrlib/png.c       |    2 +-
 wrlib/ppm.c       |    2 +-
 wrlib/save.c      |    2 +-
 wrlib/tiff.c      |    2 +-
 wrlib/wraster.h   |    6 +++---
 wrlib/xpm.c       |    4 ++--
 10 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/wrlib/imgformat.h b/wrlib/imgformat.h
index eee0f81..c7e4024 100644
--- a/wrlib/imgformat.h
+++ b/wrlib/imgformat.h
@@ -48,30 +48,30 @@ typedef enum {
 /*
  * Function for Loading in a specific format
  */
-RImage *RLoadPPM(char *file_name);
+RImage *RLoadPPM(const char *file);
 
-RImage *RLoadXPM(RContext *context, char *file);
+RImage *RLoadXPM(RContext *context, const char *file);
 
 #ifdef USE_TIFF
-RImage *RLoadTIFF(char *file, int index);
+RImage *RLoadTIFF(const char *file, int index);
 #endif
 
 #ifdef USE_PNG
-RImage *RLoadPNG(RContext *context, char *file);
+RImage *RLoadPNG(RContext *context, const char *file);
 #endif
 
 #ifdef USE_JPEG
-RImage *RLoadJPEG(RContext *context, char *file);
+RImage *RLoadJPEG(RContext *context, const char *file);
 #endif
 
 #ifdef USE_GIF
-RImage *RLoadGIF(char *file, int index);
+RImage *RLoadGIF(const char *file, int index);
 #endif
 
 /*
  * Function for Saving in a specific format
  */
-Bool RSaveXPM(RImage * image, char *filename);
+Bool RSaveXPM(RImage *image, const char *file);
 
 
 #endif
diff --git a/wrlib/jpeg.c b/wrlib/jpeg.c
index 2864277..2339f51 100644
--- a/wrlib/jpeg.c
+++ b/wrlib/jpeg.c
@@ -91,7 +91,7 @@ static void my_error_exit(j_common_ptr cinfo)
        longjmp(myerr->setjmp_buffer, 1);
 }
 
-RImage *RLoadJPEG(RContext * context, char *file_name)
+RImage *RLoadJPEG(RContext * context, const char *file_name)
 {
        RImage *image = NULL;
        struct jpeg_decompress_struct cinfo;
diff --git a/wrlib/load.c b/wrlib/load.c
index dc17c26..554e2b4 100644
--- a/wrlib/load.c
+++ b/wrlib/load.c
@@ -68,7 +68,7 @@ static int RImageCacheMaxImage = -1;  /* 0 = any size */
 static RCachedImage *RImageCache;
 
 
-static WRImgFormat identFile(char *path);
+static WRImgFormat identFile(const char *path);
 
 
 char **RSupportedFileFormats(void)
@@ -123,7 +123,7 @@ static void init_cache()
        }
 }
 
-RImage *RLoadImage(RContext * context, char *file, int index)
+RImage *RLoadImage(RContext * context, const char *file, int index)
 {
        RImage *image = NULL;
        int i;
@@ -238,7 +238,7 @@ RImage *RLoadImage(RContext * context, char *file, int 
index)
        return image;
 }
 
-char *RGetImageFileFormat(char *file)
+char *RGetImageFileFormat(const char *file)
 {
        switch (identFile(file)) {
        case IM_XPM:
@@ -272,7 +272,7 @@ char *RGetImageFileFormat(char *file)
        }
 }
 
-static WRImgFormat identFile(char *path)
+static WRImgFormat identFile(const char *path)
 {
        FILE *file;
        unsigned char buffer[32];
diff --git a/wrlib/nxpm.c b/wrlib/nxpm.c
index 5d9d270..0574fd9 100644
--- a/wrlib/nxpm.c
+++ b/wrlib/nxpm.c
@@ -551,7 +551,7 @@ static void freecolormap(XPMColor * colormap)
 }
 
 /* save routine is common to internal support and library support */
-Bool RSaveXPM(RImage * image, char *filename)
+Bool RSaveXPM(RImage * image, const char *filename)
 {
        FILE *file;
        int x, y;
diff --git a/wrlib/png.c b/wrlib/png.c
index 41736a9..fed178e 100644
--- a/wrlib/png.c
+++ b/wrlib/png.c
@@ -33,7 +33,7 @@
 #include "wraster.h"
 #include "imgformat.h"
 
-RImage *RLoadPNG(RContext * context, char *file)
+RImage *RLoadPNG(RContext *context, const char *file)
 {
        char *tmp;
        RImage *image = NULL;
diff --git a/wrlib/ppm.c b/wrlib/ppm.c
index c386363..63b7bcf 100644
--- a/wrlib/ppm.c
+++ b/wrlib/ppm.c
@@ -113,7 +113,7 @@ static RImage *load_pixmap(FILE * file, int w, int h, int 
max, int raw)
        return NULL;
 }
 
-RImage *RLoadPPM(char *file_name)
+RImage *RLoadPPM(const char *file_name)
 {
        FILE *file;
        RImage *image = NULL;
diff --git a/wrlib/save.c b/wrlib/save.c
index 949af1a..86a66c6 100644
--- a/wrlib/save.c
+++ b/wrlib/save.c
@@ -35,7 +35,7 @@
 #include "imgformat.h"
 
 
-Bool RSaveImage(RImage * image, char *filename, char *format)
+Bool RSaveImage(RImage * image, const char *filename, const char *format)
 {
        if (strcmp(format, "XPM") != 0) {
                RErrorCode = RERR_BADFORMAT;
diff --git a/wrlib/tiff.c b/wrlib/tiff.c
index 979cb5f..a54596d 100644
--- a/wrlib/tiff.c
+++ b/wrlib/tiff.c
@@ -34,7 +34,7 @@
 #include "wraster.h"
 #include "imgformat.h"
 
-RImage *RLoadTIFF(char *file, int index)
+RImage *RLoadTIFF(const char *file, int index)
 {
        RImage *image = NULL;
        TIFF *tif;
diff --git a/wrlib/wraster.h b/wrlib/wraster.h
index 40f031b..8a144e2 100644
--- a/wrlib/wraster.h
+++ b/wrlib/wraster.h
@@ -298,7 +298,7 @@ enum {
 char **RSupportedFileFormats(void);
 
 
-char *RGetImageFileFormat(char *file);
+char *RGetImageFileFormat(const char *file);
 
 /*
  * Xlib contexts
@@ -320,7 +320,7 @@ RImage *RCreateImageFromXImage(RContext *context, XImage 
*image, XImage *mask);
 RImage *RCreateImageFromDrawable(RContext *context, Drawable drawable,
                                  Pixmap mask);
 
-RImage *RLoadImage(RContext *context, char *file, int index);
+RImage *RLoadImage(RContext *context, const char *file, int index);
 
 RImage* RRetainImage(RImage *image);
 
@@ -331,7 +331,7 @@ RImage *RGetImageFromXPMData(RContext *context, char 
**xpmData);
 /*
  * RImage storing
  */
-Bool RSaveImage(RImage *image, char *filename, char *format);
+Bool RSaveImage(RImage *image, const char *filename, const char *format);
 
 /*
  * Area manipulation
diff --git a/wrlib/xpm.c b/wrlib/xpm.c
index 04307e3..12aadc6 100644
--- a/wrlib/xpm.c
+++ b/wrlib/xpm.c
@@ -153,7 +153,7 @@ RImage *RGetImageFromXPMData(RContext * context, char 
**xpmData)
        return image;
 }
 
-RImage *RLoadXPM(RContext * context, char *file)
+RImage *RLoadXPM(RContext * context, const char *file)
 {
        Display *dpy = context->dpy;
        Colormap cmap = context->cmap;
@@ -164,7 +164,7 @@ RImage *RLoadXPM(RContext * context, char *file)
        int *p;
        int i;
 
-       i = XpmReadFileToXpmImage(file, &xpm, (XpmInfo *) NULL);
+       i = XpmReadFileToXpmImage((char *)file, &xpm, (XpmInfo *) NULL);
        if (i != XpmSuccess) {
                switch (i) {
                case XpmOpenFailed:
-- 
1.7.10.4


-- 
To unsubscribe, send mail to [email protected].

Reply via email to