summaryrefslogtreecommitdiffstats
path: root/generic/tclDictObj.c
diff options
context:
space:
mode:
authornijtmans <nijtmans>2009-02-03 23:34:32 (GMT)
committernijtmans <nijtmans>2009-02-03 23:34:32 (GMT)
commit22d5aa3e9618d2c3f426a16282fbdb93be01b417 (patch)
tree7d87c563d81459de0af29d9c6276a5d4c21f403b /generic/tclDictObj.c
parent6b40f13d26013e672072cb794817a2d322d8127e (diff)
downloadtcl-22d5aa3e9618d2c3f426a16282fbdb93be01b417.zip
tcl-22d5aa3e9618d2c3f426a16282fbdb93be01b417.tar.gz
tcl-22d5aa3e9618d2c3f426a16282fbdb93be01b417.tar.bz2
- eliminate some unnessary type casts
- some internal const decorations - spacing
Diffstat (limited to 'generic/tclDictObj.c')
-rw-r--r--generic/tclDictObj.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c
index c800441..ef0ebe9 100644
--- a/generic/tclDictObj.c
+++ b/generic/tclDictObj.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: tclDictObj.c,v 1.76 2009/01/28 16:28:32 dkf Exp $
+ * RCS: @(#) $Id: tclDictObj.c,v 1.77 2009/02/03 23:34:32 nijtmans Exp $
*/
#include "tclInt.h"
@@ -473,7 +473,8 @@ UpdateStringOfDict(
ChainEntry *cPtr;
Tcl_Obj *keyPtr, *valuePtr;
int numElems, i, length;
- char *elem, *dst;
+ const char *elem;
+ char *dst;
/*
* This field is the most useful one in the whole hash structure, and it
@@ -564,10 +565,11 @@ SetDictFromAny(
Tcl_Interp *interp,
Tcl_Obj *objPtr)
{
- char *string, *s;
+ const char *string;
+ char *s;
const char *elemStart, *nextElem;
int lenRemain, length, elemSize, hasBrace, result, isNew;
- char *limit; /* Points just after string's last byte. */
+ const char *limit; /* Points just after string's last byte. */
register const char *p;
register Tcl_Obj *keyPtr, *valuePtr;
Dict *dict;
@@ -1835,7 +1837,7 @@ DictKeysCmd(
Tcl_Obj *const *objv)
{
Tcl_Obj *listPtr;
- char *pattern = NULL;
+ const char *pattern = NULL;
if (objc!=2 && objc!=3) {
Tcl_WrongNumArgs(interp, 1, objv, "dictionary ?pattern?");
@@ -1920,7 +1922,7 @@ DictValuesCmd(
Tcl_Obj *valuePtr = NULL, *listPtr;
Tcl_DictSearch search;
int done;
- char *pattern;
+ const char *pattern;
if (objc!=2 && objc!=3) {
Tcl_WrongNumArgs(interp, 1, objv, "dictionary ?pattern?");
@@ -2067,7 +2069,6 @@ DictInfoCmd(
{
Tcl_Obj *dictPtr;
Dict *dict;
- char *buf;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "dictionary");
@@ -2083,9 +2084,7 @@ DictInfoCmd(
}
dict = dictPtr->internalRep.otherValuePtr;
- buf = Tcl_HashStats(&dict->table);
- Tcl_SetObjResult(interp, Tcl_NewStringObj(buf, -1));
- ckfree(buf);
+ Tcl_SetResult(interp, Tcl_HashStats(&dict->table), TCL_DYNAMIC);
return TCL_OK;
}
@@ -2720,7 +2719,7 @@ DictFilterCmd(
Tcl_Obj **varv, *keyObj = NULL, *valueObj = NULL, *resultObj, *boolObj;
Tcl_DictSearch search;
int index, varc, done, result, satisfied;
- char *pattern;
+ const char *pattern;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "dictionary filterType ?arg ...?");