rio: proper prototypes in fns.h

Use proper function prototypes in `fns.h`, that include argument
type information.
This commit is contained in:
Dan Cross
2025-07-25 11:37:39 -04:00
parent 655f7c3184
commit 1e6e30e91e
10 changed files with 98 additions and 93 deletions

View File

@@ -6,6 +6,7 @@
#include <X11/X.h> #include <X11/X.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <X11/extensions/shape.h>
#include "dat.h" #include "dat.h"
#include "fns.h" #include "fns.h"

View File

@@ -4,6 +4,7 @@
#include <X11/X.h> #include <X11/X.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <X11/extensions/shape.h>
#include "dat.h" #include "dat.h"
#include "fns.h" #include "fns.h"

View File

@@ -3,15 +3,17 @@
#include <X11/X.h> #include <X11/X.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <X11/extensions/shape.h>
#include "dat.h" #include "dat.h"
#include "fns.h" #include "fns.h"
typedef struct { typedef struct Cursordata Cursordata;
struct Cursordata {
int width; int width;
int hot[2]; int hot[2];
unsigned char mask[64]; unsigned char mask[64];
unsigned char fore[64]; unsigned char fore[64];
} Cursordata; };
Cursordata bigarrow = { Cursordata bigarrow = {
16, 16,
@@ -157,9 +159,7 @@ static char grey_bits[] = {
static XColor bl, wh; static XColor bl, wh;
Cursor Cursor
getcursor(c, s) getcursor(Cursordata *c, ScreenInfo *s)
Cursordata *c;
ScreenInfo *s;
{ {
Pixmap f, m; Pixmap f, m;
@@ -172,8 +172,7 @@ ScreenInfo *s;
} }
void void
initcurs(s) initcurs(ScreenInfo *s)
ScreenInfo *s;
{ {
XColor dummy; XColor dummy;

View File

@@ -5,6 +5,7 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <X11/Xproto.h> #include <X11/Xproto.h>
#include <X11/extensions/shape.h>
#include "dat.h" #include "dat.h"
#include "fns.h" #include "fns.h"

View File

@@ -119,7 +119,7 @@ configurereq(XConfigureRequestEvent *e)
/* we don't set curtime as nothing here uses it */ /* we don't set curtime as nothing here uses it */
c = getclient(e->window, 0); c = getclient(e->window, 0);
trace("configurereq", c, e); trace("configurereq", c, (XEvent *)e);
e->value_mask &= ~CWSibling; e->value_mask &= ~CWSibling;
@@ -190,7 +190,7 @@ mapreq(XMapRequestEvent *e)
curtime = CurrentTime; curtime = CurrentTime;
c = getclient(e->window, 0); c = getclient(e->window, 0);
trace("mapreq", c, e); trace("mapreq", c, (XEvent *)e);
if(c == 0 || c->window != e->window){ if(c == 0 || c->window != e->window){
/* workaround for stupid NCDware */ /* workaround for stupid NCDware */

View File

@@ -7,111 +7,111 @@
#endif #endif
#define setstate setstaterio #define setstate setstaterio
typedef struct Cursordata Cursordata;
/* color.c */ /* color.c */
unsigned long colorpixel(Display*, ScreenInfo*, int, unsigned long, unsigned long); unsigned long colorpixel(Display*, ScreenInfo*, int, unsigned long, unsigned long);
/* main.c */ /* main.c */
void usage(); void usage(void);
void initscreen(); void initscreen(ScreenInfo*, int, int);
ScreenInfo *getscreen(); ScreenInfo *getscreen(Window);
Time timestamp(); Time timestamp(void);
void sendcmessage(); void sendcmessage(Window, Atom, long, int, int);
void sendconfig(); void sendconfig(Client *);
void sighandler(); void sighandler(int);
void getevent(); void getevent(XEvent *);
void cleanup(); void cleanup(void);
/* event.c */ /* event.c */
void mainloop(); void mainloop(int);
void configurereq(); void configurereq(XConfigureRequestEvent*);
void mapreq(); void mapreq(XMapRequestEvent*);
void circulatereq(); void circulatereq(XCirculateRequestEvent*);
void unmap(); void unmap(XUnmapEvent*);
void newwindow(); void newwindow(XCreateWindowEvent*);
void destroy(); void destroy(Window);
void clientmesg(); void clientmesg(XClientMessageEvent*);
void cmap(); void cmap(XColormapEvent*);
void property(); void property(XPropertyEvent*);
void shapenotify(); void shapenotify(XShapeEvent*);
void enter(); void enter(XCrossingEvent*);
void leave(); void leave(XCrossingEvent*);
void focusin(); void focusin(XFocusChangeEvent*);
void reparent(); void reparent(XReparentEvent*);
void motionnotify(); void motionnotify(XMotionEvent*);
BorderOrient borderorient(); BorderOrient borderorient(Client*, int, int);
/* manage.c */ /* manage.c */
int manage(); int manage(Client*, int);
void scanwins(); void scanwins(ScreenInfo*);
void setshape(); void setshape(Client*);
void withdraw(); void withdraw(Client*);
void gravitate(); void cmapfocus(Client*);
void cmapfocus(); void cmapnofocus(ScreenInfo*);
void cmapnofocus(); void getcmaps(Client*);
void getcmaps(); int _getprop(Window, Atom, Atom, long, unsigned char **);
int _getprop(); char *getprop(Window, Atom);
char *getprop(); Window getwprop(Window, Atom);
Window getwprop(); int getiprop(Window, Atom);
int getiprop(); int getstate(Window, int*);
int getstate(); void setstate(Client*, int);
void setstate(); void setlabel(Client*);
void setlabel(); void getproto(Client*);
void getproto(); void gettrans(Client*);
void gettrans();
/* key.c */ /* key.c */
void keypress(); void keypress(XKeyEvent*);
void keyrelease(); void keyrelease(XKeyEvent*);
void keysetup(); void keysetup(void);
/* menu.c */ /* menu.c */
void button(); void button(XButtonEvent*);
void spawn(); void spawn(ScreenInfo*);
void reshape(); void reshape(Client*, int, int (*)(Client*, int, XButtonEvent*), XButtonEvent*);
void move(); void move(Client*, int);
void delete(); void delete(Client*, int);
void hide(); void hide(Client*);
void unhide(); void unhide(int, int);
void unhidec(); void unhidec(Client*, int);
void renamec(); void renamec(Client*, char*);
void button2(); void button2(int);
void initb2menu(); void initb2menu(int);
void switch_to(); void switch_to(int);
void switch_to_c(); void switch_to_c(int, Client*);
/* client.c */ /* client.c */
void setactive(); void setactive(Client*, int);
void draw_border(); void draw_border(Client*, int);
void active(); void active(Client*);
void nofocus(); void nofocus(void);
void top(); void top(Client*);
Client *getclient(); Client *getclient(Window, int);
void rmclient(); void rmclient(Client*);
void dump_revert(); void dump_revert(void);
void dump_clients(); void dump_clients(void);
void shuffle(int); void shuffle(int);
/* grab.c */ /* grab.c */
int menuhit(); int menuhit(XButtonEvent*, Menu*);
Client *selectwin(); Client *selectwin(int, int*, ScreenInfo*);
int sweep(); int sweep(Client*, int, XButtonEvent*);
int drag(); int drag(Client*, int);
int pull(); int pull(Client*, int, XButtonEvent*);
void getmouse(); void getmouse(int*, int*, ScreenInfo*);
void setmouse(); void setmouse(int, int, ScreenInfo*);
/* error.c */ /* error.c */
int handler(); int handler(Display*, XErrorEvent*);
void fatal(); void fatal(char*);
void graberror(); void graberror(char*, int);
void showhints(); void dotrace(char*, Client*, XEvent*);
void dotrace();
/* cursor.c */ /* cursor.c */
void initcurs(); Cursor getcursor(Cursordata*, ScreenInfo*);
void initcurs(ScreenInfo*);
void ShowEvent(XEvent*); void ShowEvent(XEvent*);

View File

@@ -4,6 +4,7 @@
#include <X11/Xos.h> #include <X11/Xos.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <X11/extensions/shape.h>
#include "dat.h" #include "dat.h"
#include "fns.h" #include "fns.h"

View File

@@ -471,8 +471,9 @@ sendconfig(Client *c)
} }
void void
sighandler(void) sighandler(int _signo)
{ {
(void)_signo;
signalled = 1; signalled = 1;
} }

View File

@@ -115,7 +115,7 @@ manage(Client *c, int mapped)
nwin %= 10; nwin %= 10;
} }
if(c->is9term && !(fixsize ? drag(c, Button3) : sweep(c, Button3))){ if(c->is9term && !(fixsize ? drag(c, Button3) : sweep(c, Button3, 0))){
ScreenInfo *screen = c->screen; ScreenInfo *screen = c->screen;
XKillClient(dpy, c->window); XKillClient(dpy, c->window);
rmclient(c); rmclient(c);

View File

@@ -14,6 +14,7 @@
#include <X11/X.h> #include <X11/X.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <X11/extensions/shape.h>
#include "dat.h" #include "dat.h"
#include "fns.h" #include "fns.h"