summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authornijtmans <nijtmans>2008-11-05 22:48:58 (GMT)
committernijtmans <nijtmans>2008-11-05 22:48:58 (GMT)
commit2d48ae8ff78acce1c21210e9e27220ad5e22e877 (patch)
tree01bfd4c701cdce4cf358e8bbc735ae929b1ab2f0 /generic
parent436906415b673fbac6d7ce14621ad07a9a78b4a2 (diff)
downloadtk-2d48ae8ff78acce1c21210e9e27220ad5e22e877.zip
tk-2d48ae8ff78acce1c21210e9e27220ad5e22e877.tar.gz
tk-2d48ae8ff78acce1c21210e9e27220ad5e22e877.tar.bz2
CONSTify string and fileName parameters of TkGetBitmapData
more internal -Wwrite-string warning fixes
Diffstat (limited to 'generic')
-rw-r--r--generic/tkBitmap.c4
-rw-r--r--generic/tkImgBmap.c41
-rw-r--r--generic/tkInt.decls7
-rw-r--r--generic/tkIntDecls.h12
4 files changed, 33 insertions, 31 deletions
diff --git a/generic/tkBitmap.c b/generic/tkBitmap.c
index 8449e2f..bdbde01 100644
--- a/generic/tkBitmap.c
+++ b/generic/tkBitmap.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkBitmap.c,v 1.22 2008/10/15 06:41:06 nijtmans Exp $
+ * RCS: @(#) $Id: tkBitmap.c,v 1.23 2008/11/05 22:48:58 nijtmans Exp $
*/
#include "tkInt.h"
@@ -1091,7 +1091,7 @@ TkReadBitmapFile(
{
char *data;
- data = TkGetBitmapData(NULL, NULL, (char *) filename,
+ data = TkGetBitmapData(NULL, NULL, filename,
(int *) width_return, (int *) height_return, x_hot_return,
y_hot_return);
if (data == NULL) {
diff --git a/generic/tkImgBmap.c b/generic/tkImgBmap.c
index 395b5a6..3fc7561 100644
--- a/generic/tkImgBmap.c
+++ b/generic/tkImgBmap.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkImgBmap.c,v 1.25 2008/10/17 23:18:37 nijtmans Exp $
+ * RCS: @(#) $Id: tkImgBmap.c,v 1.26 2008/11/05 22:48:58 nijtmans Exp $
*/
#include "tkInt.h"
@@ -131,7 +131,7 @@ static Tk_ConfigSpec configSpecs[] = {
#define MAX_WORD_LENGTH 100
typedef struct ParseInfo {
- char *string; /* Next character of string data for bitmap,
+ const char *string; /* Next character of string data for bitmap,
* or NULL if bitmap is being read from
* file. */
Tcl_Channel chan; /* File containing bitmap data, or NULL if no
@@ -153,7 +153,7 @@ static void ImgBmapConfigureInstance(BitmapInstance *instancePtr);
static int ImgBmapConfigureMaster(BitmapMaster *masterPtr,
int argc, Tcl_Obj *const objv[], int flags);
static int NextBitmapWord(ParseInfo *parseInfoPtr);
-
+
/*
*----------------------------------------------------------------------
*
@@ -209,7 +209,7 @@ ImgBmapCreate(
*clientDataPtr = masterPtr;
return TCL_OK;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -313,7 +313,7 @@ ImgBmapConfigureMaster(
masterPtr->height, masterPtr->width, masterPtr->height);
return TCL_OK;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -448,7 +448,7 @@ ImgBmapConfigureInstance(
Tcl_AddErrorInfo(masterPtr->interp, "\")");
Tcl_BackgroundError(masterPtr->interp);
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -474,8 +474,8 @@ ImgBmapConfigureInstance(
char *
TkGetBitmapData(
Tcl_Interp *interp, /* For reporting errors, or NULL. */
- char *string, /* String describing bitmap. May be NULL. */
- char *fileName, /* Name of file containing bitmap description.
+ const char *string, /* String describing bitmap. May be NULL. */
+ const char *fileName, /* Name of file containing bitmap description.
* Used only if string is NULL. Must not be
* NULL if string is NULL. */
int *widthPtr, int *heightPtr,
@@ -650,7 +650,7 @@ TkGetBitmapData(
}
return NULL;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -675,7 +675,8 @@ NextBitmapWord(
ParseInfo *parseInfoPtr) /* Describes what we're reading and where we
* are in it. */
{
- char *src, *dst;
+ const char *src;
+ char *dst;
int c;
parseInfoPtr->wordLength = 0;
@@ -719,7 +720,7 @@ NextBitmapWord(
parseInfoPtr->word[parseInfoPtr->wordLength] = 0;
return TCL_OK;
}
-
+
/*
*--------------------------------------------------------------
*
@@ -782,7 +783,7 @@ ImgBmapCmd(
return TCL_OK;
}
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -853,7 +854,7 @@ ImgBmapGet(
return instancePtr;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -913,7 +914,7 @@ ImgBmapDisplay(
XSetClipOrigin(display, instancePtr->gc, 0, 0);
}
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -976,7 +977,7 @@ ImgBmapFree(
}
ckfree((char *) instancePtr);
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -1017,7 +1018,7 @@ ImgBmapDelete(
Tk_FreeOptions(configSpecs, (char *) masterPtr, NULL, 0);
ckfree((char *) masterPtr);
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -1047,7 +1048,7 @@ ImgBmapCmdDeletedProc(
Tk_DeleteImage(masterPtr->interp, Tk_NameOfImage(masterPtr->tkMaster));
}
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -1079,7 +1080,7 @@ GetByte(
}
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -1175,7 +1176,7 @@ ImgBmapPsImagemask(
Tcl_AppendResult(interp, ">} imagemask \n", NULL);
return TCL_OK;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -1282,7 +1283,7 @@ ImgBmapPostscript(
}
return TCL_OK;
}
-
+
/*
* Local Variables:
* mode: c
diff --git a/generic/tkInt.decls b/generic/tkInt.decls
index 1046450..3e09fd4 100644
--- a/generic/tkInt.decls
+++ b/generic/tkInt.decls
@@ -10,7 +10,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: tkInt.decls,v 1.47 2008/10/28 22:33:06 nijtmans Exp $
+# RCS: @(#) $Id: tkInt.decls,v 1.48 2008/11/05 22:48:58 nijtmans Exp $
library tk
@@ -129,8 +129,9 @@ declare 29 generic {
void TkpFreeCursor(TkCursor *cursorPtr)
}
declare 30 generic {
- char *TkGetBitmapData(Tcl_Interp *interp, char *string, char *fileName,
- int *widthPtr, int *heightPtr, int *hotXPtr, int *hotYPtr)
+ char *TkGetBitmapData(Tcl_Interp *interp, const char *string,
+ const char *fileName, int *widthPtr, int *heightPtr,
+ int *hotXPtr, int *hotYPtr)
}
declare 31 generic {
void TkGetButtPoints(double p1[], double p2[],
diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h
index 7665567..606b15e 100644
--- a/generic/tkIntDecls.h
+++ b/generic/tkIntDecls.h
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkIntDecls.h,v 1.37 2008/10/28 22:33:06 nijtmans Exp $
+ * RCS: @(#) $Id: tkIntDecls.h,v 1.38 2008/11/05 22:48:58 nijtmans Exp $
*/
#ifndef _TKINTDECLS
@@ -218,10 +218,10 @@ EXTERN void TkpFreeCursor (TkCursor * cursorPtr);
#ifndef TkGetBitmapData_TCL_DECLARED
#define TkGetBitmapData_TCL_DECLARED
/* 30 */
-EXTERN char * TkGetBitmapData (Tcl_Interp * interp, char * string,
- char * fileName, int * widthPtr,
- int * heightPtr, int * hotXPtr,
- int * hotYPtr);
+EXTERN char * TkGetBitmapData (Tcl_Interp * interp,
+ const char * string, const char * fileName,
+ int * widthPtr, int * heightPtr,
+ int * hotXPtr, int * hotYPtr);
#endif
#ifndef TkGetButtPoints_TCL_DECLARED
#define TkGetButtPoints_TCL_DECLARED
@@ -997,7 +997,7 @@ typedef struct TkIntStubs {
void (*tkFontPkgFree) (TkMainInfo * mainPtr); /* 27 */
void (*tkFreeBindingTags) (TkWindow * winPtr); /* 28 */
void (*tkpFreeCursor) (TkCursor * cursorPtr); /* 29 */
- char * (*tkGetBitmapData) (Tcl_Interp * interp, char * string, char * fileName, int * widthPtr, int * heightPtr, int * hotXPtr, int * hotYPtr); /* 30 */
+ char * (*tkGetBitmapData) (Tcl_Interp * interp, const char * string, const char * fileName, int * widthPtr, int * heightPtr, int * hotXPtr, int * hotYPtr); /* 30 */
void (*tkGetButtPoints) (double p1[], double p2[], double width, int project, double m1[], double m2[]); /* 31 */
TkCursor * (*tkGetCursorByName) (Tcl_Interp * interp, Tk_Window tkwin, Tk_Uid string); /* 32 */
CONST84_RETURN char * (*tkGetDefaultScreenName) (Tcl_Interp * interp, const char * screenName); /* 33 */