xkbcomp: use straight assignment instead of CopyModSet

Signed-off-by: Ran Benita <ran234@gmail.com>
master
Ran Benita 2014-04-22 18:05:24 +03:00
parent 9014cf8cd8
commit 28a22ba226
5 changed files with 9 additions and 19 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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)

View File

@ -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)

View File

@ -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);