Get rid of a few unused #defines in public header

master
Kristian Høgsberg 2010-07-02 12:26:43 -04:00
parent 97fbc348b0
commit b3805a2360
3 changed files with 5 additions and 9 deletions

View 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;

View 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);

View 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;
}