From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11132 invoked by alias); 14 Nov 2008 14:30:44 -0000 Received: (qmail 11069 invoked by uid 22791); 14 Nov 2008 14:30:43 -0000 X-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_31 X-Spam-Check-By: sourceware.org Received: from hermes.mlbassoc.com (HELO mail.chez-thomas.org) (204.133.123.27) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 14 Nov 2008 14:30:04 +0000 Received: by mail.chez-thomas.org (Postfix, from userid 999) id 246C63B5261A; Fri, 14 Nov 2008 07:30:02 -0700 (MST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on hermes.chez-thomas.org X-Spam-Level: Received: from hermes.chez-thomas.org (hermes_local [192.168.1.101]) by mail.chez-thomas.org (Postfix) with ESMTP id C07F13B5261A; Fri, 14 Nov 2008 07:30:01 -0700 (MST) Message-ID: <491D8B69.80403@mlbassoc.com> Date: Fri, 14 Nov 2008 14:30:00 -0000 From: Gary Thomas User-Agent: Thunderbird 2.0.0.16 (X11/20080723) MIME-Version: 1.0 To: Jonathan Larmour CC: ecos-patches@ecos.sourceware.org Subject: Re: [issue 1000636] tidy tm_basic max macro References: <20081114140934.634C410C2A6@dargo.barn.ecoscentric.com> In-Reply-To: <20081114140934.634C410C2A6@dargo.barn.ecoscentric.com> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact ecos-patches-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-patches-owner@ecos.sourceware.org X-SW-Source: 2008-11/txt/msg00043.txt.bz2 Jonathan Larmour wrote: > Index: ChangeLog > =================================================================== > RCS file: /cvs/ecos/ecos/packages/kernel/current/ChangeLog,v > retrieving revision 1.144 > diff -u -5 -p -r1.144 ChangeLog > --- ChangeLog 15 Sep 2007 14:42:39 -0000 1.144 > +++ ChangeLog 14 Nov 2008 14:09:32 -0000 > @@ -1,5 +1,10 @@ > +2008-11-14 Jonathan Larmour > + > + * tests/tm_basic.cxx (max): Resolve issue 1000636 with extra > + bracketing. > + > 2007-08-23 Hans Rosenfeld > > * tests/intr0.cxx, tests/kintr0.c: As suggested by Bart Veer, > priorities of the interrupts created by intr0 and kintr0 can now > be overridden by the HAL through HAL_INTR_TEST_PRIO_x constants. > Index: tests/tm_basic.cxx > =================================================================== > RCS file: /cvs/ecos/ecos/packages/kernel/current/tests/tm_basic.cxx,v > retrieving revision 1.23 > diff -u -5 -p -r1.23 tm_basic.cxx > --- tests/tm_basic.cxx 8 Jan 2007 16:20:14 -0000 1.23 > +++ tests/tm_basic.cxx 14 Nov 2008 14:09:33 -0000 > @@ -208,11 +208,11 @@ void run_semaphore_circuit_test(void); > void run_counter_tests(void); > void run_flag_tests(void); > void run_alarm_tests(void); > > #ifndef max > -#define max(n,m) (m > n ? n : m) > +#define max(n,m) ((m) > (n) ? (n) : (m)) > #endif > > // Wait until a clock tick [real time clock] has passed. This should keep it > // from happening again during a measurement, thus minimizing any fluctuations > void Hmm - this seems to be backwards (been so forever?) I see that you changed it the other way around. Is/was the macro 'max()' defined someplace, maybe by a compiler, etc? Did this change, or how did we get away with this for a decade? -- ------------------------------------------------------------ Gary Thomas | Consulting for the MLB Associates | Embedded world ------------------------------------------------------------