Commit 28a22ba22618f0736d03ddfb82f8e7dad9c9158e

Ran Benita 2014-04-22T18:05:24

xkbcomp: use straight assignment instead of CopyModSet Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/src/xkbcomp/compat.c b/src/xkbcomp/compat.c
index 61711ae..a2f4625 100644
--- a/src/xkbcomp/compat.c
+++ b/src/xkbcomp/compat.c
@@ -149,7 +149,7 @@ InitCompatInfo(CompatInfo *info, struct xkb_context *ctx,
     memset(info, 0, sizeof(*info));
     info->ctx = ctx;
     info->actions = actions;
-    CopyModSet(&info->mods, mods);
+    info->mods = *mods;
     info->default_interp.merge = MERGE_OVERRIDE;
     info->default_interp.interp.virtual_mod = XKB_MOD_INVALID;
     info->default_led.merge = MERGE_OVERRIDE;
@@ -384,7 +384,7 @@ MergeIncludedCompatMaps(CompatInfo *into, CompatInfo *from,
         return;
     }
 
-    CopyModSet(&into->mods, &from->mods);
+    into->mods = from->mods;
 
     if (into->name == NULL) {
         into->name = from->name;
@@ -872,7 +872,7 @@ CopyCompatToKeymap(struct xkb_keymap *keymap, CompatInfo *info)
     keymap->compat_section_name = strdup_safe(info->name);
     XkbEscapeMapName(keymap->compat_section_name);
 
-    CopyModSet(&keymap->mods, &info->mods);
+    keymap->mods = info->mods;
 
     if (!darray_empty(info->interps)) {
         struct collect collect;
diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c
index 06d19ca..07989b8 100644
--- a/src/xkbcomp/symbols.c
+++ b/src/xkbcomp/symbols.c
@@ -194,7 +194,7 @@ InitSymbolsInfo(SymbolsInfo *info, const struct xkb_keymap *keymap,
     info->merge = MERGE_OVERRIDE;
     InitKeyInfo(keymap->ctx, &info->default_key);
     info->actions = actions;
-    CopyModSet(&info->mods, mods);
+    info->mods = *mods;
     info->explicit_group = XKB_LAYOUT_INVALID;
 }
 
@@ -495,7 +495,7 @@ MergeIncludedSymbols(SymbolsInfo *into, SymbolsInfo *from,
         return;
     }
 
-    CopyModSet(&into->mods, &from->mods);
+    into->mods = from->mods;
 
     if (into->name == NULL) {
         into->name = from->name;
@@ -1538,7 +1538,7 @@ CopySymbolsToKeymap(struct xkb_keymap *keymap, SymbolsInfo *info)
     keymap->symbols_section_name = strdup_safe(info->name);
     XkbEscapeMapName(keymap->symbols_section_name);
 
-    CopyModSet(&keymap->mods, &info->mods);
+    keymap->mods = info->mods;
 
     keymap->num_group_names = darray_size(info->group_names);
     keymap->group_names = darray_mem(info->group_names, 0);
diff --git a/src/xkbcomp/types.c b/src/xkbcomp/types.c
index 2624cde..f22d3e7 100644
--- a/src/xkbcomp/types.c
+++ b/src/xkbcomp/types.c
@@ -102,7 +102,7 @@ InitKeyTypesInfo(KeyTypesInfo *info, struct xkb_context *ctx,
 {
     memset(info, 0, sizeof(*info));
     info->ctx = ctx;
-    CopyModSet(&info->mods, mods);
+    info->mods = *mods;
 }
 
 static void
@@ -181,7 +181,7 @@ MergeIncludedKeyTypes(KeyTypesInfo *into, KeyTypesInfo *from,
         return;
     }
 
-    CopyModSet(&into->mods, &from->mods);
+    into->mods = from->mods;
 
     if (into->name == NULL) {
         into->name = from->name;
@@ -676,7 +676,7 @@ CopyKeyTypesToKeymap(struct xkb_keymap *keymap, KeyTypesInfo *info)
     keymap->types_section_name = strdup_safe(info->name);
     XkbEscapeMapName(keymap->types_section_name);
 
-    CopyModSet(&keymap->mods, &info->mods);
+    keymap->mods = info->mods;
 
     keymap->num_types = darray_size(info->types);
     if (keymap->num_types == 0)
diff --git a/src/xkbcomp/vmod.c b/src/xkbcomp/vmod.c
index 4b03d4d..a0b029a 100644
--- a/src/xkbcomp/vmod.c
+++ b/src/xkbcomp/vmod.c
@@ -29,13 +29,6 @@
 #include "expr.h"
 #include "vmod.h"
 
-void
-CopyModSet(struct xkb_mod_set *into, const struct xkb_mod_set *from)
-{
-    memcpy(into->mods, from->mods, sizeof(*from->mods) * from->num_mods);
-    into->num_mods = from->num_mods;
-}
-
 bool
 HandleVModDef(struct xkb_context *ctx, struct xkb_mod_set *mods,
               VModDef *stmt, enum merge_mode merge)
diff --git a/src/xkbcomp/vmod.h b/src/xkbcomp/vmod.h
index d2644b9..546cf7e 100644
--- a/src/xkbcomp/vmod.h
+++ b/src/xkbcomp/vmod.h
@@ -27,9 +27,6 @@
 #ifndef XKBCOMP_VMOD_H
 #define XKBCOMP_VMOD_H
 
-void
-CopyModSet(struct xkb_mod_set *into, const struct xkb_mod_set *from);
-
 bool
 HandleVModDef(struct xkb_context *ctx, struct xkb_mod_set *mods,
               VModDef *stmt, enum merge_mode merge);