Re: [osg-users] sharedstatemanager.cpp win32 release mode compilation error

2007-12-12 Thread Robert Osfield
Hi Amos  Tim,

I've just checked in the change to use const operators in functors in
SharedStateManager, prompted by email on the same topic from Paul
Martz, this change looks the same as Tim's and is now checked in.

Robert.

On Dec 12, 2007 5:15 AM, Amos Smith [EMAIL PROTECTED] wrote:
 With code downloaded via svn this evening (revision 7671), I'm seeing a
 compilation error for osgDB SharedStateManager.cpp in Win32 Release mode.

 Excerpt of error description:

 C3848: expression having type 'const
 osgDB::SharedStateManager::CompareStateAttributes' would lose some
 const-volatile qualifiers in order to call 'bool
 osgDB::SharedStateManager::CompareStateAttributes::operator ()(const
 osg::ref_ptrT ,const osg::ref_ptrT )'


 Build environment is: WinXP SP2, MS VS 8.1 SP1, using Microsoft Platform SDK
 for Windows Server 2003 R2.


 Full output for osgDB rebuild follows:

 1-- Rebuild All started: Project: osgDB, Configuration: Release Win32
 --
 1Deleting intermediate and output files for project 'osgDB', configuration
 'Release|Win32'
 1Building Custom Rule E:/OpenSceneGraph/src/osgDB/CMakeLists.txt
 1-- searching TIFF --tiff.hE:/3rdparty--
 1-- searching FREETYPE --ft2build.hE:/3rdparty--
 1-- searching JPEG --jpeglib.hE:/3rdparty--
 1-- searching GLUT --GL/glut.hE:/3rdparty--
 1-- searching GIFLIB --gif_lib.hE:/3rdparty--
 1-- searching ZLIB --zlib.hE:/3rdparty--
 1-- searching PNG --png.hE:/3rdparty--
 1-- ERROR: wxWidgets was not found.
 1-- Found JPEG: E:/3rdParty/lib/libjpeg.lib
 1-- Found PNG: E:/3rdParty/lib/libpng.lib
 1-- Configuring done
 1-- Generating done
 1-- Build files have been written to: E:/OpenSceneGraph
 1Compiling...
 1WriteFile.cpp
 1E:\OpenSceneGraph\include\osgDB/DatabasePager(337) : warning C4800:
 'osg::Texture::TextureObject *' : forcing value to bool 'true' or 'false'
 (performance warning)
 1Version.cpp
 1SharedStateManager.cpp
 1C:\Program Files\Microsoft Visual Studio 8\VC\include\xtree(1174) : error
 C3848: expression having type 'const
 osgDB::SharedStateManager::CompareStateAttributes' would lose some
 const-volatile qualifiers in order to call 'bool
 osgDB::SharedStateManager::CompareStateAttributes::operator ()(const
 osg::ref_ptrT ,const osg::ref_ptrT )'
 1with
 1[
 1T=osg::StateAttribute
 1]
 1C:\Program Files\Microsoft Visual Studio 8\VC\include\xtree(1169)
 : while compiling class template member function
 'std::_Tree_nod_Traits::_Node *std::_Tree_Traits::_Lbound(const
 osg::ref_ptrT ) const'
 1with
 1[
 1
 _Traits=std::_Tset_traitsosg::ref_ptrosg::StateAttribute,osgDB::SharedStateManager::CompareStateAttributes,std::allocatorosg::ref_ptrosg::StateAttribute,false,
 1T=osg::StateAttribute
 1]
 1C:\Program Files\Microsoft Visual Studio 8\VC\include\set(69) :
 see reference to class template instantiation 'std::_Tree_Traits' being
 compiled
 1with
 1[
 1
 _Traits=std::_Tset_traitsosg::ref_ptrosg::StateAttribute,osgDB::SharedStateManager::CompareStateAttributes,std::allocatorosg::ref_ptrosg::StateAttribute,false
 1]
 1E:\OpenSceneGraph\include\osgDB/SharedStateManager(88) : see
 reference to class template instantiation 'std::set_Kty,_Pr' being
 compiled
 1with
 1[
 1_Kty=osg::ref_ptrosg::StateAttribute,
 1_Pr=osgDB::SharedStateManager::CompareStateAttributes
 1]
 1Registry.cpp
 1E:\OpenSceneGraph\include\osgDB/DatabasePager(337) : warning C4800:
 'osg::Texture::TextureObject *' : forcing value to bool 'true' or 'false'
 (performance warning)
 1ReaderWriter.cpp
 1E:\OpenSceneGraph\include\osgDB/DatabasePager(337) : warning C4800:
 'osg::Texture::TextureObject *' : forcing value to bool 'true' or 'false'
 (performance warning)
 1ReadFile.cpp
 1E:\OpenSceneGraph\include\osgDB/DatabasePager(337) : warning C4800:
 'osg::Texture::TextureObject *' : forcing value to bool 'true' or 'false'
 (performance warning)
 1Output.cpp
 1E:\OpenSceneGraph\include\osgDB/DatabasePager(337) : warning C4800:
 'osg::Texture::TextureObject *' : forcing value to bool 'true' or 'false'
 (performance warning)
 1Input.cpp
 1E:\OpenSceneGraph\include\osgDB/DatabasePager(337) : warning C4800:
 'osg::Texture::TextureObject *' : forcing value to bool 'true' or 'false'
 (performance warning)
 1ImageOptions.cpp
 1FileUtils.cpp
 1E:\OpenSceneGraph\include\osgDB/DatabasePager(337) : warning C4800:
 'osg::Texture::TextureObject *' : forcing value to bool 'true' or 'false'
 (performance warning)
 1FileNameUtils.cpp
 1E:\OpenSceneGraph\include\osgDB/DatabasePager(337) : warning C4800:
 'osg::Texture::TextureObject *' : forcing value to bool 'true' or 'false'
 (performance warning)
 1FieldReaderIterator.cpp
 1FieldReader.cpp
 1Field.cpp
 1DynamicLibrary.cpp
 1E:\OpenSceneGraph\include\osgDB/DatabasePager(337) : warning C4800:
 'osg::Texture::TextureObject *' : forcing value to bool 'true' or 'false'
 

