projects
/
platform
/
upstream
/
libxkbcommon.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix build error
[platform/upstream/libxkbcommon.git]
/
src
/
text.c
diff --git
a/src/text.c
b/src/text.c
index
a70c3d9
..
3c8ffd3
100644
(file)
--- a/
src/text.c
+++ b/
src/text.c
@@
-24,6
+24,8
@@
*
********************************************************/
*
********************************************************/
+#include "config.h"
+
#include "keymap.h"
#include "text.h"
#include "keymap.h"
#include "text.h"
@@
-204,19
+206,23
@@
const LookupEntry symInterpretMatchMaskNames[] = {
{ "AnyOf", MATCH_ANY },
{ "AllOf", MATCH_ALL },
{ "Exactly", MATCH_EXACTLY },
{ "AnyOf", MATCH_ANY },
{ "AllOf", MATCH_ALL },
{ "Exactly", MATCH_EXACTLY },
+ { NULL, 0 },
};
const char *
};
const char *
-ModIndexText(const struct xkb_keymap *keymap, xkb_mod_index_t ndx)
+ModIndexText(struct xkb_context *ctx, const struct xkb_mod_set *mods,
+ xkb_mod_index_t ndx)
{
if (ndx == XKB_MOD_INVALID)
return "none";
{
if (ndx == XKB_MOD_INVALID)
return "none";
- if (ndx >= darray_size(keymap->mods.mods))
+ if (ndx == XKB_MOD_NONE)
+ return "None";
+
+ if (ndx >= mods->num_mods)
return NULL;
return NULL;
- return xkb_atom_text(keymap->ctx,
- darray_item(keymap->mods.mods, ndx).name);
+ return xkb_atom_text(ctx, mods->mods[ndx].name);
}
const char *
}
const char *
@@
-251,9
+257,10
@@
SIMatchText(enum xkb_match_operation type)
}
const char *
}
const char *
-ModMaskText(const struct xkb_keymap *keymap, xkb_mod_mask_t mask)
+ModMaskText(struct xkb_context *ctx, const struct xkb_mod_set *mods,
+ xkb_mod_mask_t mask)
{
{
- char buf[1024];
+ char buf[1024]
= {0}
;
size_t pos = 0;
xkb_mod_index_t i;
const struct xkb_mod *mod;
size_t pos = 0;
xkb_mod_index_t i;
const struct xkb_mod *mod;
@@
-264,7
+271,7
@@
ModMaskText(const struct xkb_keymap *keymap, xkb_mod_mask_t mask)
if (mask == MOD_REAL_MASK_ALL)
return "all";
if (mask == MOD_REAL_MASK_ALL)
return "all";
-
darray_enumerate(i, mod, keymap->mods.
mods) {
+
xkb_mods_enumerate(i, mod,
mods) {
int ret;
if (!(mask & (1u << i)))
int ret;
if (!(mask & (1u << i)))
@@
-272,20
+279,20
@@
ModMaskText(const struct xkb_keymap *keymap, xkb_mod_mask_t mask)
ret = snprintf(buf + pos, sizeof(buf) - pos, "%s%s",
pos == 0 ? "" : "+",
ret = snprintf(buf + pos, sizeof(buf) - pos, "%s%s",
pos == 0 ? "" : "+",
- xkb_atom_text(
keymap->
ctx, mod->name));
+ xkb_atom_text(ctx, mod->name));
if (ret <= 0 || pos + ret >= sizeof(buf))
break;
else
pos += ret;
}
if (ret <= 0 || pos + ret >= sizeof(buf))
break;
else
pos += ret;
}
- return str
cpy(xkb_context_get_buffer(keymap->ctx, pos + 1), buf
);
+ return str
ncpy(xkb_context_get_buffer(ctx, pos + 1), buf, pos + 1
);
}
const char *
LedStateMaskText(struct xkb_context *ctx, enum xkb_state_component mask)
{
}
const char *
LedStateMaskText(struct xkb_context *ctx, enum xkb_state_component mask)
{
- char buf[1024];
+ char buf[1024]
= {0}
;
size_t pos = 0;
if (mask == 0)
size_t pos = 0;
if (mask == 0)
@@
-308,13
+315,13
@@
LedStateMaskText(struct xkb_context *ctx, enum xkb_state_component mask)
pos += ret;
}
pos += ret;
}
- return str
cpy(xkb_context_get_buffer(ctx, pos + 1), buf
);
+ return str
ncpy(xkb_context_get_buffer(ctx, pos + 1), buf, pos + 1
);
}
const char *
ControlMaskText(struct xkb_context *ctx, enum xkb_action_controls mask)
{
}
const char *
ControlMaskText(struct xkb_context *ctx, enum xkb_action_controls mask)
{
- char buf[1024];
+ char buf[1024]
= {0}
;
size_t pos = 0;
if (mask == 0)
size_t pos = 0;
if (mask == 0)
@@
-340,5
+347,5
@@
ControlMaskText(struct xkb_context *ctx, enum xkb_action_controls mask)
pos += ret;
}
pos += ret;
}
- return str
cpy(xkb_context_get_buffer(ctx, pos + 1), buf
);
+ return str
ncpy(xkb_context_get_buffer(ctx, pos + 1), buf, pos + 1
);
}
}