summaryrefslogtreecommitdiff
path: root/src/context.c
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2012-07-14 15:19:12 +0300
committerRan Benita <ran234@gmail.com>2012-07-14 15:19:12 +0300
commit43bf4136c976c251e973c28d07b63ea542ef3879 (patch)
tree411da1a7617be0afaf1ef2ba9306132d3389360b /src/context.c
parent70683f7debc1ce0e75f11a22acc2828b80be8f26 (diff)
downloadxorg-lib-libxkbcommon-43bf4136c976c251e973c28d07b63ea542ef3879.tar.gz
Fix fileID mess
A few problems here: * In e.g. keycodes.c the fileID field of the Info struct was never initialized to the id of the appropriate file, so it was always 0. There's some code which uses it, mostly for warnings. * Some of the fileID fields were unsigned char, which overflows several times, seeing as the ID in some of our tests can get > 1000 (because we reuse the context). * Some sign mismatches. * fileID vs file_id. Hopefully this fixes everything. I doubt this stuff had ever worked as intended, in xkbcomp or otherwise. Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'src/context.c')
-rw-r--r--src/context.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/context.c b/src/context.c
index 1e28911..b283fc4 100644
--- a/src/context.c
+++ b/src/context.c
@@ -37,7 +37,7 @@ struct xkb_context {
darray(char *) includes;
/* xkbcomp needs to assign sequential IDs to XkbFile's it creates. */
- int file_id;
+ unsigned file_id;
struct atom_table *atom_table;
};
@@ -144,7 +144,7 @@ xkb_context_include_path_get(struct xkb_context *ctx, unsigned int idx)
return darray_item(ctx->includes, idx);
}
-int
+unsigned
xkb_context_take_file_id(struct xkb_context *ctx)
{
return ctx->file_id++;