Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2001:
[Freeciv-Dev] Re: PATCH: mapgen warning removes
Home

[Freeciv-Dev] Re: PATCH: mapgen warning removes

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: PATCH: mapgen warning removes
From: Dirk Stoecker <stoecker@xxxxxxxxxxxxxx>
Date: Thu, 25 Jan 2001 11:55:36 +0100 (MET)

On 25 Jan 2001, Falk Hueffner wrote:

> Dirk Stoecker <stoecker@xxxxxxxxxxxxxx> writes:
> 
> > -static void makeisland(int islemass, int starters)
> > +static void makeisland(long islemass, int starters)
> >  {
> >    static long int tilefactor, balance, lastplaced;/* int may be only 2 
> > byte ! */
> 
> I'm sure it is assumed at about a gazillion places that int is at
> least 4 bytes. Please, let's rather document this and not uglify the
> code with weird "longs" scattered about the place which make the code
> behave bad on 64 bit architectures. (Yes, I have encountered *many*
> such problems.)

I did no assumptions about how long this argument is really, but only
fixed the code. The function is called with long arguments all the time,
so the argument should be long and there is no reason to make it int.

I don't want to change int's to long because of size issues, but only to
make the code better. Reducing the number of warnings like these will also
reduce the number of possible problems with different environments.

Ciao
 ____  _ _  ____  _ _    _ _  ____
|    |  |  |    |  | \  / |  |    | the cool Gremlin from Bischofswerda
|  __   |   ____|  |  \/  |  |    | WWW: http://home.pages.de/~stoecker/
|    |  |  |       |      |  |    | PGP key available on www page.
|____| _|_ |____| _|_    _|_ |____| I hope AMIGA never ends to make fun!




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