Commit graph

16 commits

Author SHA1 Message Date
George Koehler 36f16b0cb8 Cut down some clang warnings
Edit C code to reduce warnings from clang.  Most warnings are for
implicit declarations of functions, but some warnings want me to add
parentheses or curly braces, or to cast arguments for printf().

Make a few other changes, like declaring float_cst() in h/con_float to
be static, and using C99 bool in ego/ra/makeitems.c and
ego/share/makecldef.c.  Such changes don't silence warnings; I make
such changes while I silence warnings in the same file.  In
float_cst(), rename parameter `str` to `float_str`, so it doesn't
share a name with the global variable `str`.

Remove `const` from `newmodule(const char *)` in mach/proto/as to
silence a warning.  I wrongly added the `const` in d347207.

For warnings about implicit declarations of functions, the fix is to
declare the function before calling it.  For example, my OpenBSD
system needs <sys/wait.h> to declare wait().

In util/int, add "whatever.h" to declare more functions.  Remove old
declarations from "mem.h", to prefer the newer declarations of the
same functions in "data.h" and "stack.h".
2019-10-30 18:36:38 -04:00
George Koehler bec236c108 Include more headers to declare functions.
This causes clang to give fewer warnings of implicit declarations of
functions.

In mach/pdp/cv/cv.c, rename wr_int2() to cv_int2() because it
conflicts with wr_int2() in <object.h>.

In util/ack, rename F_OK to F_TRANSFORM because it conflicts with F_OK
for access() in <unistd.h>.
2019-03-22 15:59:35 -04:00
George Koehler 65278bc9a9 In util/ack, add prototypes and static to functions.
Declare most functions before using them.  I declare some functions in
ack.h and some in trans.h (because trans.h declares type trf).  I
leave declarations of scanb() and scanvars() in .c files because they
need type growstring.  (I can't #include "grows.h" in another header
file as long as grows.h doesn't guard against multiple inclusion.)

Functions used within one file become static.  I remove a few tiny
functions.  I move a few functions or declarations to more convenient
places.  Some functions now return void instead of a garbage int.

I feel that keyword "register" is obsolete, so I removed it from where
I was editing.  This commit doesn't touch mktables.c
2016-11-12 21:12:45 -05:00
David Given fd91851005 Add enough return types to the K&R C that the ACK builds (on Linux) using clang
now.
2016-11-10 22:04:18 +01:00
dtrg 30e34f493f Rationalised use of #includes to be more standards-compliant. 2006-07-26 18:22:02 +00:00
dtrg 014be56fb0 Replaced calls to the custom strindex() and strrindex() functions with the
exactly equivalent and standard strchr() and strrchr() functions instead.
2006-07-23 20:01:02 +00:00
ceriel 5c83e7dbb5 Header --> Id 1994-06-24 11:31:16 +00:00
ceriel dbe4e49936 New method of calling optimizers; fixed lint entry in Makefile 1989-02-09 14:08:47 +00:00
ceriel 5537abbdfb Added copyright notice 1987-03-10 01:26:51 +00:00
ceriel 2295cd130a Added some code to handle -Oego,opt,asopt and the like.
By default, optimizers can be excluded by giving them a negative
priority in the description files. This is currently done for
the global optimizer
1987-02-10 16:50:32 +00:00
ceriel 84f0869fde Fixed a bug: ack could not see the difference between ".mod" and ".m".
This is corrected.
1986-10-20 13:47:26 +00:00
keie b5fa0675b6 Added a priority associated with each phase. Paths with the highest
total priority have preference.
1984-10-05 13:34:38 +00:00
keie c93761cadc The t_do bits are not set by this module. The t_next entry is used
to see whether the scan for this phase is already done.
t_do is now set in add_inputs(files.c).
1984-09-13 14:35:02 +00:00
keie 1188f0e810 1 - A transformation is succesfull when
a - a stopsuffix is indicated and met,
    b - the last transformation is included in the transformation path.
2 - Maintains a 'cash' of best paths for all transformation to be executed.
1984-09-10 16:46:13 +00:00
keie c2f189c855 Added RCS identification. 1984-08-17 14:44:24 +00:00
keie 3b4b7cac60 Initial revision 1984-06-21 10:57:59 +00:00