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 | 87a0d0b706167c246ba2a4e61fc7f87b69c3b7a2 (patch) | |
tree | 498e69a8b7b58c2637a5b1a57603e3528443dc9d /generic | |
parent | 1f7314745e2e2ae2cd22cfa649f6f830f9e40818 (diff) | |
download | tcl-87a0d0b706167c246ba2a4e61fc7f87b69c3b7a2.zip tcl-87a0d0b706167c246ba2a4e61fc7f87b69c3b7a2.tar.gz tcl-87a0d0b706167c246ba2a4e61fc7f87b69c3b7a2.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, |