From dc269e57d815b7fd88a45f840cf8dcf748160f22 Mon Sep 17 00:00:00 2001 From: carl Date: Sat, 11 May 2019 00:53:52 +0800 Subject: [PATCH] ANSI C conversion of code and adapt man page accordingly. --- modules/src/em_mes/C_ms_stb.c | 26 +++----------- modules/src/em_mes/em_mes.3 | 65 ++++++++++------------------------- 2 files changed, 22 insertions(+), 69 deletions(-) diff --git a/modules/src/em_mes/C_ms_stb.c b/modules/src/em_mes/C_ms_stb.c index 600b747dc..6dc88957f 100644 --- a/modules/src/em_mes/C_ms_stb.c +++ b/modules/src/em_mes/C_ms_stb.c @@ -19,12 +19,7 @@ void C_ms_stb_cst(char* s, int e1, int e2, arith e3) C_mes_end(); } -void -C_ms_stb_dlb(s, e1, e2, l, off) - char *s; - int e1, e2; - label l; - arith off; +void C_ms_stb_dlb(char *s, int e1, int e2, label l, arith off) { C_mes_begin(ms_stb); if (s) C_scon(s, (arith) (strlen(s)+1)); @@ -34,12 +29,7 @@ C_ms_stb_dlb(s, e1, e2, l, off) C_mes_end(); } -void -C_ms_stb_dnam(s, e1, e2, l, off) - char *s; - int e1, e2; - char *l; - arith off; +void C_ms_stb_dnam(char *s, int e1, int e2, char *l, arith off) { C_mes_begin(ms_stb); if (s) C_scon(s, (arith) (strlen(s)+1)); @@ -49,11 +39,7 @@ C_ms_stb_dnam(s, e1, e2, l, off) C_mes_end(); } -void -C_ms_stb_ilb(s, e1, e2, l) - char *s; - int e1, e2; - label l; +void C_ms_stb_ilb(char *s, int e1, int e2, label l) { C_mes_begin(ms_stb); if (s) C_scon(s, (arith) (strlen(s)+1)); @@ -63,11 +49,7 @@ C_ms_stb_ilb(s, e1, e2, l) C_mes_end(); } -void -C_ms_stb_pnam(s, e1, e2, p) - char *s; - int e1, e2; - char *p; +void C_ms_stb_pnam(char *s, int e1, int e2, char *p) { C_mes_begin(ms_stb); if (s) C_scon(s, (arith) (strlen(s)+1)); diff --git a/modules/src/em_mes/em_mes.3 b/modules/src/em_mes/em_mes.3 index 84b4a7890..3ba4beb8d 100644 --- a/modules/src/em_mes/em_mes.3 +++ b/modules/src/em_mes/em_mes.3 @@ -6,68 +6,39 @@ em_mes \- EM-message generating routines .nf .B #include .PP -.B void C_ms_err() +.B void C_ms_err(void) .PP -.B void C_ms_opt() +.B void C_ms_opt(void) .PP -.B void C_ms_emx(wsiz, psiz) -.B arith wsiz, psiz; +.B void C_ms_emx(arith wsiz, arith psiz) .PP .B #include -.B void C_ms_reg(offs, siz, class, prior) -.B arith offs, siz; -.B int class, prior; +.B void C_ms_reg(arith offs, arith siz, int class, int prior) .PP -.B void C_ms_src(nlines, filnam) -.B int nlines; -.B char *filnam; +.B void C_ms_src(int nlines, char *filnam) .PP -.B void C_ms_flt() +.B void C_ms_flt(void) .PP -.B void C_ms_com(str) -.B char *str; +.B void C_ms_com(char *str) .PP -.B void C_ms_par(nparams) -.B arith nparams; +.B void C_ms_par(arith nparams) .PP .B #include -.B void C_ms_ego(hint, offs, siz, regno) -.B int hint, regno; -.B arith offs, siz; +.B void C_ms_ego(int hint, arith offs, arith siz, int regno) .PP -.B void C_ms_gto() +.B void C_ms_gto(void) .PP -.B void C_ms_stb_cst(s, e1, e2, e3) -.B char *s; -.B int e1, e2; -.B arith e3; +.B void C_ms_stb_cst(char *s, int e1, int e2, arith e3) .PP -.B void C_ms_stb_dlb(s, e1, e2, l, off) -.B char *s; -.B int e1, e2; -.B label l; -.B arith off; +.B void C_ms_stb_dlb(char *s, int e1, int e2, label l, arith off) .PP -.B void C_ms_stb_dnam(s, e1, e2, l, off) -.B char *s; -.B int e1, e2; -.B char *l; -.B arith off; +.B void C_ms_stb_dnam(char *s, int e1, int e2, char *l, arith off) .PP -.B void C_ms_stb_ilb(s, e1, e2, l) -.B char *s; -.B int e1, e2; -.B label l; +.B void C_ms_stb_ilb(char *s, int e1, int e2, label l) .PP -.B void C_ms_stb_pnam(s, e1, e2, p) -.B char *s; -.B int e1, e2; -.B char *p; +.B void C_ms_stb_pnam(char *s, int e1, int e2, char *p) .PP -.B void C_ms_std(s, e1, l) -.B char *s; -.B int e1; -.B int l; +.B void C_ms_std(char* s, int e1, int l) .fi .SH DESCRIPTION This set of routines forms a front end for the @@ -108,7 +79,7 @@ can be used to indicate that a local variable, having offset and size (in bytes) .IR siz , may be stored in a register. -.I Class +.I class indicates the use of the variable. The following classes are allowed (the names are defined in em_reg.h): .RS @@ -122,7 +93,7 @@ pointer variable floating point variable .LP .RE -.I Prior +.I prior is taken to be the priority of the variable; higher numbers indicate better candidates. .PP