summaryrefslogtreecommitdiffstats
path: root/generic/tkAtom.c
diff options
context:
space:
mode:
authornijtmans <nijtmans>2008-10-30 23:18:59 (GMT)
committernijtmans <nijtmans>2008-10-30 23:18:59 (GMT)
commit6f5d76a8755403d49a1465f4b9f41164a7f311f2 (patch)
tree9f94fbbc8e20c71db340e9aa5b02b47387bd82f0 /generic/tkAtom.c
parent4dddde633cc58640988340836315bbb6b780b9da (diff)
downloadtk-6f5d76a8755403d49a1465f4b9f41164a7f311f2.zip
tk-6f5d76a8755403d49a1465f4b9f41164a7f311f2.tar.gz
tk-6f5d76a8755403d49a1465f4b9f41164a7f311f2.tar.bz2
more internal -Wwrite-strings warning fixes
Diffstat (limited to 'generic/tkAtom.c')
-rw-r--r--generic/tkAtom.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/generic/tkAtom.c b/generic/tkAtom.c
index 3afada9..a9503c7 100644
--- a/generic/tkAtom.c
+++ b/generic/tkAtom.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkAtom.c,v 1.10 2008/10/29 23:31:55 jenglish Exp $
+ * RCS: @(#) $Id: tkAtom.c,v 1.11 2008/10/30 23:18:59 nijtmans Exp $
*/
#include "tkInt.h"
@@ -22,7 +22,7 @@
* those found in xatom.h
*/
-static const char * atomNameArray[] = {
+static const char *const atomNameArray[] = {
"PRIMARY", "SECONDARY", "ARC",
"ATOM", "BITMAP", "CARDINAL",
"COLORMAP", "CURSOR", "CUT_BUFFER0",
@@ -139,23 +139,22 @@ Tk_GetAtomName(
hPtr = Tcl_FindHashEntry(&dispPtr->atomTable, (char *) atom);
if (hPtr == NULL) {
- char *name;
+ const char *name;
Tk_ErrorHandler handler;
- int isNew, mustFree;
+ int isNew;
+ char *mustFree = NULL;
handler = Tk_CreateErrorHandler(dispPtr->display, BadAtom, -1, -1,
NULL, (ClientData) NULL);
- name = XGetAtomName(dispPtr->display, atom);
- mustFree = 1;
+ name = mustFree = XGetAtomName(dispPtr->display, atom);
if (name == NULL) {
name = "?bad atom?";
- mustFree = 0;
}
Tk_DeleteErrorHandler(handler);
hPtr = Tcl_CreateHashEntry(&dispPtr->nameTable, name, &isNew);
Tcl_SetHashValue(hPtr, atom);
if (mustFree) {
- XFree(name);
+ XFree(mustFree);
}
name = Tcl_GetHashKey(&dispPtr->nameTable, hPtr);
hPtr = Tcl_CreateHashEntry(&dispPtr->atomTable, (char *) atom, &isNew);