Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: [patch] const-int-ize SETTINGS_NUM
Home

[Freeciv-Dev] Re: [patch] const-int-ize SETTINGS_NUM

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Trent Piepho <xyzzy@xxxxxxxxxxxxx>
Cc: <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [patch] const-int-ize SETTINGS_NUM
From: Justin Moore <justin@xxxxxxxxxxx>
Date: Wed, 15 Aug 2001 14:05:57 -0400 (EDT)

> Also, this code,
> #define NUM_X (sizeof(X)/sizeof(X[0])), is a common construct in C
> programming.  I've probably written that hundreds of times and I see it all
> over the place.  I've never seen anyone want to assign it to a global
> variable.

   I'm familiar with the construct and is actually used in my
scorelog.[ch] patch.  I've always seen it as a const int, though, usually
because it's used entirely in a looping construct.  I guess I'll go back
and harrass the programmer(s) from whom I picked up this bad habit. :)

-jdm



[Prev in Thread] Current Thread [Next in Thread]