Blob Blame History Raw
Fixes these GCC warnings:

div_ext.c: In function 'mpfi_div_ext':
div_ext.c:62:25: warning: passing argument 1 of 'mpfr_div' from incompatible pointer type [-Wincompatible-pointer-types]
   62 |         tmp = mpfr_div (&(tmp2), &(op1->right), &(op2->left), MPFI_RNDD);
      |                         ^~~~~~~
      |                         |
      |                         __mpfr_struct (*)[1]
In file included from mpfi.h:34,
                 from mpfi-impl.h:29,
                 from div_ext.c:27:
/usr/include/mpfr.h:569:31: note: expected 'mpfr_ptr' {aka '__mpfr_struct *'} but argument is of type '__mpfr_struct (*)[1]'
  569 | __MPFR_DECLSPEC int mpfr_div (mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_rnd_t);
      |                               ^~~~~~~~
div_ext.c:65:24: warning: passing argument 1 of 'mpfr_set_zero' from incompatible pointer type [-Wincompatible-pointer-types]
   65 |         mpfr_set_zero (&(tmp2), 1);
      |                        ^~~~~~~
      |                        |
      |                        __mpfr_struct (*)[1]
/usr/include/mpfr.h:475:37: note: expected 'mpfr_ptr' {aka '__mpfr_struct *'} but argument is of type '__mpfr_struct (*)[1]'
  475 | __MPFR_DECLSPEC void mpfr_set_zero (mpfr_ptr, int);
      |                                     ^~~~~~~~
div_ext.c:69:26: warning: passing argument 1 of 'mpfr_div' from incompatible pointer type [-Wincompatible-pointer-types]
   69 |         tmp = mpfr_div ( &(tmp1), &(op1->right), &(op2->right), MPFI_RNDU);
      |                          ^~~~~~~
      |                          |
      |                          __mpfr_struct (*)[1]
/usr/include/mpfr.h:569:31: note: expected 'mpfr_ptr' {aka '__mpfr_struct *'} but argument is of type '__mpfr_struct (*)[1]'
  569 | __MPFR_DECLSPEC int mpfr_div (mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_rnd_t);
      |                               ^~~~~~~~
div_ext.c:72:24: warning: passing argument 1 of 'mpfr_set_zero' from incompatible pointer type [-Wincompatible-pointer-types]
   72 |         mpfr_set_zero( &(tmp1), -1);
      |                        ^~~~~~~
      |                        |
      |                        __mpfr_struct (*)[1]
/usr/include/mpfr.h:475:37: note: expected 'mpfr_ptr' {aka '__mpfr_struct *'} but argument is of type '__mpfr_struct (*)[1]'
  475 | __MPFR_DECLSPEC void mpfr_set_zero (mpfr_ptr, int);
      |                                     ^~~~~~~~
div_ext.c:89:25: warning: passing argument 1 of 'mpfr_div' from incompatible pointer type [-Wincompatible-pointer-types]
   89 |         tmp = mpfr_div (&(tmp1), &(op1->left), &(op2->left), MPFI_RNDU);
      |                         ^~~~~~~
      |                         |
      |                         __mpfr_struct (*)[1]
/usr/include/mpfr.h:569:31: note: expected 'mpfr_ptr' {aka '__mpfr_struct *'} but argument is of type '__mpfr_struct (*)[1]'
  569 | __MPFR_DECLSPEC int mpfr_div (mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_rnd_t);
      |                               ^~~~~~~~
div_ext.c:92:24: warning: passing argument 1 of 'mpfr_set_zero' from incompatible pointer type [-Wincompatible-pointer-types]
   92 |         mpfr_set_zero (&(tmp1), -1);
      |                        ^~~~~~~
      |                        |
      |                        __mpfr_struct (*)[1]
/usr/include/mpfr.h:475:37: note: expected 'mpfr_ptr' {aka '__mpfr_struct *'} but argument is of type '__mpfr_struct (*)[1]'
  475 | __MPFR_DECLSPEC void mpfr_set_zero (mpfr_ptr, int);
      |                                     ^~~~~~~~
