ser-tcp.c: Small signed->unsigned cleanup.
authorPedro Alves <palves@redhat.com>
Tue, 26 Mar 2013 20:29:47 +0000 (20:29 +0000)
committerPedro Alves <palves@redhat.com>
Tue, 26 Mar 2013 20:29:47 +0000 (20:29 +0000)
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.

gdb/ChangeLog
gdb/ser-tcp.c

index eef0a2535b797b6b66695e85d2c8ba014cc41660..cc307547d8f0352b88a919caefc528f3979050b1 100644 (file)
@@ -1,3 +1,8 @@
+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"
index 34c6af1f316eed60ceff3f9fd8d04153a33d6362..a818c657cae26be5e069287b811df10e927d960d 100644 (file)
@@ -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)
This page took 0.02907 seconds and 4 git commands to generate.