Re: [Freeciv-Dev] Server hangs on an Alpha
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
> > 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,
Re: [Freeciv-Dev] Server hangs on an Alpha, Peter Schaefer, 1999/07/29