summaryrefslogtreecommitdiffstats
path: root/generic/tclTomMathDecls.h
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-10-23 20:28:11 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-10-23 20:28:11 (GMT)
commita1e06f4b0acd63c93d68837e05a0d3d1fa1f0281 (patch)
tree2f184f7f806b9d5e0e8deff6a58ecffd3c1328d1 /generic/tclTomMathDecls.h
parent2df6f12a996d019b78a31c15f5875e2609fb28b2 (diff)
downloadtcl-a1e06f4b0acd63c93d68837e05a0d3d1fa1f0281.zip
tcl-a1e06f4b0acd63c93d68837e05a0d3d1fa1f0281.tar.gz
tcl-a1e06f4b0acd63c93d68837e05a0d3d1fa1f0281.tar.bz2
Combine two libtommath stub entries, which do exactly the same.
Fix mp_init_set_int stub, handling the situation that mp_init() fails (however unlikely)
Diffstat (limited to 'generic/tclTomMathDecls.h')
-rw-r--r--generic/tclTomMathDecls.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/generic/tclTomMathDecls.h b/generic/tclTomMathDecls.h
index a4c7e02..ceabc22 100644
--- a/generic/tclTomMathDecls.h
+++ b/generic/tclTomMathDecls.h
@@ -104,8 +104,9 @@
#define mp_read_radix TclBN_mp_read_radix
#define mp_rshd TclBN_mp_rshd
#define mp_set TclBN_mp_set
-#define mp_set_int TclBN_mp_set_int
-#define mp_set_long TclBN_mp_set_long
+#define mp_set_int(a,b) (TclBN_mp_set_int(a,(unsigned int)(b)),MP_OKAY)
+#define mp_set_long(a,b) (TclBN_mp_set_int(a,b),MP_OKAY)
+#define mp_set_ul(a,b) (void)TclBN_mp_set_int(a,b)
#define mp_shrink TclBN_mp_shrink
#define mp_sqr TclBN_mp_sqr
#define mp_sqrt TclBN_mp_sqrt
@@ -329,8 +330,7 @@ EXTERN mp_err TclBN_mp_expt_d_ex(const mp_int *a, mp_digit b,
mp_int *c, int fast);
/* Slot 68 is reserved */
/* Slot 69 is reserved */
-/* 70 */
-EXTERN mp_err TclBN_mp_set_long(mp_int *a, unsigned long i);
+/* Slot 70 is reserved */
/* Slot 71 is reserved */
/* 72 */
EXTERN mp_bool TclBN_mp_isodd(const mp_int *a);
@@ -431,7 +431,7 @@ typedef struct TclTomMathStubs {
mp_err (*tclBN_mp_expt_d_ex) (const mp_int *a, mp_digit b, mp_int *c, int fast); /* 67 */
void (*reserved68)(void);
void (*reserved69)(void);
- mp_err (*tclBN_mp_set_long) (mp_int *a, unsigned long i); /* 70 */
+ void (*reserved70)(void);
void (*reserved71)(void);
mp_bool (*tclBN_mp_isodd) (const mp_int *a); /* 72 */
mp_err (*tclBN_mp_tc_and) (const mp_int *a, const mp_int *b, mp_int *c); /* 73 */
@@ -594,8 +594,7 @@ extern const TclTomMathStubs *tclTomMathStubsPtr;
(tclTomMathStubsPtr->tclBN_mp_expt_d_ex) /* 67 */
/* Slot 68 is reserved */
/* Slot 69 is reserved */
-#define TclBN_mp_set_long \
- (tclTomMathStubsPtr->tclBN_mp_set_long) /* 70 */
+/* Slot 70 is reserved */
/* Slot 71 is reserved */
#define TclBN_mp_isodd \
(tclTomMathStubsPtr->tclBN_mp_isodd) /* 72 */