Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch tip-514 Excluding Merge-Ins
This is equivalent to a diff from 2f164e9d41 to b4a19593fb
2018-10-08
| ||
19:08 | TIP #514 implementation: Platform differences in handling int/wide check-in: d0f4e9da90 user: jan.nijtmans tags: core-8-branch | |
2018-09-29
| ||
08:51 | More readability improvements to unix makefile check-in: 3a0455ee94 user: dkf tags: core-8-branch | |
2018-09-28
| ||
19:59 | \Merge 8.7 Closed-Leaf check-in: bcc54d1577 user: jan.nijtmans tags: tip-502 | |
19:58 | Merge 8.7 Closed-Leaf check-in: b4a19593fb user: jan.nijtmans tags: tip-514 | |
18:57 | Merge 8.7 check-in: d812be8851 user: jan.nijtmans tags: trunk | |
18:49 | Merge 8.6 check-in: 2f164e9d41 user: jan.nijtmans tags: core-8-branch | |
18:45 | Another patch contributed by Gustaf Neumann: shifting negative numbers is undefined behavior in the ... check-in: 165586b224 user: jan.nijtmans tags: core-8-6-branch | |
18:21 | nmake build fixes for zipfs (ongoing, zip attachments not done yet) check-in: eedd24aae1 user: jan.nijtmans tags: core-8-branch | |
2018-09-27
| ||
21:38 | Merge 8.7 check-in: eaf86378bc user: jan.nijtmans tags: tip-514 | |
Changes to generic/tclBasic.c.
︙ | |||
121 122 123 124 125 126 127 | 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | - | # define DTraceCmdReturn NULL #endif /* USE_DTRACE */ static Tcl_ObjCmdProc ExprAbsFunc; static Tcl_ObjCmdProc ExprBinaryFunc; static Tcl_ObjCmdProc ExprBoolFunc; static Tcl_ObjCmdProc ExprCeilFunc; static Tcl_ObjCmdProc ExprDoubleFunc; |
︙ | |||
323 324 325 326 327 328 329 | 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 | - + | { "atan", ExprUnaryFunc, (ClientData) atan }, { "atan2", ExprBinaryFunc, (ClientData) atan2 }, { "bool", ExprBoolFunc, NULL }, { "ceil", ExprCeilFunc, NULL }, { "cos", ExprUnaryFunc, (ClientData) cos }, { "cosh", ExprUnaryFunc, (ClientData) cosh }, { "double", ExprDoubleFunc, NULL }, |
︙ | |||
6616 6617 6618 6619 6620 6621 6622 | 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 | - + | Tcl_DecrRefCount(resultPtr); if (Tcl_InitBignumFromDouble(interp, d, &big) != TCL_OK) { return TCL_ERROR; } resultPtr = Tcl_NewBignumObj(&big); /* FALLTHROUGH */ } |
︙ | |||
7592 7593 7594 7595 7596 7597 7598 | 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 | - + | return TCL_ERROR; } if (TclGetNumberFromObj(interp, objv[1], &ptr, &type) != TCL_OK) { return TCL_ERROR; } |
︙ | |||
7713 7714 7715 7716 7717 7718 7719 | 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 | - + | return TCL_ERROR; } Tcl_SetObjResult(interp, Tcl_NewDoubleObj(dResult)); return TCL_OK; } static int |
︙ | |||
7768 7769 7770 7771 7772 7773 7774 | 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 | - - - - - - - - - - - - - - - - - - - - + | * Get the error message for NaN. */ Tcl_GetDoubleFromObj(interp, objv[1], &d); return TCL_ERROR; } |
︙ |
Changes to generic/tclCmdMZ.c.
︙ | |||
1619 1620 1621 1622 1623 1624 1625 | 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 | - - - - | } break; } case STR_IS_GRAPH: chcomp = Tcl_UniCharIsGraph; break; case STR_IS_INT: |
︙ | |||
1670 1671 1672 1673 1674 1675 1676 | 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 | - | } break; case STR_IS_WIDE: if (TCL_OK == TclGetWideIntFromObj(NULL, objPtr, &w)) { break; } |
︙ |
Changes to generic/tclCompCmdsSZ.c.
︙ | |||
687 688 689 690 691 692 693 | 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 | - - - - + | } else { OP( NUM_TYPE); OP( DUP); JUMP1( JUMP_FALSE, end); } switch (t) { |
︙ |
Changes to generic/tclExecute.c.
︙ | |||
496 497 498 499 500 501 502 | 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 | - + | * * MODULE_SCOPE int GetNumberFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, * ClientData *ptrPtr, int *tPtr); */ #define GetNumberFromObj(interp, objPtr, ptrPtr, tPtr) \ (((objPtr)->typePtr == &tclIntType) \ |
︙ | |||
3616 3617 3618 3619 3620 3621 3622 | 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 | - + | if (TclIsVarDirectModifyable(varPtr)) { ClientData ptr; int type; objPtr = varPtr->value.objPtr; if (GetNumberFromObj(NULL, objPtr, &ptr, &type) == TCL_OK) { |
︙ | |||
3658 3659 3660 3661 3662 3663 3664 | 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 | - + | * We know the sum value is outside the long range; * use macro form that doesn't range test again. */ TclSetIntObj(objPtr, w+increment); } goto doneIncr; |
︙ | |||
5627 5628 5629 5630 5631 5632 5633 | 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 | - - - - - - - - - - + - + | ClientData ptr1, ptr2; int type1, type2; Tcl_WideInt w1, w2, wResult; case INST_NUM_TYPE: if (GetNumberFromObj(NULL, OBJ_AT_TOS, &ptr1, &type1) != TCL_OK) { type1 = 0; |
︙ | |||
5688 5689 5690 5691 5692 5693 5694 | 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 | - + | iResult = (*pc == INST_NEQ); goto foundResult; } if (valuePtr == value2Ptr) { compare = MP_EQ; goto convertComparison; } |
︙ | |||
5767 5768 5769 5770 5771 5772 5773 | 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 | - + | goto gotError; } /* * Check for common, simple case. */ |
︙ | |||
6007 6008 6009 6010 6011 6012 6013 | 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 | - + | #endif /* * Handle (long,long) arithmetic as best we can without going out to * an external function. */ |
︙ | |||
6150 6151 6152 6153 6154 6155 6156 | 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 | - + | TRACE_APPEND(("ERROR: illegal type %s\n", (valuePtr->typePtr? valuePtr->typePtr->name : "null"))); DECACHE_STACK_INFO(); IllegalExprOperandType(interp, pc, valuePtr); CACHE_STACK_INFO(); goto gotError; } |
︙ | |||
6187 6188 6189 6190 6191 6192 6193 | 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 | - + | goto gotError; } switch (type1) { case TCL_NUMBER_NAN: /* -NaN => NaN */ TRACE_APPEND(("%s\n", O2S(valuePtr))); NEXT_INST_F(1, 0, 0); |
︙ | |||
7866 7867 7868 7869 7870 7871 7872 | 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 | - + - + | (void) GetNumberFromObj(NULL, value2Ptr, &ptr2, &type2); switch (opcode) { case INST_MOD: /* TODO: Attempts to re-use unshared operands on stack */ w2 = 0; /* silence gcc warning */ |
︙ | |||
7957 7958 7959 7960 7961 7962 7963 | 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 | - + | case INST_LSHIFT: case INST_RSHIFT: { /* * Reject negative shift argument. */ switch (type2) { |
︙ | |||
7979 7980 7981 7982 7983 7984 7985 | 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 | - + - + | return GENERAL_ARITHMETIC_ERROR; } /* * Zero shifted any number of bits is still zero. */ |
︙ | |||
8025 8026 8027 8028 8029 8030 8031 | 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 | - + - + | } } } else { /* * Quickly force large right shifts to 0 or -1. */ |
︙ | |||
8059 8060 8061 8062 8063 8064 8065 | 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 | - + | } shift = (int)(*(const Tcl_WideInt *)ptr2); /* * Handle shifts within the native wide range. */ |
︙ | |||
8236 8237 8238 8239 8240 8241 8242 | 8227 8228 8229 8230 8231 8232 8233 8234 8235 8236 8237 8238 8239 8240 8241 | - + | } mp_clear(&big1); mp_clear(&big2); BIG_RESULT(&bigResult); } |
︙ | |||
8290 8291 8292 8293 8294 8295 8296 | 8281 8282 8283 8284 8285 8286 8287 8288 8289 8290 8291 8292 8293 8294 8295 8296 8297 8298 8299 8300 8301 8302 8303 8304 8305 8306 8307 8308 8309 8310 8311 8312 8313 8314 8315 8316 8317 8318 8319 8320 8321 8322 8323 8324 8325 8326 8327 8328 8329 8330 8331 | - + - + - + - + | if (d1==0.0 && d2<0.0) { return EXPONENT_OF_ZERO; } dResult = pow(d1, d2); goto doubleResult; } w2 = 0; |
︙ | |||
8356 8357 8358 8359 8360 8361 8362 | 8347 8348 8349 8350 8351 8352 8353 8354 8355 8356 8357 8358 8359 8360 8361 | - + | * Integers with magnitude greater than 1 raise to a negative * power yield the answer zero (see TIP 123). */ return constants[0]; } |
︙ | |||
8383 8384 8385 8386 8387 8388 8389 | 8374 8375 8376 8377 8378 8379 8380 8381 8382 8383 8384 8385 8386 8387 8388 8389 8390 8391 8392 8393 8394 8395 8396 8397 8398 | - + - + - + | } /* * We refuse to accept exponent arguments that exceed one mp_digit * which means the max exponent value is 2**28-1 = 0x0fffffff = * 268435455, which fits into a signed 32 bit int which is within the * range of the long int type. This means any numeric Tcl_Obj value |
︙ | |||
8417 8418 8419 8420 8421 8422 8423 | 8408 8409 8410 8411 8412 8413 8414 8415 8416 8417 8418 8419 8420 8421 8422 | - + | if ((Tcl_WideUInt)w2 < CHAR_BIT*sizeof(Tcl_WideInt) - 1){ WIDE_RESULT(signum * (((Tcl_WideInt) 1) << (int) w2)); } goto overflowExpon; } } |
︙ | |||
8617 8618 8619 8620 8621 8622 8623 | 8608 8609 8610 8611 8612 8613 8614 8615 8616 8617 8618 8619 8620 8621 8622 8623 8624 8625 8626 8627 8628 8629 8630 8631 8632 8633 8634 8635 8636 | - + - + | if ((type1 != TCL_NUMBER_BIG) && (type2 != TCL_NUMBER_BIG)) { TclGetWideIntFromObj(NULL, valuePtr, &w1); TclGetWideIntFromObj(NULL, value2Ptr, &w2); switch (opcode) { case INST_ADD: wResult = w1 + w2; |
︙ | |||
8754 8755 8756 8757 8758 8759 8760 | 8745 8746 8747 8748 8749 8750 8751 8752 8753 8754 8755 8756 8757 8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 | - + - + | mp_int big; Tcl_Obj *objResultPtr; (void) GetNumberFromObj(NULL, valuePtr, &ptr, &type); switch (opcode) { case INST_BITNOT: |
︙ | |||
8821 8822 8823 8824 8825 8826 8827 | 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 | - + - + | double d1, d2, tmp; Tcl_WideInt w1, w2; (void) GetNumberFromObj(NULL, valuePtr, &ptr1, &type1); (void) GetNumberFromObj(NULL, value2Ptr, &ptr2, &type2); switch (type1) { |
︙ | |||
8881 8882 8883 8884 8885 8886 8887 | 8872 8873 8874 8875 8876 8877 8878 8879 8880 8881 8882 8883 8884 8885 8886 | - + | case TCL_NUMBER_DOUBLE: d1 = *((const double *)ptr1); switch (type2) { case TCL_NUMBER_DOUBLE: d2 = *((const double *)ptr2); doubleCompare: return (d1 < d2) ? MP_LT : ((d1 > d2) ? MP_GT : MP_EQ); |
︙ | |||
8923 8924 8925 8926 8927 8928 8929 | 8914 8915 8916 8917 8918 8919 8920 8921 8922 8923 8924 8925 8926 8927 8928 | - + | Tcl_InitBignumFromDouble(NULL, d1, &big1); goto bigCompare; } case TCL_NUMBER_BIG: Tcl_TakeBignumFromObj(NULL, valuePtr, &big1); switch (type2) { |
︙ |
Changes to generic/tclInt.h.
︙ | |||
2493 2494 2495 2496 2497 2498 2499 | 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 | - - + + - - + + | #define TclGetLongFromObj(interp, objPtr, longPtr) \ (((objPtr)->typePtr == &tclIntType) \ ? ((*(longPtr) = (objPtr)->internalRep.wideValue), TCL_OK) \ : Tcl_GetLongFromObj((interp), (objPtr), (longPtr))) #else #define TclGetLongFromObj(interp, objPtr, longPtr) \ (((objPtr)->typePtr == &tclIntType \ |
︙ | |||
2705 2706 2707 2708 2709 2710 2711 | 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 | - - + + + + + | /* *---------------------------------------------------------------------- * Type values TclGetNumberFromObj *---------------------------------------------------------------------- */ |
︙ |
Changes to generic/tclObj.c.
︙ | |||
2512 2513 2514 2515 2516 2517 2518 | 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 | - + | return TclGetLongFromObj(interp, objPtr, (long *) intPtr); #else long l; if (TclGetLongFromObj(interp, objPtr, &l) != TCL_OK) { return TCL_ERROR; } |
︙ | |||
2792 2793 2794 2795 2796 2797 2798 | 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 | - + - + | if (objPtr->typePtr == &tclIntType) { *longPtr = objPtr->internalRep.wideValue; return TCL_OK; } #else if (objPtr->typePtr == &tclIntType) { /* |
︙ | |||
2839 2840 2841 2842 2843 2844 2845 | 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 | + - + + + + - + - - + + + | unsigned char *bytes = (unsigned char *) &scratch; if (mp_to_unsigned_bin_n(&big, bytes, &numBytes) == MP_OKAY) { while (numBytes-- > 0) { value = (value << CHAR_BIT) | *bytes++; } if (big.sign) { if (value <= 1 + (unsigned long)LONG_MAX) { |
︙ | |||
3078 3079 3080 3081 3082 3083 3084 | 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 | + - + + + + - + - - + + + | unsigned char *bytes = (unsigned char *) &scratch; if (mp_to_unsigned_bin_n(&big, bytes, &numBytes) == MP_OKAY) { while (numBytes-- > 0) { value = (value << CHAR_BIT) | *bytes++; } if (big.sign) { if (value <= -(Tcl_WideUInt)WIDE_MIN) { |
︙ | |||
3625 3626 3627 3628 3629 3630 3631 | 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 | - + | } else { *typePtr = TCL_NUMBER_DOUBLE; } *clientDataPtr = &objPtr->internalRep.doubleValue; return TCL_OK; } if (objPtr->typePtr == &tclIntType) { |
︙ |
Changes to generic/tclStubInit.c.
︙ | |||
291 292 293 294 295 296 297 | 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 | - + - + | * signature. Tcl 9 must find a better solution, but that cannot be done * without introducing a binary incompatibility. */ static int exprInt(Tcl_Interp *interp, const char *expr, int *ptr){ long longValue; int result = Tcl_ExprLong(interp, expr, &longValue); if (result == TCL_OK) { |
︙ |
Changes to tests/compExpr-old.test.
︙ | |||
327 328 329 330 331 332 333 | 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 | - + - - - - - + - - - | } -returnCodes error -match glob -result * test compExpr-old-9.1 {CompileRelationalExpr: just shift expr} {expr 3<<2} 12 test compExpr-old-9.2 {CompileRelationalExpr: just shift expr} {expr 0xff>>2} 63 test compExpr-old-9.3 {CompileRelationalExpr: just shift expr} {expr -1>>2} -1 test compExpr-old-9.4 {CompileRelationalExpr: just shift expr} {expr {1<<3}} 8 |
︙ |
Changes to tests/execute.test.
︙ | |||
801 802 803 804 805 806 807 | 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 | - - - + + + | } 1 # wide ints have more bits of precision than doubles, but we convert anyway test execute-7.7 {Wide int handling in INST_EQ and [incr]} { set x [expr {wide(1)<<62}] set y [expr {$x+1}] expr {double($x) == double($y)} } 1 |
︙ | |||
883 884 885 886 887 888 889 | 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 | - + - - + + - + | } 1 test execute-7.31 {Wide int handling in abs()} { set x 0xa23456871234568 incr x set y 0x123456871234568 concat [expr {abs($x)}] [expr {abs($y)}] } {730503879441204585 81985533099853160} |
︙ |
Changes to tests/expr-old.test.
︙ | |||
810 811 812 813 814 815 816 | 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 | - + - + | expr int(-1.4) } {-1} test expr-old-32.32 {math functions in expressions} { expr int(-1.6) } {-1} test expr-old-32.33 {math functions in expressions} { expr int(1e60) |
︙ | |||
1032 1033 1034 1035 1036 1037 1038 | 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 | - - + + | list [catch {testexprlong 0x100000000} result] $result } \ -result {1 {integer value too large to represent*}} test expr-old-37.8 {Tcl_ExprLong handles overflows} testexprlong { testexprlong -0x80000000 } {This is a result: -2147483648} test expr-old-37.9 {Tcl_ExprLong handles overflows} {testexprlong longIs32bit} { |
︙ | |||
1057 1058 1059 1060 1061 1062 1063 | 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 | - - - + + + + + + + | -body { list [catch {testexprlong 4294967296.} result] $result } \ -result {1 {integer value too large to represent*}} test expr-old-37.14 {Tcl_ExprLong handles overflows} testexprlong { testexprlong -2147483648. } {This is a result: -2147483648} |
︙ |
Changes to tests/expr.test.
︙ | |||
412 413 414 415 416 417 418 | 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 | - + - + - - - | expr {1ea} } -returnCodes error -match glob -result * test expr-9.1 {CompileRelationalExpr: just shift expr} {expr 3<<2} 12 test expr-9.2 {CompileRelationalExpr: just shift expr} {expr 0xff>>2} 63 test expr-9.3 {CompileRelationalExpr: just shift expr} {expr -1>>2} -1 test expr-9.4 {CompileRelationalExpr: just shift expr} {expr {1<<3}} 8 |
︙ | |||
1400 1401 1402 1403 1404 1405 1406 | 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 | - - + + | # Some compilers get this wrong; ensure that we work around it correctly test expr-24.1 {expr edge cases; shifting} {expr int(5)>>32} 0 test expr-24.2 {expr edge cases; shifting} {expr int(5)>>63} 0 test expr-24.3 {expr edge cases; shifting} {expr wide(5)>>32} 0 test expr-24.4 {expr edge cases; shifting} {expr wide(5)>>63} 0 |
︙ | |||
5804 5805 5806 5807 5808 5809 5810 | 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 | - + - + - + | test expr-32.8 {bignum regression} { expr {0%-(1<<63)} } 0 test expr-32.9 {bignum regression} { expr {0%-(1+(1<<63))} } 0 |
︙ | |||
5918 5919 5920 5921 5922 5923 5924 | 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 | - + - + - - + + - - + + | } {-2} test expr-34.11 {expr edge cases} { expr {$min / -2} } {1073741824} test expr-34.12 {expr edge cases} { expr {$min % -2} } {0} |
︙ | |||
6715 6716 6717 6718 6719 6720 6721 | 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 | - - + + | list [catch {testexprlongobj 0x100000000} result] $result } \ -result {1 {integer value too large to represent*}} test expr-39.8 {Tcl_ExprLongObj handles overflows} testexprlongobj { testexprlongobj -0x80000000 } {This is a result: -2147483648} test expr-39.9 {Tcl_ExprLongObj handles overflows} {testexprlongobj longIs32bit} { |
︙ | |||
6741 6742 6743 6744 6745 6746 6747 | 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 | - - + + | list [catch {testexprlongobj 4294967296.} result] $result } \ -result {1 {integer value too large to represent*}} test expr-39.14 {Tcl_ExprLongObj handles overflows} testexprlongobj { testexprlongobj -2147483648. } {This is a result: -2147483648} test expr-39.15 {Tcl_ExprLongObj handles overflows} {testexprlongobj longIs32bit} { |
︙ |
Changes to tests/get.test.
︙ | |||
41 42 43 44 45 46 47 | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | - - + + - - + + - - + + - + | test get-1.6 {Tcl_GetInt procedure} testgetint { list [catch {testgetint 44 {16 x}} msg] $msg } {1 {expected integer but got "16 x"}} test get-1.7 {Tcl_GetInt procedure} {testgetint longIs64bit} { list [catch {testgetint 44 18446744073709551616} msg] $msg $errorCode } {1 {integer value too large to represent} {ARITH IOVERFLOW {integer value too large to represent}}} test get-1.8 {Tcl_GetInt procedure} {testgetint longIs64bit} { |
︙ |
Changes to tests/obj.test.
︙ | |||
556 557 558 559 560 561 562 | 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 | - + - + | test obj-33.2 {integer overflow on input} {longIs32bit wideIs64bit} { set x 0xffff; append x ffff list [string is integer $x] [expr { wide($x) }] } {1 4294967295} test obj-33.3 {integer overflow on input} { set x 0x10000; append x 0000 list [string is integer $x] [expr { wide($x) }] |
︙ |
Changes to tests/scan.test.
︙ | |||
15 16 17 18 19 20 21 | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | - - + - - + - | package require tcltest 2 namespace import -force ::tcltest::* } # procedure that returns the range of integers proc int_range {} { |
︙ |
Changes to tests/string.test.
︙ | |||
670 671 672 673 674 675 676 | 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 | - - - + + + | } 1 test string-6.53.$noComp {string is integer, true with whitespace} { run {string is integer " \n1234\v"} } 1 test string-6.54.$noComp {string is integer, false} { list [run {string is integer -fail var 123abc}] $var } {0 3} |
︙ | |||
803 804 805 806 807 808 809 | 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 | - + - - - - + + + + - + - - - + + + - - - + + + | set result "" set numbers [list 1.0 +1.0 ++1.0 +-1.0 -+1.0 -1.0 --1.0 "- +1.0"] foreach num $numbers { lappend result [run {string is double -strict $num}] } return $result } {1 1 0 0 0 1 0 0} |
︙ |