delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/30/14:56:36

From: "Damian Yerrick" <die DOT spammers AT pineight DOT 8m DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Purpose of y1() in standard library?
Date: Sun, 29 Aug 1999 22:41:39 -0500
Organization: Rose-Hulman Institute of Technology
Lines: 39
Message-ID: <7qcujs$7a1$1@solomon.cs.rose-hulman.edu>
References: <199908260851 DOT LAA09357 AT ankara DOT Foo DOT COM>
NNTP-Posting-Host: yerricde.laptop.rose-hulman.edu
X-Trace: solomon.cs.rose-hulman.edu 935984572 7489 137.112.205.227 (30 Aug 1999 03:42:52 GMT)
X-Complaints-To: news AT cs DOT rose-hulman DOT edu
NNTP-Posting-Date: 30 Aug 1999 03:42:52 GMT
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
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

S. M. Halloran <mitch AT duzen DOT com DOT tr> wrote in message
news:199908260851 DOT LAA09357 AT ankara DOT Foo DOT COM...
>
> I get warnings in much of my code about my local variable named 'y1'
shadowing
> a global, which is defined the 'math.h'.  Naming variables like 'x1',
'y1',
> 'x2', 'y2' is rather logical for programs that plot pixels and so on, so
it
> would be rather irritating for a global to define itself that way, unless
it
> doesn't really need to be defined as such.

The general rule is make your local variable names short and to the point
because they will only be needed on one page of your program, and make your
global variable names descriptive because by the time you get to page 21,
you will have forgotten what they mean.

> The documentation for the standard library shows no use or purpose for
this
> function for those interfacing with it (C:\>info libc y1).   Perhaps y1()
can
> be re-named or be made part of the module in which it may be called by
only one
> or two calling functions, and therefore be declared static.

Someone screwed up.

> Mitch Halloran
> Research (Bio)chemist
> Duzen Laboratories Group
> Ankara       TURKEY

Gobble this:
http://come.to/yerrick
Full source code for the popular puzzle game DOSArena can be found here.


- Raw text -


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