diff options
Diffstat (limited to 'gmp/demos/expr')
-rw-r--r-- | gmp/demos/expr/Makefile.am | 35 | ||||
-rw-r--r-- | gmp/demos/expr/Makefile.in | 332 | ||||
-rw-r--r-- | gmp/demos/expr/README | 29 | ||||
-rw-r--r-- | gmp/demos/expr/expr-impl.h | 178 | ||||
-rw-r--r-- | gmp/demos/expr/expr.c | 33 | ||||
-rw-r--r-- | gmp/demos/expr/expr.h | 69 | ||||
-rw-r--r-- | gmp/demos/expr/exprf.c | 48 | ||||
-rw-r--r-- | gmp/demos/expr/exprfa.c | 33 | ||||
-rw-r--r-- | gmp/demos/expr/exprq.c | 48 | ||||
-rw-r--r-- | gmp/demos/expr/exprqa.c | 31 | ||||
-rw-r--r-- | gmp/demos/expr/exprv.c | 25 | ||||
-rw-r--r-- | gmp/demos/expr/exprz.c | 48 | ||||
-rw-r--r-- | gmp/demos/expr/exprza.c | 33 | ||||
-rw-r--r-- | gmp/demos/expr/run-expr.c | 27 | ||||
-rw-r--r-- | gmp/demos/expr/t-expr.c | 27 |
15 files changed, 428 insertions, 568 deletions
diff --git a/gmp/demos/expr/Makefile.am b/gmp/demos/expr/Makefile.am index 369e751743..333cacc496 100644 --- a/gmp/demos/expr/Makefile.am +++ b/gmp/demos/expr/Makefile.am @@ -1,32 +1,21 @@ ## Process this file with automake to generate Makefile.in -# Copyright 2001-2004 Free Software Foundation, Inc. +# Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc. # -# This file is part of the GNU MP Library. +# This file is part of the GNU MP Library. # -# The GNU MP Library is free software; you can redistribute it and/or modify -# it under the terms of either: +# The GNU MP Library is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 3 of the License, or (at your +# option) any later version. # -# * the GNU Lesser General Public License as published by the Free -# Software Foundation; either version 3 of the License, or (at your -# option) any later version. +# The GNU MP Library is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +# License for more details. # -# or -# -# * the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any -# later version. -# -# or both in parallel, as here. -# -# The GNU MP Library is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# for more details. -# -# You should have received copies of the GNU General Public License and the -# GNU Lesser General Public License along with the GNU MP Library. If not, -# see https://www.gnu.org/licenses/. +# You should have received a copy of the GNU Lesser General Public License +# along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/tests diff --git a/gmp/demos/expr/Makefile.in b/gmp/demos/expr/Makefile.in index adb9eba91a..5754abece6 100644 --- a/gmp/demos/expr/Makefile.in +++ b/gmp/demos/expr/Makefile.in @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.6 from Makefile.am. +# Makefile.in generated by automake 1.8.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -15,56 +14,33 @@ @SET_MAKE@ -# Copyright 2001-2004 Free Software Foundation, Inc. +# Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc. # -# This file is part of the GNU MP Library. +# This file is part of the GNU MP Library. # -# The GNU MP Library is free software; you can redistribute it and/or modify -# it under the terms of either: +# The GNU MP Library is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 3 of the License, or (at your +# option) any later version. # -# * the GNU Lesser General Public License as published by the Free -# Software Foundation; either version 3 of the License, or (at your -# option) any later version. +# The GNU MP Library is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +# License for more details. # -# or -# -# * the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any -# later version. -# -# or both in parallel, as here. -# -# The GNU MP Library is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# for more details. -# -# You should have received copies of the GNU General Public License and the -# GNU Lesser General Public License along with the GNU MP Library. If not, -# see https://www.gnu.org/licenses/. +# You should have received a copy of the GNU Lesser General Public License +# along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. +SOURCES = $(libexpr_a_SOURCES) run-expr.c t-expr.c + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ - esac; \ - test $$am__dry = yes; \ - } pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -76,52 +52,47 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = @build@ host_triplet = @host@ +ANSI2KNR = $(top_builddir)/ansi2knr EXTRA_PROGRAMS = run-expr$(EXEEXT) t-expr$(EXEEXT) subdir = demos/expr DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d +mkinstalldirs = $(mkdir_p) CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = libexpr_a_AR = $(AR) $(ARFLAGS) libexpr_a_LIBADD = -am_libexpr_a_OBJECTS = expr.$(OBJEXT) exprv.$(OBJEXT) exprz.$(OBJEXT) \ - exprza.$(OBJEXT) exprq.$(OBJEXT) exprqa.$(OBJEXT) \ - exprf.$(OBJEXT) exprfa.$(OBJEXT) +am_libexpr_a_OBJECTS = expr$U.$(OBJEXT) exprv$U.$(OBJEXT) \ + exprz$U.$(OBJEXT) exprza$U.$(OBJEXT) exprq$U.$(OBJEXT) \ + exprqa$U.$(OBJEXT) exprf$U.$(OBJEXT) exprfa$U.$(OBJEXT) libexpr_a_OBJECTS = $(am_libexpr_a_OBJECTS) run_expr_SOURCES = run-expr.c -run_expr_OBJECTS = run-expr.$(OBJEXT) +run_expr_OBJECTS = run-expr$U.$(OBJEXT) run_expr_LDADD = $(LDADD) run_expr_DEPENDENCIES = libexpr.a $(top_builddir)/libgmp.la t_expr_SOURCES = t-expr.c -t_expr_OBJECTS = t-expr.$(OBJEXT) -t_expr_DEPENDENCIES = $(top_builddir)/tests/libtests.la $(LDADD) -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +t_expr_OBJECTS = t-expr$U.$(OBJEXT) +am__DEPENDENCIES_1 = libexpr.a $(top_builddir)/libgmp.la +t_expr_DEPENDENCIES = $(top_builddir)/tests/libtests.la \ + $(am__DEPENDENCIES_1) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libexpr_a_SOURCES) run-expr.c t-expr.c DIST_SOURCES = $(libexpr_a_SOURCES) run-expr.c t-expr.c -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -135,6 +106,7 @@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BITS_PER_MP_LIMB = @BITS_PER_MP_LIMB@ CALLING_CONVENTIONS_OBJS = @CALLING_CONVENTIONS_OBJS@ CC = @CC@ CCAS = @CCAS@ @@ -150,17 +122,16 @@ CYGPATH_W = @CYGPATH_W@ DEFN_LONG_LONG_LIMB = @DEFN_LONG_LONG_LIMB@ DEFS = @DEFS@ DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ +ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ENABLE_STATIC_FALSE = @ENABLE_STATIC_FALSE@ +ENABLE_STATIC_TRUE = @ENABLE_STATIC_TRUE@ EXEEXT = @EXEEXT@ EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@ -FGREP = @FGREP@ GMP_LDFLAGS = @GMP_LDFLAGS@ -GMP_LIMB_BITS = @GMP_LIMB_BITS@ GMP_NAIL_BITS = @GMP_NAIL_BITS@ GREP = @GREP@ HAVE_CLOCK_01 = @HAVE_CLOCK_01@ @@ -174,12 +145,10 @@ HAVE_SIGALTSTACK_01 = @HAVE_SIGALTSTACK_01@ HAVE_SIGSTACK_01 = @HAVE_SIGSTACK_01@ HAVE_STACK_T_01 = @HAVE_STACK_T_01@ HAVE_SYS_RESOURCE_H_01 = @HAVE_SYS_RESOURCE_H_01@ -INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ @@ -194,26 +163,20 @@ LIBOBJS = @LIBOBJS@ LIBREADLINE = @LIBREADLINE@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ M4 = @M4@ MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ @@ -223,31 +186,26 @@ SHELL = @SHELL@ SPEED_CYCLECOUNTER_OBJ = @SPEED_CYCLECOUNTER_OBJ@ STRIP = @STRIP@ TAL_OBJECT = @TAL_OBJECT@ -TUNE_LIBS = @TUNE_LIBS@ TUNE_SQR_OBJ = @TUNE_SQR_OBJ@ +U = @U@ U_FOR_BUILD = @U_FOR_BUILD@ VERSION = @VERSION@ +WANT_CXX_FALSE = @WANT_CXX_FALSE@ +WANT_CXX_TRUE = @WANT_CXX_TRUE@ +WANT_MPBSD_FALSE = @WANT_MPBSD_FALSE@ +WANT_MPBSD_TRUE = @WANT_MPBSD_TRUE@ WITH_READLINE_01 = @WITH_READLINE_01@ YACC = @YACC@ YFLAGS = @YFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__leading_dot = @am__leading_dot@ -am__tar = @am__tar@ -am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ -builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ @@ -271,6 +229,7 @@ mandir = @mandir@ mkdir_p = @mkdir_p@ mpn_objects = @mpn_objects@ mpn_objs_in_libgmp = @mpn_objs_in_libgmp@ +mpn_objs_in_libmp = @mpn_objs_in_libmp@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ @@ -278,12 +237,8 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/tests # FIXME: This is a workaround for a bug in automake 1.8.4. When the only @@ -307,14 +262,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps demos/expr/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu --ignore-deps demos/expr/Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps demos/expr/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu --ignore-deps demos/expr/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -332,23 +287,27 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -libexpr.a: $(libexpr_a_OBJECTS) $(libexpr_a_DEPENDENCIES) $(EXTRA_libexpr_a_DEPENDENCIES) +libexpr.a: $(libexpr_a_OBJECTS) $(libexpr_a_DEPENDENCIES) -rm -f libexpr.a $(libexpr_a_AR) libexpr.a $(libexpr_a_OBJECTS) $(libexpr_a_LIBADD) $(RANLIB) libexpr.a -run-expr$(EXEEXT): $(run_expr_OBJECTS) $(run_expr_DEPENDENCIES) $(EXTRA_run_expr_DEPENDENCIES) +run-expr$(EXEEXT): $(run_expr_OBJECTS) $(run_expr_DEPENDENCIES) @rm -f run-expr$(EXEEXT) - $(LINK) $(run_expr_OBJECTS) $(run_expr_LDADD) $(LIBS) -t-expr$(EXEEXT): $(t_expr_OBJECTS) $(t_expr_DEPENDENCIES) $(EXTRA_t_expr_DEPENDENCIES) + $(LINK) $(run_expr_LDFLAGS) $(run_expr_OBJECTS) $(run_expr_LDADD) $(LIBS) +t-expr$(EXEEXT): $(t_expr_OBJECTS) $(t_expr_DEPENDENCIES) @rm -f t-expr$(EXEEXT) - $(LINK) $(t_expr_OBJECTS) $(t_expr_LDADD) $(LIBS) + $(LINK) $(t_expr_LDFLAGS) $(t_expr_OBJECTS) $(t_expr_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c +$(top_builddir)/ansi2knr: + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) ansi2knr + +mostlyclean-kr: + -test "$U" = "" || rm -f *_.c .c.o: $(COMPILE) -c $< @@ -358,6 +317,31 @@ distclean-compile: .c.lo: $(LTCOMPILE) -c -o $@ $< +expr_.c: expr.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/expr.c; then echo $(srcdir)/expr.c; else echo expr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +exprf_.c: exprf.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/exprf.c; then echo $(srcdir)/exprf.c; else echo exprf.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +exprfa_.c: exprfa.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/exprfa.c; then echo $(srcdir)/exprfa.c; else echo exprfa.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +exprq_.c: exprq.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/exprq.c; then echo $(srcdir)/exprq.c; else echo exprq.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +exprqa_.c: exprqa.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/exprqa.c; then echo $(srcdir)/exprqa.c; else echo exprqa.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +exprv_.c: exprv.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/exprv.c; then echo $(srcdir)/exprv.c; else echo exprv.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +exprz_.c: exprz.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/exprz.c; then echo $(srcdir)/exprz.c; else echo exprz.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +exprza_.c: exprza.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/exprza.c; then echo $(srcdir)/exprza.c; else echo exprza.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +run-expr_.c: run-expr.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/run-expr.c; then echo $(srcdir)/run-expr.c; else echo run-expr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +t-expr_.c: t-expr.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/t-expr.c; then echo $(srcdir)/t-expr.c; else echo t-expr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +expr_.$(OBJEXT) expr_.lo exprf_.$(OBJEXT) exprf_.lo exprfa_.$(OBJEXT) \ +exprfa_.lo exprq_.$(OBJEXT) exprq_.lo exprqa_.$(OBJEXT) exprqa_.lo \ +exprv_.$(OBJEXT) exprv_.lo exprz_.$(OBJEXT) exprz_.lo \ +exprza_.$(OBJEXT) exprza_.lo run-expr_.$(OBJEXT) run-expr_.lo \ +t-expr_.$(OBJEXT) t-expr_.lo : $(ANSI2KNR) mostlyclean-libtool: -rm -f *.lo @@ -365,85 +349,82 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs +distclean-libtool: + -rm -f libtool +uninstall-info-am: + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - set x; \ + tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -z "$$unique" && unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique + $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done @@ -461,23 +442,17 @@ install-am: all-am installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -489,7 +464,7 @@ clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags + distclean-libtool distclean-tags dvi: dvi-am @@ -497,38 +472,18 @@ dvi-am: html: html-am -html-am: - info: info-am info-am: install-data-am: -install-dvi: install-dvi-am - -install-dvi-am: - install-exec-am: -install-html: install-html-am - -install-html-am: - install-info: install-info-am -install-info-am: - install-man: -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - installcheck-am: maintainer-clean: maintainer-clean-am @@ -537,7 +492,7 @@ maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ +mostlyclean-am: mostlyclean-compile mostlyclean-generic mostlyclean-kr \ mostlyclean-libtool pdf: pdf-am @@ -548,29 +503,24 @@ ps: ps-am ps-am: -uninstall-am: - -.MAKE: install-am install-strip +uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ + install-data install-data-am install-exec install-exec-am \ + install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am + mostlyclean-generic mostlyclean-kr mostlyclean-libtool pdf \ + pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am allprogs: $(EXTRA_PROGRAMS) $(top_builddir)/tests/libtests.la: cd $(top_builddir)/tests; $(MAKE) $(AM_MAKEFLAGS) libtests.la - # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/gmp/demos/expr/README b/gmp/demos/expr/README index a54fe42c08..2283cd3ff3 100644 --- a/gmp/demos/expr/README +++ b/gmp/demos/expr/README @@ -3,28 +3,17 @@ Copyright 2001, 2004 Free Software Foundation, Inc. This file is part of the GNU MP Library. The GNU MP Library is free software; you can redistribute it and/or modify -it under the terms of either: - - * the GNU Lesser General Public License as published by the Free - Software Foundation; either version 3 of the License, or (at your - option) any later version. - -or - - * the GNU General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - -or both in parallel, as here. +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 3 of the License, or (at your +option) any later version. The GNU MP Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. -You should have received copies of the GNU General Public License and the -GNU Lesser General Public License along with the GNU MP Library. If not, -see https://www.gnu.org/licenses/. +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. @@ -101,7 +90,7 @@ hex when base==0. White space, as indicated by <ctype.h> isspace(), is ignored except for the purpose of separating tokens. -Variables can be included in expressions by putting them in the stdarg list +Variables can be included in expressions by putting them in the varargs list after the string. "a", "b", "c" etc in the expression string designate those values. For example, @@ -485,7 +474,7 @@ Assignment could be an operator attribute, making it expect an lvalue. There would want to be a standard table without assignments available though, so user input could be safely parsed. -The closing parenthesis table entry could specify the type of open paren it +The closing parethesis table entry could specify the type of open paren it expects, so that "(" and ")" could match and "[" and "]" match but not a mixture of the two. Currently "[" and "]" can be added, but there's no error on writing a mixed expression like "2*(3+4]". Maybe also there could diff --git a/gmp/demos/expr/expr-impl.h b/gmp/demos/expr/expr-impl.h index 9b6458fbd0..e6050c5622 100644 --- a/gmp/demos/expr/expr-impl.h +++ b/gmp/demos/expr/expr-impl.h @@ -1,34 +1,37 @@ /* Implementation specifics for expression evaluation. -Copyright 2000-2002, 2004 Free Software Foundation, Inc. +Copyright 2000, 2001, 2002, 2004 Free Software Foundation, Inc. This file is part of the GNU MP Library. The GNU MP Library is free software; you can redistribute it and/or modify -it under the terms of either: - - * the GNU Lesser General Public License as published by the Free - Software Foundation; either version 3 of the License, or (at your - option) any later version. - -or - - * the GNU General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - -or both in parallel, as here. +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 3 of the License, or (at your +option) any later version. The GNU MP Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received copies of the GNU General Public License and the -GNU Lesser General Public License along with the GNU MP Library. If not, -see https://www.gnu.org/licenses/. */ - +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */ + + +/* Same tests as gmp.h. */ +#if defined (__STDC__) \ + || defined (__cplusplus) \ + || defined (_AIX) \ + || defined (__DECC) \ + || (defined (__mips) && defined (_SYSTYPE_SVR4)) \ + || defined (_MSC_VER) \ + || defined (_WIN32) +#define HAVE_STDARG 1 #include <stdarg.h> +#else +#define HAVE_STDARG 0 +#include <varargs.h> +#endif #include "expr.h" @@ -50,76 +53,83 @@ union mpX_t { }; typedef union mpX_t *mpX_ptr; -typedef const union mpX_t *mpX_srcptr; - -typedef void (*mpexpr_fun_one_t) (mpX_ptr); -typedef unsigned long (*mpexpr_fun_ui_one_t) (mpX_ptr); - -typedef void (*mpexpr_fun_0ary_t) (mpX_ptr); -typedef int (*mpexpr_fun_i_0ary_t) (void); - -typedef void (*mpexpr_fun_unary_t) (mpX_ptr, mpX_srcptr); -typedef void (*mpexpr_fun_unary_ui_t) (mpX_ptr, unsigned long); -typedef int (*mpexpr_fun_i_unary_t) (mpX_srcptr); -typedef int (*mpexpr_fun_i_unary_ui_t) (unsigned long); - -typedef void (*mpexpr_fun_binary_t) (mpX_ptr, mpX_srcptr, mpX_srcptr); -typedef void (*mpexpr_fun_binary_ui_t) (mpX_ptr, mpX_srcptr, unsigned long); -typedef int (*mpexpr_fun_i_binary_t) (mpX_srcptr, mpX_srcptr); -typedef int (*mpexpr_fun_i_binary_ui_t) (mpX_srcptr, unsigned long); - -typedef void (*mpexpr_fun_ternary_t) (mpX_ptr, mpX_srcptr, mpX_srcptr, mpX_srcptr); -typedef void (*mpexpr_fun_ternary_ui_t) (mpX_ptr, mpX_srcptr, mpX_srcptr, unsigned long); -typedef int (*mpexpr_fun_i_ternary_t) (mpX_srcptr, mpX_srcptr, mpX_srcptr); -typedef int (*mpexpr_fun_i_ternary_ui_t) (mpX_srcptr, mpX_srcptr, unsigned long); - -typedef size_t (*mpexpr_fun_number_t) (mpX_ptr, const char *str, size_t len, int base); -typedef void (*mpexpr_fun_swap_t) (mpX_ptr, mpX_ptr); -typedef unsigned long (*mpexpr_fun_get_ui_t) (mpX_srcptr); -typedef void (*mpexpr_fun_set_si_t) (mpX_srcptr, long); +typedef __gmp_const union mpX_t *mpX_srcptr; + +typedef void (*mpexpr_fun_one_t) __GMP_PROTO ((mpX_ptr)); +typedef unsigned long (*mpexpr_fun_ui_one_t) __GMP_PROTO ((mpX_ptr)); + +typedef void (*mpexpr_fun_0ary_t) __GMP_PROTO ((mpX_ptr)); +typedef int (*mpexpr_fun_i_0ary_t) __GMP_PROTO ((void)); + +typedef void (*mpexpr_fun_unary_t) __GMP_PROTO ((mpX_ptr, mpX_srcptr)); +typedef void (*mpexpr_fun_unary_ui_t) __GMP_PROTO ((mpX_ptr, unsigned long)); +typedef int (*mpexpr_fun_i_unary_t) __GMP_PROTO ((mpX_srcptr)); +typedef int (*mpexpr_fun_i_unary_ui_t) __GMP_PROTO ((unsigned long)); + +typedef void (*mpexpr_fun_binary_t) __GMP_PROTO ((mpX_ptr, mpX_srcptr, mpX_srcptr)); +typedef void (*mpexpr_fun_binary_ui_t) __GMP_PROTO ((mpX_ptr, mpX_srcptr, unsigned long)); +typedef int (*mpexpr_fun_i_binary_t) __GMP_PROTO ((mpX_srcptr, mpX_srcptr)); +typedef int (*mpexpr_fun_i_binary_ui_t) __GMP_PROTO ((mpX_srcptr, unsigned long)); + +typedef void (*mpexpr_fun_ternary_t) + __GMP_PROTO ((mpX_ptr, mpX_srcptr, mpX_srcptr, mpX_srcptr)); +typedef void (*mpexpr_fun_ternary_ui_t) + __GMP_PROTO ((mpX_ptr, mpX_srcptr, mpX_srcptr, unsigned long)); +typedef int (*mpexpr_fun_i_ternary_t) + __GMP_PROTO ((mpX_srcptr, mpX_srcptr, mpX_srcptr)); +typedef int (*mpexpr_fun_i_ternary_ui_t) + __GMP_PROTO ((mpX_srcptr, mpX_srcptr, unsigned long)); + +typedef size_t (*mpexpr_fun_number_t) + __GMP_PROTO ((mpX_ptr, __gmp_const char *str, size_t len, int base)); +typedef void (*mpexpr_fun_swap_t) __GMP_PROTO ((mpX_ptr, mpX_ptr)); +typedef unsigned long (*mpexpr_fun_get_ui_t) __GMP_PROTO ((mpX_srcptr)); +typedef void (*mpexpr_fun_set_si_t) __GMP_PROTO ((mpX_srcptr, long)); struct mpexpr_control_t { - const struct mpexpr_operator_t *op; - int argcount; + __gmp_const struct mpexpr_operator_t *op; + int argcount; }; #define MPEXPR_VARIABLES 26 struct mpexpr_parse_t { - const struct mpexpr_operator_t *table; - - mpX_ptr res; - int base; - unsigned long prec; - const char *e; - size_t elen; - mpX_srcptr *var; - int error_code; - - int token; - const struct mpexpr_operator_t *token_op; - - union mpX_t *data_stack; - int data_top; - int data_alloc; - int data_inited; - - struct mpexpr_control_t *control_stack; - int control_top; - int control_alloc; - - mpexpr_fun_0ary_t mpX_clear; - mpexpr_fun_i_unary_t mpX_ulong_p; - mpexpr_fun_get_ui_t mpX_get_ui; - mpexpr_fun_unary_ui_t mpX_init; - mpexpr_fun_number_t mpX_number; - mpexpr_fun_unary_t mpX_set; - mpexpr_fun_unary_t mpX_set_or_swap; - mpexpr_fun_set_si_t mpX_set_si; - mpexpr_fun_swap_t mpX_swap; + __gmp_const struct mpexpr_operator_t *table; + + mpX_ptr res; + int base; + unsigned long prec; + __gmp_const char *e; + size_t elen; + mpX_srcptr *var; + int error_code; + + int token; + __gmp_const struct mpexpr_operator_t *token_op; + + union mpX_t *data_stack; + int data_top; + int data_alloc; + int data_inited; + + struct mpexpr_control_t *control_stack; + int control_top; + int control_alloc; + + + mpexpr_fun_0ary_t mpX_clear; + mpexpr_fun_i_unary_t mpX_ulong_p; + mpexpr_fun_get_ui_t mpX_get_ui; + mpexpr_fun_unary_ui_t mpX_init; + mpexpr_fun_number_t mpX_number; + mpexpr_fun_unary_t mpX_set; + mpexpr_fun_unary_t mpX_set_or_swap; + mpexpr_fun_set_si_t mpX_set_si; + mpexpr_fun_swap_t mpX_swap; }; -int mpexpr_evaluate (struct mpexpr_parse_t *p); -int mpexpr_va_to_var (void *var[], va_list ap); -size_t mpexpr_mpz_number (mpz_ptr res, const char *e, size_t elen, int base); +int mpexpr_evaluate __GMP_PROTO ((struct mpexpr_parse_t *p)); +int mpexpr_va_to_var __GMP_PROTO ((void *var[], va_list ap)); +size_t mpexpr_mpz_number __GMP_PROTO ((mpz_ptr res, + __gmp_const char *e, size_t elen, int base)); diff --git a/gmp/demos/expr/expr.c b/gmp/demos/expr/expr.c index 42dd7966be..f78c321738 100644 --- a/gmp/demos/expr/expr.c +++ b/gmp/demos/expr/expr.c @@ -1,32 +1,21 @@ /* mpexpr_evaluate -- shared code for simple expression evaluation -Copyright 2000-2002, 2004 Free Software Foundation, Inc. +Copyright 2000, 2001, 2002, 2004 Free Software Foundation, Inc. This file is part of the GNU MP Library. The GNU MP Library is free software; you can redistribute it and/or modify -it under the terms of either: - - * the GNU Lesser General Public License as published by the Free - Software Foundation; either version 3 of the License, or (at your - option) any later version. - -or - - * the GNU General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - -or both in parallel, as here. +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 3 of the License, or (at your +option) any later version. The GNU MP Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. -You should have received copies of the GNU General Public License and the -GNU Lesser General Public License along with the GNU MP Library. If not, -see https://www.gnu.org/licenses/. */ +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */ #include <ctype.h> #include <stdio.h> @@ -147,7 +136,7 @@ see https://www.gnu.org/licenses/. */ static int lookahead (struct mpexpr_parse_t *p, int prefix) { - const struct mpexpr_operator_t *op, *op_found; + __gmp_const struct mpexpr_operator_t *op, *op_found; size_t oplen, oplen_found, wlen; int i; @@ -289,7 +278,7 @@ lookahead (struct mpexpr_parse_t *p, int prefix) a reference through CP. */ #define CONTROL_PUSH(opptr,args) \ do { \ - const struct mpexpr_operator_t *op = opptr; \ + __gmp_const struct mpexpr_operator_t *op = opptr; \ struct mpexpr_control_t *cp; \ CONTROL_SPACE (); \ p->control_top++; \ @@ -382,7 +371,7 @@ mpexpr_evaluate (struct mpexpr_parse_t *p) /* "done" is a special sentinel at the bottom of the control stack, precedence -1 is lower than any normal operator. */ { - static const struct mpexpr_operator_t operator_done + static __gmp_const struct mpexpr_operator_t operator_done = { "DONE", NULL, MPEXPR_TYPE_DONE, -1 }; p->control_alloc = 20; diff --git a/gmp/demos/expr/expr.h b/gmp/demos/expr/expr.h index d3b7c77cc3..c3525b61ee 100644 --- a/gmp/demos/expr/expr.h +++ b/gmp/demos/expr/expr.h @@ -1,32 +1,21 @@ /* Header for expression evaluation. -Copyright 2000-2002, 2004 Free Software Foundation, Inc. +Copyright 2000, 2001, 2002, 2004 Free Software Foundation, Inc. This file is part of the GNU MP Library. The GNU MP Library is free software; you can redistribute it and/or modify -it under the terms of either: - - * the GNU Lesser General Public License as published by the Free - Software Foundation; either version 3 of the License, or (at your - option) any later version. - -or - - * the GNU General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - -or both in parallel, as here. +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 3 of the License, or (at your +option) any later version. The GNU MP Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. -You should have received copies of the GNU General Public License and the -GNU Lesser General Public License along with the GNU MP Library. If not, -see https://www.gnu.org/licenses/. */ +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */ #ifndef __EXPR_H__ @@ -109,34 +98,32 @@ see https://www.gnu.org/licenses/. */ #define MPEXPR_TYPE_OPERATOR 0x2000 -#ifdef __cplusplus -extern "C" { -#endif - -typedef void (*mpexpr_fun_t) (void); +typedef void (*mpexpr_fun_t) __GMP_PROTO ((void)); struct mpexpr_operator_t { - const char *name; - mpexpr_fun_t fun; - int type; - int precedence; + __gmp_const char *name; + mpexpr_fun_t fun; + int type; + int precedence; }; -int mpf_expr_a (const struct mpexpr_operator_t *, mpf_ptr, int, - unsigned long, const char *, size_t, mpf_srcptr [26]); -int mpf_expr (mpf_ptr, int, const char *, ...); +int mpf_expr_a __GMP_PROTO ((__gmp_const struct mpexpr_operator_t *table, + mpf_ptr res, int base, unsigned long prec, + __gmp_const char *e, size_t elen, + mpf_srcptr var[26])); +int mpf_expr __GMP_PROTO ((mpf_ptr res, int base, __gmp_const char *e, ...)); -int mpq_expr_a (const struct mpexpr_operator_t *, mpq_ptr, - int, const char *, size_t, mpq_srcptr [26]); -int mpq_expr (mpq_ptr, int, const char *, ...); +int mpq_expr_a __GMP_PROTO ((__gmp_const struct mpexpr_operator_t *table, + mpq_ptr res, int base, + __gmp_const char *e, size_t elen, + mpq_srcptr var[26])); +int mpq_expr __GMP_PROTO ((mpq_ptr res, int base, __gmp_const char *e, ...)); -int mpz_expr_a (const struct mpexpr_operator_t *, mpz_ptr, int, - const char *, size_t, mpz_srcptr [26]); -int mpz_expr (mpz_ptr, int, const char *, ...); - -#ifdef __cplusplus -} /* extern "C" */ -#endif +int mpz_expr_a __GMP_PROTO ((__gmp_const struct mpexpr_operator_t *table, + mpz_ptr res, int base, + __gmp_const char *e, size_t elen, + mpz_srcptr var[26])); +int mpz_expr __GMP_PROTO ((mpz_ptr res, int base, __gmp_const char *e, ...)); #endif diff --git a/gmp/demos/expr/exprf.c b/gmp/demos/expr/exprf.c index 1f7e21f893..c67ee51783 100644 --- a/gmp/demos/expr/exprf.c +++ b/gmp/demos/expr/exprf.c @@ -1,32 +1,21 @@ /* mpf expression evaluation -Copyright 2000-2002 Free Software Foundation, Inc. +Copyright 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU MP Library. The GNU MP Library is free software; you can redistribute it and/or modify -it under the terms of either: - - * the GNU Lesser General Public License as published by the Free - Software Foundation; either version 3 of the License, or (at your - option) any later version. - -or - - * the GNU General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - -or both in parallel, as here. +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 3 of the License, or (at your +option) any later version. The GNU MP Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. -You should have received copies of the GNU General Public License and the -GNU Lesser General Public License along with the GNU MP Library. If not, -see https://www.gnu.org/licenses/. */ +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */ #include <stdio.h> #include <string.h> @@ -45,7 +34,7 @@ e_mpf_sgn (mpf_srcptr x) } -static const struct mpexpr_operator_t _mpf_expr_standard_table[] = { +static __gmp_const struct mpexpr_operator_t _mpf_expr_standard_table[] = { { "**", (mpexpr_fun_t) mpf_pow_ui, MPEXPR_TYPE_BINARY_UI | MPEXPR_TYPE_RIGHTASSOC, 220 }, @@ -99,17 +88,32 @@ static const struct mpexpr_operator_t _mpf_expr_standard_table[] = { { NULL } }; -const struct mpexpr_operator_t * const mpf_expr_standard_table +__gmp_const struct mpexpr_operator_t * __gmp_const mpf_expr_standard_table = _mpf_expr_standard_table; int -mpf_expr (mpf_ptr res, int base, const char *e, ...) +#if HAVE_STDARG +mpf_expr (mpf_ptr res, int base, __gmp_const char *e, ...) +#else +mpf_expr (va_alist) + va_dcl +#endif { mpf_srcptr var[MPEXPR_VARIABLES]; va_list ap; int ret; +#if HAVE_STDARG va_start (ap, e); +#else + mpf_ptr res; + int base; + __gmp_const char *e; + va_start (ap); + res = va_arg (ap, mpf_ptr); + base = va_arg (ap, int); + e = va_arg (ap, __gmp_const char *); +#endif TRACE (printf ("mpf_expr(): base %d, %s\n", base, e)); ret = mpexpr_va_to_var ((void **) var, ap); diff --git a/gmp/demos/expr/exprfa.c b/gmp/demos/expr/exprfa.c index 1918cb55cd..1cc00e0f04 100644 --- a/gmp/demos/expr/exprfa.c +++ b/gmp/demos/expr/exprfa.c @@ -1,32 +1,21 @@ /* mpf expression evaluation -Copyright 2000-2002, 2004 Free Software Foundation, Inc. +Copyright 2000, 2001, 2002, 2004 Free Software Foundation, Inc. This file is part of the GNU MP Library. The GNU MP Library is free software; you can redistribute it and/or modify -it under the terms of either: - - * the GNU Lesser General Public License as published by the Free - Software Foundation; either version 3 of the License, or (at your - option) any later version. - -or - - * the GNU General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - -or both in parallel, as here. +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 3 of the License, or (at your +option) any later version. The GNU MP Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. -You should have received copies of the GNU General Public License and the -GNU Lesser General Public License along with the GNU MP Library. If not, -see https://www.gnu.org/licenses/. */ +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */ /* Future: Bitwise "&", "|" and "&" could be done, if desired. Not sure @@ -46,7 +35,7 @@ see https://www.gnu.org/licenses/. */ static size_t -e_mpf_number (mpf_ptr res, const char *e, size_t elen, int base) +e_mpf_number (mpf_ptr res, __gmp_const char *e, size_t elen, int base) { char *edup; size_t i, ret, extra=0; @@ -162,9 +151,9 @@ e_mpf_set_or_swap (mpf_ptr w, mpf_ptr x) int -mpf_expr_a (const struct mpexpr_operator_t *table, +mpf_expr_a (__gmp_const struct mpexpr_operator_t *table, mpf_ptr res, int base, unsigned long prec, - const char *e, size_t elen, + __gmp_const char *e, size_t elen, mpf_srcptr var[26]) { struct mpexpr_parse_t p; diff --git a/gmp/demos/expr/exprq.c b/gmp/demos/expr/exprq.c index 96432006ef..af91b00167 100644 --- a/gmp/demos/expr/exprq.c +++ b/gmp/demos/expr/exprq.c @@ -1,32 +1,21 @@ /* mpq expression evaluation -Copyright 2000-2002 Free Software Foundation, Inc. +Copyright 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU MP Library. The GNU MP Library is free software; you can redistribute it and/or modify -it under the terms of either: - - * the GNU Lesser General Public License as published by the Free - Software Foundation; either version 3 of the License, or (at your - option) any later version. - -or - - * the GNU General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - -or both in parallel, as here. +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 3 of the License, or (at your +option) any later version. The GNU MP Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. -You should have received copies of the GNU General Public License and the -GNU Lesser General Public License along with the GNU MP Library. If not, -see https://www.gnu.org/licenses/. */ +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */ #include <stdio.h> #include <string.h> @@ -83,7 +72,7 @@ e_mpq_den (mpq_ptr w, mpq_srcptr x) } -static const struct mpexpr_operator_t _mpq_expr_standard_table[] = { +static __gmp_const struct mpexpr_operator_t _mpq_expr_standard_table[] = { { "**", (mpexpr_fun_t) e_mpq_pow_ui, MPEXPR_TYPE_BINARY_UI | MPEXPR_TYPE_RIGHTASSOC, 220 }, @@ -132,17 +121,32 @@ static const struct mpexpr_operator_t _mpq_expr_standard_table[] = { { NULL } }; -const struct mpexpr_operator_t * const mpq_expr_standard_table +__gmp_const struct mpexpr_operator_t * __gmp_const mpq_expr_standard_table = _mpq_expr_standard_table; int -mpq_expr (mpq_ptr res, int base, const char *e, ...) +#if HAVE_STDARG +mpq_expr (mpq_ptr res, int base, __gmp_const char *e, ...) +#else +mpq_expr (va_alist) + va_dcl +#endif { mpq_srcptr var[MPEXPR_VARIABLES]; va_list ap; int ret; +#if HAVE_STDARG va_start (ap, e); +#else + mpq_ptr res; + int base; + __gmp_const char *e; + va_start (ap); + res = va_arg (ap, mpq_ptr); + base = va_arg (ap, int); + e = va_arg (ap, __gmp_const char *); +#endif TRACE (printf ("mpq_expr(): base %d, %s\n", base, e)); ret = mpexpr_va_to_var ((void **) var, ap); diff --git a/gmp/demos/expr/exprqa.c b/gmp/demos/expr/exprqa.c index f3b6ecb495..c56f1ca691 100644 --- a/gmp/demos/expr/exprqa.c +++ b/gmp/demos/expr/exprqa.c @@ -5,28 +5,17 @@ Copyright 2000, 2001, 2004 Free Software Foundation, Inc. This file is part of the GNU MP Library. The GNU MP Library is free software; you can redistribute it and/or modify -it under the terms of either: - - * the GNU Lesser General Public License as published by the Free - Software Foundation; either version 3 of the License, or (at your - option) any later version. - -or - - * the GNU General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - -or both in parallel, as here. +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 3 of the License, or (at your +option) any later version. The GNU MP Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. -You should have received copies of the GNU General Public License and the -GNU Lesser General Public License along with the GNU MP Library. If not, -see https://www.gnu.org/licenses/. */ +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */ #include <stdio.h> @@ -57,7 +46,7 @@ e_mpq_set_si1 (mpq_ptr q, long num) /* The same as mpz, but putting the result in the numerator. Negatives and fractions aren't parsed here because '-' and '/' are operators. */ static size_t -e_mpq_number (mpq_ptr res, const char *e, size_t elen, int base) +e_mpq_number (mpq_ptr res, __gmp_const char *e, size_t elen, int base) { mpz_set_ui (mpq_denref (res), 1L); return mpexpr_mpz_number (mpq_numref (res), e, elen, base); @@ -72,9 +61,9 @@ e_mpq_init (mpq_ptr q, unsigned long prec) } int -mpq_expr_a (const struct mpexpr_operator_t *table, +mpq_expr_a (__gmp_const struct mpexpr_operator_t *table, mpq_ptr res, int base, - const char *e, size_t elen, + __gmp_const char *e, size_t elen, mpq_srcptr var[26]) { struct mpexpr_parse_t p; diff --git a/gmp/demos/expr/exprv.c b/gmp/demos/expr/exprv.c index c25741b023..b53682eec6 100644 --- a/gmp/demos/expr/exprv.c +++ b/gmp/demos/expr/exprv.c @@ -6,28 +6,17 @@ Copyright 2000, 2001 Free Software Foundation, Inc. This file is part of the GNU MP Library. The GNU MP Library is free software; you can redistribute it and/or modify -it under the terms of either: - - * the GNU Lesser General Public License as published by the Free - Software Foundation; either version 3 of the License, or (at your - option) any later version. - -or - - * the GNU General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - -or both in parallel, as here. +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 3 of the License, or (at your +option) any later version. The GNU MP Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. -You should have received copies of the GNU General Public License and the -GNU Lesser General Public License along with the GNU MP Library. If not, -see https://www.gnu.org/licenses/. */ +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */ #include <stdio.h> #include "gmp.h" diff --git a/gmp/demos/expr/exprz.c b/gmp/demos/expr/exprz.c index bac1a9992e..7c01b9dc5f 100644 --- a/gmp/demos/expr/exprz.c +++ b/gmp/demos/expr/exprz.c @@ -1,32 +1,21 @@ /* mpz expression evaluation, simple part -Copyright 2000-2002 Free Software Foundation, Inc. +Copyright 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU MP Library. The GNU MP Library is free software; you can redistribute it and/or modify -it under the terms of either: - - * the GNU Lesser General Public License as published by the Free - Software Foundation; either version 3 of the License, or (at your - option) any later version. - -or - - * the GNU General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - -or both in parallel, as here. +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 3 of the License, or (at your +option) any later version. The GNU MP Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. -You should have received copies of the GNU General Public License and the -GNU Lesser General Public License along with the GNU MP Library. If not, -see https://www.gnu.org/licenses/. */ +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */ #include <ctype.h> #include <stdio.h> @@ -97,7 +86,7 @@ e_mpz_clrbit (mpz_ptr w, mpz_srcptr x, unsigned long n) mpz_clrbit (w, n); } -static const struct mpexpr_operator_t _mpz_expr_standard_table[] = { +static __gmp_const struct mpexpr_operator_t _mpz_expr_standard_table[] = { { "**", (mpexpr_fun_t) mpz_pow_ui, MPEXPR_TYPE_BINARY_UI | MPEXPR_TYPE_RIGHTASSOC, 220 }, @@ -183,17 +172,32 @@ static const struct mpexpr_operator_t _mpz_expr_standard_table[] = { /* The table is available globally only through a pointer, so the table size can change without breaking binary compatibility. */ -const struct mpexpr_operator_t * const mpz_expr_standard_table +__gmp_const struct mpexpr_operator_t * __gmp_const mpz_expr_standard_table = _mpz_expr_standard_table; int -mpz_expr (mpz_ptr res, int base, const char *e, ...) +#if HAVE_STDARG +mpz_expr (mpz_ptr res, int base, __gmp_const char *e, ...) +#else +mpz_expr (va_alist) + va_dcl +#endif { mpz_srcptr var[MPEXPR_VARIABLES]; va_list ap; int ret; +#if HAVE_STDARG va_start (ap, e); +#else + mpz_ptr res; + int base; + __gmp_const char *e; + va_start (ap); + res = va_arg (ap, mpz_ptr); + base = va_arg (ap, int); + e = va_arg (ap, __gmp_const char *); +#endif TRACE (printf ("mpz_expr(): base %d, %s\n", base, e)); ret = mpexpr_va_to_var ((void **) var, ap); diff --git a/gmp/demos/expr/exprza.c b/gmp/demos/expr/exprza.c index eda830d970..81e16ce286 100644 --- a/gmp/demos/expr/exprza.c +++ b/gmp/demos/expr/exprza.c @@ -1,32 +1,21 @@ /* mpz expression evaluation -Copyright 2000-2002, 2004 Free Software Foundation, Inc. +Copyright 2000, 2001, 2002, 2004 Free Software Foundation, Inc. This file is part of the GNU MP Library. The GNU MP Library is free software; you can redistribute it and/or modify -it under the terms of either: - - * the GNU Lesser General Public License as published by the Free - Software Foundation; either version 3 of the License, or (at your - option) any later version. - -or - - * the GNU General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - -or both in parallel, as here. +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 3 of the License, or (at your +option) any later version. The GNU MP Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. -You should have received copies of the GNU General Public License and the -GNU Lesser General Public License along with the GNU MP Library. If not, -see https://www.gnu.org/licenses/. */ +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */ #include <ctype.h> #include <stdio.h> @@ -38,7 +27,7 @@ see https://www.gnu.org/licenses/. */ /* No need to parse '-' since that's handled as an operator. This function also by mpq_expr_a, so it's not static. */ size_t -mpexpr_mpz_number (mpz_ptr res, const char *e, size_t elen, int base) +mpexpr_mpz_number (mpz_ptr res, __gmp_const char *e, size_t elen, int base) { char *edup; size_t i, ret; @@ -80,9 +69,9 @@ e_mpz_init (mpz_ptr z, unsigned long prec) } int -mpz_expr_a (const struct mpexpr_operator_t *table, +mpz_expr_a (__gmp_const struct mpexpr_operator_t *table, mpz_ptr res, int base, - const char *e, size_t elen, + __gmp_const char *e, size_t elen, mpz_srcptr var[26]) { struct mpexpr_parse_t p; diff --git a/gmp/demos/expr/run-expr.c b/gmp/demos/expr/run-expr.c index 706b910287..169f5a8814 100644 --- a/gmp/demos/expr/run-expr.c +++ b/gmp/demos/expr/run-expr.c @@ -1,32 +1,21 @@ /* Demo program to run expression evaluation. -Copyright 2000-2002, 2004 Free Software Foundation, Inc. +Copyright 2000, 2001, 2002, 2004 Free Software Foundation, Inc. This file is part of the GNU MP Library. The GNU MP Library is free software; you can redistribute it and/or modify -it under the terms of either: - - * the GNU Lesser General Public License as published by the Free - Software Foundation; either version 3 of the License, or (at your - option) any later version. - -or - - * the GNU General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - -or both in parallel, as here. +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 3 of the License, or (at your +option) any later version. The GNU MP Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. -You should have received copies of the GNU General Public License and the -GNU Lesser General Public License along with the GNU MP Library. If not, -see https://www.gnu.org/licenses/. */ +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */ /* Usage: ./run-expr [-z] [-q] [-f] [-p prec] [-b base] expression... diff --git a/gmp/demos/expr/t-expr.c b/gmp/demos/expr/t-expr.c index 2f808dd8cd..195350e829 100644 --- a/gmp/demos/expr/t-expr.c +++ b/gmp/demos/expr/t-expr.c @@ -1,32 +1,21 @@ /* Test expression evaluation (print nothing and exit 0 if successful). -Copyright 2000-2004 Free Software Foundation, Inc. +Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of the GNU MP Library. The GNU MP Library is free software; you can redistribute it and/or modify -it under the terms of either: - - * the GNU Lesser General Public License as published by the Free - Software Foundation; either version 3 of the License, or (at your - option) any later version. - -or - - * the GNU General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - -or both in parallel, as here. +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 3 of the License, or (at your +option) any later version. The GNU MP Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. -You should have received copies of the GNU General Public License and the -GNU Lesser General Public License along with the GNU MP Library. If not, -see https://www.gnu.org/licenses/. */ +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */ #include <stdio.h> #include <stdlib.h> |