From owner-freebsd-chat Fri Mar 16 12: 6:33 2001 Delivered-To: freebsd-chat@freebsd.org Received: from probity.mcc.ac.uk (probity.mcc.ac.uk [130.88.200.94]) by hub.freebsd.org (Postfix) with ESMTP id 6CCC837B718 for ; Fri, 16 Mar 2001 12:06:30 -0800 (PST) (envelope-from jcm@freebsd-uk.eu.org) Received: from dogma.freebsd-uk.eu.org ([130.88.200.97] ident=root) by probity.mcc.ac.uk with esmtp (Exim 2.05 #4) id 14e0UX-000MXj-00; Fri, 16 Mar 2001 20:06:29 +0000 Received: (from jcm@localhost) by dogma.freebsd-uk.eu.org (8.11.1/8.11.1) id f2GK6Sj34744; Fri, 16 Mar 2001 20:06:28 GMT (envelope-from jcm) Date: Fri, 16 Mar 2001 20:06:28 +0000 From: j mckitrick To: Brooks Davis Cc: freebsd-chat@FreeBSD.ORG Subject: I mean, rule of THUMB when to use macros Message-ID: <20010316200628.A34692@dogma.freebsd-uk.eu.org> References: <20010316182415.A33526@dogma.freebsd-uk.eu.org> <20010316105925.C12128@Odin.AC.HMC.Edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <20010316105925.C12128@Odin.AC.HMC.Edu>; from brooks@one-eyed-alien.net on Fri, Mar 16, 2001 at 10:59:25AM -0800 Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I can't believe I mispelled 'thumb' :-\ | > I'm sure there is one, but when do you make a macro a short function and | > vice versa? | | Pretty much never. There are times when using a macro is a reasonable | thing to do, but IMO, most of them are for readability rather then speed. Hmmm, that's what I'm seeing. | are in hiding repetative arguments to complex function calls like the | macros that declare ioctls (see /usr/include/sys/ioccom.h). That's what I'm using them for. Some repeated groups of statements that are preambles and cleanups for some function calls. Nothing overly complex, but it makes it easier to read. jm -- --------------------------------------------------------------- Jonathon McKitrick -- jcm@freebsd-uk.eu.org "It took the computing power of three C-64s to fly to the Moon. It takes a 486 to run Windows 95. Something is wrong here." --------------------------------------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message