[Freeciv-Dev] Re: [patch] const-int-ize SETTINGS_NUM
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
> 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
|
|