Change previous to use uint32_t for 'interval'.

The value is a random interval in usec obtained by reducing a uint32_t
  value modulo 1000000 (multiplied by a delay in seconds of 1).
The value is then being split into secs+usec and assigned to a timeval
  (and an interval).
With -Wsign-conversion the type has to be either an unsigned 32bit
  type, or a signed 64bit one.  This is just plain stupid.
Warning about conversions between signed and unsigned types really
  only makes sense if the compiler is dynamically tracking the domain
  of the value.
This commit is contained in:
dsl 2014-03-18 20:39:55 +00:00
parent 04f7ce1f23
commit 0f00e137a7

View File

@ -1,4 +1,4 @@
/* $NetBSD: rtsold.c,v 1.39 2014/03/18 19:30:09 christos Exp $ */
/* $NetBSD: rtsold.c,v 1.40 2014/03/18 20:39:55 dsl Exp $ */
/* $KAME: rtsold.c,v 1.77 2004/01/03 01:35:13 itojun Exp $ */
/*
@ -565,7 +565,7 @@ rtsol_timer_update(struct ifinfo *ifinfo)
{
#define MILLION 1000000
#define DADRETRY 10 /* XXX: adhoc */
time_t interval;
uint32_t interval;
struct timeval now;
bzero(&ifinfo->timer, sizeof(ifinfo->timer));