diff options
author | Raphael Isemann <teemperor@gmail.com> | 2019-09-23 09:46:17 +0000 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2019-09-23 09:46:17 +0000 |
commit | 14f6465c157b36c50ffe431463a9c94efda42b99 (patch) | |
tree | cf3b97187f4a397a53a0a09ef8a033289e7123be /lldb/source/Commands/CommandObjectSettings.cpp | |
parent | 3e2fdbee80b0d14fcdb67cbb3072f43dbec66b38 (diff) | |
download | llvm-14f6465c157b36c50ffe431463a9c94efda42b99.zip llvm-14f6465c157b36c50ffe431463a9c94efda42b99.tar.gz llvm-14f6465c157b36c50ffe431463a9c94efda42b99.tar.bz2 |
[lldb] Make cursor index in CompletionRequest unsigned
The fact that index==-1 means "no arguments" is not obvious and only
used in one place from what I can tell. Also fixes several warnings
about using the cursor index as if it was a size_t when comparing.
Not fully NFC as we now also correctly update the partial argument list
when injecting the fake empty argument in the CompletionRequest
constructor.
llvm-svn: 372566
Diffstat (limited to 'lldb/source/Commands/CommandObjectSettings.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectSettings.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lldb/source/Commands/CommandObjectSettings.cpp b/lldb/source/Commands/CommandObjectSettings.cpp index f1e3bf12..6ed63c1 100644 --- a/lldb/source/Commands/CommandObjectSettings.cpp +++ b/lldb/source/Commands/CommandObjectSettings.cpp @@ -130,9 +130,8 @@ insert-before or insert-after."); const size_t argc = request.GetParsedLine().GetArgumentCount(); const char *arg = nullptr; - int setting_var_idx; - for (setting_var_idx = 0; setting_var_idx < static_cast<int>(argc); - ++setting_var_idx) { + size_t setting_var_idx; + for (setting_var_idx = 0; setting_var_idx < argc; ++setting_var_idx) { arg = request.GetParsedLine().GetArgumentAtIndex(setting_var_idx); if (arg && arg[0] != '-') break; // We found our setting variable name index |