diff options
author | Pedro Alves <palves@redhat.com> | 2013-03-26 20:29:47 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2013-03-26 20:29:47 +0000 |
commit | 2c619be216c9fb729c2696fa10957732290b041a (patch) | |
tree | 2a32eabaa3134e38ff8499bca0fdb3f1c3c8f6cf /gdb | |
parent | 1b493192488ccb9886ffe709864e5f5c0588b004 (diff) | |
download | gdb-2c619be216c9fb729c2696fa10957732290b041a.zip gdb-2c619be216c9fb729c2696fa10957732290b041a.tar.gz gdb-2c619be216c9fb729c2696fa10957732290b041a.tar.bz2 |
ser-tcp.c: Small signed->unsigned cleanup.
The "set tcp connect-timeout" variable is unsigned:
/* Timeout period for connections, in seconds. */
static unsigned int tcp_retry_limit = 15;
And used like:
/* Check for timeout. */
if (*polls > tcp_retry_limit * POLL_INTERVAL)
{
errno = ETIMEDOUT;
return -1;
}
Which made me stop and look over why is it that 'polls' is signed.
What I found is there's really no reason.
gdb/
2013-03-26 Pedro Alves <palves@redhat.com>
* ser-tcp.c (wait_for_connect): Make 'polls' parameter unsigned.
(net_open): Make 'polls' local unsigned.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/ser-tcp.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index eef0a25..cc30754 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2013-03-26 Pedro Alves <palves@redhat.com> + * ser-tcp.c (wait_for_connect): Make 'polls' parameter unsigned. + (net_open): Make 'polls' local unsigned. + +2013-03-26 Pedro Alves <palves@redhat.com> + * remote.c (_initialize_remote): Make "set remoteaddresssize" a zuinteger command instead of uinteger. diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c index 34c6af1..a818c65 100644 --- a/gdb/ser-tcp.c +++ b/gdb/ser-tcp.c @@ -83,7 +83,7 @@ static unsigned int tcp_retry_limit = 15; Returns -1 on timeout or interrupt, otherwise the value of select. */ static int -wait_for_connect (struct serial *scb, int *polls) +wait_for_connect (struct serial *scb, unsigned int *polls) { struct timeval t; int n; @@ -165,7 +165,7 @@ net_open (struct serial *scb, const char *name) #else int ioarg; #endif - int polls = 0; + unsigned int polls = 0; use_udp = 0; if (strncmp (name, "udp:", 4) == 0) |