chiark / gitweb /
integer arithmetic types: do not use unsigned for site timeouts etc.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 19 Jun 2011 15:25:26 +0000 (16:25 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Jun 2011 11:07:26 +0000 (12:07 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
hackypar.c
hackypar.h
site.c

index 5c5cd3d013e2022229a7ac3c8a8acaa81f3e5208..31ef14576fab7897aa71d5522fe432ddca6ca628 100644 (file)
@@ -79,7 +79,7 @@ int hacky_par_mid_failnow(void) {
 bool_t (*packy_par_gen)(struct site *st);
 
 void hacky_par_end(int *ok,
-                  int32_t retries, uint32_t timeout,
+                  int32_t retries, int32_t timeout,
                   bool_t (*send_msg)(struct site *st), struct site *st) {
   int i;
   
@@ -115,7 +115,7 @@ void hacky_par_end(int *ok,
 int hacky_par_start_failnow(void) { return 0; }
 int hacky_par_mid_failnow(void) { return 0; }
 void hacky_par_end(int *ok,
-                  int32_t retries, uint32_t timeout,
+                  int32_t retries, int32_t timeout,
                   bool_t (*send_msg)(struct site *st), struct site *st) { }
 
 #endif /*HACKY_PARALLEL...else*/
index c22176ff0536723acff3f977ff8d9e36a96cb310..f47493e9e3406567c97240faf12788d84115dd03 100644 (file)
@@ -11,7 +11,7 @@ struct site;
 int hacky_par_start_failnow(void);
 int hacky_par_mid_failnow(void);
 void hacky_par_end(int *ok,
-                  int32_t retries, uint32_t timeout,
+                  int32_t retries, int32_t timeout,
                   bool_t (*send_msg)(struct site *st), struct site *st);
 
 #endif /* hackympzpar_h */
diff --git a/site.c b/site.c
index d77716ee5281ed13882cee9d4216abbdc4c75648..f3312db4e8e05f5c3b9e98e99dcf08f5c4b24099 100644 (file)
--- a/site.c
+++ b/site.c
@@ -146,10 +146,10 @@ struct site {
     struct hash_if *hash;
 
     int32_t setup_retries; /* How many times to send setup packets */
-    uint32_t setup_timeout; /* Initial timeout for setup packets */
-    uint32_t wait_timeout; /* How long to wait if setup unsuccessful */
-    uint32_t key_lifetime; /* How long a key lasts once set up */
-    uint32_t key_renegotiate_time; /* If we see traffic (or a keepalive)
+    int32_t setup_timeout; /* Initial timeout for setup packets */
+    int32_t wait_timeout; /* How long to wait if setup unsuccessful */
+    int32_t key_lifetime; /* How long a key lasts once set up */
+    int32_t key_renegotiate_time; /* If we see traffic (or a keepalive)
                                      after this time, initiate a new
                                      key exchange */
     bool_t keepalive; /* Send keepalives to detect peer failure (not yet
@@ -187,7 +187,7 @@ struct site {
     uint8_t localN[NONCELEN]; /* Nonces for key exchange */
     uint8_t remoteN[NONCELEN];
     struct buffer_if buffer; /* Current outgoing key exchange packet */
-    uint32_t retries; /* Number of retries remaining */
+    int32_t retries; /* Number of retries remaining */
     uint64_t timeout; /* Timeout for current state */
     uint8_t *dhsecret;
     uint8_t *sharedsecret;