diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2015-08-16 18:45:42 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2015-08-16 18:45:42 -0700 |
commit | e2f16ec20e1e47a76746fefc252a1f9c548b7766 (patch) | |
tree | cd399dc3eb5f8f091c02b3486035b9c57e6b9a35 /src/input.cpp | |
parent | b615534d8d67e1891437277fa781196111426f80 (diff) |
Define a constant for function-not-found in input.cpp
Avoids differences in widths of wchar_t, hopefully addressing
issue #2284
Diffstat (limited to 'src/input.cpp')
-rw-r--r-- | src/input.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/input.cpp b/src/input.cpp index d8977be3..2b556c2a 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -557,7 +557,7 @@ static void input_mapping_execute(const input_mapping_t &m, bool allow_commands) for (wcstring_list_t::const_iterator it = m.commands.begin(), end = m.commands.end(); it != end; ++it) { - if (input_function_get_code(*it) != -1) + if (input_function_get_code(*it) != INPUT_CODE_NONE) has_functions = true; else has_commands = true; @@ -1103,14 +1103,12 @@ wcstring_list_t input_function_get_names(void) wchar_t input_function_get_code(const wcstring &name) { - - size_t i; - for (i = 0; i<(sizeof(code_arr)/sizeof(wchar_t)) ; i++) + for (size_t i=0; i < sizeof code_arr / sizeof *code_arr; i++) { if (name == name_arr[i]) { return code_arr[i]; } } - return -1; + return INPUT_CODE_NONE; } |