Remove all uses of the register keyword

Signed-off-by: Ran Benita <ran234@gmail.com>
master
Ran Benita 2012-02-29 20:25:11 +02:00
parent f424251244
commit f278cea107
14 changed files with 92 additions and 92 deletions

View File

@ -455,8 +455,8 @@ bail:
struct xkb_property *
XkbcAddGeomProperty(struct xkb_geometry * geom,const char *name,const char *value)
{
register int i;
register struct xkb_property * prop;
int i;
struct xkb_property * prop;
if ((!geom)||(!name)||(!value))
return NULL;
@ -488,8 +488,8 @@ register struct xkb_property * prop;
struct xkb_color *
XkbcAddGeomColor(struct xkb_geometry * geom,const char *spec,unsigned int pixel)
{
register int i;
register struct xkb_color * color;
int i;
struct xkb_color * color;
if ((!geom)||(!spec))
return NULL;
@ -534,8 +534,8 @@ struct xkb_outline * outline;
struct xkb_shape *
XkbcAddGeomShape(struct xkb_geometry * geom,uint32_t name,int sz_outlines)
{
struct xkb_shape * shape;
register int i;
struct xkb_shape *shape;
int i;
if ((!geom)||(!name)||(sz_outlines<0))
return NULL;
@ -596,8 +596,8 @@ XkbcAddGeomSection( struct xkb_geometry * geom,
int sz_doodads,
int sz_over)
{
register int i;
struct xkb_section * section;
int i;
struct xkb_section * section;
if ((!geom)||(name==None)||(sz_rows<0))
return NULL;
@ -630,8 +630,8 @@ struct xkb_section * section;
union xkb_doodad *
XkbcAddGeomDoodad(struct xkb_geometry * geom,struct xkb_section * section,uint32_t name)
{
union xkb_doodad *old, *doodad;
register int i,nDoodads;
union xkb_doodad *old, *doodad;
int i, nDoodads;
if ((!geom)||(name==None))
return NULL;
@ -668,8 +668,8 @@ register int i,nDoodads;
struct xkb_overlay_row *
XkbcAddGeomOverlayRow(struct xkb_overlay * overlay,int row_under,int sz_keys)
{
register int i;
struct xkb_overlay_row * row;
int i;
struct xkb_overlay_row *row;
if ((!overlay)||(sz_keys<0))
return NULL;
@ -700,8 +700,8 @@ struct xkb_overlay_row * row;
struct xkb_overlay *
XkbcAddGeomOverlay(struct xkb_section * section,uint32_t name,int sz_rows)
{
register int i;
struct xkb_overlay * overlay;
int i;
struct xkb_overlay *overlay;
if ((!section)||(name==None)||(sz_rows==0))
return NULL;

View File

@ -118,8 +118,8 @@ InputLineAddChar(InputLine *line,int ch)
static Bool
GetInputLine(FILE *file,InputLine *line,Bool checkbang)
{
int ch;
Bool endOfFile,spacePending,slashPending,inComment;
int ch;
Bool endOfFile,spacePending,slashPending,inComment;
endOfFile= False;
while ((!endOfFile)&&(line->num_line==0)) {
@ -267,13 +267,13 @@ get_index(char *str, int *ndx)
static void
SetUpRemap(InputLine *line,RemapSpec *remap)
{
char * tok,*str;
unsigned present, l_ndx_present, v_ndx_present;
register int i;
int len, ndx;
_Xstrtokparams strtok_buf;
char *tok, *str;
unsigned present, l_ndx_present, v_ndx_present;
int i;
int len, ndx;
_Xstrtokparams strtok_buf;
#ifdef DEBUG
Bool found;
Bool found;
#endif
@ -369,8 +369,8 @@ Bool found;
static Bool
MatchOneOf(char *wanted,char *vals_defined)
{
char *str,*next;
int want_len= strlen(wanted);
char *str, *next;
int want_len = strlen(wanted);
for (str=vals_defined,next=NULL;str!=NULL;str=next) {
int len;
@ -396,11 +396,11 @@ CheckLine( InputLine * line,
XkbRF_RulePtr rule,
XkbRF_GroupPtr group)
{
char * str,*tok;
register int nread, i;
FileSpec tmp;
_Xstrtokparams strtok_buf;
Bool append = False;
char *str, *tok;
int nread, i;
FileSpec tmp;
_Xstrtokparams strtok_buf;
Bool append = False;
if (line->line[0]=='!') {
if (line->line[1] == '$' ||
@ -495,7 +495,7 @@ Bool append = False;
static char *
_Concat(char *str1,char *str2)
{
int len;
int len;
if ((!str1)||(!str2))
return str1;
@ -712,8 +712,8 @@ XkbRF_CheckApplyRule( XkbRF_RulePtr rule,
static void
XkbRF_ClearPartialMatches(XkbRF_RulesPtr rules)
{
register int i;
XkbRF_RulePtr rule;
int i;
XkbRF_RulePtr rule;
for (i=0,rule=rules->rules;i<rules->num_rules;i++,rule++) {
rule->flags&= ~XkbRF_PendingMatch;
@ -723,8 +723,8 @@ XkbRF_RulePtr rule;
static void
XkbRF_ApplyPartialMatches(XkbRF_RulesPtr rules,struct xkb_component_names * names)
{
int i;
XkbRF_RulePtr rule;
int i;
XkbRF_RulePtr rule;
for (rule = rules->rules, i = 0; i < rules->num_rules; i++, rule++) {
if ((rule->flags&XkbRF_PendingMatch)==0)
@ -739,9 +739,9 @@ XkbRF_CheckApplyRules( XkbRF_RulesPtr rules,
struct xkb_component_names * names,
int flags)
{
int i;
XkbRF_RulePtr rule;
int skip;
int i;
XkbRF_RulePtr rule;
int skip;
for (rule = rules->rules, i=0; i < rules->num_rules; rule++, i++) {
if ((rule->flags & flags) != flags)
@ -760,8 +760,8 @@ int skip;
static char *
XkbRF_SubstituteVars(char *name, XkbRF_MultiDefsPtr mdefs)
{
char *str, *outstr, *orig, *var;
int len, ndx;
char *str, *outstr, *orig, *var;
int len, ndx;
orig= name;
str= index(name,'%');
@ -970,7 +970,7 @@ XkbRF_GroupRec tgroup,*group;
static void
XkbRF_ClearVarDescriptions(XkbRF_DescribeVarsPtr var)
{
register int i;
int i;
for (i=0;i<var->num_desc;i++) {
free(var->desc[i].name);
@ -985,9 +985,9 @@ register int i;
void
XkbcRF_Free(XkbRF_RulesPtr rules,Bool freeRules)
{
int i;
XkbRF_RulePtr rule;
XkbRF_GroupPtr group;
int i;
XkbRF_RulePtr rule;
XkbRF_GroupPtr group;
if (!rules)
return;

View File

@ -157,7 +157,7 @@ MergeAliases(AliasInfo ** into, AliasInfo ** merge, unsigned how_merge)
int
ApplyAliases(struct xkb_desc * xkb, Bool toGeom, AliasInfo ** info_in)
{
register int i;
int i;
struct xkb_key_alias *old, *a;
AliasInfo *info;
int nNew, nOld;

View File

@ -102,7 +102,7 @@ siText(SymInterpInfo * si, CompatInfo * info)
static void
InitCompatInfo(CompatInfo * info, struct xkb_desc * xkb)
{
register int i;
int i;
info->xkb = xkb;
info->name = NULL;
@ -135,7 +135,7 @@ InitCompatInfo(CompatInfo * info, struct xkb_desc * xkb)
static void
ClearCompatInfo(CompatInfo * info, struct xkb_desc * xkb)
{
register int i;
int i;
free(info->name);
info->name = NULL;
@ -350,7 +350,7 @@ MergeIncludedCompatMaps(CompatInfo * into, CompatInfo * from, unsigned merge)
SymInterpInfo *si;
LEDInfo *led, *rtrn, *next;
GroupCompatInfo *gcm;
register int i;
int i;
if (from->errorCount > 0)
{

View File

@ -634,7 +634,7 @@ FreeShapes(ShapeInfo * si, GeometryInfo * info)
{
if (tmp->outlines)
{
register int i;
int i;
for (i = 0; i < tmp->nOutlines; i++)
{
if (tmp->outlines[i].points != NULL)
@ -2933,7 +2933,7 @@ HandleGeometryFile(XkbFile * file,
static Bool
CopyShapeDef(struct xkb_geometry * geom, ShapeInfo * si)
{
register int i, n;
int i, n;
struct xkb_shape * shape;
struct xkb_outline *old_outline, *outline;
uint32_t name;
@ -3386,7 +3386,7 @@ VerifyOverlayInfo(struct xkb_geometry * geom,
OverlayInfo * oi,
GeometryInfo * info, short rowMap[256], short rowSize[256])
{
register OverlayKeyInfo *ki, *next;
OverlayKeyInfo *ki, *next;
unsigned long oKey, uKey, sKey;
struct xkb_row * row;
struct xkb_key * key;

View File

@ -434,7 +434,7 @@ CopyIndicatorMapDefs(struct xkb_desc * xkb, LEDInfo *leds, LEDInfo **unboundRtrn
}
else
{
register struct xkb_indicator_map * im;
struct xkb_indicator_map * im;
im = &xkb->indicators->maps[led->indicator - 1];
im->flags = led->flags;
im->which_groups = led->which_groups;
@ -460,8 +460,8 @@ Bool
BindIndicators(struct xkb_desc * xkb, Bool force, LEDInfo *unbound,
LEDInfo **unboundRtrn)
{
register int i;
register LEDInfo *led, *next, *last;
int i;
LEDInfo *led, *next, *last;
if (xkb->names != NULL)
{

View File

@ -355,7 +355,7 @@ InitKeyNamesInfo(KeyNamesInfo * info)
static int
FindKeyByLong(KeyNamesInfo * info, unsigned long name)
{
register int i;
int i;
for (i = info->computedMin; i <= info->computedMax; i++)
{
@ -478,7 +478,7 @@ static void
MergeIncludedKeycodes(KeyNamesInfo * into, KeyNamesInfo * from,
unsigned merge)
{
register int i;
int i;
char buf[5];
if (from->errorCount > 0)
@ -891,7 +891,7 @@ CompileKeycodes(XkbFile *file, struct xkb_desc * xkb, unsigned merge)
if (XkbcAllocNames(xkb, XkbKeyNamesMask | XkbIndicatorNamesMask, 0, 0)
== Success)
{
register int i;
int i;
xkb->names->keycodes = xkb_intern_atom(info.name);
for (i = info.computedMin; i <= info.computedMax; i++)
{
@ -917,7 +917,7 @@ CompileKeycodes(XkbFile *file, struct xkb_desc * xkb, unsigned merge)
xkb->names->indicators[ii->ndx - 1] = ii->name;
if (xkb->indicators != NULL)
{
register unsigned bit;
unsigned bit;
bit = 1 << (ii->ndx - 1);
if (ii->virtual)
xkb->indicators->phys_indicators &= ~bit;

View File

@ -158,7 +158,7 @@ CompileKeymap(XkbFile *file, struct xkb_desc * xkb, unsigned merge)
xkb->defined = have;
if (required & (~have))
{
register int i, bit;
int i, bit;
unsigned missing;
missing = required & (~have);
for (i = 0, bit = 1; missing != 0; i++, bit <<= 1)

View File

@ -149,7 +149,7 @@ InitKeyTypesInfo(KeyTypesInfo * info, struct xkb_desc * xkb, KeyTypesInfo * from
info->dflt.lvlNames = uTypedCalloc(from->dflt.szNames, uint32_t);
if (info->dflt.lvlNames)
{
register unsigned sz = from->dflt.szNames * sizeof(uint32_t);
unsigned sz = from->dflt.szNames * sizeof(uint32_t);
memcpy(info->dflt.lvlNames, from->dflt.lvlNames, sz);
}
}
@ -198,7 +198,7 @@ FreeKeyTypesInfo(KeyTypesInfo * info)
info->name = NULL;
if (info->types)
{
register KeyTypeInfo *type;
KeyTypeInfo *type;
for (type = info->types; type; type = (KeyTypeInfo *) type->defs.next)
{
FreeKeyTypeInfo(type);
@ -446,7 +446,7 @@ HandleIncludeKeyTypes(IncludeStmt * stmt,
static struct xkb_kt_map_entry *
FindMatchingMapEntry(KeyTypeInfo * type, unsigned mask, unsigned vmask)
{
register int i;
int i;
struct xkb_kt_map_entry * entry;
for (i = 0, entry = type->entries; i < type->nEntries; i++, entry++)
@ -460,7 +460,7 @@ FindMatchingMapEntry(KeyTypeInfo * type, unsigned mask, unsigned vmask)
static void
DeleteLevel1MapEntries(KeyTypeInfo * type)
{
register int i, n;
int i, n;
for (i = 0; i < type->nEntries; i++)
{
@ -948,7 +948,7 @@ static int
HandleKeyTypeDef(KeyTypeDef * def,
struct xkb_desc * xkb, unsigned merge, KeyTypesInfo * info)
{
register int i;
int i;
KeyTypeInfo type;
if (def->merge != MergeDefault)
@ -1089,7 +1089,7 @@ HandleKeyTypesFile(XkbFile * file,
static Bool
CopyDefToKeyType(struct xkb_desc * xkb, struct xkb_key_type * type, KeyTypeInfo * def)
{
register int i;
int i;
PreserveInfo *pre;
for (pre = def->preserve; pre != NULL;
@ -1170,9 +1170,9 @@ CompileKeyTypes(XkbFile *file, struct xkb_desc * xkb, unsigned merge)
if (info.errorCount == 0)
{
register int i;
register KeyTypeInfo *def;
register struct xkb_key_type *type, *next;
int i;
KeyTypeInfo *def;
struct xkb_key_type *type, *next;
if (info.name != NULL)
{

View File

@ -249,7 +249,7 @@ FindNamedKey(struct xkb_desc * xkb,
xkb_keycode_t *kc_rtrn,
Bool use_aliases, Bool create, int start_from)
{
register unsigned n;
unsigned n;
if (start_from < xkb->min_key_code)
{
@ -315,7 +315,7 @@ Bool
FindKeyNameForAlias(struct xkb_desc * xkb, unsigned long lname,
unsigned long *real_name)
{
register int i;
int i;
char name[XkbKeyNameLength + 1];
if (xkb && xkb->geom && xkb->geom->key_aliases)

View File

@ -85,7 +85,7 @@ typedef struct _KeyInfo
static void
InitKeyInfo(KeyInfo * info)
{
register int i;
int i;
static char dflt[4] = "*";
info->defs.defined = 0;
@ -118,7 +118,7 @@ InitKeyInfo(KeyInfo * info)
static void
FreeKeyInfo(KeyInfo * info)
{
register int i;
int i;
info->defs.defined = 0;
info->defs.fileID = 0;
@ -153,7 +153,7 @@ FreeKeyInfo(KeyInfo * info)
static Bool
CopyKeyInfo(KeyInfo * old, KeyInfo * new, Bool clearOld)
{
register int i;
int i;
*new = *old;
new->defs.next = NULL;
@ -239,7 +239,7 @@ typedef struct _SymbolsInfo
static void
InitSymbolsInfo(SymbolsInfo * info, struct xkb_desc * xkb)
{
register int i;
int i;
tok_ONE_LEVEL = xkb_intern_atom("ONE_LEVEL");
tok_TWO_LEVEL = xkb_intern_atom("TWO_LEVEL");
@ -266,7 +266,7 @@ InitSymbolsInfo(SymbolsInfo * info, struct xkb_desc * xkb)
static void
FreeSymbolsInfo(SymbolsInfo * info)
{
register int i;
int i;
free(info->name);
if (info->keys)
@ -324,7 +324,7 @@ MergeKeyGroups(SymbolsInfo * info,
uint32_t *resultSyms;
union xkb_action *resultActs;
int resultWidth;
register int i;
int i;
Bool report, clobber;
clobber = (from->defs.merge != MergeAugment);
@ -467,7 +467,7 @@ MergeKeyGroups(SymbolsInfo * info,
static Bool
MergeKeys(SymbolsInfo * info, KeyInfo * into, KeyInfo * from)
{
register int i;
int i;
unsigned collide = 0;
Bool report;
@ -589,7 +589,7 @@ MergeKeys(SymbolsInfo * info, KeyInfo * into, KeyInfo * from)
static Bool
AddKeySymbols(SymbolsInfo * info, KeyInfo * key, struct xkb_desc * xkb)
{
register int i;
int i;
unsigned long real_name;
for (i = 0; i < info->nKeys; i++)
@ -701,7 +701,7 @@ static void
MergeIncludedSymbols(SymbolsInfo * into, SymbolsInfo * from,
unsigned merge, struct xkb_desc * xkb)
{
register int i;
int i;
KeyInfo *key;
if (from->errorCount > 0)
@ -861,7 +861,7 @@ GetGroupIndex(KeyInfo * key,
if (arrayNdx == NULL)
{
register int i;
int i;
unsigned defined;
if (what == SYMBOLS)
defined = key->symsDefined;
@ -952,7 +952,7 @@ AddActionsToKey(KeyInfo * key,
char *field,
ExprDef * arrayNdx, ExprDef * value, SymbolsInfo * info)
{
register int i;
int i;
unsigned ndx, nActs;
ExprDef *act;
struct xkb_any_action *toAct;
@ -1648,8 +1648,8 @@ HandleSymbolsFile(XkbFile * file,
static Bool
FindKeyForSymbol(struct xkb_desc * xkb, uint32_t sym, xkb_keycode_t *kc_rtrn)
{
register int i, j;
register Bool gotOne;
int i, j;
Bool gotOne;
j = 0;
do
@ -1684,7 +1684,7 @@ FindKeyForSymbol(struct xkb_desc * xkb, uint32_t sym, xkb_keycode_t *kc_rtrn)
static Bool
FindNamedType(struct xkb_desc * xkb, uint32_t name, unsigned *type_rtrn)
{
register unsigned n;
unsigned n;
if (xkb && xkb->map && xkb->map->types)
{
@ -1876,7 +1876,7 @@ PrepareKeyDef(KeyInfo * key)
static Bool
CopySymbolsDef(struct xkb_desc * xkb, KeyInfo *key, int start_from)
{
register int i;
int i;
xkb_keycode_t okc, kc;
unsigned width, tmp, nGroups;
struct xkb_key_type * type;
@ -2128,7 +2128,7 @@ CopyModMapDef(struct xkb_desc * xkb, ModMapEntry *entry)
Bool
CompileSymbols(XkbFile *file, struct xkb_desc * xkb, unsigned merge)
{
register int i;
int i;
SymbolsInfo info;
InitSymbolsInfo(&info, xkb);

View File

@ -205,7 +205,7 @@ uStrCaseCmp(const char *str1, const char *str2)
{
char buf1[512], buf2[512];
char c, *s;
register int n;
int n;
for (n = 0, s = buf1; (c = *str1++); n++)
{

View File

@ -47,7 +47,7 @@ InitVModInfo(VModInfo * info, struct xkb_desc * xkb)
void
ClearVModInfo(VModInfo * info, struct xkb_desc * xkb)
{
register int i;
int i;
if (XkbcAllocNames(xkb, XkbVirtualModNamesMask, 0, 0) != Success)
return;
@ -57,7 +57,7 @@ ClearVModInfo(VModInfo * info, struct xkb_desc * xkb)
info->newlyDefined = info->defined = info->available = 0;
if (xkb && xkb->names)
{
register int bit;
int bit;
for (i = 0, bit = 1; i < XkbNumVirtualMods; i++, bit <<= 1)
{
if (xkb->names->vmods[i] != None)
@ -81,7 +81,7 @@ Bool
HandleVModDef(VModDef * stmt, struct xkb_desc *xkb, unsigned mergeMode,
VModInfo * info)
{
register int i, bit, nextFree;
int i, bit, nextFree;
ExprResult mod;
struct xkb_server_map * srv;
struct xkb_names * names;
@ -206,7 +206,7 @@ LookupVModMask(void * priv, uint32_t field, unsigned type,
}
else if (LookupVModIndex(priv, field, type, val_rtrn))
{
register unsigned ndx = val_rtrn->uval;
unsigned ndx = val_rtrn->uval;
val_rtrn->uval = (1 << (XkbNumModifiers + ndx));
return True;
}

View File

@ -184,7 +184,7 @@ XkbInitIncludePath(void)
static void
XkbClearIncludePath(void)
{
register int i;
int i;
if (szPath > 0)
{
@ -401,7 +401,7 @@ XkbFindFileInCache(char *name, unsigned type, char **pathRtrn)
FILE *
XkbFindFileInPath(const char *name, unsigned type, char **pathRtrn)
{
register int i;
int i;
FILE *file = NULL;
int nameLen, typeLen, pathLen;
char buf[PATH_MAX], *typeDir;