[GRASS5] ANSIfication of GRASS 6.1-CVS functions
Markus Neteler
neteler at itc.it
Mon Jan 2 10:11:08 EST 2006
Hi developers,
I have submitting updated function declarations
to CVS to migrate old K&R style to ANSI style. About
800 functions in 230 files are affected.
This work was only possible thanks to the efforts
of Prof Giulio Antoniol (École Polytechnique, Montreal,
Canada) who analyzed the 6.1-CVS code and wrote a PERL
script for me/us to auto-convert the function
declarations.
I am submitting things only after inspection.
The list of changes (CVS diffs) is available at:
http://grass.itc.it/pipermail/grass-commit/2006-January/date.html#end
My gcc flags for compilation are (pretty restrictive):
MYCFLAGS="-g -Wall -Werror-implicit-function-declaration -fno-common"
MYCXXFLAGS="-g -Wall"
CFLAGS="$MYCFLAGS" CXXFLAGS="$MYCXXFLAGS" ./configure ...
A few doubts I have which I would like to discuss here
before submitting:
####################
I fixed (hopefully correctly) the 'wext()' definition
and calls in
lib/cdhc/as181.c
####################
Then a conflict in lib/gis/:
definition in gisdefs.h:
/* index.c */
char *G_index(char *, int);
char *G_rindex(char *, int);
definition in index.c:
char *
G_index (register char *str, register char delim)
char *
G_rindex (register char *str, register char delim)
####################
another one in lib/gis
/* unctrl.c */
char *G_unctrl(int);
definition in unctrl.c
char *G_unctrl(unsigned char c);
####################
imagery/open.c
static error (char *group, char *file, char *msga, char *msgb)
The compiler complains about absent return type:
open.c:12: warning: return type defaults to `int'
open.c: In function `error':
open.c:17: warning: control reaches end of non-void function
####################
Unrelated, I found that by chance:
bartok:gis[6941.292] grep 'floor()\|ceil()' *
align_window.c: double floor(), ceil();
color_range.c: double floor(), ceil();
I guess that it is no good idea to have it
defined, right?
####################
I hope that nothing got damaged. In a few cases the
type had to be assumed (usually 'int'). I tried to inspect
all such cases.
So: Please update from CVS and recompile and use it
as usual. Please try out especially
- g3d related modules
- libgis related modules (ok, most modules)
Cheers
Markus
More information about the grass-dev
mailing list