190792Sgshapiro/* mpf_clears() -- Clear multiple mpf_t variables.
2261363Sgshapiro
390792SgshapiroCopyright 2009, 2014, 2015 Free Software Foundation, Inc.
490792Sgshapiro
590792SgshapiroThis file is part of the GNU MP Library.
690792Sgshapiro
790792SgshapiroThe GNU MP Library is free software; you can redistribute it and/or modify
890792Sgshapiroit under the terms of either:
9266692Sgshapiro
1090792Sgshapiro  * the GNU Lesser General Public License as published by the Free
1190792Sgshapiro    Software Foundation; either version 3 of the License, or (at your
1290792Sgshapiro    option) any later version.
1390792Sgshapiro
1490792Sgshapiroor
1590792Sgshapiro
1690792Sgshapiro  * the GNU General Public License as published by the Free Software
1790792Sgshapiro    Foundation; either version 2 of the License, or (at your option) any
1890792Sgshapiro    later version.
1990792Sgshapiro
2090792Sgshapiroor both in parallel, as here.
2190792Sgshapiro
2290792SgshapiroThe GNU MP Library is distributed in the hope that it will be useful, but
2390792SgshapiroWITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
2490792Sgshapiroor FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
2590792Sgshapirofor more details.
2690792Sgshapiro
2790792SgshapiroYou should have received copies of the GNU General Public License and the
2890792SgshapiroGNU Lesser General Public License along with the GNU MP Library.  If not,
2990792Sgshapirosee https://www.gnu.org/licenses/.  */
3090792Sgshapiro
3190792Sgshapiro#include <stdarg.h>
3290792Sgshapiro#include "gmp-impl.h"
3390792Sgshapiro
3490792Sgshapirovoid
35mpf_clears (mpf_ptr x, ...)
36{
37  va_list  ap;
38
39  va_start (ap, x);
40
41  do
42    {
43      __GMP_FREE_FUNC_LIMBS (PTR(x), PREC(x) + 1);
44      x = va_arg (ap, mpf_ptr);
45    }
46  while (x != NULL);
47
48  va_end (ap);
49}
50