From: Kristian Høgsberg Date: Fri, 2 Jul 2010 16:26:43 +0000 (-0400) Subject: Get rid of a few unused #defines in public header X-Git-Tag: xkbcommon-0.2.0~847 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b3805a2360c9dd7c73333a91245762e66a38c2cb;p=platform%2Fupstream%2Flibxkbcommon.git Get rid of a few unused #defines in public header --- 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; }