/util/lexgen/tests/

tommath/bn_mp_2expt.c | 8 ++++---- libtommath/bn_mp_abs.c | 8 ++++---- libtommath/bn_mp_add.c | 8 ++++---- libtommath/bn_mp_add_d.c | 8 ++++---- libtommath/bn_mp_addmod.c | 8 ++++---- libtommath/bn_mp_and.c | 8 ++++---- libtommath/bn_mp_clamp.c | 8 ++++---- libtommath/bn_mp_clear.c | 8 ++++---- libtommath/bn_mp_clear_multi.c | 8 ++++---- libtommath/bn_mp_cmp.c | 8 ++++---- libtommath/bn_mp_cmp_d.c | 8 ++++---- libtommath/bn_mp_cmp_mag.c | 8 ++++---- libtommath/bn_mp_cnt_lsb.c | 8 ++++---- libtommath/bn_mp_copy.c | 8 ++++---- libtommath/bn_mp_count_bits.c | 8 ++++---- libtommath/bn_mp_div.c | 8 ++++---- libtommath/bn_mp_div_2.c | 8 ++++---- libtommath/bn_mp_div_2d.c | 8 ++++---- libtommath/bn_mp_div_3.c | 8 ++++---- libtommath/bn_mp_div_d.c | 8 ++++---- libtommath/bn_mp_dr_is_modulus.c | 8 ++++---- libtommath/bn_mp_dr_reduce.c | 8 ++++---- libtommath/bn_mp_dr_setup.c | 8 ++++---- libtommath/bn_mp_exch.c | 8 ++++---- libtommath/bn_mp_expt_d.c | 8 ++++---- libtommath/bn_mp_exptmod.c | 8 ++++---- libtommath/bn_mp_exptmod_fast.c | 8 ++++---- libtommath/bn_mp_exteuclid.c | 8 ++++---- libtommath/bn_mp_fread.c | 8 ++++---- libtommath/bn_mp_fwrite.c | 8 ++++---- libtommath/bn_mp_gcd.c | 8 ++++---- libtommath/bn_mp_get_int.c | 8 ++++---- libtommath/bn_mp_grow.c | 8 ++++---- libtommath/bn_mp_init.c | 8 ++++---- libtommath/bn_mp_init_copy.c | 8 ++++---- libtommath/bn_mp_init_multi.c | 8 ++++---- libtommath/bn_mp_init_set.c | 8 ++++---- libtommath/bn_mp_init_set_int.c | 8 ++++---- libtommath/bn_mp_init_size.c | 8 ++++---- libtommath/bn_mp_invmod.c | 8 ++++---- libtommath/bn_mp_invmod_slow.c | 8 ++++---- libtommath/bn_mp_is_square.c | 8 ++++---- libtommath/bn_mp_jacobi.c | 8 ++++---- libtommath/bn_mp_karatsuba_mul.c | 8 ++++---- libtommath/bn_mp_karatsuba_sqr.c | 8 ++++---- libtommath/bn_mp_lcm.c | 8 ++++---- libtommath/bn_mp_lshd.c | 8 ++++---- libtommath/bn_mp_mod.c | 8 ++++---- libtommath/bn_mp_mod_2d.c | 8 ++++---- libtommath/bn_mp_mod_d.c | 8 ++++---- libtommath/bn_mp_montgomery_calc_normalization.c | 8 ++++---- libtommath/bn_mp_montgomery_reduce.c | 8 ++++---- libtommath/bn_mp_montgomery_setup.c | 8 ++++---- libtommath/bn_mp_mul.c | 8 ++++---- libtommath/bn_mp_mul_2.c | 8 ++++---- libtommath/bn_mp_mul_2d.c | 8 ++++---- libtommath/bn_mp_mul_d.c | 8 ++++---- libtommath/bn_mp_mulmod.c | 8 ++++---- libtommath/bn_mp_n_root.c | 8 ++++---- libtommath/bn_mp_neg.c | 8 ++++---- libtommath/bn_mp_or.c | 8 ++++---- libtommath/bn_mp_prime_fermat.c | 8 ++++---- libtommath/bn_mp_prime_is_divisible.c | 8 ++++---- libtommath/bn_mp_prime_is_prime.c | 8 ++++---- libtommath/bn_mp_prime_miller_rabin.c | 8 ++++---- libtommath/bn_mp_prime_next_prime.c | 8 ++++---- libtommath/bn_mp_prime_rabin_miller_trials.c | 8 ++++---- libtommath/bn_mp_prime_random_ex.c | 8 ++++---- libtommath/bn_mp_radix_size.c | 8 ++++---- libtommath/bn_mp_radix_smap.c | 8 ++++---- libtommath/bn_mp_rand.c | 8 ++++---- libtommath/bn_mp_read_radix.c | 8 ++++---- libtommath/bn_mp_read_signed_bin.c | 8 ++++---- libtommath/bn_mp_read_unsigned_bin.c | 8 ++++---- libtommath/bn_mp_reduce.c | 8 ++++---- libtommath/bn_mp_reduce_2k.c | 8 ++++---- libtommath/bn_mp_reduce_2k_l.c | 8 ++++---- libtommath/bn_mp_reduce_2k_setup.c | 8 ++++---- libtommath/bn_mp_reduce_2k_setup_l.c | 8 ++++---- libtommath/bn_mp_reduce_is_2k.c | 8 ++++---- libtommath/bn_mp_reduce_is_2k_l.c | 8 ++++---- libtommath/bn_mp_reduce_setup.c | 8 ++++---- libtommath/bn_mp_rshd.c | 8 ++++---- libtommath/bn_mp_set.c | 8 ++++---- libtommath/bn_mp_set_int.c | 8 ++++---- libtommath/bn_mp_shrink.c | 8 ++++---- libtommath/bn_mp_signed_bin_size.c | 8 ++++---- libtommath/bn_mp_sqr.c | 8 ++++---- libtommath/bn_mp_sqrmod.c | 8 ++++---- libtommath/bn_mp_sqrt.c | 8 ++++---- libtommath/bn_mp_sub.c | 8 ++++---- libtommath/bn_mp_sub_d.c | 8 ++++---- libtommath/bn_mp_submod.c | 8 ++++---- libtommath/bn_mp_to_signed_bin.c | 8 ++++---- libtommath/bn_mp_to_signed_bin_n.c | 8 ++++---- libtommath/bn_mp_to_unsigned_bin.c | 8 ++++---- libtommath/bn_mp_to_unsigned_bin_n.c | 8 ++++---- libtommath/bn_mp_toom_mul.c | 8 ++++---- libtommath/bn_mp_toom_sqr.c | 8 ++++---- libtommath/bn_mp_toradix.c | 8 ++++---- libtommath/bn_mp_toradix_n.c | 8 ++++---- libtommath/bn_mp_unsigned_bin_size.c | 8 ++++---- libtommath/bn_mp_xor.c | 8 ++++---- libtommath/bn_mp_zero.c | 8 ++++---- libtommath/bn_prime_tab.c | 8 ++++---- libtommath/bn_reverse.c | 8 ++++---- libtommath/bn_s_mp_add.c | 8 ++++---- libtommath/bn_s_mp_exptmod.c | 8 ++++---- libtommath/bn_s_mp_mul_digs.c | 8 ++++---- libtommath/bn_s_mp_mul_high_digs.c | 8 ++++---- libtommath/bn_s_mp_sqr.c | 8 ++++---- libtommath/bn_s_mp_sub.c | 8 ++++---- libtommath/bncore.c | 8 ++++---- libtommath/booker.pl | 2 +- libtommath/demo/demo.c | 6 +++--- libtommath/demo/timing.c | 6 +++--- libtommath/etc/2kprime.c | 6 +++--- libtommath/etc/drprime.c | 6 +++--- libtommath/etc/mersenne.c | 6 +++--- libtommath/etc/mont.c | 6 +++--- libtommath/etc/pprime.c | 6 +++--- libtommath/etc/tune.c | 6 +++--- libtommath/logs/index.html | 6 +++--- libtommath/makefile.cygwin_dll | 6 +++--- libtommath/mtest/logtab.h | 6 +++--- libtommath/mtest/mpi-config.h | 8 ++++---- libtommath/mtest/mpi-types.h | 6 +++--- libtommath/mtest/mpi.c | 8 ++++---- libtommath/mtest/mpi.h | 8 ++++---- libtommath/mtest/mtest.c | 6 +++--- libtommath/tommath.h | 6 +++--- libtommath/tommath_class.h | 6 +++--- libtommath/tommath_superclass.h | 6 +++--- 139 files changed, 537 insertions(+), 537 deletions(-) diff --git a/libtommath/bn_error.c b/libtommath/bn_error.c index d96ea2a..b1b7177 100644 --- a/libtommath/bn_error.c +++ b/libtommath/bn_error.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ static const struct { @@ -42,6 +42,6 @@ char *mp_error_to_string(int code) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_error.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_error.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_fast_mp_invmod.c b/libtommath/bn_fast_mp_invmod.c index 744ae4f..ff03dff 100644 --- a/libtommath/bn_fast_mp_invmod.c +++ b/libtommath/bn_fast_mp_invmod.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes the modular inverse via binary extended euclidean algorithm, @@ -143,6 +143,6 @@ LBL_ERR:mp_clear_multi (&x, &y, &u, &v, &B, &D, NULL); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_fast_mp_invmod.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_fast_mp_invmod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_fast_mp_montgomery_reduce.c b/libtommath/bn_fast_mp_montgomery_reduce.c index 45a4089..b6c0694 100644 --- a/libtommath/bn_fast_mp_montgomery_reduce.c +++ b/libtommath/bn_fast_mp_montgomery_reduce.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes xR**-1 == x (mod N) via Montgomery Reduction @@ -167,6 +167,6 @@ int fast_mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_fast_mp_montgomery_reduce.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_fast_mp_montgomery_reduce.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_fast_s_mp_mul_digs.c b/libtommath/bn_fast_s_mp_mul_digs.c index 86b78b4..91e10d6 100644 --- a/libtommath/bn_fast_s_mp_mul_digs.c +++ b/libtommath/bn_fast_s_mp_mul_digs.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Fast (comba) multiplier @@ -102,6 +102,6 @@ int fast_s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_fast_s_mp_mul_digs.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_fast_s_mp_mul_digs.c,v $ */ +/* $Revision: 1.8 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_fast_s_mp_mul_high_digs.c b/libtommath/bn_fast_s_mp_mul_high_digs.c index 607630a..5b114d7 100644 --- a/libtommath/bn_fast_s_mp_mul_high_digs.c +++ b/libtommath/bn_fast_s_mp_mul_high_digs.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* this is a modified version of fast_s_mul_digs that only produces @@ -93,6 +93,6 @@ int fast_s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_fast_s_mp_mul_high_digs.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_fast_s_mp_mul_high_digs.c,v $ */ +/* $Revision: 1.6 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_fast_s_mp_sqr.c b/libtommath/bn_fast_s_mp_sqr.c index 50adf00..19e92ef 100644 --- a/libtommath/bn_fast_s_mp_sqr.c +++ b/libtommath/bn_fast_s_mp_sqr.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* the jist of squaring... @@ -109,6 +109,6 @@ int fast_s_mp_sqr (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_fast_s_mp_sqr.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_fast_s_mp_sqr.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_2expt.c b/libtommath/bn_mp_2expt.c index a9d3e9c..f422ffc 100644 --- a/libtommath/bn_mp_2expt.c +++ b/libtommath/bn_mp_2expt.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes a = 2**b @@ -43,6 +43,6 @@ mp_2expt (mp_int * a, int b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_2expt.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_2expt.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_abs.c b/libtommath/bn_mp_abs.c index 2a7f02c..09dd722 100644 --- a/libtommath/bn_mp_abs.c +++ b/libtommath/bn_mp_abs.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* b = |a| @@ -38,6 +38,6 @@ mp_abs (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_abs.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_abs.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_add.c b/libtommath/bn_mp_add.c index b7effdb..be20644 100644 --- a/libtommath/bn_mp_add.c +++ b/libtommath/bn_mp_add.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* high level addition (handles signs) */ @@ -48,6 +48,6 @@ int mp_add (mp_int * a, mp_int * b, mp_int * c) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_add.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_add.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_add_d.c b/libtommath/bn_mp_add_d.c index 598acab..8ca36c1 100644 --- a/libtommath/bn_mp_add_d.c +++ b/libtommath/bn_mp_add_d.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* single digit addition */ @@ -107,6 +107,6 @@ mp_add_d (mp_int * a, mp_digit b, mp_int * c) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_add_d.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_add_d.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_addmod.c b/libtommath/bn_mp_addmod.c index b0b4d8b..6d8afe1 100644 --- a/libtommath/bn_mp_addmod.c +++ b/libtommath/bn_mp_addmod.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* d = a + b (mod c) */ @@ -36,6 +36,6 @@ mp_addmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_addmod.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_addmod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_and.c b/libtommath/bn_mp_and.c index ff61017..8ea2287 100644 --- a/libtommath/bn_mp_and.c +++ b/libtommath/bn_mp_and.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* AND two ints together */ @@ -52,6 +52,6 @@ mp_and (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_and.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_and.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_clamp.c b/libtommath/bn_mp_clamp.c index 4f2f8ba..359c2ff 100644 --- a/libtommath/bn_mp_clamp.c +++ b/libtommath/bn_mp_clamp.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* trim unused digits @@ -39,6 +39,6 @@ mp_clamp (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_clamp.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_clamp.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_clear.c b/libtommath/bn_mp_clear.c index e1fe10d..a65f0a3 100644 --- a/libtommath/bn_mp_clear.c +++ b/libtommath/bn_mp_clear.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* clear one (frees) */ @@ -39,6 +39,6 @@ mp_clear (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_clear.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_clear.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_clear_multi.c b/libtommath/bn_mp_clear_multi.c index e9910e8..daaea79 100644 --- a/libtommath/bn_mp_clear_multi.c +++ b/libtommath/bn_mp_clear_multi.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include @@ -29,6 +29,6 @@ void mp_clear_multi(mp_int *mp, ...) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_clear_multi.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_clear_multi.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_cmp.c b/libtommath/bn_mp_cmp.c index 6361730..533f36b 100644 --- a/libtommath/bn_mp_cmp.c +++ b/libtommath/bn_mp_cmp.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* compare two ints (signed)*/ @@ -38,6 +38,6 @@ mp_cmp (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_cmp.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_cmp.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_cmp_d.c b/libtommath/bn_mp_cmp_d.c index 92c3567..724c1c3 100644 --- a/libtommath/bn_mp_cmp_d.c +++ b/libtommath/bn_mp_cmp_d.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* compare a digit */ @@ -39,6 +39,6 @@ int mp_cmp_d(mp_int * a, mp_digit b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_cmp_d.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_cmp_d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_cmp_mag.c b/libtommath/bn_mp_cmp_mag.c index 31c8221..693eb7c 100644 --- a/libtommath/bn_mp_cmp_mag.c +++ b/libtommath/bn_mp_cmp_mag.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* compare maginitude of two ints (unsigned) */ @@ -50,6 +50,6 @@ int mp_cmp_mag (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_cmp_mag.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_cmp_mag.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_cnt_lsb.c b/libtommath/bn_mp_cnt_lsb.c index 4aa68b5..66d1a74 100644 --- a/libtommath/bn_mp_cnt_lsb.c +++ b/libtommath/bn_mp_cnt_lsb.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ static const int lnz[16] = { @@ -48,6 +48,6 @@ int mp_cnt_lsb(mp_int *a) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_cnt_lsb.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_cnt_lsb.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_copy.c b/libtommath/bn_mp_copy.c index a5d5e6f..b0de16d 100644 --- a/libtommath/bn_mp_copy.c +++ b/libtommath/bn_mp_copy.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* copy, b = a */ @@ -63,6 +63,6 @@ mp_copy (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_copy.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_copy.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_count_bits.c b/libtommath/bn_mp_count_bits.c index 44c0cff..8bc5657 100644 --- a/libtommath/bn_mp_count_bits.c +++ b/libtommath/bn_mp_count_bits.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* returns the number of bits in an int */ @@ -40,6 +40,6 @@ mp_count_bits (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_count_bits.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_count_bits.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_div.c b/libtommath/bn_mp_div.c index 4a94172..aee9c94 100644 --- a/libtommath/bn_mp_div.c +++ b/libtommath/bn_mp_div.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #ifdef BN_MP_DIV_SMALL @@ -287,6 +287,6 @@ LBL_Q:mp_clear (&q); #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_div.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_div.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_div_2.c b/libtommath/bn_mp_div_2.c index bcb17c1..7ee3e5b 100644 --- a/libtommath/bn_mp_div_2.c +++ b/libtommath/bn_mp_div_2.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* b = a/2 */ @@ -63,6 +63,6 @@ int mp_div_2(mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_div_2.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_div_2.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_div_2d.c b/libtommath/bn_mp_div_2d.c index 12a7c99..4f7fa59 100644 --- a/libtommath/bn_mp_div_2d.c +++ b/libtommath/bn_mp_div_2d.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* shift right by a certain bit count (store quotient in c, optional remainder in d) */ @@ -92,6 +92,6 @@ int mp_div_2d (mp_int * a, int b, mp_int * c, mp_int * d) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_div_2d.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_div_2d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_div_3.c b/libtommath/bn_mp_div_3.c index 571991a..3c60269 100644 --- a/libtommath/bn_mp_div_3.c +++ b/libtommath/bn_mp_div_3.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* divide by three (based on routine from MPI and the GMP manual) */ @@ -74,6 +74,6 @@ mp_div_3 (mp_int * a, mp_int *c, mp_digit * d) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_div_3.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_div_3.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_div_d.c b/libtommath/bn_mp_div_d.c index 4f210e6..d64b4b5 100644 --- a/libtommath/bn_mp_div_d.c +++ b/libtommath/bn_mp_div_d.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ static int s_is_power_of_two(mp_digit b, int *p) @@ -105,6 +105,6 @@ int mp_div_d (mp_int * a, mp_digit b, mp_int * c, mp_digit * d) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_div_d.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_div_d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: $ */ diff --git a/libtommath/bn_mp_dr_is_modulus.c b/libtommath/bn_mp_dr_is_modulus.c index 9532df1..5237344 100644 --- a/libtommath/bn_mp_dr_is_modulus.c +++ b/libtommath/bn_mp_dr_is_modulus.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* determines if a number is a valid DR modulus */ @@ -38,6 +38,6 @@ int mp_dr_is_modulus(mp_int *a) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_dr_is_modulus.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_dr_is_modulus.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_dr_reduce.c b/libtommath/bn_mp_dr_reduce.c index 6d63462..e60b578 100644 --- a/libtommath/bn_mp_dr_reduce.c +++ b/libtommath/bn_mp_dr_reduce.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* reduce "x" in place modulo "n" using the Diminished Radix algorithm. @@ -89,6 +89,6 @@ top: } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_dr_reduce.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_dr_reduce.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_dr_setup.c b/libtommath/bn_mp_dr_setup.c index c6f4b2f..1d7d856 100644 --- a/libtommath/bn_mp_dr_setup.c +++ b/libtommath/bn_mp_dr_setup.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* determines the setup value */ @@ -27,6 +27,6 @@ void mp_dr_setup(mp_int *a, mp_digit *d) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_dr_setup.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_dr_setup.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_exch.c b/libtommath/bn_mp_exch.c index 691d9f6..38574e0 100644 --- a/libtommath/bn_mp_exch.c +++ b/libtommath/bn_mp_exch.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* swap the elements of two integers, for cases where you can't simply swap the @@ -29,6 +29,6 @@ mp_exch (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_exch.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_exch.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_expt_d.c b/libtommath/bn_mp_expt_d.c index dfd04eb..4bdc2d1 100644 --- a/libtommath/bn_mp_expt_d.c +++ b/libtommath/bn_mp_expt_d.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* calculate c = a**b using a square-multiply algorithm */ @@ -52,6 +52,6 @@ int mp_expt_d (mp_int * a, mp_digit b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_expt_d.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_expt_d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_exptmod.c b/libtommath/bn_mp_exptmod.c index 714a96f..0231916 100644 --- a/libtommath/bn_mp_exptmod.c +++ b/libtommath/bn_mp_exptmod.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ @@ -107,6 +107,6 @@ int mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_exptmod.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_exptmod.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_exptmod_fast.c b/libtommath/bn_mp_exptmod_fast.c index cb8d94a..2a3b3c9 100644 --- a/libtommath/bn_mp_exptmod_fast.c +++ b/libtommath/bn_mp_exptmod_fast.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes Y == G**X mod P, HAC pp.616, Algorithm 14.85 @@ -316,6 +316,6 @@ LBL_M: #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_exptmod_fast.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_exptmod_fast.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_exteuclid.c b/libtommath/bn_mp_exteuclid.c index 9730fa0..e6c4ce2 100644 --- a/libtommath/bn_mp_exteuclid.c +++ b/libtommath/bn_mp_exteuclid.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Extended euclidean algorithm of (a, b) produces @@ -77,6 +77,6 @@ _ERR: mp_clear_multi(&u1, &u2, &u3, &v1, &v2, &v3, &t1, &t2, &t3, &q, &tmp, NULL } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_exteuclid.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_exteuclid.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_fread.c b/libtommath/bn_mp_fread.c index c1b0128..b344b6f 100644 --- a/libtommath/bn_mp_fread.c +++ b/libtommath/bn_mp_fread.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* read a bigint from a file stream in ASCII */ @@ -62,6 +62,6 @@ int mp_fread(mp_int *a, int radix, FILE *stream) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_fread.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_fread.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_fwrite.c b/libtommath/bn_mp_fwrite.c index 5785c02..a0b4c6b 100644 --- a/libtommath/bn_mp_fwrite.c +++ b/libtommath/bn_mp_fwrite.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ int mp_fwrite(mp_int *a, int radix, FILE *stream) @@ -47,6 +47,6 @@ int mp_fwrite(mp_int *a, int radix, FILE *stream) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_fwrite.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_fwrite.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_gcd.c b/libtommath/bn_mp_gcd.c index bbc5421..b39ba90 100644 --- a/libtommath/bn_mp_gcd.c +++ b/libtommath/bn_mp_gcd.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Greatest Common Divisor using the binary method */ @@ -100,6 +100,6 @@ LBL_U:mp_clear (&v); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_gcd.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_gcd.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_get_int.c b/libtommath/bn_mp_get_int.c index 269be79..17162e2 100644 --- a/libtommath/bn_mp_get_int.c +++ b/libtommath/bn_mp_get_int.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* get the lower 32-bits of an mp_int */ @@ -40,6 +40,6 @@ unsigned long mp_get_int(mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_get_int.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_get_int.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_grow.c b/libtommath/bn_mp_grow.c index e77c774..cf2b949 100644 --- a/libtommath/bn_mp_grow.c +++ b/libtommath/bn_mp_grow.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* grow as required */ @@ -52,6 +52,6 @@ int mp_grow (mp_int * a, int size) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_grow.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_grow.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_init.c b/libtommath/bn_mp_init.c index c866e89..8be27f5 100644 --- a/libtommath/bn_mp_init.c +++ b/libtommath/bn_mp_init.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* init a new mp_int */ @@ -41,6 +41,6 @@ int mp_init (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_init.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_init.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_init_copy.c b/libtommath/bn_mp_init_copy.c index 2e1c207..0160811 100644 --- a/libtommath/bn_mp_init_copy.c +++ b/libtommath/bn_mp_init_copy.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* creates "a" then copies b into it */ @@ -27,6 +27,6 @@ int mp_init_copy (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_init_copy.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_init_copy.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_init_multi.c b/libtommath/bn_mp_init_multi.c index 70148b8..59dc3a9 100644 --- a/libtommath/bn_mp_init_multi.c +++ b/libtommath/bn_mp_init_multi.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include @@ -54,6 +54,6 @@ int mp_init_multi(mp_int *mp, ...) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_init_multi.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_init_multi.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_init_set.c b/libtommath/bn_mp_init_set.c index cdf1249..34edad9 100644 --- a/libtommath/bn_mp_init_set.c +++ b/libtommath/bn_mp_init_set.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* initialize and set a digit */ @@ -27,6 +27,6 @@ int mp_init_set (mp_int * a, mp_digit b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_init_set.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_init_set.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_init_set_int.c b/libtommath/bn_mp_init_set_int.c index a4e87d5..5c55993 100644 --- a/libtommath/bn_mp_init_set_int.c +++ b/libtommath/bn_mp_init_set_int.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* initialize and set a digit */ @@ -26,6 +26,6 @@ int mp_init_set_int (mp_int * a, unsigned long b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_init_set_int.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_init_set_int.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_init_size.c b/libtommath/bn_mp_init_size.c index 4433b16..8e01418 100644 --- a/libtommath/bn_mp_init_size.c +++ b/libtommath/bn_mp_init_size.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* init an mp_init for a given size */ @@ -43,6 +43,6 @@ int mp_init_size (mp_int * a, int size) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_init_size.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_init_size.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_invmod.c b/libtommath/bn_mp_invmod.c index 09e71cd..1546514 100644 --- a/libtommath/bn_mp_invmod.c +++ b/libtommath/bn_mp_invmod.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* hac 14.61, pp608 */ @@ -38,6 +38,6 @@ int mp_invmod (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_invmod.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_invmod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_invmod_slow.c b/libtommath/bn_mp_invmod_slow.c index ff9cc96..eedd47d 100644 --- a/libtommath/bn_mp_invmod_slow.c +++ b/libtommath/bn_mp_invmod_slow.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* hac 14.61, pp608 */ @@ -170,6 +170,6 @@ LBL_ERR:mp_clear_multi (&x, &y, &u, &v, &A, &B, &C, &D, NULL); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_invmod_slow.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_invmod_slow.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_is_square.c b/libtommath/bn_mp_is_square.c index 01f07b3..50c5244 100644 --- a/libtommath/bn_mp_is_square.c +++ b/libtommath/bn_mp_is_square.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Check if remainders are possible squares - fast exclude non-squares */ @@ -104,6 +104,6 @@ ERR:mp_clear(&t); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_is_square.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_is_square.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_jacobi.c b/libtommath/bn_mp_jacobi.c index cb7713d..91cfeea 100644 --- a/libtommath/bn_mp_jacobi.c +++ b/libtommath/bn_mp_jacobi.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes the jacobi c = (a | n) (or Legendre if n is prime) @@ -100,6 +100,6 @@ LBL_A1:mp_clear (&a1); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_jacobi.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_jacobi.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_karatsuba_mul.c b/libtommath/bn_mp_karatsuba_mul.c index 53187dd..8ea2c27 100644 --- a/libtommath/bn_mp_karatsuba_mul.c +++ b/libtommath/bn_mp_karatsuba_mul.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* c = |a| * |b| using Karatsuba Multiplication using @@ -162,6 +162,6 @@ ERR: } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_karatsuba_mul.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_karatsuba_mul.c,v $ */ +/* $Revision: 1.6 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_karatsuba_sqr.c b/libtommath/bn_mp_karatsuba_sqr.c index 7f1f253..a5e198b 100644 --- a/libtommath/bn_mp_karatsuba_sqr.c +++ b/libtommath/bn_mp_karatsuba_sqr.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Karatsuba squaring, computes b = a*a using three @@ -116,6 +116,6 @@ ERR: } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_karatsuba_sqr.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_karatsuba_sqr.c,v $ */ +/* $Revision: 1.6 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_lcm.c b/libtommath/bn_mp_lcm.c index 72a5beb..781eef5 100644 --- a/libtommath/bn_mp_lcm.c +++ b/libtommath/bn_mp_lcm.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes least common multiple as |a*b|/(a, b) */ @@ -55,6 +55,6 @@ LBL_T: } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_lcm.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_lcm.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_lshd.c b/libtommath/bn_mp_lshd.c index 84dfa81..f118cf1 100644 --- a/libtommath/bn_mp_lshd.c +++ b/libtommath/bn_mp_lshd.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* shift left a certain amount of digits */ @@ -62,6 +62,6 @@ int mp_lshd (mp_int * a, int b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_lshd.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_lshd.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_mod.c b/libtommath/bn_mp_mod.c index 16d9d76..f5cf8d0 100644 --- a/libtommath/bn_mp_mod.c +++ b/libtommath/bn_mp_mod.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* c = a mod b, 0 <= c < b */ @@ -43,6 +43,6 @@ mp_mod (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_mod.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_mod_2d.c b/libtommath/bn_mp_mod_2d.c index 2ab7e33..e194a06 100644 --- a/libtommath/bn_mp_mod_2d.c +++ b/libtommath/bn_mp_mod_2d.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* calc a value mod 2**b */ @@ -50,6 +50,6 @@ mp_mod_2d (mp_int * a, int b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_mod_2d.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mod_2d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_mod_d.c b/libtommath/bn_mp_mod_d.c index 91dcbe1..9ca37e6 100644 --- a/libtommath/bn_mp_mod_d.c +++ b/libtommath/bn_mp_mod_d.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ int @@ -22,6 +22,6 @@ mp_mod_d (mp_int * a, mp_digit b, mp_digit * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_mod_d.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mod_d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_montgomery_calc_normalization.c b/libtommath/bn_mp_montgomery_calc_normalization.c index 59dd8ea..c669fe0 100644 --- a/libtommath/bn_mp_montgomery_calc_normalization.c +++ b/libtommath/bn_mp_montgomery_calc_normalization.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* @@ -54,6 +54,6 @@ int mp_montgomery_calc_normalization (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_montgomery_calc_normalization.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_montgomery_calc_normalization.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_montgomery_reduce.c b/libtommath/bn_mp_montgomery_reduce.c index f9305d8..b765090 100644 --- a/libtommath/bn_mp_montgomery_reduce.c +++ b/libtommath/bn_mp_montgomery_reduce.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes xR**-1 == x (mod N) via Montgomery Reduction */ @@ -113,6 +113,6 @@ mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_montgomery_reduce.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_montgomery_reduce.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_montgomery_setup.c b/libtommath/bn_mp_montgomery_setup.c index cea6778..261a9fb 100644 --- a/libtommath/bn_mp_montgomery_setup.c +++ b/libtommath/bn_mp_montgomery_setup.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* setups the montgomery reduction stuff */ @@ -54,6 +54,6 @@ mp_montgomery_setup (mp_int * n, mp_digit * rho) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_montgomery_setup.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_montgomery_setup.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_mul.c b/libtommath/bn_mp_mul.c index 6506635..8b1117a 100644 --- a/libtommath/bn_mp_mul.c +++ b/libtommath/bn_mp_mul.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* high level multiplication (handles sign) */ @@ -61,6 +61,6 @@ int mp_mul (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_mul.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mul.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_mul_2.c b/libtommath/bn_mp_mul_2.c index 96d5710..02455fc 100644 --- a/libtommath/bn_mp_mul_2.c +++ b/libtommath/bn_mp_mul_2.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* b = a*2 */ @@ -77,6 +77,6 @@ int mp_mul_2(mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_mul_2.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mul_2.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_mul_2d.c b/libtommath/bn_mp_mul_2d.c index 88fa080..efeff2e 100644 --- a/libtommath/bn_mp_mul_2d.c +++ b/libtommath/bn_mp_mul_2d.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* shift left by a certain bit count */ @@ -80,6 +80,6 @@ int mp_mul_2d (mp_int * a, int b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_mul_2d.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mul_2d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_mul_d.c b/libtommath/bn_mp_mul_d.c index e86d6ab..00f9a89 100644 --- a/libtommath/bn_mp_mul_d.c +++ b/libtommath/bn_mp_mul_d.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* multiply by a digit */ @@ -74,6 +74,6 @@ mp_mul_d (mp_int * a, mp_digit b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_mul_d.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mul_d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_mulmod.c b/libtommath/bn_mp_mulmod.c index d84c555..003ceb9 100644 --- a/libtommath/bn_mp_mulmod.c +++ b/libtommath/bn_mp_mulmod.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* d = a * b (mod c) */ @@ -35,6 +35,6 @@ int mp_mulmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_mulmod.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mulmod.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_n_root.c b/libtommath/bn_mp_n_root.c index 734d5ea..0e7bedc 100644 --- a/libtommath/bn_mp_n_root.c +++ b/libtommath/bn_mp_n_root.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* find the n'th root of an integer @@ -127,6 +127,6 @@ LBL_T1:mp_clear (&t1); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_n_root.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_n_root.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_neg.c b/libtommath/bn_mp_neg.c index 17e851a..a7d035a 100644 --- a/libtommath/bn_mp_neg.c +++ b/libtommath/bn_mp_neg.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* b = -a */ @@ -35,6 +35,6 @@ int mp_neg (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_neg.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_neg.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_or.c b/libtommath/bn_mp_or.c index 09df58c..bff4995 100644 --- a/libtommath/bn_mp_or.c +++ b/libtommath/bn_mp_or.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* OR two ints together */ @@ -45,6 +45,6 @@ int mp_or (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_or.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_or.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_prime_fermat.c b/libtommath/bn_mp_prime_fermat.c index f6edf9e..c23d77f 100644 --- a/libtommath/bn_mp_prime_fermat.c +++ b/libtommath/bn_mp_prime_fermat.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* performs one Fermat test. @@ -57,6 +57,6 @@ LBL_T:mp_clear (&t); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_prime_fermat.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_fermat.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_prime_is_divisible.c b/libtommath/bn_mp_prime_is_divisible.c index 897c11b..8e7871c 100644 --- a/libtommath/bn_mp_prime_is_divisible.c +++ b/libtommath/bn_mp_prime_is_divisible.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* determines if an integers is divisible by one @@ -45,6 +45,6 @@ int mp_prime_is_divisible (mp_int * a, int *result) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_prime_is_divisible.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_is_divisible.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_prime_is_prime.c b/libtommath/bn_mp_prime_is_prime.c index 135f1d9..c316d62 100644 --- a/libtommath/bn_mp_prime_is_prime.c +++ b/libtommath/bn_mp_prime_is_prime.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* performs a variable number of rounds of Miller-Rabin @@ -78,6 +78,6 @@ LBL_B:mp_clear (&b); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_prime_is_prime.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_is_prime.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_prime_miller_rabin.c b/libtommath/bn_mp_prime_miller_rabin.c index f2d6c7f..ddf0358 100644 --- a/libtommath/bn_mp_prime_miller_rabin.c +++ b/libtommath/bn_mp_prime_miller_rabin.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Miller-Rabin test of "a" to the base of "b" as described in @@ -98,6 +98,6 @@ LBL_N1:mp_clear (&n1); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_prime_miller_rabin.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_miller_rabin.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_prime_next_prime.c b/libtommath/bn_mp_prime_next_prime.c index a875260..daf2ec7 100644 --- a/libtommath/bn_mp_prime_next_prime.c +++ b/libtommath/bn_mp_prime_next_prime.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* finds the next prime after the number "a" using "t" trials @@ -165,6 +165,6 @@ LBL_ERR: #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_prime_next_prime.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_next_prime.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_prime_rabin_miller_trials.c b/libtommath/bn_mp_prime_rabin_miller_trials.c index 30825a3..248c2fd 100644 --- a/libtommath/bn_mp_prime_rabin_miller_trials.c +++ b/libtommath/bn_mp_prime_rabin_miller_trials.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ @@ -47,6 +47,6 @@ int mp_prime_rabin_miller_trials(int size) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_prime_rabin_miller_trials.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_rabin_miller_trials.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_prime_random_ex.c b/libtommath/bn_mp_prime_random_ex.c index baddd10..07aae4b 100644 --- a/libtommath/bn_mp_prime_random_ex.c +++ b/libtommath/bn_mp_prime_random_ex.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* makes a truly random prime of a given size (bits), @@ -120,6 +120,6 @@ error: #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_prime_random_ex.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_random_ex.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_radix_size.c b/libtommath/bn_mp_radix_size.c index cf0a093..1b61e3a 100644 --- a/libtommath/bn_mp_radix_size.c +++ b/libtommath/bn_mp_radix_size.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* returns size of ASCII reprensentation */ @@ -73,6 +73,6 @@ int mp_radix_size (mp_int * a, int radix, int *size) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_radix_size.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_radix_size.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_radix_smap.c b/libtommath/bn_mp_radix_smap.c index 913acad..7d72feb 100644 --- a/libtommath/bn_mp_radix_smap.c +++ b/libtommath/bn_mp_radix_smap.c @@ -12,13 +12,13 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* chars used in radix conversions */ const char *mp_s_rmap = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/"; #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_radix_smap.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_radix_smap.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_rand.c b/libtommath/bn_mp_rand.c index 6de7447..af66a67 100644 --- a/libtommath/bn_mp_rand.c +++ b/libtommath/bn_mp_rand.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* makes a pseudo-random int of a given size */ @@ -50,6 +50,6 @@ mp_rand (mp_int * a, int digits) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_rand.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_rand.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_read_radix.c b/libtommath/bn_mp_read_radix.c index 9a6dd9b..91c46c2 100644 --- a/libtommath/bn_mp_read_radix.c +++ b/libtommath/bn_mp_read_radix.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* read a string [ASCII] in a given radix */ @@ -80,6 +80,6 @@ int mp_read_radix (mp_int * a, const char *str, int radix) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_read_radix.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_read_radix.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_read_signed_bin.c b/libtommath/bn_mp_read_signed_bin.c index ae9e6a8..8da651c 100644 --- a/libtommath/bn_mp_read_signed_bin.c +++ b/libtommath/bn_mp_read_signed_bin.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* read signed bin, big endian, first byte is 0==positive or 1==negative */ @@ -36,6 +36,6 @@ int mp_read_signed_bin (mp_int * a, const unsigned char *b, int c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_read_signed_bin.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_read_signed_bin.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_read_unsigned_bin.c b/libtommath/bn_mp_read_unsigned_bin.c index b94265f..1ebba13 100644 --- a/libtommath/bn_mp_read_unsigned_bin.c +++ b/libtommath/bn_mp_read_unsigned_bin.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* reads a unsigned char array, assumes the msb is stored first [big endian] */ @@ -50,6 +50,6 @@ int mp_read_unsigned_bin (mp_int * a, const unsigned char *b, int c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_read_unsigned_bin.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_read_unsigned_bin.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_reduce.c b/libtommath/bn_mp_reduce.c index e4c8842..21d0730 100644 --- a/libtommath/bn_mp_reduce.c +++ b/libtommath/bn_mp_reduce.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* reduces x mod m, assumes 0 < x < m**2, mu is @@ -95,6 +95,6 @@ CLEANUP: } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_reduce.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_reduce_2k.c b/libtommath/bn_mp_reduce_2k.c index 0bc9f36..d9620c2 100644 --- a/libtommath/bn_mp_reduce_2k.c +++ b/libtommath/bn_mp_reduce_2k.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* reduces a modulo n where n is of the form 2**p - d */ @@ -56,6 +56,6 @@ ERR: #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_reduce_2k.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_reduce_2k_l.c b/libtommath/bn_mp_reduce_2k_l.c index ff50948..f06103d 100644 --- a/libtommath/bn_mp_reduce_2k_l.c +++ b/libtommath/bn_mp_reduce_2k_l.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* reduces a modulo n where n is of the form 2**p - d @@ -57,6 +57,6 @@ ERR: #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_reduce_2k_l.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k_l.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_reduce_2k_setup.c b/libtommath/bn_mp_reduce_2k_setup.c index 2a97cd0..a80e7a2 100644 --- a/libtommath/bn_mp_reduce_2k_setup.c +++ b/libtommath/bn_mp_reduce_2k_setup.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* determines the setup value */ @@ -42,6 +42,6 @@ int mp_reduce_2k_setup(mp_int *a, mp_digit *d) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_reduce_2k_setup.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k_setup.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_reduce_2k_setup_l.c b/libtommath/bn_mp_reduce_2k_setup_l.c index acff733..7cf002e 100644 --- a/libtommath/bn_mp_reduce_2k_setup_l.c +++ b/libtommath/bn_mp_reduce_2k_setup_l.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* determines the setup value */ @@ -39,6 +39,6 @@ ERR: } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_reduce_2k_setup_l.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k_setup_l.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_reduce_is_2k.c b/libtommath/bn_mp_reduce_is_2k.c index e398e19..7308be7 100644 --- a/libtommath/bn_mp_reduce_is_2k.c +++ b/libtommath/bn_mp_reduce_is_2k.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* determines if mp_reduce_2k can be used */ @@ -47,6 +47,6 @@ int mp_reduce_is_2k(mp_int *a) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_reduce_is_2k.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_is_2k.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_reduce_is_2k_l.c b/libtommath/bn_mp_reduce_is_2k_l.c index 82e972d..14a4d21 100644 --- a/libtommath/bn_mp_reduce_is_2k_l.c +++ b/libtommath/bn_mp_reduce_is_2k_l.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* determines if reduce_2k_l can be used */ @@ -39,6 +39,6 @@ int mp_reduce_is_2k_l(mp_int *a) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_reduce_is_2k_l.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_is_2k_l.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_reduce_setup.c b/libtommath/bn_mp_reduce_setup.c index 94bd26f..370f20b 100644 --- a/libtommath/bn_mp_reduce_setup.c +++ b/libtommath/bn_mp_reduce_setup.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* pre-calculate the value required for Barrett reduction @@ -29,6 +29,6 @@ int mp_reduce_setup (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_reduce_setup.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_setup.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_rshd.c b/libtommath/bn_mp_rshd.c index ebc8d5f..2a693c5 100644 --- a/libtommath/bn_mp_rshd.c +++ b/libtommath/bn_mp_rshd.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* shift right a certain amount of digits */ @@ -67,6 +67,6 @@ void mp_rshd (mp_int * a, int b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_rshd.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_rshd.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_set.c b/libtommath/bn_mp_set.c index 9cb64c7..174adcb 100644 --- a/libtommath/bn_mp_set.c +++ b/libtommath/bn_mp_set.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* set to a digit */ @@ -24,6 +24,6 @@ void mp_set (mp_int * a, mp_digit b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_set.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_set.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_set_int.c b/libtommath/bn_mp_set_int.c index 106c4e2..cf10ea1 100644 --- a/libtommath/bn_mp_set_int.c +++ b/libtommath/bn_mp_set_int.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* set a 32-bit const */ @@ -43,6 +43,6 @@ int mp_set_int (mp_int * a, unsigned long b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_set_int.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_set_int.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_shrink.c b/libtommath/bn_mp_shrink.c index ddd72e3..4b8c5ef 100644 --- a/libtommath/bn_mp_shrink.c +++ b/libtommath/bn_mp_shrink.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* shrink a bignum */ @@ -30,6 +30,6 @@ int mp_shrink (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_shrink.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_shrink.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_signed_bin_size.c b/libtommath/bn_mp_signed_bin_size.c index 97fdb96..6739d19 100644 --- a/libtommath/bn_mp_signed_bin_size.c +++ b/libtommath/bn_mp_signed_bin_size.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* get the size for an signed equivalent */ @@ -22,6 +22,6 @@ int mp_signed_bin_size (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_signed_bin_size.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_signed_bin_size.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_sqr.c b/libtommath/bn_mp_sqr.c index 4e75bdb..868ccbb 100644 --- a/libtommath/bn_mp_sqr.c +++ b/libtommath/bn_mp_sqr.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes b = a*a */ @@ -53,6 +53,6 @@ if (a->used >= KARATSUBA_SQR_CUTOFF) { } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_sqr.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_sqr.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_sqrmod.c b/libtommath/bn_mp_sqrmod.c index d0f0a79..161cbbb 100644 --- a/libtommath/bn_mp_sqrmod.c +++ b/libtommath/bn_mp_sqrmod.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* c = a * a (mod b) */ @@ -36,6 +36,6 @@ mp_sqrmod (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_sqrmod.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_sqrmod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_sqrt.c b/libtommath/bn_mp_sqrt.c index 086801d..8fd057c 100644 --- a/libtommath/bn_mp_sqrt.c +++ b/libtommath/bn_mp_sqrt.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* this function is less generic than mp_n_root, simpler and faster */ @@ -76,6 +76,6 @@ E2: mp_clear(&t1); #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_sqrt.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_sqrt.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_sub.c b/libtommath/bn_mp_sub.c index c0e2def..f5015cc 100644 --- a/libtommath/bn_mp_sub.c +++ b/libtommath/bn_mp_sub.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* high level subtraction (handles signs) */ @@ -54,6 +54,6 @@ mp_sub (mp_int * a, mp_int * b, mp_int * c) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_sub.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_sub.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_sub_d.c b/libtommath/bn_mp_sub_d.c index d979f35..06cdca6 100644 --- a/libtommath/bn_mp_sub_d.c +++ b/libtommath/bn_mp_sub_d.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* single digit subtraction */ @@ -88,6 +88,6 @@ mp_sub_d (mp_int * a, mp_digit b, mp_int * c) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_sub_d.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_sub_d.c,v $ */ +/* $Revision: 1.6 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_submod.c b/libtommath/bn_mp_submod.c index 046e844..869e23c 100644 --- a/libtommath/bn_mp_submod.c +++ b/libtommath/bn_mp_submod.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* d = a - b (mod c) */ @@ -37,6 +37,6 @@ mp_submod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_submod.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_submod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_to_signed_bin.c b/libtommath/bn_mp_to_signed_bin.c index 066eb51..9df83ca 100644 --- a/libtommath/bn_mp_to_signed_bin.c +++ b/libtommath/bn_mp_to_signed_bin.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* store in signed [big endian] format */ @@ -28,6 +28,6 @@ int mp_to_signed_bin (mp_int * a, unsigned char *b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_to_signed_bin.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_to_signed_bin.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_to_signed_bin_n.c b/libtommath/bn_mp_to_signed_bin_n.c index b1df632..677f827 100644 --- a/libtommath/bn_mp_to_signed_bin_n.c +++ b/libtommath/bn_mp_to_signed_bin_n.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* store in signed [big endian] format */ @@ -26,6 +26,6 @@ int mp_to_signed_bin_n (mp_int * a, unsigned char *b, unsigned long *outlen) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_to_signed_bin_n.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_to_signed_bin_n.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_to_unsigned_bin.c b/libtommath/bn_mp_to_unsigned_bin.c index d69de35..c137f10 100644 --- a/libtommath/bn_mp_to_unsigned_bin.c +++ b/libtommath/bn_mp_to_unsigned_bin.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* store in unsigned [big endian] format */ @@ -43,6 +43,6 @@ int mp_to_unsigned_bin (mp_int * a, unsigned char *b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_to_unsigned_bin.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_to_unsigned_bin.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_to_unsigned_bin_n.c b/libtommath/bn_mp_to_unsigned_bin_n.c index 5621960..0dc00c6 100644 --- a/libtommath/bn_mp_to_unsigned_bin_n.c +++ b/libtommath/bn_mp_to_unsigned_bin_n.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* store in unsigned [big endian] format */ @@ -26,6 +26,6 @@ int mp_to_unsigned_bin_n (mp_int * a, unsigned char *b, unsigned long *outlen) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_to_unsigned_bin_n.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_to_unsigned_bin_n.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_toom_mul.c b/libtommath/bn_mp_toom_mul.c index 14d0705..ad5d9e9 100644 --- a/libtommath/bn_mp_toom_mul.c +++ b/libtommath/bn_mp_toom_mul.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* multiplication using the Toom-Cook 3-way algorithm @@ -279,6 +279,6 @@ ERR: #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_toom_mul.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_toom_mul.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_toom_sqr.c b/libtommath/bn_mp_toom_sqr.c index 14a235a..48880d0 100644 --- a/libtommath/bn_mp_toom_sqr.c +++ b/libtommath/bn_mp_toom_sqr.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* squaring using Toom-Cook 3-way algorithm */ @@ -221,6 +221,6 @@ ERR: #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_toom_sqr.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_toom_sqr.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_toradix.c b/libtommath/bn_mp_toradix.c index 1bd8819..0adc28d 100644 --- a/libtommath/bn_mp_toradix.c +++ b/libtommath/bn_mp_toradix.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* stores a bignum as a ASCII string in a given radix (2..64) */ @@ -70,6 +70,6 @@ int mp_toradix (mp_int * a, char *str, int radix) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_toradix.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_toradix.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_toradix_n.c b/libtommath/bn_mp_toradix_n.c index 39d5101..796ed55 100644 --- a/libtommath/bn_mp_toradix_n.c +++ b/libtommath/bn_mp_toradix_n.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* stores a bignum as a ASCII string in a given radix (2..64) @@ -83,6 +83,6 @@ int mp_toradix_n(mp_int * a, char *str, int radix, int maxlen) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_toradix_n.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_toradix_n.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_unsigned_bin_size.c b/libtommath/bn_mp_unsigned_bin_size.c index e79b91a..6dc3bd5 100644 --- a/libtommath/bn_mp_unsigned_bin_size.c +++ b/libtommath/bn_mp_unsigned_bin_size.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* get the size for an unsigned equivalent */ @@ -23,6 +23,6 @@ int mp_unsigned_bin_size (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_unsigned_bin_size.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_unsigned_bin_size.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_xor.c b/libtommath/bn_mp_xor.c index bf40408..59ff2e1 100644 --- a/libtommath/bn_mp_xor.c +++ b/libtommath/bn_mp_xor.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* XOR two ints together */ @@ -46,6 +46,6 @@ mp_xor (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_xor.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_xor.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_zero.c b/libtommath/bn_mp_zero.c index 3cbd933..b0977d4 100644 --- a/libtommath/bn_mp_zero.c +++ b/libtommath/bn_mp_zero.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* set to zero */ @@ -31,6 +31,6 @@ void mp_zero (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_zero.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_zero.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_prime_tab.c b/libtommath/bn_prime_tab.c index 38cb592..bd25247 100644 --- a/libtommath/bn_prime_tab.c +++ b/libtommath/bn_prime_tab.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ const mp_digit ltm_prime_tab[] = { 0x0002, 0x0003, 0x0005, 0x0007, 0x000B, 0x000D, 0x0011, 0x0013, @@ -56,6 +56,6 @@ const mp_digit ltm_prime_tab[] = { }; #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_prime_tab.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_prime_tab.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_reverse.c b/libtommath/bn_reverse.c index 3132f93..ddfa827 100644 --- a/libtommath/bn_reverse.c +++ b/libtommath/bn_reverse.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* reverse an array, used for radix code */ @@ -34,6 +34,6 @@ bn_reverse (unsigned char *s, int len) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_reverse.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_reverse.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_s_mp_add.c b/libtommath/bn_s_mp_add.c index 7023300..f034ae6 100644 --- a/libtommath/bn_s_mp_add.c +++ b/libtommath/bn_s_mp_add.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* low level addition, based on HAC pp.594, Algorithm 14.7 */ @@ -104,6 +104,6 @@ s_mp_add (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_s_mp_add.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_s_mp_add.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_s_mp_exptmod.c b/libtommath/bn_s_mp_exptmod.c index 7c6e304..097d894 100644 --- a/libtommath/bn_s_mp_exptmod.c +++ b/libtommath/bn_s_mp_exptmod.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #ifdef MP_LOW_MEM #define TAB_SIZE 32 @@ -247,6 +247,6 @@ LBL_M: } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_s_mp_exptmod.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_s_mp_exptmod.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_s_mp_mul_digs.c b/libtommath/bn_s_mp_mul_digs.c index eb99e33..f5bbf39 100644 --- a/libtommath/bn_s_mp_mul_digs.c +++ b/libtommath/bn_s_mp_mul_digs.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* multiplies |a| * |b| and only computes upto digs digits of result @@ -85,6 +85,6 @@ int s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_s_mp_mul_digs.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_s_mp_mul_digs.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_s_mp_mul_high_digs.c b/libtommath/bn_s_mp_mul_high_digs.c index 2ae9ee1..2b718f2 100644 --- a/libtommath/bn_s_mp_mul_high_digs.c +++ b/libtommath/bn_s_mp_mul_high_digs.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* multiplies |a| * |b| and does not compute the lower digs digits @@ -76,6 +76,6 @@ s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_s_mp_mul_high_digs.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_s_mp_mul_high_digs.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_s_mp_sqr.c b/libtommath/bn_s_mp_sqr.c index 0ae2869..d2531c2 100644 --- a/libtommath/bn_s_mp_sqr.c +++ b/libtommath/bn_s_mp_sqr.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* low level squaring, b = a*a, HAC pp.596-597, Algorithm 14.16 */ @@ -79,6 +79,6 @@ int s_mp_sqr (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_s_mp_sqr.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_s_mp_sqr.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_s_mp_sub.c b/libtommath/bn_s_mp_sub.c index 94375a0..6a60c39 100644 --- a/libtommath/bn_s_mp_sub.c +++ b/libtommath/bn_s_mp_sub.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* low level subtraction (assumes |a| > |b|), HAC pp.595 Algorithm 14.9 */ @@ -84,6 +84,6 @@ s_mp_sub (mp_int * a, mp_int * b, mp_int * c) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_s_mp_sub.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_s_mp_sub.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bncore.c b/libtommath/bncore.c index e53fdee..8fb1824 100644 --- a/libtommath/bncore.c +++ b/libtommath/bncore.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Known optimal configurations @@ -31,6 +31,6 @@ int KARATSUBA_MUL_CUTOFF = 80, /* Min. number of digits before Karatsub TOOM_SQR_CUTOFF = 400; #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bncore.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bncore.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/booker.pl b/libtommath/booker.pl index df8b30d..49f1889 100644 --- a/libtommath/booker.pl +++ b/libtommath/booker.pl @@ -82,7 +82,7 @@ while () { # scan till next end of comment, e.g. skip license while () { $text[$line++] = $_; - last if ($_ =~ /math\.libtomcrypt\.org/); + last if ($_ =~ /math\.libtomcrypt\.com/); } ; } diff --git a/libtommath/demo/demo.c b/libtommath/demo/demo.c index 0555366..bb5eb44 100644 --- a/libtommath/demo/demo.c +++ b/libtommath/demo/demo.c @@ -735,6 +735,6 @@ printf("compare no compare!\n"); exit(EXIT_FAILURE); } return 0; } -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/demo/demo.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2005/09/26 16:32:16 $ */ +/* $Source: /cvs/libtom/libtommath/demo/demo.c,v $ */ +/* $Revision: 1.3 $ */ +/* $Date: 2005/06/24 11:32:07 $ */ diff --git a/libtommath/demo/timing.c b/libtommath/demo/timing.c index cf0f39c..d4660a9 100644 --- a/libtommath/demo/timing.c +++ b/libtommath/demo/timing.c @@ -314,6 +314,6 @@ int main(void) return 0; } -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/demo/timing.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2005/09/26 16:32:16 $ */ +/* $Source: /cvs/libtom/libtommath/demo/timing.c,v $ */ +/* $Revision: 1.2 $ */ +/* $Date: 2005/05/05 14:38:47 $ */ diff --git a/libtommath/etc/2kprime.c b/libtommath/etc/2kprime.c index d8ea97c..c09818f 100644 --- a/libtommath/etc/2kprime.c +++ b/libtommath/etc/2kprime.c @@ -79,6 +79,6 @@ int main(void) -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/etc/2kprime.c,v $ */ -/* $Revision: 1.1.1.2 $ */ -/* $Date: 2005/09/26 16:32:16 $ */ +/* $Source: /cvs/libtom/libtommath/etc/2kprime.c,v $ */ +/* $Revision: 1.2 $ */ +/* $Date: 2005/05/05 14:38:47 $ */ diff --git a/libtommath/etc/drprime.c b/libtommath/etc/drprime.c index eec89ed..e413985 100644 --- a/libtommath/etc/drprime.c +++ b/libtommath/etc/drprime.c @@ -59,6 +59,6 @@ int main(void) } -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/etc/drprime.c,v $ */ -/* $Revision: 1.1.1.2 $ */ -/* $Date: 2005/09/26 16:32:16 $ */ +/* $Source: /cvs/libtom/libtommath/etc/drprime.c,v $ */ +/* $Revision: 1.2 $ */ +/* $Date: 2005/05/05 14:38:47 $ */ diff --git a/libtommath/etc/mersenne.c b/libtommath/etc/mersenne.c index e4891c8..6a6497a 100644 --- a/libtommath/etc/mersenne.c +++ b/libtommath/etc/mersenne.c @@ -139,6 +139,6 @@ main (void) return 0; } -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/etc/mersenne.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:28 $ */ +/* $Source: /cvs/libtom/libtommath/etc/mersenne.c,v $ */ +/* $Revision: 1.3 $ */ +/* $Date: 2006/03/31 14:18:47 $ */ diff --git a/libtommath/etc/mont.c b/libtommath/etc/mont.c index c6a8e32..393be4c 100644 --- a/libtommath/etc/mont.c +++ b/libtommath/etc/mont.c @@ -45,6 +45,6 @@ int main(void) -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/etc/mont.c,v $ */ -/* $Revision: 1.1.1.2 $ */ -/* $Date: 2005/09/26 16:32:16 $ */ +/* $Source: /cvs/libtom/libtommath/etc/mont.c,v $ */ +/* $Revision: 1.2 $ */ +/* $Date: 2005/05/05 14:38:47 $ */ diff --git a/libtommath/etc/pprime.c b/libtommath/etc/pprime.c index abb3c5a..317e2a0 100644 --- a/libtommath/etc/pprime.c +++ b/libtommath/etc/pprime.c @@ -395,6 +395,6 @@ main (void) return 0; } -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/etc/pprime.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:28 $ */ +/* $Source: /cvs/libtom/libtommath/etc/pprime.c,v $ */ +/* $Revision: 1.3 $ */ +/* $Date: 2006/03/31 14:18:47 $ */ diff --git a/libtommath/etc/tune.c b/libtommath/etc/tune.c index 3088bdb..d4a502c 100644 --- a/libtommath/etc/tune.c +++ b/libtommath/etc/tune.c @@ -137,6 +137,6 @@ main (void) return 0; } -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/etc/tune.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:29 $ */ +/* $Source: /cvs/libtom/libtommath/etc/tune.c,v $ */ +/* $Revision: 1.3 $ */ +/* $Date: 2006/03/31 14:18:47 $ */ diff --git a/libtommath/logs/index.html b/libtommath/logs/index.html index 2b65a0b..4b68c25 100644 --- a/libtommath/logs/index.html +++ b/libtommath/logs/index.html @@ -22,6 +22,6 @@ -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/logs/index.html,v $ */ -/* $Revision: 1.1.1.2 $ */ -/* $Date: 2005/09/26 16:32:16 $ */ +/* $Source: /cvs/libtom/libtommath/logs/index.html,v $ */ +/* $Revision: 1.2 $ */ +/* $Date: 2005/05/05 14:38:47 $ */ diff --git a/libtommath/makefile.cygwin_dll b/libtommath/makefile.cygwin_dll index dae65ae..85a9b20 100644 --- a/libtommath/makefile.cygwin_dll +++ b/libtommath/makefile.cygwin_dll @@ -50,6 +50,6 @@ test: $(OBJECTS) windll gcc $(CFLAGS) demo/demo.c libtommath.dll.a -Wl,--enable-auto-import -o test -s cd mtest ; $(CC) -O3 -fomit-frame-pointer -funroll-loops mtest.c -o mtest -s -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/makefile.cygwin_dll,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2005/09/26 16:31:57 $ */ +/* $Source: /cvs/libtom/libtommath/makefile.cygwin_dll,v $ */ +/* $Revision: 1.2 $ */ +/* $Date: 2005/05/05 14:38:45 $ */ diff --git a/libtommath/mtest/logtab.h b/libtommath/mtest/logtab.h index 4c8774c..bbefaef 100644 --- a/libtommath/mtest/logtab.h +++ b/libtommath/mtest/logtab.h @@ -19,6 +19,6 @@ const float s_logv_2[] = { }; -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/mtest/logtab.h,v $ */ -/* $Revision: 1.1.1.2 $ */ -/* $Date: 2005/09/26 16:32:17 $ */ +/* $Source: /cvs/libtom/libtommath/mtest/logtab.h,v $ */ +/* $Revision: 1.2 $ */ +/* $Date: 2005/05/05 14:38:47 $ */ diff --git a/libtommath/mtest/mpi-config.h b/libtommath/mtest/mpi-config.h index e6ffbc4..6049c25 100644 --- a/libtommath/mtest/mpi-config.h +++ b/libtommath/mtest/mpi-config.h @@ -1,5 +1,5 @@ /* Default configuration for MPI library */ -/* $Id: mpi-config.h,v 1.1.1.2 2005/09/26 16:32:17 kennykb Exp $ */ +/* $Id: mpi-config.h,v 1.2 2005/05/05 14:38:47 tom Exp $ */ #ifndef MPI_CONFIG_H_ #define MPI_CONFIG_H_ @@ -85,6 +85,6 @@ /* crc==3287762869, version==2, Sat Feb 02 06:43:53 2002 */ -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/mtest/mpi-config.h,v $ */ -/* $Revision: 1.1.1.2 $ */ -/* $Date: 2005/09/26 16:32:17 $ */ +/* $Source: /cvs/libtom/libtommath/mtest/mpi-config.h,v $ */ +/* $Revision: 1.2 $ */ +/* $Date: 2005/05/05 14:38:47 $ */ diff --git a/libtommath/mtest/mpi-types.h b/libtommath/mtest/mpi-types.h index 96d5967..026de58 100644 --- a/libtommath/mtest/mpi-types.h +++ b/libtommath/mtest/mpi-types.h @@ -15,6 +15,6 @@ typedef int mp_err; #define RADIX (MP_DIGIT_MAX+1) -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/mtest/mpi-types.h,v $ */ -/* $Revision: 1.1.1.2 $ */ -/* $Date: 2005/09/26 16:32:17 $ */ +/* $Source: /cvs/libtom/libtommath/mtest/mpi-types.h,v $ */ +/* $Revision: 1.2 $ */ +/* $Date: 2005/05/05 14:38:47 $ */ diff --git a/libtommath/mtest/mpi.c b/libtommath/mtest/mpi.c index 1b6f114..7c712dd 100644 --- a/libtommath/mtest/mpi.c +++ b/libtommath/mtest/mpi.c @@ -6,7 +6,7 @@ Arbitrary precision integer arithmetic library - $Id: mpi.c,v 1.1.1.2 2005/09/26 16:32:17 kennykb Exp $ + $Id: mpi.c,v 1.2 2005/05/05 14:38:47 tom Exp $ */ #include "mpi.h" @@ -3980,6 +3980,6 @@ int s_mp_outlen(int bits, int r) /* HERE THERE BE DRAGONS */ /* crc==4242132123, version==2, Sat Feb 02 06:43:52 2002 */ -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/mtest/mpi.c,v $ */ -/* $Revision: 1.1.1.2 $ */ -/* $Date: 2005/09/26 16:32:17 $ */ +/* $Source: /cvs/libtom/libtommath/mtest/mpi.c,v $ */ +/* $Revision: 1.2 $ */ +/* $Date: 2005/05/05 14:38:47 $ */ diff --git a/libtommath/mtest/mpi.h b/libtommath/mtest/mpi.h index 1bd0680..66ae873 100644 --- a/libtommath/mtest/mpi.h +++ b/libtommath/mtest/mpi.h @@ -6,7 +6,7 @@ Arbitrary precision integer arithmetic library - $Id: mpi.h,v 1.1.1.2 2005/09/26 16:32:17 kennykb Exp $ + $Id: mpi.h,v 1.2 2005/05/05 14:38:47 tom Exp $ */ #ifndef _H_MPI_ @@ -226,6 +226,6 @@ const char *mp_strerror(mp_err ec); #endif /* end _H_MPI_ */ -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/mtest/mpi.h,v $ */ -/* $Revision: 1.1.1.2 $ */ -/* $Date: 2005/09/26 16:32:17 $ */ +/* $Source: /cvs/libtom/libtommath/mtest/mpi.h,v $ */ +/* $Revision: 1.2 $ */ +/* $Date: 2005/05/05 14:38:47 $ */ diff --git a/libtommath/mtest/mtest.c b/libtommath/mtest/mtest.c index f18dc00..bdfe612 100644 --- a/libtommath/mtest/mtest.c +++ b/libtommath/mtest/mtest.c @@ -303,6 +303,6 @@ int main(void) return 0; } -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/mtest/mtest.c,v $ */ -/* $Revision: 1.1.1.2 $ */ -/* $Date: 2005/09/26 16:32:17 $ */ +/* $Source: /cvs/libtom/libtommath/mtest/mtest.c,v $ */ +/* $Revision: 1.2 $ */ +/* $Date: 2005/05/05 14:38:47 $ */ diff --git a/libtommath/tommath.h b/libtommath/tommath.h index f9b2d11..3c00b9e 100644 --- a/libtommath/tommath.h +++ b/libtommath/tommath.h @@ -579,6 +579,6 @@ extern const char *mp_s_rmap; #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/tommath.h,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:12 $ */ +/* $Source: /cvs/libtom/libtommath/tommath.h,v $ */ +/* $Revision: 1.8 $ */ +/* $Date: 2006/03/31 14:18:44 $ */ diff --git a/libtommath/tommath_class.h b/libtommath/tommath_class.h index 29e36fc..166dd80 100644 --- a/libtommath/tommath_class.h +++ b/libtommath/tommath_class.h @@ -994,6 +994,6 @@ #define LTM_LAST #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/tommath_class.h,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2005/09/26 16:32:16 $ */ +/* $Source: /cvs/libtom/libtommath/tommath_class.h,v $ */ +/* $Revision: 1.3 $ */ +/* $Date: 2005/07/28 11:59:32 $ */ diff --git a/libtommath/tommath_superclass.h b/libtommath/tommath_superclass.h index 6722510..2fdebe6 100644 --- a/libtommath/tommath_superclass.h +++ b/libtommath/tommath_superclass.h @@ -71,6 +71,6 @@ #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/tommath_superclass.h,v $ */ -/* $Revision: 1.1.1.2 $ */ -/* $Date: 2005/09/26 16:32:16 $ */ +/* $Source: /cvs/libtom/libtommath/tommath_superclass.h,v $ */ +/* $Revision: 1.3 $ */ +/* $Date: 2005/05/14 13:29:17 $ */ -- cgit v0.12 From b5c43fbc876f3a372f5d83509d70f648ae9d6b88 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 14 Mar 2011 11:51:58 +0000 Subject: Import of libtommath 0.40 --- libtommath/bn_mp_montgomery_setup.c | 2 +- libtommath/changes.txt | 4 ++++ libtommath/etc/drprimes.txt | 11 +++++++---- libtommath/makefile | 7 ++++--- libtommath/makefile.shared | 2 +- 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/libtommath/bn_mp_montgomery_setup.c b/libtommath/bn_mp_montgomery_setup.c index 261a9fb..f082749 100644 --- a/libtommath/bn_mp_montgomery_setup.c +++ b/libtommath/bn_mp_montgomery_setup.c @@ -48,7 +48,7 @@ mp_montgomery_setup (mp_int * n, mp_digit * rho) #endif /* rho = -1/m mod b */ - *rho = (((mp_word)1 << ((mp_word) DIGIT_BIT)) - x) & MP_MASK; + *rho = (unsigned long)(((mp_word)1 << ((mp_word) DIGIT_BIT)) - x) & MP_MASK; return MP_OKAY; } diff --git a/libtommath/changes.txt b/libtommath/changes.txt index 9498d36..aaaf69f 100644 --- a/libtommath/changes.txt +++ b/libtommath/changes.txt @@ -1,3 +1,7 @@ +December 24th, 2006 +v0.40 -- Updated makefile to properly support LIBNAME + -- Fixed bug in fast_s_mp_mul_high_digs() which overflowed (line 83), thanks Valgrind! + April 4th, 2006 v0.39 -- Jim Wigginton pointed out my Montgomery examples in figures 6.4 and 6.6 were off by one, k should be 9 not 8 -- Bruce Guenter suggested I use --tag=CC for libtool builds where the compiler may think it's C++. diff --git a/libtommath/etc/drprimes.txt b/libtommath/etc/drprimes.txt index 2c887ea..7c97f67 100644 --- a/libtommath/etc/drprimes.txt +++ b/libtommath/etc/drprimes.txt @@ -1,6 +1,9 @@ -280-bit prime: -p == 1942668892225729070919461906823518906642406839052139521251812409738904285204940164839 +300-bit prime: +p == 2037035976334486086268445688409378161051468393665936250636140449354381298610415201576637819 -532-bit prime: -p == 14059105607947488696282932836518693308967803494693489478439861164411992439598399594747002144074658928593502845729752797260025831423419686528151609940203368691747 +540-bit prime: +p == 3599131035634557106248430806148785487095757694641533306480604458089470064537190296255232548883112685719936728506816716098566612844395439751206810991770626477344739 + +780-bit prime: +p == 6359114106063703798370219984742410466332205126109989319225557147754704702203399726411277962562135973685197744935448875852478791860694279747355800678568677946181447581781401213133886609947027230004277244697462656003655947791725966271167 diff --git a/libtommath/makefile b/libtommath/makefile index e08a888..9f69678 100644 --- a/libtommath/makefile +++ b/libtommath/makefile @@ -3,7 +3,7 @@ #Tom St Denis #version of library -VERSION=0.39 +VERSION=0.40 CFLAGS += -I./ -Wall -W -Wshadow -Wsign-compare @@ -40,12 +40,13 @@ else USER=$(INSTALL_USER) endif -default: libtommath.a - #default files to install ifndef LIBNAME LIBNAME=libtommath.a endif + +default: ${LIBNAME} + HEADERS=tommath.h tommath_class.h tommath_superclass.h #LIBPATH-The directory for libtommath to be installed to. diff --git a/libtommath/makefile.shared b/libtommath/makefile.shared index 8522d44..e230fb8 100644 --- a/libtommath/makefile.shared +++ b/libtommath/makefile.shared @@ -1,7 +1,7 @@ #Makefile for GCC # #Tom St Denis -VERSION=0:39 +VERSION=0:40 CC = libtool --mode=compile --tag=CC gcc -- cgit v0.12 From b7a189417b38e35bb825490a1b9a15fc8d138333 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 14 Mar 2011 11:59:15 +0000 Subject: Import of libtommath 0.41 Import of libtommath 0.41 --- libtommath/bn.ind | 130 +++--- libtommath/bn.pdf | Bin 340921 -> 345714 bytes libtommath/bn.tex | 6 +- libtommath/bn_mp_div_d.c | 11 +- libtommath/changes.txt | 4 + libtommath/libtommath.dsp | 572 ++++++++++++++++++++++++ libtommath/logs/addsub.png | Bin 6253 -> 6254 bytes libtommath/logs/expt.png | Bin 6604 -> 6605 bytes libtommath/logs/invmod.png | Bin 4917 -> 4918 bytes libtommath/logs/mult.png | Bin 6769 -> 6770 bytes libtommath/makefile | 2 +- libtommath/makefile.shared | 2 +- libtommath/pics/expt_state.tif | Bin 87540 -> 87542 bytes libtommath/pics/primality.tif | Bin 85512 -> 85514 bytes libtommath/poster.pdf | Bin 37822 -> 37821 bytes libtommath/pre_gen/mpi.c | 963 +++++++++++++++++++++-------------------- libtommath/tommath.pdf | Bin 1194158 -> 1183099 bytes 17 files changed, 1138 insertions(+), 552 deletions(-) create mode 100644 libtommath/libtommath.dsp diff --git a/libtommath/bn.ind b/libtommath/bn.ind index e5f7d4a..c099b52 100644 --- a/libtommath/bn.ind +++ b/libtommath/bn.ind @@ -1,82 +1,82 @@ \begin{theindex} - \item mp\_add, \hyperpage{29} - \item mp\_add\_d, \hyperpage{52} - \item mp\_and, \hyperpage{29} - \item mp\_clear, \hyperpage{11} - \item mp\_clear\_multi, \hyperpage{12} - \item mp\_cmp, \hyperpage{24} - \item mp\_cmp\_d, \hyperpage{25} + \item mp\_add, \hyperpage{31} + \item mp\_add\_d, \hyperpage{56} + \item mp\_and, \hyperpage{31} + \item mp\_clear, \hyperpage{12} + \item mp\_clear\_multi, \hyperpage{13} + \item mp\_cmp, \hyperpage{25} + \item mp\_cmp\_d, \hyperpage{26} \item mp\_cmp\_mag, \hyperpage{23} - \item mp\_div, \hyperpage{30} - \item mp\_div\_2, \hyperpage{26} - \item mp\_div\_2d, \hyperpage{28} - \item mp\_div\_d, \hyperpage{52} - \item mp\_dr\_reduce, \hyperpage{40} - \item mp\_dr\_setup, \hyperpage{40} - \item MP\_EQ, \hyperpage{22} - \item mp\_error\_to\_string, \hyperpage{10} - \item mp\_expt\_d, \hyperpage{43} - \item mp\_exptmod, \hyperpage{43} - \item mp\_exteuclid, \hyperpage{51} - \item mp\_gcd, \hyperpage{51} + \item mp\_div, \hyperpage{32} + \item mp\_div\_2, \hyperpage{28} + \item mp\_div\_2d, \hyperpage{30} + \item mp\_div\_d, \hyperpage{56} + \item mp\_dr\_reduce, \hyperpage{45} + \item mp\_dr\_setup, \hyperpage{45} + \item MP\_EQ, \hyperpage{23} + \item mp\_error\_to\_string, \hyperpage{9} + \item mp\_expt\_d, \hyperpage{47} + \item mp\_exptmod, \hyperpage{47} + \item mp\_exteuclid, \hyperpage{55} + \item mp\_gcd, \hyperpage{55} \item mp\_get\_int, \hyperpage{20} - \item mp\_grow, \hyperpage{16} - \item MP\_GT, \hyperpage{22} + \item mp\_grow, \hyperpage{17} + \item MP\_GT, \hyperpage{23} \item mp\_init, \hyperpage{11} - \item mp\_init\_copy, \hyperpage{13} - \item mp\_init\_multi, \hyperpage{12} + \item mp\_init\_copy, \hyperpage{14} + \item mp\_init\_multi, \hyperpage{13} \item mp\_init\_set, \hyperpage{21} \item mp\_init\_set\_int, \hyperpage{21} - \item mp\_init\_size, \hyperpage{14} + \item mp\_init\_size, \hyperpage{15} \item mp\_int, \hyperpage{10} - \item mp\_invmod, \hyperpage{52} - \item mp\_jacobi, \hyperpage{52} - \item mp\_lcm, \hyperpage{51} - \item mp\_lshd, \hyperpage{28} - \item MP\_LT, \hyperpage{22} + \item mp\_invmod, \hyperpage{56} + \item mp\_jacobi, \hyperpage{56} + \item mp\_lcm, \hyperpage{56} + \item mp\_lshd, \hyperpage{30} + \item MP\_LT, \hyperpage{23} \item MP\_MEM, \hyperpage{9} - \item mp\_mod, \hyperpage{35} - \item mp\_mod\_d, \hyperpage{52} - \item mp\_montgomery\_calc\_normalization, \hyperpage{38} - \item mp\_montgomery\_reduce, \hyperpage{37} - \item mp\_montgomery\_setup, \hyperpage{37} - \item mp\_mul, \hyperpage{31} - \item mp\_mul\_2, \hyperpage{26} - \item mp\_mul\_2d, \hyperpage{28} - \item mp\_mul\_d, \hyperpage{52} - \item mp\_n\_root, \hyperpage{44} - \item mp\_neg, \hyperpage{29} + \item mp\_mod, \hyperpage{39} + \item mp\_mod\_d, \hyperpage{56} + \item mp\_montgomery\_calc\_normalization, \hyperpage{42} + \item mp\_montgomery\_reduce, \hyperpage{42} + \item mp\_montgomery\_setup, \hyperpage{42} + \item mp\_mul, \hyperpage{33} + \item mp\_mul\_2, \hyperpage{28} + \item mp\_mul\_2d, \hyperpage{29} + \item mp\_mul\_d, \hyperpage{56} + \item mp\_n\_root, \hyperpage{48} + \item mp\_neg, \hyperpage{31, 32} \item MP\_NO, \hyperpage{9} \item MP\_OKAY, \hyperpage{9} - \item mp\_or, \hyperpage{29} - \item mp\_prime\_fermat, \hyperpage{45} - \item mp\_prime\_is\_divisible, \hyperpage{45} - \item mp\_prime\_is\_prime, \hyperpage{46} - \item mp\_prime\_miller\_rabin, \hyperpage{45} - \item mp\_prime\_next\_prime, \hyperpage{46} - \item mp\_prime\_rabin\_miller\_trials, \hyperpage{46} - \item mp\_prime\_random, \hyperpage{47} - \item mp\_prime\_random\_ex, \hyperpage{47} - \item mp\_radix\_size, \hyperpage{49} - \item mp\_read\_radix, \hyperpage{49} - \item mp\_read\_unsigned\_bin, \hyperpage{50} - \item mp\_reduce, \hyperpage{36} - \item mp\_reduce\_2k, \hyperpage{41} - \item mp\_reduce\_2k\_setup, \hyperpage{41} - \item mp\_reduce\_setup, \hyperpage{36} - \item mp\_rshd, \hyperpage{28} + \item mp\_or, \hyperpage{31} + \item mp\_prime\_fermat, \hyperpage{49} + \item mp\_prime\_is\_divisible, \hyperpage{49} + \item mp\_prime\_is\_prime, \hyperpage{51} + \item mp\_prime\_miller\_rabin, \hyperpage{50} + \item mp\_prime\_next\_prime, \hyperpage{51} + \item mp\_prime\_rabin\_miller\_trials, \hyperpage{50} + \item mp\_prime\_random, \hyperpage{51} + \item mp\_prime\_random\_ex, \hyperpage{52} + \item mp\_radix\_size, \hyperpage{53} + \item mp\_read\_radix, \hyperpage{53} + \item mp\_read\_unsigned\_bin, \hyperpage{54} + \item mp\_reduce, \hyperpage{40} + \item mp\_reduce\_2k, \hyperpage{46} + \item mp\_reduce\_2k\_setup, \hyperpage{46} + \item mp\_reduce\_setup, \hyperpage{40} + \item mp\_rshd, \hyperpage{30} \item mp\_set, \hyperpage{19} \item mp\_set\_int, \hyperpage{20} - \item mp\_shrink, \hyperpage{15} - \item mp\_sqr, \hyperpage{33} - \item mp\_sub, \hyperpage{29} - \item mp\_sub\_d, \hyperpage{52} - \item mp\_to\_unsigned\_bin, \hyperpage{50} - \item mp\_toradix, \hyperpage{49} - \item mp\_unsigned\_bin\_size, \hyperpage{50} + \item mp\_shrink, \hyperpage{16} + \item mp\_sqr, \hyperpage{35} + \item mp\_sub, \hyperpage{31} + \item mp\_sub\_d, \hyperpage{56} + \item mp\_to\_unsigned\_bin, \hyperpage{54} + \item mp\_toradix, \hyperpage{53} + \item mp\_unsigned\_bin\_size, \hyperpage{54} \item MP\_VAL, \hyperpage{9} - \item mp\_xor, \hyperpage{29} + \item mp\_xor, \hyperpage{31} \item MP\_YES, \hyperpage{9} \end{theindex} diff --git a/libtommath/bn.pdf b/libtommath/bn.pdf index 392b649..5be7123 100644 Binary files a/libtommath/bn.pdf and b/libtommath/bn.pdf differ diff --git a/libtommath/bn.tex b/libtommath/bn.tex index e8eb994..9017860 100644 --- a/libtommath/bn.tex +++ b/libtommath/bn.tex @@ -1,4 +1,4 @@ -\documentclass[b5paper]{book} +\documentclass[synpaper]{book} \usepackage{hyperref} \usepackage{makeidx} \usepackage{amssymb} @@ -49,8 +49,8 @@ \begin{document} \frontmatter \pagestyle{empty} -\title{LibTomMath User Manual \\ v0.39} -\author{Tom St Denis \\ tomstdenis@iahu.ca} +\title{LibTomMath User Manual \\ v0.41} +\author{Tom St Denis \\ tomstdenis@gmail.com} \maketitle This text, the library and the accompanying textbook are all hereby placed in the public domain. This book has been formatted for B5 [176x250] paper using the \LaTeX{} {\em book} macro package. diff --git a/libtommath/bn_mp_div_d.c b/libtommath/bn_mp_div_d.c index d64b4b5..6a26d4f 100644 --- a/libtommath/bn_mp_div_d.c +++ b/libtommath/bn_mp_div_d.c @@ -19,7 +19,12 @@ static int s_is_power_of_two(mp_digit b, int *p) { int x; - for (x = 1; x < DIGIT_BIT; x++) { + /* fast return if no power of two */ + if ((b==0) || (b & (b-1))) { + return 0; + } + + for (x = 0; x < DIGIT_BIT; x++) { if (b == (((mp_digit)1)< +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=libtommath - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libtommath.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libtommath.mak" CFG="libtommath - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libtommath - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libtommath - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "libtommath" +# PROP Scc_LocalPath "." +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libtommath - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"Release\tommath.lib" + +!ELSEIF "$(CFG)" == "libtommath - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"Debug\tommath.lib" + +!ENDIF + +# Begin Target + +# Name "libtommath - Win32 Release" +# Name "libtommath - Win32 Debug" +# Begin Source File + +SOURCE=.\bn_error.c +# End Source File +# Begin Source File + +SOURCE=.\bn_fast_mp_invmod.c +# End Source File +# Begin Source File + +SOURCE=.\bn_fast_mp_montgomery_reduce.c +# End Source File +# Begin Source File + +SOURCE=.\bn_fast_s_mp_mul_digs.c +# End Source File +# Begin Source File + +SOURCE=.\bn_fast_s_mp_mul_high_digs.c +# End Source File +# Begin Source File + +SOURCE=.\bn_fast_s_mp_sqr.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_2expt.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_abs.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_add.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_add_d.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_addmod.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_and.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_clamp.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_clear.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_clear_multi.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_cmp.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_cmp_d.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_cmp_mag.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_cnt_lsb.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_copy.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_count_bits.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_div.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_div_2.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_div_2d.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_div_3.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_div_d.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_dr_is_modulus.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_dr_reduce.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_dr_setup.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_exch.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_expt_d.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_exptmod.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_exptmod_fast.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_exteuclid.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_fread.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_fwrite.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_gcd.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_get_int.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_grow.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_init.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_init_copy.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_init_multi.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_init_set.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_init_set_int.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_init_size.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_invmod.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_invmod_slow.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_is_square.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_jacobi.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_karatsuba_mul.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_karatsuba_sqr.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_lcm.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_lshd.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_mod.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_mod_2d.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_mod_d.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_montgomery_calc_normalization.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_montgomery_reduce.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_montgomery_setup.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_mul.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_mul_2.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_mul_2d.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_mul_d.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_mulmod.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_n_root.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_neg.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_or.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_prime_fermat.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_prime_is_divisible.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_prime_is_prime.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_prime_miller_rabin.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_prime_next_prime.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_prime_rabin_miller_trials.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_prime_random_ex.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_radix_size.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_radix_smap.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_rand.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_read_radix.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_read_signed_bin.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_read_unsigned_bin.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_reduce.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_reduce_2k.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_reduce_2k_l.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_reduce_2k_setup.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_reduce_2k_setup_l.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_reduce_is_2k.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_reduce_is_2k_l.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_reduce_setup.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_rshd.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_set.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_set_int.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_shrink.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_signed_bin_size.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_sqr.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_sqrmod.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_sqrt.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_sub.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_sub_d.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_submod.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_to_signed_bin.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_to_signed_bin_n.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_to_unsigned_bin.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_to_unsigned_bin_n.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_toom_mul.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_toom_sqr.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_toradix.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_toradix_n.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_unsigned_bin_size.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_xor.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_zero.c +# End Source File +# Begin Source File + +SOURCE=.\bn_prime_tab.c +# End Source File +# Begin Source File + +SOURCE=.\bn_reverse.c +# End Source File +# Begin Source File + +SOURCE=.\bn_s_mp_add.c +# End Source File +# Begin Source File + +SOURCE=.\bn_s_mp_exptmod.c +# End Source File +# Begin Source File + +SOURCE=.\bn_s_mp_mul_digs.c +# End Source File +# Begin Source File + +SOURCE=.\bn_s_mp_mul_high_digs.c +# End Source File +# Begin Source File + +SOURCE=.\bn_s_mp_sqr.c +# End Source File +# Begin Source File + +SOURCE=.\bn_s_mp_sub.c +# End Source File +# Begin Source File + +SOURCE=.\bncore.c +# End Source File +# Begin Source File + +SOURCE=.\tommath.h +# End Source File +# Begin Source File + +SOURCE=.\tommath_class.h +# End Source File +# Begin Source File + +SOURCE=.\tommath_superclass.h +# End Source File +# End Target +# End Project diff --git a/libtommath/logs/addsub.png b/libtommath/logs/addsub.png index 441c7b2..a5679ac 100644 Binary files a/libtommath/logs/addsub.png and b/libtommath/logs/addsub.png differ diff --git a/libtommath/logs/expt.png b/libtommath/logs/expt.png index d779cc5..9ee8bb7 100644 Binary files a/libtommath/logs/expt.png and b/libtommath/logs/expt.png differ diff --git a/libtommath/logs/invmod.png b/libtommath/logs/invmod.png index 9dcd7d8..0a8a4ad 100644 Binary files a/libtommath/logs/invmod.png and b/libtommath/logs/invmod.png differ diff --git a/libtommath/logs/mult.png b/libtommath/logs/mult.png index d22e8c8..4f7a4ee 100644 Binary files a/libtommath/logs/mult.png and b/libtommath/logs/mult.png differ diff --git a/libtommath/makefile b/libtommath/makefile index 9f69678..3e254d4 100644 --- a/libtommath/makefile +++ b/libtommath/makefile @@ -3,7 +3,7 @@ #Tom St Denis #version of library -VERSION=0.40 +VERSION=0.41 CFLAGS += -I./ -Wall -W -Wshadow -Wsign-compare diff --git a/libtommath/makefile.shared b/libtommath/makefile.shared index e230fb8..f17bbbd 100644 --- a/libtommath/makefile.shared +++ b/libtommath/makefile.shared @@ -1,7 +1,7 @@ #Makefile for GCC # #Tom St Denis -VERSION=0:40 +VERSION=0:41 CC = libtool --mode=compile --tag=CC gcc diff --git a/libtommath/pics/expt_state.tif b/libtommath/pics/expt_state.tif index 0aaee39..cb06e8e 100644 Binary files a/libtommath/pics/expt_state.tif and b/libtommath/pics/expt_state.tif differ diff --git a/libtommath/pics/primality.tif b/libtommath/pics/primality.tif index 83aafe0..76d6be3 100644 Binary files a/libtommath/pics/primality.tif and b/libtommath/pics/primality.tif differ diff --git a/libtommath/poster.pdf b/libtommath/poster.pdf index 1f705cf..f3768d7 100644 Binary files a/libtommath/poster.pdf and b/libtommath/poster.pdf differ diff --git a/libtommath/pre_gen/mpi.c b/libtommath/pre_gen/mpi.c index 62ec029..b7f4d47 100644 --- a/libtommath/pre_gen/mpi.c +++ b/libtommath/pre_gen/mpi.c @@ -13,7 +13,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ static const struct { @@ -43,9 +43,9 @@ char *mp_error_to_string(int code) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_error.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_error.c */ @@ -64,7 +64,7 @@ char *mp_error_to_string(int code) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes the modular inverse via binary extended euclidean algorithm, @@ -195,9 +195,9 @@ LBL_ERR:mp_clear_multi (&x, &y, &u, &v, &B, &D, NULL); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_fast_mp_invmod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_fast_mp_invmod.c */ @@ -216,7 +216,7 @@ LBL_ERR:mp_clear_multi (&x, &y, &u, &v, &B, &D, NULL); * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes xR**-1 == x (mod N) via Montgomery Reduction @@ -371,9 +371,9 @@ int fast_mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_fast_mp_montgomery_reduce.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_fast_mp_montgomery_reduce.c */ @@ -392,7 +392,7 @@ int fast_mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Fast (comba) multiplier @@ -482,9 +482,9 @@ int fast_s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_fast_s_mp_mul_digs.c,v $ */ +/* $Revision: 1.8 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_fast_s_mp_mul_digs.c */ @@ -503,7 +503,7 @@ int fast_s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* this is a modified version of fast_s_mul_digs that only produces @@ -569,7 +569,7 @@ int fast_s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs) register mp_digit *tmpc; tmpc = c->dp + digs; - for (ix = digs; ix <= pa; ix++) { + for (ix = digs; ix < pa; ix++) { /* now extract the previous digit [below the carry] */ *tmpc++ = W[ix]; } @@ -584,9 +584,9 @@ int fast_s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_fast_s_mp_mul_high_digs.c,v $ */ +/* $Revision: 1.6 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_fast_s_mp_mul_high_digs.c */ @@ -605,7 +605,7 @@ int fast_s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* the jist of squaring... @@ -702,9 +702,9 @@ int fast_s_mp_sqr (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_fast_s_mp_sqr.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_fast_s_mp_sqr.c */ @@ -723,7 +723,7 @@ int fast_s_mp_sqr (mp_int * a, mp_int * b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes a = 2**b @@ -754,9 +754,9 @@ mp_2expt (mp_int * a, int b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_2expt.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_2expt.c */ @@ -775,7 +775,7 @@ mp_2expt (mp_int * a, int b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* b = |a| @@ -801,9 +801,9 @@ mp_abs (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_abs.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_abs.c */ @@ -822,7 +822,7 @@ mp_abs (mp_int * a, mp_int * b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* high level addition (handles signs) */ @@ -858,9 +858,9 @@ int mp_add (mp_int * a, mp_int * b, mp_int * c) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_add.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_add.c */ @@ -879,7 +879,7 @@ int mp_add (mp_int * a, mp_int * b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* single digit addition */ @@ -974,9 +974,9 @@ mp_add_d (mp_int * a, mp_digit b, mp_int * c) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_add_d.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_add_d.c */ @@ -995,7 +995,7 @@ mp_add_d (mp_int * a, mp_digit b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* d = a + b (mod c) */ @@ -1019,9 +1019,9 @@ mp_addmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_addmod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_addmod.c */ @@ -1040,7 +1040,7 @@ mp_addmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* AND two ints together */ @@ -1080,9 +1080,9 @@ mp_and (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_and.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_and.c */ @@ -1101,7 +1101,7 @@ mp_and (mp_int * a, mp_int * b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* trim unused digits @@ -1128,9 +1128,9 @@ mp_clamp (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_clamp.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_clamp.c */ @@ -1149,7 +1149,7 @@ mp_clamp (mp_int * a) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* clear one (frees) */ @@ -1176,9 +1176,9 @@ mp_clear (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_clear.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_clear.c */ @@ -1197,7 +1197,7 @@ mp_clear (mp_int * a) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include @@ -1214,9 +1214,9 @@ void mp_clear_multi(mp_int *mp, ...) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_clear_multi.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_clear_multi.c */ @@ -1235,7 +1235,7 @@ void mp_clear_multi(mp_int *mp, ...) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* compare two ints (signed)*/ @@ -1261,9 +1261,9 @@ mp_cmp (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_cmp.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_cmp.c */ @@ -1282,7 +1282,7 @@ mp_cmp (mp_int * a, mp_int * b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* compare a digit */ @@ -1309,9 +1309,9 @@ int mp_cmp_d(mp_int * a, mp_digit b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_cmp_d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_cmp_d.c */ @@ -1330,7 +1330,7 @@ int mp_cmp_d(mp_int * a, mp_digit b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* compare maginitude of two ints (unsigned) */ @@ -1368,9 +1368,9 @@ int mp_cmp_mag (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_cmp_mag.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_cmp_mag.c */ @@ -1389,7 +1389,7 @@ int mp_cmp_mag (mp_int * a, mp_int * b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ static const int lnz[16] = { @@ -1425,9 +1425,9 @@ int mp_cnt_lsb(mp_int *a) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_cnt_lsb.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_cnt_lsb.c */ @@ -1446,7 +1446,7 @@ int mp_cnt_lsb(mp_int *a) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* copy, b = a */ @@ -1497,9 +1497,9 @@ mp_copy (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_copy.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_copy.c */ @@ -1518,7 +1518,7 @@ mp_copy (mp_int * a, mp_int * b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* returns the number of bits in an int */ @@ -1546,9 +1546,9 @@ mp_count_bits (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_count_bits.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_count_bits.c */ @@ -1567,7 +1567,7 @@ mp_count_bits (mp_int * a) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #ifdef BN_MP_DIV_SMALL @@ -1842,9 +1842,9 @@ LBL_Q:mp_clear (&q); #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_div.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_div.c */ @@ -1863,7 +1863,7 @@ LBL_Q:mp_clear (&q); * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* b = a/2 */ @@ -1914,9 +1914,9 @@ int mp_div_2(mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_div_2.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_div_2.c */ @@ -1935,7 +1935,7 @@ int mp_div_2(mp_int * a, mp_int * b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* shift right by a certain bit count (store quotient in c, optional remainder in d) */ @@ -2015,9 +2015,9 @@ int mp_div_2d (mp_int * a, int b, mp_int * c, mp_int * d) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_div_2d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_div_2d.c */ @@ -2036,7 +2036,7 @@ int mp_div_2d (mp_int * a, int b, mp_int * c, mp_int * d) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* divide by three (based on routine from MPI and the GMP manual) */ @@ -2098,9 +2098,9 @@ mp_div_3 (mp_int * a, mp_int *c, mp_digit * d) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_div_3.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_div_3.c */ @@ -2119,14 +2119,19 @@ mp_div_3 (mp_int * a, mp_int *c, mp_digit * d) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ static int s_is_power_of_two(mp_digit b, int *p) { int x; - for (x = 1; x < DIGIT_BIT; x++) { + /* fast return if no power of two */ + if ((b==0) || (b & (b-1))) { + return 0; + } + + for (x = 0; x < DIGIT_BIT; x++) { if (b == (((mp_digit)1)< @@ -3514,9 +3519,9 @@ int mp_init_multi(mp_int *mp, ...) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_init_multi.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_init_multi.c */ @@ -3535,7 +3540,7 @@ int mp_init_multi(mp_int *mp, ...) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* initialize and set a digit */ @@ -3550,9 +3555,9 @@ int mp_init_set (mp_int * a, mp_digit b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_init_set.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_init_set.c */ @@ -3571,7 +3576,7 @@ int mp_init_set (mp_int * a, mp_digit b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* initialize and set a digit */ @@ -3585,9 +3590,9 @@ int mp_init_set_int (mp_int * a, unsigned long b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_init_set_int.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_init_set_int.c */ @@ -3606,7 +3611,7 @@ int mp_init_set_int (mp_int * a, unsigned long b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* init an mp_init for a given size */ @@ -3637,9 +3642,9 @@ int mp_init_size (mp_int * a, int size) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_init_size.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_init_size.c */ @@ -3658,7 +3663,7 @@ int mp_init_size (mp_int * a, int size) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* hac 14.61, pp608 */ @@ -3684,9 +3689,9 @@ int mp_invmod (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_invmod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_invmod.c */ @@ -3705,7 +3710,7 @@ int mp_invmod (mp_int * a, mp_int * b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* hac 14.61, pp608 */ @@ -3863,9 +3868,9 @@ LBL_ERR:mp_clear_multi (&x, &y, &u, &v, &A, &B, &C, &D, NULL); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_invmod_slow.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_invmod_slow.c */ @@ -3884,7 +3889,7 @@ LBL_ERR:mp_clear_multi (&x, &y, &u, &v, &A, &B, &C, &D, NULL); * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Check if remainders are possible squares - fast exclude non-squares */ @@ -3976,9 +3981,9 @@ ERR:mp_clear(&t); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_is_square.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_is_square.c */ @@ -3997,7 +4002,7 @@ ERR:mp_clear(&t); * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes the jacobi c = (a | n) (or Legendre if n is prime) @@ -4085,9 +4090,9 @@ LBL_A1:mp_clear (&a1); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_jacobi.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_jacobi.c */ @@ -4106,7 +4111,7 @@ LBL_A1:mp_clear (&a1); * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* c = |a| * |b| using Karatsuba Multiplication using @@ -4256,9 +4261,9 @@ ERR: } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_karatsuba_mul.c,v $ */ +/* $Revision: 1.6 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_karatsuba_mul.c */ @@ -4277,7 +4282,7 @@ ERR: * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Karatsuba squaring, computes b = a*a using three @@ -4381,9 +4386,9 @@ ERR: } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_karatsuba_sqr.c,v $ */ +/* $Revision: 1.6 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_karatsuba_sqr.c */ @@ -4402,7 +4407,7 @@ ERR: * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes least common multiple as |a*b|/(a, b) */ @@ -4445,9 +4450,9 @@ LBL_T: } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_lcm.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_lcm.c */ @@ -4466,7 +4471,7 @@ LBL_T: * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* shift left a certain amount of digits */ @@ -4516,9 +4521,9 @@ int mp_lshd (mp_int * a, int b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_lshd.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_lshd.c */ @@ -4537,7 +4542,7 @@ int mp_lshd (mp_int * a, int b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* c = a mod b, 0 <= c < b */ @@ -4568,9 +4573,9 @@ mp_mod (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_mod.c */ @@ -4589,7 +4594,7 @@ mp_mod (mp_int * a, mp_int * b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* calc a value mod 2**b */ @@ -4627,9 +4632,9 @@ mp_mod_2d (mp_int * a, int b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mod_2d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_mod_2d.c */ @@ -4648,7 +4653,7 @@ mp_mod_2d (mp_int * a, int b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ int @@ -4658,9 +4663,9 @@ mp_mod_d (mp_int * a, mp_digit b, mp_digit * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mod_d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_mod_d.c */ @@ -4679,7 +4684,7 @@ mp_mod_d (mp_int * a, mp_digit b, mp_digit * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* @@ -4721,9 +4726,9 @@ int mp_montgomery_calc_normalization (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_montgomery_calc_normalization.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_montgomery_calc_normalization.c */ @@ -4742,7 +4747,7 @@ int mp_montgomery_calc_normalization (mp_int * a, mp_int * b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes xR**-1 == x (mod N) via Montgomery Reduction */ @@ -4843,9 +4848,9 @@ mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_montgomery_reduce.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_montgomery_reduce.c */ @@ -4864,7 +4869,7 @@ mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* setups the montgomery reduction stuff */ @@ -4900,15 +4905,15 @@ mp_montgomery_setup (mp_int * n, mp_digit * rho) #endif /* rho = -1/m mod b */ - *rho = (((mp_word)1 << ((mp_word) DIGIT_BIT)) - x) & MP_MASK; + *rho = (unsigned long)(((mp_word)1 << ((mp_word) DIGIT_BIT)) - x) & MP_MASK; return MP_OKAY; } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_montgomery_setup.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_montgomery_setup.c */ @@ -4927,7 +4932,7 @@ mp_montgomery_setup (mp_int * n, mp_digit * rho) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* high level multiplication (handles sign) */ @@ -4976,9 +4981,9 @@ int mp_mul (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mul.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_mul.c */ @@ -4997,7 +5002,7 @@ int mp_mul (mp_int * a, mp_int * b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* b = a*2 */ @@ -5062,9 +5067,9 @@ int mp_mul_2(mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mul_2.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_mul_2.c */ @@ -5083,7 +5088,7 @@ int mp_mul_2(mp_int * a, mp_int * b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* shift left by a certain bit count */ @@ -5151,9 +5156,9 @@ int mp_mul_2d (mp_int * a, int b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mul_2d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_mul_2d.c */ @@ -5172,7 +5177,7 @@ int mp_mul_2d (mp_int * a, int b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* multiply by a digit */ @@ -5234,9 +5239,9 @@ mp_mul_d (mp_int * a, mp_digit b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mul_d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_mul_d.c */ @@ -5255,7 +5260,7 @@ mp_mul_d (mp_int * a, mp_digit b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* d = a * b (mod c) */ @@ -5278,9 +5283,9 @@ int mp_mulmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mulmod.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_mulmod.c */ @@ -5299,7 +5304,7 @@ int mp_mulmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* find the n'th root of an integer @@ -5414,9 +5419,9 @@ LBL_T1:mp_clear (&t1); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_n_root.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_n_root.c */ @@ -5435,7 +5440,7 @@ LBL_T1:mp_clear (&t1); * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* b = -a */ @@ -5458,9 +5463,9 @@ int mp_neg (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_neg.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_neg.c */ @@ -5479,7 +5484,7 @@ int mp_neg (mp_int * a, mp_int * b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* OR two ints together */ @@ -5512,9 +5517,9 @@ int mp_or (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_or.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_or.c */ @@ -5533,7 +5538,7 @@ int mp_or (mp_int * a, mp_int * b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* performs one Fermat test. @@ -5578,9 +5583,9 @@ LBL_T:mp_clear (&t); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_fermat.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_prime_fermat.c */ @@ -5599,7 +5604,7 @@ LBL_T:mp_clear (&t); * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* determines if an integers is divisible by one @@ -5632,9 +5637,9 @@ int mp_prime_is_divisible (mp_int * a, int *result) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_is_divisible.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_prime_is_divisible.c */ @@ -5653,7 +5658,7 @@ int mp_prime_is_divisible (mp_int * a, int *result) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* performs a variable number of rounds of Miller-Rabin @@ -5719,9 +5724,9 @@ LBL_B:mp_clear (&b); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_is_prime.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_prime_is_prime.c */ @@ -5740,7 +5745,7 @@ LBL_B:mp_clear (&b); * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Miller-Rabin test of "a" to the base of "b" as described in @@ -5826,9 +5831,9 @@ LBL_N1:mp_clear (&n1); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_miller_rabin.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_prime_miller_rabin.c */ @@ -5847,7 +5852,7 @@ LBL_N1:mp_clear (&n1); * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* finds the next prime after the number "a" using "t" trials @@ -6000,9 +6005,9 @@ LBL_ERR: #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_next_prime.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_prime_next_prime.c */ @@ -6021,7 +6026,7 @@ LBL_ERR: * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ @@ -6056,9 +6061,9 @@ int mp_prime_rabin_miller_trials(int size) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_rabin_miller_trials.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_prime_rabin_miller_trials.c */ @@ -6077,7 +6082,7 @@ int mp_prime_rabin_miller_trials(int size) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* makes a truly random prime of a given size (bits), @@ -6185,9 +6190,9 @@ error: #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_random_ex.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_prime_random_ex.c */ @@ -6206,7 +6211,7 @@ error: * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* returns size of ASCII reprensentation */ @@ -6267,9 +6272,9 @@ int mp_radix_size (mp_int * a, int radix, int *size) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_radix_size.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_radix_size.c */ @@ -6288,16 +6293,16 @@ int mp_radix_size (mp_int * a, int radix, int *size) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* chars used in radix conversions */ const char *mp_s_rmap = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/"; #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_radix_smap.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_radix_smap.c */ @@ -6316,7 +6321,7 @@ const char *mp_s_rmap = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrs * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* makes a pseudo-random int of a given size */ @@ -6354,9 +6359,9 @@ mp_rand (mp_int * a, int digits) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_rand.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_rand.c */ @@ -6375,7 +6380,7 @@ mp_rand (mp_int * a, int digits) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* read a string [ASCII] in a given radix */ @@ -6443,9 +6448,9 @@ int mp_read_radix (mp_int * a, const char *str, int radix) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_read_radix.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_read_radix.c */ @@ -6464,7 +6469,7 @@ int mp_read_radix (mp_int * a, const char *str, int radix) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* read signed bin, big endian, first byte is 0==positive or 1==negative */ @@ -6488,9 +6493,9 @@ int mp_read_signed_bin (mp_int * a, const unsigned char *b, int c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_read_signed_bin.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_read_signed_bin.c */ @@ -6509,7 +6514,7 @@ int mp_read_signed_bin (mp_int * a, const unsigned char *b, int c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* reads a unsigned char array, assumes the msb is stored first [big endian] */ @@ -6547,9 +6552,9 @@ int mp_read_unsigned_bin (mp_int * a, const unsigned char *b, int c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_read_unsigned_bin.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_read_unsigned_bin.c */ @@ -6568,7 +6573,7 @@ int mp_read_unsigned_bin (mp_int * a, const unsigned char *b, int c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* reduces x mod m, assumes 0 < x < m**2, mu is @@ -6651,9 +6656,9 @@ CLEANUP: } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_reduce.c */ @@ -6672,7 +6677,7 @@ CLEANUP: * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* reduces a modulo n where n is of the form 2**p - d */ @@ -6716,9 +6721,9 @@ ERR: #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_reduce_2k.c */ @@ -6737,7 +6742,7 @@ ERR: * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* reduces a modulo n where n is of the form 2**p - d @@ -6782,9 +6787,9 @@ ERR: #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k_l.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_reduce_2k_l.c */ @@ -6803,7 +6808,7 @@ ERR: * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* determines the setup value */ @@ -6833,9 +6838,9 @@ int mp_reduce_2k_setup(mp_int *a, mp_digit *d) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k_setup.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_reduce_2k_setup.c */ @@ -6854,7 +6859,7 @@ int mp_reduce_2k_setup(mp_int *a, mp_digit *d) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* determines the setup value */ @@ -6881,9 +6886,9 @@ ERR: } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k_setup_l.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_reduce_2k_setup_l.c */ @@ -6902,7 +6907,7 @@ ERR: * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* determines if mp_reduce_2k can be used */ @@ -6937,9 +6942,9 @@ int mp_reduce_is_2k(mp_int *a) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_is_2k.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_reduce_is_2k.c */ @@ -6958,7 +6963,7 @@ int mp_reduce_is_2k(mp_int *a) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* determines if reduce_2k_l can be used */ @@ -6985,9 +6990,9 @@ int mp_reduce_is_2k_l(mp_int *a) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_is_2k_l.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_reduce_is_2k_l.c */ @@ -7006,7 +7011,7 @@ int mp_reduce_is_2k_l(mp_int *a) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* pre-calculate the value required for Barrett reduction @@ -7023,9 +7028,9 @@ int mp_reduce_setup (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_setup.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_reduce_setup.c */ @@ -7044,7 +7049,7 @@ int mp_reduce_setup (mp_int * a, mp_int * b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* shift right a certain amount of digits */ @@ -7099,9 +7104,9 @@ void mp_rshd (mp_int * a, int b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_rshd.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_rshd.c */ @@ -7120,7 +7125,7 @@ void mp_rshd (mp_int * a, int b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* set to a digit */ @@ -7132,9 +7137,9 @@ void mp_set (mp_int * a, mp_digit b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_set.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_set.c */ @@ -7153,7 +7158,7 @@ void mp_set (mp_int * a, mp_digit b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* set a 32-bit const */ @@ -7184,9 +7189,9 @@ int mp_set_int (mp_int * a, unsigned long b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_set_int.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_set_int.c */ @@ -7205,7 +7210,7 @@ int mp_set_int (mp_int * a, unsigned long b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* shrink a bignum */ @@ -7223,9 +7228,9 @@ int mp_shrink (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_shrink.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_shrink.c */ @@ -7244,7 +7249,7 @@ int mp_shrink (mp_int * a) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* get the size for an signed equivalent */ @@ -7254,9 +7259,9 @@ int mp_signed_bin_size (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_signed_bin_size.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_signed_bin_size.c */ @@ -7275,7 +7280,7 @@ int mp_signed_bin_size (mp_int * a) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes b = a*a */ @@ -7316,9 +7321,9 @@ if (a->used >= KARATSUBA_SQR_CUTOFF) { } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_sqr.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_sqr.c */ @@ -7337,7 +7342,7 @@ if (a->used >= KARATSUBA_SQR_CUTOFF) { * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* c = a * a (mod b) */ @@ -7361,9 +7366,9 @@ mp_sqrmod (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_sqrmod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_sqrmod.c */ @@ -7382,7 +7387,7 @@ mp_sqrmod (mp_int * a, mp_int * b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* this function is less generic than mp_n_root, simpler and faster */ @@ -7446,9 +7451,9 @@ E2: mp_clear(&t1); #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_sqrt.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_sqrt.c */ @@ -7467,7 +7472,7 @@ E2: mp_clear(&t1); * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* high level subtraction (handles signs) */ @@ -7509,9 +7514,9 @@ mp_sub (mp_int * a, mp_int * b, mp_int * c) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_sub.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_sub.c */ @@ -7530,7 +7535,7 @@ mp_sub (mp_int * a, mp_int * b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* single digit subtraction */ @@ -7606,9 +7611,9 @@ mp_sub_d (mp_int * a, mp_digit b, mp_int * c) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_sub_d.c,v $ */ +/* $Revision: 1.6 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_sub_d.c */ @@ -7627,7 +7632,7 @@ mp_sub_d (mp_int * a, mp_digit b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* d = a - b (mod c) */ @@ -7652,9 +7657,9 @@ mp_submod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_submod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_submod.c */ @@ -7673,7 +7678,7 @@ mp_submod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* store in signed [big endian] format */ @@ -7689,9 +7694,9 @@ int mp_to_signed_bin (mp_int * a, unsigned char *b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_to_signed_bin.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_to_signed_bin.c */ @@ -7710,7 +7715,7 @@ int mp_to_signed_bin (mp_int * a, unsigned char *b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* store in signed [big endian] format */ @@ -7724,9 +7729,9 @@ int mp_to_signed_bin_n (mp_int * a, unsigned char *b, unsigned long *outlen) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_to_signed_bin_n.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_to_signed_bin_n.c */ @@ -7745,7 +7750,7 @@ int mp_to_signed_bin_n (mp_int * a, unsigned char *b, unsigned long *outlen) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* store in unsigned [big endian] format */ @@ -7776,9 +7781,9 @@ int mp_to_unsigned_bin (mp_int * a, unsigned char *b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_to_unsigned_bin.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_to_unsigned_bin.c */ @@ -7797,7 +7802,7 @@ int mp_to_unsigned_bin (mp_int * a, unsigned char *b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* store in unsigned [big endian] format */ @@ -7811,9 +7816,9 @@ int mp_to_unsigned_bin_n (mp_int * a, unsigned char *b, unsigned long *outlen) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_to_unsigned_bin_n.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_to_unsigned_bin_n.c */ @@ -7832,7 +7837,7 @@ int mp_to_unsigned_bin_n (mp_int * a, unsigned char *b, unsigned long *outlen) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* multiplication using the Toom-Cook 3-way algorithm @@ -8099,9 +8104,9 @@ ERR: #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_toom_mul.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_toom_mul.c */ @@ -8120,7 +8125,7 @@ ERR: * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* squaring using Toom-Cook 3-way algorithm */ @@ -8329,9 +8334,9 @@ ERR: #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_toom_sqr.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_toom_sqr.c */ @@ -8350,7 +8355,7 @@ ERR: * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* stores a bignum as a ASCII string in a given radix (2..64) */ @@ -8408,9 +8413,9 @@ int mp_toradix (mp_int * a, char *str, int radix) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_toradix.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_toradix.c */ @@ -8429,7 +8434,7 @@ int mp_toradix (mp_int * a, char *str, int radix) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* stores a bignum as a ASCII string in a given radix (2..64) @@ -8500,9 +8505,9 @@ int mp_toradix_n(mp_int * a, char *str, int radix, int maxlen) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_toradix_n.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_toradix_n.c */ @@ -8521,7 +8526,7 @@ int mp_toradix_n(mp_int * a, char *str, int radix, int maxlen) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* get the size for an unsigned equivalent */ @@ -8532,9 +8537,9 @@ int mp_unsigned_bin_size (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_unsigned_bin_size.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_unsigned_bin_size.c */ @@ -8553,7 +8558,7 @@ int mp_unsigned_bin_size (mp_int * a) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* XOR two ints together */ @@ -8587,9 +8592,9 @@ mp_xor (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_xor.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_xor.c */ @@ -8608,7 +8613,7 @@ mp_xor (mp_int * a, mp_int * b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* set to zero */ @@ -8627,9 +8632,9 @@ void mp_zero (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_zero.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_zero.c */ @@ -8648,7 +8653,7 @@ void mp_zero (mp_int * a) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ const mp_digit ltm_prime_tab[] = { 0x0002, 0x0003, 0x0005, 0x0007, 0x000B, 0x000D, 0x0011, 0x0013, @@ -8692,9 +8697,9 @@ const mp_digit ltm_prime_tab[] = { }; #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_prime_tab.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_prime_tab.c */ @@ -8713,7 +8718,7 @@ const mp_digit ltm_prime_tab[] = { * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* reverse an array, used for radix code */ @@ -8735,9 +8740,9 @@ bn_reverse (unsigned char *s, int len) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_reverse.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_reverse.c */ @@ -8756,7 +8761,7 @@ bn_reverse (unsigned char *s, int len) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* low level addition, based on HAC pp.594, Algorithm 14.7 */ @@ -8848,9 +8853,9 @@ s_mp_add (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_s_mp_add.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_s_mp_add.c */ @@ -8869,7 +8874,7 @@ s_mp_add (mp_int * a, mp_int * b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #ifdef MP_LOW_MEM #define TAB_SIZE 32 @@ -9104,9 +9109,9 @@ LBL_M: } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_s_mp_exptmod.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_s_mp_exptmod.c */ @@ -9125,7 +9130,7 @@ LBL_M: * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* multiplies |a| * |b| and only computes upto digs digits of result @@ -9198,9 +9203,9 @@ int s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_s_mp_mul_digs.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_s_mp_mul_digs.c */ @@ -9219,7 +9224,7 @@ int s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* multiplies |a| * |b| and does not compute the lower digs digits @@ -9283,9 +9288,9 @@ s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_s_mp_mul_high_digs.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_s_mp_mul_high_digs.c */ @@ -9304,7 +9309,7 @@ s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* low level squaring, b = a*a, HAC pp.596-597, Algorithm 14.16 */ @@ -9371,9 +9376,9 @@ int s_mp_sqr (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_s_mp_sqr.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_s_mp_sqr.c */ @@ -9392,7 +9397,7 @@ int s_mp_sqr (mp_int * a, mp_int * b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* low level subtraction (assumes |a| > |b|), HAC pp.595 Algorithm 14.9 */ @@ -9464,9 +9469,9 @@ s_mp_sub (mp_int * a, mp_int * b, mp_int * c) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_s_mp_sub.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_s_mp_sub.c */ @@ -9485,7 +9490,7 @@ s_mp_sub (mp_int * a, mp_int * b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Known optimal configurations @@ -9504,9 +9509,9 @@ int KARATSUBA_MUL_CUTOFF = 80, /* Min. number of digits before Karatsub TOOM_SQR_CUTOFF = 400; #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bncore.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bncore.c */ diff --git a/libtommath/tommath.pdf b/libtommath/tommath.pdf index c9571d8..33994c3 100644 Binary files a/libtommath/tommath.pdf and b/libtommath/tommath.pdf differ -- cgit v0.12 From fac003f85aeba679d1cc6bea4eb8a84fc0ebd9f0 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 14 Mar 2011 12:08:07 +0000 Subject: Import of tommath 0.42.0 --- libtommath/bn.ind | 156 +- libtommath/bn.pdf | Bin 345714 -> 352808 bytes libtommath/bn.tex | 2 +- libtommath/bn_error.c | 6 +- libtommath/bn_fast_mp_invmod.c | 6 +- libtommath/bn_fast_mp_montgomery_reduce.c | 6 +- libtommath/bn_fast_s_mp_mul_digs.c | 6 +- libtommath/bn_fast_s_mp_mul_high_digs.c | 6 +- libtommath/bn_fast_s_mp_sqr.c | 6 +- libtommath/bn_mp_2expt.c | 6 +- libtommath/bn_mp_abs.c | 6 +- libtommath/bn_mp_add.c | 6 +- libtommath/bn_mp_add_d.c | 6 +- libtommath/bn_mp_addmod.c | 6 +- libtommath/bn_mp_and.c | 6 +- libtommath/bn_mp_clamp.c | 6 +- libtommath/bn_mp_clear.c | 6 +- libtommath/bn_mp_clear_multi.c | 6 +- libtommath/bn_mp_cmp.c | 6 +- libtommath/bn_mp_cmp_d.c | 6 +- libtommath/bn_mp_cmp_mag.c | 6 +- libtommath/bn_mp_cnt_lsb.c | 6 +- libtommath/bn_mp_copy.c | 6 +- libtommath/bn_mp_count_bits.c | 6 +- libtommath/bn_mp_div.c | 6 +- libtommath/bn_mp_div_2.c | 6 +- libtommath/bn_mp_div_2d.c | 6 +- libtommath/bn_mp_div_3.c | 6 +- libtommath/bn_mp_div_d.c | 6 +- libtommath/bn_mp_dr_is_modulus.c | 6 +- libtommath/bn_mp_dr_reduce.c | 6 +- libtommath/bn_mp_dr_setup.c | 6 +- libtommath/bn_mp_exch.c | 6 +- libtommath/bn_mp_expt_d.c | 6 +- libtommath/bn_mp_exptmod.c | 6 +- libtommath/bn_mp_exptmod_fast.c | 6 +- libtommath/bn_mp_exteuclid.c | 6 +- libtommath/bn_mp_fread.c | 6 +- libtommath/bn_mp_fwrite.c | 6 +- libtommath/bn_mp_gcd.c | 6 +- libtommath/bn_mp_get_int.c | 6 +- libtommath/bn_mp_grow.c | 6 +- libtommath/bn_mp_init.c | 6 +- libtommath/bn_mp_init_copy.c | 6 +- libtommath/bn_mp_init_multi.c | 6 +- libtommath/bn_mp_init_set.c | 6 +- libtommath/bn_mp_init_set_int.c | 6 +- libtommath/bn_mp_init_size.c | 6 +- libtommath/bn_mp_invmod.c | 6 +- libtommath/bn_mp_invmod_slow.c | 6 +- libtommath/bn_mp_is_square.c | 6 +- libtommath/bn_mp_jacobi.c | 6 +- libtommath/bn_mp_karatsuba_mul.c | 6 +- libtommath/bn_mp_karatsuba_sqr.c | 6 +- libtommath/bn_mp_lcm.c | 6 +- libtommath/bn_mp_lshd.c | 6 +- libtommath/bn_mp_mod.c | 6 +- libtommath/bn_mp_mod_2d.c | 6 +- libtommath/bn_mp_mod_d.c | 6 +- libtommath/bn_mp_montgomery_calc_normalization.c | 6 +- libtommath/bn_mp_montgomery_reduce.c | 6 +- libtommath/bn_mp_montgomery_setup.c | 6 +- libtommath/bn_mp_mul.c | 6 +- libtommath/bn_mp_mul_2.c | 6 +- libtommath/bn_mp_mul_2d.c | 6 +- libtommath/bn_mp_mul_d.c | 6 +- libtommath/bn_mp_mulmod.c | 6 +- libtommath/bn_mp_n_root.c | 6 +- libtommath/bn_mp_neg.c | 6 +- libtommath/bn_mp_or.c | 6 +- libtommath/bn_mp_prime_fermat.c | 6 +- libtommath/bn_mp_prime_is_divisible.c | 6 +- libtommath/bn_mp_prime_is_prime.c | 6 +- libtommath/bn_mp_prime_miller_rabin.c | 6 +- libtommath/bn_mp_prime_next_prime.c | 8 +- libtommath/bn_mp_prime_rabin_miller_trials.c | 6 +- libtommath/bn_mp_prime_random_ex.c | 6 +- libtommath/bn_mp_radix_size.c | 6 +- libtommath/bn_mp_radix_smap.c | 6 +- libtommath/bn_mp_rand.c | 6 +- libtommath/bn_mp_read_radix.c | 6 +- libtommath/bn_mp_read_signed_bin.c | 6 +- libtommath/bn_mp_read_unsigned_bin.c | 6 +- libtommath/bn_mp_reduce.c | 6 +- libtommath/bn_mp_reduce_2k.c | 6 +- libtommath/bn_mp_reduce_2k_l.c | 6 +- libtommath/bn_mp_reduce_2k_setup.c | 6 +- libtommath/bn_mp_reduce_2k_setup_l.c | 6 +- libtommath/bn_mp_reduce_is_2k.c | 6 +- libtommath/bn_mp_reduce_is_2k_l.c | 6 +- libtommath/bn_mp_reduce_setup.c | 6 +- libtommath/bn_mp_rshd.c | 6 +- libtommath/bn_mp_set.c | 6 +- libtommath/bn_mp_set_int.c | 6 +- libtommath/bn_mp_shrink.c | 17 +- libtommath/bn_mp_signed_bin_size.c | 6 +- libtommath/bn_mp_sqr.c | 6 +- libtommath/bn_mp_sqrmod.c | 6 +- libtommath/bn_mp_sqrt.c | 6 +- libtommath/bn_mp_sub.c | 6 +- libtommath/bn_mp_sub_d.c | 6 +- libtommath/bn_mp_submod.c | 6 +- libtommath/bn_mp_to_signed_bin.c | 6 +- libtommath/bn_mp_to_signed_bin_n.c | 6 +- libtommath/bn_mp_to_unsigned_bin.c | 6 +- libtommath/bn_mp_to_unsigned_bin_n.c | 6 +- libtommath/bn_mp_toom_mul.c | 6 +- libtommath/bn_mp_toom_sqr.c | 6 +- libtommath/bn_mp_toradix.c | 6 +- libtommath/bn_mp_toradix_n.c | 6 +- libtommath/bn_mp_unsigned_bin_size.c | 6 +- libtommath/bn_mp_xor.c | 6 +- libtommath/bn_mp_zero.c | 6 +- libtommath/bn_prime_tab.c | 6 +- libtommath/bn_reverse.c | 6 +- libtommath/bn_s_mp_add.c | 6 +- libtommath/bn_s_mp_exptmod.c | 6 +- libtommath/bn_s_mp_mul_digs.c | 6 +- libtommath/bn_s_mp_mul_high_digs.c | 6 +- libtommath/bn_s_mp_sqr.c | 6 +- libtommath/bn_s_mp_sub.c | 6 +- libtommath/bncore.c | 6 +- libtommath/changes.txt | 6 + libtommath/demo/demo.c | 6 +- libtommath/demo/timing.c | 6 +- libtommath/etc/2kprime.c | 6 +- libtommath/etc/drprime.c | 6 +- libtommath/etc/mersenne.c | 6 +- libtommath/etc/mont.c | 6 +- libtommath/etc/pprime.c | 6 +- libtommath/etc/tune.c | 6 +- libtommath/libtommath_VS2005.sln | 20 + libtommath/libtommath_VS2005.vcproj | 2803 +++++++++++++++++++++ libtommath/libtommath_VS2008.sln | 20 + libtommath/libtommath_VS2008.vcproj | 2805 ++++++++++++++++++++++ libtommath/makefile | 2 +- libtommath/mtest/logtab.h | 6 +- libtommath/mtest/mpi-config.h | 8 +- libtommath/mtest/mpi-types.h | 6 +- libtommath/mtest/mpi.c | 8 +- libtommath/mtest/mpi.h | 8 +- libtommath/mtest/mtest.c | 6 +- libtommath/poster.pdf | Bin 37821 -> 37806 bytes libtommath/pre_gen/mpi.c | 727 +++--- libtommath/tommath.h | 6 +- libtommath/tommath.pdf | Bin 1183099 -> 1332978 bytes libtommath/tommath_class.h | 6 +- libtommath/tommath_superclass.h | 6 +- 148 files changed, 6520 insertions(+), 856 deletions(-) create mode 100755 libtommath/libtommath_VS2005.sln create mode 100755 libtommath/libtommath_VS2005.vcproj create mode 100755 libtommath/libtommath_VS2008.sln create mode 100755 libtommath/libtommath_VS2008.vcproj diff --git a/libtommath/bn.ind b/libtommath/bn.ind index c099b52..3c3d288 100644 --- a/libtommath/bn.ind +++ b/libtommath/bn.ind @@ -1,82 +1,82 @@ \begin{theindex} - \item mp\_add, \hyperpage{31} - \item mp\_add\_d, \hyperpage{56} - \item mp\_and, \hyperpage{31} - \item mp\_clear, \hyperpage{12} - \item mp\_clear\_multi, \hyperpage{13} - \item mp\_cmp, \hyperpage{25} - \item mp\_cmp\_d, \hyperpage{26} - \item mp\_cmp\_mag, \hyperpage{23} - \item mp\_div, \hyperpage{32} - \item mp\_div\_2, \hyperpage{28} - \item mp\_div\_2d, \hyperpage{30} - \item mp\_div\_d, \hyperpage{56} - \item mp\_dr\_reduce, \hyperpage{45} - \item mp\_dr\_setup, \hyperpage{45} - \item MP\_EQ, \hyperpage{23} - \item mp\_error\_to\_string, \hyperpage{9} - \item mp\_expt\_d, \hyperpage{47} - \item mp\_exptmod, \hyperpage{47} - \item mp\_exteuclid, \hyperpage{55} - \item mp\_gcd, \hyperpage{55} - \item mp\_get\_int, \hyperpage{20} - \item mp\_grow, \hyperpage{17} - \item MP\_GT, \hyperpage{23} - \item mp\_init, \hyperpage{11} - \item mp\_init\_copy, \hyperpage{14} - \item mp\_init\_multi, \hyperpage{13} - \item mp\_init\_set, \hyperpage{21} - \item mp\_init\_set\_int, \hyperpage{21} - \item mp\_init\_size, \hyperpage{15} - \item mp\_int, \hyperpage{10} - \item mp\_invmod, \hyperpage{56} - \item mp\_jacobi, \hyperpage{56} - \item mp\_lcm, \hyperpage{56} - \item mp\_lshd, \hyperpage{30} - \item MP\_LT, \hyperpage{23} - \item MP\_MEM, \hyperpage{9} - \item mp\_mod, \hyperpage{39} - \item mp\_mod\_d, \hyperpage{56} - \item mp\_montgomery\_calc\_normalization, \hyperpage{42} - \item mp\_montgomery\_reduce, \hyperpage{42} - \item mp\_montgomery\_setup, \hyperpage{42} - \item mp\_mul, \hyperpage{33} - \item mp\_mul\_2, \hyperpage{28} - \item mp\_mul\_2d, \hyperpage{29} - \item mp\_mul\_d, \hyperpage{56} - \item mp\_n\_root, \hyperpage{48} - \item mp\_neg, \hyperpage{31, 32} - \item MP\_NO, \hyperpage{9} - \item MP\_OKAY, \hyperpage{9} - \item mp\_or, \hyperpage{31} - \item mp\_prime\_fermat, \hyperpage{49} - \item mp\_prime\_is\_divisible, \hyperpage{49} - \item mp\_prime\_is\_prime, \hyperpage{51} - \item mp\_prime\_miller\_rabin, \hyperpage{50} - \item mp\_prime\_next\_prime, \hyperpage{51} - \item mp\_prime\_rabin\_miller\_trials, \hyperpage{50} - \item mp\_prime\_random, \hyperpage{51} - \item mp\_prime\_random\_ex, \hyperpage{52} - \item mp\_radix\_size, \hyperpage{53} - \item mp\_read\_radix, \hyperpage{53} - \item mp\_read\_unsigned\_bin, \hyperpage{54} - \item mp\_reduce, \hyperpage{40} - \item mp\_reduce\_2k, \hyperpage{46} - \item mp\_reduce\_2k\_setup, \hyperpage{46} - \item mp\_reduce\_setup, \hyperpage{40} - \item mp\_rshd, \hyperpage{30} - \item mp\_set, \hyperpage{19} - \item mp\_set\_int, \hyperpage{20} - \item mp\_shrink, \hyperpage{16} - \item mp\_sqr, \hyperpage{35} - \item mp\_sub, \hyperpage{31} - \item mp\_sub\_d, \hyperpage{56} - \item mp\_to\_unsigned\_bin, \hyperpage{54} - \item mp\_toradix, \hyperpage{53} - \item mp\_unsigned\_bin\_size, \hyperpage{54} - \item MP\_VAL, \hyperpage{9} - \item mp\_xor, \hyperpage{31} - \item MP\_YES, \hyperpage{9} + \item mp\_add, \hyperpage{23} + \item mp\_add\_d, \hyperpage{44} + \item mp\_and, \hyperpage{23} + \item mp\_clear, \hyperpage{9} + \item mp\_clear\_multi, \hyperpage{10} + \item mp\_cmp, \hyperpage{19} + \item mp\_cmp\_d, \hyperpage{20} + \item mp\_cmp\_mag, \hyperpage{18} + \item mp\_div, \hyperpage{24} + \item mp\_div\_2, \hyperpage{21} + \item mp\_div\_2d, \hyperpage{22} + \item mp\_div\_d, \hyperpage{44} + \item mp\_dr\_reduce, \hyperpage{33} + \item mp\_dr\_setup, \hyperpage{33} + \item MP\_EQ, \hyperpage{18} + \item mp\_error\_to\_string, \hyperpage{7} + \item mp\_expt\_d, \hyperpage{35} + \item mp\_exptmod, \hyperpage{35} + \item mp\_exteuclid, \hyperpage{43} + \item mp\_gcd, \hyperpage{43} + \item mp\_get\_int, \hyperpage{16} + \item mp\_grow, \hyperpage{13} + \item MP\_GT, \hyperpage{18} + \item mp\_init, \hyperpage{8} + \item mp\_init\_copy, \hyperpage{10} + \item mp\_init\_multi, \hyperpage{10} + \item mp\_init\_set, \hyperpage{17} + \item mp\_init\_set\_int, \hyperpage{17} + \item mp\_init\_size, \hyperpage{11} + \item mp\_int, \hyperpage{8} + \item mp\_invmod, \hyperpage{44} + \item mp\_jacobi, \hyperpage{43} + \item mp\_lcm, \hyperpage{43} + \item mp\_lshd, \hyperpage{23} + \item MP\_LT, \hyperpage{18} + \item MP\_MEM, \hyperpage{7} + \item mp\_mod, \hyperpage{29} + \item mp\_mod\_d, \hyperpage{44} + \item mp\_montgomery\_calc\_normalization, \hyperpage{31} + \item mp\_montgomery\_reduce, \hyperpage{31} + \item mp\_montgomery\_setup, \hyperpage{31} + \item mp\_mul, \hyperpage{25} + \item mp\_mul\_2, \hyperpage{21} + \item mp\_mul\_2d, \hyperpage{22} + \item mp\_mul\_d, \hyperpage{44} + \item mp\_n\_root, \hyperpage{35} + \item mp\_neg, \hyperpage{24} + \item MP\_NO, \hyperpage{7} + \item MP\_OKAY, \hyperpage{7} + \item mp\_or, \hyperpage{23} + \item mp\_prime\_fermat, \hyperpage{37} + \item mp\_prime\_is\_divisible, \hyperpage{37} + \item mp\_prime\_is\_prime, \hyperpage{38} + \item mp\_prime\_miller\_rabin, \hyperpage{37} + \item mp\_prime\_next\_prime, \hyperpage{38} + \item mp\_prime\_rabin\_miller\_trials, \hyperpage{38} + \item mp\_prime\_random, \hyperpage{38} + \item mp\_prime\_random\_ex, \hyperpage{39} + \item mp\_radix\_size, \hyperpage{41} + \item mp\_read\_radix, \hyperpage{41} + \item mp\_read\_unsigned\_bin, \hyperpage{42} + \item mp\_reduce, \hyperpage{30} + \item mp\_reduce\_2k, \hyperpage{34} + \item mp\_reduce\_2k\_setup, \hyperpage{34} + \item mp\_reduce\_setup, \hyperpage{29} + \item mp\_rshd, \hyperpage{23} + \item mp\_set, \hyperpage{15} + \item mp\_set\_int, \hyperpage{16} + \item mp\_shrink, \hyperpage{12} + \item mp\_sqr, \hyperpage{26} + \item mp\_sub, \hyperpage{23} + \item mp\_sub\_d, \hyperpage{44} + \item mp\_to\_unsigned\_bin, \hyperpage{42} + \item mp\_toradix, \hyperpage{41} + \item mp\_unsigned\_bin\_size, \hyperpage{41} + \item MP\_VAL, \hyperpage{7} + \item mp\_xor, \hyperpage{23} + \item MP\_YES, \hyperpage{7} \end{theindex} diff --git a/libtommath/bn.pdf b/libtommath/bn.pdf index 5be7123..078628c 100644 Binary files a/libtommath/bn.pdf and b/libtommath/bn.pdf differ diff --git a/libtommath/bn.tex b/libtommath/bn.tex index 9017860..71b6840 100644 --- a/libtommath/bn.tex +++ b/libtommath/bn.tex @@ -49,7 +49,7 @@ \begin{document} \frontmatter \pagestyle{empty} -\title{LibTomMath User Manual \\ v0.41} +\title{LibTomMath User Manual \\ v0.42.0} \author{Tom St Denis \\ tomstdenis@gmail.com} \maketitle This text, the library and the accompanying textbook are all hereby placed in the public domain. This book has been diff --git a/libtommath/bn_error.c b/libtommath/bn_error.c index b1b7177..250057b 100644 --- a/libtommath/bn_error.c +++ b/libtommath/bn_error.c @@ -42,6 +42,6 @@ char *mp_error_to_string(int code) #endif -/* $Source: /cvs/libtom/libtommath/bn_error.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_fast_mp_invmod.c b/libtommath/bn_fast_mp_invmod.c index ff03dff..948a134 100644 --- a/libtommath/bn_fast_mp_invmod.c +++ b/libtommath/bn_fast_mp_invmod.c @@ -143,6 +143,6 @@ LBL_ERR:mp_clear_multi (&x, &y, &u, &v, &B, &D, NULL); } #endif -/* $Source: /cvs/libtom/libtommath/bn_fast_mp_invmod.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_fast_mp_montgomery_reduce.c b/libtommath/bn_fast_mp_montgomery_reduce.c index b6c0694..1a81689 100644 --- a/libtommath/bn_fast_mp_montgomery_reduce.c +++ b/libtommath/bn_fast_mp_montgomery_reduce.c @@ -167,6 +167,6 @@ int fast_mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho) } #endif -/* $Source: /cvs/libtom/libtommath/bn_fast_mp_montgomery_reduce.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_fast_s_mp_mul_digs.c b/libtommath/bn_fast_s_mp_mul_digs.c index 91e10d6..04becfd 100644 --- a/libtommath/bn_fast_s_mp_mul_digs.c +++ b/libtommath/bn_fast_s_mp_mul_digs.c @@ -102,6 +102,6 @@ int fast_s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /cvs/libtom/libtommath/bn_fast_s_mp_mul_digs.c,v $ */ -/* $Revision: 1.8 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_fast_s_mp_mul_high_digs.c b/libtommath/bn_fast_s_mp_mul_high_digs.c index 5b114d7..98bee37 100644 --- a/libtommath/bn_fast_s_mp_mul_high_digs.c +++ b/libtommath/bn_fast_s_mp_mul_high_digs.c @@ -93,6 +93,6 @@ int fast_s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /cvs/libtom/libtommath/bn_fast_s_mp_mul_high_digs.c,v $ */ -/* $Revision: 1.6 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_fast_s_mp_sqr.c b/libtommath/bn_fast_s_mp_sqr.c index 19e92ef..086b52c 100644 --- a/libtommath/bn_fast_s_mp_sqr.c +++ b/libtommath/bn_fast_s_mp_sqr.c @@ -109,6 +109,6 @@ int fast_s_mp_sqr (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_fast_s_mp_sqr.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_2expt.c b/libtommath/bn_mp_2expt.c index f422ffc..4774aab 100644 --- a/libtommath/bn_mp_2expt.c +++ b/libtommath/bn_mp_2expt.c @@ -43,6 +43,6 @@ mp_2expt (mp_int * a, int b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_2expt.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_abs.c b/libtommath/bn_mp_abs.c index 09dd722..4d1fa44 100644 --- a/libtommath/bn_mp_abs.c +++ b/libtommath/bn_mp_abs.c @@ -38,6 +38,6 @@ mp_abs (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_abs.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_add.c b/libtommath/bn_mp_add.c index be20644..122c850 100644 --- a/libtommath/bn_mp_add.c +++ b/libtommath/bn_mp_add.c @@ -48,6 +48,6 @@ int mp_add (mp_int * a, mp_int * b, mp_int * c) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_add.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_add_d.c b/libtommath/bn_mp_add_d.c index 8ca36c1..aec8fc8 100644 --- a/libtommath/bn_mp_add_d.c +++ b/libtommath/bn_mp_add_d.c @@ -107,6 +107,6 @@ mp_add_d (mp_int * a, mp_digit b, mp_int * c) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_add_d.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_addmod.c b/libtommath/bn_mp_addmod.c index 6d8afe1..0376659 100644 --- a/libtommath/bn_mp_addmod.c +++ b/libtommath/bn_mp_addmod.c @@ -36,6 +36,6 @@ mp_addmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_addmod.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_and.c b/libtommath/bn_mp_and.c index 8ea2287..22dfbff 100644 --- a/libtommath/bn_mp_and.c +++ b/libtommath/bn_mp_and.c @@ -52,6 +52,6 @@ mp_and (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_and.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_clamp.c b/libtommath/bn_mp_clamp.c index 359c2ff..1e0c817 100644 --- a/libtommath/bn_mp_clamp.c +++ b/libtommath/bn_mp_clamp.c @@ -39,6 +39,6 @@ mp_clamp (mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_clamp.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_clear.c b/libtommath/bn_mp_clear.c index a65f0a3..72301df 100644 --- a/libtommath/bn_mp_clear.c +++ b/libtommath/bn_mp_clear.c @@ -39,6 +39,6 @@ mp_clear (mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_clear.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_clear_multi.c b/libtommath/bn_mp_clear_multi.c index daaea79..6bbc10c 100644 --- a/libtommath/bn_mp_clear_multi.c +++ b/libtommath/bn_mp_clear_multi.c @@ -29,6 +29,6 @@ void mp_clear_multi(mp_int *mp, ...) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_clear_multi.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_cmp.c b/libtommath/bn_mp_cmp.c index 533f36b..77d00cd 100644 --- a/libtommath/bn_mp_cmp.c +++ b/libtommath/bn_mp_cmp.c @@ -38,6 +38,6 @@ mp_cmp (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_cmp.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_cmp_d.c b/libtommath/bn_mp_cmp_d.c index 724c1c3..0d5bcb4 100644 --- a/libtommath/bn_mp_cmp_d.c +++ b/libtommath/bn_mp_cmp_d.c @@ -39,6 +39,6 @@ int mp_cmp_d(mp_int * a, mp_digit b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_cmp_d.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_cmp_mag.c b/libtommath/bn_mp_cmp_mag.c index 693eb7c..063fd18 100644 --- a/libtommath/bn_mp_cmp_mag.c +++ b/libtommath/bn_mp_cmp_mag.c @@ -50,6 +50,6 @@ int mp_cmp_mag (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_cmp_mag.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_cnt_lsb.c b/libtommath/bn_mp_cnt_lsb.c index 66d1a74..efebd2a 100644 --- a/libtommath/bn_mp_cnt_lsb.c +++ b/libtommath/bn_mp_cnt_lsb.c @@ -48,6 +48,6 @@ int mp_cnt_lsb(mp_int *a) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_cnt_lsb.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_copy.c b/libtommath/bn_mp_copy.c index b0de16d..45cac61 100644 --- a/libtommath/bn_mp_copy.c +++ b/libtommath/bn_mp_copy.c @@ -63,6 +63,6 @@ mp_copy (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_copy.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_count_bits.c b/libtommath/bn_mp_count_bits.c index 8bc5657..6c02ec6 100644 --- a/libtommath/bn_mp_count_bits.c +++ b/libtommath/bn_mp_count_bits.c @@ -40,6 +40,6 @@ mp_count_bits (mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_count_bits.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_div.c b/libtommath/bn_mp_div.c index aee9c94..af5c55d 100644 --- a/libtommath/bn_mp_div.c +++ b/libtommath/bn_mp_div.c @@ -287,6 +287,6 @@ LBL_Q:mp_clear (&q); #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_div.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_div_2.c b/libtommath/bn_mp_div_2.c index 7ee3e5b..64ef823 100644 --- a/libtommath/bn_mp_div_2.c +++ b/libtommath/bn_mp_div_2.c @@ -63,6 +63,6 @@ int mp_div_2(mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_div_2.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_div_2d.c b/libtommath/bn_mp_div_2d.c index 4f7fa59..72936a4 100644 --- a/libtommath/bn_mp_div_2d.c +++ b/libtommath/bn_mp_div_2d.c @@ -92,6 +92,6 @@ int mp_div_2d (mp_int * a, int b, mp_int * c, mp_int * d) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_div_2d.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_div_3.c b/libtommath/bn_mp_div_3.c index 3c60269..7f6869b 100644 --- a/libtommath/bn_mp_div_3.c +++ b/libtommath/bn_mp_div_3.c @@ -74,6 +74,6 @@ mp_div_3 (mp_int * a, mp_int *c, mp_digit * d) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_div_3.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_div_d.c b/libtommath/bn_mp_div_d.c index 6a26d4f..ca34e87 100644 --- a/libtommath/bn_mp_div_d.c +++ b/libtommath/bn_mp_div_d.c @@ -110,6 +110,6 @@ int mp_div_d (mp_int * a, mp_digit b, mp_int * c, mp_digit * d) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_div_d.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2007/01/09 04:44:32 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_dr_is_modulus.c b/libtommath/bn_mp_dr_is_modulus.c index 5237344..52b4fdf 100644 --- a/libtommath/bn_mp_dr_is_modulus.c +++ b/libtommath/bn_mp_dr_is_modulus.c @@ -38,6 +38,6 @@ int mp_dr_is_modulus(mp_int *a) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_dr_is_modulus.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_dr_reduce.c b/libtommath/bn_mp_dr_reduce.c index e60b578..47f0c60 100644 --- a/libtommath/bn_mp_dr_reduce.c +++ b/libtommath/bn_mp_dr_reduce.c @@ -89,6 +89,6 @@ top: } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_dr_reduce.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_dr_setup.c b/libtommath/bn_mp_dr_setup.c index 1d7d856..99ee67d 100644 --- a/libtommath/bn_mp_dr_setup.c +++ b/libtommath/bn_mp_dr_setup.c @@ -27,6 +27,6 @@ void mp_dr_setup(mp_int *a, mp_digit *d) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_dr_setup.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_exch.c b/libtommath/bn_mp_exch.c index 38574e0..dd3098e 100644 --- a/libtommath/bn_mp_exch.c +++ b/libtommath/bn_mp_exch.c @@ -29,6 +29,6 @@ mp_exch (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_exch.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_expt_d.c b/libtommath/bn_mp_expt_d.c index 4bdc2d1..f9357cc 100644 --- a/libtommath/bn_mp_expt_d.c +++ b/libtommath/bn_mp_expt_d.c @@ -52,6 +52,6 @@ int mp_expt_d (mp_int * a, mp_digit b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_expt_d.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_exptmod.c b/libtommath/bn_mp_exptmod.c index 0231916..8fbce19 100644 --- a/libtommath/bn_mp_exptmod.c +++ b/libtommath/bn_mp_exptmod.c @@ -107,6 +107,6 @@ int mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_exptmod.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_exptmod_fast.c b/libtommath/bn_mp_exptmod_fast.c index 2a3b3c9..60c7e2b 100644 --- a/libtommath/bn_mp_exptmod_fast.c +++ b/libtommath/bn_mp_exptmod_fast.c @@ -316,6 +316,6 @@ LBL_M: #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_exptmod_fast.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_exteuclid.c b/libtommath/bn_mp_exteuclid.c index e6c4ce2..c65928d 100644 --- a/libtommath/bn_mp_exteuclid.c +++ b/libtommath/bn_mp_exteuclid.c @@ -77,6 +77,6 @@ _ERR: mp_clear_multi(&u1, &u2, &u3, &v1, &v2, &v3, &t1, &t2, &t3, &q, &tmp, NULL } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_exteuclid.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_fread.c b/libtommath/bn_mp_fread.c index b344b6f..a2e51a1 100644 --- a/libtommath/bn_mp_fread.c +++ b/libtommath/bn_mp_fread.c @@ -62,6 +62,6 @@ int mp_fread(mp_int *a, int radix, FILE *stream) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_fread.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_fwrite.c b/libtommath/bn_mp_fwrite.c index a0b4c6b..b3fd834 100644 --- a/libtommath/bn_mp_fwrite.c +++ b/libtommath/bn_mp_fwrite.c @@ -47,6 +47,6 @@ int mp_fwrite(mp_int *a, int radix, FILE *stream) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_fwrite.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_gcd.c b/libtommath/bn_mp_gcd.c index b39ba90..b45cfed 100644 --- a/libtommath/bn_mp_gcd.c +++ b/libtommath/bn_mp_gcd.c @@ -100,6 +100,6 @@ LBL_U:mp_clear (&v); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_gcd.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_get_int.c b/libtommath/bn_mp_get_int.c index 17162e2..11baa0e 100644 --- a/libtommath/bn_mp_get_int.c +++ b/libtommath/bn_mp_get_int.c @@ -40,6 +40,6 @@ unsigned long mp_get_int(mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_get_int.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_grow.c b/libtommath/bn_mp_grow.c index cf2b949..f1c1cab 100644 --- a/libtommath/bn_mp_grow.c +++ b/libtommath/bn_mp_grow.c @@ -52,6 +52,6 @@ int mp_grow (mp_int * a, int size) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_grow.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_init.c b/libtommath/bn_mp_init.c index 8be27f5..79cca3c 100644 --- a/libtommath/bn_mp_init.c +++ b/libtommath/bn_mp_init.c @@ -41,6 +41,6 @@ int mp_init (mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_init.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_init_copy.c b/libtommath/bn_mp_init_copy.c index 0160811..8ce0ef9 100644 --- a/libtommath/bn_mp_init_copy.c +++ b/libtommath/bn_mp_init_copy.c @@ -27,6 +27,6 @@ int mp_init_copy (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_init_copy.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_init_multi.c b/libtommath/bn_mp_init_multi.c index 59dc3a9..a40ea8e 100644 --- a/libtommath/bn_mp_init_multi.c +++ b/libtommath/bn_mp_init_multi.c @@ -54,6 +54,6 @@ int mp_init_multi(mp_int *mp, ...) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_init_multi.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_init_set.c b/libtommath/bn_mp_init_set.c index 34edad9..f9b08e9 100644 --- a/libtommath/bn_mp_init_set.c +++ b/libtommath/bn_mp_init_set.c @@ -27,6 +27,6 @@ int mp_init_set (mp_int * a, mp_digit b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_init_set.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_init_set_int.c b/libtommath/bn_mp_init_set_int.c index 5c55993..9473c3f 100644 --- a/libtommath/bn_mp_init_set_int.c +++ b/libtommath/bn_mp_init_set_int.c @@ -26,6 +26,6 @@ int mp_init_set_int (mp_int * a, unsigned long b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_init_set_int.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_init_size.c b/libtommath/bn_mp_init_size.c index 8e01418..69dd49c 100644 --- a/libtommath/bn_mp_init_size.c +++ b/libtommath/bn_mp_init_size.c @@ -43,6 +43,6 @@ int mp_init_size (mp_int * a, int size) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_init_size.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_invmod.c b/libtommath/bn_mp_invmod.c index 1546514..f4bdc17 100644 --- a/libtommath/bn_mp_invmod.c +++ b/libtommath/bn_mp_invmod.c @@ -38,6 +38,6 @@ int mp_invmod (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_invmod.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_invmod_slow.c b/libtommath/bn_mp_invmod_slow.c index eedd47d..2430f02 100644 --- a/libtommath/bn_mp_invmod_slow.c +++ b/libtommath/bn_mp_invmod_slow.c @@ -170,6 +170,6 @@ LBL_ERR:mp_clear_multi (&x, &y, &u, &v, &A, &B, &C, &D, NULL); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_invmod_slow.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_is_square.c b/libtommath/bn_mp_is_square.c index 50c5244..12b9ec7 100644 --- a/libtommath/bn_mp_is_square.c +++ b/libtommath/bn_mp_is_square.c @@ -104,6 +104,6 @@ ERR:mp_clear(&t); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_is_square.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_jacobi.c b/libtommath/bn_mp_jacobi.c index 91cfeea..07a9d65 100644 --- a/libtommath/bn_mp_jacobi.c +++ b/libtommath/bn_mp_jacobi.c @@ -100,6 +100,6 @@ LBL_A1:mp_clear (&a1); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_jacobi.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_karatsuba_mul.c b/libtommath/bn_mp_karatsuba_mul.c index 8ea2c27..62e885c 100644 --- a/libtommath/bn_mp_karatsuba_mul.c +++ b/libtommath/bn_mp_karatsuba_mul.c @@ -162,6 +162,6 @@ ERR: } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_karatsuba_mul.c,v $ */ -/* $Revision: 1.6 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_karatsuba_sqr.c b/libtommath/bn_mp_karatsuba_sqr.c index a5e198b..ce5c753 100644 --- a/libtommath/bn_mp_karatsuba_sqr.c +++ b/libtommath/bn_mp_karatsuba_sqr.c @@ -116,6 +116,6 @@ ERR: } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_karatsuba_sqr.c,v $ */ -/* $Revision: 1.6 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_lcm.c b/libtommath/bn_mp_lcm.c index 781eef5..a4115da 100644 --- a/libtommath/bn_mp_lcm.c +++ b/libtommath/bn_mp_lcm.c @@ -55,6 +55,6 @@ LBL_T: } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_lcm.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_lshd.c b/libtommath/bn_mp_lshd.c index f118cf1..87c216b 100644 --- a/libtommath/bn_mp_lshd.c +++ b/libtommath/bn_mp_lshd.c @@ -62,6 +62,6 @@ int mp_lshd (mp_int * a, int b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_lshd.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_mod.c b/libtommath/bn_mp_mod.c index f5cf8d0..6828328 100644 --- a/libtommath/bn_mp_mod.c +++ b/libtommath/bn_mp_mod.c @@ -43,6 +43,6 @@ mp_mod (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mod.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_mod_2d.c b/libtommath/bn_mp_mod_2d.c index e194a06..77f13c3 100644 --- a/libtommath/bn_mp_mod_2d.c +++ b/libtommath/bn_mp_mod_2d.c @@ -50,6 +50,6 @@ mp_mod_2d (mp_int * a, int b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mod_2d.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_mod_d.c b/libtommath/bn_mp_mod_d.c index 9ca37e6..4ad3d90 100644 --- a/libtommath/bn_mp_mod_d.c +++ b/libtommath/bn_mp_mod_d.c @@ -22,6 +22,6 @@ mp_mod_d (mp_int * a, mp_digit b, mp_digit * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mod_d.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_montgomery_calc_normalization.c b/libtommath/bn_mp_montgomery_calc_normalization.c index c669fe0..4825ab5 100644 --- a/libtommath/bn_mp_montgomery_calc_normalization.c +++ b/libtommath/bn_mp_montgomery_calc_normalization.c @@ -54,6 +54,6 @@ int mp_montgomery_calc_normalization (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_montgomery_calc_normalization.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_montgomery_reduce.c b/libtommath/bn_mp_montgomery_reduce.c index b765090..3c73268 100644 --- a/libtommath/bn_mp_montgomery_reduce.c +++ b/libtommath/bn_mp_montgomery_reduce.c @@ -113,6 +113,6 @@ mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_montgomery_reduce.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_montgomery_setup.c b/libtommath/bn_mp_montgomery_setup.c index f082749..0de27bb 100644 --- a/libtommath/bn_mp_montgomery_setup.c +++ b/libtommath/bn_mp_montgomery_setup.c @@ -54,6 +54,6 @@ mp_montgomery_setup (mp_int * n, mp_digit * rho) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_montgomery_setup.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_mul.c b/libtommath/bn_mp_mul.c index 8b1117a..bd75d04 100644 --- a/libtommath/bn_mp_mul.c +++ b/libtommath/bn_mp_mul.c @@ -61,6 +61,6 @@ int mp_mul (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mul.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_mul_2.c b/libtommath/bn_mp_mul_2.c index 02455fc..6ba76be 100644 --- a/libtommath/bn_mp_mul_2.c +++ b/libtommath/bn_mp_mul_2.c @@ -77,6 +77,6 @@ int mp_mul_2(mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mul_2.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_mul_2d.c b/libtommath/bn_mp_mul_2d.c index efeff2e..385ac59 100644 --- a/libtommath/bn_mp_mul_2d.c +++ b/libtommath/bn_mp_mul_2d.c @@ -80,6 +80,6 @@ int mp_mul_2d (mp_int * a, int b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mul_2d.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_mul_d.c b/libtommath/bn_mp_mul_d.c index 00f9a89..13c6066 100644 --- a/libtommath/bn_mp_mul_d.c +++ b/libtommath/bn_mp_mul_d.c @@ -74,6 +74,6 @@ mp_mul_d (mp_int * a, mp_digit b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mul_d.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_mulmod.c b/libtommath/bn_mp_mulmod.c index 003ceb9..eebca37 100644 --- a/libtommath/bn_mp_mulmod.c +++ b/libtommath/bn_mp_mulmod.c @@ -35,6 +35,6 @@ int mp_mulmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mulmod.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_n_root.c b/libtommath/bn_mp_n_root.c index 0e7bedc..e6bf725 100644 --- a/libtommath/bn_mp_n_root.c +++ b/libtommath/bn_mp_n_root.c @@ -127,6 +127,6 @@ LBL_T1:mp_clear (&t1); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_n_root.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_neg.c b/libtommath/bn_mp_neg.c index a7d035a..0e868ce 100644 --- a/libtommath/bn_mp_neg.c +++ b/libtommath/bn_mp_neg.c @@ -35,6 +35,6 @@ int mp_neg (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_neg.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_or.c b/libtommath/bn_mp_or.c index bff4995..5c2761a 100644 --- a/libtommath/bn_mp_or.c +++ b/libtommath/bn_mp_or.c @@ -45,6 +45,6 @@ int mp_or (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_or.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_prime_fermat.c b/libtommath/bn_mp_prime_fermat.c index c23d77f..fe10ab2 100644 --- a/libtommath/bn_mp_prime_fermat.c +++ b/libtommath/bn_mp_prime_fermat.c @@ -57,6 +57,6 @@ LBL_T:mp_clear (&t); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_prime_fermat.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_prime_is_divisible.c b/libtommath/bn_mp_prime_is_divisible.c index 8e7871c..2b217ae 100644 --- a/libtommath/bn_mp_prime_is_divisible.c +++ b/libtommath/bn_mp_prime_is_divisible.c @@ -45,6 +45,6 @@ int mp_prime_is_divisible (mp_int * a, int *result) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_prime_is_divisible.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_prime_is_prime.c b/libtommath/bn_mp_prime_is_prime.c index c316d62..09908df 100644 --- a/libtommath/bn_mp_prime_is_prime.c +++ b/libtommath/bn_mp_prime_is_prime.c @@ -78,6 +78,6 @@ LBL_B:mp_clear (&b); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_prime_is_prime.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_prime_miller_rabin.c b/libtommath/bn_mp_prime_miller_rabin.c index ddf0358..fe88d94 100644 --- a/libtommath/bn_mp_prime_miller_rabin.c +++ b/libtommath/bn_mp_prime_miller_rabin.c @@ -98,6 +98,6 @@ LBL_N1:mp_clear (&n1); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_prime_miller_rabin.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_prime_next_prime.c b/libtommath/bn_mp_prime_next_prime.c index daf2ec7..37a03c6 100644 --- a/libtommath/bn_mp_prime_next_prime.c +++ b/libtommath/bn_mp_prime_next_prime.c @@ -143,7 +143,7 @@ int mp_prime_next_prime(mp_int *a, int t, int bbs_style) /* is this prime? */ for (x = 0; x < t; x++) { - mp_set(&b, ltm_prime_tab[t]); + mp_set(&b, ltm_prime_tab[x]); if ((err = mp_prime_miller_rabin(a, &b, &res)) != MP_OKAY) { goto LBL_ERR; } @@ -165,6 +165,6 @@ LBL_ERR: #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_prime_next_prime.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: v0.42.0 $ */ +/* $Date: 2010-07-15 13:49:00 +0000 $ */ diff --git a/libtommath/bn_mp_prime_rabin_miller_trials.c b/libtommath/bn_mp_prime_rabin_miller_trials.c index 248c2fd..b4fc323 100644 --- a/libtommath/bn_mp_prime_rabin_miller_trials.c +++ b/libtommath/bn_mp_prime_rabin_miller_trials.c @@ -47,6 +47,6 @@ int mp_prime_rabin_miller_trials(int size) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_prime_rabin_miller_trials.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_prime_random_ex.c b/libtommath/bn_mp_prime_random_ex.c index 07aae4b..16d2aae 100644 --- a/libtommath/bn_mp_prime_random_ex.c +++ b/libtommath/bn_mp_prime_random_ex.c @@ -120,6 +120,6 @@ error: #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_prime_random_ex.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_radix_size.c b/libtommath/bn_mp_radix_size.c index 1b61e3a..9d95c48 100644 --- a/libtommath/bn_mp_radix_size.c +++ b/libtommath/bn_mp_radix_size.c @@ -73,6 +73,6 @@ int mp_radix_size (mp_int * a, int radix, int *size) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_radix_size.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_radix_smap.c b/libtommath/bn_mp_radix_smap.c index 7d72feb..b3abd3e 100644 --- a/libtommath/bn_mp_radix_smap.c +++ b/libtommath/bn_mp_radix_smap.c @@ -19,6 +19,6 @@ const char *mp_s_rmap = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/"; #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_radix_smap.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_rand.c b/libtommath/bn_mp_rand.c index af66a67..96e4e46 100644 --- a/libtommath/bn_mp_rand.c +++ b/libtommath/bn_mp_rand.c @@ -50,6 +50,6 @@ mp_rand (mp_int * a, int digits) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_rand.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_read_radix.c b/libtommath/bn_mp_read_radix.c index 91c46c2..8ce103f 100644 --- a/libtommath/bn_mp_read_radix.c +++ b/libtommath/bn_mp_read_radix.c @@ -80,6 +80,6 @@ int mp_read_radix (mp_int * a, const char *str, int radix) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_read_radix.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_read_signed_bin.c b/libtommath/bn_mp_read_signed_bin.c index 8da651c..92924e8 100644 --- a/libtommath/bn_mp_read_signed_bin.c +++ b/libtommath/bn_mp_read_signed_bin.c @@ -36,6 +36,6 @@ int mp_read_signed_bin (mp_int * a, const unsigned char *b, int c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_read_signed_bin.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_read_unsigned_bin.c b/libtommath/bn_mp_read_unsigned_bin.c index 1ebba13..5a7fa91 100644 --- a/libtommath/bn_mp_read_unsigned_bin.c +++ b/libtommath/bn_mp_read_unsigned_bin.c @@ -50,6 +50,6 @@ int mp_read_unsigned_bin (mp_int * a, const unsigned char *b, int c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_read_unsigned_bin.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_reduce.c b/libtommath/bn_mp_reduce.c index 21d0730..50e1eaa 100644 --- a/libtommath/bn_mp_reduce.c +++ b/libtommath/bn_mp_reduce.c @@ -95,6 +95,6 @@ CLEANUP: } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_reduce_2k.c b/libtommath/bn_mp_reduce_2k.c index d9620c2..6bbc5f1 100644 --- a/libtommath/bn_mp_reduce_2k.c +++ b/libtommath/bn_mp_reduce_2k.c @@ -56,6 +56,6 @@ ERR: #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_reduce_2k_l.c b/libtommath/bn_mp_reduce_2k_l.c index f06103d..067122a 100644 --- a/libtommath/bn_mp_reduce_2k_l.c +++ b/libtommath/bn_mp_reduce_2k_l.c @@ -57,6 +57,6 @@ ERR: #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k_l.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_reduce_2k_setup.c b/libtommath/bn_mp_reduce_2k_setup.c index a80e7a2..3f9ffd9 100644 --- a/libtommath/bn_mp_reduce_2k_setup.c +++ b/libtommath/bn_mp_reduce_2k_setup.c @@ -42,6 +42,6 @@ int mp_reduce_2k_setup(mp_int *a, mp_digit *d) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k_setup.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_reduce_2k_setup_l.c b/libtommath/bn_mp_reduce_2k_setup_l.c index 7cf002e..686368e 100644 --- a/libtommath/bn_mp_reduce_2k_setup_l.c +++ b/libtommath/bn_mp_reduce_2k_setup_l.c @@ -39,6 +39,6 @@ ERR: } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k_setup_l.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_reduce_is_2k.c b/libtommath/bn_mp_reduce_is_2k.c index 7308be7..08b62ff 100644 --- a/libtommath/bn_mp_reduce_is_2k.c +++ b/libtommath/bn_mp_reduce_is_2k.c @@ -47,6 +47,6 @@ int mp_reduce_is_2k(mp_int *a) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_is_2k.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_reduce_is_2k_l.c b/libtommath/bn_mp_reduce_is_2k_l.c index 14a4d21..a72e39c 100644 --- a/libtommath/bn_mp_reduce_is_2k_l.c +++ b/libtommath/bn_mp_reduce_is_2k_l.c @@ -39,6 +39,6 @@ int mp_reduce_is_2k_l(mp_int *a) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_is_2k_l.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_reduce_setup.c b/libtommath/bn_mp_reduce_setup.c index 370f20b..f017386 100644 --- a/libtommath/bn_mp_reduce_setup.c +++ b/libtommath/bn_mp_reduce_setup.c @@ -29,6 +29,6 @@ int mp_reduce_setup (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_setup.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_rshd.c b/libtommath/bn_mp_rshd.c index 2a693c5..bb506e9 100644 --- a/libtommath/bn_mp_rshd.c +++ b/libtommath/bn_mp_rshd.c @@ -67,6 +67,6 @@ void mp_rshd (mp_int * a, int b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_rshd.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_set.c b/libtommath/bn_mp_set.c index 174adcb..412673a 100644 --- a/libtommath/bn_mp_set.c +++ b/libtommath/bn_mp_set.c @@ -24,6 +24,6 @@ void mp_set (mp_int * a, mp_digit b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_set.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_set_int.c b/libtommath/bn_mp_set_int.c index cf10ea1..17cfe89 100644 --- a/libtommath/bn_mp_set_int.c +++ b/libtommath/bn_mp_set_int.c @@ -43,6 +43,6 @@ int mp_set_int (mp_int * a, unsigned long b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_set_int.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_shrink.c b/libtommath/bn_mp_shrink.c index 4b8c5ef..2bee381 100644 --- a/libtommath/bn_mp_shrink.c +++ b/libtommath/bn_mp_shrink.c @@ -19,17 +19,22 @@ int mp_shrink (mp_int * a) { mp_digit *tmp; - if (a->alloc != a->used && a->used > 0) { - if ((tmp = OPT_CAST(mp_digit) XREALLOC (a->dp, sizeof (mp_digit) * a->used)) == NULL) { + int used = 1; + + if(a->used > 0) + used = a->used; + + if (a->alloc != used) { + if ((tmp = OPT_CAST(mp_digit) XREALLOC (a->dp, sizeof (mp_digit) * used)) == NULL) { return MP_MEM; } a->dp = tmp; - a->alloc = a->used; + a->alloc = used; } return MP_OKAY; } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_shrink.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: v0.42.0 $ */ +/* $Date: 2010-06-02 15:09:36 +0200 $ */ diff --git a/libtommath/bn_mp_signed_bin_size.c b/libtommath/bn_mp_signed_bin_size.c index 6739d19..b28d402 100644 --- a/libtommath/bn_mp_signed_bin_size.c +++ b/libtommath/bn_mp_signed_bin_size.c @@ -22,6 +22,6 @@ int mp_signed_bin_size (mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_signed_bin_size.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_sqr.c b/libtommath/bn_mp_sqr.c index 868ccbb..b085668 100644 --- a/libtommath/bn_mp_sqr.c +++ b/libtommath/bn_mp_sqr.c @@ -53,6 +53,6 @@ if (a->used >= KARATSUBA_SQR_CUTOFF) { } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_sqr.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_sqrmod.c b/libtommath/bn_mp_sqrmod.c index 161cbbb..369028b 100644 --- a/libtommath/bn_mp_sqrmod.c +++ b/libtommath/bn_mp_sqrmod.c @@ -36,6 +36,6 @@ mp_sqrmod (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_sqrmod.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_sqrt.c b/libtommath/bn_mp_sqrt.c index 8fd057c..983e41c 100644 --- a/libtommath/bn_mp_sqrt.c +++ b/libtommath/bn_mp_sqrt.c @@ -76,6 +76,6 @@ E2: mp_clear(&t1); #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_sqrt.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_sub.c b/libtommath/bn_mp_sub.c index f5015cc..3c8e5d4 100644 --- a/libtommath/bn_mp_sub.c +++ b/libtommath/bn_mp_sub.c @@ -54,6 +54,6 @@ mp_sub (mp_int * a, mp_int * b, mp_int * c) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_sub.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_sub_d.c b/libtommath/bn_mp_sub_d.c index 06cdca6..13b49bc 100644 --- a/libtommath/bn_mp_sub_d.c +++ b/libtommath/bn_mp_sub_d.c @@ -88,6 +88,6 @@ mp_sub_d (mp_int * a, mp_digit b, mp_int * c) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_sub_d.c,v $ */ -/* $Revision: 1.6 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_submod.c b/libtommath/bn_mp_submod.c index 869e23c..d919c17 100644 --- a/libtommath/bn_mp_submod.c +++ b/libtommath/bn_mp_submod.c @@ -37,6 +37,6 @@ mp_submod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_submod.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_to_signed_bin.c b/libtommath/bn_mp_to_signed_bin.c index 9df83ca..dda9285 100644 --- a/libtommath/bn_mp_to_signed_bin.c +++ b/libtommath/bn_mp_to_signed_bin.c @@ -28,6 +28,6 @@ int mp_to_signed_bin (mp_int * a, unsigned char *b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_to_signed_bin.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_to_signed_bin_n.c b/libtommath/bn_mp_to_signed_bin_n.c index 677f827..9e3b011 100644 --- a/libtommath/bn_mp_to_signed_bin_n.c +++ b/libtommath/bn_mp_to_signed_bin_n.c @@ -26,6 +26,6 @@ int mp_to_signed_bin_n (mp_int * a, unsigned char *b, unsigned long *outlen) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_to_signed_bin_n.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_to_unsigned_bin.c b/libtommath/bn_mp_to_unsigned_bin.c index c137f10..76072a9 100644 --- a/libtommath/bn_mp_to_unsigned_bin.c +++ b/libtommath/bn_mp_to_unsigned_bin.c @@ -43,6 +43,6 @@ int mp_to_unsigned_bin (mp_int * a, unsigned char *b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_to_unsigned_bin.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_to_unsigned_bin_n.c b/libtommath/bn_mp_to_unsigned_bin_n.c index 0dc00c6..51028d8 100644 --- a/libtommath/bn_mp_to_unsigned_bin_n.c +++ b/libtommath/bn_mp_to_unsigned_bin_n.c @@ -26,6 +26,6 @@ int mp_to_unsigned_bin_n (mp_int * a, unsigned char *b, unsigned long *outlen) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_to_unsigned_bin_n.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_toom_mul.c b/libtommath/bn_mp_toom_mul.c index ad5d9e9..e0fd772 100644 --- a/libtommath/bn_mp_toom_mul.c +++ b/libtommath/bn_mp_toom_mul.c @@ -279,6 +279,6 @@ ERR: #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_toom_mul.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_toom_sqr.c b/libtommath/bn_mp_toom_sqr.c index 48880d0..9076e6f 100644 --- a/libtommath/bn_mp_toom_sqr.c +++ b/libtommath/bn_mp_toom_sqr.c @@ -221,6 +221,6 @@ ERR: #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_toom_sqr.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_toradix.c b/libtommath/bn_mp_toradix.c index 0adc28d..bb95783 100644 --- a/libtommath/bn_mp_toradix.c +++ b/libtommath/bn_mp_toradix.c @@ -70,6 +70,6 @@ int mp_toradix (mp_int * a, char *str, int radix) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_toradix.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_toradix_n.c b/libtommath/bn_mp_toradix_n.c index 796ed55..7e425d6 100644 --- a/libtommath/bn_mp_toradix_n.c +++ b/libtommath/bn_mp_toradix_n.c @@ -83,6 +83,6 @@ int mp_toradix_n(mp_int * a, char *str, int radix, int maxlen) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_toradix_n.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_unsigned_bin_size.c b/libtommath/bn_mp_unsigned_bin_size.c index 6dc3bd5..b16fdcd 100644 --- a/libtommath/bn_mp_unsigned_bin_size.c +++ b/libtommath/bn_mp_unsigned_bin_size.c @@ -23,6 +23,6 @@ int mp_unsigned_bin_size (mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_unsigned_bin_size.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_xor.c b/libtommath/bn_mp_xor.c index 59ff2e1..5744556 100644 --- a/libtommath/bn_mp_xor.c +++ b/libtommath/bn_mp_xor.c @@ -46,6 +46,6 @@ mp_xor (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_xor.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_zero.c b/libtommath/bn_mp_zero.c index b0977d4..99e6df2 100644 --- a/libtommath/bn_mp_zero.c +++ b/libtommath/bn_mp_zero.c @@ -31,6 +31,6 @@ void mp_zero (mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_zero.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_prime_tab.c b/libtommath/bn_prime_tab.c index bd25247..fb5ad08 100644 --- a/libtommath/bn_prime_tab.c +++ b/libtommath/bn_prime_tab.c @@ -56,6 +56,6 @@ const mp_digit ltm_prime_tab[] = { }; #endif -/* $Source: /cvs/libtom/libtommath/bn_prime_tab.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_reverse.c b/libtommath/bn_reverse.c index ddfa827..17cdcc1 100644 --- a/libtommath/bn_reverse.c +++ b/libtommath/bn_reverse.c @@ -34,6 +34,6 @@ bn_reverse (unsigned char *s, int len) } #endif -/* $Source: /cvs/libtom/libtommath/bn_reverse.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_s_mp_add.c b/libtommath/bn_s_mp_add.c index f034ae6..0ca20b8 100644 --- a/libtommath/bn_s_mp_add.c +++ b/libtommath/bn_s_mp_add.c @@ -104,6 +104,6 @@ s_mp_add (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_s_mp_add.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_s_mp_exptmod.c b/libtommath/bn_s_mp_exptmod.c index 097d894..bc02a28 100644 --- a/libtommath/bn_s_mp_exptmod.c +++ b/libtommath/bn_s_mp_exptmod.c @@ -247,6 +247,6 @@ LBL_M: } #endif -/* $Source: /cvs/libtom/libtommath/bn_s_mp_exptmod.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_s_mp_mul_digs.c b/libtommath/bn_s_mp_mul_digs.c index f5bbf39..86196bf 100644 --- a/libtommath/bn_s_mp_mul_digs.c +++ b/libtommath/bn_s_mp_mul_digs.c @@ -85,6 +85,6 @@ int s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /cvs/libtom/libtommath/bn_s_mp_mul_digs.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_s_mp_mul_high_digs.c b/libtommath/bn_s_mp_mul_high_digs.c index 2b718f2..019014e 100644 --- a/libtommath/bn_s_mp_mul_high_digs.c +++ b/libtommath/bn_s_mp_mul_high_digs.c @@ -76,6 +76,6 @@ s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /cvs/libtom/libtommath/bn_s_mp_mul_high_digs.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_s_mp_sqr.c b/libtommath/bn_s_mp_sqr.c index d2531c2..90c465d 100644 --- a/libtommath/bn_s_mp_sqr.c +++ b/libtommath/bn_s_mp_sqr.c @@ -79,6 +79,6 @@ int s_mp_sqr (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_s_mp_sqr.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_s_mp_sub.c b/libtommath/bn_s_mp_sub.c index 6a60c39..ccea6bd 100644 --- a/libtommath/bn_s_mp_sub.c +++ b/libtommath/bn_s_mp_sub.c @@ -84,6 +84,6 @@ s_mp_sub (mp_int * a, mp_int * b, mp_int * c) #endif -/* $Source: /cvs/libtom/libtommath/bn_s_mp_sub.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bncore.c b/libtommath/bncore.c index 8fb1824..1a0ac2c 100644 --- a/libtommath/bncore.c +++ b/libtommath/bncore.c @@ -31,6 +31,6 @@ int KARATSUBA_MUL_CUTOFF = 80, /* Min. number of digits before Karatsub TOOM_SQR_CUTOFF = 400; #endif -/* $Source: /cvs/libtom/libtommath/bncore.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/changes.txt b/libtommath/changes.txt index b0da4da..4fc0913 100644 --- a/libtommath/changes.txt +++ b/libtommath/changes.txt @@ -1,3 +1,9 @@ +July 23rd, 2010 +v0.42.0 + -- Fix for mp_prime_next_prime() bug when checking generated prime + -- allow mp_shrink to shrink initialized, but empty MPI's + -- Added project and solution files for Visual Studio 2005 and Visual Studio 2008. + March 10th, 2007 v0.41 -- Wolfgang Ehrhardt suggested a quick fix to mp_div_d() which makes the detection of powers of two quicker. -- [CRI] Added libtommath.dsp for Visual C++ users. diff --git a/libtommath/demo/demo.c b/libtommath/demo/demo.c index bb5eb44..3e5663b 100644 --- a/libtommath/demo/demo.c +++ b/libtommath/demo/demo.c @@ -735,6 +735,6 @@ printf("compare no compare!\n"); exit(EXIT_FAILURE); } return 0; } -/* $Source: /cvs/libtom/libtommath/demo/demo.c,v $ */ -/* $Revision: 1.3 $ */ -/* $Date: 2005/06/24 11:32:07 $ */ +/* $Source$ */ +/* $Revision: 0.36 $ */ +/* $Date: 2005-08-01 16:37:28 +0000 $ */ diff --git a/libtommath/demo/timing.c b/libtommath/demo/timing.c index d4660a9..57bb6d4 100644 --- a/libtommath/demo/timing.c +++ b/libtommath/demo/timing.c @@ -314,6 +314,6 @@ int main(void) return 0; } -/* $Source: /cvs/libtom/libtommath/demo/timing.c,v $ */ -/* $Revision: 1.2 $ */ -/* $Date: 2005/05/05 14:38:47 $ */ +/* $Source$ */ +/* $Revision: 0.36 $ */ +/* $Date: 2005-08-01 16:37:28 +0000 $ */ diff --git a/libtommath/etc/2kprime.c b/libtommath/etc/2kprime.c index c09818f..fff4825 100644 --- a/libtommath/etc/2kprime.c +++ b/libtommath/etc/2kprime.c @@ -79,6 +79,6 @@ int main(void) -/* $Source: /cvs/libtom/libtommath/etc/2kprime.c,v $ */ -/* $Revision: 1.2 $ */ -/* $Date: 2005/05/05 14:38:47 $ */ +/* $Source$ */ +/* $Revision: 0.36 $ */ +/* $Date: 2005-08-01 16:37:28 +0000 $ */ diff --git a/libtommath/etc/drprime.c b/libtommath/etc/drprime.c index e413985..ea40bd3 100644 --- a/libtommath/etc/drprime.c +++ b/libtommath/etc/drprime.c @@ -59,6 +59,6 @@ int main(void) } -/* $Source: /cvs/libtom/libtommath/etc/drprime.c,v $ */ -/* $Revision: 1.2 $ */ -/* $Date: 2005/05/05 14:38:47 $ */ +/* $Source$ */ +/* $Revision: 0.36 $ */ +/* $Date: 2005-08-01 16:37:28 +0000 $ */ diff --git a/libtommath/etc/mersenne.c b/libtommath/etc/mersenne.c index 6a6497a..6f9eed2 100644 --- a/libtommath/etc/mersenne.c +++ b/libtommath/etc/mersenne.c @@ -139,6 +139,6 @@ main (void) return 0; } -/* $Source: /cvs/libtom/libtommath/etc/mersenne.c,v $ */ -/* $Revision: 1.3 $ */ -/* $Date: 2006/03/31 14:18:47 $ */ +/* $Source$ */ +/* $Revision: 0.39 $ */ +/* $Date: 2006-04-06 19:49:59 +0000 $ */ diff --git a/libtommath/etc/mont.c b/libtommath/etc/mont.c index 393be4c..8356903 100644 --- a/libtommath/etc/mont.c +++ b/libtommath/etc/mont.c @@ -45,6 +45,6 @@ int main(void) -/* $Source: /cvs/libtom/libtommath/etc/mont.c,v $ */ -/* $Revision: 1.2 $ */ -/* $Date: 2005/05/05 14:38:47 $ */ +/* $Source$ */ +/* $Revision: 0.36 $ */ +/* $Date: 2005-08-01 16:37:28 +0000 $ */ diff --git a/libtommath/etc/pprime.c b/libtommath/etc/pprime.c index 317e2a0..d2d3a32 100644 --- a/libtommath/etc/pprime.c +++ b/libtommath/etc/pprime.c @@ -395,6 +395,6 @@ main (void) return 0; } -/* $Source: /cvs/libtom/libtommath/etc/pprime.c,v $ */ -/* $Revision: 1.3 $ */ -/* $Date: 2006/03/31 14:18:47 $ */ +/* $Source$ */ +/* $Revision: 0.39 $ */ +/* $Date: 2006-04-06 19:49:59 +0000 $ */ diff --git a/libtommath/etc/tune.c b/libtommath/etc/tune.c index d4a502c..0094f19 100644 --- a/libtommath/etc/tune.c +++ b/libtommath/etc/tune.c @@ -137,6 +137,6 @@ main (void) return 0; } -/* $Source: /cvs/libtom/libtommath/etc/tune.c,v $ */ -/* $Revision: 1.3 $ */ -/* $Date: 2006/03/31 14:18:47 $ */ +/* $Source$ */ +/* $Revision: 0.39 $ */ +/* $Date: 2006-04-06 19:49:59 +0000 $ */ diff --git a/libtommath/libtommath_VS2005.sln b/libtommath/libtommath_VS2005.sln new file mode 100755 index 0000000..21bc915 --- /dev/null +++ b/libtommath/libtommath_VS2005.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtommath", "libtommath_VS2005.vcproj", "{0272C9B2-D68B-4F24-B32D-C1FD552F7E51}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0272C9B2-D68B-4F24-B32D-C1FD552F7E51}.Debug|Win32.ActiveCfg = Debug|Win32 + {0272C9B2-D68B-4F24-B32D-C1FD552F7E51}.Debug|Win32.Build.0 = Debug|Win32 + {0272C9B2-D68B-4F24-B32D-C1FD552F7E51}.Release|Win32.ActiveCfg = Release|Win32 + {0272C9B2-D68B-4F24-B32D-C1FD552F7E51}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/libtommath/libtommath_VS2005.vcproj b/libtommath/libtommath_VS2005.vcproj new file mode 100755 index 0000000..7162185 --- /dev/null +++ b/libtommath/libtommath_VS2005.vcproj @@ -0,0 +1,2803 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libtommath/libtommath_VS2008.sln b/libtommath/libtommath_VS2008.sln new file mode 100755 index 0000000..1327ccf --- /dev/null +++ b/libtommath/libtommath_VS2008.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtommath", "libtommath_VS2008.vcproj", "{42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Debug|Win32.ActiveCfg = Debug|Win32 + {42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Debug|Win32.Build.0 = Debug|Win32 + {42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Release|Win32.ActiveCfg = Release|Win32 + {42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/libtommath/libtommath_VS2008.vcproj b/libtommath/libtommath_VS2008.vcproj new file mode 100755 index 0000000..205aec1 --- /dev/null +++ b/libtommath/libtommath_VS2008.vcproj @@ -0,0 +1,2805 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libtommath/makefile b/libtommath/makefile index 3e254d4..70de306 100644 --- a/libtommath/makefile +++ b/libtommath/makefile @@ -3,7 +3,7 @@ #Tom St Denis #version of library -VERSION=0.41 +VERSION=0.42.0 CFLAGS += -I./ -Wall -W -Wshadow -Wsign-compare diff --git a/libtommath/mtest/logtab.h b/libtommath/mtest/logtab.h index bbefaef..04c1ad3 100644 --- a/libtommath/mtest/logtab.h +++ b/libtommath/mtest/logtab.h @@ -19,6 +19,6 @@ const float s_logv_2[] = { }; -/* $Source: /cvs/libtom/libtommath/mtest/logtab.h,v $ */ -/* $Revision: 1.2 $ */ -/* $Date: 2005/05/05 14:38:47 $ */ +/* $Source$ */ +/* $Revision: 0.36 $ */ +/* $Date: 2005-08-01 16:37:28 +0000 $ */ diff --git a/libtommath/mtest/mpi-config.h b/libtommath/mtest/mpi-config.h index 6049c25..21e72b2 100644 --- a/libtommath/mtest/mpi-config.h +++ b/libtommath/mtest/mpi-config.h @@ -1,5 +1,5 @@ /* Default configuration for MPI library */ -/* $Id: mpi-config.h,v 1.2 2005/05/05 14:38:47 tom Exp $ */ +/* $ID$ */ #ifndef MPI_CONFIG_H_ #define MPI_CONFIG_H_ @@ -85,6 +85,6 @@ /* crc==3287762869, version==2, Sat Feb 02 06:43:53 2002 */ -/* $Source: /cvs/libtom/libtommath/mtest/mpi-config.h,v $ */ -/* $Revision: 1.2 $ */ -/* $Date: 2005/05/05 14:38:47 $ */ +/* $Source$ */ +/* $Revision: 0.36 $ */ +/* $Date: 2005-08-01 16:37:28 +0000 $ */ diff --git a/libtommath/mtest/mpi-types.h b/libtommath/mtest/mpi-types.h index 026de58..a90f11e 100644 --- a/libtommath/mtest/mpi-types.h +++ b/libtommath/mtest/mpi-types.h @@ -15,6 +15,6 @@ typedef int mp_err; #define RADIX (MP_DIGIT_MAX+1) -/* $Source: /cvs/libtom/libtommath/mtest/mpi-types.h,v $ */ -/* $Revision: 1.2 $ */ -/* $Date: 2005/05/05 14:38:47 $ */ +/* $Source$ */ +/* $Revision: 0.36 $ */ +/* $Date: 2005-08-01 16:37:28 +0000 $ */ diff --git a/libtommath/mtest/mpi.c b/libtommath/mtest/mpi.c index 7c712dd..f6ef8c7 100644 --- a/libtommath/mtest/mpi.c +++ b/libtommath/mtest/mpi.c @@ -6,7 +6,7 @@ Arbitrary precision integer arithmetic library - $Id: mpi.c,v 1.2 2005/05/05 14:38:47 tom Exp $ + $ID$ */ #include "mpi.h" @@ -3980,6 +3980,6 @@ int s_mp_outlen(int bits, int r) /* HERE THERE BE DRAGONS */ /* crc==4242132123, version==2, Sat Feb 02 06:43:52 2002 */ -/* $Source: /cvs/libtom/libtommath/mtest/mpi.c,v $ */ -/* $Revision: 1.2 $ */ -/* $Date: 2005/05/05 14:38:47 $ */ +/* $Source$ */ +/* $Revision: 0.36 $ */ +/* $Date: 2005-08-01 16:37:28 +0000 $ */ diff --git a/libtommath/mtest/mpi.h b/libtommath/mtest/mpi.h index 66ae873..526c3fd 100644 --- a/libtommath/mtest/mpi.h +++ b/libtommath/mtest/mpi.h @@ -6,7 +6,7 @@ Arbitrary precision integer arithmetic library - $Id: mpi.h,v 1.2 2005/05/05 14:38:47 tom Exp $ + $ID$ */ #ifndef _H_MPI_ @@ -226,6 +226,6 @@ const char *mp_strerror(mp_err ec); #endif /* end _H_MPI_ */ -/* $Source: /cvs/libtom/libtommath/mtest/mpi.h,v $ */ -/* $Revision: 1.2 $ */ -/* $Date: 2005/05/05 14:38:47 $ */ +/* $Source$ */ +/* $Revision: 0.36 $ */ +/* $Date: 2005-08-01 16:37:28 +0000 $ */ diff --git a/libtommath/mtest/mtest.c b/libtommath/mtest/mtest.c index bdfe612..92f03ad 100644 --- a/libtommath/mtest/mtest.c +++ b/libtommath/mtest/mtest.c @@ -303,6 +303,6 @@ int main(void) return 0; } -/* $Source: /cvs/libtom/libtommath/mtest/mtest.c,v $ */ -/* $Revision: 1.2 $ */ -/* $Date: 2005/05/05 14:38:47 $ */ +/* $Source$ */ +/* $Revision: 0.36 $ */ +/* $Date: 2005-08-01 16:37:28 +0000 $ */ diff --git a/libtommath/poster.pdf b/libtommath/poster.pdf index f3768d7..dc80fbb 100644 Binary files a/libtommath/poster.pdf and b/libtommath/poster.pdf differ diff --git a/libtommath/pre_gen/mpi.c b/libtommath/pre_gen/mpi.c index b7f4d47..7ba9d83 100644 --- a/libtommath/pre_gen/mpi.c +++ b/libtommath/pre_gen/mpi.c @@ -43,9 +43,9 @@ char *mp_error_to_string(int code) #endif -/* $Source: /cvs/libtom/libtommath/bn_error.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_error.c */ @@ -195,9 +195,9 @@ LBL_ERR:mp_clear_multi (&x, &y, &u, &v, &B, &D, NULL); } #endif -/* $Source: /cvs/libtom/libtommath/bn_fast_mp_invmod.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_fast_mp_invmod.c */ @@ -371,9 +371,9 @@ int fast_mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho) } #endif -/* $Source: /cvs/libtom/libtommath/bn_fast_mp_montgomery_reduce.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_fast_mp_montgomery_reduce.c */ @@ -482,9 +482,9 @@ int fast_s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /cvs/libtom/libtommath/bn_fast_s_mp_mul_digs.c,v $ */ -/* $Revision: 1.8 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_fast_s_mp_mul_digs.c */ @@ -584,9 +584,9 @@ int fast_s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /cvs/libtom/libtommath/bn_fast_s_mp_mul_high_digs.c,v $ */ -/* $Revision: 1.6 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_fast_s_mp_mul_high_digs.c */ @@ -702,9 +702,9 @@ int fast_s_mp_sqr (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_fast_s_mp_sqr.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_fast_s_mp_sqr.c */ @@ -754,9 +754,9 @@ mp_2expt (mp_int * a, int b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_2expt.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_2expt.c */ @@ -801,9 +801,9 @@ mp_abs (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_abs.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_abs.c */ @@ -858,9 +858,9 @@ int mp_add (mp_int * a, mp_int * b, mp_int * c) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_add.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_add.c */ @@ -974,9 +974,9 @@ mp_add_d (mp_int * a, mp_digit b, mp_int * c) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_add_d.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_add_d.c */ @@ -1019,9 +1019,9 @@ mp_addmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_addmod.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_addmod.c */ @@ -1080,9 +1080,9 @@ mp_and (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_and.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_and.c */ @@ -1128,9 +1128,9 @@ mp_clamp (mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_clamp.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_clamp.c */ @@ -1176,9 +1176,9 @@ mp_clear (mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_clear.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_clear.c */ @@ -1214,9 +1214,9 @@ void mp_clear_multi(mp_int *mp, ...) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_clear_multi.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_clear_multi.c */ @@ -1261,9 +1261,9 @@ mp_cmp (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_cmp.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_cmp.c */ @@ -1309,9 +1309,9 @@ int mp_cmp_d(mp_int * a, mp_digit b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_cmp_d.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_cmp_d.c */ @@ -1368,9 +1368,9 @@ int mp_cmp_mag (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_cmp_mag.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_cmp_mag.c */ @@ -1425,9 +1425,9 @@ int mp_cnt_lsb(mp_int *a) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_cnt_lsb.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_cnt_lsb.c */ @@ -1497,9 +1497,9 @@ mp_copy (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_copy.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_copy.c */ @@ -1546,9 +1546,9 @@ mp_count_bits (mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_count_bits.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_count_bits.c */ @@ -1842,9 +1842,9 @@ LBL_Q:mp_clear (&q); #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_div.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_div.c */ @@ -1914,9 +1914,9 @@ int mp_div_2(mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_div_2.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_div_2.c */ @@ -2015,9 +2015,9 @@ int mp_div_2d (mp_int * a, int b, mp_int * c, mp_int * d) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_div_2d.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_div_2d.c */ @@ -2098,9 +2098,9 @@ mp_div_3 (mp_int * a, mp_int *c, mp_digit * d) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_div_3.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_div_3.c */ @@ -2217,9 +2217,9 @@ int mp_div_d (mp_int * a, mp_digit b, mp_int * c, mp_digit * d) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_div_d.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2007/01/09 04:44:32 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_div_d.c */ @@ -2264,9 +2264,9 @@ int mp_dr_is_modulus(mp_int *a) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_dr_is_modulus.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_dr_is_modulus.c */ @@ -2362,9 +2362,9 @@ top: } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_dr_reduce.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_dr_reduce.c */ @@ -2398,9 +2398,9 @@ void mp_dr_setup(mp_int *a, mp_digit *d) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_dr_setup.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_dr_setup.c */ @@ -2436,9 +2436,9 @@ mp_exch (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_exch.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_exch.c */ @@ -2497,9 +2497,9 @@ int mp_expt_d (mp_int * a, mp_digit b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_expt_d.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_expt_d.c */ @@ -2613,9 +2613,9 @@ int mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_exptmod.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_exptmod.c */ @@ -2938,9 +2938,9 @@ LBL_M: #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_exptmod_fast.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_exptmod_fast.c */ @@ -3024,9 +3024,9 @@ _ERR: mp_clear_multi(&u1, &u2, &u3, &v1, &v2, &v3, &t1, &t2, &t3, &q, &tmp, NULL } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_exteuclid.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_exteuclid.c */ @@ -3095,9 +3095,9 @@ int mp_fread(mp_int *a, int radix, FILE *stream) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_fread.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_fread.c */ @@ -3151,9 +3151,9 @@ int mp_fwrite(mp_int *a, int radix, FILE *stream) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_fwrite.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_fwrite.c */ @@ -3260,9 +3260,9 @@ LBL_U:mp_clear (&v); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_gcd.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_gcd.c */ @@ -3309,9 +3309,9 @@ unsigned long mp_get_int(mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_get_int.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_get_int.c */ @@ -3370,9 +3370,9 @@ int mp_grow (mp_int * a, int size) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_grow.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_grow.c */ @@ -3420,9 +3420,9 @@ int mp_init (mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_init.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_init.c */ @@ -3456,9 +3456,9 @@ int mp_init_copy (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_init_copy.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_init_copy.c */ @@ -3519,9 +3519,9 @@ int mp_init_multi(mp_int *mp, ...) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_init_multi.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_init_multi.c */ @@ -3555,9 +3555,9 @@ int mp_init_set (mp_int * a, mp_digit b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_init_set.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_init_set.c */ @@ -3590,9 +3590,9 @@ int mp_init_set_int (mp_int * a, unsigned long b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_init_set_int.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_init_set_int.c */ @@ -3642,9 +3642,9 @@ int mp_init_size (mp_int * a, int size) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_init_size.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_init_size.c */ @@ -3689,9 +3689,9 @@ int mp_invmod (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_invmod.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_invmod.c */ @@ -3868,9 +3868,9 @@ LBL_ERR:mp_clear_multi (&x, &y, &u, &v, &A, &B, &C, &D, NULL); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_invmod_slow.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_invmod_slow.c */ @@ -3981,9 +3981,9 @@ ERR:mp_clear(&t); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_is_square.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_is_square.c */ @@ -4090,9 +4090,9 @@ LBL_A1:mp_clear (&a1); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_jacobi.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_jacobi.c */ @@ -4261,9 +4261,9 @@ ERR: } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_karatsuba_mul.c,v $ */ -/* $Revision: 1.6 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_karatsuba_mul.c */ @@ -4386,9 +4386,9 @@ ERR: } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_karatsuba_sqr.c,v $ */ -/* $Revision: 1.6 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_karatsuba_sqr.c */ @@ -4450,9 +4450,9 @@ LBL_T: } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_lcm.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_lcm.c */ @@ -4521,9 +4521,9 @@ int mp_lshd (mp_int * a, int b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_lshd.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_lshd.c */ @@ -4573,9 +4573,9 @@ mp_mod (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mod.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_mod.c */ @@ -4632,9 +4632,9 @@ mp_mod_2d (mp_int * a, int b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mod_2d.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_mod_2d.c */ @@ -4663,9 +4663,9 @@ mp_mod_d (mp_int * a, mp_digit b, mp_digit * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mod_d.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_mod_d.c */ @@ -4726,9 +4726,9 @@ int mp_montgomery_calc_normalization (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_montgomery_calc_normalization.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_montgomery_calc_normalization.c */ @@ -4848,9 +4848,9 @@ mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_montgomery_reduce.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_montgomery_reduce.c */ @@ -4911,9 +4911,9 @@ mp_montgomery_setup (mp_int * n, mp_digit * rho) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_montgomery_setup.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_montgomery_setup.c */ @@ -4981,9 +4981,9 @@ int mp_mul (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mul.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_mul.c */ @@ -5067,9 +5067,9 @@ int mp_mul_2(mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mul_2.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_mul_2.c */ @@ -5156,9 +5156,9 @@ int mp_mul_2d (mp_int * a, int b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mul_2d.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_mul_2d.c */ @@ -5239,9 +5239,9 @@ mp_mul_d (mp_int * a, mp_digit b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mul_d.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_mul_d.c */ @@ -5283,9 +5283,9 @@ int mp_mulmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mulmod.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_mulmod.c */ @@ -5419,9 +5419,9 @@ LBL_T1:mp_clear (&t1); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_n_root.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_n_root.c */ @@ -5463,9 +5463,9 @@ int mp_neg (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_neg.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_neg.c */ @@ -5517,9 +5517,9 @@ int mp_or (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_or.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_or.c */ @@ -5583,9 +5583,9 @@ LBL_T:mp_clear (&t); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_prime_fermat.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_prime_fermat.c */ @@ -5637,9 +5637,9 @@ int mp_prime_is_divisible (mp_int * a, int *result) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_prime_is_divisible.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_prime_is_divisible.c */ @@ -5724,9 +5724,9 @@ LBL_B:mp_clear (&b); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_prime_is_prime.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_prime_is_prime.c */ @@ -5831,9 +5831,9 @@ LBL_N1:mp_clear (&n1); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_prime_miller_rabin.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_prime_miller_rabin.c */ @@ -5983,7 +5983,7 @@ int mp_prime_next_prime(mp_int *a, int t, int bbs_style) /* is this prime? */ for (x = 0; x < t; x++) { - mp_set(&b, ltm_prime_tab[t]); + mp_set(&b, ltm_prime_tab[x]); if ((err = mp_prime_miller_rabin(a, &b, &res)) != MP_OKAY) { goto LBL_ERR; } @@ -6005,9 +6005,9 @@ LBL_ERR: #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_prime_next_prime.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: v0.42.0 $ */ +/* $Date: 2010-07-15 13:49:00 +0000 $ */ /* End: bn_mp_prime_next_prime.c */ @@ -6061,9 +6061,9 @@ int mp_prime_rabin_miller_trials(int size) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_prime_rabin_miller_trials.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_prime_rabin_miller_trials.c */ @@ -6190,9 +6190,9 @@ error: #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_prime_random_ex.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_prime_random_ex.c */ @@ -6272,9 +6272,9 @@ int mp_radix_size (mp_int * a, int radix, int *size) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_radix_size.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_radix_size.c */ @@ -6300,9 +6300,9 @@ int mp_radix_size (mp_int * a, int radix, int *size) const char *mp_s_rmap = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/"; #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_radix_smap.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_radix_smap.c */ @@ -6359,9 +6359,9 @@ mp_rand (mp_int * a, int digits) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_rand.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_rand.c */ @@ -6448,9 +6448,9 @@ int mp_read_radix (mp_int * a, const char *str, int radix) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_read_radix.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_read_radix.c */ @@ -6493,9 +6493,9 @@ int mp_read_signed_bin (mp_int * a, const unsigned char *b, int c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_read_signed_bin.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_read_signed_bin.c */ @@ -6552,9 +6552,9 @@ int mp_read_unsigned_bin (mp_int * a, const unsigned char *b, int c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_read_unsigned_bin.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_read_unsigned_bin.c */ @@ -6656,9 +6656,9 @@ CLEANUP: } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_reduce.c */ @@ -6721,9 +6721,9 @@ ERR: #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_reduce_2k.c */ @@ -6787,9 +6787,9 @@ ERR: #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k_l.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_reduce_2k_l.c */ @@ -6838,9 +6838,9 @@ int mp_reduce_2k_setup(mp_int *a, mp_digit *d) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k_setup.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_reduce_2k_setup.c */ @@ -6886,9 +6886,9 @@ ERR: } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k_setup_l.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_reduce_2k_setup_l.c */ @@ -6942,9 +6942,9 @@ int mp_reduce_is_2k(mp_int *a) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_is_2k.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_reduce_is_2k.c */ @@ -6990,9 +6990,9 @@ int mp_reduce_is_2k_l(mp_int *a) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_is_2k_l.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_reduce_is_2k_l.c */ @@ -7028,9 +7028,9 @@ int mp_reduce_setup (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_setup.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_reduce_setup.c */ @@ -7104,9 +7104,9 @@ void mp_rshd (mp_int * a, int b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_rshd.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_rshd.c */ @@ -7137,9 +7137,9 @@ void mp_set (mp_int * a, mp_digit b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_set.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_set.c */ @@ -7189,9 +7189,9 @@ int mp_set_int (mp_int * a, unsigned long b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_set_int.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_set_int.c */ @@ -7217,20 +7217,25 @@ int mp_set_int (mp_int * a, unsigned long b) int mp_shrink (mp_int * a) { mp_digit *tmp; - if (a->alloc != a->used && a->used > 0) { - if ((tmp = OPT_CAST(mp_digit) XREALLOC (a->dp, sizeof (mp_digit) * a->used)) == NULL) { + int used = 1; + + if(a->used > 0) + used = a->used; + + if (a->alloc != used) { + if ((tmp = OPT_CAST(mp_digit) XREALLOC (a->dp, sizeof (mp_digit) * used)) == NULL) { return MP_MEM; } a->dp = tmp; - a->alloc = a->used; + a->alloc = used; } return MP_OKAY; } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_shrink.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: v0.42.0 $ */ +/* $Date: 2010-06-02 15:09:36 +0200 $ */ /* End: bn_mp_shrink.c */ @@ -7259,9 +7264,9 @@ int mp_signed_bin_size (mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_signed_bin_size.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_signed_bin_size.c */ @@ -7321,9 +7326,9 @@ if (a->used >= KARATSUBA_SQR_CUTOFF) { } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_sqr.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_sqr.c */ @@ -7366,9 +7371,9 @@ mp_sqrmod (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_sqrmod.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_sqrmod.c */ @@ -7451,9 +7456,9 @@ E2: mp_clear(&t1); #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_sqrt.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_sqrt.c */ @@ -7514,9 +7519,9 @@ mp_sub (mp_int * a, mp_int * b, mp_int * c) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_sub.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_sub.c */ @@ -7611,9 +7616,9 @@ mp_sub_d (mp_int * a, mp_digit b, mp_int * c) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_sub_d.c,v $ */ -/* $Revision: 1.6 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_sub_d.c */ @@ -7657,9 +7662,9 @@ mp_submod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_submod.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_submod.c */ @@ -7694,9 +7699,9 @@ int mp_to_signed_bin (mp_int * a, unsigned char *b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_to_signed_bin.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_to_signed_bin.c */ @@ -7729,9 +7734,9 @@ int mp_to_signed_bin_n (mp_int * a, unsigned char *b, unsigned long *outlen) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_to_signed_bin_n.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_to_signed_bin_n.c */ @@ -7781,9 +7786,9 @@ int mp_to_unsigned_bin (mp_int * a, unsigned char *b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_to_unsigned_bin.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_to_unsigned_bin.c */ @@ -7816,9 +7821,9 @@ int mp_to_unsigned_bin_n (mp_int * a, unsigned char *b, unsigned long *outlen) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_to_unsigned_bin_n.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_to_unsigned_bin_n.c */ @@ -8104,9 +8109,9 @@ ERR: #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_toom_mul.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_toom_mul.c */ @@ -8334,9 +8339,9 @@ ERR: #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_toom_sqr.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_toom_sqr.c */ @@ -8413,9 +8418,9 @@ int mp_toradix (mp_int * a, char *str, int radix) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_toradix.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_toradix.c */ @@ -8505,9 +8510,9 @@ int mp_toradix_n(mp_int * a, char *str, int radix, int maxlen) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_toradix_n.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_toradix_n.c */ @@ -8537,9 +8542,9 @@ int mp_unsigned_bin_size (mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_unsigned_bin_size.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_unsigned_bin_size.c */ @@ -8592,9 +8597,9 @@ mp_xor (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_xor.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_xor.c */ @@ -8632,9 +8637,9 @@ void mp_zero (mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_zero.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_zero.c */ @@ -8697,9 +8702,9 @@ const mp_digit ltm_prime_tab[] = { }; #endif -/* $Source: /cvs/libtom/libtommath/bn_prime_tab.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_prime_tab.c */ @@ -8740,9 +8745,9 @@ bn_reverse (unsigned char *s, int len) } #endif -/* $Source: /cvs/libtom/libtommath/bn_reverse.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_reverse.c */ @@ -8853,9 +8858,9 @@ s_mp_add (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_s_mp_add.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_s_mp_add.c */ @@ -9109,9 +9114,9 @@ LBL_M: } #endif -/* $Source: /cvs/libtom/libtommath/bn_s_mp_exptmod.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_s_mp_exptmod.c */ @@ -9203,9 +9208,9 @@ int s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /cvs/libtom/libtommath/bn_s_mp_mul_digs.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_s_mp_mul_digs.c */ @@ -9288,9 +9293,9 @@ s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /cvs/libtom/libtommath/bn_s_mp_mul_high_digs.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_s_mp_mul_high_digs.c */ @@ -9376,9 +9381,9 @@ int s_mp_sqr (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_s_mp_sqr.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_s_mp_sqr.c */ @@ -9469,9 +9474,9 @@ s_mp_sub (mp_int * a, mp_int * b, mp_int * c) #endif -/* $Source: /cvs/libtom/libtommath/bn_s_mp_sub.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_s_mp_sub.c */ @@ -9509,9 +9514,9 @@ int KARATSUBA_MUL_CUTOFF = 80, /* Min. number of digits before Karatsub TOOM_SQR_CUTOFF = 400; #endif -/* $Source: /cvs/libtom/libtommath/bncore.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bncore.c */ diff --git a/libtommath/tommath.h b/libtommath/tommath.h index 3c00b9e..cf9c499 100644 --- a/libtommath/tommath.h +++ b/libtommath/tommath.h @@ -579,6 +579,6 @@ extern const char *mp_s_rmap; #endif -/* $Source: /cvs/libtom/libtommath/tommath.h,v $ */ -/* $Revision: 1.8 $ */ -/* $Date: 2006/03/31 14:18:44 $ */ +/* $Source$ */ +/* $Revision: 0.39 $ */ +/* $Date: 2006-04-06 19:49:59 +0000 $ */ diff --git a/libtommath/tommath.pdf b/libtommath/tommath.pdf index 33994c3..0b68941 100644 Binary files a/libtommath/tommath.pdf and b/libtommath/tommath.pdf differ diff --git a/libtommath/tommath_class.h b/libtommath/tommath_class.h index 166dd80..1e29c8f 100644 --- a/libtommath/tommath_class.h +++ b/libtommath/tommath_class.h @@ -994,6 +994,6 @@ #define LTM_LAST #endif -/* $Source: /cvs/libtom/libtommath/tommath_class.h,v $ */ -/* $Revision: 1.3 $ */ -/* $Date: 2005/07/28 11:59:32 $ */ +/* $Source$ */ +/* $Revision: 0.36 $ */ +/* $Date: 2005-08-01 16:37:28 +0000 $ */ diff --git a/libtommath/tommath_superclass.h b/libtommath/tommath_superclass.h index 2fdebe6..89d5516 100644 --- a/libtommath/tommath_superclass.h +++ b/libtommath/tommath_superclass.h @@ -71,6 +71,6 @@ #endif -/* $Source: /cvs/libtom/libtommath/tommath_superclass.h,v $ */ -/* $Revision: 1.3 $ */ -/* $Date: 2005/05/14 13:29:17 $ */ +/* $Source$ */ +/* $Revision: 0.36 $ */ +/* $Date: 2005-08-01 16:37:28 +0000 $ */ -- cgit v0.12 From f1bac0e8becc22f505069ad52dae904eae5e004d Mon Sep 17 00:00:00 2001 From: oehhar Date: Thu, 5 Jun 2014 19:09:51 +0000 Subject: Robust async connect tests by temporarely switching off auto continuation. Ticket [13d3af3ad5] --- tests/socket.test | 15 ++++++++++-- unix/tclUnixSock.c | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++- win/tclWinSock.c | 38 ++++++++++++++++++++++++++++++- 3 files changed, 116 insertions(+), 4 deletions(-) diff --git a/tests/socket.test b/tests/socket.test index 0c9320a..b006cb4 100644 --- a/tests/socket.test +++ b/tests/socket.test @@ -67,10 +67,19 @@ namespace import -force ::tcltest::* testConstraint thread [expr {0 == [catch {package require Thread 2.7-}]}] testConstraint exec [llength [info commands exec]] + # Produce a random port number in the Dynamic/Private range # from 49152 through 65535. proc randport {} { expr {int(rand()*16383+49152)} } +# Check if socket_test option is available +testConstraint sockettest [expr {![catch { + set h [socket -async localhost [randport]] + fconfigure $h -unsupported1 1 + close $h + }]}] + + # Test the latency of tcp connections over the loopback interface. Some OSes # (e.g. NetBSD) seem to use the Nagle algorithm and delayed ACKs, so it takes # up to 200ms for a packet sent to localhost to arrive. We're measuring this @@ -2148,7 +2157,7 @@ test socket-14.10.1 {pending [socket -async] and nonblocking [puts], server is I close $sock } -result {{} ok} test socket-14.11.0 {pending [socket -async] and nonblocking [puts], no listener, no flush} \ - -constraints {socket} \ + -constraints {socket } \ -body { set sock [socket -async localhost [randport]] fconfigure $sock -blocking 0 @@ -2161,12 +2170,14 @@ test socket-14.11.0 {pending [socket -async] and nonblocking [puts], no listener unset x } -result {socket is not connected} -returnCodes 1 test socket-14.11.1 {pending [socket -async] and nonblocking [puts], no listener, flush} \ - -constraints {socket} \ + -constraints {socket sockettest} \ -body { set sock [socket -async localhost [randport]] + fconfigure $sock -unsupported1 1 fconfigure $sock -blocking 0 puts $sock ok flush $sock + fconfigure $sock -unsupported1 0 fileevent $sock writable {set x 1} vwait x close $sock diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c index a9323c4..cf5d7b9 100644 --- a/unix/tclUnixSock.c +++ b/unix/tclUnixSock.c @@ -89,6 +89,9 @@ struct TcpState { * flag indicates that reentry is * still pending */ #define TCP_ASYNC_FAILED (1<<5) /* An async connect finally failed */ +#define TCP_ASYNC_TEST_MODE (1<<6) /* Async testing activated + * Do not automatically continue connection + * process */ /* * The following defines the maximum length of the listen queue. This is the @@ -125,6 +128,9 @@ static int TcpClose2Proc(ClientData instanceData, Tcl_Interp *interp, int flags); static int TcpGetHandleProc(ClientData instanceData, int direction, ClientData *handlePtr); +static int TcpSetOptionProc(ClientData instanceData, + Tcl_Interp *interp, const char *optionName, + const char *value); static int TcpGetOptionProc(ClientData instanceData, Tcl_Interp *interp, const char *optionName, Tcl_DString *dsPtr); @@ -147,7 +153,7 @@ static const Tcl_ChannelType tcpChannelType = { TcpInputProc, /* Input proc. */ TcpOutputProc, /* Output proc. */ NULL, /* Seek proc. */ - NULL, /* Set option proc. */ + TcpSetOptionProc, /* Set option proc. */ TcpGetOptionProc, /* Get option proc. */ TcpWatchProc, /* Initialize notifier. */ TcpGetHandleProc, /* Get OS handles out of channel. */ @@ -439,6 +445,21 @@ WaitForConnect( if (!(statePtr->flags & TCP_ASYNC_PENDING)) { return 0; } + + /* + * In socket test mode do not continue with the connect + * Exceptions are: + * - Call by recv/send and blocking socket + * (errorCodePtr != NULL && ! flags & TCP_NONBLOCKING) + */ + + if ( (statePtr->flags & TCP_ASYNC_TEST_MODE) + && !(errorCodePtr != NULL && !(statePtr->flags & TCP_NONBLOCKING))) { + if (errorCodePtr != NULL) { + *errorCodePtr = EWOULDBLOCK; + } + return -1; + } if (errorCodePtr == NULL || (statePtr->flags & TCP_NONBLOCKING)) { timeout = 0; @@ -748,6 +769,50 @@ TcpHostPortList( /* *---------------------------------------------------------------------- * + * TcpSetOptionProc -- + * + * Sets Tcp channel specific options. + * + * Results: + * None, unless an error happens. + * + * Side effects: + * Changes attributes of the socket at the system level. + * + *---------------------------------------------------------------------- + */ + +static int +TcpSetOptionProc( + ClientData instanceData, /* Socket state. */ + Tcl_Interp *interp, /* For error reporting - can be NULL. */ + const char *optionName, /* Name of the option to set. */ + const char *value) /* New value for option. */ +{ + TcpState *statePtr = instanceData; + + /* + * Set socket test int value + */ + if (!strcmp(optionName, "-unsupported1")) { + int intValue; + if (Tcl_GetInt(interp, value, &intValue) != TCL_OK) { + return TCL_ERROR; + } + if (intValue & 1) { + SET_BITS(statePtr->flags,TCP_ASYNC_TEST_MODE); + } else { + CLEAR_BITS(statePtr->flags,TCP_ASYNC_TEST_MODE); + } + return TCL_OK; + } + + return Tcl_BadChannelOption(interp, optionName, ""); +} + +/* + *---------------------------------------------------------------------- + * * TcpGetOptionProc -- * * Computes an option value for a TCP socket based channel, or a list of diff --git a/win/tclWinSock.c b/win/tclWinSock.c index f343f82..2703309 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -191,6 +191,9 @@ struct TcpState { * flag indicates that reentry is * still pending */ #define TCP_ASYNC_FAILED (1<<5) /* An async connect finally failed */ +#define TCP_ASYNC_TEST_MODE (1<<6) /* Async testing activated + * Do not automatically continue connection + * process */ /* * The following structure is what is added to the Tcl event queue when a @@ -602,6 +605,20 @@ WaitForConnect( } /* + * In socket test mode do not continue with the connect + * Exceptions are: + * - Call by recv/send and blocking socket + * (errorCodePtr != NULL && ! flags & TCP_NONBLOCKING) + * - Call by the event queue (errorCodePtr == NULL) + */ + + if ( (statePtr->flags & TCP_ASYNC_TEST_MODE) + && errorCodePtr != NULL && (statePtr->flags & TCP_NONBLOCKING)) { + *errorCodePtr = EWOULDBLOCK; + return -1; + } + + /* * Be sure to disable event servicing so we are truly modal. */ @@ -1123,6 +1140,7 @@ TcpSetOptionProc( const char *optionName, /* Name of the option to set. */ const char *value) /* New value for option. */ { + TcpState *statePtr = instanceData; #ifdef TCL_FEATURE_KEEPALIVE_NAGLE TcpState *statePtr = instanceData; SOCKET sock; @@ -1142,6 +1160,22 @@ TcpSetOptionProc( return TCL_ERROR; } + /* + * Set socket test int value + */ + if (!strcmp(optionName, "-unsupported1")) { + int intValue; + if (Tcl_GetInt(interp, value, &intValue) != TCL_OK) { + return TCL_ERROR; + } + if (intValue & 1) { + SET_BITS(statePtr->flags,TCP_ASYNC_TEST_MODE); + } else { + CLEAR_BITS(statePtr->flags,TCP_ASYNC_TEST_MODE); + } + return TCL_OK; + } + #ifdef TCL_FEATURE_KEEPALIVE_NAGLE #error "TCL_FEATURE_KEEPALIVE_NAGLE not reviewed for whether to treat statePtr->sockets as single fd or list" sock = statePtr->sockets->fd; @@ -1254,7 +1288,9 @@ TcpGetOptionProc( * Go one step in async connect * If any error is thrown save it as backround error to report eventually below */ - WaitForConnect(statePtr, NULL); + if (! (statePtr->flags & TCP_ASYNC_TEST_MODE) ) { + WaitForConnect(statePtr, NULL); + } sock = statePtr->sockets->fd; if (optionName != NULL) { -- cgit v0.12 From 57fd7d58a12e28ba76f2bafdf441d53fabf47cb0 Mon Sep 17 00:00:00 2001 From: oehhar Date: Thu, 17 Jul 2014 09:53:36 +0000 Subject: Replaced option "-unsupported1" by test command "testsocket debugflags" (thanks Donal, Donald). --- generic/tclTest.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/socket.test | 15 ++++++---- unix/tclUnixSock.c | 67 +++++++++--------------------------------- win/tclWinSock.c | 31 +++++++------------- 4 files changed, 118 insertions(+), 80 deletions(-) diff --git a/generic/tclTest.c b/generic/tclTest.c index a27c95a..80a2a37 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -75,6 +75,18 @@ typedef struct TestAsyncHandler { /* Next is list of handlers. */ } TestAsyncHandler; +/* + * Start of the socket driver state structure to acces field testFlags + */ + +typedef struct TcpState TcpState; + +struct TcpState { + Tcl_Channel channel; /* Channel associated with this socket. */ + int testFlags; /* bit field for tests. Is set by testsocket + * test procedure */ +}; + TCL_DECLARE_MUTEX(asyncTestMutex) static TestAsyncHandler *firstHandler = NULL; @@ -362,6 +374,8 @@ static int TestChannelCmd(ClientData clientData, Tcl_Interp *interp, int argc, const char **argv); static int TestChannelEventCmd(ClientData clientData, Tcl_Interp *interp, int argc, const char **argv); +static int TestSocketCmd(ClientData clientData, + Tcl_Interp *interp, int argc, const char **argv); static int TestFilesystemObjCmd(ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); @@ -666,6 +680,8 @@ Tcltest_Init( TestNumUtfCharsCmd, NULL, NULL); Tcl_CreateCommand(interp, "testsetplatform", TestsetplatformCmd, NULL, NULL); + Tcl_CreateCommand(interp, "testsocket", TestSocketCmd, + NULL, NULL); Tcl_CreateCommand(interp, "teststaticpkg", TeststaticpkgCmd, NULL, NULL); Tcl_CreateCommand(interp, "testtranslatefilename", @@ -5970,6 +5986,75 @@ TestChannelEventCmd( /* *---------------------------------------------------------------------- * + * TestSocketCmd -- + * + * Implements the Tcl "testsocket" debugging command and its + * subcommands. This is part of the testing environment. + * + * Results: + * A standard Tcl result. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + + /* ARGSUSED */ +static int +TestSocketCmd( + ClientData clientData, /* Not used. */ + Tcl_Interp *interp, /* Interpreter for result. */ + int argc, /* Count of additional args. */ + const char **argv) /* Additional arg strings. */ +{ + const char *cmdName; /* Sub command. */ + size_t len; /* Length of subcommand string. */ + + if (argc < 2) { + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], + " subcommand ?additional args..?\"", NULL); + return TCL_ERROR; + } + cmdName = argv[1]; + len = strlen(cmdName); + + if ((cmdName[0] == 't') && (strncmp(cmdName, "testflags", len) == 0)) { + Tcl_Channel hChannel; + int modePtr; + TcpState *statePtr; + /* Set test value in the socket driver + */ + /* Check for argument "channel name" + */ + if (argc < 4) { + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], + " testflags channel flags\"", NULL); + return TCL_ERROR; + } + hChannel = Tcl_GetChannel(interp, argv[2], &modePtr); + if ( NULL == hChannel ) { + Tcl_AppendResult(interp, "unknown channel:", argv[2], NULL); + return TCL_ERROR; + } + statePtr = (TcpState *)Tcl_GetChannelInstanceData(hChannel); + if ( NULL == statePtr) { + Tcl_AppendResult(interp, "No channel instance data:", argv[2], + NULL); + return TCL_ERROR; + } + statePtr->testFlags = atoi(argv[3]); + return TCL_OK; + } + + Tcl_AppendResult(interp, "bad option \"", cmdName, "\": should be " + "testflags", NULL); + return TCL_ERROR; +} + +/* + *---------------------------------------------------------------------- + * * TestWrongNumArgsObjCmd -- * * Test the Tcl_WrongNumArgs function. diff --git a/tests/socket.test b/tests/socket.test index b006cb4..839e9d2 100644 --- a/tests/socket.test +++ b/tests/socket.test @@ -72,10 +72,10 @@ testConstraint exec [llength [info commands exec]] # from 49152 through 65535. proc randport {} { expr {int(rand()*16383+49152)} } -# Check if socket_test option is available -testConstraint sockettest [expr {![catch { +# Check if testsocket testflags is available +testConstraint testsocket_testflags [expr {![catch { set h [socket -async localhost [randport]] - fconfigure $h -unsupported1 1 + testsocket testflags $h 0 close $h }]}] @@ -2170,14 +2170,17 @@ test socket-14.11.0 {pending [socket -async] and nonblocking [puts], no listener unset x } -result {socket is not connected} -returnCodes 1 test socket-14.11.1 {pending [socket -async] and nonblocking [puts], no listener, flush} \ - -constraints {socket sockettest} \ + -constraints {socket testsocket_testflags} \ -body { set sock [socket -async localhost [randport]] - fconfigure $sock -unsupported1 1 + # Set the socket in async test mode. + # The async connect will not be continued on the following fconfigure + # and puts/flush. Thus, the connect will fail after them. + testsocket testflags $sock 1 fconfigure $sock -blocking 0 puts $sock ok flush $sock - fconfigure $sock -unsupported1 0 + testsocket testflags $sock 0 fileevent $sock writable {set x 1} vwait x close $sock diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c index cf5d7b9..fdd4287 100644 --- a/unix/tclUnixSock.c +++ b/unix/tclUnixSock.c @@ -52,6 +52,8 @@ typedef struct TcpFdList { struct TcpState { Tcl_Channel channel; /* Channel associated with this file. */ + int testFlags; /* bit field for tests. Is set by testsocket + * test procedure */ TcpFdList fds; /* The file descriptors of the sockets. */ int flags; /* ORed combination of the bitfields defined * below. */ @@ -89,7 +91,13 @@ struct TcpState { * flag indicates that reentry is * still pending */ #define TCP_ASYNC_FAILED (1<<5) /* An async connect finally failed */ -#define TCP_ASYNC_TEST_MODE (1<<6) /* Async testing activated + +/* + * These bits may be ORed together into the "testFlags" field of a TcpState + * structure. + */ + +#define TCP_ASYNC_TEST_MODE (1<<0) /* Async testing activated * Do not automatically continue connection * process */ @@ -128,9 +136,6 @@ static int TcpClose2Proc(ClientData instanceData, Tcl_Interp *interp, int flags); static int TcpGetHandleProc(ClientData instanceData, int direction, ClientData *handlePtr); -static int TcpSetOptionProc(ClientData instanceData, - Tcl_Interp *interp, const char *optionName, - const char *value); static int TcpGetOptionProc(ClientData instanceData, Tcl_Interp *interp, const char *optionName, Tcl_DString *dsPtr); @@ -153,7 +158,7 @@ static const Tcl_ChannelType tcpChannelType = { TcpInputProc, /* Input proc. */ TcpOutputProc, /* Output proc. */ NULL, /* Seek proc. */ - TcpSetOptionProc, /* Set option proc. */ + NULL, /* Set option proc. */ TcpGetOptionProc, /* Get option proc. */ TcpWatchProc, /* Initialize notifier. */ TcpGetHandleProc, /* Get OS handles out of channel. */ @@ -453,11 +458,9 @@ WaitForConnect( * (errorCodePtr != NULL && ! flags & TCP_NONBLOCKING) */ - if ( (statePtr->flags & TCP_ASYNC_TEST_MODE) - && !(errorCodePtr != NULL && !(statePtr->flags & TCP_NONBLOCKING))) { - if (errorCodePtr != NULL) { - *errorCodePtr = EWOULDBLOCK; - } + if ( (statePtr->testFlags & TCP_ASYNC_TEST_MODE) + && ! (errorCodePtr != NULL && ! (statePtr->flags & TCP_NONBLOCKING))) { + *errorCodePtr = EWOULDBLOCK; return -1; } @@ -769,50 +772,6 @@ TcpHostPortList( /* *---------------------------------------------------------------------- * - * TcpSetOptionProc -- - * - * Sets Tcp channel specific options. - * - * Results: - * None, unless an error happens. - * - * Side effects: - * Changes attributes of the socket at the system level. - * - *---------------------------------------------------------------------- - */ - -static int -TcpSetOptionProc( - ClientData instanceData, /* Socket state. */ - Tcl_Interp *interp, /* For error reporting - can be NULL. */ - const char *optionName, /* Name of the option to set. */ - const char *value) /* New value for option. */ -{ - TcpState *statePtr = instanceData; - - /* - * Set socket test int value - */ - if (!strcmp(optionName, "-unsupported1")) { - int intValue; - if (Tcl_GetInt(interp, value, &intValue) != TCL_OK) { - return TCL_ERROR; - } - if (intValue & 1) { - SET_BITS(statePtr->flags,TCP_ASYNC_TEST_MODE); - } else { - CLEAR_BITS(statePtr->flags,TCP_ASYNC_TEST_MODE); - } - return TCL_OK; - } - - return Tcl_BadChannelOption(interp, optionName, ""); -} - -/* - *---------------------------------------------------------------------- - * * TcpGetOptionProc -- * * Computes an option value for a TCP socket based channel, or a list of diff --git a/win/tclWinSock.c b/win/tclWinSock.c index 2703309..d6c8e3a 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -133,6 +133,8 @@ typedef struct TcpFdList { struct TcpState { Tcl_Channel channel; /* Channel associated with this socket. */ + int testFlags; /* bit field for tests. Is set by testsocket + * test procedure */ struct TcpFdList *sockets; /* Windows SOCKET handle. */ int flags; /* Bit field comprised of the flags described * below. */ @@ -191,7 +193,13 @@ struct TcpState { * flag indicates that reentry is * still pending */ #define TCP_ASYNC_FAILED (1<<5) /* An async connect finally failed */ -#define TCP_ASYNC_TEST_MODE (1<<6) /* Async testing activated + +/* + * These bits may be ORed together into the "testFlags" field of a TcpState + * structure. + */ + +#define TCP_ASYNC_TEST_MODE (1<<0) /* Async testing activated * Do not automatically continue connection * process */ @@ -612,7 +620,7 @@ WaitForConnect( * - Call by the event queue (errorCodePtr == NULL) */ - if ( (statePtr->flags & TCP_ASYNC_TEST_MODE) + if ( (statePtr->testFlags & TCP_ASYNC_TEST_MODE) && errorCodePtr != NULL && (statePtr->flags & TCP_NONBLOCKING)) { *errorCodePtr = EWOULDBLOCK; return -1; @@ -1140,7 +1148,6 @@ TcpSetOptionProc( const char *optionName, /* Name of the option to set. */ const char *value) /* New value for option. */ { - TcpState *statePtr = instanceData; #ifdef TCL_FEATURE_KEEPALIVE_NAGLE TcpState *statePtr = instanceData; SOCKET sock; @@ -1160,22 +1167,6 @@ TcpSetOptionProc( return TCL_ERROR; } - /* - * Set socket test int value - */ - if (!strcmp(optionName, "-unsupported1")) { - int intValue; - if (Tcl_GetInt(interp, value, &intValue) != TCL_OK) { - return TCL_ERROR; - } - if (intValue & 1) { - SET_BITS(statePtr->flags,TCP_ASYNC_TEST_MODE); - } else { - CLEAR_BITS(statePtr->flags,TCP_ASYNC_TEST_MODE); - } - return TCL_OK; - } - #ifdef TCL_FEATURE_KEEPALIVE_NAGLE #error "TCL_FEATURE_KEEPALIVE_NAGLE not reviewed for whether to treat statePtr->sockets as single fd or list" sock = statePtr->sockets->fd; @@ -1288,7 +1279,7 @@ TcpGetOptionProc( * Go one step in async connect * If any error is thrown save it as backround error to report eventually below */ - if (! (statePtr->flags & TCP_ASYNC_TEST_MODE) ) { + if (! (statePtr->testFlags & TCP_ASYNC_TEST_MODE) ) { WaitForConnect(statePtr, NULL); } -- cgit v0.12 From 1990c76e8d05fcf48cccabb5d2f1a49c3c99ecd1 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 18 Jul 2014 10:00:52 +0000 Subject: Make sure the "sockettest" command is available even when running socket.test individually. --- tests/socket.test | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/socket.test b/tests/socket.test index 8ffd86b..29f1015 100644 --- a/tests/socket.test +++ b/tests/socket.test @@ -60,8 +60,13 @@ # listening at port 2048. If all fails, a message is printed and the tests # using the remote server are not performed. -package require tcltest 2 -namespace import -force ::tcltest::* +if {[lsearch [namespace children] ::tcltest] == -1} { + package require tcltest + namespace import -force ::tcltest::* +} + +::tcltest::loadTestedCommands +catch [list package require -exact Tcltest [info patchlevel]] # Some tests require the Thread package or exec command testConstraint thread [expr {0 == [catch {package require Thread 2.7-}]}] -- cgit v0.12 From a7258480c26f267158b30ff494c04bc04c6cfae0 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 25 Sep 2015 10:39:39 +0000 Subject: proposed fix for [219866c1e9]: platform::identify: regexp doesn't match platform --- library/platform/pkgIndex.tcl | 2 +- library/platform/platform.tcl | 13 ++++++++++--- unix/Makefile.in | 4 ++-- win/Makefile.in | 4 ++-- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/library/platform/pkgIndex.tcl b/library/platform/pkgIndex.tcl index 5250163..5970a3f 100644 --- a/library/platform/pkgIndex.tcl +++ b/library/platform/pkgIndex.tcl @@ -1,3 +1,3 @@ -package ifneeded platform 1.0.13 [list source [file join $dir platform.tcl]] +package ifneeded platform 1.0.14 [list source [file join $dir platform.tcl]] package ifneeded platform::shell 1.1.4 [list source [file join $dir shell.tcl]] diff --git a/library/platform/platform.tcl b/library/platform/platform.tcl index 1bce7b5..6843210 100644 --- a/library/platform/platform.tcl +++ b/library/platform/platform.tcl @@ -95,7 +95,11 @@ proc ::platform::generic {} { switch -- $plat { windows { - set plat win32 + if {$tcl_platform(platform) == "unix"} { + set plat cygwin_nt + } else { + set plat win32 + } if {$cpu eq "amd64"} { # Do not check wordSize, win32-x64 is an IL32P64 platform. set cpu x86_64 @@ -158,9 +162,12 @@ proc ::platform::identify {} { global tcl_platform set id [generic] - regexp {^([^-]+)-([^-]+)$} $id -> plat cpu + regexp {^([^-]+)(-[0-9\.]+)?(-wow)?-([^-]+)$} $id -> plat ver wow cpu switch -- $plat { + cygwin_nt { + return "${plat}-${cpu}" + } solaris { regsub {^5} $tcl_platform(osVersion) 2 text append plat $text @@ -371,7 +378,7 @@ proc ::platform::patterns {id} { # ### ### ### ######### ######### ######### ## Ready -package provide platform 1.0.13 +package provide platform 1.0.14 # ### ### ### ######### ######### ######### ## Demo application diff --git a/unix/Makefile.in b/unix/Makefile.in index 1358f29..1f2cd77 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -788,8 +788,8 @@ install-libraries: libraries $(INSTALL_TZDATA) install-msgs @echo "Installing package tcltest 2.3.8 as a Tcl Module"; @$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/tcltest-2.3.8.tm; - @echo "Installing package platform 1.0.13 as a Tcl Module"; - @$(INSTALL_DATA) $(TOP_DIR)/library/platform/platform.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/platform-1.0.13.tm; + @echo "Installing package platform 1.0.14 as a Tcl Module"; + @$(INSTALL_DATA) $(TOP_DIR)/library/platform/platform.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/platform-1.0.14.tm; @echo "Installing package platform::shell 1.1.4 as a Tcl Module"; @$(INSTALL_DATA) $(TOP_DIR)/library/platform/shell.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/platform/shell-1.1.4.tm; diff --git a/win/Makefile.in b/win/Makefile.in index dd568ba..c0d8668 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -653,8 +653,8 @@ install-libraries: libraries install-tzdata install-msgs @$(COPY) $(ROOT_DIR)/library/msgcat/msgcat.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/msgcat-1.5.2.tm; @echo "Installing package tcltest 2.3.8 as a Tcl Module"; @$(COPY) $(ROOT_DIR)/library/tcltest/tcltest.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/tcltest-2.3.8.tm; - @echo "Installing package platform 1.0.13 as a Tcl Module"; - @$(COPY) $(ROOT_DIR)/library/platform/platform.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/platform-1.0.13.tm; + @echo "Installing package platform 1.0.14 as a Tcl Module"; + @$(COPY) $(ROOT_DIR)/library/platform/platform.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/platform-1.0.14.tm; @echo "Installing package platform::shell 1.1.4 as a Tcl Module"; @$(COPY) $(ROOT_DIR)/library/platform/shell.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/platform/shell-1.1.4.tm; @echo "Installing encodings"; -- cgit v0.12 From 4bdba0452a35fd38357a21020579d0151a1c25d6 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 28 Sep 2015 11:11:00 +0000 Subject: align comment, no functional change --- generic/tclIO.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclIO.h b/generic/tclIO.h index 20e0ccd..348a9c5 100644 --- a/generic/tclIO.h +++ b/generic/tclIO.h @@ -126,7 +126,7 @@ typedef struct Channel { */ typedef struct ChannelState { - char *channelName; /* The name of the channel instance in Tcl + char *channelName; /* The name of the channel instance in Tcl * commands. Storage is owned by the generic * IO code, is dynamically allocated. */ int flags; /* ORed combination of the flags defined -- cgit v0.12 From a2540e5ece3d78a4ea38164cdbcb92d6f0c769c3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 30 Sep 2015 08:25:37 +0000 Subject: Fix [b1f19286f0]: for command documentation. Minor addendum to previous commit: Make OS version number available in ::platform::generic for Cygwin --- doc/for.n | 2 +- library/platform/platform.tcl | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/for.n b/doc/for.n index 9773677..7537e10 100644 --- a/doc/for.n +++ b/doc/for.n @@ -48,7 +48,7 @@ expression is evaluated (before each loop iteration), so changes in the variables will be visible. See below for an example: .SH EXAMPLES -Print a line for each of the integers from 0 to 10: +Print a line for each of the integers from 0 to 9: .CS for {set x 0} {$x<10} {incr x} { puts "x is $x" diff --git a/library/platform/platform.tcl b/library/platform/platform.tcl index 6843210..d510541 100644 --- a/library/platform/platform.tcl +++ b/library/platform/platform.tcl @@ -104,6 +104,7 @@ proc ::platform::generic {} { # Do not check wordSize, win32-x64 is an IL32P64 platform. set cpu x86_64 } + append plat -$tcl_platform(osVersion) } sunos { set plat solaris -- cgit v0.12 From 5572aa0ec790cb0075eca068cf30ae366abb7f4c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 30 Sep 2015 11:11:33 +0000 Subject: Don't limit Universal runtime support VisualStudio version 14 only, future versions will probably have it as well. --- win/configure | 4 ++-- win/tcl.m4 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/win/configure b/win/configure index f417981..1dcc9d2 100755 --- a/win/configure +++ b/win/configure @@ -3691,7 +3691,7 @@ echo "${ECHO_T}using shared flags" >&6 LIBRARIES="\${SHARED_LIBRARIES}" SHLIB_LD_LIBS='${LIBS}' case "x`echo \${VisualStudioVersion}`" in - x14*) + x1[4-9]*) lflags="${lflags} -nodefaultlib:libucrt.lib" ;; *) @@ -3736,7 +3736,7 @@ echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 LIBS="user32.lib advapi32.lib ws2_32.lib" case "x`echo \${VisualStudioVersion}`" in - x14*) + x1[4-9]*) LIBS="$LIBS ucrt.lib" ;; *) diff --git a/win/tcl.m4 b/win/tcl.m4 index 6f10a96..aa3c4b3 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -784,7 +784,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ LIBRARIES="\${SHARED_LIBRARIES}" SHLIB_LD_LIBS='${LIBS}' case "x`echo \${VisualStudioVersion}`" in - x14*) + x1[4-9]*) lflags="${lflags} -nodefaultlib:libucrt.lib" ;; *) @@ -826,7 +826,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ LIBS="user32.lib advapi32.lib ws2_32.lib" case "x`echo \${VisualStudioVersion}`" in - x14*) + x1[4-9]*) LIBS="$LIBS ucrt.lib" ;; *) -- cgit v0.12 From 3964ec3d8cef652a7ff8f12578bf910bedd0f50b Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 30 Sep 2015 12:57:02 +0000 Subject: Fix [738bc50e93]: auto_execok doesn't recognise mklink on windows. Remove some unnecessary end-of-line spacing. --- library/auto.tcl | 14 ++-- library/clock.tcl | 168 +++++++++++++++++++++--------------------- library/init.tcl | 12 +-- library/package.tcl | 44 +++++------ library/platform/platform.tcl | 2 +- library/safe.tcl | 18 ++--- library/tm.tcl | 2 +- 7 files changed, 128 insertions(+), 132 deletions(-) diff --git a/library/auto.tcl b/library/auto.tcl index f7cf5f0..ec680de 100644 --- a/library/auto.tcl +++ b/library/auto.tcl @@ -16,7 +16,7 @@ # so that the information gets recomputed the next time it's needed. # Also delete any commands that are listed in the auto-load index. # -# Arguments: +# Arguments: # None. proc auto_reset {} { @@ -172,7 +172,7 @@ proc tcl_findLibrary {basename version patch initScript enVarName varName} { # parse Tcl source files, writing out index entries as "proc" # commands are encountered. This implementation won't work in a # safe interpreter, since a safe interpreter can't create the -# special parser and mess with its commands. +# special parser and mess with its commands. if {[interp issafe]} { return ;# Stop sourcing the file here @@ -184,7 +184,7 @@ if {[interp issafe]} { # followed by any number of glob patterns to use in that directory to # locate all of the relevant files. # -# Arguments: +# Arguments: # dir - Name of the directory in which to create an index. # args - Any number of additional arguments giving the # names of files within dir. If no additional @@ -338,7 +338,7 @@ namespace eval auto_mkindex_parser { # handles things like the "proc" command by adding an entry for the # index file. Returns a string that represents the index file. # -# Arguments: +# Arguments: # file Name of Tcl source file to be indexed. proc auto_mkindex_parser::mkindex {file} { @@ -455,7 +455,7 @@ proc auto_mkindex_parser::commandInit {name arglist body} { if {[string match *::* $name]} { set exportCmd [list _%@namespace export [namespace tail $name]] $parser eval [list _%@namespace eval $ns $exportCmd] - + # The following proc definition does not work if you # want to tolerate space or something else diabolical # in the procedure name, (i.e., space in $alias) @@ -528,7 +528,7 @@ auto_mkindex_parser::command proc {name args} { variable scriptFile # Do some fancy reformatting on the "source" call to handle platform # differences with respect to pathnames. Use format just so that the - # command is a little easier to read (otherwise it'd be full of + # command is a little easier to read (otherwise it'd be full of # backslashed dollar signs, etc. append index [list set auto_index([fullname $name])] \ [format { [list source [file join $dir %s]]} \ @@ -553,7 +553,7 @@ auto_mkindex_parser::hook { # AUTO MKINDEX: tbcload::bcproc name arglist body # Adds an entry to the auto index list for the given pre-compiled - # procedure name. + # procedure name. auto_mkindex_parser::commandInit tbcload::bcproc {name args} { variable index diff --git a/library/clock.tcl b/library/clock.tcl index 1f83716..eb87251 100644 --- a/library/clock.tcl +++ b/library/clock.tcl @@ -43,7 +43,7 @@ namespace eval ::tcl::clock \ # The 'clock' command manipulates time. Refer to the user documentation # for the available subcommands and what they do. # -#---------------------------------------------------------------------- +#---------------------------------------------------------------------- namespace eval ::tcl::clock { @@ -189,7 +189,7 @@ proc ::tcl::clock::Initialize {} { # Germany, Norway, Denmark (Catholic Germany changed earlier) ::msgcat::mcset de_DE GREGORIAN_CHANGE_DATE 2342032 - ::msgcat::mcset nb GREGORIAN_CHANGE_DATE 2342032 + ::msgcat::mcset nb GREGORIAN_CHANGE_DATE 2342032 ::msgcat::mcset nn GREGORIAN_CHANGE_DATE 2342032 ::msgcat::mcset no GREGORIAN_CHANGE_DATE 2342032 ::msgcat::mcset da GREGORIAN_CHANGE_DATE 2342032 @@ -225,7 +225,7 @@ proc ::tcl::clock::Initialize {} { # Greece ::msgcat::mcset el GREGORIAN_CHANGE_DATE 2423480 - + #------------------------------------------------------------------ # # CONSTANTS @@ -378,7 +378,7 @@ proc ::tcl::clock::Initialize {} { {46800 0 3600 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0} :Pacific/Tongatapu }] - # Groups of fields that specify the date, priorities, and + # Groups of fields that specify the date, priorities, and # code bursts that determine Julian Day Number given those groups. # The code in [clock scan] will choose the highest priority # (lowest numbered) set of fields that determines the date. @@ -670,7 +670,7 @@ proc ::tcl::clock::format { args } { set clockval [lindex $args 0] # Get the data for time changes in the given zone - + if {$timezone eq ""} { set timezone [GetSystemTimeZone] } @@ -680,11 +680,11 @@ proc ::tcl::clock::format { args } { return -options $opts $retval } } - + # Build a procedure to format the result. Cache the built procedure's # name in the 'FormatProc' array to avoid losing its internal # representation, which contains the name resolution. - + set procName formatproc'$format'$locale set procName [namespace current]::[string map {: {\:} \\ {\\}} $procName] if {[info exists FormatProc($procName)]} { @@ -693,7 +693,7 @@ proc ::tcl::clock::format { args } { set FormatProc($procName) \ [ParseClockFormatFormat $procName $format $locale] } - + return [$procName $clockval $timezone] } @@ -720,7 +720,7 @@ proc ::tcl::clock::ParseClockFormatFormat {procName format locale} { } # Map away the locale-dependent composite format groups - + EnterLocale $locale oldLocale # Change locale if a fresh locale has been given on the command line. @@ -767,7 +767,7 @@ proc ::tcl::clock::ParseClockFormatFormat2 {format locale procName} { set formatString {} set substituents {} set state {} - + set format [LocalizeFormat $locale $format] foreach char [split $format {}] { @@ -794,7 +794,7 @@ proc ::tcl::clock::ParseClockFormatFormat2 {format locale procName} { { [lindex @DAYS_OF_WEEK_ABBREV@ \ [expr {[dict get $date dayOfWeek] \ % 7}]]}] - } + } A { # Day of week, spelt out. append formatString %s append substituents \ @@ -895,7 +895,7 @@ proc ::tcl::clock::ParseClockFormatFormat2 {format locale procName} { k { # Hour (0-23), no leading zero append formatString %2d append substituents \ - { [expr { [dict get $date localSeconds] + { [expr { [dict get $date localSeconds] / 3600 % 24 }]} } @@ -916,7 +916,7 @@ proc ::tcl::clock::ParseClockFormatFormat2 {format locale procName} { M { # Minute of the hour, leading zero append formatString %02d append substituents \ - { [expr { [dict get $date localSeconds] + { [expr { [dict get $date localSeconds] / 60 % 60 }]} } @@ -957,7 +957,7 @@ proc ::tcl::clock::ParseClockFormatFormat2 {format locale procName} { { [expr {(([dict get $date localSeconds] % 86400) < 43200) ? $am : $pm}]} - + } Q { # Hi, Jeff! append formatString %s @@ -967,11 +967,11 @@ proc ::tcl::clock::ParseClockFormatFormat2 {format locale procName} { append formatString %s append substituents { [dict get $date seconds]} } - S { # Second of the minute, with + S { # Second of the minute, with # leading zero append formatString %02d append substituents \ - { [expr { [dict get $date localSeconds] + { [expr { [dict get $date localSeconds] % 60 }]} } t { # A literal tab character @@ -992,7 +992,7 @@ proc ::tcl::clock::ParseClockFormatFormat2 {format locale procName} { } incr dow set UweekNumber \ - [expr { ( [dict get $date dayOfYear] + [expr { ( [dict get $date dayOfYear] - $dow + 7 ) / 7 }] } @@ -1015,7 +1015,7 @@ proc ::tcl::clock::ParseClockFormatFormat2 {format locale procName} { set WweekNumber \ [expr { ( [dict get $date dayOfYear] - [dict get $date dayOfWeek] - + 7 ) + + 7 ) / 7 }] } append formatString %02d @@ -1084,7 +1084,7 @@ proc ::tcl::clock::ParseClockFormatFormat2 {format locale procName} { percentO { # Character following %O set state {} switch -exact -- $char { - d - e { # Day of the month in alternative + d - e { # Day of the month in alternative # numerals append formatString %s append substituents \ @@ -1096,7 +1096,7 @@ proc ::tcl::clock::ParseClockFormatFormat2 {format locale procName} { append formatString %s append substituents \ { [lindex $localeNumerals \ - [expr { [dict get $date localSeconds] + [expr { [dict get $date localSeconds] / 3600 % 24 }]]} } @@ -1122,7 +1122,7 @@ proc ::tcl::clock::ParseClockFormatFormat2 {format locale procName} { append formatString %s append substituents \ { [lindex $localeNumerals \ - [expr { [dict get $date localSeconds] + [expr { [dict get $date localSeconds] / 60 % 60 }]]} } @@ -1131,7 +1131,7 @@ proc ::tcl::clock::ParseClockFormatFormat2 {format locale procName} { append formatString %s append substituents \ { [lindex $localeNumerals \ - [expr { [dict get $date localSeconds] + [expr { [dict get $date localSeconds] % 60 }]]} } u { # Day of the week (Monday=1,Sunday=7) @@ -1162,9 +1162,9 @@ proc ::tcl::clock::ParseClockFormatFormat2 {format locale procName} { } } } - + # Clean up any improperly terminated groups - + switch -exact -- $state { percent { append formatString %% @@ -1263,7 +1263,7 @@ proc ::tcl::clock::scan { args } { } if { [catch { expr { wide($base) } } result] } { return -code error \ - "expected integer but got \"$base\"" + "expected integer but got \"$base\"" } if { ![string is boolean $gmt] } { return -code error \ @@ -1340,7 +1340,7 @@ proc ::tcl::clock::FreeScan { string base timezone locale } { variable TZData # Get the data for time changes in the given zone - + if {[catch {SetupTimeZone $timezone} retval opts]} { dict unset opts -errorinfo return -options $opts $retval @@ -1353,7 +1353,7 @@ proc ::tcl::clock::FreeScan { string base timezone locale } { $base \ $TZData($timezone) \ 2361222] - dict set date secondOfDay [expr { [dict get $date localSeconds] + dict set date secondOfDay [expr { [dict get $date localSeconds] % 86400 }] # Parse the date. The parser will return a list comprising @@ -1400,7 +1400,7 @@ proc ::tcl::clock::FreeScan { string base timezone locale } { # east of Greenwich, and the second is a Daylight Saving Time # indicator ( 1 == yes, 0 == no, -1 == unknown ). We make it into # a time zone indicator of +-hhmm. - + if { [llength $parseZone] > 0 } { lassign $parseZone minEast dstFlag set timezone [FormatNumericTimeZone \ @@ -1414,9 +1414,9 @@ proc ::tcl::clock::FreeScan { string base timezone locale } { set date [GetJulianDayFromEraYearMonthDay $date[set date {}] 2361222] if { $parseTime ne {} } { dict set date secondOfDay $parseTime - } elseif { [llength $parseWeekday] != 0 - || [llength $parseOrdinalMonth] != 0 - || ( [llength $parseRel] != 0 + } elseif { [llength $parseWeekday] != 0 + || [llength $parseOrdinalMonth] != 0 + || ( [llength $parseRel] != 0 && ( [lindex $parseRel 0] != 0 || [lindex $parseRel 1] != 0 ) ) } { dict set date secondOfDay 0 @@ -1437,17 +1437,17 @@ proc ::tcl::clock::FreeScan { string base timezone locale } { set seconds [add $seconds \ $relMonth months $relDay days $relSecond seconds \ -timezone $timezone -locale $locale] - } + } # Do relative weekday - + if { [llength $parseWeekday] > 0 } { lassign $parseWeekday dayOrdinal dayOfWeek set date2 [GetDateFields $seconds $TZData($timezone) 2361222] dict set date2 era CE set jdwkday [WeekdayOnOrBefore $dayOfWeek \ - [expr { [dict get $date2 julianDay] + [expr { [dict get $date2 julianDay] + 6 }]] incr jdwkday [expr { 7 * $dayOrdinal }] if { $dayOrdinal > 0 } { @@ -1506,7 +1506,7 @@ proc ::tcl::clock::FreeScan { string base timezone locale } { # # Results: # Constructs and returns a procedure that accepts the -# string being scanned, the base time, and the time zone. +# string being scanned, the base time, and the time zone. # The procedure will either return the scanned time or # else throw an error that should be rethrown to the caller # of [clock scan] @@ -1776,7 +1776,7 @@ proc ::tcl::clock::ParseClockScanFormat {formatString locale} { append re \\s*\\d\\d? } V { # Week of ISO8601 year - + append re \\s*(\\d\\d?) dict set fieldSet iso8601Week [incr fieldCount] append postcode "dict set date iso8601Week \[" \ @@ -1948,7 +1948,7 @@ proc ::tcl::clock::ParseClockScanFormat {formatString locale} { "day of week is greater than 7" } dict set date dayOfWeek $dow - } + } } y { lassign [LocaleNumeralMatcher $locale] regex lookup @@ -1996,7 +1996,7 @@ proc ::tcl::clock::ParseClockScanFormat {formatString locale} { # Get time zone if needed - if { ![dict exists $fieldSet seconds] + if { ![dict exists $fieldSet seconds] && ![dict exists $fieldSet starDate] } { if { [dict exists $fieldSet tzName] } { append procBody { @@ -2018,7 +2018,7 @@ proc ::tcl::clock::ParseClockScanFormat {formatString locale} { # Assemble seconds, and convert local nominal time to UTC. - if { ![dict exists $fieldSet seconds] + if { ![dict exists $fieldSet seconds] && ![dict exists $fieldSet starDate] } { append procBody { if { [dict get $date julianDay] > 5373484 } { @@ -2047,7 +2047,7 @@ proc ::tcl::clock::ParseClockScanFormat {formatString locale} { return $procName } - + #---------------------------------------------------------------------- # # LocaleNumeralMatcher -- @@ -2087,7 +2087,7 @@ proc ::tcl::clock::LocaleNumeralMatcher {l} { } return [dict get $LocaleNumeralCache $l] } - + #---------------------------------------------------------------------- @@ -2128,7 +2128,7 @@ proc ::tcl::clock::UniquePrefixRegexp { data } { foreach { key value } $data { - # Construct all prefixes of the key; + # Construct all prefixes of the key; set prefix {} foreach char [split $key {}] { @@ -2191,7 +2191,7 @@ proc ::tcl::clock::UniquePrefixRegexp { data } { # #---------------------------------------------------------------------- -proc ::tcl::clock::MakeUniquePrefixRegexp { successors +proc ::tcl::clock::MakeUniquePrefixRegexp { successors uniquePrefixMapping prefixString } { @@ -2322,7 +2322,7 @@ proc ::tcl::clock::MakeParseCodeFromFields { dateFields parseActions } { set currPrio $prio set currFieldPos $fPos set currCodeBurst $parseAction - + } return $currCodeBurst @@ -2401,7 +2401,7 @@ proc ::tcl::clock::EnterLocale { locale oldLocaleVar } { dict set McLoaded $locale {} } -} +} #---------------------------------------------------------------------- # @@ -2565,7 +2565,7 @@ proc ::tcl::clock::LocalizeFormat { locale format } { # string. Note that the order of the [string map] operations is # significant because later formats can refer to later ones; for example # %c can refer to %X, which in turn can refer to %T. - + set list { %% %% %D %m/%d/%Y @@ -2582,7 +2582,7 @@ proc ::tcl::clock::LocalizeFormat { locale format } { lappend list %c [string map $list [mc DATE_TIME_FORMAT]] lappend list %Ec [string map $list [mc LOCALE_DATE_TIME_FORMAT]] set format [string map $list $format] - + dict set McLoaded $locale FORMAT $inFormat $format return $format } @@ -2790,7 +2790,7 @@ proc ::tcl::clock::ScanWide { str } { # #---------------------------------------------------------------------- -proc ::tcl::clock::InterpretTwoDigitYear { date baseTime +proc ::tcl::clock::InterpretTwoDigitYear { date baseTime { twoDigitField yearOfCentury } { fourDigitField year } } { @@ -2886,7 +2886,7 @@ proc ::tcl::clock::AssignBaseIso8601Year {date baseTime timeZone changeover} { # # AssignBaseMonth -- # -# Places the number of the current year and month into a +# Places the number of the current year and month into a # dictionary. # # Parameters: @@ -3191,10 +3191,10 @@ proc ::tcl::clock::SetupTimeZone { timezone } { set TZData($timezone) [list [list $MINWIDE $offset -1 $timezone]] } elseif { [string index $timezone 0] eq {:} } { - + # Convert using a time zone file - if { + if { [catch { LoadTimeZoneFile [string range $timezone 1 end] }] @@ -3206,9 +3206,9 @@ proc ::tcl::clock::SetupTimeZone { timezone } { -errorcode [list CLOCK badTimeZone $timezone] \ "time zone \"$timezone\" not found" } - + } elseif { ![catch {ParsePosixTimeZone $timezone} tzfields] } { - + # This looks like a POSIX time zone - try to process it if { [catch {ProcessPosixTimeZone $tzfields} data opts] } { @@ -3255,7 +3255,7 @@ proc ::tcl::clock::SetupTimeZone { timezone } { # no time zone information supplied with Windows actually uses # them! # -# On a Windows system where neither $env(TCL_TZ) nor $env(TZ) is +# On a Windows system where neither $env(TCL_TZ) nor $env(TZ) is # specified, GuessWindowsTimeZone looks in the Registry for the # system time zone information. It then attempts to find an entry # in WinZoneInfo for a time zone that uses the same rules. If @@ -3378,7 +3378,7 @@ proc ::tcl::clock::GuessWindowsTimeZone {} { : [::format %02d $stdSecond] } dict set WinZoneInfo $data $tzname - } + } return [dict get $WinZoneInfo $data] @@ -3533,10 +3533,10 @@ proc ::tcl::clock::ReadZoneinfoFile {fileName fname} { if {$version eq "2"} { set seek [expr {44 - + 5 * $nTime - + 6 * $nType + + 5 * $nTime + + 6 * $nType + 4 * $nLeap - + $nIsStd + + $nIsStd + $nIsGMT + $nChar }] @@ -3652,7 +3652,7 @@ proc ::tcl::clock::ReadZoneinfoFile {fileName fname} { # The following keys are present in the dictionary: # stdName - Name of the time zone when Daylight Saving Time # is not in effect. -# stdSignum - Sign (+, -, or empty) of the offset from Greenwich +# stdSignum - Sign (+, -, or empty) of the offset from Greenwich # to the given (non-DST) time zone. + and the empty # string denote zones west of Greenwich, - denotes east # of Greenwich; this is contrary to the ISO convention @@ -3697,7 +3697,7 @@ proc ::tcl::clock::ReadZoneinfoFile {fileName fname} { # endHours, endMinutes, endSeconds - # Specify the end of DST in the same way that the start* fields # specify the beginning of DST. -# +# # This procedure serves only to break the time specifier into fields. # No attempt is made to canonicalize the fields or supply default values. # @@ -3715,8 +3715,8 @@ proc ::tcl::clock::ParsePosixTimeZone { tz } { ([[:digit:]]{1,2}) (?: # 4 - Standard time zone offset, minutes - : ([[:digit:]]{1,2}) - (?: + : ([[:digit:]]{1,2}) + (?: # 5 - Standard time zone offset, seconds : ([[:digit:]]{1,2} ) )? @@ -3732,8 +3732,8 @@ proc ::tcl::clock::ParsePosixTimeZone { tz } { ([[:digit:]]{1,2}) (?: # 9 - DST time zone offset, minutes - : ([[:digit:]]{1,2}) - (?: + : ([[:digit:]]{1,2}) + (?: # 10 - DST time zone offset, seconds : ([[:digit:]]{1,2}) )? @@ -3746,8 +3746,8 @@ proc ::tcl::clock::ParsePosixTimeZone { tz } { ( J ? ) ( [[:digit:]]+ ) | M # 13 - Month number 14 - Week of month 15 - Day of week - ( [[:digit:]] + ) - [.] ( [[:digit:]] + ) + ( [[:digit:]] + ) + [.] ( [[:digit:]] + ) [.] ( [[:digit:]] + ) ) (?: @@ -3768,8 +3768,8 @@ proc ::tcl::clock::ParsePosixTimeZone { tz } { ( J ? ) ( [[:digit:]]+ ) | M # 21 - Month number 22 - Week of month 23 - Day of week - ( [[:digit:]] + ) - [.] ( [[:digit:]] + ) + ( [[:digit:]] + ) + [.] ( [[:digit:]] + ) [.] ( [[:digit:]] + ) ) (?: @@ -3845,14 +3845,14 @@ proc ::tcl::clock::ProcessPosixTimeZone { z } { } else { set stdSignum -1 } - set stdHours [lindex [::scan [dict get $z stdHours] %d] 0] + set stdHours [lindex [::scan [dict get $z stdHours] %d] 0] if { [dict get $z stdMinutes] ne {} } { - set stdMinutes [lindex [::scan [dict get $z stdMinutes] %d] 0] + set stdMinutes [lindex [::scan [dict get $z stdMinutes] %d] 0] } else { set stdMinutes 0 } if { [dict get $z stdSeconds] ne {} } { - set stdSeconds [lindex [::scan [dict get $z stdSeconds] %d] 0] + set stdSeconds [lindex [::scan [dict get $z stdSeconds] %d] 0] } else { set stdSeconds 0 } @@ -3881,14 +3881,14 @@ proc ::tcl::clock::ProcessPosixTimeZone { z } { if { [dict get $z dstHours] eq {} } { set dstOffset [expr { 3600 + $stdOffset }] } else { - set dstHours [lindex [::scan [dict get $z dstHours] %d] 0] + set dstHours [lindex [::scan [dict get $z dstHours] %d] 0] if { [dict get $z dstMinutes] ne {} } { - set dstMinutes [lindex [::scan [dict get $z dstMinutes] %d] 0] + set dstMinutes [lindex [::scan [dict get $z dstMinutes] %d] 0] } else { set dstMinutes 0 } if { [dict get $z dstSeconds] ne {} } { - set dstSeconds [lindex [::scan [dict get $z dstSeconds] %d] 0] + set dstSeconds [lindex [::scan [dict get $z dstSeconds] %d] 0] } else { set dstSeconds 0 } @@ -3903,7 +3903,7 @@ proc ::tcl::clock::ProcessPosixTimeZone { z } { # US end time is the first Sunday in November. # EU end time is the last Sunday in October - if { [dict get $z startDayOfYear] eq {} + if { [dict get $z startDayOfYear] eq {} && [dict get $z startMonth] eq {} } { if {($stdSignum * $stdHours>=0) && ($stdSignum * $stdHours<=12)} { # EU @@ -3923,7 +3923,7 @@ proc ::tcl::clock::ProcessPosixTimeZone { z } { dict set z startMinutes 0 dict set z startSeconds 0 } - if { [dict get $z endDayOfYear] eq {} + if { [dict get $z endDayOfYear] eq {} && [dict get $z endMonth] eq {} } { if {($stdSignum * $stdHours>=0) && ($stdSignum * $stdHours<=12)} { # EU @@ -3964,8 +3964,8 @@ proc ::tcl::clock::ProcessPosixTimeZone { z } { } return $data - -} + +} #---------------------------------------------------------------------- # @@ -4000,7 +4000,7 @@ proc ::tcl::clock::DeterminePosixDSTTime { z bound y } { # Time was specified as a day of the year if { [dict get $z ${bound}J] ne {} - && [IsGregorianLeapYear $y] + && [IsGregorianLeapYear $y] && ( $doy > $FEB_28 ) } { incr doy } @@ -4078,7 +4078,7 @@ proc ::tcl::clock::GetLocaleEra { date etable } { [expr { [dict get $date year] % 100 }] } else { dict set date localeEra [lindex $etable $index 1] - dict set date localeYear [expr { [dict get $date year] + dict set date localeYear [expr { [dict get $date year] - [lindex $etable $index 2] }] } return $date @@ -4136,7 +4136,7 @@ proc ::tcl::clock::GetJulianDayFromEraYearDay {date changeover} { + ( $ym1 / 4 ) - ( $ym1 / 100 ) + ( $ym1 / 400 ) }] - + # If the date is before the Gregorian change, use the Julian calendar. if { $jd < $changeover } { @@ -4219,7 +4219,7 @@ proc ::tcl::clock::GetJulianDayFromEraYearMonthWeekDay {date changeover} { proc ::tcl::clock::IsGregorianLeapYear { date } { switch -exact -- [dict get $date era] { - BCE { + BCE { set year [expr { 1 - [dict get $date year]}] } CE { @@ -4415,7 +4415,7 @@ proc ::tcl::clock::add { clockval args } { } if { [catch { expr { wide($clockval) } } result] } { return -code error \ - "expected integer but got \"$clockval\"" + "expected integer but got \"$clockval\"" } if { ![string is boolean $gmt] } { return -code error \ @@ -4427,7 +4427,7 @@ proc ::tcl::clock::add { clockval args } { } EnterLocale $locale oldLocale - + set changeover [mc GREGORIAN_CHANGE_DATE] if {[catch {SetupTimeZone $timezone} retval opts]} { diff --git a/library/init.tcl b/library/init.tcl index 4981cd6..62729e6 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -12,7 +12,7 @@ # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# This test intentionally written in pre-7.5 Tcl +# This test intentionally written in pre-7.5 Tcl if {[info commands package] == ""} { error "version mismatch: library\nscripts expect Tcl version 7.5b1 or later but the loaded version is\nonly [info patchlevel]" } @@ -346,7 +346,7 @@ proc unknown args { } } - if {([info level] == 1) && ([info script] eq "") + if {([info level] == 1) && ([info script] eq "") && [info exists tcl_interactive] && $tcl_interactive} { if {![info exists auto_noexec]} { set new [auto_execok $name] @@ -649,12 +649,8 @@ proc auto_execok name { } set auto_execs($name) "" - set shellBuiltins [list cls copy date del erase dir echo mkdir \ - md rename ren rmdir rd time type ver vol] - if {$tcl_platform(os) eq "Windows NT"} { - # NT includes the 'start' built-in - lappend shellBuiltins "start" - } + set shellBuiltins [list cls copy date del dir echo erase md mkdir \ + mklink rd ren rename rmdir start time type ver vol] if {[info exists env(PATHEXT)]} { # Add an initial ; to have the {} extension check first. set execExtensions [split ";$env(PATHEXT)" ";"] diff --git a/library/package.tcl b/library/package.tcl index 06f619c..3783722 100644 --- a/library/package.tcl +++ b/library/package.tcl @@ -40,7 +40,7 @@ proc tcl::Pkg::CompareExtension { fileName {ext {}} } { set currExt [file extension $root] if {$currExt eq $ext} { return 1 - } + } # The current extension does not match; if it is not a numeric # value, quit, as we are only looking to ignore version number @@ -289,22 +289,22 @@ proc pkg_mkIndex {args} { set ::tcl::type source } - # As a performance optimization, if we are creating - # direct load packages, don't bother figuring out the - # set of commands created by the new packages. We - # only need that list for setting up the autoloading + # As a performance optimization, if we are creating + # direct load packages, don't bother figuring out the + # set of commands created by the new packages. We + # only need that list for setting up the autoloading # used in the non-direct case. if { !$::tcl::direct } { # See what new namespaces appeared, and import commands # from them. Only exported commands go into the index. - + foreach ::tcl::x [::tcl::GetAllNamespaces] { if {! [info exists ::tcl::namespaces($::tcl::x)]} { namespace import -force ${::tcl::x}::* } # Figure out what commands appeared - + foreach ::tcl::x [info commands] { set ::tcl::newCmds($::tcl::x) 1 } @@ -313,18 +313,18 @@ proc pkg_mkIndex {args} { } foreach ::tcl::x [array names ::tcl::newCmds] { # determine which namespace a command comes from - + set ::tcl::abs [namespace origin $::tcl::x] - + # special case so that global names have no leading # ::, this is required by the unknown command - + set ::tcl::abs \ [lindex [auto_qualify $::tcl::abs ::] 0] - + if {$::tcl::x ne $::tcl::abs} { # Name changed during qualification - + set ::tcl::newCmds($::tcl::abs) 1 unset ::tcl::newCmds($::tcl::x) } @@ -437,7 +437,7 @@ proc tclPkgSetup {dir pkg version files} { set auto_index($cmd) [list load [file join $dir $f] $pkg] } else { set auto_index($cmd) [list source [file join $dir $f]] - } + } } } } @@ -466,7 +466,7 @@ proc tclPkgUnknown {name args} { set old_path [set use_path $auto_path] while {[llength $use_path]} { set dir [lindex $use_path end] - + # Make sure we only scan each directory one time. if {[info exists tclSeenPath($dir)]} { set use_path [lrange $use_path 0 end-1] @@ -500,7 +500,7 @@ proc tclPkgUnknown {name args} { set dir [lindex $use_path end] if {![info exists procdDirs($dir)]} { set file [file join $dir pkgIndex.tcl] - # safe interps usually don't have "file exists", + # safe interps usually don't have "file exists", if {([interp issafe] || [file exists $file])} { set code [catch {source $file} msg opt] if {$code == 1 && @@ -653,11 +653,11 @@ proc tcl::MacOSXPkgUnknown {original name args} { # # Any number of -load and -source parameters may be # specified, so long as there is at least one -load or -# -source parameter. If the procs component of a +# -source parameter. If the procs component of a # module specifier is left off, that module will be # set up for direct loading; otherwise, it will be # set up for lazy loading. If both -source and -load -# are specified, the -load'ed files will be loaded +# are specified, the -load'ed files will be loaded # first, followed by the -source'd files. # # Results: @@ -679,7 +679,7 @@ proc ::tcl::Pkg::Create {args} { if { $len < 6 } { error $err(wrongNumArgs) } - + # Initialize parameters array set opts {-name {} -version {} -source {} -load {}} @@ -715,14 +715,14 @@ proc ::tcl::Pkg::Create {args} { if { [llength $opts(-version)] == 0 } { error [format $err(valueMissing) "-version"] } - + if { [llength $opts(-source)] == 0 && [llength $opts(-load)] == 0 } { error $err(noLoadOrSource) } # OK, now everything is good. Generate the package ifneeded statment. set cmdline "package ifneeded $opts(-name) $opts(-version) " - + set cmdList {} set lazyFileList {} @@ -730,7 +730,7 @@ proc ::tcl::Pkg::Create {args} { foreach key {load source} { foreach filespec $opts(-$key) { lassign $filespec filename proclist - + if { [llength $proclist] == 0 } { set cmd "\[list $key \[file join \$dir [list $filename]\]\]" lappend cmdList $cmd @@ -748,4 +748,4 @@ proc ::tcl::Pkg::Create {args} { return $cmdline } -interp alias {} ::pkg::create {} ::tcl::Pkg::Create +interp alias {} ::pkg::create {} ::tcl::Pkg::Create diff --git a/library/platform/platform.tcl b/library/platform/platform.tcl index d510541..8dd91ee 100644 --- a/library/platform/platform.tcl +++ b/library/platform/platform.tcl @@ -331,7 +331,7 @@ proc ::platform::patterns {id} { lappend res macosx-universal macosx-i386-x86_64 } macosx*-* { - # 10.5+ + # 10.5+ if {[regexp {macosx([^-]*)-(.*)} $id -> v cpu]} { switch -exact -- $cpu { diff --git a/library/safe.tcl b/library/safe.tcl index 1a340a1..2dd4aed 100644 --- a/library/safe.tcl +++ b/library/safe.tcl @@ -4,7 +4,7 @@ # It implements a virtual path mecanism to hide the real pathnames from the # slave. It runs in a master interpreter and sets up data structure and # aliases that will be invoked when used from a slave interpreter. -# +# # See the safe.n man page for details. # # Copyright (c) 1996-1997 Sun Microsystems, Inc. @@ -36,7 +36,7 @@ proc ::safe::InterpStatics {} { upvar $v $v } set flag [::tcl::OptProcArgGiven -noStatics] - if {$flag && (!$noStatics == !$statics) + if {$flag && (!$noStatics == !$statics) && ([::tcl::OptProcArgGiven -statics])} { return -code error\ "conflicting values given for -statics and -noStatics" @@ -57,7 +57,7 @@ proc ::safe::InterpNested {} { set flag [::tcl::OptProcArgGiven -nestedLoadOk] # note that the test here is the opposite of the "InterpStatics" one # (it is not -noNested... because of the wanted default value) - if {$flag && (!$nestedLoadOk != !$nested) + if {$flag && (!$nestedLoadOk != !$nested) && ([::tcl::OptProcArgGiven -nested])} { return -code error\ "conflicting values given for -nested and -nestedLoadOk" @@ -238,7 +238,7 @@ proc ::safe::interpConfigure {args} { # # Returns the slave name. # -# Optional Arguments : +# Optional Arguments : # + slave name : if empty, generated name will be used # + access_path: path list controlling where load/source can occur, # if empty: the master auto_path will be used. @@ -249,7 +249,7 @@ proc ::safe::interpConfigure {args} { # use the full name and no indent so auto_mkIndex can find us proc ::safe::InterpCreate { - slave + slave access_path staticsok nestedok @@ -424,7 +424,7 @@ proc ::safe::interpAddToAccessPath {slave path} { # interpreter. It is useful when you want to install the safe base aliases # into a preexisting safe interpreter. proc ::safe::InterpInit { - slave + slave access_path staticsok nestedok @@ -563,7 +563,7 @@ proc ::safe::interpDelete {slave} { return } -# Set (or get) the logging mecanism +# Set (or get) the logging mecanism proc ::safe::setLogCmd {args} { variable Log @@ -823,7 +823,7 @@ proc ::safe::AliasSource {slave args} { return -code error $msg } set file [lindex $args $at] - + # get the real path from the virtual one. if {[catch { set realfile [TranslatePath $slave $file] @@ -831,7 +831,7 @@ proc ::safe::AliasSource {slave args} { Log $slave $msg return -code error "permission denied" } - + # check that the path is in the access path of that slave if {[catch { FileInAccessPath $slave $realfile diff --git a/library/tm.tcl b/library/tm.tcl index 7b9cafe..87db0df 100644 --- a/library/tm.tcl +++ b/library/tm.tcl @@ -191,7 +191,7 @@ proc ::tcl::tm::list {} { proc ::tcl::tm::UnknownHandler {original name args} { # Import the list of paths to search for packages in module form. - # Import the pattern used to check package names in detail. + # Import the pattern used to check package names in detail. variable paths variable pkgpattern -- cgit v0.12 From 48e066711f2f019314605b45c4b136118d9c1b45 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 30 Sep 2015 13:44:52 +0000 Subject: Mutch simpler solution to [219866c1e9]: In stead of filtering out version information from the string, make sure that ::platform::generic doesn't contain this version information in the first place. --- library/platform/platform.tcl | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/library/platform/platform.tcl b/library/platform/platform.tcl index 8dd91ee..c596e60 100644 --- a/library/platform/platform.tcl +++ b/library/platform/platform.tcl @@ -93,10 +93,13 @@ proc ::platform::generic {} { } } - switch -- $plat { + switch -glob -- $plat { + cygwin* { + set plat cygwin + } windows { if {$tcl_platform(platform) == "unix"} { - set plat cygwin_nt + set plat cygwin } else { set plat win32 } @@ -104,7 +107,6 @@ proc ::platform::generic {} { # Do not check wordSize, win32-x64 is an IL32P64 platform. set cpu x86_64 } - append plat -$tcl_platform(osVersion) } sunos { set plat solaris @@ -163,12 +165,9 @@ proc ::platform::identify {} { global tcl_platform set id [generic] - regexp {^([^-]+)(-[0-9\.]+)?(-wow)?-([^-]+)$} $id -> plat ver wow cpu + regexp {^([^-]+)-([^-]+)$} $id -> plat ver wow cpu switch -- $plat { - cygwin_nt { - return "${plat}-${cpu}" - } solaris { regsub {^5} $tcl_platform(osVersion) 2 text append plat $text -- cgit v0.12 From 03a3a2d78e1c26683170d32685d3f4d3b9ed902d Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 1 Oct 2015 11:04:19 +0000 Subject: Eliminate a few gcc compiler warnings, when using -Wwrite-strings (tested with the brand-new gcc 5.2.0) --- generic/tclCmdAH.c | 8 ++++---- generic/tclCmdMZ.c | 6 ++++-- generic/tclExecute.c | 30 +++++++++++++++--------------- generic/tclLiteral.c | 11 ++++++----- generic/tclObj.c | 42 +++++++++++++++++++++--------------------- generic/tclTest.c | 6 +++--- unix/tclUnixChan.c | 10 +++++----- unix/tclUnixNotfy.c | 2 +- unix/tclUnixTest.c | 2 +- 9 files changed, 60 insertions(+), 57 deletions(-) diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index 7f0df83..5484002 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -25,7 +25,7 @@ static int EncodingDirsObjCmd(ClientData dummy, Tcl_Obj *const objv[]); static int GetStatBuf(Tcl_Interp *interp, Tcl_Obj *pathPtr, Tcl_FSStatProc *statProc, Tcl_StatBuf *statPtr); -static char * GetTypeFromMode(int mode); +static const char * GetTypeFromMode(int mode); static int StoreStatData(Tcl_Interp *interp, Tcl_Obj *varName, Tcl_StatBuf *statPtr); @@ -1289,7 +1289,7 @@ Tcl_FileObjCmd( return TCL_ERROR; } if (objc == 2) { - char *separator = NULL; /* lint */ + const char *separator = NULL; /* lint */ switch (tclPlatform) { case TCL_PLATFORM_UNIX: @@ -1554,7 +1554,7 @@ StoreStatData( *---------------------------------------------------------------------- */ -static char * +static const char * GetTypeFromMode( int mode) { @@ -1757,7 +1757,7 @@ Tcl_ForeachObjCmd( maxj = 0; for (i=0 ; imarkerPtr = tmpMarkerPtr; - memStart = tmpMarkerPtr + offset; + memStart = tmpMarkerPtr + offset; esPtr->tosPtr = memStart - 1; *esPtr->markerPtr = (Tcl_Obj *) markerPtr; return memStart; @@ -982,7 +982,7 @@ GrowEvaluationStack( esPtr->markerPtr = &esPtr->stackWords[0]; memStart = MEMSTART(esPtr->markerPtr); esPtr->tosPtr = memStart - 1; - + if (move) { memcpy(memStart, MEMSTART(markerPtr), moveWords*sizeof(Tcl_Obj *)); esPtr->tosPtr += moveWords; @@ -1486,19 +1486,19 @@ TclCompEvalObj( * Note: Type BC => ctx.data.eval.path is not used. * ctx.data.tebc.codePtr used instead */ - + TclGetSrcInfoForPc(ctxPtr); if (ctxPtr->type == TCL_LOCATION_SOURCE) { /* * The reference made by 'TclGetSrcInfoForPc' is * dead. */ - + Tcl_DecrRefCount(ctxPtr->data.eval.path); ctxPtr->data.eval.path = NULL; } } - + if (word < ctxPtr->nline) { /* * Note: We do not care if the line[word] is -1. This @@ -1510,15 +1510,15 @@ TclCompEvalObj( * test info-32.0 using literal of info-24.8 * (dict with ... vs set body ...). */ - + redo = ((eclPtr->type == TCL_LOCATION_SOURCE) && (eclPtr->start != ctxPtr->line[word])) || ((eclPtr->type == TCL_LOCATION_BC) && (ctxPtr->type == TCL_LOCATION_SOURCE)); } - + TclStackFree(interp, ctxPtr); - + if (redo) { goto recompileObj; } @@ -1778,7 +1778,7 @@ TclExecuteByteCode( int traceInstructions = (tclTraceExec == 3); char cmdNameBuf[21]; #endif - char *curInstName = NULL; + const char *curInstName = NULL; /* * The execution uses a unified stack: first the catch stack, immediately @@ -5802,9 +5802,9 @@ TclExecuteByteCode( /* * 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 + * 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 + * long int type. This means any numeric Tcl_Obj value * not using TCL_NUMBER_LONG type must hold a value larger * than we accept. */ diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c index 6a617b0..fb7c28a 100644 --- a/generic/tclLiteral.c +++ b/generic/tclLiteral.c @@ -153,7 +153,7 @@ TclDeleteLiteralTable( * Find, or if necessary create, an object in the interpreter's literal * table that has a string representation matching the argument * string. If nsPtr!=NULL then only literals stored for the namespace are - * considered. + * considered. * * Results: * The literal object. If it was created in this call *newPtr is set to @@ -161,7 +161,7 @@ TclDeleteLiteralTable( * * Side effects: * Increments the ref count of the global LiteralEntry since the caller - * now holds a reference. + * now holds a reference. * If LITERAL_ON_HEAP is set in flags, this function is given ownership * of the string: if an object is created then its string representation * is set directly from string, otherwise the string is freed. Typically, @@ -186,7 +186,7 @@ TclCreateLiteral( LiteralEntry *globalPtr; int globalHash; Tcl_Obj *objPtr; - + /* * Is it in the interpreter's global literal table? */ @@ -709,7 +709,7 @@ ExpandLocalLiteralArray( if (currArrayPtr != newArrayPtr) { for (i=0 ; inumBuckets; oldBuckets = tablePtr->buckets; diff --git a/generic/tclObj.c b/generic/tclObj.c index d278b1f..230842a 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -569,7 +569,7 @@ TclContinuationsEnter(Tcl_Obj* objPtr, Tcl_HashEntry* hPtr = Tcl_CreateHashEntry (tsdPtr->lineCLPtr, (char*) objPtr, &newEntry); - ContLineLoc* clLocPtr = + ContLineLoc* clLocPtr = (ContLineLoc*) ckalloc (sizeof(ContLineLoc) + num*sizeof(int)); if (!newEntry) { @@ -675,7 +675,7 @@ TclContinuationsEnterDerived(Tcl_Obj* objPtr, int start, int* clNext) num = wordCLLast - clNext; if (num) { int i; - ContLineLoc* clLocPtr = + ContLineLoc* clLocPtr = TclContinuationsEnter(objPtr, num, clNext); /* @@ -1371,10 +1371,10 @@ TclFreeObj( */ objPtr->refCount = -1; - /* Invalidate the string rep first so we can use the bytes value + /* Invalidate the string rep first so we can use the bytes value * for our pointer chain, and signal an obj deletion (as opposed - * to shimmering) with 'length == -1' */ - + * to shimmering) with 'length == -1' */ + TclInvalidateStringRep(objPtr); objPtr->length = -1; @@ -1436,13 +1436,13 @@ void TclFreeObj( register Tcl_Obj *objPtr) /* The object to be freed. */ { - /* Invalidate the string rep first so we can use the bytes value + /* Invalidate the string rep first so we can use the bytes value * for our pointer chain, and signal an obj deletion (as opposed - * to shimmering) with 'length == -1' */ + * to shimmering) with 'length == -1' */ TclInvalidateStringRep(objPtr); objPtr->length = -1; - + if (!objPtr->typePtr || !objPtr->typePtr->freeIntRepProc) { /* * objPtr can be freed safely, as it will not attempt to free any @@ -2799,7 +2799,7 @@ Tcl_GetLongFromObj( tooLarge: #endif if (interp != NULL) { - char *s = "integer value too large to represent"; + const char *s = "integer value too large to represent"; Tcl_Obj *msg = Tcl_NewStringObj(s, -1); Tcl_SetObjResult(interp, msg); @@ -3098,7 +3098,7 @@ Tcl_GetWideIntFromObj( } } if (interp != NULL) { - char *s = "integer value too large to represent"; + const char *s = "integer value too large to represent"; Tcl_Obj* msg = Tcl_NewStringObj(s, -1); Tcl_SetObjResult(interp, msg); @@ -4084,7 +4084,7 @@ Tcl_GetCommandFromObj( * is not deleted. * * If any check fails, then force another conversion to the command type, - * to discard the old rep and create a new one. + * to discard the old rep and create a new one. */ resPtr = (ResolvedCmdName *) objPtr->internalRep.twoPtrValue.ptr1; @@ -4094,15 +4094,15 @@ Tcl_GetCommandFromObj( || (cmdPtr->flags & CMD_IS_DELETED) || (interp != cmdPtr->nsPtr->interp) || (cmdPtr->nsPtr->flags & NS_DYING) - || ((resPtr->refNsPtr != NULL) && + || ((resPtr->refNsPtr != NULL) && (((refNsPtr = (Namespace *) TclGetCurrentNamespace(interp)) != resPtr->refNsPtr) || (resPtr->refNsId != refNsPtr->nsId) || (resPtr->refNsCmdEpoch != refNsPtr->cmdRefEpoch))) ) { - + result = tclCmdNameType.setFromAnyProc(interp, objPtr); - + resPtr = (ResolvedCmdName *) objPtr->internalRep.twoPtrValue.ptr1; if ((result == TCL_OK) && resPtr) { cmdPtr = resPtr->cmdPtr; @@ -4110,7 +4110,7 @@ Tcl_GetCommandFromObj( cmdPtr = NULL; } } - + return (Tcl_Command) cmdPtr; } @@ -4162,7 +4162,7 @@ TclSetCmdNameObj( if ((*name++ == ':') && (*name == ':')) { /* * The name is fully qualified: set the referring namespace to - * NULL. + * NULL. */ resPtr->refNsPtr = NULL; @@ -4172,7 +4172,7 @@ TclSetCmdNameObj( */ currNsPtr = iPtr->varFramePtr->nsPtr; - + resPtr->refNsPtr = currNsPtr; resPtr->refNsId = currNsPtr->nsId; resPtr->refNsCmdEpoch = currNsPtr->cmdRefEpoch; @@ -4332,7 +4332,7 @@ SetCmdNameFromAny( /* * Reuse the old ResolvedCmdName struct instead of freeing it */ - + Command *oldCmdPtr = resPtr->cmdPtr; if (--oldCmdPtr->refCount == 0) { TclCleanupCommandMacro(oldCmdPtr); @@ -4349,8 +4349,8 @@ SetCmdNameFromAny( resPtr->cmdEpoch = cmdPtr->cmdEpoch; if ((*name++ == ':') && (*name == ':')) { /* - * The name is fully qualified: set the referring namespace to - * NULL. + * The name is fully qualified: set the referring namespace to + * NULL. */ resPtr->refNsPtr = NULL; @@ -4360,7 +4360,7 @@ SetCmdNameFromAny( */ currNsPtr = iPtr->varFramePtr->nsPtr; - + resPtr->refNsPtr = currNsPtr; resPtr->refNsId = currNsPtr->nsId; resPtr->refNsCmdEpoch = currNsPtr->cmdRefEpoch; diff --git a/generic/tclTest.c b/generic/tclTest.c index 5b51baa..1d92ff5 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -909,7 +909,7 @@ TestasyncCmd( static int AsyncHandlerProc( - ClientData clientData, /* If of TestAsyncHandler structure. + ClientData clientData, /* If of TestAsyncHandler structure. * in global list. */ Tcl_Interp *interp, /* Interpreter in which command was * executed, or NULL. */ @@ -3606,7 +3606,7 @@ PrintParse( Tcl_Parse *parsePtr) /* Parse structure to print out. */ { Tcl_Obj *objPtr; - char *typeString; + const char *typeString; Tcl_Token *tokenPtr; int i; @@ -6518,7 +6518,7 @@ TestGetIndexFromObjStructObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - char *ary[] = { + const char *ary[] = { "a", "b", "c", "d", "e", "f", NULL, NULL }; int idx,target; diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c index a0d9811..8448b77 100644 --- a/unix/tclUnixChan.c +++ b/unix/tclUnixChan.c @@ -2181,7 +2181,7 @@ TcpGetOptionProc( * We don't want to resolve INADDR_ANY; it can sometimes cause * problems (and never has a name). */ - + hostEntPtr = NULL; } else { hostEntPtr = TclpGetHostByAddr( /* INTL: Native. */ @@ -2292,7 +2292,7 @@ TcpWatchProc( * to the guarantees Tcl makes that its channels become * writable and fire writable events on an error conditon. * This has caused a leak of file descriptors in a state of - * background flushing. See Tcl ticket 1758a0b603. + * background flushing. See Tcl ticket 1758a0b603. * * As a workaround, when our caller indicates an interest in * writable notifications, we must tell the notifier built @@ -2303,7 +2303,7 @@ TcpWatchProc( * channel states and report the chan events as best it can. * We save a copy of the mask passed in to assist with that. */ - + statePtr->interest = mask; Tcl_CreateFileHandler(statePtr->fd, mask|TCL_READABLE, (Tcl_FileProc *) WrapNotify, (ClientData) statePtr); @@ -2927,7 +2927,7 @@ TclpGetDefaultStdChannel( Tcl_Channel channel = NULL; int fd = 0; /* Initializations needed to prevent */ int mode = 0; /* compiler warning (used before set). */ - char *bufMode = NULL; + const char *bufMode = NULL; /* * Some #def's to make the code a little clearer! @@ -3216,7 +3216,7 @@ TclUnixWaitForFile( if (FD_ISSET(fd, &writableMask)) { SET_BITS(result, TCL_WRITABLE); } - if (FD_ISSET(fd, &exceptionalMask)) { + if (FD_ISSET(fd, &exceptionalMask)) { SET_BITS(result, TCL_EXCEPTION); } result &= mask; diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c index 5c7f8b5..2df704b 100644 --- a/unix/tclUnixNotfy.c +++ b/unix/tclUnixNotfy.c @@ -238,7 +238,7 @@ typedef struct { void *hCursor; void *hbrBackground; void *lpszMenuName; - void *lpszClassName; + const void *lpszClassName; } WNDCLASS; extern void __stdcall CloseHandle(void *); diff --git a/unix/tclUnixTest.c b/unix/tclUnixTest.c index 0747c2d..722ded9 100644 --- a/unix/tclUnixTest.c +++ b/unix/tclUnixTest.c @@ -53,7 +53,7 @@ static Pipe testPipes[MAX_PIPES]; * The stuff below is used by the testalarm and testgotsig ommands. */ -static char *gotsig = "0"; +static const char *gotsig = "0"; /* * Forward declarations of functions defined later in this file: -- cgit v0.12 From 5cfe99ddfef51d700eee80c9f766fab9c458038e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 4 Oct 2015 10:10:58 +0000 Subject: Eliminate unnessessary end-of-line spacing. No functional change. --- generic/tclCompCmds.c | 4 +- generic/tclDictObj.c | 2 +- generic/tclEvent.c | 2 +- generic/tclFCmd.c | 2 +- generic/tclHistory.c | 8 +- generic/tclParse.c | 2 +- generic/tclStrToD.c | 198 ++++++++++++++++++++++----------------------- generic/tclStringObj.c | 4 +- generic/tclThreadStorage.c | 12 +-- generic/tclUtil.c | 50 ++++++------ unix/tclUnixNotfy.c | 2 +- 11 files changed, 143 insertions(+), 143 deletions(-) diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index 106c293..3b234b0 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.c @@ -5913,7 +5913,7 @@ TclCompileGlobalCmd( return TCL_ERROR; } - /* TODO: Consider what values can pass through the + /* TODO: Consider what values can pass through the * IndexTailVarIfKnown() screen. Full CompileWord() * likely does not apply here. Push known value instead. */ CompileWord(envPtr, varTokenPtr, interp, i); @@ -5988,7 +5988,7 @@ TclCompileVariableCmd( return TCL_ERROR; } - /* TODO: Consider what values can pass through the + /* TODO: Consider what values can pass through the * IndexTailVarIfKnown() screen. Full CompileWord() * likely does not apply here. Push known value instead. */ CompileWord(envPtr, varTokenPtr, interp, i); diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c index 4adc5ce..4fec2c1 100644 --- a/generic/tclDictObj.c +++ b/generic/tclDictObj.c @@ -593,7 +593,7 @@ SetDictFromAny( } for (i=0 ; itype = TCL_TOKEN_SIMPLE_WORD; tokenPtr->numComponents = 1; diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c index ec5e764..cff9bdd 100644 --- a/generic/tclStrToD.c +++ b/generic/tclStrToD.c @@ -64,7 +64,7 @@ typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__HI__))); /* * MIPS floating-point units need special settings in control registers * to use gradual underflow as we expect. This fix is for the MIPSpro - * compiler. + * compiler. */ #if defined(__sgi) && defined(_COMPILER_VERSION) #include @@ -102,7 +102,7 @@ typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__HI__))); /* Mask for the exponent field in the * first word of a double */ #define EXP_SHIFT 20 - /* Shift count to make the exponent an + /* Shift count to make the exponent an * integer */ #define HIDDEN_BIT (((Tcl_WideUInt) 0x00100000) << 32) /* Hidden 1 bit for the significand */ @@ -263,7 +263,7 @@ static const Tcl_WideUInt wuipow5[27] = { * Static functions defined in this file. */ -static int AccumulateDecimalDigit(unsigned, int, +static int AccumulateDecimalDigit(unsigned, int, Tcl_WideUInt *, mp_int *, int); static double MakeHighPrecisionDouble(int signum, mp_int *significand, int nSigDigs, int exponent); @@ -286,7 +286,7 @@ static void ComputeScale(int, int, int*, int*, int*, int*); static void SetPrecisionLimits(int, int, int*, int*, int*, int*); static char* BumpUp(char*, char*, int*); static int AdjustRange(double*, int); -static char* ShorteningQuickFormat(double, int, int, double, +static char* ShorteningQuickFormat(double, int, int, double, char*, int*); static char* StrictQuickFormat(double, int, int, double, char*, int*); @@ -302,15 +302,15 @@ static char* StrictInt64Conversion(Double*, int, Tcl_WideUInt, static int ShouldBankerRoundUpPowD(mp_int*, int, int); static int ShouldBankerRoundUpToNextPowD(mp_int*, mp_int*, int, int, int, mp_int*); -static char* ShorteningBignumConversionPowD(Double* dPtr, +static char* ShorteningBignumConversionPowD(Double* dPtr, int convType, Tcl_WideUInt bw, int b2, int b5, int m2plus, int m2minus, int m5, - int sd, int k, int len, + int sd, int k, int len, int ilim, int ilim1, int* decpt, char** endPtr); static char* StrictBignumConversionPowD(Double* dPtr, int convType, Tcl_WideUInt bw, int b2, int b5, - int sd, int k, int len, + int sd, int k, int len, int ilim, int ilim1, int* decpt, char** endPtr); static int ShouldBankerRoundUp(mp_int*, mp_int*, int); @@ -319,12 +319,12 @@ static int ShouldBankerRoundUpToNext(mp_int*, mp_int*, mp_int*, static char* ShorteningBignumConversion(Double* dPtr, int convType, Tcl_WideUInt bw, int b2, int m2plus, int m2minus, - int s2, int s5, int k, int len, + int s2, int s5, int k, int len, int ilim, int ilim1, int* decpt, char** endPtr); static char* StrictBignumConversion(Double* dPtr, int convType, Tcl_WideUInt bw, int b2, - int s2, int s5, int k, int len, + int s2, int s5, int k, int len, int ilim, int ilim1, int* decpt, char** endPtr); static double BignumToBiasedFrExp(mp_int *big, int *machexp); @@ -1905,7 +1905,7 @@ RefineApproximation( if ((rteSigWide & 1) == 0) { return approxResult; } - } + } /* * Convert the numerator and denominator of the corrector term accurately @@ -1994,7 +1994,7 @@ NormalizeRightward(Tcl_WideUInt* wPtr) Tcl_WideUInt w = *wPtr; if (!(w & (Tcl_WideUInt) 0xffffffff)) { w >>= 32; rv += 32; - } + } if (!(w & (Tcl_WideUInt) 0xffff)) { w >>= 16; rv += 16; } @@ -2145,7 +2145,7 @@ TakeAbsoluteValue(Double* d, /* Number to replace with absolute value */ * * Side effects: * Stores 9999 in *decpt, and sets '*endPtr' to designate the - * terminating NUL byte of the string if 'endPtr' is not NULL. + * terminating NUL byte of the string if 'endPtr' is not NULL. * * The string returned must be freed by the caller using 'ckfree'. * @@ -2233,8 +2233,8 @@ ApproximateLog10(Tcl_WideUInt bw, /* * Compute i and d2 such that d = d2*2**i, and 1 < d2 < 2. - * Compute an approximation to log10(d), - * log10(d) ~ log10(2) * i + log10(1.5) + * Compute an approximation to log10(d), + * log10(d) ~ log10(2) * i + log10(1.5) * + (significand-1.5)/(1.5 * log(10)) */ @@ -2274,7 +2274,7 @@ BetterLog10(double d, /* Original number to format */ int k, /* Characteristic(Log base 10) of the number */ int* k_check) /* Flag == 1 if k is inexact */ { - /* + /* * Performance hack. If k is in the range 0..TEN_PMAX, then we can * use a powers-of-ten table to check it. */ @@ -2318,7 +2318,7 @@ ComputeScale(int be, /* Exponent part of number: d = bw * 2**be */ int* s5) /* OUTPUT: Power of 5 in the denominator */ { - /* + /* * Scale numerator and denominator powers of 2 so that the * input binary number is the ratio of integers */ @@ -2330,7 +2330,7 @@ ComputeScale(int be, /* Exponent part of number: d = bw * 2**be */ *s2 = 0; } - /* + /* * Scale numerator and denominator so that the output decimal number * is the ratio of integers */ @@ -2438,7 +2438,7 @@ SetPrecisionLimits(int convType, inline static char* BumpUp(char* s, /* Cursor pointing one past the end of the - * string */ + * string */ char* retval, /* Start of the string of digits */ int* kPtr) /* Position of the decimal point */ { @@ -2527,7 +2527,7 @@ AdjustRange(double* dPtr, /* INOUT: Number to adjust */ * * Returns a 'quick' format of a double precision number to a string * of digits, preferring a shorter string of digits if the shorter - * string is still within 1/2 ulp of the number. + * string is still within 1/2 ulp of the number. * * Results: * Returns the string of digits. Returns NULL if the 'quick' method @@ -2638,7 +2638,7 @@ StrictQuickFormat(double d, /* Number to convert */ } *s++ = '0' + digit; - /* + /* * When the given digit count is reached, handle trailing strings * of 0 and 9. */ @@ -2852,13 +2852,13 @@ ShorteningInt64Conversion(Double* dPtr, /* OUTPUT: Position of the terminal '\0' * at the end of the returned string */ { - + char* retval = ckalloc(len + 1); /* Output buffer */ Tcl_WideUInt b = (bw * wuipow5[b5]) << b2; /* Numerator of the fraction being converted */ Tcl_WideUInt S = wuipow5[s5] << s2; - /* Denominator of the fraction being + /* Denominator of the fraction being * converted */ Tcl_WideUInt mplus, mminus; /* Ranges for testing whether the result * is within roundoff of being exact */ @@ -2890,7 +2890,7 @@ ShorteningInt64Conversion(Double* dPtr, } b = b % S; - /* + /* * Does the current digit put us on the low side of the exact value * but within within roundoff of being exact? */ @@ -2948,16 +2948,16 @@ ShorteningInt64Conversion(Double* dPtr, } break; } - + /* Advance to the next digit */ - + b = 10 * b; mplus = 10 * mplus; mminus = 10 * mminus; ++i; } - /* + /* * Endgame - store the location of the decimal point and the end of the * string. */ @@ -3020,13 +3020,13 @@ StrictInt64Conversion(Double* dPtr, /* OUTPUT: Position of the terminal '\0' * at the end of the returned string */ { - + char* retval = ckalloc(len + 1); /* Output buffer */ Tcl_WideUInt b = (bw * wuipow5[b5]) << b2; /* Numerator of the fraction being converted */ Tcl_WideUInt S = wuipow5[s5] << s2; - /* Denominator of the fraction being + /* Denominator of the fraction being * converted */ int digit; /* Current output digit */ char* s = retval; /* Cursor in the output buffer */ @@ -3066,14 +3066,14 @@ StrictInt64Conversion(Double* dPtr, } break; } - + /* Advance to the next digit */ - + b = 10 * b; ++i; } - /* + /* * Endgame - store the location of the decimal point and the end of the * string. */ @@ -3144,10 +3144,10 @@ ShouldBankerRoundUpToNextPowD(mp_int* b, /* Numerator of the fraction */ mp_int* m, /* Numerator of the rounding tolerance */ - int sd, + int sd, /* Common denominator is 2**(sd*DIGIT_BIT) */ int convType, - /* Conversion type: STEELE defeats + /* Conversion type: STEELE defeats * round-to-even (Not sure why one wants to * do this; I copied it from Gay) FIXME */ int isodd, @@ -3157,7 +3157,7 @@ ShouldBankerRoundUpToNextPowD(mp_int* b, { int i; - /* + /* * Compare B and S-m -- which is the same as comparing B+m and S -- * which we do by computing b+m and doing a bitwhack compare against * 2**(DIGIT_BIT*sd) @@ -3238,7 +3238,7 @@ ShorteningBignumConversionPowD(Double* dPtr, /* OUTPUT: Position of the terminal '\0' * at the end of the returned string */ { - + char* retval = ckalloc(len + 1); /* Output buffer */ mp_int b; /* Numerator of the fraction being converted */ @@ -3249,7 +3249,7 @@ ShorteningBignumConversionPowD(Double* dPtr, mp_int temp; int r1; - /* + /* * b = bw * 2**b2 * 5**b5 * mminus = 5**m5 */ @@ -3296,11 +3296,11 @@ ShorteningBignumConversionPowD(Double* dPtr, --b.used; mp_clamp(&b); } - /* + /* * Does the current digit put us on the low side of the exact value * but within within roundoff of being exact? */ - + r1 = mp_cmp_mag(&b, (m2plus > m2minus)? &mplus : &mminus); if (r1 == MP_LT || (r1 == MP_EQ @@ -3329,8 +3329,8 @@ ShorteningBignumConversionPowD(Double* dPtr, * Does one plus the current digit put us within roundoff of the * number? */ - - if (ShouldBankerRoundUpToNextPowD(&b, &mminus, sd, + + if (ShouldBankerRoundUpToNextPowD(&b, &mminus, sd, convType, dPtr->w.word1 & 1, &temp)) { if (digit == 9) { @@ -3353,9 +3353,9 @@ ShorteningBignumConversionPowD(Double* dPtr, } break; } - + /* Advance to the next digit */ - + mp_mul_d(&b, 10, &b); mp_mul_d(&mminus, 10, &mminus); if (m2plus > m2minus) { @@ -3364,7 +3364,7 @@ ShorteningBignumConversionPowD(Double* dPtr, ++i; } - /* + /* * Endgame - store the location of the decimal point and the end of the * string. */ @@ -3388,7 +3388,7 @@ ShorteningBignumConversionPowD(Double* dPtr, * Converts a double-precision number to a fixed-lengt string of * 'ilim' digits (or 'ilim1' if log10(d) has been overestimated.) * The denominator in David Gay's conversion algorithm is known to - * be a power of 2**DIGIT_BIT, and hence the division in the main + * be a power of 2**DIGIT_BIT, and hence the division in the main * loop may be replaced by a digit shift and mask. * * Results: @@ -3430,7 +3430,7 @@ StrictBignumConversionPowD(Double* dPtr, /* OUTPUT: Position of the terminal '\0' * at the end of the returned string */ { - + char* retval = ckalloc(len + 1); /* Output buffer */ mp_int b; /* Numerator of the fraction being converted */ @@ -3439,7 +3439,7 @@ StrictBignumConversionPowD(Double* dPtr, int i; /* Index in the output buffer */ mp_int temp; - /* + /* * b = bw * 2**b2 * 5**b5 */ @@ -3456,9 +3456,9 @@ StrictBignumConversionPowD(Double* dPtr, } mp_init(&temp); - /* + /* * Loop through the digits. Do division and mod by s == 2**(sd*DIGIT_BIT) - * by mp_digit extraction + * by mp_digit extraction */ i = 1; @@ -3488,14 +3488,14 @@ StrictBignumConversionPowD(Double* dPtr, } break; } - + /* Advance to the next digit */ - + mp_mul_d(&b, 10, &b); ++i; } - /* + /* * Endgame - store the location of the decimal point and the end of the * string. */ @@ -3592,7 +3592,7 @@ ShouldBankerRoundUpToNext(mp_int* b, Tcl_Panic("in ShouldBankerRoundUpToNext, trichotomy fails!"); return 0; } - + /* *----------------------------------------------------------------------------- * @@ -3662,10 +3662,10 @@ ShorteningBignumConversion(Double* dPtr, MulPow5(&S, s5, &S); mp_mul_2d(&S, s2, &S); /* - * Handle the case where we guess the position of the decimal point - * wrong. + * Handle the case where we guess the position of the decimal point + * wrong. */ - + if (mp_cmp_mag(&b, &S) == MP_LT) { mp_mul_d(&b, 10, &b); minit = 10; @@ -3694,7 +3694,7 @@ ShorteningBignumConversion(Double* dPtr, } digit = dig.dp[0]; - /* + /* * Does the current digit leave us with a remainder small enough to * round to it? */ @@ -3740,7 +3740,7 @@ ShorteningBignumConversion(Double* dPtr, if (i == ilim) { mp_mul_2d(&b, 1, &b); if (ShouldBankerRoundUp(&b, &S, digit&1)) { - s = BumpUp(s, retval, &k); + s = BumpUp(s, retval, &k); } break; } @@ -3757,7 +3757,7 @@ ShorteningBignumConversion(Double* dPtr, } mp_div_d(&S, 5, &S, NULL); --s5; - /* + /* * IDEA: It might possibly be a win to fall back to * int64 arithmetic here if S < 2**64/10. But it's * a win only for a fairly narrow range of magnitudes @@ -3767,7 +3767,7 @@ ShorteningBignumConversion(Double* dPtr, * Possible savings: * 10**26 1 trip through loop before fallback possible * 10**27 1 trip - * 10**28 2 trips + * 10**28 2 trips * 10**29 3 trips * 10**30 4 trips * 10**31 5 trips @@ -3796,7 +3796,7 @@ ShorteningBignumConversion(Double* dPtr, } - /* + /* * Endgame - store the location of the decimal point and the end of the * string. */ @@ -3812,7 +3812,7 @@ ShorteningBignumConversion(Double* dPtr, return retval; } - + /* *----------------------------------------------------------------------------- * @@ -3862,7 +3862,7 @@ StrictBignumConversion(Double* dPtr, mp_int temp; /* Work area */ int g; /* Size of the current digit groun */ int i, j; - + /* * b = bw * 2**b2 * 5**b5 * S = 2**s2 * 5*s5 @@ -3875,10 +3875,10 @@ StrictBignumConversion(Double* dPtr, MulPow5(&S, s5, &S); mp_mul_2d(&S, s2, &S); /* - * Handle the case where we guess the position of the decimal point - * wrong. + * Handle the case where we guess the position of the decimal point + * wrong. */ - + if (mp_cmp_mag(&b, &S) == MP_LT) { mp_mul_d(&b, 10, &b); ilim =ilim1; @@ -3900,7 +3900,7 @@ StrictBignumConversion(Double* dPtr, if (++i >= ilim) { mp_mul_2d(&b, 1, &b); if (ShouldBankerRoundUp(&b, &S, digit&1)) { - s = BumpUp(s, retval, &k); + s = BumpUp(s, retval, &k); } } else { @@ -3923,7 +3923,7 @@ StrictBignumConversion(Double* dPtr, mp_mul_d(&b, dpow5[g], &b); } mp_mul_2d(&b, g, &b); - + /* * As with the shortening bignum conversion, it's possible at * this point that we will have reduced the denominator to @@ -3936,7 +3936,7 @@ StrictBignumConversion(Double* dPtr, */ /* Extract the next group of digits */ - + mp_div(&b, &S, &dig, &b); if (dig.used > 1) { Tcl_Panic("wrong digit!"); @@ -3948,24 +3948,24 @@ StrictBignumConversion(Double* dPtr, digit %= t; } i += g; - + /* Have we converted all the requested digits? */ - + if (i == ilim) { mp_mul_2d(&b, 1, &b); if (ShouldBankerRoundUp(&b, &S, digit&1)) { - s = BumpUp(s, retval, &k); + s = BumpUp(s, retval, &k); } else { while (*--s == '0') { /* do nothing */ } ++s; - } + } break; } } } - /* + /* * Endgame - store the location of the decimal point and the end of the * string. */ @@ -4009,7 +4009,7 @@ StrictBignumConversion(Double* dPtr, * TCL_DD_STEELE - This value is not recommended and may be removed * in the future. It follows the conversion algorithm outlined * in "How to Print Floating-Point Numbers Accurately" by - * Guy L. Steele, Jr. and Jon L. White [Proc. ACM SIGPLAN '90, + * Guy L. Steele, Jr. and Jon L. White [Proc. ACM SIGPLAN '90, * pp. 112-126]. This rule has the effect of rendering 1e23 * as 9.9999999999999999e22 - which is a 'better' approximation * in the sense that it will reconvert correctly even if @@ -4021,14 +4021,14 @@ StrictBignumConversion(Double* dPtr, * 'ndigits' digits, choosing the one that is closest to the * given number (and resolving ties with 'round to even'). * It is allowed to return fewer than 'ndigits' if the number - * converts exactly; if the TCL_DD_E_FORMAT|TCL_DD_SHORTEN_FLAG - * is supplied instead, it also returns fewer digits if the + * converts exactly; if the TCL_DD_E_FORMAT|TCL_DD_SHORTEN_FLAG + * is supplied instead, it also returns fewer digits if the * shorter string will still reconvert to the given input number. * In any case, strings of trailing zeroes are suppressed. * TCL_DD_F_FORMAT - This value is used to prepare numbers for %f * format conversion. It requests that conversion proceed until * 'ndigits' digits after the decimal point have been converted. - * It is possible for this format to result in a zero-length + * It is possible for this format to result in a zero-length * string if the number is sufficiently small. Again, it * is permissible for TCL_DD_F_FORMAT to return fewer digits * for a number that converts exactly, and changing the @@ -4045,12 +4045,12 @@ StrictBignumConversion(Double* dPtr, * midpoint between two decimal strings that more precision is needed * to resolve which string is correct. * - * The value stored in the 'decpt' argument on return may be negative - * (indicating that the decimal point falls to the left of the string) + * The value stored in the 'decpt' argument on return may be negative + * (indicating that the decimal point falls to the left of the string) * or greater than the length of the string. In addition, the value -9999 * is used as a sentinel to indicate that the string is one of the special * values "Infinity" and "NaN", and that no decimal point should be inserted. - * + * *----------------------------------------------------------------------------- */ char* @@ -4076,12 +4076,12 @@ TclDoubleDigits(double dv, /* Number to convert */ int denorm; /* Flag == 1 iff the input number was * denormalized */ int k; /* Estimate of floor(log10(d)) */ - int k_check; /* Flag == 1 if d is near enough to a + int k_check; /* Flag == 1 if d is near enough to a * power of ten that k must be checked */ int b2, b5, s2, s5; /* Powers of 2 and 5 in the numerator and * denominator of intermediate results */ int ilim = -1, ilim1 = -1; /* Number of digits to convert, and number - * to convert if log10(d) has been + * to convert if log10(d) has been * overestimated */ char* retval; /* Return value from this function */ int i = -1; @@ -4090,7 +4090,7 @@ TclDoubleDigits(double dv, /* Number to convert */ d.d = dv; - /* + /* * Handle the cases of negative numbers (by taking the absolute value: * this includes -Inf and -NaN!), infinity, Not a Number, and zero. */ @@ -4103,7 +4103,7 @@ TclDoubleDigits(double dv, /* Number to convert */ return FormatZero(decpt, endPtr); } - /* + /* * Unpack the floating point into a wide integer and an exponent. * Determine the number of bits that the big integer requires, and * compute a quick approximation (which may be one too high) of @@ -4116,12 +4116,12 @@ TclDoubleDigits(double dv, /* Number to convert */ /* At this point, we have: * d is the number to convert. - * bw are significand and exponent: d == bw*2**be, + * bw are significand and exponent: d == bw*2**be, * bbits is the length of bw: 2**bbits-1 <= bw < 2**bbits * k is either ceil(log10(d)) or ceil(log10(d))+1. k_check is 0 * if we know that k is exactly ceil(log10(d)) and 1 if we need to * check. - * We want a rational number + * We want a rational number * r = b * 10**(1-k) = bw * 2**b2 * 5**b5 / (2**s2 / 5**s5), * with b2, b5, s2, s5 >= 0. Note that the most significant decimal * digit is floor(r) and that successive digits can be obtained @@ -4149,7 +4149,7 @@ TclDoubleDigits(double dv, /* Number to convert */ SetPrecisionLimits(convType, k, &ndigits, &i, &ilim, &ilim1); - /* + /* * Try to do low-precision conversion in floating point rather * than resorting to expensive multiprecision arithmetic */ @@ -4161,7 +4161,7 @@ TclDoubleDigits(double dv, /* Number to convert */ } } - /* + /* * For shortening conversions, determine the upper and lower bounds * for the remainder at which we can stop. * m+ = (2**m2plus * 5**m5) / (2**s2 * 5**s5) is the limit on the @@ -4178,9 +4178,9 @@ TclDoubleDigits(double dv, /* Number to convert */ int m5 = b5; int len = i; - /* + /* * Find the quantity i so that (2**i*5**b5)/(2**s2*5**s5) - * is 1/2 unit in the least significant place of the floating + * is 1/2 unit in the least significant place of the floating * point number. */ if (denorm) { @@ -4191,7 +4191,7 @@ TclDoubleDigits(double dv, /* Number to convert */ b2 += i; s2 += i; - /* + /* * Reduce the fractions to lowest terms, since the above calculation * may have left excess powers of 2 in numerator and denominator */ @@ -4220,7 +4220,7 @@ TclDoubleDigits(double dv, /* Number to convert */ return ShorteningInt64Conversion(&d, convType, bw, b2, b5, m2plus, m2minus, m5, - s2, s5, k, len, ilim, ilim1, + s2, s5, k, len, ilim, ilim1, decpt, endPtr); } else if (s5 == 0) { /* @@ -4239,11 +4239,11 @@ TclDoubleDigits(double dv, /* Number to convert */ } return ShorteningBignumConversionPowD(&d, convType, bw, b2, b5, m2plus, m2minus, m5, - s2/DIGIT_BIT, k, len, + s2/DIGIT_BIT, k, len, ilim, ilim1, decpt, endPtr); } else { - /* + /* * Alas, there's no helpful special case; use full-up * bignum arithmetic for the conversion */ @@ -4279,7 +4279,7 @@ TclDoubleDigits(double dv, /* Number to convert */ */ return StrictInt64Conversion(&d, convType, bw, b2, b5, - s2, s5, k, len, ilim, ilim1, + s2, s5, k, len, ilim, ilim1, decpt, endPtr); } else if (s5 == 0) { @@ -4296,7 +4296,7 @@ TclDoubleDigits(double dv, /* Number to convert */ s2 += delta; } return StrictBignumConversionPowD(&d, convType, bw, b2, b5, - s2/DIGIT_BIT, k, len, + s2/DIGIT_BIT, k, len, ilim, ilim1, decpt, endPtr); } else { /* @@ -4308,7 +4308,7 @@ TclDoubleDigits(double dv, /* Number to convert */ return StrictBignumConversion(&d, convType, bw, b2, s2, s5, k, len, ilim, ilim1, decpt, endPtr); } - } + } } @@ -4558,7 +4558,7 @@ TclBignumToDouble( /* - * We need a 'mantBits'-bit significand. Determine what shift will + * We need a 'mantBits'-bit significand. Determine what shift will * give us that. */ @@ -4573,7 +4573,7 @@ TclBignumToDouble( } shift = mantBits - bits; - /* + /* * If shift > 0, shift the significand left by the requisite number of * bits. If shift == 0, the significand is already exactly 'mantBits' * in length. If shift < 0, we will need to shift the significand right diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index 8c6a376..86f0c62 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -1392,7 +1392,7 @@ AppendUnicodeToUnicodeRep( + stringPtr->uallocated / sizeof(Tcl_UniChar)) { offset = unicode - stringPtr->unicode; } - + GrowUnicodeBuffer(objPtr, numChars); stringPtr = GET_STRING(objPtr); @@ -1575,7 +1575,7 @@ AppendUtfToUtfRep( unsigned int limit = INT_MAX - newLength; unsigned int extra = numBytes + TCL_GROWTH_MIN_ALLOC; int growth = (int) ((extra > limit) ? limit : extra); - + Tcl_SetObjLength(objPtr, newLength + growth); } diff --git a/generic/tclThreadStorage.c b/generic/tclThreadStorage.c index f1df888..1578b40 100644 --- a/generic/tclThreadStorage.c +++ b/generic/tclThreadStorage.c @@ -135,7 +135,7 @@ AllocThreadStorageEntry( hPtr = (Tcl_HashEntry *) TclpSysAlloc(sizeof(Tcl_HashEntry), 0); hPtr->key.oneWordValue = keyPtr; hPtr->clientData = NULL; - + return hPtr; } @@ -170,7 +170,7 @@ FreeThreadStorageEntry( * ThreadStorageGetHashTable -- * * This procedure returns a hash table pointer to be used for thread - * storage for the specified thread. + * storage for the specified thread. * * Results: * A hash table pointer for the specified thread, or NULL if the hash @@ -182,8 +182,8 @@ FreeThreadStorageEntry( * * Thread safety: * This function assumes that integer operations are safe (atomic) - * on all (currently) supported Tcl platforms. Hence there are - * places where shared integer arithmetic is done w/o protective locks. + * on all (currently) supported Tcl platforms. Hence there are + * places where shared integer arithmetic is done w/o protective locks. * *---------------------------------------------------------------------- */ @@ -205,12 +205,12 @@ ThreadStorageGetHashTable( * Thread safety: threadStorageCache is accessed w/o locks in order to * avoid serialization of all threads at this hot-spot. It is safe to * do this here because (threadStorageCache[index].id != id) test below - * should be atomic on all (currently) supported platforms and there + * should be atomic on all (currently) supported platforms and there * are no devastatig side effects of the test. * * Note Valgrind users: this place will show up as a race-condition in * helgrind-tool output. To silence this warnings, define VALGRIND - * symbol at compilation time. + * symbol at compilation time. */ #if !defined(VALGRIND) diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 8c6adfe..69d0b17 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -63,7 +63,7 @@ static ProcessGlobalValue executableName = { * CONVERT_MASK A mask value used to extract the conversion mode from * the flags argument. * Also indicates a strange conversion mode where all - * special characters are escaped with backslashes + * special characters are escaped with backslashes * *except for braces*. This is a strange and unnecessary * case, but it's part of the historical way in which * lists have been formatted in Tcl. To experiment with @@ -81,7 +81,7 @@ static ProcessGlobalValue executableName = { * in other cases this means an overestimate of the * required size. * - * For more details, see the comments on the Tcl*Scan*Element and + * For more details, see the comments on the Tcl*Scan*Element and * Tcl*Convert*Element routines. */ @@ -171,12 +171,12 @@ Tcl_ObjType tclEndOffsetType = { * rules similar to the parsing of the words of a command in a Tcl script. * Backslash substitution plays a key role, and is defined exactly as it is * in command parsing. The same routine, TclParseBackslash() is used in both - * command parsing and list parsing. + * command parsing and list parsing. * * NOTE: This means that if and when backslash substitution rules ever * change for command parsing, the interpretation of strings as lists also * changes. - * + * * Backslash substitution replaces an "escape sequence" of one or more * characters starting with * \u005c \ BACKSLASH @@ -189,7 +189,7 @@ Tcl_ObjType tclEndOffsetType = { * * * If the first character of a formatted substring is * \u007b { OPEN BRACE - * then the end of the substring is the matching + * then the end of the substring is the matching * \u007d } CLOSE BRACE * character, where matching is determined by counting nesting levels, * and not including any brace characters that are contained within a @@ -211,7 +211,7 @@ Tcl_ObjType tclEndOffsetType = { * that includes an unbalanced brace not in a backslash escape sequence, * and any value that ends with a backslash not itself in a backslash * escape sequence. - * + * * * If the first character of a formatted substring is * \u0022 " QUOTE * then the end of the substring is the next QUOTE character, not counting @@ -246,7 +246,7 @@ Tcl_ObjType tclEndOffsetType = { * minimum be able to produce escape sequences for the 10 characters * identified above that have significance to a list parser. * - * * * CANONICAL LISTS * * * * * + * * * CANONICAL LISTS * * * * * * * In addition to the basic rules for parsing strings into Tcl lists, there * are additional properties to be met by the set of list values that are @@ -297,7 +297,7 @@ Tcl_ObjType tclEndOffsetType = { * This sort of coding was once fairly common, though it's become more * idiomatic to see the following instead: * set script [list puts [list $one $two $three]]; eval $script - * In order to support this guarantee, every canonical list must have + * In order to support this guarantee, every canonical list must have * balance when counting those braces that are not in escape sequences. * * Within these constraints, the canonical list generation routines @@ -339,7 +339,7 @@ Tcl_ObjType tclEndOffsetType = { * #if COMPAT directives. This makes it easy to experiment with eliminating * this formatting mode simply with "#define COMPAT 0" above. I believe * this is worth considering. - * + * * Another consideration is the treatment of QUOTE characters in list elements. * TclConvertElement() must have the ability to produce the escape sequence * \" so that when a list element begins with a QUOTE we do not confuse @@ -396,7 +396,7 @@ TclMaxListLength( } /* No list element before leading white space */ - count += 1 - TclIsSpaceProc(*bytes); + count += 1 - TclIsSpaceProc(*bytes); /* Count white space runs as potential element separators */ while (numBytes) { @@ -420,7 +420,7 @@ TclMaxListLength( } /* No list element following trailing white space */ - count -= TclIsSpaceProc(bytes[-1]); + count -= TclIsSpaceProc(bytes[-1]); done: if (endPtr) { @@ -488,7 +488,7 @@ TclFindElement( * indicate that the substring of *sizePtr * bytes starting at **elementPtr is/is not * the literal list element and therefore - * does not/does require a call to + * does not/does require a call to * TclCopyAndCollapse() by the caller. */ { CONST char *p = list; @@ -945,7 +945,7 @@ TclScanElement( int preferBrace = 0; /* CONVERT_MASK mode. */ int braceCount = 0; /* Count of all braces '{' '}' seen. */ #endif - + if ((p == NULL) || (length == 0) || ((*p == '\0') && (length == -1))) { /* Empty string element must be brace quoted. */ *flagPtr = CONVERT_BRACE; @@ -1012,7 +1012,7 @@ TclScanElement( extra++; /* Escape '\' => '\\' */ if ((length == 1) || ((length == -1) && (p[1] == '\0'))) { /* Final backslash. Cannot format with brace quoting. */ - requireEscape = 1; + requireEscape = 1; break; } if (p[1] == '\n') { @@ -1087,7 +1087,7 @@ TclScanElement( if (preferEscape && !preferBrace) { /* * If we are quoting solely due to ] or internal " characters - * use the CONVERT_MASK mode where we escape all special + * use the CONVERT_MASK mode where we escape all special * characters except for braces. "extra" counted space needed * to escape braces too, so substract "braceCount" to get our * actual needs. @@ -1351,7 +1351,7 @@ int TclConvertElement( if (length == -1) { return p - dst; } - /* + /* * If we reach this point, there's an embedded NULL in the * string range being processed, which should not happen when * the encoding rules for Tcl strings are properly followed. @@ -1417,7 +1417,7 @@ Tcl_Merge( /* * We cannot allocate a large enough flag array to format this * list in one pass. We could imagine converting this routine - * to a multi-pass implementation, but for sizeof(int) == 4, + * to a multi-pass implementation, but for sizeof(int) == 4, * the limit is a max of 2^30 list elements and since each element * is at least one byte formatted, and requires one byte space * between it and the next one, that a minimum space requirement @@ -1678,7 +1678,7 @@ Tcl_Concat( } if (bytesNeeded + argc - 1 < 0) { /* - * Panic test could be tighter, but not going to bother for + * Panic test could be tighter, but not going to bother for * this legacy routine. */ Tcl_Panic("Tcl_Concat: max size of Tcl value exceeded"); @@ -1689,7 +1689,7 @@ Tcl_Concat( for (p = result, i = 0; i < argc; i++) { int trim, elemLength; const char *element; - + element = argv[i]; elemLength = strlen(argv[i]); @@ -1827,7 +1827,7 @@ Tcl_ConcatObj( for (i = 0; i < objc; i++) { int trim; - + element = TclGetStringFromObj(objv[i], &elemLength); /* Trim away the leading whitespace */ @@ -2828,7 +2828,7 @@ Tcl_PrintDouble( /* * Remember to copy the terminating NUL too. */ - + if (value < 0) { memcpy(dst, "-Inf", 5); } else { @@ -2885,7 +2885,7 @@ Tcl_PrintDouble( */ digits = TclDoubleDigits(value, *precisionPtr, - TCL_DD_E_FORMAT /* | TCL_DD_SHORTEN_FLAG */, + TCL_DD_E_FORMAT /* | TCL_DD_SHORTEN_FLAG */, &exponent, &signum, &end); } if (signum) { @@ -2896,7 +2896,7 @@ Tcl_PrintDouble( /* * E format for numbers < 1e-3 or >= 1e17. */ - + *dst++ = *p++; c = *p; if (c != '\0') { @@ -2906,7 +2906,7 @@ Tcl_PrintDouble( c = *++p; } } - /* + /* * Tcl 8.4 appears to format with at least a two-digit exponent; \ * preserve that behaviour when tcl_precision != 0 */ @@ -2919,7 +2919,7 @@ Tcl_PrintDouble( /* * F format for others. */ - + if (exponent < 0) { *dst++ = '0'; } diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c index 2df704b..a57a89a 100644 --- a/unix/tclUnixNotfy.c +++ b/unix/tclUnixNotfy.c @@ -111,7 +111,7 @@ typedef struct ThreadSpecificData { * event is ready to be processed by signaling * this condition variable. */ #endif /* __CYGWIN__ */ - int waitCVinitialized; /* Variable to flag initialization of the structure */ + int waitCVinitialized; /* Variable to flag initialization of the structure */ int eventReady; /* True if an event is ready to be processed. * Used as condition flag together with waitCV * above. */ -- cgit v0.12 From a3a5372cf6ffd69dbf4628f2c0dd5295f79888ae Mon Sep 17 00:00:00 2001 From: dkf Date: Sun, 4 Oct 2015 10:58:48 +0000 Subject: [05489ce335] Constrain broken tests. --- tests/for.test | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/tests/for.test b/tests/for.test index a0eeff6..59e62fb 100644 --- a/tests/for.test +++ b/tests/for.test @@ -14,6 +14,8 @@ if {[lsearch [namespace children] ::tcltest] == -1} { namespace import -force ::tcltest::* } +testConstraint bug-05489ce335 [testConstraint knownBug] + # Basic "for" operation. test for-1.1 {TclCompileForCmd: missing initial command} { @@ -824,7 +826,7 @@ test for-8.0 {Coverity CID 1251203: break vs continue in for-step clause} { list $i $j $k }} } {6 5 3} -test for-8.1 {Coverity CID 1251203: break vs continue in for-step clause} { +test for-8.1 {Coverity CID 1251203: break vs continue in for-step clause} bug-05489ce335 { apply {{} { for {set k 0} {$k < 3} {incr k} { set j 0 @@ -837,7 +839,7 @@ test for-8.1 {Coverity CID 1251203: break vs continue in for-step clause} { list $i $j $k }} } {2 1 3} -test for-8.2 {Coverity CID 1251203: break vs continue in for-step clause} { +test for-8.2 {Coverity CID 1251203: break vs continue in for-step clause} bug-05489ce335 { apply {{} { for {set k 0} {$k < 3} {incr k} { set j 0 @@ -863,7 +865,7 @@ test for-8.3 {break in for-step clause} { list $i $j $k }} } {2 1 3} -test for-8.4 {continue in for-step clause} { +test for-8.4 {continue in for-step clause} bug-05489ce335 { apply {{} { for {set k 0} {$k < 3} {incr k} { set j 0 @@ -876,7 +878,7 @@ test for-8.4 {continue in for-step clause} { list $i $j $k }} } {1 1 3} -test for-8.5 {break in for-step clause} { +test for-8.5 {break in for-step clause} bug-05489ce335 { apply {{} { for {set k 0} {$k < 3} {incr k} { set j 0 @@ -889,7 +891,7 @@ test for-8.5 {break in for-step clause} { list $i $j $k }} } {2 1 3} -test for-8.6 {continue in for-step clause} { +test for-8.6 {continue in for-step clause} bug-05489ce335 { apply {{} { for {set k 0} {$k < 3} {incr k} { set j 0 @@ -915,7 +917,7 @@ test for-8.7 {break in for-step clause} { list $i $j $k }} } {2 1 3} -test for-8.8 {continue in for-step clause} { +test for-8.8 {continue in for-step clause} bug-05489ce335 { apply {{} { for {set k 0} {$k < 3} {incr k} { set j 0 @@ -976,8 +978,11 @@ test for-8.12 {continue in for-step clause} { list $i $j $k }} } {1 1 3} - - + # cleanup ::tcltest::cleanupTests return + +# Local Variables: +# mode: tcl +# End: -- cgit v0.12 From 9cac91e2eb9f49a1227ec078f49d8130706a6125 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 5 Oct 2015 09:23:12 +0000 Subject: Use "cygpath -m" in stead of "cygpath -w", so paths (even windows ones) always have forward slashes. Suggested by pooryorick for [http://core.tcl.tk/tclconfig/tktview/06f1692bbe29449ac3f2161ebf9dd153d0349845|TEA], but a good idea anyway --- win/configure | 2 +- win/tcl.m4 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/win/configure b/win/configure index 1dcc9d2..dc03e62 100755 --- a/win/configure +++ b/win/configure @@ -3288,7 +3288,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CYGPATH="cygpath -w" + ac_cv_prog_CYGPATH="cygpath -m" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi diff --git a/win/tcl.m4 b/win/tcl.m4 index aa3c4b3..46d3518 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -558,7 +558,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ # Set some defaults (may get changed below) EXTRA_CFLAGS="" - AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo) + AC_CHECK_PROG(CYGPATH, cygpath, cygpath -m, echo) SHLIB_SUFFIX=".dll" -- cgit v0.12 From 5580f4a403b6c1487e27c93960c07cab1691d8f3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 6 Oct 2015 08:18:46 +0000 Subject: Double '[' and ']', otherwise re-generating "configure" doesn't give the expected result. --- win/tcl.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/win/tcl.m4 b/win/tcl.m4 index 46d3518..2795086 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -784,7 +784,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ LIBRARIES="\${SHARED_LIBRARIES}" SHLIB_LD_LIBS='${LIBS}' case "x`echo \${VisualStudioVersion}`" in - x1[4-9]*) + x1[[4-9]]*) lflags="${lflags} -nodefaultlib:libucrt.lib" ;; *) @@ -826,7 +826,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ LIBS="user32.lib advapi32.lib ws2_32.lib" case "x`echo \${VisualStudioVersion}`" in - x1[4-9]*) + x1[[4-9]]*) LIBS="$LIBS ucrt.lib" ;; *) -- cgit v0.12 From 1781dd91805d388923c459d467c95112a815d1bf Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 6 Oct 2015 09:19:18 +0000 Subject: Revise content of generate win/tclConfig.sh: Make sure that all entries use windows paths with forward slashes. --- win/configure.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/win/configure.in b/win/configure.in index 88270cf..6b30162 100644 --- a/win/configure.in +++ b/win/configure.in @@ -186,21 +186,21 @@ TCL_SHARED_LIB_SUFFIX="\${NODOT_VERSION}${DLLSUFFIX}" TCL_UNSHARED_LIB_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}" TCL_EXPORT_FILE_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}" -eval "TCL_SRC_DIR=\"`cd $srcdir/..; pwd`\"" +eval "TCL_SRC_DIR=\"`cd $srcdir/..; $CYGPATH $(pwd)`\"" eval "TCL_DLL_FILE=tcl${VER}${DLLSUFFIX}" eval "TCL_LIB_FILE=${LIBPREFIX}tcl$VER${LIBSUFFIX}" eval "TCL_LIB_FLAG=\"-ltcl${VER}${LIBFLAGSUFFIX}\"" -eval "TCL_BUILD_LIB_SPEC=\"-L`pwd` ${TCL_LIB_FLAG}\"" +eval "TCL_BUILD_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TCL_LIB_FLAG}\"" eval "TCL_LIB_SPEC=\"-L${libdir} ${TCL_LIB_FLAG}\"" eval "TCL_STUB_LIB_FILE=\"${LIBPREFIX}tclstub${VER}${LIBSUFFIX}\"" eval "TCL_STUB_LIB_FLAG=\"-ltclstub${VER}${LIBFLAGSUFFIX}\"" -eval "TCL_BUILD_STUB_LIB_SPEC=\"-L`pwd` ${TCL_STUB_LIB_FLAG}\"" +eval "TCL_BUILD_STUB_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TCL_STUB_LIB_FLAG}\"" eval "TCL_STUB_LIB_SPEC=\"-L${libdir} ${TCL_STUB_LIB_FLAG}\"" -eval "TCL_BUILD_STUB_LIB_PATH=\"`pwd`/${TCL_STUB_LIB_FILE}\"" +eval "TCL_BUILD_STUB_LIB_PATH=\"`$CYGPATH $(pwd)`/${TCL_STUB_LIB_FILE}\"" eval "TCL_STUB_LIB_PATH=\"${libdir}/${TCL_STUB_LIB_FILE}\"" # Install time header dir can be set via --includedir -- cgit v0.12 From 40ba2e067496a7fab51129617bbcd0f5553f285f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 6 Oct 2015 14:25:36 +0000 Subject: Fix [b42a851475]: file normalize ~user returns wrong directory on Windows --- win/tclWinFile.c | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/win/tclWinFile.c b/win/tclWinFile.c index fe30c55..73a2183 100755 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -17,6 +17,7 @@ #include #include #include /* For TclpGetUserHome(). */ +#include /* For TclpGetUserHome(). */ /* * The number of 100-ns intervals between the Windows system epoch (1601-01-01 @@ -177,6 +178,10 @@ typedef NET_API_STATUS NET_API_FUNCTION NETAPIBUFFERFREEPROC(LPVOID Buffer); typedef NET_API_STATUS NET_API_FUNCTION NETGETDCNAMEPROC( LPWSTR servername, LPWSTR domainname, LPBYTE *bufptr); +typedef BOOL WINAPI GETPROFILESDIRECTORYPROC( + LPWSTR lpProfilesDir, LPDWORD lpcchSize +); + /* * Declarations for local functions defined in this file: */ @@ -1418,15 +1423,18 @@ TclpGetUserHome( { char *result; HINSTANCE netapiInst; + HINSTANCE userenvInst; result = NULL; Tcl_DStringInit(bufferPtr); netapiInst = LoadLibraryA("netapi32.dll"); - if (netapiInst != NULL) { + userenvInst = LoadLibraryA("userenv.dll"); + if (netapiInst != NULL && userenvInst != NULL) { NETAPIBUFFERFREEPROC *netApiBufferFreeProc; NETGETDCNAMEPROC *netGetDCNameProc; NETUSERGETINFOPROC *netUserGetInfoProc; + GETPROFILESDIRECTORYPROC *getProfilesDirectoryProc; netApiBufferFreeProc = (NETAPIBUFFERFREEPROC *) GetProcAddress(netapiInst, "NetApiBufferFree"); @@ -1434,8 +1442,10 @@ TclpGetUserHome( GetProcAddress(netapiInst, "NetGetDCName"); netUserGetInfoProc = (NETUSERGETINFOPROC *) GetProcAddress(netapiInst, "NetUserGetInfo"); + getProfilesDirectoryProc = (GETPROFILESDIRECTORYPROC *) + GetProcAddress(userenvInst, "GetProfilesDirectoryW"); if ((netUserGetInfoProc != NULL) && (netGetDCNameProc != NULL) - && (netApiBufferFreeProc != NULL)) { + && (netApiBufferFreeProc != NULL) && (getProfilesDirectoryProc != NULL)) { USER_INFO_1 *uiPtr, **uiPtrPtr = &uiPtr; Tcl_DString ds; int nameLen, badDomain; @@ -1467,12 +1477,17 @@ TclpGetUserHome( } else { /* * User exists but has no home dir. Return - * "{Windows Drive}:/users/default". + * "{GetProfilesDirectory}/". */ - - GetWindowsDirectoryW(buf, MAX_PATH); - Tcl_UniCharToUtfDString(buf, 2, bufferPtr); - Tcl_DStringAppend(bufferPtr, "/users/default", -1); + DWORD size = MAX_PATH; + int i; + getProfilesDirectoryProc(buf, &size); + for (i = 0; i < size; ++i){ + if (buf[i] == '\\') buf[i] = '/'; + } + Tcl_UniCharToUtfDString(buf, size-1, bufferPtr); + Tcl_DStringAppend(bufferPtr, "/", -1); + Tcl_DStringAppend(bufferPtr, name, -1); } result = Tcl_DStringValue(bufferPtr); (*netApiBufferFreeProc)((void *) uiPtr); @@ -1483,6 +1498,7 @@ TclpGetUserHome( (*netApiBufferFreeProc)((void *) wDomain); } } + FreeLibrary(userenvInst); FreeLibrary(netapiInst); } if (result == NULL) { -- cgit v0.12 From 236c0f4ffd3ac7f1cef522c0c0e00b9e72cf995f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 7 Oct 2015 08:40:23 +0000 Subject: Fix surrogate handling in PrintSourceToObj(), differenciating for TCL_UTF_MAX = 6 (androwish) and TCL_UTF_MAX = 4 (tip-389-impl). No effect when TCL_UTF_MAX = 3. --- generic/tclDisassemble.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c index 15502e7..86f0e1d 100644 --- a/generic/tclDisassemble.c +++ b/generic/tclDisassemble.c @@ -833,8 +833,19 @@ PrintSourceToObj( continue; default: #if TCL_UTF_MAX > 4 - if ((int) ch > 0xffff) { - Tcl_AppendPrintfToObj(appendObj, "\\U%08x", (int) ch); + if (ch > 0xffff) { + Tcl_AppendPrintfToObj(appendObj, "\\U%08x", ch); + i += 10; + } else +#elif TCL_UTF_MAX > 3 + /* If len == 0, this means we have a char > 0xffff, resulting in + * TclUtfToUniChar producing a surrogate pair. We want to output + * this pair as a single Unicode character. + */ + if (len == 0) { + int upper = ((ch & 0x3ff) + 1) << 10; + len = TclUtfToUniChar(p, &ch); + Tcl_AppendPrintfToObj(appendObj, "\\U%08x", upper + (ch & 0x3ff)); i += 10; } else #endif -- cgit v0.12 From 81cbdd313896511542f19465bf012631591474db Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 7 Oct 2015 13:14:27 +0000 Subject: Where "interp" is only used for error-reporting, it can be allowed to be NULL. This should fix [5da26d4760]: Tcl_LoadFile() segfaults if "interp" is NULL. --- generic/tclIOUtil.c | 34 +++++++++++++++++++--------- generic/tclLoadNone.c | 14 +++++++----- unix/tclLoadDl.c | 25 ++++++++++++--------- win/tclWinLoad.c | 62 ++++++++++++++++++++++++++------------------------- 4 files changed, 79 insertions(+), 56 deletions(-) diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index 1d4f277..1330c02 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -3254,7 +3254,9 @@ Tcl_LoadFile( if (*handlePtr == NULL) { return TCL_ERROR; } - Tcl_ResetResult(interp); + if (interp) { + Tcl_ResetResult(interp); + } goto resolveSymbols; } if (Tcl_GetErrno() != EXDEV) { @@ -3270,9 +3272,11 @@ Tcl_LoadFile( */ if (Tcl_FSAccess(pathPtr, R_OK) != 0) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "couldn't load library \"%s\": %s", - Tcl_GetString(pathPtr), Tcl_PosixError(interp))); + if (interp) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "couldn't load library \"%s\": %s", + Tcl_GetString(pathPtr), Tcl_PosixError(interp))); + } return TCL_ERROR; } @@ -3321,7 +3325,9 @@ Tcl_LoadFile( } mustCopyToTempAnyway: - Tcl_ResetResult(interp); + if (interp) { + Tcl_ResetResult(interp); + } #endif /* TCL_LOAD_FROM_MEMORY */ /* @@ -3345,8 +3351,10 @@ Tcl_LoadFile( Tcl_FSDeleteFile(copyToPtr); Tcl_DecrRefCount(copyToPtr); - Tcl_SetObjResult(interp, Tcl_NewStringObj( - "couldn't load from current filesystem", -1)); + if (interp) { + Tcl_SetObjResult(interp, Tcl_NewStringObj( + "couldn't load from current filesystem", -1)); + } return TCL_ERROR; } @@ -3386,7 +3394,9 @@ Tcl_LoadFile( * have stored the number of bytes in the result. */ - Tcl_ResetResult(interp); + if (interp) { + Tcl_ResetResult(interp); + } retVal = Tcl_LoadFile(interp, copyToPtr, symbols, flags, procPtrs, &newLoadHandle); @@ -3418,7 +3428,9 @@ Tcl_LoadFile( */ *handlePtr = newLoadHandle; - Tcl_ResetResult(interp); + if (interp) { + Tcl_ResetResult(interp); + } return TCL_OK; } @@ -3479,7 +3491,9 @@ Tcl_LoadFile( divertedLoadHandle->unloadFileProcPtr = DivertUnloadFile; *handlePtr = divertedLoadHandle; - Tcl_ResetResult(interp); + if (interp) { + Tcl_ResetResult(interp); + } return retVal; resolveSymbols: diff --git a/generic/tclLoadNone.c b/generic/tclLoadNone.c index 6cb4378..6af5c4f 100644 --- a/generic/tclLoadNone.c +++ b/generic/tclLoadNone.c @@ -45,9 +45,11 @@ TclpDlopen( * file. */ int flags) { - Tcl_SetObjResult(interp, Tcl_NewStringObj( - "dynamic loading is not currently available on this system", - -1)); + if (interp) { + Tcl_SetObjResult(interp, Tcl_NewStringObj( + "dynamic loading is not currently available on this system", + -1)); + } return TCL_ERROR; } @@ -109,8 +111,10 @@ TclpLoadMemory( int flags) /* Dummy: unused by this implementation */ { - Tcl_SetObjResult(interp, Tcl_NewStringObj("dynamic loading from memory " - "is not available on this system", -1)); + if (interp) { + Tcl_SetObjResult(interp, Tcl_NewStringObj("dynamic loading from memory " + "is not available on this system", -1)); + } return TCL_ERROR; } diff --git a/unix/tclLoadDl.c b/unix/tclLoadDl.c index dc711f8..aec071c 100644 --- a/unix/tclLoadDl.c +++ b/unix/tclLoadDl.c @@ -124,9 +124,11 @@ TclpDlopen( const char *errorStr = dlerror(); - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "couldn't load file \"%s\": %s", - Tcl_GetString(pathPtr), errorStr)); + if (interp) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "couldn't load file \"%s\": %s", + Tcl_GetString(pathPtr), errorStr)); + } return TCL_ERROR; } newHandle = ckalloc(sizeof(*newHandle)); @@ -187,17 +189,18 @@ FindSymbol( Tcl_DStringFree(&newName); } Tcl_DStringFree(&ds); - if (proc == NULL && interp != NULL) { + if (proc == NULL) { const char *errorStr = dlerror(); - if (!errorStr) { - errorStr = "unknown"; + if (interp) { + if (!errorStr) { + errorStr = "unknown"; + } + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "cannot find symbol \"%s\": %s", symbol, errorStr)); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol, + NULL); } - - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "cannot find symbol \"%s\": %s", symbol, errorStr)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol, - NULL); } return proc; } diff --git a/win/tclWinLoad.c b/win/tclWinLoad.c index 3e11224..26512b1 100644 --- a/win/tclWinLoad.c +++ b/win/tclWinLoad.c @@ -102,37 +102,39 @@ TclpDlopen( * better if there was a way to get what DLLs */ - switch (lastError) { - case ERROR_MOD_NOT_FOUND: - Tcl_SetErrorCode(interp, "WIN_LOAD", "MOD_NOT_FOUND", NULL); - goto notFoundMsg; - case ERROR_DLL_NOT_FOUND: - Tcl_SetErrorCode(interp, "WIN_LOAD", "DLL_NOT_FOUND", NULL); - notFoundMsg: - Tcl_AppendToObj(errMsg, "this library or a dependent library" - " could not be found in library path", -1); - break; - case ERROR_PROC_NOT_FOUND: - Tcl_SetErrorCode(interp, "WIN_LOAD", "PROC_NOT_FOUND", NULL); - Tcl_AppendToObj(errMsg, "A function specified in the import" - " table could not be resolved by the system. Windows" - " is not telling which one, I'm sorry.", -1); - break; - case ERROR_INVALID_DLL: - Tcl_SetErrorCode(interp, "WIN_LOAD", "INVALID_DLL", NULL); - Tcl_AppendToObj(errMsg, "this library or a dependent library" - " is damaged", -1); - break; - case ERROR_DLL_INIT_FAILED: - Tcl_SetErrorCode(interp, "WIN_LOAD", "DLL_INIT_FAILED", NULL); - Tcl_AppendToObj(errMsg, "the library initialization" - " routine failed", -1); - break; - default: - TclWinConvertError(lastError); - Tcl_AppendToObj(errMsg, Tcl_PosixError(interp), -1); + if (interp) { + switch (lastError) { + case ERROR_MOD_NOT_FOUND: + Tcl_SetErrorCode(interp, "WIN_LOAD", "MOD_NOT_FOUND", NULL); + goto notFoundMsg; + case ERROR_DLL_NOT_FOUND: + Tcl_SetErrorCode(interp, "WIN_LOAD", "DLL_NOT_FOUND", NULL); + notFoundMsg: + Tcl_AppendToObj(errMsg, "this library or a dependent library" + " could not be found in library path", -1); + break; + case ERROR_PROC_NOT_FOUND: + Tcl_SetErrorCode(interp, "WIN_LOAD", "PROC_NOT_FOUND", NULL); + Tcl_AppendToObj(errMsg, "A function specified in the import" + " table could not be resolved by the system. Windows" + " is not telling which one, I'm sorry.", -1); + break; + case ERROR_INVALID_DLL: + Tcl_SetErrorCode(interp, "WIN_LOAD", "INVALID_DLL", NULL); + Tcl_AppendToObj(errMsg, "this library or a dependent library" + " is damaged", -1); + break; + case ERROR_DLL_INIT_FAILED: + Tcl_SetErrorCode(interp, "WIN_LOAD", "DLL_INIT_FAILED", NULL); + Tcl_AppendToObj(errMsg, "the library initialization" + " routine failed", -1); + break; + default: + TclWinConvertError(lastError); + Tcl_AppendToObj(errMsg, Tcl_PosixError(interp), -1); + } + Tcl_SetObjResult(interp, errMsg); } - Tcl_SetObjResult(interp, errMsg); return TCL_ERROR; } -- cgit v0.12 From 87bfeefdb63886437c8e4143e939eac72ca27660 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 7 Oct 2015 13:32:29 +0000 Subject: Fix [8587cb648c445f7]: clock default format incorrect --- doc/clock.n | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/clock.n b/doc/clock.n index a0cc63e..0460a54 100644 --- a/doc/clock.n +++ b/doc/clock.n @@ -16,13 +16,13 @@ package require \fBTcl 8.5\fR .sp \fBclock format\fR \fItimeVal\fR ?\fI\-option value\fR...? .sp -\fBclock microseconds\fR +\fBclock microseconds\fR .sp -\fBclock milliseconds\fR +\fBclock milliseconds\fR .sp \fBclock scan\fR \fIinputString\fR ?\fI\-option value\fR...? .sp -\fBclock seconds\fR +\fBclock seconds\fR .sp .BE .SH "DESCRIPTION" @@ -58,10 +58,10 @@ Formats a time that is expressed as an integer number of seconds into a format intended for consumption by users or external programs. See \fBFORMATTING TIMES\fR for a full description. .TP -\fBclock microseconds\fR +\fBclock microseconds\fR Returns the current time as an integer number of microseconds. See \fBHIGH RESOLUTION TIMERS\fR for a full description. .TP -\fBclock milliseconds\fR +\fBclock milliseconds\fR Returns the current time as an integer number of milliseconds. See \fBHIGH RESOLUTION TIMERS\fR for a full description. .TP \fBclock scan\fR \fIinputString\fR ?\fI\-option value\fR...? @@ -69,7 +69,7 @@ Scans a time that is expressed as a character string and produces an integer number of seconds. See \fBSCANNING TIMES\fR for a full description. .TP -\fBclock seconds\fR +\fBclock seconds\fR Returns the current time as an integer number of seconds. .SS "PARAMETERS" .TP @@ -112,7 +112,7 @@ and their interpretation, are described under \fBFORMAT GROUPS\fR. .PP On \fBclock format\fR, the default format is .CS -%a %b %d %H:%M:%S %z %Y +%a %b %d %H:%M:%S %Z %Y .CE .PP On \fBclock scan\fR, the lack of a \fI\-format\fR option indicates that a @@ -514,7 +514,7 @@ string of the same meaning in the locale, to indicate whether \fB%Y\fR refers to years before or after Year 1 of the Common Era. On input, accepts the string \fBB.C.E.\fR, \fBB.C.\fR, \fBC.E.\fR, \fBA.D.\fR, or the abbreviation appropriate to the current locale, and uses it to fix -whether \fB%Y\fR refers to years before or after Year 1 of the +whether \fB%Y\fR refers to years before or after Year 1 of the Common Era. .TP \fB%Ex\fR @@ -673,8 +673,8 @@ ISO8601 week number. \fB%w\fR On output, produces the ordinal number of the day of the week (Sunday==0; Saturday==6). On input, accepts a single digit and -interprets it as the day of the week; Sunday may be represented as -either 0 or 7. Note that \fB%w\fR is not the ISO8601 weekday number, +interprets it as the day of the week; Sunday may be represented as +either 0 or 7. Note that \fB%w\fR is not the ISO8601 weekday number, which is produced and accepted by \fB%u\fR. .TP \fB%W\fR @@ -753,7 +753,7 @@ The local time zone from the Control Panel on Windows systems. The C library's idea of the local time zone, as defined by the \fBmktime\fR and \fBlocaltime\fR functions. .PP -In case [1] \fIonly,\fR the string is tested to see if it is one +In case [1] \fIonly,\fR the string is tested to see if it is one of the strings: .CS gmt ut utc bst wet wat at @@ -769,7 +769,7 @@ of the strings: If it is a string in the above list, it designates a known time zone, and is interpreted as such. .PP -For time zones in case [1] that do not match any of the above strings, +For time zones in case [1] that do not match any of the above strings, and always for cases [2]-[6], the following rules apply. .PP If the time zone begins with a colon, it is one of a @@ -876,7 +876,7 @@ giving an explicit \fI\-format\fR option to the \fBclock scan\fR command. .TP \fIrelative time\fR A specification relative to the current time. The format is \fBnumber -unit\fR. Acceptable units are \fByear\fR, \fBfortnight\fR, +unit\fR. Acceptable units are \fByear\fR, \fBfortnight\fR, \fBmonth\fR, \fBweek\fR, \fBday\fR, \fBhour\fR, \fBminute\fR (or \fBmin\fR), and \fBsecond\fR (or \fBsec\fR). The unit can be specified as a singular or plural, as in \fB3 weeks\fR. -- cgit v0.12 From 404bcc3435d7a5ce178b4b84c86833285d3aa1d4 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 8 Oct 2015 14:41:46 +0000 Subject: Decorate Tcl_Exit() and Tcl_SetExitProc()'s argument with TCL_NORETURN as appropriate, as already done with Tcl_Panic() earlier. Fix minor msvc compiler warning in tclWinFile.c --- generic/tcl.decls | 4 ++-- generic/tclDecls.h | 8 ++++---- generic/tclEvent.c | 8 ++++---- win/tclWinFile.c | 3 +-- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/generic/tcl.decls b/generic/tcl.decls index a5cd24d..797a5a7 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -480,7 +480,7 @@ declare 132 { void Tcl_EventuallyFree(ClientData clientData, Tcl_FreeProc *freeProc) } declare 133 { - void Tcl_Exit(int status) + TCL_NORETURN void Tcl_Exit(int status) } declare 134 { int Tcl_ExposeCommand(Tcl_Interp *interp, const char *hiddenCmdToken, @@ -1872,7 +1872,7 @@ declare 518 { # TIP#121 (exit handler) dkf for Joe Mistachkin declare 519 { - Tcl_ExitProc *Tcl_SetExitProc(Tcl_ExitProc *proc) + Tcl_ExitProc *Tcl_SetExitProc(TCL_NORETURN1 Tcl_ExitProc *proc) } # TIP#143 (resource limits) dkf diff --git a/generic/tclDecls.h b/generic/tclDecls.h index 996129d..b022d3c 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -417,7 +417,7 @@ EXTERN int Tcl_EvalObj(Tcl_Interp *interp, Tcl_Obj *objPtr); EXTERN void Tcl_EventuallyFree(ClientData clientData, Tcl_FreeProc *freeProc); /* 133 */ -EXTERN void Tcl_Exit(int status); +EXTERN TCL_NORETURN void Tcl_Exit(int status); /* 134 */ EXTERN int Tcl_ExposeCommand(Tcl_Interp *interp, const char *hiddenCmdToken, @@ -1500,7 +1500,7 @@ EXTERN void Tcl_GetCommandFullName(Tcl_Interp *interp, EXTERN int Tcl_FSEvalFileEx(Tcl_Interp *interp, Tcl_Obj *fileName, const char *encodingName); /* 519 */ -EXTERN Tcl_ExitProc * Tcl_SetExitProc(Tcl_ExitProc *proc); +EXTERN Tcl_ExitProc * Tcl_SetExitProc(TCL_NORETURN1 Tcl_ExitProc *proc); /* 520 */ EXTERN void Tcl_LimitAddHandler(Tcl_Interp *interp, int type, Tcl_LimitHandlerProc *handlerProc, @@ -1976,7 +1976,7 @@ typedef struct TclStubs { int (*tcl_EvalFile) (Tcl_Interp *interp, const char *fileName); /* 130 */ int (*tcl_EvalObj) (Tcl_Interp *interp, Tcl_Obj *objPtr); /* 131 */ void (*tcl_EventuallyFree) (ClientData clientData, Tcl_FreeProc *freeProc); /* 132 */ - void (*tcl_Exit) (int status); /* 133 */ + TCL_NORETURN1 void (*tcl_Exit) (int status); /* 133 */ int (*tcl_ExposeCommand) (Tcl_Interp *interp, const char *hiddenCmdToken, const char *cmdName); /* 134 */ int (*tcl_ExprBoolean) (Tcl_Interp *interp, const char *expr, int *ptr); /* 135 */ int (*tcl_ExprBooleanObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *ptr); /* 136 */ @@ -2370,7 +2370,7 @@ typedef struct TclStubs { Tcl_Command (*tcl_GetCommandFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr); /* 516 */ void (*tcl_GetCommandFullName) (Tcl_Interp *interp, Tcl_Command command, Tcl_Obj *objPtr); /* 517 */ int (*tcl_FSEvalFileEx) (Tcl_Interp *interp, Tcl_Obj *fileName, const char *encodingName); /* 518 */ - Tcl_ExitProc * (*tcl_SetExitProc) (Tcl_ExitProc *proc); /* 519 */ + Tcl_ExitProc * (*tcl_SetExitProc) (TCL_NORETURN1 Tcl_ExitProc *proc); /* 519 */ void (*tcl_LimitAddHandler) (Tcl_Interp *interp, int type, Tcl_LimitHandlerProc *handlerProc, ClientData clientData, Tcl_LimitHandlerDeleteProc *deleteProc); /* 520 */ void (*tcl_LimitRemoveHandler) (Tcl_Interp *interp, int type, Tcl_LimitHandlerProc *handlerProc, ClientData clientData); /* 521 */ int (*tcl_LimitReady) (Tcl_Interp *interp); /* 522 */ diff --git a/generic/tclEvent.c b/generic/tclEvent.c index 281ff6c..8305410 100644 --- a/generic/tclEvent.c +++ b/generic/tclEvent.c @@ -89,7 +89,7 @@ static int subsystemsInitialized = 0; * non-NULL value. */ -static Tcl_ExitProc *appExitPtr = NULL; +static TCL_NORETURN1 Tcl_ExitProc *appExitPtr = NULL; typedef struct ThreadSpecificData { ExitHandler *firstExitPtr; /* First in list of all exit handlers for this @@ -857,7 +857,7 @@ Tcl_DeleteThreadExitHandler( Tcl_ExitProc * Tcl_SetExitProc( - Tcl_ExitProc *proc) /* New exit handler for app or NULL */ + TCL_NORETURN1 Tcl_ExitProc *proc) /* New exit handler for app or NULL */ { Tcl_ExitProc *prevExitProc; @@ -933,12 +933,12 @@ InvokeExitHandlers(void) *---------------------------------------------------------------------- */ -void +TCL_NORETURN void Tcl_Exit( int status) /* Exit status for application; typically 0 * for normal return, 1 for error return. */ { - Tcl_ExitProc *currentAppExitPtr; + TCL_NORETURN1 Tcl_ExitProc *currentAppExitPtr; Tcl_MutexLock(&exitMutex); currentAppExitPtr = appExitPtr; diff --git a/win/tclWinFile.c b/win/tclWinFile.c index be9c947..25c6ea4 100755 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -1467,8 +1467,7 @@ TclpGetUserHome( * User exists but has no home dir. Return * "{GetProfilesDirectory}/". */ - DWORD size = MAX_PATH; - int i; + DWORD i, size = MAX_PATH; GetProfilesDirectoryW(buf, &size); for (i = 0; i < size; ++i){ if (buf[i] == '\\') buf[i] = '/'; -- cgit v0.12 From 6816e77cbfb64f58b952d8cd4fe20e69141729ee Mon Sep 17 00:00:00 2001 From: stwo Date: Fri, 9 Oct 2015 13:18:48 +0000 Subject: Tcl/OpenBSD/Sparc needs -fPIC. --- unix/configure | 2 +- unix/tcl.m4 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/configure b/unix/configure index 31758c3..27e147b 100755 --- a/unix/configure +++ b/unix/configure @@ -7527,7 +7527,7 @@ fi ;; *) case "$arch" in - alpha|sparc64) + alpha|sparc|sparc64) SHLIB_CFLAGS="-fPIC" ;; *) diff --git a/unix/tcl.m4 b/unix/tcl.m4 index d896d05..83c3fb1 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1518,7 +1518,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ ;; *) case "$arch" in - alpha|sparc64) + alpha|sparc|sparc64) SHLIB_CFLAGS="-fPIC" ;; *) -- cgit v0.12 From 2a1ef7e5c60cf8a23a9da2c301fd4044c9f0db0e Mon Sep 17 00:00:00 2001 From: stwo Date: Fri, 9 Oct 2015 13:30:49 +0000 Subject: Tcl/OpenBSD/Sparc needs -fPIC. --- unix/configure | 2 +- unix/tcl.m4 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/configure b/unix/configure index 1899aa3..bbac11d 100755 --- a/unix/configure +++ b/unix/configure @@ -7579,7 +7579,7 @@ fi ;; *) case "$arch" in - alpha|sparc64) + alpha|sparc|sparc64) SHLIB_CFLAGS="-fPIC" ;; *) diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 3db997a..d7d6a7b 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1542,7 +1542,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ ;; *) case "$arch" in - alpha|sparc64) + alpha|sparc|sparc64) SHLIB_CFLAGS="-fPIC" ;; *) -- cgit v0.12 From 2c3171b7932c069b7f8c7bbfdbdb199251e2399e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 9 Oct 2015 14:40:28 +0000 Subject: Make autoconf > 2.59 work warning-free --- win/Makefile.in | 1 + 1 file changed, 1 insertion(+) diff --git a/win/Makefile.in b/win/Makefile.in index c0d8668..b3417e7 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -22,6 +22,7 @@ exec_prefix = @exec_prefix@ bindir = @bindir@ libdir = @libdir@ includedir = @includedir@ +datarootdir = @datarootdir@ mandir = @mandir@ # The following definition can be set to non-null for special systems like AFS -- cgit v0.12 From 7ac2d8cc226958fbe8a0c9014c2cadae69a31e06 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sat, 10 Oct 2015 12:37:34 +0000 Subject: Fix minor msvc compiler warning in tclWinFile.c --- win/tclWinFile.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 73a2183..41de4a8 100755 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -1479,8 +1479,7 @@ TclpGetUserHome( * User exists but has no home dir. Return * "{GetProfilesDirectory}/". */ - DWORD size = MAX_PATH; - int i; + DWORD i, size = MAX_PATH; getProfilesDirectoryProc(buf, &size); for (i = 0; i < size; ++i){ if (buf[i] == '\\') buf[i] = '/'; -- cgit v0.12 From de3fd77202d2f00e549b962c6b56a85f5d8d7042 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 12 Oct 2015 09:57:26 +0000 Subject: Various build fixes, when using Cygwin shell in combination with native MinGW compiler. Contributed by pooryorick. --- win/Makefile.in | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/win/Makefile.in b/win/Makefile.in index b3417e7..e9a28c4 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -102,10 +102,15 @@ COMPAT_DIR = @srcdir@/../compat # Converts a POSIX path to a Windows native path. CYGPATH = @CYGPATH@ -GENERIC_DIR_NATIVE = $(shell $(CYGPATH) '$(GENERIC_DIR)' | sed 's!\\!/!g') -TOMMATH_DIR_NATIVE = $(shell $(CYGPATH) '$(TOMMATH_DIR)' | sed 's!\\!/!g') -WIN_DIR_NATIVE = $(shell $(CYGPATH) '$(WIN_DIR)' | sed 's!\\!/!g') -ROOT_DIR_NATIVE = $(shell $(CYGPATH) '$(ROOT_DIR)' | sed 's!\\!/!g') +libdir_native = $(shell $(CYGPATH) '$(libdir)') +bindir_native = $(shell $(CYGPATH) '$(bindir)') +includedir_native = $(shell $(CYGPATH) '$(includedir)') +mandir_native = $(shell $(CYGPATH) '$(mandir)') +TCL_LIBRARY_NATIVE = $(shell $(CYGPATH) '$(TCL_LIBRARY)') +GENERIC_DIR_NATIVE = $(shell $(CYGPATH) '$(GENERIC_DIR)') +TOMMATH_DIR_NATIVE = $(shell $(CYGPATH) '$(TOMMATH_DIR)') +WIN_DIR_NATIVE = $(shell $(CYGPATH) '$(WIN_DIR)') +ROOT_DIR_NATIVE = $(shell $(CYGPATH) '$(ROOT_DIR)') #GENERIC_DIR_NATIVE = $(GENERIC_DIR) #TOMMATH_DIR_NATIVE = $(TOMMATH_DIR) #WIN_DIR_NATIVE = $(WIN_DIR) @@ -114,7 +119,7 @@ ROOT_DIR_NATIVE = $(shell $(CYGPATH) '$(ROOT_DIR)' | sed 's!\\!/!g') # Fully qualify library path so that `make test` # does not depend on the current directory. LIBRARY_DIR1 = $(shell cd '$(ROOT_DIR_NATIVE)/library' ; pwd) -LIBRARY_DIR = $(shell $(CYGPATH) '$(LIBRARY_DIR1)' | sed 's!\\!/!g') +LIBRARY_DIR = $(shell $(CYGPATH) '$(LIBRARY_DIR1)') DLLSUFFIX = @DLLSUFFIX@ LIBSUFFIX = @LIBSUFFIX@ EXESUFFIX = @EXESUFFIX@ @@ -503,17 +508,17 @@ tclWinDde.${OBJEXT} : tclWinDde.c tclPkgConfig.${OBJEXT}: tclPkgConfig.c $(CC) -c $(CC_SWITCHES) \ - -DCFG_INSTALL_LIBDIR=\"$(LIB_INSTALL_DIR)\" \ - -DCFG_INSTALL_BINDIR=\"$(BIN_INSTALL_DIR)\" \ - -DCFG_INSTALL_SCRDIR=\"$(SCRIPT_INSTALL_DIR)\" \ - -DCFG_INSTALL_INCDIR=\"$(INCLUDE_INSTALL_DIR)\" \ + -DCFG_INSTALL_LIBDIR=\"$(LIB_INSTALL_DIR_NATIVE)\" \ + -DCFG_INSTALL_BINDIR=\"$(BIN_INSTALL_DIR_NATIVE)\" \ + -DCFG_INSTALL_SCRDIR=\"$(SCRIPT_INSTALL_DIR_NATIVE)\" \ + -DCFG_INSTALL_INCDIR=\"$(INCLUDE_INSTALL_DIR_NATIVE)\" \ -DCFG_INSTALL_DOCDIR=\"$(MAN_INSTALL_DIR)\" \ \ - -DCFG_RUNTIME_LIBDIR=\"$(libdir)\" \ - -DCFG_RUNTIME_BINDIR=\"$(bindir)\" \ - -DCFG_RUNTIME_SCRDIR=\"$(TCL_LIBRARY)\" \ - -DCFG_RUNTIME_INCDIR=\"$(includedir)\" \ - -DCFG_RUNTIME_DOCDIR=\"$(mandir)\" \ + -DCFG_RUNTIME_LIBDIR=\"$(libdir_native)\" \ + -DCFG_RUNTIME_BINDIR=\"$(bindir_native)\" \ + -DCFG_RUNTIME_SCRDIR=\"$(TCL_LIBRARY_NATIVE)\" \ + -DCFG_RUNTIME_INCDIR=\"$(includedir_native)\" \ + -DCFG_RUNTIME_DOCDIR=\"$(mandir_native)\" \ -DBUILD_tcl \ @DEPARG@ $(CC_OBJNAME) -- cgit v0.12 From b26b272f52e27f26233144697e4526a6f156e4c0 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sat, 17 Oct 2015 07:21:19 +0000 Subject: Proposed fix for [ba44e415a0]: "Use of mutexLock causes problem with reactive event handling in AndroWish". This basically undoes the retry mechamism in Tcl_MutexLock, introduced in [9f8b7bea53]. Does this retry mechamism hurt more than it helps? Feedback requested. --- unix/tclUnixThrd.c | 51 +++++---------------------------------------------- win/tclWinThrd.c | 37 +++++-------------------------------- 2 files changed, 10 insertions(+), 78 deletions(-) diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c index ae81c5f..0e8070d 100644 --- a/unix/tclUnixThrd.c +++ b/unix/tclUnixThrd.c @@ -22,19 +22,6 @@ typedef struct ThreadSpecificData { static Tcl_ThreadDataKey dataKey; /* - * This is the number of milliseconds to wait between internal retries in - * the Tcl_MutexLock function. This value must be greater than zero and - * should be a suitable value for the given platform. - * - * TODO: This may need to be dynamically determined, based on the relative - * performance of the running process. - */ - -#ifndef TCL_MUTEX_LOCK_SLEEP_TIME -# define TCL_MUTEX_LOCK_SLEEP_TIME (25) -#endif - -/* * masterLock is used to serialize creation of mutexes, condition variables, * and thread local storage. This is the only place that can count on the * ability to statically initialize the mutex. @@ -58,13 +45,6 @@ static pthread_mutex_t allocLock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t *allocLockPtr = &allocLock; /* - * The mutexLock serializes Tcl_MutexLock. This is necessary to prevent - * races when finalizing a mutex that some other thread may want to lock. - */ - -static pthread_mutex_t mutexLock = PTHREAD_MUTEX_INITIALIZER; - -/* * These are for the critical sections inside this file. */ @@ -380,7 +360,6 @@ TclpMasterUnlock(void) pthread_mutex_unlock(&masterLock); #endif } - /* *---------------------------------------------------------------------- @@ -457,32 +436,12 @@ retry: } MASTER_UNLOCK; } - while (1) { - pthread_mutex_lock(&mutexLock); - pmutexPtr = *((pthread_mutex_t **)mutexPtr); - if (pmutexPtr == NULL) { - pthread_mutex_unlock(&mutexLock); - goto retry; - } - if (pthread_mutex_trylock(pmutexPtr) == 0) { - pthread_mutex_unlock(&mutexLock); - return; - } - pthread_mutex_unlock(&mutexLock); - /* - * BUGBUG: All core and Thread package tests pass when usleep() - * is used; however, the Thread package tests hang at - * various places when Tcl_Sleep() is used, typically - * while running test "thread-17.8", "thread-17.9", or - * "thread-17.11a". Really, what we want here is just - * to yield to other threads for a while. - */ -#ifdef HAVE_USLEEP - usleep(TCL_MUTEX_LOCK_SLEEP_TIME * 1000); -#else - Tcl_Sleep(TCL_MUTEX_LOCK_SLEEP_TIME); -#endif + + pmutexPtr = *((pthread_mutex_t **)mutexPtr); + if (pmutexPtr == NULL) { + goto retry; } + pthread_mutex_lock(pmutexPtr); } /* diff --git a/win/tclWinThrd.c b/win/tclWinThrd.c index ae7ce80..927e115 100644 --- a/win/tclWinThrd.c +++ b/win/tclWinThrd.c @@ -24,16 +24,6 @@ _CRTIMP unsigned int __cdecl _controlfp (unsigned int unNew, unsigned int unMask #endif /* - * This is the number of milliseconds to wait between internal retries in - * the Tcl_MutexLock function. This value must be greater than or equal - * to zero and should be a suitable value for the given platform. - */ - -#ifndef TCL_MUTEX_LOCK_SLEEP_TIME -# define TCL_MUTEX_LOCK_SLEEP_TIME (0) -#endif - -/* * This is the master lock used to serialize access to other serialization * data structures. */ @@ -67,13 +57,6 @@ static int allocOnce = 0; #endif /* TCL_THREADS */ /* - * The mutexLock serializes Tcl_MutexLock. This is necessary to prevent - * races when finalizing a mutex that some other thread may want to lock. - */ - -static CRITICAL_SECTION mutexLock; - -/* * The joinLock serializes Create- and ExitThread. This is necessary to * prevent a race where a new joinable thread exits before the creating thread * had the time to create the necessary data structures in the emulation @@ -386,7 +369,6 @@ TclpInitLock(void) */ init = 1; - InitializeCriticalSection(&mutexLock); InitializeCriticalSection(&joinLock); InitializeCriticalSection(&initLock); InitializeCriticalSection(&masterLock); @@ -534,7 +516,6 @@ void TclFinalizeLock(void) { MASTER_LOCK; - DeleteCriticalSection(&mutexLock); DeleteCriticalSection(&joinLock); /* @@ -605,20 +586,12 @@ retry: } MASTER_UNLOCK; } - while (1) { - EnterCriticalSection(&mutexLock); - csPtr = *((CRITICAL_SECTION **)mutexPtr); - if (csPtr == NULL) { - LeaveCriticalSection(&mutexLock); - goto retry; - } - if (TryEnterCriticalSection(csPtr)) { - LeaveCriticalSection(&mutexLock); - return; - } - LeaveCriticalSection(&mutexLock); - Tcl_Sleep(TCL_MUTEX_LOCK_SLEEP_TIME); + + csPtr = *((CRITICAL_SECTION **)mutexPtr); + if (csPtr == NULL) { + goto retry; } + EnterCriticalSection(csPtr); } /* -- cgit v0.12 From ec590efe63eabdd8f4a8768f8cadab88ba95033e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 19 Oct 2015 13:52:58 +0000 Subject: typo in comment. Eliminate unnecessary end-of-line spacing. --- generic/tclCompCmdsGR.c | 4 ++-- generic/tclCompCmdsSZ.c | 12 ++++++------ generic/tclDictObj.c | 4 ++-- generic/tclEncoding.c | 2 +- generic/tclFCmd.c | 2 +- generic/tclIORTrans.c | 6 +++--- generic/tclIOSock.c | 10 +++++----- generic/tclObj.c | 4 ++-- generic/tclParse.c | 4 ++-- generic/tclProc.c | 4 ++-- generic/tclResult.c | 4 ++-- 11 files changed, 28 insertions(+), 28 deletions(-) diff --git a/generic/tclCompCmdsGR.c b/generic/tclCompCmdsGR.c index ec9d054..e674fb0 100644 --- a/generic/tclCompCmdsGR.c +++ b/generic/tclCompCmdsGR.c @@ -144,7 +144,7 @@ TclCompileGlobalCmd( return TCL_ERROR; } - /* TODO: Consider what value can pass throug the + /* TODO: Consider what value can pass throug the * IndexTailVarIfKnown() screen. Full CompileWord() * likely does not apply here. Push known value instead. */ CompileWord(envPtr, varTokenPtr, interp, i); @@ -2890,7 +2890,7 @@ TclCompileVariableCmd( return TCL_ERROR; } - /* TODO: Consider what value can pass throug the + /* TODO: Consider what value can pass throug the * IndexTailVarIfKnown() screen. Full CompileWord() * likely does not apply here. Push known value instead. */ CompileWord(envPtr, varTokenPtr, interp, i); diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c index 5d3ffd3..ef9340e 100644 --- a/generic/tclCompCmdsSZ.c +++ b/generic/tclCompCmdsSZ.c @@ -292,7 +292,7 @@ TclCompileStringCatCmd( PushStringLiteral(envPtr, ""); return TCL_OK; } - + /* General case: issue CONCAT1's (by chunks of 254 if needed), folding contiguous constants along the way */ @@ -313,7 +313,7 @@ TclCompileStringCatCmd( if (folded) { int len; const char *bytes = Tcl_GetStringFromObj(folded, &len); - + PushLiteral(envPtr, bytes, len); Tcl_DecrRefCount(folded); folded = NULL; @@ -331,7 +331,7 @@ TclCompileStringCatCmd( if (folded) { int len; const char *bytes = Tcl_GetStringFromObj(folded, &len); - + PushLiteral(envPtr, bytes, len); Tcl_DecrRefCount(folded); folded = NULL; @@ -1003,7 +1003,7 @@ TclCompileStringRangeCmd( /* * Push the operands onto the stack and then the substring operation. - */ + */ nonConstantIndices: CompileWord(envPtr, stringTokenPtr, interp, 1); @@ -2182,7 +2182,7 @@ IssueSwitchChainedTests( } /* - * Now do the actual compilation. Note that we do not use BODY() + * Now do the actual compilation. Note that we do not use BODY() * because we may have synthesized the tokens in a non-standard * pattern. */ @@ -2640,7 +2640,7 @@ TclCompileThrowCmd( } CompileWord(envPtr, msgToken, interp, 2); - codeIsList = codeKnown && (TCL_OK == + codeIsList = codeKnown && (TCL_OK == Tcl_ListObjLength(interp, objPtr, &len)); codeIsValid = codeIsList && (len != 0); diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c index 980f0a8..c8474e6 100644 --- a/generic/tclDictObj.c +++ b/generic/tclDictObj.c @@ -3051,14 +3051,14 @@ DictFilterCmd( Tcl_IncrRefCount(valueObj); if (Tcl_ObjSetVar2(interp, keyVarObj, NULL, keyObj, TCL_LEAVE_ERR_MSG) == NULL) { - Tcl_AddErrorInfo(interp, + Tcl_AddErrorInfo(interp, "\n (\"dict filter\" filter script key variable)"); result = TCL_ERROR; goto abnormalResult; } if (Tcl_ObjSetVar2(interp, valueVarObj, NULL, valueObj, TCL_LEAVE_ERR_MSG) == NULL) { - Tcl_AddErrorInfo(interp, + Tcl_AddErrorInfo(interp, "\n (\"dict filter\" filter script value variable)"); result = TCL_ERROR; goto abnormalResult; diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 4ae017d..4edebcf 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -1450,7 +1450,7 @@ Tcl_UtfToExternal( * * Side effects: * The absolute pathname for the application is computed and stored to be - * returned later be [info nameofexecutable]. + * returned later by [info nameofexecutable]. * *--------------------------------------------------------------------------- */ diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c index f335269..bb814ea 100644 --- a/generic/tclFCmd.c +++ b/generic/tclFCmd.c @@ -120,7 +120,7 @@ FileCopyRename( } i++; if ((objc - i) < 2) { - Tcl_WrongNumArgs(interp, 1, objv, + Tcl_WrongNumArgs(interp, 1, objv, "?-option value ...? source ?source ...? target"); return TCL_ERROR; } diff --git a/generic/tclIORTrans.c b/generic/tclIORTrans.c index 8baa9ad..af86ba5 100644 --- a/generic/tclIORTrans.c +++ b/generic/tclIORTrans.c @@ -943,7 +943,7 @@ ReflectClose( Tcl_EventuallyFree(rtPtr, (Tcl_FreeProc *) FreeReflectedTransform); return errorCode; - } + } #endif /* TCL_THREADS */ errorCodeSet = 1; goto cleanup; @@ -957,7 +957,7 @@ ReflectClose( Tcl_EventuallyFree(rtPtr, (Tcl_FreeProc *) FreeReflectedTransform); return errorCode; - } + } #endif /* TCL_THREADS */ errorCodeSet = 1; goto cleanup; @@ -1177,7 +1177,7 @@ ReflectInput( */ rtPtr->eofPending = 1; - + /* * Now this is a bit different. The partial data waiting is * converted and returned. diff --git a/generic/tclIOSock.c b/generic/tclIOSock.c index f69d30f..d578d19 100644 --- a/generic/tclIOSock.c +++ b/generic/tclIOSock.c @@ -23,7 +23,7 @@ static Tcl_ThreadDataKey dataKey; #undef gai_strerror static const char *gai_strerror(int code) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - + if (tsdPtr->initialized) { Tcl_DStringFree(&tsdPtr->errorMsg); } else { @@ -187,11 +187,11 @@ TclCreateSocketAddress( TclFormatInt(portbuf, port); portstring = portbuf; } - + (void) memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; - /* + /* * Magic variable to enforce a certain address family - to be superseded * by a TIP that adds explicit switches to [socket] */ @@ -228,7 +228,7 @@ TclCreateSocketAddress( if (willBind) { hints.ai_flags |= AI_PASSIVE; - } + } result = getaddrinfo(native, portstring, &hints, addrlist); @@ -283,7 +283,7 @@ TclCreateSocketAddress( for (p = *addrlist; p != NULL; p = p->ai_next) { i++; } - + return 1; } diff --git a/generic/tclObj.c b/generic/tclObj.c index 15ea91f..c641152 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -3972,10 +3972,10 @@ TclCompareObjKeys( /* * If the object pointers are the same then they match. * OPT: this comparison was moved to the caller - + if (objPtr1 == objPtr2) return 1; */ - + /* * Don't use Tcl_GetStringFromObj as it would prevent l1 and l2 being * in a register. diff --git a/generic/tclParse.c b/generic/tclParse.c index effc201..95abc45 100644 --- a/generic/tclParse.c +++ b/generic/tclParse.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ - + #include "tclInt.h" #include "tclParse.h" #include @@ -1915,7 +1915,7 @@ Tcl_ParseQuotedString( * flags argument to provide support for the -nobackslashes, -nocommands, * and -novariables options, as represented by the flag values * TCL_SUBST_BACKSLASHES, TCL_SUBST_COMMANDS, TCL_SUBST_VARIABLES. - * + * * Results: * None. * diff --git a/generic/tclProc.c b/generic/tclProc.c index 02bda51..ac65bde 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -1854,8 +1854,8 @@ InterpProcNR2( if (result != TCL_OK) { goto process; } - - done: + + done: if (TCL_DTRACE_PROC_RESULT_ENABLED()) { int l = iPtr->varFramePtr->isProcCallFrame & FRAME_IS_LAMBDA ? 1 : 0; Tcl_Obj *r = Tcl_GetObjResult(interp); diff --git a/generic/tclResult.c b/generic/tclResult.c index 2f2563a..9d0714c 100644 --- a/generic/tclResult.c +++ b/generic/tclResult.c @@ -1293,7 +1293,7 @@ TclProcessReturn( if (Tcl_IsShared(iPtr->errorStack)) { Tcl_Obj *newObj; - + newObj = Tcl_DuplicateObj(iPtr->errorStack); Tcl_DecrRefCount(iPtr->errorStack); Tcl_IncrRefCount(newObj); @@ -1626,7 +1626,7 @@ TclNoErrorStack( Tcl_Obj *options) { Tcl_Obj **keys = GetKeys(); - + Tcl_DictObjRemove(interp, options, keys[KEY_ERRORSTACK]); return options; } -- cgit v0.12 From 742b7cee05467846b9ad80a57eacf888dffa845f Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 19 Oct 2015 14:07:48 +0000 Subject: [154f0982f2] Document that Tcl_NewObjectInstance() really needs to make a namespace. --- doc/Class.3 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/Class.3 b/doc/Class.3 index 7e421fe..1c3fe08 100644 --- a/doc/Class.3 +++ b/doc/Class.3 @@ -71,7 +71,8 @@ The name of the object to create, or NULL if a new unused name is to be automatically selected. .AP "const char" *nsName in The name of the namespace to create for the object's private use, or NULL if a -new unused name is to be automatically selected. +new unused name is to be automatically selected. The namespace must not +already exist. .AP int objc in The number of elements in the \fIobjv\fR array. .AP "Tcl_Obj *const" *objv in -- cgit v0.12 From b8c0c06fdf9f099f27f114fc9c92b7786dce13a5 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 19 Oct 2015 17:42:43 +0000 Subject: Adaptation of the patch re-fixconstraintloops.patch from http://www.postgresql.org/message-id/19394.1444865029@sss.pgh.pa.us --- generic/regc_nfa.c | 655 ++++++++++++++++++++++++++++++++++++++++++++++++----- generic/regcomp.c | 7 + tests/reg.test | 25 ++ 3 files changed, 633 insertions(+), 54 deletions(-) diff --git a/generic/regc_nfa.c b/generic/regc_nfa.c index 1d572c3..20eb3ba 100644 --- a/generic/regc_nfa.c +++ b/generic/regc_nfa.c @@ -34,6 +34,7 @@ #define NISERR() VISERR(nfa->v) #define NERR(e) VERR(nfa->v, (e)) +#define STACK_TOO_DEEP(x) (0) /* - newnfa - set up an NFA @@ -883,6 +884,20 @@ specialcolors( - optimize - optimize an NFA ^ static long optimize(struct nfa *, FILE *); */ + + /* + * The main goal of this function is not so much "optimization" (though it + * does try to get rid of useless NFA states) as reducing the NFA to a form + * the regex executor can handle. The executor, and indeed the cNFA format + * that is its input, can only handle PLAIN and LACON arcs. The output of + * the regex parser also includes EMPTY (do-nothing) arcs, as well as + * ^, $, AHEAD, and BEHIND constraint arcs, which we must get rid of here. + * We first get rid of EMPTY arcs and then deal with the constraint arcs. + * The hardest part of either job is to get rid of circular loops of the + * target arc type. We would have to do that in any case, though, as such a + * loop would otherwise allow the executor to cycle through the loop endlessly + * without making any progress in the input string. + */ static long /* re_info bits */ optimize( struct nfa *nfa, @@ -904,6 +919,7 @@ optimize( if (verbose) { fprintf(f, "\nconstraints:\n"); } + fixconstraintloops(nfa, f); /* get rid of constraint loops */ pullback(nfa, f); /* pull back constraints backward */ pushfwd(nfa, f); /* push fwd constraints forward */ if (verbose) { @@ -914,7 +930,7 @@ optimize( } /* - - pullback - pull back constraints backward to (with luck) eliminate them + - pullback - pull back constraints backward to eliminate them ^ static VOID pullback(struct nfa *, FILE *); */ static void @@ -954,6 +970,12 @@ pullback( return; } + /* + * Any ^ constraints we were able to pull to the start state can now be + * replaced by PLAIN arcs referencing the BOS or BOL colors. There should + * be no other ^ or BEHIND arcs left in the NFA, though we do not check + * that here (compact() will fail if so). + */ for (a=nfa->pre->outs ; a!=NULL ; a=nexta) { nexta = a->outchain; if (a->type == '^') { @@ -982,10 +1004,7 @@ pull( struct arc *nexta; struct state *s; - if (from == to) { /* circular constraint is pointless */ - freearc(nfa, con); - return 1; - } + assert(from != to); /* should have gotten rid of this earlier */ if (from->flag) { /* can't pull back beyond start */ return 0; } @@ -995,25 +1014,6 @@ pull( } /* - * DGP 2007-11-15: Cloning a state with a circular constraint on its list - * of outs can lead to trouble [Bug 1810038], so get rid of them first. - */ - - for (a = from->outs; a != NULL; a = nexta) { - nexta = a->outchain; - switch (a->type) { - case '^': - case '$': - case BEHIND: - case AHEAD: - if (from == a->to) { - freearc(nfa, a); - } - break; - } - } - - /* * First, clone from state if necessary to avoid other outarcs. */ @@ -1022,7 +1022,6 @@ pull( if (NISERR()) { return 0; } - assert(to != from); /* con is not an inarc */ copyins(nfa, from, s, 1); /* duplicate inarcs */ cparc(nfa, con, s, to); /* move constraint arc */ freearc(nfa, con); @@ -1071,7 +1070,7 @@ pull( } /* - - pushfwd - push forward constraints forward to (with luck) eliminate them + - pushfwd - push forward constraints forward to eliminate them ^ static VOID pushfwd(struct nfa *, FILE *); */ static void @@ -1111,6 +1110,12 @@ pushfwd( return; } + /* + * Any $ constraints we were able to push to the post state can now be + * replaced by PLAIN arcs referencing the EOS or EOL colors. There should + * be no other $ or AHEAD arcs left in the NFA, though we do not check + * that here (compact() will fail if so). + */ for (a = nfa->post->ins; a != NULL; a = nexta) { nexta = a->inchain; if (a->type == '$') { @@ -1139,10 +1144,7 @@ push( struct arc *nexta; struct state *s; - if (to == from) { /* circular constraint is pointless */ - freearc(nfa, con); - return 1; - } + assert(to != from); /* should have gotten rid of this earlier */ if (to->flag) { /* can't push forward beyond end */ return 0; } @@ -1152,28 +1154,6 @@ push( } /* - * DGP 2007-11-15: Here we duplicate the same protections as appear - * in pull() above to avoid troubles with cloning a state with a - * circular constraint on its list of ins. It is not clear whether - * this is necessary, or is protecting against a "can't happen". - * Any test case that actually leads to a freearc() call here would - * be a welcome addition to the test suite. - */ - - for (a = to->ins; a != NULL; a = nexta) { - nexta = a->inchain; - switch (a->type) { - case '^': - case '$': - case BEHIND: - case AHEAD: - if (a->from == to) { - freearc(nfa, a); - } - break; - } - } - /* * First, clone to state if necessary to avoid other inarcs. */ @@ -1503,6 +1483,573 @@ replaceempty( copyins(nfa, from, to, 0); } + +/* + * isconstraintarc - detect whether an arc is of a constraint type + */ +static inline int +isconstraintarc(struct arc * a) +{ + switch (a->type) + { + case '^': + case '$': + case BEHIND: + case AHEAD: + case LACON: + return 1; + } + return 0; +} + +/* + * hasconstraintout - does state have a constraint out arc? + */ +static int +hasconstraintout(struct state * s) +{ + struct arc *a; + + for (a = s->outs; a != NULL; a = a->outchain) { + if (isconstraintarc(a)) { + return 1; + } + } + return 0; +} + +/* + * fixconstraintloops - get rid of loops containing only constraint arcs + * + * A loop of states that contains only constraint arcs is useless, since + * passing around the loop represents no forward progress. Moreover, it + * would cause infinite looping in pullback/pushfwd, so we need to get rid + * of such loops before doing that. + */ +static void +fixconstraintloops( + struct nfa * nfa, + FILE *f) /* for debug output; NULL none */ +{ + struct state *s; + struct state *nexts; + struct arc *a; + struct arc *nexta; + int hasconstraints; + + /* + * In the trivial case of a state that loops to itself, we can just drop + * the constraint arc altogether. This is worth special-casing because + * such loops are far more common than loops containing multiple states. + * While we're at it, note whether any constraint arcs survive. + */ + hasconstraints = 0; + for (s = nfa->states; s != NULL && !NISERR(); s = nexts) { + nexts = s->next; + /* while we're at it, ensure tmp fields are clear for next step */ + assert(s->tmp == NULL); + for (a = s->outs; a != NULL && !NISERR(); a = nexta) { + nexta = a->outchain; + if (isconstraintarc(a)) { + if (a->to == s) { + freearc(nfa, a); + } else { + hasconstraints = 1; + } + } + } + /* If we removed all the outarcs, the state is useless. */ + if (s->nouts == 0 && !s->flag) { + dropstate(nfa, s); + } + } + + /* Nothing to do if no remaining constraint arcs */ + if (NISERR() || !hasconstraints) { + return; + } + + /* + * Starting from each remaining NFA state, search outwards for a + * constraint loop. If we find a loop, break the loop, then start the + * search over. (We could possibly retain some state from the first scan, + * but it would complicate things greatly, and multi-state constraint + * loops are rare enough that it's not worth optimizing the case.) + */ + restart: + for (s = nfa->states; s != NULL && !NISERR(); s = s->next) { + if (findconstraintloop(nfa, s)) { + goto restart; + } + } + + if (NISERR()) { + return; + } + + /* + * Now remove any states that have become useless. (This cleanup is not + * very thorough, and would be even less so if we tried to combine it with + * the previous step; but cleanup() will take care of anything we miss.) + * + * Because findconstraintloop intentionally doesn't reset all tmp fields, + * we have to clear them after it's done. This is a convenient place to + * do that, too. + */ + for (s = nfa->states; s != NULL; s = nexts) { + nexts = s->next; + s->tmp = NULL; + if ((s->nins == 0 || s->nouts == 0) && !s->flag) { + dropstate(nfa, s); + } + } + + if (f != NULL) { + dumpnfa(nfa, f); + } +} + +/* + * findconstraintloop - recursively find a loop of constraint arcs + * + * If we find a loop, break it by calling breakconstraintloop(), then + * return 1; otherwise return 0. + * + * State tmp fields are guaranteed all NULL on a success return, because + * breakconstraintloop does that. After a failure return, any state that + * is known not to be part of a loop is marked with s->tmp == s; this allows + * us not to have to re-prove that fact on later calls. (This convention is + * workable because we already eliminated single-state loops.) + * + * Note that the found loop doesn't necessarily include the first state we + * are called on. Any loop reachable from that state will do. + * + * The maximum recursion depth here is one more than the length of the longest + * loop-free chain of constraint arcs, which is surely no more than the size + * of the NFA, and in practice will be a lot less than that. + */ +static int +findconstraintloop(struct nfa * nfa, struct state * s) +{ + struct arc *a; + + /* Since this is recursive, it could be driven to stack overflow */ + if (STACK_TOO_DEEP(nfa->v->re)) { + NERR(REG_ETOOBIG); + return 1; /* to exit as quickly as possible */ + } + + if (s->tmp != NULL) { + /* Already proven uninteresting? */ + if (s->tmp == s) { + return 0; + } + /* Found a loop involving s */ + breakconstraintloop(nfa, s); + /* The tmp fields have been cleaned up by breakconstraintloop */ + return 1; + } + for (a = s->outs; a != NULL; a = a->outchain) { + if (isconstraintarc(a)) { + struct state *sto = a->to; + + assert(sto != s); + s->tmp = sto; + if (findconstraintloop(nfa, sto)) { + return 1; + } + } + } + + /* + * If we get here, no constraint loop exists leading out from s. Mark it + * with s->tmp == s so we need not rediscover that fact again later. + */ + s->tmp = s; + return 0; +} + +/* + * breakconstraintloop - break a loop of constraint arcs + * + * sinitial is any one member state of the loop. Each loop member's tmp + * field links to its successor within the loop. (Note that this function + * will reset all the tmp fields to NULL.) + * + * We can break the loop by, for any one state S1 in the loop, cloning its + * loop successor state S2 (and possibly following states), and then moving + * all S1->S2 constraint arcs to point to the cloned S2. The cloned S2 should + * copy any non-constraint outarcs of S2. Constraint outarcs should be + * dropped if they point back to S1, else they need to be copied as arcs to + * similarly cloned states S3, S4, etc. In general, each cloned state copies + * non-constraint outarcs, drops constraint outarcs that would lead to itself + * or any earlier cloned state, and sends other constraint outarcs to newly + * cloned states. No cloned state will have any inarcs that aren't constraint + * arcs or do not lead from S1 or earlier-cloned states. It's okay to drop + * constraint back-arcs since they would not take us to any state we've not + * already been in; therefore, no new constraint loop is created. In this way + * we generate a modified NFA that can still represent every useful state + * sequence, but not sequences that represent state loops with no consumption + * of input data. Note that the set of cloned states will certainly include + * all of the loop member states other than S1, and it may also include + * non-loop states that are reachable from S2 via constraint arcs. This is + * important because there is no guarantee that findconstraintloop found a + * maximal loop (and searching for one would be NP-hard, so don't try). + * Frequently the "non-loop states" are actually part of a larger loop that + * we didn't notice, and indeed there may be several overlapping loops. + * This technique ensures convergence in such cases, while considering only + * the originally-found loop does not. + * + * If there is only one S1->S2 constraint arc, then that constraint is + * certainly satisfied when we enter any of the clone states. This means that + * in the common case where many of the constraint arcs are identically + * labeled, we can merge together clone states linked by a similarly-labeled + * constraint: if we can get to the first one we can certainly get to the + * second, so there's no need to distinguish. This greatly reduces the number + * of new states needed, so we preferentially break the given loop at a state + * pair where this is true. + * + * Furthermore, it's fairly common to find that a cloned successor state has + * no outarcs, especially if we're a bit aggressive about removing unnecessary + * outarcs. If that happens, then there is simply not any interesting state + * that can be reached through the predecessor's loop arcs, which means we can + * break the loop just by removing those loop arcs, with no new states added. + */ +static void +breakconstraintloop(struct nfa * nfa, struct state * sinitial) +{ + struct state *s; + struct state *shead; + struct state *stail; + struct state *sclone; + struct state *nexts; + struct arc *refarc; + struct arc *a; + struct arc *nexta; + + /* + * Start by identifying which loop step we want to break at. + * Preferentially this is one with only one constraint arc. (XXX are + * there any other secondary heuristics we want to use here?) Set refarc + * to point to the selected lone constraint arc, if there is one. + */ + refarc = NULL; + s = sinitial; + do { + nexts = s->tmp; + assert(nexts != s); /* should not see any one-element loops */ + if (refarc == NULL) { + int narcs = 0; + + for (a = s->outs; a != NULL; a = a->outchain) { + if (a->to == nexts && isconstraintarc(a)) { + refarc = a; + narcs++; + } + } + assert(narcs > 0); + if (narcs > 1) { + refarc = NULL; /* multiple constraint arcs here, no good */ + } + } + s = nexts; + } while (s != sinitial); + + if (refarc) { + /* break at the refarc */ + shead = refarc->from; + stail = refarc->to; + assert(stail == shead->tmp); + } else { + /* for lack of a better idea, break after sinitial */ + shead = sinitial; + stail = sinitial->tmp; + } + + /* + * Reset the tmp fields so that we can use them for local storage in + * clonesuccessorstates. (findconstraintloop won't mind, since it's just + * going to abandon its search anyway.) + */ + for (s = nfa->states; s != NULL; s = s->next) { + s->tmp = NULL; + } + + /* + * Recursively build clone state(s) as needed. + */ + sclone = newstate(nfa); + if (sclone == NULL) { + assert(NISERR()); + return; + } + + clonesuccessorstates(nfa, stail, sclone, shead, refarc, + NULL, NULL, nfa->nstates); + + if (NISERR()) { + return; + } + + /* + * It's possible that sclone has no outarcs at all, in which case it's + * useless. (We don't try extremely hard to get rid of useless states + * here, but this is an easy and fairly common case.) + */ + if (sclone->nouts == 0) { + freestate(nfa, sclone); + sclone = NULL; + } + + /* + * Move shead's constraint-loop arcs to point to sclone, or just drop them + * if we discovered we don't need sclone. + */ + for (a = shead->outs; a != NULL; a = nexta) { + nexta = a->outchain; + if (a->to == stail && isconstraintarc(a)) { + if (sclone) { + cparc(nfa, a, shead, sclone); + } + freearc(nfa, a); + if (NISERR()) { + break; + } + } + } +} + +/* + * clonesuccessorstates - create a tree of constraint-arc successor states + * + * ssource is the state to be cloned, and sclone is the state to copy its + * outarcs into. sclone's inarcs, if any, should already be set up. + * + * spredecessor is the original predecessor state that we are trying to build + * successors for (it may not be the immediate predecessor of ssource). + * refarc, if not NULL, is the original constraint arc that is known to have + * been traversed out of spredecessor to reach the successor(s). + * + * For each cloned successor state, we transiently create a "donemap" that is + * a boolean array showing which source states we've already visited for this + * clone state. This prevents infinite recursion as well as useless repeat + * visits to the same state subtree (which can add up fast, since typical NFAs + * have multiple redundant arc pathways). Each donemap is a char array + * indexed by state number. The donemaps are all of the same size "nstates", + * which is nfa->nstates as of the start of the recursion. This is enough to + * have entries for all pre-existing states, but *not* entries for clone + * states created during the recursion. That's okay since we have no need to + * mark those. + * + * curdonemap is NULL when recursing to a new sclone state, or sclone's + * donemap when we are recursing without having created a new state (which we + * do when we decide we can merge a successor state into the current clone + * state). outerdonemap is NULL at the top level and otherwise the parent + * clone state's donemap. + * + * The successor states we create and fill here form a strict tree structure, + * with each state having exactly one predecessor, except that the toplevel + * state has no inarcs as yet (breakconstraintloop will add its inarcs from + * spredecessor after we're done). Thus, we can examine sclone's inarcs back + * to the root, plus refarc if any, to identify the set of constraints already + * known valid at the current point. This allows us to avoid generating extra + * successor states. + */ +static void +clonesuccessorstates( + struct nfa * nfa, + struct state * ssource, + struct state * sclone, + struct state * spredecessor, + struct arc * refarc, + char *curdonemap, + char *outerdonemap, + int nstates) +{ + char *donemap; + struct arc *a; + + /* Since this is recursive, it could be driven to stack overflow */ + if (STACK_TOO_DEEP(nfa->v->re)) { + NERR(REG_ETOOBIG); + return; + } + + /* If this state hasn't already got a donemap, create one */ + donemap = curdonemap; + if (donemap == NULL) { + donemap = (char *) MALLOC(nstates * sizeof(char)); + if (donemap == NULL) { + NERR(REG_ESPACE); + return; + } + + if (outerdonemap != NULL) { + /* + * Not at outermost recursion level, so copy the outer level's + * donemap; this ensures that we see states in process of being + * visited at outer levels, or already merged into predecessor + * states, as ones we shouldn't traverse back to. + */ + memcpy(donemap, outerdonemap, nstates * sizeof(char)); + } else { + /* At outermost level, only spredecessor is off-limits */ + memset(donemap, 0, nstates * sizeof(char)); + assert(spredecessor->no < nstates); + donemap[spredecessor->no] = 1; + } + } + + /* Mark ssource as visited in the donemap */ + assert(ssource->no < nstates); + assert(donemap[ssource->no] == 0); + donemap[ssource->no] = 1; + + /* + * We proceed by first cloning all of ssource's outarcs, creating new + * clone states as needed but not doing more with them than that. Then in + * a second pass, recurse to process the child clone states. This allows + * us to have only one child clone state per reachable source state, even + * when there are multiple outarcs leading to the same state. Also, when + * we do visit a child state, its set of inarcs is known exactly, which + * makes it safe to apply the constraint-is-already-checked optimization. + * Also, this ensures that we've merged all the states we can into the + * current clone before we recurse to any children, thus possibly saving + * them from making extra images of those states. + * + * While this function runs, child clone states of the current state are + * marked by setting their tmp fields to point to the original state they + * were cloned from. This makes it possible to detect multiple outarcs + * leading to the same state, and also makes it easy to distinguish clone + * states from original states (which will have tmp == NULL). + */ + for (a = ssource->outs; a != NULL && !NISERR(); a = a->outchain) { + struct state *sto = a->to; + + /* + * We do not consider cloning successor states that have no constraint + * outarcs; just link to them as-is. They cannot be part of a + * constraint loop so there is no need to make copies. In particular, + * this rule keeps us from trying to clone the post state, which would + * be a bad idea. + */ + if (isconstraintarc(a) && hasconstraintout(sto)) { + struct state *prevclone; + int canmerge; + struct arc *a2; + + /* + * Back-link constraint arcs must not be followed. Nor is there a + * need to revisit states previously merged into this clone. + */ + assert(sto->no < nstates); + if (donemap[sto->no] != 0) { + continue; + } + + /* + * Check whether we already have a child clone state for this + * source state. + */ + prevclone = NULL; + for (a2 = sclone->outs; a2 != NULL; a2 = a2->outchain) { + if (a2->to->tmp == sto) { + prevclone = a2->to; + break; + } + } + + /* + * If this arc is labeled the same as refarc, or the same as any + * arc we must have traversed to get to sclone, then no additional + * constraints need to be met to get to sto, so we should just + * merge its outarcs into sclone. + */ + if (refarc && a->type == refarc->type && a->co == refarc->co) { + canmerge = 1; + } else { + struct state *s; + + canmerge = 0; + for (s = sclone; s->ins; s = s->ins->from) { + if (s->nins == 1 && + a->type == s->ins->type && a->co == s->ins->co) { + canmerge = 1; + break; + } + } + } + + if (canmerge) { + /* + * We can merge into sclone. If we previously made a child + * clone state, drop it; there's no need to visit it. (This + * can happen if ssource has multiple pathways to sto, and we + * only just now found one that is provably a no-op.) + */ + if (prevclone) { + dropstate(nfa, prevclone); /* kills our outarc, too */ + } + + /* Recurse to merge sto's outarcs into sclone */ + clonesuccessorstates(nfa, sto, sclone, spredecessor, refarc, + donemap, outerdonemap, nstates); + /* sto should now be marked as previously visited */ + assert(NISERR() || donemap[sto->no] == 1); + } else if (prevclone) { + /* + * We already have a clone state for this successor, so just + * make another arc to it. + */ + cparc(nfa, a, sclone, prevclone); + } else { + /* + * We need to create a new successor clone state. + */ + struct state *stoclone; + + stoclone = newstate(nfa); + if (stoclone == NULL) { + assert(NISERR()); + break; + } + /* Mark it as to what it's a clone of */ + stoclone->tmp = sto; + /* ... and add the outarc leading to it */ + cparc(nfa, a, sclone, stoclone); + } + } else { + /* + * Non-constraint outarcs just get copied to sclone, as do outarcs + * leading to states with no constraint outarc. + */ + cparc(nfa, a, sclone, sto); + } + } + + /* + * If we are at outer level for this clone state, recurse to all its child + * clone states, clearing their tmp fields as we go. (If we're not + * outermost for sclone, leave this to be done by the outer call level.) + * Note that if we have multiple outarcs leading to the same clone state, + * it will only be recursed-to once. + */ + if (curdonemap == NULL) { + for (a = sclone->outs; a != NULL && !NISERR(); a = a->outchain) { + struct state *stoclone = a->to; + struct state *sto = stoclone->tmp; + + if (sto != NULL) { + stoclone->tmp = NULL; + clonesuccessorstates(nfa, sto, stoclone, spredecessor, refarc, + NULL, donemap, nstates); + } + } + + /* Don't forget to free sclone's donemap when done with it */ + FREE(donemap); + } +} /* - cleanup - clean up NFA after optimizations @@ -1618,7 +2165,7 @@ analyze( } /* - - compact - compact an NFA + - compact - construct the compact representation of an NFA ^ static VOID compact(struct nfa *, struct cnfa *); */ static void @@ -1687,7 +2234,7 @@ compact( cnfa->flags |= HASLACONS; break; default: - assert(NOTREACHED); + NERR(REG_ASSERT); break; } } diff --git a/generic/regcomp.c b/generic/regcomp.c index b1c02d8..27bb736 100644 --- a/generic/regcomp.c +++ b/generic/regcomp.c @@ -149,6 +149,13 @@ static int combine(struct arc *, struct arc *); static void fixempties(struct nfa *, FILE *); static struct state *emptyreachable(struct state *, struct state *); static void replaceempty(struct nfa *, struct state *, struct state *); +static int isconstraintarc(struct arc *); +static int hasconstraintout(struct state *); +static void fixconstraintloops(struct nfa *, FILE *); +static int findconstraintloop(struct nfa *, struct state *); +static void breakconstraintloop(struct nfa *, struct state *); +static void clonesuccessorstates(struct nfa *, struct state *, struct state *, + struct state *, struct arc *, char *, char *, int); static void cleanup(struct nfa *); static void markreachable(struct nfa *, struct state *, struct state *, struct state *); static void markcanreach(struct nfa *, struct state *, struct state *, struct state *); diff --git a/tests/reg.test b/tests/reg.test index 0ebfa11..b259ce5 100644 --- a/tests/reg.test +++ b/tests/reg.test @@ -1068,6 +1068,31 @@ test reg-33.13 {Bug 1810264 - infinite loop} { test reg-33.14 {Bug 1810264 - super-expensive expression} nonPortable { regexp {(x{200}){200}$y} {x} } 0 + +test reg-33.15 {constraint fixes} { + regexp {(^)+^} x +} 1 +test reg-33.16 {constraint fixes} { + regexp {($^)+} x +} 0 +test reg-33.17 {constraint fixes} { + regexp {(^$)*} x +} 1 +test reg-33.18 {constraint fixes} { + regexp {(^(?!aa))+} {aa bb cc} +} 0 +test reg-33.19 {constraint fixes} { + regexp {(^(?!aa)(?!bb)(?!cc))+} {aa x} +} 0 +test reg-33.20 {constraint fixes} { + regexp {(^(?!aa)(?!bb)(?!cc))+} {bb x} +} 0 +test reg-33.21 {constraint fixes} { + regexp {(^(?!aa)(?!bb)(?!cc))+} {cc x} +} 0 +test reg-33.22 {constraint fixes} { + regexp {(^(?!aa)(?!bb)(?!cc))+} {dd x} +} 1 # cleanup ::tcltest::cleanupTests -- cgit v0.12 From 8ed7672ab71b54afa94e164e73fdc274b0b39771 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 19 Oct 2015 19:32:04 +0000 Subject: Adaptation of re-oNsquared.patch from Tom Lane @ postgres. --- generic/regc_nfa.c | 805 ++++++++++++++++++++++++++++++++++++++++++++++------- generic/regcomp.c | 10 +- generic/regguts.h | 4 +- 3 files changed, 720 insertions(+), 99 deletions(-) diff --git a/generic/regc_nfa.c b/generic/regc_nfa.c index 20eb3ba..0f572b8 100644 --- a/generic/regc_nfa.c +++ b/generic/regc_nfa.c @@ -35,6 +35,8 @@ #define NISERR() VISERR(nfa->v) #define NERR(e) VERR(nfa->v, (e)) #define STACK_TOO_DEEP(x) (0) +#define CANCEL_REQUESTED(x) (0) +#define REG_CANCEL 777 /* - newnfa - set up an NFA @@ -322,6 +324,10 @@ destroystate( ^ static VOID newarc(struct nfa *, int, pcolor, struct state *, ^ struct state *); */ +/* + * This function checks to make sure that no duplicate arcs are created. + * In general we never want duplicates. + */ static void newarc( struct nfa *nfa, @@ -334,16 +340,42 @@ newarc( assert(from != NULL && to != NULL); - /* - * Check for duplicates. - */ - - for (a=from->outs ; a!=NULL ; a=a->outchain) { - if (a->to == to && a->co == co && a->type == t) { - return; + /* check for duplicate arc, using whichever chain is shorter */ + if (from->nouts <= to->nins) { + for (a = from->outs; a != NULL; a = a->outchain) { + if (a->to == to && a->co == co && a->type == t) { + return; + } + } + } else { + for (a = to->ins; a != NULL; a = a->inchain) { + if (a->from == from && a->co == co && a->type == t) { + return; + } } } + + /* no dup, so create the arc */ + createarc(nfa, t, co, from, to); +} +/* + * createarc - create a new arc within an NFA + * + * This function must *only* be used after verifying that there is no existing + * identical arc (same type/color/from/to). + */ +static void +createarc( + struct nfa * nfa, + int t, + pcolor co, + struct state * from, + struct state * to) +{ + struct arc *a; + + /* the arc is physically allocated within its from-state */ a = allocarc(nfa, from); if (NISERR()) { return; @@ -356,15 +388,21 @@ newarc( a->from = from; /* - * Put the new arc on the beginning, not the end, of the chains. Not only - * is this easier, it has the very useful side effect that deleting the - * most-recently-added arc is the cheapest case rather than the most - * expensive one. + * Put the new arc on the beginning, not the end, of the chains; it's + * simpler here, and freearc() is the same cost either way. See also the + * logic in moveins() and its cohorts, as well as fixempties(). */ - a->inchain = to->ins; + a->inchainRev = NULL; + if (to->ins) { + to->ins->inchainRev = a; + } to->ins = a; a->outchain = from->outs; + a->outchainRev = NULL; + if (from->outs) { + from->outs->outchainRev = a; + } from->outs = a; from->nouts++; @@ -437,7 +475,7 @@ freearc( { struct state *from = victim->from; struct state *to = victim->to; - struct arc *a; + struct arc *predecessor; assert(victim->type != 0); @@ -454,16 +492,17 @@ freearc( */ assert(from != NULL); - assert(from->outs != NULL); - a = from->outs; - if (a == victim) { /* simple case: first in chain */ + predecessor = victim->outchainRev; + if (predecessor == NULL) { + assert(from->outs == victim); from->outs = victim->outchain; } else { - for (; a!=NULL && a->outchain!=victim ; a=a->outchain) { - continue; - } - assert(a != NULL); - a->outchain = victim->outchain; + assert(predecessor->outchain == victim); + predecessor->outchain = victim->outchain; + } + if (victim->outchain != NULL) { + assert(victim->outchain->outchainRev == victim); + victim->outchain->outchainRev = predecessor; } from->nouts--; @@ -472,31 +511,78 @@ freearc( */ assert(to != NULL); - assert(to->ins != NULL); - a = to->ins; - if (a == victim) { /* simple case: first in chain */ + predecessor = victim->inchainRev; + if (predecessor == NULL) { + assert(to->ins == victim); to->ins = victim->inchain; } else { - for (; a->inchain!=victim ; a=a->inchain) { - assert(a->inchain != NULL); - continue; - } - a->inchain = victim->inchain; + assert(predecessor->inchain == victim); + predecessor->inchain = victim->inchain; + } + if (victim->inchain != NULL) { + assert(victim->inchain->inchainRev == victim); + victim->inchain->inchainRev = predecessor; } to->nins--; /* - * Clean up and place on free list. + * Clean up and place on from-state's free list. */ victim->type = 0; victim->from = NULL; /* precautions... */ victim->to = NULL; victim->inchain = NULL; + victim->inchainRev = NULL; victim->outchain = NULL; + victim->outchainRev = NULL; victim->freechain = from->free; from->free = victim; } + +/* + * changearctarget - flip an arc to have a different to state + * + * Caller must have verified that there is no pre-existing duplicate arc. + * + * Note that because we store arcs in their from state, we can't easily have + * a similar changearcsource function. + */ +static void +changearctarget(struct arc * a, struct state * newto) +{ + struct state *oldto = a->to; + struct arc *predecessor; + + assert(oldto != newto); + + /* take it off old target's in-chain */ + assert(oldto != NULL); + predecessor = a->inchainRev; + if (predecessor == NULL) { + assert(oldto->ins == a); + oldto->ins = a->inchain; + } else { + assert(predecessor->inchain == a); + predecessor->inchain = a->inchain; + } + if (a->inchain != NULL) { + assert(a->inchain->inchainRev == a); + a->inchain->inchainRev = predecessor; + } + oldto->nins--; + + a->to = newto; + + /* prepend it to new target's in-chain */ + a->inchain = newto->ins; + a->inchainRev = NULL; + if (newto->ins) { + newto->ins->inchainRev = a; + } + newto->ins = a; + newto->nins++; +} /* - hasnonemptyout - Does state have a non-EMPTY out arc? @@ -589,13 +675,181 @@ cparc( { newarc(nfa, oa->type, oa->co, from, to); } + +/* + * sortins - sort the in arcs of a state by from/color/type + */ +static void +sortins( + struct nfa * nfa, + struct state * s) +{ + struct arc **sortarray; + struct arc *a; + int n = s->nins; + int i; + + if (n <= 1) { + return; /* nothing to do */ + } + /* make an array of arc pointers ... */ + sortarray = (struct arc **) MALLOC(n * sizeof(struct arc *)); + if (sortarray == NULL) { + NERR(REG_ESPACE); + return; + } + i = 0; + for (a = s->ins; a != NULL; a = a->inchain) { + sortarray[i++] = a; + } + assert(i == n); + /* ... sort the array */ + qsort(sortarray, n, sizeof(struct arc *), sortins_cmp); + /* ... and rebuild arc list in order */ + /* it seems worth special-casing first and last items to simplify loop */ + a = sortarray[0]; + s->ins = a; + a->inchain = sortarray[1]; + a->inchainRev = NULL; + for (i = 1; i < n - 1; i++) { + a = sortarray[i]; + a->inchain = sortarray[i + 1]; + a->inchainRev = sortarray[i - 1]; + } + a = sortarray[i]; + a->inchain = NULL; + a->inchainRev = sortarray[i - 1]; + FREE(sortarray); +} + +static int +sortins_cmp( + const void *a, + const void *b) +{ + const struct arc *aa = *((const struct arc * const *) a); + const struct arc *bb = *((const struct arc * const *) b); + + /* we check the fields in the order they are most likely to be different */ + if (aa->from->no < bb->from->no) { + return -1; + } + if (aa->from->no > bb->from->no) { + return 1; + } + if (aa->co < bb->co) { + return -1; + } + if (aa->co > bb->co) { + return 1; + } + if (aa->type < bb->type) { + return -1; + } + if (aa->type > bb->type) { + return 1; + } + return 0; +} + +/* + * sortouts - sort the out arcs of a state by to/color/type + */ +static void +sortouts( + struct nfa * nfa, + struct state * s) +{ + struct arc **sortarray; + struct arc *a; + int n = s->nouts; + int i; + + if (n <= 1) { + return; /* nothing to do */ + } + /* make an array of arc pointers ... */ + sortarray = (struct arc **) MALLOC(n * sizeof(struct arc *)); + if (sortarray == NULL) { + NERR(REG_ESPACE); + return; + } + i = 0; + for (a = s->outs; a != NULL; a = a->outchain) { + sortarray[i++] = a; + } + assert(i == n); + /* ... sort the array */ + qsort(sortarray, n, sizeof(struct arc *), sortouts_cmp); + /* ... and rebuild arc list in order */ + /* it seems worth special-casing first and last items to simplify loop */ + a = sortarray[0]; + s->outs = a; + a->outchain = sortarray[1]; + a->outchainRev = NULL; + for (i = 1; i < n - 1; i++) { + a = sortarray[i]; + a->outchain = sortarray[i + 1]; + a->outchainRev = sortarray[i - 1]; + } + a = sortarray[i]; + a->outchain = NULL; + a->outchainRev = sortarray[i - 1]; + FREE(sortarray); +} + +static int +sortouts_cmp( + const void *a, + const void *b) +{ + const struct arc *aa = *((const struct arc * const *) a); + const struct arc *bb = *((const struct arc * const *) b); + + /* we check the fields in the order they are most likely to be different */ + if (aa->to->no < bb->to->no) { + return -1; + } + if (aa->to->no > bb->to->no) { + return 1; + } + if (aa->co < bb->co) { + return -1; + } + if (aa->co > bb->co) { + return 1; + } + if (aa->type < bb->type) { + return -1; + } + if (aa->type > bb->type) { + return 1; + } + return 0; +} + +/* + * Common decision logic about whether to use arc-by-arc operations or + * sort/merge. If there's just a few source arcs we cannot recoup the + * cost of sorting the destination arc list, no matter how large it is. + * Otherwise, limit the number of arc-by-arc comparisons to about 1000 + * (a somewhat arbitrary choice, but the breakeven point would probably + * be machine dependent anyway). + */ +#define BULK_ARC_OP_USE_SORT(nsrcarcs, ndestarcs) \ + ((nsrcarcs) < 4 ? 0 : ((nsrcarcs) > 32 || (ndestarcs) > 32)) /* - moveins - move all in arcs of a state to another state * You might think this could be done better by just updating the - * existing arcs, and you would be right if it weren't for the desire + * existing arcs, and you would be right if it weren't for the need * for duplicate suppression, which makes it easier to just make new * ones to exploit the suppression built into newarc. + * + * However, if we have a whole lot of arcs to deal with, retail duplicate + * checks become too slow. In that case we proceed by sorting and merging + * the arc lists, and then we can indeed just update the arcs in-place. + * ^ static VOID moveins(struct nfa *, struct state *, struct state *); */ static void @@ -604,14 +858,79 @@ moveins( struct state *oldState, struct state *newState) { - struct arc *a; - assert(oldState != newState); - while ((a = oldState->ins) != NULL) { - cparc(nfa, a, a->from, newState); - freearc(nfa, a); + if (!BULK_ARC_OP_USE_SORT(oldState->nins, newState->nins)) { + /* With not too many arcs, just do them one at a time */ + struct arc *a; + + while ((a = oldState->ins) != NULL) { + cparc(nfa, a, a->from, newState); + freearc(nfa, a); + } + } else { + /* + * With many arcs, use a sort-merge approach. Note changearctarget() + * will put the arc onto the front of newState's chain, so it does not + * break our walk through the sorted part of the chain. + */ + struct arc *oa; + struct arc *na; + + /* + * Because we bypass newarc() in this code path, we'd better include a + * cancel check. + */ + if (CANCEL_REQUESTED(nfa->v->re)) { + NERR(REG_CANCEL); + return; + } + + sortins(nfa, oldState); + sortins(nfa, newState); + if (NISERR()) { + return; /* might have failed to sort */ + } + oa = oldState->ins; + na = newState->ins; + while (oa != NULL && na != NULL) { + struct arc *a = oa; + + switch (sortins_cmp(&oa, &na)) { + case -1: + /* newState does not have anything matching oa */ + oa = oa->inchain; + + /* + * Rather than doing createarc+freearc, we can just unlink + * and relink the existing arc struct. + */ + changearctarget(a, newState); + break; + case 0: + /* match, advance in both lists */ + oa = oa->inchain; + na = na->inchain; + /* ... and drop duplicate arc from oldState */ + freearc(nfa, a); + break; + case +1: + /* advance only na; oa might have a match later */ + na = na->inchain; + break; + default: + assert(NOTREACHED); + } + } + while (oa != NULL) { + /* newState does not have anything matching oa */ + struct arc *a = oa; + + oa = oa->inchain; + changearctarget(a, newState); + } } + assert(oldState->nins == 0); assert(oldState->ins == NULL); } @@ -628,14 +947,178 @@ copyins( struct state *newState, int all) { - struct arc *a; - assert(oldState != newState); - for (a=oldState->ins ; a!=NULL ; a=a->inchain) { - if (all || a->type != EMPTY) { - cparc(nfa, a, a->from, newState); + if (!BULK_ARC_OP_USE_SORT(oldState->nins, newState->nins)) { + /* With not too many arcs, just do them one at a time */ + struct arc *a; + + for (a = oldState->ins; a != NULL; a = a->inchain) { + if (all || a->type != EMPTY) { + cparc(nfa, a, a->from, newState); + } + } + } else { + /* + * With many arcs, use a sort-merge approach. Note that createarc() + * will put new arcs onto the front of newState's chain, so it does + * not break our walk through the sorted part of the chain. + */ + struct arc *oa; + struct arc *na; + + /* + * Because we bypass newarc() in this code path, we'd better include a + * cancel check. + */ + if (CANCEL_REQUESTED(nfa->v->re)) { + NERR(REG_CANCEL); + return; } + + sortins(nfa, oldState); + sortins(nfa, newState); + if (NISERR()) { + return; /* might have failed to sort */ + } + oa = oldState->ins; + na = newState->ins; + while (oa != NULL && na != NULL) { + struct arc *a = oa; + + if (!all && a->type == EMPTY) { + oa = oa->inchain; + continue; + } + + switch (sortins_cmp(&oa, &na)) { + case -1: + /* newState does not have anything matching oa */ + oa = oa->inchain; + createarc(nfa, a->type, a->co, a->from, newState); + break; + case 0: + /* match, advance in both lists */ + oa = oa->inchain; + na = na->inchain; + break; + case +1: + /* advance only na; oa might have a match later */ + na = na->inchain; + break; + default: + assert(NOTREACHED); + } + } + while (oa != NULL) { + /* newState does not have anything matching oa */ + struct arc *a = oa; + + if (!all && a->type == EMPTY) { + oa = oa->inchain; + continue; + } + + oa = oa->inchain; + createarc(nfa, a->type, a->co, a->from, newState); + } + } +} + +/* + * mergeins - merge a list of inarcs into a state + * + * This is much like copyins, but the source arcs are listed in an array, + * and are not guaranteed unique. It's okay to clobber the array contents. + */ +static void +mergeins( + struct nfa * nfa, + struct state * s, + struct arc ** arcarray, + int arccount) +{ + struct arc *na; + int i; + int j; + + if (arccount <= 0) { + return; + } + + /* + * Because we bypass newarc() in this code path, we'd better include a + * cancel check. + */ + if (CANCEL_REQUESTED(nfa->v->re)) { + NERR(REG_CANCEL); + return; + } + + /* Sort existing inarcs as well as proposed new ones */ + sortins(nfa, s); + if (NISERR()) { + return; /* might have failed to sort */ + } + + qsort(arcarray, arccount, sizeof(struct arc *), sortins_cmp); + + /* + * arcarray very likely includes dups, so we must eliminate them. (This + * could be folded into the next loop, but it's not worth the trouble.) + */ + j = 0; + for (i = 1; i < arccount; i++) { + switch (sortins_cmp(&arcarray[j], &arcarray[i])) { + case -1: + /* non-dup */ + arcarray[++j] = arcarray[i]; + break; + case 0: + /* dup */ + break; + default: + /* trouble */ + assert(NOTREACHED); + } + } + arccount = j + 1; + + /* + * Now merge into s' inchain. Note that createarc() will put new arcs + * onto the front of s's chain, so it does not break our walk through the + * sorted part of the chain. + */ + i = 0; + na = s->ins; + while (i < arccount && na != NULL) { + struct arc *a = arcarray[i]; + + switch (sortins_cmp(&a, &na)) { + case -1: + /* s does not have anything matching a */ + createarc(nfa, a->type, a->co, a->from, s); + i++; + break; + case 0: + /* match, advance in both lists */ + i++; + na = na->inchain; + break; + case +1: + /* advance only na; array might have a match later */ + na = na->inchain; + break; + default: + assert(NOTREACHED); + } + } + while (i < arccount) { + /* s does not have anything matching a */ + struct arc *a = arcarray[i]; + + createarc(nfa, a->type, a->co, a->from, s); + i++; } } @@ -649,14 +1132,78 @@ moveouts( struct state *oldState, struct state *newState) { - struct arc *a; - assert(oldState != newState); - while ((a = oldState->outs) != NULL) { - cparc(nfa, a, newState, a->to); - freearc(nfa, a); + if (!BULK_ARC_OP_USE_SORT(oldState->nouts, newState->nouts)) { + /* With not too many arcs, just do them one at a time */ + struct arc *a; + + while ((a = oldState->outs) != NULL) { + cparc(nfa, a, newState, a->to); + freearc(nfa, a); + } + } else { + /* + * With many arcs, use a sort-merge approach. Note that createarc() + * will put new arcs onto the front of newState's chain, so it does + * not break our walk through the sorted part of the chain. + */ + struct arc *oa; + struct arc *na; + + /* + * Because we bypass newarc() in this code path, we'd better include a + * cancel check. + */ + if (CANCEL_REQUESTED(nfa->v->re)) { + NERR(REG_CANCEL); + return; + } + + sortouts(nfa, oldState); + sortouts(nfa, newState); + if (NISERR()) { + return; /* might have failed to sort */ + } + oa = oldState->outs; + na = newState->outs; + while (oa != NULL && na != NULL) { + struct arc *a = oa; + + switch (sortouts_cmp(&oa, &na)) { + case -1: + /* newState does not have anything matching oa */ + oa = oa->outchain; + createarc(nfa, a->type, a->co, newState, a->to); + freearc(nfa, a); + break; + case 0: + /* match, advance in both lists */ + oa = oa->outchain; + na = na->outchain; + /* ... and drop duplicate arc from oldState */ + freearc(nfa, a); + break; + case +1: + /* advance only na; oa might have a match later */ + na = na->outchain; + break; + default: + assert(NOTREACHED); + } + } + while (oa != NULL) { + /* newState does not have anything matching oa */ + struct arc *a = oa; + + oa = oa->outchain; + createarc(nfa, a->type, a->co, newState, a->to); + freearc(nfa, a); + } } + + assert(oldState->nouts == 0); + assert(oldState->outs == NULL); } /* @@ -671,13 +1218,80 @@ copyouts( struct state *newState, int all) { - struct arc *a; - assert(oldState != newState); - for (a=oldState->outs ; a!=NULL ; a=a->outchain) { - if (all || a->type != EMPTY) { - cparc(nfa, a, newState, a->to); + if (!BULK_ARC_OP_USE_SORT(oldState->nouts, newState->nouts)) { + /* With not too many arcs, just do them one at a time */ + struct arc *a; + + for (a = oldState->outs; a != NULL; a = a->outchain) { + if (all || a->type != EMPTY) { + cparc(nfa, a, newState, a->to); + } + } + } else { + /* + * With many arcs, use a sort-merge approach. Note that createarc() + * will put new arcs onto the front of newState's chain, so it does + * not break our walk through the sorted part of the chain. + */ + struct arc *oa; + struct arc *na; + + /* + * Because we bypass newarc() in this code path, we'd better include a + * cancel check. + */ + if (CANCEL_REQUESTED(nfa->v->re)) { + NERR(REG_CANCEL); + return; + } + + sortouts(nfa, oldState); + sortouts(nfa, newState); + if (NISERR()) { + return; /* might have failed to sort */ + } + oa = oldState->outs; + na = newState->outs; + while (oa != NULL && na != NULL) { + struct arc *a = oa; + + if (!all && a->type == EMPTY) { + oa = oa->outchain; + continue; + } + + switch (sortouts_cmp(&oa, &na)) { + case -1: + /* newState does not have anything matching oa */ + oa = oa->outchain; + createarc(nfa, a->type, a->co, newState, a->to); + break; + case 0: + /* match, advance in both lists */ + oa = oa->outchain; + na = na->outchain; + break; + case +1: + /* advance only na; oa might have a match later */ + na = na->outchain; + break; + default: + assert(NOTREACHED); + } + } + while (oa != NULL) { + /* newState does not have anything matching oa */ + struct arc *a = oa; + + if (!all && a->type == EMPTY){ + oa = oa->outchain; + continue; + } + + oa = oa->outchain; + createarc(nfa, a->type, a->co, newState, a->to); } } } @@ -2238,7 +2852,7 @@ compact( break; } } - carcsort(first, ca-1); + carcsort(first, ca - first); ca->co = COLORLESS; ca->to = 0; ca++; @@ -2258,33 +2872,39 @@ compact( /* - carcsort - sort compacted-NFA arcs by color - * Really dumb algorithm, but if the list is long enough for that to matter, - * you're in real trouble anyway. ^ static VOID carcsort(struct carc *, struct carc *); */ static void carcsort( struct carc *first, - struct carc *last) + size_t n) { - struct carc *p; - struct carc *q; - struct carc tmp; - - if (last - first <= 1) { - return; + if (n > 1) { + qsort(first, n, sizeof(struct carc), carc_cmp); } +} - for (p = first; p <= last; p++) { - for (q = p; q <= last; q++) { - if (p->co > q->co || (p->co == q->co && p->to > q->to)) { - assert(p != q); - tmp = *p; - *p = *q; - *q = tmp; - } - } +static int +carc_cmp( + const void *a, + const void *b) +{ + const struct carc *aa = (const struct carc *) a; + const struct carc *bb = (const struct carc *) b; + + if (aa->co < bb->co) { + return -1; + } + if (aa->co > bb->co) { + return +1; + } + if (aa->to < bb->to) { + return -1; } + if (aa->to > bb->to) { + return +1; + } + return 0; } /* @@ -2382,37 +3002,28 @@ dumparcs( FILE *f) { int pos; + struct arc *a; - assert(s->nouts > 0); - /* printing arcs in reverse order is usually clearer */ - pos = dumprarcs(s->outs, s, f, 1); - if (pos != 1) { - fprintf(f, "\n"); - } -} - -/* - - dumprarcs - dump remaining outarcs, recursively, in reverse order - ^ static int dumprarcs(struct arc *, struct state *, FILE *, int); - */ -static int /* resulting print position */ -dumprarcs( - struct arc *a, - struct state *s, - FILE *f, - int pos) /* initial print position */ -{ - if (a->outchain != NULL) { - pos = dumprarcs(a->outchain, s, f, pos); + /* printing oldest arcs first is usually clearer */ + a = s->outs; + assert(a != NULL); + while (a->outchain != NULL) { + a = a->outchain; } - dumparc(a, s, f); - if (pos == 5) { + pos = 1; + do { + dumparc(a, s, f); + if (pos == 5) { + fprintf(f, "\n"); + pos = 1; + } else { + pos++; + } + a = a->outchainRev; + } while (a != NULL); + if (pos != 1) { fprintf(f, "\n"); - pos = 1; - } else { - pos++; } - return pos; } /* diff --git a/generic/regcomp.c b/generic/regcomp.c index 27bb736..b01311b 100644 --- a/generic/regcomp.c +++ b/generic/regcomp.c @@ -119,15 +119,22 @@ static void dropstate(struct nfa *, struct state *); static void freestate(struct nfa *, struct state *); static void destroystate(struct nfa *, struct state *); static void newarc(struct nfa *, int, pcolor, struct state *, struct state *); +static void createarc(struct nfa *, int, pcolor, struct state *, struct state *); static struct arc *allocarc(struct nfa *, struct state *); static void freearc(struct nfa *, struct arc *); +static void changearctarget(struct arc *, struct state *); static int hasnonemptyout(struct state *); static int nonemptyouts(struct state *); static int nonemptyins(struct state *); static struct arc *findarc(struct state *, int, pcolor); static void cparc(struct nfa *, struct arc *, struct state *, struct state *); +static void sortins(struct nfa *, struct state *); +static int sortins_cmp(const void *, const void *); +static void sortouts(struct nfa *, struct state *); +static int sortouts_cmp(const void *, const void *); static void moveins(struct nfa *, struct state *, struct state *); static void copyins(struct nfa *, struct state *, struct state *, int); +static void mergeins(struct nfa *, struct state *, struct arc **, int); static void moveouts(struct nfa *, struct state *, struct state *); static void copyouts(struct nfa *, struct state *, struct state *, int); static void cloneouts(struct nfa *, struct state *, struct state *, struct state *, int); @@ -161,7 +168,8 @@ static void markreachable(struct nfa *, struct state *, struct state *, struct s static void markcanreach(struct nfa *, struct state *, struct state *, struct state *); static long analyze(struct nfa *); static void compact(struct nfa *, struct cnfa *); -static void carcsort(struct carc *, struct carc *); +static void carcsort(struct carc *, size_t); +static int carc_cmp(const void *, const void *); static void freecnfa(struct cnfa *); static void dumpnfa(struct nfa *, FILE *); #ifdef REG_DEBUG diff --git a/generic/regguts.h b/generic/regguts.h index ac625d5..7ed8ec1 100644 --- a/generic/regguts.h +++ b/generic/regguts.h @@ -265,8 +265,10 @@ struct arc { struct state *from; /* where it's from (and contained within) */ struct state *to; /* where it's to */ struct arc *outchain; /* *from's outs chain or free chain */ -#define freechain outchain + struct arc *outchainRev; /* back-link in *from's outs chain */ +#define freechain outchain /* we do not maintain "freechainRev" */ struct arc *inchain; /* *to's ins chain */ + struct arc *inchainRev; /* back-link in *to's ins chain */ struct arc *colorchain; /* color's arc chain */ struct arc *colorchainRev; /* back-link in color's arc chain */ }; -- cgit v0.12 From f12c713f8e323f0c7872d83c93b2371c7eb42365 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 20 Oct 2015 18:32:25 +0000 Subject: Adaptation of re-better-fixempties.patch from Tom Lane @ postgres. --- generic/regc_nfa.c | 265 +++++++++++++++++++++++++++-------------------------- generic/regcomp.c | 6 +- 2 files changed, 136 insertions(+), 135 deletions(-) diff --git a/generic/regc_nfa.c b/generic/regc_nfa.c index 0f572b8..5582e4e 100644 --- a/generic/regc_nfa.c +++ b/generic/regc_nfa.c @@ -603,44 +603,6 @@ hasnonemptyout( } /* - - nonemptyouts - count non-EMPTY out arcs of a state - ^ static int nonemptyouts(struct state *); - */ -static int -nonemptyouts( - struct state *s) -{ - int n = 0; - struct arc *a; - - for (a = s->outs; a != NULL; a = a->outchain) { - if (a->type != EMPTY) { - n++; - } - } - return n; -} - -/* - - nonemptyins - count non-EMPTY in arcs of a state - ^ static int nonemptyins(struct state *); - */ -static int -nonemptyins( - struct state *s) -{ - int n = 0; - struct arc *a; - - for (a = s->ins; a != NULL; a = a->inchain) { - if (a->type != EMPTY) { - n++; - } - } - return n; -} - -/* - findarc - find arc, if any, from given source with given type and color * If there is more than one such arc, the result is random. ^ static struct arc *findarc(struct state *, int, pcolor); @@ -1897,6 +1859,12 @@ fixempties( struct state *nexts; struct arc *a; struct arc *nexta; + int totalinarcs; + struct arc **inarcsorig; + struct arc **arcarray; + int arccount; + int prevnins; + int nskip; /* * First, get rid of any states whose sole out-arc is an EMPTY, @@ -1942,42 +1910,129 @@ fixempties( dropstate(nfa, s); } + if (NISERR()) { + return; + } + /* - * For each remaining NFA state, find all other states that are - * reachable from it by a chain of one or more EMPTY arcs. Then - * generate new arcs that eliminate the need for each such chain. + * For each remaining NFA state, find all other states from which it is + * reachable by a chain of one or more EMPTY arcs. Then generate new arcs + * that eliminate the need for each such chain. + * + * We could replace a chain of EMPTY arcs that leads from a "from" state + * to a "to" state either by pushing non-EMPTY arcs forward (linking + * directly from "from"'s predecessors to "to") or by pulling them back + * (linking directly from "from" to "to"'s successors). We choose to + * always do the former; this choice is somewhat arbitrary, but the + * approach below requires that we uniformly do one or the other. + * + * Suppose we have a chain of N successive EMPTY arcs (where N can easily + * approach the size of the NFA). All of the intermediate states must + * have additional inarcs and outarcs, else they'd have been removed by + * the steps above. Assuming their inarcs are mostly not empties, we will + * add O(N^2) arcs to the NFA, since a non-EMPTY inarc leading to any one + * state in the chain must be duplicated to lead to all its successor + * states as well. So there is no hope of doing less than O(N^2) work; + * however, we should endeavor to keep the big-O cost from being even + * worse than that, which it can easily become without care. In + * particular, suppose we were to copy all S1's inarcs forward to S2, and + * then also to S3, and then later we consider pushing S2's inarcs forward + * to S3. If we include the arcs already copied from S1 in that, we'd be + * doing O(N^3) work. (The duplicate-arc elimination built into newarc() + * and its cohorts would get rid of the extra arcs, but not without cost.) + * + * We can avoid this cost by treating only arcs that existed at the start + * of this phase as candidates to be pushed forward. To identify those, + * we remember the first inarc each state had to start with. We rely on + * the fact that newarc() and friends put new arcs on the front of their + * to-states' inchains, and that this phase never deletes arcs, so that + * the original arcs must be the last arcs in their to-states' inchains. + * + * So the process here is that, for each state in the NFA, we gather up + * all non-EMPTY inarcs of states that can reach the target state via + * EMPTY arcs. We then sort, de-duplicate, and merge these arcs into the + * target state's inchain. (We can safely use sort-merge for this as long + * as we update each state's original-arcs pointer after we add arcs to + * it; the sort step of mergeins probably changed the order of the old + * arcs.) * - * If we just do this straightforwardly, the algorithm gets slow in - * complex graphs, because the same arcs get copied to all - * intermediate states of an EMPTY chain, and then uselessly pushed - * repeatedly to the chain's final state; we waste a lot of time in - * newarc's duplicate checking. To improve matters, we decree that - * any state with only EMPTY out-arcs is "doomed" and will not be - * part of the final NFA. That can be ensured by not adding any new - * out-arcs to such a state. Having ensured that, we need not update - * the state's in-arcs list either; all arcs that might have gotten - * pushed forward to it will just get pushed directly to successor - * states. This eliminates most of the useless duplicate arcs. + * Another refinement worth making is that, because we only add non-EMPTY + * arcs during this phase, and all added arcs have the same from-state as + * the non-EMPTY arc they were cloned from, we know ahead of time that any + * states having only EMPTY outarcs will be useless for lack of outarcs + * after we drop the EMPTY arcs. (They cannot gain non-EMPTY outarcs if + * they had none to start with.) So we need not bother to update the + * inchains of such states at all. */ + + /* Remember the states' first original inarcs */ + /* ... and while at it, count how many old inarcs there are altogether */ + inarcsorig = (struct arc **) MALLOC(nfa->nstates * sizeof(struct arc *)); + if (inarcsorig == NULL) { + NERR(REG_ESPACE); + return; + } + totalinarcs = 0; + for (s = nfa->states; s != NULL; s = s->next) { + inarcsorig[s->no] = s->ins; + totalinarcs += s->nins; + } + + /* + * Create a workspace for accumulating the inarcs to be added to the + * current target state. totalinarcs is probably a considerable + * overestimate of the space needed, but the NFA is unlikely to be large + * enough at this point to make it worth being smarter. + */ + arcarray = (struct arc **) MALLOC(totalinarcs * sizeof(struct arc *)); + if (arcarray == NULL) { + NERR(REG_ESPACE); + FREE(inarcsorig); + return; + } + + /* And iterate over the target states */ for (s = nfa->states; s != NULL && !NISERR(); s = s->next) { - for (s2 = emptyreachable(s, s); s2 != s && !NISERR(); - s2 = nexts) { - /* - * If s2 is doomed, we decide that (1) we will always push - * arcs forward to it, not pull them back to s; and (2) we - * can optimize away the push-forward, per comment above. - * So do nothing. - */ - if (s2->flag || hasnonemptyout(s2)) { - replaceempty(nfa, s, s2); + /* Ignore target states without non-EMPTY outarcs, per note above */ + if (!s->flag && !hasnonemptyout(s)) { + continue; + } + + /* Find predecessor states and accumulate their original inarcs */ + arccount = 0; + for (s2 = emptyreachable(nfa, s, s, inarcsorig); s2 != s; s2 = nexts) { + /* Add s2's original inarcs to arcarray[], but ignore empties */ + for (a = inarcsorig[s2->no]; a != NULL; a = a->inchain) { + if (a->type != EMPTY) { + arcarray[arccount++] = a; + } } + + /* Reset the tmp fields as we walk back */ + nexts = s2->tmp; + s2->tmp = NULL; + } + s->tmp = NULL; + assert(arccount <= totalinarcs); - /* Reset the tmp fields as we walk back */ - nexts = s2->tmp; - s2->tmp = NULL; + /* Remember how many original inarcs this state has */ + prevnins = s->nins; + + /* Add non-duplicate inarcs to target state */ + mergeins(nfa, s, arcarray, arccount); + + /* Now we must update the state's inarcsorig pointer */ + nskip = s->nins - prevnins; + a = s->ins; + while (nskip-- > 0) { + a = a->inchain; } - s->tmp = NULL; + inarcsorig[s->no] = a; } + + FREE(arcarray); + FREE(inarcsorig); + if (NISERR()) { return; } @@ -2013,90 +2068,38 @@ fixempties( } /* - - emptyreachable - recursively find all states reachable from s by EMPTY arcs + - emptyreachable - recursively find all states that can reach s by EMPTY arcs * The return value is the last such state found. Its tmp field links back * to the next-to-last such state, and so on back to s, so that all these * states can be located without searching the whole NFA. + * + * Since this is only used in fixempties(), we pass in the inarcsorig[] array + * maintained by that function. This lets us skip over all new inarcs, which + * are certainly not EMPTY arcs. + * * The maximum recursion depth here is equal to the length of the longest * loop-free chain of EMPTY arcs, which is surely no more than the size of - * the NFA, and in practice will be a lot less than that. + * the NFA, and in practice will be less than that. ^ static struct state *emptyreachable(struct state *, struct state *); */ static struct state * emptyreachable( + struct nfa *nfa, struct state *s, - struct state *lastfound) + struct state *lastfound, + struct arc **inarcsorig) { struct arc *a; s->tmp = lastfound; lastfound = s; - for (a = s->outs; a != NULL; a = a->outchain) { - if (a->type == EMPTY && a->to->tmp == NULL) { - lastfound = emptyreachable(a->to, lastfound); + for (a = inarcsorig[s->no]; a != NULL; a = a->inchain) { + if (a->type == EMPTY && a->from->tmp == NULL) { + lastfound = emptyreachable(nfa, a->from, lastfound, inarcsorig); } } return lastfound; } - -/* - - replaceempty - replace an EMPTY arc chain with some non-empty arcs - * The EMPTY arc(s) should be deleted later, but we can't do it here because - * they may still be needed to identify other arc chains during fixempties(). - ^ static void replaceempty(struct nfa *, struct state *, struct state *); - */ -static void -replaceempty( - struct nfa *nfa, - struct state *from, - struct state *to) -{ - int fromouts; - int toins; - - assert(from != to); - - /* - * Create replacement arcs that bypass the need for the EMPTY chain. We - * can do this either by pushing arcs forward (linking directly from - * "from"'s predecessors to "to") or by pulling them back (linking - * directly from "from" to "to"'s successors). In general, we choose - * whichever way creates greater fan-out or fan-in, so as to improve the - * odds of reducing the other state to zero in-arcs or out-arcs and - * thereby being able to delete it. However, if "from" is doomed (has no - * non-EMPTY out-arcs), we must keep it so, so always push forward in that - * case. - * - * The fan-out/fan-in comparison should count only non-EMPTY arcs. If - * "from" is doomed, we can skip counting "to"'s arcs, since we want to - * force taking the copynonemptyins path in that case. - */ - fromouts = nonemptyouts(from); - toins = (fromouts == 0) ? 1 : nonemptyins(to); - - if (fromouts > toins) { - copyouts(nfa, to, from, 0); - return; - } - if (fromouts < toins) { - copyins(nfa, from, to, 0); - return; - } - - /* - * fromouts == toins. Decide on secondary issue: copy fewest arcs. - * - * Doesn't seem to be worth the trouble to exclude empties from these - * comparisons; that takes extra time and doesn't seem to improve the - * resulting graph much. - */ - if (from->nins > to->nouts) { - copyouts(nfa, to, from, 0); - return; - } - - copyins(nfa, from, to, 0); -} /* * isconstraintarc - detect whether an arc is of a constraint type diff --git a/generic/regcomp.c b/generic/regcomp.c index b01311b..985cb93 100644 --- a/generic/regcomp.c +++ b/generic/regcomp.c @@ -124,8 +124,6 @@ static struct arc *allocarc(struct nfa *, struct state *); static void freearc(struct nfa *, struct arc *); static void changearctarget(struct arc *, struct state *); static int hasnonemptyout(struct state *); -static int nonemptyouts(struct state *); -static int nonemptyins(struct state *); static struct arc *findarc(struct state *, int, pcolor); static void cparc(struct nfa *, struct arc *, struct state *, struct state *); static void sortins(struct nfa *, struct state *); @@ -154,8 +152,8 @@ static int push(struct nfa *, struct arc *); #define COMPATIBLE 3 /* compatible but not satisfied yet */ static int combine(struct arc *, struct arc *); static void fixempties(struct nfa *, FILE *); -static struct state *emptyreachable(struct state *, struct state *); -static void replaceempty(struct nfa *, struct state *, struct state *); +static struct state *emptyreachable(struct nfa *, struct state *, + struct state *, struct arc **); static int isconstraintarc(struct arc *); static int hasconstraintout(struct state *); static void fixconstraintloops(struct nfa *, FILE *); -- cgit v0.12 From 5ec3b6491d71b85b55f8927e78f033e75c92170f Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 20 Oct 2015 19:21:53 +0000 Subject: Adaptation of re-better-pushpull.patch from Tom Lane @postgres --- generic/regc_nfa.c | 155 ++++++++++++++++++++++++++++++++++++++++------------- generic/regcomp.c | 4 +- 2 files changed, 119 insertions(+), 40 deletions(-) diff --git a/generic/regc_nfa.c b/generic/regc_nfa.c index 5582e4e..bbc4dd6 100644 --- a/generic/regc_nfa.c +++ b/generic/regc_nfa.c @@ -1518,6 +1518,7 @@ pullback( struct state *nexts; struct arc *a; struct arc *nexta; + struct state *intermediates; int progress; /* @@ -1528,15 +1529,27 @@ pullback( progress = 0; for (s=nfa->states ; s!=NULL && !NISERR() ; s=nexts) { nexts = s->next; + intermediates = NULL; for (a=s->outs ; a!=NULL && !NISERR() ; a=nexta) { nexta = a->outchain; if (a->type == '^' || a->type == BEHIND) { - if (pull(nfa, a)) { + if (pull(nfa, a, &intermediates)) { progress = 1; } } assert(nexta == NULL || s->no != FREESTATE); } + /* clear tmp fields of intermediate states created here */ + while (intermediates != NULL) { + struct state *ns = intermediates->tmp; + + intermediates->tmp = NULL; + intermediates = ns; + } + /* if s is now useless, get rid of it */ + if ((s->nins == 0 || s->nouts == 0) && !s->flag) { + dropstate(nfa, s); + } } if (progress && f != NULL) { dumpnfa(nfa, f); @@ -1564,15 +1577,28 @@ pullback( /* - pull - pull a back constraint backward past its source state - * A significant property of this function is that it deletes at most - * one state -- the constraint's from state -- and only if the constraint - * was that state's last outarc. + * + * Returns 1 if successful (which it always is unless the source is the + * start state or we have an internal error), 0 if nothing happened. + * + * A significant property of this function is that it deletes no pre-existing + * states, and no outarcs of the constraint's from state other than the given + * constraint arc. This makes the loops in pullback() safe, at the cost that + * we may leave useless states behind. Therefore, we leave it to pullback() + * to delete such states. + * + * If the from state has multiple back-constraint outarcs, and/or multiple + * compatible constraint inarcs, we only need to create one new intermediate + * state per combination of predecessor and successor states. *intermediates + * points to a list of such intermediate states for this from state (chained + * through their tmp fields). ^ static int pull(struct nfa *, struct arc *); */ -static int /* 0 couldn't, 1 could */ +static int pull( struct nfa *nfa, - struct arc *con) + struct arc *con, + struct state **intermediates) { struct state *from = con->from; struct state *to = con->to; @@ -1590,7 +1616,9 @@ pull( } /* - * First, clone from state if necessary to avoid other outarcs. + * First, clone from state if necessary to avoid other outarcs. This may + * seem wasteful, but it simplifies the logic, and we'll get rid of the + * clone state again at the bottom. */ if (from->nouts > 1) { @@ -1601,6 +1629,9 @@ pull( copyins(nfa, from, s, 1); /* duplicate inarcs */ cparc(nfa, con, s, to); /* move constraint arc */ freearc(nfa, con); + if (NISERR()) { + return 0; + } from = s; con = from->outs; } @@ -1610,7 +1641,7 @@ pull( * Propagate the constraint into the from state's inarcs. */ - for (a=from->ins ; a!=NULL ; a=nexta) { + for (a=from->ins ; a!=NULL && !NISERR(); a=nexta) { nexta = a->inchain; switch (combine(con, a)) { case INCOMPATIBLE: /* destroy the arc */ @@ -1619,17 +1650,25 @@ pull( case SATISFIED: /* no action needed */ break; case COMPATIBLE: /* swap the two arcs, more or less */ - s = newstate(nfa); - if (NISERR()) { - return 0; + /* need an intermediate state, but might have one already */ + for (s = *intermediates; s != NULL; s = s->tmp) { + assert(s->nins > 0 && s->nouts > 0); + if (s->ins->from == a->from && s->outs->to == to) { + break; + } } - cparc(nfa, a, s, to); /* anticipate move */ - cparc(nfa, con, a->from, s); - if (NISERR()) { - return 0; + if (s == NULL) { + s = newstate(nfa); + if (NISERR()) { + return 0; + } + s->tmp = *intermediates; + *intermediates = s; } - freearc(nfa, a); - break; + cparc(nfa, con, a->from, s); + cparc(nfa, a, s, to); + freearc(nfa, a); + break; default: assert(NOTREACHED); break; @@ -1641,7 +1680,8 @@ pull( */ moveins(nfa, from, to); - dropstate(nfa, from); /* will free the constraint */ + freearc(nfa, con); + /* from state is now useless, but we leave it to pullback() to clean up */ return 1; } @@ -1658,6 +1698,7 @@ pushfwd( struct state *nexts; struct arc *a; struct arc *nexta; + struct state *intermediates; int progress; /* @@ -1668,14 +1709,25 @@ pushfwd( progress = 0; for (s=nfa->states ; s!=NULL && !NISERR() ; s=nexts) { nexts = s->next; + intermediates = NULL; for (a = s->ins; a != NULL && !NISERR(); a = nexta) { nexta = a->inchain; if (a->type == '$' || a->type == AHEAD) { - if (push(nfa, a)) { + if (push(nfa, a, &intermediates)) { progress = 1; } } - assert(nexta == NULL || s->no != FREESTATE); + } + /* clear tmp fields of intermediate states created here */ + while (intermediates != NULL) { + struct state *ns = intermediates->tmp; + + intermediates->tmp = NULL; + intermediates = ns; + } + /* if s is now useless, get rid of it */ + if ((s->nins == 0 || s->nouts == 0) && !s->flag) { + dropstate(nfa, s); } } if (progress && f != NULL) { @@ -1704,15 +1756,28 @@ pushfwd( /* - push - push a forward constraint forward past its destination state - * A significant property of this function is that it deletes at most - * one state -- the constraint's to state -- and only if the constraint - * was that state's last inarc. + * + * Returns 1 if successful (which it always is unless the destination is the + * post state or we have an internal error), 0 if nothing happened. + * + * A significant property of this function is that it deletes no pre-existing + * states, and no inarcs of the constraint's to state other than the given + * constraint arc. This makes the loops in pushfwd() safe, at the cost that + * we may leave useless states behind. Therefore, we leave it to pushfwd() + * to delete such states. + * + * If the to state has multiple forward-constraint inarcs, and/or multiple + * compatible constraint outarcs, we only need to create one new intermediate + * state per combination of predecessor and successor states. *intermediates + * points to a list of such intermediate states for this to state (chained + * through their tmp fields). ^ static int push(struct nfa *, struct arc *); */ -static int /* 0 couldn't, 1 could */ +static int push( struct nfa *nfa, - struct arc *con) + struct arc *con, + struct state **intermediates) { struct state *from = con->from; struct state *to = con->to; @@ -1730,7 +1795,9 @@ push( } /* - * First, clone to state if necessary to avoid other inarcs. + * First, clone to state if necessary to avoid other inarcs. This may + * seem wasteful, but it simplifies the logic, and we'll get rid of the + * clone state again at the bottom. */ if (to->nins > 1) { @@ -1739,8 +1806,11 @@ push( return 0; } copyouts(nfa, to, s, 1); /* duplicate outarcs */ - cparc(nfa, con, from, s); /* move constraint */ + cparc(nfa, con, from, s); /* move constraint arc */ freearc(nfa, con); + if (NISERR()) { + return 0; + } to = s; con = to->ins; } @@ -1750,7 +1820,7 @@ push( * Propagate the constraint into the to state's outarcs. */ - for (a = to->outs; a != NULL; a = nexta) { + for (a = to->outs; a != NULL && !NISERR(); a = nexta) { nexta = a->outchain; switch (combine(con, a)) { case INCOMPATIBLE: /* destroy the arc */ @@ -1759,17 +1829,25 @@ push( case SATISFIED: /* no action needed */ break; case COMPATIBLE: /* swap the two arcs, more or less */ - s = newstate(nfa); - if (NISERR()) { - return 0; + /* need an intermediate state, but might have one already */ + for (s = *intermediates; s != NULL; s = s->tmp) { + assert(s->nins > 0 && s->nouts > 0); + if (s->ins->from == from && s->outs->to == a->to) { + break; + } } - cparc(nfa, con, s, a->to); /* anticipate move */ - cparc(nfa, a, from, s); - if (NISERR()) { - return 0; + if (s == NULL) { + s = newstate(nfa); + if (NISERR()) { + return 0; + } + s->tmp = *intermediates; + *intermediates = s; } - freearc(nfa, a); - break; + cparc(nfa, con, s, a->to); + cparc(nfa, a, from, s); + freearc(nfa, a); + break; default: assert(NOTREACHED); break; @@ -1781,7 +1859,8 @@ push( */ moveouts(nfa, to, from); - dropstate(nfa, to); /* will free the constraint */ + freearc(nfa, con); + /* to state is now useless, but we leave it to pushfwd() to clean up */ return 1; } diff --git a/generic/regcomp.c b/generic/regcomp.c index 985cb93..6b40100 100644 --- a/generic/regcomp.c +++ b/generic/regcomp.c @@ -144,9 +144,9 @@ static void cleartraverse(struct nfa *, struct state *); static void specialcolors(struct nfa *); static long optimize(struct nfa *, FILE *); static void pullback(struct nfa *, FILE *); -static int pull(struct nfa *, struct arc *); +static int pull(struct nfa *, struct arc *, struct state **); static void pushfwd(struct nfa *, FILE *); -static int push(struct nfa *, struct arc *); +static int push(struct nfa *, struct arc *, struct state **); #define INCOMPATIBLE 1 /* destroys arc */ #define SATISFIED 2 /* constraint satisfied */ #define COMPATIBLE 3 /* compatible but not satisfied yet */ -- cgit v0.12 From 75ed02d88822dad90ad256551f2df875aa884975 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 20 Oct 2015 19:53:03 +0000 Subject: Adaptation of re-memaccounting.patch from Tom Lane @postgres. --- generic/regc_nfa.c | 84 +++++++++--------------------------------------------- generic/regcomp.c | 2 ++ generic/regerrs.h | 2 +- generic/regex.h | 2 +- generic/regguts.h | 16 ++++++----- tests/regexp.test | 2 +- 6 files changed, 28 insertions(+), 80 deletions(-) diff --git a/generic/regc_nfa.c b/generic/regc_nfa.c index bbc4dd6..5568bff 100644 --- a/generic/regc_nfa.c +++ b/generic/regc_nfa.c @@ -62,7 +62,6 @@ newnfa( nfa->nstates = 0; nfa->cm = cm; nfa->v = v; - nfa->size = 0; nfa->bos[0] = nfa->bos[1] = COLORLESS; nfa->eos[0] = nfa->eos[1] = COLORLESS; nfa->parent = parent; /* Precedes newfstate so parent is valid. */ @@ -90,61 +89,6 @@ newnfa( } /* - - TooManyStates - checks if the max states exceeds the compile-time value - ^ static int TooManyStates(struct nfa *); - */ -static int -TooManyStates( - struct nfa *nfa) -{ - struct nfa *parent = nfa->parent; - size_t sz = nfa->size; - - while (parent != NULL) { - sz = parent->size; - parent = parent->parent; - } - if (sz > REG_MAX_STATES) { - return 1; - } - return 0; -} - -/* - - IncrementSize - increases the tracked size of the NFA and its parents. - ^ static void IncrementSize(struct nfa *); - */ -static void -IncrementSize( - struct nfa *nfa) -{ - struct nfa *parent = nfa->parent; - - nfa->size++; - while (parent != NULL) { - parent->size++; - parent = parent->parent; - } -} - -/* - - DecrementSize - increases the tracked size of the NFA and its parents. - ^ static void DecrementSize(struct nfa *); - */ -static void -DecrementSize( - struct nfa *nfa) -{ - struct nfa *parent = nfa->parent; - - nfa->size--; - while (parent != NULL) { - parent->size--; - parent = parent->parent; - } -} - -/* - freenfa - free an entire NFA ^ static VOID freenfa(struct nfa *); */ @@ -180,20 +124,20 @@ newstate( { struct state *s; - if (TooManyStates(nfa)) { - /* XXX: add specific error for this */ - NERR(REG_ETOOBIG); - return NULL; - } if (nfa->free != NULL) { s = nfa->free; nfa->free = s->next; } else { + if (nfa->v->spaceused >= REG_MAX_COMPILE_SPACE) { + NERR(REG_ETOOBIG); + return NULL; + } s = (struct state *) MALLOC(sizeof(struct state)); if (s == NULL) { NERR(REG_ESPACE); return NULL; } + nfa->v->spaceused += sizeof(struct state); s->oas.next = NULL; s->free = NULL; s->noas = 0; @@ -217,12 +161,6 @@ newstate( } s->prev = nfa->slast; nfa->slast = s; - - /* - * Track the current size and the parent size. - */ - - IncrementSize(nfa); return s; } @@ -293,7 +231,6 @@ freestate( s->prev = NULL; s->next = nfa->free; /* don't delete it, put it on the free list */ nfa->free = s; - DecrementSize(nfa); } /* @@ -312,11 +249,13 @@ destroystate( for (ab=s->oas.next ; ab!=NULL ; ab=abnext) { abnext = ab->next; FREE(ab); + nfa->v->spaceused -= sizeof(struct arcbatch); } s->ins = NULL; s->outs = NULL; s->next = NULL; FREE(s); + nfa->v->spaceused -= sizeof(struct state); } /* @@ -439,14 +378,19 @@ allocarc( */ if (s->free == NULL) { - struct arcbatch *newAb = (struct arcbatch *) - MALLOC(sizeof(struct arcbatch)); + struct arcbatch *newAb; int i; + if (nfa->v->spaceused >= REG_MAX_COMPILE_SPACE) { + NERR(REG_ETOOBIG); + return NULL; + } + newAb = (struct arcbatch *) MALLOC(sizeof(struct arcbatch)); if (newAb == NULL) { NERR(REG_ESPACE); return NULL; } + nfa->v->spaceused += sizeof(struct arcbatch); newAb->next = s->oas.next; s->oas.next = newAb; diff --git a/generic/regcomp.c b/generic/regcomp.c index 6b40100..3c91962 100644 --- a/generic/regcomp.c +++ b/generic/regcomp.c @@ -228,6 +228,7 @@ struct vars { struct cvec *cv2; /* utility cvec */ struct subre *lacons; /* lookahead-constraint vector */ int nlacons; /* size of lacons */ + size_t spaceused; /* approx. space used for compilation */ }; /* parsing macros; most know that `v' is the struct vars pointer */ @@ -337,6 +338,7 @@ compile( v->cv2 = NULL; v->lacons = NULL; v->nlacons = 0; + v->spaceused = 0; re->re_magic = REMAGIC; re->re_info = 0; /* bits get set during parse */ re->re_csize = sizeof(chr); diff --git a/generic/regerrs.h b/generic/regerrs.h index 72548ff..ee203d5 100644 --- a/generic/regerrs.h +++ b/generic/regerrs.h @@ -16,5 +16,5 @@ { REG_INVARG, "REG_INVARG", "invalid argument to regex function" }, { REG_MIXED, "REG_MIXED", "character widths of regex and string differ" }, { REG_BADOPT, "REG_BADOPT", "invalid embedded option" }, -{ REG_ETOOBIG, "REG_ETOOBIG", "nfa has too many states" }, +{ REG_ETOOBIG, "REG_ETOOBIG", "regular expression is too complex" }, { REG_ECOLORS, "REG_ECOLORS", "too many colors" }, diff --git a/generic/regex.h b/generic/regex.h index b5dce50..b5b11bd 100644 --- a/generic/regex.h +++ b/generic/regex.h @@ -277,7 +277,7 @@ typedef struct { #define REG_INVARG 16 /* invalid argument to regex function */ #define REG_MIXED 17 /* character widths of regex and string differ */ #define REG_BADOPT 18 /* invalid embedded option */ -#define REG_ETOOBIG 19 /* nfa has too many states */ +#define REG_ETOOBIG 19 /* regular expression is too complex */ #define REG_ECOLORS 20 /* too many colors */ /* two specials for debugging and testing */ #define REG_ATOI 101 /* convert error-code name to number */ diff --git a/generic/regguts.h b/generic/regguts.h index 7ed8ec1..72bdcb3 100644 --- a/generic/regguts.h +++ b/generic/regguts.h @@ -307,9 +307,6 @@ struct nfa { struct colormap *cm; /* the color map */ color bos[2]; /* colors, if any, assigned to BOS and BOL */ color eos[2]; /* colors, if any, assigned to EOS and EOL */ - size_t size; /* Current NFA size; differs from nstates as - * it also counts the number of states created - * by children of this state. */ struct vars *v; /* simplifies compile error reporting */ struct nfa *parent; /* parent NFA, if any */ }; @@ -339,11 +336,16 @@ struct cnfa { #define NULLCNFA(cnfa) ((cnfa).nstates == 0) /* - * Used to limit the maximum NFA size to something sane. [Bug 1810264] + * This symbol limits the transient heap space used by the regex compiler, + * and thereby also the maximum complexity of NFAs that we'll deal with. + * Currently we only count NFA states and arcs against this; the other + * transient data is generally not large enough to notice compared to those. + * Note that we do not charge anything for the final output data structures + * (the compacted NFA and the colormap). */ - -#ifndef REG_MAX_STATES -# define REG_MAX_STATES 100000 +#ifndef REG_MAX_COMPILE_SPACE +#define REG_MAX_COMPILE_SPACE \ + (100000 * sizeof(struct state) + 100000 * sizeof(struct arcbatch)) #endif /* diff --git a/tests/regexp.test b/tests/regexp.test index 362f425..7878d41 100644 --- a/tests/regexp.test +++ b/tests/regexp.test @@ -716,7 +716,7 @@ test regexp-22.4 {Bug 3606139} -setup { [a 668]([a 55])[a 668]([a 55])[a 668]([a 55])[a 511]] {}] a } -cleanup { rename a {} -} -returnCodes 1 -result {couldn't compile regular expression pattern: nfa has too many states} +} -returnCodes 1 -match glob -result {couldn't compile regular expression pattern: *} test regexp-22.5 {Bug 3610026} -setup { set e {} set cp 99 -- cgit v0.12 From bc85f89c10afaf5368f4c41a235e11955886a1a3 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 20 Oct 2015 20:21:44 +0000 Subject: Adaptation of most of the re-mopup.patch from Tom Lane @ postgress. Still should add the new tests. --- generic/regc_nfa.c | 50 ++++++++++++++++---------------------------------- generic/regcomp.c | 12 ++++++------ 2 files changed, 22 insertions(+), 40 deletions(-) diff --git a/generic/regc_nfa.c b/generic/regc_nfa.c index 5568bff..6280e5e 100644 --- a/generic/regc_nfa.c +++ b/generic/regc_nfa.c @@ -843,15 +843,13 @@ moveins( /* - copyins - copy in arcs of a state to another state - * Either all arcs, or only non-empty ones as determined by all value. ^ static VOID copyins(struct nfa *, struct state *, struct state *, int); */ static void copyins( struct nfa *nfa, struct state *oldState, - struct state *newState, - int all) + struct state *newState) { assert(oldState != newState); @@ -860,9 +858,7 @@ copyins( struct arc *a; for (a = oldState->ins; a != NULL; a = a->inchain) { - if (all || a->type != EMPTY) { - cparc(nfa, a, a->from, newState); - } + cparc(nfa, a, a->from, newState); } } else { /* @@ -892,11 +888,6 @@ copyins( while (oa != NULL && na != NULL) { struct arc *a = oa; - if (!all && a->type == EMPTY) { - oa = oa->inchain; - continue; - } - switch (sortins_cmp(&oa, &na)) { case -1: /* newState does not have anything matching oa */ @@ -920,11 +911,6 @@ copyins( /* newState does not have anything matching oa */ struct arc *a = oa; - if (!all && a->type == EMPTY) { - oa = oa->inchain; - continue; - } - oa = oa->inchain; createarc(nfa, a->type, a->co, a->from, newState); } @@ -1114,15 +1100,13 @@ moveouts( /* - copyouts - copy out arcs of a state to another state - * Either all arcs, or only non-empty ones as determined by all value. ^ static VOID copyouts(struct nfa *, struct state *, struct state *, int); */ static void copyouts( struct nfa *nfa, struct state *oldState, - struct state *newState, - int all) + struct state *newState) { assert(oldState != newState); @@ -1131,9 +1115,7 @@ copyouts( struct arc *a; for (a = oldState->outs; a != NULL; a = a->outchain) { - if (all || a->type != EMPTY) { - cparc(nfa, a, newState, a->to); - } + cparc(nfa, a, newState, a->to); } } else { /* @@ -1163,11 +1145,6 @@ copyouts( while (oa != NULL && na != NULL) { struct arc *a = oa; - if (!all && a->type == EMPTY) { - oa = oa->outchain; - continue; - } - switch (sortouts_cmp(&oa, &na)) { case -1: /* newState does not have anything matching oa */ @@ -1191,11 +1168,6 @@ copyouts( /* newState does not have anything matching oa */ struct arc *a = oa; - if (!all && a->type == EMPTY){ - oa = oa->outchain; - continue; - } - oa = oa->outchain; createarc(nfa, a->type, a->co, newState, a->to); } @@ -1446,6 +1418,11 @@ optimize( fprintf(f, "\nfinal cleanup:\n"); } cleanup(nfa); /* final tidying */ +#ifdef REG_DEBUG + if (verbose) { + dumpnfa(nfa, f); + } +#endif return analyze(nfa); /* and analysis */ } @@ -1570,7 +1547,7 @@ pull( if (NISERR()) { return 0; } - copyins(nfa, from, s, 1); /* duplicate inarcs */ + copyins(nfa, from, s); /* duplicate inarcs */ cparc(nfa, con, s, to); /* move constraint arc */ freearc(nfa, con); if (NISERR()) { @@ -1749,7 +1726,7 @@ push( if (NISERR()) { return 0; } - copyouts(nfa, to, s, 1); /* duplicate outarcs */ + copyouts(nfa, to, s); /* duplicate outarcs */ cparc(nfa, con, from, s); /* move constraint arc */ freearc(nfa, con); if (NISERR()) { @@ -2958,6 +2935,8 @@ dumpnfa( { #ifdef REG_DEBUG struct state *s; + int nstates = 0; + int narcs = 0; fprintf(f, "pre %d, post %d", nfa->pre->no, nfa->post->no); if (nfa->bos[0] != COLORLESS) { @@ -2975,7 +2954,10 @@ dumpnfa( fprintf(f, "\n"); for (s = nfa->states; s != NULL; s = s->next) { dumpstate(s, f); + nstates++; + narcs += s->nouts; } + fprintf(f, "total of %d states, %d arcs\n", nstates, narcs); if (nfa->parent == NULL) { dumpcolors(nfa->cm, f); } diff --git a/generic/regcomp.c b/generic/regcomp.c index 3c91962..8287b7e 100644 --- a/generic/regcomp.c +++ b/generic/regcomp.c @@ -131,10 +131,10 @@ static int sortins_cmp(const void *, const void *); static void sortouts(struct nfa *, struct state *); static int sortouts_cmp(const void *, const void *); static void moveins(struct nfa *, struct state *, struct state *); -static void copyins(struct nfa *, struct state *, struct state *, int); +static void copyins(struct nfa *, struct state *, struct state *); static void mergeins(struct nfa *, struct state *, struct arc **, int); static void moveouts(struct nfa *, struct state *, struct state *); -static void copyouts(struct nfa *, struct state *, struct state *, int); +static void copyouts(struct nfa *, struct state *, struct state *); static void cloneouts(struct nfa *, struct state *, struct state *, struct state *, int); static void delsub(struct nfa *, struct state *, struct state *); static void deltraverse(struct nfa *, struct state *, struct state *); @@ -173,7 +173,6 @@ static void dumpnfa(struct nfa *, FILE *); #ifdef REG_DEBUG static void dumpstate(struct state *, FILE *); static void dumparcs(struct state *, FILE *); -static int dumprarcs(struct arc *, struct state *, FILE *, int); static void dumparc(struct arc *, struct state *, FILE *); #endif static void dumpcnfa(struct cnfa *, FILE *); @@ -627,8 +626,9 @@ makesearch( for (s=slist ; s!=NULL ; s=s2) { s2 = newstate(nfa); - - copyouts(nfa, s, s2, 1); + NOERR(); + copyouts(nfa, s, s2); + NOERR(); for (a=s->ins ; a!=NULL ; a=b) { b = a->inchain; @@ -2061,7 +2061,7 @@ dump( dumpcolors(&g->cmap, f); if (!NULLCNFA(g->search)) { - printf("\nsearch:\n"); + fprintf(f, "\nsearch:\n"); dumpcnfa(&g->search, f); } for (i = 1; i < g->nlacons; i++) { -- cgit v0.12 From 16ccc54387b39505723e3413eb4d755ea7cdb3ff Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 21 Oct 2015 13:35:48 +0000 Subject: Adapted new tests contributed from Tom Lane @postgres. --- tests/reg.test | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/reg.test b/tests/reg.test index b259ce5..6cd2eb3 100644 --- a/tests/reg.test +++ b/tests/reg.test @@ -1093,6 +1093,34 @@ test reg-33.21 {constraint fixes} { test reg-33.22 {constraint fixes} { regexp {(^(?!aa)(?!bb)(?!cc))+} {dd x} } 1 + +test reg-33.23 {} { + regexp {abcd(\m)+xyz} x +} 0 +test reg-33.24 {} { + regexp {abcd(\m)+xyz} a +} 0 +test reg-33.25 {} { + regexp {^abcd*(((((^(a c(e?d)a+|)+|)+|)+|)+|a)+|)} x +} 0 +test reg-33.26 {} { + regexp {a^(^)bcd*xy(((((($a+|)+|)+|)+$|)+|)+|)^$} x +} 0 +test reg-33.27 {} { + regexp {xyz(\Y\Y)+} x +} 0 +test reg-33.28 {} { + regexp {x|(?:\M)+} x +} 1 +test reg-33.29 {} { + # This is near the limits of the RE engine + regexp [string repeat x*y*z* 480] x +} 1 + +test reg-33.30 {Bug 1080042} { + regexp {(\Y)+} foo +} 1 + # cleanup ::tcltest::cleanupTests -- cgit v0.12 From 775b09cb001aae11f753654ae22365f295f56fe8 Mon Sep 17 00:00:00 2001 From: oehhar Date: Wed, 21 Oct 2015 20:30:49 +0000 Subject: Change "clock format -format %x -locale current" output on msgcat locale change [4a0c163d24] --- library/clock.tcl | 36 ++++++++++++++++++++++++++++++++++++ tests/clock.test | 13 +++++++++++++ 2 files changed, 49 insertions(+) diff --git a/library/clock.tcl b/library/clock.tcl index bfdf832..8e4b657 100755 --- a/library/clock.tcl +++ b/library/clock.tcl @@ -111,6 +111,7 @@ proc ::tcl::clock::Initialize {} { mcpackagelocale set {} ::msgcat::mcpackageconfig set mcfolder [file join $LibDir msgs] ::msgcat::mcpackageconfig set unknowncmd "" + ::msgcat::mcpackageconfig set changecmd ChangeCurrentLocale # Define the message catalog for the root locale. @@ -4475,6 +4476,41 @@ proc ::tcl::clock::AddDays { days clockval timezone changeover } { #---------------------------------------------------------------------- # +# ChangeCurrentLocale -- +# +# The global locale was changed within msgcat. +# Clears the buffered parse functions of the current locale. +# +# Parameters: +# loclist (ignored) +# +# Results: +# None. +# +# Side effects: +# Buffered parse functions are cleared. +# +#---------------------------------------------------------------------- + +proc ::tcl::clock::ChangeCurrentLocale {args} { + variable FormatProc + variable LocaleNumeralCache + variable CachedSystemTimeZone + variable TimeZoneBad + + foreach p [info procs [namespace current]::scanproc'*'current] { + rename $p {} + } + foreach p [info procs [namespace current]::formatproc'*'current] { + rename $p {} + } + + catch {array unset FormatProc *'current} + set LocaleNumeralCache {} +} + +#---------------------------------------------------------------------- +# # ClearCaches -- # # Clears all caches to reclaim the memory used in [clock] diff --git a/tests/clock.test b/tests/clock.test index 2abeab9..4f69ed3 100644 --- a/tests/clock.test +++ b/tests/clock.test @@ -36931,6 +36931,19 @@ test clock-67.2 {Bug d19a30db57} -body { # error, not segfault tcl::clock::GetJulianDayFromEraYearMonthDay {} 2361222 } -returnCodes error -match glob -result * + +test clock-67.3 {Change %x output on global locale change [Bug 4a0c163d24]} -setup { + package require msgcat + set current [msgcat::mclocale] +} -body { + msgcat::mclocale de_de + set res [clock format 1 -locale current -format %x] + msgcat::mclocale en_uk + lappend res [clock format 1 -locale current -format %x] +} -cleanup { + msgcat::mclocale $current +} -result {01.01.1970 01/01/1970} + test clock-67.3 {Bug d19a30db57} -body { # error, not segfault tcl::clock::GetJulianDayFromEraYearWeekDay {} 2361222 -- cgit v0.12 From f82f46df1628c6703ad0ff2b94d83c6c9a46c56f Mon Sep 17 00:00:00 2001 From: Kevin B Kenny Date: Wed, 21 Oct 2015 23:30:41 +0000 Subject: Micro-optimization: remove double checked lock from TclGetAllocCache in favour of initialization in TclInitSubsystems --- generic/tclEvent.c | 3 +++ generic/tclInt.h | 3 +++ unix/tclUnixThrd.c | 27 ++++++++++----------------- win/tclWinThrd.c | 33 +++++++++++++++------------------ 4 files changed, 31 insertions(+), 35 deletions(-) diff --git a/generic/tclEvent.c b/generic/tclEvent.c index 8305410..d62850b 100644 --- a/generic/tclEvent.c +++ b/generic/tclEvent.c @@ -1043,6 +1043,9 @@ TclInitSubsystems(void) #if USE_TCLALLOC TclInitAlloc(); /* Process wide mutex init */ #endif +#if defined(TCL_THREADS) && defined(USE_THREAD_ALLOC) + TclpInitThreadAlloc(); +#endif #ifdef TCL_MEM_DEBUG TclInitDbCkalloc(); /* Process wide mutex init */ #endif diff --git a/generic/tclInt.h b/generic/tclInt.h index 356d250..d4baed4 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -3146,6 +3146,9 @@ MODULE_SCOPE int TclpLoadMemory(Tcl_Interp *interp, void *buffer, Tcl_FSUnloadFileProc **unloadProcPtr, int flags); #endif MODULE_SCOPE void TclInitThreadStorage(void); +#if defined(TCL_THREADS) && defined(USE_THREAD_ALLOC) +MODULE_SCOPE void TclpInitThreadAlloc(void); +#endif MODULE_SCOPE void TclFinalizeThreadDataThread(void); MODULE_SCOPE void TclFinalizeThreadStorage(void); #ifdef TCL_WIDE_CLICKS diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c index ea03332..0f4a8a3 100644 --- a/unix/tclUnixThrd.c +++ b/unix/tclUnixThrd.c @@ -680,7 +680,6 @@ TclpInetNtoa( */ #ifdef USE_THREAD_ALLOC -static volatile int initialized = 0; static pthread_key_t key; typedef struct allocMutex { @@ -727,29 +726,23 @@ TclpFreeAllocCache( TclFreeAllocCache(ptr); pthread_setspecific(key, NULL); - - } else if (initialized) { - /* - * Called by us in TclFinalizeThreadAlloc() during the library - * finalization initiated from Tcl_Finalize() - */ - + + } else { pthread_key_delete(key); - initialized = 0; } } +void +TclpInitThreadAlloc(void) +{ + pthread_mutex_lock(allocLockPtr); + pthread_key_create(&key, TclpFreeAllocCache); + pthread_mutex_unlock(allocLockPtr); +} + void * TclpGetAllocCache(void) { - if (!initialized) { - pthread_mutex_lock(allocLockPtr); - if (!initialized) { - pthread_key_create(&key, TclpFreeAllocCache); - initialized = 1; - } - pthread_mutex_unlock(allocLockPtr); - } return pthread_getspecific(key); } diff --git a/win/tclWinThrd.c b/win/tclWinThrd.c index 1c9d483..fac8ab3 100644 --- a/win/tclWinThrd.c +++ b/win/tclWinThrd.c @@ -122,7 +122,6 @@ typedef struct WinCondition { */ #ifdef USE_THREAD_ALLOC -static int once; static DWORD tlsKey; typedef struct allocMutex { @@ -971,24 +970,24 @@ TclpFreeAllocMutex( free(lockPtr); } +void +TclInitThreadAlloc(void) +{ + /* + * We need to make sure that TclpFreeAllocCache is called on each + * thread that calls this, but only on threads that call this. + */ + + tlsKey = TlsAlloc(); + if (tlsKey == TLS_OUT_OF_INDEXES) { + Tcl_Panic("could not allocate thread local storage"); + } +} + void * TclpGetAllocCache(void) { void *result; - - if (!once) { - /* - * We need to make sure that TclpFreeAllocCache is called on each - * thread that calls this, but only on threads that call this. - */ - - tlsKey = TlsAlloc(); - once = 1; - if (tlsKey == TLS_OUT_OF_INDEXES) { - Tcl_Panic("could not allocate thread local storage"); - } - } - result = TlsGetValue(tlsKey); if ((result == NULL) && (GetLastError() != NO_ERROR)) { Tcl_Panic("TlsGetValue failed from TclpGetAllocCache"); @@ -1024,7 +1023,7 @@ TclpFreeAllocCache( if (!success) { Tcl_Panic("TlsSetValue failed from TclpFreeAllocCache"); } - } else if (once) { + } else { /* * Called by us in TclFinalizeThreadAlloc() during the library * finalization initiated from Tcl_Finalize() @@ -1034,9 +1033,7 @@ TclpFreeAllocCache( if (!success) { Tcl_Panic("TlsFree failed from TclpFreeAllocCache"); } - once = 0; /* reset for next time. */ } - } #endif /* USE_THREAD_ALLOC */ -- cgit v0.12 From ea342f5111aeaaf3b3da7e7e75df24f55a0f3e7d Mon Sep 17 00:00:00 2001 From: dkf Date: Thu, 22 Oct 2015 01:00:28 +0000 Subject: Turn off NRE asserts by default. About a 5% speedup on [clock format]. --- generic/tclBasic.c | 3 --- generic/tclExecute.c | 3 --- generic/tclInt.h | 4 +++- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/generic/tclBasic.c b/generic/tclBasic.c index a09bf10..5c5bc64 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -22,10 +22,7 @@ #include "tclCompile.h" #include "tommath.h" #include - -#if NRE_ENABLE_ASSERTS #include -#endif #define INTERP_STACK_INITIAL_SIZE 2000 #define CORO_STACK_INITIAL_SIZE 200 diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 7f65262..b10af65 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -20,10 +20,7 @@ #include "tclOOInt.h" #include "tommath.h" #include - -#if NRE_ENABLE_ASSERTS #include -#endif /* * Hack to determine whether we may expect IEEE floating point. The hack is diff --git a/generic/tclInt.h b/generic/tclInt.h index d4baed4..50eb370 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -4799,7 +4799,9 @@ void Tcl_Panic(const char *, ...) __attribute__((analyzer_noreturn)); */ #define NRE_USE_SMALL_ALLOC 1 /* Only turn off for debugging purposes. */ -#define NRE_ENABLE_ASSERTS 1 +#ifndef NRE_ENABLE_ASSERTS +#define NRE_ENABLE_ASSERTS 0 +#endif /* * This is the main data struct for representing NR commands. It is designed -- cgit v0.12 From ca9cf2ba57b9245e21d8bd908ffdbea32ed3d7cd Mon Sep 17 00:00:00 2001 From: Kevin B Kenny Date: Thu, 22 Oct 2015 14:07:01 +0000 Subject: fix typo in micro-optimization TclpInitThreadAlloc --- win/tclWinThrd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win/tclWinThrd.c b/win/tclWinThrd.c index fac8ab3..a2fc226 100644 --- a/win/tclWinThrd.c +++ b/win/tclWinThrd.c @@ -971,7 +971,7 @@ TclpFreeAllocMutex( } void -TclInitThreadAlloc(void) +TclpInitThreadAlloc(void) { /* * We need to make sure that TclpFreeAllocCache is called on each -- cgit v0.12 From ca7c0960d7638677ec58d01f6229fda1c9e310a4 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 22 Oct 2015 21:06:35 +0000 Subject: Open the release candidate branch for Tcl 8.5.19. Updated changes file. --- changes | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/changes b/changes index 6d61b5e..31757a0 100644 --- a/changes +++ b/changes @@ -7929,3 +7929,42 @@ of Tcl_Channel (porter) 2015-02-11 tzdata updated to Olson's tzdata2015a (venkat) --- Released 8.5.18, March 6, 2015 --- http://core.tcl.tk/tcl/ for details + +2015-03-10 (bug)[3028676] Refinement in OS X notifier (steffen,walzer,lars_h) + +2015-04-23 (bug)[19ea02] Win: shared read from linked dirs (bogdan,oehhar) + +2015-04-24 (bug)[879a07] Incomplete chars @ buffer ends (leunissen,porter) + +2015-04-29 (bug)[894da1] Hang flushing blocking channels (yorick) + +2015-05-27 (enhancement) Relax memdebug constraint on extensions (kupries) + +2015-06-16 (bug)[e770d9] Higher baud on serial channels (woods,nijtmans) + +2015-06-18 (update) Update Unicode data to 8.0 (nijtmans) + *** POTENTIAL INCOMPATIBILITY *** + +2015-07-15 (bug)[b1534b][9bad63] writes beyond buffer bounds (hanno,porter) + +2015-07-29 (bug)[3e7eca] Allocation overflow in expr parsing (rickyb,porter) + +2015-08-12 tzdata updated to Olson's tzdata2015f (venkat) + +2015-08-19 (bug)[00189c] MSVC 14: semi-static UCRT support (dower,nijtmans) + +2015-08-26 (bug)[0df7a1] Tolerate getcwd() failures (cato,nijtmans) + +2015-09-23 (bug)[e0a7b3] Input buffer draining & file events (griffin,porter) + +2015-09-24 (bug)[57945b] lock in forking/multi-threading (neumann,mistachkin) + +2015-09-29 (bug)[219866] Cygwin support error (yorick,nijtmans) +=> platform 1.0.14 + +2015-10-06 (bug)[b42a85] Win: [file normalize ~user] wrong dir (nadkarni) + +2015-10-21 (bug)[818a1a][a3c350][d7ea9f][8f2450][1080042] Many fixes and +improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich) + +--- Released 8.5.19, December 1, 2015 --- http://core.tcl.tk/tcl/ for details -- cgit v0.12 From 4479e16df25d9fad8636372be8e5010eb70df2c9 Mon Sep 17 00:00:00 2001 From: oehhar Date: Fri, 23 Oct 2015 08:08:09 +0000 Subject: New test for clock scan, test numbering corrected --- tests/clock.test | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) mode change 100644 => 100755 tests/clock.test diff --git a/tests/clock.test b/tests/clock.test old mode 100644 new mode 100755 index 4f69ed3..d4f0bc9 --- a/tests/clock.test +++ b/tests/clock.test @@ -36932,22 +36932,35 @@ test clock-67.2 {Bug d19a30db57} -body { tcl::clock::GetJulianDayFromEraYearMonthDay {} 2361222 } -returnCodes error -match glob -result * -test clock-67.3 {Change %x output on global locale change [Bug 4a0c163d24]} -setup { +test clock-67.3 {Bug d19a30db57} -body { + # error, not segfault + tcl::clock::GetJulianDayFromEraYearWeekDay {} 2361222 +} -returnCodes error -match glob -result * + +test clock-67.4 {Change format %x output on global locale change [Bug 4a0c163d24]} -setup { package require msgcat set current [msgcat::mclocale] } -body { msgcat::mclocale de_de - set res [clock format 1 -locale current -format %x] + set res [list [clock format 1 -locale current -format %x]] msgcat::mclocale en_uk lappend res [clock format 1 -locale current -format %x] } -cleanup { msgcat::mclocale $current } -result {01.01.1970 01/01/1970} -test clock-67.3 {Bug d19a30db57} -body { - # error, not segfault - tcl::clock::GetJulianDayFromEraYearWeekDay {} 2361222 -} -returnCodes error -match glob -result * +test clock-67.5 {Change scan %x output on global locale change [Bug 4a0c163d24]} -setup { + package require msgcat + set current [msgcat::mclocale] +} -body { + msgcat::mclocale de_de + set res [clock scan "01.01.1970" -locale current -format %x] + msgcat::mclocale en_uk + # This will fail without the bug fix, as still de_de is active + expr {$res == [clock scan "01/01/1970" -locale current -format %x]} +} -cleanup { + msgcat::mclocale $current +} -result {1} # cleanup -- cgit v0.12 From f99f9dafa7b110163fe611aa0b1662d1487a61dc Mon Sep 17 00:00:00 2001 From: oehhar Date: Fri, 23 Oct 2015 12:52:19 +0000 Subject: Make test clock-67.4 time zone independent. Bug [4a0c163d24] --- tests/clock.test | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/clock.test b/tests/clock.test index d4f0bc9..615f3a8 100644 --- a/tests/clock.test +++ b/tests/clock.test @@ -36942,12 +36942,12 @@ test clock-67.4 {Change format %x output on global locale change [Bug 4a0c163d24 set current [msgcat::mclocale] } -body { msgcat::mclocale de_de - set res [list [clock format 1 -locale current -format %x]] + set res [regexp {^\d{2}\.\d{2}\.\d{4}$} [clock format 1 -locale current -format %x]] msgcat::mclocale en_uk - lappend res [clock format 1 -locale current -format %x] + lappend res [regexp {^\d{2}/\d{2}/\d{4}$} [clock format 1 -locale current -format %x]] } -cleanup { msgcat::mclocale $current -} -result {01.01.1970 01/01/1970} +} -result {1 1} test clock-67.5 {Change scan %x output on global locale change [Bug 4a0c163d24]} -setup { package require msgcat -- cgit v0.12 From 8ce51a07b8d38dd87747125c886b78d9960f9fe8 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 23 Oct 2015 14:30:40 +0000 Subject: Bump to release number 8.5.19 --- README | 2 +- generic/tcl.h | 4 ++-- library/init.tcl | 2 +- tools/tcl.wse.in | 2 +- unix/configure.in | 2 +- unix/tcl.spec | 2 +- win/configure.in | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README b/README index 6d5a9be..c71d177 100644 --- a/README +++ b/README @@ -1,5 +1,5 @@ README: Tcl - This is the Tcl 8.5.18 source distribution. + This is the Tcl 8.5.19 source distribution. http://sourceforge.net/projects/tcl/files/Tcl/ You can get any source release of Tcl from the URL above. diff --git a/generic/tcl.h b/generic/tcl.h index 464f205..4fb5bb2 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -58,10 +58,10 @@ extern "C" { #define TCL_MAJOR_VERSION 8 #define TCL_MINOR_VERSION 5 #define TCL_RELEASE_LEVEL TCL_FINAL_RELEASE -#define TCL_RELEASE_SERIAL 18 +#define TCL_RELEASE_SERIAL 19 #define TCL_VERSION "8.5" -#define TCL_PATCH_LEVEL "8.5.18" +#define TCL_PATCH_LEVEL "8.5.19" /* * The following definitions set up the proper options for Windows compilers. diff --git a/library/init.tcl b/library/init.tcl index 62729e6..aaf148b 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -16,7 +16,7 @@ if {[info commands package] == ""} { error "version mismatch: library\nscripts expect Tcl version 7.5b1 or later but the loaded version is\nonly [info patchlevel]" } -package require -exact Tcl 8.5.18 +package require -exact Tcl 8.5.19 # Compute the auto path to use in this interpreter. # The values on the path come from several locations: diff --git a/tools/tcl.wse.in b/tools/tcl.wse.in index 3bc8ee4..06efbba 100644 --- a/tools/tcl.wse.in +++ b/tools/tcl.wse.in @@ -12,7 +12,7 @@ item: Global Log Pathname=%MAINDIR%\INSTALL.LOG Message Font=MS Sans Serif Font Size=8 - Disk Label=tcl8.5.18 + Disk Label=tcl8.5.19 Disk Filename=setup Patch Flags=0000000000000001 Patch Threshold=85 diff --git a/unix/configure.in b/unix/configure.in index 9c93024..ed895d9 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -25,7 +25,7 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [ TCL_VERSION=8.5 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=5 -TCL_PATCH_LEVEL=".18" +TCL_PATCH_LEVEL=".19" VERSION=${TCL_VERSION} #------------------------------------------------------------------------ diff --git a/unix/tcl.spec b/unix/tcl.spec index 76ab925..9062694 100644 --- a/unix/tcl.spec +++ b/unix/tcl.spec @@ -4,7 +4,7 @@ Name: tcl Summary: Tcl scripting language development environment -Version: 8.5.18 +Version: 8.5.19 Release: 2 License: BSD Group: Development/Languages diff --git a/win/configure.in b/win/configure.in index 6b30162..8931a38 100644 --- a/win/configure.in +++ b/win/configure.in @@ -14,7 +14,7 @@ SHELL=/bin/sh TCL_VERSION=8.5 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=5 -TCL_PATCH_LEVEL=".18" +TCL_PATCH_LEVEL=".19" VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION TCL_DDE_VERSION=1.3 -- cgit v0.12 From 2117a3bcf0ee00ee1c7036744732be970cfd6181 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 23 Oct 2015 14:57:56 +0000 Subject: Backout of failed attempt to fix [32ae34e63a] got checked into wrong branch. --- generic/tclIO.c | 47 ++----------- generic/tclIORChan.c | 8 +++ tests/io.test | 186 --------------------------------------------------- tests/ioCmd.test | 26 +++---- 4 files changed, 25 insertions(+), 242 deletions(-) diff --git a/generic/tclIO.c b/generic/tclIO.c index 0910cc5..9a4735f 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -113,30 +113,11 @@ typedef struct CopyState { Tcl_WideInt total; /* Total bytes transferred (written). */ Tcl_Interp *interp; /* Interp that started the copy. */ Tcl_Obj *cmdPtr; /* Command to be invoked at completion. */ - int refCount; /* Claim count on the struct */ - int bufInUse; /* Flag to govern access to buffer */ int bufSize; /* Size of appended buffer. */ char buffer[1]; /* Copy buffer, this must be the last * field. */ } CopyState; -static void -PreserveCopyState( - CopyState *csPtr) -{ - csPtr->refCount++; -} - -static void -ReleaseCopyState( - CopyState *csPtr) -{ - if (--csPtr->refCount) { - return; - } - ckfree((char *) csPtr); -} - /* * All static variables used in this file are collected into a single instance * of the following structure. For multi-threaded implementations, there is @@ -8668,13 +8649,9 @@ TclCopyChannel( Tcl_IncrRefCount(cmdPtr); } csPtr->cmdPtr = cmdPtr; - csPtr->refCount = 1; - csPtr->bufInUse = 0; inStatePtr->csPtrR = csPtr; - PreserveCopyState(csPtr); outStatePtr->csPtrW = csPtr; - PreserveCopyState(csPtr); /* * Special handling of -size 0 async transfers, so that the -command is @@ -8726,11 +8703,6 @@ CopyData( /* Encoding control */ int underflow; /* Input underflow */ - if (csPtr->bufInUse) { - return TCL_OK; - } - PreserveCopyState(csPtr); - inChan = (Tcl_Channel) csPtr->readPtr; outChan = (Tcl_Channel) csPtr->writePtr; inStatePtr = csPtr->readPtr->state; @@ -8792,7 +8764,6 @@ CopyData( sizeb = csPtr->toRead; } - csPtr->bufInUse = 1; if (inBinary || sameEncoding) { size = DoRead(inStatePtr->topChanPtr, csPtr->buffer, sizeb); } else { @@ -8843,7 +8814,6 @@ CopyData( TclDecrRefCount(bufObj); bufObj = NULL; } - ReleaseCopyState(csPtr); return TCL_OK; } } @@ -8864,7 +8834,6 @@ CopyData( } else { sizeb = WriteChars(outStatePtr->topChanPtr, buffer, sizeb); } - csPtr->bufInUse = 0; /* * [Bug 2895565]. At this point 'size' still contains the number of @@ -8936,7 +8905,6 @@ CopyData( TclDecrRefCount(bufObj); bufObj = NULL; } - ReleaseCopyState(csPtr); return TCL_OK; } @@ -8959,7 +8927,6 @@ CopyData( TclDecrRefCount(bufObj); bufObj = NULL; } - ReleaseCopyState(csPtr); return TCL_OK; } } /* while */ @@ -8975,14 +8942,15 @@ CopyData( */ total = csPtr->total; - if (cmdPtr && interp && csPtr->cmdPtr) { + if (cmdPtr && interp) { int code; /* * Get a private copy of the command so we can mutate it by adding * arguments. Note that StopCopy frees our saved reference to the * original command obj. */ - cmdPtr = Tcl_DuplicateObj(csPtr->cmdPtr); + + cmdPtr = Tcl_DuplicateObj(cmdPtr); Tcl_IncrRefCount(cmdPtr); StopCopy(csPtr); Tcl_Preserve(interp); @@ -9010,7 +8978,6 @@ CopyData( } } } - ReleaseCopyState(csPtr); return result; } @@ -9324,16 +9291,10 @@ StopCopy( CopyEventProc, csPtr); } TclDecrRefCount(csPtr->cmdPtr); - csPtr->cmdPtr = NULL; - } - if (inStatePtr->csPtrR == NULL) { - return; } - ReleaseCopyState(inStatePtr->csPtrR); inStatePtr->csPtrR = NULL; - ReleaseCopyState(outStatePtr->csPtrW); outStatePtr->csPtrW = NULL; - ReleaseCopyState(csPtr); + ckfree((char *) csPtr); } /* diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c index 2e5fa45..bbb5b88 100644 --- a/generic/tclIORChan.c +++ b/generic/tclIORChan.c @@ -1508,6 +1508,14 @@ ReflectWatch( mask &= rcPtr->mode; + if (mask == rcPtr->interest) { + /* + * Same old, same old, why should we do something? + */ + + return; + } + rcPtr->interest = mask; /* diff --git a/tests/io.test b/tests/io.test index 914cbca..50c5808 100644 --- a/tests/io.test +++ b/tests/io.test @@ -7886,192 +7886,6 @@ test io-53.15 {[ed29c4da21] DoRead: fblocked seen as error} -setup { removeFile out } -result 100 -test io-53.18 {[32ae34e63a] recursive CopyData} -setup { - proc driver {cmd args} { - variable buffer - variable index - set chan [lindex $args 0] - switch -- $cmd { - initialize { - set index($chan) 0 - set buffer($chan) [encoding convertto utf-8 \ - [string repeat a 100]] - return {initialize finalize watch read} - } - finalize { - unset index($chan) buffer($chan) - return - } - watch { - if {"read" in [lindex $args 1]} { - chan postevent $chan read - } - return - } - read { - set n [lindex $args 1] - set new [expr {$index($chan) + $n}] - set result [string range $buffer($chan) $index($chan) $new-1] - set index($chan) $new - return $result - } - } - } - proc more {c outChan bytes args} { - if {[eof $c]} { - set ::done eof - catch {close $c} - return - } - if {[llength $args]} { - set ::done error - } else { - chan copy $c $outChan -command [list [namespace which more] $c $outChan] - } - } - set c [chan create read [namespace which driver]] - chan configure $c -encoding utf-8 - set out [makeFile {} out] - set outChan [open $out w] - # Different encoding to force use of DoReadChars() - chan configure $outChan -encoding iso8859-1 -} -body { - after 100 {set ::done timeout} - chan copy $c $outChan -size 99 -command [list [namespace which more] $c $outChan] - vwait ::done - set ::done -} -cleanup { - close $outChan - removeFile out - rename driver {} - rename more {} - unset ::done -} -result eof - -test io-53.19 {[32ae34e63a] stop ReflectWatch filtering} -setup { - proc driver {cmd args} { - variable buffer - variable index - set chan [lindex $args 0] - switch -- $cmd { - initialize { - set index($chan) 0 - set buffer($chan) [encoding convertto utf-8 \ - [string repeat a 100]] - return {initialize finalize watch read} - } - finalize { - unset index($chan) buffer($chan) - return - } - watch { - if {"read" in [lindex $args 1]} { - chan postevent $chan read - } - return - } - read { - set n [lindex $args 1] - set new [expr {$index($chan) + $n}] - set result [string range $buffer($chan) $index($chan) $new-1] - set index($chan) $new - return $result - } - } - } - proc more {c outChan bytes args} { - if {[eof $c]} { - set ::done eof - catch {close $c} - return - } - if {[llength $args]} { - set ::done error - } else { - chan copy $c $outChan -size 30 -command [list [namespace which more] $c $outChan] - } - } - set c [chan create read [namespace which driver]] - chan configure $c -encoding utf-8 -buffersize 20 - set out [makeFile {} out] - set outChan [open $out w] - # Different encoding to force use of DoReadChars() - chan configure $outChan -encoding iso8859-1 -} -body { - after 100 {set ::done timeout} - chan copy $c $outChan -size 30 -command [list [namespace which more] $c $outChan] - vwait ::done - set ::done -} -cleanup { - catch {close $outChan} - removeFile out - rename driver {} - rename more {} - unset ::done -} -result eof - -test io-53.20 {[e0a7b3e5f8] DoRead calls to UpdateInterest} -setup { - proc driver {cmd args} { - variable buffer - variable index - set chan [lindex $args 0] - switch -- $cmd { - initialize { - set index($chan) 0 - set buffer($chan) [encoding convertto utf-8 \ - [string repeat a 100]] - return {initialize finalize watch read} - } - finalize { - unset index($chan) buffer($chan) - return - } - watch { - if {"read" in [lindex $args 1]} { - chan postevent $chan read - } - return - } - read { - set n [lindex $args 1] - set new [expr {$index($chan) + $n}] - set result [string range $buffer($chan) $index($chan) $new-1] - set index($chan) $new - return $result - } - } - } - proc more {c outChan bytes args} { - if {[eof $c]} { - set ::done eof - catch {close $c} - return - } - if {[llength $args]} { - set ::done error - } else { - chan copy $c $outChan -size 10 -command [list [namespace which more] $c $outChan] - } - } - set c [chan create read [namespace which driver]] - chan configure $c -encoding utf-8 -buffersize 20 - set out [makeFile {} out] - set outChan [open $out w] - # Same encoding to force use of DoRead() - chan configure $outChan -encoding utf-8 -} -body { - after 100 {set ::done timeout} - chan copy $c $outChan -size 10 -command [list [namespace which more] $c $outChan] - vwait ::done - set ::done -} -cleanup { - catch {close $outChan} - removeFile out - rename driver {} - rename more {} - unset ::done -} -result eof - test io-54.1 {Recursive channel events} {socket fileevent} { # This test checks to see if file events are delivered during recursive # event loops when there is buffered data on the channel. diff --git a/tests/ioCmd.test b/tests/ioCmd.test index e2a6d84..5a76d48 100644 --- a/tests/ioCmd.test +++ b/tests/ioCmd.test @@ -981,7 +981,7 @@ test iocmd-23.1 {chan read, regular data return} -match glob -body { close $c rename foo {} set res -} -result {{read rc* 4096} {read rc* 4096} {watch rc* {}} snarfsnarf} +} -result {{read rc* 4096} {read rc* 4096} snarfsnarf} test iocmd-23.2 {chan read, bad data return, to much} -match glob -body { set res {} proc foo {args} { @@ -993,7 +993,7 @@ test iocmd-23.2 {chan read, bad data return, to much} -match glob -body { close $c rename foo {} set res -} -result {{read rc* 4096} {watch rc* {}} 1 {read delivered more than requested}} +} -result {{read rc* 4096} 1 {read delivered more than requested}} test iocmd-23.3 {chan read, for non-readable channel} -match glob -body { set res {} proc foo {args} { @@ -1016,7 +1016,7 @@ test iocmd-23.4 {chan read, error return} -match glob -body { close $c rename foo {} set res -} -result {{read rc* 4096} {watch rc* {}} 1 BOOM!} +} -result {{read rc* 4096} 1 BOOM!} test iocmd-23.5 {chan read, break return is error} -match glob -body { set res {} proc foo {args} { @@ -1028,7 +1028,7 @@ test iocmd-23.5 {chan read, break return is error} -match glob -body { close $c rename foo {} set res -} -result {{read rc* 4096} {watch rc* {}} 1 *bad code*} +} -result {{read rc* 4096} 1 *bad code*} test iocmd-23.6 {chan read, continue return is error} -match glob -body { set res {} proc foo {args} { @@ -1040,7 +1040,7 @@ test iocmd-23.6 {chan read, continue return is error} -match glob -body { close $c rename foo {} set res -} -result {{read rc* 4096} {watch rc* {}} 1 *bad code*} +} -result {{read rc* 4096} 1 *bad code*} test iocmd-23.7 {chan read, custom return is error} -match glob -body { set res {} proc foo {args} { @@ -1052,7 +1052,7 @@ test iocmd-23.7 {chan read, custom return is error} -match glob -body { close $c rename foo {} set res -} -result {{read rc* 4096} {watch rc* {}} 1 *bad code*} +} -result {{read rc* 4096} 1 *bad code*} test iocmd-23.8 {chan read, level is squashed} -match glob -body { set res {} proc foo {args} { @@ -1064,7 +1064,7 @@ test iocmd-23.8 {chan read, level is squashed} -match glob -body { close $c rename foo {} set res -} -result {{read rc* 4096} {watch rc* {}} 1 *bad code* {-code 1 -level 0 -errorcode NONE -errorline 1 -errorinfo *bad code*subcommand "read"*}} +} -result {{read rc* 4096} 1 *bad code* {-code 1 -level 0 -errorcode NONE -errorline 1 -errorinfo *bad code*subcommand "read"*}} test iocmd-23.9 {chan read, no data means eof} -match glob -setup { set res {} proc foo {args} { @@ -1080,7 +1080,7 @@ test iocmd-23.9 {chan read, no data means eof} -match glob -setup { close $c rename foo {} unset res -} -result {{read rc* 4096} {watch rc* {}} {} 1} +} -result {{read rc* 4096} {} 1} test iocmd-23.10 {chan read, EAGAIN means no data, yet no eof either} -match glob -setup { set res {} proc foo {args} { @@ -1096,7 +1096,7 @@ test iocmd-23.10 {chan read, EAGAIN means no data, yet no eof either} -match glo close $c rename foo {} unset res -} -result {{read rc* 4096} {watch rc* {}} {} 0} +} -result {{read rc* 4096} {} 0} test iocmd-23.11 {chan read, close pulls the rug out} -match glob -body { set res {} proc foo {args} { @@ -1410,14 +1410,14 @@ test iocmd-25.10 {chan configure, cgetall, level is ignored} -match glob -body { test iocmd-26.1 {chan configure, set standard option} -match glob -body { set res {} proc foo {args} { - oninit configure; onfinal; track; return + oninit configure; onfinal; track; note MUST_NOT_HAPPEN; return } set c [chan create {r w} foo] note [fconfigure $c -translation lf] close $c rename foo {} set res -} -result {{watch rc* {}} {}} +} -result {{}} test iocmd-26.2 {chan configure, set option, error return} -match glob -body { set res {} proc foo {args} { @@ -1955,7 +1955,7 @@ test iocmd-31.6 {chan postevent, posted events do happen} -match glob -body { close $c rename foo {} set res -} -result {{watch rc* read} {} TOCK {watch rc* read} {} {watch rc* {}}} +} -result {{watch rc* read} {} TOCK {} {watch rc* {}}} test iocmd-31.7 {chan postevent, posted events do happen} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return} @@ -1968,7 +1968,7 @@ test iocmd-31.7 {chan postevent, posted events do happen} -match glob -body { close $c rename foo {} set res -} -result {{watch rc* write} {} TOCK {watch rc* write} {} {watch rc* {}}} +} -result {{watch rc* write} {} TOCK {} {watch rc* {}}} test iocmd-31.8 {chan postevent after close throws error} -match glob -setup { proc foo {args} {oninit; onfinal; track; return} proc dummy args { return } -- cgit v0.12 From 0dd6aea93ddc469a60059a29582f10a3a472e00d Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 23 Oct 2015 15:21:36 +0000 Subject: autoconf-2.59 --- unix/configure | 2 +- win/configure | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/unix/configure b/unix/configure index bbac11d..98c2bba 100755 --- a/unix/configure +++ b/unix/configure @@ -1337,7 +1337,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu TCL_VERSION=8.5 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=5 -TCL_PATCH_LEVEL=".18" +TCL_PATCH_LEVEL=".19" VERSION=${TCL_VERSION} #------------------------------------------------------------------------ diff --git a/win/configure b/win/configure index dc03e62..607cf30 100755 --- a/win/configure +++ b/win/configure @@ -1311,7 +1311,7 @@ SHELL=/bin/sh TCL_VERSION=8.5 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=5 -TCL_PATCH_LEVEL=".18" +TCL_PATCH_LEVEL=".19" VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION TCL_DDE_VERSION=1.3 @@ -4775,21 +4775,21 @@ TCL_SHARED_LIB_SUFFIX="\${NODOT_VERSION}${DLLSUFFIX}" TCL_UNSHARED_LIB_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}" TCL_EXPORT_FILE_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}" -eval "TCL_SRC_DIR=\"`cd $srcdir/..; pwd`\"" +eval "TCL_SRC_DIR=\"`cd $srcdir/..; $CYGPATH $(pwd)`\"" eval "TCL_DLL_FILE=tcl${VER}${DLLSUFFIX}" eval "TCL_LIB_FILE=${LIBPREFIX}tcl$VER${LIBSUFFIX}" eval "TCL_LIB_FLAG=\"-ltcl${VER}${LIBFLAGSUFFIX}\"" -eval "TCL_BUILD_LIB_SPEC=\"-L`pwd` ${TCL_LIB_FLAG}\"" +eval "TCL_BUILD_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TCL_LIB_FLAG}\"" eval "TCL_LIB_SPEC=\"-L${libdir} ${TCL_LIB_FLAG}\"" eval "TCL_STUB_LIB_FILE=\"${LIBPREFIX}tclstub${VER}${LIBSUFFIX}\"" eval "TCL_STUB_LIB_FLAG=\"-ltclstub${VER}${LIBFLAGSUFFIX}\"" -eval "TCL_BUILD_STUB_LIB_SPEC=\"-L`pwd` ${TCL_STUB_LIB_FLAG}\"" +eval "TCL_BUILD_STUB_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TCL_STUB_LIB_FLAG}\"" eval "TCL_STUB_LIB_SPEC=\"-L${libdir} ${TCL_STUB_LIB_FLAG}\"" -eval "TCL_BUILD_STUB_LIB_PATH=\"`pwd`/${TCL_STUB_LIB_FILE}\"" +eval "TCL_BUILD_STUB_LIB_PATH=\"`$CYGPATH $(pwd)`/${TCL_STUB_LIB_FILE}\"" eval "TCL_STUB_LIB_PATH=\"${libdir}/${TCL_STUB_LIB_FILE}\"" # Install time header dir can be set via --includedir -- cgit v0.12 From f6c021c559b57cc973581cb328496b13e5f3c952 Mon Sep 17 00:00:00 2001 From: dkf Date: Fri, 23 Oct 2015 21:52:10 +0000 Subject: Knock perhaps 1% off execution time: guard on TclAsyncReady more efficient when decrementing to zero. --- generic/tclExecute.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/generic/tclExecute.c b/generic/tclExecute.c index b10af65..f6dfc46 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -34,14 +34,14 @@ #endif /* - * A mask (should be 2**n-1) that is used to work out when the bytecode engine - * should call Tcl_AsyncReady() to see whether there is a signal that needs - * handling. + * A counter that is used to work out when the bytecode engine should call + * Tcl_AsyncReady() to see whether there is a signal that needs handling, and + * other expensive periodic operations. */ -#ifndef ASYNC_CHECK_COUNT_MASK -# define ASYNC_CHECK_COUNT_MASK 63 -#endif /* !ASYNC_CHECK_COUNT_MASK */ +#ifndef ASYNC_CHECK_COUNT +# define ASYNC_CHECK_COUNT 64 +#endif /* !ASYNC_CHECK_COUNT */ /* * Boolean flag indicating whether the Tcl bytecode interpreter has been @@ -2116,7 +2116,8 @@ TEBCresume( * sporadically: no special need for speed. */ - int instructionCount = 0; /* Counter that is used to work out when to + int instructionCount = ASYNC_CHECK_COUNT; + /* Counter that is used to work out when to * call Tcl_AsyncReady() */ const char *curInstName; #ifdef TCL_COMPILE_DEBUG @@ -2315,10 +2316,11 @@ TEBCresume( /* * Check for asynchronous handlers [Bug 746722]; we do the check every - * ASYNC_CHECK_COUNT_MASK instruction, of the form (2**n-1). + * ASYNC_CHECK_COUNT instructions. */ - if ((instructionCount++ & ASYNC_CHECK_COUNT_MASK) == 0) { + if (!(--instructionCount)) { + instructionCount = ASYNC_CHECK_COUNT; DECACHE_STACK_INFO(); if (TclAsyncReady(iPtr)) { result = Tcl_AsyncInvoke(interp, result); -- cgit v0.12 From b40c3af17683766d1e1359c9ceb4dd7178f6afc5 Mon Sep 17 00:00:00 2001 From: Kevin B Kenny Date: Fri, 23 Oct 2015 22:29:23 +0000 Subject: Correct bad regexp in platform::identify that causes it to return incorrect results everywhere. --- library/platform/platform.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/platform/platform.tcl b/library/platform/platform.tcl index c596e60..0160184 100644 --- a/library/platform/platform.tcl +++ b/library/platform/platform.tcl @@ -165,7 +165,7 @@ proc ::platform::identify {} { global tcl_platform set id [generic] - regexp {^([^-]+)-([^-]+)$} $id -> plat ver wow cpu + regexp {^([^-]+)(-[0-9\.]+)?(-wow)?-([^-]+)$} $id -> plat ver wow cpu switch -- $plat { solaris { -- cgit v0.12 From 24c49324b4488e47b21eaa259a0950464f9b930c Mon Sep 17 00:00:00 2001 From: dkf Date: Fri, 23 Oct 2015 22:30:57 +0000 Subject: Ensure that at lease the format of the output of the platform package's commands is consistently parsable. --- tests/platform.test | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/platform.test b/tests/platform.test index ab82d07..b5ddc48 100644 --- a/tests/platform.test +++ b/tests/platform.test @@ -1,4 +1,4 @@ -# The file tests the tcl_platform variable +# The file tests the tcl_platform variable and platform package. # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and @@ -54,6 +54,17 @@ test platform-3.1 {CPU ID on Windows/UNIX} \ -match regexp \ -result {^(?:AuthenticAMD|CentaurHauls|CyrixInstead|GenuineIntel)$} +# The platform package makes very few promises, but does promise that the +# format of string it produces consists of two non-empty words separated by a +# hyphen. +package require platform +test platform-4.1 {format of platform::identify result} -match regexp -body { + platform::identify +} -result {^[^-]+-[^-]+$} +test platform-4.2 {format of platform::generic result} -match regexp -body { + platform::generic +} -result {^[^-]+-[^-]+$} + # cleanup cleanupTests -- cgit v0.12 From d0c545cc65b329440189d7ebfec034137b26e0e7 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sat, 24 Oct 2015 07:40:30 +0000 Subject: Bring back regexp to wat it was in latest release. This is the correct fix for kbk's attempt. --- library/platform/platform.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/platform/platform.tcl b/library/platform/platform.tcl index 0160184..35a22a3 100644 --- a/library/platform/platform.tcl +++ b/library/platform/platform.tcl @@ -165,7 +165,7 @@ proc ::platform::identify {} { global tcl_platform set id [generic] - regexp {^([^-]+)(-[0-9\.]+)?(-wow)?-([^-]+)$} $id -> plat ver wow cpu + regexp {^([^-]+)-([^-]+)$} $id -> plat cpu switch -- $plat { solaris { -- cgit v0.12 From 042f85a7d6565407ef15942699cb0e1d2f28330e Mon Sep 17 00:00:00 2001 From: dkf Date: Sat, 24 Oct 2015 16:01:56 +0000 Subject: A more lenient test; different platforms are more diverse in their correct output. --- tests/platform.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/platform.test b/tests/platform.test index b5ddc48..51b9067 100644 --- a/tests/platform.test +++ b/tests/platform.test @@ -60,10 +60,10 @@ test platform-3.1 {CPU ID on Windows/UNIX} \ package require platform test platform-4.1 {format of platform::identify result} -match regexp -body { platform::identify -} -result {^[^-]+-[^-]+$} +} -result {^([^-]+-)+[^-]+$} test platform-4.2 {format of platform::generic result} -match regexp -body { platform::generic -} -result {^[^-]+-[^-]+$} +} -result {^([^-]+-)+[^-]+$} # cleanup cleanupTests -- cgit v0.12 From e36e1a062d95b44a81c16c2435d235196ca8aa4c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 25 Oct 2015 19:39:38 +0000 Subject: Remove use of HAVE_USLEEP. It isn't use anywhere any more. --- unix/configure.in | 6 ------ unix/tcl.m4 | 42 ------------------------------------------ 2 files changed, 48 deletions(-) diff --git a/unix/configure.in b/unix/configure.in index 9c93024..6c7cc09 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -479,12 +479,6 @@ if test $tcl_cv_putenv_copy = yes; then fi #-------------------------------------------------------------------- -# Check for support of usleep function -#-------------------------------------------------------------------- - -SC_ENABLE_USLEEP - -#-------------------------------------------------------------------- # Check for support of nl_langinfo function #-------------------------------------------------------------------- diff --git a/unix/tcl.m4 b/unix/tcl.m4 index d7d6a7b..7a0b677 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -808,48 +808,6 @@ AC_DEFUN([SC_ENABLE_SYMBOLS], [ ]) #------------------------------------------------------------------------ -# SC_ENABLE_USLEEP -- -# -# Allows use of usleep function. -# This is only relevant for Unix. -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --enable-usleep=yes|no (default is yes) -# -# Defines the following vars: -# HAVE_USLEEP Triggers use of usleep if defined. -#------------------------------------------------------------------------ - -AC_DEFUN([SC_ENABLE_USLEEP], [ - AC_ARG_ENABLE(usleep, - AC_HELP_STRING([--enable-usleep], - [use usleep if possible to sleep, otherwise use Tcl_Sleep (default: on)]), - [usleep_ok=$enableval], [usleep_ok=yes]) - - HAVE_USLEEP=0 - if test "$usleep_ok" = "yes"; then - AC_CHECK_HEADER(unistd.h,[usleep_ok=yes],[usleep_ok=no]) - fi - AC_MSG_CHECKING([whether to use usleep]) - if test "$usleep_ok" = "yes"; then - AC_CACHE_VAL(tcl_cv_usleep_h, [ - AC_TRY_COMPILE([#include ], [usleep(0);], - [tcl_cv_usleep_h=yes],[tcl_cv_usleep_h=no])]) - AC_MSG_RESULT([$tcl_cv_usleep_h]) - if test $tcl_cv_usleep_h = yes; then - AC_DEFINE(HAVE_USLEEP, 1, [Do we have usleep()?]) - fi - else - AC_MSG_RESULT([$usleep_ok]) - fi -]) - -#------------------------------------------------------------------------ # SC_ENABLE_LANGINFO -- # # Allows use of modern nl_langinfo check for better l10n. -- cgit v0.12 From bbe3301cc5fb0ed82fefb30d8f810ea5492fd58d Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 25 Oct 2015 22:45:39 +0000 Subject: re-generate "configure", both for unix and win --- unix/configure | 231 --------------------------------------------------------- win/configure | 8 +- 2 files changed, 4 insertions(+), 235 deletions(-) diff --git a/unix/configure b/unix/configure index bbac11d..692b801 100755 --- a/unix/configure +++ b/unix/configure @@ -857,8 +857,6 @@ Optional Features: --enable-load allow dynamic loading and "load" command (default: on) --enable-symbols build with debugging symbols (default: off) - --enable-usleep use usleep if possible to sleep, otherwise use - Tcl_Sleep (default: on) --enable-langinfo use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on) --enable-dll-unloading enable the 'unload' command (default: on) @@ -16434,235 +16432,6 @@ _ACEOF fi #-------------------------------------------------------------------- -# Check for support of usleep function -#-------------------------------------------------------------------- - - - # Check whether --enable-usleep or --disable-usleep was given. -if test "${enable_usleep+set}" = set; then - enableval="$enable_usleep" - usleep_ok=$enableval -else - usleep_ok=yes -fi; - - HAVE_USLEEP=0 - if test "$usleep_ok" = "yes"; then - if test "${ac_cv_header_unistd_h+set}" = set; then - echo "$as_me:$LINENO: checking for unistd.h" >&5 -echo $ECHO_N "checking for unistd.h... $ECHO_C" >&6 -if test "${ac_cv_header_unistd_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_unistd_h" >&5 -echo "${ECHO_T}$ac_cv_header_unistd_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking unistd.h usability" >&5 -echo $ECHO_N "checking unistd.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking unistd.h presence" >&5 -echo $ECHO_N "checking unistd.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: unistd.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: unistd.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: unistd.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: unistd.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: unistd.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: unistd.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: unistd.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: unistd.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: unistd.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: unistd.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: unistd.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: unistd.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: unistd.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: unistd.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: unistd.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: unistd.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------ ## -## Report this to the tcl lists. ## -## ------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for unistd.h" >&5 -echo $ECHO_N "checking for unistd.h... $ECHO_C" >&6 -if test "${ac_cv_header_unistd_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_unistd_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_unistd_h" >&5 -echo "${ECHO_T}$ac_cv_header_unistd_h" >&6 - -fi -if test $ac_cv_header_unistd_h = yes; then - usleep_ok=yes -else - usleep_ok=no -fi - - - fi - echo "$as_me:$LINENO: checking whether to use usleep" >&5 -echo $ECHO_N "checking whether to use usleep... $ECHO_C" >&6 - if test "$usleep_ok" = "yes"; then - if test "${tcl_cv_usleep_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -usleep(0); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_usleep_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_usleep_h=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - echo "$as_me:$LINENO: result: $tcl_cv_usleep_h" >&5 -echo "${ECHO_T}$tcl_cv_usleep_h" >&6 - if test $tcl_cv_usleep_h = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_USLEEP 1 -_ACEOF - - fi - else - echo "$as_me:$LINENO: result: $usleep_ok" >&5 -echo "${ECHO_T}$usleep_ok" >&6 - fi - - -#-------------------------------------------------------------------- # Check for support of nl_langinfo function #-------------------------------------------------------------------- diff --git a/win/configure b/win/configure index dc03e62..63d6765 100755 --- a/win/configure +++ b/win/configure @@ -4775,21 +4775,21 @@ TCL_SHARED_LIB_SUFFIX="\${NODOT_VERSION}${DLLSUFFIX}" TCL_UNSHARED_LIB_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}" TCL_EXPORT_FILE_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}" -eval "TCL_SRC_DIR=\"`cd $srcdir/..; pwd`\"" +eval "TCL_SRC_DIR=\"`cd $srcdir/..; $CYGPATH $(pwd)`\"" eval "TCL_DLL_FILE=tcl${VER}${DLLSUFFIX}" eval "TCL_LIB_FILE=${LIBPREFIX}tcl$VER${LIBSUFFIX}" eval "TCL_LIB_FLAG=\"-ltcl${VER}${LIBFLAGSUFFIX}\"" -eval "TCL_BUILD_LIB_SPEC=\"-L`pwd` ${TCL_LIB_FLAG}\"" +eval "TCL_BUILD_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TCL_LIB_FLAG}\"" eval "TCL_LIB_SPEC=\"-L${libdir} ${TCL_LIB_FLAG}\"" eval "TCL_STUB_LIB_FILE=\"${LIBPREFIX}tclstub${VER}${LIBSUFFIX}\"" eval "TCL_STUB_LIB_FLAG=\"-ltclstub${VER}${LIBFLAGSUFFIX}\"" -eval "TCL_BUILD_STUB_LIB_SPEC=\"-L`pwd` ${TCL_STUB_LIB_FLAG}\"" +eval "TCL_BUILD_STUB_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TCL_STUB_LIB_FLAG}\"" eval "TCL_STUB_LIB_SPEC=\"-L${libdir} ${TCL_STUB_LIB_FLAG}\"" -eval "TCL_BUILD_STUB_LIB_PATH=\"`pwd`/${TCL_STUB_LIB_FILE}\"" +eval "TCL_BUILD_STUB_LIB_PATH=\"`$CYGPATH $(pwd)`/${TCL_STUB_LIB_FILE}\"" eval "TCL_STUB_LIB_PATH=\"${libdir}/${TCL_STUB_LIB_FILE}\"" # Install time header dir can be set via --includedir -- cgit v0.12 From 18425b42d186aee1a919721890d7ffeb875137c3 Mon Sep 17 00:00:00 2001 From: venkat Date: Tue, 27 Oct 2015 23:16:06 +0000 Subject: Update to tzdata2015g from ietf --- library/tzdata/America/Fort_Nelson | 151 +++++++++++++++++++++++++++++++++++++ library/tzdata/Europe/Istanbul | 3 +- library/tzdata/Pacific/Fiji | 72 +++++++++--------- library/tzdata/Pacific/Norfolk | 3 + 4 files changed, 192 insertions(+), 37 deletions(-) create mode 100644 library/tzdata/America/Fort_Nelson diff --git a/library/tzdata/America/Fort_Nelson b/library/tzdata/America/Fort_Nelson new file mode 100644 index 0000000..d819368 --- /dev/null +++ b/library/tzdata/America/Fort_Nelson @@ -0,0 +1,151 @@ +# created by tools/tclZIC.tcl - do not edit + +set TZData(:America/Fort_Nelson) { + {-9223372036854775808 -29447 0 LMT} + {-2713880953 -28800 0 PST} + {-1632060000 -25200 1 PDT} + {-1615129200 -28800 0 PST} + {-880207200 -25200 1 PWT} + {-769395600 -25200 1 PPT} + {-765385200 -28800 0 PST} + {-757353600 -28800 0 PST} + {-725817600 -28800 0 PST} + {-715788000 -25200 1 PDT} + {-702486000 -28800 0 PST} + {-684338400 -25200 1 PDT} + {-671036400 -28800 0 PST} + {-652888800 -25200 1 PDT} + {-639586800 -28800 0 PST} + {-620834400 -25200 1 PDT} + {-608137200 -28800 0 PST} + {-589384800 -25200 1 PDT} + {-576082800 -28800 0 PST} + {-557935200 -25200 1 PDT} + {-544633200 -28800 0 PST} + {-526485600 -25200 1 PDT} + {-513183600 -28800 0 PST} + {-495036000 -25200 1 PDT} + {-481734000 -28800 0 PST} + {-463586400 -25200 1 PDT} + {-450284400 -28800 0 PST} + {-431532000 -25200 1 PDT} + {-418230000 -28800 0 PST} + {-400082400 -25200 1 PDT} + {-386780400 -28800 0 PST} + {-368632800 -25200 1 PDT} + {-355330800 -28800 0 PST} + {-337183200 -25200 1 PDT} + {-323881200 -28800 0 PST} + {-305733600 -25200 1 PDT} + {-292431600 -28800 0 PST} + {-273679200 -25200 1 PDT} + {-260982000 -28800 0 PST} + {-242229600 -25200 1 PDT} + {-226508400 -28800 0 PST} + {-210780000 -25200 1 PDT} + {-195058800 -28800 0 PST} + {-179330400 -25200 1 PDT} + {-163609200 -28800 0 PST} + {-147880800 -25200 1 PDT} + {-131554800 -28800 0 PST} + {-116431200 -25200 1 PDT} + {-100105200 -28800 0 PST} + {-84376800 -25200 1 PDT} + {-68655600 -28800 0 PST} + {-52927200 -25200 1 PDT} + {-37206000 -28800 0 PST} + {-21477600 -25200 1 PDT} + {-5756400 -28800 0 PST} + {9972000 -25200 1 PDT} + {25693200 -28800 0 PST} + {41421600 -25200 1 PDT} + {57747600 -28800 0 PST} + {73476000 -25200 1 PDT} + {89197200 -28800 0 PST} + {104925600 -25200 1 PDT} + {120646800 -28800 0 PST} + {136375200 -25200 1 PDT} + {152096400 -28800 0 PST} + {167824800 -25200 1 PDT} + {183546000 -28800 0 PST} + {199274400 -25200 1 PDT} + {215600400 -28800 0 PST} + {230724000 -25200 1 PDT} + {247050000 -28800 0 PST} + {262778400 -25200 1 PDT} + {278499600 -28800 0 PST} + {294228000 -25200 1 PDT} + {309949200 -28800 0 PST} + {325677600 -25200 1 PDT} + {341398800 -28800 0 PST} + {357127200 -25200 1 PDT} + {372848400 -28800 0 PST} + {388576800 -25200 1 PDT} + {404902800 -28800 0 PST} + {420026400 -25200 1 PDT} + {436352400 -28800 0 PST} + {452080800 -25200 1 PDT} + {467802000 -28800 0 PST} + {483530400 -25200 1 PDT} + {499251600 -28800 0 PST} + {514980000 -25200 1 PDT} + {530701200 -28800 0 PST} + {536486400 -28800 0 PST} + {544615200 -25200 1 PDT} + {562150800 -28800 0 PST} + {576064800 -25200 1 PDT} + {594205200 -28800 0 PST} + {607514400 -25200 1 PDT} + {625654800 -28800 0 PST} + {638964000 -25200 1 PDT} + {657104400 -28800 0 PST} + {671018400 -25200 1 PDT} + {688554000 -28800 0 PST} + {702468000 -25200 1 PDT} + {720003600 -28800 0 PST} + {733917600 -25200 1 PDT} + {752058000 -28800 0 PST} + {765367200 -25200 1 PDT} + {783507600 -28800 0 PST} + {796816800 -25200 1 PDT} + {814957200 -28800 0 PST} + {828871200 -25200 1 PDT} + {846406800 -28800 0 PST} + {860320800 -25200 1 PDT} + {877856400 -28800 0 PST} + {891770400 -25200 1 PDT} + {909306000 -28800 0 PST} + {923220000 -25200 1 PDT} + {941360400 -28800 0 PST} + {954669600 -25200 1 PDT} + {972810000 -28800 0 PST} + {986119200 -25200 1 PDT} + {1004259600 -28800 0 PST} + {1018173600 -25200 1 PDT} + {1035709200 -28800 0 PST} + {1049623200 -25200 1 PDT} + {1067158800 -28800 0 PST} + {1081072800 -25200 1 PDT} + {1099213200 -28800 0 PST} + {1112522400 -25200 1 PDT} + {1130662800 -28800 0 PST} + {1143972000 -25200 1 PDT} + {1162112400 -28800 0 PST} + {1173607200 -25200 1 PDT} + {1194166800 -28800 0 PST} + {1205056800 -25200 1 PDT} + {1225616400 -28800 0 PST} + {1236506400 -25200 1 PDT} + {1257066000 -28800 0 PST} + {1268560800 -25200 1 PDT} + {1289120400 -28800 0 PST} + {1300010400 -25200 1 PDT} + {1320570000 -28800 0 PST} + {1331460000 -25200 1 PDT} + {1352019600 -28800 0 PST} + {1362909600 -25200 1 PDT} + {1383469200 -28800 0 PST} + {1394359200 -25200 1 PDT} + {1414918800 -28800 0 PST} + {1425808800 -25200 0 MST} +} diff --git a/library/tzdata/Europe/Istanbul b/library/tzdata/Europe/Istanbul index 7cb4820..8eadbc3 100644 --- a/library/tzdata/Europe/Istanbul +++ b/library/tzdata/Europe/Istanbul @@ -133,7 +133,8 @@ set TZData(:Europe/Istanbul) { {1396227600 10800 0 EEST} {1414285200 7200 0 EET} {1427590800 10800 1 EEST} - {1445734800 7200 0 EET} + {1445734800 10800 1 EEST} + {1446944400 7200 0 EET} {1459040400 10800 1 EEST} {1477789200 7200 0 EET} {1490490000 10800 1 EEST} diff --git a/library/tzdata/Pacific/Fiji b/library/tzdata/Pacific/Fiji index 4aae330..8f8b12f 100644 --- a/library/tzdata/Pacific/Fiji +++ b/library/tzdata/Pacific/Fiji @@ -20,9 +20,9 @@ set TZData(:Pacific/Fiji) { {1414850400 46800 1 FJST} {1421503200 43200 0 FJT} {1446300000 46800 1 FJST} - {1453557600 43200 0 FJT} + {1452952800 43200 0 FJT} {1478354400 46800 1 FJST} - {1485007200 43200 0 FJT} + {1484402400 43200 0 FJT} {1509804000 46800 1 FJST} {1516456800 43200 0 FJT} {1541253600 46800 1 FJST} @@ -30,11 +30,11 @@ set TZData(:Pacific/Fiji) { {1572703200 46800 1 FJST} {1579356000 43200 0 FJT} {1604152800 46800 1 FJST} - {1611410400 43200 0 FJT} + {1610805600 43200 0 FJT} {1636207200 46800 1 FJST} - {1642860000 43200 0 FJT} + {1642255200 43200 0 FJT} {1667656800 46800 1 FJST} - {1674309600 43200 0 FJT} + {1673704800 43200 0 FJT} {1699106400 46800 1 FJST} {1705759200 43200 0 FJT} {1730556000 46800 1 FJST} @@ -42,9 +42,9 @@ set TZData(:Pacific/Fiji) { {1762005600 46800 1 FJST} {1768658400 43200 0 FJT} {1793455200 46800 1 FJST} - {1800712800 43200 0 FJT} + {1800108000 43200 0 FJT} {1825509600 46800 1 FJST} - {1832162400 43200 0 FJT} + {1831557600 43200 0 FJT} {1856959200 46800 1 FJST} {1863612000 43200 0 FJT} {1888408800 46800 1 FJST} @@ -54,9 +54,9 @@ set TZData(:Pacific/Fiji) { {1951308000 46800 1 FJST} {1957960800 43200 0 FJT} {1983362400 46800 1 FJST} - {1990015200 43200 0 FJT} + {1989410400 43200 0 FJT} {2014812000 46800 1 FJST} - {2021464800 43200 0 FJT} + {2020860000 43200 0 FJT} {2046261600 46800 1 FJST} {2052914400 43200 0 FJT} {2077711200 46800 1 FJST} @@ -64,11 +64,11 @@ set TZData(:Pacific/Fiji) { {2109160800 46800 1 FJST} {2115813600 43200 0 FJT} {2140610400 46800 1 FJST} - {2147868000 43200 0 FJT} + {2147263200 43200 0 FJT} {2172664800 46800 1 FJST} - {2179317600 43200 0 FJT} + {2178712800 43200 0 FJT} {2204114400 46800 1 FJST} - {2210767200 43200 0 FJT} + {2210162400 43200 0 FJT} {2235564000 46800 1 FJST} {2242216800 43200 0 FJT} {2267013600 46800 1 FJST} @@ -76,9 +76,9 @@ set TZData(:Pacific/Fiji) { {2298463200 46800 1 FJST} {2305116000 43200 0 FJT} {2329912800 46800 1 FJST} - {2337170400 43200 0 FJT} + {2336565600 43200 0 FJT} {2361967200 46800 1 FJST} - {2368620000 43200 0 FJT} + {2368015200 43200 0 FJT} {2393416800 46800 1 FJST} {2400069600 43200 0 FJT} {2424866400 46800 1 FJST} @@ -86,11 +86,11 @@ set TZData(:Pacific/Fiji) { {2456316000 46800 1 FJST} {2462968800 43200 0 FJT} {2487765600 46800 1 FJST} - {2495023200 43200 0 FJT} + {2494418400 43200 0 FJT} {2519820000 46800 1 FJST} - {2526472800 43200 0 FJT} + {2525868000 43200 0 FJT} {2551269600 46800 1 FJST} - {2557922400 43200 0 FJT} + {2557317600 43200 0 FJT} {2582719200 46800 1 FJST} {2589372000 43200 0 FJT} {2614168800 46800 1 FJST} @@ -98,9 +98,9 @@ set TZData(:Pacific/Fiji) { {2645618400 46800 1 FJST} {2652271200 43200 0 FJT} {2677068000 46800 1 FJST} - {2684325600 43200 0 FJT} + {2683720800 43200 0 FJT} {2709122400 46800 1 FJST} - {2715775200 43200 0 FJT} + {2715170400 43200 0 FJT} {2740572000 46800 1 FJST} {2747224800 43200 0 FJT} {2772021600 46800 1 FJST} @@ -110,9 +110,9 @@ set TZData(:Pacific/Fiji) { {2834920800 46800 1 FJST} {2841573600 43200 0 FJT} {2866975200 46800 1 FJST} - {2873628000 43200 0 FJT} + {2873023200 43200 0 FJT} {2898424800 46800 1 FJST} - {2905077600 43200 0 FJT} + {2904472800 43200 0 FJT} {2929874400 46800 1 FJST} {2936527200 43200 0 FJT} {2961324000 46800 1 FJST} @@ -120,11 +120,11 @@ set TZData(:Pacific/Fiji) { {2992773600 46800 1 FJST} {2999426400 43200 0 FJT} {3024223200 46800 1 FJST} - {3031480800 43200 0 FJT} + {3030876000 43200 0 FJT} {3056277600 46800 1 FJST} - {3062930400 43200 0 FJT} + {3062325600 43200 0 FJT} {3087727200 46800 1 FJST} - {3094380000 43200 0 FJT} + {3093775200 43200 0 FJT} {3119176800 46800 1 FJST} {3125829600 43200 0 FJT} {3150626400 46800 1 FJST} @@ -132,9 +132,9 @@ set TZData(:Pacific/Fiji) { {3182076000 46800 1 FJST} {3188728800 43200 0 FJT} {3213525600 46800 1 FJST} - {3220783200 43200 0 FJT} + {3220178400 43200 0 FJT} {3245580000 46800 1 FJST} - {3252232800 43200 0 FJT} + {3251628000 43200 0 FJT} {3277029600 46800 1 FJST} {3283682400 43200 0 FJT} {3308479200 46800 1 FJST} @@ -142,11 +142,11 @@ set TZData(:Pacific/Fiji) { {3339928800 46800 1 FJST} {3346581600 43200 0 FJT} {3371378400 46800 1 FJST} - {3378636000 43200 0 FJT} + {3378031200 43200 0 FJT} {3403432800 46800 1 FJST} - {3410085600 43200 0 FJT} + {3409480800 43200 0 FJT} {3434882400 46800 1 FJST} - {3441535200 43200 0 FJT} + {3440930400 43200 0 FJT} {3466332000 46800 1 FJST} {3472984800 43200 0 FJT} {3497781600 46800 1 FJST} @@ -154,9 +154,9 @@ set TZData(:Pacific/Fiji) { {3529231200 46800 1 FJST} {3535884000 43200 0 FJT} {3560680800 46800 1 FJST} - {3567938400 43200 0 FJT} + {3567333600 43200 0 FJT} {3592735200 46800 1 FJST} - {3599388000 43200 0 FJT} + {3598783200 43200 0 FJT} {3624184800 46800 1 FJST} {3630837600 43200 0 FJT} {3655634400 46800 1 FJST} @@ -166,9 +166,9 @@ set TZData(:Pacific/Fiji) { {3718533600 46800 1 FJST} {3725186400 43200 0 FJT} {3750588000 46800 1 FJST} - {3757240800 43200 0 FJT} + {3756636000 43200 0 FJT} {3782037600 46800 1 FJST} - {3788690400 43200 0 FJT} + {3788085600 43200 0 FJT} {3813487200 46800 1 FJST} {3820140000 43200 0 FJT} {3844936800 46800 1 FJST} @@ -176,11 +176,11 @@ set TZData(:Pacific/Fiji) { {3876386400 46800 1 FJST} {3883039200 43200 0 FJT} {3907836000 46800 1 FJST} - {3915093600 43200 0 FJT} + {3914488800 43200 0 FJT} {3939890400 46800 1 FJST} - {3946543200 43200 0 FJT} + {3945938400 43200 0 FJT} {3971340000 46800 1 FJST} - {3977992800 43200 0 FJT} + {3977388000 43200 0 FJT} {4002789600 46800 1 FJST} {4009442400 43200 0 FJT} {4034239200 46800 1 FJST} diff --git a/library/tzdata/Pacific/Norfolk b/library/tzdata/Pacific/Norfolk index a8fac15..b12ab8c 100644 --- a/library/tzdata/Pacific/Norfolk +++ b/library/tzdata/Pacific/Norfolk @@ -4,4 +4,7 @@ set TZData(:Pacific/Norfolk) { {-9223372036854775808 40312 0 LMT} {-2177493112 40320 0 NMT} {-599656320 41400 0 NFT} + {152029800 45000 1 NFST} + {162912600 41400 0 NFT} + {1443882600 39600 0 NFT} } -- cgit v0.12 From d2b7a7797a402493c3e257f8c83b27111c0770c0 Mon Sep 17 00:00:00 2001 From: dkf Date: Wed, 28 Oct 2015 21:15:21 +0000 Subject: Expose some of the TclBN operations through the internal API, so clients of the bignum code don't need to use tclTomMath.h directly. --- generic/tclInt.h | 7 +------ generic/tclTomMath.decls | 23 +++++++++++++++++++---- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/generic/tclInt.h b/generic/tclInt.h index 356d250..f9d2edf 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -4435,17 +4435,12 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file, /* *---------------------------------------------------------------------- * - * Core procedures added to libtommath for bignum manipulation. + * Core procedure added to libtommath for bignum manipulation. * *---------------------------------------------------------------------- */ MODULE_SCOPE Tcl_PackageInitProc TclTommath_Init; -MODULE_SCOPE void TclBNInitBignumFromLong(mp_int *bignum, long initVal); -MODULE_SCOPE void TclBNInitBignumFromWideInt(mp_int *bignum, - Tcl_WideInt initVal); -MODULE_SCOPE void TclBNInitBignumFromWideUInt(mp_int *bignum, - Tcl_WideUInt initVal); /* *---------------------------------------------------------------------- diff --git a/generic/tclTomMath.decls b/generic/tclTomMath.decls index ea3abb1..8d9e05f 100644 --- a/generic/tclTomMath.decls +++ b/generic/tclTomMath.decls @@ -1,9 +1,8 @@ # tclTomMath.decls -- # -# This file contains the declarations for the functions in -# 'libtommath' that are contained within the Tcl library. -# This file is used to generate the 'tclTomMathDecls.h' and -# 'tclTomMathStub.c' files. +# This file contains the declarations for the functions in 'libtommath' +# that are contained within the Tcl library. This file is used to +# generate the 'tclTomMathDecls.h' and 'tclTomMathStub.c' files. # # If you edit this file, advance the revision number (and the epoch # if the new stubs are not backward compatible) in tclTomMathDecls.h @@ -221,3 +220,19 @@ declare 62 { declare 63 { int TclBN_mp_cnt_lsb(const mp_int *a) } + +# Formerly internal API to allow initialisation of bignums without knowing the +# typedefs of how a bignum works internally. +declare 64 { + void TclBNInitBignumFromLong(mp_int *bignum, long initVal) +} +declare 65 { + void TclBNInitBignumFromWideInt(mp_int *bignum, Tcl_WideInt initVal) +} +declare 66 { + void TclBNInitBignumFromWideUInt(mp_int *bignum, Tcl_WideUInt initVal) +} + +# Local Variables: +# mode: tcl +# End: -- cgit v0.12 From 573cabc6d240f1e84a271373810ae254a2dd4791 Mon Sep 17 00:00:00 2001 From: dkf Date: Wed, 28 Oct 2015 21:15:52 +0000 Subject: make genstubs --- generic/tclStubInit.c | 3 +++ generic/tclTomMathDecls.h | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 7d44163..5b7a1cd 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -746,6 +746,9 @@ const TclTomMathStubs tclTomMathStubs = { TclBN_mp_init_set_int, /* 61 */ TclBN_mp_set_int, /* 62 */ TclBN_mp_cnt_lsb, /* 63 */ + TclBNInitBignumFromLong, /* 64 */ + TclBNInitBignumFromWideInt, /* 65 */ + TclBNInitBignumFromWideUInt, /* 66 */ }; static const TclStubHooks tclStubHooks = { diff --git a/generic/tclTomMathDecls.h b/generic/tclTomMathDecls.h index 69b095c..2ce9d5a 100644 --- a/generic/tclTomMathDecls.h +++ b/generic/tclTomMathDecls.h @@ -279,6 +279,14 @@ EXTERN int TclBN_mp_init_set_int(mp_int *a, unsigned long i); EXTERN int TclBN_mp_set_int(mp_int *a, unsigned long i); /* 63 */ EXTERN int TclBN_mp_cnt_lsb(const mp_int *a); +/* 64 */ +EXTERN void TclBNInitBignumFromLong(mp_int *bignum, long initVal); +/* 65 */ +EXTERN void TclBNInitBignumFromWideInt(mp_int *bignum, + Tcl_WideInt initVal); +/* 66 */ +EXTERN void TclBNInitBignumFromWideUInt(mp_int *bignum, + Tcl_WideUInt initVal); typedef struct TclTomMathStubs { int magic; @@ -348,6 +356,9 @@ typedef struct TclTomMathStubs { int (*tclBN_mp_init_set_int) (mp_int *a, unsigned long i); /* 61 */ int (*tclBN_mp_set_int) (mp_int *a, unsigned long i); /* 62 */ int (*tclBN_mp_cnt_lsb) (const mp_int *a); /* 63 */ + void (*tclBNInitBignumFromLong) (mp_int *bignum, long initVal); /* 64 */ + void (*tclBNInitBignumFromWideInt) (mp_int *bignum, Tcl_WideInt initVal); /* 65 */ + void (*tclBNInitBignumFromWideUInt) (mp_int *bignum, Tcl_WideUInt initVal); /* 66 */ } TclTomMathStubs; extern const TclTomMathStubs *tclTomMathStubsPtr; @@ -490,6 +501,12 @@ extern const TclTomMathStubs *tclTomMathStubsPtr; (tclTomMathStubsPtr->tclBN_mp_set_int) /* 62 */ #define TclBN_mp_cnt_lsb \ (tclTomMathStubsPtr->tclBN_mp_cnt_lsb) /* 63 */ +#define TclBNInitBignumFromLong \ + (tclTomMathStubsPtr->tclBNInitBignumFromLong) /* 64 */ +#define TclBNInitBignumFromWideInt \ + (tclTomMathStubsPtr->tclBNInitBignumFromWideInt) /* 65 */ +#define TclBNInitBignumFromWideUInt \ + (tclTomMathStubsPtr->tclBNInitBignumFromWideUInt) /* 66 */ #endif /* defined(USE_TCL_STUBS) */ -- cgit v0.12 From c5b0b72ed7cbfd413896d9c9b0cb7bdcf521fc53 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 10 Nov 2015 16:31:29 +0000 Subject: [261a8a79f0] Integer overflow leads to segfault. --- generic/tclIO.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclIO.c b/generic/tclIO.c index 9a4735f..7bc849e 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -5938,7 +5938,7 @@ TranslateInputEOL( break; default: /* In other modes, at most 2 src bytes become a dst byte. */ - if (srcLen > 2 * dstLen) { + if (srcLen/2 > dstLen) { srcLen = 2 * dstLen; } break; -- cgit v0.12 From f84d09bdd759fbee98108d0a097f322255fdf0e3 Mon Sep 17 00:00:00 2001 From: max Date: Wed, 11 Nov 2015 09:56:41 +0000 Subject: Remove unused calculation of the result set size from TclCreateSocketAddress() --- generic/tclIOSock.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/generic/tclIOSock.c b/generic/tclIOSock.c index d578d19..c5b7d28 100644 --- a/generic/tclIOSock.c +++ b/generic/tclIOSock.c @@ -171,7 +171,7 @@ TclCreateSocketAddress( char *native = NULL, portbuf[TCL_INTEGER_SPACE], *portstring; const char *family = NULL; Tcl_DString ds; - int result, i; + int result; if (host != NULL) { native = Tcl_UtfToExternalDString(NULL, host, -1, &ds); @@ -279,11 +279,6 @@ TclCreateSocketAddress( *addrlist = v4head; } } - i = 0; - for (p = *addrlist; p != NULL; p = p->ai_next) { - i++; - } - return 1; } -- cgit v0.12 From e93e78ae999879629f4db62379c05fd53ca4db57 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 13 Nov 2015 08:40:54 +0000 Subject: Fix [https://www.sqlite.org/src/info/34eb6911afee09e7|34eb6911af], taken over from SQLite: Fix uses of ctype functions (ex: isspace()) on signed characters in test programs and in some obscure extensions. No changes to the core. --- win/nmakehlp.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/win/nmakehlp.c b/win/nmakehlp.c index d0edcf0..84cf75c 100644 --- a/win/nmakehlp.c +++ b/win/nmakehlp.c @@ -498,9 +498,10 @@ GetVersionFromFile( p = strstr(szBuffer, match); if (p != NULL) { /* - * Skip to first digit. + * Skip to first digit after the match. */ + p += strlen(match); while (*p && !isdigit(*p)) { ++p; } @@ -605,8 +606,8 @@ SubstituteFile( sp = fopen(substitutions, "rt"); if (sp != NULL) { while (fgets(szBuffer, cbBuffer, sp) != NULL) { - char *ks, *ke, *vs, *ve; - ks = szBuffer; + unsigned char *ks, *ke, *vs, *ve; + ks = (unsigned char*)szBuffer; while (ks && *ks && isspace(*ks)) ++ks; ke = ks; while (ke && *ke && !isspace(*ke)) ++ke; @@ -615,7 +616,7 @@ SubstituteFile( ve = vs; while (ve && *ve && !(*ve == '\r' || *ve == '\n')) ++ve; *ke = 0, *ve = 0; - list_insert(&substPtr, ks, vs); + list_insert(&substPtr, (char*)ks, (char*)vs); } fclose(sp); } @@ -630,11 +631,11 @@ SubstituteFile( } } #endif - + /* * Run the substitutions over each line of the input */ - + while (fgets(szBuffer, cbBuffer, fp) != NULL) { list_item_t *p = NULL; for (p = substPtr; p != NULL; p = p->nextPtr) { @@ -654,7 +655,7 @@ SubstituteFile( } printf(szBuffer); } - + list_free(&substPtr); } fclose(fp); -- cgit v0.12 From 31b415218813b465bfd99d4d79ae85e95c90028f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 16 Nov 2015 10:32:40 +0000 Subject: =?UTF-8?q?Fix=20--enable-symbols=20build=20on=20Cygwin.=20Reporte?= =?UTF-8?q?d=20by=20Fran=C3=A7ois=20Vogel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- unix/Makefile.in | 2 +- win/Makefile.in | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/unix/Makefile.in b/unix/Makefile.in index 1f2cd77..84d0391 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -560,7 +560,7 @@ ${LIB_FILE}: ${STUB_LIB_FILE} ${OBJS} ${STUB_LIB_FILE}: ${STUB_LIB_OBJS} @if test "x${LIB_FILE}" = "xlibtcl${MAJOR_VERSION}.${MINOR_VERSION}.dll"; then \ - (cd ${TOP_DIR}/win; ${MAKE} libtclstub${MAJOR_VERSION}${MINOR_VERSION}.a); \ + (cd ${TOP_DIR}/win; ${MAKE} winextensions); \ fi rm -f $@ @MAKE_STUB_LIB@ diff --git a/win/Makefile.in b/win/Makefile.in index e9a28c4..ada9448 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -400,6 +400,8 @@ winhelp: $(ROOT_DIR)/tools/man2help.tcl $(MAN2TCL) ./$(TCLSH) "$(ROOT_DIR_NATIVE)"/tools/man2help.tcl tcl "$(VER)" $(TCL_DOCS) hcw /c /e tcl.hpj +winextensions: ${DDE_DLL_FILE} ${REG_DLL_FILE} + $(MAN2TCL): $(ROOT_DIR)/tools/man2tcl.c $(CC) $(CFLAGS_OPTIMIZE) $(MAN2TCLFLAGS) -o $(MAN2TCL) "$(ROOT_DIR_NATIVE)"/tools/man2tcl.c -- cgit v0.12 From 0c95d1d7c2d07e8a422b8af055160e8009e7eeb4 Mon Sep 17 00:00:00 2001 From: oehhar Date: Tue, 17 Nov 2015 17:01:58 +0000 Subject: Spanish translation of example corrected --- doc/msgcat.n | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/msgcat.n b/doc/msgcat.n index 7e46528..34e153d 100644 --- a/doc/msgcat.n +++ b/doc/msgcat.n @@ -384,7 +384,7 @@ the package. For example, a short \fBes.msg\fR might contain: .PP .CS namespace eval ::mypackage { - \fB::msgcat::mcflset\fR "Free Beer!" "Cerveza Gracias!" + \fB::msgcat::mcflset\fR "Free Beer" "Cerveza Gratis" } .CE .SH "RECOMMENDED MESSAGE SETUP FOR PACKAGES" -- cgit v0.12 From 5498d8aaa43327e94fd652a66fde74f4187452db Mon Sep 17 00:00:00 2001 From: oehhar Date: Tue, 17 Nov 2015 17:07:33 +0000 Subject: Spanish translation of example corrected --- doc/msgcat.n | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/msgcat.n b/doc/msgcat.n index bae6dbe..b4f7140 100644 --- a/doc/msgcat.n +++ b/doc/msgcat.n @@ -321,7 +321,7 @@ the package. For example, a short \fBes.msg\fR might contain: .PP .CS namespace eval ::mypackage { - \fB::msgcat::mcflset\fR "Free Beer!" "Cerveza Gracias!" + \fB::msgcat::mcflset\fR "Free Beer" "Cerveza Gratis" } .CE .SH "RECOMMENDED MESSAGE SETUP FOR PACKAGES" -- cgit v0.12 From c32d032cbd7947d9e64e931df87fc4f374d81e7f Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 20 Nov 2015 15:47:30 +0000 Subject: [40f628e8e3] Tcl_ListObjReplace() callers need to handle TCL_ERROR. --- generic/tclCmdIL.c | 10 ++++++++-- generic/tclUtil.c | 8 +++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index ea9c1e4..02e5812 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -2233,7 +2233,10 @@ Tcl_LinsertObjCmd( Tcl_ListObjAppendElement(NULL, listPtr, objv[3]); } else { - Tcl_ListObjReplace(NULL, listPtr, index, 0, (objc-3), &(objv[3])); + if (TCL_OK != Tcl_ListObjReplace(interp, listPtr, index, 0, + (objc-3), &(objv[3]))) { + return TCL_ERROR; + } } /* @@ -2598,7 +2601,10 @@ Tcl_LreplaceObjCmd( * optimize this case away. */ - Tcl_ListObjReplace(NULL, listPtr, first, numToDelete, objc-4, &(objv[4])); + if (TCL_OK != Tcl_ListObjReplace(interp, listPtr, first, numToDelete, + objc-4, &(objv[4]))) { + return TCL_ERROR; + } /* * Set the interpreter's object result. diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 69d0b17..bc1490e 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -1791,7 +1791,12 @@ Tcl_ConcatObj( TclListObjGetElements(NULL, objPtr, &listc, &listv); if (listc) { if (resPtr) { - Tcl_ListObjReplace(NULL, resPtr, INT_MAX, 0, listc, listv); + if (TCL_OK != Tcl_ListObjReplace(NULL, resPtr, + INT_MAX, 0, listc, listv)) { + /* Abandon ship! */ + Tcl_DecrRefCount(resPtr); + goto slow; + } } else { resPtr = TclListObjCopy(NULL, objPtr); } @@ -1808,6 +1813,7 @@ Tcl_ConcatObj( * the slow way, using the string representations. */ + slow: /* First try to pre-allocate the size required */ for (i = 0; i < objc; i++) { element = TclGetStringFromObj(objv[i], &elemLength); -- cgit v0.12 From dfbac0054227702fab645e6c03d08c35a8dd9b7c Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 20 Nov 2015 16:58:11 +0000 Subject: [3293874] Simplified fix (not backport). Also detect >LIST_MAX early. --- generic/tclListObj.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 289cf2d..c4b5cfc 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -854,8 +854,13 @@ Tcl_ListObjReplace( count = numElems - first; } + if (objc > LIST_MAX - (numElems - count)) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "max length of a Tcl list (%d elements) exceeded", LIST_MAX)); + return TCL_ERROR; + } isShared = (listRepPtr->refCount > 1); - numRequired = numElems - count + objc; + numRequired = numElems - count + objc; /* Known <= LIST_MAX */ for (i = 0; i < objc; i++) { Tcl_IncrRefCount(objv[i]); @@ -906,6 +911,8 @@ Tcl_ListObjReplace( listRepPtr = AttemptNewList(interp, newMax, NULL); if (listRepPtr == NULL) { + listRepPtr = AttemptNewList(interp, numRequired, NULL); + if (listRepPtr == NULL) { for (i = 0; i < objc; i++) { /* See bug 3598580 */ #if TCL_MAJOR_VERSION > 8 @@ -916,6 +923,7 @@ Tcl_ListObjReplace( } return TCL_ERROR; } + } listPtr->internalRep.twoPtrValue.ptr1 = (void *) listRepPtr; listRepPtr->refCount++; -- cgit v0.12 From 6b4bc6bb8d46722088d73bd4a93f51e7fc65dbf4 Mon Sep 17 00:00:00 2001 From: dkf Date: Sat, 21 Nov 2015 22:22:49 +0000 Subject: [3d96b7076e] Prevent crashes when destroying an object's class inside a method call. --- generic/tclOO.c | 20 +++++++++++++++---- generic/tclOODefineCmds.c | 15 ++++++++++---- generic/tclOOInfo.c | 12 +++++++++++ generic/tclOOInt.h | 3 +++ tests/oo.test | 51 +++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 93 insertions(+), 8 deletions(-) diff --git a/generic/tclOO.c b/generic/tclOO.c index 84bb85a..5fca220 100644 --- a/generic/tclOO.c +++ b/generic/tclOO.c @@ -951,6 +951,16 @@ ReleaseClassContents( } if (!IsRootClass(oPtr)) { FOREACH(instancePtr, clsPtr->instances) { + int j; + if (instancePtr->selfCls == clsPtr) { + instancePtr->flags |= CLASS_GONE; + } + for(j=0 ; jmixins.num ; j++) { + Class *mixin = instancePtr->mixins.list[j]; + if (mixin == clsPtr) { + instancePtr->mixins.list[j] = NULL; + } + } if (instancePtr != NULL && !IsRoot(instancePtr)) { AddRef(instancePtr); } @@ -1131,12 +1141,14 @@ ObjectNamespaceDeleted( * methods on the object. */ - if (!IsRootObject(oPtr)) { + if (!IsRootObject(oPtr) && !(oPtr->flags & CLASS_GONE)) { TclOORemoveFromInstances(oPtr, oPtr->selfCls); } FOREACH(mixinPtr, oPtr->mixins) { - TclOORemoveFromInstances(oPtr, mixinPtr); + if (mixinPtr) { + TclOORemoveFromInstances(oPtr, mixinPtr); + } } if (i) { ckfree(oPtr->mixins.list); @@ -1908,13 +1920,13 @@ Tcl_CopyObjectInstance( */ FOREACH(mixinPtr, o2Ptr->mixins) { - if (mixinPtr != o2Ptr->selfCls) { + if (mixinPtr && mixinPtr != o2Ptr->selfCls) { TclOORemoveFromInstances(o2Ptr, mixinPtr); } } DUPLICATE(o2Ptr->mixins, oPtr->mixins, Class *); FOREACH(mixinPtr, o2Ptr->mixins) { - if (mixinPtr != o2Ptr->selfCls) { + if (mixinPtr && mixinPtr != o2Ptr->selfCls) { TclOOAddToInstances(o2Ptr, mixinPtr); } } diff --git a/generic/tclOODefineCmds.c b/generic/tclOODefineCmds.c index 85f6c31..c880754 100644 --- a/generic/tclOODefineCmds.c +++ b/generic/tclOODefineCmds.c @@ -323,7 +323,9 @@ TclOOObjectSetMixins( if (numMixins == 0) { if (oPtr->mixins.num != 0) { FOREACH(mixinPtr, oPtr->mixins) { - TclOORemoveFromInstances(oPtr, mixinPtr); + if (mixinPtr) { + TclOORemoveFromInstances(oPtr, mixinPtr); + } } ckfree(oPtr->mixins.list); oPtr->mixins.num = 0; @@ -332,7 +334,7 @@ TclOOObjectSetMixins( } else { if (oPtr->mixins.num != 0) { FOREACH(mixinPtr, oPtr->mixins) { - if (mixinPtr != oPtr->selfCls) { + if (mixinPtr && mixinPtr != oPtr->selfCls) { TclOORemoveFromInstances(oPtr, mixinPtr); } } @@ -1213,6 +1215,9 @@ TclOODefineClassObjCmd( TclOORemoveFromInstances(oPtr, oPtr->selfCls); oPtr->selfCls = clsPtr; TclOOAddToInstances(oPtr, oPtr->selfCls); + if (!(clsPtr->thisPtr->flags & OBJECT_DELETED)) { + oPtr->flags &= ~CLASS_GONE; + } if (oPtr->classPtr != NULL) { BumpGlobalEpoch(interp, oPtr->classPtr); } else { @@ -2509,8 +2514,10 @@ ObjMixinGet( resultObj = Tcl_NewObj(); FOREACH(mixinPtr, oPtr->mixins) { - Tcl_ListObjAppendElement(NULL, resultObj, - TclOOObjectName(interp, mixinPtr->thisPtr)); + if (mixinPtr) { + Tcl_ListObjAppendElement(NULL, resultObj, + TclOOObjectName(interp, mixinPtr->thisPtr)); + } } Tcl_SetObjResult(interp, resultObj); return TCL_OK; diff --git a/generic/tclOOInfo.c b/generic/tclOOInfo.c index 0c22bcf..76eaef5 100644 --- a/generic/tclOOInfo.c +++ b/generic/tclOOInfo.c @@ -196,6 +196,9 @@ InfoObjectClassCmd( } FOREACH(mixinPtr, oPtr->mixins) { + if (!mixinPtr) { + continue; + } if (TclOOIsReachable(o2clsPtr, mixinPtr)) { Tcl_SetObjResult(interp, Tcl_NewIntObj(1)); return TCL_OK; @@ -467,6 +470,9 @@ InfoObjectIsACmd( Class *mixinPtr; FOREACH(mixinPtr, oPtr->mixins) { + if (!mixinPtr) { + continue; + } if (TclOOIsReachable(o2Ptr->classPtr, mixinPtr)) { result = 1; break; @@ -665,6 +671,9 @@ InfoObjectMixinsCmd( resultObj = Tcl_NewObj(); FOREACH(mixinPtr, oPtr->mixins) { + if (!mixinPtr) { + continue; + } Tcl_ListObjAppendElement(NULL, resultObj, TclOOObjectName(interp, mixinPtr->thisPtr)); } @@ -1281,6 +1290,9 @@ InfoClassMixinsCmd( resultObj = Tcl_NewObj(); FOREACH(mixinPtr, clsPtr->mixins) { + if (!mixinPtr) { + continue; + } Tcl_ListObjAppendElement(NULL, resultObj, TclOOObjectName(interp, mixinPtr->thisPtr)); } diff --git a/generic/tclOOInt.h b/generic/tclOOInt.h index 208e32c..b75ffdb 100644 --- a/generic/tclOOInt.h +++ b/generic/tclOOInt.h @@ -193,6 +193,9 @@ typedef struct Object { * destroyed. */ #define DESTRUCTOR_CALLED 2 /* Flag to say that the destructor has been * called. */ +#define CLASS_GONE 4 /* Indicates that the class of this object has + * been deleted, and so the object should not + * attempt to remove itself from its class. */ #define ROOT_OBJECT 0x1000 /* Flag to say that this object is the root of * the class hierarchy and should be treated * specially during teardown. */ diff --git a/tests/oo.test b/tests/oo.test index c83e015..2112f10 100644 --- a/tests/oo.test +++ b/tests/oo.test @@ -638,6 +638,57 @@ test oo-3.9 {Bug 2944404: deleting the object in the destructor} -setup { } -cleanup { cls destroy } -result {in destructor} +test oo-3.10 {Bug 3d96b7076e: killing the object's class in a method call} -setup { + oo::class create Super +} -body { + # Only reliably failed in a memdebug build + oo::class create Cls { + superclass Super + method mthd {} { + [self class] destroy + return ok + } + } + [Cls new] mthd +} -cleanup { + Super destroy +} -result ok +test oo-3.11 {Bug 3d96b7076e: killing the object's class in a method call} -setup { + oo::class create Super + oo::class create Sub { + superclass Super + } +} -body { + # Only reliably failed in a memdebug build + oo::class create Cls { + superclass Super + method mthd {} { + oo::objdefine [self] class Sub + Cls destroy + return ok + } + } + [Cls new] mthd +} -cleanup { + Super destroy +} -result ok +test oo-3.12 {Bug 3d96b7076e: killing the object's class in a method call} -setup { + oo::class create Super +} -body { + # Only reliably failed in a memdebug build + oo::class create Cls { + superclass Super + method mthd {} { + [self class] destroy + return ok + } + } + set o [Super new] + oo::objdefine $o mixin Cls + $o mthd +} -cleanup { + Super destroy +} -result ok test oo-4.1 {basic test of OO functionality: export} { set o [oo::object new] -- cgit v0.12 From 5eeef96ee9e6fbb573a438338662fea9ca7c0efd Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 22 Nov 2015 21:02:29 +0000 Subject: Cherrypick [812a81812ebf89d2416059d45fabd27e45603f5e|812a81812e]: Turn off NRE asserts by default. About a 5% speedup on [clock format]. --- generic/regc_nfa.c | 12 ++++++------ generic/tclBasic.c | 3 --- generic/tclExecute.c | 3 --- generic/tclInt.h | 4 +++- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/generic/regc_nfa.c b/generic/regc_nfa.c index 0e0343e..088c6c0 100644 --- a/generic/regc_nfa.c +++ b/generic/regc_nfa.c @@ -293,7 +293,7 @@ newarc( } } } - + /* no dup, so create the arc */ createarc(nfa, t, co, from, to); } @@ -657,7 +657,7 @@ sortins_cmp( } return 0; } - + /* * sortouts - sort the out arcs of a state by to/color/type */ @@ -2020,7 +2020,7 @@ fixempties( arcarray[arccount++] = a; } } - + /* Reset the tmp fields as we walk back */ nexts = s2->tmp; s2->tmp = NULL; @@ -2042,7 +2042,7 @@ fixempties( } inarcsorig[s->no] = a; } - + FREE(arcarray); FREE(inarcsorig); @@ -2193,7 +2193,7 @@ fixconstraintloops( dropstate(nfa, s); } } - + /* Nothing to do if no remaining constraint arcs */ if (NISERR() || !hasconstraints) { return; @@ -2909,7 +2909,7 @@ carc_cmp( { const struct carc *aa = (const struct carc *) a; const struct carc *bb = (const struct carc *) b; - + if (aa->co < bb->co) { return -1; } diff --git a/generic/tclBasic.c b/generic/tclBasic.c index a09bf10..5c5bc64 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -22,10 +22,7 @@ #include "tclCompile.h" #include "tommath.h" #include - -#if NRE_ENABLE_ASSERTS #include -#endif #define INTERP_STACK_INITIAL_SIZE 2000 #define CORO_STACK_INITIAL_SIZE 200 diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 7f65262..b10af65 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -20,10 +20,7 @@ #include "tclOOInt.h" #include "tommath.h" #include - -#if NRE_ENABLE_ASSERTS #include -#endif /* * Hack to determine whether we may expect IEEE floating point. The hack is diff --git a/generic/tclInt.h b/generic/tclInt.h index f9d2edf..082fab4 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -4791,7 +4791,9 @@ void Tcl_Panic(const char *, ...) __attribute__((analyzer_noreturn)); */ #define NRE_USE_SMALL_ALLOC 1 /* Only turn off for debugging purposes. */ -#define NRE_ENABLE_ASSERTS 1 +#ifndef NRE_ENABLE_ASSERTS +#define NRE_ENABLE_ASSERTS 0 +#endif /* * This is the main data struct for representing NR commands. It is designed -- cgit v0.12 From 48ac4215cf78865b39eadc4341f8c59def82aa12 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 24 Nov 2015 09:00:27 +0000 Subject: Make ::tcl::tm::roots work for alpha/beta Tcl releases. (backported from "novem", will be needed anyway for whatever future developments) --- library/tm.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/tm.tcl b/library/tm.tcl index 55efda6..66c56a1 100644 --- a/library/tm.tcl +++ b/library/tm.tcl @@ -354,7 +354,7 @@ proc ::tcl::tm::Defaults {} { # Calls 'path add' to paths to the list of module search paths. proc ::tcl::tm::roots {paths} { - lassign [split [package present Tcl] .] major minor + regexp {^(\d+)\.(\d+)} [package present Tcl] - major minor foreach pa $paths { set p [file join $pa tcl$major] for {set n $minor} {$n >= 0} {incr n -1} { -- cgit v0.12 From 81929af166648538e5b049b7d0e1cd2b24906d08 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 24 Nov 2015 15:05:15 +0000 Subject: Fix comments at the top of the *.decls files, which are not correct any more for a long long time. --- generic/tcl.decls | 4 ++-- generic/tclInt.decls | 5 ++--- generic/tclTomMath.decls | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/generic/tcl.decls b/generic/tcl.decls index 28cee54..92ccdcf 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -2,8 +2,8 @@ # # This file contains the declarations for all supported public # functions that are exported by the Tcl library via the stubs table. -# This file is used to generate the tclDecls.h, tclPlatDecls.h, -# tclStub.c, and tclPlatStub.c files. +# This file is used to generate the tclDecls.h, tclPlatDecls.h +# and tclStubInit.c files. # # Copyright (c) 1998-1999 by Scriptics Corporation. # Copyright (c) 2001, 2002 by Kevin B. Kenny. All rights reserved. diff --git a/generic/tclInt.decls b/generic/tclInt.decls index 102d04b..920116c 100644 --- a/generic/tclInt.decls +++ b/generic/tclInt.decls @@ -2,9 +2,8 @@ # # This file contains the declarations for all unsupported # functions that are exported by the Tcl library. This file -# is used to generate the tclIntDecls.h, tclIntPlatDecls.h, -# tclIntStub.c, tclPlatStub.c, tclCompileDecls.h and tclCompileStub.c -# files +# is used to generate the tclIntDecls.h, tclIntPlatDecls.h +# and tclStubInit.c files # # Copyright (c) 1998-1999 by Scriptics Corporation. # Copyright (c) 2001 by Kevin B. Kenny. All rights reserved. diff --git a/generic/tclTomMath.decls b/generic/tclTomMath.decls index 1bfc443..ab39e83 100644 --- a/generic/tclTomMath.decls +++ b/generic/tclTomMath.decls @@ -3,7 +3,7 @@ # This file contains the declarations for the functions in # 'libtommath' that are contained within the Tcl library. # This file is used to generate the 'tclTomMathDecls.h' and -# 'tclTomMathStub.c' files. +# 'tclStubInit.c' files. # # If you edit this file, advance the revision number (and the epoch # if the new stubs are not backward compatible) in tclTomMathDecls.h -- cgit v0.12 From a90dcf7e3dbae2714513cbc09ec978dfcf21aa55 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 26 Nov 2015 11:46:02 +0000 Subject: On cygwin, install libtcl8.5.dll.a in the {prefix}/lib directory. On win32, don't create empty {prefix}/lib/tcl8/8.2 and {prefix}/lib/tcl8/8.3 directories any more during installing. --- unix/configure | 2 +- unix/tcl.m4 | 2 +- win/makefile.vc | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/unix/configure b/unix/configure index 692b801..a90aff3 100755 --- a/unix/configure +++ b/unix/configure @@ -8880,7 +8880,7 @@ fi MAKE_LIB='${SHLIB_LD} -o $@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}' if test "${SHLIB_SUFFIX}" = ".dll"; then - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)"' + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)";if test -f $(LIB_FILE).a; then $(INSTALL_DATA) $(LIB_FILE).a "$(LIB_INSTALL_DIR)"; fi;' DLL_INSTALL_DIR="\$(BIN_INSTALL_DIR)" else diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 7a0b677..a7faae5 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -2069,7 +2069,7 @@ dnl # preprocessing tests use only CPPFLAGS. LIB_SUFFIX=${SHARED_LIB_SUFFIX} MAKE_LIB='${SHLIB_LD} -o [$]@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}' AS_IF([test "${SHLIB_SUFFIX}" = ".dll"], [ - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)"' + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)";if test -f $(LIB_FILE).a; then $(INSTALL_DATA) $(LIB_FILE).a "$(LIB_INSTALL_DIR)"; fi;' DLL_INSTALL_DIR="\$(BIN_INSTALL_DIR)" ], [ INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"' diff --git a/win/makefile.vc b/win/makefile.vc index 267f53f..8c8ecdf 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -1012,10 +1012,6 @@ install-libraries: tclConfig install-msgs install-tzdata $(MKDIR) "$(SCRIPT_INSTALL_DIR)" @if not exist "$(SCRIPT_INSTALL_DIR)\..\tcl8$(NULL)" \ $(MKDIR) "$(SCRIPT_INSTALL_DIR)\..\tcl8" - @if not exist "$(SCRIPT_INSTALL_DIR)\..\tcl8\8.2$(NULL)" \ - $(MKDIR) "$(SCRIPT_INSTALL_DIR)\..\tcl8\8.2" - @if not exist "$(SCRIPT_INSTALL_DIR)\..\tcl8\8.3$(NULL)" \ - $(MKDIR) "$(SCRIPT_INSTALL_DIR)\..\tcl8\8.3" @if not exist "$(SCRIPT_INSTALL_DIR)\..\tcl8\8.4$(NULL)" \ $(MKDIR) "$(SCRIPT_INSTALL_DIR)\..\tcl8\8.4" @if not exist "$(SCRIPT_INSTALL_DIR)\..\tcl8\8.4\platform$(NULL)" \ -- cgit v0.12 From efe36a3e290e2f47f8bed9ca19569cf46d0079ce Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 30 Nov 2015 18:24:03 +0000 Subject: [32c5740a4d] Have Tcl_ListObjReplace() try to use realloc() for growing when it can do so. --- generic/tclListObj.c | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 0dfa845..14b8a14 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -857,7 +857,7 @@ Tcl_ListObjReplace( { List *listRepPtr; register Tcl_Obj **elemPtrs; - int numElems, numRequired, numAfterLast, start, i, j, isShared; + int needGrow, numElems, numRequired, numAfterLast, start, i, j, isShared; if (Tcl_IsShared(listPtr)) { Tcl_Panic("%s called with shared object", "Tcl_ListObjReplace"); @@ -913,12 +913,39 @@ Tcl_ListObjReplace( } isShared = (listRepPtr->refCount > 1); numRequired = numElems - count + objc; /* Known <= LIST_MAX */ + needGrow = numRequired > listRepPtr->maxElemCount; for (i = 0; i < objc; i++) { Tcl_IncrRefCount(objv[i]); } - if ((numRequired <= listRepPtr->maxElemCount) && !isShared) { + if (needGrow && !isShared) { + /* Try to use realloc */ + List *newPtr = NULL; + int attempt = 2 * numRequired; + if (attempt <= LIST_MAX) { + newPtr = attemptckrealloc(listRepPtr, LIST_SIZE(attempt)); + } + if (newPtr == NULL) { + attempt = numRequired + 1 + TCL_MIN_ELEMENT_GROWTH; + if (attempt > LIST_MAX) { + attempt = LIST_MAX; + } + newPtr = attemptckrealloc(listRepPtr, LIST_SIZE(attempt)); + } + if (newPtr == NULL) { + attempt = numRequired; + newPtr = attemptckrealloc(listRepPtr, LIST_SIZE(attempt)); + } + if (newPtr) { + listRepPtr = newPtr; + listPtr->internalRep.twoPtrValue.ptr1 = listRepPtr; + elemPtrs = &listRepPtr->elements; + listRepPtr->maxElemCount = attempt; + needGrow = numRequired > listRepPtr->maxElemCount; + } + } + if (!needGrow && !isShared) { int shift; /* @@ -955,7 +982,7 @@ Tcl_ListObjReplace( Tcl_Obj **oldPtrs = elemPtrs; int newMax; - if (numRequired > listRepPtr->maxElemCount){ + if (needGrow){ newMax = 2 * numRequired; } else { newMax = listRepPtr->maxElemCount; -- cgit v0.12 From 7b5ffe4a2c27ceb9b41422abe0a3a680dc345244 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 2 Dec 2015 11:02:34 +0000 Subject: Fix 64-bit MSVC build without SDK: If the MSVC version is recent enough, compiling without SDK works fine (provided that the build is configured using "--enable-64bit"). --- win/configure | 12 ++++-------- win/tcl.m4 | 7 ++----- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/win/configure b/win/configure index 63d6765..090feaa 100755 --- a/win/configure +++ b/win/configure @@ -3722,15 +3722,11 @@ echo "${ECHO_T}using shared flags" >&6 ;; esac if test ! -d "${PATH64}" ; then - { echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5 -echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;} - { echo "$as_me:$LINENO: WARNING: Ensure latest Platform SDK is installed" >&5 -echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;} - do64bit="no" - else - echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 -echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 + { echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK" >&5 +echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK" >&2;} fi + echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 +echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 fi LIBS="user32.lib advapi32.lib ws2_32.lib" diff --git a/win/tcl.m4 b/win/tcl.m4 index 2795086..006778c 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -815,12 +815,9 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ ;; esac if test ! -d "${PATH64}" ; then - AC_MSG_WARN([Could not find 64-bit $MACHINE SDK to enable 64bit mode]) - AC_MSG_WARN([Ensure latest Platform SDK is installed]) - do64bit="no" - else - AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) + AC_MSG_WARN([Could not find 64-bit $MACHINE SDK]) fi + AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) fi LIBS="user32.lib advapi32.lib ws2_32.lib" -- cgit v0.12 From 003b3000368a5f8752fcee1444cf4ec1cee6fe62 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 11 Dec 2015 10:13:33 +0000 Subject: Fix [c9eb6b0ac01bb8ef96a616c71426a3db4a279bec|c9eb6b0ac0]: ConvertLocalToUTCUsingC fails the first time if TZ is not set --- generic/tclClock.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/generic/tclClock.c b/generic/tclClock.c index 3ec94fb..32ba145 100644 --- a/generic/tclClock.c +++ b/generic/tclClock.c @@ -1994,22 +1994,23 @@ ClockSecondsObjCmd( static void TzsetIfNecessary(void) { - static char* tzWas = NULL; /* Previous value of TZ, protected by + static char* tzWas = INT2PTR(-1); /* Previous value of TZ, protected by * clockMutex. */ const char* tzIsNow; /* Current value of TZ */ Tcl_MutexLock(&clockMutex); tzIsNow = getenv("TZ"); - if (tzIsNow != NULL && (tzWas == NULL || strcmp(tzIsNow, tzWas) != 0)) { + if (tzIsNow != NULL && (tzWas == NULL || tzWas == INT2PTR(-1) + || strcmp(tzIsNow, tzWas) != 0)) { tzset(); - if (tzWas != NULL) { + if (tzWas != NULL && tzWas != INT2PTR(-1)) { ckfree(tzWas); } tzWas = ckalloc(strlen(tzIsNow) + 1); strcpy(tzWas, tzIsNow); } else if (tzIsNow == NULL && tzWas != NULL) { tzset(); - ckfree(tzWas); + if (tzWas != INT2PTR(-1)) ckfree(tzWas); tzWas = NULL; } Tcl_MutexUnlock(&clockMutex); -- cgit v0.12 From f1d71456ca0ed0f306f2fdfbaf3668e506f41aa9 Mon Sep 17 00:00:00 2001 From: dkf Date: Sat, 12 Dec 2015 11:54:33 +0000 Subject: Issue the correct auxType when compiling [array set]. --- generic/tclCompCmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index 18da741..8d0e2f6 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.c @@ -365,7 +365,7 @@ TclCompileArraySetCmd( infoPtr->varLists[0]->numVars = 2; infoPtr->varLists[0]->varIndexes[0] = keyVar; infoPtr->varLists[0]->varIndexes[1] = valVar; - infoIndex = TclCreateAuxData(infoPtr, &tclForeachInfoType, envPtr); + infoIndex = TclCreateAuxData(infoPtr, &tclNewForeachInfoType, envPtr); /* * Start issuing instructions to write to the array. -- cgit v0.12 From df25840e9998ccae184ac0e650ea1857d1da6634 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 15 Dec 2015 10:33:09 +0000 Subject: Eliminate AuxDataType table: since this table only contains 4 constant entries, it is overkill to use a hash table for that. --- generic/tclCompile.c | 156 ++++----------------------------------------------- generic/tclCompile.h | 2 - generic/tclExecute.c | 2 - 3 files changed, 10 insertions(+), 150 deletions(-) diff --git a/generic/tclCompile.c b/generic/tclCompile.c index f62ec14..6c4734d 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -17,15 +17,6 @@ #include /* - * Table of all AuxData types. - */ - -static Tcl_HashTable auxDataTypeTable; -static int auxDataTypeTableInitialized; /* 0 means not yet initialized. */ - -TCL_DECLARE_MUTEX(tableMutex) - -/* * Variable that controls whether compilation tracing is enabled and, if so, * what level of tracing is desired: * 0: no compilation tracing @@ -4221,59 +4212,6 @@ TclGetInstructionTable(void) } /* - *-------------------------------------------------------------- - * - * RegisterAuxDataType -- - * - * This procedure is called to register a new AuxData type in the table - * of all AuxData types supported by Tcl. - * - * Results: - * None. - * - * Side effects: - * The type is registered in the AuxData type table. If there was already - * a type with the same name as in typePtr, it is replaced with the new - * type. - * - *-------------------------------------------------------------- - */ - -static void -RegisterAuxDataType( - const AuxDataType *typePtr) /* Information about object type; storage must - * be statically allocated (must live forever; - * will not be deallocated). */ -{ - register Tcl_HashEntry *hPtr; - int isNew; - - Tcl_MutexLock(&tableMutex); - if (!auxDataTypeTableInitialized) { - TclInitAuxDataTypeTable(); - } - - /* - * If there's already a type with the given name, remove it. - */ - - hPtr = Tcl_FindHashEntry(&auxDataTypeTable, typePtr->name); - if (hPtr != NULL) { - Tcl_DeleteHashEntry(hPtr); - } - - /* - * Now insert the new object type. - */ - - hPtr = Tcl_CreateHashEntry(&auxDataTypeTable, typePtr->name, &isNew); - if (isNew) { - Tcl_SetHashValue(hPtr, typePtr); - } - Tcl_MutexUnlock(&tableMutex); -} - -/* *---------------------------------------------------------------------- * * TclGetAuxDataType -- @@ -4294,90 +4232,16 @@ const AuxDataType * TclGetAuxDataType( const char *typeName) /* Name of AuxData type to look up. */ { - register Tcl_HashEntry *hPtr; - const AuxDataType *typePtr = NULL; - - Tcl_MutexLock(&tableMutex); - if (!auxDataTypeTableInitialized) { - TclInitAuxDataTypeTable(); - } - - hPtr = Tcl_FindHashEntry(&auxDataTypeTable, typeName); - if (hPtr != NULL) { - typePtr = Tcl_GetHashValue(hPtr); - } - Tcl_MutexUnlock(&tableMutex); - - return typePtr; -} - -/* - *-------------------------------------------------------------- - * - * TclInitAuxDataTypeTable -- - * - * This procedure is invoked to perform once-only initialization of the - * AuxData type table. It also registers the AuxData types defined in - * this file. - * - * Results: - * None. - * - * Side effects: - * Initializes the table of defined AuxData types "auxDataTypeTable" with - * builtin AuxData types defined in this file. - * - *-------------------------------------------------------------- - */ - -void -TclInitAuxDataTypeTable(void) -{ - /* - * The table mutex must already be held before this routine is invoked. - */ - - auxDataTypeTableInitialized = 1; - Tcl_InitHashTable(&auxDataTypeTable, TCL_STRING_KEYS); - - /* - * There are only four AuxData types at this time, so register them here. - */ - - RegisterAuxDataType(&tclForeachInfoType); - RegisterAuxDataType(&tclNewForeachInfoType); - RegisterAuxDataType(&tclJumptableInfoType); - RegisterAuxDataType(&tclDictUpdateInfoType); -} - -/* - *---------------------------------------------------------------------- - * - * TclFinalizeAuxDataTypeTable -- - * - * This procedure is called by Tcl_Finalize after all exit handlers have - * been run to free up storage associated with the table of AuxData - * types. This procedure is called by TclFinalizeExecution() which is - * called by Tcl_Finalize(). - * - * Results: - * None. - * - * Side effects: - * Deletes all entries in the hash table of AuxData types. - * - *---------------------------------------------------------------------- - */ - -void -TclFinalizeAuxDataTypeTable(void) -{ - Tcl_MutexLock(&tableMutex); - if (auxDataTypeTableInitialized) { - Tcl_DeleteHashTable(&auxDataTypeTable); - auxDataTypeTableInitialized = 0; - } - Tcl_MutexUnlock(&tableMutex); + if (!strcmp(typeName, tclForeachInfoType.name)) { + return &tclForeachInfoType; + } else if (!strcmp(typeName, tclNewForeachInfoType.name)) { + return &tclNewForeachInfoType; + } else if (!strcmp(typeName, tclDictUpdateInfoType.name)) { + return &tclDictUpdateInfoType; + } else if (!strcmp(typeName, tclJumptableInfoType.name)) { + return &tclJumptableInfoType; + } + return NULL; } /* diff --git a/generic/tclCompile.h b/generic/tclCompile.h index b89346d..8811187 100644 --- a/generic/tclCompile.h +++ b/generic/tclCompile.h @@ -1123,7 +1123,6 @@ MODULE_SCOPE void TclExpandJumpFixupArray(JumpFixupArray *fixupArrayPtr); MODULE_SCOPE int TclNRExecuteByteCode(Tcl_Interp *interp, ByteCode *codePtr); MODULE_SCOPE Tcl_Obj * TclFetchLiteral(CompileEnv *envPtr, unsigned int index); -MODULE_SCOPE void TclFinalizeAuxDataTypeTable(void); MODULE_SCOPE int TclFindCompiledLocal(const char *name, int nameChars, int create, CompileEnv *envPtr); MODULE_SCOPE int TclFixupForwardJump(CompileEnv *envPtr, @@ -1131,7 +1130,6 @@ MODULE_SCOPE int TclFixupForwardJump(CompileEnv *envPtr, int distThreshold); MODULE_SCOPE void TclFreeCompileEnv(CompileEnv *envPtr); MODULE_SCOPE void TclFreeJumpFixupArray(JumpFixupArray *fixupArrayPtr); -MODULE_SCOPE void TclInitAuxDataTypeTable(void); MODULE_SCOPE void TclInitByteCodeObj(Tcl_Obj *objPtr, CompileEnv *envPtr); MODULE_SCOPE void TclInitCompileEnv(Tcl_Interp *interp, diff --git a/generic/tclExecute.c b/generic/tclExecute.c index b10af65..dacc9e2 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -927,7 +927,6 @@ TclCreateExecEnv( Tcl_MutexLock(&execMutex); if (!execInitialized) { - TclInitAuxDataTypeTable(); InitByteCodeExecution(interp); execInitialized = 1; } @@ -1026,7 +1025,6 @@ TclFinalizeExecution(void) Tcl_MutexLock(&execMutex); execInitialized = 0; Tcl_MutexUnlock(&execMutex); - TclFinalizeAuxDataTypeTable(); } /* -- cgit v0.12 From 62b1f5c63defe1dc95bf58b163ef0aa0fd1fa699 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 15 Dec 2015 11:13:32 +0000 Subject: make some MODULE_SCOPE symbols static --- generic/tclCompCmds.c | 45 +++++++++++++++++++++++++++++++++++++++------ generic/tclCompile.c | 33 --------------------------------- generic/tclCompile.h | 11 ----------- 3 files changed, 39 insertions(+), 50 deletions(-) diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index 8d0e2f6..3ab03cc 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.c @@ -54,7 +54,7 @@ static int CompileDictEachCmd(Tcl_Interp *interp, * The structures below define the AuxData types defined in this file. */ -const AuxDataType tclForeachInfoType = { +static const AuxDataType foreachInfoType = { "ForeachInfo", /* name */ DupForeachInfo, /* dupProc */ FreeForeachInfo, /* freeProc */ @@ -62,7 +62,7 @@ const AuxDataType tclForeachInfoType = { DisassembleForeachInfo /* disassembleProc */ }; -const AuxDataType tclNewForeachInfoType = { +static const AuxDataType newForeachInfoType = { "NewForeachInfo", /* name */ DupForeachInfo, /* dupProc */ FreeForeachInfo, /* freeProc */ @@ -70,7 +70,7 @@ const AuxDataType tclNewForeachInfoType = { DisassembleNewForeachInfo /* disassembleProc */ }; -const AuxDataType tclDictUpdateInfoType = { +static const AuxDataType dictUpdateInfoType = { "DictUpdateInfo", /* name */ DupDictUpdateInfo, /* dupProc */ FreeDictUpdateInfo, /* freeProc */ @@ -81,6 +81,39 @@ const AuxDataType tclDictUpdateInfoType = { /* *---------------------------------------------------------------------- * + * TclGetAuxDataType -- + * + * This procedure looks up an Auxdata type by name. + * + * Results: + * If an AuxData type with name matching "typeName" is found, a pointer + * to its AuxDataType structure is returned; otherwise, NULL is returned. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +const AuxDataType * +TclGetAuxDataType( + const char *typeName) /* Name of AuxData type to look up. */ +{ + if (!strcmp(typeName, foreachInfoType.name)) { + return &foreachInfoType; + } else if (!strcmp(typeName, newForeachInfoType.name)) { + return &newForeachInfoType; + } else if (!strcmp(typeName, dictUpdateInfoType.name)) { + return &dictUpdateInfoType; + } else if (!strcmp(typeName, tclJumptableInfoType.name)) { + return &tclJumptableInfoType; + } + return NULL; +} + +/* + *---------------------------------------------------------------------- + * * TclCompileAppendCmd -- * * Procedure called to compile the "append" command. @@ -365,7 +398,7 @@ TclCompileArraySetCmd( infoPtr->varLists[0]->numVars = 2; infoPtr->varLists[0]->varIndexes[0] = keyVar; infoPtr->varLists[0]->varIndexes[1] = valVar; - infoIndex = TclCreateAuxData(infoPtr, &tclNewForeachInfoType, envPtr); + infoIndex = TclCreateAuxData(infoPtr, &newForeachInfoType, envPtr); /* * Start issuing instructions to write to the array. @@ -1669,7 +1702,7 @@ TclCompileDictUpdateCmd( * can't be snagged by literal sharing and forced to shimmer dangerously. */ - infoIndex = TclCreateAuxData(duiPtr, &tclDictUpdateInfoType, envPtr); + infoIndex = TclCreateAuxData(duiPtr, &dictUpdateInfoType, envPtr); for (i=0 ; iauxDataArrayPtr[TclGetUInt4AtPtr(index)].clientData)) - /* * Structure used to hold information about a switch command that is needed * during program execution. These structures are stored in CompileEnv and @@ -1033,11 +1027,6 @@ typedef struct { * STRUCTURE. */ } DictUpdateInfo; -MODULE_SCOPE const AuxDataType tclDictUpdateInfoType; - -#define DICTUPDATEINFO(envPtr, index) \ - ((DictUpdateInfo*)((envPtr)->auxDataArrayPtr[TclGetUInt4AtPtr(index)].clientData)) - /* * ClientData type used by the math operator commands. */ -- cgit v0.12 From b8ee717f77fc6f8add7137b14be34357192aacea Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 15 Dec 2015 13:19:43 +0000 Subject: Remove unused static function definition --- generic/tclCompile.c | 1 - 1 file changed, 1 deletion(-) diff --git a/generic/tclCompile.c b/generic/tclCompile.c index 6598829..4c259ab 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -679,7 +679,6 @@ static int IsCompactibleCompileEnv(Tcl_Interp *interp, #ifdef TCL_COMPILE_STATS static void RecordByteCodeStats(ByteCode *codePtr); #endif /* TCL_COMPILE_STATS */ -static void RegisterAuxDataType(const AuxDataType *typePtr); static int SetByteCodeFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr); static void StartExpanding(CompileEnv *envPtr); -- cgit v0.12 From 9766a76000f4b621c0fa1ef9f7ad6d41d0f36a74 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 21 Dec 2015 10:27:19 +0000 Subject: Code-cleanup: CONST -> const, don't use macro's like __REG_CONST and types like re_void any more. No change in functionality. --- generic/regcustom.h | 8 ------- generic/regex.h | 60 ++++++++++++++--------------------------------------- unix/Makefile.in | 2 +- win/tclWinChan.c | 2 +- 4 files changed, 18 insertions(+), 54 deletions(-) diff --git a/generic/regcustom.h b/generic/regcustom.h index 1c970ea..681b97d 100644 --- a/generic/regcustom.h +++ b/generic/regcustom.h @@ -60,12 +60,6 @@ #ifdef __REG_REGOFF_T #undef __REG_REGOFF_T #endif -#ifdef __REG_VOID_T -#undef __REG_VOID_T -#endif -#ifdef __REG_CONST -#undef __REG_CONST -#endif #ifdef __REG_NOFRONT #undef __REG_NOFRONT #endif @@ -75,8 +69,6 @@ /* Interface types */ #define __REG_WIDE_T Tcl_UniChar #define __REG_REGOFF_T long /* Not really right, but good enough... */ -#define __REG_VOID_T void -#define __REG_CONST const /* Names and declarations */ #define __REG_WIDE_COMPILE TclReComp #define __REG_WIDE_EXEC TclReExec diff --git a/generic/regex.h b/generic/regex.h index 53450e5..8845f72 100644 --- a/generic/regex.h +++ b/generic/regex.h @@ -92,12 +92,6 @@ extern "C" { #ifdef __REG_REGOFF_T #undef __REG_REGOFF_T #endif -#ifdef __REG_VOID_T -#undef __REG_VOID_T -#endif -#ifdef __REG_CONST -#undef __REG_CONST -#endif #ifdef __REG_NOFRONT #undef __REG_NOFRONT #endif @@ -107,8 +101,6 @@ extern "C" { /* interface types */ #define __REG_WIDE_T Tcl_UniChar #define __REG_REGOFF_T long /* not really right, but good enough... */ -#define __REG_VOID_T void -#define __REG_CONST const /* names and declarations */ #define __REG_WIDE_COMPILE TclReComp #define __REG_WIDE_EXEC TclReExec @@ -134,26 +126,6 @@ typedef long regoff_t; #endif /* - * For benefit of old compilers, we offer the option of - * overriding the `void' type used to declare nonexistent return types. - */ -#ifdef __REG_VOID_T -typedef __REG_VOID_T re_void; -#else -typedef void re_void; -#endif - -/* - * Also for benefit of old compilers, can supply a macro which - * expands to a substitute for `const'. - */ -#ifndef __REG_CONST -#define __REG_CONST const -#endif - - - -/* * other interface types */ @@ -197,13 +169,13 @@ typedef struct { /* * compilation ^ #ifndef __REG_NOCHAR - ^ int re_comp(regex_t *, __REG_CONST char *, size_t, int); + ^ int re_comp(regex_t *, const char *, size_t, int); ^ #endif ^ #ifndef __REG_NOFRONT - ^ int regcomp(regex_t *, __REG_CONST char *, int); + ^ int regcomp(regex_t *, const char *, int); ^ #endif ^ #ifdef __REG_WIDE_T - ^ int __REG_WIDE_COMPILE(regex_t *, __REG_CONST __REG_WIDE_T *, size_t, int); + ^ int __REG_WIDE_COMPILE(regex_t *, const __REG_WIDE_T *, size_t, int); ^ #endif */ #define REG_BASIC 000000 /* BREs (convenience) */ @@ -228,14 +200,14 @@ typedef struct { /* * execution ^ #ifndef __REG_NOCHAR - ^ int re_exec(regex_t *, __REG_CONST char *, size_t, + ^ int re_exec(regex_t *, const char *, size_t, ^ rm_detail_t *, size_t, regmatch_t [], int); ^ #endif ^ #ifndef __REG_NOFRONT - ^ int regexec(regex_t *, __REG_CONST char *, size_t, regmatch_t [], int); + ^ int regexec(regex_t *, const char *, size_t, regmatch_t [], int); ^ #endif ^ #ifdef __REG_WIDE_T - ^ int __REG_WIDE_EXEC(regex_t *, __REG_CONST __REG_WIDE_T *, size_t, + ^ int __REG_WIDE_EXEC(regex_t *, const __REG_WIDE_T *, size_t, ^ rm_detail_t *, size_t, regmatch_t [], int); ^ #endif */ @@ -248,7 +220,7 @@ typedef struct { /* * misc generics (may be more functions here eventually) - ^ re_void regfree(regex_t *); + ^ void regfree(regex_t *); */ /* @@ -260,7 +232,7 @@ typedef struct { * of character is used for error reports is independent of what kind is used * in matching. * - ^ extern size_t regerror(int, __REG_CONST regex_t *, char *, size_t); + ^ extern size_t regerror(int, const regex_t *, char *, size_t); */ #define REG_OKAY 0 /* no errors detected */ #define REG_NOMATCH 1 /* failed to match */ @@ -293,25 +265,25 @@ typedef struct { /* automatically gathered by fwd; do not hand-edit */ /* === regproto.h === */ #ifndef __REG_NOCHAR -int re_comp(regex_t *, __REG_CONST char *, size_t, int); +int re_comp(regex_t *, const char *, size_t, int); #endif #ifndef __REG_NOFRONT -int regcomp(regex_t *, __REG_CONST char *, int); +int regcomp(regex_t *, const char *, int); #endif #ifdef __REG_WIDE_T -MODULE_SCOPE int __REG_WIDE_COMPILE(regex_t *, __REG_CONST __REG_WIDE_T *, size_t, int); +MODULE_SCOPE int __REG_WIDE_COMPILE(regex_t *, const __REG_WIDE_T *, size_t, int); #endif #ifndef __REG_NOCHAR -int re_exec(regex_t *, __REG_CONST char *, size_t, rm_detail_t *, size_t, regmatch_t [], int); +int re_exec(regex_t *, const char *, size_t, rm_detail_t *, size_t, regmatch_t [], int); #endif #ifndef __REG_NOFRONT -int regexec(regex_t *, __REG_CONST char *, size_t, regmatch_t [], int); +int regexec(regex_t *, const char *, size_t, regmatch_t [], int); #endif #ifdef __REG_WIDE_T -MODULE_SCOPE int __REG_WIDE_EXEC(regex_t *, __REG_CONST __REG_WIDE_T *, size_t, rm_detail_t *, size_t, regmatch_t [], int); +MODULE_SCOPE int __REG_WIDE_EXEC(regex_t *, const __REG_WIDE_T *, size_t, rm_detail_t *, size_t, regmatch_t [], int); #endif -MODULE_SCOPE re_void regfree(regex_t *); -MODULE_SCOPE size_t regerror(int, __REG_CONST regex_t *, char *, size_t); +MODULE_SCOPE void regfree(regex_t *); +MODULE_SCOPE size_t regerror(int, const regex_t *, char *, size_t); /* automatically gathered by fwd; do not hand-edit */ /* =====^!^===== end forwards =====^!^===== */ diff --git a/unix/Makefile.in b/unix/Makefile.in index da43c5d..bc73118 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -1828,7 +1828,7 @@ gendate: # -e 's?SCCSID?RCS: @(#) ?' \ # -e '/#ifdef __STDC__/,/#endif/d' -e '/TclDateerrlab:/d' \ # -e '/TclDatenewstate:/d' -e '/#pragma/d' \ -# -e '/#include /d' -e 's/const /CONST /g' \ +# -e '/#include /d' \ # -e '/#define YYNEW/s/malloc/TclDateAlloc/g' \ # -e '/#define YYENLARGE/,/realloc/s/realloc/TclDateRealloc/g' \ # $(GENERIC_DIR)/tclDate.c diff --git a/win/tclWinChan.c b/win/tclWinChan.c index cca0dab..78b510b 100644 --- a/win/tclWinChan.c +++ b/win/tclWinChan.c @@ -95,7 +95,7 @@ static void FileThreadActionProc(ClientData instanceData, static int FileTruncateProc(ClientData instanceData, Tcl_WideInt length); static DWORD FileGetType(HANDLE handle); -static int NativeIsComPort(CONST TCHAR *nativeName); +static int NativeIsComPort(const TCHAR *nativeName); /* * This structure describes the channel type structure for file based IO. */ -- cgit v0.12 From 1614457e38312b8180cd9ef843bffcc6a45a14cc Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 22 Dec 2015 18:27:23 +0000 Subject: [593baa032c] Possible fix (with test) for segfault in superclass teardown. --- generic/tclOO.c | 29 ++++++++++++++++++++--------- tests/oo.test | 7 +++++++ 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/generic/tclOO.c b/generic/tclOO.c index 5fca220..f2e0ca9 100644 --- a/generic/tclOO.c +++ b/generic/tclOO.c @@ -58,6 +58,7 @@ static const struct { static Class * AllocClass(Tcl_Interp *interp, Object *useThisObj); static Object * AllocObject(Tcl_Interp *interp, const char *nameStr, const char *nsNameStr); +static void ClearSuperclasses(Class *clsPtr); static int CloneClassMethod(Tcl_Interp *interp, Class *clsPtr, Method *mPtr, Tcl_Obj *namePtr, Method **newMPtrPtr); @@ -905,6 +906,20 @@ ObjectRenamedTrace( */ static void +ClearSuperclasses( + Class *clsPtr) +{ + int i; + Class *superPtr; + + FOREACH(superPtr, clsPtr->superclasses) { + TclOORemoveFromSubclasses(clsPtr, superPtr); + } + ckfree(clsPtr->superclasses.list); + clsPtr->superclasses.num = 0; +} + +static void ReleaseClassContents( Tcl_Interp *interp, /* The interpreter containing the class. */ Object *oPtr) /* The object representing the class. */ @@ -999,6 +1014,9 @@ ReleaseClassContents( if (!Deleted(subclassPtr->thisPtr)) { Tcl_DeleteCommandFromToken(interp, subclassPtr->thisPtr->command); } + if (subclassPtr->superclasses.num) { + ClearSuperclasses(subclassPtr); + } DelRef(subclassPtr->thisPtr); DelRef(subclassPtr); } @@ -1195,7 +1213,6 @@ ObjectNamespaceDeleted( } if (clsPtr != NULL) { - Class *superPtr; Tcl_ObjectMetadataType *metadataTypePtr; ClientData value; @@ -1224,14 +1241,8 @@ ObjectNamespaceDeleted( ckfree(clsPtr->mixins.list); clsPtr->mixins.num = 0; } - FOREACH(superPtr, clsPtr->superclasses) { - if (!Deleted(superPtr->thisPtr)) { - TclOORemoveFromSubclasses(clsPtr, superPtr); - } - } - if (i) { - ckfree(clsPtr->superclasses.list); - clsPtr->superclasses.num = 0; + if (clsPtr->superclasses.num) { + ClearSuperclasses(clsPtr); } if (clsPtr->subclasses.list) { ckfree(clsPtr->subclasses.list); diff --git a/tests/oo.test b/tests/oo.test index 2112f10..ca5c7f9 100644 --- a/tests/oo.test +++ b/tests/oo.test @@ -3671,6 +3671,13 @@ test oo-35.2 {Bug 9d61624b3d: Empty superclass must not cause crash} -setup { unset -nocomplain result fruitMetaclass destroy } -result {::appleClass ::orange ::oo::class ::oo::class 1 1 ::appleClass ::pear} +test oo-35.3 {Bug 593baa032c: superclass list teardown} { + # Bug makes this crash, especially with mem-debugging on + oo::class create B {} + oo::class create D {superclass B} + namespace eval [info object namespace D] [list [namespace which B] destroy] +} {} + cleanupTests return -- cgit v0.12 From 2516cd875a00dd9b9f1d23f43a86342c1007bdb4 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 22 Dec 2015 19:50:04 +0000 Subject: [593baa032c] Additional fix for the mixinSubs list. --- generic/tclOO.c | 29 +++++++++++++++++++++-------- tests/oo.test | 6 ++++++ 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/generic/tclOO.c b/generic/tclOO.c index f2e0ca9..34eb5ad 100644 --- a/generic/tclOO.c +++ b/generic/tclOO.c @@ -58,6 +58,7 @@ static const struct { static Class * AllocClass(Tcl_Interp *interp, Object *useThisObj); static Object * AllocObject(Tcl_Interp *interp, const char *nameStr, const char *nsNameStr); +static void ClearMixins(Class *clsPtr); static void ClearSuperclasses(Class *clsPtr); static int CloneClassMethod(Tcl_Interp *interp, Class *clsPtr, Method *mPtr, Tcl_Obj *namePtr, @@ -906,6 +907,20 @@ ObjectRenamedTrace( */ static void +ClearMixins( + Class *clsPtr) +{ + int i; + Class *mixinPtr; + + FOREACH(mixinPtr, clsPtr->mixins) { + TclOORemoveFromMixinSubs(clsPtr, mixinPtr); + } + ckfree(clsPtr->mixins.list); + clsPtr->mixins.num = 0; +} + +static void ClearSuperclasses( Class *clsPtr) { @@ -994,6 +1009,9 @@ ReleaseClassContents( Tcl_DeleteCommandFromToken(interp, mixinSubclassPtr->thisPtr->command); } + if (mixinSubclassPtr->mixins.num) { + ClearMixins(mixinSubclassPtr); + } DelRef(mixinSubclassPtr->thisPtr); DelRef(mixinSubclassPtr); } @@ -1232,14 +1250,9 @@ ObjectNamespaceDeleted( ckfree(clsPtr->filters.list); clsPtr->filters.num = 0; } - FOREACH(mixinPtr, clsPtr->mixins) { - if (!Deleted(mixinPtr->thisPtr)) { - TclOORemoveFromMixinSubs(clsPtr, mixinPtr); - } - } - if (i) { - ckfree(clsPtr->mixins.list); - clsPtr->mixins.num = 0; + + if (clsPtr->mixins.num) { + ClearMixins(clsPtr); } if (clsPtr->superclasses.num) { ClearSuperclasses(clsPtr); diff --git a/tests/oo.test b/tests/oo.test index ca5c7f9..895f7ed 100644 --- a/tests/oo.test +++ b/tests/oo.test @@ -3677,6 +3677,12 @@ test oo-35.3 {Bug 593baa032c: superclass list teardown} { oo::class create D {superclass B} namespace eval [info object namespace D] [list [namespace which B] destroy] } {} +test oo-35.4 {Bug 593baa032c: mixins list teardown} { + # Bug makes this crash, especially with mem-debugging on + oo::class create B {} + oo::class create D {mixin B} + namespace eval [info object namespace D] [list [namespace which B] destroy] +} {} cleanupTests -- cgit v0.12 From 97e52f918d3e35ec3f61e099424ccf966aae3101 Mon Sep 17 00:00:00 2001 From: dkf Date: Fri, 1 Jan 2016 17:46:45 +0000 Subject: Document the Tcl_CancelEval function correctly. It was missing its second argument, making using it correctly impossible, especially from C++. --- doc/Cancel.3 | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/doc/Cancel.3 b/doc/Cancel.3 index 5d258b7..f6b1636 100644 --- a/doc/Cancel.3 +++ b/doc/Cancel.3 @@ -13,20 +13,25 @@ Tcl_CancelEval, Tcl_Canceled \- cancel Tcl scripts .nf \fB#include \fR int -\fBTcl_CancelEval\fR(\fIinterp, clientData, flags\fR) +\fBTcl_CancelEval\fR(\fIinterp, resultObjPtr, clientData, flags\fR) .sp int \fBTcl_Canceled\fR(\fIinterp, flags\fR) .SH ARGUMENTS +.AS Tcl_Interp *interp .AP Tcl_Interp *interp in Interpreter in which to cancel the script. +.AP Tcl_Obj *resultObjPtr in +Error message to use in the cancellation, or NULL to use a default message. If +not NULL, this object will have its reference count decremented before +\fBTcl_CancelEval\fR returns. .AP int flags in ORed combination of flag bits that specify additional options. For \fBTcl_CancelEval\fR, only \fBTCL_CANCEL_UNWIND\fR is currently supported. For \fBTcl_Canceled\fR, only \fBTCL_LEAVE_ERR_MSG\fR and \fBTCL_CANCEL_UNWIND\fR are currently supported. .AP ClientData clientData in -Currently, reserved for future use. +Currently reserved for future use. It should be set to NULL. .BE .SH DESCRIPTION @@ -41,19 +46,21 @@ returns \fBTCL_ERROR\fR if it has. Otherwise, \fBTCL_OK\fR is returned. Extensions can use this function to check to see if they should abort a long running command. This function is thread sensitive and may only be called from the thread the interpreter was created in. -.SH "FLAG BITS" +.SS "FLAG BITS" Any ORed combination of the following values may be used for the \fIflags\fR argument to procedures such as \fBTcl_CancelEval\fR: -.TP 23 +.TP 20 \fBTCL_CANCEL_UNWIND\fR +. This flag is used by \fBTcl_CancelEval\fR and \fBTcl_Canceled\fR. For \fBTcl_CancelEval\fR, if this flag is set, the script in progress is canceled and the evaluation stack for the interpreter is unwound. For \fBTcl_Canceled\fR, if this flag is set, the script in progress is considered to be canceled only if the evaluation stack for the interpreter is being unwound. -.TP 23 +.TP 20 \fBTCL_LEAVE_ERR_MSG\fR +. This flag is only used by \fBTcl_Canceled\fR; it is ignored by other procedures. If an error is returned and this bit is set in \fIflags\fR, then an error message will be left in the interpreter's @@ -61,6 +68,7 @@ result, where it can be retrieved with \fBTcl_GetObjResult\fR or \fBTcl_GetStringResult\fR. If this flag bit is not set then no error message is left and the interpreter's result will not be modified. .SH "SEE ALSO" +interp(n), Tcl_Eval(3), TIP 285 .SH KEYWORDS cancel, unwind -- cgit v0.12 From 86b9cc18cdb1b06c9e34a429885a716f2c3e6a04 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 6 Jan 2016 11:15:20 +0000 Subject: Fix win32 mingw 32-bit build, bug was introduced by [c397433be321e6d9] (wrong zlib1.dll was copied) --- win/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win/Makefile.in b/win/Makefile.in index 7e6486c..2d27a41 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -468,7 +468,7 @@ ${TEST_DLL_FILE}: ${TCL_STUB_LIB_FILE} ${TCLTEST_OBJS} # use pre-built zlib1.dll ${ZLIB_DLL_FILE}: ${TCL_STUB_LIB_FILE} - @if test "@ZLIB_LIBS@set" != "${ZLIB_DIR}/win32/zdll.libset" ; then \ + @if test "@ZLIB_LIBS@set" != "${ZLIB_DIR_NATIVE}/win32/zdll.libset" ; then \ $(COPY) $(ZLIB_DIR)/win64/${ZLIB_DLL_FILE} ${ZLIB_DLL_FILE}; \ else \ $(COPY) $(ZLIB_DIR)/win32/${ZLIB_DLL_FILE} ${ZLIB_DLL_FILE}; \ -- cgit v0.12 From 7b79011075ebaea03aecd04ccb351f56681469a4 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 7 Jan 2016 11:33:02 +0000 Subject: Fix [f01d74dc8c]: DEFAULT_COPY_BLOCK_SIZE has incorrect value --- unix/tclUnixFCmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c index 3b1b6ca..a1a409e 100644 --- a/unix/tclUnixFCmd.c +++ b/unix/tclUnixFCmd.c @@ -564,7 +564,7 @@ TclUnixCopyFile( #define BINMODE #endif /* DJGPP */ -#define DEFAULT_COPY_BLOCK_SIZE 4069 +#define DEFAULT_COPY_BLOCK_SIZE 4096 if ((srcFd = TclOSopen(src, O_RDONLY BINMODE, 0)) < 0) { /* INTL: Native */ return TCL_ERROR; -- cgit v0.12 From 247529b2e2220a8d411a33788f9e7be3828d12a6 Mon Sep 17 00:00:00 2001 From: Joe Mistachkin Date: Thu, 14 Jan 2016 23:55:45 +0000 Subject: Add the tcl_platform(engine) element, TIP to be written. --- generic/tclBasic.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 5c5bc64..0bb43cc 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -916,6 +916,13 @@ Tcl_CreateInterp(void) TclInitEmbeddedConfigurationInformation(interp); /* + * TIP #XXX: Declare the name of the script engine to be "Tcl". + */ + + Tcl_SetVar2(interp, "tcl_platform", "engine", "Tcl", + TCL_GLOBAL_ONLY); + + /* * Compute the byte order of this machine. */ -- cgit v0.12 From 4320d2b7859b143036f361013d5eaa7d0baaa5c8 Mon Sep 17 00:00:00 2001 From: Joe Mistachkin Date: Fri, 15 Jan 2016 00:39:41 +0000 Subject: Add docs and tests. --- doc/tclvars.n | 5 +++++ tests/platform.test | 6 +++++- tests/safe.test | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/tclvars.n b/doc/tclvars.n index a8fba47..a256c21 100644 --- a/doc/tclvars.n +++ b/doc/tclvars.n @@ -299,6 +299,11 @@ so extension writers can specify which package to load depending on the C run-time library that is in use. This is not an indication that this core contains symbols. .TP +\fBengine\fR +. +The name of the Tcl language implementation. When the interpreter is first +created, this is always set to the string \fBTcl\fR. +.TP \fBmachine\fR . The instruction set executed by this machine, such as diff --git a/tests/platform.test b/tests/platform.test index cc00d49..c826444 100644 --- a/tests/platform.test +++ b/tests/platform.test @@ -23,6 +23,10 @@ catch [list package require -exact Tcltest [info patchlevel]] testConstraint testCPUID [llength [info commands testcpuid]] +test platform-1.0 {tcl_platform(engine)} { + set tcl_platform(engine) +} {Tcl} + test platform-1.1 {TclpSetVariables: tcl_platform} { interp create i i eval {catch {unset tcl_platform(debug)}} @@ -30,7 +34,7 @@ test platform-1.1 {TclpSetVariables: tcl_platform} { set result [i eval {lsort [array names tcl_platform]}] interp delete i set result -} {byteOrder machine os osVersion pathSeparator platform pointerSize user wordSize} +} {byteOrder engine machine os osVersion pathSeparator platform pointerSize user wordSize} # Test assumes twos-complement arithmetic, which is true of virtually # everything these days. Note that this does *not* use wide(), and diff --git a/tests/safe.test b/tests/safe.test index 859f352..94c1755 100644 --- a/tests/safe.test +++ b/tests/safe.test @@ -174,7 +174,7 @@ test safe-6.3 {test safe interpreters knowledge of the world} { } set r [lsearch -all -inline -not -exact $r "threaded"] lsort $r -} {byteOrder pathSeparator platform pointerSize wordSize} +} {byteOrder engine pathSeparator platform pointerSize wordSize} # More test should be added to check that hostname, nameofexecutable, aren't # leaking infos, but they still do... -- cgit v0.12 From 7a410220dde1167eb71e19d5e53ce442fbe27cd6 Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 18 Jan 2016 10:16:35 +0000 Subject: Put the file location information that Tcl has into the disassembled code. Important for tclquadcode. --- generic/tclDisassemble.c | 99 +++++++++++++++++++++++++++++++++++++++++++----- generic/tclInt.h | 3 +- tests/compile.test | 42 ++++++++++++++++++-- 3 files changed, 131 insertions(+), 13 deletions(-) diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c index 86f0e1d..a60a58d 100644 --- a/generic/tclDisassemble.c +++ b/generic/tclDisassemble.c @@ -21,9 +21,13 @@ * Prototypes for procedures defined later in this file: */ -static Tcl_Obj * DisassembleByteCodeAsDicts(Tcl_Obj *objPtr); +static Tcl_Obj * DisassembleByteCodeAsDicts(Tcl_Interp *interp, + Tcl_Obj *objPtr); static int FormatInstruction(ByteCode *codePtr, const unsigned char *pc, Tcl_Obj *bufferObj); +static void GetLocationInformation(Tcl_Interp *interp, + Proc *procPtr, Tcl_Obj **fileObjPtr, + int *linePtr); static void PrintSourceToObj(Tcl_Obj *appendObj, const char *stringPtr, int maxChars); static void UpdateStringOfInstName(Tcl_Obj *objPtr); @@ -48,6 +52,57 @@ static const Tcl_ObjType tclInstNameType = { #define BYTECODE(objPtr) \ ((ByteCode *) (objPtr)->internalRep.twoPtrValue.ptr1) +/* + *---------------------------------------------------------------------- + * + * GetLocationInformation -- + * + * This procedure looks up the information about where a procedure was + * originally declared. + * + * Results: + * Writes to the variables pointed at by fileObjPtr and linePtr. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +static void +GetLocationInformation( + Tcl_Interp *interp, /* Where to look up the location + * information. */ + Proc *procPtr, /* What to look up the information for. */ + Tcl_Obj **fileObjPtr, /* Where to write the information about what + * file the code came from. Will be written + * to, either with the object (assume shared!) + * that describes what the file was, or with + * NULL if the information is not + * available. */ + int *linePtr) /* Where to write the information about what + * line number represented the start of the + * code in question. Will be written to, + * either with the line number or with -1 if + * the information is not available. */ +{ + Interp *iPtr = (Interp *) interp; + Tcl_HashEntry *hePtr; + CmdFrame *cfPtr; + + *fileObjPtr = NULL; + *linePtr = -1; + if (iPtr != NULL && procPtr != NULL) { + hePtr = Tcl_FindHashEntry(iPtr->linePBodyPtr, procPtr); + if (hePtr != NULL && (cfPtr = Tcl_GetHashValue(hePtr)) != NULL) { + *linePtr = cfPtr->line[0]; + if (cfPtr->type == TCL_LOCATION_SOURCE) { + *fileObjPtr = cfPtr->data.eval.path; + } + } + } +} + #ifdef TCL_COMPILE_DEBUG /* *---------------------------------------------------------------------- @@ -68,10 +123,10 @@ static const Tcl_ObjType tclInstNameType = { void TclPrintByteCodeObj( - Tcl_Interp *interp, /* Used only for Tcl_GetStringFromObj. */ + Tcl_Interp *interp, /* Used only for getting location info. */ Tcl_Obj *objPtr) /* The bytecode object to disassemble. */ { - Tcl_Obj *bufPtr = TclDisassembleByteCodeObj(objPtr); + Tcl_Obj *bufPtr = TclDisassembleByteCodeObj(interp, objPtr); fprintf(stdout, "\n%s", TclGetString(bufPtr)); Tcl_DecrRefCount(bufPtr); @@ -187,15 +242,16 @@ TclPrintSource( Tcl_Obj * TclDisassembleByteCodeObj( + Tcl_Interp *interp, Tcl_Obj *objPtr) /* The bytecode object to disassemble. */ { ByteCode *codePtr = BYTECODE(objPtr); unsigned char *codeStart, *codeLimit, *pc; unsigned char *codeDeltaNext, *codeLengthNext; unsigned char *srcDeltaNext, *srcLengthNext; - int codeOffset, codeLen, srcOffset, srcLen, numCmds, delta, i; + int codeOffset, codeLen, srcOffset, srcLen, numCmds, delta, i, line; Interp *iPtr = (Interp *) *codePtr->interpHandle; - Tcl_Obj *bufferObj; + Tcl_Obj *bufferObj, *fileObj; char ptrBuf1[20], ptrBuf2[20]; TclNewObj(bufferObj); @@ -220,6 +276,11 @@ TclDisassembleByteCodeObj( Tcl_AppendToObj(bufferObj, " Source ", -1); PrintSourceToObj(bufferObj, codePtr->source, TclMin(codePtr->numSrcBytes, 55)); + GetLocationInformation(interp, codePtr->procPtr, &fileObj, &line); + if (line > -1 && fileObj != NULL) { + Tcl_AppendPrintfToObj(bufferObj, "\n File \"%s\" Line %d", + Tcl_GetString(fileObj), line); + } Tcl_AppendPrintfToObj(bufferObj, "\n Cmds %d, src %d, inst %d, litObjs %u, aux %d, stkDepth %u, code/src %.2f\n", numCmds, codePtr->numSrcBytes, codePtr->numCodeBytes, @@ -881,14 +942,16 @@ PrintSourceToObj( static Tcl_Obj * DisassembleByteCodeAsDicts( + Tcl_Interp *interp, /* Used for looking up the CmdFrame for the + * procedure, if one exists. */ Tcl_Obj *objPtr) /* The bytecode-holding value to take apart */ { ByteCode *codePtr = BYTECODE(objPtr); Tcl_Obj *description, *literals, *variables, *instructions, *inst; - Tcl_Obj *aux, *exn, *commands; + Tcl_Obj *aux, *exn, *commands, *file; unsigned char *pc, *opnd, *codeOffPtr, *codeLenPtr, *srcOffPtr, *srcLenPtr; int codeOffset, codeLength, sourceOffset, sourceLength; - int i, val; + int i, val, line; /* * Get the literals from the bytecode. @@ -1152,6 +1215,13 @@ DisassembleByteCodeAsDicts( #undef Decode /* + * Get the source file and line number information from the CmdFrame + * system if it is available. + */ + + GetLocationInformation(interp, codePtr->procPtr, &file, &line); + + /* * Build the overall result. */ @@ -1174,6 +1244,15 @@ DisassembleByteCodeAsDicts( Tcl_NewIntObj(codePtr->maxStackDepth)); Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("exceptdepth", -1), Tcl_NewIntObj(codePtr->maxExceptDepth)); + if (line > -1) { + Tcl_DictObjPut(NULL, description, + Tcl_NewStringObj("initiallinenumber", -1), + Tcl_NewIntObj(line)); + } + if (file) { + Tcl_DictObjPut(NULL, description, + Tcl_NewStringObj("sourcefile", -1), file); + } return description; } @@ -1403,9 +1482,11 @@ Tcl_DisassembleObjCmd( return TCL_ERROR; } if (PTR2INT(clientData)) { - Tcl_SetObjResult(interp, DisassembleByteCodeAsDicts(codeObjPtr)); + Tcl_SetObjResult(interp, + DisassembleByteCodeAsDicts(interp, codeObjPtr)); } else { - Tcl_SetObjResult(interp, TclDisassembleByteCodeObj(codeObjPtr)); + Tcl_SetObjResult(interp, + TclDisassembleByteCodeObj(interp, codeObjPtr)); } return TCL_OK; } diff --git a/generic/tclInt.h b/generic/tclInt.h index 082fab4..9a5b4bf 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -3152,7 +3152,8 @@ MODULE_SCOPE void TclFinalizeThreadStorage(void); MODULE_SCOPE Tcl_WideInt TclpGetWideClicks(void); MODULE_SCOPE double TclpWideClicksToNanoseconds(Tcl_WideInt clicks); #endif -MODULE_SCOPE Tcl_Obj * TclDisassembleByteCodeObj(Tcl_Obj *objPtr); +MODULE_SCOPE Tcl_Obj * TclDisassembleByteCodeObj(Tcl_Interp *interp, + Tcl_Obj *objPtr); MODULE_SCOPE int TclZlibInit(Tcl_Interp *interp); MODULE_SCOPE void * TclpThreadCreateKey(void); MODULE_SCOPE void TclpThreadDeleteKey(void *keyPtr); diff --git a/tests/compile.test b/tests/compile.test index d4a31d4..46e678a 100644 --- a/tests/compile.test +++ b/tests/compile.test @@ -765,7 +765,7 @@ test compile-18.24 {disassembler - basics} -returnCodes error -body { } -result "can't interpret \"\{\" as a lambda expression" test compile-18.25 {disassembler - basics} -body { dict keys [tcl::unsupported::getbytecode lambda {{} {}}] -} -result $bytecodekeys +} -result "$bytecodekeys initiallinenumber sourcefile" test compile-18.26 {disassembler - basics} -returnCodes error -body { tcl::unsupported::getbytecode proc } -match glob -result {wrong # args: should be "* proc procName"} @@ -778,7 +778,43 @@ test compile-18.28 {disassembler - basics} -setup { dict keys [tcl::unsupported::getbytecode proc chewonthis] } -cleanup { rename chewonthis {} +} -result "$bytecodekeys initiallinenumber sourcefile" +test compile-18.28.1 {disassembler - tricky bit} -setup { + eval [list proc chewonthis {} {}] +} -body { + dict keys [tcl::unsupported::getbytecode proc chewonthis] +} -cleanup { + rename chewonthis {} +} -result $bytecodekeys +test compile-18.28.2 {disassembler - tricky bit} -setup { + eval {proc chewonthis {} {}} +} -body { + dict keys [tcl::unsupported::getbytecode proc chewonthis] +} -cleanup { + rename chewonthis {} +} -result "$bytecodekeys initiallinenumber sourcefile" +test compile-18.28.3 {disassembler - tricky bit} -setup { + proc Proc {n a b} { + proc $n $a $b + } + Proc chewonthis {} {} +} -body { + dict keys [tcl::unsupported::getbytecode proc chewonthis] +} -cleanup { + rename Proc {} + rename chewonthis {} } -result $bytecodekeys +test compile-18.28.4 {disassembler - tricky bit} -setup { + proc Proc {n a b} { + tailcall proc $n $a $b + } + Proc chewonthis {} {} +} -body { + dict keys [tcl::unsupported::getbytecode proc chewonthis] +} -cleanup { + rename Proc {} + rename chewonthis {} +} -result "$bytecodekeys initiallinenumber sourcefile" test compile-18.29 {disassembler - basics} -returnCodes error -body { tcl::unsupported::getbytecode script } -match glob -result {wrong # args: should be "* script script"} @@ -807,7 +843,7 @@ test compile-18.35 {disassembler - basics} -setup { dict keys [tcl::unsupported::getbytecode method foo bar] } -cleanup { foo destroy -} -result $bytecodekeys +} -result "$bytecodekeys initiallinenumber sourcefile" test compile-18.36 {disassembler - basics} -returnCodes error -body { tcl::unsupported::getbytecode objmethod } -match glob -result {wrong # args: should be "* objmethod objectName methodName"} @@ -824,7 +860,7 @@ test compile-18.39 {disassembler - basics} -setup { dict keys [tcl::unsupported::getbytecode objmethod foo bar] } -cleanup { foo destroy -} -result $bytecodekeys +} -result "$bytecodekeys initiallinenumber sourcefile" test compile-19.0 {Bug 3614102: reset stack housekeeping} -body { # This will panic in a --enable-symbols=compile build, unless bug is fixed. -- cgit v0.12 From a03db6ab78e482f5bd0a3acbf350f81361ae4da4 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 18 Jan 2016 12:19:31 +0000 Subject: Make function TclDisassembleByteCodeObj() static, since it is only used in a single source file. --- generic/tclDisassemble.c | 14 ++++++++------ generic/tclInt.h | 2 -- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c index a60a58d..c85fe13 100644 --- a/generic/tclDisassemble.c +++ b/generic/tclDisassemble.c @@ -23,6 +23,8 @@ static Tcl_Obj * DisassembleByteCodeAsDicts(Tcl_Interp *interp, Tcl_Obj *objPtr); +static Tcl_Obj * DisassembleByteCodeObj(Tcl_Interp *interp, + Tcl_Obj *objPtr); static int FormatInstruction(ByteCode *codePtr, const unsigned char *pc, Tcl_Obj *bufferObj); static void GetLocationInformation(Tcl_Interp *interp, @@ -126,7 +128,7 @@ TclPrintByteCodeObj( Tcl_Interp *interp, /* Used only for getting location info. */ Tcl_Obj *objPtr) /* The bytecode object to disassemble. */ { - Tcl_Obj *bufPtr = TclDisassembleByteCodeObj(interp, objPtr); + Tcl_Obj *bufPtr = DisassembleByteCodeObj(interp, objPtr); fprintf(stdout, "\n%s", TclGetString(bufPtr)); Tcl_DecrRefCount(bufPtr); @@ -231,7 +233,7 @@ TclPrintSource( /* *---------------------------------------------------------------------- * - * TclDisassembleByteCodeObj -- + * DisassembleByteCodeObj -- * * Given an object which is of bytecode type, return a disassembled * version of the bytecode (in a new refcount 0 object). No guarantees @@ -240,8 +242,8 @@ TclPrintSource( *---------------------------------------------------------------------- */ -Tcl_Obj * -TclDisassembleByteCodeObj( +static Tcl_Obj * +DisassembleByteCodeObj( Tcl_Interp *interp, Tcl_Obj *objPtr) /* The bytecode object to disassemble. */ { @@ -368,7 +370,7 @@ TclDisassembleByteCodeObj( rangePtr->catchOffset); break; default: - Tcl_Panic("TclDisassembleByteCodeObj: bad ExceptionRange type %d", + Tcl_Panic("DisassembleByteCodeObj: bad ExceptionRange type %d", rangePtr->type); } } @@ -1486,7 +1488,7 @@ Tcl_DisassembleObjCmd( DisassembleByteCodeAsDicts(interp, codeObjPtr)); } else { Tcl_SetObjResult(interp, - TclDisassembleByteCodeObj(interp, codeObjPtr)); + DisassembleByteCodeObj(interp, codeObjPtr)); } return TCL_OK; } diff --git a/generic/tclInt.h b/generic/tclInt.h index 9a5b4bf..42c13dd 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -3152,8 +3152,6 @@ MODULE_SCOPE void TclFinalizeThreadStorage(void); MODULE_SCOPE Tcl_WideInt TclpGetWideClicks(void); MODULE_SCOPE double TclpWideClicksToNanoseconds(Tcl_WideInt clicks); #endif -MODULE_SCOPE Tcl_Obj * TclDisassembleByteCodeObj(Tcl_Interp *interp, - Tcl_Obj *objPtr); MODULE_SCOPE int TclZlibInit(Tcl_Interp *interp); MODULE_SCOPE void * TclpThreadCreateKey(void); MODULE_SCOPE void TclpThreadDeleteKey(void *keyPtr); -- cgit v0.12 From d35ea153489e5abcf15a7e2de5a2659e72c2373b Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 18 Jan 2016 14:32:41 +0000 Subject: Eliminate some usages of Tcl_GlobalEval() and Tcl_Eval(), which are deprecated functions. --- generic/tclTest.c | 12 ++++++------ generic/tclTestProcBodyObj.c | 2 +- generic/tclThreadTest.c | 6 +++--- generic/tclTrace.c | 3 ++- generic/tclZlib.c | 4 ++-- unix/dltest/pkge.c | 2 +- 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/generic/tclTest.c b/generic/tclTest.c index 600f5ec..284d80a 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -958,7 +958,7 @@ AsyncHandlerProc( listArgv[3] = NULL; cmd = Tcl_Merge(3, listArgv); if (interp != NULL) { - code = Tcl_Eval(interp, cmd); + code = Tcl_EvalEx(interp, cmd, -1, 0); } else { /* * this should not happen, but by definition of how async handlers are @@ -1241,7 +1241,7 @@ TestcmdtraceCmd( if (strcmp(argv[1], "tracetest") == 0) { Tcl_DStringInit(&buffer); cmdTrace = Tcl_CreateTrace(interp, 50000, CmdTraceProc, &buffer); - result = Tcl_Eval(interp, argv[2]); + result = Tcl_EvalEx(interp, argv[2], -1, 0); if (result == TCL_OK) { Tcl_ResetResult(interp); Tcl_AppendResult(interp, Tcl_DStringValue(&buffer), NULL); @@ -1257,13 +1257,13 @@ TestcmdtraceCmd( */ cmdTrace = Tcl_CreateTrace(interp, 50000, CmdTraceDeleteProc, NULL); - Tcl_Eval(interp, argv[2]); + Tcl_EvalEx(interp, argv[2], -1, 0); } else if (strcmp(argv[1], "leveltest") == 0) { Interp *iPtr = (Interp *) interp; Tcl_DStringInit(&buffer); cmdTrace = Tcl_CreateTrace(interp, iPtr->numLevels + 4, CmdTraceProc, &buffer); - result = Tcl_Eval(interp, argv[2]); + result = Tcl_EvalEx(interp, argv[2], -1, 0); if (result == TCL_OK) { Tcl_ResetResult(interp); Tcl_AppendResult(interp, Tcl_DStringValue(&buffer), NULL); @@ -1987,7 +1987,7 @@ EncodingToUtfProc( TclEncoding *encodingPtr; encodingPtr = (TclEncoding *) clientData; - Tcl_GlobalEval(encodingPtr->interp, encodingPtr->toUtfCmd); + Tcl_EvalEx(encodingPtr->interp,encodingPtr->toUtfCmd,-1,TCL_EVAL_GLOBAL); len = strlen(Tcl_GetStringResult(encodingPtr->interp)); if (len > dstLen) { @@ -2019,7 +2019,7 @@ EncodingFromUtfProc( TclEncoding *encodingPtr; encodingPtr = (TclEncoding *) clientData; - Tcl_GlobalEval(encodingPtr->interp, encodingPtr->fromUtfCmd); + Tcl_EvalEx(encodingPtr->interp, encodingPtr->fromUtfCmd,-1,TCL_EVAL_GLOBAL); len = strlen(Tcl_GetStringResult(encodingPtr->interp)); if (len > dstLen) { diff --git a/generic/tclTestProcBodyObj.c b/generic/tclTestProcBodyObj.c index 0d3617e..4d32c5a 100644 --- a/generic/tclTestProcBodyObj.c +++ b/generic/tclTestProcBodyObj.c @@ -143,7 +143,7 @@ RegisterCommand( if (cmdTablePtr->exportIt) { sprintf(buf, "namespace eval %s { namespace export %s }", namespace, cmdTablePtr->cmdName); - if (Tcl_Eval(interp, buf) != TCL_OK) { + if (Tcl_EvalEx(interp, buf, -1, 0) != TCL_OK) { return TCL_ERROR; } } diff --git a/generic/tclThreadTest.c b/generic/tclThreadTest.c index 02ee038..75f8a15 100644 --- a/generic/tclThreadTest.c +++ b/generic/tclThreadTest.c @@ -613,7 +613,7 @@ NewTestThread( */ Tcl_Preserve(tsdPtr->interp); - result = Tcl_Eval(tsdPtr->interp, threadEvalScript); + result = Tcl_EvalEx(tsdPtr->interp, threadEvalScript, -1, 0); if (result != TCL_OK) { ThreadErrorProc(tsdPtr->interp); } @@ -834,7 +834,7 @@ ThreadSend( if (threadId == Tcl_GetCurrentThread()) { Tcl_MutexUnlock(&threadMutex); - return Tcl_GlobalEval(interp, script); + return Tcl_EvalEx(interp, script,-1,TCL_EVAL_GLOBAL); } /* @@ -1029,7 +1029,7 @@ ThreadEventProc( Tcl_Preserve(interp); Tcl_ResetResult(interp); Tcl_CreateThreadExitHandler(ThreadFreeProc, threadEventPtr->script); - code = Tcl_GlobalEval(interp, threadEventPtr->script); + code = Tcl_EvalEx(interp, threadEventPtr->script,-1,TCL_EVAL_GLOBAL); Tcl_DeleteThreadExitHandler(ThreadFreeProc, threadEventPtr->script); if (code != TCL_OK) { errorCode = Tcl_GetVar(interp, "errorCode", TCL_GLOBAL_ONLY); diff --git a/generic/tclTrace.c b/generic/tclTrace.c index fe52d59..4e74c54 100644 --- a/generic/tclTrace.c +++ b/generic/tclTrace.c @@ -1889,7 +1889,8 @@ TraceExecutionProc( * interpreter. */ - traceCode = Tcl_Eval(interp, Tcl_DStringValue(&cmd)); + traceCode = Tcl_EvalEx(interp, Tcl_DStringValue(&cmd), + Tcl_DStringLength(&cmd), 0); tcmdPtr->flags &= ~TCL_TRACE_EXEC_IN_PROGRESS; /* diff --git a/generic/tclZlib.c b/generic/tclZlib.c index 44dd9e0..ba3e9cb 100644 --- a/generic/tclZlib.c +++ b/generic/tclZlib.c @@ -762,7 +762,7 @@ Tcl_ZlibStreamInit( */ if (interp != NULL) { - if (Tcl_Eval(interp, "::incr ::tcl::zlib::cmdcounter") != TCL_OK) { + if (Tcl_EvalEx(interp, "::incr ::tcl::zlib::cmdcounter", -1, 0) != TCL_OK) { goto error; } Tcl_DStringInit(&cmdname); @@ -3816,7 +3816,7 @@ TclZlibInit( * commands. */ - Tcl_Eval(interp, "namespace eval ::tcl::zlib {variable cmdcounter 0}"); + Tcl_EvalEx(interp, "namespace eval ::tcl::zlib {variable cmdcounter 0}", -1, 0); /* * Create the public scripted interface to this file's functionality. diff --git a/unix/dltest/pkge.c b/unix/dltest/pkge.c index d616352..395cd0e 100644 --- a/unix/dltest/pkge.c +++ b/unix/dltest/pkge.c @@ -50,5 +50,5 @@ Pkge_Init( if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { return TCL_ERROR; } - return Tcl_Eval(interp, script); + return Tcl_EvalEx(interp, script, -1, 0); } -- cgit v0.12 From 7dd65dcdd0d8e9013803356230cce9a9ac6dfef3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 18 Jan 2016 15:00:49 +0000 Subject: One more Tcl_GlobalEval() usage. --- generic/tclTest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclTest.c b/generic/tclTest.c index 284d80a..5468c56 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -4507,7 +4507,7 @@ TestfeventCmd( return TCL_ERROR; } if (interp2 != NULL) { - code = Tcl_GlobalEval(interp2, argv[2]); + code = Tcl_EvalEx(interp2, argv[2], -1, TCL_EVAL_GLOBAL); Tcl_SetObjResult(interp, Tcl_GetObjResult(interp2)); return code; } else { -- cgit v0.12 From 28d25fa6cf8d801e60d1d41099179e356ef8ecae Mon Sep 17 00:00:00 2001 From: Joe Mistachkin Date: Tue, 19 Jan 2016 17:48:25 +0000 Subject: Update comment with TIP number. --- generic/tclBasic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 0bb43cc..e5d7406 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -916,7 +916,7 @@ Tcl_CreateInterp(void) TclInitEmbeddedConfigurationInformation(interp); /* - * TIP #XXX: Declare the name of the script engine to be "Tcl". + * TIP #440: Declare the name of the script engine to be "Tcl". */ Tcl_SetVar2(interp, "tcl_platform", "engine", "Tcl", -- cgit v0.12 From 093b0618b6e6bef06c090aab243ad716995ba4b5 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 21 Jan 2016 13:11:15 +0000 Subject: Fix compiler warnings (discovered on latest clang/gcc6), suggested by Gustaf Neumann. All harmless, no change of functionality. --- generic/tclClock.c | 10 ++++++---- generic/tclExecute.c | 12 +++++++----- macosx/tclMacOSXBundle.c | 4 +--- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/generic/tclClock.c b/generic/tclClock.c index 32ba145..782c681 100644 --- a/generic/tclClock.c +++ b/generic/tclClock.c @@ -562,8 +562,9 @@ ClockGetjuliandayfromerayearmonthdayObjCmd ( || TclGetIntFromObj(interp, fieldPtr, &(fields.dayOfMonth)) != TCL_OK || TclGetIntFromObj(interp, objv[2], &changeover) != TCL_OK) { - if (fieldPtr == NULL) - Tcl_SetObjResult(interp, Tcl_NewStringObj("expected key(s) not found in dictionary", -1)); + if (fieldPtr == NULL) { + Tcl_SetObjResult(interp, Tcl_NewStringObj("expected key(s) not found in dictionary", -1)); + } return TCL_ERROR; } fields.era = era; @@ -655,8 +656,9 @@ ClockGetjuliandayfromerayearweekdayObjCmd ( |