diff --git a/tools/edit_fallback.hh b/tools/edit_fallback.hh index ebebdc7..e1fa084 100644 --- a/tools/edit_fallback.hh +++ b/tools/edit_fallback.hh @@ -10,7 +10,7 @@ inline void init_lineedit(cs_state &, ostd::string_range) { inline std::optional read_line(cs_state &, cs_svar *pr) { ostd::write(pr->get_value()); - return std::move(ostd::cin.get_line(ostd::appender()).get()); + return ostd::cin.get_line(ostd::appender()).get(); } inline void add_history(cs_state &, ostd::string_range) { diff --git a/tools/edit_linenoise.hh b/tools/edit_linenoise.hh index cdb98d1..582f7bd 100644 --- a/tools/edit_linenoise.hh +++ b/tools/edit_linenoise.hh @@ -72,7 +72,7 @@ inline std::optional read_line(cs_state &, cs_svar *pr) { } std::string ret = line; linenoiseFree(line); - return std::move(ret); + return ret; } inline void add_history(cs_state &, ostd::string_range line) { diff --git a/tools/edit_readline.hh b/tools/edit_readline.hh index 0d97db5..44d39e7 100644 --- a/tools/edit_readline.hh +++ b/tools/edit_readline.hh @@ -76,7 +76,7 @@ inline std::optional read_line(cs_state &, cs_svar *pr) { } std::string ret = line; free(line); - return std::move(ret); + return ret; } inline void add_history(cs_state &, ostd::string_range line) { diff --git a/tools/linenoise.cc b/tools/linenoise.cc index ab92b5c..21bd883 100644 --- a/tools/linenoise.cc +++ b/tools/linenoise.cc @@ -350,7 +350,7 @@ static void freeCompletions(linenoiseCompletions *lc) { static int completeLine(struct linenoiseState *ls) { linenoiseCompletions lc = { 0, NULL }; int nread, nwritten; - char c = 0; + signed char c = 0; completionCallback(ls->buf,&lc); if (lc.len == 0) { @@ -793,9 +793,9 @@ static int linenoiseEdit(int stdin_fd, int stdout_fd, char *buf, size_t buflen, if (write(l.ofd,prompt,l.plen) == -1) return -1; while(1) { - char c; + signed char c; int nread; - char seq[3]; + signed char seq[3]; nread = read(l.ifd,&c,1); if (nread <= 0) return l.len; diff --git a/tools/repl.cc b/tools/repl.cc index aca84e3..027d5a4 100644 --- a/tools/repl.cc +++ b/tools/repl.cc @@ -371,7 +371,7 @@ endargs: return 0; } else { std::string str; - for (char c = '\0'; (c = ostd::cin.get_char()) != EOF;) { + for (signed char c = '\0'; (c = ostd::cin.get_char()) != EOF;) { str += c; } do_call(gcs, str);