summaryrefslogtreecommitdiff
path: root/src/keysym-utf.c
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2014-01-11 16:40:42 +0200
committerRan Benita <ran234@gmail.com>2014-01-11 17:01:39 +0200
commit31430670df468ee90e260e006e277074a2a9319f (patch)
tree3c0f98c38db97a48fe8747a173e7060ae729e883 /src/keysym-utf.c
parent1d5ae2263a609700ca78de20bdbe07314c8ee636 (diff)
downloadlibxkbcommon-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/keysym-utf.c')
-rw-r--r--src/keysym-utf.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/keysym-utf.c b/src/keysym-utf.c
index 9a96053..129da15 100644
--- a/src/keysym-utf.c
+++ b/src/keysym-utf.c
@@ -840,14 +840,13 @@ bin_search(const struct codepair *table, size_t length, xkb_keysym_t keysym)
{
int first = 0;
int last = length;
- int mid;
if (keysym < table[0].keysym || keysym > table[length].keysym)
return 0;
/* binary search in table */
while (last >= first) {
- mid = (first + last) / 2;
+ int mid = (first + last) / 2;
if (table[mid].keysym < keysym)
first = mid + 1;
else if (table[mid].keysym > keysym)