summaryrefslogtreecommitdiffstats
path: root/generic
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 /generic
parent74318119b04effffec948581aa1004b23fdd6c3b (diff)
downloadtcl-1d90238ed304fdd70f1a56dfc4f94a7add80c736.zip
tcl-1d90238ed304fdd70f1a56dfc4f94a7add80c736.tar.gz
tcl-1d90238ed304fdd70f1a56dfc4f94a7add80c736.tar.bz2
eliminate -Wwrite-strings warnings in enable-threads build.
use TclNewLiteralStringObj()
Diffstat (limited to 'generic')
-rw-r--r--generic/tclExecute.c6
-rw-r--r--generic/tclThreadTest.c12
2 files changed, 9 insertions, 9 deletions
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);