ack/util/ego/il/il3_change.h
George Koehler 17bc9cdef7 More void, fewer clang warnings in util/ego
Most warnings are for functions implicitly returning int.  Change most
of these functions to return void.  (Traditional K&R C had no void
type, but C89 has it.)

Add prototypes to most function declarations in headers.  This is
easy, because ego declares most of its extern functions, and the
comments listed most parameters.  There were a few outdated or missing
declarations, and a few .c files that failed to include an .h with the
declarations.

Add prototypes to a few function definitions in .c files.  Most
functions still have traditional K&R definitions.  Most STATIC
functions still don't have prototypes, because they have no earlier
declaration where I would have added the prototype.

Change some prototypes in util/ego/share/alloc.h.  Functions newmap()
and oldmap() handle an array of pointers to something; change the
array's type from `short **` to `void **`.  Callers use casts to go
between `void **` and the correct type, like `line_p *`.  Function
oldtable() takes a `short *`, not a `short **`; I added the wrong type
in 5bbbaf4.

Make a few other changes to silence warnings.  There are a few places
where clang wants extra parentheses in the code.

Edit util/ego/ra/build.lua to add the missing dependency on ra*.h; I
needed this to prevent crashes from ra.
2019-11-01 15:27:16 -04:00

53 lines
1.5 KiB
C

/* $Id$ */
/*
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
/* I N L I N E S U B S T I T U T I O N
*
* I L 3 _ C H A N G E . C
*/
void chg_callseq(call_p c, line_p cal, line_p *l_out);
/*
* Change the calling sequence of
* the call c. The parameters are
* changed and the sequence
* CAL - ASP - LFR is removed.
* cal points to the CAL instruction
* l_out indicates where the expanded
* text of the called routine must
* be put.
*/
line_p make_label(line_p l, proc_p p);
/*
* Make sure that the instruction after
* l contains a label. If this is not
* already the case, create a new label.
*/
void modify(line_p text, call_p c, line_p lab, offset ab_off,
offset lb_off, int lab_off);
/*
* Modify the EM text of the called
* procedure.
*/
void mod_actuals(call_p nc, call_p c, line_p lab, offset ab_off,
offset lb_off, int lab_off);
/*
* Modify the actual parameters of the
* call nc the same way as the text of
* call c would be modified.
*/
void insert(line_p text, line_p l, line_p firstline);
/*
* Insert the modified EM text.
* Pseudos are put after the pseudos
* of the caller.
*/
void liquidate(proc_p p, line_p text);
/*
* All calls to p were expanded in line,
* so p is no longer needed.
*/