Complete.Org: Mailing Lists: Archives: freeciv-java: May 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: David Chen <cooldc@xxxxxxxxxxx>
Cc: freeciv-java@xxxxxxxxxxx
Subject: [FreeCiv-Java] Re: question about dio_get_uint32
From: Raimar Falke <rf13@xxxxxxxxxxxxxxxxx>
Date: Wed, 28 May 2003 14:19:20 +0200

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@xxxxxxxxxxxxxxxxx
 "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



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