summaryrefslogtreecommitdiffstats
path: root/generic/tclEncoding.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-11-18 07:39:21 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-11-18 07:39:21 (GMT)
commit72275aed2c38b56ce2a3bbcc29547a2967d2fc2c (patch)
tree27563e9a6fe1f058242ca0ec4d562a68ca1890f2 /generic/tclEncoding.c
parentfd54c8a9d81e0a3758b2029ab0d8d962a9038e14 (diff)
downloadtcl-72275aed2c38b56ce2a3bbcc29547a2967d2fc2c.zip
tcl-72275aed2c38b56ce2a3bbcc29547a2967d2fc2c.tar.gz
tcl-72275aed2c38b56ce2a3bbcc29547a2967d2fc2c.tar.bz2
Better programming practice, no literal '-1' in source code. Might even be useful for 64bit-sizes branch
<p>add TCL_NOSIZE as internal defined for -1, and use it in a lot of places Ass this function argument should be size_t, not ssize_t (still to be TIPped), something like this will be needed anyway.
Diffstat (limited to 'generic/tclEncoding.c')
-rw-r--r--generic/tclEncoding.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index 7a55724..393acf9 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -724,7 +724,7 @@ Tcl_SetDefaultEncodingDir(
const char *path)
{
Tcl_Obj *searchPath = Tcl_GetEncodingSearchPath();
- Tcl_Obj *directory = Tcl_NewStringObj(path, -1);
+ Tcl_Obj *directory = Tcl_NewStringObj(path, TCL_NOSIZE);
searchPath = Tcl_DuplicateObj(searchPath);
Tcl_ListObjReplace(NULL, searchPath, 0, 0, 1, &directory);
@@ -923,7 +923,7 @@ Tcl_GetEncodingNames(
Encoding *encodingPtr = Tcl_GetHashValue(hPtr);
Tcl_CreateHashEntry(&table,
- Tcl_NewStringObj(encodingPtr->name, -1), &dummy);
+ Tcl_NewStringObj(encodingPtr->name, TCL_NOSIZE), &dummy);
}
Tcl_MutexUnlock(&encodingMutex);
@@ -1461,7 +1461,7 @@ OpenEncodingFileChannel(
const char *name) /* The name of the encoding file on disk and
* also the name for new encoding. */
{
- Tcl_Obj *nameObj = Tcl_NewStringObj(name, -1);
+ Tcl_Obj *nameObj = Tcl_NewStringObj(name, TCL_NOSIZE);
Tcl_Obj *fileNameObj = Tcl_DuplicateObj(nameObj);
Tcl_Obj *searchPath = Tcl_DuplicateObj(Tcl_GetEncodingSearchPath());
Tcl_Obj *map = TclGetProcessGlobalValue(&encodingFileMap);
@@ -1471,7 +1471,7 @@ OpenEncodingFileChannel(
Tcl_ListObjGetElements(NULL, searchPath, &numDirs, &dir);
Tcl_IncrRefCount(nameObj);
- Tcl_AppendToObj(fileNameObj, ".enc", -1);
+ Tcl_AppendToObj(fileNameObj, ".enc", TCL_NOSIZE);
Tcl_IncrRefCount(fileNameObj);
Tcl_DictObjGet(NULL, map, nameObj, &directory);