diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-09-03 12:53:15 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-09-03 12:53:15 (GMT) |
commit | 2f2b7f6ac7122f3b6be07e793e1658cdb5791aa2 (patch) | |
tree | ed9189deb7f4bee3b751fa2588d626b12111cffd /generic | |
parent | 5f1bd2f2e3aa755c4216fb0e47dd2c04f47a1453 (diff) | |
download | tcl-2f2b7f6ac7122f3b6be07e793e1658cdb5791aa2.zip tcl-2f2b7f6ac7122f3b6be07e793e1658cdb5791aa2.tar.gz tcl-2f2b7f6ac7122f3b6be07e793e1658cdb5791aa2.tar.bz2 |
Eliminate use of wideBiggerThanInt test constraint, since it's the same as {longIs32bit wideIs64bit}. And ... it's name is actually wrong ...
Don't use int() any more in any test constraint, since it's semantics might change. We don't want the test constraints to change with it. (See: TIP# 514)
Simplify implementation of wideIs64bit test constraint, just testing for 64-bit sign bit is enough.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclTest.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/generic/tclTest.c b/generic/tclTest.c index ac01ecf..48b4761 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -293,6 +293,8 @@ static int TestgetassocdataCmd(ClientData dummy, Tcl_Interp *interp, int argc, const char **argv); static int TestgetintCmd(ClientData dummy, Tcl_Interp *interp, int argc, const char **argv); +static int TestlongsizeCmd(ClientData dummy, + Tcl_Interp *interp, int argc, const char **argv); static int TestgetplatformCmd(ClientData dummy, Tcl_Interp *interp, int argc, const char **argv); static int TestgetvarfullnameCmd( @@ -645,6 +647,8 @@ Tcltest_Init( NULL, NULL); Tcl_CreateCommand(interp, "testgetint", TestgetintCmd, NULL, NULL); + Tcl_CreateCommand(interp, "testlongsize", TestlongsizeCmd, + NULL, NULL); Tcl_CreateCommand(interp, "testgetplatform", TestgetplatformCmd, NULL, NULL); Tcl_CreateObjCommand(interp, "testgetvarfullname", @@ -6936,6 +6940,24 @@ TestgetintCmd( } } +/* + * Used for determining sizeof(long) at script level. + */ +static int +TestlongsizeCmd( + ClientData dummy, + Tcl_Interp *interp, + int argc, + const char **argv) +{ + if (argc != 1) { + Tcl_AppendResult(interp, "wrong # args", NULL); + return TCL_ERROR; + } + Tcl_SetObjResult(interp, Tcl_NewIntObj((int)sizeof(long))); + return TCL_OK; +} + static int NREUnwind_callback( ClientData data[], |