xkbcomp: use straight assignment instead of CopyModSet Signed-off-by: Ran Benita <ran234@gmail.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
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);