Get rid of a few unused #defines in public header
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
diff --git a/include/X11/extensions/XKBcommon.h b/include/X11/extensions/XKBcommon.h
index f622fb8..495b629 100644
--- a/include/X11/extensions/XKBcommon.h
+++ b/include/X11/extensions/XKBcommon.h
@@ -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;
diff --git a/src/xkbcomp/action.c b/src/xkbcomp/action.c
index a384e20..2f37f90 100644
--- a/src/xkbcomp/action.c
+++ b/src/xkbcomp/action.c
@@ -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);
diff --git a/src/xkbcomp/compat.c b/src/xkbcomp/compat.c
index 711d29d..de2c25b 100644
--- a/src/xkbcomp/compat.c
+++ b/src/xkbcomp/compat.c
@@ -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;
}