inits.c
Upload User: qaz666999
Upload Date: 2022-08-06
Package Size: 2570k
Code Size: 1k
Category:

Algorithm

Development Platform:

Unix_Linux

  1. /* mpz_inits() -- Initialize multiple mpz_t variables and set them to 0.
  2. Copyright 2009 Free Software Foundation, Inc.
  3. This file is part of the GNU MP Library.
  4. The GNU MP Library is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU Lesser General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or (at your
  7. option) any later version.
  8. The GNU MP Library is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  10. or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
  11. License for more details.
  12. You should have received a copy of the GNU Lesser General Public License
  13. along with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.  */
  14. #include "config.h"
  15. #if HAVE_STDARG
  16. #include <stdarg.h>
  17. #else
  18. #include <varargs.h>
  19. #endif
  20. #include <stdio.h> /* for NULL */
  21. #include "gmp.h"
  22. #include "gmp-impl.h"
  23. void
  24. #if HAVE_STDARG
  25. mpz_inits (mpz_ptr x, ...)
  26. #else
  27. mpz_inits (va_alist)
  28.      va_dcl
  29. #endif
  30. {
  31.   va_list  ap;
  32. #if HAVE_STDARG
  33.   va_start (ap, x);
  34. #else
  35.   mpz_ptr x;
  36.   va_start (ap);
  37.   x = va_arg (ap, mpz_ptr);
  38. #endif
  39.   while (x != NULL)
  40.     {
  41.       mpz_init (x);
  42.       x = va_arg (ap, mpz_ptr);
  43.     }
  44.   va_end (ap);
  45. }