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/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/shape.h>
#include "dat.h"
#include "fns.h"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -115,7 +115,7 @@ manage(Client *c, int mapped)
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;
XKillClient(dpy, c->window);
rmclient(c);

View File

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