summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-12-22 11:38:22 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-12-22 11:38:22 (GMT)
commit4532b23e99a7e9a97370342358b5236306558062 (patch)
tree498e69a8b7b58c2637a5b1a57603e3528443dc9d /generic
parent9a2993c23fa5fae20401bc8ee4ac9f87891abe9c (diff)
downloadtcl-4532b23e99a7e9a97370342358b5236306558062.zip
tcl-4532b23e99a7e9a97370342358b5236306558062.tar.gz
tcl-4532b23e99a7e9a97370342358b5236306558062.tar.bz2
Fix some comments (which were not correct any more in this branch), and don't allow booleans in integer context.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclLink.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/generic/tclLink.c b/generic/tclLink.c
index f719ade..56f8a5c 100644
--- a/generic/tclLink.c
+++ b/generic/tclLink.c
@@ -678,10 +678,10 @@ ObjValue(
}
}
/*
- * This function works almost the same as Tcl_GetBooleanFromObj(), only
- * it doesn't have an interpreter to report errors, and it considers
- * the character sequences "0x", "0b" and "0o" as valid, for purpose
- * of the link functionality in Tcl. See bug [39f6304c2e].
+ * This function checks for integer representations, which are valid
+ * when linking with C variables, but which are invalid in other
+ * contexts in Tcl. Handled are "+", "-", "0x", "0b" and "0o" (upper-
+ * and lowercase). See bug [39f6304c2e].
*/
int
GetInvalidIntFromObj(Tcl_Obj *objPtr,
@@ -697,15 +697,14 @@ GetInvalidIntFromObj(Tcl_Obj *objPtr,
*intPtr = 0;
return TCL_OK;
}
- return Tcl_GetBooleanFromObj(NULL, objPtr, intPtr);
+ return TCL_ERROR;
}
/*
- * This function works almost the same as Tcl_GetBooleanFromObj(), only
- * it returns a double in stead of an integer, it doesn't have an interpreter
- * to report errors, and it considers the character sequences ".", "0x", "0b"
- * and "0o" as valid, for purpose of the link functionality in Tcl.
- * See bug [39f6304c2e].
+ * This function checks for double representations, which are valid
+ * when linking with C variables, but which are invalid in other
+ * contexts in Tcl. Handled are ".", "+", "-", "0x", "0b" and "0o"
+ * (upper- and lowercase). See bug [39f6304c2e].
*/
int
GetInvalidDoubleFromObj(Tcl_Obj *objPtr,