diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2004-12-30 17:35:29 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2004-12-30 17:35:29 +0000 |
commit | 157d4bd650a3e421c5bac48da7e528af9a6a76e2 (patch) | |
tree | 0379fb2c85e183c3c5669d425b3e42ae4592791b /gnu/lib/libf2c/libU77 | |
parent | 791194721fec8918406191b62da6dc41f2d690e5 (diff) |
Actual synch with 3.3.5.
Changes in Makefile.bsd-wrapper to avoid prereq.
Fix in lib*/config.h.in to include the right ones and get the correct
definitions.
Bump of shlib_version accordingly.
Diffstat (limited to 'gnu/lib/libf2c/libU77')
57 files changed, 734 insertions, 848 deletions
diff --git a/gnu/lib/libf2c/libU77/Makefile.in b/gnu/lib/libf2c/libU77/Makefile.in index 19945115016..6830d8bce5a 100644 --- a/gnu/lib/libf2c/libU77/Makefile.in +++ b/gnu/lib/libf2c/libU77/Makefile.in @@ -37,13 +37,13 @@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ @SET_MAKE@ -SHELL = /bin/sh +SHELL = @SHELL@ #### End of system configuration section. #### # fio.h is in libI77. config.h is in `.'. ALL_CFLAGS = -I. -I$(srcdir) -I$(F2C_H_DIR)/libI77 -I$(G2C_H_DIR) \ - -I$(F2C_H_DIR) $(CPPFLAGS) $(DEFS) $(CFLAGS) + -I$(F2C_H_DIR) $(CPPFLAGS) $(DEFS) $(WARN_CFLAGS) $(CFLAGS) # This could probably be done more elegantly, but it's currently # just for running the u77-test test. diff --git a/gnu/lib/libf2c/libU77/Version.c b/gnu/lib/libf2c/libU77/Version.c index 39e6b8b80af..45b68a6b141 100644 --- a/gnu/lib/libf2c/libU77/Version.c +++ b/gnu/lib/libf2c/libU77/Version.c @@ -1,12 +1 @@ -static char junk[] = "\n@(#) LIBU77 VERSION 19980709\n"; - -char __G77_LIBU77_VERSION__[] = "3.2.2 20030422 (release)"; - -#include <stdio.h> - -void -g77__uvers__ () -{ - fprintf (stderr, "__G77_LIBU77_VERSION__: %s", __G77_LIBU77_VERSION__); - fputs (junk, stderr); -} +const char __LIBU77_VERSION__[] = "@(#) LIBU77 VERSION 19980709\n"; diff --git a/gnu/lib/libf2c/libU77/access_.c b/gnu/lib/libf2c/libU77/access_.c index fefdebb0d8d..0a2dbce9d78 100644 --- a/gnu/lib/libf2c/libU77/access_.c +++ b/gnu/lib/libf2c/libU77/access_.c @@ -45,35 +45,39 @@ Boston, MA 02111-1307, USA. */ # define F_OK 0 #endif -#ifdef KR_headers -void g_char (); +void g_char (const char *a, ftnlen alen, char *b); -integer G77_access_0 (name, mode, Lname, Lmode) - char *name, *mode; - ftnlen Lname, Lmode; -#else -void g_char(const char *a, ftnlen alen, char *b); - -integer G77_access_0 (const char *name, const char *mode, ftnlen Lname, ftnlen Lmode) -#endif +integer +G77_access_0 (const char *name, const char *mode, ftnlen Lname, ftnlen Lmode) { char *buff; - char *bp, *blast; int amode, i; - buff = malloc (Lname+1); - if (!buff) return -1; + buff = malloc (Lname + 1); + if (!buff) + return -1; g_char (name, Lname, buff); amode = 0; - for (i=0;i<Lmode;i++) { - switch (mode[i]) { - case 'r': amode |= R_OK; break; - case 'w': amode |= W_OK; break; - case 'x': amode |= X_OK; break; - case ' ': amode |= F_OK; break; /* as per Sun, at least */ - default: return EINVAL; + for (i = 0; i < Lmode; i++) + { + switch (mode[i]) + { + case 'r': + amode |= R_OK; + break; + case 'w': + amode |= W_OK; + break; + case 'x': + amode |= X_OK; + break; + case ' ': + amode |= F_OK; + break; /* as per Sun, at least */ + default: + return EINVAL; + } } - } i = access (buff, amode); free (buff); return i; diff --git a/gnu/lib/libf2c/libU77/alarm_.c b/gnu/lib/libf2c/libU77/alarm_.c index e7f9c2ddcc4..d2c93824490 100644 --- a/gnu/lib/libf2c/libU77/alarm_.c +++ b/gnu/lib/libf2c/libU77/alarm_.c @@ -29,36 +29,23 @@ Boston, MA 02111-1307, USA. */ #ifndef RETSIGTYPE /* we shouldn't rely on this... */ -#ifdef KR_headers -#define RETSIGTYPE int -#else #define RETSIGTYPE void #endif -#endif -typedef RETSIGTYPE (*sig_type)(); +typedef RETSIGTYPE (*sig_type) (); -#ifdef KR_headers -extern sig_type signal(); -#else #include <signal.h> -typedef int (*sig_proc)(int); -#endif +typedef int (*sig_proc) (int); #ifndef SIG_ERR #define SIG_ERR ((sig_type) -1) #endif -#ifdef KR_headers -integer G77_alarm_0 (seconds, proc) - integer *seconds; - sig_type proc; -#else -integer G77_alarm_0 (integer *seconds, sig_proc proc) -#endif +integer +G77_alarm_0 (integer * seconds, sig_proc proc) { int status; #if defined (HAVE_ALARM) && defined (SIGALRM) - if (signal(SIGALRM, (sig_type)proc) == SIG_ERR) + if (signal (SIGALRM, (sig_type) proc) == SIG_ERR) status = -1; else status = alarm (*seconds); diff --git a/gnu/lib/libf2c/libU77/bes.c b/gnu/lib/libf2c/libU77/bes.c index 442337fd77a..73373fdd223 100644 --- a/gnu/lib/libf2c/libU77/bes.c +++ b/gnu/lib/libf2c/libU77/bes.c @@ -16,31 +16,43 @@ License along with GNU Fortran; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#if 0 /* Don't include these unless necessary -- jcb. */ +#if 0 /* Don't include these unless necessary -- jcb. */ #include "f2c.h" #include <math.h> -double G77_besj0_0 (const real *x) { - return j0 (*x); +double +G77_besj0_0 (const real * x) +{ + return j0 (*x); } -double G77_besj1_0 (const real *x) { - return j1 (*x); +double +G77_besj1_0 (const real * x) +{ + return j1 (*x); } -double G77_besjn_0 (const integer *n, real *x) { - return jn (*n, *x); - } +double +G77_besjn_0 (const integer * n, real * x) +{ + return jn (*n, *x); +} -double G77_besy0_0 (const real *x) { - return y0 (*x); +double +G77_besy0_0 (const real * x) +{ + return y0 (*x); } -double G77_besy1_0 (const real *x) { - return y1 (*x); +double +G77_besy1_0 (const real * x) +{ + return y1 (*x); } -double G77_besyn_0 (const integer *n, real *x) { - return yn (*n, *x); +double +G77_besyn_0 (const integer * n, real * x) +{ + return yn (*n, *x); } #endif diff --git a/gnu/lib/libf2c/libU77/chdir_.c b/gnu/lib/libf2c/libU77/chdir_.c index 9bd53fb95d7..bebdeb0a0c6 100644 --- a/gnu/lib/libf2c/libU77/chdir_.c +++ b/gnu/lib/libf2c/libU77/chdir_.c @@ -32,24 +32,17 @@ Boston, MA 02111-1307, USA. */ #include "f2c.h" -#ifdef KR_headers -void g_char (); +void g_char (const char *a, ftnlen alen, char *b); -integer G77_chdir_0 (name, Lname) - char *name; - ftnlen Lname; -#else -void g_char(const char *a, ftnlen alen, char *b); - -integer G77_chdir_0 (const char *name, const ftnlen Lname) -#endif +integer +G77_chdir_0 (const char *name, const ftnlen Lname) { char *buff; - char *bp, *blast; int i; - buff = malloc (Lname+1); - if (!buff) return -1; + buff = malloc (Lname + 1); + if (!buff) + return -1; g_char (name, Lname, buff); i = chdir (buff); free (buff); diff --git a/gnu/lib/libf2c/libU77/chmod_.c b/gnu/lib/libf2c/libU77/chmod_.c index d482d9ed828..86e620cbc2f 100644 --- a/gnu/lib/libf2c/libU77/chmod_.c +++ b/gnu/lib/libf2c/libU77/chmod_.c @@ -41,41 +41,41 @@ Boston, MA 02111-1307, USA. */ #define CHMOD_PATH "/bin/chmod" #endif -#ifdef KR_headers -extern void s_cat (); -void g_char (); +extern void s_cat (char *lp, char *rpp[], ftnlen rnp[], ftnlen * np, + ftnlen ll); +void g_char (const char *a, ftnlen alen, char *b); -integer G77_chmod_0 (name, mode, Lname, Lmode) - char *name, *mode; - ftnlen Lname, Lmode; -#else -extern void s_cat(char *lp, char *rpp[], ftnlen rnp[], ftnlen *np, ftnlen ll); -void g_char(const char *a, ftnlen alen, char *b); - -integer G77_chmod_0 (/* const */ char *name, /* const */ char *mode, const ftnlen Lname, const ftnlen Lmode) -#endif +integer +G77_chmod_0 ( /* const */ char *name, /* const */ char *mode, + const ftnlen Lname, const ftnlen Lmode) { char *buff; - char *bp, *blast; int i; ftnlen l, l2; ftnlen six = 6; address a[6]; ftnlen ii[6]; - char chmod_path [] = CHMOD_PATH; + char chmod_path[] = CHMOD_PATH; l = strlen (chmod_path); - buff = malloc (Lname+Lmode+l+3+13+1); - if (!buff) return -1; - ii[0] = l; a[0] = chmod_path; - ii[1] = 1; a[1] = " "; - ii[2] = Lmode; a[2] = mode; - ii[3] = 2; a[3] = " '"; - for (l2=Lname; (l2 > 1) && (name[l2-1] == ' '); ) + buff = malloc (Lname + Lmode + l + 3 + 13 + 1); + if (!buff) + return -1; + ii[0] = l; + a[0] = chmod_path; + ii[1] = 1; + a[1] = " "; + ii[2] = Lmode; + a[2] = mode; + ii[3] = 2; + a[3] = " '"; + for (l2 = Lname; (l2 > 1) && (name[l2 - 1] == ' ');) l2--; - ii[4] = l2; a[4] = name; - ii[5] = 13; a[5] = "' 2>/dev/null"; - s_cat (buff, a, ii, &six, Lname+Lmode+l+3+13); - buff[Lname+Lmode+l+3+13] = '\0'; + ii[4] = l2; + a[4] = name; + ii[5] = 13; + a[5] = "' 2>/dev/null"; + s_cat (buff, a, ii, &six, Lname + Lmode + l + 3 + 13); + buff[Lname + Lmode + l + 3 + 13] = '\0'; i = system (buff); free (buff); return i; diff --git a/gnu/lib/libf2c/libU77/config.hin b/gnu/lib/libf2c/libU77/config.hin index 2f20872a4cf..92e64f0b991 100644 --- a/gnu/lib/libf2c/libU77/config.hin +++ b/gnu/lib/libf2c/libU77/config.hin @@ -1,3 +1,5 @@ +/* kludge to build under OpenBSD */ +#include "libI77/config.h" /* config.hin. Generated automatically from configure.in by autoheader. */ /* Define to empty if the keyword does not work. */ @@ -33,6 +35,12 @@ /* Define as the path of the `chmod' program. */ #undef CHMOD_PATH +/* Define if your gettimeofday takes only one argument. */ +#undef GETTIMEOFDAY_ONE_ARGUMENT + +/* Define if your gettimeofday takes a time zome argument. */ +#undef HAVE_TIMEZONE + /* Define if you have the alarm function. */ #undef HAVE_ALARM @@ -54,6 +62,9 @@ /* Define if you have the getrusage function. */ #undef HAVE_GETRUSAGE +/* Define if you have the gettimeofday function. */ +#undef HAVE_GETTIMEOFDAY + /* Define if you have the getuid function. */ #undef HAVE_GETUID diff --git a/gnu/lib/libf2c/libU77/configure b/gnu/lib/libf2c/libU77/configure index f25748f99f0..29a5f131a37 100755 --- a/gnu/lib/libf2c/libU77/configure +++ b/gnu/lib/libf2c/libU77/configure @@ -28,6 +28,7 @@ program_suffix=NONE program_transform_name=s,x,x, silent= site= +sitefile= srcdir= target=NONE verbose= @@ -142,6 +143,7 @@ Configuration: --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX @@ -312,6 +314,11 @@ EOF -site=* | --site=* | --sit=*) site="$ac_optarg" ;; + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) @@ -477,12 +484,16 @@ fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi fi +else + CONFIG_SITE="$sitefile" fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then @@ -523,28 +534,6 @@ fi -# These defines are necessary to get 64-bit file size support. - -cat >> confdefs.h <<\EOF -#define _XOPEN_SOURCE 500L -EOF - -# The following is needed by irix6.2 so that struct timeval is declared. -cat >> confdefs.h <<\EOF -#define _XOPEN_SOURCE_EXTENDED 1 -EOF - -# The following is needed by Solaris2.5.1 so that struct timeval is declared. -cat >> confdefs.h <<\EOF -#define __EXTENSIONS__ 1 -EOF - -cat >> confdefs.h <<\EOF -#define _FILE_OFFSET_BITS 64 -EOF - - - # For g77 we'll set CC to point at the built gcc, but this will get it into @@ -552,7 +541,7 @@ EOF # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:556: checking for $ac_word" >&5 +echo "configure:545: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -582,7 +571,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:586: checking for $ac_word" >&5 +echo "configure:575: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -633,7 +622,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:637: checking for $ac_word" >&5 +echo "configure:626: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -666,7 +655,7 @@ fi echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:670: checking whether we are using GNU C" >&5 +echo "configure:659: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -675,7 +664,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:679: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:668: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -694,7 +683,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:698: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:687: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -726,6 +715,53 @@ else fi +# These defines are necessary to get 64-bit file size support. +# NetBSD 1.4 header files does not support XOPEN_SOURCE == 600, but it +# handles 64-bit file sizes without needing these defines. +echo $ac_n "checking whether _XOPEN_SOURCE may be defined""... $ac_c" 1>&6 +echo "configure:723: checking whether _XOPEN_SOURCE may be defined" >&5 +cat > conftest.$ac_ext <<EOF +#line 725 "configure" +#include "confdefs.h" +#define _XOPEN_SOURCE 600L +#include <unistd.h> +int main() { + +; return 0; } +EOF +if { (eval echo configure:733: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + may_use_xopen_source=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + may_use_xopen_source=no +fi +rm -f conftest* +echo "$ac_t""$may_use_xopen_source" 1>&6 +if test $may_use_xopen_source = yes; then + cat >> confdefs.h <<\EOF +#define _XOPEN_SOURCE 600L +EOF + + # The following is needed by irix6.2 so that struct timeval is declared. + cat >> confdefs.h <<\EOF +#define _XOPEN_SOURCE_EXTENDED 1 +EOF + + # The following is needed by Solaris2.5.1 so that struct timeval is declared. + cat >> confdefs.h <<\EOF +#define __EXTENSIONS__ 1 +EOF + + cat >> confdefs.h <<\EOF +#define _FILE_OFFSET_BITS 64 +EOF + +fi + + LIBTOOL='$(SHELL) ../libtool' @@ -738,7 +774,7 @@ fi test "$AR" || AR=ar echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:742: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:778: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -768,7 +804,7 @@ fi # Extract the first word of "chmod", so it can be a program name with args. set dummy chmod; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:772: checking for $ac_word" >&5 +echo "configure:808: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_ac_cv_prog_chmod'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -812,7 +848,7 @@ else fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:816: checking how to run the C preprocessor" >&5 +echo "configure:852: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -827,13 +863,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 831 "configure" +#line 867 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:837: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:873: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -844,13 +880,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 848 "configure" +#line 884 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:854: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:890: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -861,13 +897,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext <<EOF -#line 865 "configure" +#line 901 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:871: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:907: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -892,12 +928,12 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:896: checking for ANSI C header files" >&5 +echo "configure:932: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 901 "configure" +#line 937 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -905,7 +941,7 @@ else #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:909: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:945: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -922,7 +958,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 926 "configure" +#line 962 "configure" #include "confdefs.h" #include <string.h> EOF @@ -940,7 +976,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 944 "configure" +#line 980 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -961,7 +997,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF -#line 965 "configure" +#line 1001 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -972,7 +1008,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -995,14 +1031,13 @@ EOF fi - echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:1001: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:1036: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1006 "configure" +#line 1041 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/time.h> @@ -1011,7 +1046,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:1015: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1050: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -1036,17 +1071,17 @@ for ac_hdr in limits.h unistd.h sys/time.h string.h stdlib.h \ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1040: checking for $ac_hdr" >&5 +echo "configure:1075: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1045 "configure" +#line 1080 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1050: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1085: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1074,12 +1109,12 @@ done echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1078: checking for working const" >&5 +echo "configure:1113: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1083 "configure" +#line 1118 "configure" #include "confdefs.h" int main() { @@ -1128,7 +1163,7 @@ ccp = (char const *const *) p; ; return 0; } EOF -if { (eval echo configure:1132: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1167: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1149,12 +1184,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:1153: checking for size_t" >&5 +echo "configure:1188: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1158 "configure" +#line 1193 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -1182,12 +1217,12 @@ EOF fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:1186: checking for mode_t" >&5 +echo "configure:1221: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1191 "configure" +#line 1226 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -1216,12 +1251,12 @@ fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:1220: checking for pid_t" >&5 +echo "configure:1255: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1225 "configure" +#line 1260 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -1249,12 +1284,12 @@ EOF fi echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6 -echo "configure:1253: checking for st_blksize in struct stat" >&5 +echo "configure:1288: checking for st_blksize in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1258 "configure" +#line 1293 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/stat.h> @@ -1262,7 +1297,7 @@ int main() { struct stat s; s.st_blksize; ; return 0; } EOF -if { (eval echo configure:1266: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1301: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blksize=yes else @@ -1283,12 +1318,12 @@ EOF fi echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6 -echo "configure:1287: checking for st_blocks in struct stat" >&5 +echo "configure:1322: checking for st_blocks in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1292 "configure" +#line 1327 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/stat.h> @@ -1296,7 +1331,7 @@ int main() { struct stat s; s.st_blocks; ; return 0; } EOF -if { (eval echo configure:1300: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1335: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blocks=yes else @@ -1319,12 +1354,12 @@ else fi echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6 -echo "configure:1323: checking for st_rdev in struct stat" >&5 +echo "configure:1358: checking for st_rdev in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1328 "configure" +#line 1363 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/stat.h> @@ -1332,7 +1367,7 @@ int main() { struct stat s; s.st_rdev; ; return 0; } EOF -if { (eval echo configure:1336: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1371: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_rdev=yes else @@ -1353,12 +1388,12 @@ EOF fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:1357: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:1392: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1362 "configure" +#line 1397 "configure" #include "confdefs.h" #include <sys/types.h> #include <time.h> @@ -1366,7 +1401,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:1370: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1405: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -1388,7 +1423,7 @@ fi echo $ac_n "checking for gethostname in -lsocket""... $ac_c" 1>&6 -echo "configure:1392: checking for gethostname in -lsocket" >&5 +echo "configure:1427: checking for gethostname in -lsocket" >&5 ac_lib_var=`echo socket'_'gethostname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1396,7 +1431,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <<EOF -#line 1400 "configure" +#line 1435 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -1407,7 +1442,7 @@ int main() { gethostname() ; return 0; } EOF -if { (eval echo configure:1411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1433,12 +1468,12 @@ for ac_func in symlink getcwd getwd lstat gethostname strerror clock \ getrusage times alarm getlogin getgid getuid kill link ttyname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1437: checking for $ac_func" >&5 +echo "configure:1472: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1442 "configure" +#line 1477 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1461,7 +1496,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1490,12 +1525,12 @@ done for ac_func in gettimeofday do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1494: checking for $ac_func" >&5 +echo "configure:1529: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1499 "configure" +#line 1534 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1518,7 +1553,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1544,19 +1579,19 @@ done if test "$ac_cv_func_gettimeofday" = yes; then echo $ac_n "checking for struct timezone""... $ac_c" 1>&6 -echo "configure:1548: checking for struct timezone" >&5 +echo "configure:1583: checking for struct timezone" >&5 if eval "test \"`echo '$''{'g77_cv_struct_timezone'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1553 "configure" +#line 1588 "configure" #include "confdefs.h" #include <sys/time.h> int main() { struct timezone tz; ; return 0; } EOF -if { (eval echo configure:1560: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1595: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* g77_cv_struct_timezone=yes else @@ -1577,7 +1612,7 @@ EOF else cat > conftest.$ac_ext <<EOF -#line 1581 "configure" +#line 1616 "configure" #include "confdefs.h" #ifdef TIME_WITH_SYS_TIME @@ -1600,7 +1635,7 @@ main () exit (0); } EOF -if { (eval echo configure:1604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cat >> confdefs.h <<\EOF #define HAVE_TIMEZONE 1 @@ -1616,12 +1651,12 @@ fi fi echo $ac_n "checking whether gettimeofday can accept two arguments""... $ac_c" 1>&6 -echo "configure:1620: checking whether gettimeofday can accept two arguments" >&5 +echo "configure:1655: checking whether gettimeofday can accept two arguments" >&5 if eval "test \"`echo '$''{'emacs_cv_gettimeofday_two_arguments'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1625 "configure" +#line 1660 "configure" #include "confdefs.h" #ifdef TIME_WITH_SYS_TIME @@ -1647,7 +1682,7 @@ int main() { gettimeofday (&time, DUMMY); ; return 0; } EOF -if { (eval echo configure:1651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* emacs_cv_gettimeofday_two_arguments=yes else diff --git a/gnu/lib/libf2c/libU77/configure.in b/gnu/lib/libf2c/libU77/configure.in index 13fa524129f..a56fc4cd311 100644 --- a/gnu/lib/libf2c/libU77/configure.in +++ b/gnu/lib/libf2c/libU77/configure.in @@ -23,17 +23,6 @@ AC_PREREQ(2.12.1) AC_INIT(access_.c) AC_CONFIG_HEADER(config.h:config.hin) -# These defines are necessary to get 64-bit file size support. - -AC_DEFINE(_XOPEN_SOURCE, 500L, [Get Single Unix Specification semantics]) -# The following is needed by irix6.2 so that struct timeval is declared. -AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Get Single Unix Specification semantics]) -# The following is needed by Solaris2.5.1 so that struct timeval is declared. -AC_DEFINE(__EXTENSIONS__, 1, [Solaris extensions]) -AC_DEFINE(_FILE_OFFSET_BITS, 64, [Get 64-bit file size support]) - -dnl Checks for programs. - dnl FIXME AC_PROG_CC wants CC to be able to link things, but it may dnl not be able to. define([AC_PROG_CC_WORKS],[]) @@ -42,6 +31,26 @@ define([AC_PROG_CC_WORKS],[]) # the makefiles AC_PROG_CC +# These defines are necessary to get 64-bit file size support. +# NetBSD 1.4 header files does not support XOPEN_SOURCE == 600, but it +# handles 64-bit file sizes without needing these defines. +AC_MSG_CHECKING(whether _XOPEN_SOURCE may be defined) +AC_TRY_COMPILE([#define _XOPEN_SOURCE 600L +#include <unistd.h>],, +may_use_xopen_source=yes, +may_use_xopen_source=no) +AC_MSG_RESULT($may_use_xopen_source) +if test $may_use_xopen_source = yes; then + AC_DEFINE(_XOPEN_SOURCE, 600L, [Get Single Unix Specification semantics]) + # The following is needed by irix6.2 so that struct timeval is declared. + AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Get Single Unix Specification semantics]) + # The following is needed by Solaris2.5.1 so that struct timeval is declared. + AC_DEFINE(__EXTENSIONS__, 1, [Solaris extensions]) + AC_DEFINE(_FILE_OFFSET_BITS, 64, [Get 64-bit file size support]) +fi + +dnl Checks for programs. + LIBTOOL='$(SHELL) ../libtool' AC_SUBST(LIBTOOL) @@ -70,17 +79,6 @@ fi dnl Checks for header files. AC_HEADER_STDC -dnl We could do this if we didn't know we were using gcc -dnl AC_MSG_CHECKING(for prototype-savvy compiler) -dnl AC_CACHE_VAL(ac_cv_sys_proto, -dnl [AC_TRY_LINK(, -dnl dnl looks screwy because TRY_LINK expects a function body -dnl [return 0;} int foo (int * bar) {], -dnl ac_cv_sys_proto=yes, -dnl [ac_cv_sys_proto=no -dnl AC_DEFINE(KR_headers)])]) -dnl AC_MSG_RESULT($ac_cv_sys_proto) - AC_HEADER_TIME AC_CHECK_HEADERS(limits.h unistd.h sys/time.h string.h stdlib.h \ sys/param.h sys/times.h) diff --git a/gnu/lib/libf2c/libU77/ctime_.c b/gnu/lib/libf2c/libU77/ctime_.c index a855cb59539..56e660562b7 100644 --- a/gnu/lib/libf2c/libU77/ctime_.c +++ b/gnu/lib/libf2c/libU77/ctime_.c @@ -39,16 +39,9 @@ Boston, MA 02111-1307, USA. */ /* may need sys/time.h & long arg for stime (bsd, svr1-3) */ -#ifdef KR_headers -/* Character */ void G77_ctime_0 (chtime, Lchtime, xstime) - char *chtime; - longint * xstime; - ftnlen Lchtime; -#else -/* Character */ void G77_ctime_0 (char *chtime, const ftnlen Lchtime, longint * xstime) -#endif +/* Character */ void +G77_ctime_0 (char *chtime, const ftnlen Lchtime, longint * xstime) { - int i, l; int s_copy (); time_t stime = *xstime; diff --git a/gnu/lib/libf2c/libU77/date_.c b/gnu/lib/libf2c/libU77/date_.c index c3cd55d7ace..306cc5f2da4 100644 --- a/gnu/lib/libf2c/libU77/date_.c +++ b/gnu/lib/libf2c/libU77/date_.c @@ -9,47 +9,48 @@ static integer c__5 = 5; -/* Subroutine */ int G77_date_y2kbug_0 (char *buf, ftnlen buf_len) +/* Subroutine */ int +G77_date_y2kbug_0 (char *buf, ftnlen buf_len) { - /* System generated locals */ - address a__1[5]; - longint i__1; - integer i__2[5]; - char ch__1[24]; - - /* Builtin functions */ - /* Subroutine */ int s_copy(), s_cat(); - - /* Local variables */ - static char cbuf[24]; - extern longint G77_time_0 (); - extern /* Character */ VOID G77_ctime_0 (); - - i__1 = G77_time_0 (); - G77_ctime_0 (ch__1, 24L, &i__1); - s_copy(cbuf, ch__1, 24L, 24L); + /* System generated locals */ + address a__1[5]; + longint i__1; + integer i__2[5]; + char ch__1[24]; + + /* Builtin functions */ + /* Subroutine */ int s_copy (), s_cat (); + + /* Local variables */ + static char cbuf[24]; + extern longint G77_time_0 (); + extern /* Character */ void G77_ctime_0 (); + + i__1 = G77_time_0 (); + G77_ctime_0 (ch__1, 24L, &i__1); + s_copy (cbuf, ch__1, 24L, 24L); /* Writing concatenation */ - i__2[0] = 2, a__1[0] = cbuf + 8; - i__2[1] = 1, a__1[1] = "-"; - i__2[2] = 3, a__1[2] = cbuf + 4; - i__2[3] = 1, a__1[3] = "-"; - i__2[4] = 2, a__1[4] = cbuf + 22; - s_cat(buf, a__1, i__2, &c__5, buf_len); - return 0; -} /* date_ */ + i__2[0] = 2, a__1[0] = cbuf + 8; + i__2[1] = 1, a__1[1] = "-"; + i__2[2] = 3, a__1[2] = cbuf + 4; + i__2[3] = 1, a__1[3] = "-"; + i__2[4] = 2, a__1[4] = cbuf + 22; + s_cat (buf, a__1, i__2, &c__5, buf_len); + return 0; +} /* date_ */ #ifdef PIC # include <stdio.h> const char *G77_Non_Y2K_Compliance_Message = - "Call to non Y2K compliant subroutine detected."; + "Call to non Y2K compliant subroutine detected."; -int G77_date_y2kbuggy_0 (char *buf, ftnlen buf_len) +int +G77_date_y2kbuggy_0 (char *buf __attribute__ ((__unused__)), + ftnlen buf_len __attribute__ ((__unused__))) { - extern int G77_abort_0(); + extern int G77_abort_0 (); fprintf (stderr, "%s\n", G77_Non_Y2K_Compliance_Message); - G77_abort_0(); + G77_abort_0 (); } #endif - - diff --git a/gnu/lib/libf2c/libU77/datetime_.c b/gnu/lib/libf2c/libU77/datetime_.c index 62b06b6ad3b..cd7c7ca0a3b 100644 --- a/gnu/lib/libf2c/libU77/datetime_.c +++ b/gnu/lib/libf2c/libU77/datetime_.c @@ -31,40 +31,48 @@ Boston, MA 02111-1307, USA. */ # include <time.h> # endif #endif +#if defined (_WIN32) +#include <windows.h> +#undef min +#undef max +#endif #include "f2c.h" -#ifdef KR_headers -VOID s_copy (); -#else -void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb); -#endif +void s_copy (register char *a, register char *b, ftnlen la, ftnlen lb); -int G77_date_and_time_0 (char *date, char *fftime, char *zone, - integer *values, ftnlen date_len, - ftnlen fftime_len, ftnlen zone_len) +int +G77_date_and_time_0 (char *date, char *fftime, char *zone, + integer * values, ftnlen date_len, + ftnlen fftime_len, ftnlen zone_len) { - time_t lt=time(<); - struct tm ltime = *localtime(<), gtime = *gmtime(<); + time_t lt = time (<); + struct tm ltime = *localtime (<), gtime = *gmtime (<); char dat[9], zon[6], ftim[11]; int i, vals[8]; +#if defined (_WIN32) + struct _SYSTEMTIME wdattim; + GetLocalTime(&wdattim); + vals[7] = wdattim.wMilliseconds; +#else + vals[7] = 0; /* no STDC/POSIX way to get this */ + /* GNUish way; maybe use `ftime' on other systems. */ +#endif vals[0] = 1900 + ltime.tm_year; vals[1] = 1 + ltime.tm_mon; vals[2] = ltime.tm_mday; /* fixme: year boundaries */ vals[3] = (ltime.tm_min - gtime.tm_min + - 60*(ltime.tm_hour - gtime.tm_hour + - 24*(ltime.tm_yday -gtime.tm_yday))); + 60 * (ltime.tm_hour - gtime.tm_hour + + 24 * (ltime.tm_yday - gtime.tm_yday))); vals[4] = ltime.tm_hour; vals[5] = ltime.tm_min; vals[6] = ltime.tm_sec; - vals[7] = 0; /* no STDC/POSIX way to get this */ - /* GNUish way; maybe use `ftime' on other systems. */ #if HAVE_GETTIMEOFDAY { struct timeval tp; # if GETTIMEOFDAY_ONE_ARGUMENT - if (! gettimeofday (&tp)) + if (!gettimeofday (&tp)) # else # if HAVE_STRUCT_TIMEZONE struct timezone tzp; @@ -74,26 +82,28 @@ int G77_date_and_time_0 (char *date, char *fftime, char *zone, HPUX. Configure checks if gettimeofday actually fails with a non-NULL arg and pretends that struct timezone is missing if it does fail. */ - if (! gettimeofday (&tp, &tzp)) + if (!gettimeofday (&tp, &tzp)) # else - if (! gettimeofday (&tp, (void *) 0)) + if (!gettimeofday (&tp, (void *) 0)) # endif /* HAVE_STRUCT_TIMEZONE */ # endif /* GETTIMEOFDAY_ONE_ARGUMENT */ - vals[7] = tp.tv_usec/1000; + vals[7] = tp.tv_usec / 1000; } #endif /* HAVE_GETTIMEOFDAY */ if (values) /* null pointer for missing optional */ - for (i=0; i<=7; i++) + for (i = 0; i <= 7; i++) values[i] = vals[i]; sprintf (dat, "%04d%02d%02d", vals[0], vals[1], vals[2]); - s_copy(date, dat, date_len, 8); - if (zone) { - sprintf(zon, "%+03d%02d", vals[3] / 60, abs(vals[3] % 60)); - s_copy(zone, zon, zone_len, 5); - } - if (fftime) { - sprintf (ftim, "%02d%02d%02d.%03d", vals[4], vals[5], vals[6], vals[7]); - s_copy(fftime, ftim, fftime_len, 10); - } + s_copy (date, dat, date_len, 8); + if (zone) + { + sprintf (zon, "%+03d%02d", vals[3] / 60, abs (vals[3] % 60)); + s_copy (zone, zon, zone_len, 5); + } + if (fftime) + { + sprintf (ftim, "%02d%02d%02d.%03d", vals[4], vals[5], vals[6], vals[7]); + s_copy (fftime, ftim, fftime_len, 10); + } return 0; } diff --git a/gnu/lib/libf2c/libU77/dbes.c b/gnu/lib/libf2c/libU77/dbes.c index 1ef5978a8e8..8a31746102e 100644 --- a/gnu/lib/libf2c/libU77/dbes.c +++ b/gnu/lib/libf2c/libU77/dbes.c @@ -16,31 +16,43 @@ License along with GNU Fortran; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#if 0 /* Don't include these unless necessary -- dnp. */ +#if 0 /* Don't include these unless necessary -- dnp. */ #include "f2c.h" #include <math.h> -double G77_dbesj0_0 (const double *x) { - return j0 (*x); +double +G77_dbesj0_0 (const double *x) +{ + return j0 (*x); } -double G77_dbesj1_0 (const double *x) { - return j1 (*x); +double +G77_dbesj1_0 (const double *x) +{ + return j1 (*x); } -double G77_dbesjn_0 (const integer *n, double *x) { - return jn (*n, *x); - } +double +G77_dbesjn_0 (const integer * n, double *x) +{ + return jn (*n, *x); +} -double G77_dbesy0_0 (const double *x) { - return y0 (*x); +double +G77_dbesy0_0 (const double *x) +{ + return y0 (*x); } -double G77_dbesy1_0 (const double *x) { - return y1 (*x); +double +G77_dbesy1_0 (const double *x) +{ + return y1 (*x); } -double G77_dbesyn_0 (const integer *n, double *x) { - return yn (*n, *x); +double +G77_dbesyn_0 (const integer * n, double *x) +{ + return yn (*n, *x); } #endif diff --git a/gnu/lib/libf2c/libU77/dtime_.c b/gnu/lib/libf2c/libU77/dtime_.c index 19100e698de..dc9a8639df2 100644 --- a/gnu/lib/libf2c/libU77/dtime_.c +++ b/gnu/lib/libf2c/libU77/dtime_.c @@ -44,19 +44,8 @@ Boston, MA 02111-1307, USA. */ #include <errno.h> /* for ENOSYS */ #include "f2c.h" -/* For dtime, etime we store the clock tick parameter (clk_tck) the - first time either of them is invoked rather than each time. This - approach probably speeds up each invocation by avoiding a system - call each time, but means that the overhead of the first call is - different to all others. */ -static long clk_tck = 0; - -#ifdef KR_headers -double G77_dtime_0 (tarray) - real tarray[2]; -#else -double G77_dtime_0 (real tarray[2]) -#endif +double +G77_dtime_0 (real tarray[2]) { #if defined (_WIN32) static int win32_platform = -1; @@ -68,7 +57,7 @@ double G77_dtime_0 (real tarray[2]) GetVersionEx (&osv); win32_platform = osv.dwPlatformId; } - + /* We need to use this hack on non-NT platforms, where the first call returns 0.0 and subsequent ones return the correct value. */ if (win32_platform != VER_PLATFORM_WIN32_NT) @@ -82,7 +71,7 @@ double G77_dtime_0 (real tarray[2]) if (clock_freq == 0) { LARGE_INTEGER freq; - if (! QueryPerformanceFrequency (&freq)) + if (!QueryPerformanceFrequency (&freq)) { errno = ENOSYS; return 0.0; @@ -90,15 +79,15 @@ double G77_dtime_0 (real tarray[2]) else { clock_freq = ((unsigned long long) freq.HighPart << 32) - + ((unsigned) freq.LowPart); + + ((unsigned) freq.LowPart); } } - if (! QueryPerformanceCounter (&counter_val)) + if (!QueryPerformanceCounter (&counter_val)) return -1.0; count = ((unsigned long long) counter_val.HighPart << 32) - + (unsigned) counter_val.LowPart; + + (unsigned) counter_val.LowPart; delta = ((double) (count - old_count)) / clock_freq; tarray[0] = (float) delta; tarray[1] = 0.0; @@ -112,10 +101,10 @@ double G77_dtime_0 (real tarray[2]) GetProcessTimes (GetCurrentProcess (), &creation_time, &exit_time, &kernel_time, &user_time); - utime = ((unsigned long long) user_time.dwHighDateTime << 32) - + (unsigned) user_time.dwLowDateTime; - stime = ((unsigned long long) kernel_time.dwHighDateTime << 32) - + (unsigned) kernel_time.dwLowDateTime; + utime = ((unsigned long long) user_time.dwHighDateTime << 32) + + (unsigned) user_time.dwLowDateTime; + stime = ((unsigned long long) kernel_time.dwHighDateTime << 32) + + (unsigned) kernel_time.dwLowDateTime; tarray[0] = (utime - old_utime) / 1.0e7; tarray[1] = (stime - old_stime) / 1.0e7; @@ -131,15 +120,21 @@ double G77_dtime_0 (real tarray[2]) static float old_utime = 0.0, old_stime = 0.0; struct rusage rbuff; - if (getrusage (RUSAGE_SELF, &rbuff) != 0) - abort (); - utime = (float) (rbuff.ru_utime).tv_sec + - (float) (rbuff.ru_utime).tv_usec/1000000.0; - tarray[0] = utime - (float) old_utime; - stime = (float) (rbuff.ru_stime).tv_sec + - (float) (rbuff.ru_stime).tv_usec/1000000.0; + if (getrusage (RUSAGE_SELF, &rbuff) != 0) + abort (); + utime = (float) (rbuff.ru_utime).tv_sec + + (float) (rbuff.ru_utime).tv_usec / 1000000.0; + tarray[0] = utime - (float) old_utime; + stime = (float) (rbuff.ru_stime).tv_sec + + (float) (rbuff.ru_stime).tv_usec / 1000000.0; tarray[1] = stime - old_stime; -#else /* HAVE_GETRUSAGE */ +#else /* HAVE_GETRUSAGE */ + /* For dtime, etime we store the clock tick parameter (clk_tck) the + first time either of them is invoked rather than each time. This + approach probably speeds up each invocation by avoiding a system + call each time, but means that the overhead of the first call is + different to all others. */ + static long clk_tck = 0; time_t utime, stime; static time_t old_utime = 0, old_stime = 0; struct tms buffer; @@ -147,24 +142,31 @@ double G77_dtime_0 (real tarray[2]) /* NeXTStep seems to define _SC_CLK_TCK but not to have sysconf; fixme: does using _POSIX_VERSION help? */ # if defined _SC_CLK_TCK && defined _POSIX_VERSION - if (! clk_tck) clk_tck = sysconf(_SC_CLK_TCK); + if (!clk_tck) + clk_tck = sysconf (_SC_CLK_TCK); # elif defined CLOCKS_PER_SECOND - if (! clk_tck) clk_tck = CLOCKS_PER_SECOND; + if (!clk_tck) + clk_tck = CLOCKS_PER_SECOND; # elif defined CLK_TCK - if (! clk_tck) clk_tck = CLK_TCK; + if (!clk_tck) + clk_tck = CLK_TCK; # elif defined HZ - if (! clk_tck) clk_tck = HZ; + if (!clk_tck) + clk_tck = HZ; # elif defined HAVE_GETRUSAGE # else - #error Dont know clock tick length +#error Dont know clock tick length # endif - if (times(&buffer) == (clock_t)-1) return -1.0; - utime = buffer.tms_utime; stime = buffer.tms_stime; - tarray[0] = ((float)(utime - old_utime)) / (float)clk_tck; - tarray[1] = ((float)(stime - old_stime)) / (float)clk_tck; + if (times (&buffer) == (clock_t) - 1) + return -1.0; + utime = buffer.tms_utime; + stime = buffer.tms_stime; + tarray[0] = ((float) (utime - old_utime)) / (float) clk_tck; + tarray[1] = ((float) (stime - old_stime)) / (float) clk_tck; #endif /* HAVE_GETRUSAGE */ - old_utime = utime; old_stime = stime; - return (tarray[0]+tarray[1]); + old_utime = utime; + old_stime = stime; + return (tarray[0] + tarray[1]); #else /* ! HAVE_GETRUSAGE && ! HAVE_TIMES */ errno = ENOSYS; return 0.0; diff --git a/gnu/lib/libf2c/libU77/etime_.c b/gnu/lib/libf2c/libU77/etime_.c index 88eead3fbb4..d0edb2fbcd3 100644 --- a/gnu/lib/libf2c/libU77/etime_.c +++ b/gnu/lib/libf2c/libU77/etime_.c @@ -44,19 +44,8 @@ Boston, MA 02111-1307, USA. */ #include <errno.h> /* for ENOSYS */ #include "f2c.h" -/* For dtime, etime we store the clock tick parameter (clk_tck) the - first time either of them is invoked rather than each time. This - approach probably speeds up each invocation by avoiding a system - call each time, but means that the overhead of the first call is - different to all others. */ -static long clk_tck = 0; - -#ifdef KR_headers -double G77_etime_0 (tarray) - real tarray[2]; -#else -double G77_etime_0 (real tarray[2]) -#endif +double +G77_etime_0 (real tarray[2]) { #if defined (_WIN32) static int win32_platform = -1; @@ -69,7 +58,7 @@ double G77_etime_0 (real tarray[2]) GetVersionEx (&osv); win32_platform = osv.dwPlatformId; } - + /* non-NT platforms don't have a clue as to how long a process has been running, so simply return the uptime. Bad judgement call? */ if (win32_platform != VER_PLATFORM_WIN32_NT) @@ -82,7 +71,7 @@ double G77_etime_0 (real tarray[2]) if (clock_freq == 0) { LARGE_INTEGER freq; - if (! QueryPerformanceFrequency (&freq)) + if (!QueryPerformanceFrequency (&freq)) { errno = ENOSYS; return 0.0; @@ -90,19 +79,19 @@ double G77_etime_0 (real tarray[2]) else { clock_freq = ((unsigned long long) freq.HighPart << 32) - + ((unsigned) freq.LowPart); - if (! QueryPerformanceCounter (&counter_val)) + + ((unsigned) freq.LowPart); + if (!QueryPerformanceCounter (&counter_val)) return -1.0; old_count = ((unsigned long long) counter_val.HighPart << 32) - + (unsigned) counter_val.LowPart; + + (unsigned) counter_val.LowPart; } } - if (! QueryPerformanceCounter (&counter_val)) + if (!QueryPerformanceCounter (&counter_val)) return -1.0; count = ((unsigned long long) counter_val.HighPart << 32) - + (unsigned) counter_val.LowPart; + + (unsigned) counter_val.LowPart; tarray[0] = usertime = (double) (count - old_count) / clock_freq; tarray[1] = systime = 0.0; } @@ -114,13 +103,13 @@ double G77_etime_0 (real tarray[2]) GetProcessTimes (GetCurrentProcess (), &creation_time, &exit_time, &kernel_time, &user_time); utime = ((unsigned long long) user_time.dwHighDateTime << 32) - + (unsigned) user_time.dwLowDateTime; + + (unsigned) user_time.dwLowDateTime; stime = ((unsigned long long) kernel_time.dwHighDateTime << 32) - + (unsigned) kernel_time.dwLowDateTime; + + (unsigned) kernel_time.dwLowDateTime; tarray[0] = usertime = utime / 1.0e7; tarray[1] = systime = stime / 1.0e7; - } + } return usertime + systime; #elif defined (HAVE_GETRUSAGE) || defined (HAVE_TIMES) @@ -128,34 +117,45 @@ double G77_etime_0 (real tarray[2]) #ifdef HAVE_GETRUSAGE struct rusage rbuff; - if (getrusage (RUSAGE_SELF, &rbuff) != 0) - abort (); - tarray[0] = ((float) (rbuff.ru_utime).tv_sec + - (float) (rbuff.ru_utime).tv_usec/1000000.0); - tarray[1] = ((float) (rbuff.ru_stime).tv_sec + - (float) (rbuff.ru_stime).tv_usec/1000000.0); -#else /* HAVE_GETRUSAGE */ + if (getrusage (RUSAGE_SELF, &rbuff) != 0) + abort (); + tarray[0] = ((float) (rbuff.ru_utime).tv_sec + + (float) (rbuff.ru_utime).tv_usec / 1000000.0); + tarray[1] = ((float) (rbuff.ru_stime).tv_sec + + (float) (rbuff.ru_stime).tv_usec / 1000000.0); +#else /* HAVE_GETRUSAGE */ + /* For dtime, etime we store the clock tick parameter (clk_tck) the + first time either of them is invoked rather than each time. This + approach probably speeds up each invocation by avoiding a system + call each time, but means that the overhead of the first call is + different to all others. */ + static long clk_tck = 0; struct tms buffer; /* NeXTStep seems to define _SC_CLK_TCK but not to have sysconf; fixme: does using _POSIX_VERSION help? */ # if defined _SC_CLK_TCK && defined _POSIX_VERSION - if (! clk_tck) clk_tck = sysconf(_SC_CLK_TCK); + if (!clk_tck) + clk_tck = sysconf (_SC_CLK_TCK); # elif defined CLOCKS_PER_SECOND - if (! clk_tck) clk_tck = CLOCKS_PER_SECOND; + if (!clk_tck) + clk_tck = CLOCKS_PER_SECOND; # elif defined CLK_TCK - if (! clk_tck) clk_tck = CLK_TCK; + if (!clk_tck) + clk_tck = CLK_TCK; # elif defined HZ - if (! clk_tck) clk_tck = HZ; + if (!clk_tck) + clk_tck = HZ; # elif defined HAVE_GETRUSAGE # else - #error Dont know clock tick length +#error Dont know clock tick length # endif - if (times(&buffer) == (clock_t)-1) return -1.0; - tarray[0] = (float) buffer.tms_utime / (float)clk_tck; - tarray[1] = (float) buffer.tms_stime / (float)clk_tck; + if (times (&buffer) == (clock_t) - 1) + return -1.0; + tarray[0] = (float) buffer.tms_utime / (float) clk_tck; + tarray[1] = (float) buffer.tms_stime / (float) clk_tck; #endif /* HAVE_GETRUSAGE */ - return (tarray[0]+tarray[1]); + return (tarray[0] + tarray[1]); #else /* ! HAVE_GETRUSAGE && ! HAVE_TIMES */ errno = ENOSYS; return 0.0; diff --git a/gnu/lib/libf2c/libU77/fdate_.c b/gnu/lib/libf2c/libU77/fdate_.c index a0bc9836f44..d710a5cb3be 100644 --- a/gnu/lib/libf2c/libU77/fdate_.c +++ b/gnu/lib/libf2c/libU77/fdate_.c @@ -43,12 +43,13 @@ Boston, MA 02111-1307, USA. */ also a subroutine version. Of course, the calling convention is essentially the same for both. */ -/* Character *24 */ void G77_fdate_0 (char *ret_val, ftnlen ret_val_len) +/* Character *24 */ void +G77_fdate_0 (char *ret_val, ftnlen ret_val_len) { - int s_copy (); - time_t tloc; - tloc = time (NULL); - /* Allow a length other than 24 for compatibility with what other - systems do, despite it being documented as 24. */ - s_copy (ret_val, ctime ((time_t *) &tloc), ret_val_len, 24); + int s_copy (); + time_t tloc; + tloc = time (NULL); + /* Allow a length other than 24 for compatibility with what other + systems do, despite it being documented as 24. */ + s_copy (ret_val, ctime ((time_t *) & tloc), ret_val_len, 24); } diff --git a/gnu/lib/libf2c/libU77/fgetc_.c b/gnu/lib/libf2c/libU77/fgetc_.c index 49f39830d2c..ec94829a6a1 100644 --- a/gnu/lib/libf2c/libU77/fgetc_.c +++ b/gnu/lib/libf2c/libU77/fgetc_.c @@ -26,43 +26,36 @@ Boston, MA 02111-1307, USA. */ #include "f2c.h" #include "fio.h" -#ifdef KR_headers -integer G77_fgetc_0 (lunit, c, Lc) - integer *lunit; - ftnlen Lc; /* should be 1 */ - char *c; -#else -integer G77_fgetc_0 (const integer *lunit, char *c, ftnlen Lc) -#endif +integer +G77_fgetc_0 (const integer * lunit, char *c, ftnlen Lc) { int err; FILE *f = f__units[*lunit].ufd; - if (*lunit>=MXUNIT || *lunit<0) + if (*lunit >= MXUNIT || *lunit < 0) return 101; /* bad unit error */ err = getc (f); - if (err == EOF) { - if (feof (f)) - return -1; - else - return ferror (f); } - else { - if (Lc == 0) + if (err == EOF) + { + if (feof (f)) + return -1; + else + return ferror (f); + } + else + { + if (Lc == 0) + return 0; + + c[0] = err; + while (--Lc) + *++c = ' '; return 0; - - c[0] = err; - while (--Lc) - *++c = ' '; - return 0; } + } } -#ifdef KR_headers -integer G77_fget_0 (c, Lc) - ftnlen Lc; /* should be 1 */ - char *c; -#else -integer G77_fget_0 (char *c, const ftnlen Lc) -#endif +integer +G77_fget_0 (char *c, const ftnlen Lc) { integer five = 5; diff --git a/gnu/lib/libf2c/libU77/flush1_.c b/gnu/lib/libf2c/libU77/flush1_.c index 451915debac..7327593be8f 100644 --- a/gnu/lib/libf2c/libU77/flush1_.c +++ b/gnu/lib/libf2c/libU77/flush1_.c @@ -25,22 +25,16 @@ Boston, MA 02111-1307, USA. */ /* This flushes a single unit, c.f. libI77 version. */ -#ifdef KR_headers -extern integer G77_fnum_0 (); - -/* Subroutine */ int G77_flush1_0 (lunit) - integer *lunit; -#else extern integer G77_fnum_0 (integer *); -/* Subroutine */ int G77_flush1_0 (const integer *lunit) -#endif +/* Subroutine */ int +G77_flush1_0 (const integer * lunit) { - if (*lunit>=MXUNIT || *lunit<0) - err(1,101,"flush"); + if (*lunit >= MXUNIT || *lunit < 0) + err (1, 101, "flush"); /* f__units is a table of descriptions for the unit numbers (defined in io.h) with file descriptors rather than streams */ if (f__units[*lunit].ufd != NULL && f__units[*lunit].uwrt) - fflush(f__units[*lunit].ufd); + fflush (f__units[*lunit].ufd); return 0; } diff --git a/gnu/lib/libf2c/libU77/fnum_.c b/gnu/lib/libf2c/libU77/fnum_.c index 0a3ba013e06..daf8f3dc080 100644 --- a/gnu/lib/libf2c/libU77/fnum_.c +++ b/gnu/lib/libf2c/libU77/fnum_.c @@ -22,17 +22,13 @@ Boston, MA 02111-1307, USA. */ #include "f2c.h" #include "fio.h" -#ifdef KR_headers -integer G77_fnum_0 (lunit) - integer *lunit; -#else -integer G77_fnum_0 (integer *lunit) -#endif +integer +G77_fnum_0 (integer * lunit) { - if (*lunit>=MXUNIT || *lunit<0) - err(1,101,"fnum"); + if (*lunit >= MXUNIT || *lunit < 0) + err (1, 101, "fnum"); /* f__units is a table of descriptions for the unit numbers (defined in io.h). Use file descriptor (ufd) and fileno rather than udev field since udev is unix specific */ - return fileno(f__units[*lunit].ufd); + return fileno (f__units[*lunit].ufd); } diff --git a/gnu/lib/libf2c/libU77/fputc_.c b/gnu/lib/libf2c/libU77/fputc_.c index 5a1109e8d4f..7e45dd4140c 100644 --- a/gnu/lib/libf2c/libU77/fputc_.c +++ b/gnu/lib/libf2c/libU77/fputc_.c @@ -26,38 +26,29 @@ Boston, MA 02111-1307, USA. */ #include "f2c.h" #include "fio.h" -#ifdef KR_headers -integer G77_fputc_0 (lunit, c, Lc) - integer *lunit; - ftnlen Lc; /* should be 1 */ - char *c; -#else -integer G77_fputc_0 (const integer *lunit, const char *c, const ftnlen Lc) -#endif +integer +G77_fputc_0 (const integer * lunit, const char *c, + const ftnlen Lc __attribute__ ((__unused__))) { int err; FILE *f = f__units[*lunit].ufd; - if (*lunit>=MXUNIT || *lunit<0) + if (*lunit >= MXUNIT || *lunit < 0) return 101; /* bad unit error */ err = putc (c[0], f); - if (err == EOF) { - if (feof (f)) - return -1; - else - return ferror (f); - } + if (err == EOF) + { + if (feof (f)) + return -1; + else + return ferror (f); + } else return 0; } -#ifdef KR_headers -integer G77_fput_0 (c, Lc) - ftnlen Lc; /* should be 1 */ - char *c; -#else -integer G77_fput_0 (const char *c, const ftnlen Lc) -#endif +integer +G77_fput_0 (const char *c, const ftnlen Lc) { integer six = 6; diff --git a/gnu/lib/libf2c/libU77/fstat_.c b/gnu/lib/libf2c/libU77/fstat_.c index da5434ad0b7..e978c6adb2e 100644 --- a/gnu/lib/libf2c/libU77/fstat_.c +++ b/gnu/lib/libf2c/libU77/fstat_.c @@ -26,17 +26,10 @@ Boston, MA 02111-1307, USA. */ #include <sys/types.h> #include <sys/stat.h> -#ifdef KR_headers -extern integer G77_fnum_0 (); - -integer G77_fstat_0 (lunit, statb) - integer *lunit; - integer statb[13]; -#else extern integer G77_fnum_0 (const integer *); -integer G77_fstat_0 (const integer *lunit, integer statb[13]) -#endif +integer +G77_fstat_0 (const integer * lunit, integer statb[13]) { int err; struct stat buf; diff --git a/gnu/lib/libf2c/libU77/gerror_.c b/gnu/lib/libf2c/libU77/gerror_.c index 6f5943c1dce..252440dc85b 100644 --- a/gnu/lib/libf2c/libU77/gerror_.c +++ b/gnu/lib/libf2c/libU77/gerror_.c @@ -29,21 +29,16 @@ Boston, MA 02111-1307, USA. */ #include "f2c.h" #ifndef HAVE_STRERROR - extern char *sys_errlist []; +extern char *sys_errlist[]; # define strerror(i) (sys_errlist[i]) #endif -#ifdef KR_headers -extern void s_copy (); -/* Subroutine */ int G77_gerror_0 (str, Lstr) - char *str; ftnlen Lstr; -#else -extern void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb); -/* Subroutine */ int G77_gerror_0 (char *str, ftnlen Lstr) -#endif +extern void s_copy (register char *a, register char *b, ftnlen la, ftnlen lb); +/* Subroutine */ int +G77_gerror_0 (char *str, ftnlen Lstr) { - char * s; + char *s; - s = strerror(errno); + s = strerror (errno); s_copy (str, s, Lstr, strlen (s)); return 0; } diff --git a/gnu/lib/libf2c/libU77/getcwd_.c b/gnu/lib/libf2c/libU77/getcwd_.c index e757803896a..75277af0f74 100644 --- a/gnu/lib/libf2c/libU77/getcwd_.c +++ b/gnu/lib/libf2c/libU77/getcwd_.c @@ -34,26 +34,22 @@ Boston, MA 02111-1307, USA. */ #ifdef HAVE_UNISTD_H # include <unistd.h> #else - extern char *getcwd (); +extern char *getcwd (); #endif -#ifdef KR_headers -extern void s_copy (); -integer G77_getcwd_0 (str, Lstr) - char *str; ftnlen Lstr; -#else -extern void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb); -integer G77_getcwd_0 (char *str, const ftnlen Lstr) -#endif +extern void s_copy (register char *a, register char *b, ftnlen la, ftnlen lb); +integer +G77_getcwd_0 (char *str, const ftnlen Lstr) { - int i; - char *ret; + int i; + char *ret; - ret = getcwd (str, Lstr); - if (ret == NULL) return errno; - for (i=strlen(str); i<Lstr; i++) - str[i] = ' '; - return 0; + ret = getcwd (str, Lstr); + if (ret == NULL) + return errno; + for (i = strlen (str); i < Lstr; i++) + str[i] = ' '; + return 0; } #elif HAVE_GETWD /* HAVE_GETCWD */ @@ -61,37 +57,30 @@ integer G77_getcwd_0 (char *str, const ftnlen Lstr) /* getwd usage taken from SunOS4 man */ # include <sys/param.h> - extern char *getwd (); -#ifdef KR_headers -extern VOID s_copy (); -integer G77_getcwd_0 (str, Lstr) - char *str; ftnlen Lstr; -#else -extern void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb); -integer G77_getcwd_0 (char *str, const ftnlen Lstr) -#endif +extern char *getwd (); +extern void s_copy (register char *a, register char *b, ftnlen la, ftnlen lb); +integer +G77_getcwd_0 (char *str, const ftnlen Lstr) { char pathname[MAXPATHLEN]; size_t l; - if (getwd (pathname) == NULL) { - return errno; - } else { - s_copy (str, pathname, Lstr, strlen (str)); - return 0; - } + if (getwd (pathname) == NULL) + { + return errno; + } + else + { + s_copy (str, pathname, Lstr, strlen (str)); + return 0; + } } -#else /* !HAVE_GETWD && !HAVE_GETCWD */ +#else /* !HAVE_GETWD && !HAVE_GETCWD */ -#ifdef KR_headers -extern VOID s_copy (); -integer G77_getcwd_0 (str, Lstr) - char *str; ftnlen Lstr; -#else -extern void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb); -integer G77_getcwd_0 (char *str, const ftnlen Lstr) -#endif +extern void s_copy (register char *a, register char *b, ftnlen la, ftnlen lb); +integer +G77_getcwd_0 (char *str, const ftnlen Lstr) { return errno = ENOSYS; } diff --git a/gnu/lib/libf2c/libU77/getgid_.c b/gnu/lib/libf2c/libU77/getgid_.c index b489bacc6ed..7dcbdf80b57 100644 --- a/gnu/lib/libf2c/libU77/getgid_.c +++ b/gnu/lib/libf2c/libU77/getgid_.c @@ -26,11 +26,8 @@ Boston, MA 02111-1307, USA. */ #include <errno.h> /* for ENOSYS */ #include "f2c.h" -#ifdef KR_headers -integer G77_getgid_0 () -#else -integer G77_getgid_0 (void) -#endif +integer +G77_getgid_0 (void) { #if defined (HAVE_GETGID) return getgid (); diff --git a/gnu/lib/libf2c/libU77/getlog_.c b/gnu/lib/libf2c/libU77/getlog_.c index 82cb564a67a..94c5f416067 100644 --- a/gnu/lib/libf2c/libU77/getlog_.c +++ b/gnu/lib/libf2c/libU77/getlog_.c @@ -41,14 +41,9 @@ Boston, MA 02111-1307, USA. */ /* SGI also has character*(*) function getlog() */ -#ifdef KR_headers -extern VOID s_copy (); -/* Subroutine */ int G77_getlog_0 (str, Lstr) - char *str; ftnlen Lstr; -#else -extern void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb); -/* Subroutine */ int G77_getlog_0 (char *str, const ftnlen Lstr) -#endif +extern void s_copy (register char *a, register char *b, ftnlen la, ftnlen lb); +/* Subroutine */ int +G77_getlog_0 (char *str, const ftnlen Lstr) { size_t i; char *p; @@ -56,12 +51,15 @@ extern void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb); #if defined (HAVE_GETLOGIN) p = getlogin (); - if (p != NULL) { - i = strlen (p); - s_copy (str, p, Lstr, i); - } else { - s_copy (str, " ", Lstr, 1); - } + if (p != NULL) + { + i = strlen (p); + s_copy (str, p, Lstr, i); + } + else + { + s_copy (str, " ", Lstr, 1); + } status = 0; #else errno = ENOSYS; diff --git a/gnu/lib/libf2c/libU77/getpid_.c b/gnu/lib/libf2c/libU77/getpid_.c index fa484785957..6f1d8d7eede 100644 --- a/gnu/lib/libf2c/libU77/getpid_.c +++ b/gnu/lib/libf2c/libU77/getpid_.c @@ -25,11 +25,8 @@ Boston, MA 02111-1307, USA. */ #include <sys/types.h> #include "f2c.h" -#ifdef KR_headers -integer G77_getpid_0 () -#else -integer G77_getpid_0 (void) -#endif +integer +G77_getpid_0 (void) { return getpid (); } diff --git a/gnu/lib/libf2c/libU77/getuid_.c b/gnu/lib/libf2c/libU77/getuid_.c index 408ff0ab600..d88b8e2cd9a 100644 --- a/gnu/lib/libf2c/libU77/getuid_.c +++ b/gnu/lib/libf2c/libU77/getuid_.c @@ -26,11 +26,8 @@ Boston, MA 02111-1307, USA. */ #include <errno.h> /* for ENOSYS */ #include "f2c.h" -#ifdef KR_headers -integer G77_getuid_0 () -#else -integer G77_getuid_0 (void) -#endif +integer +G77_getuid_0 (void) { #if defined (HAVE_GETUID) return getuid (); diff --git a/gnu/lib/libf2c/libU77/gmtime_.c b/gnu/lib/libf2c/libU77/gmtime_.c index 8036b5aabe4..9de3c5a8de5 100644 --- a/gnu/lib/libf2c/libU77/gmtime_.c +++ b/gnu/lib/libf2c/libU77/gmtime_.c @@ -33,12 +33,8 @@ Boston, MA 02111-1307, USA. */ #endif #include "f2c.h" -#ifdef KR_headers -/* Subroutine */ int G77_gmtime_0 (xstime, tarray) - integer *xstime, tarray[9]; -#else -/* Subroutine */ int G77_gmtime_0 (const integer * xstime, integer tarray[9]) -#endif +/* Subroutine */ int +G77_gmtime_0 (const integer * xstime, integer tarray[9]) { struct tm *lt; time_t stime = *xstime; diff --git a/gnu/lib/libf2c/libU77/hostnm_.c b/gnu/lib/libf2c/libU77/hostnm_.c index fd717b9f857..7f511f422bb 100644 --- a/gnu/lib/libf2c/libU77/hostnm_.c +++ b/gnu/lib/libf2c/libU77/hostnm_.c @@ -30,20 +30,22 @@ Boston, MA 02111-1307, USA. */ #include <errno.h> /* for ENOSYS */ #include "f2c.h" -integer G77_hostnm_0 (char *name, ftnlen Lname) +integer +G77_hostnm_0 (char *name, ftnlen Lname) { - int ret, i; + int ret, i; #if HAVE_GETHOSTNAME - ret = gethostname (name, Lname); - if (ret==0) { - /* Pad with blanks (assuming gethostname will make an error - return if it can't fit in the null). */ - for (i=strlen(name); i<Lname; i++) - name[i] = ' '; + ret = gethostname (name, Lname); + if (ret == 0) + { + /* Pad with blanks (assuming gethostname will make an error + return if it can't fit in the null). */ + for (i = strlen (name); i < Lname; i++) + name[i] = ' '; } - return ret; + return ret; #else - return errno = ENOSYS; + return errno = ENOSYS; #endif } diff --git a/gnu/lib/libf2c/libU77/idate_.c b/gnu/lib/libf2c/libU77/idate_.c index 572efd956eb..f2bea12e59d 100644 --- a/gnu/lib/libf2c/libU77/idate_.c +++ b/gnu/lib/libf2c/libU77/idate_.c @@ -37,17 +37,13 @@ Boston, MA 02111-1307, USA. */ /* libU77 one: */ -#ifdef KR_headers -/* Subroutine */ int G77_idate_0 (iarray) - int iarray[3]; -#else -/* Subroutine */ int G77_idate_0 (int iarray[3]) -#endif +/* Subroutine */ int +G77_idate_0 (int iarray[3]) { struct tm *lt; time_t tim; - tim = time(NULL); - lt = localtime(&tim); + tim = time (NULL); + lt = localtime (&tim); iarray[0] = lt->tm_mday; iarray[1] = lt->tm_mon + 1; /* in range 1-12 in SunOS (experimentally) */ /* The `+1900' is consistent with SunOS and Irix, but they don't say diff --git a/gnu/lib/libf2c/libU77/ierrno_.c b/gnu/lib/libf2c/libU77/ierrno_.c index 557b53a4664..0dc76b0262f 100644 --- a/gnu/lib/libf2c/libU77/ierrno_.c +++ b/gnu/lib/libf2c/libU77/ierrno_.c @@ -22,11 +22,8 @@ Boston, MA 02111-1307, USA. */ #include <errno.h> #include "f2c.h" -#ifdef KR_headers -integer G77_ierrno_0 () -#else -integer G77_ierrno_0 (void) -#endif +integer +G77_ierrno_0 (void) { return errno; } diff --git a/gnu/lib/libf2c/libU77/irand_.c b/gnu/lib/libf2c/libU77/irand_.c index 2bf14ccee26..a9054311515 100644 --- a/gnu/lib/libf2c/libU77/irand_.c +++ b/gnu/lib/libf2c/libU77/irand_.c @@ -31,27 +31,18 @@ Boston, MA 02111-1307, USA. */ /* Note this is per SunOS -- other s may have no arg. */ -#ifdef KR_headers -integer G77_irand_0 (flag) - integer *flag; -#else -integer G77_irand_0 (integer *flag) -#endif +integer +G77_irand_0 (integer * flag) { - switch (*flag) { - case 0: - break; - case 1: - srand (0); /* Arbitrary choice of initialiser. */ - break; - default: - srand (*flag); - } + switch (*flag) + { + case 0: + break; + case 1: + srand (0); /* Arbitrary choice of initialiser. */ + break; + default: + srand (*flag); + } return rand (); } - - - - - - diff --git a/gnu/lib/libf2c/libU77/isatty_.c b/gnu/lib/libf2c/libU77/isatty_.c index 92c33468f53..fa2f56dafab 100644 --- a/gnu/lib/libf2c/libU77/isatty_.c +++ b/gnu/lib/libf2c/libU77/isatty_.c @@ -25,20 +25,14 @@ Boston, MA 02111-1307, USA. */ #include "f2c.h" #include "fio.h" -#ifdef KR_headers -extern integer G77_fnum_0 (); - -logical G77_isatty_0 (lunit) - integer *lunit; -#else extern integer G77_fnum_0 (integer *); -logical G77_isatty_0 (integer *lunit) -#endif +logical +G77_isatty_0 (integer * lunit) { - if (*lunit>=MXUNIT || *lunit<0) - err(1,101,"isatty"); + if (*lunit >= MXUNIT || *lunit < 0) + err (1, 101, "isatty"); /* f__units is a table of descriptions for the unit numbers (defined in io.h) with file descriptors rather than streams */ - return (isatty(G77_fnum_0 (lunit)) ? TRUE_ : FALSE_); + return (isatty (G77_fnum_0 (lunit)) ? TRUE_ : FALSE_); } diff --git a/gnu/lib/libf2c/libU77/itime_.c b/gnu/lib/libf2c/libU77/itime_.c index ad47872dc8d..12a7864fd97 100644 --- a/gnu/lib/libf2c/libU77/itime_.c +++ b/gnu/lib/libf2c/libU77/itime_.c @@ -33,18 +33,14 @@ Boston, MA 02111-1307, USA. */ #endif #include "f2c.h" -#ifdef KR_headers -/* Subroutine */ int G77_itime_0 (tarray) - integer tarray[3]; -#else -/* Subroutine */ int G77_itime_0 (integer tarray[3]) -#endif +/* Subroutine */ int +G77_itime_0 (integer tarray[3]) { struct tm *lt; time_t tim; - tim = time(NULL); - lt = localtime(&tim); + tim = time (NULL); + lt = localtime (&tim); tarray[0] = lt->tm_hour; tarray[1] = lt->tm_min; tarray[2] = lt->tm_sec; diff --git a/gnu/lib/libf2c/libU77/kill_.c b/gnu/lib/libf2c/libU77/kill_.c index 99197bd02e7..41eab152cbf 100644 --- a/gnu/lib/libf2c/libU77/kill_.c +++ b/gnu/lib/libf2c/libU77/kill_.c @@ -26,15 +26,11 @@ Boston, MA 02111-1307, USA. */ /* fixme: bsd, svr1-3 use int, not pid_t */ -#ifdef KR_headers -integer G77_kill_0 (pid, signum) - integer *pid, *signum; -#else -integer G77_kill_0 (const integer *pid, const integer *signum) -#endif +integer +G77_kill_0 (const integer * pid, const integer * signum) { #if defined (HAVE_KILL) - return kill ((pid_t) *pid, *signum) ? errno : 0; + return kill ((pid_t) * pid, *signum) ? errno : 0; #else errno = ENOSYS; return -1; diff --git a/gnu/lib/libf2c/libU77/link_.c b/gnu/lib/libf2c/libU77/link_.c index 003fac8ffe2..f3070e4b6e9 100644 --- a/gnu/lib/libf2c/libU77/link_.c +++ b/gnu/lib/libf2c/libU77/link_.c @@ -34,30 +34,27 @@ Boston, MA 02111-1307, USA. */ #include <errno.h> /* for ENOSYS */ #include "f2c.h" -#ifdef KR_headers -void g_char (); +void g_char (const char *a, ftnlen alen, char *b); -integer G77_link_0 (path1, path2, Lpath1, Lpath2) - char *path1, *path2; ftnlen Lpath1, Lpath2; -#else -void g_char(const char *a, ftnlen alen, char *b); - -integer G77_link_0 (const char *path1, const char *path2, const ftnlen Lpath1, const ftnlen Lpath2) -#endif +integer +G77_link_0 (const char *path1, const char *path2, const ftnlen Lpath1, + const ftnlen Lpath2) { #if defined (HAVE_LINK) char *buff1, *buff2; - char *bp, *blast; int i; - buff1 = malloc (Lpath1+1); - if (buff1 == NULL) return -1; + buff1 = malloc (Lpath1 + 1); + if (buff1 == NULL) + return -1; g_char (path1, Lpath1, buff1); - buff2 = malloc (Lpath2+1); - if (buff2 == NULL) return -1; + buff2 = malloc (Lpath2 + 1); + if (buff2 == NULL) + return -1; g_char (path2, Lpath2, buff2); i = link (buff1, buff2); - free (buff1); free (buff2); + free (buff1); + free (buff2); return i ? errno : 0; #else /* ! HAVE_LINK */ errno = ENOSYS; diff --git a/gnu/lib/libf2c/libU77/lnblnk_.c b/gnu/lib/libf2c/libU77/lnblnk_.c index 806eca293f1..f21ac42398b 100644 --- a/gnu/lib/libf2c/libU77/lnblnk_.c +++ b/gnu/lib/libf2c/libU77/lnblnk_.c @@ -21,15 +21,18 @@ Boston, MA 02111-1307, USA. */ #include "f2c.h" -integer G77_lnblnk_0 (char *str, ftnlen str_len) +integer +G77_lnblnk_0 (char *str, ftnlen str_len) { - integer ret_val; - integer i_len(); - - for (ret_val = str_len; ret_val >= 1; --ret_val) { - if (*(unsigned char *)&str[ret_val - 1] != ' ') { - return ret_val; + integer ret_val; + integer i_len (); + + for (ret_val = str_len; ret_val >= 1; --ret_val) + { + if (*(unsigned char *) &str[ret_val - 1] != ' ') + { + return ret_val; } } - return ret_val; + return ret_val; } diff --git a/gnu/lib/libf2c/libU77/lstat_.c b/gnu/lib/libf2c/libU77/lstat_.c index 801f6aad1af..3914cc64ff4 100644 --- a/gnu/lib/libf2c/libU77/lstat_.c +++ b/gnu/lib/libf2c/libU77/lstat_.c @@ -30,27 +30,19 @@ Boston, MA 02111-1307, USA. */ /* lstat isn't posix */ -#ifdef KR_headers -void g_char(); +void g_char (const char *a, ftnlen alen, char *b); -integer G77_lstat_0 (name, statb, Lname) - char *name; - integer statb[13]; - ftnlen Lname; -#else -void g_char(const char *a, ftnlen alen, char *b); - -integer G77_lstat_0 (const char *name, integer statb[13], const ftnlen Lname) -#endif +integer +G77_lstat_0 (const char *name, integer statb[13], const ftnlen Lname) { #if HAVE_LSTAT char *buff; - char *bp, *blast; int err; struct stat buf; - buff = malloc (Lname+1); - if (buff == NULL) return -1; + buff = malloc (Lname + 1); + if (buff == NULL) + return -1; g_char (name, Lname, buff); err = lstat (buff, &buf); free (buff); @@ -80,7 +72,7 @@ integer G77_lstat_0 (const char *name, integer statb[13], const ftnlen Lname) statb[12] = -1; #endif return err; -#else /* !HAVE_LSTAT */ +#else /* !HAVE_LSTAT */ return errno = ENOSYS; -#endif /* !HAVE_LSTAT */ +#endif /* !HAVE_LSTAT */ } diff --git a/gnu/lib/libf2c/libU77/ltime_.c b/gnu/lib/libf2c/libU77/ltime_.c index d4afa878cea..008df1dd08d 100644 --- a/gnu/lib/libf2c/libU77/ltime_.c +++ b/gnu/lib/libf2c/libU77/ltime_.c @@ -33,12 +33,8 @@ Boston, MA 02111-1307, USA. */ #endif #include "f2c.h" -#ifdef KR_headers -/* Subroutine */ int G77_ltime_0 (xstime, tarray) - integer *xstime, tarray[9]; -#else -/* Subroutine */ int G77_ltime_0 (const integer * xstime, integer tarray[9]) -#endif +/* Subroutine */ int +G77_ltime_0 (const integer * xstime, integer tarray[9]) { struct tm *lt; time_t stime = *xstime; diff --git a/gnu/lib/libf2c/libU77/mclock_.c b/gnu/lib/libf2c/libU77/mclock_.c index 6b7e81b1e04..686c4906751 100644 --- a/gnu/lib/libf2c/libU77/mclock_.c +++ b/gnu/lib/libf2c/libU77/mclock_.c @@ -33,11 +33,8 @@ Boston, MA 02111-1307, USA. */ /* Reported by wd42ej@sgi83.wwb.noaa.gov (Russ Jones AUTO-Sun3) on AIX. */ -#ifdef KR_headers -longint G77_mclock_0 () -#else -longint G77_mclock_0 (void) -#endif +longint +G77_mclock_0 (void) { #if HAVE_CLOCK return clock (); diff --git a/gnu/lib/libf2c/libU77/perror_.c b/gnu/lib/libf2c/libU77/perror_.c index 26d8582dbcc..6fe96aa6fc2 100644 --- a/gnu/lib/libf2c/libU77/perror_.c +++ b/gnu/lib/libf2c/libU77/perror_.c @@ -28,19 +28,15 @@ Boston, MA 02111-1307, USA. */ #endif #include "f2c.h" -#ifdef KR_headers -/* Subroutine */ int G77_perror_0 (str, Lstr) - char *str; ftnlen Lstr; -#else -/* Subroutine */ int G77_perror_0 (const char *str, const ftnlen Lstr) -#endif +/* Subroutine */ int +G77_perror_0 (const char *str, const ftnlen Lstr) { char buff[1000]; char *bp, *blast; /* same technique as `system' -- what's wrong with malloc? */ blast = buff + (Lstr < 1000 ? Lstr : 1000); - for (bp = buff ; bp<blast && *str!='\0' ; ) + for (bp = buff; bp < blast && *str != '\0';) *bp++ = *str++; *bp = '\0'; perror (buff); diff --git a/gnu/lib/libf2c/libU77/rand_.c b/gnu/lib/libf2c/libU77/rand_.c index 165aee1220c..1592dc5ab38 100644 --- a/gnu/lib/libf2c/libU77/rand_.c +++ b/gnu/lib/libf2c/libU77/rand_.c @@ -34,21 +34,18 @@ Boston, MA 02111-1307, USA. */ /* Note this is per SunOS -- other s may have no arg. */ -#ifdef KR_headers -double G77_rand_0 (flag) - integer *flag; -#else -double G77_rand_0 (integer *flag) -#endif +double +G77_rand_0 (integer * flag) { - switch (*flag) { - case 0: - break; - case 1: - srand (0); /* Arbitrary choice of initialiser. */ - break; - default: - srand (*flag); - } + switch (*flag) + { + case 0: + break; + case 1: + srand (0); /* Arbitrary choice of initialiser. */ + break; + default: + srand (*flag); + } return (float) rand () / RAND_MAX; } diff --git a/gnu/lib/libf2c/libU77/rename_.c b/gnu/lib/libf2c/libU77/rename_.c index 9583001c421..59759bcfb54 100644 --- a/gnu/lib/libf2c/libU77/rename_.c +++ b/gnu/lib/libf2c/libU77/rename_.c @@ -29,28 +29,25 @@ Boston, MA 02111-1307, USA. */ #include <errno.h> #include "f2c.h" -#ifdef KR_headers -void g_char (); +void g_char (const char *a, ftnlen alen, char *b); -integer G77_rename_0 (path1, path2, Lpath1, Lpath2) - char *path1, *path2; ftnlen Lpath1, Lpath2; -#else -void g_char(const char *a, ftnlen alen, char *b); - -integer G77_rename_0 (const char *path1, const char *path2, const ftnlen Lpath1, const ftnlen Lpath2) -#endif +integer +G77_rename_0 (const char *path1, const char *path2, const ftnlen Lpath1, + const ftnlen Lpath2) { char *buff1, *buff2; - char *bp, *blast; int i; - buff1 = malloc (Lpath1+1); - if (buff1 == NULL) return -1; + buff1 = malloc (Lpath1 + 1); + if (buff1 == NULL) + return -1; g_char (path1, Lpath1, buff1); - buff2 = malloc (Lpath2+1); - if (buff2 == NULL) return -1; + buff2 = malloc (Lpath2 + 1); + if (buff2 == NULL) + return -1; g_char (path2, Lpath2, buff2); i = rename (buff1, buff2); - free (buff1); free (buff2); + free (buff1); + free (buff2); return i ? errno : 0; } diff --git a/gnu/lib/libf2c/libU77/secnds_.c b/gnu/lib/libf2c/libU77/secnds_.c index 1942528530f..1d661a9ad6b 100644 --- a/gnu/lib/libf2c/libU77/secnds_.c +++ b/gnu/lib/libf2c/libU77/secnds_.c @@ -36,16 +36,16 @@ Boston, MA 02111-1307, USA. */ /* This is a VMS intrinsic. */ -double G77_secnds_0 (real *r) +double +G77_secnds_0 (real * r) { - struct tm *lt; - time_t clock; - float f; - - clock = time (NULL); - lt = localtime (&clock); - f= (3600.0*((real)lt->tm_hour) + 60.0*((real)lt->tm_min) + - (real)lt->tm_sec - *r); - return f; + struct tm *lt; + time_t clock; + float f; + + clock = time (NULL); + lt = localtime (&clock); + f = (3600.0 * ((real) lt->tm_hour) + 60.0 * ((real) lt->tm_min) + + (real) lt->tm_sec - *r); + return f; } - diff --git a/gnu/lib/libf2c/libU77/second_.c b/gnu/lib/libf2c/libU77/second_.c index 41bb5a90a92..b40474a49a7 100644 --- a/gnu/lib/libf2c/libU77/second_.c +++ b/gnu/lib/libf2c/libU77/second_.c @@ -18,7 +18,9 @@ Boston, MA 02111-1307, USA. */ #include "f2c.h" -double G77_second_0 () { +double +G77_second_0 () +{ extern double G77_etime_0 (); real tarray[2]; diff --git a/gnu/lib/libf2c/libU77/sleep_.c b/gnu/lib/libf2c/libU77/sleep_.c index 36e1b8d9a7b..fcf112a1c6a 100644 --- a/gnu/lib/libf2c/libU77/sleep_.c +++ b/gnu/lib/libf2c/libU77/sleep_.c @@ -25,12 +25,8 @@ Boston, MA 02111-1307, USA. */ #include "f2c.h" /* Subroutine */ -#ifdef KR_headers -int G77_sleep_0 (seconds) - integer *seconds; -#else -int G77_sleep_0 (const integer *seconds) -#endif +int +G77_sleep_0 (const integer * seconds) { (void) sleep ((unsigned int) *seconds); return 0; diff --git a/gnu/lib/libf2c/libU77/srand_.c b/gnu/lib/libf2c/libU77/srand_.c index 8edc62e4fe0..822d980dd0f 100644 --- a/gnu/lib/libf2c/libU77/srand_.c +++ b/gnu/lib/libf2c/libU77/srand_.c @@ -24,13 +24,9 @@ Boston, MA 02111-1307, USA. */ #endif #include "f2c.h" -/* Subroutine */ -#ifdef KR_headers -int G77_srand_0 (seed) - integer *seed; -#else -int G77_srand_0 (const integer *seed) -#endif +/* Subroutine */ +int +G77_srand_0 (const integer * seed) { srand ((unsigned int) *seed); return 0; diff --git a/gnu/lib/libf2c/libU77/stat_.c b/gnu/lib/libf2c/libU77/stat_.c index b24f3892221..65a63b7c9f5 100644 --- a/gnu/lib/libf2c/libU77/stat_.c +++ b/gnu/lib/libf2c/libU77/stat_.c @@ -27,26 +27,18 @@ Boston, MA 02111-1307, USA. */ #include <sys/stat.h> #include "f2c.h" -#ifdef KR_headers -void g_char (); +void g_char (const char *a, ftnlen alen, char *b); -integer G77_stat_0 (name, statb, Lname) - char *name; - integer statb[13]; - ftnlen Lname; -#else -void g_char(const char *a, ftnlen alen, char *b); - -integer G77_stat_0 (const char *name, integer statb[13], const ftnlen Lname) -#endif +integer +G77_stat_0 (const char *name, integer statb[13], const ftnlen Lname) { char *buff; - char *bp, *blast; int err; struct stat buf; - buff = malloc (Lname+1); - if (buff == NULL) return -1; + buff = malloc (Lname + 1); + if (buff == NULL) + return -1; g_char (name, Lname, buff); err = stat (buff, &buf); free (buff); diff --git a/gnu/lib/libf2c/libU77/symlnk_.c b/gnu/lib/libf2c/libU77/symlnk_.c index 4b0bf24541d..92ec605a423 100644 --- a/gnu/lib/libf2c/libU77/symlnk_.c +++ b/gnu/lib/libf2c/libU77/symlnk_.c @@ -33,32 +33,29 @@ Boston, MA 02111-1307, USA. */ #endif #include "f2c.h" -#ifdef KR_headers -void g_char (); +void g_char (const char *a, ftnlen alen, char *b); -integer G77_symlnk_0 (path1, path2, Lpath1, Lpath2) - char *path1, *path2; ftnlen Lpath1, Lpath2; -#else -void g_char(const char *a, ftnlen alen, char *b); - -integer G77_symlnk_0 (const char *path1, const char *path2, const ftnlen Lpath1, const ftnlen Lpath2) -#endif +integer +G77_symlnk_0 (const char *path1, const char *path2, const ftnlen Lpath1, + const ftnlen Lpath2) { #if HAVE_SYMLINK char *buff1, *buff2; - char *bp, *blast; int i; - buff1 = (char *) malloc (Lpath1+1); - if (buff1 == NULL) return -1; + buff1 = (char *) malloc (Lpath1 + 1); + if (buff1 == NULL) + return -1; g_char (path1, Lpath1, buff1); - buff2 = (char *) malloc (Lpath2+1); - if (buff2 == NULL) return -1; + buff2 = (char *) malloc (Lpath2 + 1); + if (buff2 == NULL) + return -1; g_char (path2, Lpath2, buff2); i = symlink (buff1, buff2); - free (buff1); free (buff2); + free (buff1); + free (buff2); return i ? errno : 0; -#else /* !HAVE_SYMLINK */ +#else /* !HAVE_SYMLINK */ return errno = ENOSYS; -#endif /* !HAVE_SYMLINK */ +#endif /* !HAVE_SYMLINK */ } diff --git a/gnu/lib/libf2c/libU77/sys_clock_.c b/gnu/lib/libf2c/libU77/sys_clock_.c index 86ee2fdefd5..ea39eead4f0 100644 --- a/gnu/lib/libf2c/libU77/sys_clock_.c +++ b/gnu/lib/libf2c/libU77/sys_clock_.c @@ -43,31 +43,29 @@ Boston, MA 02111-1307, USA. */ #include <errno.h> /* for ENOSYS */ #include "f2c.h" -#ifdef KR_headers -int G77_system_clock_0 (count, count_rate, count_max) - integer *count, *count_rate, *count_max; -#else -int G77_system_clock_0 (integer *count, integer *count_rate, integer *count_max) -#endif +int +G77_system_clock_0 (integer * count, integer * count_rate, + integer * count_max) { #if defined (HAVE_TIMES) struct tms buffer; unsigned long cnt; - if (count_rate) { + if (count_rate) + { #ifdef _SC_CLK_TCK - *count_rate = sysconf(_SC_CLK_TCK); + *count_rate = sysconf (_SC_CLK_TCK); #elif defined CLOCKS_PER_SECOND - *count_rate = CLOCKS_PER_SECOND; + *count_rate = CLOCKS_PER_SECOND; #elif defined CLK_TCK - *count_rate = CLK_TCK; + *count_rate = CLK_TCK; #elif defined HZ - *count_rate = HZ; + *count_rate = HZ; #else #error Dont know clock tick length #endif - } + } if (count_max) /* optional arg present? */ - *count_max = INT_MAX; /* dubious */ + *count_max = INT_MAX; /* dubious */ cnt = times (&buffer); if (cnt > (unsigned long) (INT_MAX)) *count = INT_MAX; /* also dubious */ diff --git a/gnu/lib/libf2c/libU77/time_.c b/gnu/lib/libf2c/libU77/time_.c index 73894b0b413..2eb8a413991 100644 --- a/gnu/lib/libf2c/libU77/time_.c +++ b/gnu/lib/libf2c/libU77/time_.c @@ -35,11 +35,8 @@ Boston, MA 02111-1307, USA. */ /* As well as this external function some compilers have an intrinsic subroutine which fills a character argument (which is the VMS way) -- caveat emptor. */ -#ifdef KR_headers -longint G77_time_0 () -#else -longint G77_time_0 (void) -#endif +longint +G77_time_0 (void) { /* There are potential problems with the cast of the time_t here. */ return time (NULL); diff --git a/gnu/lib/libf2c/libU77/ttynam_.c b/gnu/lib/libf2c/libU77/ttynam_.c index c7610fb0c87..ffdf5bfdf9a 100644 --- a/gnu/lib/libf2c/libU77/ttynam_.c +++ b/gnu/lib/libf2c/libU77/ttynam_.c @@ -35,28 +35,25 @@ Boston, MA 02111-1307, USA. */ #include <errno.h> /* for ENOSYS */ #include "f2c.h" -#ifdef KR_headers -extern void s_copy (); -extern integer G77_fnum_0 (); -/* Character */ void G77_ttynam_0 (ret_val, ret_val_len, lunit) - char *ret_val; ftnlen ret_val_len; integer *lunit -#else -extern integer G77_fnum_0 (integer *lunit); -extern void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb); -/* Character */ void G77_ttynam_0 (char *ret_val, ftnlen ret_val_len, integer *lunit) -#endif +extern integer G77_fnum_0 (integer * lunit); +extern void s_copy (register char *a, register char *b, ftnlen la, ftnlen lb); +/* Character */ void +G77_ttynam_0 (char *ret_val, ftnlen ret_val_len, integer * lunit) { #if defined (HAVE_TTYNAME) size_t i; char *p; p = ttyname (G77_fnum_0 (lunit)); - if (p != NULL) { - i = strlen (p); - s_copy (ret_val, p, ret_val_len, i); - } else { - s_copy (ret_val, " ", ret_val_len, 1); - } + if (p != NULL) + { + i = strlen (p); + s_copy (ret_val, p, ret_val_len, i); + } + else + { + s_copy (ret_val, " ", ret_val_len, 1); + } #else errno = ENOSYS; s_copy (ret_val, " ", ret_val_len, 1); diff --git a/gnu/lib/libf2c/libU77/umask_.c b/gnu/lib/libf2c/libU77/umask_.c index 203acfa916f..5c4546a83ac 100644 --- a/gnu/lib/libf2c/libU77/umask_.c +++ b/gnu/lib/libf2c/libU77/umask_.c @@ -23,12 +23,8 @@ Boston, MA 02111-1307, USA. */ #include <sys/stat.h> #include "f2c.h" -#ifdef KR_headers -integer G77_umask_0 (mask) - integer *mask; -#else -integer G77_umask_0 (integer *mask) -#endif +integer +G77_umask_0 (integer * mask) { - return umask ((mode_t) *mask); + return umask ((mode_t) * mask); } diff --git a/gnu/lib/libf2c/libU77/unlink_.c b/gnu/lib/libf2c/libU77/unlink_.c index cd00559b29a..08222d92749 100644 --- a/gnu/lib/libf2c/libU77/unlink_.c +++ b/gnu/lib/libf2c/libU77/unlink_.c @@ -33,23 +33,17 @@ Boston, MA 02111-1307, USA. */ #endif #include "f2c.h" -#ifdef KR_headers -void g_char (); +void g_char (const char *a, ftnlen alen, char *b); -integer G77_unlink_0 (str, Lstr) - char *str; ftnlen Lstr; -#else -void g_char(const char *a, ftnlen alen, char *b); - -integer G77_unlink_0 (const char *str, const ftnlen Lstr) -#endif +integer +G77_unlink_0 (const char *str, const ftnlen Lstr) { char *buff; - char *bp, *blast; int i; - buff = malloc (Lstr+1); - if (buff == NULL) return -1; + buff = malloc (Lstr + 1); + if (buff == NULL) + return -1; g_char (str, Lstr, buff); i = unlink (buff); free (buff); diff --git a/gnu/lib/libf2c/libU77/vxtidate_.c b/gnu/lib/libf2c/libU77/vxtidate_.c index e5963af42e6..0563a9120d6 100644 --- a/gnu/lib/libf2c/libU77/vxtidate_.c +++ b/gnu/lib/libf2c/libU77/vxtidate_.c @@ -38,34 +38,28 @@ Boston, MA 02111-1307, USA. */ /* VMS style: */ /* Subroutine */ -#ifdef KR_headers -int G77_vxtidate_y2kbug_0 (m, d, y) - integer *y, *m, *d; -#else -int G77_vxtidate_y2kbug_0 (integer *m, integer *d, integer *y) -#endif +int +G77_vxtidate_y2kbug_0 (integer * m, integer * d, integer * y) { struct tm *lt; time_t tim; - tim = time(NULL); - lt = localtime(&tim); + tim = time (NULL); + lt = localtime (&tim); *y = lt->tm_year % 100; - *m = lt->tm_mon+1; + *m = lt->tm_mon + 1; *d = lt->tm_mday; return 0; } #ifdef PIC extern const char *G77_Non_Y2K_Compliance_Message; -# ifdef KR_headers -int G77_vxtidate_y2kbuggy_0 (m, d, y) - integer *y, *m, *d; -# else -int G77_vxtidate_y2kbuggy_0 (integer *m, integer *d, integer *y) -# endif +int +G77_vxtidate_y2kbuggy_0 (integer * m __attribute__ ((__unused__)), + integer * d __attribute__ ((__unused__)), + integer * y __attribute__ ((__unused__))) { - extern int G77_abort_0(); + extern int G77_abort_0 (); fprintf (stderr, "%s\n", G77_Non_Y2K_Compliance_Message); - G77_abort_0(); + G77_abort_0 (); } #endif diff --git a/gnu/lib/libf2c/libU77/vxttime_.c b/gnu/lib/libf2c/libU77/vxttime_.c index e45cc05d055..5982748583a 100644 --- a/gnu/lib/libf2c/libU77/vxttime_.c +++ b/gnu/lib/libf2c/libU77/vxttime_.c @@ -39,17 +39,13 @@ Boston, MA 02111-1307, USA. */ #include "f2c.h" /* Subroutine */ -#ifdef KR_headers -void G77_vxttime_0 (chtime, Lchtime) - char chtime[8]; - ftnlen Lchtime; -#else -void G77_vxttime_0 (char chtime[8], const ftnlen Lchtime) -#endif +void +G77_vxttime_0 (char chtime[8], + const ftnlen Lchtime __attribute__ ((__unused__))) { time_t tim; char *ctim; - tim = time(NULL); + tim = time (NULL); ctim = ctime (&tim); - strncpy (chtime, ctim+11, 8); + strncpy (chtime, ctim + 11, 8); } |