diff options
Diffstat (limited to 'generic/tclTomMathInterface.c')
-rw-r--r-- | generic/tclTomMathInterface.c | 81 |
1 files changed, 3 insertions, 78 deletions
diff --git a/generic/tclTomMathInterface.c b/generic/tclTomMathInterface.c index 78888a7..9e7bf4b 100644 --- a/generic/tclTomMathInterface.c +++ b/generic/tclTomMathInterface.c @@ -89,81 +89,6 @@ TclBN_revision(void) { return TCLTOMMATH_REVISION; } -#if 0 - -/* - *---------------------------------------------------------------------- - * - * TclBNAlloc -- - * - * Allocate memory for libtommath. - * - * Results: - * Returns a pointer to the allocated block. - * - * This procedure is a wrapper around Tcl_Alloc, needed because of a - * mismatched type signature between Tcl_Alloc and malloc. - * - *---------------------------------------------------------------------- - */ - -extern void * -TclBNAlloc( - size_t x) -{ - return (void *) ckalloc((unsigned int) x); -} - -/* - *---------------------------------------------------------------------- - * - * TclBNRealloc -- - * - * Change the size of an allocated block of memory in libtommath - * - * Results: - * Returns a pointer to the allocated block. - * - * This procedure is a wrapper around Tcl_Realloc, needed because of a - * mismatched type signature between Tcl_Realloc and realloc. - * - *---------------------------------------------------------------------- - */ - -void * -TclBNRealloc( - void *p, - size_t s) -{ - return (void *) ckrealloc((char *) p, (unsigned int) s); -} - -/* - *---------------------------------------------------------------------- - * - * TclBNFree -- - * - * Free allocated memory in libtommath. - * - * Results: - * None. - * - * Side effects: - * Memory is freed. - * - * This function is simply a wrapper around Tcl_Free, needed in libtommath - * because of a type mismatch between free and Tcl_Free. - * - *---------------------------------------------------------------------- - */ - -extern void -TclBNFree( - void *p) -{ - ckree((char *) p); -} -#endif /* *---------------------------------------------------------------------- @@ -187,7 +112,7 @@ TclInitBignumFromLong( long v) { if (mp_init_size(a, (CHAR_BIT * sizeof(long) + DIGIT_BIT - 1) / DIGIT_BIT) != MP_OKAY) { - Tcl_Panic("initialization failure in TclBNInitBignumFromLong"); + Tcl_Panic("initialization failure in TclInitBignumFromLong"); } if (v < (long)0) { mp_set_long_long(a, (Tcl_WideUInt)(-(Tcl_WideInt)v)); @@ -219,7 +144,7 @@ TclInitBignumFromWideInt( Tcl_WideInt v) /* Initial value */ { if (mp_init_size(a, (CHAR_BIT * sizeof(Tcl_WideUInt) + DIGIT_BIT - 1) / DIGIT_BIT) != MP_OKAY) { - Tcl_Panic("initialization failure in TclBNInitBignumFromWideInt"); + Tcl_Panic("initialization failure in TclInitBignumFromWideInt"); } if (v < (Tcl_WideInt)0) { mp_set_long_long(a, (Tcl_WideUInt)(-v)); @@ -251,7 +176,7 @@ TclInitBignumFromWideUInt( Tcl_WideUInt v) /* Initial value */ { if (mp_init_size(a, (CHAR_BIT * sizeof(Tcl_WideUInt) + DIGIT_BIT - 1) / DIGIT_BIT) != MP_OKAY) { - Tcl_Panic("initialization failure in TclBNInitBignumFromWideUInt"); + Tcl_Panic("initialization failure in TclInitBignumFromWideUInt"); } mp_set_long_long(a, v); } |