summaryrefslogtreecommitdiff
path: root/tools/mpfrlint
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2019-04-25 12:21:30 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2019-04-25 12:21:30 +0000
commit7231a4fddd79fb547e0c2a3d57691bc25de593d9 (patch)
tree0af3ee4942588cb2f1863db8164e954d18644ce7 /tools/mpfrlint
parent7e408afc43bc53101409ebfc94d1f00fe0723f77 (diff)
downloadmpfr-7231a4fddd79fb547e0c2a3d57691bc25de593d9.tar.gz
[tools/mpfrlint] Check that the lists of rounding modes in
src/print_rnd_mode.c and doc/mpfr.texi are identical. [doc/mpfr.texi] Updated the list of rounding modes in the description of the mpfr_print_rnd_mode function. Choose the same order as in the "Rounding Modes" section in "MPFR Basics". (merged changesets r13472,13474-13475 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/4.0@13476 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tools/mpfrlint')
-rwxr-xr-xtools/mpfrlint11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/mpfrlint b/tools/mpfrlint
index 810799b2a..2020e7fa6 100755
--- a/tools/mpfrlint
+++ b/tools/mpfrlint
@@ -386,6 +386,17 @@ grep -E '[^a-z_](m|re)alloc *\(' tests/*.c | \
err-if-output --dir=doc "check-typography" ./check-typography
+rndmodes1=(${(o)$(perl -ne '/return\s*"(MPFR_\S+)"/ and print "$1\n"' src/print_rnd_mode.c)})
+rndmodes2=(${(o)$(sed -n '/deftypefun.*mpfr_print_rnd_mode/,/end deftypefun/{s/[^"]*"\(MPFR_[^"]*\)"[^"]*/\1\n/gp}' doc/mpfr.texi)})
+rndmodes3=(${(o)$(sed -n '/The following rounding modes are supported:/,/end itemize/{s/.*@item @code{\(MPFR_[^}]*\)}.*/\1/p}' doc/mpfr.texi)})
+[[ "$rndmodes1" == "$rndmodes2" && "$rndmodes2" == "$rndmodes3" ]] ||
+ { cat <<EOF && err=1 }
+The lists of rounding modes in src/print_rnd_mode.c and doc/mpfr.texi differ:
+ $rndmodes1
+ $rndmodes2
+ $rndmodes3
+EOF
+
fdlv1="`sed -n '/Version / {
s/.*Version //
s/,.*//