kernel - CAM cleanup 1/N - Remove ancient scsi pccard drivers ncv, nsp, stg
[dragonfly.git] / contrib / gmp / mpf / swap.c
blob26934f641fe40a1a64ec2adfbfd072566480ec04
1 /* mpf_swap (U, V) -- Swap U and V.
3 Copyright 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
5 This file is part of the GNU MP Library.
7 The GNU MP Library is free software; you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
12 The GNU MP Library is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 License for more details.
17 You should have received a copy of the GNU Lesser General Public License
18 along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
20 #include "gmp.h"
21 #include "gmp-impl.h"
23 void
24 mpf_swap (mpf_ptr u, mpf_ptr v) __GMP_NOTHROW
26 mp_ptr up, vp;
27 mp_size_t usize, vsize;
28 mp_size_t uprec, vprec;
29 mp_exp_t uexp, vexp;
31 uprec = u->_mp_prec;
32 vprec = v->_mp_prec;
33 v->_mp_prec = uprec;
34 u->_mp_prec = vprec;
36 usize = u->_mp_size;
37 vsize = v->_mp_size;
38 v->_mp_size = usize;
39 u->_mp_size = vsize;
41 uexp = u->_mp_exp;
42 vexp = v->_mp_exp;
43 v->_mp_exp = uexp;
44 u->_mp_exp = vexp;
46 up = u->_mp_d;
47 vp = v->_mp_d;
48 v->_mp_d = up;
49 u->_mp_d = vp;