diff options
author | Ran Benita <ran234@gmail.com> | 2014-01-11 16:40:42 +0200 |
---|---|---|
committer | Ran Benita <ran234@gmail.com> | 2014-01-11 17:01:39 +0200 |
commit | 31430670df468ee90e260e006e277074a2a9319f (patch) | |
tree | 3c0f98c38db97a48fe8747a173e7060ae729e883 /src/xkbcomp/action.c | |
parent | 1d5ae2263a609700ca78de20bdbe07314c8ee636 (diff) | |
download | libxkbcommon-31430670df468ee90e260e006e277074a2a9319f.tar.gz libxkbcommon-31430670df468ee90e260e006e277074a2a9319f.tar.bz2 libxkbcommon-31430670df468ee90e260e006e277074a2a9319f.zip |
Fix some cppcheck warnings
Someone was nice enough to run this for us:
ftp://ftp.sunet.se/pub/Linux/distributions/Debian/debian/pool/main/libx/libxkbcommon/libxkbcommon_0.3.1.orig.tar.gz
[libxkbcommon-0.3.1/src/keymap.c:86]: (style) The scope of the variable 'j' can be reduced.
[libxkbcommon-0.3.1/src/keymap.c:87]: (style) The scope of the variable 'key' can be reduced.
[libxkbcommon-0.3.1/src/keysym-utf.c:843]: (style) The scope of the variable 'mid' can be reduced.
[libxkbcommon-0.3.1/src/state.c:992]: (style) The scope of the variable 'str' can be reduced.
[libxkbcommon-0.3.1/src/xkbcomp/action.c:467]: (style) The scope of the variable 'absolute' can be reduced.
[libxkbcommon-0.3.1/src/xkbcomp/rules.c:468]: (style) The scope of the variable 'consumed' can be reduced.
[libxkbcommon-0.3.1/src/xkbcomp/rules.c:862]: (style) The scope of the variable 'mlvo' can be reduced.
[libxkbcommon-0.3.1/src/xkbcomp/rules.c:863]: (style) The scope of the variable 'kccgst' can be reduced.
[libxkbcommon-0.3.1/src/xkbcomp/rules.c:865]: (style) The scope of the variable 'match_type' can be reduced.
[libxkbcommon-0.3.1/src/xkbcomp/symbols.c:753]: (style) The scope of the variable 'toAct' can be reduced.
[libxkbcommon-0.3.1/src/xkbcomp/symbols.c:1573]: (style) The scope of the variable 'key' can be reduced.
[libxkbcommon-0.3.1/test/common.c:80]: (warning) %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'.
[libxkbcommon-0.3.1/test/interactive.c:358]: (style) The scope of the variable 'nevs' can be reduced.
[libxkbcommon-0.3.1/test/interactive.c:236]: (style) Checking if unsigned variable 'nsyms' is less than zero.
[libxkbcommon-0.3.1/test/interactive.c:226]: (style) Unused variable: unicode
Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'src/xkbcomp/action.c')
-rw-r--r-- | src/xkbcomp/action.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/xkbcomp/action.c b/src/xkbcomp/action.c index fed108f..9882c29 100644 --- a/src/xkbcomp/action.c +++ b/src/xkbcomp/action.c @@ -468,18 +468,14 @@ HandleMovePtr(struct xkb_keymap *keymap, union xkb_action *action, const ExprDef *value) { struct xkb_pointer_action *act = &action->ptr; - bool absolute; if (array_ndx && (field == ACTION_FIELD_X || field == ACTION_FIELD_Y)) return ReportActionNotArray(keymap, action->type, field); if (field == ACTION_FIELD_X || field == ACTION_FIELD_Y) { int val; - - if (value->expr.op == EXPR_NEGATE || value->expr.op == EXPR_UNARY_PLUS) - absolute = false; - else - absolute = true; + const bool absolute = (value->expr.op != EXPR_NEGATE && + value->expr.op != EXPR_UNARY_PLUS); if (!ExprResolveInteger(keymap->ctx, value, &val)) return ReportMismatch(keymap, action->type, field, "integer"); |