From 7a6e1a5b42b550b815de523ac3f68cc7bacf3bf3 Mon Sep 17 00:00:00 2001 From: ellson Date: Wed, 23 Feb 2005 21:15:21 +0000 Subject: [PATCH] ansify some functions --- cmd/lefty/ws/x11/libfilereq/Draw.c | 103 ++++++++--------------------- cmd/lefty/ws/x11/libfilereq/Path.c | 61 +++++------------ 2 files changed, 43 insertions(+), 121 deletions(-) diff --git a/cmd/lefty/ws/x11/libfilereq/Draw.c b/cmd/lefty/ws/x11/libfilereq/Draw.c index 4586dcd81..a65181520 100644 --- a/cmd/lefty/ws/x11/libfilereq/Draw.c +++ b/cmd/lefty/ws/x11/libfilereq/Draw.c @@ -144,9 +144,7 @@ void SFcreateGC() XSetClipRectangles(SFdisplay, SFtextGC, 0, 0, rectangles, 1, Unsorted); } -void SFclearList(n, doScroll) -long n; -int doScroll; +void SFclearList(long n, int doScroll) { SFDir *dir; @@ -189,9 +187,7 @@ int doScroll; } } -static void SFdeleteEntry(dir, entry) -SFDir *dir; -SFEntry *entry; +static void SFdeleteEntry(SFDir *dir, SFEntry *entry) { register SFEntry *e; register SFEntry *end; @@ -239,17 +235,12 @@ SFEntry *entry; ); } -static void SFwriteStatChar(name, last, statBuf) -char *name; -int last; -struct stat *statBuf; +static void SFwriteStatChar(char *name, int last, struct stat *statBuf) { name[last] = SFstatChar(statBuf); } -static int SFstatAndCheck(dir, entry) -SFDir *dir; -SFEntry *entry; +static int SFstatAndCheck(SFDir *dir, SFEntry *entry) { struct stat statBuf; char save; @@ -302,14 +293,10 @@ SFEntry *entry; return 0; } -static void SFdrawStrings(w, dir, from, to) -register Window w; -register SFDir *dir; -register int from; -register int to; +static void SFdrawStrings(Window w, SFDir *dir, int from, int to) { - register int i; - register SFEntry *entry; + int i; + SFEntry *entry; int x; x = SFtextX - dir->hOrigin * SFcharWidth; @@ -365,9 +352,7 @@ register int to; } } -void SFdrawList(n, doScroll) -long n; -int doScroll; +void SFdrawList(long n, int doScroll) { SFDir *dir; Window w; @@ -388,8 +373,7 @@ int doScroll; } } -void SFdrawLists(doScroll) -int doScroll; +void SFdrawLists(int doScroll) { long i; @@ -398,8 +382,7 @@ int doScroll; } } -static void SFinvertEntry(n) -register int n; +static void SFinvertEntry(int n) { XFillRectangle(SFdisplay, XtWindow(selFileLists[n]), @@ -438,9 +421,7 @@ static unsigned long SFscrollTimerInterval() return (unsigned long) t; } -static void SFscrollTimer(p, id) -XtPointer p; -XtIntervalId *id; +static void SFscrollTimer(XtPointer p, XtIntervalId *id) { SFDir *dir; int save; @@ -484,12 +465,10 @@ XtIntervalId *id; } } -static int SFnewInvertEntry(n, event) -register long n; -register XMotionEvent *event; +static int SFnewInvertEntry(long n, XMotionEvent *event) { - register int x, y; - register int new; + int x, y; + int new; static int SFscrollTimerAdded = 0; x = event->x; @@ -529,12 +508,9 @@ register XMotionEvent *event; } /* ARGSUSED */ -void SFenterList(w, n, event) -Widget w; -register int n; -register XEnterWindowEvent *event; +void SFenterList(Widget w, int n, XEnterWindowEvent *event) { - register int new; + int new; /* sanity */ if (SFcurrentInvert[n] != -1) { @@ -550,10 +526,7 @@ register XEnterWindowEvent *event; } /* ARGSUSED */ -void SFleaveList(w, n, event) -Widget w; -register int n; -XEvent *event; +void SFleaveList(Widget w, int n, XEvent *event) { if (SFcurrentInvert[n] != -1) { SFinvertEntry(n); @@ -562,12 +535,9 @@ XEvent *event; } /* ARGSUSED */ -void SFmotionList(w, n, event) -Widget w; -register int n; -register XMotionEvent *event; +void SFmotionList(Widget w, int n, XMotionEvent *event) { - register int new; + int new; new = SFnewInvertEntry((long) n, event); @@ -583,10 +553,7 @@ register XMotionEvent *event; } /* ARGSUSED */ -void SFvFloatSliderMovedCallback(w, n, fnew) -Widget w; -int n; -float *fnew; +void SFvFloatSliderMovedCallback(Widget w, int n, float *fnew) { int new; @@ -596,10 +563,7 @@ float *fnew; } /* ARGSUSED */ -void SFvSliderMovedCallback(w, n, new) -Widget w; -int n; -int new; +void SFvSliderMovedCallback(Widget w, int n, int new) { int old; register Window win; @@ -667,10 +631,7 @@ int new; } /* ARGSUSED */ -void SFvAreaSelectedCallback(w, n, pnew) -Widget w; -int n; -int pnew; +void SFvAreaSelectedCallback(Widget w, int n, int pnew) { SFDir *dir; int new; @@ -707,10 +668,7 @@ int pnew; } /* ARGSUSED */ -void SFhSliderMovedCallback(w, n, new) -Widget w; -int n; -float *new; +void SFhSliderMovedCallback(Widget w, int n, float *new) { SFDir *dir; int save; @@ -726,10 +684,7 @@ float *new; } /* ARGSUSED */ -void SFhAreaSelectedCallback(w, n, pnew) -Widget w; -int n; -int pnew; +void SFhAreaSelectedCallback(Widget w, int n, int pnew) { SFDir *dir; int new; @@ -765,10 +720,7 @@ int pnew; } /* ARGSUSED */ -void SFpathSliderMovedCallback(w, client_data, new) -Widget w; -XtPointer client_data; -float *new; +void SFpathSliderMovedCallback(Widget w, XtPointer client_data, float *new) { SFDir *dir; int n; @@ -804,10 +756,7 @@ float *new; /* ARGSUSED */ -void SFpathAreaSelectedCallback(w, client_data, pnew) -Widget w; -XtPointer client_data; -int pnew; +void SFpathAreaSelectedCallback(Widget w, XtPointer client_data, int pnew) { int new; float f; diff --git a/cmd/lefty/ws/x11/libfilereq/Path.c b/cmd/lefty/ws/x11/libfilereq/Path.c index cfaceaa55..7a2188630 100644 --- a/cmd/lefty/ws/x11/libfilereq/Path.c +++ b/cmd/lefty/ws/x11/libfilereq/Path.c @@ -95,8 +95,7 @@ static int SFtwiddle = 0; void SFsetText(char *path); -int SFchdir(path) -char *path; +int SFchdir(char *path) { int result; @@ -112,8 +111,7 @@ char *path; return result; } -static void SFfree(i) -int i; +static void SFfree(int i) { register SFDir *dir; register int j; @@ -134,15 +132,12 @@ int i; dir->dir = NULL; } -static void SFstrdup(s1, s2) -char **s1; -char *s2; +static void SFstrdup(char **s1, char *s2) { *s1 = strcpy(XtMalloc((unsigned) (strlen(s2) + 1)), s2); } -static void SFunreadableDir(dir) -SFDir *dir; +static void SFunreadableDir(SFDir *dir) { char *cannotOpen = " "; @@ -155,9 +150,7 @@ SFDir *dir; } #ifdef SEL_FILE_IGNORE_CASE -static SFstrncmp(p, q, n) -register char *p, *q; -register int n; +static SFstrncmp(char *p, char *q, int n) { register char c1, c2; char *psave, *qsave; @@ -198,9 +191,7 @@ register int n; } #endif /* def SEL_FILE_IGNORE_CASE */ -static void SFreplaceText(dir, str) -SFDir *dir; -char *str; +static void SFreplaceText(SFDir *dir, char *str) { int len; @@ -220,8 +211,7 @@ char *str; SFtextChanged(); } -static void SFexpand(str) -char *str; +static void SFexpand(char *str) { int len; int cmp; @@ -270,9 +260,7 @@ char *str; XtFree(growing); } -static int SFfindFile(dir, str) -SFDir *dir; -register char *str; +static int SFfindFile(SFDir *dir, char *str) { register int i, last, max; register char *name, save; @@ -473,8 +461,7 @@ static void SFgetHomeDirs() } } -static int SFfindHomeDir(begin, end) -char *begin, *end; +static int SFfindHomeDir(char *begin, char *end) { char save; char *theRest; @@ -684,8 +671,7 @@ void SFupdatePath() } } -void SFsetText(path) -char *path; +void SFsetText(char *path) { XawTextBlock text; @@ -699,19 +685,13 @@ char *path; } /* ARGSUSED */ -void SFbuttonPressList(w, n, event) -Widget w; -int n; -XButtonPressedEvent *event; +void SFbuttonPressList(Widget w, int n, XButtonPressedEvent *event) { SFbuttonPressed = 1; } /* ARGSUSED */ -void SFbuttonReleaseList(w, n, event) -Widget w; -int n; -XButtonReleasedEvent *event; +void SFbuttonReleaseList(Widget w, int n, XButtonReleasedEvent *event) { SFDir *dir; @@ -723,16 +703,13 @@ XButtonReleasedEvent *event; } SFdoNotTouchVorigin = 1; dir = &(SFdirs[SFdirPtr + n]); - SFreplaceText(dir, - dir->entries[dir->vOrigin + + SFreplaceText(dir, dir->entries[dir->vOrigin + SFcurrentInvert[n]].shown); SFmotionList(w, n, event); } } -static int SFcheckDir(n, dir) -int n; -SFDir *dir; +static int SFcheckDir(int n, SFDir *dir) { struct stat statBuf; int i; @@ -793,8 +770,7 @@ SFDir *dir; return 0; } -static int SFcheckFiles(dir) -SFDir *dir; +static int SFcheckFiles(SFDir *dir) { int from, to; int result; @@ -831,9 +807,7 @@ SFDir *dir; return result; } -void SFdirModTimer(cl, id) -XtPointer cl; -XtIntervalId *id; +void SFdirModTimer(XtPointer cl, XtIntervalId *id) { static int n = -1; static int f = 0; @@ -876,8 +850,7 @@ XtIntervalId *id; /* Return a single character describing what kind of file STATBUF is. */ -char SFstatChar(statBuf) -struct stat *statBuf; +char SFstatChar(struct stat *statBuf) { if (S_ISDIR(statBuf->st_mode)) { return '/'; -- 2.40.0