parent
5e3615b246
commit
c03834a1c6
|
@ -166,8 +166,6 @@ get_home_xcompose_file_path(void)
|
||||||
char *
|
char *
|
||||||
get_locale_compose_file_path(const char *locale)
|
get_locale_compose_file_path(const char *locale)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
const char *xlocaledir;
|
|
||||||
char *resolved;
|
char *resolved;
|
||||||
char *path;
|
char *path;
|
||||||
|
|
||||||
|
@ -193,8 +191,8 @@ get_locale_compose_file_path(const char *locale)
|
||||||
path = resolved;
|
path = resolved;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
xlocaledir = get_xlocaledir_path();
|
const char *xlocaledir = get_xlocaledir_path();
|
||||||
ret = asprintf(&path, "%s/%s", xlocaledir, resolved);
|
int ret = asprintf(&path, "%s/%s", xlocaledir, resolved);
|
||||||
free(resolved);
|
free(resolved);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -1163,14 +1163,13 @@ xkb_state_mod_indices_are_active(struct xkb_state *state,
|
||||||
...)
|
...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
xkb_mod_index_t idx = 0;
|
|
||||||
xkb_mod_mask_t wanted = 0;
|
xkb_mod_mask_t wanted = 0;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
xkb_mod_index_t num_mods = xkb_keymap_num_mods(state->keymap);
|
xkb_mod_index_t num_mods = xkb_keymap_num_mods(state->keymap);
|
||||||
|
|
||||||
va_start(ap, match);
|
va_start(ap, match);
|
||||||
while (1) {
|
while (1) {
|
||||||
idx = va_arg(ap, xkb_mod_index_t);
|
xkb_mod_index_t idx = va_arg(ap, xkb_mod_index_t);
|
||||||
if (idx == XKB_MOD_INVALID)
|
if (idx == XKB_MOD_INVALID)
|
||||||
break;
|
break;
|
||||||
if (idx >= num_mods) {
|
if (idx >= num_mods) {
|
||||||
|
@ -1214,12 +1213,12 @@ xkb_state_mod_names_are_active(struct xkb_state *state,
|
||||||
...)
|
...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
xkb_mod_index_t idx = 0;
|
|
||||||
xkb_mod_mask_t wanted = 0;
|
xkb_mod_mask_t wanted = 0;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
va_start(ap, match);
|
va_start(ap, match);
|
||||||
while (1) {
|
while (1) {
|
||||||
|
xkb_mod_index_t idx;
|
||||||
const char *str = va_arg(ap, const char *);
|
const char *str = va_arg(ap, const char *);
|
||||||
if (str == NULL)
|
if (str == NULL)
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -377,8 +377,6 @@ static void
|
||||||
MergeIncludedCompatMaps(CompatInfo *into, CompatInfo *from,
|
MergeIncludedCompatMaps(CompatInfo *into, CompatInfo *from,
|
||||||
enum merge_mode merge)
|
enum merge_mode merge)
|
||||||
{
|
{
|
||||||
SymInterpInfo *si;
|
|
||||||
|
|
||||||
if (from->errorCount > 0) {
|
if (from->errorCount > 0) {
|
||||||
into->errorCount += from->errorCount;
|
into->errorCount += from->errorCount;
|
||||||
return;
|
return;
|
||||||
|
@ -396,6 +394,7 @@ MergeIncludedCompatMaps(CompatInfo *into, CompatInfo *from,
|
||||||
darray_init(from->interps);
|
darray_init(from->interps);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
SymInterpInfo *si;
|
||||||
darray_foreach(si, from->interps) {
|
darray_foreach(si, from->interps) {
|
||||||
si->merge = (merge == MERGE_DEFAULT ? si->merge : merge);
|
si->merge = (merge == MERGE_DEFAULT ? si->merge : merge);
|
||||||
if (!AddInterp(into, si, false))
|
if (!AddInterp(into, si, false))
|
||||||
|
|
|
@ -499,8 +499,6 @@ static void
|
||||||
MergeIncludedSymbols(SymbolsInfo *into, SymbolsInfo *from,
|
MergeIncludedSymbols(SymbolsInfo *into, SymbolsInfo *from,
|
||||||
enum merge_mode merge)
|
enum merge_mode merge)
|
||||||
{
|
{
|
||||||
KeyInfo *keyi;
|
|
||||||
ModMapEntry *mm;
|
|
||||||
xkb_atom_t *group_name;
|
xkb_atom_t *group_name;
|
||||||
xkb_layout_index_t group_names_in_both;
|
xkb_layout_index_t group_names_in_both;
|
||||||
|
|
||||||
|
@ -536,6 +534,7 @@ MergeIncludedSymbols(SymbolsInfo *into, SymbolsInfo *from,
|
||||||
darray_init(from->keys);
|
darray_init(from->keys);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
KeyInfo *keyi;
|
||||||
darray_foreach(keyi, from->keys) {
|
darray_foreach(keyi, from->keys) {
|
||||||
keyi->merge = (merge == MERGE_DEFAULT ? keyi->merge : merge);
|
keyi->merge = (merge == MERGE_DEFAULT ? keyi->merge : merge);
|
||||||
if (!AddKeySymbols(into, keyi, false))
|
if (!AddKeySymbols(into, keyi, false))
|
||||||
|
@ -548,6 +547,7 @@ MergeIncludedSymbols(SymbolsInfo *into, SymbolsInfo *from,
|
||||||
darray_init(from->modmaps);
|
darray_init(from->modmaps);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
ModMapEntry *mm;
|
||||||
darray_foreach(mm, from->modmaps) {
|
darray_foreach(mm, from->modmaps) {
|
||||||
mm->merge = (merge == MERGE_DEFAULT ? mm->merge : merge);
|
mm->merge = (merge == MERGE_DEFAULT ? mm->merge : merge);
|
||||||
if (!AddModMapEntry(into, mm))
|
if (!AddModMapEntry(into, mm))
|
||||||
|
@ -1258,13 +1258,12 @@ FindKeyForSymbol(struct xkb_keymap *keymap, xkb_keysym_t sym)
|
||||||
{
|
{
|
||||||
struct xkb_key *key;
|
struct xkb_key *key;
|
||||||
xkb_layout_index_t group;
|
xkb_layout_index_t group;
|
||||||
xkb_level_index_t level;
|
|
||||||
bool got_one_group, got_one_level;
|
bool got_one_group, got_one_level;
|
||||||
|
|
||||||
group = 0;
|
group = 0;
|
||||||
do {
|
do {
|
||||||
|
xkb_level_index_t level = 0;
|
||||||
got_one_group = false;
|
got_one_group = false;
|
||||||
level = 0;
|
|
||||||
do {
|
do {
|
||||||
got_one_level = false;
|
got_one_level = false;
|
||||||
xkb_keys_foreach(key, keymap) {
|
xkb_keys_foreach(key, keymap) {
|
||||||
|
@ -1299,8 +1298,8 @@ FindKeyForSymbol(struct xkb_keymap *keymap, xkb_keysym_t sym)
|
||||||
static xkb_atom_t
|
static xkb_atom_t
|
||||||
FindAutomaticType(struct xkb_context *ctx, GroupInfo *groupi)
|
FindAutomaticType(struct xkb_context *ctx, GroupInfo *groupi)
|
||||||
{
|
{
|
||||||
xkb_keysym_t sym0, sym1, sym2, sym3;
|
xkb_keysym_t sym0, sym1;
|
||||||
xkb_level_index_t width = darray_size(groupi->levels);
|
const xkb_level_index_t width = darray_size(groupi->levels);
|
||||||
|
|
||||||
#define GET_SYM(level) \
|
#define GET_SYM(level) \
|
||||||
(darray_item(groupi->levels, level).num_syms == 0 ? \
|
(darray_item(groupi->levels, level).num_syms == 0 ? \
|
||||||
|
@ -1328,6 +1327,7 @@ FindAutomaticType(struct xkb_context *ctx, GroupInfo *groupi)
|
||||||
|
|
||||||
if (width <= 4) {
|
if (width <= 4) {
|
||||||
if (xkb_keysym_is_lower(sym0) && xkb_keysym_is_upper(sym1)) {
|
if (xkb_keysym_is_lower(sym0) && xkb_keysym_is_upper(sym1)) {
|
||||||
|
xkb_keysym_t sym2, sym3;
|
||||||
sym2 = GET_SYM(2);
|
sym2 = GET_SYM(2);
|
||||||
sym3 = (width == 4 ? GET_SYM(3) : XKB_KEY_NoSymbol);
|
sym3 = (width == 4 ? GET_SYM(3) : XKB_KEY_NoSymbol);
|
||||||
|
|
||||||
|
|
|
@ -174,8 +174,6 @@ static void
|
||||||
MergeIncludedKeyTypes(KeyTypesInfo *into, KeyTypesInfo *from,
|
MergeIncludedKeyTypes(KeyTypesInfo *into, KeyTypesInfo *from,
|
||||||
enum merge_mode merge)
|
enum merge_mode merge)
|
||||||
{
|
{
|
||||||
KeyTypeInfo *type;
|
|
||||||
|
|
||||||
if (from->errorCount > 0) {
|
if (from->errorCount > 0) {
|
||||||
into->errorCount += from->errorCount;
|
into->errorCount += from->errorCount;
|
||||||
return;
|
return;
|
||||||
|
@ -193,6 +191,7 @@ MergeIncludedKeyTypes(KeyTypesInfo *into, KeyTypesInfo *from,
|
||||||
darray_init(from->types);
|
darray_init(from->types);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
KeyTypeInfo *type;
|
||||||
darray_foreach(type, from->types) {
|
darray_foreach(type, from->types) {
|
||||||
type->merge = (merge == MERGE_DEFAULT ? type->merge : merge);
|
type->merge = (merge == MERGE_DEFAULT ? type->merge : merge);
|
||||||
if (!AddKeyType(into, type, false))
|
if (!AddKeyType(into, type, false))
|
||||||
|
|
Loading…
Reference in New Issue