diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2012-08-23 23:56:35 +0200 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2012-08-23 23:56:35 +0200 |
| commit | e4fd839ddaaf3fc68df2cb502a633a2ae6a9f86f (patch) | |
| tree | 681b2a63eb9b9497b97697e3f1479a7b20270427 /src/ncurses.cc | |
| parent | 0d8cce272831cd896d0e69d7c86cc9afc521eb11 (diff) | |
use a strongly typed int CharCount for character counts
Diffstat (limited to 'src/ncurses.cc')
| -rw-r--r-- | src/ncurses.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/ncurses.cc b/src/ncurses.cc index b18e048e..c9dd6bde 100644 --- a/src/ncurses.cc +++ b/src/ncurses.cc @@ -113,7 +113,7 @@ void NCursesClient::draw_window(Window& window) String content = atom.content.content(); if (content[content.length()-1] == '\n') { - addnstr(content.c_str(), content.length() - 1); + addnstr(content.c_str(), (int)content.length() - 1); addch(' '); } else @@ -139,9 +139,9 @@ void NCursesClient::draw_window(Window& window) static int last_status_length = 0; move(max_y, max_x - last_status_length); clrtoeol(); - move(max_y, max_x - status_line.length()); + move(max_y, max_x - (int)status_line.length()); addstr(status_line.c_str()); - last_status_length = status_line.length(); + last_status_length = (int)status_line.length(); } Key NCursesClient::get_key() @@ -179,7 +179,7 @@ String NCursesClient::prompt(const String& text, const Context& context, Complet addstr(text.c_str()); clrtoeol(); - size_t cursor_pos = 0; + CharCount cursor_pos = 0; Completions completions; int current_completion = -1; @@ -285,7 +285,7 @@ String NCursesClient::prompt(const String& text, const Context& context, Complet else completion = completions.candidates[current_completion]; - move(max_y-1, text.length()); + move(max_y-1, (int)text.length()); result = result.substr(0, completions.start) + completion; cursor_pos = completions.start + completion.length(); break; @@ -296,10 +296,10 @@ String NCursesClient::prompt(const String& text, const Context& context, Complet ++cursor_pos; } - move(max_y - 1, text.length()); + move(max_y - 1, (int)text.length()); clrtoeol(); addstr(result.c_str()); - move(max_y - 1, text.length() + cursor_pos); + move(max_y - 1, (int)(text.length() + cursor_pos)); refresh(); } return result; |
