[PATCH kbproto] Use vmods data type when accessing redirect key vmods

Dirk Wallenstein halsmit at t-online.de
Wed Feb 17 04:01:58 PST 2010


Usually vmods have the data type unsigned short, and the integer size is
not needed here. This makes storing the macro's result in an XkbModsRec
much more comfortable.

Signed-off-by: Dirk Wallenstein <halsmit at t-online.de>
---
 XKBstr.h |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/XKBstr.h b/XKBstr.h
index bc63f49..6752d25 100644
--- a/XKBstr.h
+++ b/XKBstr.h
@@ -214,12 +214,12 @@ typedef struct	_XkbRedirectKeyAction {
 	unsigned char	vmods1;
 } XkbRedirectKeyAction;
 
-#define	XkbSARedirectVMods(a)		((((unsigned int)(a)->vmods1)<<8)|\
-					((unsigned int)(a)->vmods0))
+#define	XkbSARedirectVMods(a)		((((unsigned short)(a)->vmods1)<<8)|\
+					((unsigned short)(a)->vmods0))
 #define	XkbSARedirectSetVMods(a,m)	(((a)->vmods_mask1=(((m)>>8)&0xff)),\
 					 ((a)->vmods_mask0=((m)&0xff)))
-#define	XkbSARedirectVModsMask(a)	((((unsigned int)(a)->vmods_mask1)<<8)|\
-					((unsigned int)(a)->vmods_mask0))
+#define	XkbSARedirectVModsMask(a)	((((unsigned short)(a)->vmods_mask1)<<8)|\
+					((unsigned short)(a)->vmods_mask0))
 #define	XkbSARedirectSetVModsMask(a,m)	(((a)->vmods_mask1=(((m)>>8)&0xff)),\
 					 ((a)->vmods_mask0=((m)&0xff)))
 
-- 
1.6.5.3



More information about the xorg-devel mailing list