diff options
author | Kevin B Kenny <kennykb@acm.org> | 2005-12-27 20:14:08 (GMT) |
---|---|---|
committer | Kevin B Kenny <kennykb@acm.org> | 2005-12-27 20:14:08 (GMT) |
commit | 872e88fa4a341e40d152513ef5eca12fc1796fc4 (patch) | |
tree | 6ac1b304e947d621734475db91e19db47d68c048 /generic | |
parent | bfcaf58680879434db61618ae08073a85cf3379a (diff) | |
download | tcl-872e88fa4a341e40d152513ef5eca12fc1796fc4.zip tcl-872e88fa4a341e40d152513ef5eca12fc1796fc4.tar.gz tcl-872e88fa4a341e40d152513ef5eca12fc1796fc4.tar.bz2 |
Export Tcl_InitBignumFromDouble
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tcl.decls | 9 | ||||
-rw-r--r-- | generic/tclBasic.c | 8 | ||||
-rw-r--r-- | generic/tclDecls.h | 14 | ||||
-rw-r--r-- | generic/tclExecute.c | 6 | ||||
-rw-r--r-- | generic/tclInt.h | 4 | ||||
-rwxr-xr-x | generic/tclStrToD.c | 10 | ||||
-rw-r--r-- | generic/tclStubInit.c | 3 |
7 files changed, 36 insertions, 18 deletions
diff --git a/generic/tcl.decls b/generic/tcl.decls index 3549ccc..410538d 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.117 2005/12/27 17:39:01 kennykb Exp $ +# RCS: @(#) $Id: tcl.decls,v 1.118 2005/12/27 20:14:08 kennykb Exp $ library tcl @@ -2030,6 +2030,13 @@ declare 564 generic { declare 565 generic { void Tcl_GetChannelError (Tcl_Channel chan, Tcl_Obj** msg) } + +# Additional conversion functions for bignum support + +declare 566 generic { + int Tcl_InitBignumFromDouble(Tcl_Interp* interp, double initval, + mp_int *toInit) +} ############################################################################## diff --git a/generic/tclBasic.c b/generic/tclBasic.c index c219502..19acbf5 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclBasic.c,v 1.185 2005/12/14 02:09:19 das Exp $ + * RCS: @(#) $Id: tclBasic.c,v 1.186 2005/12/27 20:14:08 kennykb Exp $ */ #include "tclInt.h" @@ -4316,7 +4316,7 @@ Tcl_ExprLongObj( d = *((CONST double *)internalPtr); Tcl_DecrRefCount(resultPtr); - if (TclInitBignumFromDouble(interp, d, &big) != TCL_OK) { + if (Tcl_InitBignumFromDouble(interp, d, &big) != TCL_OK) { return TCL_ERROR; } resultPtr = Tcl_NewBignumObj(&big); @@ -5347,7 +5347,7 @@ ExprEntierFunc( if ((d >= (double)LONG_MAX) || (d <= (double)LONG_MIN)) { mp_int big; - if (TclInitBignumFromDouble(interp, d, &big) != TCL_OK) { + if (Tcl_InitBignumFromDouble(interp, d, &big) != TCL_OK) { /* Infinity */ return TCL_ERROR; } @@ -5651,7 +5651,7 @@ ExprRoundFunc( if ((intPart >= (double)max) || (intPart <= (double)min)) { mp_int big; - if (TclInitBignumFromDouble(interp, intPart, &big) != TCL_OK) { + if (Tcl_InitBignumFromDouble(interp, intPart, &big) != TCL_OK) { /* Infinity */ return TCL_ERROR; } diff --git a/generic/tclDecls.h b/generic/tclDecls.h index a4a8ec6..8802438 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.119 2005/12/27 17:39:01 kennykb Exp $ + * RCS: @(#) $Id: tclDecls.h,v 1.120 2005/12/27 20:14:08 kennykb Exp $ */ #ifndef _TCLDECLS @@ -3527,6 +3527,13 @@ EXTERN void Tcl_SetChannelError _ANSI_ARGS_((Tcl_Channel chan, EXTERN void Tcl_GetChannelError _ANSI_ARGS_((Tcl_Channel chan, Tcl_Obj** msg)); #endif +#ifndef Tcl_InitBignumFromDouble_TCL_DECLARED +#define Tcl_InitBignumFromDouble_TCL_DECLARED +/* 566 */ +EXTERN int Tcl_InitBignumFromDouble _ANSI_ARGS_(( + Tcl_Interp* interp, double initval, + mp_int * toInit)); +#endif typedef struct TclStubHooks { struct TclPlatStubs *tclPlatStubs; @@ -4134,6 +4141,7 @@ typedef struct TclStubs { void (*tcl_GetChannelErrorInterp) _ANSI_ARGS_((Tcl_Interp* interp, Tcl_Obj** msg)); /* 563 */ void (*tcl_SetChannelError) _ANSI_ARGS_((Tcl_Channel chan, Tcl_Obj* msg)); /* 564 */ void (*tcl_GetChannelError) _ANSI_ARGS_((Tcl_Channel chan, Tcl_Obj** msg)); /* 565 */ + int (*tcl_InitBignumFromDouble) _ANSI_ARGS_((Tcl_Interp* interp, double initval, mp_int * toInit)); /* 566 */ } TclStubs; #ifdef __cplusplus @@ -6438,6 +6446,10 @@ extern TclStubs *tclStubsPtr; #define Tcl_GetChannelError \ (tclStubsPtr->tcl_GetChannelError) /* 565 */ #endif +#ifndef Tcl_InitBignumFromDouble +#define Tcl_InitBignumFromDouble \ + (tclStubsPtr->tcl_InitBignumFromDouble) /* 566 */ +#endif #endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */ diff --git a/generic/tclExecute.c b/generic/tclExecute.c index f4cc090..6fb49ec 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.224 2005/12/18 22:41:19 dkf Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.225 2005/12/27 20:14:08 kennykb Exp $ */ #include "tclInt.h" @@ -3643,7 +3643,7 @@ TclExecuteByteCode( mp_clear(&big2); goto doubleCompare; } - TclInitBignumFromDouble(NULL, d1, &big1); + Tcl_InitBignumFromDouble(NULL, d1, &big1); goto bigCompare; } break; @@ -3680,7 +3680,7 @@ TclExecuteByteCode( mp_clear(&big1); goto doubleCompare; } - TclInitBignumFromDouble(NULL, d2, &big2); + Tcl_InitBignumFromDouble(NULL, d2, &big2); goto bigCompare; case TCL_NUMBER_BIG: if (Tcl_IsShared(value2Ptr)) { diff --git a/generic/tclInt.h b/generic/tclInt.h index 4a0590a..895eafd 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -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: tclInt.h,v 1.263 2005/12/19 19:03:17 dgp Exp $ + * RCS: @(#) $Id: tclInt.h,v 1.264 2005/12/27 20:14:09 kennykb Exp $ */ #ifndef _TCLINT @@ -2082,8 +2082,6 @@ MODULE_SCOPE int TclIncrObj(Tcl_Interp *interp, Tcl_Obj *valuePtr, MODULE_SCOPE Tcl_Obj * TclIncrObjVar2(Tcl_Interp *interp, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, Tcl_Obj *incrPtr, int flags); MODULE_SCOPE void TclInitAlloc(void); -MODULE_SCOPE int TclInitBignumFromDouble(Tcl_Interp *interp, double d, - mp_int *b); MODULE_SCOPE void TclInitDbCkalloc(void); MODULE_SCOPE void TclInitDoubleConversion(void); MODULE_SCOPE void TclInitEmbeddedConfigurationInformation( diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c index 9fe25d0..7122d33 100755 --- a/generic/tclStrToD.c +++ b/generic/tclStrToD.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclStrToD.c,v 1.18 2005/12/19 19:03:17 dgp Exp $ + * RCS: @(#) $Id: tclStrToD.c,v 1.19 2005/12/27 20:14:09 kennykb Exp $ * *---------------------------------------------------------------------- */ @@ -2214,7 +2214,7 @@ TclFinalizeDoubleConversion() /* *---------------------------------------------------------------------- * - * TclInitBignumFromDouble -- + * Tcl_InitBignumFromDouble -- * * Extracts the integer part of a double and converts it to an arbitrary * precision integer. @@ -2223,14 +2223,14 @@ TclFinalizeDoubleConversion() * None. * * Side effects: - * Initializes the bignum supplied, and stores the converted number * in - * it. + * Initializes the bignum supplied, and stores the converted number + * in it. * *---------------------------------------------------------------------- */ int -TclInitBignumFromDouble( +Tcl_InitBignumFromDouble( Tcl_Interp *interp, /* For error message */ double d, /* Number to convert */ mp_int *b) /* Place to store the result */ diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 8274d1a..88f59e0 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.126 2005/12/27 17:39:02 kennykb Exp $ + * RCS: @(#) $Id: tclStubInit.c,v 1.127 2005/12/27 20:14:09 kennykb Exp $ */ #include "tclInt.h" @@ -1062,6 +1062,7 @@ TclStubs tclStubs = { Tcl_GetChannelErrorInterp, /* 563 */ Tcl_SetChannelError, /* 564 */ Tcl_GetChannelError, /* 565 */ + Tcl_InitBignumFromDouble, /* 566 */ }; /* !END!: Do not edit above this line. */ |