Complete.Org: Mailing Lists: Archives: freeciv-java: June 2003:
[FreeCiv-Java] Re: question about dio_get_uint32
Home

[FreeCiv-Java] Re: question about dio_get_uint32

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-java@xxxxxxxxxxx
Subject: [FreeCiv-Java] Re: question about dio_get_uint32
From: Artur Biesiadowski <abies@xxxxxxxx>
Date: Mon, 02 Jun 2003 09:19:04 +0200
Reply-to: abies@xxxxxxxxx

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



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