summaryrefslogtreecommitdiffstats
path: root/generic/tclTomMathInterface.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2017-09-14 08:05:32 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2017-09-14 08:05:32 (GMT)
commite5cd963c59b6bd893f48e2ce7f72b6b7dc19bb76 (patch)
tree4a917e616035a428c6c5aea0604a5fb4c1c8a5ef /generic/tclTomMathInterface.c
parent8b01a846c357441f7db46601c5606ac57e79e259 (diff)
downloadtcl-e5cd963c59b6bd893f48e2ce7f72b6b7dc19bb76.zip
tcl-e5cd963c59b6bd893f48e2ce7f72b6b7dc19bb76.tar.gz
tcl-e5cd963c59b6bd893f48e2ce7f72b6b7dc19bb76.tar.bz2
Remove some unnecessary #if 0 sections. Fix comments and panic messages. No functional changes.
Diffstat (limited to 'generic/tclTomMathInterface.c')
-rw-r--r--generic/tclTomMathInterface.c81
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);
}