delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/09/30/08:28:42

From: "Johan Venter" <jventer AT writeme DOT com>
Newsgroups: comp.os.msdos.djgpp
References: <KoXyN35vg1q8HZF3EIU5c3sceTlu AT 4ax DOT com>
Subject: Re: What is MID() macro ?
Lines: 29
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Message-ID: <%jHI3.30026$ei1.52479@newsfeeds.bigpond.com>
Date: Thu, 30 Sep 1999 11:36:33 +1000
NNTP-Posting-Host: 139.134.163.113
X-Trace: newsfeeds.bigpond.com 938688891 139.134.163.113 (Thu, 30 Sep 1999 20:54:51 EST)
NNTP-Posting-Date: Thu, 30 Sep 1999 20:54:51 EST
Organization: Telstra BigPond Internet Services (http://www.bigpond.com)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Kevin <krugman AT nospam DOT demon DOT co DOT uk> wrote in message
news:KoXyN35vg1q8HZF3EIU5c3sceTlu AT 4ax DOT com...
> Hi all
>
> In the Allegro ex22.c program, a macro called MID is used thus
>
> col = MID(128, 255 - fixtoi(v1->z + v2->z) / 16, 255);
>
> I've not seen MID() before, what is it and where is it
> declared/defined ?.

From allegro.h:

#define MIN(x,y)     (((x) < (y)) ? (x) : (y))
#define MAX(x,y)     (((x) > (y)) ? (x) : (y))
#define MID(x,y,z)   MAX((x), MIN((y), (z)))

From my understanding of that, it finds the middle number of the three passed to
it.

--
Johan Venter
ICQ 3643877 - jventer AT writeme DOT com
The TPU DJGPP Interest Group - http://surf.to/djgppig
The RSXNTDJ 1.5 HOWTO - http://surf.to/rsxntdj




- Raw text -


  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019