summaryrefslogtreecommitdiffstats
path: root/generic/tclBasic.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-05-29 22:48:50 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-05-29 22:48:50 (GMT)
commit7a1b66b00db2dcc63f4743c36b4e8e6edcfc4211 (patch)
tree770e7df5a9383984bb53ff5db2ae72fea43a3f7d /generic/tclBasic.c
parent4e994192a1fe60802c91b8ffee51720f54093bac (diff)
downloadtcl-7a1b66b00db2dcc63f4743c36b4e8e6edcfc4211.zip
tcl-7a1b66b00db2dcc63f4743c36b4e8e6edcfc4211.tar.gz
tcl-7a1b66b00db2dcc63f4743c36b4e8e6edcfc4211.tar.bz2
Update some libtommath functions to the latest trunk versions. Small step forward in the upgrade to (upcoming) libtommath 1.2.
Advantage: simplify Tcl code accessing those functions.
Diffstat (limited to 'generic/tclBasic.c')
-rw-r--r--generic/tclBasic.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index b148333..3b9fca9 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -1920,7 +1920,7 @@ Tcl_CreateCommand(
/* An existing command conflicts. Try to delete it.. */
cmdPtr = Tcl_GetHashValue(hPtr);
-
+
/*
* Be careful to preserve
* any existing import links so we can restore them down below. That
@@ -2107,7 +2107,7 @@ Tcl_CreateObjCommand(
cmdPtr = Tcl_GetHashValue(hPtr);
/*
- * [***] This is wrong. See Tcl Bug a16752c252.
+ * [***] This is wrong. See Tcl Bug a16752c252.
* However, this buggy behavior is kept under particular
* circumstances to accommodate deployed binaries of the
* "tclcompiler" program. http://sourceforge.net/projects/tclpro/
@@ -5188,7 +5188,7 @@ TclEvalObjEx(
TclStackAlloc(interp, sizeof(CmdFrame));
eoFramePtr->type = TCL_LOCATION_EVAL_LIST;
- eoFramePtr->level = (iPtr->cmdFramePtr == NULL? 1
+ eoFramePtr->level = (iPtr->cmdFramePtr == NULL? 1
: iPtr->cmdFramePtr->level + 1);
eoFramePtr->framePtr = iPtr->framePtr;
eoFramePtr->nextPtr = iPtr->cmdFramePtr;
@@ -6346,7 +6346,7 @@ ExprIsqrtFunc(
if (Tcl_GetBignumFromObj(interp, objv[1], &big) != TCL_OK) {
return TCL_ERROR;
}
- if (SIGN(&big) == MP_NEG) {
+ if (mp_isneg(&big)) {
mp_clear(&big);
goto negarg;
}
@@ -6617,8 +6617,7 @@ ExprAbsFunc(
#endif
if (type == TCL_NUMBER_BIG) {
- /* TODO: const correctness ? */
- if (mp_cmp_d((mp_int *) ptr, 0) == MP_LT) {
+ if (mp_cmp_d(ptr, 0) == MP_LT) {
Tcl_GetBignumFromObj(NULL, objv[1], &big);
tooLarge:
mp_neg(&big, &big);
@@ -6768,7 +6767,7 @@ ExprIntFunc(
mp_int big;
Tcl_GetBignumFromObj(NULL, objPtr, &big);
- mp_mod_2d(&big, (int) CHAR_BIT * sizeof(long), &big);
+ mp_mod_2d(&big, CHAR_BIT * sizeof(long), &big);
objPtr = Tcl_NewBignumObj(&big);
Tcl_IncrRefCount(objPtr);
TclGetLongFromObj(NULL, objPtr, &iResult);
@@ -6800,7 +6799,7 @@ ExprWideFunc(
mp_int big;
Tcl_GetBignumFromObj(NULL, objPtr, &big);
- mp_mod_2d(&big, (int) CHAR_BIT * sizeof(Tcl_WideInt), &big);
+ mp_mod_2d(&big, CHAR_BIT * sizeof(Tcl_WideInt), &big);
objPtr = Tcl_NewBignumObj(&big);
Tcl_IncrRefCount(objPtr);
Tcl_GetWideIntFromObj(NULL, objPtr, &wResult);
@@ -7007,7 +7006,7 @@ ExprSrandFunc(
return TCL_ERROR;
}
- mp_mod_2d(&big, (int) CHAR_BIT * sizeof(long), &big);
+ mp_mod_2d(&big, CHAR_BIT * sizeof(long), &big);
objPtr = Tcl_NewBignumObj(&big);
Tcl_IncrRefCount(objPtr);
TclGetLongFromObj(NULL, objPtr, &i);