From owner-svn-src-head@FreeBSD.ORG Tue Aug 6 16:48:19 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 05DCDE13; Tue, 6 Aug 2013 16:48:19 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CEFA728AD; Tue, 6 Aug 2013 16:48:18 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1V6kQe-0006l9-44; Tue, 06 Aug 2013 16:48:12 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r76Gm9OK027795; Tue, 6 Aug 2013 10:48:09 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/W96/UDAa/Z3GkN6nRuOos Subject: Re: svn commit: r253995 - in head/usr.sbin: rtadvd rtsold From: Ian Lepore To: Hiroki Sato In-Reply-To: <201308061549.r76FnImt054058@svn.freebsd.org> References: <201308061549.r76FnImt054058@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Tue, 06 Aug 2013 10:48:09 -0600 Message-ID: <1375807689.3320.48.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Aug 2013 16:48:19 -0000 On Tue, 2013-08-06 at 15:49 +0000, Hiroki Sato wrote: > Author: hrs > Date: Tue Aug 6 15:49:18 2013 > New Revision: 253995 > URL: http://svnweb.freebsd.org/changeset/base/253995 > > Log: > Fix build on arm and mips. > > Modified: > head/usr.sbin/rtadvd/timer.c > head/usr.sbin/rtsold/rtsold.c > > Modified: head/usr.sbin/rtadvd/timer.c > ============================================================================== > --- head/usr.sbin/rtadvd/timer.c Tue Aug 6 15:34:11 2013 (r253994) > +++ head/usr.sbin/rtadvd/timer.c Tue Aug 6 15:49:18 2013 (r253995) > @@ -59,11 +59,8 @@ void > rtadvd_timer_init(void) > { > /* Generate maximum time in timespec. */ > - memset(&tm_limit.tv_sec, 0xff, sizeof(tm_limit.tv_sec)); > - memset(&tm_limit.tv_nsec, 0xff, sizeof(tm_limit.tv_nsec)); > - tm_limit.tv_sec &= ~(1UL << (sizeof(tm_limit.tv_sec) * 8 - 1)); > - tm_limit.tv_nsec &= ~(1UL << (sizeof(tm_limit.tv_nsec) * 8 - 1)); > - > + tm_limit.tv_sec = (-1) & ~((time_t)1 << ((sizeof(tm_max.tv_sec) * 8) - 1)); > + tm_limit.tv_nsec = (-1) & ~((long)1 << ((sizeof(tm_max.tv_nsec) * 8) - 1)); > tm_max = tm_limit; > TAILQ_INIT(&ra_timer); > } > > Modified: head/usr.sbin/rtsold/rtsold.c > ============================================================================== > --- head/usr.sbin/rtsold/rtsold.c Tue Aug 6 15:34:11 2013 (r253994) > +++ head/usr.sbin/rtsold/rtsold.c Tue Aug 6 15:49:18 2013 (r253995) > @@ -188,10 +188,8 @@ main(int argc, char **argv) > } > > /* Generate maximum time in timespec. */ > - memset(&tm_max.tv_sec, 0xff, sizeof(tm_max.tv_sec)); > - memset(&tm_max.tv_nsec, 0xff, sizeof(tm_max.tv_nsec)); > - tm_max.tv_sec &= ~(1UL << (sizeof(tm_max.tv_sec) * 8 - 1)); > - tm_max.tv_nsec &= ~(1UL << (sizeof(tm_max.tv_nsec) * 8 - 1)); > + tm_max.tv_sec = (-1) & ~((time_t)1 << ((sizeof(tm_max.tv_sec) * 8) - 1)); > + tm_max.tv_nsec = (-1) & ~((long)1 << ((sizeof(tm_max.tv_nsec) * 8) - 1)); > > /* set log level */ > if (dflag > 1) The maximum number of nsec is 999999999 regardless of the type of tv_nsec. That expression for max time_t sure is ugly, but I can't think of anything that isn't just differently-ugly. At least the comment makes the purpose clear. -- Ian