Get rid of a few unused #defines in public header
authorKristian Høgsberg <krh@bitplanet.net>
Fri, 2 Jul 2010 16:26:43 +0000 (12:26 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Fri, 2 Jul 2010 18:21:59 +0000 (14:21 -0400)
include/X11/extensions/XKBcommon.h
src/xkbcomp/action.c
src/xkbcomp/compat.c

index f622fb8..495b629 100644 (file)
@@ -76,10 +76,9 @@ struct xkb_rule_names {
     char *  options;
 };
 
-#define XkbcAnyActionDataSize 18
 struct xkb_any_action {
     unsigned char   type;
-    unsigned char   pad[XkbcAnyActionDataSize];
+    unsigned char   pad[18];
 };
 
 struct xkb_mod_action {
@@ -371,8 +370,6 @@ struct xkb_bounds {
        short   x1,y1;
        short   x2,y2;
 };
-#define        XkbBoundsWidth(b)       (((b)->x2)-((b)->x1))
-#define        XkbBoundsHeight(b)      (((b)->y2)-((b)->y1))
 
 struct xkb_outline {
        unsigned short  num_points;
@@ -390,7 +387,6 @@ struct xkb_shape {
        struct xkb_outline *     primary;
        struct xkb_bounds        bounds;
 };
-#define        XkbOutlineIndex(s,o)    ((int)((o)-&(s)->outlines[0]))
 
 struct xkb_shape_doodad {
        uint32_t                 name;
index a384e20..2f37f90 100644 (file)
@@ -1200,7 +1200,7 @@ HandlePrivate(struct xkb_desc * xkb,
                     ACTION("Extra %d bytes ignored\n", len - 6);
                     return False;
                 }
-                strncpy((char *) action->pad, rtrn.str, XkbcAnyActionDataSize);
+                strncpy((char *) action->pad, rtrn.str, sizeof action->pad);
             }
             free(rtrn.str);
             return True;
@@ -1215,7 +1215,7 @@ HandlePrivate(struct xkb_desc * xkb,
                 return False;
             }
             ndx = rtrn.uval;
-            if (ndx >= XkbcAnyActionDataSize)
+            if (ndx >= sizeof action->pad)
             {
                 ERROR("The data for a private action is 18 bytes long\n");
                 ACTION("Attempt to use data[%d] ignored\n", ndx);
index 711d29d..de2c25b 100644 (file)
@@ -119,7 +119,7 @@ InitCompatInfo(CompatInfo * info, struct xkb_desc * xkb)
     info->dflt.interp.flags = 0;
     info->dflt.interp.virtual_mod = XkbNoModifier;
     info->dflt.interp.act.type = XkbSA_NoAction;
-    for (i = 0; i < XkbcAnyActionDataSize; i++)
+    for (i = 0; i < sizeof info->dflt.interp.act.pad; i++)
     {
         info->dflt.interp.act.pad[i] = 0;
     }
@@ -147,7 +147,7 @@ ClearCompatInfo(CompatInfo * info, struct xkb_desc * xkb)
     info->dflt.interp.flags = 0;
     info->dflt.interp.virtual_mod = XkbNoModifier;
     info->dflt.interp.act.type = XkbSA_NoAction;
-    for (i = 0; i < XkbcAnyActionDataSize; i++)
+    for (i = 0; i < sizeof info->dflt.interp.act.pad; i++)
     {
         info->dflt.interp.act.pad[i] = 0;
     }