My mistake, I meant that the "volatile" and "&" should be removed (not the whole static_cast<>). May "static_cast<unsigned int>" do it? (since I'm not certain volatile here is useful, because we simply return a copy).
Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ Le Tue, 03 Feb 2009 22:28:26 +0100, Sukender <suky0...@free.fr> a écrit: > I don't even understand the reason of the static_cast<>... why it is there? > IMHO, it should be removed, but I'm no Atomic/Threads/etc expert. > > Sukender > PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ > > Le Tue, 03 Feb 2009 15:48:03 +0100, Robert Osfield <robert.osfi...@gmail.com> > a écrit: > >> Hi Windows experts, >> >> Here's another Windows warning that I'll like a hand resolving: >> >> 2>..\common\Atomic.cpp(133) : warning C4239: nonstandard extension >> used : 'static_cast' : conversion from 'volatile const long' to >> 'volatile const unsigned int &' >> >> The code is: >> >> Atomic::operator unsigned() const >> { >> #if defined(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS) >> __sync_synchronize(); >> return _value; >> #elif defined(_OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED) >> MemoryBarrier(); >> return static_cast<unsigned const volatile &>(_value); >> <<<< Here is line 133, problem line. >> #elif defined(_OPENTHREADS_ATOMIC_USE_BSD_ATOMIC) >> OSMemoryBarrier(); >> return static_cast<unsigned const volatile>(_value); >> #else >> # error This implementation should happen inline in the include file >> #endif >> } >> >> To me a fix would be to remove the & from the static_cast<unsigned >> const volatile &> as it seems a tad superfluous in this method as it's >> returning an unsigned int on the stack anyway. >> >> Thoughts? >> Robert. >> _______________________________________________ >> osg-users mailing list >> osg-users@lists.openscenegraph.org >> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org