Better ANSI C compatibility and portability - part 1:

+ Addition of function prototypes.
+ Change function definitions to ANSI C style.
+ Convert to sed scripts some shell scripts for better portability.
+ Reduce usage of em_path.h
This commit is contained in:
carl 2019-02-19 00:32:48 +08:00
parent 90d4797ff7
commit 0ac16f6116
54 changed files with 274 additions and 332 deletions

View file

@ -0,0 +1,99 @@
cmake_minimum_required (VERSION 2.9)
project(em_code)
set(SRC
bhcst.c
bhdlb.c
bhdnam.c
bhfcon.c
bhicon.c
bhilb.c
bhpnam.c
bhucon.c
crcst.c
crdlb.c
crdnam.c
crxcon.c
crilb.c
crpnam.c
crscon.c
cst.c
dfdlb.c
dfdnam.c
dfilb.c
dlb.c
dnam.c
end.c
endarg.c
exc.c
fcon.c
getid.c
icon.c
ilb.c
insert.c
internerr.c
msend.c
op.c
opcst.c
opdlb.c
opdnam.c
opilb.c
opnarg.c
oppnam.c
pnam.c
pro.c
pronarg.c
msstart.c
psdlb.c
psdnam.c
pspnam.c
scon.c
ucon.c
C_out.c
failed.c
em.c
em_codeEK.h
em_code.h
em_codeCE.h
em_codeO.h
em_private.h
)
set(INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
add_library(eme ${SRC})
target_include_directories(eme PUBLIC ${INCLUDE_DIRS})
target_compile_definitions(eme PRIVATE READABLE_EM)
target_link_libraries(eme em_data alloc print system)
add_library(emk ${SRC})
target_include_directories(emk PUBLIC ${INCLUDE_DIRS})
target_link_libraries(emk em_data alloc print system)
set_target_properties(eme PROPERTIES PUBLIC_HEADER "em_codeEK.h")
set_target_properties(emk PROPERTIES PUBLIC_HEADER "em_codeEK.h")
add_custom_command(
OUTPUT em_codeEK.h file1.tmp
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/makeem.sed
${CMAKE_CURRENT_BINARY_DIR}/makeem.sed
COMMAND sed -f makeem.sed ${CMAKE_CURRENT_SOURCE_DIR}/../../../h/em_table>file1.tmp
COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR}/em.nogen file1.tmp>em_codeEK.h
COMMENT "Regenerate em_codeEK.h from em_table"
)
install(TARGETS eme emk
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
PUBLIC_HEADER DESTINATION include
)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/em_code.3X DESTINATION man OPTIONAL)

View file

