summaryrefslogtreecommitdiffstats
path: root/mpi-patches/mpi-set-double-intptr
diff options
context:
space:
mode:
Diffstat (limited to 'mpi-patches/mpi-set-double-intptr')
-rw-r--r--mpi-patches/mpi-set-double-intptr55
1 files changed, 0 insertions, 55 deletions
diff --git a/mpi-patches/mpi-set-double-intptr b/mpi-patches/mpi-set-double-intptr
deleted file mode 100644
index 4cd89766..00000000
--- a/mpi-patches/mpi-set-double-intptr
+++ /dev/null
@@ -1,55 +0,0 @@
-Index: mpi-1.8.6/mpi.c
-===================================================================
---- mpi-1.8.6.orig/mpi.c 2015-02-07 19:32:56.016560235 -0800
-+++ mpi-1.8.6/mpi.c 2015-02-07 19:32:58.456517144 -0800
-@@ -571,6 +571,36 @@
- return MP_OKAY;
- }
-
-+#ifdef HAVE_DOUBLE_INTPTR_T
-+mp_err mp_set_double_intptr(mp_int *mp, double_intptr_t z)
-+{
-+ int ix, shift;
-+ double_intptr_t v = z > 0 ? z : -z;
-+ const int nd = (sizeof v + sizeof (mp_digit) - 1) / sizeof (mp_digit);
-+
-+ ARGCHK(mp != NULL, MP_BADARG);
-+
-+ mp_zero(mp);
-+
-+ if(z == 0)
-+ return MP_OKAY; /* shortcut for zero */
-+
-+ s_mp_grow(mp, nd);
-+
-+ USED(mp) = nd;
-+
-+ for (ix = 0, shift = 0; ix < nd; ix++, shift += MP_DIGIT_BIT)
-+ {
-+ DIGIT(mp, ix) = (v >> shift) & MP_DIGIT_MAX;
-+ }
-+
-+ if(z < 0)
-+ SIGN(mp) = MP_NEG;
-+
-+ return MP_OKAY;
-+}
-+#endif
-+
- mp_err mp_set_word(mp_int *mp, mp_word w, int sign)
- {
- USED(mp) = 2;
-Index: mpi-1.8.6/mpi.h
-===================================================================
---- mpi-1.8.6.orig/mpi.h 2015-02-07 19:32:56.016560235 -0800
-+++ mpi-1.8.6/mpi.h 2015-02-07 19:32:58.456517144 -0800
-@@ -100,6 +100,9 @@
- mp_err mp_set_int(mp_int *mp, long z);
- mp_err mp_set_intptr(mp_int *mp, int_ptr_t z);
- mp_err mp_get_intptr(mp_int *mp, int_ptr_t *z);
-+#ifdef HAVE_DOUBLE_INTPTR_T
-+mp_err mp_set_double_intptr(mp_int *mp, double_intptr_t z);
-+#endif
- mp_err mp_set_word(mp_int *mp, mp_word w, int sign);
-
- /*------------------------------------------------------------------------*/