summaryrefslogtreecommitdiff
path: root/src/compose/table.h
diff options
context:
space:
mode:
authorRan Benita <ran@unusedvar.com>2021-03-30 17:52:36 +0300
committerRan Benita <ran@unusedvar.com>2021-03-30 17:52:36 +0300
commit1638409b22aef33d487863876ab214b949db4984 (patch)
treed814fecd96bde91cbad2578bd4e2f0f81ce69a41 /src/compose/table.h
parent127f8c976d93dc27d059bde2a250815c29302c2e (diff)
downloadxorg-lib-libxkbcommon-1638409b22aef33d487863876ab214b949db4984.tar.gz
compose: add a limit of 65535 sequences
Fits in uint16_t, which enables some future optimizations. But also a good idea to have some limit. Not aware of any compose files which come close. Signed-off-by: Ran Benita <ran@unusedvar.com>
Diffstat (limited to 'src/compose/table.h')
-rw-r--r--src/compose/table.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/compose/table.h b/src/compose/table.h
index 05a415f..a051e1b 100644
--- a/src/compose/table.h
+++ b/src/compose/table.h
@@ -68,15 +68,18 @@
* \0 is so offset 0 points to an empty string).
*/
+/* Fits in uint16_t, also a good idea to have some limit. */
+#define MAX_COMPOSE_NODES 65535
+
struct compose_node {
xkb_keysym_t keysym;
/* Offset into xkb_compose_table::nodes. */
- unsigned int next:31;
- bool is_leaf:1;
+ uint16_t next;
+ bool is_leaf;
union {
/* Offset into xkb_compose_table::nodes. */
- uint32_t successor;
+ uint16_t successor;
struct {
/* Offset into xkb_compose_table::utf8. */
uint32_t utf8;