diff options
author | 2012-08-04 11:07:42 -0700 | |
---|---|---|
committer | 2012-08-04 11:34:45 -0700 | |
commit | b904aa78e854b55414a5f6ea0a995fe9a852ee99 (patch) | |
tree | 9c0a2c408ef2c0fccd56ffd3a7bc0cbd01d48d29 /complete.cpp | |
parent | 8185bee4b83ce94f098cd07a360a0d78ad781c78 (diff) |
Additional warning cleanup and switching from int to size_t where appropriate
Diffstat (limited to 'complete.cpp')
-rw-r--r-- | complete.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/complete.cpp b/complete.cpp index df95ae58..e2bb336b 100644 --- a/complete.cpp +++ b/complete.cpp @@ -1722,14 +1722,12 @@ void complete( const wcstring &cmd, std::vector<completion_t> &comps, complete_t completer_t completer(cmd, type); const wchar_t *tok_begin, *tok_end, *cmdsubst_begin, *cmdsubst_end, *prev_begin, *prev_end; - wcstring buff; tokenizer tok; const wchar_t *current_token=0, *prev_token=0; wcstring current_command; int on_command=0; - int pos; + size_t pos; bool done=false; - int cursor_pos; int use_command = 1; int use_function = 1; int use_builtin = 1; @@ -1737,7 +1735,7 @@ void complete( const wcstring &cmd, std::vector<completion_t> &comps, complete_t // debug( 1, L"Complete '%ls'", cmd ); - cursor_pos = cmd.size(); + size_t cursor_pos = cmd.size(); const wchar_t *cmd_cstr = cmd.c_str(); parse_util_cmdsubst_extent( cmd_cstr, cursor_pos, &cmdsubst_begin, &cmdsubst_end ); @@ -1762,7 +1760,7 @@ void complete( const wcstring &cmd, std::vector<completion_t> &comps, complete_t { pos = cursor_pos-(cmdsubst_begin-cmd_cstr); - buff = wcstring( cmdsubst_begin, cmdsubst_end-cmdsubst_begin ); + wcstring buff = wcstring( cmdsubst_begin, cmdsubst_end-cmdsubst_begin ); int had_cmd=0; int end_loop=0; @@ -1805,11 +1803,9 @@ void complete( const wcstring &cmd, std::vector<completion_t> &comps, complete_t if( !is_ddash || ( (use_command && use_function && use_builtin ) ) ) { - int token_end; - current_command = ncmd; - token_end = tok_get_pos( &tok ) + ncmd.size(); + size_t token_end = tok_get_pos( &tok ) + ncmd.size(); on_command = (pos <= token_end ); had_cmd=1; |