Complete.Org: Mailing Lists: Archives: freeciv-dev: July 1999:
Re: [Freeciv-Dev] Server hangs on an Alpha

Re: [Freeciv-Dev] Server hangs on an Alpha

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: brunel@xxxxxxxxxxxxxxxxxxxx (Nicolas Brunel)
Cc: matthew@xxxxxxxxxxxxxx, freeciv-dev@xxxxxxxxxxx
Subject: Re: [Freeciv-Dev] Server hangs on an Alpha
From: Rizos Sakellariou <rizos@xxxxxxxxxxx>
Date: Thu, 29 Jul 1999 12:54:05 -0500 (CDT)

> > I changed the myrand(int size) to myrand(RANDOM_TYPE size) and
> > recompiled.  The problem was still present.  I then changed the
> > RANDOM_TYPE typedef from "unsigned int" to "unsigned long int" and the
> > now the server doesn't hang anymore.  
> It fixs this problem. But, it creates a cast from long int to int in lots
> of place. And casts can create problems... 
> > I haven't had a chance to make
> > sure it is "working" correctly, but it no longer hangs.
> That's already a good point.
> > 
> > (BTW both of my changes together should have counteracted the two
> >  problems you noted above).
> To be really sure, we have to parse mapgen.c. In all places a cast is done
> from long int to int, we have to check the long int is no greater or
> lesser to an int. If we can wipe out those long int it will be safer.

Agreed. I dont see any reason why totalmass should be defined as long. 
It seems to me that (with current maxs allowed) the maximum value 
it can get is 15040. Similarly, we should be able to get rid of
the remaining long integers in mapgen.c. I would rather leave myrand()


> No time to do it tonigh,
> Bye,
> _("Nicolas")

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