div_ext.c:96:26: warning: passing argument 1 of 'mpfr_div' from incompatible pointer type [-Wincompatible-pointer-types]
   96 |         tmp = mpfr_div ( &(tmp2), &(op1->left), &(op2->right), MPFI_RNDD);
      |                          ^~~~~~~
      |                          |
      |                          __mpfr_struct (*)[1]
/usr/include/mpfr.h:569:31: note: expected 'mpfr_ptr' {aka '__mpfr_struct *'} but argument is of type '__mpfr_struct (*)[1]'
  569 | __MPFR_DECLSPEC int mpfr_div (mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_rnd_t);
      |                               ^~~~~~~~
div_ext.c:99:24: warning: passing argument 1 of 'mpfr_set_zero' from incompatible pointer type [-Wincompatible-pointer-types]
   99 |         mpfr_set_zero( &(tmp2), 1);
      |                        ^~~~~~~
      |                        |
      |                        __mpfr_struct (*)[1]
/usr/include/mpfr.h:475:37: note: expected 'mpfr_ptr' {aka '__mpfr_struct *'} but argument is of type '__mpfr_struct (*)[1]'
  475 | __MPFR_DECLSPEC void mpfr_set_zero (mpfr_ptr, int);
      |                                     ^~~~~~~~
div_ext.c:33:19: warning: variable 'tmp' set but not used [-Wunused-but-set-variable]
   33 |   int nb_res = 0, tmp;
      |                   ^~~

--- a/src/div_ext.c	2022-03-11 08:33:43.000000000 -0700
+++ b/src/div_ext.c	2022-03-28 16:18:12.827629679 -0600
@@ -59,17 +59,17 @@ mpfi_div_ext (mpfi_ptr res1, mpfi_ptr re
       mpfr_init2 (tmp1, mpfi_get_prec(res1));
       mpfr_init2 (tmp2, mpfi_get_prec(res2));
       if ( mpfr_number_p (&(op2->left)) ) {
-        tmp = mpfr_div (&(tmp2), &(op1->right), &(op2->left), MPFI_RNDD);
+        tmp = mpfr_div (tmp2, &(op1->right), &(op2->left), MPFI_RNDD);
       }
       else { /* denominator has infinite left endpoint */
-        mpfr_set_zero (&(tmp2), 1);
+        mpfr_set_zero (tmp2, 1);
       }
 
       if ( mpfr_number_p (&(op2->right)) ) {
-        tmp = mpfr_div ( &(tmp1), &(op1->right), &(op2->right), MPFI_RNDU);
+        tmp = mpfr_div (tmp1, &(op1->right), &(op2->right), MPFI_RNDU);
       }
       else { /* denominator has infinite right endpoint */
-        mpfr_set_zero( &(tmp1), -1);
+        mpfr_set_zero(tmp1, -1);
       }
 
       mpfr_set_inf (&(res1->left), -1);
@@ -86,17 +86,17 @@ mpfi_div_ext (mpfi_ptr res1, mpfi_ptr re
       mpfr_init2 (tmp1, mpfi_get_prec(res1));
       mpfr_init2 (tmp2, mpfi_get_prec(res2));
       if ( mpfr_number_p (&(op2->left)) ) {
-        tmp = mpfr_div (&(tmp1), &(op1->left), &(op2->left), MPFI_RNDU);
+        tmp = mpfr_div (tmp1, &(op1->left), &(op2->left), MPFI_RNDU);
       }
       else { /* denominator has infinite left endpoint */
-        mpfr_set_zero (&(tmp1), -1);
+        mpfr_set_zero (tmp1, -1);
       }
 
       if ( mpfr_number_p (&(op2->right)) ) {
-        tmp = mpfr_div ( &(tmp2), &(op1->left), &(op2->right), MPFI_RNDD);
+        tmp = mpfr_div (tmp2, &(op1->left), &(op2->right), MPFI_RNDD);
       }
       else { /* denominator has infinite right endpoint */
-        mpfr_set_zero( &(tmp2), 1);
+        mpfr_set_zero(tmp2, 1);
       }
       mpfr_set_inf (&(res1->left), -1);
       mpfr_set (&(res1->right), tmp1, MPFI_RNDU);