Commit 4d85a6fe by Kaveh R. Ghazi Committed by Kaveh Ghazi

*: Delete KR_headers cruft.

	* libF77/*: Delete KR_headers cruft.
	* libI77/*: Likewise.
	* libU77/*: Likewise.

From-SVN: r54132
parent 1e730c5c
Fri May 31 21:50:01 2002 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* libF77/*: Delete KR_headers cruft.
* libI77/*: Likewise.
* libU77/*: Likewise.
Thu May 30 23:04:52 2002 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> Thu May 30 23:04:52 2002 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Makefile.in (WARN_CFLAGS): New. * Makefile.in (WARN_CFLAGS): New.
......
...@@ -6,13 +6,6 @@ ...@@ -6,13 +6,6 @@
static integer memfailure = 3; static integer memfailure = 3;
#ifdef KR_headers
extern char *malloc();
extern void G77_exit_0 ();
char *
F77_aloc(Len, whence) integer Len; char *whence;
#else
#include <stdlib.h> #include <stdlib.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
...@@ -24,7 +17,6 @@ extern void G77_exit_0 (integer*); ...@@ -24,7 +17,6 @@ extern void G77_exit_0 (integer*);
char * char *
F77_aloc(integer Len, char *whence) F77_aloc(integer Len, char *whence)
#endif
{ {
char *rv; char *rv;
unsigned int uLen = (unsigned int) Len; /* for K&R C */ unsigned int uLen = (unsigned int) Len; /* for K&R C */
......
#include <stdio.h> #include <stdio.h>
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
extern VOID sig_die();
int G77_abort_0 ()
#else
extern void sig_die(char*,int); extern void sig_die(char*,int);
int G77_abort_0 (void) int G77_abort_0 (void)
#endif
{ {
sig_die("Fortran abort routine called", 1); sig_die("Fortran abort routine called", 1);
return 0; /* not reached */ return 0; /* not reached */
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
extern double f__cabs();
double c_abs(z) complex *z;
#else
extern double f__cabs(double, double); extern double f__cabs(double, double);
double c_abs(complex *z) double c_abs(complex *z)
#endif
{ {
return( f__cabs( z->r, z->i ) ); return( f__cabs( z->r, z->i ) );
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
extern double sin(), cos(), sinh(), cosh();
VOID c_cos(r, z) complex *r, *z;
#else
#undef abs #undef abs
#include "math.h" #include "math.h"
void c_cos(complex *r, complex *z) void c_cos(complex *r, complex *z)
#endif
{ {
double zi = z->i, zr = z->r; double zi = z->i, zr = z->r;
r->r = cos(zr) * cosh(zi); r->r = cos(zr) * cosh(zi);
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
extern VOID sig_die();
VOID c_div(c, a, b)
complex *a, *b, *c;
#else
extern void sig_die(char*,int); extern void sig_die(char*,int);
void c_div(complex *c, complex *a, complex *b) void c_div(complex *c, complex *a, complex *b)
#endif
{ {
double ratio, den; double ratio, den;
double abr, abi, cr; double abr, abi, cr;
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
extern double exp(), cos(), sin();
VOID c_exp(r, z) complex *r, *z;
#else
#undef abs #undef abs
#include "math.h" #include "math.h"
void c_exp(complex *r, complex *z) void c_exp(complex *r, complex *z)
#endif
{ {
double expx, zi = z->i; double expx, zi = z->i;
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
extern double log(), f__cabs(), atan2();
VOID c_log(r, z) complex *r, *z;
#else
#undef abs #undef abs
#include "math.h" #include "math.h"
extern double f__cabs(double, double); extern double f__cabs(double, double);
void c_log(complex *r, complex *z) void c_log(complex *r, complex *z)
#endif
{ {
double zi, zr; double zi, zr;
r->i = atan2(zi = z->i, zr = z->r); r->i = atan2(zi = z->i, zr = z->r);
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
extern double sin(), cos(), sinh(), cosh();
VOID c_sin(r, z) complex *r, *z;
#else
#undef abs #undef abs
#include "math.h" #include "math.h"
void c_sin(complex *r, complex *z) void c_sin(complex *r, complex *z)
#endif
{ {
double zi = z->i, zr = z->r; double zi = z->i, zr = z->r;
r->r = sin(zr) * cosh(zi); r->r = sin(zr) * cosh(zi);
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
extern double sqrt(), f__cabs();
VOID c_sqrt(r, z) complex *r, *z;
#else
#undef abs #undef abs
#include "math.h" #include "math.h"
extern double f__cabs(double, double); extern double f__cabs(double, double);
void c_sqrt(complex *r, complex *z) void c_sqrt(complex *r, complex *z)
#endif
{ {
double mag, t; double mag, t;
double zi = z->i, zr = z->r; double zi = z->i, zr = z->r;
......
#ifdef KR_headers
extern double sqrt();
double f__cabs(real, imag) double real, imag;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
double f__cabs(double real, double imag) double f__cabs(double real, double imag)
#endif
{ {
double temp; double temp;
......
...@@ -56,17 +56,6 @@ the G77 runtime system. If necessary, install gcc now with \`LANGUAGES=c', ...@@ -56,17 +56,6 @@ the G77 runtime system. If necessary, install gcc now with \`LANGUAGES=c',
then the target library, then build with \`LANGUAGES=f77'.])]) then the target library, then build with \`LANGUAGES=f77'.])])
AC_HEADER_STDC 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(g77_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 g77_cv_sys_proto=yes,
dnl [g77_cv_sys_proto=no
dnl AC_DEFINE(KR_headers)])])
dnl AC_MSG_RESULT($g77_cv_sys_proto)
AC_MSG_CHECKING(for posix) AC_MSG_CHECKING(for posix)
AC_CACHE_VAL(g77_cv_header_posix, AC_CACHE_VAL(g77_cv_header_posix,
AC_EGREP_CPP(yes, AC_EGREP_CPP(yes,
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double d_abs(x) doublereal *x;
#else
double d_abs(doublereal *x) double d_abs(doublereal *x)
#endif
{ {
if(*x >= 0) if(*x >= 0)
return(*x); return(*x);
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double acos();
double d_acos(x) doublereal *x;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
double d_acos(doublereal *x) double d_acos(doublereal *x)
#endif
{ {
return( acos(*x) ); return( acos(*x) );
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double asin();
double d_asin(x) doublereal *x;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
double d_asin(doublereal *x) double d_asin(doublereal *x)
#endif
{ {
return( asin(*x) ); return( asin(*x) );
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double atan();
double d_atan(x) doublereal *x;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
double d_atan(doublereal *x) double d_atan(doublereal *x)
#endif
{ {
return( atan(*x) ); return( atan(*x) );
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double atan2();
double d_atn2(x,y) doublereal *x, *y;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
double d_atn2(doublereal *x, doublereal *y) double d_atn2(doublereal *x, doublereal *y)
#endif
{ {
return( atan2(*x,*y) ); return( atan2(*x,*y) );
} }
#include "f2c.h" #include "f2c.h"
VOID VOID
#ifdef KR_headers
d_cnjg(r, z) doublecomplex *r, *z;
#else
d_cnjg(doublecomplex *r, doublecomplex *z) d_cnjg(doublecomplex *r, doublecomplex *z)
#endif
{ {
doublereal zi = z->i; doublereal zi = z->i;
r->r = z->r; r->r = z->r;
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double cos();
double d_cos(x) doublereal *x;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
double d_cos(doublereal *x) double d_cos(doublereal *x)
#endif
{ {
return( cos(*x) ); return( cos(*x) );
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double cosh();
double d_cosh(x) doublereal *x;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
double d_cosh(doublereal *x) double d_cosh(doublereal *x)
#endif
{ {
return( cosh(*x) ); return( cosh(*x) );
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double d_dim(a,b) doublereal *a, *b;
#else
double d_dim(doublereal *a, doublereal *b) double d_dim(doublereal *a, doublereal *b)
#endif
{ {
return( *a > *b ? *a - *b : 0); return( *a > *b ? *a - *b : 0);
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double exp();
double d_exp(x) doublereal *x;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
double d_exp(doublereal *x) double d_exp(doublereal *x)
#endif
{ {
return( exp(*x) ); return( exp(*x) );
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double d_imag(z) doublecomplex *z;
#else
double d_imag(doublecomplex *z) double d_imag(doublecomplex *z)
#endif
{ {
return(z->i); return(z->i);
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double floor();
double d_int(x) doublereal *x;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
double d_int(doublereal *x) double d_int(doublereal *x)
#endif
{ {
return( (*x>0) ? floor(*x) : -floor(- *x) ); return( (*x>0) ? floor(*x) : -floor(- *x) );
} }
...@@ -2,14 +2,9 @@ ...@@ -2,14 +2,9 @@
#define log10e 0.43429448190325182765 #define log10e 0.43429448190325182765
#ifdef KR_headers
double log();
double d_lg10(x) doublereal *x;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
double d_lg10(doublereal *x) double d_lg10(doublereal *x)
#endif
{ {
return( log10e * log(*x) ); return( log10e * log(*x) );
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double log();
double d_log(x) doublereal *x;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
double d_log(doublereal *x) double d_log(doublereal *x)
#endif
{ {
return( log(*x) ); return( log(*x) );
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
#ifdef IEEE_drem
double drem();
#else
double floor();
#endif
double d_mod(x,y) doublereal *x, *y;
#else
#ifdef IEEE_drem #ifdef IEEE_drem
double drem(double, double); double drem(double, double);
#else #else
...@@ -15,7 +7,6 @@ double drem(double, double); ...@@ -15,7 +7,6 @@ double drem(double, double);
#include <math.h> #include <math.h>
#endif #endif
double d_mod(doublereal *x, doublereal *y) double d_mod(doublereal *x, doublereal *y)
#endif
{ {
#ifdef IEEE_drem #ifdef IEEE_drem
double xa, ya, z; double xa, ya, z;
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double floor();
double d_nint(x) doublereal *x;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
double d_nint(doublereal *x) double d_nint(doublereal *x)
#endif
{ {
return( (*x)>=0 ? return( (*x)>=0 ?
floor(*x + .5) : -floor(.5 - *x) ); floor(*x + .5) : -floor(.5 - *x) );
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double d_prod(x,y) real *x, *y;
#else
double d_prod(real *x, real *y) double d_prod(real *x, real *y)
#endif
{ {
return( (*x) * (*y) ); return( (*x) * (*y) );
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double d_sign(a,b) doublereal *a, *b;
#else
double d_sign(doublereal *a, doublereal *b) double d_sign(doublereal *a, doublereal *b)
#endif
{ {
double x; double x;
x = (*a >= 0 ? *a : - *a); x = (*a >= 0 ? *a : - *a);
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double sin();
double d_sin(x) doublereal *x;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
double d_sin(doublereal *x) double d_sin(doublereal *x)
#endif
{ {
return( sin(*x) ); return( sin(*x) );
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double sinh();
double d_sinh(x) doublereal *x;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
double d_sinh(doublereal *x) double d_sinh(doublereal *x)
#endif
{ {
return( sinh(*x) ); return( sinh(*x) );
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double sqrt();
double d_sqrt(x) doublereal *x;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
double d_sqrt(doublereal *x) double d_sqrt(doublereal *x)
#endif
{ {
return( sqrt(*x) ); return( sqrt(*x) );
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double tan();
double d_tan(x) doublereal *x;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
double d_tan(doublereal *x) double d_tan(doublereal *x)
#endif
{ {
return( tan(*x) ); return( tan(*x) );
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double tanh();
double d_tanh(x) doublereal *x;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
double d_tanh(doublereal *x) double d_tanh(doublereal *x)
#endif
{ {
return( tanh(*x) ); return( tanh(*x) );
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double erf();
double G77_derf_0 (x) doublereal *x;
#else
extern double erf(double); extern double erf(double);
double G77_derf_0 (doublereal *x) double G77_derf_0 (doublereal *x)
#endif
{ {
return( erf(*x) ); return( erf(*x) );
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
extern double erfc();
double G77_derfc_0 (x) doublereal *x;
#else
extern double erfc(double); extern double erfc(double);
double G77_derfc_0 (doublereal *x) double G77_derfc_0 (doublereal *x)
#endif
{ {
return( erfc(*x) ); return( erfc(*x) );
} }
...@@ -24,11 +24,7 @@ ...@@ -24,11 +24,7 @@
#endif #endif
double double
#ifdef KR_headers
dtime_(tarray) float *tarray;
#else
dtime_(float *tarray) dtime_(float *tarray)
#endif
{ {
#ifdef USE_CLOCK #ifdef USE_CLOCK
#ifndef CLOCKS_PER_SECOND #ifndef CLOCKS_PER_SECOND
......
...@@ -6,13 +6,8 @@ ...@@ -6,13 +6,8 @@
#define M ( (long) (sizeof(long) - 1) ) #define M ( (long) (sizeof(long) - 1) )
#define EVEN(x) ( ( (x)+ M) & (~M) ) #define EVEN(x) ( ( (x)+ M) & (~M) )
#ifdef KR_headers
extern VOID s_copy();
G77_ef1asc_0 (a, la, b, lb) ftnint *a, *b; ftnlen *la, *lb;
#else
extern void s_copy(char*,char*,ftnlen,ftnlen); extern void s_copy(char*,char*,ftnlen,ftnlen);
int G77_ef1asc_0 (ftnint *a, ftnlen *la, ftnint *b, ftnlen *lb) int G77_ef1asc_0 (ftnint *a, ftnlen *la, ftnint *b, ftnlen *lb)
#endif
{ {
s_copy( (char *)a, (char *)b, EVEN(*la), *lb ); s_copy( (char *)a, (char *)b, EVEN(*la), *lb );
return 0; /* ignored return value */ return 0; /* ignored return value */
......
...@@ -2,13 +2,8 @@ ...@@ -2,13 +2,8 @@
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
extern integer s_cmp();
integer G77_ef1cmc_0 (a, la, b, lb) ftnint *a, *b; ftnlen *la, *lb;
#else
extern integer s_cmp(char*,char*,ftnlen,ftnlen); extern integer s_cmp(char*,char*,ftnlen,ftnlen);
integer G77_ef1cmc_0 (ftnint *a, ftnlen *la, ftnint *b, ftnlen *lb) integer G77_ef1cmc_0 (ftnint *a, ftnlen *la, ftnint *b, ftnlen *lb)
#endif
{ {
return( s_cmp( (char *)a, (char *)b, *la, *lb) ); return( s_cmp( (char *)a, (char *)b, *la, *lb) );
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double erf();
double G77_erf_0 (x) real *x;
#else
extern double erf(double); extern double erf(double);
double G77_erf_0 (real *x) double G77_erf_0 (real *x)
#endif
{ {
return( erf(*x) ); return( erf(*x) );
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double erfc();
double G77_erfc_0 (x) real *x;
#else
extern double erfc(double); extern double erfc(double);
double G77_erfc_0 (real *x) double G77_erfc_0 (real *x)
#endif
{ {
return( erfc(*x) ); return( erfc(*x) );
} }
...@@ -24,11 +24,7 @@ ...@@ -24,11 +24,7 @@
#endif #endif
double double
#ifdef KR_headers
etime_(tarray) float *tarray;
#else
etime_(float *tarray) etime_(float *tarray)
#endif
{ {
#ifdef USE_CLOCK #ifdef USE_CLOCK
#ifndef CLOCKS_PER_SECOND #ifndef CLOCKS_PER_SECOND
......
...@@ -12,20 +12,14 @@ ...@@ -12,20 +12,14 @@
#undef abs #undef abs
#undef min #undef min
#undef max #undef max
#ifndef KR_headers
#include <stdlib.h> #include <stdlib.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
extern void f_exit(void); extern void f_exit(void);
#endif
void void
#ifdef KR_headers
G77_exit_0 (rc) integer *rc;
#else
G77_exit_0 (integer *rc) G77_exit_0 (integer *rc)
#endif
{ {
#ifdef NO_ONEXIT #ifdef NO_ONEXIT
f_exit(); f_exit();
......
...@@ -6,11 +6,7 @@ ...@@ -6,11 +6,7 @@
* variable argument c * variable argument c
*/ */
#ifdef KR_headers
VOID G77_getarg_0 (n, s, ls) ftnint *n; register char *s; ftnlen ls;
#else
void G77_getarg_0 (ftnint *n, register char *s, ftnlen ls) void G77_getarg_0 (ftnint *n, register char *s, ftnlen ls)
#endif
{ {
extern int f__xargc; extern int f__xargc;
extern char **f__xargv; extern char **f__xargv;
......
#include "f2c.h" #include "f2c.h"
#undef abs #undef abs
#ifdef KR_headers
extern char *F77_aloc(), *getenv();
#else
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
extern char *F77_aloc(ftnlen, char*); extern char *F77_aloc(ftnlen, char*);
#endif
/* /*
* getenv - f77 subroutine to return environment variables * getenv - f77 subroutine to return environment variables
...@@ -20,13 +16,8 @@ extern char *F77_aloc(ftnlen, char*); ...@@ -20,13 +16,8 @@ extern char *F77_aloc(ftnlen, char*);
* if ENV_NAME is not defined * if ENV_NAME is not defined
*/ */
#ifdef KR_headers
VOID
G77_getenv_0 (fname, value, flen, vlen) char *value, *fname; ftnlen vlen, flen;
#else
void void
G77_getenv_0 (char *fname, char *value, ftnlen flen, ftnlen vlen) G77_getenv_0 (char *fname, char *value, ftnlen flen, ftnlen vlen)
#endif
{ {
char buf[256], *ep, *fp; char buf[256], *ep, *fp;
integer i; integer i;
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
shortint h_abs(x) shortint *x;
#else
shortint h_abs(shortint *x) shortint h_abs(shortint *x)
#endif
{ {
if(*x >= 0) if(*x >= 0)
return(*x); return(*x);
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
shortint h_dim(a,b) shortint *a, *b;
#else
shortint h_dim(shortint *a, shortint *b) shortint h_dim(shortint *a, shortint *b)
#endif
{ {
return( *a > *b ? *a - *b : 0); return( *a > *b ? *a - *b : 0);
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double floor();
shortint h_dnnt(x) doublereal *x;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
shortint h_dnnt(doublereal *x) shortint h_dnnt(doublereal *x)
#endif
{ {
return (shortint)(*x >= 0. ? floor(*x + .5) : -floor(.5 - *x)); return (shortint)(*x >= 0. ? floor(*x + .5) : -floor(.5 - *x));
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
shortint h_indx(a, b, la, lb) char *a, *b; ftnlen la, lb;
#else
shortint h_indx(char *a, char *b, ftnlen la, ftnlen lb) shortint h_indx(char *a, char *b, ftnlen la, ftnlen lb)
#endif
{ {
ftnlen i, n; ftnlen i, n;
char *s, *t, *bend; char *s, *t, *bend;
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
shortint h_len(s, n) char *s; ftnlen n;
#else
shortint h_len(char *s, ftnlen n) shortint h_len(char *s, ftnlen n)
#endif
{ {
return(n); return(n);
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
shortint h_mod(a,b) short *a, *b;
#else
shortint h_mod(short *a, short *b) shortint h_mod(short *a, short *b)
#endif
{ {
return( *a % *b); return( *a % *b);
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double floor();
shortint h_nint(x) real *x;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
shortint h_nint(real *x) shortint h_nint(real *x)
#endif
{ {
return (shortint)(*x >= 0 ? floor(*x + .5) : -floor(.5 - *x)); return (shortint)(*x >= 0 ? floor(*x + .5) : -floor(.5 - *x));
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
shortint h_sign(a,b) shortint *a, *b;
#else
shortint h_sign(shortint *a, shortint *b) shortint h_sign(shortint *a, shortint *b)
#endif
{ {
shortint x; shortint x;
x = (*a >= 0 ? *a : - *a); x = (*a >= 0 ? *a : - *a);
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
extern integer s_cmp();
shortlogical hl_ge(a,b,la,lb) char *a, *b; ftnlen la, lb;
#else
extern integer s_cmp(char *, char *, ftnlen, ftnlen); extern integer s_cmp(char *, char *, ftnlen, ftnlen);
shortlogical hl_ge(char *a, char *b, ftnlen la, ftnlen lb) shortlogical hl_ge(char *a, char *b, ftnlen la, ftnlen lb)
#endif
{ {
return(s_cmp(a,b,la,lb) >= 0); return(s_cmp(a,b,la,lb) >= 0);
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
extern integer s_cmp();
shortlogical hl_gt(a,b,la,lb) char *a, *b; ftnlen la, lb;
#else
extern integer s_cmp(char *, char *, ftnlen, ftnlen); extern integer s_cmp(char *, char *, ftnlen, ftnlen);
shortlogical hl_gt(char *a, char *b, ftnlen la, ftnlen lb) shortlogical hl_gt(char *a, char *b, ftnlen la, ftnlen lb)
#endif
{ {
return(s_cmp(a,b,la,lb) > 0); return(s_cmp(a,b,la,lb) > 0);
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
extern integer s_cmp();
shortlogical hl_le(a,b,la,lb) char *a, *b; ftnlen la, lb;
#else
extern integer s_cmp(char *, char *, ftnlen, ftnlen); extern integer s_cmp(char *, char *, ftnlen, ftnlen);
shortlogical hl_le(char *a, char *b, ftnlen la, ftnlen lb) shortlogical hl_le(char *a, char *b, ftnlen la, ftnlen lb)
#endif
{ {
return(s_cmp(a,b,la,lb) <= 0); return(s_cmp(a,b,la,lb) <= 0);
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
extern integer s_cmp();
shortlogical hl_lt(a,b,la,lb) char *a, *b; ftnlen la, lb;
#else
extern integer s_cmp(char *, char *, ftnlen, ftnlen); extern integer s_cmp(char *, char *, ftnlen, ftnlen);
shortlogical hl_lt(char *a, char *b, ftnlen la, ftnlen lb) shortlogical hl_lt(char *a, char *b, ftnlen la, ftnlen lb)
#endif
{ {
return(s_cmp(a,b,la,lb) < 0); return(s_cmp(a,b,la,lb) < 0);
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
integer i_abs(x) integer *x;
#else
integer i_abs(integer *x) integer i_abs(integer *x)
#endif
{ {
if(*x >= 0) if(*x >= 0)
return(*x); return(*x);
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
integer i_dim(a,b) integer *a, *b;
#else
integer i_dim(integer *a, integer *b) integer i_dim(integer *a, integer *b)
#endif
{ {
return( *a > *b ? *a - *b : 0); return( *a > *b ? *a - *b : 0);
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double floor();
integer i_dnnt(x) doublereal *x;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
integer i_dnnt(doublereal *x) integer i_dnnt(doublereal *x)
#endif
{ {
return (integer)(*x >= 0. ? floor(*x + .5) : -floor(.5 - *x)); return (integer)(*x >= 0. ? floor(*x + .5) : -floor(.5 - *x));
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
integer i_indx(a, b, la, lb) char *a, *b; ftnlen la, lb;
#else
integer i_indx(char *a, char *b, ftnlen la, ftnlen lb) integer i_indx(char *a, char *b, ftnlen la, ftnlen lb)
#endif
{ {
ftnlen i, n; ftnlen i, n;
char *s, *t, *bend; char *s, *t, *bend;
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
integer i_len(s, n) char *s; ftnlen n;
#else
integer i_len(char *s, ftnlen n) integer i_len(char *s, ftnlen n)
#endif
{ {
return(n); return(n);
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
integer i_mod(a,b) integer *a, *b;
#else
integer i_mod(integer *a, integer *b) integer i_mod(integer *a, integer *b)
#endif
{ {
return( *a % *b); return( *a % *b);
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double floor();
integer i_nint(x) real *x;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
integer i_nint(real *x) integer i_nint(real *x)
#endif
{ {
return (integer)(*x >= 0 ? floor(*x + .5) : -floor(.5 - *x)); return (integer)(*x >= 0 ? floor(*x + .5) : -floor(.5 - *x));
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
integer i_sign(a,b) integer *a, *b;
#else
integer i_sign(integer *a, integer *b) integer i_sign(integer *a, integer *b)
#endif
{ {
integer x; integer x;
x = (*a >= 0 ? *a : - *a); x = (*a >= 0 ? *a : - *a);
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
ftnint G77_iargc_0 ()
#else
ftnint G77_iargc_0 (void) ftnint G77_iargc_0 (void)
#endif
{ {
extern int f__xargc; extern int f__xargc;
return ( f__xargc - 1 ); return ( f__xargc - 1 );
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
extern integer s_cmp();
logical l_ge(a,b,la,lb) char *a, *b; ftnlen la, lb;
#else
extern integer s_cmp(char *, char *, ftnlen, ftnlen); extern integer s_cmp(char *, char *, ftnlen, ftnlen);
logical l_ge(char *a, char *b, ftnlen la, ftnlen lb) logical l_ge(char *a, char *b, ftnlen la, ftnlen lb)
#endif
{ {
return(s_cmp(a,b,la,lb) >= 0); return(s_cmp(a,b,la,lb) >= 0);
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
extern integer s_cmp();
logical l_gt(a,b,la,lb) char *a, *b; ftnlen la, lb;
#else
extern integer s_cmp(char *, char *, ftnlen, ftnlen); extern integer s_cmp(char *, char *, ftnlen, ftnlen);
logical l_gt(char *a, char *b, ftnlen la, ftnlen lb) logical l_gt(char *a, char *b, ftnlen la, ftnlen lb)
#endif
{ {
return(s_cmp(a,b,la,lb) > 0); return(s_cmp(a,b,la,lb) > 0);
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
extern integer s_cmp();
logical l_le(a,b,la,lb) char *a, *b; ftnlen la, lb;
#else
extern integer s_cmp(char *, char *, ftnlen, ftnlen); extern integer s_cmp(char *, char *, ftnlen, ftnlen);
logical l_le(char *a, char *b, ftnlen la, ftnlen lb) logical l_le(char *a, char *b, ftnlen la, ftnlen lb)
#endif
{ {
return(s_cmp(a,b,la,lb) <= 0); return(s_cmp(a,b,la,lb) <= 0);
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
extern integer s_cmp();
logical l_lt(a,b,la,lb) char *a, *b; ftnlen la, lb;
#else
extern integer s_cmp(char *, char *, ftnlen, ftnlen); extern integer s_cmp(char *, char *, ftnlen, ftnlen);
logical l_lt(char *a, char *b, ftnlen la, ftnlen lb) logical l_lt(char *a, char *b, ftnlen la, ftnlen lb)
#endif
{ {
return(s_cmp(a,b,la,lb) < 0); return(s_cmp(a,b,la,lb) < 0);
} }
...@@ -5,11 +5,7 @@ ...@@ -5,11 +5,7 @@
#endif #endif
integer integer
#ifdef KR_headers
lbit_bits(a, b, len) integer a, b, len;
#else
lbit_bits(integer a, integer b, integer len) lbit_bits(integer a, integer b, integer len)
#endif
{ {
/* Assume 2's complement arithmetic */ /* Assume 2's complement arithmetic */
...@@ -23,11 +19,7 @@ lbit_bits(integer a, integer b, integer len) ...@@ -23,11 +19,7 @@ lbit_bits(integer a, integer b, integer len)
} }
integer integer
#ifdef KR_headers
lbit_cshift(a, b, len) integer a, b, len;
#else
lbit_cshift(integer a, integer b, integer len) lbit_cshift(integer a, integer b, integer len)
#endif
{ {
unsigned long x, y, z; unsigned long x, y, z;
......
#include "f2c.h" #include "f2c.h"
integer integer
#ifdef KR_headers
lbit_shift(a, b) integer a; integer b;
#else
lbit_shift(integer a, integer b) lbit_shift(integer a, integer b)
#endif
{ {
return b >= 0 ? a << b : (integer)((uinteger)a >> -b); return b >= 0 ? a << b : (integer)((uinteger)a >> -b);
} }
...@@ -3,10 +3,8 @@ ...@@ -3,10 +3,8 @@
#include <stdio.h> #include <stdio.h>
#include "signal1.h" #include "signal1.h"
#ifndef KR_headers
#undef VOID #undef VOID
#include <stdlib.h> #include <stdlib.h>
#endif
#ifndef VOID #ifndef VOID
#define VOID void #define VOID void
...@@ -16,41 +14,20 @@ ...@@ -16,41 +14,20 @@
extern "C" { extern "C" {
#endif #endif
#ifdef NO__STDC
#define ONEXIT onexit
extern VOID f_exit();
#else
#ifndef KR_headers
extern void f_exit(void); extern void f_exit(void);
#ifndef NO_ONEXIT #ifndef NO_ONEXIT
#define ONEXIT atexit #define ONEXIT atexit
extern int atexit(void (*)(void)); extern int atexit(void (*)(void));
#endif #endif
#else
#ifndef NO_ONEXIT
#define ONEXIT onexit
extern VOID f_exit();
#endif
#endif
#endif
#ifdef KR_headers
extern VOID f_init();
extern int MAIN__();
#else
extern void f_init(void); extern void f_init(void);
extern int MAIN__(void); extern int MAIN__(void);
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#ifdef KR_headers
main(argc, argv) int argc; char **argv;
#else
main(int argc, char **argv) main(int argc, char **argv)
#endif
{ {
f_setarg(argc, argv); f_setarg(argc, argv);
f_setsig(); f_setsig();
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
VOID pow_ci(p, a, b) /* p = a**b */
complex *p, *a; integer *b;
#else
extern void pow_zi(doublecomplex*, doublecomplex*, integer*); extern void pow_zi(doublecomplex*, doublecomplex*, integer*);
void pow_ci(complex *p, complex *a, integer *b) /* p = a**b */ void pow_ci(complex *p, complex *a, integer *b) /* p = a**b */
#endif
{ {
doublecomplex p1, a1; doublecomplex p1, a1;
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double pow();
double pow_dd(ap, bp) doublereal *ap, *bp;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
double pow_dd(doublereal *ap, doublereal *bp) double pow_dd(doublereal *ap, doublereal *bp)
#endif
{ {
return(pow(*ap, *bp) ); return(pow(*ap, *bp) );
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double pow_di(ap, bp) doublereal *ap; integer *bp;
#else
double pow_di(doublereal *ap, integer *bp) double pow_di(doublereal *ap, integer *bp)
#endif
{ {
double pow, x; double pow, x;
integer n; integer n;
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
shortint pow_hh(ap, bp) shortint *ap, *bp;
#else
shortint pow_hh(shortint *ap, shortint *bp) shortint pow_hh(shortint *ap, shortint *bp)
#endif
{ {
shortint pow, x, n; shortint pow, x, n;
unsigned u; unsigned u;
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
integer pow_ii(ap, bp) integer *ap, *bp;
#else
integer pow_ii(integer *ap, integer *bp) integer pow_ii(integer *ap, integer *bp)
#endif
{ {
integer pow, x, n; integer pow, x, n;
unsigned long u; unsigned long u;
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
longint pow_qq(ap, bp) longint *ap, *bp;
#else
longint pow_qq(longint *ap, longint *bp) longint pow_qq(longint *ap, longint *bp)
#endif
{ {
longint pow, x, n; longint pow, x, n;
unsigned long long u; /* system-dependent */ unsigned long long u; /* system-dependent */
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double pow_ri(ap, bp) real *ap; integer *bp;
#else
double pow_ri(real *ap, integer *bp) double pow_ri(real *ap, integer *bp)
#endif
{ {
double pow, x; double pow, x;
integer n; integer n;
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
VOID pow_zi(p, a, b) /* p = a**b */
doublecomplex *p, *a; integer *b;
#else
extern void z_div(doublecomplex*, doublecomplex*, doublecomplex*); extern void z_div(doublecomplex*, doublecomplex*, doublecomplex*);
void pow_zi(doublecomplex *p, doublecomplex *a, integer *b) /* p = a**b */ void pow_zi(doublecomplex *p, doublecomplex *a, integer *b) /* p = a**b */
#endif
{ {
integer n; integer n;
unsigned long u; unsigned long u;
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double log(), exp(), cos(), sin(), atan2(), f__cabs();
VOID pow_zz(r,a,b) doublecomplex *r, *a, *b;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
extern double f__cabs(double,double); extern double f__cabs(double,double);
void pow_zz(doublecomplex *r, doublecomplex *a, doublecomplex *b) void pow_zz(doublecomplex *r, doublecomplex *a, doublecomplex *b)
#endif
{ {
double logr, logi, x, y; double logr, logi, x, y;
......
...@@ -9,11 +9,7 @@ ...@@ -9,11 +9,7 @@
#endif #endif
integer integer
#ifdef KR_headers
qbit_bits(a, b, len) longint a; integer b, len;
#else
qbit_bits(longint a, integer b, integer len) qbit_bits(longint a, integer b, integer len)
#endif
{ {
/* Assume 2's complement arithmetic */ /* Assume 2's complement arithmetic */
...@@ -27,11 +23,7 @@ qbit_bits(longint a, integer b, integer len) ...@@ -27,11 +23,7 @@ qbit_bits(longint a, integer b, integer len)
} }
longint longint
#ifdef KR_headers
qbit_cshift(a, b, len) longint a; integer b, len;
#else
qbit_cshift(longint a, integer b, integer len) qbit_cshift(longint a, integer b, integer len)
#endif
{ {
ulongint x, y, z; ulongint x, y, z;
......
#include "f2c.h" #include "f2c.h"
longint longint
#ifdef KR_headers
qbit_shift(a, b) longint a; integer b;
#else
qbit_shift(longint a, integer b) qbit_shift(longint a, integer b)
#endif
{ {
return b >= 0 ? a << b : (longint)((ulongint)a >> -b); return b >= 0 ? a << b : (longint)((ulongint)a >> -b);
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double r_abs(x) real *x;
#else
double r_abs(real *x) double r_abs(real *x)
#endif
{ {
if(*x >= 0) if(*x >= 0)
return(*x); return(*x);
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double acos();
double r_acos(x) real *x;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
double r_acos(real *x) double r_acos(real *x)
#endif
{ {
return( acos(*x) ); return( acos(*x) );
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double asin();
double r_asin(x) real *x;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
double r_asin(real *x) double r_asin(real *x)
#endif
{ {
return( asin(*x) ); return( asin(*x) );
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double atan();
double r_atan(x) real *x;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
double r_atan(real *x) double r_atan(real *x)
#endif
{ {
return( atan(*x) ); return( atan(*x) );
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double atan2();
double r_atn2(x,y) real *x, *y;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
double r_atn2(real *x, real *y) double r_atn2(real *x, real *y)
#endif
{ {
return( atan2(*x,*y) ); return( atan2(*x,*y) );
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
VOID r_cnjg(r, z) complex *r, *z;
#else
VOID r_cnjg(complex *r, complex *z) VOID r_cnjg(complex *r, complex *z)
#endif
{ {
real zi = z->i; real zi = z->i;
r->r = z->r; r->r = z->r;
......
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double cos();
double r_cos(x) real *x;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
double r_cos(real *x) double r_cos(real *x)
#endif
{ {
return( cos(*x) ); return( cos(*x) );
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double cosh();
double r_cosh(x) real *x;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
double r_cosh(real *x) double r_cosh(real *x)
#endif
{ {
return( cosh(*x) ); return( cosh(*x) );
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double r_dim(a,b) real *a, *b;
#else
double r_dim(real *a, real *b) double r_dim(real *a, real *b)
#endif
{ {
return( *a > *b ? *a - *b : 0); return( *a > *b ? *a - *b : 0);
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double exp();
double r_exp(x) real *x;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
double r_exp(real *x) double r_exp(real *x)
#endif
{ {
return( exp(*x) ); return( exp(*x) );
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double r_imag(z) complex *z;
#else
double r_imag(complex *z) double r_imag(complex *z)
#endif
{ {
return(z->i); return(z->i);
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double floor();
double r_int(x) real *x;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
double r_int(real *x) double r_int(real *x)
#endif
{ {
return( (*x>0) ? floor(*x) : -floor(- *x) ); return( (*x>0) ? floor(*x) : -floor(- *x) );
} }
...@@ -2,14 +2,9 @@ ...@@ -2,14 +2,9 @@
#define log10e 0.43429448190325182765 #define log10e 0.43429448190325182765
#ifdef KR_headers
double log();
double r_lg10(x) real *x;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
double r_lg10(real *x) double r_lg10(real *x)
#endif
{ {
return( log10e * log(*x) ); return( log10e * log(*x) );
} }
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
double log();
double r_log(x) real *x;
#else
#undef abs #undef abs
#include <math.h> #include <math.h>
double r_log(real *x) double r_log(real *x)
#endif
{ {
return( log(*x) ); return( log(*x) );
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment