summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.vc20
-rw-r--r--acinclude.m45
-rw-r--r--configure.ac2
-rw-r--r--doc/mpc.texi6
-rw-r--r--doc/version.texi8
-rw-r--r--src/get_version.c2
-rw-r--r--src/inp_str.c12
-rw-r--r--src/mpc-impl.h12
-rw-r--r--src/mpc.h2
-rw-r--r--src/mul_i.c6
-rw-r--r--src/pow.c22
11 files changed, 45 insertions, 52 deletions
diff --git a/Makefile.vc b/Makefile.vc
index 5dfba9e..06d7762 100644
--- a/Makefile.vc
+++ b/Makefile.vc
@@ -39,7 +39,7 @@ CPP = cl.exe
CC = cl.exe
CDEFAULTFLAGS=/O2 /GR- /MD /nologo /EHs
-VERSION=0.7-dev
+VERSION=0.7
######################## do not edit below this line ##########################
@@ -60,7 +60,7 @@ ENDTESTCOMPILE=/LIBPATH:"$(GMPDIR)\lib" libmpc.lib libmpfr.lib libgmp.lib
#generate the CPPLINKOBJECTS : goto src and execute
# ls *.c | sed "s/\.c/\.obj/" | awk ' { printf("%s \\\n",$1); } '
#generate the list for tests : goto tests and execute
-# ls *.c | sed "s/\.c//" | awk ' { printf("\t$(TESTCOMPILE)%s.c $(MIDTESTCOMPILE)%s.exe $(ENDTESTCOMPILE)\n\tcd $(DIRMPCTESTS) && %s.exe && cd ..\n",$1,$1,$1,$1); } '
+# ls t*.c | sed "s/\.c//" | awk ' { printf("\t$(TESTCOMPILE)%s.c $(MIDTESTCOMPILE)%s.exe $(ENDTESTCOMPILE)\n\tcd $(DIRMPCTESTS) && %s.exe && cd ..\n",$1,$1,$1,$1); } '
LIBRARY = libmpc.dll
LIBRARYLIB = libmpc.lib
@@ -104,8 +104,6 @@ $(DIRMPC)\norm.obj \
$(DIRMPC)\out_str.obj \
$(DIRMPC)\pow.obj \
$(DIRMPC)\proj.obj \
-$(DIRMPC)\random.obj \
-$(DIRMPC)\random2.obj \
$(DIRMPC)\real.obj \
$(DIRMPC)\set.obj \
$(DIRMPC)\set_prec.obj \
@@ -125,7 +123,7 @@ $(DIRMPC)\tanh.obj \
$(DIRMPC)\uceil_log2.obj \
$(DIRMPC)\ui_div.obj \
$(DIRMPC)\ui_ui_sub.obj \
-$(DIRMPC)\urandom.obj
+$(DIRMPC)\urandom.obj
@@ -168,8 +166,6 @@ norm.obj \
out_str.obj \
pow.obj \
proj.obj \
-random.obj \
-random2.obj \
real.obj \
set.obj \
set_prec.obj \
@@ -189,7 +185,7 @@ tanh.obj \
uceil_log2.obj \
ui_div.obj \
ui_ui_sub.obj \
-urandom.obj
+urandom.obj
#
# Link target: automatically builds its object dependencies before
@@ -235,8 +231,6 @@ test :
copy $(GMPDIR)\lib\*gmp*.dll $(DIRMPCTESTS)
copy $(MPFRDIR)\lib\*mpfr*.dll $(DIRMPCTESTS)
copy $(LIBRARY) $(DIRMPCTESTS)
- $(TESTCOMPILE)tset.c $(MIDTESTCOMPILE)tset.exe $(ENDTESTCOMPILE)
- cd $(DIRMPCTESTS) && tset.exe && cd ..
$(TESTCOMPILE)tabs.c $(MIDTESTCOMPILE)tabs.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tabs.exe && cd ..
$(TESTCOMPILE)tadd.c $(MIDTESTCOMPILE)tadd.exe $(ENDTESTCOMPILE)
@@ -269,10 +263,10 @@ test :
cd $(DIRMPCTESTS) && tfr_sub.exe && cd ..
$(TESTCOMPILE)tget_version.c $(MIDTESTCOMPILE)tget_version.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tget_version.exe && cd ..
- $(TESTCOMPILE)tio_str.c $(MIDTESTCOMPILE)tio_str.exe $(ENDTESTCOMPILE)
- cd $(DIRMPCTESTS) && tio_str.exe && cd ..
$(TESTCOMPILE)timag.c $(MIDTESTCOMPILE)timag.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && timag.exe && cd ..
+ $(TESTCOMPILE)tio_str.c $(MIDTESTCOMPILE)tio_str.exe $(ENDTESTCOMPILE)
+ cd $(DIRMPCTESTS) && tio_str.exe && cd ..
$(TESTCOMPILE)tlog.c $(MIDTESTCOMPILE)tlog.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tlog.exe && cd ..
$(TESTCOMPILE)tmul.c $(MIDTESTCOMPILE)tmul.exe $(ENDTESTCOMPILE)
@@ -301,6 +295,8 @@ test :
cd $(DIRMPCTESTS) && treal.exe && cd ..
$(TESTCOMPILE)treimref.c $(MIDTESTCOMPILE)treimref.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && treimref.exe && cd ..
+ $(TESTCOMPILE)tset.c $(MIDTESTCOMPILE)tset.exe $(ENDTESTCOMPILE)
+ cd $(DIRMPCTESTS) && tset.exe && cd ..
$(TESTCOMPILE)tsin.c $(MIDTESTCOMPILE)tsin.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tsin.exe && cd ..
$(TESTCOMPILE)tsinh.c $(MIDTESTCOMPILE)tsinh.exe $(ENDTESTCOMPILE)
diff --git a/acinclude.m4 b/acinclude.m4
index 419bd8b..6309618 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -108,14 +108,11 @@ AC_DEFUN([MPC_PROG_CC_WARNINGCFLAGS], [
if echo $VERSION | grep -c dev >/dev/null 2>&1 ; then
if test x$GCC = xyes ; then
case $host in
- *-*-cygwin* | *-*-mingw*) ;;
- *) AX_C_CHECK_FLAG(-ansi,,,$1="$$1 -ansi",) ;;
- esac
- case $host in
*darwin*) ;;
*) AX_C_CHECK_FLAG(-D_FORTIFY_SOURCE=2,,,$1="$$1 -D_FORTIFY_SOURCE=2",) ;;
esac
AX_C_CHECK_FLAG(-pedantic,,,$1="$$1 -pedantic",)
+ AX_C_CHECK_FLAG(-Wno-long-long,,,$1="$$1 -Wno-long-long",)
AX_C_CHECK_FLAG(-Wall,,,$1="$$1 -Wall",)
AX_C_CHECK_FLAG(-Wextra,,,$1="$$1 -Wextra",)
AX_C_CHECK_FLAG(-Werror,,,$1="$$1 -Werror",)
diff --git a/configure.ac b/configure.ac
index 26aa267..534f946 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@ MA 02111-1307, USA. */
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
-AC_INIT(mpc, 0.7-dev, mpc-discuss@lists.gforge.inria.fr)
+AC_INIT(mpc, 0.7, mpc-discuss@lists.gforge.inria.fr)
AC_CONFIG_SRCDIR([src/mpc-impl.h])
AC_CONFIG_HEADER([config.h])
diff --git a/doc/mpc.texi b/doc/mpc.texi
index 12650ea..ac3fc76 100644
--- a/doc/mpc.texi
+++ b/doc/mpc.texi
@@ -627,8 +627,8 @@ Set @var{rop} to Nan+i*NaN.
@end deftypefun
@deftypefun void mpc_swap (mpc_t @var{op1}, mpc_t @var{op2})
-Swap the values of @var{op1} and @var{op2} efficiently. Warning: the
-precisions are exchanged too; in case the precisions are different,
+Swap the values of @var{op1} and @var{op2} efficiently. Warning: The
+precisions are exchanged, too; in case these are different,
@code{mpc_swap} is thus not equivalent to three @code{mpc_set} calls using a
third auxiliary variable.
@end deftypefun
@@ -1058,7 +1058,7 @@ Value}).
For instance, you can define mpc_set_ui_fr as follows:
@example
-int mpc_set_ui_d (mpc_t rop, long int re, double im, mpc_rnd_t rnd)
+int mpc_set_ui_fr (mpc_t rop, long int re, double im, mpc_rnd_t rnd)
MPC_SET_X_Y (ui, fr, rop, re, im, rnd);
@end example
@end defmac
diff --git a/doc/version.texi b/doc/version.texi
index 8c97c8b..9026e5e 100644
--- a/doc/version.texi
+++ b/doc/version.texi
@@ -1,4 +1,4 @@
-@set UPDATED 25 August 2009
-@set UPDATED-MONTH August 2009
-@set EDITION 0.7-dev
-@set VERSION 0.7-dev
+@set UPDATED 10 September 2009
+@set UPDATED-MONTH September 2009
+@set EDITION 0.7
+@set VERSION 0.7
diff --git a/src/get_version.c b/src/get_version.c
index 92368f3..49c867c 100644
--- a/src/get_version.c
+++ b/src/get_version.c
@@ -24,5 +24,5 @@ MA 02111-1307, USA. */
const char *
mpc_get_version (void)
{
- return "0.7-dev";
+ return "0.7";
}
diff --git a/src/inp_str.c b/src/inp_str.c
index 7adac05..621679a 100644
--- a/src/inp_str.c
+++ b/src/inp_str.c
@@ -110,14 +110,14 @@ extract_string (FILE *stream)
/* (n-char-sequence) only after a NaN */
if ((nread != 3
- || tolower (str[0]) != 'n'
- || tolower (str[1]) != 'a'
- || tolower (str[2]) != 'n')
+ || tolower ((unsigned char) (str[0])) != 'n'
+ || tolower ((unsigned char) (str[1])) != 'a'
+ || tolower ((unsigned char) (str[2])) != 'n')
&& (nread != 5
|| str[0] != '@'
- || tolower (str[1]) != 'n'
- || tolower (str[2]) != 'a'
- || tolower (str[3]) != 'n'
+ || tolower ((unsigned char) (str[1])) != 'n'
+ || tolower ((unsigned char) (str[2])) != 'a'
+ || tolower ((unsigned char) (str[3])) != 'n'
|| str[4] != '@')) {
ungetc (c, stream);
return str;
diff --git a/src/mpc-impl.h b/src/mpc-impl.h
index b2c5ebe..de64752 100644
--- a/src/mpc-impl.h
+++ b/src/mpc-impl.h
@@ -83,16 +83,16 @@ MA 02111-1307, USA. */
#define INV_RND(r) \
(((r) == GMP_RNDU) ? GMP_RNDD : (((r) == GMP_RNDD) ? GMP_RNDU : (r)))
-/* Convention in C99 (G.3): z is regarded as an infinity if at least one of
- its parts is infinite */
#define mpc_inf_p(z) (mpfr_inf_p(MPC_RE(z))||mpfr_inf_p(MPC_IM(z)))
-/* Convention in C99 (G.3): z is regarded as a zero if each of its parts is
- a zero */
+ /* Convention in C99 (G.3): z is regarded as an infinity if at least one of
+ its parts is infinite */
#define mpc_zero_p(z) (mpfr_zero_p(MPC_RE(z))&&mpfr_zero_p(MPC_IM(z)))
-/* Convention in C99 (G.3): z is regarded as finite if both its parts are */
+ /* Convention in C99 (G.3): z is regarded as a zero if each of its parts is
+ a zero */
#define mpc_fin_p(z) (mpfr_number_p(MPC_RE(z))&&mpfr_number_p(MPC_IM(z)))
-/* Consider as NaN all other numbers */
+ /* Convention in C99 (G.3): z is regarded as finite if both its parts are */
#define mpc_nan_p(z) ((mpfr_nan_p(MPC_RE(z)) && !mpfr_inf_p(MPC_IM(z))) || (mpfr_nan_p(MPC_IM(z)) && !mpfr_inf_p(MPC_RE(z))))
+ /* Consider as NaN all other numbers containing at least one NaN */
#define OUT(x) \
diff --git a/src/mpc.h b/src/mpc.h
index b3f3095..5ae2be1 100644
--- a/src/mpc.h
+++ b/src/mpc.h
@@ -29,7 +29,7 @@ MA 02111-1307, USA. */
#define MPC_VERSION_MAJOR 0
#define MPC_VERSION_MINOR 7
#define MPC_VERSION_PATCHLEVEL 0
-#define MPC_VERSION_STRING "0.7-dev"
+#define MPC_VERSION_STRING "0.7"
/* Macros dealing with MPC VERSION */
#define MPC_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
diff --git a/src/mul_i.c b/src/mul_i.c
index b59f511..9c72170 100644
--- a/src/mul_i.c
+++ b/src/mul_i.c
@@ -1,4 +1,4 @@
-/* mpc_mul_si -- Multiply a complex number by plus or minus i.
+/* mpc_mul_i -- Multiply a complex number by plus or minus i.
Copyright (C) 2005, 2009 Andreas Enge, Philippe Th\'eveny
@@ -76,6 +76,6 @@ mpc_mul_i (mpc_ptr a, mpc_srcptr b, int sign, mpc_rnd_t rnd)
inex_im = mpfr_neg (MPC_IM (a), MPC_RE (b), MPC_RND_IM (rnd));
}
}
-
- return MPC_INEX(inex_re, inex_im);
+
+ return MPC_INEX(inex_re, inex_im);
}
diff --git a/src/pow.c b/src/pow.c
index 4fe1677..59227d2 100644
--- a/src/pow.c
+++ b/src/pow.c
@@ -49,7 +49,7 @@ MA 02111-1307, USA. */
whether c = -b^2, i.e., if -c is a square.
Case 3: b = 0. Then d is necessarily zero, thus it suffices to check
- whether c = a^2, i.e., if c is a square.
+ whether c = a^2, i.e., if c is a square.
*/
static int
mpc_perfect_square_p (mpz_t a, mpz_t b, mpz_t c, mpz_t d)
@@ -183,11 +183,11 @@ mpc_pow_exact (mpc_ptr z, mpc_srcptr x, mpfr_srcptr y, mpc_rnd_t rnd,
}
else /* neither c nor d is zero */
{
- unsigned long u;
+ unsigned long v;
t = mpz_scan1 (c, 0);
- u = mpz_scan1 (d, 0);
- if (u < t)
- t = u;
+ v = mpz_scan1 (d, 0);
+ if (v < t)
+ t = v;
mpz_div_2exp (c, c, t);
mpz_div_2exp (d, d, t);
ec += t;
@@ -355,7 +355,7 @@ mpc_pow_exact (mpc_ptr z, mpc_srcptr x, mpfr_srcptr y, mpc_rnd_t rnd,
/* Return 1 if y*2^k is an odd integer, 0 otherwise.
Adapted from MPFR, file pow.c.
-
+
Examples: with k=0, check if y is an odd integer,
with k=1, check if y is half-an-integer,
with k=-1, check if y/2 is an odd integer.
@@ -430,7 +430,7 @@ mpc_pow (mpc_ptr z, mpc_srcptr x, mpc_srcptr y, mpc_rnd_t rnd)
mpfr_t n;
int inex, cx1;
int sign_zi;
- /* cx1 < 0 if |x| < 1
+ /* cx1 < 0 if |x| < 1
cx1 = 0 if |x| = 1
cx1 > 0 if |x| > 1
*/
@@ -441,7 +441,7 @@ mpc_pow (mpc_ptr z, mpc_srcptr x, mpc_srcptr y, mpc_rnd_t rnd)
cx1 = -inex;
sign_zi = (cx1 < 0 && mpfr_signbit (MPC_IM (y)) == 0)
- || (cx1 == 0
+ || (cx1 == 0
&& mpfr_signbit (MPC_IM (x)) != mpfr_signbit (MPC_RE (y)))
|| (cx1 > 0 && mpfr_signbit (MPC_IM (y)));
@@ -492,7 +492,7 @@ mpc_pow (mpc_ptr z, mpc_srcptr x, mpc_srcptr y, mpc_rnd_t rnd)
ret = mpc_set_ui (z, +1, rnd);
/* the sign of the zero imaginary part is known in some cases (see
- algorithm.tex). In such cases we have
+ algorithm.tex). In such cases we have
(x +s*0i)^(y+/-0i) = x^y + s*sign(y)*0i
where s = +/-1. We extend here this rule to fix the sign of the
zero part.
@@ -671,7 +671,7 @@ mpc_pow (mpc_ptr z, mpc_srcptr x, mpc_srcptr y, mpc_rnd_t rnd)
mpfr_t n;
int inex, cx1;
int sign_zi;
- /* cx1 < 0 if |x| < 1
+ /* cx1 < 0 if |x| < 1
cx1 = 0 if |x| = 1
cx1 > 0 if |x| > 1
*/
@@ -682,7 +682,7 @@ mpc_pow (mpc_ptr z, mpc_srcptr x, mpc_srcptr y, mpc_rnd_t rnd)
cx1 = -inex;
sign_zi = (cx1 < 0 && mpfr_signbit (MPC_IM (y)) == 0)
- || (cx1 == 0
+ || (cx1 == 0
&& mpfr_signbit (MPC_IM (x)) != mpfr_signbit (MPC_RE (y)))
|| (cx1 > 0 && mpfr_signbit (MPC_IM (y)));