diff options
-rw-r--r-- | src/flash/mflash.c | 3 | ||||
-rw-r--r-- | src/helper/jim.c | 6 | ||||
-rw-r--r-- | src/server/gdb_server.c | 2 | ||||
-rw-r--r-- | src/server/tcl_server.c | 2 | ||||
-rw-r--r-- | src/server/telnet_server.c | 14 | ||||
-rw-r--r-- | src/svf/svf.c | 3 |
6 files changed, 16 insertions, 14 deletions
diff --git a/src/flash/mflash.c b/src/flash/mflash.c index 123d61ce..5c8ca8c1 100644 --- a/src/flash/mflash.c +++ b/src/flash/mflash.c @@ -1345,7 +1345,8 @@ COMMAND_HANDLER(mg_bank_cmd) char *str; mflash_bank->rst_pin.num = strtoul(CMD_ARGV[2], &str, 0); if (*str) - mflash_bank->rst_pin.port[0] = (uint16_t)tolower(str[0]); + mflash_bank->rst_pin.port[0] = (uint16_t) + tolower((unsigned)str[0]); mflash_bank->target = target; diff --git a/src/helper/jim.c b/src/helper/jim.c index c04acf09..53d1a75e 100644 --- a/src/helper/jim.c +++ b/src/helper/jim.c @@ -2217,7 +2217,7 @@ static Jim_Obj *JimStringToLower(Jim_Interp *interp, Jim_Obj *strObjPtr) memcpy(buf, strObjPtr->bytes, strObjPtr->length + 1); for (i = 0; i < strObjPtr->length; i++) - buf[i] = tolower(buf[i]); + buf[i] = tolower((unsigned)buf[i]); return Jim_NewStringObjNoAlloc(interp, buf, strObjPtr->length); } @@ -2233,7 +2233,7 @@ static Jim_Obj *JimStringToUpper(Jim_Interp *interp, Jim_Obj *strObjPtr) memcpy(buf, strObjPtr->bytes, strObjPtr->length + 1); for (i = 0; i < strObjPtr->length; i++) - buf[i] = toupper(buf[i]); + buf[i] = toupper((unsigned)buf[i]); return Jim_NewStringObjNoAlloc(interp, buf, strObjPtr->length); } @@ -2347,7 +2347,7 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr, case '8': case '9': accum = 0; - while (isdigit(*fmt) && (fmtLen > 0)) { + while (isdigit((unsigned)*fmt) && (fmtLen > 0)) { accum = (accum * 10) + (*fmt - '0'); fmt++; fmtLen--; } diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index 8798ae03..cf628641 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -943,7 +943,7 @@ void gdb_str_to_target(struct target *target, char *tstr, struct reg *reg) } } -static int hextoint(char c) +static int hextoint(int c) { if (c>='0'&&c<='9') { diff --git a/src/server/tcl_server.c b/src/server/tcl_server.c index 08247686..a772c0ac 100644 --- a/src/server/tcl_server.c +++ b/src/server/tcl_server.c @@ -88,7 +88,7 @@ static int tcl_input(struct connection *connection) const char *result; int reslen; struct tcl_connection *tclc; - char in[256]; + unsigned char in[256]; rlen = read_socket(connection->fd, &in, sizeof(in)); if (rlen <= 0) { diff --git a/src/server/telnet_server.c b/src/server/telnet_server.c index 929c1c16..92e7480b 100644 --- a/src/server/telnet_server.c +++ b/src/server/telnet_server.c @@ -195,8 +195,8 @@ void telnet_clear_line(struct connection *connection, struct telnet_connection * int telnet_input(struct connection *connection) { int bytes_read; - char buffer[TELNET_BUFFER_SIZE]; - char *buf_p; + unsigned char buffer[TELNET_BUFFER_SIZE]; + unsigned char *buf_p; struct telnet_connection *t_con = connection->priv; struct command_context *command_context = connection->cmd_ctx; @@ -216,7 +216,7 @@ int telnet_input(struct connection *connection) switch (t_con->state) { case TELNET_STATE_DATA: - if (*buf_p == '\xff') + if (*buf_p == 0xff) { t_con->state = TELNET_STATE_IAC; } @@ -395,16 +395,16 @@ int telnet_input(struct connection *connection) case TELNET_STATE_IAC: switch (*buf_p) { - case '\xfe': + case 0xfe: t_con->state = TELNET_STATE_DONT; break; - case '\xfd': + case 0xfd: t_con->state = TELNET_STATE_DO; break; - case '\xfc': + case 0xfc: t_con->state = TELNET_STATE_WONT; break; - case '\xfb': + case 0xfb: t_con->state = TELNET_STATE_WILL; break; } diff --git a/src/svf/svf.c b/src/svf/svf.c index 1c746f38..dfdecbcd 100644 --- a/src/svf/svf.c +++ b/src/svf/svf.c @@ -470,7 +470,8 @@ free_all: #define SVFP_CMD_INC_CNT 1024 static int svf_read_command_from_file(int fd) { - char ch, *tmp_buffer = NULL; + unsigned char ch; + char *tmp_buffer = NULL; int cmd_pos = 0, cmd_ok = 0, slash = 0, comment = 0; while (!cmd_ok && (read(fd, &ch, 1) > 0)) |