aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Schink <openocd-dev@marcschink.de>2017-10-29 19:54:00 +0100
committerSpencer Oliver <spen@spen-soft.co.uk>2017-12-06 21:01:39 +0000
commit5679dc657c9f4530d2137c1b94f8077ab7fb7146 (patch)
tree3586123e11abd86dc3cde5d7c5c97c54f0ca0bdd
parent8bb7021ca8ef9ec9db8ce629a5d4dad5b73b6b07 (diff)
downloadriscv-openocd-5679dc657c9f4530d2137c1b94f8077ab7fb7146.zip
riscv-openocd-5679dc657c9f4530d2137c1b94f8077ab7fb7146.tar.gz
riscv-openocd-5679dc657c9f4530d2137c1b94f8077ab7fb7146.tar.bz2
server/gdb: Use 'bool' instead of 'int' for boolean values
Change-Id: I71c2f2553a29e9ef167ff3313cc06c7b31c64190 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4278 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
-rw-r--r--src/server/gdb_server.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c
index d7fff66..626179c 100644
--- a/src/server/gdb_server.c
+++ b/src/server/gdb_server.c
@@ -71,8 +71,8 @@ struct gdb_connection {
int ctrl_c;
enum target_state frontend_state;
struct image *vflash_image;
- int closed;
- int busy;
+ bool closed;
+ bool busy;
int noack_mode;
/* set flag to true if you want the next stepi to return immediately.
* allowing GDB to pick up a fresh set of register values from the target
@@ -215,7 +215,7 @@ static int gdb_get_char_inner(struct connection *connection, int *next_char)
if (gdb_con->buf_cnt > 0)
break;
if (gdb_con->buf_cnt == 0) {
- gdb_con->closed = 1;
+ gdb_con->closed = true;
return ERROR_SERVER_REMOTE_CLOSED;
}
@@ -227,10 +227,10 @@ static int gdb_get_char_inner(struct connection *connection, int *next_char)
usleep(1000);
break;
case WSAECONNABORTED:
- gdb_con->closed = 1;
+ gdb_con->closed = true;
return ERROR_SERVER_REMOTE_CLOSED;
case WSAECONNRESET:
- gdb_con->closed = 1;
+ gdb_con->closed = true;
return ERROR_SERVER_REMOTE_CLOSED;
default:
LOG_ERROR("read: %d", errno);
@@ -242,14 +242,14 @@ static int gdb_get_char_inner(struct connection *connection, int *next_char)
usleep(1000);
break;
case ECONNABORTED:
- gdb_con->closed = 1;
+ gdb_con->closed = true;
return ERROR_SERVER_REMOTE_CLOSED;
case ECONNRESET:
- gdb_con->closed = 1;
+ gdb_con->closed = true;
return ERROR_SERVER_REMOTE_CLOSED;
default:
LOG_ERROR("read: %s", strerror(errno));
- gdb_con->closed = 1;
+ gdb_con->closed = true;
return ERROR_SERVER_REMOTE_CLOSED;
}
#endif
@@ -341,7 +341,7 @@ static int gdb_write(struct connection *connection, void *data, int len)
if (connection_write(connection, data, len) == len)
return ERROR_OK;
- gdb_con->closed = 1;
+ gdb_con->closed = true;
return ERROR_SERVER_REMOTE_CLOSED;
}
@@ -448,7 +448,7 @@ static int gdb_put_packet_inner(struct connection *connection,
return ERROR_OK;
} else {
LOG_ERROR("unknown character(1) 0x%2.2x in reply, dropping connection", reply);
- gdb_con->closed = 1;
+ gdb_con->closed = true;
return ERROR_SERVER_REMOTE_CLOSED;
}
} else if (reply == '$') {
@@ -458,7 +458,7 @@ static int gdb_put_packet_inner(struct connection *connection,
} else {
LOG_ERROR("unknown character(2) 0x%2.2x in reply, dropping connection",
reply);
- gdb_con->closed = 1;
+ gdb_con->closed = true;
return ERROR_SERVER_REMOTE_CLOSED;
}
}
@@ -471,9 +471,9 @@ static int gdb_put_packet_inner(struct connection *connection,
int gdb_put_packet(struct connection *connection, char *buffer, int len)
{
struct gdb_connection *gdb_con = connection->priv;
- gdb_con->busy = 1;
+ gdb_con->busy = true;
int retval = gdb_put_packet_inner(connection, buffer, len);
- gdb_con->busy = 0;
+ gdb_con->busy = false;
/* we sent some data, reset timer for keep alive messages */
kept_alive();
@@ -679,9 +679,9 @@ static int gdb_get_packet_inner(struct connection *connection,
static int gdb_get_packet(struct connection *connection, char *buffer, int *len)
{
struct gdb_connection *gdb_con = connection->priv;
- gdb_con->busy = 1;
+ gdb_con->busy = true;
int retval = gdb_get_packet_inner(connection, buffer, len);
- gdb_con->busy = 0;
+ gdb_con->busy = false;
return retval;
}
@@ -930,8 +930,8 @@ static int gdb_new_connection(struct connection *connection)
gdb_connection->ctrl_c = 0;
gdb_connection->frontend_state = TARGET_HALTED;
gdb_connection->vflash_image = NULL;
- gdb_connection->closed = 0;
- gdb_connection->busy = 0;
+ gdb_connection->closed = false;
+ gdb_connection->busy = false;
gdb_connection->noack_mode = 0;
gdb_connection->sync = false;
gdb_connection->mem_write_error = false;