From 287ce098825dc7c070edbb4f3cc742eff15cfdc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski=20=28amade=29?= Date: Mon, 3 Jan 2011 04:21:02 +0100 Subject: rewrite functions definitions --- src/acls.c | 82 ++++------------ src/ansi.c | 191 ++++++++++-------------------------- src/attacher.c | 19 +--- src/canvas.c | 46 +++------ src/display.c | 231 +++++++++++++------------------------------ src/encoding.c | 113 ++++++--------------- src/fileio.c | 45 +++------ src/help.c | 50 +++------- src/input.c | 25 +---- src/layer.c | 126 +++++------------------- src/layout.c | 48 +++------ src/list_window.c | 4 +- src/loadav.c | 3 +- src/logfile.c | 38 +++----- src/mark.c | 54 +++-------- src/misc.c | 92 +++++------------- src/nethack.c | 3 +- src/process.c | 286 ++++++++++++++---------------------------------------- src/pty.c | 30 ++---- src/putenv.c | 9 +- src/resize.c | 53 +++------- src/sched.c | 10 +- src/screen.c | 101 +++++-------------- src/search.c | 30 ++---- src/socket.c | 64 ++++-------- src/teln.c | 51 +++------- src/termcap.c | 65 ++++--------- src/utmp.c | 55 +++-------- src/viewport.c | 3 +- src/window.c | 125 ++++++------------------ 30 files changed, 545 insertions(+), 1507 deletions(-) diff --git a/src/acls.c b/src/acls.c index 89963c0..887bd78 100644 --- a/src/acls.c +++ b/src/acls.c @@ -99,9 +99,7 @@ static int UserAclCopy (struct acluser **, struct acluser **); static int -GrowBitfield(bfp, len, delta, defaultbit) -AclBits *bfp; -int len, delta, defaultbit; +GrowBitfield(AclBits *bfp, int len, int delta, int defaultbit) { AclBits n, o = *bfp; int i; @@ -127,8 +125,7 @@ int len, delta, defaultbit; * or NULL which may be replaced by a User-ptr to create the entry. */ struct acluser ** -FindUserPtr(name) -char *name; +FindUserPtr(char *name) { struct acluser **u; @@ -153,9 +150,7 @@ int DefaultMetaEsc = -1; * He has default rights, determined by umask. */ int -UserAdd(name, pass, up) -char *name, *pass; -struct acluser **up; +UserAdd(char *name, char *pass, struct acluser **up) { #ifdef MULTIUSER int j; @@ -329,9 +324,7 @@ struct acluser **up; * Destroy all his permissions and completely detach him from the session. */ int -UserDel(name, up) -char *name; -struct acluser **up; +UserDel(char *name, struct acluser **up) { struct acluser *u; #ifdef MULTIUSER @@ -405,8 +398,7 @@ struct acluser **up; * Also removes any references into the users copybuffer */ int -UserFreeCopyBuffer(u) -struct acluser *u; +UserFreeCopyBuffer(struct acluser *u) { struct win *w; struct paster *pa; @@ -435,10 +427,7 @@ struct acluser *u; * the last next pointer is returned. This address will contain NULL. */ static struct aclusergroup ** -FindGroupPtr(gp, u, recursive) -struct aclusergroup **gp; -struct acluser *u; -int recursive; +FindGroupPtr(struct aclusergroup **gp, struct acluser *u, int recursive) { struct aclusergroup **g; @@ -471,8 +460,7 @@ const char *pw, *password; * Cyclic links are prevented. */ int -AclLinkUser(from, to) -char *from, *to; +AclLinkUser(char *from, char *to) { struct acluser **u1, **u2; struct aclusergroup **g; @@ -500,9 +488,7 @@ char *from, *to; * returns NULL if successfull, an static error string otherwise */ char * -DoSu(up, name, pw1, pw2) -struct acluser **up; -char *name, *pw1, *pw2; +DoSu(struct acluser **up, char *name, char *pw1, char *pw2) { struct acluser *u; int sorry = 0; @@ -609,9 +595,7 @@ char *name, *pw1, *pw2; /* This gives the users default rights to the new window w created by u */ int -NewWindowAcl(w, u) -struct win *w; -struct acluser *u; +NewWindowAcl(struct win *w, struct acluser *u) { int i, j; @@ -642,8 +626,7 @@ struct acluser *u; } void -FreeWindowAcl(w) -struct win *w; +FreeWindowAcl(struct win *w) { int i; @@ -660,10 +643,7 @@ struct win *w; * AclSetPermWin, try to merge both functions. */ static int -AclSetPermCmd(u, mode, cmd) -struct acluser *u; -char *mode; -struct comm *cmd; +AclSetPermCmd(struct acluser *u, char *mode, struct comm *cmd) { int neg = 0; char *m = mode; @@ -705,10 +685,7 @@ struct comm *cmd; * uu should be NULL, except if you want to change his umask. */ static int -AclSetPermWin(uu, u, mode, win) -struct acluser *u, *uu; -char *mode; -struct win *win; +AclSetPermWin(struct acluser *uu, struct acluser *u, char *mode, struct win *win) { int neg = 0; int bit, bits; @@ -805,9 +782,7 @@ struct win *win; * uu should be NULL, except if you want to change his umask. */ int -AclSetPerm(uu, u, mode, s) -struct acluser *uu, *u; -char *mode, *s; +AclSetPerm(struct acluser *uu, struct acluser *u, char *mode, char *s) { struct win *w; int i; @@ -869,10 +844,7 @@ char *mode, *s; * uu should be NULL, except if you want to change his umask. */ static int -UserAcl(uu, u, argc, argv) -struct acluser *uu, **u; -int argc; -char **argv; +UserAcl(struct acluser *uu, struct acluser **u, int argc, char **argv) { if ((*u && !strcmp((*u)->u_name, "nobody")) || (argc > 1 && !strcmp(argv[0], "nobody"))) @@ -901,8 +873,7 @@ char **argv; } static int -UserAclCopy(to_up, from_up) -struct acluser **to_up, **from_up; +UserAclCopy(struct acluser **to_up, struct acluser **from_up) { struct win *w; int i, j, to_id, from_id; @@ -956,10 +927,7 @@ struct acluser **to_up, **from_up; * uu should be NULL, except if you want to change his umask. */ int -UsersAcl(uu, argc, argv) -struct acluser *uu; -int argc; -char **argv; +UsersAcl(struct acluser *uu, int argc, char **argv) { char *s; int r; @@ -1017,10 +985,7 @@ char **argv; * default_c_bits umask ??±rwxn */ int -AclUmask(u, str, errp) -struct acluser *u; -char *str; -char **errp; +AclUmask(struct acluser *u, char *str, char **errp) { char mode[16]; char *av[3]; @@ -1061,8 +1026,7 @@ char **errp; } void -AclWinSwap(a, b) -int a, b; +AclWinSwap(int a, int b) { debug2("AclWinSwap(%d, %d) NOP.\n", a, b); } @@ -1070,10 +1034,7 @@ int a, b; struct acluser *EffectiveAclUser = NULL; /* hook for AT command permission */ int -AclCheckPermWin(u, mode, w) -struct acluser *u; -int mode; -struct win *w; +AclCheckPermWin(struct acluser *u, int mode, struct win *w) { int ok; @@ -1108,10 +1069,7 @@ struct win *w; } int -AclCheckPermCmd(u, mode, c) -struct acluser *u; -int mode; -struct comm *c; +AclCheckPermCmd(struct acluser *u, int mode, struct comm *c) { int ok; diff --git a/src/ansi.c b/src/ansi.c index cb7eb01..b22b099 100644 --- a/src/ansi.c +++ b/src/ansi.c @@ -175,16 +175,14 @@ static void MBceLine (struct win *, int, int, int, int); #endif void -ResetAnsiState(p) -struct win *p; +ResetAnsiState(struct win *p) { p->w_state = LIT; p->w_StringType = NONE; } void -ResetWindow(p) -register struct win *p; +ResetWindow(register struct win *p) { register int i; @@ -218,9 +216,7 @@ register struct win *p; /* adds max 22 bytes */ int -GetAnsiStatus(w, buf) -struct win *w; -char *buf; +GetAnsiStatus(struct win *w, char *buf) { char *p = buf; @@ -247,8 +243,7 @@ char *buf; #ifdef FONT void -ResetCharsets(p) -struct win *p; +ResetCharsets(struct win *p) { p->w_gr = nwin_default.gr; p->w_c1 = nwin_default.c1; @@ -261,9 +256,7 @@ struct win *p; } void -SetCharsets(p, s) -struct win *p; -char *s; +SetCharsets(struct win *p, char *s) { int i; @@ -292,10 +285,7 @@ char *s; * */ void -WriteString(wp, buf, len) -struct win *wp; -register char *buf; -register int len; +WriteString(struct win *wp, register char *buf, register int len) { register int c; #ifdef FONT @@ -906,10 +896,7 @@ register int len; } static void -WLogString(p, buf, len) -struct win *p; -char *buf; -int len; +WLogString(struct win *p, char *buf, int len) { if (!p->w_log) return; @@ -930,8 +917,7 @@ int len; } static int -Special(c) -register int c; +Special(register int c) { switch (c) { @@ -966,8 +952,7 @@ register int c; } static void -DoESC(c, intermediate) -int c, intermediate; +DoESC(int c, int intermediate) { debug2("DoESC: %x - inter = %x\n", c, intermediate); switch (intermediate) @@ -1108,8 +1093,7 @@ int c, intermediate; } static void -DoCSI(c, intermediate) -int c, intermediate; +DoCSI(int c, int intermediate) { register int i, a1 = curr->w_args[0], a2 = curr->w_args[1]; @@ -1486,8 +1470,7 @@ int c, intermediate; static void -StringStart(type) -enum string_t type; +StringStart(enum string_t type) { curr->w_StringType = type; curr->w_stringp = curr->w_string; @@ -1495,8 +1478,7 @@ enum string_t type; } static void -StringChar(c) -int c; +StringChar(int c) { if (curr->w_stringp >= curr->w_string + MAXSTR - 1) curr->w_state = LIT; @@ -1662,8 +1644,7 @@ PrintStart() } static void -PrintChar(c) -int c; +PrintChar(int c) { if (curr->w_stringp >= curr->w_string + MAXSTR - 1) PrintFlush(); @@ -1705,9 +1686,7 @@ PrintFlush() void -WNewAutoFlow(win, on) -struct win *win; -int on; +WNewAutoFlow(struct win *win, int on) { debug1("WNewAutoFlow: %d\n", on); if (win->w_flow & FLOW_AUTOFLAG) @@ -1721,8 +1700,7 @@ int on; #ifdef FONT static void -DesignateCharset(c, n) -int c, n; +DesignateCharset(int c, int n) { curr->w_ss = 0; # ifdef ENCODINGS @@ -1746,8 +1724,7 @@ int c, n; } static void -MapCharset(n) -int n; +MapCharset(int n) { curr->w_ss = 0; if (curr->w_Charset != n) @@ -1760,8 +1737,7 @@ int n; } static void -MapCharsetR(n) -int n; +MapCharsetR(int n) { curr->w_ss = 0; if (curr->w_CharsetR != n) @@ -1775,8 +1751,7 @@ int n; #endif /* FONT */ static void -SaveCursor(cursor) -struct cursor *cursor; +SaveCursor(struct cursor *cursor) { cursor->on = 1; cursor->x = curr->w_x; @@ -1791,8 +1766,7 @@ struct cursor *cursor; } static void -RestoreCursor(cursor) -struct cursor *cursor; +RestoreCursor(struct cursor *cursor) { if (!cursor->on) return; @@ -1837,8 +1811,7 @@ Return() } static void -LineFeed(out_mode) -int out_mode; +LineFeed(int out_mode) { /* out_mode: 0=lf, 1=cr+lf */ if (out_mode) @@ -1871,8 +1844,7 @@ ReverseLineFeed() } static void -InsertChar(n) -int n; +InsertChar(int n) { register int y = curr->w_y, x = curr->w_x; @@ -1887,8 +1859,7 @@ int n; } static void -DeleteChar(n) -int n; +DeleteChar(int n) { register int y = curr->w_y, x = curr->w_x; @@ -1901,8 +1872,7 @@ int n; } static void -DeleteLine(n) -int n; +DeleteLine(int n) { if (curr->w_y < curr->w_top || curr->w_y > curr->w_bot) return; @@ -1914,8 +1884,7 @@ int n; } static void -InsertLine(n) -int n; +InsertLine(int n) { if (curr->w_y < curr->w_top || curr->w_y > curr->w_bot) return; @@ -1927,8 +1896,7 @@ int n; } static void -ScrollRegion(n) -int n; +ScrollRegion(int n) { MScrollV(curr, n, curr->w_top, curr->w_bot, CURR_BCE); LScrollV(&curr->w_layer, n, curr->w_top, curr->w_bot, CURR_BCE); @@ -2005,8 +1973,7 @@ ClearToEOS() } static void -ClearLineRegion(from, to) -int from, to; +ClearLineRegion(int from, int to) { register int y = curr->w_y; LClearArea(&curr->w_layer, from, y, to, y, CURR_BCE, 1); @@ -2015,8 +1982,7 @@ int from, to; } static void -CursorRight(n) -register int n; +CursorRight(register int n) { register int x = curr->w_x; @@ -2031,8 +1997,7 @@ register int n; } static void -CursorUp(n) -register int n; +CursorUp(register int n) { if (curr->w_y < curr->w_top) /* if above scrolling rgn, */ { @@ -2046,8 +2011,7 @@ register int n; } static void -CursorDown(n) -register int n; +CursorDown(register int n) { if (curr->w_y > curr->w_bot) /* if below scrolling rgn, */ { @@ -2061,8 +2025,7 @@ register int n; } static void -CursorLeft(n) -register int n; +CursorLeft(register int n) { if ((curr->w_x -= n) < 0) curr->w_x = 0; @@ -2070,8 +2033,7 @@ register int n; } static void -ASetMode(on) -int on; +ASetMode(int on) { register int i; @@ -2232,10 +2194,7 @@ FillWithEs() */ void -ChangeAKA(p, s, l) -struct win *p; -char *s; -int l; +ChangeAKA(struct win *p, char *s, int l) { int i, c; @@ -2318,9 +2277,7 @@ RestorePosRendition() /* Send a terminal report as if it were typed. */ static void -Report(fmt, n1, n2) -char *fmt; -int n1, n2; +Report(char *fmt, int n1, int n2) { register int len; char rbuf[40]; /* enough room for all replys */ @@ -2362,10 +2319,7 @@ int n1, n2; */ static void -MFixLine(p, y, mc) -struct win *p; -int y; -struct mchar *mc; +MFixLine(struct win *p, int y, struct mchar *mc) { struct mline *ml = &p->w_mlines[y]; if (mc->attr && ml->attr == null) @@ -2445,9 +2399,7 @@ struct mchar *mc; #endif static void -MScrollH(p, n, y, xs, xe, bce) -struct win *p; -int n, y, xs, xe, bce; +MScrollH(struct win *p, int n, int y, int xs, int xe, int bce) { struct mline *ml; @@ -2490,9 +2442,7 @@ int n, y, xs, xe, bce; } static void -MScrollV(p, n, ys, ye, bce) -struct win *p; -int n, ys, ye, bce; +MScrollV(struct win *p, int n, int ys, int ye, int bce) { int i, cnt1, cnt2; struct mline tmp[256]; @@ -2610,9 +2560,7 @@ int n, ys, ye, bce; } static void -Scroll(cp, cnt1, cnt2, tmp) -char *cp, *tmp; -int cnt1, cnt2; +Scroll(char *cp, int cnt1, int cnt2, char *tmp) { if (!cnt1 || !cnt2) return; @@ -2631,9 +2579,7 @@ int cnt1, cnt2; } static void -MClearArea(p, xs, ys, xe, ye, bce) -struct win *p; -int xs, ys, xe, ye, bce; +MClearArea(struct win *p, int xs, int ys, int xe, int ye, int bce) { int n, y; int xxe; @@ -2668,10 +2614,7 @@ int xs, ys, xe, ye, bce; } static void -MInsChar(p, c, x, y) -struct win *p; -struct mchar *c; -int x, y; +MInsChar(struct win *p, struct mchar *c, int x, int y) { int n; struct mline *ml; @@ -2713,10 +2656,7 @@ int x, y; } static void -MPutChar(p, c, x, y) -struct win *p; -struct mchar *c; -int x, y; +MPutChar(struct win *p, struct mchar *c, int x, int y) { struct mline *ml; @@ -2748,11 +2688,7 @@ int x, y; static void -MWrapChar(p, c, y, top, bot, ins) -struct win *p; -struct mchar *c; -int y, top, bot; -int ins; +MWrapChar(struct win *p, struct mchar *c, int y, int top, int bot, int ins) { struct mline *ml; int bce; @@ -2776,12 +2712,7 @@ int ins; } static void -MPutStr(p, s, n, r, x, y) -struct win *p; -char *s; -int n; -struct mchar *r; -int x, y; +MPutStr(struct win *p, char *s, int n, struct mchar *r, int x, int y) { struct mline *ml; int i; @@ -2834,9 +2765,7 @@ int x, y; #ifdef COLOR static void -MBceLine(p, y, xs, xe, bce) -struct win *p; -int y, xs, xe, bce; +MBceLine(struct win *p, int y, int xs, int xe, int bce) { struct mchar mc; struct mline *ml; @@ -2865,9 +2794,7 @@ int y, xs, xe, bce; #ifdef COPY_PASTE static void -WAddLineToHist(wp, ml) -struct win *wp; -struct mline *ml; +WAddLineToHist(struct win *wp, struct mline *ml) { register unsigned char *q, *o; struct mline *hml; @@ -2907,9 +2834,7 @@ struct mline *ml; #endif int -MFindUsedLine(p, ye, ys) -struct win *p; -int ys, ye; +MFindUsedLine(struct win *p, int ye, int ys) { int y; struct mline *ml = p->w_mlines + ye; @@ -2954,9 +2879,7 @@ int ys, ye; * more than once. */ void -WBell(p, visual) -struct win *p; -int visual; +WBell(struct win *p, int visual) { struct canvas *cv; if (displays == NULL) @@ -2983,9 +2906,7 @@ int visual; * (screen uses \Eg as special vbell sequence) */ static void -WReverseVideo(p, on) -struct win *p; -int on; +WReverseVideo(struct win *p, int on) { struct canvas *cv; for (cv = p->w_layer.l_cvlist; cv; cv = cv->c_lnext) @@ -3005,10 +2926,7 @@ int on; } void -WMsg(p, err, str) -struct win *p; -int err; -char *str; +WMsg(struct win *p, int err, char *str) { extern struct layer *flayer; struct layer *oldflayer = flayer; @@ -3018,9 +2936,7 @@ char *str; } void -WChangeSize(p, w, h) -struct win *p; -int w, h; +WChangeSize(struct win *p, int w, int h) { int wok = 0; struct canvas *cv; @@ -3066,10 +2982,7 @@ int w, h; } static int -WindowChangedCheck(s, what, hp) -char *s; -int what; -int *hp; +WindowChangedCheck(char *s, int what, int *hp) { int h = 0; int l; @@ -3100,9 +3013,7 @@ int *hp; } void -WindowChanged(p, what) -struct win *p; -int what; +WindowChanged(struct win *p, int what) { int inwstr, inhstr, inlstr; int inwstrh = 0, inhstrh = 0, inlstrh = 0; diff --git a/src/attacher.c b/src/attacher.c index 80f941e..e2e3ccb 100644 --- a/src/attacher.c +++ b/src/attacher.c @@ -110,9 +110,7 @@ QueryResultFail SIGDEFARG */ static int -WriteMessage(s, m) -int s; -struct msg *m; +WriteMessage(int s, struct msg *m) { int r, l = sizeof(*m); @@ -135,8 +133,7 @@ struct msg *m; int -Attach(how) -int how; +Attach(int how) { int n, lasts; struct msg m; @@ -811,11 +808,7 @@ LockTerminal() static int PAM_conv (int, const struct pam_message **, struct pam_response **, void *); static int -PAM_conv(num_msg, msg, resp, appdata_ptr) -int num_msg; -const struct pam_message **msg; -struct pam_response **resp; -void *appdata_ptr; +PAM_conv(int num_msg, const struct pam_message **msg, struct pam_response **resp, void *appdata_ptr) { int replies = 0; struct pam_response *reply = NULL; @@ -987,11 +980,7 @@ screen_builtin_lck() void -SendCmdMessage(sty, match, av, query) -char *sty; -char *match; -char **av; -int query; +SendCmdMessage(char *sty, char *match, char **av, int query) { int i, s; struct msg m; diff --git a/src/canvas.c b/src/canvas.c index 93177cb..38c88ab 100644 --- a/src/canvas.c +++ b/src/canvas.c @@ -40,8 +40,7 @@ extern struct LayFuncs BlankLf; extern int focusminwidth, focusminheight; static void -CanvasInitBlank(cv) -struct canvas *cv; +CanvasInitBlank(struct canvas *cv) { cv->c_blank.l_cvlist = cv; cv->c_blank.l_width = cv->c_xe - cv->c_xs + 1; @@ -56,8 +55,7 @@ struct canvas *cv; } static void -FreePerp(pcv) -struct canvas *pcv; +FreePerp(struct canvas *pcv) { struct canvas *cv; @@ -87,8 +85,7 @@ struct canvas *pcv; } void -FreeCanvas(cv) -struct canvas *cv; +FreeCanvas(struct canvas *cv) { struct viewport *vp, *nvp; struct canvas **cvp; @@ -141,8 +138,7 @@ struct canvas *cv; } int -CountCanvas(cv) -struct canvas *cv; +CountCanvas(struct canvas *cv) { int num = 0; for (; cv; cv = cv->c_slnext) @@ -167,8 +163,7 @@ struct canvas *cv; } int -CountCanvasPerp(cv) -struct canvas *cv; +CountCanvasPerp(struct canvas *cv) { struct canvas *cvp; int num = 1, n; @@ -183,8 +178,7 @@ struct canvas *cv; } struct canvas * -FindCanvas(x, y) -int x, y; +FindCanvas(int x, int y) { struct canvas *cv, *mcv = 0; int m, mm = 0; @@ -233,9 +227,7 @@ int x, y; } void -SetCanvasWindow(cv, wi) -struct canvas *cv; -struct win *wi; +SetCanvasWindow(struct canvas *cv, struct win *wi) { struct win *p = 0, **pp; struct layer *l; @@ -408,9 +400,7 @@ MakeDefaultCanvas() } static struct canvas ** -CreateCanvasChainRec(cv, cvp) -struct canvas *cv; -struct canvas **cvp; +CreateCanvasChainRec(struct canvas *cv, struct canvas **cvp) { for (; cv; cv = cv->c_slnext) { @@ -434,9 +424,7 @@ RecreateCanvasChain() } void -EqualizeCanvas(cv, gflag) -struct canvas *cv; -int gflag; +EqualizeCanvas(struct canvas *cv, int gflag) { struct canvas *cv2; for (; cv; cv = cv->c_slnext) @@ -454,8 +442,7 @@ int gflag; } void -ResizeCanvas(cv) -struct canvas *cv; +ResizeCanvas(struct canvas *cv) { struct canvas *cv2, *cvn, *fcv; int nh, i, maxi, hh, m, w, wsum; @@ -642,8 +629,7 @@ struct canvas *cv; } static struct canvas * -AddPerp(cv) -struct canvas *cv; +AddPerp(struct canvas *cv) { struct canvas *pcv; debug("Creating new perp node\n"); @@ -681,8 +667,7 @@ struct canvas *cv; } int -AddCanvas(orient) -int orient; +AddCanvas(int orient) { struct canvas *cv; int xs, xe, ys, ye; @@ -848,9 +833,7 @@ OneCanvas() } void -DupLayoutCv(cvf, cvt, save) -struct canvas *cvf, *cvt; -int save; +DupLayoutCv(struct canvas *cvf, struct canvas *cvt, int save) { while(cvf) { @@ -897,8 +880,7 @@ int save; } void -PutWindowCv(cv) -struct canvas *cv; +PutWindowCv(struct canvas *cv) { struct win *p; for (; cv; cv = cv->c_slnext) diff --git a/src/display.c b/src/display.c index d826f04..6d56dd9 100644 --- a/src/display.c +++ b/src/display.c @@ -134,42 +134,35 @@ int focusminwidth, focusminheight; */ void -DefProcess(bufp, lenp) -char **bufp; -int *lenp; +DefProcess(char **bufp, int *lenp) { *bufp += *lenp; *lenp = 0; } void -DefRedisplayLine(y, xs, xe, isblank) -int y, xs, xe, isblank; +DefRedisplayLine(int y, int xs, int xe, int isblank) { if (isblank == 0 && y >= 0) DefClearLine(y, xs, xe, 0); } void -DefClearLine(y, xs, xe, bce) -int y, xs, xe, bce; +DefClearLine(int y, int xs, int xe, int bce) { LClearLine(flayer, y, xs, xe, bce, (struct mline *)0); } /*ARGSUSED*/ int -DefRewrite(y, xs, xe, rend, doit) -int y, xs, xe, doit; -struct mchar *rend; +DefRewrite(int y, int xs, int xe, struct mchar *rend, int doit) { return EXPENSIVE; } /*ARGSUSED*/ int -DefResize(wi, he) -int wi, he; +DefResize(int wi, int he) { return -1; } @@ -205,8 +198,7 @@ struct LayFuncs BlankLf = /*ARGSUSED*/ static int -BlankResize(wi, he) -int wi, he; +BlankResize(int wi, int he) { flayer->l_width = wi; flayer->l_height = he; @@ -221,10 +213,7 @@ int wi, he; */ struct display * -MakeDisplay(uname, utty, term, fd, pid, Mode) -char *uname, *utty, *term; -int fd, pid; -struct mode *Mode; +MakeDisplay(char *uname, char *utty, char *term, int fd, int pid, struct mode *Mode) { struct acluser **u; struct baud_values *b; @@ -428,8 +417,7 @@ FreeDisplay() * we may try to restore our old window sizes. */ void -InitTerm(adapt) -int adapt; +InitTerm(int adapt) { ASSERT(display); ASSERT(D_tcinited); @@ -509,8 +497,7 @@ FinitTerm() static void -INSERTCHAR(c) -int c; +INSERTCHAR(int c) { ASSERT(display); if (!D_insert && D_x < D_width - 1) @@ -535,8 +522,7 @@ int c; } void -PUTCHAR(c) -int c; +PUTCHAR(int c) { ASSERT(display); if (D_insert && D_x < D_width - 1) @@ -545,8 +531,7 @@ int c; } void -PUTCHARLP(c) -int c; +PUTCHARLP(int c) { if (D_x < D_width - 1) { @@ -585,8 +570,7 @@ int c; */ STATIC void -RAW_PUTCHAR(c) -int c; +RAW_PUTCHAR(int c) { ASSERT(display); @@ -686,8 +670,7 @@ addedutf8: } static int -DoAddChar(c) -int c; +DoAddChar(int c) { /* this is for ESC-sequences only (AddChar is a macro) */ AddChar(c); @@ -695,8 +678,7 @@ int c; } void -AddCStr(s) -char *s; +AddCStr(char *s) { if (display && s && *s) { @@ -706,9 +688,7 @@ char *s; } void -AddCStr2(s, c) -char *s; -int c; +AddCStr2(char *s, int c) { if (display && s && *s) { @@ -721,8 +701,7 @@ int c; /* Insert mode is a toggle on some terminals, so we need this hack: */ void -InsertMode(on) -int on; +InsertMode(int on) { if (display && on != D_insert && D_IM) { @@ -737,8 +716,7 @@ int on; /* ...and maybe keypad application mode is a toggle, too: */ void -KeypadMode(on) -int on; +KeypadMode(int on) { #ifdef MAPKEYS if (display) @@ -756,8 +734,7 @@ int on; } void -CursorkeysMode(on) -int on; +CursorkeysMode(int on) { #ifdef MAPKEYS if (display) @@ -775,8 +752,7 @@ int on; } void -ReverseVideo(on) -int on; +ReverseVideo(int on) { if (display && D_revvid != on && D_CVR) { @@ -789,8 +765,7 @@ int on; } void -CursorVisibility(v) -int v; +CursorVisibility(int v) { if (display && D_curvis != v) { @@ -808,8 +783,7 @@ int v; } void -MouseMode(mode) -int mode; +MouseMode(int mode) { if (!display) return; @@ -840,16 +814,14 @@ static int StrCost; /* ARGSUSED */ static int -CountChars(c) -int c; +CountChars(int c) { StrCost++; return c; } int -CalcCost(s) -register char *s; +CalcCost(register char *s) { ASSERT(display); if (s) @@ -864,8 +836,7 @@ register char *s; } static int -CallRewrite(y, xs, xe, doit) -int y, xs, xe, doit; +CallRewrite(int y, int xs, int xe, int doit) { struct canvas *cv, *cvlist, *cvlnext; struct viewport *vp; @@ -925,8 +896,7 @@ int y, xs, xe, doit; void -GotoPos(x2, y2) -int x2, y2; +GotoPos(int x2, int y2) { register int dy, dx, x1, y1; register int costx, costy; @@ -1131,8 +1101,7 @@ ClearAll() } void -ClearArea(x1, y1, xs, xe, x2, y2, bce, uselayfn) -int x1, y1, xs, xe, x2, y2, bce, uselayfn; +ClearArea(int x1, int y1, int xs, int xe, int x2, int y2, int bce, int uselayfn) { int y, xxe; struct canvas *cv; @@ -1249,8 +1218,7 @@ int x1, y1, xs, xe, x2, y2, bce, uselayfn; * too expensive over a low baud line. */ void -Redisplay(cur_only) -int cur_only; +Redisplay(int cur_only) { ASSERT(display); @@ -1277,8 +1245,7 @@ int cur_only; } void -RedisplayDisplays(cur_only) -int cur_only; +RedisplayDisplays(int cur_only) { struct display *olddisplay = display; for (display = displays; display; display = display->d_next) @@ -1289,9 +1256,7 @@ int cur_only; /* XXX: use oml! */ void -ScrollH(y, xs, xe, n, bce, oml) -int y, xs, xe, n, bce; -struct mline *oml; +ScrollH(int y, int xs, int xe, int n, int bce, struct mline *oml) { int i; @@ -1386,8 +1351,7 @@ struct mline *oml; } void -ScrollV(xs, ys, xe, ye, n, bce) -int xs, ys, xe, ye, n, bce; +ScrollV(int xs, int ys, int xe, int ye, int n, int bce) { int i; int up; @@ -1525,8 +1489,7 @@ int xs, ys, xe, ye, n, bce; } void -SetAttr(new) -register int new; +SetAttr(register int new) { register int i, j, old, typ; @@ -1603,8 +1566,7 @@ register int new; #ifdef FONT void -SetFont(new) -int new; +SetFont(int new) { int old = D_rend.font; if (!display || old == new) @@ -1650,8 +1612,7 @@ int new; #ifdef COLOR int -color256to16(jj) -int jj; +color256to16(int jj) { int min, max; int r, g, b; @@ -1680,8 +1641,7 @@ min) / (max - min) | (max > 3 ? 8 : 0); #ifdef COLORS256 int -color256to88(jj) -int jj; +color256to88(int jj) { int r, g, b; @@ -1700,8 +1660,7 @@ int jj; #endif void -SetColor(f, b) -int f, b; +SetColor(int f, int b) { int of, ob; static unsigned char sftrans[8] = {0,4,2,6,1,5,3,7}; @@ -1815,8 +1774,7 @@ int f, b; } static void -SetBackColor(new) -int new; +SetBackColor(int new) { if (!display) return; @@ -1825,8 +1783,7 @@ int new; #endif /* COLOR */ void -SetRendition(mc) -struct mchar *mc; +SetRendition(struct mchar *mc) { if (!display) return; @@ -1890,9 +1847,7 @@ struct mchar *mc; } void -SetRenditionMline(ml, x) -struct mline *ml; -int x; +SetRenditionMline(struct mline *ml, int x) { if (!display) return; @@ -1946,8 +1901,7 @@ int x; } void -MakeStatus(msg) -char *msg; +MakeStatus(char *msg) { register char *s, *t; register int max; @@ -2152,9 +2106,7 @@ strlen_onscreen(unsigned char *c, unsigned char *end) } static int -PrePutWinMsg(s, start, max) -char *s; -int start, max; +PrePutWinMsg(char *s, int start, int max) { /* Avoid double-encoding problem for a UTF-8 message on a UTF-8 locale. Ideally, this would not be necessary. But fixing it the Right Way will @@ -2178,7 +2130,7 @@ int start, max; } #else static int -PrePutWinMsg(s, start, max) +PrePutWinMsg(char *s, int start, int max) char *s; int start, max; { @@ -2189,8 +2141,7 @@ int start, max; /* refresh the display's hstatus line */ void -ShowHStatus(str) -char *str; +ShowHStatus(char *str) { int l, ox, oy, max; @@ -2304,8 +2255,7 @@ RefreshHStatus() */ void -RefreshAll(isblank) -int isblank; +RefreshAll(int isblank) { struct canvas *cv; @@ -2320,8 +2270,7 @@ int isblank; } void -RefreshArea(xs, ys, xe, ye, isblank) -int xs, ys, xe, ye, isblank; +RefreshArea(int xs, int ys, int xe, int ye, int isblank) { int y; ASSERT(display); @@ -2337,8 +2286,7 @@ int xs, ys, xe, ye, isblank; } void -RefreshLine(y, from, to, isblank) -int y, from, to, isblank; +RefreshLine(int y, int from, int to, int isblank) { struct viewport *vp, *lvp; struct canvas *cv, *lcv, *cvlist, *cvlnext; @@ -2494,8 +2442,7 @@ int y, from, to, isblank; * position must be safe. */ static void -WriteLP(x2, y2) -int x2, y2; +WriteLP(int x2, int y2) { struct mchar oldrend; @@ -2525,9 +2472,7 @@ int x2, y2; } void -ClearLine(oml, y, from, to, bce) -struct mline *oml; -int from, to, y, bce; +ClearLine(struct mline *oml, int y, int from, int to, int bce) { int x; #ifdef COLOR @@ -2572,9 +2517,7 @@ int from, to, y, bce; } void -DisplayLine(oml, ml, y, from, to) -struct mline *oml, *ml; -int from, to, y; +DisplayLine(struct mline *oml, struct mline *ml, int y, int from, int to) { register int x; int last2flag = 0, delete_lp = 0; @@ -2672,9 +2615,7 @@ int from, to, y; } void -PutChar(c, x, y) -struct mchar *c; -int x, y; +PutChar(struct mchar *c, int x, int y) { GotoPos(x, y); SetRendition(c); @@ -2692,10 +2633,7 @@ int x, y; } void -InsChar(c, x, xe, y, oml) -struct mchar *c; -int x, xe, y; -struct mline *oml; +InsChar(struct mchar *c, int x, int xe, int y, struct mline *oml) { GotoPos(x, y); if (y == D_bot && !D_CLP) @@ -2757,11 +2695,7 @@ struct mline *oml; } void -WrapChar(c, x, y, xs, ys, xe, ye, ins) -struct mchar *c; -int x, y; -int xs, ys, xe, ye; -int ins; +WrapChar(struct mchar *c, int x, int y, int xs, int ys, int xe, int ye, int ins) { int bce; @@ -2841,8 +2775,7 @@ int ins; } int -ResizeDisplay(wi, he) -int wi, he; +ResizeDisplay(int wi, int he) { ASSERT(display); debug2("ResizeDisplay: to (%d,%d).\n", wi, he); @@ -2869,8 +2802,7 @@ int wi, he; } void -ChangeScrollRegion(newtop, newbot) -int newtop, newbot; +ChangeScrollRegion(int newtop, int newbot) { if (display == 0) return; @@ -2899,9 +2831,7 @@ int newtop, newbot; #define WT_FLAG "2" /* change to "0" to set both title and icon */ void -SetXtermOSC(i, s) -int i; -char *s; +SetXtermOSC(int i, char *s) { static char *oscs[][2] = { { WT_FLAG ";", "screen" }, /* set window title */ @@ -2945,8 +2875,7 @@ ClearAllXtermOSC() */ void -AddStr(str) -char *str; +AddStr(char *str) { register char c; @@ -2965,9 +2894,7 @@ char *str; } void -AddStrn(str, n) -char *str; -int n; +AddStrn(char *str, int n) { register char c; @@ -2987,8 +2914,7 @@ int n; } void -Flush(progress) -int progress; +Flush(int progress) { register int l; int wr; @@ -3121,9 +3047,7 @@ Resize_obuf() } void -DisplaySleep1000(n, eat) -int n; -int eat; +DisplaySleep1000(int n, int eat) { char buf; fd_set r; @@ -3240,9 +3164,7 @@ NukePending() * we get EAGAIN */ static void -disp_writeev_eagain(ev, data) -struct event *ev; -char *data; +disp_writeev_eagain(struct event *ev, char *data) { display = (struct display *)data; evdeq(&D_writeev); @@ -3253,9 +3175,7 @@ char *data; #endif static void -disp_writeev_fn(ev, data) -struct event *ev; -char *data; +disp_writeev_fn(struct event *ev, char *data) { int len, size = OUTPUT_BLOCK_SIZE; @@ -3351,9 +3271,7 @@ char *data; } static void -disp_readev_fn(ev, data) -struct event *ev; -char *data; +disp_readev_fn(struct event *ev, char *data) { int size; char buf[IOSIZE]; @@ -3533,9 +3451,7 @@ char *data; } static void -disp_status_fn(ev, data) -struct event *ev; -char *data; +disp_status_fn(struct event *ev, char *data) { display = (struct display *)data; debug1("disp_status_fn for display %x\n", (int)display); @@ -3544,9 +3460,7 @@ char *data; } static void -disp_hstatus_fn(ev, data) -struct event *ev; -char *data; +disp_hstatus_fn(struct event *ev, char *data) { display = (struct display *)data; if (D_status == STATUS_ON_HS) @@ -3559,9 +3473,7 @@ char *data; } static void -disp_blocked_fn(ev, data) -struct event *ev; -char *data; +disp_blocked_fn(struct event *ev, char *data) { struct win *p; @@ -3583,9 +3495,7 @@ char *data; #ifdef MAPKEYS static void -disp_map_fn(ev, data) -struct event *ev; -char *data; +disp_map_fn(struct event *ev, char *data) { char *p; int l, i; @@ -3618,9 +3528,7 @@ char *data; #endif static void -disp_idle_fn(ev, data) -struct event *ev; -char *data; +disp_idle_fn(struct event *ev, char *data) { struct display *olddisplay; display = (struct display *)data; @@ -3657,9 +3565,7 @@ ResetIdle() #ifdef BLANKER_PRG static void -disp_blanker_fn(ev, data) -struct event *ev; -char *data; +disp_blanker_fn(struct event *ev, char *data) { char buf[IOSIZE], *b; int size; @@ -3719,8 +3625,7 @@ KillBlanker() } void -RunBlanker(cmdv) -char **cmdv; +RunBlanker(char **cmdv) { char *m; int pid; diff --git a/src/encoding.c b/src/encoding.c index 03c9d53..8e5b0af 100644 --- a/src/encoding.c +++ b/src/encoding.c @@ -305,8 +305,7 @@ InitBuiltinTabs() } static int -recode_char(c, to_utf, font) -int c, to_utf, font; +recode_char(int c, int to_utf, int font) { int f; unsigned short (*p)[2]; @@ -391,8 +390,7 @@ int c, to_utf, font; #ifdef DW_CHARS static int -recode_char_dw(c, c2p, to_utf, font) -int c, *c2p, to_utf, font; +recode_char_dw(int c, int *c2p, int to_utf, int font) { int f; unsigned short (*p)[2]; @@ -457,8 +455,7 @@ int c, *c2p, to_utf, font; #endif static int -recode_char_to_encoding(c, encoding) -int c, encoding; +recode_char_to_encoding(int c, int encoding) { char *fp; int x; @@ -477,8 +474,7 @@ int c, encoding; #ifdef DW_CHARS static int -recode_char_dw_to_encoding(c, c2p, encoding) -int c, *c2p, encoding; +recode_char_dw_to_encoding(int c, int *c2p, int encoding) { char *fp; int x; @@ -498,9 +494,7 @@ int c, *c2p, encoding; struct mchar * -recode_mchar(mc, from, to) -struct mchar *mc; -int from, to; +recode_mchar(struct mchar *mc, int from, int to) { static struct mchar rmc; int c; @@ -534,10 +528,7 @@ int from, to; } struct mline * -recode_mline(ml, w, from, to) -struct mline *ml; -int w; -int from, to; +recode_mline(struct mline *ml, int w, int from, int to) { static int maxlen; static int last; @@ -666,8 +657,7 @@ struct combchar { struct combchar **combchars; void -AddUtf8(c) -int c; +AddUtf8(int c) { ASSERT(D_encoding == UTF8); if (c >= 0xd800 && c < 0xe000 && combchars && combchars[c - 0xd800]) @@ -699,9 +689,7 @@ int c; } int -ToUtf8_comb(p, c) -char *p; -int c; +ToUtf8_comb(char *p, int c) { int l; @@ -714,9 +702,7 @@ int c; } int -ToUtf8(p, c) -char *p; -int c; +ToUtf8(char *p, int c) { int l = 1; if (c >= 0x10000) @@ -759,8 +745,7 @@ int c; * >= 0: decoded character */ int -FromUtf8(c, utf8charp) -int c, *utf8charp; +FromUtf8(int c, int *utf8charp) { int utf8char = *utf8charp; if (utf8char) @@ -822,9 +807,7 @@ int c, *utf8charp; void -WinSwitchEncoding(p, encoding) -struct win *p; -int encoding; +WinSwitchEncoding(struct win *p, int encoding) { int i, j, c; struct mline *ml; @@ -959,8 +942,7 @@ static int bisearch(int ucs, const struct interval *table, int max) { } int -utf8_isdouble(c) -int c; +utf8_isdouble(int c) { /* sorted list of non-overlapping intervals of East Asian Ambiguous * characters, generated by "uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf c" */ @@ -1038,8 +1020,7 @@ int c; #endif int -utf8_iscomb(c) -int c; +utf8_iscomb(int c) { /* taken from Markus Kuhn's wcwidth */ static const struct interval combining[] = { @@ -1097,8 +1078,7 @@ int c; } static void -comb_tofront(root, i) -int root, i; +comb_tofront(int root, int i) { for (;;) { @@ -1117,9 +1097,7 @@ int root, i; } void -utf8_handle_comb(c, mc) -int c; -struct mchar *mc; +utf8_handle_comb(int c, struct mchar *mc) { int root, i, c1; int isdouble; @@ -1195,9 +1173,7 @@ struct mchar *mc; #else /* !UTF8 */ void -WinSwitchEncoding(p, encoding) -struct win *p; -int encoding; +WinSwitchEncoding(struct win *p, int encoding) { p->w_encoding = encoding; return; @@ -1206,9 +1182,7 @@ int encoding; #endif /* UTF8 */ static int -encmatch(s1, s2) -char *s1; -char *s2; +encmatch(char *s1, char *s2) { int c1, c2; do @@ -1239,8 +1213,7 @@ char *s2; } int -FindEncoding(name) -char *name; +FindEncoding(char *name) { int encoding; @@ -1267,8 +1240,7 @@ char *name; } char * -EncodingName(encoding) -int encoding; +EncodingName(int encoding) { if (encoding >= (int)(sizeof(encodings)/sizeof(*encodings))) return 0; @@ -1276,15 +1248,13 @@ int encoding; } int -EncodingDefFont(encoding) -int encoding; +EncodingDefFont(int encoding) { return encodings[encoding].deffont; } void -ResetEncoding(p) -struct win *p; +ResetEncoding(struct win *p) { char *c; int encoding = p->w_encoding; @@ -1316,10 +1286,7 @@ struct win *p; int -DecodeChar(c, encoding, statep) -int c; -int encoding; -int *statep; +DecodeChar(int c, int encoding, int *statep) { int t; @@ -1424,11 +1391,7 @@ int *statep; } int -EncodeChar(bp, c, encoding, fontp) -char *bp; -int c; -int encoding; -int *fontp; +EncodeChar(char *bp, int c, int encoding, int *fontp) { int t, f, l; @@ -1602,8 +1565,7 @@ int *fontp; } int -CanEncodeFont(encoding, f) -int encoding, f; +CanEncodeFont(int encoding, int f) { switch(encoding) { @@ -1631,8 +1593,7 @@ int encoding, f; #ifdef DW_CHARS int -PrepareEncodedChar(c) -int c; +PrepareEncodedChar(int c) { int encoding; int t = 0; @@ -1684,11 +1645,7 @@ int c; #endif int -RecodeBuf(fbuf, flen, fenc, tenc, tbuf) -unsigned char *fbuf; -int flen; -int fenc, tenc; -unsigned char *tbuf; +RecodeBuf(unsigned char *fbuf, int flen, int fenc, int tenc, unsigned char *tbuf) { int c, i, j; int decstate = 0, font = 0; @@ -1709,10 +1666,7 @@ unsigned char *tbuf; #ifdef UTF8 int -ContainsSpecialDeffont(ml, xs, xe, encoding) -struct mline *ml; -int xs, xe; -int encoding; +ContainsSpecialDeffont(struct mline *ml, int xs, int xe, int encoding) { unsigned char *f, *i; int c, x, dx; @@ -1740,9 +1694,7 @@ int encoding; int -LoadFontTranslation(font, file) -int font; -char *file; +LoadFontTranslation(int font, char *file) { char buf[1024], *myfile; FILE *f; @@ -1831,8 +1783,7 @@ char *file; } void -LoadFontTranslationsForEncoding(encoding) -int encoding; +LoadFontTranslationsForEncoding(int encoding) { char *c; int f; @@ -1855,11 +1806,7 @@ int encoding; * copy/paste mode */ int -EncodeChar(bp, c, encoding, fontp) -char *bp; -int c; -int encoding; -int *fontp; +EncodeChar(char *bp, int c, int encoding, int *fontp) { int f, l; f = (c == -1) ? 0 : c >> 16; diff --git a/src/fileio.c b/src/fileio.c index f90c3cd..6e21fbe 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -61,8 +61,7 @@ char *rc_name = ""; int rc_recursion = 0; static char * -CatExtra(str1, str2) -register char *str1, *str2; +CatExtra(register char *str1, register char *str2) { register char *cp; register int len1, len2, add_colon; @@ -92,8 +91,7 @@ register char *str1, *str2; } static char * -findrcfile(rcfile) -char *rcfile; +findrcfile(char *rcfile) { char buf[256]; char *p; @@ -169,9 +167,7 @@ char *rcfile; * 2) rcfilename = RcFileName */ int -StartRc(rcfilename, nopanic) -char *rcfilename; -int nopanic; +StartRc(char *rcfilename, int nopanic) { register int argc, len; register char *p, *cp; @@ -293,8 +289,7 @@ int nopanic; } void -FinishRc(rcfilename) -char *rcfilename; +FinishRc(char *rcfilename) { char buf[2048]; FILE *fp; @@ -334,8 +329,7 @@ char *rcfilename; } void -do_source(rcfilename) -char *rcfilename; +do_source(char *rcfilename) { if (rc_recursion > 10) { @@ -354,9 +348,7 @@ char *rcfilename; * This is bad when we run detached. */ void -RcLine(ubuf, ubufl) -char *ubuf; -int ubufl; +RcLine(char *ubuf, int ubufl) { char *args[MAXARGS]; int argl[MAXARGS]; @@ -392,10 +384,7 @@ int ubufl; * needs display for copybuffer access and termcap dumping */ void -WriteFile(user, fn, dump) -struct acluser *user; -char *fn; -int dump; +WriteFile(struct acluser *user, char *fn, int dump) { /* dump==0: create .termcap, * dump==1: hardcopy, @@ -593,9 +582,7 @@ int dump; * stored. */ char * -ReadFile(fn, lenp) -char *fn; -int *lenp; +ReadFile(char *fn, int *lenp) { int i, l, size; char c, *bp, *buf; @@ -661,9 +648,7 @@ KillBuffers() */ FILE * -secfopen(name, mode) -char *name; -char *mode; +secfopen(char *name, char *mode) { FILE *fi; #ifndef USE_SETEUID @@ -707,10 +692,7 @@ char *mode; int -secopen(name, flags, mode) -char *name; -int flags; -int mode; +secopen(char *name, int flags, int mode) { int fd; #ifndef USE_SETEUID @@ -790,9 +772,7 @@ int mode; int -printpipe(p, cmd) -struct win *p; -char *cmd; +printpipe(struct win *p, char *cmd) { int pi[2]; if (pipe(pi)) @@ -830,8 +810,7 @@ char *cmd; } int -readpipe(cmdv) -char **cmdv; +readpipe(char **cmdv) { int pi[2]; diff --git a/src/help.c b/src/help.c index 72d8acd..2025b1f 100644 --- a/src/help.c +++ b/src/help.c @@ -61,8 +61,7 @@ extern char *wliststr; extern char *wlisttit; void -exit_with_usage(myname, message, arg) -char *myname, *message, *arg; +exit_with_usage(char *myname, char *message, char *arg) { printf("Use: %s [-opts] [cmd [args]]\n", myname); printf(" or: %s -r [host.tty]\n\nOptions:\n", myname); @@ -156,9 +155,7 @@ static struct LayFuncs HelpLf = void -display_help(class, ktabp) -char *class; -struct action *ktabp; +display_help(char *class, struct action *ktabp) { int i, n, key, mcom, mkey, l; struct helpdata *helpdata; @@ -242,9 +239,7 @@ struct action *ktabp; } static void -HelpProcess(ppbuf, plen) -char **ppbuf; -int *plen; +HelpProcess(char **ppbuf, int *plen) { int done = 0; @@ -373,9 +368,7 @@ helppage() } static void -AddAction(act, x, y) -struct action *act; -int x, y; +AddAction(struct action *act, int x, int y) { char buf[256]; int del, l; @@ -436,9 +429,7 @@ int x, y; } static void -add_key_to_buf(buf, key) -char *buf; -int key; +add_key_to_buf(char *buf, int key) { buf += strlen(buf); if (key < 0) @@ -462,8 +453,7 @@ int key; static void -HelpRedisplayLine(y, xs, xe, isblank) -int y, xs, xe, isblank; +HelpRedisplayLine(int y, int xs, int xe, int isblank) { if (y < 0) { @@ -606,9 +596,7 @@ screen-devel@gnu.org\n\n\n" ; static void -CopyrightProcess(ppbuf, plen) -char **ppbuf; -int *plen; +CopyrightProcess(char **ppbuf, int *plen) { int done = 0; struct copydata *copydata; @@ -737,8 +725,7 @@ copypage() } static void -CopyrightRedisplayLine(y, xs, xe, isblank) -int y, xs, xe, isblank; +CopyrightRedisplayLine(int y, int xs, int xe, int isblank) { ASSERT(flayer); if (y < 0) @@ -801,9 +788,7 @@ static struct LayFuncs BindkeyLf = void -display_bindkey(title, tab) -char *title; -struct action *tab; +display_bindkey(char *title, struct action *tab) { struct bindkeydata *bindkeydata; int i, n; @@ -921,9 +906,7 @@ bindkeypage() } static void -BindkeyProcess(ppbuf, plen) -char **ppbuf; -int *plen; +BindkeyProcess(char **ppbuf, int *plen) { int done = 0; struct bindkeydata *bindkeydata; @@ -957,8 +940,7 @@ int *plen; } static void -BindkeyRedisplayLine(y, xs, xe, isblank) -int y, xs, xe, isblank; +BindkeyRedisplayLine(int y, int xs, int xe, int isblank) { if (y < 0) { @@ -999,8 +981,7 @@ static struct LayFuncs ZmodemLf = /*ARGSUSED*/ static int -ZmodemResize(wi, he) -int wi, he; +ZmodemResize(int wi, int he) { flayer->l_width = wi; flayer->l_height = he; @@ -1009,8 +990,7 @@ int wi, he; } static void -ZmodemRedisplayLine(y, xs, xe, isblank) -int y, xs, xe, isblank; +ZmodemRedisplayLine(int y, int xs, int xe, int isblank) { DefRedisplayLine(y, xs, xe, isblank); if (y == 0 && xs == 0) @@ -1032,9 +1012,7 @@ ZmodemPage() static void -PadStr(str, n, x, y) -char *str; -int n, x, y; +PadStr(char *str, int n, int x, int y) { int l; diff --git a/src/input.c b/src/input.c index fe0c596..7a7084d 100644 --- a/src/input.c +++ b/src/input.c @@ -86,8 +86,7 @@ static struct LayFuncs InpLf = /* called once, after InitOverlayPage in Input() or Isearch() */ void -inp_setprompt(p, s) -char *p, *s; +inp_setprompt(char *p, char *s) { struct inpdata *inpdata; @@ -120,13 +119,7 @@ char *p, *s; * INP_EVERY == digraph mode. */ void -Input(istr, len, mode, finfunc, priv, data) -char *istr; -int len; -int mode; -void (*finfunc) (char *buf, int len, char *priv); -char *priv; -int data; +Input(char *istr, int len, int mode, void (*finfunc) (char *buf, int len, char *priv), char *priv, int data) { int maxlen; struct inpdata *inpdata; @@ -168,12 +161,7 @@ int data; } static void -erase_chars(inpdata, from, to, x, mv) -struct inpdata *inpdata; -char *from; -char *to; -int x; -int mv; +erase_chars(struct inpdata *inpdata, char *from, char *to, int x, int mv) { int chng; ASSERT(from < to); @@ -204,9 +192,7 @@ int mv; } static void -InpProcess(ppbuf, plen) -char **ppbuf; -int *plen; +InpProcess(char **ppbuf, int *plen) { int len, x; char *pbuf; @@ -477,8 +463,7 @@ InpAbort() } static void -InpRedisplayLine(y, xs, xe, isblank) -int y, xs, xe, isblank; +InpRedisplayLine(int y, int xs, int xe, int isblank) { int q, r, s, l, v; struct inpdata *inpdata; diff --git a/src/layer.c b/src/layer.c index b25e1bc..7c3b28b 100644 --- a/src/layer.c +++ b/src/layer.c @@ -56,9 +56,7 @@ static struct mline *mloff (struct mline *, int); */ static struct mline * -mloff(ml, off) -struct mline *ml; -int off; +mloff(struct mline *ml, int off) { static struct mline mml; @@ -95,9 +93,7 @@ int off; } void -LGotoPos(l, x, y) -struct layer *l; -int x, y; +LGotoPos(struct layer *l, int x, int y) { struct canvas *cv; struct viewport *vp; @@ -142,11 +138,7 @@ int x, y; } void -LScrollH(l, n, y, xs, xe, bce, ol) -struct layer *l; -int n, y, xs, xe; -int bce; -struct mline *ol; +LScrollH(struct layer *l, int n, int y, int xs, int xe, int bce, struct mline *ol) { struct canvas *cv; struct viewport *vp; @@ -197,11 +189,7 @@ struct mline *ol; } void -LScrollV(l, n, ys, ye, bce) -struct layer *l; -int n; -int ys, ye; -int bce; +LScrollV(struct layer *l, int n, int ys, int ye, int bce) { struct canvas *cv; struct viewport *vp; @@ -262,11 +250,7 @@ int bce; } void -LInsChar(l, c, x, y, ol) -struct layer *l; -struct mchar *c; -int x, y; -struct mline *ol; +LInsChar(struct layer *l, struct mchar *c, int x, int y, struct mline *ol) { struct canvas *cv; struct viewport *vp; @@ -319,10 +303,7 @@ struct mline *ol; } void -LPutChar(l, c, x, y) -struct layer *l; -struct mchar *c; -int x, y; +LPutChar(struct layer *l, struct mchar *c, int x, int y) { struct canvas *cv; struct viewport *vp; @@ -365,12 +346,7 @@ int x, y; } void -LPutStr(l, s, n, r, x, y) -struct layer *l; -char *s; -int n; -struct mchar *r; -int x, y; +LPutStr(struct layer *l, char *s, int n, struct mchar *r, int x, int y) { struct canvas *cv; struct viewport *vp; @@ -429,12 +405,7 @@ int x, y; } void -LPutWinMsg(l, s, n, r, x, y) -struct layer *l; -char *s; -int n; -struct mchar *r; -int x, y; +LPutWinMsg(struct layer *l, char *s, int n, struct mchar *r, int x, int y) { struct canvas *cv; struct viewport *vp; @@ -491,10 +462,7 @@ int x, y; } void -LClearLine(l, y, xs, xe, bce, ol) -struct layer *l; -int y, xs, xe, bce; -struct mline *ol; +LClearLine(struct layer *l, int y, int xs, int xe, int bce, struct mline *ol) { struct canvas *cv; struct viewport *vp; @@ -530,11 +498,7 @@ struct mline *ol; } void -LClearArea(l, xs, ys, xe, ye, bce, uself) -struct layer *l; -int xs, ys, xe, ye; -int bce; -int uself; +LClearArea(struct layer *l, int xs, int ys, int xe, int ye, int bce, int uself) { struct canvas *cv; struct viewport *vp; @@ -618,11 +582,7 @@ int uself; } void -LCDisplayLine(l, ml, y, xs, xe, isblank) -struct layer *l; -struct mline *ml; -int y, xs, xe; -int isblank; +LCDisplayLine(struct layer *l, struct mline *ml, int y, int xs, int xe, int isblank) { struct canvas *cv; struct viewport *vp; @@ -664,11 +624,7 @@ int isblank; } void -LCDisplayLineWrap(l, ml, y, from, to, isblank) -struct layer *l; -struct mline *ml; -int y, from, to; -int isblank; +LCDisplayLineWrap(struct layer *l, struct mline *ml, int y, int from, int to, int isblank) { struct mchar nc; copy_mline2mchar(&nc, ml, 0); @@ -686,9 +642,7 @@ int isblank; } void -LSetRendition(l, r) -struct layer *l; -struct mchar *r; +LSetRendition(struct layer *l, struct mchar *r) { struct canvas *cv; @@ -702,11 +656,7 @@ struct mchar *r; } void -LWrapChar(l, c, y, top, bot, ins) -struct layer *l; -struct mchar *c; -int y, top, bot; -int ins; +LWrapChar(struct layer *l, struct mchar *c, int y, int top, int bot, int ins) { struct canvas *cv, *cvlist, *cvlnext; struct viewport *vp, *evp, **vpp; @@ -829,9 +779,7 @@ int ins; void -LCursorVisibility(l, vis) -struct layer *l; -int vis; +LCursorVisibility(struct layer *l, int vis) { struct canvas *cv; for (cv = l->l_cvlist; cv; cv = cv->c_lnext) @@ -846,9 +794,7 @@ int vis; } void -LSetFlow(l, flow) -struct layer *l; -int flow; +LSetFlow(struct layer *l, int flow) { struct canvas *cv; for (cv = l->l_cvlist; cv; cv = cv->c_lnext) @@ -861,9 +807,7 @@ int flow; } void -LKeypadMode(l, on) -struct layer *l; -int on; +LKeypadMode(struct layer *l, int on) { struct canvas *cv; for (cv = l->l_cvlist; cv; cv = cv->c_lnext) @@ -878,9 +822,7 @@ int on; } void -LCursorkeysMode(l, on) -struct layer *l; -int on; +LCursorkeysMode(struct layer *l, int on) { struct canvas *cv; for (cv = l->l_cvlist; cv; cv = cv->c_lnext) @@ -895,9 +837,7 @@ int on; } void -LMouseMode(l, on) -struct layer *l; -int on; +LMouseMode(struct layer *l, int on) { struct canvas *cv; for (cv = l->l_cvlist; cv; cv = cv->c_lnext) @@ -912,17 +852,13 @@ int on; } void -LClearAll(l, uself) -struct layer *l; -int uself; +LClearAll(struct layer *l, int uself) { LClearArea(l, 0, 0, l->l_width - 1, l->l_height - 1, 0, uself); } void -LRefreshAll(l, isblank) -struct layer *l; -int isblank; +LRefreshAll(struct layer *l, int isblank) { struct layer *oldflayer; int y; @@ -980,8 +916,7 @@ LMsg(int err, const char *fmt, VA_DOTS) */ void -KillLayerChain(lay) -struct layer *lay; +KillLayerChain(struct layer *lay) { struct canvas *cv, *ncv; struct layer *l, *oldflayer; @@ -1011,10 +946,7 @@ struct layer *lay; int -InitOverlayPage(datasize, lf, block) -int datasize; -struct LayFuncs *lf; -int block; +InitOverlayPage(int datasize, struct LayFuncs *lf, int block) { char *data; struct layer *newlay; @@ -1199,9 +1131,7 @@ LayProcessMouseSwitch(struct layer *l, int s) } } -void LayPause(layer, pause) -struct layer *layer; -int pause; +void LayPause(struct layer *layer, int pause) { struct canvas *cv; struct display *olddisplay = display; @@ -1290,10 +1220,7 @@ int pause; } void -LayPauseUpdateRegion(layer, xs, xe, ys, ye) -struct layer *layer; -int xs, xe; -int ys, ye; +LayPauseUpdateRegion(struct layer *layer, int xs, int xe, int ys, int ye) { if (!layer->l_pause.d) return; @@ -1334,8 +1261,7 @@ int ys, ye; } void -LayerCleanupMemory(layer) -struct layer *layer; +LayerCleanupMemory(struct layer *layer) { if (layer->l_pause.left) free(layer->l_pause.left); diff --git a/src/layout.c b/src/layout.c index ec0c400..a05e77b 100644 --- a/src/layout.c +++ b/src/layout.c @@ -40,8 +40,7 @@ struct layout *layout_last, layout_last_marker; struct layout *layout_attach = &layout_last_marker; void -FreeLayoutCv(cv) -struct canvas *cv; +FreeLayoutCv(struct canvas *cv) { struct canvas *cnext, *c = cv; for (; cv; cv = cnext) @@ -60,9 +59,7 @@ struct canvas *cv; } struct layout * -CreateLayout(title, startat) -char *title; -int startat; +CreateLayout(char *title, int startat) { struct layout *lay, **pl; int i; @@ -96,9 +93,7 @@ int startat; } void -SaveLayout(name, cv) -char *name; -struct canvas *cv; +SaveLayout(char *name, struct canvas *cv) { struct layout *lay; struct canvas *fcv; @@ -119,8 +114,7 @@ struct canvas *cv; } void -AutosaveLayout(lay) -struct layout *lay; +AutosaveLayout(struct layout *lay) { struct canvas *fcv; if (!lay || !lay->lay_autosave) @@ -133,8 +127,7 @@ struct layout *lay; } struct layout * -FindLayout(name) -char *name; +FindLayout(char *name) { struct layout *lay; char *s; @@ -150,9 +143,7 @@ char *name; } void -LoadLayout(lay, cv) -struct layout *lay; -struct canvas *cv; +LoadLayout(struct layout *lay, struct canvas *cv) { AutosaveLayout(D_layout); if (!lay) @@ -182,9 +173,7 @@ struct canvas *cv; } void -NewLayout(title, startat) -char *title; -int startat; +NewLayout(char *title, int startat) { struct layout *lay; struct canvas *fcv; @@ -211,10 +200,7 @@ int startat; static char * -AddLayoutsInfo(buf, len, where) -char *buf; -int len; -int where; +AddLayoutsInfo(char *buf, int len, int where) { char *s, *ss, *t; struct layout *p, **pp; @@ -253,8 +239,7 @@ int where; } void -ShowLayouts(where) -int where; +ShowLayouts(int where) { char buf[1024]; char *s, *ss; @@ -286,8 +271,7 @@ int where; } void -RemoveLayout(lay) -struct layout *lay; +RemoveLayout(struct layout *lay) { struct layout **layp = &layouts; @@ -317,9 +301,7 @@ struct layout *lay; } void -UpdateLayoutCanvas(cv, wi) -struct canvas *cv; -struct win *wi; +UpdateLayoutCanvas(struct canvas *cv, struct win *wi) { for (; cv; cv = cv->c_slnext) { @@ -348,9 +330,7 @@ struct win *wi; static void -dump_canvas(cv, file) -struct canvas *cv; -FILE *file; +dump_canvas(struct canvas *cv, FILE *file) { struct canvas *c; for (c = cv->c_slperp; c && c->c_slnext; c = c->c_slnext) @@ -368,9 +348,7 @@ FILE *file; } int -LayoutDumpCanvas(cv, filename) -struct canvas *cv; -char *filename; +LayoutDumpCanvas(struct canvas *cv, char *filename) { FILE *file = secfopen(filename, "a"); if (!file) diff --git a/src/list_window.c b/src/list_window.c index 3e64714..005b77b 100644 --- a/src/list_window.c +++ b/src/list_window.c @@ -668,9 +668,7 @@ WListUpdate(struct win *p, struct ListData *ldata) } void -WListUpdatecv(cv, p) -struct canvas *cv; -struct win *p; +WListUpdatecv(struct canvas *cv, struct win *p) { struct ListData *ldata; struct gl_Window_Data *wdata; diff --git a/src/loadav.c b/src/loadav.c index 290c310..5948909 100644 --- a/src/loadav.c +++ b/src/loadav.c @@ -339,8 +339,7 @@ GetLoadav() #endif void -AddLoadav(p) -char *p; +AddLoadav(char *p) { int i, j; if (loadok == 0) diff --git a/src/logfile.c b/src/logfile.c index 82fa82e..3e31c72 100644 --- a/src/logfile.c +++ b/src/logfile.c @@ -43,8 +43,7 @@ static int stolen_logfile (struct logfile *); static struct logfile *logroot = NULL; static void -changed_logfile(l) -struct logfile *l; +changed_logfile(struct logfile *l) { struct stat o, *s = l->st; @@ -66,8 +65,7 @@ struct logfile *l; * need_fd is returned on success, else -1 is returned. */ int -lf_move_fd(fd, need_fd) -int need_fd, fd; +lf_move_fd(int fd, int need_fd) { int r = -1; @@ -80,10 +78,7 @@ int need_fd, fd; } static int -logfile_reopen(name, wantfd, l) -char *name; -int wantfd; -struct logfile *l; +logfile_reopen(char *name, int wantfd, struct logfile *l) { int got_fd; @@ -115,8 +110,7 @@ static int (* lf_reopen_fn)() = logfile_reopen; * d) return 0 on success. */ void -logreopen_register(fn) -int (*fn) (char *, int, struct logfile *); +logreopen_register(int (*fn) (char *, int, struct logfile *)) { lf_reopen_fn = fn ? fn : logfile_reopen; } @@ -128,8 +122,7 @@ int (*fn) (char *, int, struct logfile *); * on every call. */ static int -stolen_logfile(l) -struct logfile *l; +stolen_logfile(struct logfile *l) { struct stat o, *s = l->st; @@ -164,8 +157,7 @@ struct logfile *l; } static struct logfile * -lookup_logfile(name) -char *name; +lookup_logfile(char *name) { struct logfile *l; @@ -176,9 +168,7 @@ char *name; } struct logfile * -logfopen(name, fp) -char *name; -FILE *fp; +logfopen(char *name, FILE *fp) { struct logfile *l; @@ -216,8 +206,7 @@ FILE *fp; } int -islogfile(name) -char *name; +islogfile(char *name) { if (!name) return logroot ? 1 : 0; @@ -225,8 +214,7 @@ char *name; } int -logfclose(l) -struct logfile *l; +logfclose(struct logfile *l) { struct logfile **lp; @@ -255,10 +243,7 @@ struct logfile *l; * or changed, re-open it. */ int -logfwrite(l, buf, n) -struct logfile *l; -char *buf; -int n; +logfwrite(struct logfile *l, char *buf, int n) { int r; @@ -272,8 +257,7 @@ int n; } int -logfflush(l) -struct logfile *l; +logfflush(struct logfile *l) { int r = 0; diff --git a/src/mark.c b/src/mark.c index 433fb93..995e36d 100644 --- a/src/mark.c +++ b/src/mark.c @@ -94,8 +94,7 @@ static struct markdata *markdata; * 1 - letter * 2 - other */ -static int is_letter(c) -char c; +static int is_letter(int c) { if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || @@ -112,8 +111,7 @@ char c; } static int -linestart(y) -int y; +linestart(int y) { register int x; register unsigned char *i; @@ -127,8 +125,7 @@ int y; } static int -lineend(y) -int y; +lineend(int y) { register int x; register unsigned char *i; @@ -212,8 +209,7 @@ nextchar(int *xp, int *yp, int direction, char target, int num) static void -nextword(xp, yp, flags, num) -int *xp, *yp, flags, num; +nextword(int *xp, int *yp, int flags, int num) { int xx = fore->w_width, yy = fore->w_histheight + fore->w_height; register int sx, oq, q, x, y; @@ -274,9 +270,7 @@ int *xp, *yp, flags, num; */ static int -rem(x1, y1, x2, y2, redisplay, pt, yend) -int x1, y1, x2, y2, redisplay, yend; -char *pt; +rem(int x1, int y1, int x2, int y2, int redisplay, char *pt, int yend) { int i, j, from, to, ry, c; int l = 0; @@ -427,8 +421,7 @@ char *pt; */ static int -eq(a, b) -int a, b; +eq(int a, int b) { if (a == b) return 1; @@ -533,9 +526,7 @@ MarkRoutine() } static void -MarkProcess(inbufp,inlenp) -char **inbufp; -int *inlenp; +MarkProcess(char **inbufp, int *inlenp) { char *inbuf, *pt; int inlen; @@ -1101,15 +1092,13 @@ processchar: *inlenp = inlen; } -void revto(tx, ty) -int tx, ty; +void revto(int tx, int ty) { revto_line(tx, ty, -1); } /* tx, ty: WINDOW, line: DISPLAY */ -void revto_line(tx, ty, line) -int tx, ty, line; +void revto_line(int tx, int ty, int line) { int fx, fy; int x, y, t, revst, reven, qq, ff, tt, st, en, ce = 0; @@ -1294,10 +1283,8 @@ MarkAbort() static void -MarkRedisplayLine(y, xs, xe, isblank) -int y; /* NOTE: y is in DISPLAY coords system! */ -int xs, xe; -int isblank; +MarkRedisplayLine(int y, int xs, int xe, int isblank) +/* NOTE: y is in DISPLAY coords system! */ { int wy, x, i, rm; int sta, sto, cp; /* NOTE: these 3 are in WINDOW coords system */ @@ -1388,9 +1375,7 @@ int isblank; * This ugly routine is to speed up GotoPos() */ static int -MarkRewrite(ry, xs, xe, rend, doit) -int ry, xs, xe, doit; -struct mchar *rend; +MarkRewrite(int ry, int xs, int xe, struct mchar *rend, int doit) { int dx, x, y, st, en, t, rm; unsigned char *i; @@ -1465,8 +1450,7 @@ struct mchar *rend; /* * scroll the screen contents up/down. */ -static int MarkScrollUpDisplay(n) -int n; +static int MarkScrollUpDisplay(int n) { int i; @@ -1484,8 +1468,7 @@ int n; } static int -MarkScrollDownDisplay(n) -int n; +MarkScrollDownDisplay(int n) { int i; @@ -1503,11 +1486,7 @@ int n; } void -MakePaster(pa, buf, len, bufiscopy) -struct paster *pa; -char *buf; -int len; -int bufiscopy; +MakePaster(struct paster *pa, char *buf, int len, int bufiscopy) { FreePaster(pa); pa->pa_pasteptr = buf; @@ -1519,8 +1498,7 @@ int bufiscopy; } void -FreePaster(pa) -struct paster *pa; +FreePaster(struct paster *pa) { if (pa->pa_pastebuf) free(pa->pa_pastebuf); diff --git a/src/misc.c b/src/misc.c index dec1457..68d2202 100644 --- a/src/misc.c +++ b/src/misc.c @@ -51,8 +51,7 @@ static int close_func (void *, int); #endif char * -SaveStr(str) -register const char *str; +SaveStr(register const char *str) { register char *cp; @@ -64,9 +63,7 @@ register const char *str; } char * -SaveStrn(str, n) -register const char *str; -int n; +SaveStrn(register const char *str, int n) { register char *cp; @@ -82,9 +79,7 @@ int n; /* cheap strstr replacement */ char * -InStr(str, pat) -char *str; -const char *pat; +InStr(char *str, const char *pat) { int npat = strlen(pat); for (;*str; str++) @@ -95,8 +90,7 @@ const char *pat; #ifndef HAVE_STRERROR char * -strerror(err) -int err; +strerror(int err) { extern int sys_nerr; extern char *sys_errlist[]; @@ -110,9 +104,7 @@ int err; #endif void -centerline(str, y) -char *str; -int y; +centerline(char *str, int y) { int l, n; @@ -125,10 +117,7 @@ int y; } void -leftline(str, y, rend) -char *str; -int y; -struct mchar *rend; +leftline(char *str, int y, struct mchar *rend) { int l, n; struct mchar mchar_dol; @@ -147,8 +136,7 @@ struct mchar *rend; char * -Filename(s) -char *s; +Filename(char *s) { register char *p = s; @@ -160,8 +148,7 @@ char *s; } char * -stripdev(nam) -char *nam; +stripdev(char *nam) { #ifdef apollo char *p; @@ -246,8 +233,7 @@ void (*func) SIGPROTOARG; #ifdef HAVE_SETEUID void -xseteuid(euid) -int euid; +xseteuid(int euid) { if (seteuid(euid) == 0) return; @@ -257,8 +243,7 @@ int euid; } void -xsetegid(egid) -int egid; +xsetegid(int egid) { if (setegid(egid)) Panic(errno, "setegid"); @@ -268,8 +253,7 @@ int egid; # ifdef HAVE_SETREUID void -xseteuid(euid) -int euid; +xseteuid(int euid) { int oeuid; @@ -283,8 +267,7 @@ int euid; } void -xsetegid(egid) -int egid; +xsetegid(int egid) { int oegid; @@ -304,9 +287,7 @@ int egid; #ifdef NEED_OWN_BCOPY void -xbcopy(s1, s2, len) -register char *s1, *s2; -register int len; +xbcopy(register char *s1, register char *s2, register int len) { if (s1 < s2 && s2 < s1 + len) { @@ -322,17 +303,14 @@ register int len; #endif /* NEED_OWN_BCOPY */ void -bclear(p, n) -char *p; -int n; +bclear(char *p, int n) { bcopy((char *)blank, p, n); } void -Kill(pid, sig) -int pid, sig; +Kill(int pid, int sig) { if (pid < 2) return; @@ -346,9 +324,7 @@ int pid, sig; * the default file descriptor limit has risen to 65k. */ static int -close_func(cb_data, fd) -void *cb_data; -int fd; +close_func(void *cb_data, int fd) { int except = *(int *)cb_data; if (fd > 2 && fd != except) @@ -357,8 +333,7 @@ int fd; } void -closeallfiles(except) -int except; +closeallfiles(int except) { (void)fdwalk(close_func, &except); } @@ -366,8 +341,7 @@ int except; #else /* HAVE_FDWALK */ void -closeallfiles(except) -int except; +closeallfiles(int except) { int f; #ifdef SVR4 @@ -436,8 +410,7 @@ UserContext() } void -UserReturn(val) -int val; +UserReturn(int val) { #ifndef USE_SETEUID if (eff_uid == real_uid && eff_gid == real_gid) @@ -480,9 +453,7 @@ UserStatus() #ifndef HAVE_RENAME int -rename (old, new) -char *old; -char *new; +rename (char *old, char *new) { if (link(old, new) < 0) return -1; @@ -492,9 +463,7 @@ char *new; int -AddXChar(buf, ch) -char *buf; -int ch; +AddXChar(char *buf, int ch) { char *p = buf; @@ -516,9 +485,7 @@ int ch; } int -AddXChars(buf, len, str) -char *buf, *str; -int len; +AddXChars(char *buf, int len, char *str) { char *p; @@ -542,8 +509,7 @@ int len; #ifdef DEBUG void -opendebug(new, shout) -int new, shout; +opendebug(int new, int shout) { char buf[256]; @@ -568,9 +534,7 @@ int new, shout; #endif /* DEBUG */ void -sleep1000(msec) -int msec; - +sleep1000(int msec) { struct timeval t; @@ -585,9 +549,7 @@ int msec; * to free the buffer after putenv(), unless it it the one found in putenv.c */ void -xsetenv(var, value) -char *var; -char *value; +xsetenv(char *var, char *value) { #ifndef USESETENV char *buf; @@ -633,9 +595,7 @@ char *value; * emulation of libcurses, which ignores ospeed. */ int -_delay(delay, outc) -register int delay; -int (*outc) (int); +_delay(register int delay, int (*outc) (int)) { int pad; extern short ospeed; diff --git a/src/nethack.c b/src/nethack.c index d8ae456..74d9194 100644 --- a/src/nethack.c +++ b/src/nethack.c @@ -121,8 +121,7 @@ static struct nlstrans nethacktrans[] = { #endif const char * -DoNLS(from) -const char *from; +DoNLS(const char *from) { #ifdef NETHACK struct nlstrans *t; diff --git a/src/process.c b/src/process.c index ade54f0..770a4c4 100644 --- a/src/process.c +++ b/src/process.c @@ -1591,10 +1591,7 @@ static char *resizeprompts[] = { }; static int -parse_input_int(buf, len, val) -const char *buf; -int len; -int *val; +parse_input_int(const char *buf, int len, int *val) { int x = 0, i; if (len >= 1 && ((*buf == 'U' && buf[1] == '+') || (*buf == '0' && (buf[1] == 'x' || buf[1] == 'X')))) @@ -1825,9 +1822,7 @@ InitKeytab() } static struct action * -FindKtab(class, create) -char *class; -int create; +FindKtab(char *class, int create) { struct kclass *kp, **kpp; int i; @@ -1867,8 +1862,7 @@ int create; } static void -ClearAction(act) -struct action *act; +ClearAction(struct action *act) { char **p; @@ -1897,9 +1891,7 @@ struct action *act; */ void -ProcessInput(ibuf, ilen) -char *ibuf; -int ilen; +ProcessInput(char *ibuf, int ilen) { int ch, slen; unsigned char *s, *q; @@ -2038,9 +2030,7 @@ int ilen; */ void -ProcessInput2(ibuf, ilen) -char *ibuf; -int ilen; +ProcessInput2(char *ibuf, int ilen) { char *s; int ch, slen; @@ -2100,11 +2090,7 @@ int ilen; } void -DoProcess(p, bufp, lenp, pa) -struct win *p; -char **bufp; -int *lenp; -struct paster *pa; +DoProcess(struct win *p, char **bufp, int *lenp, struct paster *pa) { int oldlen; struct display *d = display; @@ -2161,8 +2147,7 @@ struct paster *pa; } int -FindCommnr(str) -const char *str; +FindCommnr(const char *str) { int x, m, l = 0, r = RC_LAST; while (l <= r) @@ -2180,9 +2165,7 @@ const char *str; } static int -CheckArgNum(nr, args) -int nr; -char **args; +CheckArgNum(int nr, char **args) { int i, n; static char *argss[] = {"no", "one", "two", "three", "four", "OOPS"}; @@ -2283,10 +2266,7 @@ char **args; } static void -StuffFin(buf, len, data) -char *buf; -int len; -char *data; +StuffFin(char *buf, int len, char *data) { if (!flayer) return; @@ -2306,9 +2286,7 @@ char *data; /*ARGSUSED*/ void -DoAction(act, key) -struct action *act; -int key; +DoAction(struct action *act, int key) { int nr = act->nr; char **args = act->args; @@ -5721,9 +5699,7 @@ CollapseWindowlist() } void -DoCommand(argv, argl) -char **argv; -int *argl; +DoCommand(char **argv, int *argl) { struct action act; const char *cmd = *argv; @@ -5754,11 +5730,7 @@ int *argl; } static void -SaveAction(act, nr, args, argl) -struct action *act; -int nr; -char **args; -int *argl; +SaveAction(struct action *act, int nr, char **args, int *argl) { register int argc = 0; char **pp; @@ -5790,8 +5762,7 @@ int *argl; } static char ** -SaveArgs(args) -char **args; +SaveArgs(char **args) { register char **ap, **pp; register int argc = 0; @@ -5817,9 +5788,7 @@ char **args; * argc is returned. */ int -Parse(buf, bufl, args, argl) -char *buf, **args; -int bufl, *argl; +Parse(char *buf, int bufl, char **args, int *argl) { register char *p = buf, **ap = args, *pp; register int delim, argc; @@ -6010,9 +5979,7 @@ int bufl, *argl; } void -SetEscape(u, e, me) -struct acluser *u; -int e, me; +SetEscape(struct acluser *u, int e, int me) { if (u) { @@ -6047,9 +6014,7 @@ int e, me; } int -ParseSwitch(act, var) -struct action *act; -int *var; +ParseSwitch(struct action *act, int *var) { if (*act->args == 0) { @@ -6060,9 +6025,7 @@ int *var; } static int -ParseOnOff(act, var) -struct action *act; -int *var; +ParseOnOff(struct action *act, int *var) { register int num = -1; char **args = act->args; @@ -6084,9 +6047,7 @@ int *var; } int -ParseSaveStr(act, var) -struct action *act; -char **var; +ParseSaveStr(struct action *act, char **var) { char **args = act->args; if (*args == 0 || args[1]) @@ -6101,9 +6062,7 @@ char **var; } int -ParseNum(act, var) -struct action *act; -int *var; +ParseNum(struct action *act, int *var) { int i; char *p, **args = act->args; @@ -6134,9 +6093,7 @@ int *var; } static int -ParseNum1000(act, var) -struct action *act; -int *var; +ParseNum1000(struct action *act, int *var) { int i; char *p, **args = act->args; @@ -6184,8 +6141,7 @@ int *var; } static struct win * -WindowByName(s) -char *s; +WindowByName(char *s) { struct win *p; @@ -6199,8 +6155,7 @@ char *s; } static int -WindowByNumber(str) -char *str; +WindowByNumber(char *str) { int i; char *s; @@ -6220,8 +6175,7 @@ char *str; * Be careful when assigning numeric strings as WindowTitles. */ int -WindowByNoN(str) -char *str; +WindowByNoN(char *str) { int i; struct win *p; @@ -6236,9 +6190,7 @@ char *str; } static int -ParseWinNum(act, var) -struct action *act; -int *var; +ParseWinNum(struct action *act, int *var) { char **args = act->args; int i = 0; @@ -6262,12 +6214,7 @@ int *var; } static int -ParseBase(act, p, var, base, bname) -struct action *act; -char *p; -int *var; -int base; -char *bname; +ParseBase(struct action *act, char *p, int *var, int base, char *bname) { int i = 0; int c; @@ -6297,9 +6244,7 @@ char *bname; } static int -IsNum(s, base) -register char *s; -register int base; +IsNum(register char *s, register int base) { for (base += '0'; *s; ++s) if (*s < '0' || *s > base) @@ -6308,9 +6253,7 @@ register int base; } int -IsNumColon(s, base, p, psize) -int base, psize; -char *s, *p; +IsNumColon(char *s, int base, char *p, int psize) { char *q; if ((q = rindex(s, ':')) != 0) @@ -6325,8 +6268,7 @@ char *s, *p; } void -SwitchWindow(n) -int n; +SwitchWindow(int n) { struct win *p; @@ -6367,8 +6309,7 @@ int n; * Puts window wi in canvas display->d_forecv. */ void -SetForeWindow(wi) -struct win *wi; +SetForeWindow(struct win *wi) { struct win *p; if (display == 0) @@ -6394,8 +6335,7 @@ struct win *wi; * norefresh = -1 forces a refresh, disregard all_norefresh then. */ void -Activate(norefresh) -int norefresh; +Activate(int norefresh) { debug1("Activate(%d)\n", norefresh); if (display == 0) @@ -6491,8 +6431,7 @@ MoreWindows() } void -KillWindow(wi) -struct win *wi; +KillWindow(struct win *wi) { struct win **pp, *p; struct canvas *cv; @@ -6554,8 +6493,7 @@ struct win *wi; } static void -LogToggle(on) -int on; +LogToggle(int on) { char buf[1024]; @@ -6586,11 +6524,7 @@ int on; } char * -AddWindows(buf, len, flags, where) -char *buf; -int len; -int flags; -int where; +AddWindows(char *buf, int len, int flags, int where) { register char *s, *ss; register struct win **pp, *p; @@ -6664,10 +6598,7 @@ int where; } char * -AddWindowFlags(buf, len, p) -char *buf; -int len; -struct win *p; +AddWindowFlags(char *buf, int len, struct win *p) { char *s = buf; if (p == 0 || len < 12) @@ -6707,10 +6638,7 @@ struct win *p; } char * -AddOtherUsers(buf, len, p) -char *buf; -int len; -struct win *p; +AddOtherUsers(char *buf, int len, struct win *p) { struct display *d, *olddisplay = display; struct canvas *cv; @@ -6750,8 +6678,7 @@ struct win *p; } void -ShowWindows(where) -int where; +ShowWindows(int where) { char buf[1024]; char *s, *ss; @@ -6929,10 +6856,7 @@ ShowDInfo() } static void -AKAfin(buf, len, data) -char *buf; -int len; -char *data; /* dummy */ +AKAfin(char *buf, int len, char *data) { ASSERT(display); if (len && fore) @@ -6966,10 +6890,7 @@ InputAKA() } static void -Colonfin(buf, len, data) -char *buf; -int len; -char *data; /* dummy */ +Colonfin(char *buf, int len, char *data) { char mbuf[256]; @@ -7039,10 +6960,7 @@ char *data; /* dummy */ } static void -SelectFin(buf, len, data) -char *buf; -int len; -char *data; /* dummy */ +SelectFin(char *buf, int len, char *data) { int n; @@ -7060,10 +6978,7 @@ char *data; /* dummy */ } static void -SelectLayoutFin(buf, len, data) -char *buf; -int len; -char *data; /* dummy */ +SelectLayoutFin(char *buf, int len, char *data) { struct layout *lay; @@ -7098,10 +7013,7 @@ static char setenv_var[31]; static void -SetenvFin1(buf, len, data) -char *buf; -int len; -char *data; /* dummy */ +SetenvFin1(char *buf, int len, char *data) { if (!len || !display) return; @@ -7109,10 +7021,7 @@ char *data; /* dummy */ } static void -SetenvFin2(buf, len, data) -char *buf; -int len; -char *data; /* dummy */ +SetenvFin2(char *buf, int len, char *data) { if (!len || !display) return; @@ -7122,8 +7031,7 @@ char *data; /* dummy */ } static void -InputSetenv(arg) -char *arg; +InputSetenv(char *arg) { static char setenv_buf[50 + sizeof(setenv_var)]; /* need to be static here, cannot be freed */ @@ -7145,8 +7053,7 @@ char *arg; * -a, -M, -L */ void -DoScreen(fn, av) -char *fn, **av; +DoScreen(char *fn, char **av) { struct NewWindow nwin; register int num; @@ -7275,10 +7182,7 @@ char *fn, **av; * l (left), r (right). placing a mark will now be done with ".". */ int -CompileKeys(s, sl, array) -char *s; -int sl; -unsigned char *array; +CompileKeys(char *s, int sl, unsigned char *array) { int i; unsigned char key, value; @@ -7320,10 +7224,7 @@ unsigned char *array; #if defined(DETACH) && defined(POW_DETACH) static void -pow_detach_fn(buf, len, data) -char *buf; -int len; -char *data; /* dummy */ +pow_detach_fn(char *buf, int len, char *data) { debug("pow_detach_fn called\n"); if (len) @@ -7344,10 +7245,7 @@ char *data; /* dummy */ #ifdef COPY_PASTE static void -copy_reg_fn(buf, len, data) -char *buf; -int len; -char *data; /* dummy */ +copy_reg_fn(char *buf, int len, char *data) { struct plop *pp = plop_tab + (int)(unsigned char)*buf; @@ -7377,10 +7275,7 @@ char *data; /* dummy */ } static void -ins_reg_fn(buf, len, data) -char *buf; -int len; -char *data; /* dummy */ +ins_reg_fn(char *buf, int len, char *data) { struct plop *pp = plop_tab + (int)(unsigned char)*buf; @@ -7403,10 +7298,7 @@ char *data; /* dummy */ #endif /* COPY_PASTE */ static void -process_fn(buf, len, data) -char *buf; -int len; -char *data; /* dummy */ +process_fn(char *buf, int len, char *data) { struct plop *pp = plop_tab + (int)(unsigned char)*buf; @@ -7424,10 +7316,7 @@ char *data; /* dummy */ } static void -confirm_fn(buf, len, data) -char *buf; -int len; -char *data; +confirm_fn(char *buf, int len, char *data) { struct action act; @@ -7453,10 +7342,7 @@ struct inputsu }; static void -su_fin(buf, len, data) -char *buf; -int len; -char *data; +su_fin(char *buf, int len, char *data) { struct inputsu *i = (struct inputsu *)data; char *p; @@ -7485,10 +7371,7 @@ char *data; } static int -InputSu(w, up, name) -struct win *w; -struct acluser **up; -char *name; +InputSu(struct win *w, struct acluser **up, char *name) { struct inputsu *i; @@ -7507,10 +7390,7 @@ char *name; #ifdef PASSWORD static void -pass1(buf, len, data) -char *buf; -int len; -char *data; +pass1(char *buf, int len, char *data) { struct acluser *u = (struct acluser *)data; @@ -7525,10 +7405,7 @@ char *data; } static void -pass2(buf, len, data) -char *buf; -int len; -char *data; +pass2(char *buf, int len, char *data) { int st; char salt[3]; @@ -7590,8 +7467,7 @@ char *data; #endif /* PASSWORD */ static int -digraph_find(buf) -const char *buf; +digraph_find(const char *buf) { int i; for (i = 0; i < sizeof(digraphs) && digraphs[i].d[0]; i++) @@ -7601,10 +7477,7 @@ const char *buf; } static void -digraph_fn(buf, len, data) -char *buf; -int len; -char *data; /* dummy */ +digraph_fn(char *buf, int len, char *data) { int ch, i, x; @@ -7672,8 +7545,7 @@ char *data; /* dummy */ #ifdef MAPKEYS int -StuffKey(i) -int i; +StuffKey(int i) { struct action *act; int discard = 0; @@ -7738,8 +7610,7 @@ int i; static int -IsOnDisplay(wi) -struct win *wi; +IsOnDisplay(struct win *wi) { struct canvas *cv; ASSERT(display); @@ -7750,9 +7621,7 @@ struct win *wi; } struct win * -FindNiceWindow(wi, presel) -struct win *wi; -char *presel; +FindNiceWindow(struct win *wi, char *presel) { int i; @@ -7869,9 +7738,7 @@ char *str; #endif static int -CalcSlicePercent(cv, percent) -struct canvas *cv; -int percent; +CalcSlicePercent(struct canvas *cv, int percent) { int w, wsum, up; if (!cv || !cv->c_slback) @@ -7886,12 +7753,12 @@ int percent; } static int -ChangeCanvasSize(fcv, abs, diff, gflag, percent) -struct canvas *fcv; /* make this canvas bigger */ -int abs; /* mode: 0:rel 1:abs 2:max */ -int diff; /* change this much */ -int gflag; /* go up if neccessary */ -int percent; +ChangeCanvasSize(struct canvas *fcv, int abs, int diff, int gflag, int percent) +//struct canvas *fcv; /* make this canvas bigger */ +//int abs; /* mode: 0:rel 1:abs 2:max */ +//int diff; /* change this much */ +//int gflag; /* go up if neccessary */ +//int percent; { struct canvas *cv; int done, have, m, dir; @@ -8017,9 +7884,7 @@ int percent; } static void -ResizeRegions(arg, flags) -char *arg; -int flags; +ResizeRegions(char *arg, int flags) { struct canvas *cv; int diff, l; @@ -8168,10 +8033,7 @@ int flags; } static void -ResizeFin(buf, len, data) -char *buf; -int len; -char *data; +ResizeFin(char *buf, int len, char *data) { int ch; int flags = *(int *)data; @@ -8199,9 +8061,7 @@ char *data; } void -SetForeCanvas(d, cv) -struct display *d; -struct canvas *cv; +SetForeCanvas(struct display *d, struct canvas *cv) { struct display *odisplay = display; if (d->d_forecv == cv) @@ -8255,9 +8115,7 @@ RefreshXtermOSC() #endif int -ParseAttrColor(s1, s2, msgok) -char *s1, *s2; -int msgok; +ParseAttrColor(char *s1, char *s2, int msgok) { int i, n; char *s, *ss; @@ -8437,9 +8295,7 @@ int msgok; * Intensity is encoded into bits 17(fg) and 18(bg). */ void -ApplyAttrColor(i, mc) -int i; -struct mchar *mc; +ApplyAttrColor(int i, struct mchar *mc) { debug1("ApplyAttrColor %06x\n", i); mc->attr |= i >> 8 & 255; diff --git a/src/pty.c b/src/pty.c index 03d7a9a..a826051 100644 --- a/src/pty.c +++ b/src/pty.c @@ -115,8 +115,7 @@ int pty_preopen = 0; /***************************************************************/ static void -initmaster(f) -int f; +initmaster(int f) { #ifdef POSIX tcflush(f, TCIOFLUSH); @@ -131,8 +130,7 @@ int f; } void -InitPTY(f) -int f; +InitPTY(int f) { if (f < 0) return; @@ -153,8 +151,7 @@ int f; #if defined(OSX) && !defined(PTY_DONE) #define PTY_DONE int -OpenPTY(ttyn) -char **ttyn; +OpenPTY(char **ttyn) { register int f; if ((f = open_controlling_pty(TtyName)) < 0) @@ -170,8 +167,7 @@ char **ttyn; #if (defined(sequent) || defined(_SEQUENT_)) && !defined(PTY_DONE) #define PTY_DONE int -OpenPTY(ttyn) -char **ttyn; +OpenPTY(char **ttyn) { char *m, *s; register int f; @@ -194,8 +190,7 @@ char **ttyn; #if defined(__sgi) && !defined(PTY_DONE) #define PTY_DONE int -OpenPTY(ttyn) -char **ttyn; +OpenPTY(char **ttyn) { int f; char *name, *_getpty(); @@ -222,8 +217,7 @@ char **ttyn; #if defined(MIPS) && defined(HAVE_DEV_PTC) && !defined(PTY_DONE) #define PTY_DONE int -OpenPTY(ttyn) -char **ttyn; +OpenPTY(char **ttyn) { register int f; struct stat buf; @@ -248,8 +242,7 @@ char **ttyn; #if defined(HAVE_SVR4_PTYS) && !defined(PTY_DONE) #define PTY_DONE int -OpenPTY(ttyn) -char **ttyn; +OpenPTY(char **ttyn) { register int f; char *m, *ptsname(); @@ -292,8 +285,7 @@ char **ttyn; #define PTY_DONE int -OpenPTY(ttyn) -char **ttyn; +OpenPTY(char **ttyn) { register int f; @@ -321,8 +313,7 @@ char **ttyn; #if defined(HAVE_OPENPTY) && !defined(PTY_DONE) #define PTY_DONE int -OpenPTY(ttyn) -char **ttyn; +OpenPTY(char **ttyn) { int f, s; if (openpty(&f, &s, TtyName, NULL, NULL) != 0) @@ -339,8 +330,7 @@ char **ttyn; #ifndef PTY_DONE int -OpenPTY(ttyn) -char **ttyn; +OpenPTY(char **ttyn) { register char *p, *q, *l, *d; register int f; diff --git a/src/putenv.c b/src/putenv.c index 6400dad..6b5c461 100644 --- a/src/putenv.c +++ b/src/putenv.c @@ -79,8 +79,7 @@ static int newenv (void) /* copy env. from stack to heap */ static int moreenv (void) /* incr. size of env. */ int -unsetenv(name) -char *name; +unsetenv(char *name) { register int i; @@ -102,8 +101,7 @@ char *name; } int -putenv(string) -char *string; +putenv(char *string) { register int i; register char *p; @@ -142,8 +140,7 @@ char *string; } static int -findenv(name) -char *name; +findenv(char *name) { register char *namechar, *envchar; register int i, found; diff --git a/src/resize.c b/src/resize.c index 7eb1e26..74c5395 100644 --- a/src/resize.c +++ b/src/resize.c @@ -86,8 +86,7 @@ static struct mline mline_zero = { */ void -CheckScreenSize(change_flag) -int change_flag; +CheckScreenSize(int change_flag) { int wi, he; @@ -146,9 +145,7 @@ int change_flag; } void -ChangeScreenSize(wi, he, change_fore) -int wi, he; -int change_fore; +ChangeScreenSize(int wi, int he, int change_fore) { struct win *p; struct canvas *cv; @@ -293,8 +290,7 @@ ResizeLayersToCanvases() } int -MayResizeLayer(l) -struct layer *l; +MayResizeLayer(struct layer *l) { int cvs = 0; debug("MayResizeLayer:\n"); @@ -353,10 +349,7 @@ kaablamm() } while (0) void -ResizeLayer(l, wi, he, norefdisp) -struct layer *l; -int wi, he; -struct display *norefdisp; +ResizeLayer(struct layer *l, int wi, int he, struct display *norefdisp) { struct win *p; struct canvas *cv; @@ -419,8 +412,7 @@ struct display *norefdisp; } static void -FreeMline(ml) -struct mline *ml; +FreeMline(struct mline *ml) { if (ml->image) free(ml->image); @@ -444,9 +436,7 @@ struct mline *ml; } static int -AllocMline(ml, w) -struct mline *ml; -int w; +AllocMline(struct mline *ml, int w) { ml->image = malloc(w); ml->attr = null; @@ -467,9 +457,7 @@ int w; static int -BcopyMline(mlf, xf, mlt, xt, l, w) -struct mline *mlf, *mlt; -int xf, xt, l, w; +BcopyMline(struct mline *mlf, int xf, struct mline *mlt, int xt, int l, int w) { int r = 0; @@ -522,8 +510,7 @@ int xf, xt, l, w; static int maxwidth; static void -CheckMaxSize(wi) -int wi; +CheckMaxSize(int wi) { unsigned char *oldnull = null; unsigned char *oldblank = blank; @@ -609,9 +596,7 @@ int wi; char * -xrealloc(mem, len) -char *mem; -int len; +xrealloc(char *mem, int len) { register char *nmem; @@ -624,9 +609,7 @@ int len; } static void -MakeBlankLine(p, n) -register unsigned char *p; -register int n; +MakeBlankLine(register unsigned char *p, register int n) { while (n--) *p++ = ' '; @@ -652,9 +635,7 @@ register int n; int -ChangeWindowSize(p, wi, he, hi) -struct win *p; -int wi, he, hi; +ChangeWindowSize(struct win *p, int wi, int he, int hi) { struct mline *mlf = 0, *mlt = 0, *ml, *nmlines, *nhlines; int fy, ty, l, lx, lf, lt, yy, oty, addone; @@ -1047,8 +1028,7 @@ int wi, he, hi; } void -FreeAltScreen(p) -struct win *p; +FreeAltScreen(struct win *p) { int i; @@ -1075,8 +1055,7 @@ struct win *p; } static void -SwapAltScreen(p) -struct win *p; +SwapAltScreen(struct win *p) { struct mline *ml; int t; @@ -1096,8 +1075,7 @@ struct win *p; } void -EnterAltScreen(p) -struct win *p; +EnterAltScreen(struct win *p) { if (!p->w_alt.on) { @@ -1118,8 +1096,7 @@ struct win *p; } void -LeaveAltScreen(p) -struct win *p; +LeaveAltScreen(struct win *p) { if (!p->w_alt.on) return; diff --git a/src/sched.c b/src/sched.c index 8ae53ad..d9b5841 100644 --- a/src/sched.c +++ b/src/sched.c @@ -47,8 +47,7 @@ static int sgihack (void); #endif void -evenq(ev) -struct event *ev; +evenq(struct event *ev) { struct event *evp, **evpp; debug3("New event fd %d type %d queued %d\n", ev->fd, ev->type, ev->queued); @@ -69,8 +68,7 @@ struct event *ev; } void -evdeq(ev) -struct event *ev; +evdeq(struct event *ev) { struct event *evp, **evpp; debug3("Deq event fd %d type %d queued %d\n", ev->fd, ev->type, ev->queued); @@ -240,9 +238,7 @@ sched() } void -SetTimeout(ev, timo) -struct event *ev; -int timo; +SetTimeout(struct event *ev, int timo) { ASSERT(ev->type == EV_TIMEOUT); debug2("event %x new timeout %d ms\n", ev, timo); diff --git a/src/screen.c b/src/screen.c index 9c5c0a8..2039f7a 100644 --- a/src/screen.c +++ b/src/screen.c @@ -263,10 +263,7 @@ static int InterruptPlease; static int GotSigChld; static int -lf_secreopen(name, wantfd, l) -char *name; -int wantfd; -struct logfile *l; +lf_secreopen(char *name, int wantfd, struct logfile *l) { int got_fd; @@ -289,9 +286,7 @@ struct logfile *l; static struct passwd * -getpwbyname(name, ppp) -char *name; -struct passwd *ppp; +getpwbyname(char *name, struct passwd *ppp) { int n; #ifdef SHADOWPW @@ -363,9 +358,7 @@ locale_name(void) } int -main(ac, av) -int ac; -char **av; +main(int ac, char **av) { register int n; char *ap; @@ -1477,15 +1470,13 @@ char **av; return 0; } -void -WindowDied(p, wstat, wstat_valid) -struct win *p; #ifdef BSDWAIT - union wait wstat; +void +WindowDied(struct win *p, union wait wstat, int wstat_valid) #else - int wstat; +void +WindowDied(struct win *p, int wstat, int wstat_valid) #endif -int wstat_valid; { int killit = 0; @@ -1808,8 +1799,7 @@ FinitHandler SIGDEFARG } void -Finit(i) -int i; +Finit(int i) { signal(SIGCHLD, SIG_DFL); signal(SIGHUP, SIG_IGN); @@ -1856,8 +1846,7 @@ int i; } void -eexit(e) -int e; +eexit(int e) { debug("eexit\n"); if (ServerSocket != -1) @@ -1901,8 +1890,7 @@ Hangup() * Note: Take extra care here, we may be called by interrupt! */ void -Detach(mode) -int mode; +Detach(int mode) { int sign = 0, pid; struct canvas *cv; @@ -2042,8 +2030,7 @@ int mode; } static int -IsSymbol(e, s) -char *e, *s; +IsSymbol(char *e, char *s) { register int l; @@ -2234,11 +2221,7 @@ static int winmsg_rendpos[MAX_WINMSG_REND]; static int winmsg_numrend; static char * -pad_expand(buf, p, numpad, padlen) -char *buf; -char *p; -int numpad; -int padlen; +pad_expand(char *buf, char *p, int numpad, int padlen) { char *pn, *pn2; int i, r; @@ -2287,8 +2270,7 @@ struct backtick { struct backtick *backticks; static void -backtick_filter(bt) -struct backtick *bt; +backtick_filter(struct backtick *bt) { char *p, *q; int c; @@ -2304,9 +2286,7 @@ struct backtick *bt; } static void -backtick_fn(ev, data) -struct event *ev; -char *data; +backtick_fn(struct event *ev, char *data) { struct backtick *bt; int i, j, k, l; @@ -2354,11 +2334,7 @@ char *data; } void -setbacktick(num, lifespan, tick, cmdv) -int num; -int lifespan; -int tick; -char **cmdv; +setbacktick(int num, int lifespan, int tick, char **cmdv) { struct backtick **btp, *bt; char **v; @@ -2427,10 +2403,7 @@ char **cmdv; } static char * -runbacktick(bt, tickp, now) -struct backtick *bt; -int *tickp; -time_t now; +runbacktick(struct backtick *bt, int *tickp, time_t now) { int f, i, l, j; time_t now2; @@ -2478,9 +2451,7 @@ time_t now; } int -AddWinMsgRend(str, r) -const char *str; -int r; +AddWinMsgRend(const char *str, int r) { if (winmsg_numrend >= MAX_WINMSG_REND || str < winmsg_buf || str >= winmsg_buf + MAXSTR) @@ -2494,13 +2465,7 @@ int r; } char * -MakeWinMsgEv(str, win, esc, padlen, ev, rec) -char *str; -struct win *win; -int esc; -int padlen; -struct event *ev; -int rec; +MakeWinMsgEv(char *str, struct win *win, int esc, int padlen, struct event *ev, int rec) { static int tick; char *s = str; @@ -3034,18 +2999,13 @@ int rec; } char * -MakeWinMsg(s, win, esc) -char *s; -struct win *win; -int esc; +MakeWinMsg(char *s, struct win *win, int esc) { return MakeWinMsgEv(s, win, esc, 0, (struct event *)0, 0); } void -PutWinMsg(s, start, max) -char *s; -int start, max; +PutWinMsg(char *s, int start, int max) { int i, p, l, r, n; struct mchar rend; @@ -3119,8 +3079,7 @@ int start, max; #ifdef DEBUG static void -fds1(i, j) -int i, j; +fds1(int i, int j) { while (i < j) { @@ -3149,18 +3108,14 @@ fds() #endif static void -serv_read_fn(ev, data) -struct event *ev; -char *data; +serv_read_fn(struct event *ev, char *data) { debug("Knock - knock!\n"); ReceiveMsg(); } static void -serv_select_fn(ev, data) -struct event *ev; -char *data; +serv_select_fn(struct event *ev, char *data) { struct win *p; @@ -3363,9 +3318,7 @@ char *data; } static void -logflush_fn(ev, data) -struct event *ev; -char *data; +logflush_fn(struct event *ev, char *data) { struct win *p; char *buf; @@ -3405,8 +3358,7 @@ char *data; * returned. */ static char * -ParseChar(p, cp) -char *p, *cp; +ParseChar(char *p, char *cp) { if (*p == 0) return 0; @@ -3433,8 +3385,7 @@ char *p, *cp; } static int -ParseEscape(p) -char *p; +ParseEscape(char *p) { unsigned char buf[2]; diff --git a/src/search.c b/src/search.c index c69460a..3e604c5 100644 --- a/src/search.c +++ b/src/search.c @@ -51,8 +51,7 @@ static void searchend (char *, int); static void backsearchend (char *, int); void -Search(dir) -int dir; +Search(int dir) { struct markdata *markdata; if (dir == 0) @@ -71,9 +70,7 @@ int dir; } static void -searchend(buf, len) -char *buf; -int len; +searchend(char *buf, int len) { int x = 0, sx, ex, y; struct markdata *markdata; @@ -101,9 +98,7 @@ int len; } static void -backsearchend(buf, len) -char *buf; -int len; +backsearchend(char *buf, int len) { int sx, ex, x = -1, y; struct markdata *markdata; @@ -131,9 +126,7 @@ int len; } static int -matchword(pattern, y, sx, ex) -char *pattern; -int y, sx, ex; +matchword(char *pattern, int y, int sx, int ex) { unsigned char *ip, *ipe, *cp, *pp; struct mline *ml; @@ -181,9 +174,7 @@ static int is_bm (char *, int, int, int, int); static int -is_bm(str, l, p, end, dir) -char *str; -int l, p, end, dir; +is_bm(char *str, int l, int p, int end, int dir) { int tab[256]; int i, q; @@ -236,10 +227,7 @@ int l, p, end, dir; /*ARGSUSED*/ static void -is_process(p, n, data) /* i-search */ -char *p; -int n; -char *data; /* dummy */ +is_process(char *p, int n, char *data) /* i-search */ { int pos, x, y, dir; struct markdata *markdata; @@ -324,8 +312,7 @@ char *data; /* dummy */ } static int -is_redo(markdata) -struct markdata *markdata; +is_redo(struct markdata *markdata) { int i, pos, npos, dir; char c; @@ -355,8 +342,7 @@ struct markdata *markdata; } void -ISearch(dir) -int dir; +ISearch(int dir) { struct markdata *markdata; diff --git a/src/socket.c b/src/socket.c index e9f40dc..38d9393 100644 --- a/src/socket.c +++ b/src/socket.c @@ -113,10 +113,7 @@ extern struct comm comms[]; */ int -FindSocket(fdp, nfoundp, notherp, match) -int *fdp; -int *nfoundp, *notherp; -char *match; +FindSocket(int *fdp, int *nfoundp, int *notherp, char *match) { DIR *dirp; struct dirent *dp; @@ -491,8 +488,7 @@ MakeServerSocket() int -MakeClientSocket(err) -int err; +MakeClientSocket(int err) { register int s = 0; @@ -585,8 +581,7 @@ MakeServerSocket() } int -MakeClientSocket(err) -int err; +MakeClientSocket(int err) { register int s; struct sockaddr_un a; @@ -633,9 +628,7 @@ int err; */ void -SendCreateMsg(sty, nwin) -char *sty; -struct NewWindow *nwin; +SendCreateMsg(char *sty, struct NewWindow *nwin) { int s; struct msg m; @@ -693,8 +686,7 @@ struct NewWindow *nwin; } int -SendErrorMsg(tty, buf) -char *tty, *buf; +SendErrorMsg(char *tty, char *buf) { int s; struct msg m; @@ -715,8 +707,7 @@ char *tty, *buf; } static void -ExecCreate(mp) -struct msg *mp; +ExecCreate(struct msg *mp) { struct NewWindow nwin; char *args[MAXARGS]; @@ -768,8 +759,7 @@ struct msg *mp; } static int -CheckPid(pid) -int pid; +CheckPid(int pid) { debug1("Checking pid %d\n", pid); if (pid < 2) @@ -796,8 +786,7 @@ int pid; * Earlier versions seemed to work -- wonder what they did. */ static int -ttycmp(s1, s2) -char *s1, *s2; +ttycmp(char *s1, char *s2) { if (strlen(s1) > 5) s1 += strlen(s1) - 5; if (strlen(s2) > 5) s2 += strlen(s2) - 5; @@ -809,10 +798,7 @@ char *s1, *s2; #endif static int -CreateTempDisplay(m, recvfd, wi) -struct msg *m; -int recvfd; -struct win *wi; +CreateTempDisplay(struct msg *m, int recvfd, struct win *wi) { int pid; int attach; @@ -1201,8 +1187,7 @@ ReceiveMsg() } void -ReceiveRaw(s) -int s; +ReceiveRaw(int s) { char rd[256]; int len = 0; @@ -1232,9 +1217,7 @@ int s; * sequent_ptx socket emulation must have mode 000 on the socket! */ static int -sconnect(s, sapp, len) -int s, len; -struct sockaddr *sapp; +sconnect(int s, struct sockaddr *sapp, int len) { register struct sockaddr_un *sap; struct stat st; @@ -1302,8 +1285,7 @@ RecoverSocket() static void -FinishAttach(m) -struct msg *m; +FinishAttach(struct msg *m) { char *p; int pid; @@ -1470,8 +1452,7 @@ struct msg *m; } static void -FinishDetach(m) -struct msg *m; +FinishDetach(struct msg *m) { struct display *next, **d, *det; int pid; @@ -1533,8 +1514,7 @@ struct pwdata { }; static void -AskPassword(m) -struct msg *m; +AskPassword(struct msg *m) { struct pwdata *pwdata; ASSERT(display); @@ -1549,9 +1529,7 @@ struct msg *m; } static void -PasswordProcessInput(ibuf, ilen) -char *ibuf; -int ilen; +PasswordProcessInput(char *ibuf, int ilen) { struct pwdata *pwdata; int c, l; @@ -1629,9 +1607,7 @@ int ilen; /* 'end' is exclusive, i.e. you should *not* write in *end */ static char * -strncpy_escape_quote(dst, src, end) -char *dst; -const char *src, *end; +strncpy_escape_quote(char *dst, const char *src, const char *end) { while (*src && dst < end) { @@ -1652,8 +1628,7 @@ const char *src, *end; } static void -DoCommandMsg(mp) -struct msg *mp; +DoCommandMsg(struct msg *mp) { char *args[MAXARGS]; int argl[MAXARGS]; @@ -1780,10 +1755,7 @@ struct msg *mp; #ifndef NAMEDPIPE int -SendAttachMsg(s, m, fd) -int s; -struct msg *m; -int fd; +SendAttachMsg(int s, struct msg *m, int fd) { int r; struct msghdr msg; diff --git a/src/teln.c b/src/teln.c index 4e1d2b2..49f5718 100644 --- a/src/teln.c +++ b/src/teln.c @@ -84,9 +84,7 @@ static unsigned char tn_init[] = { }; static void -tel_connev_fn(ev, data) -struct event *ev; -char *data; +tel_connev_fn(struct event *ev, char *data) { struct win *p = (struct win *)data; if (connect(p->w_ptyfd, (struct sockaddr *)&p->w_telsa, sizeof(p->w_telsa)) && errno != EISCONN) @@ -105,8 +103,7 @@ char *data; } int -TelOpen(args) -char **args; +TelOpen(char **args) { int fd; int on = 1; @@ -122,8 +119,7 @@ char **args; } int -TelConnect(p) -struct win *p; +TelConnect(struct win *p) { int port = TEL_DEFPORT; struct hostent *hp; @@ -188,16 +184,13 @@ struct win *p; } int -TelIsline(p) -struct win *p; +TelIsline(struct win *p) { return !fore->w_telropts[TO_SGA]; } void -TelProcessLine(bufpp, lenp) -char **bufpp; -int *lenp; +TelProcessLine(char **bufpp, int *lenp) { int echo = !fore->w_telropts[TO_ECHO]; unsigned char c; @@ -247,10 +240,7 @@ int *lenp; } int -DoTelnet(buf, lenp, f) -char *buf; -int *lenp; -int f; +DoTelnet(char *buf, int *lenp, int f) { int echo = !fore->w_telropts[TO_ECHO]; int cmode = fore->w_telropts[TO_SGA]; @@ -300,11 +290,7 @@ int f; /* modifies data in-place, returns new length */ int -TelIn(p, buf, len, free) -struct win *p; -char *buf; -int len; -int free; +TelIn(struct win *p, char *buf, int len, int free) { char *rp, *wp; int c; @@ -387,10 +373,7 @@ int free; } static void -TelReply(p, str, len) -struct win *p; -char *str; -int len; +TelReply(struct win *p, char *str, int len) { if (len <= 0) return; @@ -404,9 +387,7 @@ int len; } static void -TelDocmd(p, cmd, opt) -struct win *p; -int cmd, opt; +TelDocmd(struct win *p, int cmd, int opt) { unsigned char b[3]; int repl = 0; @@ -481,8 +462,7 @@ int cmd, opt; static void -TelDosub(p) -struct win *p; +TelDosub(struct win *p) { char trepl[20 + 6 + 1]; int l; @@ -509,16 +489,14 @@ struct win *p; } void -TelBreak(p) -struct win *p; +TelBreak(struct win *p) { static unsigned char tel_break[] = { TC_IAC, TC_BREAK }; TelReply(p, (char *)tel_break, 2); } void -TelWindowSize(p) -struct win *p; +TelWindowSize(struct win *p) { char s[20], trepl[20], *t; int i; @@ -544,10 +522,7 @@ static char tc_s[] = TC_S; static char to_s[] = TO_S; void -TelStatus(p, buf, l) -struct win *p; -char *buf; -int l; +TelStatus(struct win *p, char *buf, int l) { int i; diff --git a/src/termcap.c b/src/termcap.c index b24f3cd..17a9bc8 100644 --- a/src/termcap.c +++ b/src/termcap.c @@ -83,8 +83,7 @@ static const char TermcapConst[] = "\\\n\ \t:le=^H:bl=^G:cr=^M:it#8:ho=\\E[H:nw=\\EE:ta=^I:is=\\E)0:"; char * -gettermcapstring(s) -char *s; +gettermcapstring(char *s) { int i; @@ -106,9 +105,7 @@ char *s; * Effect: display initialisation. */ int -InitTermcap(wi, he) -int wi; -int he; +InitTermcap(int wi, int he) { register char *s; int i; @@ -495,9 +492,7 @@ int he; #ifdef MAPKEYS int -remap(n, map) -int n; -int map; +remap(int n, int map) { char *s = 0; int fl = 0, domap = 0; @@ -613,10 +608,7 @@ CheckEscape() } static int -findseq_ge(seq, k, sp) -char *seq; -int k; -unsigned char **sp; +findseq_ge(char *seq, int k, unsigned char **sp) { unsigned char *p; int j, l; @@ -648,10 +640,7 @@ unsigned char **sp; } static void -setseqoff(p, i, o) -unsigned char *p; -int i; -int o; +setseqoff(unsigned char *p, int i, int o) { unsigned char *q; int l, k; @@ -675,10 +664,7 @@ int o; } static int -addmapseq(seq, k, nr) -char *seq; -int k; -int nr; +addmapseq(char *seq, int k, int nr) { int i, j, l, mo, m; unsigned char *p, *q; @@ -749,9 +735,7 @@ int nr; } static int -remmapseq(seq, k) -char *seq; -int k; +remmapseq(char *seq, int k) { int j, l; unsigned char *p, *q; @@ -821,8 +805,7 @@ dumpmap() * Appends to the static variable Termcap */ static void -AddCap(s) -char *s; +AddCap(char *s) { register int n; @@ -847,8 +830,7 @@ char *s; * global buffer "Termcap". A pointer to this buffer is returned. */ char * -MakeTermcap(aflag) -int aflag; +MakeTermcap(int aflag) { char buf[TERMCAP_BUFSIZE]; register char *p, *cp, *s, ch, *tname; @@ -1129,10 +1111,7 @@ int aflag; } static void -MakeString(cap, buf, buflen, s) -char *cap, *buf; -int buflen; -char *s; +MakeString(char *cap, char *buf, int buflen, char *s) { register char *p, *pmax; register unsigned int c; @@ -1185,8 +1164,7 @@ char *s; #ifdef FONT int -CreateTransTable(s) -char *s; +CreateTransTable(char *s) { int curchar; char *templ, *arg; @@ -1300,8 +1278,7 @@ FreeTransTable() #endif /* FONT */ static int -copyarg(pp, s) -char **pp, *s; +copyarg(char **pp, char *s) { int l; char *p; @@ -1328,8 +1305,7 @@ char **pp, *s; */ static int -e_tgetent(bp, name) -char *bp, *name; +e_tgetent(char *bp, char *name) { int r; @@ -1353,10 +1329,7 @@ char *bp, *name; */ static char * -findcap(cap, tepp, n) -char *cap; -char **tepp; -int n; +findcap(char *cap, char **tepp, int n) { char *tep; char c, *p, *cp; @@ -1465,9 +1438,7 @@ int n; } static char * -e_tgetstr(cap, tepp) -char *cap; -char **tepp; +e_tgetstr(char *cap, char **tepp) { char *tep; if ((tep = findcap(cap, tepp, 0))) @@ -1476,8 +1447,7 @@ char **tepp; } static int -e_tgetflag(cap) -char *cap; +e_tgetflag(char *cap) { char buf[2], *bufp; char *tep; @@ -1488,8 +1458,7 @@ char *cap; } static int -e_tgetnum(cap) -char *cap; +e_tgetnum(char *cap) { char buf[20], *bufp; char *tep, c; diff --git a/src/utmp.c b/src/utmp.c index 10d3c64..1d08e8f 100644 --- a/src/utmp.c +++ b/src/utmp.c @@ -157,8 +157,7 @@ static struct ttyent *getttyent (void); #ifndef UTMPOK void -SlotToggle(how) -int how; +SlotToggle(int how) { debug1("SlotToggle (!UTMPOK) %d\n", how); # ifdef UTMPFILE @@ -174,8 +173,7 @@ int how; #ifdef UTMPOK void -SlotToggle(how) -int how; +SlotToggle(int how) { debug1("SlotToggle %d\n", how); if (fore->w_type != W_TYPE_PTY) @@ -403,8 +401,7 @@ RestoreLoginSlot() */ int -SetUtmp(wi) -struct win *wi; +SetUtmp(struct win *wi) { register slot_t slot; struct utmp u; @@ -498,8 +495,7 @@ struct win *wi; */ int -RemoveUtmp(wi) -struct win *wi; +RemoveUtmp(struct win *wi) { struct utmp u, *uu; slot_t slot; @@ -551,8 +547,7 @@ struct win *wi; #define SLOT_USED(u) (u->ut_type == USER_PROCESS) static struct utmp * -getutslot(slot) -slot_t slot; +getutslot(slot_t slot) { struct utmp u; bzero((char *)&u, sizeof(u)); @@ -562,11 +557,7 @@ slot_t slot; } static int -pututslot(slot, u, host, wi) -slot_t slot; -struct utmp *u; -char *host; -struct win *wi; +pututslot(slot_t slot, struct utmp *u, char *host, struct win *wi) { #ifdef _SEQUENT_ if (SLOT_USED(u) && host && *host) @@ -594,8 +585,7 @@ struct win *wi; } static void -makedead(u) -struct utmp *u; +makedead(struct utmp *u) { u->ut_type = DEAD_PROCESS; #if (!defined(linux) || defined(EMPTY)) && !defined(__CYGWIN__) @@ -608,10 +598,7 @@ struct utmp *u; } static void -makeuser(u, line, user, pid) -struct utmp *u; -char *line, *user; -int pid; +makeuser(struct utmp *u, char *line, char *user, int pid) { time_t now; u->ut_type = USER_PROCESS; @@ -635,8 +622,7 @@ int pid; } static slot_t -TtyNameSlot(nam) -char *nam; +TtyNameSlot(char *nam) { return stripdev(nam); } @@ -687,8 +673,7 @@ getutent() } static struct utmp * -getutslot(slot) -slot_t slot; +getutslot(slot_t slot) { if (utmpfd < 0 && !initutmp()) return 0; @@ -699,11 +684,7 @@ slot_t slot; } static int -pututslot(slot, u, host, wi) -slot_t slot; -struct utmp *u; -char *host; -struct win *wi; +pututslot(slot_t slot, struct utmp *u, char *host, struct win *wi) { #ifdef sequent if (SLOT_USED(u)) @@ -719,8 +700,7 @@ struct win *wi; static void -makedead(u) -struct utmp *u; +makedead(struct utmp *u) { #ifdef UT_UNSORTED bzero(u->ut_name, sizeof(u->ut_name)); @@ -734,10 +714,7 @@ struct utmp *u; static void -makeuser(u, line, user, pid) -struct utmp *u; -char *line, *user; -int pid; +makeuser(struct utmp *u, char *line, char *user, int pid) { time_t now; strncpy(u->ut_line, line, sizeof(u->ut_line)); @@ -747,8 +724,7 @@ int pid; } static slot_t -TtyNameSlot(nam) -char *nam; +TtyNameSlot(char *nam) { slot_t slot; char *line; @@ -878,8 +854,7 @@ getlogin() /* aargh, linux' pututline returns void! */ struct utmp * -xpututline(u) -struct utmp *u; +xpututline(struct utmp *u) { struct utmp *u2; pututline(u); diff --git a/src/viewport.c b/src/viewport.c index f1607d5..638d826 100644 --- a/src/viewport.c +++ b/src/viewport.c @@ -125,8 +125,7 @@ RethinkDisplayViewports() } void -RethinkViewportOffsets(cv) -struct canvas *cv; +RethinkViewportOffsets(struct canvas *cv) { struct viewport *vp; diff --git a/src/window.c b/src/window.c index ba3b521..25c903c 100644 --- a/src/window.c +++ b/src/window.c @@ -173,8 +173,7 @@ static int const_IOSIZE = IOSIZE; static int const_one = 1; void -nwin_compose(def, new, res) -struct NewWindow *def, *new, *res; +nwin_compose(struct NewWindow *def, struct NewWindow *new, struct NewWindow *res) { #define COMPOSE(x) res->x = new->x != nwin_undef.x ? new->x : def->x COMPOSE(StartAt); @@ -219,10 +218,7 @@ struct LayFuncs WinLf = }; static int -DoAutolf(buf, lenp, fr) -char *buf; -int *lenp; -int fr; +DoAutolf(char *buf, int *lenp, int fr) { char *p; int len = *lenp; @@ -247,9 +243,7 @@ int fr; } static void -WinProcess(bufpp, lenp) -char **bufpp; -int *lenp; +WinProcess(char **bufpp, int *lenp) { int l2 = 0, f, *ilen, l = *lenp, trunc; char *ibuf; @@ -346,9 +340,7 @@ int *lenp; } static void -ZombieProcess(bufpp, lenp) -char **bufpp; -int *lenp; +ZombieProcess(char **bufpp, int *lenp) { int l = *lenp; char *buf = *bufpp, b1[10], b2[10]; @@ -381,8 +373,7 @@ int *lenp; } static void -WinRedisplayLine(y, from, to, isblank) -int y, from, to, isblank; +WinRedisplayLine(int y, int from, int to, int isblank) { debug3("WinRedisplayLine %d %d %d\n", y, from, to); if (y < 0) @@ -395,9 +386,7 @@ int y, from, to, isblank; } static int -WinRewrite(y, x1, x2, rend, doit) -int y, x1, x2, doit; -struct mchar *rend; +WinRewrite(int y, int x1, int x2, struct mchar *rend, int doit) { register int cost, dx; register unsigned char *p, *i; @@ -466,8 +455,7 @@ struct mchar *rend; } static void -WinClearLine(y, xs, xe, bce) -int y, xs, xe, bce; +WinClearLine(int y, int xs, int xe, int bce) { fore = (struct win *)flayer->l_data; debug3("WinClearLine %d %d-%d\n", y, xs, xe); @@ -475,8 +463,7 @@ int y, xs, xe, bce; } static int -WinResize(wi, he) -int wi, he; +WinResize(int wi, int he) { fore = (struct win *)flayer->l_data; ChangeWindowSize(fore, wi, he, fore->w_histheight); @@ -515,10 +502,7 @@ WinRestore() * returns 0 on success. */ int -DoStartLog(w, buf, bufsize) -struct win *w; -char *buf; -int bufsize; +DoStartLog(struct win *w, char *buf, int bufsize) { int n; if (!w || !buf) @@ -551,8 +535,7 @@ int bufsize; * The display d (if specified) switches to that window. */ int -MakeWindow(newwin) -struct NewWindow *newwin; +MakeWindow(struct NewWindow *newwin) { register struct win **pp, *p; register int n, i; @@ -877,8 +860,7 @@ struct NewWindow *newwin; * working directory is lost. */ int -RemakeWindow(p) -struct win *p; +RemakeWindow(struct win *p) { char *TtyName; int lflag, f; @@ -941,8 +923,7 @@ struct win *p; } void -CloseDevice(wp) -struct win *wp; +CloseDevice(struct win *wp) { if (wp->w_ptyfd < 0) return; @@ -964,8 +945,7 @@ struct win *wp; } void -FreeWindow(wp) -struct win *wp; +FreeWindow(struct win *wp) { struct display *d; int i; @@ -1058,11 +1038,7 @@ struct win *wp; } static int -OpenDevice(args, lflag, typep, namep) -char **args; -int lflag; -int *typep; -char **namep; +OpenDevice(char **args, int lflag, int *typep, char **namep) { char *arg = args[0]; struct stat st; @@ -1185,9 +1161,7 @@ char **namep; * */ static int -ForkWindow(win, args, ttyn) -struct win *win; -char **args, *ttyn; +ForkWindow(struct win *win, char **args, char *ttyn) { int pid; char tebuf[25]; @@ -1463,8 +1437,7 @@ char **args, *ttyn; #ifndef HAVE_EXECVPE void -execvpe(prog, args, env) -char *prog, **args, **env; +execvpe(char *prog, char **args, char **env) { register char *path = NULL, *p; char buf[1024]; @@ -1512,8 +1485,7 @@ char *prog, **args, **env; #ifdef PSEUDOS int -winexec(av) -char **av; +winexec(char **av) { char **pp; char *p, *s, *t; @@ -1661,8 +1633,7 @@ char **av; } void -FreePseudowin(w) -struct win *w; +FreePseudowin(struct win *w) { struct pseudowin *pwin = w->w_pwin; @@ -1699,9 +1670,7 @@ struct win *w; * returns 0, if the lock really has been released */ int -ReleaseAutoWritelock(dis, w) -struct display *dis; -struct win *w; +ReleaseAutoWritelock(struct display *dis, struct win *w) { debug2("ReleaseAutoWritelock: user %s, window %d\n", dis->d_user->u_name, w->w_number); @@ -1729,9 +1698,7 @@ struct win *w; * returns 0, if the lock really could be obtained */ int -ObtainAutoWritelock(d, w) -struct display *d; -struct win *w; +ObtainAutoWritelock(struct display *d, struct win *w) { if ((w->w_wlock == WLOCK_AUTO) && !AclCheckPermWin(d->d_user, ACL_WRITE, w) && @@ -1753,9 +1720,7 @@ struct win *w; #ifdef COPY_PASTE static void -paste_slowev_fn(ev, data) -struct event *ev; -char *data; +paste_slowev_fn(struct event *ev, char *data) { struct paster *pa = (struct paster *)data; struct win *p; @@ -1779,9 +1744,7 @@ char *data; static int -muchpending(p, ev) -struct win *p; -struct event *ev; +muchpending(struct win *p, struct event *ev) { struct canvas *cv; for (cv = p->w_layer.l_cvlist; cv; cv = cv->c_lnext) @@ -1823,9 +1786,7 @@ struct event *ev; } static void -win_readev_fn(ev, data) -struct event *ev; -char *data; +win_readev_fn(struct event *ev, char *data) { struct win *p = (struct win *)data; char buf[IOSIZE], *bp; @@ -1943,9 +1904,7 @@ char *data; static void -win_writeev_fn(ev, data) -struct event *ev; -char *data; +win_writeev_fn(struct event *ev, char *data) { struct win *p = (struct win *)data; int len; @@ -1974,9 +1933,7 @@ char *data; #ifdef PSEUDOS static void -pseu_readev_fn(ev, data) -struct event *ev; -char *data; +pseu_readev_fn(struct event *ev, char *data) { struct win *p = (struct win *)data; char buf[IOSIZE]; @@ -2037,9 +1994,7 @@ char *data; } static void -pseu_writeev_fn(ev, data) -struct event *ev; -char *data; +pseu_writeev_fn(struct event *ev, char *data) { struct win *p = (struct win *)data; struct pseudowin *pw = p->w_pwin; @@ -2058,9 +2013,7 @@ char *data; #endif /* PSEUDOS */ static void -win_silenceev_fn(ev, data) -struct event *ev; -char *data; +win_silenceev_fn(struct event *ev, char *data) { struct win *p = (struct win *)data; struct canvas *cv; @@ -2083,9 +2036,7 @@ char *data; } static void -win_destroyev_fn(ev, data) -struct event *ev; -char *data; +win_destroyev_fn(struct event *ev, char *data) { struct win *p = (struct win *)ev->data; WindowDied(p, p->w_exitstatus, 1); @@ -2094,10 +2045,7 @@ char *data; #ifdef ZMODEM static int -zmodem_parse(p, bp, len) -struct win *p; -char *bp; -int len; +zmodem_parse(struct win *p, char *bp, int len) { int i; char *b2 = bp; @@ -2164,10 +2112,7 @@ int len; } static void -zmodem_fin(buf, len, data) -char *buf; -int len; -char *data; +zmodem_fin(char *buf, int len, char *data) { char *s; int n; @@ -2183,11 +2128,7 @@ char *data; } static void -zmodem_found(p, send, bp, len) -struct win *p; -int send; -char *bp; -int len; +zmodem_found(struct win *p, int send, char *bp, int len) { char *s; int i, n; @@ -2244,9 +2185,7 @@ int len; } void -zmodem_abort(p, d) -struct win *p; -struct display *d; +zmodem_abort(struct win *p, struct display *d) { struct display *olddisplay = display; struct layer *oldflayer = flayer; -- cgit v1.2.1