Hi Robert,

I've been getting this warning 7 times per compiled file for a little while:

warning C4312: 'type cast' : conversion from 'GLsizeiptrARB' to 'const GLvoid *' of greater size

It happens on lines like this:

setVertexPointer(array->getDataSize(),array->getDataType(),0,(const GLvoid *)(vbo->getOffset(array->getBufferIndex())));

The actual lines are in include/osg/state lines 578, 669, 759, 854, 921, 998 and 1163.

Now, from what I can see, GLvoid is gotten from gl.h (in the Platform SDK) and evaluates to void. GLsizeiptrARB is gotten from the include/osg/BufferObject header, and evaluates to int.

First of all, it's trying to convert int to const void*, am I reading that correctly? vbo->getOffset() returns GLsizeiptrARB and it's trying to cast it to const GLvoid*. Is that OK?

Is there a quick way to remove this warning? I imagine in other cases, it could be a sign of 64-bit porting problems, but I'm on a 32 bit platform, so I don't see why the compiler is warning me of this. For that matter, aren't both int and void* 32 bits on 32 bit platforms? (my knowledge in this is limited, and I guess they can't be or this warning wouldn't occur...)

It would be nice to be able to remove this warning. Thanks,

J-S
--
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to