summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/tcl.decls2
-rw-r--r--generic/tclDecls.h7
-rw-r--r--generic/tclExecute.c6
-rw-r--r--generic/tclStubInit.c2
-rw-r--r--generic/tclTomMath.h17
-rw-r--r--generic/tclTomMathDecls.h5
-rw-r--r--generic/tclUtf.c4
-rw-r--r--generic/tclUtil.c4
8 files changed, 20 insertions, 27 deletions
diff --git a/generic/tcl.decls b/generic/tcl.decls
index ca47f11..3af01fc 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -864,7 +864,7 @@ declare 244 {nostub {Don't use this function in a stub-enabled extension}} {
void Tcl_StaticPackage(Tcl_Interp *interp, const char *pkgName,
Tcl_PackageInitProc *initProc, Tcl_PackageInitProc *safeInitProc)
}
-declare 245 {
+declare 245 {deprecated {No longer in use, changed to macro}} {
int Tcl_StringMatch(const char *str, const char *pattern)
}
declare 246 {deprecated {}} {
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index 7a8ad87..394be56 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -754,7 +754,8 @@ EXTERN void Tcl_StaticPackage(Tcl_Interp *interp,
Tcl_PackageInitProc *initProc,
Tcl_PackageInitProc *safeInitProc);
/* 245 */
-EXTERN int Tcl_StringMatch(const char *str, const char *pattern);
+TCL_DEPRECATED("No longer in use, changed to macro")
+int Tcl_StringMatch(const char *str, const char *pattern);
/* 246 */
TCL_DEPRECATED("")
int Tcl_TellOld(Tcl_Channel chan);
@@ -2206,7 +2207,7 @@ typedef struct TclStubs {
int (*tcl_SplitList) (Tcl_Interp *interp, const char *listStr, int *argcPtr, const char ***argvPtr); /* 242 */
void (*tcl_SplitPath) (const char *path, int *argcPtr, const char ***argvPtr); /* 243 */
TCL_DEPRECATED_API("Don't use this function in a stub-enabled extension") void (*tcl_StaticPackage) (Tcl_Interp *interp, const char *pkgName, Tcl_PackageInitProc *initProc, Tcl_PackageInitProc *safeInitProc); /* 244 */
- int (*tcl_StringMatch) (const char *str, const char *pattern); /* 245 */
+ TCL_DEPRECATED_API("No longer in use, changed to macro") int (*tcl_StringMatch) (const char *str, const char *pattern); /* 245 */
TCL_DEPRECATED_API("") int (*tcl_TellOld) (Tcl_Channel chan); /* 246 */
TCL_DEPRECATED_API("No longer in use, changed to macro") int (*tcl_TraceVar) (Tcl_Interp *interp, const char *varName, int flags, Tcl_VarTraceProc *proc, ClientData clientData); /* 247 */
int (*tcl_TraceVar2) (Tcl_Interp *interp, const char *part1, const char *part2, int flags, Tcl_VarTraceProc *proc, ClientData clientData); /* 248 */
@@ -4136,6 +4137,8 @@ extern const TclStubs *tclStubsPtr;
#define Tcl_GetUnicode(objPtr) Tcl_GetUnicodeFromObj((objPtr), NULL)
#undef Tcl_BackgroundError
#define Tcl_BackgroundError(interp) Tcl_BackgroundException((interp), TCL_ERROR)
+#undef Tcl_StringMatch
+#define Tcl_StringMatch(str, pattern) Tcl_StringCaseMatch((str), (pattern), 0)
#if TCL_UTF_MAX == 3
# undef Tcl_GetUnicodeFromObj
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 903e8d7..680bdd0 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -8400,7 +8400,11 @@ ExecuteExtendedBinaryMathOp(
overflowExpon:
Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
- if (big2.used > 1) {
+ if ((big2.used > 1)
+#if DIGIT_BIT > 28
+ || ((big2.used == 1) && (big2.dp[0] >= (1<<28)))
+#endif
+ ) {
mp_clear(&big2);
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"exponent too large", -1));
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index 34619c2..4fc79e4 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -468,6 +468,8 @@ static int utf16Ncasecmp(const unsigned short *ucs, const unsigned short *uct, u
# define Tcl_SetPanicProc 0
# define Tcl_FindExecutable 0
# define TclOldFreeObj 0
+# undef Tcl_StringMatch
+# define Tcl_StringMatch 0
# define TclBN_reverse 0
# define TclBN_fast_s_mp_mul_digs 0
# define TclBN_fast_s_mp_sqr 0
diff --git a/generic/tclTomMath.h b/generic/tclTomMath.h
index fbf0d35..3f23fd6 100644
--- a/generic/tclTomMath.h
+++ b/generic/tclTomMath.h
@@ -25,7 +25,7 @@ extern "C" {
#endif
/* MS Visual C++ doesn't have a 128bit type for words, so fall back to 32bit MPI's (where words are 64bit) */
-#if defined(_MSC_VER) || defined(__LLP64__) || defined(__e2k__) || defined(__LCC__)
+#if defined(_WIN32) || defined(__LLP64__) || defined(__e2k__) || defined(__LCC__)
# define MP_32BIT
#endif
@@ -110,9 +110,6 @@ typedef unsigned long long mp_word;
/* otherwise the bits per digit is calculated automatically from the size of a mp_digit */
#ifndef DIGIT_BIT
# define DIGIT_BIT (((CHAR_BIT * MP_SIZEOF_MP_DIGIT) - 1)) /* bits per digit */
-typedef unsigned long mp_min_u32;
-#else
-typedef mp_digit mp_min_u32;
#endif
#define MP_DIGIT_BIT DIGIT_BIT
@@ -142,14 +139,6 @@ typedef mp_digit mp_min_u32;
typedef int mp_err;
-/* you'll have to tune these... */
-#if defined(BUILD_tcl) || !defined(_WIN32)
-MODULE_SCOPE int KARATSUBA_MUL_CUTOFF,
- KARATSUBA_SQR_CUTOFF,
- TOOM_MUL_CUTOFF,
- TOOM_SQR_CUTOFF;
-#endif
-
/* define this to use lower memory usage routines (exptmods mostly) */
/* #define MP_LOW_MEM */
@@ -229,8 +218,8 @@ int mp_init_size(mp_int *a, int size);
/* ---> Basic Manipulations <--- */
#define mp_iszero(a) (((a)->used == 0) ? MP_YES : MP_NO)
-#define mp_iseven(a) ((((a)->used == 0) || (((a)->dp[0] & 1u) == 0u)) ? MP_YES : MP_NO)
-#define mp_isodd(a) ((((a)->used > 0) && (((a)->dp[0] & 1u) == 1u)) ? MP_YES : MP_NO)
+#define mp_iseven(a) (!mp_get_bit((a),0))
+#define mp_isodd(a) mp_get_bit((a),0)
#define mp_isneg(a) (((a)->sign != MP_ZPOS) ? MP_YES : MP_NO)
/* set to zero */
diff --git a/generic/tclTomMathDecls.h b/generic/tclTomMathDecls.h
index cb99df7..52ab26f 100644
--- a/generic/tclTomMathDecls.h
+++ b/generic/tclTomMathDecls.h
@@ -39,11 +39,6 @@
/* Rename the global symbols in libtommath to avoid linkage conflicts */
-#define KARATSUBA_MUL_CUTOFF TclBNKaratsubaMulCutoff
-#define KARATSUBA_SQR_CUTOFF TclBNKaratsubaSqrCutoff
-#define TOOM_MUL_CUTOFF TclBNToomMulCutoff
-#define TOOM_SQR_CUTOFF TclBNToomSqrCutoff
-
#define bn_reverse TclBN_reverse
#define fast_s_mp_mul_digs TclBN_fast_s_mp_mul_digs
#define fast_s_mp_sqr TclBN_fast_s_mp_sqr
diff --git a/generic/tclUtf.c b/generic/tclUtf.c
index c446a80..56b715f 100644
--- a/generic/tclUtf.c
+++ b/generic/tclUtf.c
@@ -67,9 +67,7 @@ static const unsigned char totalBytes[256] = {
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
- 4,4,4,4,4,4,4,4,
- 1,1,1,1,1,1,1,1
+ 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,1,1,1,1,1,1,1,1,1,1,1
};
/*
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index e432560..f4b1ab1 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -2186,6 +2186,7 @@ Tcl_ConcatObj(
return resPtr;
}
+#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
/*
*----------------------------------------------------------------------
*
@@ -2204,6 +2205,7 @@ Tcl_ConcatObj(
*----------------------------------------------------------------------
*/
+#undef Tcl_StringMatch
int
Tcl_StringMatch(
const char *str, /* String. */
@@ -2212,7 +2214,7 @@ Tcl_StringMatch(
{
return Tcl_StringCaseMatch(str, pattern, 0);
}
-
+#endif /* TCL_NO_DEPRECATED */
/*
*----------------------------------------------------------------------
*