Re: [osg-users] sharedstatemanager.cpp win32 release mode compilation error

2007-12-11 Thread Tim Moore
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Amos Smith wrote:
 With code downloaded via svn this evening (revision 7671), I'm seeing a
 compilation error for osgDB SharedStateManager.cpp in Win32 Release mode.
 
 Excerpt of error description:
 
 C3848: expression having type 'const
 osgDB::SharedStateManager::CompareStateAttributes' would lose some
 const-volatile qualifiers in order to call 'bool
 osgDB::SharedStateManager::CompareStateAttributes::operator ()(const
 osg::ref_ptrT ,const osg::ref_ptrT )'
 
I believe this is the fault of my submission of changes to DatabasePager.
This should fix it:
diff --git a/include/osgDB/SharedStateManager b/include/osgDB/SharedStateManager
index 9e5e8ef..89f848c 100644
- --- a/include/osgDB/SharedStateManager
+++ b/include/osgDB/SharedStateManager
@@ -68,7 +68,7 @@ namespace osgDB {
 struct CompareStateAttributes
 {
 bool operator()(const osg::ref_ptrosg::StateAttribute lhs,
- -const osg::ref_ptrosg::StateAttribute rhs)
+const osg::ref_ptrosg::StateAttribute rhs) const
 {
 return *lhs  *rhs;
 }
@@ -77,7 +77,7 @@ namespace osgDB {
 struct CompareStateSets
 {
 bool operator()(const osg::ref_ptrosg::StateSet lhs,
- -const osg::ref_ptrosg::StateSet rhs)
+const osg::ref_ptrosg::StateSet rhs) const
 {
 return lhs-compare(*rhs, true)  0;
 }

The whole file is attached.
Tim
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFHX4GPeDhWHdXrDRURAiDGAJ4kzhBpnLSM+OfHTGQCaCnzf3GGVwCdH//i
cMxss0cjKIO8C9gX3EOdpTU=
=Ehv7
-END PGP SIGNATURE-


DatabasePager.tar
Description: Unix tar archive
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] sharedstatemanager.cpp win32 release mode compilation error

2007-12-11 Thread Amos Smith
Thanks Tim, the const-ness added to the CompareStateAttributes and 
CompareStateSets operator declarations does resolve the compilation issue.

Cheers,

Amos
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org