From: Ran Benita Date: Tue, 17 Jul 2012 14:08:14 +0000 (+0300) Subject: Remove CommonInfo X-Git-Tag: xkbcommon-0.2.0~403 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=db98696d0b36469a6030902ad41bb658f349f49f;p=platform%2Fupstream%2Flibxkbcommon.git Remove CommonInfo Not used by anything anymore. Signed-off-by: Ran Benita --- diff --git a/src/xkbcomp/compat.c b/src/xkbcomp/compat.c index f089fe5..cbd9a6d 100644 --- a/src/xkbcomp/compat.c +++ b/src/xkbcomp/compat.c @@ -266,29 +266,29 @@ AddInterp(CompatInfo * info, SymInterpInfo * new) return true; } - if (use_new_field(_SI_VirtualMod, old->defined, old->file_id, + if (UseNewField(_SI_VirtualMod, old->defined, old->file_id, new->defined, new->file_id, new->merge, &collide)) { old->interp.virtual_mod = new->interp.virtual_mod; old->defined |= _SI_VirtualMod; } - if (use_new_field(_SI_Action, old->defined, old->file_id, new->defined, + if (UseNewField(_SI_Action, old->defined, old->file_id, new->defined, new->file_id, new->merge, &collide)) { old->interp.act = new->interp.act; old->defined |= _SI_Action; } - if (use_new_field(_SI_AutoRepeat, old->defined, old->file_id, + if (UseNewField(_SI_AutoRepeat, old->defined, old->file_id, new->defined, new->file_id, new->merge, &collide)) { old->interp.flags &= ~XkbSI_AutoRepeat; old->interp.flags |= (new->interp.flags & XkbSI_AutoRepeat); old->defined |= _SI_AutoRepeat; } - if (use_new_field(_SI_LockingKey, old->defined, old->file_id, + if (UseNewField(_SI_LockingKey, old->defined, old->file_id, new->defined, new->file_id, new->merge, &collide)) { old->interp.flags &= ~XkbSI_LockingKey; old->interp.flags |= (new->interp.flags & XkbSI_LockingKey); old->defined |= _SI_LockingKey; } - if (use_new_field(_SI_LevelOneOnly, old->defined, old->file_id, + if (UseNewField(_SI_LevelOneOnly, old->defined, old->file_id, new->defined, new->file_id, new->merge, &collide)) { old->interp.match &= ~XkbSI_LevelOneOnly; old->interp.match |= (new->interp.match & XkbSI_LevelOneOnly); @@ -422,50 +422,43 @@ AddIndicatorMap(struct xkb_keymap *keymap, CompatInfo *info, LEDInfo *new) } collide = 0; - if (use_new_field(_LED_Index, old->defined, old->file_id, - new->defined, new->file_id, new->merge, - &collide)) { + if (UseNewField(_LED_Index, old->defined, old->file_id, + new->defined, new->file_id, new->merge, &collide)) { old->indicator = new->indicator; old->defined |= _LED_Index; } - if (use_new_field(_LED_Mods, old->defined, old->file_id, - new->defined, new->file_id, new->merge, - &collide)) { + if (UseNewField(_LED_Mods, old->defined, old->file_id, + new->defined, new->file_id, new->merge, &collide)) { old->which_mods = new->which_mods; old->real_mods = new->real_mods; old->vmods = new->vmods; old->defined |= _LED_Mods; } - if (use_new_field(_LED_Groups, old->defined, old->file_id, - new->defined, new->file_id, new->merge, - &collide)) { + if (UseNewField(_LED_Groups, old->defined, old->file_id, + new->defined, new->file_id, new->merge, &collide)) { old->which_groups = new->which_groups; old->groups = new->groups; old->defined |= _LED_Groups; } - if (use_new_field(_LED_Ctrls, old->defined, old->file_id, - new->defined, new->file_id, new->merge, - &collide)) { + if (UseNewField(_LED_Ctrls, old->defined, old->file_id, + new->defined, new->file_id, new->merge, &collide)) { old->ctrls = new->ctrls; old->defined |= _LED_Ctrls; } - if (use_new_field(_LED_Explicit, old->defined, old->file_id, - new->defined, new->file_id, new->merge, - &collide)) { + if (UseNewField(_LED_Explicit, old->defined, old->file_id, + new->defined, new->file_id, new->merge, &collide)) { old->flags &= ~XkbIM_NoExplicit; old->flags |= (new->flags & XkbIM_NoExplicit); old->defined |= _LED_Explicit; } - if (use_new_field(_LED_Automatic, old->defined, old->file_id, - new->defined, new->file_id, new->merge, - &collide)) { + if (UseNewField(_LED_Automatic, old->defined, old->file_id, + new->defined, new->file_id, new->merge, &collide)) { old->flags &= ~XkbIM_NoAutomatic; old->flags |= (new->flags & XkbIM_NoAutomatic); old->defined |= _LED_Automatic; } - if (use_new_field(_LED_DrivesKbd, old->defined, old->file_id, - new->defined, new->file_id, new->merge, - &collide)) { + if (UseNewField(_LED_DrivesKbd, old->defined, old->file_id, + new->defined, new->file_id, new->merge, &collide)) { old->flags &= ~XkbIM_LEDDrivesKB; old->flags |= (new->flags & XkbIM_LEDDrivesKB); old->defined |= _LED_DrivesKbd; diff --git a/src/xkbcomp/misc.c b/src/xkbcomp/misc.c index 8cecd19..5362d80 100644 --- a/src/xkbcomp/misc.c +++ b/src/xkbcomp/misc.c @@ -107,37 +107,16 @@ ProcessIncludeFile(struct xkb_context *ctx, } bool -UseNewField(unsigned field, - CommonInfo * oldDefs, CommonInfo * newDefs, unsigned *pCollide) -{ - bool useNew; - - useNew = false; - if (oldDefs->defined & field) { - if (newDefs->defined & field) { - if (((oldDefs->file_id == newDefs->file_id) - && (warningLevel > 0)) || (warningLevel > 9)) { - *pCollide |= field; - } - if (newDefs->merge != MERGE_AUGMENT) - useNew = true; - } - } - else if (newDefs->defined & field) - useNew = true; - return useNew; -} - -bool -use_new_field(unsigned field, short old_defined, unsigned old_file_id, - short new_defined, unsigned new_file_id, - enum merge_mode new_merge, unsigned *collide) +UseNewField(unsigned field, short old_defined, unsigned old_file_id, + short new_defined, unsigned new_file_id, + enum merge_mode new_merge, unsigned *collide) { if (!(old_defined & field)) return true; if (new_defined & field) { - if ((old_file_id == new_file_id && warningLevel > 0) || warningLevel > 9) + if ((old_file_id == new_file_id && warningLevel > 0) || + warningLevel > 9) *collide |= field; if (new_merge != MERGE_AUGMENT) @@ -147,40 +126,6 @@ use_new_field(unsigned field, short old_defined, unsigned old_file_id, return false; } - -void * -ClearCommonInfo(CommonInfo * cmn) -{ - if (cmn != NULL) { - CommonInfo *this, *next; - for (this = cmn; this != NULL; this = next) { - next = this->next; - free(this); - } - } - return NULL; -} - -void * -AddCommonInfo(CommonInfo * old, CommonInfo * new) -{ - CommonInfo *first; - - first = old; - while (old && old->next) - { - old = old->next; - } - new->next = NULL; - if (old) { - old->next = new; - return first; - } - return new; -} - -/***====================================================================***/ - /** * Find the key with the given name. * diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c index 3c11415..e2ce206 100644 --- a/src/xkbcomp/symbols.c +++ b/src/xkbcomp/symbols.c @@ -560,28 +560,28 @@ MergeKeys(SymbolsInfo *info, struct xkb_keymap *keymap, } } } - if (use_new_field(_Key_Behavior, into->defined, into->file_id, - from->defined, from->file_id, from->merge, &collide)) { + if (UseNewField(_Key_Behavior, into->defined, into->file_id, + from->defined, from->file_id, from->merge, &collide)) { into->behavior = from->behavior; into->defined |= _Key_Behavior; } - if (use_new_field(_Key_VModMap, into->defined, into->file_id, - from->defined, from->file_id, from->merge, &collide)) { + if (UseNewField(_Key_VModMap, into->defined, into->file_id, + from->defined, from->file_id, from->merge, &collide)) { into->vmodmap = from->vmodmap; into->defined |= _Key_VModMap; } - if (use_new_field(_Key_Repeat, into->defined, into->file_id, - from->defined, from->file_id, from->merge, &collide)) { + if (UseNewField(_Key_Repeat, into->defined, into->file_id, + from->defined, from->file_id, from->merge, &collide)) { into->repeat = from->repeat; into->defined |= _Key_Repeat; } - if (use_new_field(_Key_Type_Dflt, into->defined, into->file_id, - from->defined, from->file_id, from->merge, &collide)) { + if (UseNewField(_Key_Type_Dflt, into->defined, into->file_id, + from->defined, from->file_id, from->merge, &collide)) { into->dfltType = from->dfltType; into->defined |= _Key_Type_Dflt; } - if (use_new_field(_Key_GroupInfo, into->defined, into->file_id, - from->defined, from->file_id, from->merge, &collide)) { + if (UseNewField(_Key_GroupInfo, into->defined, into->file_id, + from->defined, from->file_id, from->merge, &collide)) { into->out_of_range_group_action = from->out_of_range_group_action; into->out_of_range_group_number = from->out_of_range_group_number; into->defined |= _Key_GroupInfo; diff --git a/src/xkbcomp/xkbcomp-priv.h b/src/xkbcomp/xkbcomp-priv.h index 7e5d47d..cccbb14 100644 --- a/src/xkbcomp/xkbcomp-priv.h +++ b/src/xkbcomp/xkbcomp-priv.h @@ -32,27 +32,10 @@ #include "text.h" #include "utils.h" -typedef struct _CommonInfo { - unsigned short defined; - unsigned file_id; - enum merge_mode merge; - struct _CommonInfo *next; -} CommonInfo; - -extern bool -UseNewField(unsigned field, CommonInfo *oldDefs, CommonInfo *newDefs, - unsigned *pCollide); - bool -use_new_field(unsigned field, short old_defined, unsigned old_file_id, - short new_defined, unsigned new_file_id, - enum merge_mode new_merge, unsigned *collide); - -extern void * -ClearCommonInfo(CommonInfo *cmn); - -extern void * -AddCommonInfo(CommonInfo * old, CommonInfo * new); +UseNewField(unsigned field, short old_defined, unsigned old_file_id, + short new_defined, unsigned new_file_id, + enum merge_mode new_merge, unsigned *collide); extern bool ProcessIncludeFile(struct xkb_context *ctx, IncludeStmt *stmt,