From: Bruce S. <Bru...@nc...> - 2008-01-22 21:56:22
|
Thanks much for the information, the patch, and the pleasure! Looks to me like it would make sense simply to use long instead of int on all platforms. Bruce Sherwood Lars Bittrich wrote: > Hi, > > I got an error while buiding visual-4.beta24 on my Gentoo amd64 system (core2 > duo). The relevant part of build.log is: > > ./core/util/icososphere.cpp: In function 'float* cvisual::<unnamed>::avgptr(float*, float*)': > ./core/util/icososphere.cpp:71: error: cast from 'float*' to 'int' loses precision > > I'm not a C++ expert but I think it is due to the different size of pointers > on 64bit architectures. For me the attached patch worked. Maybe, there is a > much better way to do it, but now it builds fine and the examples are working. > > I still get some strange 'segmentation fault's after a while or when closing the > window. But those I got even more often with visual-3.2.9 and they may be due > to the new ati driver which is not really stable. > > Now that I can test it, I have to say that I really like it. It was always a > cool thing to make 3D animation with just a few lines. But now it looks even > better and there are no more confusions with numpy vs. Numeric. > > Greetings, > > Lars > > > > ------------------------------------------------------------------------ > > --- visual-4.beta24/src/core/util/icososphere.cpp 2007-01-29 20:59:59.000000000 +0100 > +++ visual-4.beta24-patched/src/core/util/icososphere.cpp 2008-01-22 21:06:27.000000000 +0100 > @@ -68,7 +68,11 @@ > inline float* > avgptr( float* a, float* b) > { > +#if defined __ia64 || defined __x86_64__ || defined __64BIT__ > + return (float*)( long(a) + ((long(b)-long(a))>>1) ); > +#else > return (float*)( int(a) + ((int(b)-int(a))>>1) ); > +#endif > } > > } // !namespace anonymous > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users |