]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - stdlib/gmp-impl.h
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / stdlib / gmp-impl.h
index 85e419d36f99829e60503eb9219a80e57370aa5a..9f8766c78a0f2a4fdace607998c5291faff10e06 100644 (file)
@@ -1,6 +1,6 @@
 /* Include file for internal GNU MP types and definitions.
 
-Copyright (C) 1991, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+Copyright (C) 1991-2019 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library.
 
@@ -15,9 +15,8 @@ or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
 License for more details.
 
 You should have received a copy of the GNU Lesser General Public License
-along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-MA 02111-1307, USA. */
+along with the GNU MP Library; see the file COPYING.LIB.  If not, see
+<http://www.gnu.org/licenses/>.  */
 
 /* When using gcc, make sure to use its builtin alloca.  */
 #if ! defined (alloca) && defined (__GNUC__)
@@ -48,7 +47,8 @@ MA 02111-1307, USA. */
 #endif
 #endif
 
-#if ! defined (HAVE_ALLOCA) || USE_STACK_ALLOC
+#if (! defined (alloca) && ! defined (HAVE_ALLOCA)) \
+    || defined (USE_STACK_ALLOC)
 #include "stack-alloc.h"
 #else
 #define TMP_DECL(m)
@@ -65,17 +65,11 @@ MA 02111-1307, USA. */
 #define inline                 /* Empty */
 #endif
 
-#define ABS(x) (x >= 0 ? x : -x)
-#ifndef MIN
-#define MIN(l,o) ((l) < (o) ? (l) : (o))
-#endif
-#ifndef MAX
-#define MAX(h,i) ((h) > (i) ? (h) : (i))
-#endif
+/* Get MAX/MIN macros.  */
+#include <sys/param.h>
 
 /* Field access macros.  */
 #define SIZ(x) ((x)->_mp_size)
-#define ABSIZ(x) ABS (SIZ (x))
 #define PTR(x) ((x)->_mp_d)
 #define EXP(x) ((x)->_mp_exp)
 #define PREC(x) ((x)->_mp_prec)
@@ -217,7 +211,8 @@ extern mp_size_t __gmp_default_fp_limb_precision;
    has to be set.  Put the quotient in Q and the remainder in R.  */
 #define udiv_qrnnd_preinv(q, r, nh, nl, d, di) \
   do {                                                                 \
-    mp_limb_t _q, _ql, _r;                                             \
+    mp_limb_t _ql __attribute__ ((unused));                            \
+    mp_limb_t _q, _r;                                                  \
     mp_limb_t _xh, _xl;                                                        \
     umul_ppmm (_q, _ql, (nh), (di));                                   \
     _q += (nh);                        /* DI is 2**BITS_PER_MP_LIMB too small */\
@@ -241,7 +236,7 @@ extern mp_size_t __gmp_default_fp_limb_precision;
     (r) = _r;                                                          \
     (q) = _q;                                                          \
   } while (0)
-/* Like udiv_qrnnd_preinv, but for for any value D.  DNORM is D shifted left
+/* Like udiv_qrnnd_preinv, but for any value D.  DNORM is D shifted left
    so that its most significant bit is set.  LGUP is ceil(log2(D)).  */
 #define udiv_qrnnd_preinv2gen(q, r, nh, nl, d, di, dnorm, lgup) \
   do {                                                                 \
@@ -313,13 +308,17 @@ typedef unsigned int UHWtype;
 
 /* Prototypes for internal mpn calls.  */
 extern void impn_mul_n_basecase _PROTO ((mp_ptr prodp, mp_srcptr up,
-                                        mp_srcptr vp, mp_size_t size));
+                                        mp_srcptr vp, mp_size_t size))
+     attribute_hidden;
 extern void impn_mul_n _PROTO ((mp_ptr prodp, mp_srcptr up, mp_srcptr vp,
-                               mp_size_t size, mp_ptr tspace));
+                               mp_size_t size, mp_ptr tspace))
+     attribute_hidden;
 extern void impn_sqr_n_basecase _PROTO ((mp_ptr prodp, mp_srcptr up,
-                                        mp_size_t size));
+                                        mp_size_t size))
+     attribute_hidden;
 extern void impn_sqr_n _PROTO ((mp_ptr prodp, mp_srcptr up, mp_size_t size,
-                               mp_ptr tspace));
+                               mp_ptr tspace))
+     attribute_hidden;