diff options
author | Cyril Brulebois <kibi@debian.org> | 2011-05-25 04:00:12 -0700 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2011-05-26 08:15:41 -0700 |
commit | 0796c3ad0dc1a2a0e42ca3b2c7b0cfd4016fc9e4 (patch) | |
tree | d097a98eb5a56c5a5a82a6f14046a8ad765a8dbc /xts5 | |
parent | 35f6e2daf13a2d4430cc778a1bb5b382255fd404 (diff) |
xts5: Fix missing type specifiers.
Use void when nothing is actually returned, use int otherwise.
Also update the appropriate header for the void ones. Even though a
comment claims this header is generated automatically from the source
files, that doesn't seem to be the case.
The following warning go away accordingly:
| CC checkevent.lo
| checkevent.c:664:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
| check_ext_event(good,ev)
| ^~~~~~~~~~~~~~~
| CC devcntl.lo
| devcntl.c:401:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
| devicerelkeys(dev)
| ^~~~~~~~~~~~~
| devcntl.c:537:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
| modpress(disp, mask)
| ^~~~~~~~
| devcntl.c:545:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
| devmodpress(disp, dev, mask)
| ^~~~~~~~~~~
| devcntl.c:559:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
| modrel(disp, mask)
| ^~~~~~
| devcntl.c:567:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
| devmodrel(disp, dev, mask)
| ^~~~~~~~~
| devcntl.c:644:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
| ismodkey(mask, kc)
| ^~~~~~~~
| devcntl.c:669:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
| restoredevstate()
| ^~~~~~~~~~~~~~~
| devcntl.c:681:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
| noext(needbutton)
| ^~~~~
| devcntl.c:703:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
| nbuttons()
| ^~~~~~~~
| devcntl.c:718:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
| getkeycode(display)
| ^~~~~~~~~~
| devcntl.c:741:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
| getdevkeycode(display,dev)
| ^~~~~~~~~~~~~
| CC pfcount.lo
| pfcount.c:118:1: waning: type specifier missing, defaults to 'int' [-Wimplicit-int]
| pfcount(pass, fail)
| ^~~~~~~
| pfcount.c:126:1: waning: type specifier missing, defaults to 'int' [-Wimplicit-int]
| rptcounts()
| ^~~~~~~~~
| CC regid.lo
| regid.c:312:1: waning: type specifier missing, defaults to 'int' [-Wimplicit-int]
| regenable()
| ^~~~~~~~~
| regid.c:316:1: waning: type specifier missing, defaults to 'int' [-Wimplicit-int]
| regdisable()
| ^~~~~~~~~~
| CC checkfont.lo
| checkfont.c:155:8: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
| static check1prop(XFontStruct *fsp, XFontProp *fp, char *str);
| ~~~~~~ ^
| checkfont.c:451:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
| check1prop(fsp, fp, str)
| ^
| CC cursor.lo
| cursor.c:123:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
| curofwin(display, cursor, window)
| ^~~~~~~~
| cursor.c:133:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
| defcur(display, window)
| ^~~~~~
| cursor.c:165:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
| spriteiswin(display, window)
| ^~~~~~~~~~~
Signed-off-by: Cyril Brulebois <kibi@debian.org>
[aplattner@nvidia.com: Squashed a few similar commits]
Tested-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Diffstat (limited to 'xts5')
-rw-r--r-- | xts5/include/xtlibproto.h | 14 | ||||
-rw-r--r-- | xts5/src/lib/checkevent.c | 2 | ||||
-rw-r--r-- | xts5/src/lib/checkfont.c | 6 | ||||
-rw-r--r-- | xts5/src/lib/cursor.c | 6 | ||||
-rw-r--r-- | xts5/src/lib/devcntl.c | 22 | ||||
-rw-r--r-- | xts5/src/lib/pfcount.c | 4 | ||||
-rw-r--r-- | xts5/src/lib/regid.c | 4 |
7 files changed, 29 insertions, 29 deletions
diff --git a/xts5/include/xtlibproto.h b/xts5/include/xtlibproto.h index d2765195..fdfd443d 100644 --- a/xts5/include/xtlibproto.h +++ b/xts5/include/xtlibproto.h @@ -254,8 +254,8 @@ Pixmap nondepth1pixmap( Display *disp, Drawable d); void setfuncpixel(Display *disp, Drawable drw, int *xp, int *yp); void regid(Display *disp, union regtypes *id, int type); void freereg(void); -int regenable(void); -int regdisable(void); +void regenable(void); +void regdisable(void); void openfonts(Font fonts[], int nfonts); int checkfsp(XFontStruct *fsp, XFontStruct *good, char *str); void txtextents(XFontStruct *fsp, unsigned char *str, int n, int *dir, int *ascent, int *descent, XCharStruct *overall); @@ -321,8 +321,8 @@ void settimeout(int to); unsigned long cleartimeout(void); Region makeregion(void); int samehost(XHostAddress *h1, XHostAddress *h2); -int pfcount(int pass, int fail); -int rptcounts(void); +void pfcount(int pass, int fail); +void rptcounts(void); Status SimulateKeyPressEvent(Display *dpy, KeyCode keycode); Status SimulateKeyReleaseEvent(Display *dpy, KeyCode keycode); Status SimulateButtonPressEvent(Display *dpy, unsigned int button); @@ -341,10 +341,10 @@ void relbuttons(void); void relkeys(void); void relalldev(void); unsigned int wantmods(Display *disp, int want); -int modpress(Display *disp, unsigned int mask); -int modrel(Display *disp, unsigned int mask); +void modpress(Display *disp, unsigned int mask); +void modrel(Display *disp, unsigned int mask); int ismodkey(unsigned int mask, int kc); -int restoredevstate(void); +void restoredevstate(void); int noext(int needbutton); int nbuttons(void); int getkeycode(Display *display); diff --git a/xts5/src/lib/checkevent.c b/xts5/src/lib/checkevent.c index 3248ed84..40a0e609 100644 --- a/xts5/src/lib/checkevent.c +++ b/xts5/src/lib/checkevent.c @@ -661,7 +661,7 @@ char tempstr[50]; } #ifdef INPUTEXTENSION -check_ext_event(good,ev) +int check_ext_event(good,ev) XEvent *good, *ev; { int i; diff --git a/xts5/src/lib/checkfont.c b/xts5/src/lib/checkfont.c index f2c54985..e1c56246 100644 --- a/xts5/src/lib/checkfont.c +++ b/xts5/src/lib/checkfont.c @@ -152,11 +152,11 @@ int nfontinfo = NELEM(fontinfo); #ifdef __STDC__ static int checkprops(XFontStruct *fsp, XFontStruct *good, char *str); static XCharStruct *getmetric(XFontStruct *fsp, unsigned int c); -static check1prop(XFontStruct *fsp, XFontProp *fp, char *str); +static int check1prop(XFontStruct *fsp, XFontProp *fp, char *str); #else static int checkprops(); static XCharStruct *getmetric(); -static check1prop(); +static int check1prop(); #endif /* @@ -447,7 +447,7 @@ int pass = 0, fail = 0; /* * Check a single property */ -static +static int check1prop(fsp, fp, str) XFontStruct *fsp; XFontProp *fp; diff --git a/xts5/src/lib/cursor.c b/xts5/src/lib/cursor.c index 7cff8a64..e55390b1 100644 --- a/xts5/src/lib/cursor.c +++ b/xts5/src/lib/cursor.c @@ -120,7 +120,7 @@ purpose. It is provided "as is" without express or implied warranty. /* does this cursor match that of the window? */ -curofwin(display, cursor, window) +int curofwin(display, cursor, window) Display *display; Cursor cursor; Window window; @@ -130,7 +130,7 @@ Window window; /* has this window the default cursor? */ -defcur(display, window) +int defcur(display, window) Display *display; Window window; { @@ -162,7 +162,7 @@ Window window; /* is the current cursor the same as that of window? */ -spriteiswin(display, window) +int spriteiswin(display, window) Display *display; Window window; { diff --git a/xts5/src/lib/devcntl.c b/xts5/src/lib/devcntl.c index a7c99286..24d7815d 100644 --- a/xts5/src/lib/devcntl.c +++ b/xts5/src/lib/devcntl.c @@ -398,7 +398,7 @@ int i; keyind = 0; } #ifdef INPUTEXTENSION -devicerelkeys(dev) +void devicerelkeys(dev) XDevice *dev; { int i, id=dev->device_id; @@ -534,7 +534,7 @@ static void devmodthing(/* disp, dev, mask */); * function should be made of bits obtained by a previous call to wantmods, * to ensure that they have assigned keycodes. */ -modpress(disp, mask) +void modpress(disp, mask) Display *disp; unsigned int mask; { @@ -542,7 +542,7 @@ unsigned int mask; } #ifdef INPUTEXTENSION -devmodpress(disp, dev, mask) +void devmodpress(disp, dev, mask) Display *disp; XDevice *dev; unsigned int mask; @@ -556,7 +556,7 @@ unsigned int mask; * function should be made of bits obtained by a previous call to wantmods, * to ensure that they have assigned keycodes. */ -modrel(disp, mask) +void modrel(disp, mask) Display *disp; unsigned int mask; { @@ -564,7 +564,7 @@ unsigned int mask; } #ifdef INPUTEXTENSION -devmodrel(disp, dev, mask) +void devmodrel(disp, dev, mask) Display *disp; XDevice *dev; unsigned int mask; @@ -641,7 +641,7 @@ void (*func)(); * Check if a keycode corresponds to any of mods in a mask, returned by * wantmods. */ -ismodkey(mask, kc) +int ismodkey(mask, kc) unsigned int mask; int kc; { @@ -666,7 +666,7 @@ int mod; * This routine should be called at the end of a test after any of the * device press routines have been called. */ -restoredevstate() +void restoredevstate() { extern Display *Dsp; @@ -678,7 +678,7 @@ extern Display *Dsp; /* * Returns True if we don't want to do extended testing for any reason. */ -noext(needbutton) +int noext(needbutton) int needbutton; { @@ -700,7 +700,7 @@ int needbutton; /* * Returns the number of physical buttons. */ -nbuttons() +int nbuttons() { static int Nbuttons = -1; unsigned char pmap[5]; @@ -715,7 +715,7 @@ extern Display *Dsp; * Returns a valid keycode for the server. A different one is returned * every time (until it wraps round). */ -getkeycode(display) +int getkeycode(display) Display *display; { static int minkc, maxkc; @@ -738,7 +738,7 @@ static int curkey; * every time (until it wraps round). */ #ifdef INPUTEXTENSION -getdevkeycode(display,dev) +int getdevkeycode(display,dev) Display *display; XDevice *dev; { diff --git a/xts5/src/lib/pfcount.c b/xts5/src/lib/pfcount.c index c7f2343a..9e2e50cb 100644 --- a/xts5/src/lib/pfcount.c +++ b/xts5/src/lib/pfcount.c @@ -115,7 +115,7 @@ static int failcount; * use at all because there is no guarantee that pfcount is actually * called. */ -pfcount(pass, fail) +void pfcount(pass, fail) int pass; int fail; { @@ -123,7 +123,7 @@ int fail; failcount += failcount; } -rptcounts() +void rptcounts() { trace("passcount=%d, failcount=%d", passcount, failcount); } diff --git a/xts5/src/lib/regid.c b/xts5/src/lib/regid.c index dca60e6e..1b54f747 100644 --- a/xts5/src/lib/regid.c +++ b/xts5/src/lib/regid.c @@ -309,11 +309,11 @@ struct regid *rp; * Functions to enable and disable resource registration. After disabling * it then resources can be freed explicitly. */ -regenable() +void regenable() { Regenabled = 1; } -regdisable() +void regdisable() { Regenabled = 0; } |