Re: question about dio_get_uint32
Raimar Falke <rf13-r/[email protected]> Wed, 28 May 2003 14:19:20 +0200
| Newsgroups | gmane.games.freeciv.java |
|---|---|
| Message-ID | <[email protected]> |
On Wed, May 28, 2003 at 08:46:23AM +0000, David Chen wrote: > hi, > although I've noticed that this emailing list has had very little > activitiy lately other than junk mails, hopefully someone will pick up this > message. > 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? So you are asking if you have to expect values in the range 2^31 to 2^31-1? The answer is yes. At least here dio_put_uint32(&dout, pinfo->embassy); dio_put_uint32(&dout, pinfo->gives_shared_vision); you can get a value where the highest bit is set. These are bit fields indexed by player number. These could be converted to BV_* which may make your work easier. Raimar -- email: rf13-r/[email protected] "Like the ad says, at 300 dpi you can tell she's wearing a swimsuit. At 600 dpi you can tell it's wet. At 1200 dpi you can tell it's painted on. I suppose at 2400 dpi you can tell if the paint is giving her a rash." -- Joshua R. Poulson