Hi Sukender,
When I've see one like this in the past I've just used a
static_cast<unsigned int>() rather than changing the return type as
changing the return changes the interface.
With this type of warning this near 2.8 I'd suggest disabling the
warning via include/osg/Export.
To include/osg/Export I've just added:
#pragma warning( disable : 4267 )
And checked this in to the OSG-2.8 branch.
Once 2.8 is out we can consider removing more of the warning disables
and having another bash at fixing the warnings. FYI, this warning
will have been suppressed in 2.6 and before, so all we are doing is
falling back to an older position, we still suppress less warnings
than we used to, so we are making progress.
Robert.
On Thu, Feb 5, 2009 at 4:02 PM, Sukender <[email protected]> wrote:
> Hi Robert,
>
> I found new (minor) warnings, in inlined methods (and thus not detectable
> until used).
> warning C4267: 'return' : conversion from 'size_t' to 'unsigned int',
> possible loss of data
>
> osg/Uniform(318):
> inline unsigned int getNumParents()
> osg/Geode(93):
> inline unsigned int getNumDrawables()
> osg/Geode:
> inline unsigned int getDrawableIndex()
>
> But there are certainly much more.
> I guess all of these should return a "size_t" instead of an "unsigned int"
> (or cast their return). MSVC generates this warning whereas size_t is an
> unsigned int.
>
> Sukender
> PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org