xkbcomp: make a couple of casts explicit to mark them as checked

This acknowledges some "possible loss of data cast" warnings from MSVC.

Signed-off-by: Ran Benita <ran@unusedvar.com>
master
Ran Benita 2019-12-27 21:51:34 +02:00
parent f967d46b65
commit fbd0e643d8
2 changed files with 5 additions and 2 deletions

View File

@ -384,7 +384,8 @@ HandleKeycodeDef(KeyNamesInfo *info, KeycodeDef *stmt, enum merge_mode merge)
return false;
}
return AddKeyName(info, stmt->value, stmt->name, merge, false, true);
return AddKeyName(info, (xkb_keycode_t) stmt->value,
stmt->name, merge, false, true);
}
static bool

View File

@ -50,7 +50,9 @@ number(struct scanner *s, int64_t *out, int *out_tok)
if (is_hex)
*out = strtoul(start, &end, 16);
else if (is_float)
*out = strtod(start, &end);
/* The parser currently just ignores floats, so the cast is
* fine - the value doesn't matter. */
*out = (int64_t) strtod(start, &end);
else
*out = strtoul(start, &end, 10);
if (errno != 0 || s->s + s->pos != end)