Re: [Flightgear-devel] nojoy for simgear on amd64

2005-08-13 Thread Harald JOHNSEN

Mathias Fröhlich wrote:


On Donnerstag 11 August 2005 10:20, Erik Hofman wrote:
 


Andy Ross wrote:
  There is a similar spot in FlightGear where something wants to use a
   


pointer as an integer ID.  I haven't checked these in as this is not
really a good solution -- the ID needs to be guaranteed-unique.
 


I just noticed there is even an id_t in sys/types.h on IRIX, is this
common?
   


I don't think so.

The only type I know that is guaranteed to be capable of storing the whole 
pointer is a void*. But void* is menat to be not that pure address number in 
the properties, it is meant to store some arbitrary property, which is ok so 
far.


But I believe that for our problem, it would be sufficient if we just convert 
that address to a string and take this string as an id.

That saied how about something like

stringstream s;
s  this;

and then take

s.str()

as that id?

  Greetings

Mathias

 

Using strings add too much overhead for a general solution, void * could 
be better except that those pointers
can not really be compared (if you want to use your id in a map you must 
have a  operator that does

not exist here).
But those ID are not pointers, they are just random numbers so 'id = 
++static_counter' is sufficient.


Harald.


___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] nojoy for simgear on amd64

2005-08-13 Thread Mathias Fröhlich
On Samstag 13 August 2005 10:50, Harald JOHNSEN wrote:
 Using strings add too much overhead for a general solution, void * could
 be better except that those pointers
 can not really be compared (if you want to use your id in a map you must
 have a  operator that does
 not exist here).
 But those ID are not pointers, they are just random numbers so 'id =
 ++static_counter' is sufficient.
True, do you prepare a patch?
:)

   Greetings

Mathias

-- 
Mathias Fröhlich, email: [EMAIL PROTECTED]

___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] nojoy for simgear on amd64

2005-08-13 Thread Andy Ross
Mathias Fröhlich wrote:
 Erik Hofman wrote:
  I just noticed there is even an id_t in sys/types.h on IRIX, is this
  common?

 I don't think so.

 The only type I know that is guaranteed to be capable of storing the whole
 pointer is a void*. But void* is menat to be not that pure address number in
 the properties, it is meant to store some arbitrary property, which is ok so
 far.

The standard type for this purpose is size_t.  It is part of ANSI
C, and required to be an integer type capable of holding any
value formed by the difference of two char pointers.  I believe
it is required to by defined in sys/types.h, but any of the
headers that define functions that use it (e.g. memcpy, strncpy,
etc...) will pull it in.

Andy

___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] nojoy for simgear on amd64

2005-08-11 Thread Erik Hofman

Andy Ross wrote:


There is a similar spot in FlightGear where something wants to use a
pointer as an integer ID.  I haven't checked these in as this is not
really a good solution -- the ID needs to be guaranteed-unique.


I think you would be able to use the time_t type for ID's as a hack, 
since the system developers want that one to be as large as the system 
can handle ...


Erik

___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] nojoy for simgear on amd64

2005-08-11 Thread Erik Hofman

Andy Ross wrote:
  There is a similar spot in FlightGear where something wants to use a

pointer as an integer ID.  I haven't checked these in as this is not
really a good solution -- the ID needs to be guaranteed-unique.


I just noticed there is even an id_t in sys/types.h on IRIX, is this common?

Erik

___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


[Flightgear-devel] nojoy for simgear on amd64

2005-08-10 Thread Wendell Turner


Today's cvs of simgear doesn't compile on an amd64 machine.

make[4]: Entering directory 
`/home/wendell/flightgear/FlightGear-0.9/simgear/source/simgear/scene/sky'
if g++ -DHAVE_CONFIG_H -I. -I. -I../../../simgear -I../../.. 
-I/usr/X11R6/include -g -O2 -D_REENTRANT -MT newcloud.o -MD -MP -MF 
.deps/newcloud.Tpo -c -o newcloud.o newcloud.cxx; \
then mv -f .deps/newcloud.Tpo .deps/newcloud.Po; else rm -f 
.deps/newcloud.Tpo; exit 1; fi

newcloud.cxx: In member function ‘void SGNewCloud::init()’:
newcloud.cxx:67: error: cast from ‘SGNewCloud*’ to ‘int’ loses precision
make[4]: *** [newcloud.o] Error 1

The ./configure reports
Configure Summary
=
Prefix: /usr/local
Debug messages: yes
Automake version: automake (GNU automake) 1.9.5
Without JPEG Factory support
Threads: pthread lib found.

This is a new machine, and I'm just figuring it out, so I don't doubt
the possibility of pilot error.

OS is Fedora 4.
Error occurs on both of
gcc (GCC) 4.0.0
gcc32 (GCC) 3.2.3

(is there a separate simgear mailing list, or is this it?)

Wendell


___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d