[PATCH:xts 08/16] xts5: Fix missing type specifiers.

Cyril Brulebois kibi at debian.org
Wed May 25 04:00:17 PDT 2011


Use void when nothing is actually returned, use int otherwise.

The following warning go away accordingly:
|   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)
| ^~~~~~~~~~~~~

Also update the appropriate headers 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.

Signed-off-by: Cyril Brulebois <kibi at debian.org>
---
 xts5/include/xtlibproto.h |    6 +++---
 xts5/src/lib/devcntl.c    |   22 +++++++++++-----------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/xts5/include/xtlibproto.h b/xts5/include/xtlibproto.h
index d276519..59eb02d 100644
--- a/xts5/include/xtlibproto.h
+++ b/xts5/include/xtlibproto.h
@@ -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/devcntl.c b/xts5/src/lib/devcntl.c
index a7c9928..24d7815 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;
 {
-- 
1.7.5.1



More information about the xorg-devel mailing list