diff options
| author | dgp <dgp@users.sourceforge.net> | 2018-10-17 19:47:01 (GMT) |
|---|---|---|
| committer | dgp <dgp@users.sourceforge.net> | 2018-10-17 19:47:01 (GMT) |
| commit | 1b03667a27e4f198e48c344454663aae4c085a14 (patch) | |
| tree | 70bbdddb4f6bdec0c26dd22cf8ccd499b1c97416 /generic/tclTest.c | |
| parent | 5c24bebd2b402df644549d6c0efe6586dde65891 (diff) | |
| parent | e154c5151281fbbe01ef1361f5f6980a5ec5a6d3 (diff) | |
| download | tcl-1b03667a27e4f198e48c344454663aae4c085a14.zip tcl-1b03667a27e4f198e48c344454663aae4c085a14.tar.gz tcl-1b03667a27e4f198e48c344454663aae4c085a14.tar.bz2 | |
merge 8.7
Diffstat (limited to 'generic/tclTest.c')
| -rw-r--r-- | generic/tclTest.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/generic/tclTest.c b/generic/tclTest.c index ac01ecf..18bfc1b 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", @@ -2828,7 +2832,7 @@ TestlinkCmd( static int intVar = 43; static int boolVar = 4; static double realVar = 1.23; - static Tcl_WideInt wideVar = Tcl_LongAsWide(79); + static Tcl_WideInt wideVar = 79; static char *stringVar = NULL; static char charVar = '@'; static unsigned char ucharVar = 130; @@ -2838,7 +2842,7 @@ TestlinkCmd( static long longVar = 123456789L; static unsigned long ulongVar = 3456789012UL; static float floatVar = 4.5; - static Tcl_WideUInt uwideVar = (Tcl_WideUInt) Tcl_LongAsWide(123); + static Tcl_WideUInt uwideVar = 123; static int created = 0; char buffer[2*TCL_DOUBLE_SPACE]; int writable, flag; @@ -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[], |
