summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--ChangeLog6
-rw-r--r--generic/tkBitmap.c4
-rw-r--r--generic/tkImgBmap.c41
-rw-r--r--generic/tkInt.decls7
-rw-r--r--generic/tkIntDecls.h12
-rw-r--r--unix/tkUnixCursor.c12
-rw-r--r--unix/tkUnixSend.c49
7 files changed, 70 insertions, 61 deletions
diff --git a/ChangeLog b/ChangeLog
index f77b15e..716ad80 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,7 +2,13 @@
* unix/tkUnixFont.c: fix [Bug 2226093] const changes not all correct
* unix/tkUnixButton.c: more internal -Wwrite-strings warning fixes
+ * unix/tkUnixCursor.c:
+ * unix/tkUnixSend.c:
* unix/tkUnixRFont.c:
+ * generic/tkInt.decls: CONSTify string and fileName parameters of TkGetBitmapData
+ * generic/tkImgBmap.c:
+ * generic/tkBitmap.c: remove unneccessary type cast
+ * generic/tkIntDecls.h: (regenerated)
2008-11-03 Jan Nijtmans <nijtmans@users.sf.net>
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 */
diff --git a/unix/tkUnixCursor.c b/unix/tkUnixCursor.c
index 103fd13..59c415a 100644
--- a/unix/tkUnixCursor.c
+++ b/unix/tkUnixCursor.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkUnixCursor.c,v 1.14 2008/04/27 22:39:13 dkf Exp $
+ * RCS: @(#) $Id: tkUnixCursor.c,v 1.15 2008/11/05 22:48:58 nijtmans Exp $
*/
#include "tkInt.h"
@@ -163,7 +163,7 @@ static const struct CursorName {
static const struct TkCursorName {
const char *name;
- char *data;
+ const char *data;
char *mask;
} tkCursorNames[] = {
{"none", CURSOR_NONE_DATA, NULL},
@@ -184,7 +184,7 @@ static const struct TkCursorName {
static Cursor CreateCursorFromTableOrFile(Tcl_Interp *interp,
Tk_Window tkwin, int argc, const char **argv,
const struct TkCursorName *tkCursorPtr);
-
+
/*
*----------------------------------------------------------------------
*
@@ -550,7 +550,7 @@ CreateCursorFromTableOrFile(
}
return cursor;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -600,7 +600,7 @@ TkCreateCursorFromData(
}
return (TkCursor *) cursorPtr;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -627,7 +627,7 @@ TkpFreeCursor(
XFreeCursor(unixCursorPtr->display, (Cursor) unixCursorPtr->info.cursor);
Tk_FreeXId(unixCursorPtr->display, (XID) unixCursorPtr->info.cursor);
}
-
+
/*
* Local Variables:
* mode: c
diff --git a/unix/tkUnixSend.c b/unix/tkUnixSend.c
index 8427ee4..60cdf86 100644
--- a/unix/tkUnixSend.c
+++ b/unix/tkUnixSend.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: tkUnixSend.c,v 1.22 2008/07/23 23:24:46 nijtmans Exp $
+ * RCS: @(#) $Id: tkUnixSend.c,v 1.23 2008/11/05 22:48:58 nijtmans Exp $
*/
#include "tkUnixInt.h"
@@ -226,7 +226,7 @@ static int ServerSecure(TkDisplay *dispPtr);
static void UpdateCommWindow(TkDisplay *dispPtr);
static int ValidateName(TkDisplay *dispPtr, const char *name,
Window commWindow, int oldOK);
-
+
/*
*----------------------------------------------------------------------
*
@@ -325,7 +325,7 @@ RegOpen(
}
return regPtr;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -378,7 +378,7 @@ RegFindName(
}
return None;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -442,7 +442,7 @@ RegDeleteName(
}
}
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -492,7 +492,7 @@ RegAddName(
regPtr->property = newProp;
regPtr->allocedByX = 0;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -552,7 +552,7 @@ RegClose(
}
ckfree((char *) regPtr);
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -647,7 +647,7 @@ ValidateName(
}
return result;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -690,7 +690,7 @@ ServerSecure(
return secure;
#endif /* TK_NO_SECURITY */
}
-
+
/*
*--------------------------------------------------------------
*
@@ -849,7 +849,7 @@ Tk_SetAppName(
return riPtr->name;
}
-
+
/*
*--------------------------------------------------------------
*
@@ -1087,7 +1087,7 @@ Tk_SendCmd(
if (!ValidateName(pending.dispPtr, pending.target,
pending.commWindow, 0)) {
- char *msg;
+ const char *msg;
if (ValidateName(pending.dispPtr, pending.target,
pending.commWindow, 1)) {
@@ -1137,7 +1137,7 @@ Tk_SendCmd(
Tcl_SetResult(interp, pending.result, TCL_DYNAMIC);
return pending.code;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -1225,7 +1225,7 @@ TkGetInterpNames(
RegClose(regPtr);
return TCL_OK;
}
-
+
/*
*--------------------------------------------------------------
*
@@ -1255,7 +1255,7 @@ TkSendCleanup(
dispPtr->commTkwin = NULL;
}
}
-
+
/*
*--------------------------------------------------------------
*
@@ -1312,7 +1312,7 @@ SendInit(
return TCL_OK;
}
-
+
/*
*--------------------------------------------------------------
*
@@ -1340,7 +1340,7 @@ SendEventProc(
{
TkDisplay *dispPtr = clientData;
char *propInfo, **propInfoPtr = &propInfo;
- register char *p;
+ const char *p;
int result, actualFormat;
unsigned long numItems, bytesAfter;
Atom actualType;
@@ -1395,7 +1395,8 @@ SendEventProc(
if ((*p == 'c') && (p[1] == 0)) {
Window commWindow;
- char *interpName, *script, *serial, *end;
+ const char *interpName, *script, *serial;
+ char *end;
Tcl_DString reply;
RegisteredInterp *riPtr;
@@ -1550,7 +1551,7 @@ SendEventProc(
}
} else if ((*p == 'r') && (p[1] == 0)) {
int serial, code, gotSerial;
- char *errorInfo, *errorCode, *resultString;
+ const char *errorInfo, *errorCode, *resultString;
PendingCommand *pcPtr;
/*
@@ -1649,7 +1650,7 @@ SendEventProc(
}
XFree(propInfo);
}
-
+
/*
*--------------------------------------------------------------
*
@@ -1728,7 +1729,7 @@ AppendErrorProc(
}
return 0;
}
-
+
/*
*--------------------------------------------------------------
*
@@ -1777,7 +1778,7 @@ DeleteProc(
UpdateCommWindow(riPtr->dispPtr);
Tcl_EventuallyFree(riPtr, TCL_DYNAMIC);
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -1817,7 +1818,7 @@ SendRestrictProc(
}
return TK_DEFER_EVENT;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -1857,7 +1858,7 @@ UpdateCommWindow(
Tcl_DStringLength(&names));
Tcl_DStringFree(&names);
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -1965,7 +1966,7 @@ TkpTestsendCmd(
}
return TCL_OK;
}
-
+
/*
* Local Variables:
* mode: c