diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-12-22 11:38:22 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-12-22 11:38:22 (GMT) |
commit | 4532b23e99a7e9a97370342358b5236306558062 (patch) | |
tree | 498e69a8b7b58c2637a5b1a57603e3528443dc9d /generic | |
parent | 9a2993c23fa5fae20401bc8ee4ac9f87891abe9c (diff) | |
download | tcl-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.c | 19 |
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, |