Wendell Turner wrote:
> 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

GCC doesn't like a direct cast from a pointer to an integer of
different size.  This is what I'm doing, basically double-casting the
pointer to a 64 bit integer, and thence to a 32 bit value:

--- newcloud.cxx        30 May 2005 09:04:57 -0000      1.8
+++ newcloud.cxx        11 Aug 2005 03:56:51 -0000
@@ -64,7 +64,7 @@
        pauseLength = 0.0f;
        last_step = -1.0f;
        familly = CLFamilly_nn;
-       cloudId = (int) this;
+       cloudId = (int)(long)this;
        sgSetVec3(center, 0.0f, 0.0f, 0.0f);
        sgSetVec3(cloudpos, 0.0f, 0.0f, 0.0f);
        radius = 0.0f;

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.

Andy

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

Reply via email to