Mercurial > hg > octave-lyh > gnulib-hg
changeset 3977:bbfbba55424c
Move to ANSI C.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Tue, 19 Nov 2002 13:32:42 +0000 |
parents | df9c91af417b |
children | 55eb3920b607 |
files | lib/ChangeLog lib/gcd.c lib/gcd.h |
diffstat | 3 files changed, 8 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,9 @@ +2002-11-19 Bruno Haible <bruno@clisp.org> + + * gcd.h (PARAMS): Remove macro. + (gcd): Use ANSI C function declarations. + * gcd.c (gcd): Likewise. + 2002-11-15 Bruno Haible <bruno@clisp.org> * strcspn.c: Include <stddef.h>.
--- a/lib/gcd.c +++ b/lib/gcd.c @@ -23,9 +23,7 @@ /* Return the greatest common divisor of a > 0 and b > 0. */ unsigned long -gcd (a, b) - unsigned long a; - unsigned long b; +gcd (unsigned long a, unsigned long b) { /* Why no division, as in Euclid's algorithm? Because in Euclid's algorithm the division result floor(a/b) or floor(b/a) is very often = 1 or = 2,
--- a/lib/gcd.h +++ b/lib/gcd.h @@ -19,15 +19,7 @@ #ifndef _GCD_H #define _GCD_H -#ifndef PARAMS -# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES -# define PARAMS(args) args -# else -# define PARAMS(args) () -# endif -#endif - /* Return the greatest common divisor of a > 0 and b > 0. */ -extern unsigned long gcd PARAMS ((unsigned long a, unsigned long b)); +extern unsigned long gcd (unsigned long a, unsigned long b); #endif /* _GCD_H */