delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/07/24/08:05:04

Message-ID: <3F1F823D.100FED69@acm.org>
From: Eric Sosman <esosman AT acm DOT org>
X-Mailer: Mozilla 4.72 [en] (Win95; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: malloc question.
References: <84e4e2a9 DOT 0307230454 DOT 730046e5 AT posting DOT google DOT com> <bfm1d7$db6$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE> <84e4e2a9 DOT 0307231619 DOT 53a48663 AT posting DOT google DOT com>
Lines: 28
Date: Thu, 24 Jul 2003 11:51:04 GMT
NNTP-Posting-Host: 12.91.3.172
X-Complaints-To: abuse AT worldnet DOT att DOT net
X-Trace: bgtnsc04-news.ops.worldnet.att.net 1059047464 12.91.3.172 (Thu, 24 Jul 2003 11:51:04 GMT)
NNTP-Posting-Date: Thu, 24 Jul 2003 11:51:04 GMT
Organization: AT&T Worldnet
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Joel wrote:
> 
> Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de> wrote in message news:<bfm1d7$db6$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE>...
> > Joel <jbs30000 AT aol DOT com> wrote:
> > > From here
> > > http://www.delorie.com/djgpp/doc/ug/graphics/vbe20.html
> > > I used code to get protected mode function offsets.  And instead of
> > > using vesa_pm_info I just called it VESA_PM.
> >
> > Please re-think that decision.  By ancient tradition in both C and
> > C++, NAMES_IN_ALL_CAPS are reserved for #define'd macros and possibly
> > enum labels.  You'll mislead anyone else who may get to read your code
> > later.
> >
> Didn't realize about the all caps rule, thanks for the info.

    It isn't really a "rule," but more of an "accepted practice,
subject to sensible exceptions."  For example, C's <stdio.h> header
provides a definition for something called a `FILE' that is quite
often a struct, not a macro; <assert.h> defines `assert' which is
*required* to be a macro despite the lower-case name; and so on.

    Still, if you follow this convention "most of the time" your
code will be somewhat easier for a human reader to understand.

-- 
Eric Sosman
esosman AT acm DOT org

- Raw text -


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