Re: question about dio_get_uint32

Artur Biesiadowski <[email protected]> Mon, 02 Jun 2003 09:19:04 +0200
Newsgroups gmane.games.freeciv.java
Message-ID <[email protected]>
David Chen wrote:

>  I am builiding a java client for freeciv 1.14.0  (I gave up on trying 
> to keeping up to date with the latest development and went for a stable 
> version)  My question is about ./common/dataio.dio_get_uint32.  Does 
> freeciv actually use unsigned 4 byte ints?  More broadly, is it safe to 
> assume that I can use java int (signed, 4 bytes) to read in all the ints 
> from all types of packets?

As long, as data is a bitfield, it is not important if you use signed or 
unsigned types. It only becomes important, if it is a scalar - but then, 
you still can read it like this from the net, and only cast to long when 
comparing versus other integers. I don't think that freeciv uses full 
resolution of long in scalar manner anywhere - only bitfields.

Artur