From fnaumann@mail.cs.uni-magdeburg.de  Tue Aug  3 10:02:40 2004
X-Envelope-From: Martin_Elsaesser@ll.maus.de
X-Envelope-To: <mint@fishpool.com>
From: Martin_Elsaesser@ll.maus.de (=?ISO-8859-1?Q?Martin_Els=E4sser?=)
To: mint@fishpool.com
Subject: [MiNT] Freemint sys/params.h
Message-ID: <200408030743.p60311@ll.maus.de>
In-Reply-To: <1091482952.4487.21.camel@localhost>
Date: Tue, 3 Aug 2004 07:43:00 +0200
Organization: MAUS Schondorf/Landsberg (+49-8192-9969999)
X-Gateway: b3.maus.de gb1.1r 102698.1858
X-Gateway-Administrator: postmaster@b3.maus.de
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Lines: 32
X-MIME-Autoconverted: from 8bit to quoted-printable by hirsch.in-berlin.de id i737e2IB006283
Delivered-To: mint@fishpool.com
Delivered-To: mint@lists.fishpool.fi
X-ecartis-version: Ecartis v1.0.0
Sender: mint-bounce@lists.fishpool.fi
Errors-to: mint-bounce@lists.fishpool.fi
X-original-sender: Martin_Elsaesser@ll.maus.de
Precedence: bulk
List-help: <mailto:ecartis@lists.fishpool.fi?Subject=help>
List-unsubscribe: <mailto:mint-request@lists.fishpool.fi?Subject=unsubscribe>
List-ID: <mint.lists.fishpool.fi>
X-List-ID: <mint.lists.fishpool.fi>
X-Milter: ClamAV 0.70/0.70kjel
X-Milter: milter-regex 1.5jel
X-Milter: ClamAV 0.70/0.70kjel
X-Milter: milter-regex 1.5jel
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by prinz.cs.uni-magdeburg.de id i7382OeI008503

Hallo Mark,

MD>2, I don't know what MAX does here.

It's very simple. Look on the substitution if you call

   int i = 3;
   int j = 4;
   int k = MAX(i++, j--);

After your macro is evaluated, you get

   int i = 3;
   int j = 4;
   k = (i++ > j-- ? i++ : j--);

with the result of k=3 since j is decremented twice. And after the original
macro you get

   int i = 3;
   int j = 4;
   k = ({int _a = i++; int _b = j++;  \
              _a > _b ? _a : _b; });

with the result of k=4 since j is decremented once. That's the difference:
the "original" macro you found behaves more like a function call.

Gruß

     Martin    [PGP-Key available]
---
Für Mails >16 kByte: martin@melsaesser.de


