diff --git a/dtool/Config.Linux.pp b/dtool/Config.Linux.pp index 80cf1d01bf..443f81f2f6 100644 --- a/dtool/Config.Linux.pp +++ b/dtool/Config.Linux.pp @@ -138,7 +138,7 @@ // What is the syntax of the STL allocator declaration? See // LocalSetup.pp for allowable values. -#define STL_ALLOCATOR GNU +#define STL_ALLOCATOR MODERN // The dynamic library file extension (usually .so .dll or .dylib): #define DYNAMIC_LIB_EXT .so diff --git a/dtool/src/cppparser/Sources.pp b/dtool/src/cppparser/Sources.pp index e23caac21a..e2b1cddfd8 100644 --- a/dtool/src/cppparser/Sources.pp +++ b/dtool/src/cppparser/Sources.pp @@ -21,8 +21,7 @@ cppSimpleType.h cppStructType.h cppTBDType.h \ cppTemplateParameterList.h cppTemplateScope.h cppToken.h \ cppType.h cppTypeDeclaration.h cppTypeParser.h \ - cppTypeProxy.h cppTypedef.h cppUsing.h cppVisibility.h \ - indent.h + cppTypeProxy.h cppTypedef.h cppUsing.h cppVisibility.h #define INCLUDED_SOURCES \ cppArrayType.cxx cppClassTemplateParameter.cxx \ @@ -38,6 +37,6 @@ cppTemplateParameterList.cxx cppTemplateScope.cxx \ cppToken.cxx cppType.cxx cppTypeDeclaration.cxx \ cppTypeParser.cxx cppTypeProxy.cxx cppTypedef.cxx \ - cppUsing.cxx cppVisibility.cxx indent.cxx + cppUsing.cxx cppVisibility.cxx #end static_lib_target diff --git a/dtool/src/cppparser/indent.cxx b/dtool/src/cppparser/indent.cxx deleted file mode 100644 index 8b185d2a0f..0000000000 --- a/dtool/src/cppparser/indent.cxx +++ /dev/null @@ -1,36 +0,0 @@ -// Filename: indent.cxx -// Created by: drose (16Jan99) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - - -#include "indent.h" - -//////////////////////////////////////////////////////////////////// -// Function: indent -// Description: A handy function for doing text formatting. This -// function simply outputs the indicated number of -// spaces to the given output stream, returning the -// stream itself. Useful for indenting a series of -// lines of text by a given amount. -//////////////////////////////////////////////////////////////////// -ostream & -indent(ostream &out, int indent_level) { - for (int i = 0; i < indent_level; ++i) { - out << ' '; - } - return out; -} diff --git a/dtool/src/cppparser/indent.h b/dtool/src/cppparser/indent.h deleted file mode 100644 index a96468bd75..0000000000 --- a/dtool/src/cppparser/indent.h +++ /dev/null @@ -1,37 +0,0 @@ -// Filename: indent.h -// Created by: drose (16Jan99) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#ifndef INDENT_H -#define INDENT_H - -#include "dtoolbase.h" - -//////////////////////////////////////////////////////////////////// -// Function: indent -// Description: A handy function for doing text formatting. This -// function simply outputs the indicated number of -// spaces to the given output stream, returning the -// stream itself. Useful for indenting a series of -// lines of text by a given amount. -//////////////////////////////////////////////////////////////////// -ostream & -indent(ostream &out, int indent_level); - -#endif - - diff --git a/dtool/src/dtoolbase/Sources.pp b/dtool/src/dtoolbase/Sources.pp index 34b3ffeaee..9556234fe3 100644 --- a/dtool/src/dtoolbase/Sources.pp +++ b/dtool/src/dtoolbase/Sources.pp @@ -6,6 +6,7 @@ dallocator.T dallocator.h \ dtoolbase.cxx dtoolbase.h dtoolbase_cc.h dtoolsymbols.h \ fakestringstream.h \ + indent.I indent.h indent.cxx \ nearly_zero.h \ stl_compares.I stl_compares.h \ pallocator.T pallocator.h \ @@ -15,6 +16,7 @@ cmath.I cmath.h \ dallocator.T dallocator.h \ dtoolbase.h dtoolbase_cc.h dtoolsymbols.h fakestringstream.h \ + indent.I indent.h \ nearly_zero.h \ stl_compares.I stl_compares.h \ pallocator.T pallocator.h \ diff --git a/dtool/src/dtoolbase/dallocator.h b/dtool/src/dtoolbase/dallocator.h index 62ac429521..446da84edf 100644 --- a/dtool/src/dtoolbase/dallocator.h +++ b/dtool/src/dtoolbase/dallocator.h @@ -95,6 +95,7 @@ public: INLINE pointer allocate(size_type n, allocator::const_pointer hint = 0); INLINE void deallocate(pointer p, size_type n); + /* #ifdef __GNUC__ template INLINE void destroy(Subtype *p) { @@ -105,6 +106,7 @@ public: ::new(p) Subtype(value); } #endif // __GNUC__ + */ template struct rebind { typedef dallocator other; diff --git a/panda/src/express/indent.I b/dtool/src/dtoolbase/indent.I similarity index 100% rename from panda/src/express/indent.I rename to dtool/src/dtoolbase/indent.I diff --git a/panda/src/express/indent.cxx b/dtool/src/dtoolbase/indent.cxx similarity index 100% rename from panda/src/express/indent.cxx rename to dtool/src/dtoolbase/indent.cxx diff --git a/panda/src/express/indent.h b/dtool/src/dtoolbase/indent.h similarity index 97% rename from panda/src/express/indent.h rename to dtool/src/dtoolbase/indent.h index 21a96d440e..ba94818f31 100644 --- a/panda/src/express/indent.h +++ b/dtool/src/dtoolbase/indent.h @@ -19,7 +19,7 @@ #ifndef INDENT_H #define INDENT_H -#include "pandabase.h" +#include "dtoolbase.h" //////////////////////////////////////////////////////////////////// // Function: indent @@ -29,7 +29,7 @@ // stream itself. Useful for indenting a series of // lines of text by a given amount. //////////////////////////////////////////////////////////////////// -EXPCL_PANDAEXPRESS ostream & +EXPCL_DTOOL ostream & indent(ostream &out, int indent_level); //////////////////////////////////////////////////////////////////// diff --git a/dtool/src/dtoolbase/pallocator.h b/dtool/src/dtoolbase/pallocator.h index a32c3a93a4..20745ebd30 100644 --- a/dtool/src/dtoolbase/pallocator.h +++ b/dtool/src/dtoolbase/pallocator.h @@ -104,6 +104,7 @@ public: INLINE pointer allocate(size_type n, allocator::const_pointer hint = 0); INLINE void deallocate(pointer p, size_type n); + /* #ifdef __GNUC__ // The gcc 4.0 version seems to pass any old type to construct() and // destroy(), so we need template methods. @@ -116,6 +117,7 @@ public: p->~Subtype(); } #endif // __GNUC__ + */ template struct rebind { typedef pallocator other; diff --git a/dtool/src/dtoolbase/pmap.h b/dtool/src/dtoolbase/pmap.h index f7654bb558..1719294895 100644 --- a/dtool/src/dtoolbase/pmap.h +++ b/dtool/src/dtoolbase/pmap.h @@ -52,11 +52,11 @@ // memory. //////////////////////////////////////////////////////////////////// template > -class pmap : public map > { +class pmap : public map > > { public: - pmap() : map >() { } - pmap(const pmap ©) : map >(copy) { } - pmap(const Compare &comp) : map >(comp) { } + pmap() : map > >() { } + pmap(const pmap ©) : map > >(copy) { } + pmap(const Compare &comp) : map > >(comp) { } }; //////////////////////////////////////////////////////////////////// @@ -67,11 +67,11 @@ public: // memory. //////////////////////////////////////////////////////////////////// template > -class pmultimap : public multimap > { +class pmultimap : public multimap > > { public: - pmultimap() : multimap >() { } - pmultimap(const pmultimap ©) : multimap >(copy) { } - pmultimap(const Compare &comp) : multimap >(comp) { } + pmultimap() : multimap > >() { } + pmultimap(const pmultimap ©) : multimap > >(copy) { } + pmultimap(const Compare &comp) : multimap > >(comp) { } }; #ifdef HAVE_STL_HASH @@ -83,11 +83,11 @@ public: // memory. //////////////////////////////////////////////////////////////////// template > > -class phash_map : public hash_map > { +class phash_map : public hash_map > > { public: - phash_map() : hash_map >() { } - phash_map(const phash_map ©) : hash_map >(copy) { } - phash_map(const Compare &comp) : hash_map >(comp) { } + phash_map() : hash_map > >() { } + phash_map(const phash_map ©) : hash_map > >(copy) { } + phash_map(const Compare &comp) : hash_map > >(comp) { } }; //////////////////////////////////////////////////////////////////// @@ -98,11 +98,11 @@ public: // memory. //////////////////////////////////////////////////////////////////// template > > -class phash_multimap : public hash_multimap > { +class phash_multimap : public hash_multimap > > { public: - phash_multimap() : hash_multimap >() { } - phash_multimap(const phash_multimap ©) : hash_multimap >(copy) { } - phash_multimap(const Compare &comp) : hash_multimap >(comp) { } + phash_multimap() : hash_multimap > >() { } + phash_multimap(const phash_multimap ©) : hash_multimap > >(copy) { } + phash_multimap(const Compare &comp) : hash_multimap > >(comp) { } }; #else // HAVE_STL_HASH diff --git a/dtool/src/dtoolutil/filename.cxx b/dtool/src/dtoolutil/filename.cxx index b4cb6e98fd..2ead0a2ede 100644 --- a/dtool/src/dtoolutil/filename.cxx +++ b/dtool/src/dtoolutil/filename.cxx @@ -19,6 +19,7 @@ #include "filename.h" #include "dSearchPath.h" #include "executionEnvironment.h" +#include "vector_string.h" #include // For rename() and tempnam() #include // for clock() and time() @@ -644,7 +645,7 @@ standardize() { return; } - vector components; + vector_string components; // Pull off the components of the filename one at a time. bool global = (_filename[0] == '/'); @@ -1091,12 +1092,12 @@ compare_timestamps(const Filename &other, // This file doesn't, the other one does. return this_missing_is_old ? -1 : 1; - } else { // !other_exists - assert(!other_exists); - - // This file exists, the other one doesn't. - return other_missing_is_old ? 1 : -1; } + // !other_exists + assert(!other_exists); + + // This file exists, the other one doesn't. + return other_missing_is_old ? 1 : -1; } //////////////////////////////////////////////////////////////////// diff --git a/dtool/src/interrogatedb/Sources.pp b/dtool/src/interrogatedb/Sources.pp index 499dd9e0d7..d8a3da534c 100644 --- a/dtool/src/interrogatedb/Sources.pp +++ b/dtool/src/interrogatedb/Sources.pp @@ -14,19 +14,39 @@ interrogateFunctionWrapper.h interrogateManifest.I \ interrogateManifest.h interrogateType.I interrogateType.h \ interrogate_datafile.I interrogate_datafile.h \ - interrogate_interface.h interrogate_request.h vector_int.h + interrogate_interface.h interrogate_request.h \ + py_panda.h \ + register_type.I register_type.h \ + typedObject.I typedObject.h \ + typeHandle.I typeHandle.h \ + typeRegistry.I typeRegistry.h \ + typeRegistryNode.I typeRegistryNode.h \ + vector_int.h #define INCLUDED_SOURCES \ - config_interrogatedb.cxx indexRemapper.cxx \ + config_interrogatedb.cxx \ + dtool_super_base.cxx \ + indexRemapper.cxx \ interrogateComponent.cxx interrogateDatabase.cxx \ interrogateElement.cxx interrogateFunction.cxx \ interrogateFunctionWrapper.cxx interrogateManifest.cxx \ interrogateType.cxx interrogate_datafile.cxx \ interrogate_interface.cxx interrogate_request.cxx \ + py_panda.cxx \ + register_type.cxx \ + typedObject.cxx \ + typeHandle.cxx \ + typeRegistry.cxx typeRegistryNode.cxx \ vector_int.cxx #define INSTALL_HEADERS \ interrogate_interface.h interrogate_request.h vector_int.h \ - config_interrogatedb.h py_panda.h + config_interrogatedb.h py_panda.h \ + register_type.I register_type.h \ + typedObject.I typedObject.h \ + typeHandle.I typeHandle.h \ + typeRegistry.I typeRegistry.h \ + typeRegistryNode.I typeRegistryNode.h \ + #end lib_target diff --git a/dtool/src/interrogatedb/dtool_super_base.cxx b/dtool/src/interrogatedb/dtool_super_base.cxx new file mode 100644 index 0000000000..79580af9bc --- /dev/null +++ b/dtool/src/interrogatedb/dtool_super_base.cxx @@ -0,0 +1,95 @@ +// Filename: dtool_super_base.cxx +// Created by: drose (04Jul05) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved +// +// All use of this software is subject to the terms of the Panda 3d +// Software license. You should have received a copy of this license +// along with this source code; you will also find a current copy of +// the license at http://etc.cmu.edu/panda3d/docs/license/ . +// +// To contact the maintainers of this program write to +// panda3d-general@lists.sourceforge.net . +// +//////////////////////////////////////////////////////////////////// + +#include "py_panda.h" + +class EmptyClass +{ +}; +Define_Module_Class_Private(dtoolconfig,DTOOL_SUPPER_BASE,EmptyClass,DTOOL_SUPPER_BASE111); + +static PyObject * GetSupperBase(PyObject * self) +{ + Py_INCREF(&(Dtool_DTOOL_SUPPER_BASE.As_PyTypeObject())); // order is important .. this is used for static functions + return (PyObject *)&Dtool_DTOOL_SUPPER_BASE; +}; + + +PyMethodDef Dtool_Methods_DTOOL_SUPPER_BASE[]= { + { "DtoolGetSupperBase",(PyCFunction ) &GetSupperBase, METH_NOARGS,"Will Return SUPPERbase Class"}, + { NULL, NULL } +}; + +static long DTool_HashKey_Methods_DTOOL_SUPPER_BASE(PyObject * self) +{ + void * local_this =DTOOL_Call_GetPointerThis(self); + if(local_this == NULL) + { + return -1; + }; + return (long)local_this; +}; + + +inline void Dtool_PyModuleClassInit_DTOOL_SUPPER_BASE(PyObject *module) +{ + static bool initdone = false; + if(!initdone) + { + + initdone = true; + Dtool_DTOOL_SUPPER_BASE.As_PyTypeObject().tp_dict = PyDict_New(); + PyDict_SetItemString(Dtool_DTOOL_SUPPER_BASE.As_PyTypeObject().tp_dict,"DtoolClassDict",Dtool_DTOOL_SUPPER_BASE.As_PyTypeObject().tp_dict); + + // __hash__ + Dtool_DTOOL_SUPPER_BASE.As_PyTypeObject().tp_hash = &DTool_HashKey_Methods_DTOOL_SUPPER_BASE; + Dtool_DTOOL_SUPPER_BASE.As_PyTypeObject().tp_compare = &DTOOL_PyObject_Compare; + + if(PyType_Ready(&Dtool_DTOOL_SUPPER_BASE.As_PyTypeObject()) < 0) + { + PyErr_SetString(PyExc_TypeError, "PyType_Ready(Dtool_DTOOL_SUPPER_BASE)"); + return; + } + Py_INCREF(&Dtool_DTOOL_SUPPER_BASE.As_PyTypeObject()); + + PyDict_SetItemString(Dtool_DTOOL_SUPPER_BASE.As_PyTypeObject().tp_dict,"DtoolGetSupperBase",PyCFunction_New(&Dtool_Methods_DTOOL_SUPPER_BASE[0],&Dtool_DTOOL_SUPPER_BASE.As_PyObject())); + + } + + if(module != NULL) + { + Py_INCREF(&Dtool_DTOOL_SUPPER_BASE.As_PyTypeObject()); + PyModule_AddObject(module, "DTOOL_SUPPER_BASE",(PyObject *)&Dtool_DTOOL_SUPPER_BASE.As_PyTypeObject()); + } +} + +inline void * Dtool_DowncastInterface_DTOOL_SUPPER_BASE(void *from_this, Dtool_PyTypedObject *from_type) +{ + return (void *) NULL; +} + +inline void * Dtool_UpcastInterface_DTOOL_SUPPER_BASE(PyObject *self, Dtool_PyTypedObject *requested_type) +{ + return NULL; +} + +int Dtool_Init_DTOOL_SUPPER_BASE(PyObject *self, PyObject *args, PyObject *kwds) +{ + PyErr_SetString(PyExc_TypeError, "Error Can Not Init SUPPER BASE"); + return -1; +} diff --git a/dtool/src/interrogatedb/interrogatedb_composite1.cxx b/dtool/src/interrogatedb/interrogatedb_composite1.cxx index ac7b9e8b66..2c18b5e400 100644 --- a/dtool/src/interrogatedb/interrogatedb_composite1.cxx +++ b/dtool/src/interrogatedb/interrogatedb_composite1.cxx @@ -1,5 +1,6 @@ #include "vector_int.cxx" +#include "dtool_super_base.cxx" #include "config_interrogatedb.cxx" #include "indexRemapper.cxx" #include "interrogateComponent.cxx" diff --git a/dtool/src/interrogatedb/interrogatedb_composite2.cxx b/dtool/src/interrogatedb/interrogatedb_composite2.cxx index 63f7f601af..8b396d8546 100644 --- a/dtool/src/interrogatedb/interrogatedb_composite2.cxx +++ b/dtool/src/interrogatedb/interrogatedb_composite2.cxx @@ -3,6 +3,12 @@ #include "interrogateManifest.cxx" #include "interrogateType.cxx" #include "interrogate_request.cxx" +#include "py_panda.cxx" +#include "register_type.cxx" +#include "typedObject.cxx" +#include "typeHandle.cxx" +#include "typeRegistry.cxx" +#include "typeRegistryNode.cxx" diff --git a/dtool/src/interrogatedb/py_panda.cxx b/dtool/src/interrogatedb/py_panda.cxx new file mode 100644 index 0000000000..7bcae3da0a --- /dev/null +++ b/dtool/src/interrogatedb/py_panda.cxx @@ -0,0 +1,19 @@ +// Filename: py_panda.cxx +// Created by: drose (04Jul05) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved +// +// All use of this software is subject to the terms of the Panda 3d +// Software license. You should have received a copy of this license +// along with this source code; you will also find a current copy of +// the license at http://etc.cmu.edu/panda3d/docs/license/ . +// +// To contact the maintainers of this program write to +// panda3d-general@lists.sourceforge.net . +// +//////////////////////////////////////////////////////////////////// + +#include "py_panda.h" diff --git a/dtool/src/interrogatedb/py_panda.h b/dtool/src/interrogatedb/py_panda.h index 84ada20127..34b73242c1 100755 --- a/dtool/src/interrogatedb/py_panda.h +++ b/dtool/src/interrogatedb/py_panda.h @@ -34,7 +34,7 @@ #ifndef NO_RUNTIME_TYPES -#include "pandabase.h" +#include "dtoolbase.h" #include "typedObject.h" #include "typeRegistry.h" @@ -43,6 +43,9 @@ #ifdef HAVE_LONG_LONG #undef HAVE_LONG_LONG #endif +#ifdef _POSIX_C_SOURCE +#undef _POSIX_C_SOURCE +#endif #include "Python.h" #include "structmember.h" @@ -783,94 +786,7 @@ inline int DTOOL_PyObject_Compare(PyObject *v1, PyObject *v2) return 0; } - -#ifdef PANDA_LIBRARY_NAME_libexpress -#define DTOOL_CREATE_SUPPER_BASE -#endif - -#ifdef DTOOL_CREATE_SUPPER_BASE - -class EmptyClass -{ -}; -Define_Module_Class_Private(pandaexpress,DTOOL_SUPPER_BASE,EmptyClass,DTOOL_SUPPER_BASE111); - -static PyObject * GetSupperBase(PyObject * self) -{ - Py_INCREF(&(Dtool_DTOOL_SUPPER_BASE.As_PyTypeObject())); // order is important .. this is used for static functions - return (PyObject *)&Dtool_DTOOL_SUPPER_BASE; -}; - - -PyMethodDef Dtool_Methods_DTOOL_SUPPER_BASE[]= { - { "DtoolGetSupperBase",(PyCFunction ) &GetSupperBase, METH_NOARGS,"Will Return SUPPERbase Class"}, - { NULL, NULL } -}; - -static long DTool_HashKey_Methods_DTOOL_SUPPER_BASE(PyObject * self) -{ - void * local_this =DTOOL_Call_GetPointerThis(self); - if(local_this == NULL) - { - return -1; - }; - return (long)local_this; -}; - - -inline void Dtool_PyModuleClassInit_DTOOL_SUPPER_BASE(PyObject *module) -{ - static bool initdone = false; - if(!initdone) - { - - initdone = true; - Dtool_DTOOL_SUPPER_BASE.As_PyTypeObject().tp_dict = PyDict_New(); - PyDict_SetItemString(Dtool_DTOOL_SUPPER_BASE.As_PyTypeObject().tp_dict,"DtoolClassDict",Dtool_DTOOL_SUPPER_BASE.As_PyTypeObject().tp_dict); - - // __hash__ - Dtool_DTOOL_SUPPER_BASE.As_PyTypeObject().tp_hash = &DTool_HashKey_Methods_DTOOL_SUPPER_BASE; - Dtool_DTOOL_SUPPER_BASE.As_PyTypeObject().tp_compare = &DTOOL_PyObject_Compare; - - if(PyType_Ready(&Dtool_DTOOL_SUPPER_BASE.As_PyTypeObject()) < 0) - { - PyErr_SetString(PyExc_TypeError, "PyType_Ready(Dtool_DTOOL_SUPPER_BASE)"); - return; - } - Py_INCREF(&Dtool_DTOOL_SUPPER_BASE.As_PyTypeObject()); - - PyDict_SetItemString(Dtool_DTOOL_SUPPER_BASE.As_PyTypeObject().tp_dict,"DtoolGetSupperBase",PyCFunction_New(&Dtool_Methods_DTOOL_SUPPER_BASE[0],&Dtool_DTOOL_SUPPER_BASE.As_PyObject())); - - } - - if(module != NULL) - { - Py_INCREF(&Dtool_DTOOL_SUPPER_BASE.As_PyTypeObject()); - PyModule_AddObject(module, "DTOOL_SUPPER_BASE",(PyObject *)&Dtool_DTOOL_SUPPER_BASE.As_PyTypeObject()); - } -} - -inline void * Dtool_DowncastInterface_DTOOL_SUPPER_BASE(void *from_this, Dtool_PyTypedObject *from_type) -{ - return (void *) NULL; -} - -inline void * Dtool_UpcastInterface_DTOOL_SUPPER_BASE(PyObject *self, Dtool_PyTypedObject *requested_type) -{ - return NULL; -} - -int Dtool_Init_DTOOL_SUPPER_BASE(PyObject *self, PyObject *args, PyObject *kwds) -{ - PyErr_SetString(PyExc_TypeError, "Error Can Not Init SUPPER BASE"); - return -1; -} - - -#else -IMPORT_THIS struct Dtool_PyTypedObject Dtool_DTOOL_SUPPER_BASE; -#endif // DTOOL_CREATE_SUPPER_BASE - +EXPCL_DTOOLCONFIG extern struct Dtool_PyTypedObject Dtool_DTOOL_SUPPER_BASE; #endif // PY_PANDA_H_ diff --git a/panda/src/express/register_type.I b/dtool/src/interrogatedb/register_type.I similarity index 100% rename from panda/src/express/register_type.I rename to dtool/src/interrogatedb/register_type.I diff --git a/panda/src/express/register_type.cxx b/dtool/src/interrogatedb/register_type.cxx similarity index 100% rename from panda/src/express/register_type.cxx rename to dtool/src/interrogatedb/register_type.cxx diff --git a/panda/src/express/register_type.h b/dtool/src/interrogatedb/register_type.h similarity index 93% rename from panda/src/express/register_type.h rename to dtool/src/interrogatedb/register_type.h index 019c8f8766..798ed9d877 100644 --- a/panda/src/express/register_type.h +++ b/dtool/src/interrogatedb/register_type.h @@ -19,7 +19,7 @@ #ifndef REGISTER_TYPE_H #define REGISTER_TYPE_H -#include "pandabase.h" +#include "dtoolbase.h" #include "typeHandle.h" #include "typeRegistry.h" @@ -85,13 +85,13 @@ register_dynamic_type(const string &name, // A few system-wide TypeHandles are defined for some basic types. -extern TypeHandle EXPCL_PANDAEXPRESS long_type_handle; -extern TypeHandle EXPCL_PANDAEXPRESS int_type_handle; -extern TypeHandle EXPCL_PANDAEXPRESS short_type_handle; -extern TypeHandle EXPCL_PANDAEXPRESS char_type_handle; -extern TypeHandle EXPCL_PANDAEXPRESS bool_type_handle; -extern TypeHandle EXPCL_PANDAEXPRESS double_type_handle; -extern TypeHandle EXPCL_PANDAEXPRESS float_type_handle; +extern TypeHandle EXPCL_DTOOLCONFIG long_type_handle; +extern TypeHandle EXPCL_DTOOLCONFIG int_type_handle; +extern TypeHandle EXPCL_DTOOLCONFIG short_type_handle; +extern TypeHandle EXPCL_DTOOLCONFIG char_type_handle; +extern TypeHandle EXPCL_DTOOLCONFIG bool_type_handle; +extern TypeHandle EXPCL_DTOOLCONFIG double_type_handle; +extern TypeHandle EXPCL_DTOOLCONFIG float_type_handle; extern TypeHandle long_p_type_handle; extern TypeHandle int_p_type_handle; @@ -102,7 +102,7 @@ extern TypeHandle double_p_type_handle; extern TypeHandle float_p_type_handle; extern TypeHandle void_p_type_handle; -void EXPCL_PANDAEXPRESS init_system_type_handles(); +void EXPCL_DTOOLCONFIG init_system_type_handles(); // The following template function and its specializations will return // a TypeHandle for any type in the world, from a pointer to that diff --git a/panda/src/express/typeHandle.I b/dtool/src/interrogatedb/typeHandle.I similarity index 97% rename from panda/src/express/typeHandle.I rename to dtool/src/interrogatedb/typeHandle.I index ea67b5e40c..e0b961383a 100644 --- a/panda/src/express/typeHandle.I +++ b/dtool/src/interrogatedb/typeHandle.I @@ -17,11 +17,6 @@ //////////////////////////////////////////////////////////////////// -// In general, we use the express_cat->info() syntax in this file -// (instead of express_cat.info()), because much of this work is done at -// static init time, and we must use the arrow syntax to force -// initialization of the express_cat category. - //////////////////////////////////////////////////////////////////// // Function: TypeHandle::Constructor // Access: Published diff --git a/panda/src/express/typeHandle.cxx b/dtool/src/interrogatedb/typeHandle.cxx similarity index 100% rename from panda/src/express/typeHandle.cxx rename to dtool/src/interrogatedb/typeHandle.cxx diff --git a/panda/src/express/typeHandle.h b/dtool/src/interrogatedb/typeHandle.h similarity index 97% rename from panda/src/express/typeHandle.h rename to dtool/src/interrogatedb/typeHandle.h index 750a29a5e4..206739d308 100644 --- a/panda/src/express/typeHandle.h +++ b/dtool/src/interrogatedb/typeHandle.h @@ -19,13 +19,11 @@ #ifndef TYPEHANDLE_H #define TYPEHANDLE_H -#include "pandabase.h" - +#include "dtoolbase.h" +#include "typeRegistry.h" #include "notify.h" -#include "config_express.h" - -#include "set" +#include // The following illustrates the convention for declaring a type that // uses TypeHandle. In this example, ThisThingie inherits from @@ -90,7 +88,7 @@ class TypedObject; // ancestry of a particular type may be queried, and the // type name may be retrieved for run-time display. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDAEXPRESS TypeHandle { +class EXPCL_DTOOLCONFIG TypeHandle { PUBLISHED: INLINE TypeHandle(); INLINE TypeHandle(const TypeHandle ©); diff --git a/panda/src/express/typeRegistry.I b/dtool/src/interrogatedb/typeRegistry.I similarity index 56% rename from panda/src/express/typeRegistry.I rename to dtool/src/interrogatedb/typeRegistry.I index ef9cc0fd4d..e8bb3373de 100644 --- a/panda/src/express/typeRegistry.I +++ b/dtool/src/interrogatedb/typeRegistry.I @@ -48,32 +48,3 @@ freshen_derivations() { _derivations_fresh = true; } } - -//////////////////////////////////////////////////////////////////// -// Function: TypeRegistry::is_derived_from -// Access: Public -// Description: Returns true if the first type is derived from the -// second type, false otherwise. -// -// The "child_object" pointer is an optional pointer to -// the TypedObject class that owns the child TypeHandle. -// It is only used in case the TypeHandle is -// inadvertently undefined. -// -// This function definition follows the definitions for -// look_up() and freshen_derivations() just to maximize -// the chance the the compiler will be able to inline -// the above functions. Yeah, a compiler shouldn't -// care, but there's a big different between "shouldn't" -// and "doesn't". -//////////////////////////////////////////////////////////////////// -INLINE bool TypeRegistry:: -is_derived_from(TypeHandle child, TypeHandle base, - TypedObject *child_object) { - const TypeRegistryNode *child_node = look_up(child, child_object); - const TypeRegistryNode *base_node = look_up(base, (TypedObject *)NULL); - nassertr(child_node != (TypeRegistryNode *)NULL && - base_node != (TypeRegistryNode *)NULL, false); - freshen_derivations(); - return TypeRegistryNode::is_derived_from(child_node, base_node); -} diff --git a/panda/src/express/typeRegistry.cxx b/dtool/src/interrogatedb/typeRegistry.cxx similarity index 89% rename from panda/src/express/typeRegistry.cxx rename to dtool/src/interrogatedb/typeRegistry.cxx index 6dc254abe7..c4db51135b 100644 --- a/panda/src/express/typeRegistry.cxx +++ b/dtool/src/interrogatedb/typeRegistry.cxx @@ -17,16 +17,19 @@ //////////////////////////////////////////////////////////////////// #include "typeRegistry.h" +#include "typeRegistryNode.h" +#include "typeHandle.h" #include "typedObject.h" #include "indent.h" -#include "config_express.h" +#include "config_interrogatedb.h" +#include "configVariableBool.h" #include -// In general, we use the express_cat->info() syntax in this file -// (instead of express_cat.info()), because much of this work is done at +// In general, we use the interrogatedb_cat->info() syntax in this file +// (instead of interrogatedb_cat.info()), because much of this work is done at // static init time, and we must use the arrow syntax to force -// initialization of the express_cat category. +// initialization of the interrogatedb_cat category. TypeRegistry *TypeRegistry::_global_pointer = NULL; @@ -64,9 +67,9 @@ register_type(TypeHandle &type_handle, const string &name) { #ifdef NOTIFY_DEBUG // This code runs at static init time, so cannot use the - // express_cat.is_spam() syntax. - if (express_cat->is_spam()) { - express_cat->spam() << "Registering type " << name << "\n"; + // interrogatedb_cat.is_spam() syntax. + if (interrogatedb_cat->is_spam()) { + interrogatedb_cat->spam() << "Registering type " << name << "\n"; } #endif @@ -101,7 +104,7 @@ register_type(TypeHandle &type_handle, const string &name) { // at the first call to register_type(), and we got the same // reference passed in this time, but now it's different! Bad // juju. - express_cat->error() + interrogatedb_cat->error() << "Reregistering " << name << "\n"; type_handle == rnode->_handle; return false; @@ -109,7 +112,7 @@ register_type(TypeHandle &type_handle, const string &name) { if (type_handle != rnode->_handle) { // Hmm, we seem to have a contradictory type registration! - express_cat->warning() + interrogatedb_cat->warning() << "Attempt to register type " << name << " more than once!\n"; // This is invalid, but we'll allow it anyway. It seems to happen @@ -142,9 +145,9 @@ register_dynamic_type(const string &name) { #ifdef NOTIFY_DEBUG // This code runs at static init time, so cannot use the - // express_cat.is_spam() syntax. - if (express_cat->is_spam()) { - express_cat->spam() << "Registering type " << name << "\n"; + // interrogatedb_cat.is_spam() syntax. + if (interrogatedb_cat->is_spam()) { + interrogatedb_cat->spam() << "Registering type " << name << "\n"; } #endif @@ -211,7 +214,7 @@ record_alternate_name(TypeHandle type, const string &name) { NameRegistry::iterator ri = _name_registry.insert(NameRegistry::value_type(name, rnode)).first; if ((*ri).second != rnode) { - express_cat.warning() + interrogatedb_cat.warning() << "Name " << name << " already assigned to TypeHandle " << rnode->_name << "; cannot reassign to " << type << "\n"; } @@ -254,6 +257,35 @@ get_name(TypeHandle type, TypedObject *object) const { return rnode->_name; } +//////////////////////////////////////////////////////////////////// +// Function: TypeRegistry::is_derived_from +// Access: Public +// Description: Returns true if the first type is derived from the +// second type, false otherwise. +// +// The "child_object" pointer is an optional pointer to +// the TypedObject class that owns the child TypeHandle. +// It is only used in case the TypeHandle is +// inadvertently undefined. +// +// This function definition follows the definitions for +// look_up() and freshen_derivations() just to maximize +// the chance the the compiler will be able to inline +// the above functions. Yeah, a compiler shouldn't +// care, but there's a big different between "shouldn't" +// and "doesn't". +//////////////////////////////////////////////////////////////////// +bool TypeRegistry:: +is_derived_from(TypeHandle child, TypeHandle base, + TypedObject *child_object) { + const TypeRegistryNode *child_node = look_up(child, child_object); + const TypeRegistryNode *base_node = look_up(base, (TypedObject *)NULL); + nassertr(child_node != (TypeRegistryNode *)NULL && + base_node != (TypeRegistryNode *)NULL, false); + freshen_derivations(); + return TypeRegistryNode::is_derived_from(child_node, base_node); +} + //////////////////////////////////////////////////////////////////// // Function: TypeRegistry::get_num_root_classes // Access: Public @@ -400,7 +432,7 @@ reregister_types() { ++ri) { TypeRegistryNode *rnode = (*ri); if (rnode != NULL && rnode->_handle != rnode->_ref) { - express_cat->warning() + interrogatedb_cat->warning() << "Reregistering " << rnode->_name << "\n"; } } @@ -439,8 +471,8 @@ TypeRegistry *TypeRegistry:: ptr() { if (_global_pointer == NULL) { #ifdef NOTIFY_DEBUG - if (express_cat->is_spam()) { - express_cat->spam() + if (interrogatedb_cat->is_spam()) { + interrogatedb_cat->spam() << "Creating global TypeRegistry\n"; } #endif @@ -478,7 +510,13 @@ init_global_pointer() { // Now that we've created the TypeRegistry, we can assign this // Config variable. - TypeRegistryNode::_paranoid_inheritance = get_paranoid_inheritance(); + + ConfigVariableBool paranoid_inheritance + ("paranoid-inheritance", true, + PRC_DESC("Set this to true to double-check the test for inheritance of " + "TypeHandles, e.g. via is_of_type(). This has no effect if NDEBUG " + "is defined.")); + TypeRegistryNode::_paranoid_inheritance = paranoid_inheritance; } //////////////////////////////////////////////////////////////////// @@ -491,7 +529,7 @@ init_global_pointer() { void TypeRegistry:: rebuild_derivations() { #ifdef NOTIFY_DEBUG - express_cat->debug() + interrogatedb_cat->debug() << "Rebuilding derivation tree.\n"; #endif @@ -575,19 +613,19 @@ look_up(TypeHandle handle, TypedObject *object) const { handle = object->force_init_type(); if (handle._index == 0) { // Strange. - express_cat->error() + interrogatedb_cat->error() << "Unable to force_init_type() on unregistered TypeHandle.\n"; nassertr(false, NULL); } if (handle == object->get_type()) { // Problem solved! - express_cat->warning() + interrogatedb_cat->warning() << "Type " << handle << " was unregistered!\n"; } else { // No good; it looks like the TypeHandle belongs to a class // that defined get_type(), but didn't define // force_init_type(). - express_cat->error() + interrogatedb_cat->error() << "Attempt to reference unregistered TypeHandle. Type is of some\n" << "class derived from " << handle << " that doesn't define a good\n" << "force_init_type() method.\n"; @@ -597,17 +635,17 @@ look_up(TypeHandle handle, TypedObject *object) const { } else { // We don't have a TypedObject pointer, so there's nothing we // can do about it. - express_cat->error() + interrogatedb_cat->error() << "Attempt to reference unregistered TypeHandle!\n" << "Registered TypeHandles are:\n"; - write(express_cat->error(false)); + write(interrogatedb_cat->error(false)); nassertr(false, NULL); } } if (handle._index < 0 || handle._index >= (int)_handle_registry.size()) { - express_cat->fatal() + interrogatedb_cat->fatal() << "Invalid TypeHandle index " << handle._index << "! Is memory corrupt?\n"; nassertr(false, NULL); @@ -624,7 +662,7 @@ TypeHandle TypeRegistry::find_type_by_id(int id) const { if (id < 0 ||id >= (int)_handle_registry.size()) { - express_cat->fatal() + interrogatedb_cat->fatal() << "Invalid TypeHandle index " << id << "! Is memory corrupt?\n"; //nassertr(false, NULL); diff --git a/panda/src/express/typeRegistry.h b/dtool/src/interrogatedb/typeRegistry.h similarity index 91% rename from panda/src/express/typeRegistry.h rename to dtool/src/interrogatedb/typeRegistry.h index a763dca08e..82059266f5 100644 --- a/panda/src/express/typeRegistry.h +++ b/dtool/src/interrogatedb/typeRegistry.h @@ -19,15 +19,18 @@ #ifndef TYPEREGISTRY_H #define TYPEREGISTRY_H -#include "pandabase.h" - -#include "typeHandle.h" -#include "typeRegistryNode.h" +#include "dtoolbase.h" #include "notify.h" #include "pvector.h" #include "pmap.h" +#include + +class TypeHandle; +class TypeRegistryNode; +class TypedObject; + //////////////////////////////////////////////////////////////////// // Class : TypeRegistry // Description : The TypeRegistry class maintains all the assigned @@ -37,7 +40,7 @@ // initially, and it should be migrated to shared memory // as soon as shared memory becomes available. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDAEXPRESS TypeRegistry { +class EXPCL_DTOOLCONFIG TypeRegistry { public: // User code shouldn't generally need to call // TypeRegistry::register_type() or record_derivation() directly; @@ -55,8 +58,8 @@ PUBLISHED: string get_name(TypeHandle type, TypedObject *object) const; - INLINE bool is_derived_from(TypeHandle child, TypeHandle base, - TypedObject *child_object); + bool is_derived_from(TypeHandle child, TypeHandle base, + TypedObject *child_object); int get_num_root_classes(); TypeHandle get_root_class(int n); @@ -115,7 +118,7 @@ private: /////////////////////////////////////////// // Helper function to allow for "C" interaction into the type system -extern "C" EXPCL_PANDAEXPRESS int get_best_parent_from_Set(int id, const std::set &set); +extern "C" EXPCL_DTOOLCONFIG int get_best_parent_from_Set(int id, const std::set &set); #include "typeRegistry.I" diff --git a/panda/src/express/typeRegistryNode.I b/dtool/src/interrogatedb/typeRegistryNode.I similarity index 100% rename from panda/src/express/typeRegistryNode.I rename to dtool/src/interrogatedb/typeRegistryNode.I diff --git a/panda/src/express/typeRegistryNode.cxx b/dtool/src/interrogatedb/typeRegistryNode.cxx similarity index 99% rename from panda/src/express/typeRegistryNode.cxx rename to dtool/src/interrogatedb/typeRegistryNode.cxx index 7becc0e84f..22123f929e 100644 --- a/panda/src/express/typeRegistryNode.cxx +++ b/dtool/src/interrogatedb/typeRegistryNode.cxx @@ -17,6 +17,7 @@ //////////////////////////////////////////////////////////////////// #include "typeRegistryNode.h" +#include "config_interrogatedb.h" #include @@ -68,7 +69,7 @@ is_derived_from(const TypeRegistryNode *child, const TypeRegistryNode *base) { if (_paranoid_inheritance) { bool paranoid_derives = check_derived_from(child, base); if (derives != paranoid_derives) { - express_cat.error() + interrogatedb_cat.error() << "Inheritance test for " << child->_name << " from " << base->_name << " failed!\n" << "Result: " << derives << " should have been: " @@ -133,7 +134,7 @@ is_derived_from(const TypeRegistryNode *child, const TypeRegistryNode *base) { if (_paranoid_inheritance) { bool paranoid_derives = check_derived_from(child, base); if (derives != paranoid_derives) { - express_cat.error() + interrogatedb_cat.error() << "Inheritance test for " << child->_name << " from " << base->_name << " failed!\n" << "Result: " << derives << " should have been: " diff --git a/panda/src/express/typeRegistryNode.h b/dtool/src/interrogatedb/typeRegistryNode.h similarity index 97% rename from panda/src/express/typeRegistryNode.h rename to dtool/src/interrogatedb/typeRegistryNode.h index b384147590..d118a51d57 100644 --- a/panda/src/express/typeRegistryNode.h +++ b/dtool/src/interrogatedb/typeRegistryNode.h @@ -19,7 +19,7 @@ #ifndef TYPEREGISTRYNODE_H #define TYPEREGISTRYNODE_H -#include "pandabase.h" +#include "dtoolbase.h" #include "typeHandle.h" @@ -32,7 +32,7 @@ // class; this class is hidden within the TypeRegistry // accessors. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDAEXPRESS TypeRegistryNode { +class EXPCL_DTOOLCONFIG TypeRegistryNode { public: TypeRegistryNode(TypeHandle handle, const string &name, TypeHandle &ref); diff --git a/panda/src/express/typedObject.I b/dtool/src/interrogatedb/typedObject.I similarity index 100% rename from panda/src/express/typedObject.I rename to dtool/src/interrogatedb/typedObject.I diff --git a/panda/src/express/typedObject.cxx b/dtool/src/interrogatedb/typedObject.cxx similarity index 96% rename from panda/src/express/typedObject.cxx rename to dtool/src/interrogatedb/typedObject.cxx index fdf24de542..fdb3f351bf 100644 --- a/panda/src/express/typedObject.cxx +++ b/dtool/src/interrogatedb/typedObject.cxx @@ -17,7 +17,7 @@ //////////////////////////////////////////////////////////////////// #include "typedObject.h" -#include "config_express.h" +#include "config_interrogatedb.h" TypeHandle TypedObject::_type_handle; @@ -42,7 +42,7 @@ get_type() const { // Normally, this function should never be called, because it is a // pure virtual function. If it is called, you probably called // get_type() on a recently-destructed object. - express_cat.warning() + interrogatedb_cat.warning() << "TypedObject::get_type() called!\n"; return _type_handle; } diff --git a/panda/src/express/typedObject.h b/dtool/src/interrogatedb/typedObject.h similarity index 98% rename from panda/src/express/typedObject.h rename to dtool/src/interrogatedb/typedObject.h index 08630da28f..94562d0a03 100644 --- a/panda/src/express/typedObject.h +++ b/dtool/src/interrogatedb/typedObject.h @@ -19,12 +19,12 @@ #ifndef TYPEDOBJECT_H #define TYPEDOBJECT_H -#include "pandabase.h" +#include "dtoolbase.h" #include "typeHandle.h" #include "register_type.h" -#include "set" +#include //////////////////////////////////////////////////////////////////// // Class : TypedObject @@ -104,7 +104,7 @@ // } // //////////////////////////////////////////////////////////////////// -class EXPCL_PANDAEXPRESS TypedObject { +class EXPCL_DTOOLCONFIG TypedObject { public: INLINE TypedObject(); INLINE TypedObject(const TypedObject ©); diff --git a/dtool/src/prc/notify.h b/dtool/src/prc/notify.h index 2108f0e870..97f42d4b6d 100644 --- a/dtool/src/prc/notify.h +++ b/dtool/src/prc/notify.h @@ -22,10 +22,7 @@ #include "dtoolbase.h" #include "notifySeverity.h" - -#include -#include -#include +#include "pmap.h" class NotifyCategory; @@ -96,7 +93,7 @@ private: bool _assert_failed; string _assert_error_message; - typedef map Categories; + typedef pmap Categories; Categories _categories; static Notify *_global_ptr; diff --git a/dtool/src/prckeys/Sources.pp b/dtool/src/prckeys/Sources.pp index a28293ff3d..a9a2499ca7 100644 --- a/dtool/src/prckeys/Sources.pp +++ b/dtool/src/prckeys/Sources.pp @@ -1,4 +1,4 @@ -#define LOCAL_LIBS dtoolutil dtoolbase prc dconfig interrogatedb +#define LOCAL_LIBS pystub dtoolutil dtoolbase prc dconfig interrogatedb #begin bin_target #define BUILD_TARGET $[HAVE_SSL] diff --git a/panda/src/express/Sources.pp b/panda/src/express/Sources.pp index 9d3836c84b..8f474fd224 100644 --- a/panda/src/express/Sources.pp +++ b/panda/src/express/Sources.pp @@ -26,7 +26,7 @@ encryptStreamBuf.h encryptStreamBuf.I encryptStream.h encryptStream.I \ error_utils.h \ hashGeneratorBase.I hashGeneratorBase.h \ - hashVal.I hashVal.h indent.I indent.h \ + hashVal.I hashVal.h \ indirectLess.I indirectLess.h \ littleEndian.h \ memoryInfo.I memoryInfo.h \ @@ -50,7 +50,6 @@ pta_uchar.h \ ramfile.I ramfile.h \ referenceCount.I referenceCount.h \ - register_type.I register_type.h \ reversedNumericData.I reversedNumericData.h \ selectThreadImpl.h \ streamReader.I streamReader.h streamWriter.I streamWriter.h \ @@ -60,11 +59,8 @@ threadDummyImpl.h threadDummyImpl.I thread.h thread.I threadImpl.h \ threadNsprImpl.h threadNsprImpl.I threadPriority.h \ tokenBoard.I \ - tokenBoard.h trueClock.I trueClock.h typeHandle.I \ - typeHandle.h typedObject.I typedObject.h \ + tokenBoard.h trueClock.I trueClock.h \ typedReferenceCount.I typedReferenceCount.h typedef.h \ - typeRegistry.I typeRegistry.h \ - typeRegistryNode.I typeRegistryNode.h \ unicodeLatinMap.h \ vector_uchar.h \ virtualFileComposite.h virtualFileComposite.I virtualFile.h \ @@ -89,7 +85,7 @@ datagramSink.cxx dcast.cxx \ encryptStreamBuf.cxx encryptStream.cxx \ error_utils.cxx \ - hashGeneratorBase.cxx hashVal.cxx indent.cxx \ + hashGeneratorBase.cxx hashVal.cxx \ memoryInfo.cxx memoryUsage.cxx memoryUsagePointerCounts.cxx \ memoryUsagePointers.cxx multifile.cxx \ pmutex.cxx mutexHolder.cxx mutexDummyImpl.cxx mutexNsprImpl.cxx \ @@ -105,16 +101,15 @@ profileTimer.cxx \ pta_uchar.cxx \ ramfile.cxx \ - referenceCount.cxx register_type.cxx \ + referenceCount.cxx \ reversedNumericData.cxx \ streamReader.cxx streamWriter.cxx \ stringDecoder.cxx \ subStream.cxx subStreamBuf.cxx \ textEncoder.cxx \ thread.cxx threadDummyImpl.cxx threadNsprImpl.cxx \ - trueClock.cxx typeHandle.cxx \ - typedObject.cxx typedReferenceCount.cxx \ - typeRegistry.cxx typeRegistryNode.cxx \ + trueClock.cxx \ + typedReferenceCount.cxx \ unicodeLatinMap.cxx \ vector_uchar.cxx \ virtualFileComposite.cxx virtualFile.cxx virtualFileList.cxx \ @@ -146,7 +141,6 @@ error_utils.h \ hashGeneratorBase.I \ hashGeneratorBase.h hashVal.I hashVal.h \ - indent.I indent.h \ indirectLess.I indirectLess.h \ littleEndian.h memoryInfo.I memoryInfo.h memoryUsage.I \ memoryUsage.h memoryUsagePointerCounts.I \ @@ -167,7 +161,6 @@ profileTimer.h pta_uchar.h \ ramfile.I ramfile.h \ referenceCount.I referenceCount.h \ - register_type.I register_type.h \ reversedNumericData.I reversedNumericData.h \ selectThreadImpl.h \ streamReader.I streamReader.h streamWriter.I streamWriter.h \ @@ -177,11 +170,9 @@ threadDummyImpl.h threadDummyImpl.I thread.h thread.I threadImpl.h \ threadNsprImpl.h threadNsprImpl.I threadPriority.h \ tokenBoard.I \ - tokenBoard.h trueClock.I trueClock.h typeHandle.I typeHandle.h \ - typedObject.I typedObject.h typedReferenceCount.I \ + tokenBoard.h trueClock.I trueClock.h \ + typedReferenceCount.I \ typedReferenceCount.h typedef.h \ - typeRegistry.I typeRegistry.h \ - typeRegistryNode.I typeRegistryNode.h \ unicodeLatinMap.h \ vector_uchar.h \ virtualFileComposite.h virtualFileComposite.I virtualFile.h \ diff --git a/panda/src/express/config_express.N b/panda/src/express/config_express.N index 9521bab077..ea6787e08e 100644 --- a/panda/src/express/config_express.N +++ b/panda/src/express/config_express.N @@ -6,6 +6,9 @@ forcetype GlobPattern forcetype Notify forcetype NotifyCategory forcetype NotifySeverity +forcetype TypedObject +forcetype TypeHandle +forcetype TypeRegistry forcetype ConfigExpress renametype ConfigExpress ConfigExpress diff --git a/panda/src/express/config_express.cxx b/panda/src/express/config_express.cxx index 2a02788b83..3edfb8a707 100644 --- a/panda/src/express/config_express.cxx +++ b/panda/src/express/config_express.cxx @@ -248,21 +248,6 @@ get_paranoid_clock() { return *paranoid_clock; } -bool -get_paranoid_inheritance() { - static ConfigVariableBool *paranoid_inheritance = NULL; - - if (paranoid_inheritance == (ConfigVariableBool *)NULL) { - paranoid_inheritance = new ConfigVariableBool - ("paranoid-inheritance", true, - PRC_DESC("Set this to true to double-check the test for inheritance of " - "TypeHandles, e.g. via is_of_type(). This has no effect if NDEBUG " - "is defined.")); - } - - return *paranoid_inheritance; -} - bool get_verify_dcast() { static ConfigVariableBool *verify_dcast = NULL; diff --git a/panda/src/express/dcast.h b/panda/src/express/dcast.h index acbbd1d17d..e95af240db 100644 --- a/panda/src/express/dcast.h +++ b/panda/src/express/dcast.h @@ -23,6 +23,7 @@ #include "typeHandle.h" #include "typedObject.h" +#include "config_express.h" // The DCAST (downcast) macro is defined as a convenience for // downcasting from some TypedObject pointer (or a PointerTo). It's diff --git a/panda/src/express/express_composite1.cxx b/panda/src/express/express_composite1.cxx index 6a5979dd39..2d48c611c6 100644 --- a/panda/src/express/express_composite1.cxx +++ b/panda/src/express/express_composite1.cxx @@ -18,7 +18,6 @@ #include "encryptStream.cxx" #include "hashGeneratorBase.cxx" #include "hashVal.cxx" -#include "indent.cxx" #include "memoryInfo.cxx" #include "memoryUsage.cxx" #include "memoryUsagePointerCounts.cxx" diff --git a/panda/src/express/express_composite2.cxx b/panda/src/express/express_composite2.cxx index 7c662a4c77..8f85af1127 100644 --- a/panda/src/express/express_composite2.cxx +++ b/panda/src/express/express_composite2.cxx @@ -9,7 +9,6 @@ #include "pta_uchar.cxx" #include "ramfile.cxx" #include "referenceCount.cxx" -#include "register_type.cxx" #include "reversedNumericData.cxx" #include "streamReader.cxx" #include "streamWriter.cxx" @@ -21,11 +20,7 @@ #include "threadDummyImpl.cxx" #include "threadNsprImpl.cxx" #include "trueClock.cxx" -#include "typeHandle.cxx" -#include "typedObject.cxx" #include "typedReferenceCount.cxx" -#include "typeRegistry.cxx" -#include "typeRegistryNode.cxx" #include "unicodeLatinMap.cxx" #include "vector_uchar.cxx" #include "virtualFile.cxx" diff --git a/panda/src/express/memoryUsage.h b/panda/src/express/memoryUsage.h index c210cc6e9c..dba019c499 100644 --- a/panda/src/express/memoryUsage.h +++ b/panda/src/express/memoryUsage.h @@ -138,7 +138,7 @@ private: // Actually, it turns out that it doesn't matter, since somehow the // pallocator gets used even though we specify dallocator here, so // we have to make special code that handles the recursion anyway. - typedef map, dallocator > Table; + typedef map, dallocator > > Table; Table _table; int _freeze_index; int _count; @@ -156,7 +156,7 @@ private: private: // Cannot use a pmap, since that would be recursive! typedef map, dallocator > Counts; + less, dallocator > > Counts; Counts _counts; }; TypeHistogram _trend_types; diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index bcd6459673..4f47500ab8 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -4200,6 +4200,7 @@ finish_modify_state() { TexGenAttrib::Mode mode = _current_tex_gen->get_mode(stage); switch (mode) { case TexGenAttrib::M_off: + case TexGenAttrib::M_light_vector: break; case TexGenAttrib::M_eye_sphere_map: