summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2006-12-01 14:31:17 (GMT)
committerdgp <dgp@users.sourceforge.net>2006-12-01 14:31:17 (GMT)
commit84e12e85c42e0e68ff5aa6b331aa0d53962f7c5a (patch)
tree399de1866a806b933dcc90269909728680e3553d /generic
parent426b5e333ff956b1b4b7306157c877ccee9093c5 (diff)
downloadtcl-84e12e85c42e0e68ff5aa6b331aa0d53962f7c5a.zip
tcl-84e12e85c42e0e68ff5aa6b331aa0d53962f7c5a.tar.gz
tcl-84e12e85c42e0e68ff5aa6b331aa0d53962f7c5a.tar.bz2
TIP#298 IMPLEMENTATION
* generic/tcl.decls: Tcl_GetBignumAndClearObj -> Tcl_TakeBignumFromObj. * generic/tclObj.c: * generic/tclDecls.h: make genstubs * generic/tclStubInit.c: * generic/tclExecute.c: Update callers. * generic/tclMathOp.c:
Diffstat (limited to 'generic')
-rw-r--r--generic/tcl.decls4
-rw-r--r--generic/tclDecls.h16
-rw-r--r--generic/tclExecute.c94
-rw-r--r--generic/tclMathOp.c93
-rw-r--r--generic/tclObj.c17
-rw-r--r--generic/tclStubInit.c4
6 files changed, 50 insertions, 178 deletions
diff --git a/generic/tcl.decls b/generic/tcl.decls
index 40e548c..8ae593b 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -11,7 +11,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: tcl.decls,v 1.123 2006/11/15 20:08:42 dgp Exp $
+# RCS: @(#) $Id: tcl.decls,v 1.124 2006/12/01 14:31:18 dgp Exp $
library tcl
@@ -2005,7 +2005,7 @@ declare 558 generic {
int Tcl_GetBignumFromObj( Tcl_Interp* interp, Tcl_Obj* obj, mp_int* value )
}
declare 559 generic {
- int Tcl_GetBignumAndClearObj( Tcl_Interp* interp, Tcl_Obj* obj, mp_int* value )
+ int Tcl_TakeBignumFromObj( Tcl_Interp* interp, Tcl_Obj* obj, mp_int* value )
}
# TIP #208 ('chan' Command) jeffh
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index c05e029..7568dd1 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclDecls.h,v 1.126 2006/11/15 20:08:43 dgp Exp $
+ * RCS: @(#) $Id: tclDecls.h,v 1.127 2006/12/01 14:31:19 dgp Exp $
*/
#ifndef _TCLDECLS
@@ -3329,10 +3329,10 @@ EXTERN void Tcl_SetBignumObj (Tcl_Obj* obj, mp_int* value);
EXTERN int Tcl_GetBignumFromObj (Tcl_Interp* interp,
Tcl_Obj* obj, mp_int* value);
#endif
-#ifndef Tcl_GetBignumAndClearObj_TCL_DECLARED
-#define Tcl_GetBignumAndClearObj_TCL_DECLARED
+#ifndef Tcl_TakeBignumFromObj_TCL_DECLARED
+#define Tcl_TakeBignumFromObj_TCL_DECLARED
/* 559 */
-EXTERN int Tcl_GetBignumAndClearObj (Tcl_Interp* interp,
+EXTERN int Tcl_TakeBignumFromObj (Tcl_Interp* interp,
Tcl_Obj* obj, mp_int* value);
#endif
#ifndef Tcl_TruncateChannel_TCL_DECLARED
@@ -4054,7 +4054,7 @@ typedef struct TclStubs {
Tcl_Obj* (*tcl_DbNewBignumObj) (mp_int* value, CONST char* file, int line); /* 556 */
void (*tcl_SetBignumObj) (Tcl_Obj* obj, mp_int* value); /* 557 */
int (*tcl_GetBignumFromObj) (Tcl_Interp* interp, Tcl_Obj* obj, mp_int* value); /* 558 */
- int (*tcl_GetBignumAndClearObj) (Tcl_Interp* interp, Tcl_Obj* obj, mp_int* value); /* 559 */
+ int (*tcl_TakeBignumFromObj) (Tcl_Interp* interp, Tcl_Obj* obj, mp_int* value); /* 559 */
int (*tcl_TruncateChannel) (Tcl_Channel chan, Tcl_WideInt length); /* 560 */
Tcl_DriverTruncateProc * (*tcl_ChannelTruncateProc) (Tcl_ChannelType * chanTypePtr); /* 561 */
void (*tcl_SetChannelErrorInterp) (Tcl_Interp* interp, Tcl_Obj* msg); /* 562 */
@@ -6351,9 +6351,9 @@ extern TclStubs *tclStubsPtr;
#define Tcl_GetBignumFromObj \
(tclStubsPtr->tcl_GetBignumFromObj) /* 558 */
#endif
-#ifndef Tcl_GetBignumAndClearObj
-#define Tcl_GetBignumAndClearObj \
- (tclStubsPtr->tcl_GetBignumAndClearObj) /* 559 */
+#ifndef Tcl_TakeBignumFromObj
+#define Tcl_TakeBignumFromObj \
+ (tclStubsPtr->tcl_TakeBignumFromObj) /* 559 */
#endif
#ifndef Tcl_TruncateChannel
#define Tcl_TruncateChannel \
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index c8c94ac..0e3368d 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.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.
*
- * RCS: @(#) $Id: tclExecute.c,v 1.255 2006/12/01 06:06:01 das Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.256 2006/12/01 14:31:19 dgp Exp $
*/
#include "tclInt.h"
@@ -1115,7 +1115,7 @@ TclIncrObj(
}
#endif
- Tcl_GetBignumAndClearObj(interp, valuePtr, &value);
+ Tcl_TakeBignumFromObj(interp, valuePtr, &value);
Tcl_GetBignumFromObj(interp, incrPtr, &incr);
mp_add(&value, &incr, &value);
mp_clear(&incr);
@@ -3511,11 +3511,7 @@ TclExecuteByteCode(
l2 = (long) d2;
goto longCompare;
case TCL_NUMBER_BIG:
- if (Tcl_IsShared(value2Ptr)) {
- Tcl_GetBignumFromObj(NULL, value2Ptr, &big2);
- } else {
- Tcl_GetBignumAndClearObj(NULL, value2Ptr, &big2);
- }
+ Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
if (mp_cmp_d(&big2, 0) == MP_LT) {
compare = MP_GT;
} else {
@@ -3556,11 +3552,7 @@ TclExecuteByteCode(
w2 = (Tcl_WideInt) d2;
goto wideCompare;
case TCL_NUMBER_BIG:
- if (Tcl_IsShared(value2Ptr)) {
- Tcl_GetBignumFromObj(NULL, value2Ptr, &big2);
- } else {
- Tcl_GetBignumAndClearObj(NULL, value2Ptr, &big2);
- }
+ Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
if (mp_cmp_d(&big2, 0) == MP_LT) {
compare = MP_GT;
} else {
@@ -3621,11 +3613,7 @@ TclExecuteByteCode(
compare = (d1 > 0.0) ? MP_GT : MP_LT;
break;
}
- if (Tcl_IsShared(value2Ptr)) {
- Tcl_GetBignumFromObj(NULL, value2Ptr, &big2);
- } else {
- Tcl_GetBignumAndClearObj(NULL, value2Ptr, &big2);
- }
+ Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
if ((d1 < (double)LONG_MAX) && (d1 > (double)LONG_MIN)) {
if (mp_cmp_d(&big2, 0) == MP_LT) {
compare = MP_GT;
@@ -3647,11 +3635,7 @@ TclExecuteByteCode(
break;
case TCL_NUMBER_BIG:
- if (Tcl_IsShared(valuePtr)) {
- Tcl_GetBignumFromObj(NULL, valuePtr, &big1);
- } else {
- Tcl_GetBignumAndClearObj(NULL, valuePtr, &big1);
- }
+ Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
switch (type2) {
#ifndef NO_WIDE_TYPE
case TCL_NUMBER_WIDE:
@@ -3681,11 +3665,7 @@ TclExecuteByteCode(
Tcl_InitBignumFromDouble(NULL, d2, &big2);
goto bigCompare;
case TCL_NUMBER_BIG:
- if (Tcl_IsShared(value2Ptr)) {
- Tcl_GetBignumFromObj(NULL, value2Ptr, &big2);
- } else {
- Tcl_GetBignumAndClearObj(NULL, value2Ptr, &big2);
- }
+ Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
bigCompare:
compare = mp_cmp(&big1, &big2);
mp_clear(&big1);
@@ -3835,11 +3815,7 @@ TclExecuteByteCode(
#endif
{
mp_int big2;
- if (Tcl_IsShared(value2Ptr)) {
- Tcl_GetBignumFromObj(NULL, value2Ptr, &big2);
- } else {
- Tcl_GetBignumAndClearObj(NULL, value2Ptr, &big2);
- }
+ Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
/* TODO: internals intrusion */
if ((l1 > 0) ^ (big2.sign == MP_ZPOS)) {
@@ -3883,11 +3859,7 @@ TclExecuteByteCode(
}
{
mp_int big2;
- if (Tcl_IsShared(value2Ptr)) {
- Tcl_GetBignumFromObj(NULL, value2Ptr, &big2);
- } else {
- Tcl_GetBignumAndClearObj(NULL, value2Ptr, &big2);
- }
+ Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
/* TODO: internals intrusion */
if ((w1 > ((Tcl_WideInt) 0)) ^ (big2.sign == MP_ZPOS)) {
@@ -4087,11 +4059,7 @@ TclExecuteByteCode(
{
mp_int big, bigResult, bigRemainder;
- if (Tcl_IsShared(valuePtr)) {
- Tcl_GetBignumFromObj(NULL, valuePtr, &big);
- } else {
- Tcl_GetBignumAndClearObj(NULL, valuePtr, &big);
- }
+ Tcl_TakeBignumFromObj(NULL, valuePtr, &big);
mp_init(&bigResult);
if (*pc == INST_LSHIFT) {
@@ -4152,16 +4120,8 @@ TclExecuteByteCode(
mp_int *First, *Second;
int numPos;
- if (Tcl_IsShared(valuePtr)) {
- Tcl_GetBignumFromObj(NULL, valuePtr, &big1);
- } else {
- Tcl_GetBignumAndClearObj(NULL, valuePtr, &big1);
- }
- if (Tcl_IsShared(value2Ptr)) {
- Tcl_GetBignumFromObj(NULL, value2Ptr, &big2);
- } else {
- Tcl_GetBignumAndClearObj(NULL, value2Ptr, &big2);
- }
+ Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
+ Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
/*
* Count how many positive arguments we have. If only one of the
@@ -4766,11 +4726,7 @@ TclExecuteByteCode(
#endif
case TCL_NUMBER_BIG: {
mp_int big2;
- if (Tcl_IsShared(value2Ptr)) {
- Tcl_GetBignumFromObj(NULL, value2Ptr, &big2);
- } else {
- Tcl_GetBignumAndClearObj(NULL, value2Ptr, &big2);
- }
+ Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
negativeExponent = (mp_cmp_d(&big2, 0) == MP_LT);
mp_mod_2d(&big2, 1, &big2);
oddExponent = !mp_iszero(&big2);
@@ -4912,16 +4868,8 @@ TclExecuteByteCode(
{
mp_int big1, big2, bigResult, bigRemainder;
TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
- if (Tcl_IsShared(valuePtr)) {
- Tcl_GetBignumFromObj(NULL, valuePtr, &big1);
- } else {
- Tcl_GetBignumAndClearObj(NULL, valuePtr, &big1);
- }
- if (Tcl_IsShared(value2Ptr)) {
- Tcl_GetBignumFromObj(NULL, value2Ptr, &big2);
- } else {
- Tcl_GetBignumAndClearObj(NULL, value2Ptr, &big2);
- }
+ Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
+ Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
mp_init(&bigResult);
switch (*pc) {
case INST_ADD:
@@ -5030,11 +4978,7 @@ TclExecuteByteCode(
NEXT_INST_F(1, 0, 0);
}
#endif
- if (Tcl_IsShared(valuePtr)) {
- Tcl_GetBignumFromObj(NULL, valuePtr, &big);
- } else {
- Tcl_GetBignumAndClearObj(NULL, valuePtr, &big);
- }
+ Tcl_TakeBignumFromObj(NULL, valuePtr, &big);
/* ~a = - a - 1 */
mp_neg(&big, &big);
mp_sub_d(&big, 1, &big);
@@ -5119,11 +5063,7 @@ TclExecuteByteCode(
break;
#endif
case TCL_NUMBER_BIG:
- if (Tcl_IsShared(valuePtr)) {
- Tcl_GetBignumFromObj(NULL, valuePtr, &big);
- } else {
- Tcl_GetBignumAndClearObj(NULL, valuePtr, &big);
- }
+ Tcl_TakeBignumFromObj(NULL, valuePtr, &big);
}
mp_neg(&big, &big);
if (Tcl_IsShared(valuePtr)) {
diff --git a/generic/tclMathOp.c b/generic/tclMathOp.c
index 8836da5..1a1ebe9 100644
--- a/generic/tclMathOp.c
+++ b/generic/tclMathOp.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclMathOp.c,v 1.1 2006/11/25 17:18:10 dkf Exp $
+ * RCS: @(#) $Id: tclMathOp.c,v 1.2 2006/12/01 14:31:19 dgp Exp $
*/
#include "tclInt.h"
@@ -242,11 +242,7 @@ CombineIntFloat(
#endif
case TCL_NUMBER_BIG: {
mp_int big2;
- if (Tcl_IsShared(value2Ptr)) {
- Tcl_GetBignumFromObj(NULL, value2Ptr, &big2);
- } else {
- Tcl_GetBignumAndClearObj(NULL, value2Ptr, &big2);
- }
+ Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
negativeExponent = (mp_cmp_d(&big2, 0) == MP_LT);
mp_mod_2d(&big2, 1, &big2);
oddExponent = !mp_iszero(&big2);
@@ -375,16 +371,8 @@ CombineIntFloat(
overflow:
{
mp_int big1, big2, bigResult, bigRemainder;
- if (Tcl_IsShared(valuePtr)) {
- Tcl_GetBignumFromObj(NULL, valuePtr, &big1);
- } else {
- Tcl_GetBignumAndClearObj(NULL, valuePtr, &big1);
- }
- if (Tcl_IsShared(value2Ptr)) {
- Tcl_GetBignumFromObj(NULL, value2Ptr, &big2);
- } else {
- Tcl_GetBignumAndClearObj(NULL, value2Ptr, &big2);
- }
+ Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
+ Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
mp_init(&bigResult);
switch (opcode) {
case INST_ADD:
@@ -533,16 +521,9 @@ CombineIntOnly(
mp_int *First, *Second;
int numPos;
- if (Tcl_IsShared(valuePtr)) {
- Tcl_GetBignumFromObj(NULL, valuePtr, &big1);
- } else {
- Tcl_GetBignumAndClearObj(NULL, valuePtr, &big1);
- }
- if (Tcl_IsShared(value2Ptr)) {
- Tcl_GetBignumFromObj(NULL, value2Ptr, &big2);
- } else {
- Tcl_GetBignumAndClearObj(NULL, value2Ptr, &big2);
- }
+
+ Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
+ Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
/*
* Count how many positive arguments we have. If only one of the
@@ -867,11 +848,7 @@ CompareNumbers(
l2 = (long) d2;
goto longCompare;
case TCL_NUMBER_BIG:
- if (Tcl_IsShared(numObj2)) {
- Tcl_GetBignumFromObj(NULL, numObj2, &big2);
- } else {
- Tcl_GetBignumAndClearObj(NULL, numObj2, &big2);
- }
+ Tcl_TakeBignumFromObj(NULL, numObj2, &big2);
if (mp_cmp_d(&big2, 0) == MP_LT) {
*resultPtr = MP_GT;
} else {
@@ -910,11 +887,7 @@ CompareNumbers(
w2 = (Tcl_WideInt) d2;
goto wideCompare;
case TCL_NUMBER_BIG:
- if (Tcl_IsShared(numObj2)) {
- Tcl_GetBignumFromObj(NULL, numObj2, &big2);
- } else {
- Tcl_GetBignumAndClearObj(NULL, numObj2, &big2);
- }
+ Tcl_TakeBignumFromObj(NULL, numObj2, &big2);
if (mp_cmp_d(&big2, 0) == MP_LT) {
*resultPtr = MP_GT;
} else {
@@ -973,11 +946,7 @@ CompareNumbers(
*resultPtr = (d1 > 0.0) ? MP_GT : MP_LT;
return TCL_OK;
}
- if (Tcl_IsShared(numObj2)) {
- Tcl_GetBignumFromObj(NULL, numObj2, &big2);
- } else {
- Tcl_GetBignumAndClearObj(NULL, numObj2, &big2);
- }
+ Tcl_TakeBignumFromObj(NULL, numObj2, &big2);
if ((d1 < (double)LONG_MAX) && (d1 > (double)LONG_MIN)) {
if (mp_cmp_d(&big2, 0) == MP_LT) {
*resultPtr = MP_GT;
@@ -999,11 +968,7 @@ CompareNumbers(
return TCL_OK;
case TCL_NUMBER_BIG:
- if (Tcl_IsShared(numObj1)) {
- Tcl_GetBignumFromObj(NULL, numObj1, &big1);
- } else {
- Tcl_GetBignumAndClearObj(NULL, numObj1, &big1);
- }
+ Tcl_TakeBignumFromObj(NULL, numObj1, &big1);
switch (type2) {
#ifndef NO_WIDE_TYPE
case TCL_NUMBER_WIDE:
@@ -1033,11 +998,7 @@ CompareNumbers(
Tcl_InitBignumFromDouble(NULL, d2, &big2);
goto bigCompare;
case TCL_NUMBER_BIG:
- if (Tcl_IsShared(numObj2)) {
- Tcl_GetBignumFromObj(NULL, numObj2, &big2);
- } else {
- Tcl_GetBignumAndClearObj(NULL, numObj2, &big2);
- }
+ Tcl_TakeBignumFromObj(NULL, numObj2, &big2);
goto bigCompare;
}
}
@@ -1122,11 +1083,7 @@ TclInvertOpCmd(
default: {
mp_int big;
- if (Tcl_IsShared(objv[1])) {
- Tcl_GetBignumFromObj(NULL, objv[1], &big);
- } else {
- Tcl_GetBignumAndClearObj(NULL, objv[1], &big);
- }
+ Tcl_TakeBignumFromObj(NULL, objv[1], &big);
/* ~a = - a - 1 */
mp_neg(&big, &big);
mp_sub_d(&big, 1, &big);
@@ -1846,11 +1803,7 @@ TclLshiftOpCmd(
{
mp_int big, bigResult;
- if (Tcl_IsShared(objv[1])) {
- Tcl_GetBignumFromObj(NULL, objv[1], &big);
- } else {
- Tcl_GetBignumAndClearObj(NULL, objv[1], &big);
- }
+ Tcl_TakeBignumFromObj(NULL, objv[1], &big);
mp_init(&bigResult);
mp_mul_2d(&big, shift, &bigResult);
@@ -2024,11 +1977,7 @@ TclRshiftOpCmd(
{
mp_int big, bigResult, bigRemainder;
- if (Tcl_IsShared(objv[1])) {
- Tcl_GetBignumFromObj(NULL, objv[1], &big);
- } else {
- Tcl_GetBignumAndClearObj(NULL, objv[1], &big);
- }
+ Tcl_TakeBignumFromObj(NULL, objv[1], &big);
mp_init(&bigResult);
mp_init(&bigRemainder);
@@ -2173,11 +2122,7 @@ TclModOpCmd(
#endif
{
mp_int big2;
- if (Tcl_IsShared(objv[2])) {
- Tcl_GetBignumFromObj(NULL, objv[2], &big2);
- } else {
- Tcl_GetBignumAndClearObj(NULL, objv[2], &big2);
- }
+ Tcl_TakeBignumFromObj(NULL, objv[2], &big2);
/* TODO: internals intrusion */
if ((l1 > 0) ^ (big2.sign == MP_ZPOS)) {
@@ -2216,11 +2161,7 @@ TclModOpCmd(
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(wRemainder));
} else {
mp_int big2;
- if (Tcl_IsShared(objv[2])) {
- Tcl_GetBignumFromObj(NULL, objv[2], &big2);
- } else {
- Tcl_GetBignumAndClearObj(NULL, objv[2], &big2);
- }
+ Tcl_TakeBignumFromObj(NULL, objv[2], &big2);
/* TODO: internals intrusion */
if ((w1 > ((Tcl_WideInt) 0)) ^ (big2.sign == MP_ZPOS)) {
diff --git a/generic/tclObj.c b/generic/tclObj.c
index 7aac447..58a964a 100644
--- a/generic/tclObj.c
+++ b/generic/tclObj.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.
*
- * RCS: @(#) $Id: tclObj.c,v 1.115 2006/11/15 20:08:45 dgp Exp $
+ * RCS: @(#) $Id: tclObj.c,v 1.116 2006/12/01 14:31:19 dgp Exp $
*/
#include "tclInt.h"
@@ -2744,12 +2744,6 @@ Tcl_DbNewBignumObj(
*----------------------------------------------------------------------
*/
-/*
- * TODO: Consider a smarter Tcl_GetBignumAndClearObj() that doesn't
- * require caller to check for a shared Tcl_Obj, but falls back to
- * Tcl_GetBignumFromObj() when sharing is an issue.
- */
-
static int
GetBignumFromObj(
Tcl_Interp *interp, /* Tcl interpreter for error reporting */
@@ -2759,14 +2753,11 @@ GetBignumFromObj(
{
do {
if (objPtr->typePtr == &tclBignumType) {
- if (copy) {
+ if (copy || Tcl_IsShared(objPtr)) {
mp_int temp;
UNPACK_BIGNUM(objPtr, temp);
mp_init_copy(bignumValue, &temp);
} else {
- if (Tcl_IsShared(objPtr)) {
- Tcl_Panic("Tcl_GetBignumAndClearObj called on shared Tcl_Obj");
- }
UNPACK_BIGNUM(objPtr, *bignumValue);
objPtr->internalRep.ptrAndLongRep.ptr = NULL;
objPtr->internalRep.ptrAndLongRep.value = 0;
@@ -2841,7 +2832,7 @@ Tcl_GetBignumFromObj(
/*
*----------------------------------------------------------------------
*
- * Tcl_GetBignumAndClearObj --
+ * Tcl_TakeBignumFromObj --
*
* This function retrieves a 'bignum' value from a Tcl object, converting
* the object if necessary.
@@ -2865,7 +2856,7 @@ Tcl_GetBignumFromObj(
*/
int
-Tcl_GetBignumAndClearObj(
+Tcl_TakeBignumFromObj(
Tcl_Interp *interp, /* Tcl interpreter for error reporting */
Tcl_Obj *objPtr, /* Object to read */
mp_int *bignumValue) /* Returned bignum value. */
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index ff829be..f06006d 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclStubInit.c,v 1.137 2006/11/15 20:08:45 dgp Exp $
+ * RCS: @(#) $Id: tclStubInit.c,v 1.138 2006/12/01 14:31:20 dgp Exp $
*/
#include "tclInt.h"
@@ -1061,7 +1061,7 @@ TclStubs tclStubs = {
Tcl_DbNewBignumObj, /* 556 */
Tcl_SetBignumObj, /* 557 */
Tcl_GetBignumFromObj, /* 558 */
- Tcl_GetBignumAndClearObj, /* 559 */
+ Tcl_TakeBignumFromObj, /* 559 */
Tcl_TruncateChannel, /* 560 */
Tcl_ChannelTruncateProc, /* 561 */
Tcl_SetChannelErrorInterp, /* 562 */