Drop CARD32 and Opaque types

master
Kristian Høgsberg 2010-06-28 06:50:12 -04:00
parent 2fb329c964
commit 47d3b3969b
28 changed files with 257 additions and 265 deletions

View File

@ -167,12 +167,12 @@ typedef struct _XkbcKeyType {
unsigned char map_count;
XkbcKTMapEntryPtr map;
XkbcModsPtr preserve;
CARD32 name;
CARD32 *level_names;
uint32_t name;
uint32_t *level_names;
} XkbcKeyTypeRec, *XkbcKeyTypePtr;
typedef struct _XkbcSymInterpretRec {
CARD32 sym;
uint32_t sym;
unsigned char flags;
unsigned char match;
uint8_t mods; /* XXX real or virt? */
@ -220,18 +220,18 @@ typedef struct _XkbcServerMapRec {
} XkbcServerMapRec, *XkbcServerMapPtr;
typedef struct _XkbcNamesRec {
CARD32 keycodes;
CARD32 geometry;
CARD32 symbols;
CARD32 types;
CARD32 compat;
CARD32 vmods[XkbNumVirtualMods];
CARD32 indicators[XkbNumIndicators];
CARD32 groups[XkbNumKbdGroups];
uint32_t keycodes;
uint32_t geometry;
uint32_t symbols;
uint32_t types;
uint32_t compat;
uint32_t vmods[XkbNumVirtualMods];
uint32_t indicators[XkbNumIndicators];
uint32_t groups[XkbNumKbdGroups];
XkbKeyNamePtr keys;
XkbKeyAliasPtr key_aliases;
CARD32 *radio_groups;
CARD32 phys_symbols;
uint32_t *radio_groups;
uint32_t phys_symbols;
unsigned char num_keys;
unsigned char num_key_aliases;
@ -268,7 +268,7 @@ typedef struct _XkbcOutline {
} XkbcOutlineRec, *XkbcOutlinePtr;
typedef struct _XkbcShape {
CARD32 name;
uint32_t name;
unsigned short num_outlines;
unsigned short sz_outlines;
XkbcOutlinePtr outlines;
@ -279,7 +279,7 @@ typedef struct _XkbcShape {
#define XkbOutlineIndex(s,o) ((int)((o)-&(s)->outlines[0]))
typedef struct _XkbcShapeDoodad {
CARD32 name;
uint32_t name;
unsigned char type;
unsigned char priority;
short top;
@ -294,7 +294,7 @@ typedef struct _XkbcShapeDoodad {
#define XkbSetShapeDoodadShape(g,d,s) ((d)->shape_ndx= (s)-&(g)->shapes[0])
typedef struct _XkbcTextDoodad {
CARD32 name;
uint32_t name;
unsigned char type;
unsigned char priority;
short top;
@ -310,7 +310,7 @@ typedef struct _XkbcTextDoodad {
#define XkbSetTextDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0])
typedef struct _XkbcIndicatorDoodad {
CARD32 name;
uint32_t name;
unsigned char type;
unsigned char priority;
short top;
@ -331,7 +331,7 @@ typedef struct _XkbcIndicatorDoodad {
((d)->shape_ndx= (s)-&(g)->shapes[0])
typedef struct _XkbcLogoDoodad {
CARD32 name;
uint32_t name;
unsigned char type;
unsigned char priority;
short top;
@ -347,7 +347,7 @@ typedef struct _XkbcLogoDoodad {
#define XkbSetLogoDoodadShape(g,d,s) ((d)->shape_ndx= (s)-&(g)->shapes[0])
typedef struct _XkbcAnyDoodad {
CARD32 name;
uint32_t name;
unsigned char type;
unsigned char priority;
short top;
@ -392,7 +392,7 @@ typedef struct _XkbRow {
} XkbcRowRec, *XkbcRowPtr;
typedef struct _XkbcSection {
CARD32 name;
uint32_t name;
unsigned char priority;
short top;
short left;
@ -424,7 +424,7 @@ typedef struct _XkbOverlayRow {
} XkbcOverlayRowRec, *XkbcOverlayRowPtr;
typedef struct _XkbOverlay {
CARD32 name;
uint32_t name;
XkbcSectionPtr section_under;
unsigned short num_rows;
unsigned short sz_rows;
@ -433,7 +433,7 @@ typedef struct _XkbOverlay {
} XkbcOverlayRec, *XkbcOverlayPtr;
typedef struct _XkbcGeometry {
CARD32 name;
uint32_t name;
unsigned short width_mm;
unsigned short height_mm;
char * label_font;
@ -541,17 +541,17 @@ XkbcCanonicaliseComponents(XkbComponentNamesPtr names,
* XkbcKeysymToString: if you need to preserve it, then you must
* duplicate it.
*
* This is CARD32 rather than KeySym, as KeySym changes size between
* This is uint32_t rather than KeySym, as KeySym changes size between
* client and server (no, really).
*/
extern char *
XkbcKeysymToString(CARD32 ks);
XkbcKeysymToString(uint32_t ks);
/*
* See XkbcKeysymToString comments: this function will accept any string
* from that function.
*/
extern CARD32
extern uint32_t
XkbcStringToKeysym(const char *s);
_XFUNCPROTOEND

View File

@ -136,7 +136,7 @@ XkbcAllocNames(XkbcDescPtr xkb, unsigned which, int nTotalRG, int nTotalAliases)
type = xkb->map->types;
for (i = 0; i < xkb->map->num_types; i++, type++) {
if (!type->level_names) {
type->level_names = _XkbTypedCalloc(type->num_levels, CARD32);
type->level_names = _XkbTypedCalloc(type->num_levels, uint32_t);
if (!type->level_names)
return BadAlloc;
}
@ -181,15 +181,15 @@ XkbcAllocNames(XkbcDescPtr xkb, unsigned which, int nTotalRG, int nTotalAliases)
if ((which & XkbRGNamesMask) && (nTotalRG > 0)) {
if (!names->radio_groups)
names->radio_groups = _XkbTypedCalloc(nTotalRG, CARD32);
names->radio_groups = _XkbTypedCalloc(nTotalRG, uint32_t);
else if (nTotalRG > names->num_rg) {
CARD32 *prev_radio_groups = names->radio_groups;
uint32_t *prev_radio_groups = names->radio_groups;
names->radio_groups = _XkbTypedRealloc(names->radio_groups,
nTotalRG, CARD32);
nTotalRG, uint32_t);
if (names->radio_groups)
_XkbClearElems(names->radio_groups, names->num_rg,
nTotalRG - 1, CARD32);
nTotalRG - 1, uint32_t);
else
_XkbFree(prev_radio_groups);
}

View File

@ -81,14 +81,14 @@ SOFTWARE.
typedef struct _Node {
struct _Node *left, *right;
CARD32 a;
uint32_t a;
unsigned int fingerPrint;
char *string;
} NodeRec, *NodePtr;
#define BAD_RESOURCE 0xe0000000
static CARD32 lastAtom = None;
static uint32_t lastAtom = None;
static NodePtr atomRoot = NULL;
static unsigned long tableLength;
static NodePtr *nodeTable = NULL;
@ -115,7 +115,7 @@ XkbcInitAtoms(InternAtomFuncPtr intern, GetAtomValueFuncPtr get_atom_value)
}
static const char *
_XkbcAtomGetString(CARD32 atom)
_XkbcAtomGetString(uint32_t atom)
{
NodePtr node;
@ -130,14 +130,14 @@ _XkbcAtomGetString(CARD32 atom)
}
char *
XkbcAtomGetString(CARD32 atom)
XkbcAtomGetString(uint32_t atom)
{
const char *ret = _XkbcAtomGetString(atom);
return ret ? strdup(ret) : NULL;
}
char *
XkbcAtomText(CARD32 atom)
XkbcAtomText(uint32_t atom)
{
const char *tmp;
char *ret;
@ -154,7 +154,7 @@ XkbcAtomText(CARD32 atom)
return ret;
}
static CARD32
static uint32_t
_XkbcMakeAtom(const char *string, unsigned len, Bool makeit)
{
NodePtr *np;
@ -228,7 +228,7 @@ _XkbcMakeAtom(const char *string, unsigned len, Bool makeit)
return None;
}
CARD32
uint32_t
XkbcInternAtom(const char *name, Bool onlyIfExists)
{
if (!name)

View File

@ -718,7 +718,7 @@ XkbcOutlinePtr outline;
}
XkbcShapePtr
XkbcAddGeomShape(XkbcGeometryPtr geom,CARD32 name,int sz_outlines)
XkbcAddGeomShape(XkbcGeometryPtr geom,uint32_t name,int sz_outlines)
{
XkbcShapePtr shape;
register int i;
@ -777,7 +777,7 @@ XkbcRowPtr row;
XkbcSectionPtr
XkbcAddGeomSection( XkbcGeometryPtr geom,
CARD32 name,
uint32_t name,
int sz_rows,
int sz_doodads,
int sz_over)
@ -816,7 +816,7 @@ XkbcSectionPtr section;
}
XkbcDoodadPtr
XkbcAddGeomDoodad(XkbcGeometryPtr geom,XkbcSectionPtr section,CARD32 name)
XkbcAddGeomDoodad(XkbcGeometryPtr geom,XkbcSectionPtr section,uint32_t name)
{
XkbcDoodadPtr old,doodad;
register int i,nDoodads;
@ -921,7 +921,7 @@ XkbcOverlayRowPtr row;
}
XkbcOverlayPtr
XkbcAddGeomOverlay(XkbcSectionPtr section,CARD32 name,int sz_rows)
XkbcAddGeomOverlay(XkbcSectionPtr section,uint32_t name,int sz_rows)
{
register int i;
XkbcOverlayPtr overlay;

View File

@ -38,7 +38,7 @@ authorization from the authors.
#include "ks_tables.h"
char *
XkbcKeysymToString(CARD32 ks)
XkbcKeysymToString(uint32_t ks)
{
int i, n, h, idx;
const unsigned char *entry;
@ -91,7 +91,7 @@ XkbcKeysymToString(CARD32 ks)
return ret;
}
CARD32
uint32_t
XkbcStringToKeysym(const char *s)
{
int i, n, h, c, idx;
@ -99,7 +99,7 @@ XkbcStringToKeysym(const char *s)
const char *p = s;
const unsigned char *entry;
unsigned char sig1, sig2;
CARD32 val;
uint32_t val;
while ((c = *p++))
sig = (sig << 1) + c;

View File

@ -268,11 +268,11 @@ XkbcCopyKeyType(XkbcKeyTypePtr from, XkbcKeyTypePtr into)
}
if (from->level_names && (into->num_levels > 0)) {
into->level_names = _XkbTypedCalloc(into->num_levels, CARD32);
into->level_names = _XkbTypedCalloc(into->num_levels, uint32_t);
if (!into->level_names)
return BadAlloc;
memcpy(into->level_names, from->level_names,
into->num_levels * sizeof(CARD32));
into->num_levels * sizeof(uint32_t));
}
return Success;
@ -362,10 +362,10 @@ XkbcResizeKeyType(XkbcDescPtr xkb, int type_ndx, int map_count,
}
if ((new_num_lvls > type->num_levels) || !type->level_names) {
CARD32 *prev_level_names = type->level_names;
uint32_t *prev_level_names = type->level_names;
type->level_names = _XkbTypedRealloc(type->level_names, new_num_lvls,
CARD32);
uint32_t);
if (!type->level_names) {
if (prev_level_names)
_XkbFree(prev_level_names);
@ -398,7 +398,7 @@ XkbcResizeKeyType(XkbcDescPtr xkb, int type_ndx, int map_count,
nMatchingKeys = 0;
if (new_num_lvls > type->num_levels) {
int nTotal;
CARD32 *newSyms;
uint32_t *newSyms;
int width, match, nResize = 0;
int i, g, nSyms;
@ -427,7 +427,7 @@ XkbcResizeKeyType(XkbcDescPtr xkb, int type_ndx, int map_count,
int nextMatch;
xkb->map->size_syms = (nTotal * 12) / 10;
newSyms = _XkbTypedCalloc(xkb->map->size_syms, CARD32);
newSyms = _XkbTypedCalloc(xkb->map->size_syms, uint32_t);
if (!newSyms)
return BadAlloc;
nextMatch = 0;
@ -435,20 +435,20 @@ XkbcResizeKeyType(XkbcDescPtr xkb, int type_ndx, int map_count,
for (i = xkb->min_key_code; i <= xkb->max_key_code; i++) {
if (matchingKeys[nextMatch] == i) {
CARD32 *pOld;
uint32_t *pOld;
nextMatch++;
width = XkbKeyGroupsWidth(xkb, i);
pOld = XkbKeySymsPtr(xkb, i);
for (g = XkbKeyNumGroups(xkb, i) - 1; g >= 0; g--)
memcpy(&newSyms[nSyms+(new_num_lvls * g)],
&pOld[width * g], width * sizeof(CARD32));
&pOld[width * g], width * sizeof(uint32_t));
xkb->map->key_sym_map[i].offset = nSyms;
nSyms += XkbKeyNumGroups(xkb, i) * new_num_lvls;
}
else {
memcpy(&newSyms[nSyms], XkbKeySymsPtr(xkb, i),
XkbKeyNumSyms(xkb, i) * sizeof(CARD32));
XkbKeyNumSyms(xkb, i) * sizeof(uint32_t));
xkb->map->key_sym_map[i].offset = nSyms;
nSyms += XkbKeyNumSyms(xkb,i);
}
@ -491,7 +491,7 @@ XkbcResizeKeyType(XkbcDescPtr xkb, int type_ndx, int map_count,
firstClear = new_num_lvls;
for (i = 0; i < nMatchingKeys; i++) {
CARD32 *pSyms;
uint32_t *pSyms;
int width, nClear;
key = matchingKeys[i];
@ -502,7 +502,7 @@ XkbcResizeKeyType(XkbcDescPtr xkb, int type_ndx, int map_count,
if (XkbKeyKeyTypeIndex(xkb, key, g) == type_ndx) {
if (nClear>0)
bzero(&pSyms[g * width + firstClear],
nClear * sizeof(CARD32));
nClear * sizeof(uint32_t));
}
}
}
@ -513,12 +513,12 @@ XkbcResizeKeyType(XkbcDescPtr xkb, int type_ndx, int map_count,
return Success;
}
CARD32 *
uint32_t *
XkbcResizeKeySyms(XkbcDescPtr xkb, int key, int needed)
{
int i, nSyms, nKeySyms;
unsigned nOldSyms;
CARD32 *newSyms;
uint32_t *newSyms;
if (needed == 0) {
xkb->map->key_sym_map[key].offset = 0;
@ -532,11 +532,11 @@ XkbcResizeKeySyms(XkbcDescPtr xkb, int key, int needed)
if (xkb->map->size_syms - xkb->map->num_syms >= (unsigned)needed) {
if (nOldSyms > 0)
memcpy(&xkb->map->syms[xkb->map->num_syms],
XkbKeySymsPtr(xkb, key), nOldSyms * sizeof(CARD32));
XkbKeySymsPtr(xkb, key), nOldSyms * sizeof(uint32_t));
if ((needed - nOldSyms) > 0)
bzero(&xkb->map->syms[xkb->map->num_syms + XkbKeyNumSyms(xkb, key)],
(needed - nOldSyms) * sizeof(CARD32));
(needed - nOldSyms) * sizeof(uint32_t));
xkb->map->key_sym_map[key].offset = xkb->map->num_syms;
xkb->map->num_syms += needed;
@ -545,7 +545,7 @@ XkbcResizeKeySyms(XkbcDescPtr xkb, int key, int needed)
}
xkb->map->size_syms += (needed > 32 ? needed : 32);
newSyms = _XkbTypedCalloc(xkb->map->size_syms, CARD32);
newSyms = _XkbTypedCalloc(xkb->map->size_syms, uint32_t);
if (!newSyms)
return NULL;
@ -562,9 +562,9 @@ XkbcResizeKeySyms(XkbcDescPtr xkb, int key, int needed)
nKeySyms = needed;
if (nCopy != 0)
memcpy(&newSyms[nSyms], XkbKeySymsPtr(xkb, i),
nCopy * sizeof(CARD32));
nCopy * sizeof(uint32_t));
if (nKeySyms > nCopy)
bzero(&newSyms[nSyms+nCopy], (nKeySyms - nCopy) * sizeof(CARD32));
bzero(&newSyms[nSyms+nCopy], (nKeySyms - nCopy) * sizeof(uint32_t));
xkb->map->key_sym_map[i].offset = nSyms;
nSyms += nKeySyms;

View File

@ -190,7 +190,7 @@ XkbcEnsureSafeMapName(char *name)
}
unsigned
_XkbcKSCheckCase(CARD32 ks)
_XkbcKSCheckCase(uint32_t ks)
{
unsigned set = (ks & (~0xff)) >> 8;
unsigned rtrn = 0;

View File

@ -60,7 +60,7 @@ char *
XkbcVModIndexText(XkbcDescPtr xkb, unsigned ndx)
{
int len;
CARD32 *vmodNames;
uint32_t *vmodNames;
char *rtrn, *tmp = NULL;
if (xkb && xkb->names)
@ -280,7 +280,7 @@ XkbcActionTypeText(unsigned type)
}
char *
XkbcKeysymText(CARD32 sym)
XkbcKeysymText(uint32_t sym)
{
return XkbcKeysymToString(sym);
}

View File

@ -82,7 +82,7 @@ extern int
XkbcResizeKeyType(XkbcDescPtr xkb, int type_ndx, int map_count,
Bool want_preserve, int new_num_lvls);
extern CARD32 *
extern uint32_t *
XkbcResizeKeySyms(XkbcDescPtr xkb, int key, int needed);
extern int

View File

@ -156,7 +156,7 @@ ExprResolveLhs(ExprDef * expr,
Bool
SimpleLookup(char * priv,
CARD32 elem, CARD32 field, unsigned type, ExprResult * val_rtrn)
uint32_t elem, uint32_t field, unsigned type, ExprResult * val_rtrn)
{
LookupEntry *entry;
register char *str;
@ -184,7 +184,7 @@ SimpleLookup(char * priv,
Bool
RadioLookup(char * priv,
CARD32 elem, CARD32 field, unsigned type, ExprResult * val_rtrn)
uint32_t elem, uint32_t field, unsigned type, ExprResult * val_rtrn)
{
register char *str;
int rg;
@ -212,7 +212,7 @@ RadioLookup(char * priv,
int
TableLookup(char * priv,
CARD32 elem, CARD32 field, unsigned type, ExprResult * val_rtrn)
uint32_t elem, uint32_t field, unsigned type, ExprResult * val_rtrn)
{
LookupTable *tbl = (LookupTable *) priv;
register char *str;
@ -233,7 +233,7 @@ TableLookup(char * priv,
if (tbl == NULL) /* didn't find a matching element */
return False;
priv = (char *) tbl->entries;
return SimpleLookup(priv, (CARD32) None, field, type, val_rtrn);
return SimpleLookup(priv, (uint32_t) None, field, type, val_rtrn);
}
static LookupEntry modIndexNames[] = {
@ -251,7 +251,7 @@ static LookupEntry modIndexNames[] = {
int
LookupModIndex(char * priv,
CARD32 elem, CARD32 field, unsigned type, ExprResult * val_rtrn)
uint32_t elem, uint32_t field, unsigned type, ExprResult * val_rtrn)
{
return SimpleLookup((char *) modIndexNames, elem, field, type,
val_rtrn);
@ -259,7 +259,7 @@ LookupModIndex(char * priv,
int
LookupModMask(char * priv,
CARD32 elem, CARD32 field, unsigned type, ExprResult * val_rtrn)
uint32_t elem, uint32_t field, unsigned type, ExprResult * val_rtrn)
{
char *str;
Bool ret = True;
@ -317,7 +317,7 @@ ExprResolveModIndex(ExprDef * expr,
val_rtrn->ival = expr->value.ival;
return True;
case ExprIdent:
if (LookupModIndex(lookupPriv, (CARD32) None, expr->value.str,
if (LookupModIndex(lookupPriv, (uint32_t) None, expr->value.str,
(unsigned) TypeInt, val_rtrn))
{
return True;
@ -915,7 +915,7 @@ ExprResolveEnum(ExprDef * expr, ExprResult * val_rtrn, LookupEntry * values)
exprOpText(expr->op));
return False;
}
if (!SimpleLookup((char *) values, (CARD32) None, expr->value.str,
if (!SimpleLookup((char *) values, (uint32_t) None, expr->value.str,
(unsigned) TypeInt, val_rtrn))
{
int nOut = 0;
@ -1049,7 +1049,7 @@ ExprResolveKeySym(ExprDef * expr,
IdentLookupFunc lookup, char * lookupPriv)
{
int ok = 0;
CARD32 sym;
uint32_t sym;
if (expr->op == ExprIdent)
{

View File

@ -36,8 +36,8 @@ typedef union _ExprResult
} ExprResult;
typedef Bool(*IdentLookupFunc) (char * /* priv */ ,
CARD32 /* elem */ ,
CARD32 /* field */ ,
uint32_t /* elem */ ,
uint32_t /* field */ ,
unsigned /* type */ ,
ExprResult * /* val_rtrn */
);
@ -76,36 +76,36 @@ extern char *exprOpText(unsigned /* type */
);
extern int RadioLookup(char * /* priv */ ,
CARD32 /* elem */ ,
CARD32 /* field */ ,
uint32_t /* elem */ ,
uint32_t /* field */ ,
unsigned /* type */ ,
ExprResult * /* val_rtrn */
);
extern int SimpleLookup(char * /* priv */ ,
CARD32 /* elem */ ,
CARD32 /* field */ ,
uint32_t /* elem */ ,
uint32_t /* field */ ,
unsigned /* type */ ,
ExprResult * /* val_rtrn */
);
extern int TableLookup(char * /* priv */ ,
CARD32 /* elem */ ,
CARD32 /* field */ ,
uint32_t /* elem */ ,
uint32_t /* field */ ,
unsigned /* type */ ,
ExprResult * /* val_rtrn */
);
extern int LookupModIndex(char * /* priv */ ,
CARD32 /* elem */ ,
CARD32 /* field */ ,
uint32_t /* elem */ ,
uint32_t /* field */ ,
unsigned /* type */ ,
ExprResult * /* val_rtrn */
);
extern int LookupModMask(char * /* priv */ ,
CARD32 /* elem */ ,
CARD32 /* field */ ,
uint32_t /* elem */ ,
uint32_t /* field */ ,
unsigned /* type */ ,
ExprResult * /* val_rtrn */
);

View File

@ -58,7 +58,7 @@ typedef struct _PropertyInfo
typedef struct _ShapeInfo
{
CommonInfo defs;
CARD32 name;
uint32_t name;
short index;
unsigned short nOutlines;
unsigned short szOutlines;
@ -97,7 +97,7 @@ typedef struct _ShapeInfo
typedef struct _DoodadInfo
{
CommonInfo defs;
CARD32 name;
uint32_t name;
unsigned char type;
unsigned char priority;
short top;
@ -106,18 +106,18 @@ typedef struct _DoodadInfo
unsigned short corner;
unsigned short width;
unsigned short height;
CARD32 shape;
CARD32 color;
CARD32 offColor;
CARD32 text;
CARD32 font;
CARD32 fontSlant;
CARD32 fontWeight;
CARD32 fontSetWidth;
CARD32 fontVariant;
uint32_t shape;
uint32_t color;
uint32_t offColor;
uint32_t text;
uint32_t font;
uint32_t fontSlant;
uint32_t fontWeight;
uint32_t fontSetWidth;
uint32_t fontVariant;
unsigned short fontSize;
CARD32 fontEncoding;
CARD32 fontSpec;
uint32_t fontEncoding;
uint32_t fontSpec;
char *logoName;
struct _SectionInfo *section;
} DoodadInfo;
@ -137,8 +137,8 @@ typedef struct _KeyInfo
char name[8];
short gap;
short index;
CARD32 shape;
CARD32 color;
uint32_t shape;
uint32_t color;
struct _RowInfo *row;
} KeyInfo;
#define keyText(k) ((k)&&(k)->name[0]?(k)->name:"default")
@ -175,7 +175,7 @@ typedef struct _OverlayKeyInfo
typedef struct _OverlayInfo
{
CommonInfo defs;
CARD32 name;
uint32_t name;
unsigned short nRows;
unsigned short nKeys;
OverlayKeyInfo *keys;
@ -195,7 +195,7 @@ typedef struct _OverlayInfo
typedef struct _SectionInfo
{
CommonInfo defs;
CARD32 name;
uint32_t name;
unsigned short top;
unsigned short left;
unsigned short width;
@ -233,16 +233,16 @@ typedef struct _GeometryInfo
DoodadInfo *doodads;
int widthMM;
int heightMM;
CARD32 font;
CARD32 fontSlant;
CARD32 fontWeight;
CARD32 fontSetWidth;
CARD32 fontVariant;
uint32_t font;
uint32_t fontSlant;
uint32_t fontWeight;
uint32_t fontSetWidth;
uint32_t fontVariant;
unsigned fontSize;
CARD32 fontEncoding;
CARD32 fontSpec;
CARD32 baseColor;
CARD32 labelColor;
uint32_t fontEncoding;
uint32_t fontSpec;
uint32_t baseColor;
uint32_t labelColor;
int dfltCornerRadius;
SectionInfo dfltSection;
DoodadInfo *dfltDoodads;
@ -428,7 +428,7 @@ FindDoodadByType(DoodadInfo * di, unsigned type)
}
static DoodadInfo *
FindDoodadByName(DoodadInfo * di, CARD32 name)
FindDoodadByName(DoodadInfo * di, uint32_t name)
{
while (di)
{
@ -794,7 +794,7 @@ NextShape(GeometryInfo * info)
}
static ShapeInfo *
FindShape(GeometryInfo * info, CARD32 name, const char *type, const char *which)
FindShape(GeometryInfo * info, uint32_t name, const char *type, const char *which)
{
ShapeInfo *old;
@ -1510,7 +1510,7 @@ SetTextDoodadField(DoodadInfo * di,
char *typeName = "text doodad";
union
{
CARD32 *str;
uint32_t *str;
short *ival;
unsigned short *uval;
} pField;
@ -2118,7 +2118,7 @@ HandleGeometryVar(VarDef * stmt, XkbcDescPtr xkb, GeometryInfo * info)
ExprResult elem, field, tmp;
ExprDef *ndx;
DoodadInfo *di;
CARD32 *pField = NULL;
uint32_t *pField = NULL;
int ret;
if (ExprResolveLhs(stmt->name, &elem, &field, &ndx) == 0)
@ -2928,7 +2928,7 @@ CopyShapeDef(XkbcGeometryPtr geom, ShapeInfo * si)
register int i, n;
XkbcShapePtr shape;
XkbcOutlinePtr old_outline, outline;
CARD32 name;
uint32_t name;
si->index = geom->num_shapes;
name = si->name;
@ -3255,10 +3255,10 @@ VerifyDoodadInfo(DoodadInfo * di, GeometryInfo * info)
#define FONT_TEMPLATE "-*-%s-%s-%s-%s-%s-*-%d-*-*-*-*-%s"
static char *
FontFromParts(CARD32 fontTok,
CARD32 weightTok,
CARD32 slantTok,
CARD32 setWidthTok, CARD32 varTok, int size, CARD32 encodingTok)
FontFromParts(uint32_t fontTok,
uint32_t weightTok,
uint32_t slantTok,
uint32_t setWidthTok, uint32_t varTok, int size, uint32_t encodingTok)
{
int totalSize;
char *font, *weight, *slant, *setWidth, *variant, *encoding;
@ -3288,7 +3288,7 @@ static Bool
CopyDoodadDef(XkbcGeometryPtr geom,
XkbcSectionPtr section, DoodadInfo * di, GeometryInfo * info)
{
CARD32 name;
uint32_t name;
XkbcDoodadPtr doodad;
XkbcColorPtr color;
XkbcShapePtr shape;
@ -3473,7 +3473,7 @@ static Bool
CopyOverlayDef(XkbcGeometryPtr geom,
XkbcSectionPtr section, OverlayInfo * oi, GeometryInfo * info)
{
CARD32 name;
uint32_t name;
XkbcOverlayPtr ol;
XkbcOverlayRowPtr row;
XkbcOverlayKeyPtr key;

View File

@ -513,7 +513,7 @@ BindIndicators(XkbcDescPtr xkb, Bool force, LEDInfo *unbound,
if ((xkb->names != NULL) &&
(xkb->names->indicators[led->indicator - 1] != led->name))
{
CARD32 old = xkb->names->indicators[led->indicator - 1];
uint32_t old = xkb->names->indicators[led->indicator - 1];
ERROR("Multiple names bound to indicator %d\n",
(unsigned int) led->indicator);
ACTION("Using %s, ignoring %s\n",

View File

@ -40,7 +40,7 @@
typedef struct _LEDInfo
{
CommonInfo defs;
CARD32 name;
uint32_t name;
unsigned char indicator;
unsigned char flags;
unsigned char which_mods;

View File

@ -60,7 +60,7 @@ typedef struct _IndicatorNameInfo
{
CommonInfo defs;
int ndx;
CARD32 name;
uint32_t name;
Bool virtual;
} IndicatorNameInfo;
@ -142,7 +142,7 @@ FindIndicatorByIndex(KeyNamesInfo * info, int ndx)
}
static IndicatorNameInfo *
FindIndicatorByName(KeyNamesInfo * info, CARD32 name)
FindIndicatorByName(KeyNamesInfo * info, uint32_t name)
{
IndicatorNameInfo *old;
@ -227,7 +227,7 @@ AddIndicatorName(KeyNamesInfo * info, IndicatorNameInfo * new)
else
{
const char *oldType, *newType;
CARD32 using, ignoring;
uint32_t using, ignoring;
if (old->virtual)
oldType = "virtual indicator";
else

View File

@ -52,7 +52,7 @@ typedef struct _PreserveInfo
typedef struct _KeyTypeInfo
{
CommonInfo defs;
CARD32 name;
uint32_t name;
int fileID;
unsigned mask;
unsigned vmask;
@ -63,7 +63,7 @@ typedef struct _KeyTypeInfo
XkbcKTMapEntryPtr entries;
PreserveInfo *preserve;
int szNames;
CARD32 *lvlNames;
uint32_t *lvlNames;
} KeyTypeInfo;
typedef struct _KeyTypesInfo
@ -78,10 +78,10 @@ typedef struct _KeyTypesInfo
VModInfo vmods;
} KeyTypesInfo;
CARD32 tok_ONE_LEVEL;
CARD32 tok_TWO_LEVEL;
CARD32 tok_ALPHABETIC;
CARD32 tok_KEYPAD;
uint32_t tok_ONE_LEVEL;
uint32_t tok_TWO_LEVEL;
uint32_t tok_ALPHABETIC;
uint32_t tok_KEYPAD;
/***====================================================================***/
@ -108,7 +108,7 @@ extern Bool AddPreserve(XkbcDescPtr /* xkb */ ,
extern Bool AddLevelName(KeyTypeInfo * /* type */ ,
unsigned /* level */ ,
CARD32 /* name */ ,
uint32_t /* name */ ,
Bool /* clobber */ ,
Bool /* report */
);
@ -168,10 +168,10 @@ InitKeyTypesInfo(KeyTypesInfo * info, XkbcDescPtr xkb, KeyTypesInfo * from)
}
if (from->dflt.lvlNames)
{
info->dflt.lvlNames = uTypedCalloc(from->dflt.szNames, CARD32);
info->dflt.lvlNames = uTypedCalloc(from->dflt.szNames, uint32_t);
if (info->dflt.lvlNames)
{
register unsigned sz = from->dflt.szNames * sizeof(CARD32);
register unsigned sz = from->dflt.szNames * sizeof(uint32_t);
memcpy(info->dflt.lvlNames, from->dflt.lvlNames, sz);
}
}
@ -783,12 +783,12 @@ SetPreserve(KeyTypeInfo * type,
Bool
AddLevelName(KeyTypeInfo * type,
unsigned level, CARD32 name, Bool clobber, Bool report)
unsigned level, uint32_t name, Bool clobber, Bool report)
{
if ((type->lvlNames == NULL) || (type->szNames <= level))
{
type->lvlNames =
uTypedRecalloc(type->lvlNames, type->szNames, level + 1, CARD32);
uTypedRecalloc(type->lvlNames, type->szNames, level + 1, uint32_t);
if (type->lvlNames == NULL)
{
ERROR("Couldn't allocate level names for type %s\n",
@ -837,7 +837,7 @@ SetLevelName(KeyTypeInfo * type, ExprDef * arrayNdx, ExprDef * value)
{
ExprResult rtrn;
unsigned level;
CARD32 level_name;
uint32_t level_name;
if (arrayNdx == NULL)
return ReportTypeShouldBeArray(type, "level name");
@ -1177,15 +1177,15 @@ CopyDefToKeyType(XkbcDescPtr xkb, XkbcKeyTypePtr type, KeyTypeInfo * def)
}
else
type->preserve = NULL;
type->name = (CARD32) def->name;
type->name = (uint32_t) def->name;
if (def->szNames > 0)
{
type->level_names = uTypedCalloc(def->numLevels, CARD32);
type->level_names = uTypedCalloc(def->numLevels, uint32_t);
/* assert def->szNames<=def->numLevels */
for (i = 0; i < def->szNames; i++)
{
type->level_names[i] = (CARD32) def->lvlNames[i];
type->level_names[i] = (uint32_t) def->lvlNames[i];
}
}
else

View File

@ -256,8 +256,8 @@ AddCommonInfo(CommonInfo * old, CommonInfo * new)
typedef struct _KeyNameDesc
{
CARD32 level1;
CARD32 level2;
uint32_t level1;
uint32_t level2;
char name[5];
Bool used;
} KeyNameDesc;

View File

@ -166,7 +166,7 @@ KeyAliasCreate(char *alias, char *real)
}
VModDef *
VModCreate(CARD32 name, ExprDef * value)
VModCreate(uint32_t name, ExprDef * value)
{
VModDef *def;
def = uTypedAlloc(VModDef);
@ -206,7 +206,7 @@ VarCreate(ExprDef * name, ExprDef * value)
}
VarDef *
BoolVarCreate(CARD32 nameToken, unsigned set)
BoolVarCreate(uint32_t nameToken, unsigned set)
{
ExprDef *name, *value;
@ -239,7 +239,7 @@ InterpCreate(char *sym, ExprDef * match)
}
KeyTypeDef *
KeyTypeCreate(CARD32 name, VarDef * body)
KeyTypeCreate(uint32_t name, VarDef * body)
{
KeyTypeDef *def;
@ -306,7 +306,7 @@ GroupCompatCreate(int group, ExprDef * val)
}
ModMapDef *
ModMapCreate(CARD32 modifier, ExprDef * keys)
ModMapCreate(uint32_t modifier, ExprDef * keys)
{
ModMapDef *def;
@ -328,7 +328,7 @@ ModMapCreate(CARD32 modifier, ExprDef * keys)
}
IndicatorMapDef *
IndicatorMapCreate(CARD32 name, VarDef * body)
IndicatorMapCreate(uint32_t name, VarDef * body)
{
IndicatorMapDef *def;
@ -373,7 +373,7 @@ IndicatorNameCreate(int ndx, ExprDef * name, Bool virtual)
}
ExprDef *
ActionCreate(CARD32 name, ExprDef * args)
ActionCreate(uint32_t name, ExprDef * args)
{
ExprDef *act;
@ -413,7 +413,7 @@ CreateKeysymList(char *sym)
}
ShapeDef *
ShapeDeclCreate(CARD32 name, OutlineDef * outlines)
ShapeDeclCreate(uint32_t name, OutlineDef * outlines)
{
ShapeDef *shape;
OutlineDef *ol;
@ -438,7 +438,7 @@ ShapeDeclCreate(CARD32 name, OutlineDef * outlines)
}
OutlineDef *
OutlineCreate(CARD32 field, ExprDef * points)
OutlineCreate(uint32_t field, ExprDef * points)
{
OutlineDef *outline;
ExprDef *pt;
@ -516,7 +516,7 @@ RowDeclCreate(KeyDef * keys)
}
SectionDef *
SectionDeclCreate(CARD32 name, RowDef * rows)
SectionDeclCreate(uint32_t name, RowDef * rows)
{
SectionDef *section;
RowDef *row;
@ -560,7 +560,7 @@ OverlayKeyCreate(char *under, char *over)
}
OverlayDef *
OverlayDeclCreate(CARD32 name, OverlayKeyDef * keys)
OverlayDeclCreate(uint32_t name, OverlayKeyDef * keys)
{
OverlayDef *ol;
OverlayKeyDef *key;
@ -582,7 +582,7 @@ OverlayDeclCreate(CARD32 name, OverlayKeyDef * keys)
}
DoodadDef *
DoodadCreate(unsigned type, CARD32 name, VarDef * body)
DoodadCreate(unsigned type, uint32_t name, VarDef * body)
{
DoodadDef *doodad;
@ -620,9 +620,9 @@ AppendKeysymList(ExprDef * list, char *sym)
}
int
LookupKeysym(char *str, CARD32 * sym_rtrn)
LookupKeysym(char *str, uint32_t * sym_rtrn)
{
CARD32 sym;
uint32_t sym;
if ((!str) || (uStrCaseCmp(str, "any") == 0)
|| (uStrCaseCmp(str, "nosymbol") == 0))

View File

@ -76,7 +76,7 @@ extern KeyAliasDef *KeyAliasCreate(char * /* alias */ ,
char * /* real */
);
extern VModDef *VModCreate(CARD32 /* name */ ,
extern VModDef *VModCreate(uint32_t /* name */ ,
ExprDef * /* value */
);
@ -84,7 +84,7 @@ extern VarDef *VarCreate(ExprDef * /* name */ ,
ExprDef * /* value */
);
extern VarDef *BoolVarCreate(CARD32 /* nameToken */ ,
extern VarDef *BoolVarCreate(uint32_t /* nameToken */ ,
unsigned /* set */
);
@ -92,7 +92,7 @@ extern InterpDef *InterpCreate(char * /* sym */ ,
ExprDef * /* match */
);
extern KeyTypeDef *KeyTypeCreate(CARD32 /* name */ ,
extern KeyTypeDef *KeyTypeCreate(uint32_t /* name */ ,
VarDef * /* body */
);
@ -104,11 +104,11 @@ extern GroupCompatDef *GroupCompatCreate(int /* group */ ,
ExprDef * /* def */
);
extern ModMapDef *ModMapCreate(CARD32 /* modifier */ ,
extern ModMapDef *ModMapCreate(uint32_t /* modifier */ ,
ExprDef * /* keys */
);
extern IndicatorMapDef *IndicatorMapCreate(CARD32 /* name */ ,
extern IndicatorMapDef *IndicatorMapCreate(uint32_t /* name */ ,
VarDef * /* body */
);
@ -117,18 +117,18 @@ extern IndicatorNameDef *IndicatorNameCreate(int /* ndx */ ,
Bool /* virtual */
);
extern ExprDef *ActionCreate(CARD32 /* name */ ,
extern ExprDef *ActionCreate(uint32_t /* name */ ,
ExprDef * /* args */
);
extern ExprDef *CreateKeysymList(char * /* sym */
);
extern ShapeDef *ShapeDeclCreate(CARD32 /* name */ ,
extern ShapeDef *ShapeDeclCreate(uint32_t /* name */ ,
OutlineDef * /* outlines */
);
extern OutlineDef *OutlineCreate(CARD32 /* field */ ,
extern OutlineDef *OutlineCreate(uint32_t /* field */ ,
ExprDef * /* points */
);
@ -143,7 +143,7 @@ extern KeyDef *KeyDeclMerge(KeyDef * /* into */ ,
extern RowDef *RowDeclCreate(KeyDef * /* keys */
);
extern SectionDef *SectionDeclCreate(CARD32 /* name */ ,
extern SectionDef *SectionDeclCreate(uint32_t /* name */ ,
RowDef * /* rows */
);
@ -151,12 +151,12 @@ extern OverlayKeyDef *OverlayKeyCreate(char * /* under */ ,
char * /* over */
);
extern OverlayDef *OverlayDeclCreate(CARD32 /* name */ ,
extern OverlayDef *OverlayDeclCreate(uint32_t /* name */ ,
OverlayKeyDef * /* rows */
);
extern DoodadDef *DoodadCreate(unsigned /* type */ ,
CARD32 /* name */ ,
uint32_t /* name */ ,
VarDef * /* body */
);
@ -165,7 +165,7 @@ extern ExprDef *AppendKeysymList(ExprDef * /* list */ ,
);
extern int LookupKeysym(char * /* str */ ,
CARD32 * /* sym_rtrn */
uint32_t * /* sym_rtrn */
);
extern IncludeStmt *IncludeCreate(char * /* str */ ,

View File

@ -42,9 +42,9 @@
#include "misc.h"
#include "alias.h"
extern CARD32 tok_ONE_LEVEL;
extern CARD32 tok_TWO_LEVEL;
extern CARD32 tok_KEYPAD;
extern uint32_t tok_ONE_LEVEL;
extern uint32_t tok_TWO_LEVEL;
extern uint32_t tok_KEYPAD;
/***====================================================================***/
@ -70,15 +70,15 @@ typedef struct _KeyInfo
unsigned char symsDefined;
unsigned char actsDefined;
short numLevels[XkbNumKbdGroups];
CARD32 *syms[XkbNumKbdGroups];
uint32_t *syms[XkbNumKbdGroups];
XkbcAction *acts[XkbNumKbdGroups];
CARD32 types[XkbNumKbdGroups];
uint32_t types[XkbNumKbdGroups];
unsigned repeat;
XkbBehavior behavior;
unsigned short vmodmap;
unsigned long nameForOverlayKey;
unsigned long allowNone;
CARD32 dfltType;
uint32_t dfltType;
} KeyInfo;
/**
@ -178,7 +178,7 @@ CopyKeyInfo(KeyInfo * old, KeyInfo * new, Bool clearOld)
width = new->numLevels[i];
if (old->syms[i] != NULL)
{
new->syms[i] = uTypedCalloc(width, CARD32);
new->syms[i] = uTypedCalloc(width, uint32_t);
if (!new->syms[i])
{
new->syms[i] = NULL;
@ -186,7 +186,7 @@ CopyKeyInfo(KeyInfo * old, KeyInfo * new, Bool clearOld)
return False;
}
memcpy((char *) new->syms[i], (char *) old->syms[i],
width * sizeof(CARD32));
width * sizeof(uint32_t));
}
if (old->acts[i] != NULL)
{
@ -214,7 +214,7 @@ typedef struct _ModMapEntry
union
{
unsigned long keyName;
CARD32 keySym;
uint32_t keySym;
} u;
} ModMapEntry;
@ -234,7 +234,7 @@ typedef struct _SymbolsInfo
KeyInfo dflt;
VModInfo vmods;
ActionInfo *action;
CARD32 groupNames[XkbNumKbdGroups];
uint32_t groupNames[XkbNumKbdGroups];
ModMapEntry *modMap;
AliasInfo *aliases;
@ -315,7 +315,7 @@ ResizeKeyGroup(KeyInfo * key,
{
key->syms[group] = uTypedRecalloc(key->syms[group],
key->numLevels[group], newWidth,
CARD32);
uint32_t);
if (!key->syms[group])
return False;
}
@ -336,7 +336,7 @@ static Bool
MergeKeyGroups(SymbolsInfo * info,
KeyInfo * into, KeyInfo * from, unsigned group)
{
CARD32 *resultSyms;
uint32_t *resultSyms;
XkbcAction *resultActs;
int resultWidth;
register int i;
@ -359,7 +359,7 @@ MergeKeyGroups(SymbolsInfo * info,
}
if (resultSyms == NULL)
{
resultSyms = uTypedCalloc(resultWidth, CARD32);
resultSyms = uTypedCalloc(resultWidth, uint32_t);
if (!resultSyms)
{
WSGO("Could not allocate symbols for group merge\n");
@ -381,7 +381,7 @@ MergeKeyGroups(SymbolsInfo * info,
}
for (i = 0; i < resultWidth; i++)
{
CARD32 fromSym, toSym;
uint32_t fromSym, toSym;
if (from->syms[group] && (i < from->numLevels[group]))
fromSym = from->syms[group][i];
else
@ -396,7 +396,7 @@ MergeKeyGroups(SymbolsInfo * info,
resultSyms[i] = fromSym;
else
{
CARD32 use, ignore;
uint32_t use, ignore;
if (clobber)
{
use = fromSym;
@ -540,7 +540,7 @@ MergeKeys(SymbolsInfo * info, KeyInfo * into, KeyInfo * from)
if ((into->types[i] != None) && (report) &&
(into->types[i] != from->types[i]))
{
CARD32 use, ignore;
uint32_t use, ignore;
collide |= _Key_Types;
if (from->defs.merge != MergeAugment)
{
@ -1565,11 +1565,11 @@ SetExplicitGroup(SymbolsInfo * info, KeyInfo * key)
key->numLevels[i] = 0;
if (key->syms[i] != NULL)
uFree(key->syms[i]);
key->syms[i] = (CARD32 *) NULL;
key->syms[i] = (uint32_t *) NULL;
if (key->acts[i] != NULL)
uFree(key->acts[i]);
key->acts[i] = (XkbcAction *) NULL;
key->types[i] = (CARD32) 0;
key->types[i] = (uint32_t) 0;
}
}
key->typesDefined = key->symsDefined = key->actsDefined = 1 << group;
@ -1577,11 +1577,11 @@ SetExplicitGroup(SymbolsInfo * info, KeyInfo * key)
key->numLevels[group] = key->numLevels[0];
key->numLevels[0] = 0;
key->syms[group] = key->syms[0];
key->syms[0] = (CARD32 *) NULL;
key->syms[0] = (uint32_t *) NULL;
key->acts[group] = key->acts[0];
key->acts[0] = (XkbcAction *) NULL;
key->types[group] = key->types[0];
key->types[0] = (CARD32) 0;
key->types[0] = (uint32_t) 0;
return True;
}
@ -1720,7 +1720,7 @@ HandleSymbolsFile(XkbFile * file,
}
static Bool
FindKeyForSymbol(XkbcDescPtr xkb, CARD32 sym, unsigned int *kc_rtrn)
FindKeyForSymbol(XkbcDescPtr xkb, uint32_t sym, unsigned int *kc_rtrn)
{
register int i, j;
register Bool gotOne;
@ -1756,7 +1756,7 @@ FindKeyForSymbol(XkbcDescPtr xkb, CARD32 sym, unsigned int *kc_rtrn)
* @return True if found, False otherwise.
*/
static Bool
FindNamedType(XkbcDescPtr xkb, CARD32 name, unsigned *type_rtrn)
FindNamedType(XkbcDescPtr xkb, uint32_t name, unsigned *type_rtrn)
{
register unsigned n;
@ -1764,7 +1764,7 @@ FindNamedType(XkbcDescPtr xkb, CARD32 name, unsigned *type_rtrn)
{
for (n = 0; n < xkb->map->num_types; n++)
{
if (xkb->map->types[n].name == (CARD32) name)
if (xkb->map->types[n].name == (uint32_t) name)
{
*type_rtrn = n;
return True;
@ -1791,7 +1791,7 @@ FindNamedType(XkbcDescPtr xkb, CARD32 name, unsigned *type_rtrn)
* @returns True if a type could be found, False otherwise.
*/
static Bool
FindAutomaticType(int width, CARD32 * syms, CARD32 * typeNameRtrn,
FindAutomaticType(int width, uint32_t * syms, uint32_t * typeNameRtrn,
Bool * autoType)
{
*autoType = False;
@ -1885,11 +1885,11 @@ PrepareKeyDef(KeyInfo * key)
}
if ((key->symsDefined & 1) && key->syms[0])
{
key->syms[i] = uTypedCalloc(width, CARD32);
key->syms[i] = uTypedCalloc(width, uint32_t);
if (key->syms[i] == NULL)
continue;
memcpy((void *) key->syms[i], (void *) key->syms[0],
width * sizeof(CARD32));
width * sizeof(uint32_t));
key->symsDefined |= 1 << i;
}
if (defined & 1)
@ -1911,7 +1911,7 @@ PrepareKeyDef(KeyInfo * key)
if ((key->syms[i] != key->syms[0]) &&
(key->syms[i] == NULL || key->syms[0] == NULL ||
memcmp((void *) key->syms[i], (void *) key->syms[0],
sizeof(CARD32) * key->numLevels[0])))
sizeof(uint32_t) * key->numLevels[0])))
{
identical = False;
break;
@ -1932,11 +1932,11 @@ PrepareKeyDef(KeyInfo * key)
key->numLevels[i] = 0;
if (key->syms[i] != NULL)
uFree(key->syms[i]);
key->syms[i] = (CARD32 *) NULL;
key->syms[i] = (uint32_t *) NULL;
if (key->acts[i] != NULL)
uFree(key->acts[i]);
key->acts[i] = (XkbcAction *) NULL;
key->types[i] = (CARD32) 0;
key->types[i] = (uint32_t) 0;
}
key->symsDefined &= 1;
key->actsDefined &= 1;
@ -1957,7 +1957,7 @@ CopySymbolsDef(XkbcDescPtr xkb, KeyInfo *key, int start_from)
unsigned okc, kc, width, tmp, nGroups;
XkbcKeyTypePtr type;
Bool haveActions, autoType, useAlias;
CARD32 *outSyms;
uint32_t *outSyms;
XkbcAction *outActs;
unsigned types[XkbNumKbdGroups];

View File

@ -26,8 +26,7 @@
#ifndef TOKENS_H
#define TOKENS_H 1
#include <X11/Xdefs.h>
#include <X11/Xmd.h>
#include <stdint.h>
#define END_OF_FILE 0
#define ERROR_TOK 255
@ -99,9 +98,9 @@
#define FUNCTION_KEYS 76
#define ALTERNATE_GROUP 77
extern CARD32 tok_ONE_LEVEL;
extern CARD32 tok_TWO_LEVEL;
extern CARD32 tok_ALPHABETIC;
extern CARD32 tok_KEYPAD;
extern uint32_t tok_ONE_LEVEL;
extern uint32_t tok_TWO_LEVEL;
extern uint32_t tok_ALPHABETIC;
extern uint32_t tok_KEYPAD;
#endif

View File

@ -32,35 +32,35 @@
/***====================================================================***/
Opaque
void *
uAlloc(unsigned size)
{
return ((Opaque) malloc(size));
return ((void *) malloc(size));
}
/***====================================================================***/
Opaque
void *
uCalloc(unsigned n, unsigned size)
{
return ((Opaque) calloc(n, size));
return ((void *) calloc(n, size));
}
/***====================================================================***/
Opaque
uRealloc(Opaque old, unsigned newSize)
void *
uRealloc(void * old, unsigned newSize)
{
if (old == NULL)
return ((Opaque) malloc(newSize));
return ((void *) malloc(newSize));
else
return ((Opaque) realloc((char *) old, newSize));
return ((void *) realloc((char *) old, newSize));
}
/***====================================================================***/
Opaque
uRecalloc(Opaque old, unsigned nOld, unsigned nNew, unsigned itemSize)
void *
uRecalloc(void * old, unsigned nOld, unsigned nNew, unsigned itemSize)
{
char *rtrn;
@ -74,15 +74,15 @@ uRecalloc(Opaque old, unsigned nOld, unsigned nNew, unsigned itemSize)
bzero(&rtrn[nOld * itemSize], (nNew - nOld) * itemSize);
}
}
return (Opaque) rtrn;
return (void *) rtrn;
}
/***====================================================================***/
void
uFree(Opaque ptr)
uFree(void * ptr)
{
if (ptr != (Opaque) NULL)
if (ptr != (void *) NULL)
free((char *) ptr);
return;
}

View File

@ -43,13 +43,6 @@
/***====================================================================***/
#ifndef OPAQUE_DEFINED
typedef void *Opaque;
#endif
#ifndef NullOpaque
#define NullOpaque ((Opaque)NULL)
#endif
#ifndef BOOLEAN_DEFINED
typedef char Boolean;
#endif
@ -72,27 +65,27 @@ typedef int Comparison;
/***====================================================================***/
extern Opaque
extern void *
uAlloc(unsigned size);
extern Opaque
extern void *
uCalloc(unsigned n, unsigned size);
extern Opaque
uRealloc(Opaque old, unsigned newSize);
extern void *
uRealloc(void * old, unsigned newSize);
extern Opaque
uRecalloc(Opaque old, unsigned nOld, unsigned nNew, unsigned newSize);
extern void *
uRecalloc(void * old, unsigned nOld, unsigned nNew, unsigned newSize);
extern void
uFree(Opaque ptr);
uFree(void * ptr);
#define uTypedAlloc(t) ((t *)uAlloc((unsigned)sizeof(t)))
#define uTypedCalloc(n,t) ((t *)uCalloc((unsigned)n,(unsigned)sizeof(t)))
#define uTypedRealloc(pO,n,t) ((t *)uRealloc((Opaque)pO,((unsigned)n)*sizeof(t)))
#define uTypedRecalloc(pO,o,n,t) ((t *)uRecalloc((Opaque)pO,((unsigned)o),((unsigned)n),sizeof(t)))
#define uTypedRealloc(pO,n,t) ((t *)uRealloc((void *)pO,((unsigned)n)*sizeof(t)))
#define uTypedRecalloc(pO,o,n,t) ((t *)uRecalloc((void *)pO,((unsigned)o),((unsigned)n),sizeof(t)))
#if (defined mdHasAlloca) && (mdHasAlloca)
#define uTmpAlloc(n) ((Opaque)alloca((unsigned)n))
#define uTmpAlloc(n) ((void *)alloca((unsigned)n))
#define uTmpFree(p)
#else
#define uTmpAlloc(n) uAlloc(n)

View File

@ -164,7 +164,7 @@ HandleVModDef(VModDef * stmt, unsigned mergeMode, VModInfo * info)
*/
int
LookupVModIndex(char * priv,
CARD32 elem, CARD32 field, unsigned type, ExprResult * val_rtrn)
uint32_t elem, uint32_t field, unsigned type, ExprResult * val_rtrn)
{
int i;
XkbcDescPtr xkb;
@ -203,7 +203,7 @@ LookupVModIndex(char * priv,
*/
int
LookupVModMask(char * priv,
CARD32 elem, CARD32 field, unsigned type, ExprResult * val_rtrn)
uint32_t elem, uint32_t field, unsigned type, ExprResult * val_rtrn)
{
if (LookupVModIndex(priv, elem, field, type, val_rtrn))
{
@ -217,7 +217,7 @@ LookupVModMask(char * priv,
int
FindKeypadVMod(XkbcDescPtr xkb)
{
CARD32 name;
uint32_t name;
ExprResult rtrn;
name = XkbcInternAtom("NumLock", False);

View File

@ -54,15 +54,15 @@ extern Bool ApplyVModDefs(VModInfo * /* info */ ,
);
extern int LookupVModIndex(char * /* priv */ ,
CARD32 /* elem */ ,
CARD32 /* field */ ,
uint32_t /* elem */ ,
uint32_t /* field */ ,
unsigned /* type */ ,
ExprResult * /* val_rtrn */
);
extern int LookupVModMask(char * /* priv */ ,
CARD32 /* elem */ ,
CARD32 /* field */ ,
uint32_t /* elem */ ,
uint32_t /* field */ ,
unsigned /* type */ ,
ExprResult * /* val_rtrn */
);

View File

@ -140,18 +140,18 @@ typedef struct _Expr
} binary;
struct
{
CARD32 element;
CARD32 field;
uint32_t element;
uint32_t field;
} field;
struct
{
CARD32 element;
CARD32 field;
uint32_t element;
uint32_t field;
struct _Expr *entry;
} array;
struct
{
CARD32 name;
uint32_t name;
struct _Expr *args;
} action;
struct
@ -166,11 +166,11 @@ typedef struct _Expr
int y;
} coord;
struct _Expr *child;
CARD32 str;
uint32_t str;
unsigned uval;
int ival;
char keyName[5];
Opaque ptr;
void * ptr;
} value;
} ExprDef;
@ -186,7 +186,7 @@ typedef struct _VModDef
{
ParseCommon common;
unsigned merge;
CARD32 name;
uint32_t name;
ExprDef *value;
} VModDef;
@ -210,7 +210,7 @@ typedef struct _KeyTypeDef
{
ParseCommon common;
unsigned merge;
CARD32 name;
uint32_t name;
VarDef *body;
} KeyTypeDef;
@ -226,7 +226,7 @@ typedef struct _ModMapDef
{
ParseCommon common;
unsigned merge;
CARD32 modifier;
uint32_t modifier;
ExprDef *keys;
} ModMapDef;
@ -259,7 +259,7 @@ typedef struct _IndicatorNameDef
typedef struct _OutlineDef
{
ParseCommon common;
CARD32 field;
uint32_t field;
int nPoints;
ExprDef *points;
} OutlineDef;
@ -268,7 +268,7 @@ typedef struct _ShapeDef
{
ParseCommon common;
unsigned merge;
CARD32 name;
uint32_t name;
int nOutlines;
OutlineDef *outlines;
} ShapeDef;
@ -292,7 +292,7 @@ typedef struct _SectionDef
{
ParseCommon common;
unsigned merge;
CARD32 name;
uint32_t name;
int nRows;
RowDef *rows;
} SectionDef;
@ -308,7 +308,7 @@ typedef struct _OverlayDef
{
ParseCommon common;
unsigned merge;
CARD32 name;
uint32_t name;
int nKeys;
OverlayKeyDef *keys;
} OverlayDef;
@ -318,7 +318,7 @@ typedef struct _DoodadDef
ParseCommon common;
unsigned merge;
unsigned type;
CARD32 name;
uint32_t name;
VarDef *body;
} DoodadDef;

View File

@ -135,7 +135,7 @@ extern XkbcOutlinePtr
XkbcAddGeomOutline(XkbcShapePtr shape, int sz_points);
extern XkbcShapePtr
XkbcAddGeomShape(XkbcGeometryPtr geom, CARD32 name, int sz_outlines);
XkbcAddGeomShape(XkbcGeometryPtr geom, uint32_t name, int sz_outlines);
extern XkbcKeyPtr
XkbcAddGeomKey(XkbcRowPtr row);
@ -144,11 +144,11 @@ extern XkbcRowPtr
XkbcAddGeomRow(XkbcSectionPtr section, int sz_keys);
extern XkbcSectionPtr
XkbcAddGeomSection(XkbcGeometryPtr geom, CARD32 name,
XkbcAddGeomSection(XkbcGeometryPtr geom, uint32_t name,
int sz_rows, int sz_doodads, int sz_over);
extern XkbcDoodadPtr
XkbcAddGeomDoodad(XkbcGeometryPtr geom, XkbcSectionPtr section, CARD32 name);
XkbcAddGeomDoodad(XkbcGeometryPtr geom, XkbcSectionPtr section, uint32_t name);
extern XkbcOverlayKeyPtr
XkbcAddGeomOverlayKey(XkbcOverlayPtr overlay, XkbcOverlayRowPtr row,
@ -158,7 +158,7 @@ extern XkbcOverlayRowPtr
XkbcAddGeomOverlayRow(XkbcOverlayPtr overlay, int row_under, int sz_keys);
extern XkbcOverlayPtr
XkbcAddGeomOverlay(XkbcSectionPtr section, CARD32 name, int sz_rows);
XkbcAddGeomOverlay(XkbcSectionPtr section, uint32_t name, int sz_rows);
/***====================================================================***/

View File

@ -52,7 +52,7 @@ extern void
XkbcEnsureSafeMapName(char *name);
extern unsigned
_XkbcKSCheckCase(CARD32 sym);
_XkbcKSCheckCase(uint32_t sym);
#define XkbcKSIsLower(k) (_XkbcKSCheckCase(k) & _XkbKSLower)
#define XkbcKSIsUpper(k) (_XkbcKSCheckCase(k) & _XkbKSUpper)
@ -95,7 +95,7 @@ extern char *
XkbcActionTypeText(unsigned type);
extern char *
XkbcKeysymText(CARD32 sym);
XkbcKeysymText(uint32_t sym);
extern char *
XkbcKeyNameText(char *name);