Browse Source

fix warnings

master
Daniel Kolesa 7 months ago
parent
commit
3224a33645
5 changed files with 7 additions and 7 deletions
  1. +1
    -1
      tools/edit_fallback.hh
  2. +1
    -1
      tools/edit_linenoise.hh
  3. +1
    -1
      tools/edit_readline.hh
  4. +3
    -3
      tools/linenoise.cc
  5. +1
    -1
      tools/repl.cc

+ 1
- 1
tools/edit_fallback.hh View File

@ -10,7 +10,7 @@ inline void init_lineedit(cs_state &, ostd::string_range) {
inline std::optional<std::string> read_line(cs_state &, cs_svar *pr) {
ostd::write(pr->get_value());
return std::move(ostd::cin.get_line(ostd::appender<std::string>()).get());
return ostd::cin.get_line(ostd::appender<std::string>()).get();
}
inline void add_history(cs_state &, ostd::string_range) {


+ 1
- 1
tools/edit_linenoise.hh View File

@ -72,7 +72,7 @@ inline std::optional<std::string> 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) {


+ 1
- 1
tools/edit_readline.hh View File

@ -76,7 +76,7 @@ inline std::optional<std::string> 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) {


+ 3
- 3
tools/linenoise.cc View File

@ -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;


+ 1
- 1
tools/repl.cc View File

@ -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);


Loading…
Cancel
Save