summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/FileSystem.34
-rw-r--r--generic/regc_lex.c2
-rw-r--r--generic/tclStrToD.c25
-rw-r--r--generic/tclStubInit.c3
-rw-r--r--generic/tclTomMath.decls4
-rw-r--r--generic/tclTomMathDecls.h12
-rw-r--r--library/auto.tcl4
-rw-r--r--library/init.tcl2
-rw-r--r--library/install.tcl6
-rw-r--r--library/safe.tcl2
-rw-r--r--tests/get.test4
-rw-r--r--tests/main.test2
-rw-r--r--tests/string.test17
-rw-r--r--unix/Makefile.in5
-rw-r--r--win/Makefile.in1
-rwxr-xr-xwin/configure2
-rw-r--r--win/configure.ac2
-rw-r--r--win/makefile.vc1
18 files changed, 55 insertions, 43 deletions
diff --git a/doc/FileSystem.3 b/doc/FileSystem.3
index 99acf7e..4583b22 100644
--- a/doc/FileSystem.3
+++ b/doc/FileSystem.3
@@ -150,7 +150,7 @@ long long
unsigned
\fBTcl_GetBlockSizeFromStat\fR(\fIstatPtr\fR)
.sp
-Tcl_WideUInt
+unsigned long long
\fBTcl_GetBlocksFromStat\fR(\fIstatPtr\fR)
.sp
long long
@@ -177,7 +177,7 @@ unsigned
long long
\fBTcl_GetModificationTimeFromStat\fR(\fIstatPtr\fR)
.sp
-Tcl_WideUInt
+unsigned long long
\fBTcl_GetSizeFromStat\fR(\fIstatPtr\fR)
.sp
int
diff --git a/generic/regc_lex.c b/generic/regc_lex.c
index 2914cbb..2c0ddeb 100644
--- a/generic/regc_lex.c
+++ b/generic/regc_lex.c
@@ -1005,7 +1005,7 @@ brenext(
if (LASTTYPE(EMPTY) || LASTTYPE('(') || LASTTYPE('^')) {
RETV(PLAIN, c);
}
- RET('*');
+ RETV('*', 1);
break;
case CHR('['):
if (HAVE(6) && *(v->now+0) == CHR('[') &&
diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c
index 7aee804..b213bed 100644
--- a/generic/tclStrToD.c
+++ b/generic/tclStrToD.c
@@ -22,6 +22,11 @@
#define copysign _copysign
#endif
+#ifndef PRIx64
+# define PRIx64 TCL_LL_MODIFIER "x"
+#endif
+
+
/*
* This code supports (at least hypothetically), IBM, Cray, VAX and IEEE-754
* floating point; of these, only IEEE-754 can represent NaN. IEEE-754 can be
@@ -899,12 +904,14 @@ TclParseNumber(
under = 0;
state = BINARY;
break;
- } else if (c == '_' && !(flags & TCL_PARSE_NO_UNDERSCORE)) {
- /* Ignore numeric "white space" */
- under = 1;
- break;
+ } else if (c == '_' && !(flags & TCL_PARSE_NO_UNDERSCORE)) {
+ /* Ignore numeric "white space" */
+ under = 1;
+ break;
} else if (c != '1') {
goto endgame;
+ } else {
+ under = 0;
}
if (objPtr != NULL) {
shift = numTrailZeros + 1;
@@ -944,11 +951,11 @@ TclParseNumber(
under = 0;
numTrailZeros++;
} else if ( ! isdigit(UCHAR(c))) {
- if (c == '_' && !(flags & TCL_PARSE_NO_UNDERSCORE)) {
- /* Ignore numeric "white space" */
- under = 1;
- break;
- }
+ if (c == '_' && !(flags & TCL_PARSE_NO_UNDERSCORE)) {
+ /* Ignore numeric "white space" */
+ under = 1;
+ break;
+ }
goto endgame;
}
under = 0;
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index 6bd6e53..e29330b 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -138,6 +138,7 @@ static void uniCodePanic(void) {
#define TclBN_mp_to_radix mp_to_radix
#define TclBN_mp_to_ubin mp_to_ubin
#define TclBN_mp_ubin_size mp_ubin_size
+#define TclBN_mp_unpack mp_unpack
#define TclBN_mp_xor mp_xor
#define TclBN_mp_zero mp_zero
#define TclBN_s_mp_add s_mp_add
@@ -1199,7 +1200,7 @@ const TclTomMathStubs tclTomMathStubs = {
TclBN_mp_set_u64, /* 68 */
TclBN_mp_get_mag_u64, /* 69 */
TclBN_mp_set_i64, /* 70 */
- 0, /* 71 */
+ TclBN_mp_unpack, /* 71 */
0, /* 72 */
TclBN_mp_tc_and, /* 73 */
TclBN_mp_tc_or, /* 74 */
diff --git a/generic/tclTomMath.decls b/generic/tclTomMath.decls
index 9d6eb1c..5ea16f1 100644
--- a/generic/tclTomMath.decls
+++ b/generic/tclTomMath.decls
@@ -244,6 +244,10 @@ declare 69 {
declare 70 {
void TclBN_mp_set_i64(mp_int *a, int64_t i)
}
+declare 71 {
+ mp_err MP_WUR TclBN_mp_unpack(mp_int *rop, size_t count, mp_order order, size_t size,
+ mp_endian endian, size_t nails, const void *op)
+}
# Added in libtommath 1.1.0
declare 73 {deprecated {merged with mp_and}} {
diff --git a/generic/tclTomMathDecls.h b/generic/tclTomMathDecls.h
index 1427e8b..4c1505f 100644
--- a/generic/tclTomMathDecls.h
+++ b/generic/tclTomMathDecls.h
@@ -141,6 +141,7 @@ MODULE_SCOPE mp_err TclBN_s_mp_sub_d(const mp_int *a, mp_digit b, mp_int *c);
#define mp_to_radix TclBN_mp_to_radix
#define mp_to_ubin TclBN_mp_to_ubin
#define mp_ubin_size TclBN_mp_ubin_size
+#define mp_unpack TclBN_mp_unpack
#define mp_xor TclBN_mp_xor
#define mp_zero TclBN_mp_zero
#define s_mp_add TclBN_s_mp_add
@@ -379,7 +380,11 @@ EXTERN void TclBN_mp_set_u64(mp_int *a, uint64_t i);
EXTERN uint64_t TclBN_mp_get_mag_u64(const mp_int *a) MP_WUR;
/* 70 */
EXTERN void TclBN_mp_set_i64(mp_int *a, int64_t i);
-/* Slot 71 is reserved */
+/* 71 */
+EXTERN mp_err TclBN_mp_unpack(mp_int *rop, size_t count,
+ mp_order order, size_t size,
+ mp_endian endian, size_t nails,
+ const void *op) MP_WUR;
/* Slot 72 is reserved */
/* 73 */
TCL_DEPRECATED("merged with mp_and")
@@ -482,7 +487,7 @@ typedef struct TclTomMathStubs {
void (*tclBN_mp_set_u64) (mp_int *a, uint64_t i); /* 68 */
uint64_t (*tclBN_mp_get_mag_u64) (const mp_int *a) MP_WUR; /* 69 */
void (*tclBN_mp_set_i64) (mp_int *a, int64_t i); /* 70 */
- void (*reserved71)(void);
+ mp_err (*tclBN_mp_unpack) (mp_int *rop, size_t count, mp_order order, size_t size, mp_endian endian, size_t nails, const void *op) MP_WUR; /* 71 */
void (*reserved72)(void);
TCL_DEPRECATED_API("merged with mp_and") mp_err (*tclBN_mp_tc_and) (const mp_int *a, const mp_int *b, mp_int *c); /* 73 */
TCL_DEPRECATED_API("merged with mp_or") mp_err (*tclBN_mp_tc_or) (const mp_int *a, const mp_int *b, mp_int *c); /* 74 */
@@ -648,7 +653,8 @@ extern const TclTomMathStubs *tclTomMathStubsPtr;
(tclTomMathStubsPtr->tclBN_mp_get_mag_u64) /* 69 */
#define TclBN_mp_set_i64 \
(tclTomMathStubsPtr->tclBN_mp_set_i64) /* 70 */
-/* Slot 71 is reserved */
+#define TclBN_mp_unpack \
+ (tclTomMathStubsPtr->tclBN_mp_unpack) /* 71 */
/* Slot 72 is reserved */
#define TclBN_mp_tc_and \
(tclTomMathStubsPtr->tclBN_mp_tc_and) /* 73 */
diff --git a/library/auto.tcl b/library/auto.tcl
index 2eacf8c..5f86c93 100644
--- a/library/auto.tcl
+++ b/library/auto.tcl
@@ -292,7 +292,7 @@ proc auto_mkindex_old {dir args} {
set f ""
set error [catch {
set f [open $file]
- fconfigure $f -encoding utf-8 -eofchar \032
+ fconfigure $f -encoding utf-8 -eofchar "\032 {}"
while {[gets $f line] >= 0} {
if {[regexp {^proc[ ]+([^ ]*)} $line match procName]} {
set procName [lindex [auto_qualify $procName "::"] 0]
@@ -404,7 +404,7 @@ proc auto_mkindex_parser::mkindex {file} {
set scriptFile $file
set fid [open $file]
- fconfigure $fid -encoding utf-8 -eofchar \032
+ fconfigure $fid -encoding utf-8 -eofchar "\032 {}"
set contents [read $fid]
close $fid
diff --git a/library/init.tcl b/library/init.tcl
index c5b9705..c9bfff6 100644
--- a/library/init.tcl
+++ b/library/init.tcl
@@ -442,7 +442,7 @@ proc auto_load_index {} {
continue
} else {
set error [catch {
- fconfigure $f -encoding utf-8 -eofchar \032
+ fconfigure $f -encoding utf-8 -eofchar "\032 {}"
set id [gets $f]
if {$id eq "# Tcl autoload index file, version 2.0"} {
eval [read $f]
diff --git a/library/install.tcl b/library/install.tcl
index 2c5afa7..ce8e80b 100644
--- a/library/install.tcl
+++ b/library/install.tcl
@@ -35,7 +35,7 @@ proc ::practcl::_pkgindex_directory {path} {
# Read the file, and override assumptions as needed
###
set fin [open $file r]
- fconfigure $fin -encoding utf-8 -eofchar \032
+ fconfigure $fin -encoding utf-8 -eofchar "\032 {}"
set dat [read $fin]
close $fin
# Look for a teapot style Package statement
@@ -59,7 +59,7 @@ proc ::practcl::_pkgindex_directory {path} {
foreach file [glob -nocomplain $path/*.tcl] {
if { [file tail $file] == "version_info.tcl" } continue
set fin [open $file r]
- fconfigure $fin -encoding utf-8 -eofchar \032
+ fconfigure $fin -encoding utf-8 -eofchar "\032 {}"
set dat [read $fin]
close $fin
if {![regexp "package provide" $dat]} continue
@@ -79,7 +79,7 @@ proc ::practcl::_pkgindex_directory {path} {
return $buffer
}
set fin [open $pkgidxfile r]
- fconfigure $fin -encoding utf-8 -eofchar \032
+ fconfigure $fin -encoding utf-8 -eofchar "\032 {}"
set dat [read $fin]
close $fin
set trace 0
diff --git a/library/safe.tcl b/library/safe.tcl
index 0efc00f..2ee4531 100644
--- a/library/safe.tcl
+++ b/library/safe.tcl
@@ -980,7 +980,7 @@ proc ::safe::AliasSource {child args} {
set replacementMsg "script error"
set code [catch {
set f [open $realfile]
- fconfigure $f -encoding $encoding -eofchar \032
+ fconfigure $f -encoding $encoding -eofchar "\032 {}"
set contents [read $f]
close $f
::interp eval $child [list info script $file]
diff --git a/tests/get.test b/tests/get.test
index 3ba905b..25f8d77 100644
--- a/tests/get.test
+++ b/tests/get.test
@@ -110,11 +110,11 @@ test get-3.4 {Tcl_GetDouble with iffy numbers} testdoubleobj {
}
} {0.0 0.0 0.0 0.0 0.0 7.0 {expected floating-point number but got "- 0"} 0.0 10.0 2.0}
test get-3.5 {tcl_GetInt with numeric whitespace (i.e. '_')} testgetint {
- lmap x {0_0 " 1_0" "0_2 " " 3_3 " 14__23__32___4 " 0x_a " " 0_07 " " 0o_1_0 " " 0_b1_0 " _33 42_ 0_x15 0_o17 0_d19 } {
+ lmap x {0_0 " 1_0" "0_2 " " 3_3 " 14__23__32___4 " 0x_a " 0b1111_1111 " 0_07 " " 0o_1_0 " " 0b_1_0 " " 0_b1_0 " _33 42_ 0_x15 0_o17 0_d19 } {
catch {testgetint $x} x
set x
}
-} {0 10 2 33 1423324 10 7 8 {expected integer but got " 0_b1_0 "} {expected integer but got "_33"} {expected integer but got "42_"} {expected integer but got "0_x15"} {expected integer but got "0_o17"} {expected integer but got "0_d19"}}
+} {0 10 2 33 1423324 10 255 7 8 2 {expected integer but got " 0_b1_0 "} {expected integer but got "_33"} {expected integer but got "42_"} {expected integer but got "0_x15"} {expected integer but got "0_o17"} {expected integer but got "0_d19"}}
# cleanup
::tcltest::cleanupTests
diff --git a/tests/main.test b/tests/main.test
index 87e0a9a..37f87b4 100644
--- a/tests/main.test
+++ b/tests/main.test
@@ -606,7 +606,7 @@ namespace eval ::tcl::test::main {
catch {set f [open "|[list [interpreter]]" w+]}
catch {chan configure $f -blocking 0}
} -body {
- type $f "chan configure stdin -eofchar \\032
+ type $f "chan configure stdin -eofchar \"\\032 {}\"
if 1 \{\n\032"
variable wait
chan event $f readable \
diff --git a/tests/string.test b/tests/string.test
index 0bc0359..11bc573 100644
--- a/tests/string.test
+++ b/tests/string.test
@@ -511,15 +511,6 @@ test string-5.21.$noComp {string index, surrogates, bug [11ae2be95dac9417]} -con
} -result [list \U100000 {} b]
-proc largest_int {} {
- # This will give us what the largest valid int on this machine is,
- # so we can test for overflow properly below on >32 bit systems
- set int 1
- set exp 7; # assume we get at least 8 bits
- while {wide($int) > 0} { set int [expr {wide(1) << [incr exp]}] }
- return [expr {$int-1}]
-}
-
test string-6.1.$noComp {string is, not enough args} {
list [catch {run {string is}} msg] $msg
} {1 {wrong # args: should be "string is class ?-strict? ?-failindex var? str"}}
@@ -634,7 +625,7 @@ test string-6.37.$noComp {string is double, false on int overflow} -setup {
# Since bignums arrived in Tcl 8.5, the sense of this test changed.
# Now integer values that exceed native limits become bignums, and
# bignums can convert to doubles without error.
- list [run {string is double -fail var [largest_int]0}] $var
+ list [run {string is double -fail var 9223372036854775808}] $var
} -result {1 priorValue}
# string-6.38 removed, underflow on input is no longer an error.
test string-6.39.$noComp {string is double, false} {
@@ -694,7 +685,7 @@ test string-6.54.$noComp {string is integer, false} {
list [run {string is integer -fail var 123abc}] $var
} {0 3}
test string-6.55.$noComp {string is integer, no overflow possible} {
- run {string is integer +[largest_int]0}
+ run {string is integer +9223372036854775808}
} 1
test string-6.56.$noComp {string is integer, false} {
list [run {string is integer -fail var [expr double(1)]}] $var
@@ -864,7 +855,7 @@ test string-6.101.$noComp {string is wideinteger, false} {
list [run {string is wideinteger -fail var 123abc}] $var
} {0 3}
test string-6.102.$noComp {string is wideinteger, false on overflow} {
- list [run {string is wideinteger -fail var +[largest_int]0}] $var
+ list [run {string is wideinteger -fail var +9223372036854775808}] $var
} {0 -1}
test string-6.103.$noComp {string is wideinteger, false} {
list [run {string is wideinteger -fail var [expr double(1)]}] $var
@@ -971,8 +962,6 @@ test string-6.131.$noComp {string is entier, false on bad hex} {
list [run {string is entier -fail var 0X12345611234123456123456562345612345612345612345612345612345612345612345612345612345345XYZ}] $var
} {0 88}
-catch {rename largest_int {}}
-
test string-7.1.$noComp {string last, not enough args} {
list [catch {run {string last a}} msg] $msg
} {1 {wrong # args: should be "string last needleString haystackString ?lastIndex?"}}
diff --git a/unix/Makefile.in b/unix/Makefile.in
index 4ad001e..0dfdaf3 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -340,7 +340,7 @@ TOMMATH_OBJS = bn_s_mp_reverse.o bn_s_mp_mul_digs_fast.o \
bn_mp_set_u64.o bn_mp_shrink.o \
bn_mp_sqr.o bn_mp_sqrt.o bn_mp_sub.o bn_mp_sub_d.o \
bn_mp_signed_rsh.o \
- bn_mp_to_ubin.o \
+ bn_mp_to_ubin.o bn_mp_unpack.o \
bn_s_mp_toom_mul.o bn_s_mp_toom_sqr.o bn_mp_to_radix.o \
bn_mp_ubin_size.o bn_mp_xor.o bn_mp_zero.o bn_s_mp_add.o \
bn_s_mp_mul_digs.o bn_s_mp_sqr.o bn_s_mp_sub.o
@@ -1740,6 +1740,9 @@ bn_mp_to_radix.o: $(TOMMATH_DIR)/bn_mp_to_radix.c $(MATHHDRS)
bn_mp_ubin_size.o: $(TOMMATH_DIR)/bn_mp_ubin_size.c $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_ubin_size.c
+bn_mp_unpack.o: $(TOMMATH_DIR)/bn_mp_unpack.c $(MATHHDRS)
+ $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_unpack.c
+
bn_mp_xor.o: $(TOMMATH_DIR)/bn_mp_xor.c $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_xor.c
diff --git a/win/Makefile.in b/win/Makefile.in
index 26e8b5c..c93f50a 100644
--- a/win/Makefile.in
+++ b/win/Makefile.in
@@ -414,6 +414,7 @@ TOMMATH_OBJS = \
bn_mp_to_ubin.${OBJEXT} \
bn_mp_to_radix.${OBJEXT} \
bn_mp_ubin_size.${OBJEXT} \
+ bn_mp_unpack.${OBJEXT} \
bn_mp_xor.${OBJEXT} \
bn_mp_zero.${OBJEXT} \
bn_s_mp_add.${OBJEXT} \
diff --git a/win/configure b/win/configure
index 95d9bbb..5ad3d2f 100755
--- a/win/configure
+++ b/win/configure
@@ -5698,7 +5698,7 @@ eval "TCL_STUB_LIB_SPEC=\"-L${libdir} ${TCL_STUB_LIB_FLAG}\""
eval "TCL_BUILD_STUB_LIB_PATH=\"`$CYGPATH $(pwd)`/${TCL_STUB_LIB_FILE}\""
eval "TCL_STUB_LIB_PATH=\"${libdir}/${TCL_STUB_LIB_FILE}\""
-if test ${SHARED_BUILD} = 0 ; then
+if test ${SHARED_BUILD} = 0 -o "$GCC" != "yes" ; then
eval "TCL_LIB_FILE=\"${LIBPREFIX}tcl${VER}${LIBSUFFIX}\""
else
eval "TCL_LIB_FILE=\"${LIBPREFIX}tcl${VER}${DLLSUFFIX}.a\""
diff --git a/win/configure.ac b/win/configure.ac
index 85680ad..02b6363 100644
--- a/win/configure.ac
+++ b/win/configure.ac
@@ -327,7 +327,7 @@ eval "TCL_STUB_LIB_SPEC=\"-L${libdir} ${TCL_STUB_LIB_FLAG}\""
eval "TCL_BUILD_STUB_LIB_PATH=\"`$CYGPATH $(pwd)`/${TCL_STUB_LIB_FILE}\""
eval "TCL_STUB_LIB_PATH=\"${libdir}/${TCL_STUB_LIB_FILE}\""
-if test ${SHARED_BUILD} = 0 ; then
+if test ${SHARED_BUILD} = 0 -o "$GCC" != "yes" ; then
eval "TCL_LIB_FILE=\"${LIBPREFIX}tcl${VER}${LIBSUFFIX}\""
else
eval "TCL_LIB_FILE=\"${LIBPREFIX}tcl${VER}${DLLSUFFIX}.a\""
diff --git a/win/makefile.vc b/win/makefile.vc
index ed3a852..66879ab 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -393,6 +393,7 @@ TOMMATHOBJS = \
$(TMP_DIR)\bn_mp_to_ubin.obj \
$(TMP_DIR)\bn_mp_to_radix.obj \
$(TMP_DIR)\bn_mp_ubin_size.obj \
+ $(TMP_DIR)\bn_mp_unpack.obj \
$(TMP_DIR)\bn_mp_xor.obj \
$(TMP_DIR)\bn_mp_zero.obj \
$(TMP_DIR)\bn_s_mp_add.obj \