[Freeciv-Dev] Re: [PATCH] Cleanup of common/shared.c and related files.
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Jeff Mallatt <jjm@xxxxxxxxxxxx> writes:
> At 2000/08/08 12:35 , Gaute (B) Strokkenes wrote:
> >
> >This patch fixes a minor 64bit bug (int_to_text ()) would break if
> >ints are 64 bits,) adds a missing prototype, removes an obsolete
> >define (WIPEBIT) and adds lots of comments.
>
> A couple of things. First, we prefer to not re-format code that isn't
> being changed. And, if we re-format, we prefer to conform to "indent -kr
> -i2" (as specified on the web site and in the hackers guide).
Well, I just found stuff like
if(*cp!='\n')
very hard on my poor eyes, so I added a few spaces since I was in the
neighbourhood anyway. It's no big deal to me. (I just ran shared.c
through indent -kr -i2. Looking at it superficially, it was even more
aggressive about adding spaces, if anything. I'm not aware of any
other way that I broke with K&R style, so if I did I would be grateful
if you pointed it out to me, so that the incident does not repeat
itself.)
> Second, we're moving common code out of the individual GUIs, not into it.
> Even simple code, like the motto string.
My thought was that putting it in common bloated the server
unnecessarily, but more importantly I thought it would confuse an
outsider who is going through the Freeciv internals (that would be
me.) What about client/climisc.c ? Or what about putting
#define FREECIV_MOTTO N_("bla-bla")
somewhere appropriate?
Also, I'd like to point out that I wasn't just rewriting int_to_text()
because I felt like it; the main point was to make it easier to
internationalise. I'm sorry if that wasn't clear. In non-American
locales, grouping of digits does not have to occur "regularly," by
which I mean that
US 1,234,567
-> 1,23,4567
is entirely possible, just to pick an arbitrary example. ANSI C has a
way to specify this via localeconv() and struct lconv (which is a lame
interface anyway, but it's what we're stuck with.) Doing this
properly pretty much forces you to go through the number you're
formatting from right to left because of the way this information is
specified, hence my change.
--
Big Gaute (not to be confused with LG)
I'll clean your ROOM!! I know some GOOD stories, too!! All about
ROAD Island's, HUSH Puppies, and how LUKE finds GOLD on his LAND!!
|
|