@ -9,25 +9,22 @@
/* $Id$ */
static arg();
static pseudo();
static void arg(struct e_instr *p, int comma);
static void pseudo(struct e_instr *p);
extern char em_flag[];
char *C_error;
#define flags(pp) (em_flag[(pp)->em_opcode - sp_fmnem] & EM_PAR)
struct e_instr *
C_alloc()
struct e_instr *C_alloc(void)
{
static struct e_instr b;
return &b;
}
int
C_out(p)
register struct e_instr *p;
int C_out(register struct e_instr *p)
{
/* Generate EM-code from the e_instr structure "p"
*/
@ -82,9 +79,7 @@ C_out(p)
return 1;
}
static
arg(p, comma)
register struct e_instr *p;
static void arg(register struct e_instr *p, int comma)
{
/* Output the argument of "p".
*/
@ -145,9 +140,7 @@ arg(p, comma)
}
}
static
pseudo(p)
register struct e_instr *p;
static void pseudo(register struct e_instr *p)
{
PS(p->em_opcode);

View file

@ -2,11 +2,7 @@
/* $Id$ */
void
CC_bhcst(op, n, w, i)
arith n;
arith w;
int i;
void CC_bhcst(int op, arith n, arith w, int i)
{
/* BSS or HOL with size n, initial value a cst w, and flag i
*/

View file

@ -2,12 +2,7 @@
/* $Id$ */
void
CC_bhdlb(op, n, s, off, i)
arith n;
label s;
arith off;
int i;
void CC_bhdlb(int op, arith n, label s, arith off, int i)
{
/* BSS or HOL with size n, initial value a dlb(s, off),
and flag i

View file

@ -2,12 +2,7 @@
/* $Id$ */
void
CC_bhdnam(op, n, s, off, i)
arith n;
char *s;
arith off;
int i;
void CC_bhdnam(int op, arith n, char *s, arith off, int i)
{
/* BSS or HOL with size n, initial value a dnam(s, off),
and flag i

View file

@ -2,12 +2,7 @@
/* $Id$ */
void
CC_bhfcon(op, n, s, sz, i)
arith n;
char *s;
arith sz;
int i;
void CC_bhfcon(int op, arith n, char *s, arith sz, int i)
{
/* BSS or HOL with size n, initial value an FCON (s, sz),
and flag i

View file

@ -2,12 +2,7 @@
/* $Id$ */
void
CC_bhicon(op, n, s, sz, i)
arith n;
char *s;
arith sz;
int i;
void CC_bhicon(int op, arith n, char *s, arith sz, int i)
{
/* BSS or HOL with size n, initial value an ICON (s, sz),
and flag i

View file

@ -2,11 +2,7 @@
/* $Id$ */
void
CC_bhilb(op, n, l, i)
arith n;
label l;
int i;
void CC_bhilb(int op, arith n, label l, int i)
{
/* BSS or HOL with size n, initial value a ILB(l),
and flag i

View file

@ -2,11 +2,7 @@
/* $Id$ */
void
CC_bhpnam(op, n, p, i)
arith n;
char *p;
int i;
void CC_bhpnam(int op, arith n, char *p, int i)
{
/* BSS or HOL with size n, initial value a PNAM(p),
and flag i

View file

@ -2,12 +2,7 @@
/* $Id$ */
void
CC_bhucon(op, n, s, sz, i)
arith n;
char *s;
arith sz;
int i;
void CC_bhucon(int op, arith n, char *s, arith sz, int i)
{
/* BSS or HOL with size n, initial value an UCON (s, sz),
and flag i

View file

@ -89,6 +89,7 @@ local function build_variant(code, cflags)
"modules+headers",
"modules/src/alloc+lib",
"modules/src/em_data+lib",
"modules/src/print+lib",
"modules/src/system+lib",
},
vars = {

View file

@ -2,9 +2,7 @@
/* $Id$ */
void
CC_crcst(op, v)
arith v;
void CC_crcst(int op, arith v)
{
/* CON or ROM with argument CST(v)
*/

View file

@ -2,10 +2,7 @@
/* $Id$ */
void
CC_crdlb(op, v, off)
label v;
arith off;
void CC_crdlb(int op, label v, arith off)
{
/* CON or ROM with argument DLB(v, off)
*/

View file

@ -2,10 +2,7 @@
/* $Id$ */
void
CC_crdnam(op, s, off)
char *s;
arith off;
void CC_crdnam(int op, char* s, arith off)
{
/* CON or ROM with argument DNAM(s, off)
*/

View file

@ -2,9 +2,7 @@
/* $Id$ */
void
CC_crilb(op, l)
label l;
void CC_crilb(int op, label l)
{
/* CON or ROM with argument ILB(l)
*/

View file

@ -2,9 +2,7 @@
/* $Id$ */
void
CC_crpnam(op, p)
char *p;
void CC_crpnam(int op, char* p)
{
/* CON or ROM with argument PNAM(p)
*/

View file

@ -2,10 +2,7 @@
/* $Id$ */
void
CC_crscon(op, v, s)
char *v;
arith s;
void CC_crscon(int op, char* v, arith s)
{
/* CON or ROM with argument SCON(v,z)
*/

View file

@ -2,10 +2,7 @@
/* $Id$ */
void
CC_crxcon(op, spec, v, s)
char *v;
arith s;
void CC_crxcon(int op, int spec, char* v, arith s)
{
/* CON or ROM with argument ICON(v,z)
*/

View file

@ -2,9 +2,7 @@
/* $Id$ */
void
CC_cst(l)
arith l;
void CC_cst(arith l)
{
COMMA();
CST(l);

View file

@ -2,9 +2,7 @@
/* $Id$ */
void
CC_dfdlb(l)
label l;
void CC_dfdlb(label l)
{
/* Define numeric data label
*/

View file

@ -2,9 +2,7 @@
/* $Id$ */
void
CC_dfdnam(s)
char *s;
void CC_dfdnam(char* s)
{
/* Define data label
*/

View file

@ -2,9 +2,7 @@
/* $Id$ */
void
CC_dfilb(l)
label l;
void CC_dfilb(label l)
{
/* Define instruction label
*/

View file

@ -2,10 +2,7 @@
/* $Id$ */
void
CC_dlb(l, val)
label l;
arith val;
void CC_dlb(label l, arith val)
{
COMMA();
DOFF(l, val);

View file

@ -2,10 +2,7 @@
/* $Id$ */
void
CC_dnam(str, val)
char *str;
arith val;
void CC_dnam(char* str, arith val)
{
COMMA();
NOFF(str, val);

View file

@ -12,7 +12,9 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "system.h"
#include "alloc.h"
#include "print.h"
#include "em_arith.h"
#include "insert.h"
#include "em_private.h"
@ -49,8 +51,9 @@ char *C_current_out = obuf;
char *C_opp = obuf;
#endif
void
C_flush() {
void C_flush(void)
{
int count;
#ifdef INCORE
static unsigned int bufsiz;
@ -69,6 +72,7 @@ C_flush() {
return;
}
#endif
count = (int)(C_opp - obuf);
if (C_opp != obuf && sys_write(C_ofp, obuf, (int)(C_opp - obuf)) == 0) {
C_ofp = 0;
C_failed();
@ -82,9 +86,7 @@ C_flush() {
#define Xputbyte(c) put(c)
#endif
void
C_putbyte(c)
int c;
void C_putbyte(int c)
{
Xputbyte(c);
}
@ -94,15 +96,11 @@ C_putbyte(c)
#endif
/*ARGSUSED*/
void
C_init(w, p)
arith w, p;
void C_init(arith w, arith p)
{
}
int
C_open(nm)
char *nm;
int C_open(char* nm)
{
/* Open file "nm" for output
*/
@ -110,13 +108,15 @@ C_open(nm)
if (nm == 0)
C_ofp = STDOUT; /* standard output */
else
if (sys_open(nm, OP_WRITE, &C_ofp) == 0)
{
if (sys_open(nm, OP_WRITE, &C_ofp) == 0)
return 0;
}
return 1;
}
void
C_close()
void C_close(void)
{
/* Finish the code-generation.
*/
@ -150,8 +150,7 @@ C_close()
C_ofp = 0;
}
int
C_busy()
int C_busy(void)
{
return C_ofp != 0; /* true if code is being generated */
}
@ -165,32 +164,27 @@ C_busy()
names.
*/
void
C_magic()
void C_magic(void)
{
}
/*** the readable code generating routines ***/
static
wrs(s)
register char *s;
static int wrs(register char *s)
{
while (*s) {
while (*s)
{
C_putbyte(*s++);
}
return 0;
}
void
C_pt_dnam(s)
char *s;
void C_pt_dnam(char* s)
{
wrs(s);
}
void
C_pt_ilb(l)
label l;
void C_pt_ilb(label l)
{
char buf[16];
@ -201,17 +195,14 @@ C_pt_ilb(l)
extern char em_mnem[][4];
extern char em_pseu[][4];
void
C_pt_op(x)
void C_pt_op(int x)
{
C_putbyte(' ');
wrs(em_mnem[x - sp_fmnem]);
C_putbyte(' ');
}
void
C_pt_cst(l)
arith l;
void C_pt_cst(arith l)
{
char buf[16];
@ -219,10 +210,7 @@ C_pt_cst(l)
wrs(buf);
}
void
C_pt_scon(x, y)
char *x;
arith y;
void C_pt_scon(char *x, arith y)
{
char xbuf[1024];
register char *p;
@ -239,17 +227,14 @@ C_pt_scon(x, y)
C_putbyte('\'');
}
void
C_pt_ps(x)
void C_pt_ps(int x)
{
C_putbyte(' ');
wrs(em_pseu[x - sp_fpseu]);
C_putbyte(' ');
}
void
C_pt_dlb(l)
label l;
void C_pt_dlb(label l)
{
char buf[16];
@ -257,10 +242,7 @@ C_pt_dlb(l)
wrs(buf);
}
void
C_pt_doff(l, v)
label l;
arith v;
void C_pt_doff(label l, arith v)
{
char buf[16];
@ -271,10 +253,7 @@ C_pt_doff(l, v)
}
}
void
C_pt_noff(s, v)
char *s;
arith v;
void C_pt_noff(char *s, arith v)
{
char buf[16];
@ -285,17 +264,13 @@ C_pt_noff(s, v)
}
}
void
C_pt_pnam(s)
char *s;
void C_pt_pnam(char *s)
{
C_putbyte('$');
wrs(s);
}
void
C_pt_dfilb(l)
label l;
void C_pt_dfilb(label l)
{
char buf[16];
@ -303,11 +278,7 @@ C_pt_dfilb(l)
wrs(buf);
}
void
C_pt_wcon(sp, v, sz) /* sp_icon, sp_ucon or sp_fcon with int repr */
int sp;
char *v;
arith sz;
void C_pt_wcon(int sp, char *v, arith sz) /* sp_icon, sp_ucon or sp_fcon with int repr */
{
int ch = sp == sp_icon ? 'I' : sp == sp_ucon ? 'U' : 'F';
@ -316,18 +287,18 @@ C_pt_wcon(sp, v, sz) /* sp_icon, sp_ucon or sp_fcon with int repr */
C_pt_cst(sz);
}
void
C_pt_nl() {
void C_pt_nl(void)
{
C_putbyte('\n');
}
void
C_pt_comma() {
void C_pt_comma(void)
{
C_putbyte(',');
}
void
C_pt_ccend() {
void C_pt_ccend(void)
{
C_putbyte('?');
}
@ -345,8 +316,7 @@ C_pt_ccend() {
names.
*/
void
C_magic()
void C_magic(void)
{
put16(sp_magic);
}
@ -355,9 +325,7 @@ C_magic()
#define fit16i(x) ((x) >= (long)(-0x8000) && (x) <= (long)0x7FFF)
#define fit8u(x) ((x) <= 0xFF) /* x is already unsigned */
void
C_pt_ilb(l)
register label l;
void C_pt_ilb(register label l)
{
if (fit8u(l)) {
put8(sp_ilb1);
@ -369,9 +337,7 @@ C_pt_ilb(l)
}
}
void
C_pt_dlb(l)
register label l;
void C_pt_dlb(register label l)
{
if (fit8u(l)) {
put8(sp_dlb1);
@ -383,9 +349,7 @@ C_pt_dlb(l)
}
}
void
C_pt_cst(l)
register arith l;
void C_pt_cst(register arith l)
{
if (l >= (arith) -sp_zcst0 && l < (arith) (sp_ncst0 - sp_zcst0)) {
/* we can convert 'l' to an int because its value
@ -404,10 +368,7 @@ C_pt_cst(l)
}
}
void
C_pt_doff(l, v)
label l;
arith v;
void C_pt_doff(label l, arith v)
{
if (v == 0) {
C_pt_dlb(l);
@ -419,9 +380,7 @@ C_pt_doff(l, v)
}
}
void
C_pt_str(s)
register char *s;
void C_pt_str(register char *s)
{
register int len;
@ -431,18 +390,13 @@ C_pt_str(s)
}
}
void
C_pt_dnam(s)
char *s;
void C_pt_dnam(char* s)
{
put8(sp_dnam);
C_pt_str(s);
}
void
C_pt_noff(s, v)
char *s;
arith v;
void C_pt_noff(char* s, arith v)
{
if (v == 0) {
C_pt_dnam(s);
@ -454,19 +408,13 @@ C_pt_noff(s, v)
}
}
void
C_pt_pnam(s)
char *s;
void C_pt_pnam(char* s)
{
put8(sp_pnam);
C_pt_str(s);
}
void
C_pt_wcon(sp, v, sz) /* sp_icon, sp_ucon or sp_fcon with int repr */
int sp;
char *v;
arith sz;
void C_pt_wcon(int sp, char* v, arith sz) /* sp_icon, sp_ucon or sp_fcon with int repr */
{
/* how 'bout signextension int --> long ??? */
put8(sp);
@ -474,10 +422,7 @@ C_pt_wcon(sp, v, sz) /* sp_icon, sp_ucon or sp_fcon with int repr */
C_pt_str(v);
}
void
C_pt_scon(b, n)
register char *b;
register arith n;
void C_pt_scon(register char *b, register arith n)
{
put8(sp_scon);
C_pt_cst(n);

View file

@ -5,6 +5,7 @@
*/
#include "em_mesX.h"
#include "em_arith.h"
#include "ansi.h"
_PROTOTYPE(void C_ms_com, (char *));
@ -24,6 +25,8 @@ _PROTOTYPE(void C_ms_stb_ilb, (char *, int, int, label));
_PROTOTYPE(void C_ms_stb_pnam, (char *, int, int, char *));
_PROTOTYPE(void C_ms_std, (char *, int, int));
#ifdef PEEPHOLE
#include "em_codeO.h"
#include "emO_code.h"

View file

@ -5,16 +5,16 @@
*/
/* private inclusion file */
#include <em_arith.h>
#include <em_label.h>
#include "em_arith.h"
#include "em_label.h"
/* include the EM description files */
#include <em_spec.h>
#include <em_pseu.h>
#include <em_mnem.h>
#include <em_reg.h>
#include "em_spec.h"
#include "em_pseu.h"
#include "em_mnem.h"
#include "em_reg.h"
#include <ansi.h>
#include "ansi.h"
#include "em_codeEK.h"
@ -79,6 +79,10 @@ _PROTOTYPE(void C_pt_noff, (char *, arith));
_PROTOTYPE(void C_pt_pnam, (char *));
_PROTOTYPE(void C_pt_dfilb, (label));
_PROTOTYPE(void C_pt_wcon, (int, char *, arith));
_PROTOTYPE(void C_failed, (void));
_PROTOTYPE(void C_flush, (void));
_PROTOTYPE(void C_internal_error, (void));
_PROTOTYPE(void C_putbyte, (int));
#ifdef READABLE_EM
_PROTOTYPE(void C_pt_ps, (int));
_PROTOTYPE(void C_pt_op, (int));

View file

@ -2,9 +2,7 @@
/* $Id$ */
void
CC_end(l)
arith l;
void CC_end(arith l)
{
/* END pseudo of procedure with l locals
*/

View file

@ -2,8 +2,7 @@
/* $Id$ */
void
CC_endnarg()
void CC_endnarg()
{
/* END pseudo of procedure with unknown # of locals
*/

View file

@ -2,9 +2,7 @@
/* $Id$ */
void
CC_exc(c1,c2)
arith c1,c2;
void CC_exc(arith c1,arith c2)
{
PS(ps_exc);
CST(c1);

View file

@ -2,10 +2,7 @@
/* $Id$ */
void
CC_fcon(val, siz)
char *val;
arith siz;
void CC_fcon(char* val, arith siz)
{
COMMA();
WCON(sp_fcon, val, siz);

View file

@ -3,8 +3,7 @@
/* Get a unique id for C_insertpart, etc.
*/
int
C_getid()
int C_getid(void)
{
static int id = 0;

View file

@ -2,10 +2,7 @@
/* $Id$ */
void
CC_icon(val, siz)
char *val;
arith siz;
void CC_icon(char* val, arith siz)
{
COMMA();
WCON(sp_icon, val, siz);

View file

@ -2,9 +2,7 @@
/* $Id$ */
void
CC_ilb(l)
label l;
void CC_ilb(label l)
{
COMMA();
ILB(l);

View file

@ -11,11 +11,18 @@
#include <stdlib.h>
#include <string.h>
#include <em_path.h>
#include <alloc.h>
#include <stdio.h>
#include <assert.h>
#include "em_private.h"
#include "system.h"
/*#include "em_path.h"*/
#include "alloc.h"
#include "insert.h"
char *C_tmpdir = TMP_DIR;
/* To make this portable, the initial value here is NULL
* and system is used to retrieve the correct directory
*/
char *C_tmpdir = NULL;
static Part *C_stable[TABSIZ];
static char *C_old_top;
@ -58,12 +65,10 @@ getbyte(b)
}
#endif
static C_out_parts();
static Part *C_findpart();
static void C_out_parts(register PartOfPart *pp);
static Part *C_findpart(int part);
static
outpart(id)
int id;
static int outpart(int id)
{
/* Output part "id", if present.
*/
@ -73,11 +78,10 @@ outpart(id)
C_out_parts(p->p_parts);
p->p_parts = 0;
}
return 0;
}
static
C_out_parts(pp)
register PartOfPart *pp;
static void C_out_parts(register PartOfPart *pp)
{
/* Output the list of chunks started by "pp".
The list is build in reverse order, so this routine is
@ -119,9 +123,7 @@ C_out_parts(pp)
}
}
static Part *
C_findpart(part)
int part;
static Part *C_findpart(int part)
{
/* Look for part "part" in the table.
Return 0 if not present,
@ -134,14 +136,22 @@ C_findpart(part)
return p;
}
static
swttmp()
static int swttmp(void)
{
#ifndef INCORE
if (C_tmpfile == 0) {
static char tmpbuf[64];
if (C_tmpfile == NULL) {
static char tmpbuf[FILENAME_MAX];
register char *p = tmpbuf;
if (C_tmpdir == NULL)
{
C_tmpdir = sys_gettmpdir();
assert(C_tmpdir != NULL);
}
strcpy(p, C_tmpdir);
strcat(p, "/CodeXXXXXX");
close(mkstemp(p));
@ -175,10 +185,10 @@ swttmp()
C_ontmpfile = 1;
}
#endif
return 0;
}
static
swtout()
static int swtout(void)
{
#ifndef INCORE
if (C_ontmpfile) {
@ -203,11 +213,10 @@ swtout()
C_ontmpfile = 0;
}
#endif
return 0;
}
static int
available(part)
int part;
static int available(int part)
{
/* See if part "part", and all the parts it consists of,
are available. Return 1 if they are, 0 otherwize
@ -240,9 +249,7 @@ available(part)
return retval;
}
static Part *
mkpart(part)
int part;
static Part *mkpart(int part)
{
/* Create a Part structure with id "part", and return a
pointer to it, after checking that is does not exist
@ -266,9 +273,7 @@ mkpart(part)
return p;
}
static
end_partofpart(p)
register Part *p;
static void end_partofpart(register Part *p)
{
/* End the current chunk of part *p.
*/
@ -285,9 +290,7 @@ end_partofpart(p)
}
}
static
resume(p)
register Part *p;
static void resume(register Part *p)
{
/* Resume part "p", by creating a new PartOfPart structure
for it.
@ -302,9 +305,7 @@ resume(p)
pp->pp_begin = C_current_out - C_BASE;
}
void
C_insertpart(part)
int part;
void C_insertpart(int part)
{
/* Insert part "part" in the current part. If C_sequential is
still set and the part to be inserted is available now,
@ -341,9 +342,7 @@ C_insertpart(part)
resume(p);
}
void
C_beginpart(part)
int part;
void C_beginpart(int part)
{
/* Now follows the definition for part "part".
Suspend the current part, and add part "part" to the
@ -361,9 +360,7 @@ C_beginpart(part)
resume(p);
}
void
C_endpart(part)
int part;
void C_endpart(int part)
{
/* End the current part. The parameter "part" is just there
for the checking. Do we really need it ???

View file

@ -3,10 +3,11 @@
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
#include <system.h>
#include <stdio.h>
#include <stdlib.h>
#include "system.h"
void
C_internal_error()
void C_internal_error(void)
{
sys_write(STDERR,"internal error\n",15);
sys_stop(S_EXIT);

View file

@ -0,0 +1,18 @@
1i\
/* this part is generated from em_table */
# Remove pseudo instructions
/^\(...\) \([0-9]\).*/d
# Remove opcode constant categories/count
/^\(....\) \([0-9]\).*/d
/^\(.....\) \([0-9]\).*/d
# Below are the actual replacement of opcodes.
s/^\(...\) \(d\).*/#define C_\1(c) CC_opcst(op_\1, c)/
s/^\(...\) \([cslnfzor]\).*/#define C_\1(c) CC_opcst(op_\1, c)/
s/^\(...\) \(w\).*/#define C_\1(w) CC_opcst(op_\1, w)\
#define C_\1_narg() CC_opnarg(op_\1)/
s/^\(...\) \(g\).*/#define C_\1(g) CC_opcst(op_\1, g)\
#define C_\1_dnam(g, o) CC_opdnam(op_\1, g, o)\
#define C_\1_dlb(g, o) CC_opdlb(op_\1, g, o)/
s/^\(...\) \(p\).*/#define C_\1(p) CC_oppnam(op_\1, p)/
s/^\(...\) \(b\).*/#define C_\1(b) CC_opilb(op_\1, b)/
s/^\(...\) \(-\).*/#define C_\1() CC_op(op_\1)/

View file

@ -2,8 +2,7 @@
/* $Id$ */
void
CC_msend()
void CC_msend(void)
{
CEND();
NL();

View file

@ -2,9 +2,7 @@
/* $Id$ */
void
CC_msstart(cst)
int cst;
void CC_msstart(int cst)
{
/* start of message
*/

View file

@ -2,8 +2,7 @@
/* $Id$ */
void
CC_op(opcode)
void CC_op(int opcode)
{
/* Instruction that never has an argument
Argument types: -

View file

@ -2,9 +2,7 @@
/* $Id$ */
void
CC_opcst(opcode, cst)
arith cst;
void CC_opcst(int opcode, arith cst)
{
/* Instruction with a constant argument
Argument types: c, d, l, g, f, n, s, z, o, w, r

View file

@ -2,10 +2,7 @@
/* $Id$ */
void
CC_opdlb(opcode, dlb, offset)
label dlb;
arith offset;
void CC_opdlb(int opcode, label dlb, arith offset)
{
/* Instruction that as a numeric datalabel + offset as argument
Argument types: g

View file

@ -2,10 +2,7 @@
/* $Id$ */
void
CC_opdnam(opcode, dnam, offset)
char *dnam;
arith offset;
void CC_opdnam(int opcode, char* dnam, arith offset)
{
/* Instruction that has a datalabel + offset as argument
Argument types: g

View file

@ -2,9 +2,7 @@
/* $Id$ */
void
CC_opilb(opcode, ilb)
label ilb;
void CC_opilb(int opcode, label ilb)
{
/* Instruction with instruction label argument
Argument types: b

View file

@ -2,8 +2,7 @@
/* $Id$ */
void
CC_opnarg(opcode)
void CC_opnarg(int opcode)
{
/* Instruction with optional argument, but now without one
Argument types: w

View file

@ -2,9 +2,7 @@
/* $Id$ */
void
CC_oppnam(opcode, pnam)
char *pnam;
void CC_oppnam(int opcode, char* pnam)
{
/* Instruction that has a procedure name as argument
Argument types: p

View file

@ -2,9 +2,7 @@
/* $Id$ */
void
CC_pnam(str)
char *str;
void CC_pnam(char* str)
{
COMMA();
PNAM(str);

View file

@ -2,10 +2,7 @@
/* $Id$ */
void
CC_pro(pnam, l)
char *pnam;
arith l;
void CC_pro(char* pnam, arith l)
{
/* PRO pseudo with procedure name pnam and # of locals l
*/

View file

@ -2,9 +2,7 @@
/* $Id$ */
void
CC_pronarg(pnam)
char *pnam;
void CC_pronarg(char* pnam)
{
/* PRO pseudo with procedure name pnam and unknown # of locals
*/

View file

@ -2,9 +2,7 @@
/* $Id$ */
void
CC_psdlb(op, dlb)
label dlb;
void CC_psdlb(int op, label dlb)
{
/* Pseudo with numeric datalabel
*/

View file

@ -2,9 +2,7 @@
/* $Id$ */
void
CC_psdnam(op, dnam)
char *dnam;
void CC_psdnam(int op, char* dnam)
{
/* Pseudo with data label
*/

View file

@ -2,9 +2,7 @@
/* $Id$ */
void
CC_pspnam(op, pnam)
char *pnam;
void CC_pspnam(int op, char* pnam)
{
/* Pseudo with procedure name
*/

View file

@ -2,10 +2,7 @@
/* $Id$ */
void
CC_scon(str, siz)
char *str;
arith siz;
void CC_scon(char* str, arith siz)
{
COMMA();
SCON(str, siz);

View file

@ -2,10 +2,7 @@
/* $Id$ */
void
CC_ucon(val,siz)
char *val;
arith siz;
void CC_ucon(char* val,arith siz)
{
COMMA();
WCON(sp_ucon, val, siz);