summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornijtmans <nijtmans>2008-12-16 23:24:13 (GMT)
committernijtmans <nijtmans>2008-12-16 23:24:13 (GMT)
commit1d90238ed304fdd70f1a56dfc4f94a7add80c736 (patch)
tree692c37174e83ec64e5f20f728d49cea200dae3f3
parent74318119b04effffec948581aa1004b23fdd6c3b (diff)
downloadtcl-1d90238ed304fdd70f1a56dfc4f94a7add80c736.zip
tcl-1d90238ed304fdd70f1a56dfc4f94a7add80c736.tar.gz
tcl-1d90238ed304fdd70f1a56dfc4f94a7add80c736.tar.bz2
eliminate -Wwrite-strings warnings in enable-threads build.
use TclNewLiteralStringObj()
-rw-r--r--ChangeLog8
-rw-r--r--generic/tclExecute.c6
-rw-r--r--generic/tclThreadTest.c12
-rw-r--r--unix/tclUnixFCmd.c7
-rw-r--r--win/tclWinFCmd.c4
5 files changed, 23 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index 3f999a4..d4531ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-12-16 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tclThreadTest.c: eliminate -Wwrite-strings warnings
+ in enable-threads build.
+ * generic/tclExecute.c: use TclNewLiteralStringObj()
+ * unix/tclUnixFCmd.c: use TclNewLiteralStringObj()
+ * win/tclWinFCmd.c: use TclNewLiteralStringObj()
+
2008-12-16 Donal K. Fellows <dkf@users.sf.net>
TIP #329 IMPLEMENTATION
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 058f93f..ed656d5 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclExecute.c,v 1.421 2008/12/16 15:50:47 ferrieux Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.422 2008/12/16 23:24:13 nijtmans Exp $
*/
#include "tclInt.h"
@@ -2879,7 +2879,7 @@ TclExecuteByteCode(
Tcl_Panic("TclExecuteByteCode: unrecognized builtin function code %d", opnd);
}
- objPtr = Tcl_NewStringObj("::tcl::mathfunc::", 17);
+ TclNewLiteralStringObj(objPtr, "::tcl::mathfunc::");
Tcl_AppendToObj(objPtr, tclBuiltinFuncTable[opnd].name, -1);
/*
@@ -2927,7 +2927,7 @@ TclExecuteByteCode(
objc = TclGetUInt1AtPtr(pc+1);
objPtr = OBJ_AT_DEPTH(objc-1);
- tmpPtr = Tcl_NewStringObj("::tcl::mathfunc::", 17);
+ TclNewLiteralStringObj(tmpPtr, "::tcl::mathfunc::");
Tcl_AppendObjToObj(tmpPtr, objPtr);
Tcl_DecrRefCount(objPtr);
diff --git a/generic/tclThreadTest.c b/generic/tclThreadTest.c
index 82485ff..cad9e11 100644
--- a/generic/tclThreadTest.c
+++ b/generic/tclThreadTest.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: tclThreadTest.c,v 1.28 2008/11/19 00:04:49 nijtmans Exp $
+ * RCS: @(#) $Id: tclThreadTest.c,v 1.29 2008/12/16 23:24:13 nijtmans Exp $
*/
#include "tclInt.h"
@@ -60,7 +60,7 @@ static struct ThreadSpecificData *threadList;
*/
typedef struct ThreadCtrl {
- char *script; /* The Tcl command this thread should
+ const char *script; /* The Tcl command this thread should
* execute */
int flags; /* Initial value of the "flags" field in the
* ThreadSpecificData structure for the new
@@ -124,7 +124,7 @@ EXTERN int TclThread_Init(Tcl_Interp *interp);
EXTERN int Tcl_ThreadObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
-EXTERN int TclCreateThread(Tcl_Interp *interp, char *script,
+EXTERN int TclCreateThread(Tcl_Interp *interp, const char *script,
int joinable);
EXTERN int TclThreadList(Tcl_Interp *interp);
EXTERN int TclThreadSend(Tcl_Interp *interp, Tcl_ThreadId id,
@@ -281,7 +281,7 @@ Tcl_ThreadObjCmd(
return TclThreadCancel(interp, (Tcl_ThreadId) id, result, flags);
}
case THREAD_CREATE: {
- char *script;
+ const char *script;
int joinable, len;
if (objc == 2) {
@@ -505,7 +505,7 @@ Tcl_ThreadObjCmd(
int
TclCreateThread(
Tcl_Interp *interp, /* Current interpreter. */
- char *script, /* Script to execute */
+ const char *script, /* Script to execute */
int joinable) /* Flag, joinable thread or not */
{
ThreadCtrl ctrl;
@@ -1189,7 +1189,7 @@ ThreadExitProc(
* going to call free on it.
*/
- char *msg = "target thread died";
+ const char *msg = "target thread died";
resultPtr->result = ckalloc(strlen(msg)+1);
strcpy(resultPtr->result, msg);
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c
index 442c6d6..2523800 100644
--- a/unix/tclUnixFCmd.c
+++ b/unix/tclUnixFCmd.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: tclUnixFCmd.c,v 1.70 2008/11/29 18:17:19 dkf Exp $
+ * RCS: @(#) $Id: tclUnixFCmd.c,v 1.71 2008/12/16 23:24:13 nijtmans Exp $
*
* Portions of this code were derived from NetBSD source code which has the
* following copyright notice:
@@ -1059,7 +1059,7 @@ TraverseUnixTree(
unsigned short pathlen = ent->fts_pathlen - sourceLen;
int type;
Tcl_StatBuf *statBufPtr = NULL;
-
+
if (info == FTS_DNR || info == FTS_ERR || info == FTS_NS) {
errfile = ent->fts_path;
break;
@@ -1684,7 +1684,8 @@ SetPermissionsAttribute(
Tcl_Obj *
TclpObjListVolumes(void)
{
- Tcl_Obj *resultPtr = Tcl_NewStringObj("/", 1);
+ Tcl_Obj *resultPtr;
+ TclNewLiteralStringObj(resultPtr, "/");
Tcl_IncrRefCount(resultPtr);
return resultPtr;
diff --git a/win/tclWinFCmd.c b/win/tclWinFCmd.c
index 93ea1bc..c0de916 100644
--- a/win/tclWinFCmd.c
+++ b/win/tclWinFCmd.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinFCmd.c,v 1.55 2008/10/26 18:43:26 dkf Exp $
+ * RCS: @(#) $Id: tclWinFCmd.c,v 1.56 2008/12/16 23:24:13 nijtmans Exp $
*/
#include "tclWinInt.h"
@@ -1806,7 +1806,7 @@ ConvertFileNameFormat(
*/
if (Tcl_DStringValue(&dsTemp)[0] == '~') {
- tempPath = Tcl_NewStringObj("./",2);
+ TclNewLiteralStringObj(tempPath, "./");
Tcl_AppendToObj(tempPath, Tcl_DStringValue(&dsTemp),
Tcl_DStringLength(&dsTemp));
} else {