summaryrefslogtreecommitdiffstats
path: root/generic/tclLiteral.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-09-05 13:14:45 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-09-05 13:14:45 (GMT)
commitb41a44e3942c841677cdcf7cd46be77c5c27ab08 (patch)
treea95eae27a774d5596a43ac7843d8d876f6f12da6 /generic/tclLiteral.c
parent68caa10ca3562292a830860aaa37289795fe68b7 (diff)
downloadtcl-b41a44e3942c841677cdcf7cd46be77c5c27ab08.zip
tcl-b41a44e3942c841677cdcf7cd46be77c5c27ab08.tar.gz
tcl-b41a44e3942c841677cdcf7cd46be77c5c27ab08.tar.bz2
Some patch clean-up, no change in functionality
Diffstat (limited to 'generic/tclLiteral.c')
-rw-r--r--generic/tclLiteral.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c
index 864d050..484b86b 100644
--- a/generic/tclLiteral.c
+++ b/generic/tclLiteral.c
@@ -214,16 +214,15 @@ TclCreateLiteral(
if (globalPtrPtr) {
*globalPtrPtr = globalPtr;
}
- if ((flags & LITERAL_ON_HEAP)) {
+ if (flags & LITERAL_ON_HEAP) {
ckfree(bytes);
}
globalPtr->refCount++;
return objPtr;
}
}
-
if (!newPtr) {
- if ((flags & LITERAL_ON_HEAP)) {
+ if (flags & LITERAL_ON_HEAP) {
ckfree(bytes);
}
return NULL;
@@ -236,15 +235,15 @@ TclCreateLiteral(
TclNewObj(objPtr);
Tcl_IncrRefCount(objPtr);
- if ((flags & LITERAL_ON_HEAP)) {
+ if (flags & LITERAL_ON_HEAP) {
objPtr->bytes = bytes;
objPtr->length = length;
} else {
TclInitStringRep(objPtr, bytes, length);
}
- if ((flags & LITERAL_UNSHARED)) {
- /*
+ if (flags & LITERAL_UNSHARED) {
+ /*
* Make clear, that no global value is returned
*/
if (globalPtrPtr != NULL) {
@@ -429,7 +428,7 @@ TclRegisterLiteral(
* the namespace as the interp's global NS.
*/
- if ((flags & LITERAL_CMD_NAME)) {
+ if (flags & LITERAL_CMD_NAME) {
if ((length >= 2) && (bytes[0] == ':') && (bytes[1] == ':')) {
nsPtr = iPtr->globalNsPtr;
} else {
@@ -438,10 +437,11 @@ TclRegisterLiteral(
} else {
nsPtr = NULL;
}
-
+
/*
* Is it in the interpreter's global literal table? If not, create it.
*/
+
globalPtr = NULL;
objPtr = TclCreateLiteral(iPtr, bytes, length, hash, &new, nsPtr, flags,
&globalPtr);
@@ -1167,10 +1167,6 @@ TclVerifyLocalLiteralTable(
if (LookupLiteralEntry((Tcl_Interp *) envPtr->iPtr,
localPtr->objPtr) == NULL) {
bytes = Tcl_GetStringFromObj(localPtr->objPtr, &length);
- //Tcl_Panic("%s: local literal \"%.*s\" is not global",
- // "TclVerifyLocalLiteralTable",
- // (length>60? 60 : length), bytes);
- /*fprintf(stderr, "local literal \"%s\" is not global\n",bytes);*/
}
if (localPtr->objPtr->bytes == NULL) {
Tcl_Panic("%s: literal has NULL string rep",