diff --git a/.gitignore b/.gitignore index fe2e883a65..8f3af151c7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,47 @@ -/built_x64 -/built -/thirdparty -/targetroot +# makepanda directories +/built*/ +/thirdparty/ +/targetroot/ +/dstroot/ + +# Core dumps +core +core.* +vgcore.* + +# Editor files/directories +*.save +*.save.1 +*.sublime-workspace +.vscode/ + +# Temporary build files +/_vfsimporter.* +*.pdb +*.obj +*.o +*.gch +*.pch + +# Produced installer/executables +/*.exe +/*.deb +/*.rpm +/*.app +/*.pkg +/*.dmg +/*.whl + +# CMake +/build/ +CMakeCache.txt +CMakeFiles/ +CMakeScripts/ +Makefile +cmake_install.cmake +install_manifest.txt +CTestTestfile.cmake + +# Windows +Thumbs.db +ehthumbs.db diff --git a/contrib/src/ai/aiBehaviors.h b/contrib/src/ai/aiBehaviors.h index 3c11b5e7a8..6a20876db8 100644 --- a/contrib/src/ai/aiBehaviors.h +++ b/contrib/src/ai/aiBehaviors.h @@ -11,10 +11,6 @@ * @date 2009-09-08 */ -#pragma warning (disable:4996) -#pragma warning (disable:4005) -#pragma warning(disable:4275) - #ifndef _AIBEHAVIORS_H #define _AIBEHAVIORS_H diff --git a/contrib/src/ai/aiCharacter.h b/contrib/src/ai/aiCharacter.h index 5d2b2c1d51..9fd0833a99 100644 --- a/contrib/src/ai/aiCharacter.h +++ b/contrib/src/ai/aiCharacter.h @@ -11,11 +11,6 @@ * @date 2009-09-08 */ -#pragma warning (disable:4996) -#pragma warning (disable:4005) -#pragma warning(disable:4275) - - #ifndef _AICHARACTER_H #define _AICHARACTER_H diff --git a/contrib/src/ai/aiGlobals.h b/contrib/src/ai/aiGlobals.h index 749cb9ec21..1d8e8a9c41 100644 --- a/contrib/src/ai/aiGlobals.h +++ b/contrib/src/ai/aiGlobals.h @@ -11,10 +11,6 @@ * @date 2009-09-08 */ -#pragma warning (disable:4996) -#pragma warning (disable:4005) -#pragma warning(disable:4275) - #ifndef _AI_GLOBALS_H #define _AI_GLOBALS_H diff --git a/contrib/src/ai/aiWorld.h b/contrib/src/ai/aiWorld.h index 95115355ba..f85e1dc584 100644 --- a/contrib/src/ai/aiWorld.h +++ b/contrib/src/ai/aiWorld.h @@ -11,11 +11,6 @@ * @date 2009-09-08 */ -#pragma warning (disable:4996) -#pragma warning (disable:4005) -#pragma warning(disable:4275) - - #ifndef _AIWORLD_H #define _AIWORLD_H diff --git a/contrib/src/ai/obstacleAvoidance.cxx b/contrib/src/ai/obstacleAvoidance.cxx index 7160baa096..faf8a1ff05 100644 --- a/contrib/src/ai/obstacleAvoidance.cxx +++ b/contrib/src/ai/obstacleAvoidance.cxx @@ -34,7 +34,7 @@ obstacle_detection() { CPT(BoundingSphere) np_sphere = np_bounds->as_bounding_sphere(); LVecBase3 avoidance(0.0, 0.0, 0.0); double distance = 0x7fff ; - double expanded_radius; + double expanded_radius = 0; LVecBase3 to_obstacle; LVecBase3 prev_avoidance; for(unsigned int i = 0; i < _ai_char->_world->_obstacles.size(); ++i) { @@ -89,8 +89,8 @@ do_obstacle_avoidance() { CPT(BoundingSphere) bsphere = bounds->as_bounding_sphere(); PT(BoundingVolume) np_bounds = _ai_char->get_node_path().get_bounds(); CPT(BoundingSphere) np_sphere = np_bounds->as_bounding_sphere(); - double distance_needed = offset.length() - bsphere->get_radius() - np_sphere->get_radius(); - if((obstacle_detection())) { + + if (obstacle_detection()) { LVecBase3 direction = _ai_char->get_char_render().get_relative_vector(_ai_char->get_node_path(), LVector3::forward()); direction.normalize(); float forward_component = offset.dot(direction); diff --git a/direct/src/controls/BattleWalker.py b/direct/src/controls/BattleWalker.py index a26beb4103..104dc3e55b 100755 --- a/direct/src/controls/BattleWalker.py +++ b/direct/src/controls/BattleWalker.py @@ -1,7 +1,7 @@ from direct.showbase.InputStateGlobal import inputState from direct.task.Task import Task -from pandac.PandaModules import * +from panda3d.core import * from . import GravityWalker BattleStrafe = 0 diff --git a/direct/src/controls/NonPhysicsWalker.py b/direct/src/controls/NonPhysicsWalker.py index 02d2edae30..de5a6bfb00 100755 --- a/direct/src/controls/NonPhysicsWalker.py +++ b/direct/src/controls/NonPhysicsWalker.py @@ -19,7 +19,7 @@ from direct.showbase import DirectObject from direct.controls.ControlManager import CollisionHandlerRayStart from direct.showbase.InputStateGlobal import inputState from direct.task.Task import Task -from pandac.PandaModules import * +from panda3d.core import * class NonPhysicsWalker(DirectObject.DirectObject): notify = DirectNotifyGlobal.directNotify.newCategory("NonPhysicsWalker") diff --git a/direct/src/dcparser/dcArrayParameter.h b/direct/src/dcparser/dcArrayParameter.h index fa9e6e925a..10a8f022c2 100644 --- a/direct/src/dcparser/dcArrayParameter.h +++ b/direct/src/dcparser/dcArrayParameter.h @@ -23,7 +23,7 @@ * parameter type accepts an arbitrary (or possibly fixed) number of nested * fields, all of which are of the same type. */ -class EXPCL_DIRECT DCArrayParameter : public DCParameter { +class DCArrayParameter : public DCParameter { public: DCArrayParameter(DCParameter *element_type, const DCUnsignedIntRange &size = DCUnsignedIntRange()); diff --git a/direct/src/dcparser/dcAtomicField.h b/direct/src/dcparser/dcAtomicField.h index b03d8ed290..c002ecf15a 100644 --- a/direct/src/dcparser/dcAtomicField.h +++ b/direct/src/dcparser/dcAtomicField.h @@ -27,7 +27,7 @@ * This defines an interface to the Distributed Class, and is always * implemented as a remote procedure method. */ -class EXPCL_DIRECT DCAtomicField : public DCField { +class DCAtomicField : public DCField { public: DCAtomicField(const string &name, DCClass *dclass, bool bogus_field); virtual ~DCAtomicField(); diff --git a/direct/src/dcparser/dcClass.h b/direct/src/dcparser/dcClass.h index 94d077b540..9e981a0097 100644 --- a/direct/src/dcparser/dcClass.h +++ b/direct/src/dcparser/dcClass.h @@ -41,7 +41,7 @@ class DCParameter; /** * Defines a particular DistributedClass as read from an input .dc file. */ -class EXPCL_DIRECT DCClass : public DCDeclaration { +class DCClass : public DCDeclaration { public: DCClass(DCFile *dc_file, const string &name, bool is_struct, bool bogus_class); diff --git a/direct/src/dcparser/dcClassParameter.h b/direct/src/dcparser/dcClassParameter.h index 913ed20a6e..e846d48f88 100644 --- a/direct/src/dcparser/dcClassParameter.h +++ b/direct/src/dcparser/dcClassParameter.h @@ -23,7 +23,7 @@ class DCClass; * This represents a class (or struct) object used as a parameter itself. * This means that all the fields of the class get packed into the message. */ -class EXPCL_DIRECT DCClassParameter : public DCParameter { +class DCClassParameter : public DCParameter { public: DCClassParameter(const DCClass *dclass); DCClassParameter(const DCClassParameter ©); diff --git a/direct/src/dcparser/dcDeclaration.h b/direct/src/dcparser/dcDeclaration.h index ced47b3737..218473aef4 100644 --- a/direct/src/dcparser/dcDeclaration.h +++ b/direct/src/dcparser/dcDeclaration.h @@ -26,7 +26,7 @@ class DCSwitch; * only purpose is so that classes and typedefs can be stored in one list * together so they can be ordered correctly on output. */ -class EXPCL_DIRECT DCDeclaration { +class DCDeclaration { public: virtual ~DCDeclaration(); diff --git a/direct/src/dcparser/dcField.h b/direct/src/dcparser/dcField.h index 2bf2b5e840..e7f2dbcd3c 100644 --- a/direct/src/dcparser/dcField.h +++ b/direct/src/dcparser/dcField.h @@ -34,7 +34,7 @@ class HashGenerator; /** * A single field of a Distributed Class, either atomic or molecular. */ -class EXPCL_DIRECT DCField : public DCPackerInterface, public DCKeywordList { +class DCField : public DCPackerInterface, public DCKeywordList { public: DCField(); DCField(const string &name, DCClass *dclass); diff --git a/direct/src/dcparser/dcFile.h b/direct/src/dcparser/dcFile.h index ec3f431aa7..8ad67e1ace 100644 --- a/direct/src/dcparser/dcFile.h +++ b/direct/src/dcparser/dcFile.h @@ -29,7 +29,7 @@ class DCDeclaration; * Represents the complete list of Distributed Class descriptions as read from * a .dc file. */ -class EXPCL_DIRECT DCFile { +class DCFile { PUBLISHED: DCFile(); ~DCFile(); diff --git a/direct/src/dcparser/dcKeyword.h b/direct/src/dcparser/dcKeyword.h index aa074c6f37..76c212c093 100644 --- a/direct/src/dcparser/dcKeyword.h +++ b/direct/src/dcparser/dcKeyword.h @@ -25,7 +25,7 @@ class HashGenerator; * define a communication property associated with a field, for instance * "broadcast" or "airecv". */ -class EXPCL_DIRECT DCKeyword : public DCDeclaration { +class DCKeyword : public DCDeclaration { public: DCKeyword(const string &name, int historical_flag = ~0); virtual ~DCKeyword(); diff --git a/direct/src/dcparser/dcKeywordList.h b/direct/src/dcparser/dcKeywordList.h index b5e35b3247..ada61ffaa0 100644 --- a/direct/src/dcparser/dcKeywordList.h +++ b/direct/src/dcparser/dcKeywordList.h @@ -23,7 +23,7 @@ class HashGenerator; * This is a list of keywords (see DCKeyword) that may be set on a particular * field. */ -class EXPCL_DIRECT DCKeywordList { +class DCKeywordList { public: DCKeywordList(); DCKeywordList(const DCKeywordList ©); diff --git a/direct/src/dcparser/dcMolecularField.h b/direct/src/dcparser/dcMolecularField.h index 8b2d056bdd..6d532a1b23 100644 --- a/direct/src/dcparser/dcMolecularField.h +++ b/direct/src/dcparser/dcMolecularField.h @@ -25,7 +25,7 @@ class DCParameter; * This represents a combination of two or more related atomic fields, that * will often be treated as a unit. */ -class EXPCL_DIRECT DCMolecularField : public DCField { +class DCMolecularField : public DCField { public: DCMolecularField(const string &name, DCClass *dclass); diff --git a/direct/src/dcparser/dcPackData.h b/direct/src/dcparser/dcPackData.h index 9d19548591..99cd0abbd5 100644 --- a/direct/src/dcparser/dcPackData.h +++ b/direct/src/dcparser/dcPackData.h @@ -19,7 +19,7 @@ /** * This is a block of data that receives the results of DCPacker. */ -class EXPCL_DIRECT DCPackData { +class DCPackData { PUBLISHED: INLINE DCPackData(); INLINE ~DCPackData(); diff --git a/direct/src/dcparser/dcPacker.h b/direct/src/dcparser/dcPacker.h index 049429e0ec..380d40600c 100644 --- a/direct/src/dcparser/dcPacker.h +++ b/direct/src/dcparser/dcPacker.h @@ -31,7 +31,7 @@ class DCSwitchParameter; * See also direct/src/doc/dcPacker.txt for a more complete description and * examples of using this class. */ -class EXPCL_DIRECT DCPacker { +class DCPacker { PUBLISHED: DCPacker(); ~DCPacker(); @@ -216,7 +216,7 @@ private: const DCPackerCatalog *_catalog; const DCPackerCatalog::LiveCatalog *_live_catalog; - class EXPCL_DIRECT StackElement { + class StackElement { public: // As an optimization, we implement operator new and delete here to // minimize allocation overhead during push() and pop(). diff --git a/direct/src/dcparser/dcPackerCatalog.h b/direct/src/dcparser/dcPackerCatalog.h index 70c75e2d1a..71469d6744 100644 --- a/direct/src/dcparser/dcPackerCatalog.h +++ b/direct/src/dcparser/dcPackerCatalog.h @@ -26,7 +26,7 @@ class DCSwitchParameter; * requested from a particular field; its ownership is retained by the field * so it must not be deleted. */ -class EXPCL_DIRECT DCPackerCatalog { +class DCPackerCatalog { private: DCPackerCatalog(const DCPackerInterface *root); DCPackerCatalog(const DCPackerCatalog ©); diff --git a/direct/src/dcparser/dcPackerInterface.h b/direct/src/dcparser/dcPackerInterface.h index eca03d3257..42284ac54f 100644 --- a/direct/src/dcparser/dcPackerInterface.h +++ b/direct/src/dcparser/dcPackerInterface.h @@ -64,7 +64,7 @@ END_PUBLISH * Normally these methods are called only by the DCPacker object; the user * wouldn't normally call these directly. */ -class EXPCL_DIRECT DCPackerInterface { +class DCPackerInterface { public: DCPackerInterface(const string &name = string()); DCPackerInterface(const DCPackerInterface ©); diff --git a/direct/src/dcparser/dcParameter.h b/direct/src/dcparser/dcParameter.h index d8765f4d54..6c8ae910a6 100644 --- a/direct/src/dcparser/dcParameter.h +++ b/direct/src/dcparser/dcParameter.h @@ -32,7 +32,7 @@ class HashGenerator; * This may also be a typedef reference to another type, which has the same * properties as the referenced type, but a different name. */ -class EXPCL_DIRECT DCParameter : public DCField { +class DCParameter : public DCField { protected: DCParameter(); DCParameter(const DCParameter ©); diff --git a/direct/src/dcparser/dcSimpleParameter.h b/direct/src/dcparser/dcSimpleParameter.h index 747950939a..5e2e39c498 100644 --- a/direct/src/dcparser/dcSimpleParameter.h +++ b/direct/src/dcparser/dcSimpleParameter.h @@ -25,7 +25,7 @@ * divisor, which is meaningful only for the numeric type elements (and * represents a fixed-point numeric convention). */ -class EXPCL_DIRECT DCSimpleParameter : public DCParameter { +class DCSimpleParameter : public DCParameter { public: DCSimpleParameter(DCSubatomicType type, unsigned int divisor = 1); DCSimpleParameter(const DCSimpleParameter ©); diff --git a/direct/src/dcparser/dcSwitch.h b/direct/src/dcparser/dcSwitch.h index 355edd2403..77eefdbb6f 100644 --- a/direct/src/dcparser/dcSwitch.h +++ b/direct/src/dcparser/dcSwitch.h @@ -27,7 +27,7 @@ class DCField; * and represents two or more alternative unpacking schemes based on the first * field read. */ -class EXPCL_DIRECT DCSwitch : public DCDeclaration { +class DCSwitch : public DCDeclaration { public: DCSwitch(const string &name, DCField *key_parameter); virtual ~DCSwitch(); diff --git a/direct/src/dcparser/dcSwitchParameter.h b/direct/src/dcparser/dcSwitchParameter.h index 4456cfd6a5..0303af620f 100644 --- a/direct/src/dcparser/dcSwitchParameter.h +++ b/direct/src/dcparser/dcSwitchParameter.h @@ -23,7 +23,7 @@ class DCSwitch; * This represents a switch object used as a parameter itself, which packs the * appropriate fields of the switch into the message. */ -class EXPCL_DIRECT DCSwitchParameter : public DCParameter { +class DCSwitchParameter : public DCParameter { public: DCSwitchParameter(const DCSwitch *dswitch); DCSwitchParameter(const DCSwitchParameter ©); diff --git a/direct/src/dcparser/dcTypedef.h b/direct/src/dcparser/dcTypedef.h index 515df985af..62797fc8ff 100644 --- a/direct/src/dcparser/dcTypedef.h +++ b/direct/src/dcparser/dcTypedef.h @@ -23,7 +23,7 @@ class DCParameter; * This represents a single typedef declaration in the dc file. It assigns a * particular type to a new name, just like a C typedef. */ -class EXPCL_DIRECT DCTypedef : public DCDeclaration { +class DCTypedef : public DCDeclaration { public: DCTypedef(DCParameter *parameter, bool implicit = false); DCTypedef(const string &name); diff --git a/direct/src/distributed/CartesianGridBase.py b/direct/src/distributed/CartesianGridBase.py index d45fb00292..f5e9d90339 100755 --- a/direct/src/distributed/CartesianGridBase.py +++ b/direct/src/distributed/CartesianGridBase.py @@ -1,4 +1,4 @@ -from pandac.PandaModules import Vec3 +from panda3d.core import Vec3 # Utility functions that are useful to both AI and client CartesianGrid code class CartesianGridBase: diff --git a/direct/src/distributed/ClientRepositoryBase.py b/direct/src/distributed/ClientRepositoryBase.py index 9836f0fd0b..826d3058fd 100644 --- a/direct/src/distributed/ClientRepositoryBase.py +++ b/direct/src/distributed/ClientRepositoryBase.py @@ -1,4 +1,5 @@ -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from .MsgTypes import * from direct.task import Task from direct.directnotify import DirectNotifyGlobal diff --git a/direct/src/distributed/ConnectionRepository.py b/direct/src/distributed/ConnectionRepository.py index deda5ab5c6..105b77a9a9 100644 --- a/direct/src/distributed/ConnectionRepository.py +++ b/direct/src/distributed/ConnectionRepository.py @@ -1,4 +1,5 @@ -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from direct.task import Task from direct.directnotify.DirectNotifyGlobal import directNotify from direct.distributed.DoInterestManager import DoInterestManager diff --git a/direct/src/distributed/DistributedCamera.py b/direct/src/distributed/DistributedCamera.py index 297a24bf98..8c9b076338 100755 --- a/direct/src/distributed/DistributedCamera.py +++ b/direct/src/distributed/DistributedCamera.py @@ -1,4 +1,5 @@ -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from direct.fsm.FSM import FSM from direct.interval.IntervalGlobal import * from direct.distributed.DistributedObject import DistributedObject diff --git a/direct/src/distributed/DistributedCameraOV.py b/direct/src/distributed/DistributedCameraOV.py index 82945de29e..a539b12794 100755 --- a/direct/src/distributed/DistributedCameraOV.py +++ b/direct/src/distributed/DistributedCameraOV.py @@ -1,4 +1,5 @@ -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from direct.distributed.DistributedObjectOV import DistributedObjectOV class DistributedCameraOV(DistributedObjectOV): diff --git a/direct/src/distributed/DistributedCartesianGrid.py b/direct/src/distributed/DistributedCartesianGrid.py index 8c156af9d1..3942f3a154 100755 --- a/direct/src/distributed/DistributedCartesianGrid.py +++ b/direct/src/distributed/DistributedCartesianGrid.py @@ -1,5 +1,6 @@ -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from direct.interval.IntervalGlobal import * from direct.directnotify.DirectNotifyGlobal import directNotify diff --git a/direct/src/distributed/DistributedCartesianGridAI.py b/direct/src/distributed/DistributedCartesianGridAI.py index 3b830b8028..2ad2983aa1 100755 --- a/direct/src/distributed/DistributedCartesianGridAI.py +++ b/direct/src/distributed/DistributedCartesianGridAI.py @@ -1,5 +1,6 @@ -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from direct.directnotify.DirectNotifyGlobal import directNotify from direct.task import Task from .DistributedNodeAI import DistributedNodeAI diff --git a/direct/src/distributed/DistributedNodeAI.py b/direct/src/distributed/DistributedNodeAI.py index 3d30e8d707..f119ee6a93 100644 --- a/direct/src/distributed/DistributedNodeAI.py +++ b/direct/src/distributed/DistributedNodeAI.py @@ -1,4 +1,4 @@ -from pandac.PandaModules import NodePath +from panda3d.core import NodePath from . import DistributedObjectAI from . import GridParent diff --git a/direct/src/distributed/DistributedObjectGlobalUD.py b/direct/src/distributed/DistributedObjectGlobalUD.py index c5be6f012a..b8f84b472e 100755 --- a/direct/src/distributed/DistributedObjectGlobalUD.py +++ b/direct/src/distributed/DistributedObjectGlobalUD.py @@ -35,9 +35,9 @@ class DistributedObjectGlobalUD(DistributedObjectUD): def __execMessage(self, message): if not self.ExecNamespace: # Import some useful variables into the ExecNamespace initially. - import pandac.PandaModules + import panda3d.core - for key, value in pandac.PandaModules.__dict__.items(): + for key, value in panda3d.core.__dict__.items(): if not key.startswith('__'): self.ExecNamespace[key] = value #self.importExecNamespace() diff --git a/direct/src/distributed/DistributedObjectUD.py b/direct/src/distributed/DistributedObjectUD.py index 4309ad7d80..c67d0004cc 100755 --- a/direct/src/distributed/DistributedObjectUD.py +++ b/direct/src/distributed/DistributedObjectUD.py @@ -3,7 +3,8 @@ from direct.directnotify.DirectNotifyGlobal import directNotify from direct.distributed.DistributedObjectBase import DistributedObjectBase from direct.showbase import PythonUtil -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * #from PyDatagram import PyDatagram #from PyDatagramIterator import PyDatagramIterator diff --git a/direct/src/distributed/DistributedSmoothNode.py b/direct/src/distributed/DistributedSmoothNode.py index cdc2dc034e..1d6aef43fb 100644 --- a/direct/src/distributed/DistributedSmoothNode.py +++ b/direct/src/distributed/DistributedSmoothNode.py @@ -1,6 +1,7 @@ """DistributedSmoothNode module: contains the DistributedSmoothNode class""" -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from .ClockDelta import * from . import DistributedNode from . import DistributedSmoothNodeBase diff --git a/direct/src/distributed/DoInterestManager.py b/direct/src/distributed/DoInterestManager.py index a81000a788..eb616d3f26 100755 --- a/direct/src/distributed/DoInterestManager.py +++ b/direct/src/distributed/DoInterestManager.py @@ -7,7 +7,8 @@ zone, remove interest in that zone. p.s. A great deal of this code is just code moved from ClientRepository.py. """ -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from .MsgTypes import * from direct.showbase.PythonUtil import * from direct.showbase import DirectObject diff --git a/direct/src/distributed/GridParent.py b/direct/src/distributed/GridParent.py index 1fc9713897..5d5d47b8e5 100755 --- a/direct/src/distributed/GridParent.py +++ b/direct/src/distributed/GridParent.py @@ -1,5 +1,6 @@ -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * # # GridParent.py diff --git a/direct/src/distributed/ServerRepository.py b/direct/src/distributed/ServerRepository.py index 11cec06ac3..4031998b50 100644 --- a/direct/src/distributed/ServerRepository.py +++ b/direct/src/distributed/ServerRepository.py @@ -1,6 +1,7 @@ """ServerRepository module: contains the ServerRepository class""" -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from direct.distributed.MsgTypesCMU import * from direct.task import Task from direct.directnotify import DirectNotifyGlobal diff --git a/direct/src/distributed/TimeManager.py b/direct/src/distributed/TimeManager.py index f74a97300b..714abd7f7d 100644 --- a/direct/src/distributed/TimeManager.py +++ b/direct/src/distributed/TimeManager.py @@ -1,5 +1,5 @@ from direct.showbase.DirectObject import * -from pandac.PandaModules import * +from panda3d.core import * from direct.task import Task from direct.distributed import DistributedObject from direct.directnotify import DirectNotifyGlobal diff --git a/direct/src/distributed/TimeManagerAI.py b/direct/src/distributed/TimeManagerAI.py index c912394326..2e235523ce 100644 --- a/direct/src/distributed/TimeManagerAI.py +++ b/direct/src/distributed/TimeManagerAI.py @@ -1,5 +1,5 @@ from direct.distributed.ClockDelta import * -from pandac.PandaModules import * +from panda3d.core import * from direct.distributed import DistributedObjectAI class TimeManagerAI(DistributedObjectAI.DistributedObjectAI): diff --git a/direct/src/distributed/cConnectionRepository.cxx b/direct/src/distributed/cConnectionRepository.cxx index 4d615b2179..41fb3d6286 100644 --- a/direct/src/distributed/cConnectionRepository.cxx +++ b/direct/src/distributed/cConnectionRepository.cxx @@ -402,8 +402,28 @@ send_datagram(const Datagram &dg) { } #ifdef WANT_NATIVE_NET - if(_native) - return _bdc.SendMessage(dg); + if (_native) { + bool result = _bdc.SendMessage(); + if (!result && _bdc.IsConnected()) { +#ifdef HAVE_PYTHON + ostringstream s; + +#if PY_VERSION_HEX >= 0x03030000 + PyObject *exc_type = PyExc_ConnectionError; +#else + PyObject *exc_type = PyExc_OSError; +#endif + + s << endl << "Error sending message: " << endl; + msg.dump_hex(s); + s << "Message data: " << msg.get_data() << endl; + + string message = s.str(); + PyErr_SetString(exc_type, message.c_str()); +#endif + } + return result; + } #endif #ifdef HAVE_NET diff --git a/direct/src/fsm/FSM.py b/direct/src/fsm/FSM.py index 577c1232b7..3aa583f007 100644 --- a/direct/src/fsm/FSM.py +++ b/direct/src/fsm/FSM.py @@ -149,7 +149,7 @@ class FSM(DirectObject): def __init__(self, name): self.fsmLock = RLock() - self.name = name + self._name = name self.stateArray = [] self._serialNum = FSM.SerialNum FSM.SerialNum += 1 @@ -185,7 +185,7 @@ class FSM(DirectObject): # the messenger on every state change. The new and old states are # accessible as self.oldState and self.newState, and the transition # functions will already have been called. - return 'FSM-%s-%s-stateChange' % (self._serialNum, self.name) + return 'FSM-%s-%s-stateChange' % (self._serialNum, self._name) def getCurrentFilter(self): if not self.state: @@ -240,7 +240,7 @@ class FSM(DirectObject): try: assert isinstance(request, str) self.notify.debug("%s.forceTransition(%s, %s" % ( - self.name, request, str(args)[1:])) + self._name, request, str(args)[1:])) if not self.state: # Queue up the request. @@ -268,7 +268,7 @@ class FSM(DirectObject): try: assert isinstance(request, str) self.notify.debug("%s.demand(%s, %s" % ( - self.name, request, str(args)[1:])) + self._name, request, str(args)[1:])) if not self.state: # Queue up the request. self.__requestQueue.append(PythonUtil.Functor( @@ -307,7 +307,7 @@ class FSM(DirectObject): try: assert isinstance(request, str) self.notify.debug("%s.request(%s, %s" % ( - self.name, request, str(args)[1:])) + self._name, request, str(args)[1:])) filter = self.getCurrentFilter() result = filter(request, args) @@ -385,7 +385,7 @@ class FSM(DirectObject): # In either case, we quietly ignore unhandled command # (lowercase) requests. - assert self.notify.debug("%s ignoring request %s from state %s." % (self.name, request, self.state)) + assert self.notify.debug("%s ignoring request %s from state %s." % (self._name, request, self.state)) return None def filterOff(self, request, args): @@ -444,7 +444,7 @@ class FSM(DirectObject): # Internal function to change unconditionally to the indicated # state. assert self.state - assert self.notify.debug("%s to state %s." % (self.name, newState)) + assert self.notify.debug("%s to state %s." % (self._name, newState)) self.oldState = self.state self.newState = newState @@ -476,7 +476,7 @@ class FSM(DirectObject): if self.__requestQueue: request = self.__requestQueue.pop(0) - assert self.notify.debug("%s continued queued request." % (self.name)) + assert self.notify.debug("%s continued queued request." % (self._name)) request() def __callEnterFunc(self, name, *args): @@ -525,9 +525,9 @@ class FSM(DirectObject): try: className = self.__class__.__name__ if self.state: - str = ('%s FSM:%s in state "%s"' % (className, self.name, self.state)) + str = ('%s FSM:%s in state "%s"' % (className, self._name, self.state)) else: - str = ('%s FSM:%s in transition from \'%s\' to \'%s\'' % (className, self.name, self.oldState, self.newState)) + str = ('%s FSM:%s in transition from \'%s\' to \'%s\'' % (className, self._name, self.oldState, self.newState)) return str finally: self.fsmLock.release() diff --git a/direct/src/p3d/FileSpec.py b/direct/src/p3d/FileSpec.py index f6ca6b93d0..ddd1dafd6e 100644 --- a/direct/src/p3d/FileSpec.py +++ b/direct/src/p3d/FileSpec.py @@ -33,7 +33,7 @@ class FileSpec: if st is None: st = os.stat(pathname.toOsSpecific()) self.size = st.st_size - self.timestamp = st.st_mtime + self.timestamp = int(st.st_mtime) self.readHash(pathname) @@ -124,7 +124,7 @@ class FileSpec: self.__correctHash(packageDir, pathname, st, notify) return False - if st.st_mtime == self.timestamp: + if int(st.st_mtime) == self.timestamp: # If the size is right and the timestamp is right, the # file passes. if notify: @@ -198,7 +198,7 @@ class FileSpec: # The hash is OK. If the timestamp is wrong, change it back # to what we expect it to be, so we can quick-verify it # successfully next time. - if st.st_mtime != self.timestamp: + if int(st.st_mtime) != self.timestamp: self.__updateTimestamp(pathname, st) return True @@ -219,7 +219,7 @@ class FileSpec: if notify: notify.info("Correcting timestamp of %s to %d (%s)" % ( self.filename, st.st_mtime, time.asctime(time.localtime(st.st_mtime)))) - self.timestamp = st.st_mtime + self.timestamp = int(st.st_mtime) def checkHash(self, packageDir, pathname, st): """ Returns true if the file has the expected md5 hash, false diff --git a/direct/src/plugin/p3dCInstance.h b/direct/src/plugin/p3dCInstance.h index 40708f7d0c..8d0ebc29c2 100644 --- a/direct/src/plugin/p3dCInstance.h +++ b/direct/src/plugin/p3dCInstance.h @@ -21,8 +21,6 @@ #include "get_tinyxml.h" #include "windowHandle.h" -#include - class P3DSession; /** diff --git a/direct/src/showbase/BufferViewer.py b/direct/src/showbase/BufferViewer.py index b1a2f39593..c2a7f86049 100644 --- a/direct/src/showbase/BufferViewer.py +++ b/direct/src/showbase/BufferViewer.py @@ -278,6 +278,15 @@ class BufferViewer(DirectObject): self.analyzeTextureSet(self.exclude, exclude) self.analyzeTextureSet(self.include, include) + # Use a custom sampler when applying the textures. This fixes + # wrap issues and prevents depth compare on shadow maps. + sampler = SamplerState() + sampler.setWrapU(SamplerState.WM_clamp) + sampler.setWrapV(SamplerState.WM_clamp) + sampler.setWrapW(SamplerState.WM_clamp) + sampler.setMinfilter(SamplerState.FT_linear) + sampler.setMagfilter(SamplerState.FT_nearest) + # Generate a list of cards and the corresponding windows. cards = [] wins = [] @@ -290,7 +299,7 @@ class BufferViewer(DirectObject): for face in range(6): self.cardmaker.setUvRangeCube(face) card = NodePath(self.cardmaker.generate()) - card.setTexture(tex) + card.setTexture(tex, sampler) cards.append(card) elif (tex.getTextureType() == Texture.TT2dTextureArray): for layer in range(tex.getZSize()): @@ -301,11 +310,11 @@ class BufferViewer(DirectObject): # the fixed-function pipeline, so we need to # enable the shader generator to view them. card.setShaderAuto() - card.setTexture(tex) + card.setTexture(tex, sampler) cards.append(card) else: card = win.getTextureCard() - card.setTexture(tex) + card.setTexture(tex, sampler) cards.append(card) wins.append(win) exclude[tex] = 1 diff --git a/direct/src/showbase/ExceptionVarDump.py b/direct/src/showbase/ExceptionVarDump.py index 82060a7d24..42aca9b7c9 100755 --- a/direct/src/showbase/ExceptionVarDump.py +++ b/direct/src/showbase/ExceptionVarDump.py @@ -1,5 +1,6 @@ __all__ = ["install"] +from panda3d.core import * from direct.directnotify.DirectNotifyGlobal import directNotify from direct.showbase.PythonUtil import fastRepr import sys diff --git a/direct/src/showbase/LeakDetectors.py b/direct/src/showbase/LeakDetectors.py index 1124d1301d..38d45d225b 100755 --- a/direct/src/showbase/LeakDetectors.py +++ b/direct/src/showbase/LeakDetectors.py @@ -1,6 +1,6 @@ # objects that report different types of leaks to the ContainerLeakDetector -from pandac.PandaModules import * +from panda3d.core import * from direct.showbase.DirectObject import DirectObject from direct.showbase.Job import Job import gc, sys diff --git a/direct/src/showbase/Loader.py b/direct/src/showbase/Loader.py index 5aca6c4042..b22de7400b 100644 --- a/direct/src/showbase/Loader.py +++ b/direct/src/showbase/Loader.py @@ -28,7 +28,7 @@ class Loader(DirectObject): self.extraArgs = extraArgs self.numRemaining = numObjects self.cancelled = False - self.requests = {} + self.requests = set() def gotObject(self, index, object): self.objects[index] = object @@ -45,6 +45,8 @@ class Loader(DirectObject): self.base = base self.loader = PandaLoader.getGlobalPtr() + self.__requests = {} + self.hook = "async_loader_%s" % (Loader.loaderIndex) Loader.loaderIndex += 1 self.accept(self.hook, self.__gotAsyncObject) @@ -116,7 +118,7 @@ class Loader(DirectObject): """ assert Loader.notify.debug("Loading model: %s" % (modelPath)) - if loaderOptions == None: + if loaderOptions is None: loaderOptions = LoaderOptions() else: loaderOptions = LoaderOptions(loaderOptions) @@ -156,7 +158,7 @@ class Loader(DirectObject): result = [] for modelPath in modelList: node = self.loader.loadSync(Filename(modelPath), loaderOptions) - if (node != None): + if node is not None: nodePath = NodePath(node) else: nodePath = None @@ -179,16 +181,16 @@ class Loader(DirectObject): # callback (passing it the models on the parameter list). cb = Loader.Callback(len(modelList), gotList, callback, extraArgs) - i=0 + i = 0 for modelPath in modelList: request = self.loader.makeAsyncRequest(Filename(modelPath), loaderOptions) if priority is not None: request.setPriority(priority) request.setDoneEvent(self.hook) - request.setPythonObject((cb, i)) - i+=1 self.loader.loadAsync(request) - cb.requests[request] = True + cb.requests.add(request) + self.__requests[request] = (cb, i) + i += 1 return cb def cancelRequest(self, cb): @@ -200,6 +202,7 @@ class Loader(DirectObject): cb.cancelled = True for request in cb.requests: self.loader.remove(request) + del self.__requests[request] cb.requests = None def isRequestPending(self, cb): @@ -273,7 +276,7 @@ class Loader(DirectObject): # to resolve it for us. options = LoaderOptions(LoaderOptions.LFSearch | LoaderOptions.LFNoDiskCache | LoaderOptions.LFCacheOnly) modelNode = self.loader.loadSync(Filename(model), options) - if modelNode == None: + if modelNode is None: # Model not found. assert Loader.notify.debug("Unloading model not loaded: %s" % (model)) return @@ -293,7 +296,7 @@ class Loader(DirectObject): a callback is used, the model is saved asynchronously, and the true/false status is passed to the callback function. """ - if loaderOptions == None: + if loaderOptions is None: loaderOptions = LoaderOptions() else: loaderOptions = LoaderOptions(loaderOptions) @@ -342,16 +345,16 @@ class Loader(DirectObject): # callback (passing it the models on the parameter list). cb = Loader.Callback(len(modelList), gotList, callback, extraArgs) - i=0 + i = 0 for modelPath, node in modelList: request = self.loader.makeAsyncSaveRequest(Filename(modelPath), loaderOptions, node) if priority is not None: request.setPriority(priority) request.setDoneEvent(self.hook) - request.setPythonObject((cb, i)) - i+=1 self.loader.saveAsync(request) - cb.requests[request] = True + cb.requests.add(request) + self.__requests[request] = (cb, i) + i += 1 return cb @@ -496,7 +499,7 @@ class Loader(DirectObject): phaseChecker(modelPath, loaderOptions) font = FontPool.loadFont(modelPath) - if font == None: + if font is None: if not okMissing: message = 'Could not load font file: %s' % (modelPath) raise IOError(message) @@ -506,21 +509,21 @@ class Loader(DirectObject): # The following properties may only be set for dynamic fonts. if hasattr(font, "setPointSize"): - if pointSize != None: + if pointSize is not None: font.setPointSize(pointSize) - if pixelsPerUnit != None: + if pixelsPerUnit is not None: font.setPixelsPerUnit(pixelsPerUnit) - if scaleFactor != None: + if scaleFactor is not None: font.setScaleFactor(scaleFactor) - if textureMargin != None: + if textureMargin is not None: font.setTextureMargin(textureMargin) - if polyMargin != None: + if polyMargin is not None: font.setPolyMargin(polyMargin) - if minFilter != None: + if minFilter is not None: font.setMinfilter(minFilter) - if magFilter != None: + if magFilter is not None: font.setMagfilter(magFilter) - if anisotropicDegree != None: + if anisotropicDegree is not None: font.setAnisotropicDegree(anisotropicDegree) if color: font.setFg(color) @@ -577,10 +580,10 @@ class Loader(DirectObject): the texture and the number of expected mipmap images. If minfilter or magfilter is not None, they should be a symbol - like Texture.FTLinear or Texture.FTNearest. (minfilter may be - further one of the Mipmap filter type symbols.) These specify - the filter mode that will automatically be applied to the - texture when it is loaded. Note that this setting may + like SamplerState.FTLinear or SamplerState.FTNearest. (minfilter + may be further one of the Mipmap filter type symbols.) These + specify the filter mode that will automatically be applied to + the texture when it is loaded. Note that this setting may override the texture's existing settings, even if it has already been loaded. See egg-texture-cards for a more robust way to apply per-texture filter types and settings. @@ -596,7 +599,7 @@ class Loader(DirectObject): left image and '1' for the right image. Larger numbers are also allowed if you need more than two views. """ - if loaderOptions == None: + if loaderOptions is None: loaderOptions = LoaderOptions() else: loaderOptions = LoaderOptions(loaderOptions) @@ -657,7 +660,7 @@ class Loader(DirectObject): numbered 8 - 15 will be part of the right eye view. """ assert Loader.notify.debug("Loading 3-D texture: %s" % (texturePattern)) - if loaderOptions == None: + if loaderOptions is None: loaderOptions = LoaderOptions() else: loaderOptions = LoaderOptions(loaderOptions) @@ -711,7 +714,7 @@ class Loader(DirectObject): and each six images will define a new view. """ assert Loader.notify.debug("Loading cube map: %s" % (texturePattern)) - if loaderOptions == None: + if loaderOptions is None: loaderOptions = LoaderOptions() else: loaderOptions = LoaderOptions(loaderOptions) @@ -821,13 +824,12 @@ class Loader(DirectObject): # callback (passing it the sounds on the parameter list). cb = Loader.Callback(len(soundList), gotList, callback, extraArgs) - for i in range(len(soundList)): - soundPath = soundList[i] + for i, soundPath in enumerate(soundList): request = AudioLoadRequest(manager, soundPath, positional) request.setDoneEvent(self.hook) - request.setPythonObject((cb, i)) self.loader.loadAsync(request) - cb.requests[request] = True + cb.requests.add(request) + self.__requests[request] = (cb, i) return cb def unloadSfx(self, sfx): @@ -852,7 +854,7 @@ class Loader(DirectObject): return shader def unloadShader(self, shaderPath): - if (shaderPath != None): + if shaderPath is not None: ShaderPool.releaseShader(shaderPath) def asyncFlattenStrong(self, model, inPlace = True, @@ -886,14 +888,14 @@ class Loader(DirectObject): gotList = True cb = Loader.Callback(len(modelList), gotList, callback, extraArgs) - i=0 + i = 0 for model in modelList: request = ModelFlattenRequest(model.node()) request.setDoneEvent(self.hook) - request.setPythonObject((cb, i)) - i+=1 self.loader.loadAsync(request) - cb.requests[request] = True + cb.requests.add(request) + self.__requests[request] = (cb, i) + i += 1 return cb def __asyncFlattenDone(self, models, @@ -921,16 +923,23 @@ class Loader(DirectObject): of loaded objects, and call the appropriate callback when it's time.""" - cb, i = request.getPythonObject() - if cb.cancelled: + if request not in self.__requests: return - del cb.requests[request] + cb, i = self.__requests[request] + if cb.cancelled: + # Shouldn't be here. + del self.__requests[request] + return + + cb.requests.discard(request) + if not cb.requests: + del self.__requests[request] object = None if hasattr(request, "getModel"): node = request.getModel() - if (node != None): + if node is not None: object = NodePath(node) elif hasattr(request, "getSound"): diff --git a/direct/src/showbase/MirrorDemo.py b/direct/src/showbase/MirrorDemo.py index f72142b634..e2a77dbf82 100755 --- a/direct/src/showbase/MirrorDemo.py +++ b/direct/src/showbase/MirrorDemo.py @@ -23,7 +23,7 @@ surface are possible, like a funhouse mirror. However, the reflection itself is always basically planar; for more accurate convex reflections, you will need to use a sphere map or a cube map.""" -from pandac.PandaModules import * +from panda3d.core import * from direct.task import Task def setupMirror(name, width, height, rootCamera = None): diff --git a/direct/src/showbase/ShadowDemo.py b/direct/src/showbase/ShadowDemo.py index b7fff5e596..78f9d33dd0 100755 --- a/direct/src/showbase/ShadowDemo.py +++ b/direct/src/showbase/ShadowDemo.py @@ -14,7 +14,7 @@ multitexture rendering techniques. It's not a particularly great way to do shadows. """ -from pandac.PandaModules import * +from panda3d.core import * from direct.task import Task sc = None diff --git a/direct/src/showbase/ShadowPlacer.py b/direct/src/showbase/ShadowPlacer.py index b0563d007c..80826926f7 100755 --- a/direct/src/showbase/ShadowPlacer.py +++ b/direct/src/showbase/ShadowPlacer.py @@ -12,7 +12,7 @@ the its parent node. from direct.controls.ControlManager import CollisionHandlerRayStart from direct.directnotify import DirectNotifyGlobal -from pandac.PandaModules import * +from panda3d.core import * from . import DirectObject class ShadowPlacer(DirectObject.DirectObject): diff --git a/direct/src/showutil/FreezeTool.py b/direct/src/showutil/FreezeTool.py index d75a79b56b..c734c56101 100644 --- a/direct/src/showutil/FreezeTool.py +++ b/direct/src/showutil/FreezeTool.py @@ -984,7 +984,10 @@ class Freezer: try: self.__loadModule(mdef) except ImportError as ex: - print("Unknown module: %s (%s)" % (mdef.moduleName, str(ex))) + message = "Unknown module: %s" % (mdef.moduleName) + if str(ex) != "No module named " + str(mdef.moduleName): + message += " (%s)" % (ex) + print(message) # Also attempt to import any implicit modules. If any of # these fail to import, we don't really care. diff --git a/direct/src/stdpy/thread.py b/direct/src/stdpy/thread.py index d10a47fb54..05090e65d8 100644 --- a/direct/src/stdpy/thread.py +++ b/direct/src/stdpy/thread.py @@ -102,7 +102,7 @@ def start_new_thread(function, args, kwargs = {}, name = None): name = 'PythonThread-%s' % (threadId) thread = core.PythonThread(threadFunc, [threadId], name, name) - thread.setPythonData(threadId) + thread.setPythonIndex(threadId) _threads[threadId] = (thread, {}, None) thread.start(core.TPNormal, False) @@ -121,7 +121,7 @@ def _add_thread(thread, wrapper): threadId = _nextThreadId _nextThreadId += 1 - thread.setPythonData(threadId) + thread.setPythonIndex(threadId) _threads[threadId] = (thread, {}, wrapper) return threadId @@ -133,8 +133,8 @@ def _get_thread_wrapper(thread, wrapperClass): is not one, creates an instance of the indicated wrapperClass instead. """ - threadId = thread.getPythonData() - if threadId is None: + threadId = thread.getPythonIndex() + if threadId == -1: # The thread has never been assigned a threadId. Go assign one. global _nextThreadId @@ -143,7 +143,7 @@ def _get_thread_wrapper(thread, wrapperClass): threadId = _nextThreadId _nextThreadId += 1 - thread.setPythonData(threadId) + thread.setPythonIndex(threadId) wrapper = wrapperClass(thread, threadId) _threads[threadId] = (thread, {}, wrapper) return wrapper @@ -169,8 +169,8 @@ def _get_thread_locals(thread, i): """ Returns the locals dictionary for the indicated thread. If there is not one, creates an empty dictionary. """ - threadId = thread.getPythonData() - if threadId is None: + threadId = thread.getPythonIndex() + if threadId == -1: # The thread has never been assigned a threadId. Go assign one. global _nextThreadId @@ -179,7 +179,7 @@ def _get_thread_locals(thread, i): threadId = _nextThreadId _nextThreadId += 1 - thread.setPythonData(threadId) + thread.setPythonIndex(threadId) locals = {} _threads[threadId] = (thread, locals, None) return locals.setdefault(i, {}) @@ -205,9 +205,9 @@ def _remove_thread_id(threadId): _threadsLock.acquire() try: thread, locals, wrapper = _threads[threadId] - assert thread.getPythonData() == threadId + assert thread.getPythonIndex() == threadId del _threads[threadId] - thread.setPythonData(None) + thread.setPythonIndex(-1) finally: _threadsLock.release() diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index 90c661c63a..04fa87010d 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -1,3 +1,35 @@ +------------------------ RELEASE 1.9.3 ------------------------ + +This issue fixes several bugs that were still found in 1.9.2. + +* Fix crash when running in Steam on Linux when using OpenAL +* Fix crash using wx/tkinter on Mac as long as want-wx/tk is set +* Fix loading models from 'models' package with models/ prefix +* Fix random crashes in task system +* Fix memory leaks in BulletTriangleMesh +* Fix loading old models with MovingPart +* Improve performance of CPU vertex animation somewhat +* Show framebuffer properties when fbprop request fails +* Show error instead of crash on use of object before __init__ +* Fix hang on exit when using Python task on threaded task chain +* Fix inability to get RGBA renderbuffer in certain cases +* Work around GLSL issue with #pragma and certain Intel drivers +* Improve performance of texture load and store operations +* Fix crashes with pbuffers on Intel cards on Windows +* Support for Autodesk Maya 2016.5 +* Add shadow-depth-bits config var to control shadow map depth +* Fix cull issue when rendering cube map (or any multi-lens setup) +* Fix crash rendering with the same camera to different contexts +* Fix compile error when making static build with DX9 renderer +* Fix assertion when using aux render targets in DX9 +* Work around Cg bug generating invalid ASM for saturated tex loads +* Fix issues with certain Cg shader inputs in DX9 +* Support uint8 index buffers in DX9 +* Fix occasional frame lag when loading a big model asynchronously +* Fix race condition reading string config var +* Fix interrogate parsing issue with "const static" +* Add back missing libp3pystub.a to Mac OS X SDK + ------------------------ RELEASE 1.9.2 ------------------------ This is a minor bugfix release, fixing a few minor issues that diff --git a/dtool/src/cppparser/cppBison.cxx.prebuilt b/dtool/src/cppparser/cppBison.cxx.prebuilt index 697bc6c30a..427e91bf55 100644 --- a/dtool/src/cppparser/cppBison.cxx.prebuilt +++ b/dtool/src/cppparser/cppBison.cxx.prebuilt @@ -815,16 +815,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 85 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 5523 +#define YYLAST 5547 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 150 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 109 +#define YYNNTS 104 /* YYNRULES -- Number of rules. */ -#define YYNRULES 680 +#define YYNRULES 672 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 1339 +#define YYNSTATES 1320 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ @@ -887,71 +887,70 @@ static const yytype_uint16 yyrline[] = 447, 451, 464, 463, 475, 476, 477, 478, 479, 480, 481, 494, 503, 507, 515, 519, 523, 534, 555, 585, 602, 630, 667, 689, 722, 744, 755, 769, 768, 783, - 787, 791, 802, 806, 810, 814, 818, 822, 826, 830, - 834, 838, 842, 846, 854, 855, 859, 860, 864, 868, - 877, 885, 893, 898, 897, 913, 912, 934, 942, 953, - 962, 976, 975, 991, 990, 1005, 1020, 1026, 1035, 1042, - 1055, 1054, 1079, 1078, 1106, 1105, 1136, 1135, 1154, 1153, - 1174, 1173, 1205, 1204, 1230, 1243, 1247, 1251, 1255, 1259, - 1263, 1268, 1272, 1283, 1287, 1291, 1295, 1299, 1303, 1307, - 1311, 1315, 1319, 1323, 1327, 1331, 1335, 1339, 1343, 1347, - 1351, 1355, 1359, 1363, 1367, 1371, 1375, 1379, 1383, 1387, - 1391, 1395, 1399, 1403, 1407, 1411, 1415, 1419, 1423, 1427, - 1431, 1435, 1442, 1443, 1448, 1447, 1455, 1459, 1460, 1464, - 1470, 1479, 1483, 1487, 1491, 1495, 1501, 1511, 1515, 1520, - 1532, 1536, 1550, 1565, 1570, 1575, 1580, 1585, 1590, 1595, - 1600, 1606, 1605, 1627, 1637, 1647, 1651, 1655, 1664, 1668, - 1673, 1677, 1682, 1690, 1695, 1703, 1707, 1712, 1716, 1721, - 1729, 1734, 1742, 1746, 1753, 1757, 1764, 1768, 1772, 1776, - 1780, 1787, 1791, 1795, 1799, 1803, 1807, 1814, 1815, 1816, - 1820, 1823, 1824, 1825, 1829, 1834, 1840, 1846, 1857, 1861, - 1871, 1875, 1879, 1884, 1889, 1894, 1899, 1904, 1909, 1917, - 1921, 1925, 1930, 1935, 1940, 1945, 1950, 1955, 1960, 1966, - 1974, 1978, 1983, 1988, 1993, 1998, 2003, 2008, 2016, 2020, - 2025, 2030, 2035, 2040, 2045, 2050, 2055, 2061, 2068, 2075, - 2085, 2089, 2097, 2101, 2105, 2109, 2113, 2129, 2145, 2154, - 2161, 2165, 2173, 2177, 2181, 2185, 2189, 2205, 2221, 2239, - 2248, 2255, 2259, 2267, 2271, 2287, 2303, 2312, 2319, 2323, - 2331, 2335, 2344, 2343, 2368, 2367, 2397, 2398, 2405, 2406, - 2410, 2411, 2415, 2419, 2423, 2427, 2431, 2435, 2439, 2443, - 2447, 2451, 2458, 2466, 2470, 2474, 2479, 2487, 2491, 2498, - 2499, 2504, 2511, 2512, 2517, 2525, 2529, 2533, 2540, 2544, - 2548, 2556, 2555, 2578, 2577, 2600, 2601, 2605, 2611, 2618, - 2627, 2628, 2629, 2633, 2637, 2641, 2645, 2649, 2653, 2658, - 2663, 2668, 2673, 2677, 2682, 2691, 2696, 2704, 2708, 2712, - 2720, 2730, 2730, 2740, 2741, 2745, 2746, 2747, 2748, 2749, - 2750, 2751, 2752, 2753, 2754, 2755, 2755, 2755, 2756, 2756, - 2756, 2756, 2757, 2757, 2757, 2757, 2757, 2758, 2758, 2758, - 2759, 2759, 2759, 2759, 2759, 2760, 2760, 2760, 2760, 2760, - 2761, 2761, 2761, 2761, 2761, 2762, 2762, 2762, 2762, 2762, - 2763, 2763, 2763, 2763, 2764, 2764, 2764, 2764, 2764, 2765, - 2765, 2765, 2765, 2765, 2766, 2766, 2766, 2766, 2766, 2766, - 2767, 2767, 2767, 2767, 2767, 2768, 2768, 2768, 2768, 2769, - 2769, 2769, 2769, 2770, 2770, 2770, 2770, 2770, 2771, 2771, - 2771, 2772, 2772, 2772, 2772, 2772, 2773, 2773, 2773, 2773, - 2773, 2774, 2774, 2774, 2774, 2774, 2777, 2777, 2777, 2777, - 2777, 2777, 2777, 2777, 2777, 2777, 2777, 2778, 2778, 2778, - 2778, 2778, 2778, 2778, 2778, 2778, 2778, 2779, 2779, 2783, - 2787, 2794, 2798, 2805, 2809, 2816, 2820, 2824, 2828, 2832, - 2836, 2840, 2844, 2848, 2852, 2856, 2860, 2864, 2868, 2872, - 2876, 2880, 2884, 2888, 2892, 2896, 2900, 2904, 2908, 2912, - 2916, 2920, 2924, 2928, 2932, 2936, 2940, 2944, 2948, 2952, - 2956, 2960, 2968, 2972, 2976, 2980, 2984, 2988, 2992, 3002, - 3008, 3014, 3020, 3026, 3032, 3038, 3045, 3052, 3059, 3066, - 3072, 3078, 3082, 3086, 3090, 3094, 3105, 3116, 3120, 3124, - 3128, 3132, 3136, 3140, 3144, 3148, 3152, 3156, 3160, 3164, - 3168, 3172, 3176, 3180, 3184, 3188, 3192, 3196, 3200, 3204, - 3208, 3212, 3216, 3220, 3224, 3228, 3232, 3236, 3243, 3247, - 3251, 3255, 3259, 3263, 3267, 3271, 3275, 3281, 3287, 3291, - 3295, 3309, 3313, 3317, 3321, 3325, 3329, 3333, 3337, 3341, - 3345, 3349, 3360, 3371, 3375, 3379, 3383, 3387, 3391, 3395, - 3399, 3403, 3407, 3411, 3415, 3419, 3423, 3427, 3431, 3435, - 3439, 3443, 3447, 3451, 3455, 3459, 3463, 3467, 3471, 3475, - 3479, 3483, 3487, 3494, 3498, 3502, 3506, 3510, 3514, 3518, - 3522, 3526, 3532, 3538, 3546, 3547, 3548, 3552, 3553, 3554, - 3555, 3559, 3567, 3575, 3603, 3607, 3611, 3615, 3619, 3625, - 3629, 3633, 3637, 3648, 3652, 3656, 3664, 3668, 3672, 3678, - 3689 + 787, 792, 796, 807, 811, 815, 819, 823, 827, 831, + 835, 839, 843, 847, 851, 859, 860, 864, 865, 870, + 869, 885, 894, 902, 910, 918, 929, 945, 944, 959, + 974, 983, 998, 997, 1022, 1021, 1049, 1048, 1079, 1078, + 1097, 1096, 1117, 1116, 1148, 1147, 1173, 1186, 1190, 1194, + 1198, 1202, 1206, 1211, 1215, 1226, 1230, 1234, 1238, 1242, + 1246, 1250, 1254, 1258, 1262, 1266, 1270, 1274, 1278, 1282, + 1286, 1290, 1294, 1298, 1302, 1306, 1310, 1314, 1318, 1322, + 1326, 1330, 1334, 1338, 1342, 1346, 1350, 1354, 1358, 1362, + 1366, 1370, 1374, 1378, 1385, 1386, 1391, 1390, 1398, 1402, + 1403, 1407, 1413, 1422, 1426, 1430, 1434, 1438, 1444, 1454, + 1458, 1463, 1475, 1479, 1493, 1508, 1513, 1518, 1523, 1528, + 1533, 1538, 1543, 1549, 1548, 1570, 1580, 1590, 1594, 1598, + 1607, 1611, 1616, 1620, 1625, 1633, 1638, 1646, 1650, 1655, + 1659, 1664, 1672, 1677, 1685, 1689, 1696, 1700, 1707, 1711, + 1715, 1719, 1723, 1730, 1734, 1738, 1742, 1746, 1750, 1757, + 1758, 1759, 1763, 1766, 1767, 1768, 1772, 1777, 1783, 1789, + 1800, 1804, 1814, 1818, 1822, 1827, 1832, 1837, 1842, 1847, + 1852, 1860, 1864, 1868, 1873, 1878, 1883, 1888, 1893, 1898, + 1903, 1909, 1917, 1921, 1926, 1931, 1936, 1941, 1946, 1951, + 1959, 1963, 1968, 1973, 1978, 1983, 1988, 1993, 1998, 2004, + 2011, 2018, 2028, 2032, 2040, 2044, 2048, 2052, 2056, 2072, + 2088, 2097, 2104, 2108, 2116, 2120, 2124, 2128, 2132, 2148, + 2164, 2182, 2191, 2198, 2202, 2210, 2214, 2230, 2246, 2255, + 2262, 2266, 2274, 2278, 2287, 2286, 2311, 2310, 2340, 2341, + 2348, 2349, 2353, 2354, 2358, 2362, 2366, 2370, 2374, 2378, + 2382, 2386, 2390, 2394, 2401, 2409, 2413, 2417, 2422, 2430, + 2434, 2441, 2442, 2447, 2454, 2455, 2460, 2468, 2472, 2476, + 2483, 2487, 2491, 2499, 2498, 2521, 2520, 2543, 2544, 2548, + 2554, 2561, 2570, 2571, 2572, 2576, 2580, 2584, 2588, 2592, + 2596, 2601, 2606, 2611, 2616, 2620, 2625, 2634, 2639, 2647, + 2651, 2655, 2663, 2673, 2673, 2683, 2684, 2688, 2689, 2690, + 2691, 2692, 2693, 2694, 2695, 2696, 2697, 2698, 2698, 2698, + 2699, 2699, 2699, 2699, 2700, 2700, 2700, 2700, 2700, 2701, + 2701, 2701, 2702, 2702, 2702, 2702, 2702, 2703, 2703, 2703, + 2703, 2703, 2704, 2704, 2704, 2704, 2704, 2705, 2705, 2705, + 2705, 2705, 2706, 2706, 2706, 2706, 2707, 2707, 2707, 2707, + 2707, 2708, 2708, 2708, 2708, 2708, 2709, 2709, 2709, 2709, + 2709, 2709, 2710, 2710, 2710, 2710, 2710, 2711, 2711, 2711, + 2711, 2712, 2712, 2712, 2712, 2713, 2713, 2713, 2713, 2713, + 2714, 2714, 2714, 2715, 2715, 2715, 2715, 2715, 2716, 2716, + 2716, 2716, 2716, 2717, 2717, 2717, 2717, 2717, 2720, 2720, + 2720, 2720, 2720, 2720, 2720, 2720, 2720, 2720, 2720, 2721, + 2721, 2721, 2721, 2721, 2721, 2721, 2721, 2721, 2721, 2722, + 2722, 2726, 2730, 2737, 2741, 2748, 2752, 2759, 2763, 2767, + 2771, 2775, 2779, 2783, 2787, 2791, 2795, 2799, 2803, 2807, + 2811, 2815, 2819, 2823, 2827, 2831, 2835, 2839, 2843, 2847, + 2851, 2855, 2859, 2863, 2867, 2871, 2875, 2879, 2883, 2887, + 2891, 2895, 2899, 2903, 2911, 2915, 2919, 2923, 2927, 2931, + 2935, 2945, 2951, 2957, 2963, 2969, 2975, 2981, 2988, 2995, + 3002, 3009, 3015, 3021, 3025, 3029, 3033, 3037, 3048, 3059, + 3063, 3067, 3071, 3075, 3079, 3083, 3087, 3091, 3095, 3099, + 3103, 3107, 3111, 3115, 3119, 3123, 3127, 3131, 3135, 3139, + 3143, 3147, 3151, 3155, 3159, 3163, 3167, 3171, 3175, 3179, + 3186, 3190, 3194, 3198, 3202, 3206, 3210, 3214, 3218, 3224, + 3230, 3234, 3238, 3252, 3256, 3260, 3264, 3268, 3272, 3276, + 3280, 3284, 3288, 3292, 3303, 3314, 3318, 3322, 3326, 3330, + 3334, 3338, 3342, 3346, 3350, 3354, 3358, 3362, 3366, 3370, + 3374, 3378, 3382, 3386, 3390, 3394, 3398, 3402, 3406, 3410, + 3414, 3418, 3422, 3426, 3430, 3437, 3441, 3445, 3449, 3453, + 3457, 3461, 3465, 3469, 3475, 3481, 3489, 3490, 3491, 3495, + 3496, 3497, 3498, 3502, 3510, 3518, 3546, 3550, 3554, 3558, + 3562, 3568, 3572, 3576, 3580, 3591, 3595, 3599, 3607, 3611, + 3615, 3621, 3632 }; #endif @@ -991,16 +990,14 @@ static const char *const yytname[] = "'!'", "$accept", "grammar", "cpp", "constructor_inits", "constructor_init", "extern_c", "$@1", "declaration", "friend_declaration", "$@2", "storage_class", "attribute_specifiers", - "attribute_specifier", "type_like_declaration", - "multiple_var_declaration", "$@3", "$@4", - "multiple_instance_identifiers", "multiple_const_instance_identifiers", - "typedef_declaration", "$@5", "$@6", "typedef_instance_identifiers", - "typedef_const_instance_identifiers", "constructor_prototype", "$@7", - "$@8", "function_prototype", "$@9", "$@10", "$@11", "$@12", "$@13", + "attribute_specifier", "type_like_declaration", "$@3", + "multiple_instance_identifiers", "typedef_declaration", "$@4", + "typedef_instance_identifiers", "constructor_prototype", "$@5", "$@6", + "function_prototype", "$@7", "$@8", "$@9", "$@10", "$@11", "function_post", "function_operator", "more_template_declaration", - "template_declaration", "$@14", "template_formal_parameters", + "template_declaration", "$@12", "template_formal_parameters", "template_nonempty_formal_parameters", "template_formal_parameter", - "template_formal_parameter_type", "instance_identifier", "$@15", + "template_formal_parameter_type", "instance_identifier", "$@13", "instance_identifier_and_maybe_trailing_return_type", "maybe_trailing_return_type", "function_parameter_list", "function_parameters", "formal_parameter_list", "formal_parameters", @@ -1011,12 +1008,12 @@ static const char *const yytname[] = "not_paren_formal_parameter_identifier", "formal_parameter_identifier", "not_paren_empty_instance_identifier", "empty_instance_identifier", "type", "type_decl", "predefined_type", "var_type_decl", "full_type", - "anonymous_struct", "$@16", "named_struct", "$@17", "maybe_final", + "anonymous_struct", "$@14", "named_struct", "$@15", "maybe_final", "maybe_class_derivation", "class_derivation", "base_specification", "enum", "enum_decl", "enum_element_type", "enum_body_trailing_comma", "enum_body", "enum_keyword", "struct_keyword", "namespace_declaration", - "$@18", "$@19", "using_declaration", "simple_type", "simple_int_type", - "simple_float_type", "simple_void_type", "code", "$@20", "code_block", + "$@16", "$@17", "using_declaration", "simple_type", "simple_int_type", + "simple_float_type", "simple_void_type", "code", "$@18", "code_block", "element", "optional_const_expr", "optional_const_expr_comma", "const_expr_comma", "no_angle_bracket_const_expr", "const_expr", "const_operand", "formal_const_expr", "formal_const_operand", @@ -1048,12 +1045,12 @@ static const yytype_uint16 yytoknum[] = }; # endif -#define YYPACT_NINF -703 +#define YYPACT_NINF -734 #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-703))) + (!!((Yystate) == (-734))) -#define YYTABLE_NINF -676 +#define YYTABLE_NINF -668 #define yytable_value_is_error(Yytable_value) \ 0 @@ -1062,140 +1059,138 @@ static const yytype_uint16 yytoknum[] = STATE-NUM. */ static const yytype_int16 yypact[] = { - 362, -703, 2822, 4474, 57, 3018, -703, -703, -703, -703, - -703, -703, -703, -703, -118, -82, -78, -69, -61, -41, - -13, -30, -4, -703, -703, -18, -2, 1, 4682, -703, - -703, 23, 59, 73, 89, 133, -703, 141, 188, 199, - 2822, 2822, 2822, 2822, 2822, 1432, 585, 2822, 3762, -703, - 189, -703, -703, -703, -703, -703, -703, -703, 4704, 213, - -703, -20, -703, -703, 1983, 2722, 2722, -703, 1244, -703, - 2722, -703, -703, 62, -703, -703, -703, -703, 66, 48, - 959, -703, -703, -703, -703, -703, -703, 5378, 5378, -703, - 5378, 892, 5378, 160, -703, 5335, 225, 227, 233, 251, - 5378, 2255, 191, 269, 272, 5378, 5378, 263, 5263, 5378, - 5378, 2691, 5378, 5378, -703, 63, -703, -703, -703, 3269, - -703, -703, -703, -703, -703, -703, 2822, 4474, 2822, 2822, - 2822, 2822, 4474, 2822, 4474, 2822, 2822, 2822, -703, -703, - 278, 1244, 289, 1244, 1244, -703, 4474, 2822, 2822, 4474, - 4474, 1432, 2822, 2822, 79, 79, 79, 79, 79, -118, - -78, -69, -61, -41, -30, -18, -2, 2511, 2380, 2608, - 2625, 199, 309, -83, 3762, -703, -703, -703, -703, -703, - -703, -703, -703, -703, -703, 1244, 310, 332, -703, -703, - 79, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, - 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, - 2822, 2822, 2252, 2822, -703, -703, 62, 2822, -703, -703, - -703, 2722, -703, -703, -703, -703, -703, 322, 145, 62, - 62, 145, 145, 4033, 321, -703, 324, -703, -703, -703, - -703, 1115, 342, 27, 64, 87, -703, -703, -703, 5378, - -703, -703, -703, 5378, -703, -703, -703, 5231, 2349, -703, - 1244, 1244, 1244, 1244, -703, -703, 363, -703, -703, -703, - -703, -703, 2822, 3300, -703, 346, -703, 3376, -703, 1244, - 115, -703, -703, 1244, 300, 348, -703, 2943, 349, 4546, - 1244, -703, 1244, 350, 148, 370, -703, -703, -703, -703, - 900, 959, -703, 344, 381, -703, 351, 378, 383, 384, - 385, 396, 388, 399, 392, 397, 398, 2822, -703, 2822, - -703, -703, 413, 406, 407, 409, 425, 416, 3483, 417, - 418, 2822, 2822, -703, -703, -24, 585, 935, 3983, 1311, - 1311, 117, 117, 729, 729, -703, 3672, 4123, 4039, 1275, - 117, 117, 167, 167, 79, 79, 79, -703, -703, -36, - 1126, -703, 3504, 145, 441, 145, 145, 145, 145, 145, - 364, -703, 321, -703, 321, -703, 364, 364, -703, 145, - 4603, 4452, 145, 145, 435, 37, -703, 623, -703, 2822, - 1244, 436, -703, -703, -703, -703, 1115, -703, 509, -703, - -703, -703, 458, 466, 467, 470, 477, 4839, -703, 3443, - 4236, 295, 464, 2943, 148, -703, -703, 481, -703, 4474, - 468, 485, 471, -703, 20, -703, -703, -703, 2822, 4704, - 403, -703, -703, 474, -703, -703, 1244, -9, -703, -703, - -703, 1553, -703, -703, 529, -703, 491, -703, -703, -703, - -703, -703, -703, -703, 479, -703, 480, -703, -703, -703, - 3522, 482, 483, -703, -703, -703, 486, -703, -703, -703, - -703, 79, 3762, -703, 4308, 932, -703, -703, 2822, -703, - -703, -703, 364, 145, 364, 364, 364, 364, 364, 2822, - -58, 4704, 623, -703, 26, 35, 572, -703, 4380, 492, - 623, 623, 623, 623, 623, 623, -21, -703, -703, 484, - 3762, -703, -34, -703, 510, 4895, -703, 511, -703, 4951, - -703, 631, 633, 634, 637, -703, -703, 355, 523, -703, - -703, 1244, 2467, 1244, 516, 530, -703, 623, -703, -703, - 20, -703, -703, 529, -703, 528, 512, 1244, 2014, 4308, - 522, 529, 4308, 529, 3540, 403, 533, 403, 403, 403, - 403, 403, 95, -703, -703, 5007, -703, 520, -703, 210, - -703, -71, 546, 547, 537, 548, 549, 2366, 3707, 550, - 529, 529, 3133, 529, 529, 529, 529, -703, 138, 308, - -703, 1115, 2822, 2822, -703, -703, 2822, 2822, 539, 4625, - -703, -703, -703, -703, 543, 564, -703, 3762, 364, 544, - 552, 623, -21, 555, 556, 932, -703, -703, 623, 557, - 557, 557, 557, 557, 265, 2822, 2822, -703, -703, 558, - -703, 2822, -703, 4125, 568, 574, -703, -703, -703, -23, - 577, 579, 584, 5063, 41, -703, 582, 623, 587, 5309, - 4236, 44, 529, -703, 308, -703, 5378, -703, -703, -703, - -703, -703, -703, -703, 601, 586, 611, -703, -703, 4682, - -703, -703, 612, 605, 615, -703, 609, 2822, 2822, 2822, - 2822, 1432, 2822, 610, 78, -703, -703, 3804, -703, 189, - -703, 613, 529, 367, 614, -703, 308, -703, 273, 403, - 618, 618, 618, 618, 618, -703, 2822, -703, 4308, -703, - 1867, -703, -703, 1244, 2822, 2822, -703, -703, -703, -703, - -703, 2366, 619, 638, 3762, -703, -703, 529, 301, 301, - 748, -703, -703, -703, -703, -703, -703, -703, -703, -703, - -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, - -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, - -703, -703, -703, -703, -703, -703, -703, 622, 621, -703, - -703, 301, 301, 301, 373, 766, -703, 2822, -703, 1553, - 645, -703, 510, 17, 80, 98, 142, 572, 4682, 62, - 369, -703, -703, 4308, -21, -703, 4308, 4308, -703, 557, - 629, 3762, 627, 3726, 4743, 4759, 4798, 1244, 426, -703, - 1244, -703, -703, -703, 4125, 5119, 767, 650, 769, 772, - 773, -703, 657, 4474, 44, 4474, -703, -703, -703, -703, - 2936, -703, -703, -703, 308, 660, -703, -703, 4474, 4474, - 4474, 647, 4474, 4474, 4474, 1432, 79, 79, 79, 79, - 654, 144, 79, -703, -703, 2133, 2822, 2822, 2822, 2822, - 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, - 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2480, 2822, 572, - 382, 661, 572, 674, -703, -703, 618, 4308, 656, 662, - -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, - -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, - -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, - -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, - -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, - -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, - -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, - -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, - -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, - -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, - -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, - -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, - -703, -703, -703, -703, -703, 659, -703, 663, 665, 667, - -703, 2594, 301, -703, -703, -703, -703, -703, 2014, 668, - 3707, 529, -703, -703, -703, -703, 932, 62, -703, -703, - 669, 670, 682, -703, 688, 689, 4308, -703, -703, 3147, - -703, 3147, -703, 3147, -703, -703, 3147, 3147, 3147, -703, - 5175, -703, -703, 154, -703, 175, 691, 176, -703, -703, - -703, -703, 694, 697, 705, 707, 699, 709, 2936, 2936, - 2936, 2936, 2936, 1432, 2936, 3935, -703, 720, -703, 529, - 706, 715, 717, 2822, 721, 719, 739, 730, 3575, 2822, - -703, -703, -703, 935, 3983, 1311, 1311, 117, 117, 729, - 729, -703, 3744, 4123, 4039, 1275, 117, 117, 167, 167, - 79, 79, 79, -703, -703, 196, 2034, 283, 733, -703, - 283, 529, 4308, 736, -703, 572, 1720, -703, -703, -703, - -703, 2366, 3762, 738, -703, -703, 753, -703, -703, -703, - 572, 572, 572, 741, -703, -703, -703, -703, -703, -703, - -703, 875, 760, 879, 764, 765, 884, 768, 4474, 4474, - 4474, 4474, 4474, 4474, 205, 205, 205, 205, 205, 749, - 198, 205, 2936, 2936, 2936, 2936, 2936, 2936, 2936, 2936, - 2936, 2936, 2936, 2936, 2936, 2936, 2936, 2936, 2936, 2936, - 2936, 2708, 2822, 529, -703, -703, 771, 774, 751, 775, - -703, 777, -703, -703, 79, 2822, -703, -703, -703, 4308, - -703, 763, 572, 283, -703, 761, 572, -703, 932, 932, - 932, 572, 770, -703, 785, -703, -703, 200, -703, 795, - 781, 807, 809, 802, 813, 2936, -703, 1567, 3965, 3088, - 3088, 462, 462, 762, 762, -703, 3893, 2266, 4139, 4168, - 686, 686, 205, 205, 205, -703, -703, 201, 3164, -703, - 2822, 2822, -703, 2822, 2822, 3762, 4308, 812, 572, 283, - -703, 283, 816, -703, -703, -703, 283, 837, 903, 956, - 847, -703, 832, 833, 834, -703, 836, 205, 2936, -703, - -703, 206, 245, 247, 248, 835, 572, 283, -703, -703, - 838, 841, -703, 2822, 2822, 2822, 2822, 3935, -703, -703, - -703, -703, 572, 932, 854, 855, 256, 257, 258, 262, - 932, -703, -703, -703, -703, -703, -703, -703, -703 + 234, -734, 2792, 4509, 43, 3003, -734, -734, -734, -734, + -734, -734, -734, -734, -90, -84, -79, -70, -48, -32, + -11, -24, 10, -734, -734, 15, 41, 65, 4717, -734, + -734, 77, 76, 99, 129, 147, -734, 142, 164, 178, + 2792, 2792, 2792, 2792, 2792, 1390, 310, 2792, 3797, -734, + 252, -734, -734, -734, -734, -734, -734, -734, 4739, 181, + -734, -23, -734, -734, 1575, 1958, 1958, -734, 2339, -734, + 1958, -734, -734, 144, -734, -734, -734, -734, -22, 82, + 1087, -734, -734, -734, -734, -734, -734, 5402, 5402, 5402, + -734, 5402, 895, 5402, 162, -734, 5366, 203, 216, 219, + 225, 5402, 1487, 244, 251, 258, 5402, 5402, 250, 5297, + 5402, 5402, 2433, 5402, 5402, -734, 253, -734, -734, -734, + 3265, -734, -734, -734, -734, -734, 2792, 4509, 2792, 2792, + 2792, 2792, 4509, 2792, 4509, 2792, 2792, 2792, -734, -734, + 264, 2339, 266, 2339, 2339, -734, 4509, 2792, 2792, 4509, + 4509, 1390, 2792, 2792, 74, 74, 74, 74, 74, -90, + -79, -70, -48, -32, -24, 15, 41, 1421, 2122, 2253, + 2350, 178, 278, -88, 3797, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, 2339, 280, 304, -734, -734, + 74, 2792, 2792, 2792, 2792, 2792, 2792, 2792, 2792, 2792, + 2792, 2792, 2792, 2792, 2792, 2792, 2792, 2792, 2792, 2792, + 2792, 2792, 2222, 2792, -734, -734, 144, 2792, -734, -734, + -734, 1958, -734, -734, -734, -734, -734, 299, 256, 144, + 144, 256, 256, 4068, 305, -734, 315, -734, -734, -734, + -734, 1226, 342, -18, -3, 13, -734, -734, -734, 5402, + -734, -734, -734, -734, 5402, -734, -734, -734, 5241, 2111, + -734, 2339, 2339, 2339, 2339, -734, -734, 341, -734, -734, + -734, -734, -734, 2792, 3339, -734, 340, -734, 3411, -734, + 2339, 249, -734, -734, 2339, 291, 333, -734, 358, 4581, + 2339, -734, 2339, 323, 313, 390, -734, -734, -734, -734, + 412, 1087, -734, 368, 392, -734, 376, 377, 382, 387, + 388, 400, 389, 401, 403, 411, 425, 2792, -734, 2792, + -734, -734, 402, 428, 429, 431, 409, 433, 3518, 434, + 437, 2792, 2792, -734, -734, -42, 310, 969, 1108, 928, + 928, 744, 744, 318, 318, -734, 3707, 4017, 4074, 4158, + 744, 744, 386, 386, 74, 74, 74, -734, -734, -45, + 2009, -734, 3539, 256, 408, 256, 256, 256, 256, 256, + 439, -734, 305, -734, 305, -734, 439, 439, -734, 256, + 4638, 4487, 256, 256, 441, 30, -734, 106, -734, 2792, + 2339, 442, -734, -734, -734, -734, 1226, -734, 517, -734, + -734, -734, 465, 474, 475, 476, 479, 4849, -734, 3478, + 4271, 338, 448, 313, -734, -734, 481, -734, 4509, 459, + 483, 468, -734, 14, 2792, 4739, 236, -734, -734, 469, + -734, -734, 2339, 93, -734, -734, -734, 2108, -734, -734, + 817, -734, 485, -734, -734, -734, -734, -734, -734, -734, + 471, -734, 472, -734, -734, -734, 3557, 477, 473, -734, + -734, -734, 478, -734, -734, -734, -734, 74, 3797, -734, + 4343, 339, -734, -734, 2792, -734, -734, -734, 439, 256, + 439, 439, 439, 439, 439, 2792, 185, 4739, 106, -734, + 270, 300, 561, -734, 4415, 482, 106, 106, 106, 106, + 106, 106, 52, -734, -734, 480, 3797, -734, 49, -734, + 498, 4905, -734, 496, -734, 4961, -734, 616, 619, 622, + 623, -734, -734, 399, 506, -734, -734, 2339, 2209, 2339, + 499, 510, -734, 106, -734, -734, 14, -734, 817, -734, + 511, 490, 2339, 1544, 4343, 502, 817, 4343, 3575, 236, + 503, 236, 236, 236, 236, 236, 247, -734, -734, 5017, + -734, 501, -734, 275, -734, 5, 521, 523, 505, 525, + 529, 2336, 3742, 515, 817, 817, 3118, 817, 817, 817, + 817, -734, 78, 346, -734, 1226, 2792, 2792, -734, -734, + 2792, 2792, 504, 4660, -734, -734, -734, -734, 514, 542, + -734, 3797, 439, 524, 530, 106, 52, 534, 538, 339, + -734, -734, 106, 540, 540, 540, 540, 540, 337, 2792, + 2792, -734, -734, 541, -734, 2792, -734, 2866, 557, 560, + -734, -734, -734, -37, 564, 565, 566, 5073, 28, -734, + 558, 106, 567, 5323, 4271, 80, -734, 346, -734, 5402, + -734, -734, -734, -734, -734, -734, -734, 550, 568, 571, + -734, -734, 4717, -734, -734, 572, 551, 573, -734, 590, + 2792, 2792, 2792, 2792, 1390, 2792, 591, 42, -734, -734, + 3839, -734, 252, -734, 594, 817, 89, 595, -734, 365, + 236, 598, 598, 598, 598, 598, -734, 2792, -734, 4343, + -734, 1842, -734, -734, 2339, 2792, 2792, -734, -734, -734, + -734, -734, 2336, 563, 585, 3797, -734, -734, 817, 372, + 372, 726, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, 599, 601, + -734, -734, 372, 372, 372, 335, 742, -734, 2792, -734, + 2108, 624, -734, 498, -13, -8, -6, 31, 561, 4717, + 144, 243, -734, -734, 4343, 52, -734, 4343, 4343, -734, + 540, 606, 3797, 604, 3761, 4160, 4778, 4794, 2339, 394, + -734, 2339, -734, -734, -734, 2866, 5129, 743, 627, 746, + 747, 748, -734, 631, 4509, 80, 4509, -734, -734, -734, + -734, 2906, -734, -734, 633, -734, -734, 4509, 4509, 4509, + 626, 4509, 4509, 4509, 1390, 74, 74, 74, 74, 617, + 34, 74, -734, -734, 1989, 2792, 2792, 2792, 2792, 2792, + 2792, 2792, 2792, 2792, 2792, 2792, 2792, 2792, 2792, 2792, + 2792, 2792, 2792, 2792, 2792, 2792, 2450, 2792, 561, 348, + 630, 561, -734, 598, 4343, 620, 625, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, 634, -734, 635, 639, 644, -734, 2564, 372, + -734, -734, -734, -734, -734, 1544, 632, 3742, 817, -734, + -734, -734, -734, 339, 144, -734, -734, 646, 647, 650, + -734, 653, 654, 4343, -734, -734, 2953, -734, 2953, -734, + 2953, -734, -734, 2953, 2953, 2953, -734, 5185, -734, -734, + 56, -734, 110, 655, 124, -734, -734, -734, -734, 649, + 667, 670, 671, 663, 673, 2906, 2906, 2906, 2906, 2906, + 1390, 2906, 3970, -734, 817, 664, 676, 677, 2792, 679, + 675, 687, 680, 3610, 2792, -734, -734, -734, 969, 1108, + 928, 928, 744, 744, 318, 318, -734, 3779, 4017, 4074, + 4158, 744, 744, 386, 386, 74, 74, 74, -734, -734, + 128, 3149, -2, 665, -734, -2, 4343, 690, -734, 561, + 1695, -734, -734, -734, -734, 2336, 3797, 692, -734, -734, + 699, -734, -734, -734, 561, 561, 561, 694, -734, -734, + -734, -734, -734, -734, -734, 832, 718, 841, 727, 728, + 847, 730, 4509, 4509, 4509, 4509, 4509, 4509, 209, 209, + 209, 209, 209, 713, 139, 209, 2906, 2906, 2906, 2906, + 2906, 2906, 2906, 2906, 2906, 2906, 2906, 2906, 2906, 2906, + 2906, 2906, 2906, 2906, 2906, 2678, 2792, -734, -734, 716, + 717, 719, 720, -734, 722, -734, -734, 74, 2792, -734, + -734, -734, 4343, 723, 561, -2, -734, 715, 561, -734, + 339, 339, 339, 561, 725, -734, 745, -734, -734, 160, + -734, 731, 740, 750, 754, 734, 755, 2906, -734, 3197, + 4000, 2848, 2848, 1434, 1434, 526, 526, -734, 3928, 4174, + 4203, 1131, 536, 536, 209, 209, 209, -734, -734, 163, + 3167, 2792, 2792, -734, 2792, 2792, 3797, 4343, 749, 561, + -2, -734, -2, 751, -734, -734, -734, -2, 764, 883, + 884, 768, -734, 756, 758, 759, -734, 760, 209, 2906, + -734, -734, 169, 177, 187, 192, 753, 561, -2, -734, + -734, 762, 766, -734, 2792, 2792, 2792, 2792, 3970, -734, + -734, -734, -734, 561, 339, 777, 778, 199, 205, 215, + 228, 339, -734, -734, -734, -734, -734, -734, -734, -734 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -1203,172 +1198,170 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_uint16 yydefact[] = { - 0, 680, 0, 0, 0, 680, 5, 592, 588, 591, - 676, 677, 594, 595, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 590, 596, 0, 0, 0, 0, 598, - 597, 0, 0, 0, 0, 0, 589, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 680, 0, 3, 532, - 593, 261, 269, 343, 344, 346, 347, 328, 0, 0, - 358, 325, 357, 352, 349, 348, 351, 329, 0, 330, - 350, 360, 345, 680, 4, 263, 264, 265, 0, 314, - 0, 260, 340, 341, 342, 1, 20, 680, 680, 21, - 680, 680, 680, 0, 37, 680, 0, 0, 0, 0, - 680, 0, 0, 0, 0, 680, 680, 0, 680, 680, - 680, 0, 680, 680, 6, 0, 16, 7, 18, 0, - 14, 58, 15, 17, 62, 39, 680, 0, 680, 680, - 680, 680, 0, 680, 0, 680, 680, 680, 282, 287, - 0, 0, 553, 0, 0, 281, 0, 680, 680, 0, - 0, 0, 680, 680, 562, 560, 559, 561, 558, 261, - 343, 344, 346, 347, 358, 357, 352, 349, 348, 351, - 350, 345, 0, 0, 493, 664, 665, 666, 669, 667, - 671, 670, 668, 672, 658, 657, 0, 655, 660, 654, - 557, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 672, 0, 0, 0, 672, 5, 584, 580, 583, + 668, 669, 586, 587, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 582, 588, 0, 0, 0, 0, 590, + 589, 0, 0, 0, 0, 0, 581, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 672, 0, 3, 524, + 585, 253, 261, 335, 336, 338, 339, 320, 0, 0, + 350, 317, 349, 344, 341, 340, 343, 321, 0, 322, + 342, 352, 337, 672, 4, 255, 256, 257, 0, 306, + 0, 252, 332, 333, 334, 1, 20, 672, 672, 672, + 21, 672, 672, 672, 0, 37, 672, 0, 0, 0, + 0, 672, 0, 0, 0, 0, 672, 672, 0, 672, + 672, 672, 0, 672, 672, 6, 0, 16, 7, 18, + 0, 14, 15, 17, 64, 39, 672, 0, 672, 672, + 672, 672, 0, 672, 0, 672, 672, 672, 274, 279, + 0, 0, 545, 0, 0, 273, 0, 672, 672, 0, + 0, 0, 672, 672, 554, 552, 551, 553, 550, 253, + 335, 336, 338, 339, 350, 349, 344, 341, 340, 343, + 342, 337, 0, 0, 485, 656, 657, 658, 661, 659, + 663, 662, 660, 664, 650, 649, 0, 647, 652, 646, + 549, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 678, 679, 680, 0, 326, 327, - 359, 349, 354, 353, 356, 262, 355, 0, 680, 680, - 680, 680, 680, 680, 0, 290, 248, 680, 673, 674, - 675, 0, 316, 664, 665, 667, 292, 266, 294, 680, - 50, 49, 51, 680, 40, 45, 22, 680, 0, 43, - 0, 0, 0, 0, 48, 680, 0, 25, 24, 23, - 46, 42, 0, 0, 146, 0, 52, 0, 19, 0, - 0, 44, 47, 0, 289, 271, 280, 0, 0, 0, - 0, 12, 0, 0, 0, 288, 63, 273, 274, 275, - 314, 0, 270, 0, 492, 491, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 283, 680, - 285, 284, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 587, 659, 680, 680, 571, 572, 573, - 574, 575, 576, 579, 580, 586, 0, 568, 569, 570, - 577, 578, 566, 567, 563, 564, 565, 585, 584, 0, - 0, 291, 0, 680, 0, 680, 680, 680, 680, 680, - 253, 240, 0, 249, 0, 250, 252, 251, 179, 680, - 0, 0, 680, 680, 0, 180, 183, 680, 178, 680, - 322, 0, 319, 318, 313, 317, 0, 680, 680, 41, - 38, 680, 0, 0, 0, 0, 0, 680, 331, 0, - 680, 289, 271, 0, 0, 288, 71, 0, 337, 0, - 0, 54, 56, 80, 82, 289, 271, 65, 0, 0, - 680, 272, 680, 0, 361, 196, 0, 0, 60, 361, - 201, 0, 61, 59, 0, 278, 316, 276, 538, 552, - 544, 540, 542, 543, 0, 550, 0, 549, 539, 546, - 0, 0, 0, 545, 548, 551, 0, 555, 556, 547, - 541, 533, 494, 96, 680, 680, 95, 656, 0, 583, - 582, 268, 254, 680, 245, 241, 242, 244, 243, 680, - 0, 0, 680, 217, 0, 0, 680, 182, 0, 0, - 680, 680, 680, 680, 680, 680, 680, 230, 229, 0, - 490, 489, 323, 312, 267, 680, 297, 680, 296, 680, - 333, 0, 0, 0, 0, 335, 680, 0, 0, 158, - 159, 0, 0, 0, 0, 148, 149, 680, 157, 147, - 0, 73, 75, 0, 339, 0, 0, 0, 680, 680, - 0, 0, 680, 0, 0, 680, 0, 680, 680, 680, - 680, 680, 0, 221, 220, 680, 84, 0, 680, 0, - 8, 0, 0, 0, 0, 0, 0, 680, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 64, 680, 680, - 160, 0, 0, 0, 286, 554, 0, 0, 0, 0, - 98, 100, 97, 99, 0, 0, 175, 581, 246, 0, - 0, 680, 680, 0, 0, 680, 181, 184, 680, 235, - 231, 232, 234, 233, 0, 0, 680, 214, 194, 255, - 320, 0, 293, 0, 0, 299, 298, 336, 680, 0, - 0, 0, 0, 680, 0, 36, 151, 680, 153, 680, - 0, 680, 0, 72, 680, 338, 680, 55, 647, 643, - 646, 649, 650, 186, 0, 0, 0, 645, 651, 0, - 653, 652, 0, 0, 0, 644, 0, 0, 0, 0, - 0, 0, 0, 0, 187, 218, 190, 219, 601, 648, - 185, 0, 0, 0, 0, 66, 680, 279, 0, 680, - 226, 222, 223, 225, 224, 90, 680, 13, 680, 197, - 362, 363, 361, 0, 680, 680, 199, 200, 202, 204, - 205, 680, 0, 208, 210, 207, 203, 0, 167, 163, - 0, 113, 114, 115, 116, 117, 118, 121, 122, 137, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 141, 140, 124, 123, 110, 112, 111, 119, - 120, 108, 109, 105, 106, 107, 104, 0, 0, 103, - 161, 164, 166, 165, 0, 0, 171, 680, 173, 0, - 0, 67, 277, 0, 0, 0, 0, 680, 0, 680, - 0, 361, 247, 680, 680, 215, 680, 680, 256, 236, - 239, 195, 0, 324, 671, 0, 670, 0, 0, 300, - 0, 302, 661, 680, 0, 680, 0, 0, 0, 0, - 0, 332, 0, 0, 680, 0, 142, 145, 143, 150, - 0, 155, 192, 74, 680, 0, 76, 53, 0, 0, - 0, 609, 0, 0, 0, 0, 617, 616, 615, 614, - 0, 0, 613, 57, 189, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 670, 671, 672, 0, 318, 319, + 351, 341, 346, 345, 348, 254, 347, 0, 672, 672, + 672, 672, 672, 672, 0, 282, 240, 672, 665, 666, + 667, 0, 308, 656, 657, 659, 284, 258, 286, 672, + 51, 40, 50, 52, 672, 41, 46, 22, 672, 0, + 44, 0, 0, 0, 0, 49, 672, 0, 25, 24, + 23, 47, 43, 0, 0, 138, 0, 53, 0, 19, + 0, 0, 45, 48, 0, 281, 263, 272, 0, 0, + 0, 12, 0, 0, 0, 280, 59, 265, 266, 267, + 306, 0, 262, 0, 484, 483, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 275, 672, + 277, 276, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 579, 651, 672, 672, 563, 564, 565, + 566, 567, 568, 571, 572, 578, 0, 560, 561, 562, + 569, 570, 558, 559, 555, 556, 557, 577, 576, 0, + 0, 283, 0, 672, 0, 672, 672, 672, 672, 672, + 245, 232, 0, 241, 0, 242, 244, 243, 171, 672, + 0, 0, 672, 672, 0, 172, 175, 672, 170, 672, + 314, 0, 311, 310, 305, 309, 0, 672, 672, 42, + 38, 672, 0, 0, 0, 0, 0, 672, 323, 0, + 672, 281, 263, 0, 280, 67, 0, 329, 0, 0, + 55, 57, 72, 74, 0, 0, 672, 264, 672, 0, + 353, 188, 0, 0, 62, 353, 193, 0, 63, 61, + 0, 270, 308, 268, 530, 544, 536, 532, 534, 535, + 0, 542, 0, 541, 531, 538, 0, 0, 0, 537, + 540, 543, 0, 547, 548, 539, 533, 525, 486, 88, + 672, 672, 87, 648, 0, 575, 574, 260, 246, 672, + 237, 233, 234, 236, 235, 672, 0, 0, 672, 209, + 0, 0, 672, 174, 0, 0, 672, 672, 672, 672, + 672, 672, 672, 222, 221, 0, 482, 481, 315, 304, + 259, 672, 289, 672, 288, 672, 325, 0, 0, 0, + 0, 327, 672, 0, 0, 150, 151, 0, 0, 0, + 0, 140, 141, 672, 149, 139, 0, 69, 0, 331, + 0, 0, 0, 672, 672, 0, 0, 672, 0, 672, + 0, 672, 672, 672, 672, 672, 0, 213, 212, 672, + 76, 0, 672, 0, 8, 0, 0, 0, 0, 0, + 0, 672, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 60, 672, 672, 152, 0, 0, 0, 278, 546, + 0, 0, 0, 0, 90, 92, 89, 91, 0, 0, + 167, 573, 238, 0, 0, 672, 672, 0, 0, 672, + 173, 176, 672, 227, 223, 224, 226, 225, 0, 0, + 672, 206, 186, 247, 312, 0, 285, 0, 0, 291, + 290, 328, 672, 0, 0, 0, 0, 672, 0, 36, + 143, 672, 145, 672, 0, 672, 68, 672, 330, 672, + 56, 639, 635, 638, 641, 642, 178, 0, 0, 0, + 637, 643, 0, 645, 644, 0, 0, 0, 636, 0, + 0, 0, 0, 0, 0, 0, 0, 179, 210, 182, + 211, 593, 640, 177, 0, 0, 0, 0, 271, 0, + 672, 218, 214, 215, 217, 216, 82, 672, 13, 672, + 189, 354, 355, 353, 0, 672, 672, 191, 192, 194, + 196, 197, 672, 0, 200, 202, 199, 195, 0, 159, + 155, 0, 105, 106, 107, 108, 109, 110, 113, 114, + 129, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 133, 132, 116, 115, 102, 104, 103, + 111, 112, 100, 101, 97, 98, 99, 96, 0, 0, + 95, 153, 156, 158, 157, 0, 0, 163, 672, 165, + 0, 0, 65, 269, 0, 0, 0, 0, 672, 0, + 672, 0, 353, 239, 672, 672, 207, 672, 672, 248, + 228, 231, 187, 0, 316, 663, 0, 662, 0, 0, + 292, 0, 294, 653, 672, 0, 672, 0, 0, 0, + 0, 0, 324, 0, 0, 672, 0, 134, 137, 135, + 142, 0, 147, 184, 0, 70, 54, 0, 0, 0, + 601, 0, 0, 0, 0, 609, 608, 607, 606, 0, + 0, 605, 58, 181, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 680, - 0, 0, 680, 0, 69, 92, 227, 680, 0, 0, - 365, 366, 370, 367, 374, 368, 369, 371, 372, 373, - 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, - 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, - 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 440, 421, 422, 423, - 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, - 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 680, 482, 483, 484, 475, 487, 471, 472, 470, - 477, 478, 466, 467, 468, 469, 476, 474, 481, 479, - 485, 480, 486, 473, 364, 0, 9, 0, 0, 0, - 206, 209, 168, 162, 139, 138, 170, 174, 680, 0, - 195, 0, 536, 535, 537, 534, 680, 680, 176, 101, - 0, 0, 0, 216, 0, 0, 680, 237, 321, 0, - 305, 0, 304, 0, 303, 663, 0, 0, 0, 662, - 680, 301, 334, 0, 26, 0, 0, 0, 35, 152, - 156, 154, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 193, 495, 0, 78, 0, - 0, 0, 0, 680, 0, 0, 0, 0, 0, 0, - 642, 188, 191, 626, 627, 628, 629, 630, 631, 634, - 635, 641, 0, 623, 624, 625, 632, 633, 621, 622, - 618, 619, 620, 640, 639, 0, 0, 81, 0, 86, - 83, 0, 680, 0, 228, 680, 0, 198, 11, 10, - 211, 680, 212, 0, 169, 68, 0, 177, 102, 599, - 680, 680, 680, 0, 311, 310, 309, 308, 307, 306, - 295, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 508, 506, 505, 507, 504, 0, - 0, 503, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 672, 0, + 0, 672, 84, 219, 672, 0, 0, 357, 358, 362, + 359, 366, 360, 361, 363, 364, 365, 367, 368, 369, + 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, + 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, + 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 432, 413, 414, 415, 416, 417, 418, + 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 433, 434, 435, 436, 437, 438, 439, + 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, + 450, 451, 452, 453, 454, 455, 456, 457, 672, 474, + 475, 476, 467, 479, 463, 464, 462, 469, 470, 458, + 459, 460, 461, 468, 466, 473, 471, 477, 472, 478, + 465, 356, 0, 9, 0, 0, 0, 198, 201, 160, + 154, 131, 130, 162, 166, 672, 0, 187, 0, 528, + 527, 529, 526, 672, 672, 168, 93, 0, 0, 0, + 208, 0, 0, 672, 229, 313, 0, 297, 0, 296, + 0, 295, 655, 0, 0, 0, 654, 672, 293, 326, + 0, 26, 0, 0, 0, 35, 144, 148, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 77, 608, 0, 0, 0, 0, - 607, 0, 611, 612, 602, 0, 638, 637, 88, 680, - 70, 0, 680, 85, 488, 0, 680, 361, 680, 680, - 680, 680, 0, 27, 0, 32, 34, 0, 29, 0, - 0, 0, 0, 0, 0, 0, 531, 517, 518, 519, - 520, 521, 522, 523, 524, 530, 0, 514, 515, 516, - 512, 513, 509, 510, 511, 529, 528, 0, 0, 79, - 0, 0, 610, 0, 0, 636, 680, 0, 680, 91, - 213, 172, 0, 259, 258, 257, 238, 0, 0, 0, - 0, 502, 0, 0, 0, 501, 0, 496, 0, 527, - 526, 0, 0, 0, 0, 0, 680, 93, 600, 28, - 0, 0, 30, 0, 0, 0, 0, 525, 605, 604, - 606, 603, 680, 680, 0, 0, 0, 0, 0, 0, - 680, 87, 33, 31, 499, 498, 500, 497, 89 + 0, 0, 185, 487, 0, 0, 0, 0, 672, 0, + 0, 0, 0, 0, 0, 634, 180, 183, 618, 619, + 620, 621, 622, 623, 626, 627, 633, 0, 615, 616, + 617, 624, 625, 613, 614, 610, 611, 612, 632, 631, + 0, 0, 73, 0, 78, 75, 672, 0, 220, 672, + 0, 190, 11, 10, 203, 672, 204, 0, 161, 66, + 0, 169, 94, 591, 672, 672, 672, 0, 303, 302, + 301, 300, 299, 298, 287, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 500, 498, + 497, 499, 496, 0, 0, 495, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 71, 600, 0, + 0, 0, 0, 599, 0, 603, 604, 594, 0, 630, + 629, 80, 672, 0, 672, 77, 480, 0, 672, 353, + 672, 672, 672, 672, 0, 27, 0, 32, 34, 0, + 29, 0, 0, 0, 0, 0, 0, 0, 523, 509, + 510, 511, 512, 513, 514, 515, 516, 522, 0, 506, + 507, 508, 504, 505, 501, 502, 503, 521, 520, 0, + 0, 0, 0, 602, 0, 0, 628, 672, 0, 672, + 83, 205, 164, 0, 251, 250, 249, 230, 0, 0, + 0, 0, 494, 0, 0, 0, 493, 0, 488, 0, + 519, 518, 0, 0, 0, 0, 0, 672, 85, 592, + 28, 0, 0, 30, 0, 0, 0, 0, 517, 597, + 596, 598, 595, 672, 672, 0, 0, 0, 0, 0, + 0, 672, 79, 33, 31, 491, 490, 492, 489, 81 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -703, -703, -222, -703, 279, -703, -703, 734, -703, -703, - -11, 450, -703, -99, -703, -703, -703, -33, -132, -703, - -703, -703, -87, -197, -703, -703, -703, 731, -703, -703, - -703, -703, -703, -442, -703, -703, 358, -703, -703, -703, - 361, 489, -516, -703, -512, -559, -467, -703, -15, -703, - 190, -541, -703, -377, -702, -703, -380, 161, -309, -206, - 85, -191, -42, -95, -579, -227, 16, -104, -703, -89, - -703, -703, -703, -703, 203, -73, -703, -356, -703, -703, - -14, -7, -703, -703, -703, -703, 14, 51, -703, -703, - -437, -703, 24, -703, -472, -125, -27, -260, 531, 277, - -703, -703, 687, -703, -698, 803, 811, -514, -1 + -734, -734, -260, -734, 210, -734, -734, 657, -734, -734, + 188, 371, -734, -104, -734, -102, -734, -734, -134, -734, + -734, -734, 666, -734, -734, -734, -734, -734, -435, -734, + -734, 298, -734, -734, -734, 311, 414, -480, -734, -534, + -550, -460, -734, -72, -734, 143, -571, -734, -405, -705, + -734, -379, 113, -474, 97, -179, -213, -40, 684, -573, + 688, 16, -83, -734, -82, -734, -734, -734, -734, 149, + -80, -734, -377, -734, -734, -15, -7, -734, -734, -734, + -734, -17, 3, -734, -734, -434, -734, -10, -734, -476, + -106, -31, 246, 522, -249, -734, -734, 637, -734, -733, + 795, 799, -495, -1 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 4, 5, 569, 570, 116, 432, 117, 118, 257, - 119, 420, 421, 120, 121, 444, 553, 587, 695, 278, - 543, 652, 653, 833, 293, 549, 552, 294, 708, 1219, - 1276, 887, 1132, 475, 770, 827, 122, 275, 534, 535, - 536, 537, 588, 1028, 589, 605, 384, 385, 683, 684, - 831, 627, 438, 442, 722, 723, 386, 686, 562, 506, - 234, 235, 73, 415, 142, 296, 74, 75, 397, 76, - 398, 517, 634, 635, 809, 77, 78, 394, 390, 391, - 79, 80, 123, 526, 638, 124, 81, 82, 83, 84, - 567, 568, 710, 1014, 509, 303, 304, 1085, 174, 49, - 687, 688, 186, 187, 811, 812, 590, 50, 125 + -1, 4, 5, 563, 564, 117, 428, 118, 119, 258, + 120, 419, 420, 121, 440, 581, 279, 538, 646, 293, + 544, 547, 294, 699, 1202, 1257, 874, 1116, 471, 761, + 818, 122, 276, 530, 531, 532, 533, 582, 1015, 583, + 599, 384, 385, 676, 677, 822, 621, 434, 438, 713, + 714, 386, 679, 556, 502, 234, 235, 73, 295, 142, + 296, 74, 75, 397, 76, 398, 513, 628, 629, 800, + 77, 78, 394, 390, 391, 79, 80, 123, 522, 632, + 124, 81, 82, 83, 84, 561, 562, 701, 1001, 505, + 303, 304, 1072, 174, 49, 680, 681, 186, 187, 802, + 803, 584, 50, 125 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -1376,1330 +1369,1331 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 6, 493, 574, 307, 308, 309, 310, 598, 312, 274, - 314, 315, 316, 644, 143, 297, 216, 609, 173, 1019, - 789, 144, 323, 324, 295, 361, 126, 329, 330, 778, - 298, 654, 550, 473, 689, 693, 218, 542, 373, 375, - 514, 696, 145, 407, 332, 189, 299, 214, 780, 215, - 416, 497, 572, 573, 615, 714, 798, 85, 238, 239, - 427, 172, 127, 333, 728, 729, 128, 771, 772, 773, - 774, 795, 236, 715, 227, 129, 250, 251, 228, 252, - 254, 255, 691, 130, 259, 694, 219, 489, 610, 264, - 841, 332, 854, 630, 270, 271, 631, 273, 276, 277, - -673, 281, 282, 131, 816, 300, 1050, 1052, 1054, 625, - 479, 199, 301, 835, 133, 222, 223, 224, 617, 229, - 474, 226, 132, 817, 626, 305, 135, 305, 305, 305, - 305, 134, 305, 302, 305, 305, 305, -674, 197, 198, - 834, 240, 136, 306, 332, 137, 305, 305, 311, 199, - 313, 305, 305, -673, 802, 883, -673, 364, 146, 551, - -675, 365, 322, 1032, 498, 325, 326, 327, 685, 297, - 599, 489, 613, 297, 830, 515, 880, 241, 295, 519, - 489, 614, 230, 297, 298, 359, 541, 822, 298, 626, - -674, 387, 237, -674, 461, 214, 231, 215, 298, 199, - 299, 232, 366, 147, 299, 855, 233, 332, 283, 1037, - 565, 1022, 781, -675, 299, 236, -675, 148, 222, 223, - 224, 226, 211, 212, 213, 332, 1033, 371, 236, 236, - 371, 371, 388, 149, 888, 782, 392, 1190, 259, 705, - 706, 889, 399, 418, 1034, 419, 698, 430, 700, 701, - 702, 703, 704, 1043, 206, 207, 208, 209, 210, 300, - 211, 212, 213, 300, 6, 367, 301, 775, 150, 332, - 301, 332, 222, 300, 439, 1015, 440, 836, 441, 368, - 301, 1161, 776, 777, 369, 151, 612, 302, 1035, 256, - 1100, 302, 395, 1087, 619, 620, 621, 622, 623, 624, - 1162, 302, 1163, 1166, 643, 1029, 208, 209, 210, 297, - 211, 212, 213, 370, 372, 374, 376, 377, 305, 884, - 267, 1164, 1167, 332, 298, 332, 1042, 1289, 332, 1044, - 1045, 651, 152, 332, 476, 189, 712, 713, 492, 387, - 299, 689, 1216, 153, 1246, 1036, 1290, 1299, 1200, 1201, - 1202, 1154, 1318, 1155, 1041, 1156, 600, 217, 1157, 1158, - 1159, 10, 371, 11, 371, 371, 371, 371, 371, 260, - 601, 261, 332, 602, 332, 332, 603, 262, 371, 175, - 176, 371, 371, 332, 332, 332, 508, 555, 511, 332, - 886, 1319, 604, 1320, 1321, 263, 6, 518, 268, 300, - 6, 269, 1334, 1335, 1336, 794, 301, 272, 1337, 539, - 626, 800, 799, 238, 239, 556, 815, 885, 706, 557, - 1133, -94, 317, -94, 538, -94, -94, 302, -94, 564, - -94, 6, 387, 319, 439, 545, 440, 1127, 779, 1225, - 1130, 824, 177, 178, 423, 776, 777, 395, 482, 611, - 484, 485, 486, 487, 488, 331, 387, 1088, 335, 336, - 558, 363, 179, 180, 490, 181, 389, 494, 495, -240, - 182, 396, 183, 388, 606, 685, 434, 1146, 435, 436, - 437, 410, 371, 1188, 1189, 1, 2, 3, 511, 408, - 448, 508, 424, 428, 1190, 476, 240, 449, 443, 508, - 508, 508, 508, 508, 508, 628, 387, 387, 332, 489, - 387, 776, 777, 881, 689, 1039, 636, 776, 777, 1026, - 1056, 1057, 1058, 559, 450, 6, 776, 777, 1128, 451, - 452, 453, 454, 48, 455, 456, 508, 560, 457, 238, - 239, 579, 561, 458, 459, 580, 538, 690, 388, 462, - 826, 388, 463, 464, 564, 465, 564, 564, 564, 564, - 564, 466, 467, 469, 470, 783, 784, 711, 608, 785, - 786, 154, 155, 156, 157, 158, 725, 654, 190, 1153, - 483, 496, 516, 513, 520, 143, 581, 606, 628, 1017, - 1018, 1060, 144, 521, 522, 175, 176, 523, 1038, 1195, - 1196, 1197, 1198, 1199, 524, 1200, 1201, 1202, 540, 544, - 508, 628, 547, 145, 606, 548, 546, 508, 566, 696, - 591, 582, 240, 592, 593, 511, 810, 596, 595, 473, - 597, 618, 629, 238, 239, 499, -315, 6, 273, 500, - 633, 639, 395, 640, 641, 837, 508, 642, 685, 583, - 832, 645, 649, 628, 851, 143, 655, 650, 177, 178, - 656, 692, 144, 584, 538, 1221, 387, 709, 585, 1283, - 1284, 1285, 699, 586, 716, 717, 719, 720, 179, 180, - 501, 181, 328, 145, 718, 787, 182, 790, 183, 727, - 791, 834, 792, 1223, 813, 628, 793, 850, 564, 796, - 797, 814, 626, -247, 818, 511, 819, 388, 1228, 1229, - 1230, 820, 823, 305, 305, 184, 240, 825, 1190, 185, - 725, 839, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 502, 360, 838, 840, 842, 362, 843, - 844, 387, 1277, 845, 387, 387, 853, 503, 1023, 879, - 882, 199, 504, 706, 1331, 1021, 1020, 505, 1024, 1025, - 1027, 1338, 1031, 1046, 143, 1047, 511, 1063, 1064, 1065, - 1279, 144, 1066, 1067, 1281, 1068, 476, 1089, 236, 1286, - 1282, 1093, 388, 628, 1190, 388, 388, 810, 810, 810, - 1099, 1131, 145, 409, 1134, 1129, 1137, 810, 1135, 1305, - 1138, 1139, 6, 387, 1140, 1148, 1144, 1149, 1174, 1175, - 1176, 1177, 1178, 832, 1181, 1197, 1198, 1199, 1150, 1200, - 1201, 1202, 1169, 628, 1151, 1152, 1307, 1165, 1168, 1069, - 1170, 1071, 1171, 1172, 1173, 387, 1147, 1203, 460, 188, - 1125, 1206, 1205, 1207, 1090, 1091, 1092, 1209, 1094, 1095, - 1096, 1097, 471, 472, 1323, 1210, 206, 207, 208, 209, - 210, 225, 211, 212, 213, 1211, 1212, 1218, 476, 1227, - 1330, 476, 1222, 247, 1226, 1232, 388, 1231, 1233, 1234, - 242, 248, 1235, 1236, 1237, 1245, 1238, 1272, 253, 1195, - 1196, 1197, 1198, 1199, 266, 1200, 1201, 1202, 1280, 1278, - 243, 244, 1288, 1310, 280, 1270, 1287, 1292, 1271, 1273, - 510, 1274, 1247, 1248, 1249, 1250, 1251, 1252, 1253, 1254, - 1255, 1256, 1257, 1258, 1259, 1260, 1261, 1262, 1263, 1264, - 1265, 1291, 87, 1293, 318, 1294, 320, 321, 1295, 1296, - 88, 192, 193, 194, 195, 196, 197, 198, 1306, 554, - 90, 91, 92, 1308, 599, 1309, 1311, 199, 1208, 243, - 244, 249, 578, 177, 178, 1312, 1313, 1314, 1315, 100, - 1316, 1322, 1332, 1333, 1324, 1297, 387, 1325, 334, 105, - 711, 400, 1016, 245, 180, 106, 181, 657, 1145, 1220, - 109, 182, 1204, 183, 387, 600, 1269, 828, 414, 607, - 112, 829, 113, 1143, 1070, 1136, 1102, 1061, 0, 601, - 510, 647, 602, 477, 0, 603, 0, 690, 0, 241, - 0, 0, 177, 178, 0, 606, 236, 115, 1317, 0, - 0, 604, 810, 0, 810, 388, 810, 0, 0, 810, - 810, 810, 245, 180, 0, 181, 1180, 0, 0, 0, - 182, 402, 183, 403, 404, 405, 406, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 0, 211, 212, - 213, 0, 417, 0, 0, 246, 422, 0, 0, 0, - 387, 0, 305, 431, 0, 433, 0, 0, 0, 1179, - 0, 0, 0, 445, 447, 0, 0, 1086, 724, 0, - 0, 446, 248, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 393, 0, 0, 0, - 0, 388, 0, 0, 476, 0, 0, 0, 0, 188, - 725, 191, 192, 193, 194, 195, 196, 197, 198, 476, - 476, 476, 0, 0, 0, 0, 801, 510, 199, 0, - 0, 0, 803, 0, 0, 0, 53, 0, 54, 55, - 56, 0, 0, 0, 1267, 0, 0, 387, 0, 0, - 0, 0, 0, 0, 1239, 1240, 1241, 1242, 1243, 1244, - 0, 0, 0, 512, 0, 63, 221, 0, 507, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 846, 847, - 848, 849, 0, 852, 0, 65, 66, 0, 388, 0, - 0, 476, 0, 0, 0, 476, 0, 606, 606, 606, - 476, 70, 0, 0, 387, 0, 72, 510, 0, 571, - 0, 563, 0, 1301, 1302, 0, 1303, 1304, 0, 0, - 0, 0, 724, 0, 175, 176, 0, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 0, 211, - 212, 213, 0, 0, 480, 388, 0, 476, 0, 0, - 0, 0, 0, 0, 0, 0, 1326, 1327, 1328, 1329, - 0, 0, 193, 194, 195, 196, 197, 198, 0, 0, - 0, 0, 0, 507, 0, 476, 0, 199, 510, 0, - 1030, 507, 507, 507, 507, 507, 507, 177, 178, 0, - 0, 476, 606, 0, 0, 0, 0, 0, 0, 606, - 195, 196, 197, 198, 646, 0, 648, 179, 180, 0, - 181, 0, 0, 199, 0, 182, 0, 183, 507, 0, - 422, 0, 0, 0, 0, 1086, 1086, 1086, 1086, 1086, - 0, 1086, 0, 0, 0, 0, 563, 0, 563, 563, - 563, 563, 563, 0, 0, 0, 1098, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1103, 1104, 1105, - 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, - 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 0, 1126, - 204, 205, 206, 207, 208, 209, 210, 0, 211, 212, - 213, 0, 507, 0, 0, 0, 0, 0, 0, 507, - 0, 0, 0, 0, 0, 7, 8, 9, 10, 0, - 11, 12, 13, 159, 0, 0, 204, 205, 206, 207, - 208, 209, 210, 0, 211, 212, 213, 0, 507, 1086, - 1086, 1086, 1086, 1086, 1086, 1086, 1086, 1086, 1086, 1086, - 1086, 1086, 1086, 1086, 1086, 1086, 1086, 1086, 0, 15, - 52, 0, 0, 160, 0, 161, 162, 163, 57, 58, - 0, 20, 59, 0, 0, 164, 22, 0, 0, 61, - 0, 0, 0, 0, 23, 24, 165, 0, 0, 0, - 563, 0, 166, 167, 0, 0, 571, 0, 0, 0, - 0, 28, 1086, 29, 0, 30, 0, 0, 0, 0, - 31, 0, 168, 169, 34, 0, 0, 35, 67, 0, - 0, 0, 36, 0, 0, 37, 68, 69, 170, 0, - 0, 71, 1142, 171, 0, 0, 7, 8, 9, 10, - 0, 11, 12, 13, 14, 0, 40, 0, 0, 41, - 42, 43, 0, 0, 44, 1086, 45, 46, 0, 0, - 0, 47, 0, 1183, 1184, 1185, 1186, 1187, 1188, 1189, - 0, 0, 0, 1040, 0, 0, 0, 0, 0, 1190, - 15, 0, 0, 0, 16, 0, 17, 18, 19, 0, - 1055, 0, 20, 1059, 575, 576, 21, 22, 0, 0, - 0, 0, 0, 0, 0, 23, 24, 25, 0, 0, - 1214, 0, 0, 26, 27, 0, 0, 0, 0, 0, - 0, 0, 28, 0, 29, 0, 30, 0, 0, 0, - 0, 31, 0, 32, 33, 34, 0, 0, 35, 0, - 0, 0, 0, 36, 0, 0, 37, 0, 0, 38, - 0, 0, 724, 0, 39, 0, 0, 0, 0, 577, - 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, - 41, 42, 43, 0, 0, 44, 0, 45, 46, 1192, - 1193, 1194, 47, 0, 1195, 1196, 1197, 1198, 1199, 0, - 1200, 1201, 1202, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 890, 891, 892, 893, 894, 895, 896, - 897, 898, 899, 1268, 900, 901, 902, 903, 904, 905, - 906, 907, 908, 909, 910, 0, 1275, 0, 0, 0, - 0, 0, 911, 912, 913, 914, 915, 916, 917, 918, - 919, 920, 921, 922, 923, 924, 925, 926, 927, 0, - 0, 928, 929, 930, 931, 932, 933, 934, 935, 936, - 937, 938, 939, 940, 941, 942, 0, 943, 0, 944, - 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, - 955, 956, 0, 0, 0, 0, 0, 957, 958, 959, - 0, 960, 961, 962, 963, 964, 965, 966, 967, 968, - 969, 970, 971, 972, 973, 974, 975, 0, 976, 977, - 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, - 988, 989, 990, 0, 0, 0, 991, 992, 993, 994, - 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, - 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1224, 1012, 1013, - 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, - 0, 900, 901, 902, 903, 904, 905, 906, 907, 908, - 909, 910, 0, 0, 0, 0, 0, 0, 0, 911, - 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, - 922, 923, 924, 925, 926, 927, 0, 0, 928, 929, - 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, - 940, 941, 942, 0, 943, 0, 944, 945, 946, 947, - 948, 949, 950, 951, 952, 953, 954, 955, 956, 0, - 0, 0, 0, 0, 957, 958, 959, 0, 960, 961, - 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, - 972, 973, 974, 975, 0, 976, 977, 978, 979, 980, - 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, - 0, 0, 0, 991, 992, 993, 994, 995, 996, 997, - 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, - 1008, 1009, 1010, 1011, 0, 1012, 1013, 658, 659, 660, - 10, 0, 11, 661, 662, 51, 0, 0, 663, 0, - 0, 0, 0, 0, 53, 0, 54, 55, 56, 0, - 0, 0, 0, 0, 0, 0, 220, 0, 0, 191, - 192, 193, 194, 195, 196, 197, 198, 0, 0, 0, - 0, 664, 52, 63, 221, 53, 199, 54, 55, 56, - 57, 380, 0, 665, 59, 0, 0, 60, 666, 0, - 0, 61, 0, 65, 66, 0, 667, 668, 62, 0, - 0, 0, 0, 0, 63, 64, 0, 0, 0, 70, - 0, 0, 0, 669, 72, 670, 0, 671, 0, 0, - 0, 381, 672, 0, 65, 66, 673, 0, 0, 674, - 67, 0, 0, 0, 675, 0, 0, 676, 68, 69, - 70, 0, 0, 71, 0, 72, 658, 659, 660, 10, - 0, 11, 661, 662, 51, 0, 0, 1101, 677, 0, - 0, 678, 679, 0, 0, 0, 680, 0, 681, 0, - 0, 0, 0, 682, 0, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 0, 211, 212, 213, - 664, 52, 1217, 0, 53, 0, 54, 55, 56, 57, - 380, 0, 665, 59, 0, 0, 60, 666, 0, 0, - 61, 0, 0, 0, 0, 667, 668, 62, 0, 0, - 0, 0, 0, 63, 64, 0, 0, 0, 0, 0, - 0, 0, 669, 0, 670, 0, 671, 0, 0, 0, - 381, 672, 0, 65, 66, 673, 0, 0, 674, 67, - 0, 0, 0, 675, 0, 0, 676, 68, 69, 70, - 0, 0, 71, 0, 72, 7, 8, 9, 10, 0, - 11, 12, 13, 14, 0, 175, 176, 677, 0, 0, - 678, 679, 0, 0, 0, 680, 0, 681, 0, 0, - 0, 0, 682, 1184, 1185, 1186, 1187, 1188, 1189, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1190, 15, - 0, 0, 0, 16, 0, 17, 18, 19, 0, 0, - 0, 20, 0, 0, 0, 21, 22, 0, 0, 0, - 0, 0, 0, 0, 23, 24, 25, 0, 177, 178, - 0, 0, 26, 27, 0, 0, 0, 0, 0, 0, - 0, 28, 0, 29, 0, 30, 0, 0, 179, 180, - 31, 181, 32, 33, 34, 0, 182, 35, 183, 175, - 176, 0, 36, 0, 0, 37, 0, 0, 38, 7, - 8, 9, 10, 39, 11, 12, 13, 14, 0, 0, - 0, 265, 0, 0, 0, 0, 40, 0, 0, 41, - 42, 43, 0, 0, 44, 0, 45, 46, 358, 1193, - 1194, 47, 0, 1195, 1196, 1197, 1198, 1199, 0, 1200, - 1201, 1202, 0, 15, 0, 0, 0, 16, 0, 17, - 18, 19, 177, 178, 0, 20, 0, 0, 0, 21, - 22, 53, 0, 54, 55, 56, 0, 0, 23, 24, - 25, 0, 179, 180, 0, 181, 26, 27, 0, 0, - 182, 0, 183, 0, 0, 28, 0, 29, 0, 30, - 63, 221, 0, 0, 31, 0, 32, 33, 34, 0, - 0, 35, 0, 0, 0, 401, 36, 529, 530, 37, - 65, 66, 38, 7, 8, 9, 10, 39, 11, 12, - 13, 14, 721, 0, 0, 0, 70, 0, 0, 0, - 40, 72, 0, 41, 42, 43, 0, 0, 44, 0, - 45, 46, 0, 0, 0, 47, 0, 0, 53, 0, - 54, 55, 56, 0, 147, 0, 0, 15, 0, 0, - 60, 16, 0, 17, 18, 19, 0, 0, 0, 20, - 0, 62, 0, 21, 22, 0, 0, 63, 64, 0, - 0, 0, 23, 24, 25, 0, 0, 0, 0, 0, - 26, 27, 53, 0, 54, 55, 56, 65, 66, 28, - 0, 29, 0, 30, 220, 0, 0, 0, 31, 0, - 32, 33, 34, 70, 0, 35, 71, 0, 72, 0, - 36, 63, 221, 37, 0, 0, 38, 7, 8, 9, - 10, 39, 11, 12, 13, 14, 0, 0, 0, 0, - 0, 65, 66, 0, 40, 0, 0, 41, 42, 43, - 0, 0, 44, 0, 45, 46, 1124, 70, 0, 47, - 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, - 0, 15, 0, 0, 0, 16, 0, 17, 18, 19, - 0, 0, 0, 20, 0, 137, 0, 21, 22, 53, - 0, 54, 55, 56, 0, 0, 23, 24, 25, 0, - 0, 0, 0, 0, 26, 27, 53, 0, 54, 55, - 56, 0, 0, 28, 0, 29, 0, 30, 63, 221, - 0, 0, 31, 0, 32, 33, 34, 0, 0, 35, - 0, 175, 176, 0, 36, 63, 221, 37, 65, 66, - 38, 7, 8, 9, 10, 39, 11, 12, 13, 14, - 1141, 0, 0, 0, 70, 65, 66, 0, 40, 72, - 0, 41, 42, 43, 0, 0, 44, 0, 45, 46, - 0, 70, 0, 47, 0, 0, 72, 0, 0, 0, - 0, 0, 148, 0, 0, 15, 0, 0, 0, 16, - 0, 17, 18, 19, 177, 178, 0, 20, 0, 152, - 0, 21, 22, 53, 0, 54, 55, 56, 0, 279, - 23, 24, 25, 0, 179, 180, 0, 181, 26, 27, - 0, 0, 182, 0, 183, 0, 0, 28, 0, 29, - 0, 30, 63, 221, 0, 0, 31, 0, 32, 33, - 34, 0, 0, 35, 0, 0, 0, 0, 36, 0, - 0, 37, 65, 66, 38, 7, 8, 9, 10, 39, - 11, 12, 13, 14, 0, 0, 0, 0, 70, 0, + 6, 568, 489, 361, 647, 275, 407, 1006, 537, 603, + 592, 145, 771, 143, 173, 469, 373, 375, 216, 510, + 780, 144, 307, 308, 309, 310, 545, 312, 638, 314, + 315, 316, 769, 218, 214, 786, 215, 297, 298, 332, + 299, 323, 324, 85, 493, 189, 329, 330, 682, 370, + 372, 374, 376, 377, 126, -665, 843, 609, 333, 789, + 127, 172, 1037, 1039, 1041, 128, 686, 222, 223, 224, + -666, 594, 236, 226, 129, 689, 824, 691, 692, 693, + 694, 695, 332, 219, 684, 595, -667, 687, 596, 830, + 807, 597, 238, 239, 719, 720, 130, 762, 763, 764, + 765, 475, 470, 302, 237, 300, 199, 598, -665, 808, + 593, -665, 131, 301, 332, 611, 238, 239, 495, 332, + 133, 332, 496, -666, 132, 305, -666, 305, 305, 305, + 305, 705, 305, 1019, 305, 305, 305, 511, 1020, -667, + 1021, 515, -667, 306, 793, 134, 305, 305, 311, 706, + 313, 305, 305, 546, 566, 567, 227, 494, 332, 135, + 228, 332, 322, 497, 678, 325, 326, 327, 559, 844, + 222, 223, 224, 226, 813, 240, 624, 1022, 772, 625, + 1085, 359, 619, 1145, 478, 136, 480, 481, 482, 483, + 484, 297, 298, 387, 299, 297, 298, 620, 299, 240, + 486, 229, 1146, 490, 491, 869, 1024, 766, 773, 137, + 821, 241, 146, 457, 1030, 236, 873, 211, 212, 213, + 147, 875, 767, 768, 222, 620, 498, 371, 236, 236, + 371, 371, 388, 767, 768, 870, 392, 1147, 1009, 876, + 499, 1174, 825, 148, 395, 500, 238, 239, 550, 426, + 501, 1150, 551, 175, 176, 332, 1148, 302, 214, 300, + 215, 302, 637, 300, 230, 6, 332, 301, 364, 1002, + 1151, 301, 365, 149, 1199, 250, 251, 252, 231, 253, + 255, 256, 150, 232, 260, 1228, 151, 1270, 233, 265, + 332, 257, 1016, 552, 271, 272, 332, 274, 277, 278, + 602, 282, 283, 1138, 332, 1139, 1271, 1140, 152, 1280, + 1141, 1142, 1143, 366, 332, 1299, 177, 178, 305, 332, + 175, 176, 153, 1300, 1029, 217, 332, 1031, 1032, 240, + 485, 604, 332, 1301, 472, 189, 179, 180, 1302, 181, + 488, 387, 332, 1023, 182, 1315, 183, 261, 1028, 682, + 199, 1316, 1184, 1185, 1186, 332, 553, 1, 2, 3, + 262, 1317, 371, 263, 371, 371, 371, 371, 371, 264, + 554, 593, 806, 268, 1318, 555, 367, 417, 371, 418, + 269, 371, 371, 177, 178, 549, 504, 270, 507, 1026, + 368, 696, 697, 534, 273, 369, 6, 514, 284, 395, + 6, 703, 704, 179, 180, 10, 181, 11, 317, 535, + 319, 182, 594, 183, 1117, 485, 607, -86, 199, -86, + 1207, -86, 243, 244, 331, 558, 595, 6, 335, 596, + 387, 336, 597, 1112, 540, 422, 1115, 260, 363, 435, + 184, 436, 399, 437, 185, 485, 608, 605, 598, 430, + 389, 431, 432, 433, 387, 206, 207, 208, 209, 210, + -232, 211, 212, 213, -86, 678, -86, 408, -86, 388, + 600, 396, 435, 1130, 436, 410, 770, 423, 371, 767, + 768, 1013, 620, 791, 507, 177, 178, 504, 1043, 1044, + 1045, 472, 767, 768, 1113, 504, 504, 504, 504, 504, + 504, 622, 424, 387, 387, 245, 180, 387, 181, 872, + 697, 534, 630, 182, 444, 183, 767, 768, 439, 332, + 682, 6, 445, 446, 48, 208, 209, 210, 447, 211, + 212, 213, 504, 448, 449, 451, 450, 452, 458, 817, + 647, 241, 683, 388, 1047, 462, 388, 479, 558, 453, + 558, 558, 558, 558, 558, 774, 775, 454, 1174, 776, + 777, 702, 154, 155, 156, 157, 158, 1025, 1174, 190, + 716, 455, 1073, 1137, 459, 460, 145, 461, 143, 463, + 465, 600, 622, 466, 485, 606, 144, 492, 395, 509, + 512, 516, 536, 613, 614, 615, 616, 617, 618, 1004, + 1005, 517, 518, 519, 504, 622, 520, 541, 600, 539, + 542, 504, 543, 560, 585, 586, 587, 590, 469, 507, + 801, 612, 591, 589, -307, 627, 633, 534, 623, 634, + 645, 6, 635, 636, 639, 643, 678, 644, 649, 648, + 504, 685, 690, 840, 823, 145, 622, 143, 700, 707, + 778, 708, 709, 710, 718, 144, 1203, 711, 781, 387, + 1264, 1265, 1266, 1179, 1180, 1181, 1182, 1183, 782, 1184, + 1185, 1186, 783, 328, 784, 1181, 1182, 1183, 787, 1184, + 1185, 1186, 788, 804, 1205, 620, -239, 805, 814, 558, + 839, 809, 810, 811, 827, 832, 507, 816, 388, 1210, + 1211, 1212, 785, 828, 305, 305, 829, 831, 833, 790, + 1007, 716, 1008, 337, 338, 339, 340, 341, 342, 343, + 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 834, 360, 1010, 842, 815, 362, + 868, 871, 1258, 697, 387, 1011, 1014, 387, 387, 1012, + 1033, 1018, 1034, 1050, 1312, 1051, 1052, 1053, 1054, 1055, + 1074, 1319, 145, 1084, 143, 197, 198, 507, 1118, 1260, + 1078, 1119, 144, 1262, 1114, 1263, 199, 472, 1267, 236, + 1128, 1121, 1122, 388, 622, 1123, 388, 388, 801, 801, + 801, 1124, 1132, 1152, 1133, 409, 1134, 1286, 801, 1135, + 1136, 1149, 1153, 6, 387, 1154, 1155, 1156, 1157, 1201, + 1188, 1131, 1189, 1190, 823, 1192, 1073, 1073, 1073, 1073, + 1073, 1193, 1073, 1194, 1288, 1209, 1195, 238, 239, 573, + 1056, 274, 1058, 574, 387, 1110, 1204, 826, 1208, 456, + 1213, 188, 1214, 1075, 1076, 1077, 1215, 1079, 1080, 1081, + 1082, 1216, 1304, 467, 468, 1217, 1218, 1219, 1220, 1227, + 1251, 1252, 1261, 225, 1254, 1253, 1255, 472, 1311, 1259, + 472, 1268, 1269, 388, 575, 247, 1273, 1272, 242, 248, + 1276, 206, 207, 208, 209, 210, 1274, 211, 212, 213, + 1275, 1277, 1290, 1291, 1292, 1287, 1293, 267, 1289, 1303, + 1294, 254, 1295, 1296, 1297, 1313, 1314, 281, 1305, 576, + 240, 506, 1306, 650, 1003, 400, 1129, 1073, 1073, 1073, + 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, + 1073, 1073, 1073, 1073, 1073, 1073, 318, 577, 320, 321, + 1187, 819, 641, 1127, 413, 87, 548, 195, 196, 197, + 198, 578, 88, 89, 1048, 820, 579, 1087, 1057, 572, + 199, 580, 414, 91, 92, 93, 415, 0, 1120, 0, + 0, 0, 1191, 473, 249, 387, 0, 702, 1073, 0, + 334, 0, 101, 0, 0, 192, 193, 194, 195, 196, + 197, 198, 106, 387, 0, 0, 601, 0, 107, 0, + 0, 199, 0, 110, 0, 0, 0, 506, 0, 0, + 0, 0, 0, 113, 683, 114, 0, 0, 0, 0, + 0, 0, 600, 236, 0, 0, 0, 0, 0, 801, + 1073, 801, 388, 801, 0, 0, 801, 801, 801, 1164, + 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 402, 0, 403, 404, 405, 406, + 0, 0, 0, 204, 205, 206, 207, 208, 209, 210, + 0, 211, 212, 213, 0, 416, 387, 305, 0, 421, + 0, 0, 0, 0, 0, 427, 1163, 429, 0, 0, + 0, 0, 0, 715, 0, 441, 443, 243, 244, 442, + 248, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 0, 211, 212, 213, 388, 0, 0, 472, 0, + 0, 0, 0, 0, 716, 193, 194, 195, 196, 197, + 198, 188, 0, 472, 472, 472, 0, 0, 0, 0, + 199, 792, 506, 0, 0, 0, 0, 794, 1168, 1169, + 1170, 1171, 1172, 1173, 1249, 0, 0, 0, 0, 0, + 177, 178, 387, 1174, 0, 0, 0, 0, 1221, 1222, + 1223, 1224, 1225, 1226, 0, 0, 0, 0, 0, 0, + 245, 180, 0, 181, 0, 508, 503, 0, 182, 0, + 183, 0, 835, 836, 837, 838, 0, 841, 0, 0, + 0, 388, 0, 472, 0, 0, 0, 472, 0, 600, + 600, 600, 472, 246, 0, 0, 0, 387, 0, 506, + 1282, 1283, 0, 1284, 1285, 557, 0, 565, 0, 0, + 0, 0, 0, 0, 715, 0, 0, 393, 0, 0, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 0, 211, 212, 213, 0, 0, 388, 0, 472, 0, + 0, 0, 0, 1307, 1308, 1309, 1310, 0, 1179, 1180, + 1181, 1182, 1183, 0, 1184, 1185, 1186, 53, 0, 54, + 55, 56, 0, 0, 0, 0, 472, 503, 0, 0, + 506, 0, 1017, 0, 0, 503, 503, 503, 503, 503, + 503, 0, 472, 600, 0, 0, 63, 221, 0, 0, + 600, 1158, 1159, 1160, 1161, 1162, 0, 1165, 0, 0, + 0, 0, 640, 0, 642, 0, 65, 66, 0, 0, + 0, 0, 503, 0, 0, 0, 0, 421, 0, 0, + 0, 0, 70, 0, 0, 0, 0, 72, 557, 0, + 557, 557, 557, 557, 557, 0, 1083, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1088, 1089, 1090, + 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, + 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 0, 1111, + 0, 0, 0, 7, 8, 9, 10, 0, 11, 12, + 13, 159, 0, 0, 503, 0, 0, 0, 0, 0, + 0, 503, 1229, 1230, 1231, 1232, 1233, 1234, 1235, 1236, + 1237, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 1245, 1246, + 1247, 0, 0, 0, 0, 0, 0, 15, 52, 0, + 503, 160, 0, 161, 162, 163, 57, 58, 0, 20, + 59, 0, 0, 164, 22, 1172, 1173, 61, 0, 0, + 0, 0, 23, 24, 165, 0, 1174, 0, 0, 0, + 166, 167, 53, 1278, 54, 55, 56, 0, 0, 28, + 0, 29, 0, 30, 220, 0, 0, 0, 31, 557, + 168, 169, 34, 0, 0, 35, 67, 175, 176, 565, + 36, 63, 221, 37, 68, 69, 170, 0, 0, 71, + 0, 171, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 65, 66, 0, 40, 1298, 0, 41, 42, 43, + 1126, 0, 44, 0, 45, 46, 0, 70, 0, 47, + 0, 0, 72, 0, 0, 0, 0, 651, 652, 653, + 10, 0, 11, 654, 655, 51, 0, 0, 656, 0, + 177, 178, 0, 0, 0, 137, 0, 0, 0, 0, + 0, 1179, 1180, 1181, 1182, 1183, 1027, 1184, 1185, 1186, + 179, 180, 0, 181, 0, 0, 0, 0, 182, 0, + 183, 657, 52, 1042, 0, 53, 1046, 54, 55, 56, + 57, 380, 0, 658, 59, 0, 1197, 60, 659, 0, + 0, 61, 0, 266, 0, 0, 660, 661, 62, 0, + 0, 0, 0, 0, 63, 64, 53, 0, 54, 55, + 56, 0, 0, 662, 0, 663, 0, 664, 220, 0, + 0, 381, 665, 0, 65, 66, 666, 715, 0, 667, + 67, 0, 0, 0, 668, 63, 221, 669, 68, 69, + 70, 0, 0, 71, 0, 72, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 65, 66, 0, 670, 0, + 0, 671, 672, 0, 0, 0, 673, 0, 674, 0, + 0, 70, 0, 675, 0, 0, 72, 0, 877, 878, + 879, 880, 881, 882, 883, 884, 885, 886, 1250, 887, + 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, + 1256, 0, 0, 0, 0, 0, 0, 898, 899, 900, + 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, + 911, 912, 913, 914, 0, 0, 915, 916, 917, 918, + 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, + 929, 0, 930, 0, 931, 932, 933, 934, 935, 936, + 937, 938, 939, 940, 941, 942, 943, 0, 0, 0, + 0, 0, 944, 945, 946, 0, 947, 948, 949, 950, + 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, + 961, 962, 0, 963, 964, 965, 966, 967, 968, 969, + 970, 971, 972, 973, 974, 975, 976, 977, 0, 0, + 0, 978, 979, 980, 981, 982, 983, 984, 985, 986, + 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, + 997, 998, 1206, 999, 1000, 877, 878, 879, 880, 881, + 882, 883, 884, 885, 886, 0, 887, 888, 889, 890, + 891, 892, 893, 894, 895, 896, 897, 0, 0, 0, + 0, 0, 0, 0, 898, 899, 900, 901, 902, 903, + 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, + 914, 0, 0, 915, 916, 917, 918, 919, 920, 921, + 922, 923, 924, 925, 926, 927, 928, 929, 0, 930, + 0, 931, 932, 933, 934, 935, 936, 937, 938, 939, + 940, 941, 942, 943, 0, 0, 0, 0, 0, 944, + 945, 946, 0, 947, 948, 949, 950, 951, 952, 953, + 954, 955, 956, 957, 958, 959, 960, 961, 962, 0, + 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, + 973, 974, 975, 976, 977, 0, 0, 0, 978, 979, + 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, + 990, 991, 992, 993, 994, 995, 996, 997, 998, 0, + 999, 1000, 651, 652, 653, 10, 0, 11, 654, 655, + 51, 0, 0, 1086, 0, 0, 0, 0, 0, 53, + 0, 54, 55, 56, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 191, 192, 193, 194, 195, 196, + 197, 198, 0, 0, 0, 0, 657, 52, 63, 221, + 53, 199, 54, 55, 56, 57, 380, 0, 658, 59, + 0, 0, 60, 659, 0, 0, 61, 0, 65, 66, + 0, 660, 661, 62, 0, 0, 0, 0, 0, 63, + 64, 0, 0, 0, 70, 0, 0, 0, 662, 72, + 663, 0, 664, 0, 0, 0, 381, 665, 0, 65, + 66, 666, 0, 0, 667, 67, 0, 0, 0, 668, + 0, 0, 669, 68, 69, 70, 0, 0, 71, 0, + 72, 7, 8, 9, 10, 0, 11, 12, 13, 14, + 0, 175, 176, 670, 0, 0, 671, 672, 0, 0, + 0, 673, 0, 674, 0, 0, 0, 0, 675, 0, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 0, 211, 212, 213, 15, 0, 476, 0, 16, + 0, 17, 18, 19, 0, 0, 0, 20, 0, 569, + 570, 21, 22, 53, 0, 54, 55, 56, 0, 0, + 23, 24, 25, 0, 177, 178, 0, 0, 26, 27, + 0, 0, 0, 0, 0, 0, 0, 28, 0, 29, + 0, 30, 63, 221, 179, 180, 31, 181, 32, 33, + 34, 0, 182, 35, 183, 0, 0, 0, 36, 525, + 526, 37, 65, 66, 38, 7, 8, 9, 10, 39, + 11, 12, 13, 14, 571, 0, 0, 401, 70, 0, 0, 0, 40, 72, 0, 41, 42, 43, 0, 0, - 44, 0, 45, 46, 1266, 0, 0, 47, 0, 0, + 44, 0, 45, 46, 0, 0, 0, 47, 0, 0, + 53, 0, 54, 55, 56, 0, 147, 0, 0, 15, + 0, 0, 60, 16, 0, 17, 18, 19, 0, 0, + 0, 20, 0, 62, 0, 21, 22, 0, 0, 63, + 64, 0, 0, 0, 23, 24, 25, 0, 0, 0, + 0, 0, 26, 27, 53, 0, 54, 55, 56, 65, + 66, 28, 0, 29, 0, 30, 0, 0, 0, 0, + 31, 0, 32, 33, 34, 70, 0, 35, 71, 0, + 72, 0, 36, 63, 221, 37, 0, 0, 38, 7, + 8, 9, 10, 39, 11, 12, 13, 14, 0, 175, + 176, 0, 0, 65, 66, 0, 40, 0, 0, 41, + 42, 43, 0, 0, 44, 0, 45, 46, 358, 70, + 0, 47, 0, 0, 72, 0, 0, 0, 0, 0, + 0, 0, 0, 15, 0, 0, 0, 16, 0, 17, + 18, 19, 0, 0, 0, 20, 0, 148, 0, 21, + 22, 53, 0, 54, 55, 56, 0, 0, 23, 24, + 25, 0, 177, 178, 0, 0, 26, 27, 0, 0, + 0, 0, 0, 0, 0, 28, 0, 29, 0, 30, + 63, 221, 179, 180, 31, 181, 32, 33, 34, 0, + 182, 35, 183, 175, 176, 0, 36, 0, 0, 37, + 65, 66, 38, 7, 8, 9, 10, 39, 11, 12, + 13, 14, 712, 0, 0, 0, 70, 0, 0, 0, + 40, 72, 0, 41, 42, 43, 0, 0, 44, 0, + 45, 46, 0, 0, 0, 47, 0, 0, 0, 0, + 0, 0, 0, 0, 152, 0, 0, 15, 0, 0, + 0, 16, 0, 17, 18, 19, 177, 178, 0, 20, + 0, 0, 0, 21, 22, 0, 0, 0, 0, 0, + 0, 280, 23, 24, 25, 0, 179, 180, 0, 181, + 26, 27, 0, 0, 182, 0, 183, 0, 0, 28, + 0, 29, 0, 30, 0, 0, 0, 0, 31, 0, + 32, 33, 34, 0, 0, 35, 0, 0, 0, 0, + 36, 0, 0, 37, 0, 0, 38, 7, 8, 9, + 10, 39, 11, 12, 13, 14, 0, 0, 0, 0, + 0, 0, 0, 0, 40, 0, 0, 41, 42, 43, + 0, 0, 44, 0, 45, 46, 1109, 0, 0, 47, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 15, 0, 0, 0, 16, 0, 17, 18, 19, + 0, 0, 0, 20, 0, 0, 0, 21, 22, 0, + 0, 0, 0, 0, 0, 0, 23, 24, 25, 0, + 0, 0, 0, 0, 26, 27, 0, 0, 0, 0, + 0, 0, 0, 28, 0, 29, 0, 30, 0, 0, + 0, 0, 31, 0, 32, 33, 34, 0, 0, 35, + 0, 0, 0, 0, 36, 0, 0, 37, 0, 0, + 38, 7, 8, 9, 10, 39, 11, 12, 13, 14, + 1125, 0, 0, 0, 0, 0, 0, 0, 40, 0, + 0, 41, 42, 43, 0, 0, 44, 0, 45, 46, + 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 15, 0, 0, 0, 16, + 0, 17, 18, 19, 0, 0, 0, 20, 0, 0, + 0, 21, 22, 0, 0, 0, 0, 0, 0, 0, + 23, 24, 25, 0, 0, 0, 0, 0, 26, 27, + 0, 0, 0, 0, 0, 0, 0, 28, 0, 29, + 0, 30, 0, 0, 0, 0, 31, 0, 32, 33, + 34, 0, 0, 35, 0, 0, 0, 0, 36, 0, + 0, 37, 0, 0, 38, 7, 8, 9, 10, 39, + 11, 12, 13, 14, 0, 0, 0, 0, 0, 0, + 0, 0, 40, 0, 0, 41, 42, 43, 0, 0, + 44, 0, 45, 46, 1248, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 16, 0, 17, 18, 19, 0, 0, 0, 20, 0, 0, 0, 21, 22, 0, 0, 0, - 0, 0, 0, 0, 23, 24, 25, 0, 0, 0, - 0, 0, 26, 27, 0, 0, 0, 0, 0, 0, - 0, 28, 0, 29, 0, 30, 0, 0, 0, 0, + 0, 0, 0, 0, 23, 24, 25, 1170, 1171, 1172, + 1173, 0, 26, 27, 0, 0, 175, 176, 0, 0, + 1174, 28, 0, 29, 0, 30, 0, 0, 0, 0, 31, 0, 32, 33, 34, 0, 0, 35, 0, 0, 0, 0, 36, 0, 0, 37, 0, 0, 38, 7, 8, 9, 10, 39, 11, 12, 13, 0, 0, 0, - 0, 0, 0, 425, 426, 0, 40, 0, 0, 41, - 42, 43, 0, 0, 44, 0, 45, 46, 0, 0, - 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1072, 0, 0, 0, 0, 0, 0, - 0, 286, 0, 0, 53, 1073, 54, 55, 56, 57, - 1074, 0, 0, 288, 0, 0, 60, 0, 23, 24, - 61, 0, 0, 0, 0, 0, 0, 62, -2, 0, - 0, 0, 0, 63, 64, 0, 0, 29, 0, 30, - 0, 0, 0, 0, 1075, 0, 0, 0, 1076, 0, - 0, 1077, 0, 65, 66, 0, 36, 0, 0, 67, - 0, 0, 0, 0, 0, 0, 0, 290, 69, 70, - 0, 0, 71, 0, 72, 0, 0, 86, 87, 0, - 1078, 0, 0, 1079, 1080, 1081, 88, 0, 1082, 0, - 1083, 46, 0, 0, 89, 1084, 90, 91, 92, 93, - 0, 0, 0, 94, 0, 0, 0, 95, 0, 0, - 0, 96, 97, 98, 99, 100, 101, 1186, 1187, 1188, - 1189, 0, 102, 103, 104, 105, 0, 0, 0, 0, - 1190, 106, 107, 0, 0, 108, 109, 0, 0, 0, - 110, 0, 0, 0, 0, 111, 112, 0, 113, 730, - 0, 0, 0, 0, 0, 0, 114, 0, 731, 732, - 733, 734, 735, 736, 737, 738, 0, 175, 176, 0, - 0, 0, 0, 115, 0, 739, 0, 740, 741, 742, - 743, 744, 745, 746, 747, 748, 749, 750, 751, 191, - 192, 193, 194, 195, 196, 197, 198, 0, 0, 0, - 0, 0, 0, 0, 0, 752, 199, 0, 0, 0, - 0, 0, 0, 57, 0, 0, 0, 0, 0, 0, + 0, 0, 57, 0, 0, 0, 40, 0, 0, 41, + 42, 43, 0, 0, 44, 0, 45, 46, 0, 177, + 178, 47, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1059, 0, 0, 0, 0, 0, 179, + 795, 796, 797, 175, 176, 1060, 0, 182, 0, 183, + 1061, 0, 67, 0, 0, 0, 0, 0, 23, 24, + 798, 69, 0, 0, 799, 1179, 1180, 1181, 1182, 1183, + 0, 1184, 1185, 1186, 0, 0, 0, 29, 0, 30, + 0, 0, 0, -2, 1062, 0, 0, 0, 1063, 57, + 0, 1064, 0, 0, 0, 0, 36, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 177, 178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 177, 178, 753, 0, 0, 1195, 1196, 1197, 1198, 1199, - 0, 1200, 1201, 1202, 0, 0, 0, 0, 0, 0, - 179, 180, 0, 181, 0, 0, 0, 0, 182, 0, - 183, 0, 0, 67, 0, 0, 0, 0, 0, 0, - 754, 807, 69, 755, 0, 756, 757, 758, 759, 760, - 761, 762, 763, 764, 765, 766, 0, 767, 768, 284, - 285, 0, 769, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 0, 211, 212, 213, - 284, 285, 1300, 0, 0, 0, 0, 286, 0, 0, - 53, 0, 54, 55, 56, 57, 287, 0, 0, 288, - 0, 0, 60, 0, 0, 0, 61, 0, 0, 0, - 0, 0, 0, 62, 0, 0, 0, 0, 286, 63, - 64, 53, 0, 54, 55, 56, 57, 287, 0, 0, - 288, 289, 0, 60, 0, 0, 0, 61, 0, 65, - 66, 0, 0, 0, 62, 67, 0, 0, 0, 0, - 63, 64, 0, 290, 69, 70, 411, 412, 71, 0, - 72, 0, 289, 0, 0, 291, 0, 0, 0, 0, - 65, 66, 0, 0, 0, 0, 67, 0, 0, 0, - 0, 292, 0, 0, 290, 69, 70, 0, 0, 71, - 0, 72, 0, 0, 286, 0, 0, 53, 0, 54, - 55, 56, 57, 413, 0, 0, 288, 0, 0, 60, - 0, 0, 292, 61, 0, 0, 0, 0, 0, 0, - 62, 0, 0, 0, 0, 0, 63, 64, 191, 192, - 193, 194, 195, 196, 197, 198, 0, 0, 289, 0, - 0, 0, 0, 0, 0, 199, 65, 66, 0, 0, - 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, - 290, 69, 70, 0, 0, 71, 0, 72, 191, 192, - 193, 194, 195, 196, 197, 198, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 199, 0, 0, 292, 191, - 192, 193, 194, 195, 196, 197, 198, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 199, 191, 192, 193, - 194, 195, 196, 197, 198, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 199, 191, 192, 193, 194, 195, - 196, 197, 198, 0, 0, 0, 0, 0, 0, 0, - 527, 0, 199, 0, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 0, 211, 212, 213, 528, - 191, 192, 193, 194, 195, 196, 197, 198, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 199, 0, 0, - 0, 0, 0, 0, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 0, 211, 212, 213, 468, - 0, 0, 0, 0, 0, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 0, 211, 212, 213, - 481, 0, 0, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 0, 211, 212, 213, 594, 0, - 0, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 0, 211, 212, 213, 697, 191, 192, 193, - 194, 195, 196, 197, 198, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 199, 0, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 0, 211, 212, - 213, 1213, 191, 192, 193, 194, 195, 196, 197, 198, + 1065, 0, 0, 1066, 1067, 1068, 179, 180, 1069, 181, + 1070, 46, 86, 87, 182, 1071, 183, 0, 0, 67, + 88, 89, 0, 0, 0, 0, 0, 798, 69, 90, + 0, 91, 92, 93, 94, 0, 0, 0, 95, 0, + 0, 0, 96, 0, 0, 0, 97, 98, 99, 100, + 101, 102, 0, 0, 0, 0, 0, 103, 104, 105, + 106, 0, 0, 0, 0, 0, 107, 108, 0, 0, + 109, 110, 0, 0, 0, 111, 0, 0, 0, 0, + 112, 113, 0, 114, 721, 0, 0, 0, 0, 0, + 0, 115, 0, 722, 723, 724, 725, 726, 727, 728, + 729, 0, 0, 0, 0, 0, 0, 0, 116, 0, + 730, 0, 731, 732, 733, 734, 735, 736, 737, 738, + 739, 740, 741, 742, 191, 192, 193, 194, 195, 196, + 197, 198, 0, 0, 0, 0, 0, 0, 0, 0, + 743, 199, 191, 192, 193, 194, 195, 196, 197, 198, 0, 0, 0, 0, 0, 0, 0, 0, 0, 199, - 0, 191, 192, 193, 194, 195, 196, 197, 198, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 199, 191, - 192, 193, 194, 195, 196, 197, 198, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 199, 191, 192, 193, - 194, 195, 196, 197, 198, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 199, 0, 0, 0, 0, 0, - 0, 478, 0, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 0, 211, 212, 213, 0, 856, - 857, 858, 859, 860, 861, 862, 863, 0, 0, 0, - 0, 0, 0, 0, 0, 726, 864, 0, 200, 201, + 0, 0, 0, 0, 0, 0, 0, 744, 0, 0, + 0, 0, 0, 1167, 1168, 1169, 1170, 1171, 1172, 1173, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1174, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 745, 0, 0, 746, 0, + 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, + 757, 0, 758, 759, 0, 0, 0, 760, 0, 0, + 0, 0, 0, 0, 0, 285, 286, 0, 0, 0, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 0, 211, 212, 213, 0, 0, 1200, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 0, - 211, 212, 213, 1048, 0, 0, 0, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 0, 211, - 212, 213, 0, 1215, 0, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 0, 211, 212, 213, - 0, 0, 0, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 0, 211, 212, 213, 1182, 1183, - 1184, 1185, 1186, 1187, 1188, 1189, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1190, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 865, 866, 867, 868, 869, - 870, 871, 872, 873, 874, 875, 0, 876, 877, 878, - 1182, 1183, 1184, 1185, 1186, 1187, 1188, 1189, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1190, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1184, 1185, 1186, 1187, 1188, 1189, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1190, 0, 0, - 193, 194, 195, 196, 197, 198, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 199, 0, 0, 0, 0, - 0, 0, 1298, 0, 1191, 1192, 1193, 1194, 0, 0, - 1195, 1196, 1197, 1198, 1199, 0, 1200, 1201, 1202, 0, - 0, 0, 0, 0, 51, 0, 0, 378, 0, 379, - 0, 0, 0, 0, 0, 0, 193, 194, 195, 196, - 197, 198, 0, 0, 0, 0, 1191, 1192, 1193, 1194, - 0, 199, 1195, 1196, 1197, 1198, 1199, 0, 1200, 1201, - 1202, 52, 0, 0, 53, 0, 54, 55, 56, 57, - 380, 0, 0, 59, 0, 0, 60, 1192, 1193, 1194, - 61, 0, 1195, 1196, 1197, 1198, 1199, 62, 1200, 1201, - 1202, 0, 0, 63, 64, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 0, 211, 212, 213, 0, - 381, 0, 0, 65, 66, 175, 176, 0, 0, 67, - 193, 194, 195, 196, 197, 198, 0, 68, 69, 70, - 0, 0, 71, 0, 72, 199, 1184, 1185, 1186, 1187, - 1188, 1189, 0, 0, 0, 0, 0, 382, 0, 0, - 0, 1190, 383, 203, 204, 205, 206, 207, 208, 209, - 210, 57, 211, 212, 213, 1184, 1185, 1186, 1187, 1188, - 1189, 0, 0, 0, 0, 0, 0, 0, 177, 178, - 1190, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 179, 804, - 805, 806, 0, 0, 0, 0, 182, 0, 183, 0, - 0, 67, 0, 0, 0, 0, 0, 0, 0, 807, - 69, 0, 0, 808, 0, 0, 529, 530, 0, 0, - 0, 0, 0, 0, 0, 0, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 0, 211, 212, 213, 0, - 0, 0, 0, 1194, 0, 0, 1195, 1196, 1197, 1198, - 1199, 0, 1200, 1201, 1202, 0, 0, 53, 0, 54, - 55, 56, 531, 532, 0, 0, 0, 0, 0, 60, - 0, 0, 0, 0, 0, 1195, 1196, 1197, 1198, 1199, - 62, 1200, 1201, 1202, 0, 0, 63, 64, 0, 51, - 0, 0, 378, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 65, 66, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 533, 0, 70, 0, 0, 71, 52, 72, 0, 53, + 211, 212, 213, 287, 0, 1281, 53, 0, 54, 55, + 56, 57, 0, 0, 0, 288, 0, 0, 60, 1176, + 1177, 1178, 61, 0, 1179, 1180, 1181, 1182, 1183, 62, + 1184, 1185, 1186, 0, 0, 63, 64, 0, 0, 285, + 286, 0, 0, 0, 0, 0, 0, 289, 0, 0, + 0, 0, 0, 0, 0, 65, 66, 0, 0, 0, + 0, 67, 0, 0, 0, 0, 0, 0, 0, 290, + 69, 70, 0, 0, 71, 0, 72, 287, 0, 0, + 53, 291, 54, 55, 56, 57, 0, 0, 0, 288, + 0, 0, 60, 0, 0, 0, 61, 292, 0, 0, + 0, 0, 0, 62, 0, 0, 0, 0, 0, 63, + 64, 411, 412, 0, 0, 0, 0, 0, 0, 0, + 0, 289, 0, 0, 0, 0, 0, 0, 0, 65, + 66, 0, 0, 0, 0, 67, 0, 0, 0, 0, + 0, 0, 0, 290, 69, 70, 0, 0, 71, 287, + 72, 0, 53, 0, 54, 55, 56, 57, 0, 0, + 0, 288, 0, 0, 60, 0, 0, 0, 61, 0, + 0, 292, 0, 0, 0, 62, 0, 0, 0, 0, + 0, 63, 64, 191, 192, 193, 194, 195, 196, 197, + 198, 0, 0, 289, 0, 0, 0, 0, 0, 0, + 199, 65, 66, 0, 0, 0, 0, 67, 0, 0, + 0, 0, 0, 0, 0, 290, 69, 70, 0, 0, + 71, 0, 72, 191, 192, 193, 194, 195, 196, 197, + 198, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 199, 0, 0, 292, 191, 192, 193, 194, 195, 196, + 197, 198, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 199, 191, 192, 193, 194, 195, 196, 197, 198, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 199, + 191, 192, 193, 194, 195, 196, 197, 198, 0, 0, + 0, 0, 0, 0, 0, 523, 0, 199, 0, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 0, 211, 212, 213, 524, 191, 192, 193, 194, 195, + 196, 197, 198, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 199, 0, 0, 0, 0, 0, 0, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 0, 211, 212, 213, 464, 0, 0, 0, 0, 0, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 0, 211, 212, 213, 477, 0, 0, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 0, + 211, 212, 213, 588, 0, 0, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 0, 211, 212, + 213, 688, 191, 192, 193, 194, 195, 196, 197, 198, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 199, + 0, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 0, 211, 212, 213, 1196, 191, 192, 193, + 194, 195, 196, 197, 198, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 199, 0, 191, 192, 193, 194, + 195, 196, 197, 198, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 199, 191, 192, 193, 194, 195, 196, + 197, 198, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 199, 191, 192, 193, 194, 195, 196, 197, 198, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 199, + 0, 0, 0, 0, 0, 0, 474, 0, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 0, + 211, 212, 213, 0, 845, 846, 847, 848, 849, 850, + 851, 852, 0, 0, 0, 0, 0, 0, 0, 0, + 717, 853, 0, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 0, 211, 212, 213, 1035, 0, + 0, 0, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 0, 211, 212, 213, 0, 1198, 0, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 0, 211, 212, 213, 0, 0, 0, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 0, + 211, 212, 213, 1166, 1167, 1168, 1169, 1170, 1171, 1172, + 1173, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1174, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, + 864, 0, 865, 866, 867, 1166, 1167, 1168, 1169, 1170, + 1171, 1172, 1173, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1174, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1168, 1169, 1170, + 1171, 1172, 1173, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1174, 0, 193, 194, 195, 196, 197, 198, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 199, + 0, 0, 0, 0, 0, 0, 0, 1279, 0, 1175, + 1176, 1177, 1178, 0, 0, 1179, 1180, 1181, 1182, 1183, + 0, 1184, 1185, 1186, 0, 0, 0, 0, 0, 51, + 0, 0, 378, 0, 379, 0, 0, 0, 0, 0, + 0, 193, 194, 195, 196, 197, 198, 0, 0, 0, + 0, 1175, 1176, 1177, 1178, 0, 199, 1179, 1180, 1181, + 1182, 1183, 0, 1184, 1185, 1186, 52, 0, 0, 53, 0, 54, 55, 56, 57, 380, 0, 0, 59, 0, - 0, 60, 0, 0, 0, 61, 0, 0, 0, 0, - 0, 0, 62, 0, 0, 0, 0, 0, 63, 64, - 0, 51, 0, 0, 616, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 381, 0, 0, 65, 66, - 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, - 0, 0, 68, 69, 70, 0, 0, 71, 52, 72, - 0, 53, 0, 54, 55, 56, 57, 380, 0, 0, - 59, 0, 0, 60, 0, 0, 0, 61, 0, 0, - 0, 0, 0, 0, 62, 0, 0, 0, 0, 0, - 63, 64, 0, 51, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 381, 0, 0, - 65, 66, 0, 0, 0, 51, 67, 0, 0, 0, - 0, 0, 0, 0, 68, 69, 70, 0, 0, 71, - 52, 72, 0, 53, 0, 54, 55, 56, 57, 380, - 0, 0, 59, 0, 0, 60, 0, 0, 0, 61, - 0, 0, 52, 0, 0, 53, 62, 54, 55, 56, - 57, 58, 63, 64, 59, 0, 0, 60, 0, 0, - 0, 61, 0, 0, 0, 0, 0, 0, 62, 381, - 0, 0, 65, 66, 63, 64, 0, 51, 67, 0, - 0, 0, 0, 0, 0, 0, 68, 69, 70, 0, - 0, 71, 0, 72, 65, 66, 0, 0, 0, 0, - 67, 0, 0, 0, 0, 0, 0, 0, 68, 69, - 70, 0, 0, 71, 52, 72, 0, 53, 0, 54, - 55, 56, 57, 429, 0, 0, 59, 0, 0, 60, - 0, 0, 0, 61, 51, 0, 0, 0, 0, 0, - 62, 0, 0, 0, 0, 0, 63, 64, 0, 0, - 0, 0, 0, 0, 0, 0, 138, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 65, 66, 0, 0, - 0, 52, 67, 0, 53, 0, 54, 55, 56, 57, - 68, 69, 70, 59, 0, 71, 60, 72, 0, 0, - 61, 0, 0, 139, 0, 0, 53, 62, 54, 55, - 56, 57, 788, 63, 64, 140, 0, 0, 60, 0, - 0, 0, 61, 138, 0, 0, 0, 0, 0, 62, - 491, 0, 0, 65, 66, 63, 64, 0, 0, 67, - 0, 0, 0, 0, 0, 51, 0, 68, 69, 70, - 0, 0, 71, 0, 72, 65, 66, 0, 0, 0, - 139, 67, 0, 53, 0, 54, 55, 56, 57, 141, - 69, 70, 140, 0, 71, 60, 72, 0, 0, 61, - 0, 0, 52, 175, 176, 53, 62, 54, 55, 56, - 57, 0, 63, 64, 59, 0, 0, 60, 0, 175, - 176, 61, 0, 0, 0, 0, 0, 0, 62, 0, - 0, 0, 65, 66, 63, 64, 0, 0, 67, 0, - 0, 0, 0, 0, 0, 0, 141, 69, 70, 57, - 0, 71, 0, 72, 65, 66, 0, 0, 175, 176, - 67, 0, 0, 0, 0, 57, 177, 178, 68, 69, - 70, 0, 0, 71, 0, 72, 0, 0, 0, 0, - 0, 0, 177, 178, 0, 0, 179, 180, 0, 181, - 0, 0, 0, 0, 182, 0, 183, 0, 0, 67, - 0, 0, 179, 180, 57, 181, 0, 807, 69, 0, - 182, 1049, 183, 0, 0, 67, 0, 0, 0, 0, - 0, 177, 178, 807, 69, 0, 0, 1051, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 86, 87, - 0, 179, 180, 0, 181, 0, 0, 88, 0, 182, - 0, 183, 0, 0, 67, 89, 0, 90, 91, 92, - 93, 0, 807, 69, 94, 0, 1053, 0, 95, 0, - 0, 0, 96, 97, 98, 99, 100, 101, 0, 0, - 0, 0, 0, 102, 103, 104, 105, 0, 0, 0, - 0, 0, 106, 107, 86, 87, 108, 109, 0, 0, - 0, 110, 0, 88, 0, 0, 111, 112, 0, 113, - 0, 89, 0, 90, 91, 92, 93, 114, 0, 0, - 94, 0, 0, 0, 95, 0, 0, 0, 96, 97, - 98, 99, 100, 101, 115, 0, 525, 0, 0, 102, - 103, 104, 105, 0, 0, 0, 0, 0, 106, 107, - 86, 87, 108, 109, 0, 0, 0, 110, 0, 88, - 0, 0, 111, 112, 0, 113, 0, 89, 0, 90, - 91, 92, 93, 114, 0, 0, 94, 0, 0, 0, - 95, 0, 0, 0, 96, 97, 98, 99, 100, 101, - 115, 0, 632, 0, 0, 102, 103, 104, 105, 0, - 0, 0, 0, 0, 106, 107, 86, 87, 108, 109, - 0, 0, 0, 110, 0, 88, 0, 0, 111, 112, - 0, 113, 0, 89, 0, 90, 91, 92, 93, 114, - 0, 0, 94, 0, 0, 0, 95, 0, 0, 0, - 96, 97, 98, 99, 100, 101, 115, 0, 637, 0, - 0, 102, 103, 104, 105, 0, 0, 0, 0, 0, - 106, 107, 86, 87, 108, 109, 0, 0, 0, 110, - 0, 88, 0, 0, 111, 112, 0, 113, 0, 89, - 0, 90, 91, 92, 93, 114, 0, 0, 94, 0, - 0, 0, 95, 0, 0, 0, 96, 97, 98, 99, - 100, 101, 115, 0, 707, 0, 0, 102, 103, 104, - 105, 0, 0, 0, 0, 0, 106, 107, 86, 87, - 108, 109, 0, 0, 0, 110, 0, 88, 0, 0, - 111, 112, 0, 113, 0, 89, 0, 90, 91, 92, - 93, 114, 0, 0, 94, 0, 0, 0, 95, 0, - 0, 0, 96, 97, 98, 99, 100, 101, 115, 0, - 821, 0, 0, 102, 103, 104, 105, 0, 0, 0, - 0, 0, 106, 107, 86, 87, 108, 109, 0, 0, - 0, 110, 0, 88, 0, 0, 111, 112, 0, 113, - 0, 89, 0, 90, 91, 92, 93, 114, 0, 0, - 94, 0, 0, 0, 95, 0, 0, 0, 96, 97, - 98, 99, 100, 101, 115, 0, 1062, 0, 0, 102, - 103, 104, 105, 0, 0, 0, 0, 0, 106, 107, - 86, 87, 108, 109, 0, 0, 0, 110, 0, 88, - 0, 0, 111, 112, 0, 113, 0, 89, 0, 90, - 91, 92, 93, 114, 0, 0, 94, 0, 0, 0, - 95, 0, 0, 87, 96, 97, 98, 99, 100, 101, - 115, 88, 1160, 0, 0, 102, 103, 104, 105, 0, - 0, 90, 91, 92, 106, 107, 0, 0, 108, 109, - 0, 0, 249, 110, 0, 0, 0, 0, 111, 112, - 100, 113, 0, 0, 0, 0, 0, 0, 0, 87, - 105, 0, 0, 0, 0, 0, 106, 88, 0, 0, - 0, 109, 0, 0, 0, 0, 115, 90, 91, 92, - 111, 112, 0, 113, 0, 87, 0, 0, 249, 0, - 0, 0, 0, 88, 0, 0, 100, 0, -144, 0, - 0, 0, 0, 90, 91, 92, 105, 0, 115, 0, - 0, 0, 106, 0, 249, 0, 108, 109, 0, 0, - 0, 0, 100, 258, 0, 0, 111, 112, 87, 113, - 0, 0, 105, 0, 0, 0, 88, 0, 106, 0, - 0, 0, 0, 109, 0, 0, 90, 91, 92, 0, - 0, 0, 0, 112, 115, 113, 0, 249, 0, 0, - 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 105, 0, 0, 0, 0, - 115, 106, 0, 0, 0, 0, 109, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 112, 0, 113, 0, + 0, 60, 1176, 1177, 1178, 61, 0, 1179, 1180, 1181, + 1182, 1183, 62, 1184, 1185, 1186, 0, 0, 63, 64, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 0, + 211, 212, 213, 0, 0, 381, 0, 0, 65, 66, + 175, 176, 0, 0, 67, 193, 194, 195, 196, 197, + 198, 0, 68, 69, 70, 0, 0, 71, 0, 72, + 199, 1168, 1169, 1170, 1171, 1172, 1173, 0, 0, 0, + 0, 0, 382, 0, 0, 0, 1174, 383, 203, 204, + 205, 206, 207, 208, 209, 210, 57, 211, 212, 213, + 1168, 1169, 1170, 1171, 1172, 1173, 0, 0, 0, 0, + 0, 0, 0, 177, 178, 1174, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 179, 180, 0, 181, 0, 0, 0, + 0, 182, 0, 183, 0, 0, 67, 0, 0, 0, + 0, 0, 0, 0, 798, 69, 0, 0, 1036, 0, + 0, 525, 526, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 204, 205, 206, 207, 208, 209, 210, + 0, 211, 212, 213, 0, 0, 0, 1177, 1178, 0, + 0, 1179, 1180, 1181, 1182, 1183, 0, 1184, 1185, 1186, + 0, 0, 53, 0, 54, 55, 56, 527, 528, 0, + 0, 0, 0, 0, 60, 0, 0, 1178, 0, 0, + 1179, 1180, 1181, 1182, 1183, 62, 1184, 1185, 1186, 0, + 0, 63, 64, 0, 51, 0, 0, 378, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 115 + 0, 65, 66, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 529, 0, 70, 0, 0, + 71, 52, 72, 0, 53, 0, 54, 55, 56, 57, + 380, 0, 0, 59, 0, 0, 60, 0, 0, 0, + 61, 0, 0, 0, 0, 0, 0, 62, 0, 0, + 0, 0, 0, 63, 64, 0, 51, 0, 0, 610, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 381, 0, 0, 65, 66, 0, 0, 0, 0, 67, + 0, 0, 0, 0, 0, 0, 0, 68, 69, 70, + 0, 0, 71, 52, 72, 0, 53, 0, 54, 55, + 56, 57, 380, 0, 0, 59, 0, 0, 60, 0, + 0, 0, 61, 0, 0, 0, 0, 0, 0, 62, + 0, 0, 0, 0, 0, 63, 64, 0, 51, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 381, 0, 0, 65, 66, 0, 0, 0, + 51, 67, 0, 0, 0, 0, 0, 0, 0, 68, + 69, 70, 0, 0, 71, 52, 72, 0, 53, 0, + 54, 55, 56, 57, 380, 0, 0, 59, 0, 0, + 60, 0, 0, 0, 61, 0, 0, 52, 0, 0, + 53, 62, 54, 55, 56, 57, 58, 63, 64, 59, + 0, 0, 60, 0, 0, 0, 61, 0, 0, 0, + 0, 0, 0, 62, 381, 0, 0, 65, 66, 63, + 64, 0, 51, 67, 0, 0, 0, 0, 0, 0, + 0, 68, 69, 70, 0, 0, 71, 0, 72, 65, + 66, 0, 0, 0, 0, 67, 0, 0, 0, 0, + 0, 0, 0, 68, 69, 70, 0, 0, 71, 52, + 72, 0, 53, 0, 54, 55, 56, 57, 425, 0, + 0, 59, 0, 0, 60, 0, 0, 0, 61, 51, + 0, 0, 0, 0, 0, 62, 0, 0, 0, 0, + 0, 63, 64, 0, 0, 0, 0, 0, 0, 0, + 0, 138, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 65, 66, 0, 0, 0, 52, 67, 0, 53, + 0, 54, 55, 56, 57, 68, 69, 70, 59, 0, + 71, 60, 72, 0, 0, 61, 0, 0, 139, 0, + 0, 53, 62, 54, 55, 56, 57, 779, 63, 64, + 140, 0, 0, 60, 0, 0, 0, 61, 138, 0, + 0, 0, 0, 0, 62, 487, 0, 0, 65, 66, + 63, 64, 0, 0, 67, 0, 0, 0, 0, 0, + 51, 0, 68, 69, 70, 0, 0, 71, 0, 72, + 65, 66, 0, 0, 0, 139, 67, 0, 53, 0, + 54, 55, 56, 57, 141, 69, 70, 140, 0, 71, + 60, 72, 0, 0, 61, 0, 0, 52, 175, 176, + 53, 62, 54, 55, 56, 57, 0, 63, 64, 59, + 0, 0, 60, 0, 175, 176, 61, 0, 0, 0, + 0, 0, 0, 62, 0, 0, 0, 65, 66, 63, + 64, 0, 0, 67, 0, 0, 0, 0, 0, 0, + 0, 141, 69, 70, 57, 0, 71, 0, 72, 65, + 66, 0, 0, 0, 0, 67, 0, 0, 0, 0, + 57, 177, 178, 68, 69, 70, 0, 0, 71, 0, + 72, 0, 0, 0, 0, 0, 0, 177, 178, 0, + 0, 179, 180, 0, 181, 0, 0, 0, 0, 182, + 0, 183, 0, 0, 67, 0, 0, 179, 180, 0, + 181, 0, 798, 69, 0, 182, 1038, 183, 86, 87, + 67, 0, 0, 0, 0, 0, 88, 89, 798, 69, + 0, 0, 1040, 0, 0, 90, 0, 91, 92, 93, + 94, 0, 0, 0, 95, 0, 0, 0, 96, 0, + 0, 0, 97, 98, 99, 100, 101, 102, 0, 0, + 0, 0, 0, 103, 104, 105, 106, 0, 0, 0, + 0, 0, 107, 108, 86, 87, 109, 110, 0, 0, + 0, 111, 88, 89, 0, 0, 112, 113, 0, 114, + 0, 90, 0, 91, 92, 93, 94, 115, 0, 0, + 95, 0, 0, 0, 96, 0, 0, 0, 97, 98, + 99, 100, 101, 102, 116, 0, 521, 0, 0, 103, + 104, 105, 106, 0, 0, 0, 0, 0, 107, 108, + 86, 87, 109, 110, 0, 0, 0, 111, 88, 89, + 0, 0, 112, 113, 0, 114, 0, 90, 0, 91, + 92, 93, 94, 115, 0, 0, 95, 0, 0, 0, + 96, 0, 0, 0, 97, 98, 99, 100, 101, 102, + 116, 0, 626, 0, 0, 103, 104, 105, 106, 0, + 0, 0, 0, 0, 107, 108, 86, 87, 109, 110, + 0, 0, 0, 111, 88, 89, 0, 0, 112, 113, + 0, 114, 0, 90, 0, 91, 92, 93, 94, 115, + 0, 0, 95, 0, 0, 0, 96, 0, 0, 0, + 97, 98, 99, 100, 101, 102, 116, 0, 631, 0, + 0, 103, 104, 105, 106, 0, 0, 0, 0, 0, + 107, 108, 86, 87, 109, 110, 0, 0, 0, 111, + 88, 89, 0, 0, 112, 113, 0, 114, 0, 90, + 0, 91, 92, 93, 94, 115, 0, 0, 95, 0, + 0, 0, 96, 0, 0, 0, 97, 98, 99, 100, + 101, 102, 116, 0, 698, 0, 0, 103, 104, 105, + 106, 0, 0, 0, 0, 0, 107, 108, 86, 87, + 109, 110, 0, 0, 0, 111, 88, 89, 0, 0, + 112, 113, 0, 114, 0, 90, 0, 91, 92, 93, + 94, 115, 0, 0, 95, 0, 0, 0, 96, 0, + 0, 0, 97, 98, 99, 100, 101, 102, 116, 0, + 812, 0, 0, 103, 104, 105, 106, 0, 0, 0, + 0, 0, 107, 108, 86, 87, 109, 110, 0, 0, + 0, 111, 88, 89, 0, 0, 112, 113, 0, 114, + 0, 90, 0, 91, 92, 93, 94, 115, 0, 0, + 95, 0, 0, 0, 96, 0, 0, 0, 97, 98, + 99, 100, 101, 102, 116, 0, 1049, 0, 0, 103, + 104, 105, 106, 0, 0, 0, 0, 0, 107, 108, + 86, 87, 109, 110, 0, 0, 0, 111, 88, 89, + 0, 0, 112, 113, 0, 114, 0, 90, 0, 91, + 92, 93, 94, 115, 0, 0, 95, 0, 0, 0, + 96, 0, 0, 0, 97, 98, 99, 100, 101, 102, + 116, 0, 1144, 0, 0, 103, 104, 105, 106, 0, + 0, 0, 0, 0, 107, 108, 0, 87, 109, 110, + 0, 0, 0, 111, 88, 89, 0, 0, 112, 113, + 0, 114, 0, 0, 0, 91, 92, 93, 0, 0, + 0, 0, 0, 87, 0, 0, 249, 0, 0, 0, + 88, 89, 0, 0, 101, 0, 116, 0, 0, 0, + 0, 91, 92, 93, 106, 0, 0, 0, 0, 0, + 107, 0, 249, 0, 0, 110, 0, 0, 0, 0, + 101, 0, 0, 0, 112, 113, 87, 114, 0, 0, + 106, 0, 0, 88, 89, 0, 107, 0, 0, 0, + 109, 110, -136, 0, 91, 92, 93, 0, 0, 0, + 112, 113, 116, 114, 0, 249, 0, 0, 0, 0, + 0, 0, 87, 101, 259, 0, 0, 0, 0, 88, + 89, 0, 0, 106, 0, 0, 0, 0, 116, 107, + 91, 92, 93, 0, 110, 0, 0, 0, 0, 0, + 0, 249, 0, 0, 113, 0, 114, 0, 0, 101, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 106, + 0, 0, 0, 0, 0, 107, 0, 0, 0, 0, + 110, 116, 0, 0, 0, 0, 0, 0, 0, 0, + 113, 0, 114, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 116 }; static const yytype_int16 yycheck[] = { - 1, 381, 439, 128, 129, 130, 131, 474, 133, 108, - 135, 136, 137, 527, 28, 119, 58, 489, 45, 721, - 599, 28, 147, 148, 119, 216, 144, 152, 153, 588, - 119, 543, 12, 57, 548, 551, 56, 414, 229, 230, - 396, 553, 28, 265, 127, 46, 119, 6, 589, 8, - 277, 14, 61, 62, 496, 126, 615, 0, 10, 11, - 287, 45, 144, 146, 580, 581, 144, 583, 584, 585, - 586, 612, 73, 144, 12, 144, 87, 88, 16, 90, - 91, 92, 549, 144, 95, 552, 106, 145, 146, 100, - 669, 127, 14, 127, 105, 106, 130, 108, 109, 110, - 73, 112, 113, 144, 127, 119, 804, 805, 806, 130, - 146, 32, 119, 654, 144, 64, 65, 66, 498, 57, - 144, 70, 135, 146, 145, 126, 144, 128, 129, 130, - 131, 135, 133, 119, 135, 136, 137, 73, 21, 22, - 652, 93, 144, 127, 127, 144, 147, 148, 132, 32, - 134, 152, 153, 126, 626, 696, 129, 12, 135, 139, - 73, 16, 146, 146, 127, 149, 150, 151, 548, 273, - 32, 145, 146, 277, 130, 397, 692, 129, 273, 401, - 145, 146, 120, 287, 273, 212, 413, 146, 277, 145, - 126, 233, 126, 129, 319, 6, 134, 8, 287, 32, - 273, 139, 57, 144, 277, 127, 144, 127, 145, 788, - 432, 727, 589, 126, 287, 216, 129, 144, 167, 168, - 169, 170, 143, 144, 145, 127, 146, 228, 229, 230, - 231, 232, 233, 144, 706, 591, 237, 32, 249, 144, - 145, 708, 253, 128, 146, 130, 555, 289, 557, 558, - 559, 560, 561, 794, 137, 138, 139, 140, 141, 273, - 143, 144, 145, 277, 265, 120, 273, 129, 135, 127, - 277, 127, 221, 287, 126, 712, 128, 654, 130, 134, - 287, 127, 144, 145, 139, 144, 492, 273, 146, 129, - 146, 277, 241, 834, 500, 501, 502, 503, 504, 505, - 146, 287, 127, 127, 526, 777, 139, 140, 141, 413, - 143, 144, 145, 228, 229, 230, 231, 232, 319, 696, - 129, 146, 146, 127, 413, 127, 793, 127, 127, 796, - 797, 537, 144, 127, 335, 336, 126, 127, 380, 381, - 413, 855, 146, 144, 146, 787, 146, 146, 143, 144, - 145, 1049, 146, 1051, 791, 1053, 73, 144, 1056, 1057, - 1058, 6, 363, 8, 365, 366, 367, 368, 369, 144, - 87, 144, 127, 90, 127, 127, 93, 144, 379, 10, - 11, 382, 383, 127, 127, 127, 387, 429, 389, 127, - 699, 146, 109, 146, 146, 144, 397, 398, 129, 413, - 401, 129, 146, 146, 146, 611, 413, 144, 146, 410, - 145, 146, 618, 10, 11, 12, 638, 144, 145, 16, - 887, 126, 144, 128, 410, 130, 126, 413, 128, 430, - 130, 432, 474, 144, 126, 419, 128, 879, 130, 1141, - 882, 647, 73, 74, 144, 144, 145, 396, 363, 491, - 365, 366, 367, 368, 369, 146, 498, 834, 148, 127, - 57, 139, 93, 94, 379, 96, 145, 382, 383, 145, - 101, 129, 103, 474, 475, 855, 126, 1036, 128, 129, - 130, 135, 483, 21, 22, 123, 124, 125, 489, 126, - 146, 492, 144, 144, 32, 496, 93, 146, 128, 500, - 501, 502, 503, 504, 505, 506, 548, 549, 127, 145, - 552, 144, 145, 146, 1028, 146, 517, 144, 145, 146, - 94, 95, 96, 120, 146, 526, 144, 145, 146, 146, - 146, 146, 136, 2, 146, 136, 537, 134, 146, 10, - 11, 12, 139, 146, 146, 16, 532, 548, 549, 136, - 649, 552, 146, 146, 555, 146, 557, 558, 559, 560, - 561, 136, 146, 146, 146, 592, 593, 568, 483, 596, - 597, 40, 41, 42, 43, 44, 577, 1089, 47, 1046, - 139, 146, 73, 147, 126, 599, 57, 588, 589, 714, - 715, 813, 599, 127, 127, 10, 11, 127, 789, 137, - 138, 139, 140, 141, 127, 143, 144, 145, 144, 128, - 611, 612, 127, 599, 615, 144, 148, 618, 144, 1131, - 129, 92, 93, 144, 144, 626, 633, 144, 146, 57, - 144, 139, 148, 10, 11, 12, 126, 638, 649, 16, - 129, 10, 591, 10, 10, 656, 647, 10, 1028, 120, - 651, 128, 136, 654, 681, 669, 128, 127, 73, 74, - 148, 139, 669, 134, 650, 1132, 708, 147, 139, 1228, - 1229, 1230, 139, 144, 128, 128, 128, 128, 93, 94, - 57, 96, 151, 669, 147, 146, 101, 144, 103, 139, - 126, 1203, 148, 1135, 126, 696, 144, 681, 699, 144, - 144, 127, 145, 145, 127, 706, 127, 708, 1150, 1151, - 1152, 127, 130, 714, 715, 130, 93, 130, 32, 134, - 721, 135, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 120, 213, 144, 135, 135, 217, 144, - 135, 793, 1219, 144, 796, 797, 146, 134, 10, 146, - 146, 32, 139, 145, 1323, 127, 147, 144, 146, 148, - 4, 1330, 127, 144, 788, 148, 777, 10, 128, 10, - 1222, 788, 10, 10, 1226, 128, 787, 127, 789, 1231, - 1227, 144, 793, 794, 32, 796, 797, 804, 805, 806, - 146, 127, 788, 272, 148, 144, 147, 814, 146, 1276, - 147, 146, 813, 855, 147, 146, 148, 147, 1078, 1079, - 1080, 1081, 1082, 824, 1084, 139, 140, 141, 146, 143, - 144, 145, 135, 834, 146, 146, 1278, 146, 144, 823, - 135, 825, 135, 144, 135, 887, 1037, 127, 317, 46, - 877, 136, 146, 136, 838, 839, 840, 136, 842, 843, - 844, 845, 331, 332, 1306, 146, 137, 138, 139, 140, - 141, 68, 143, 144, 145, 136, 146, 144, 879, 126, - 1322, 882, 146, 80, 146, 10, 887, 146, 128, 10, - 79, 80, 128, 128, 10, 146, 128, 146, 6, 137, - 138, 139, 140, 141, 101, 143, 144, 145, 147, 146, - 10, 11, 127, 10, 111, 144, 146, 136, 144, 144, - 389, 144, 1182, 1183, 1184, 1185, 1186, 1187, 1188, 1189, - 1190, 1191, 1192, 1193, 1194, 1195, 1196, 1197, 1198, 1199, - 1200, 146, 50, 136, 141, 136, 143, 144, 146, 136, - 58, 16, 17, 18, 19, 20, 21, 22, 146, 428, - 68, 69, 70, 147, 32, 128, 10, 32, 1093, 10, - 11, 79, 441, 73, 74, 128, 144, 144, 144, 87, - 144, 146, 128, 128, 146, 1245, 1028, 146, 185, 97, - 991, 257, 713, 93, 94, 103, 96, 547, 1031, 1131, - 108, 101, 1089, 103, 1046, 73, 1203, 649, 277, 478, - 118, 650, 120, 1028, 824, 991, 855, 814, -1, 87, - 489, 532, 90, 336, -1, 93, -1, 1028, -1, 129, - -1, -1, 73, 74, -1, 1036, 1037, 145, 1298, -1, - -1, 109, 1049, -1, 1051, 1046, 1053, -1, -1, 1056, - 1057, 1058, 93, 94, -1, 96, 1083, -1, -1, -1, - 101, 258, 103, 260, 261, 262, 263, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, - 145, -1, 279, -1, -1, 126, 283, -1, -1, -1, - 1132, -1, 1093, 290, -1, 292, -1, -1, -1, 1083, - -1, -1, -1, 300, 301, -1, -1, 830, 577, -1, - -1, 300, 301, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 11, -1, -1, -1, - -1, 1132, -1, -1, 1135, -1, -1, -1, -1, 336, - 1141, 15, 16, 17, 18, 19, 20, 21, 22, 1150, - 1151, 1152, -1, -1, -1, -1, 625, 626, 32, -1, - -1, -1, 631, -1, -1, -1, 51, -1, 53, 54, - 55, -1, -1, -1, 1201, -1, -1, 1219, -1, -1, - -1, -1, -1, -1, 1168, 1169, 1170, 1171, 1172, 1173, - -1, -1, -1, 390, -1, 80, 81, -1, 387, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 677, 678, - 679, 680, -1, 682, -1, 100, 101, -1, 1219, -1, - -1, 1222, -1, -1, -1, 1226, -1, 1228, 1229, 1230, - 1231, 116, -1, -1, 1276, -1, 121, 706, -1, 436, - -1, 430, -1, 1270, 1271, -1, 1273, 1274, -1, -1, - -1, -1, 721, -1, 10, 11, -1, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, - 144, 145, -1, -1, 148, 1276, -1, 1278, -1, -1, - -1, -1, -1, -1, -1, -1, 1313, 1314, 1315, 1316, - -1, -1, 17, 18, 19, 20, 21, 22, -1, -1, - -1, -1, -1, 492, -1, 1306, -1, 32, 777, -1, - 779, 500, 501, 502, 503, 504, 505, 73, 74, -1, - -1, 1322, 1323, -1, -1, -1, -1, -1, -1, 1330, - 19, 20, 21, 22, 531, -1, 533, 93, 94, -1, - 96, -1, -1, 32, -1, 101, -1, 103, 537, -1, - 547, -1, -1, -1, -1, 1078, 1079, 1080, 1081, 1082, - -1, 1084, -1, -1, -1, -1, 555, -1, 557, 558, - 559, 560, 561, -1, -1, -1, 845, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, - 869, 870, 871, 872, 873, 874, 875, 876, -1, 878, - 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, - 145, -1, 611, -1, -1, -1, -1, -1, -1, 618, - -1, -1, -1, -1, -1, 3, 4, 5, 6, -1, - 8, 9, 10, 11, -1, -1, 135, 136, 137, 138, - 139, 140, 141, -1, 143, 144, 145, -1, 647, 1182, - 1183, 1184, 1185, 1186, 1187, 1188, 1189, 1190, 1191, 1192, - 1193, 1194, 1195, 1196, 1197, 1198, 1199, 1200, -1, 47, - 48, -1, -1, 51, -1, 53, 54, 55, 56, 57, - -1, 59, 60, -1, -1, 63, 64, -1, -1, 67, - -1, -1, -1, -1, 72, 73, 74, -1, -1, -1, - 699, -1, 80, 81, -1, -1, 713, -1, -1, -1, - -1, 89, 1245, 91, -1, 93, -1, -1, -1, -1, - 98, -1, 100, 101, 102, -1, -1, 105, 106, -1, - -1, -1, 110, -1, -1, 113, 114, 115, 116, -1, - -1, 119, 1021, 121, -1, -1, 3, 4, 5, 6, - -1, 8, 9, 10, 11, -1, 134, -1, -1, 137, - 138, 139, -1, -1, 142, 1298, 144, 145, -1, -1, - -1, 149, -1, 16, 17, 18, 19, 20, 21, 22, - -1, -1, -1, 790, -1, -1, -1, -1, -1, 32, - 47, -1, -1, -1, 51, -1, 53, 54, 55, -1, - 807, -1, 59, 810, 61, 62, 63, 64, -1, -1, - -1, -1, -1, -1, -1, 72, 73, 74, -1, -1, - 1099, -1, -1, 80, 81, -1, -1, -1, -1, -1, - -1, -1, 89, -1, 91, -1, 93, -1, -1, -1, - -1, 98, -1, 100, 101, 102, -1, -1, 105, -1, - -1, -1, -1, 110, -1, -1, 113, -1, -1, 116, - -1, -1, 1141, -1, 121, -1, -1, -1, -1, 126, - -1, -1, -1, -1, -1, -1, -1, 134, -1, -1, - 137, 138, 139, -1, -1, 142, -1, 144, 145, 132, - 133, 134, 149, -1, 137, 138, 139, 140, 141, -1, - 143, 144, 145, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 1202, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, -1, 1215, -1, -1, -1, - -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, -1, - -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, -1, 67, -1, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, -1, -1, -1, -1, -1, 87, 88, 89, - -1, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, -1, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, -1, -1, -1, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, -1, -1, -1, -1, -1, -1, -1, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, -1, -1, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, -1, 67, -1, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, -1, - -1, -1, -1, -1, 87, 88, 89, -1, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, -1, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - -1, -1, -1, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, -1, 148, 149, 3, 4, 5, + 1, 435, 381, 216, 538, 109, 266, 712, 413, 485, + 470, 28, 583, 28, 45, 57, 229, 230, 58, 396, + 593, 28, 128, 129, 130, 131, 12, 133, 523, 135, + 136, 137, 582, 56, 6, 606, 8, 120, 120, 127, + 120, 147, 148, 0, 14, 46, 152, 153, 543, 228, + 229, 230, 231, 232, 144, 73, 14, 492, 146, 609, + 144, 45, 795, 796, 797, 144, 546, 64, 65, 66, + 73, 73, 73, 70, 144, 549, 647, 551, 552, 553, + 554, 555, 127, 106, 544, 87, 73, 547, 90, 662, + 127, 93, 10, 11, 574, 575, 144, 577, 578, 579, + 580, 146, 144, 120, 126, 120, 32, 109, 126, 146, + 32, 129, 144, 120, 127, 494, 10, 11, 12, 127, + 144, 127, 16, 126, 135, 126, 129, 128, 129, 130, + 131, 126, 133, 146, 135, 136, 137, 397, 146, 126, + 146, 401, 129, 127, 620, 135, 147, 148, 132, 144, + 134, 152, 153, 139, 61, 62, 12, 127, 127, 144, + 16, 127, 146, 57, 543, 149, 150, 151, 428, 127, + 167, 168, 169, 170, 146, 93, 127, 146, 583, 130, + 146, 212, 130, 127, 363, 144, 365, 366, 367, 368, + 369, 274, 274, 233, 274, 278, 278, 145, 278, 93, + 379, 57, 146, 382, 383, 685, 779, 129, 585, 144, + 130, 129, 135, 319, 785, 216, 690, 143, 144, 145, + 144, 697, 144, 145, 221, 145, 120, 228, 229, 230, + 231, 232, 233, 144, 145, 146, 237, 127, 718, 699, + 134, 32, 647, 144, 241, 139, 10, 11, 12, 289, + 144, 127, 16, 10, 11, 127, 146, 274, 6, 274, + 8, 278, 522, 278, 120, 266, 127, 274, 12, 703, + 146, 278, 16, 144, 146, 87, 88, 89, 134, 91, + 92, 93, 135, 139, 96, 146, 144, 127, 144, 101, + 127, 129, 768, 57, 106, 107, 127, 109, 110, 111, + 479, 113, 114, 1036, 127, 1038, 146, 1040, 144, 146, + 1043, 1044, 1045, 57, 127, 146, 73, 74, 319, 127, + 10, 11, 144, 146, 784, 144, 127, 787, 788, 93, + 145, 146, 127, 146, 335, 336, 93, 94, 146, 96, + 380, 381, 127, 778, 101, 146, 103, 144, 782, 844, + 32, 146, 143, 144, 145, 127, 120, 123, 124, 125, + 144, 146, 363, 144, 365, 366, 367, 368, 369, 144, + 134, 32, 632, 129, 146, 139, 120, 128, 379, 130, + 129, 382, 383, 73, 74, 425, 387, 129, 389, 146, + 134, 144, 145, 410, 144, 139, 397, 398, 145, 396, + 401, 126, 127, 93, 94, 6, 96, 8, 144, 410, + 144, 101, 73, 103, 874, 145, 146, 126, 32, 128, + 1125, 130, 10, 11, 146, 426, 87, 428, 148, 90, + 470, 127, 93, 868, 418, 144, 871, 249, 139, 126, + 130, 128, 254, 130, 134, 145, 146, 487, 109, 126, + 145, 128, 129, 130, 494, 137, 138, 139, 140, 141, + 145, 143, 144, 145, 126, 844, 128, 126, 130, 470, + 471, 129, 126, 1023, 128, 135, 130, 144, 479, 144, + 145, 146, 145, 146, 485, 73, 74, 488, 94, 95, + 96, 492, 144, 145, 146, 496, 497, 498, 499, 500, + 501, 502, 144, 543, 544, 93, 94, 547, 96, 144, + 145, 528, 513, 101, 146, 103, 144, 145, 128, 127, + 1015, 522, 146, 146, 2, 139, 140, 141, 146, 143, + 144, 145, 533, 146, 146, 146, 136, 136, 136, 643, + 1074, 129, 543, 544, 804, 136, 547, 139, 549, 146, + 551, 552, 553, 554, 555, 586, 587, 146, 32, 590, + 591, 562, 40, 41, 42, 43, 44, 780, 32, 47, + 571, 146, 821, 1033, 146, 146, 593, 146, 593, 146, + 146, 582, 583, 146, 145, 488, 593, 146, 585, 147, + 73, 126, 144, 496, 497, 498, 499, 500, 501, 705, + 706, 127, 127, 127, 605, 606, 127, 148, 609, 128, + 127, 612, 144, 144, 129, 144, 144, 144, 57, 620, + 627, 139, 144, 146, 126, 129, 10, 644, 148, 10, + 533, 632, 10, 10, 128, 136, 1015, 127, 148, 128, + 641, 139, 139, 674, 645, 662, 647, 662, 147, 128, + 146, 128, 147, 128, 139, 662, 1116, 128, 144, 699, + 1210, 1211, 1212, 137, 138, 139, 140, 141, 126, 143, + 144, 145, 148, 151, 144, 139, 140, 141, 144, 143, + 144, 145, 144, 126, 1119, 145, 145, 127, 130, 690, + 674, 127, 127, 127, 144, 144, 697, 130, 699, 1134, + 1135, 1136, 605, 135, 705, 706, 135, 135, 135, 612, + 147, 712, 127, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 144, 213, 10, 146, 641, 217, + 146, 146, 1202, 145, 784, 146, 4, 787, 788, 148, + 144, 127, 148, 10, 1304, 128, 10, 10, 10, 128, + 127, 1311, 779, 146, 779, 21, 22, 768, 148, 1204, + 144, 146, 779, 1208, 144, 1209, 32, 778, 1213, 780, + 148, 147, 147, 784, 785, 146, 787, 788, 795, 796, + 797, 147, 146, 144, 147, 273, 146, 1257, 805, 146, + 146, 146, 135, 804, 844, 135, 135, 144, 135, 144, + 146, 1024, 136, 136, 815, 136, 1065, 1066, 1067, 1068, + 1069, 146, 1071, 136, 1259, 126, 146, 10, 11, 12, + 814, 643, 816, 16, 874, 866, 146, 649, 146, 317, + 146, 46, 10, 827, 828, 829, 128, 831, 832, 833, + 834, 10, 1287, 331, 332, 128, 128, 10, 128, 146, + 144, 144, 147, 68, 144, 146, 144, 868, 1303, 146, + 871, 146, 127, 874, 57, 80, 136, 146, 79, 80, + 146, 137, 138, 139, 140, 141, 136, 143, 144, 145, + 136, 136, 128, 10, 10, 146, 128, 102, 147, 146, + 144, 6, 144, 144, 144, 128, 128, 112, 146, 92, + 93, 389, 146, 542, 704, 258, 1018, 1166, 1167, 1168, + 1169, 1170, 1171, 1172, 1173, 1174, 1175, 1176, 1177, 1178, + 1179, 1180, 1181, 1182, 1183, 1184, 141, 120, 143, 144, + 1074, 643, 528, 1015, 278, 50, 424, 19, 20, 21, + 22, 134, 57, 58, 805, 644, 139, 844, 815, 437, + 32, 144, 278, 68, 69, 70, 278, -1, 978, -1, + -1, -1, 1078, 336, 79, 1015, -1, 978, 1227, -1, + 185, -1, 87, -1, -1, 16, 17, 18, 19, 20, + 21, 22, 97, 1033, -1, -1, 474, -1, 103, -1, + -1, 32, -1, 108, -1, -1, -1, 485, -1, -1, + -1, -1, -1, 118, 1015, 120, -1, -1, -1, -1, + -1, -1, 1023, 1024, -1, -1, -1, -1, -1, 1036, + 1279, 1038, 1033, 1040, -1, -1, 1043, 1044, 1045, 1070, + 145, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 259, -1, 261, 262, 263, 264, + -1, -1, -1, 135, 136, 137, 138, 139, 140, 141, + -1, 143, 144, 145, -1, 280, 1116, 1078, -1, 284, + -1, -1, -1, -1, -1, 290, 1070, 292, -1, -1, + -1, -1, -1, 571, -1, 300, 301, 10, 11, 300, + 301, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, -1, 143, 144, 145, 1116, -1, -1, 1119, -1, + -1, -1, -1, -1, 1125, 17, 18, 19, 20, 21, + 22, 336, -1, 1134, 1135, 1136, -1, -1, -1, -1, + 32, 619, 620, -1, -1, -1, -1, 625, 17, 18, + 19, 20, 21, 22, 1185, -1, -1, -1, -1, -1, + 73, 74, 1202, 32, -1, -1, -1, -1, 1152, 1153, + 1154, 1155, 1156, 1157, -1, -1, -1, -1, -1, -1, + 93, 94, -1, 96, -1, 390, 387, -1, 101, -1, + 103, -1, 670, 671, 672, 673, -1, 675, -1, -1, + -1, 1202, -1, 1204, -1, -1, -1, 1208, -1, 1210, + 1211, 1212, 1213, 126, -1, -1, -1, 1257, -1, 697, + 1251, 1252, -1, 1254, 1255, 426, -1, 432, -1, -1, + -1, -1, -1, -1, 712, -1, -1, 11, -1, -1, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + -1, 143, 144, 145, -1, -1, 1257, -1, 1259, -1, + -1, -1, -1, 1294, 1295, 1296, 1297, -1, 137, 138, + 139, 140, 141, -1, 143, 144, 145, 51, -1, 53, + 54, 55, -1, -1, -1, -1, 1287, 488, -1, -1, + 768, -1, 770, -1, -1, 496, 497, 498, 499, 500, + 501, -1, 1303, 1304, -1, -1, 80, 81, -1, -1, + 1311, 1065, 1066, 1067, 1068, 1069, -1, 1071, -1, -1, + -1, -1, 527, -1, 529, -1, 100, 101, -1, -1, + -1, -1, 533, -1, -1, -1, -1, 542, -1, -1, + -1, -1, 116, -1, -1, -1, -1, 121, 549, -1, + 551, 552, 553, 554, 555, -1, 834, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 845, 846, 847, + 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, -1, 867, + -1, -1, -1, 3, 4, 5, 6, -1, 8, 9, + 10, 11, -1, -1, 605, -1, -1, -1, -1, -1, + -1, 612, 1166, 1167, 1168, 1169, 1170, 1171, 1172, 1173, + 1174, 1175, 1176, 1177, 1178, 1179, 1180, 1181, 1182, 1183, + 1184, -1, -1, -1, -1, -1, -1, 47, 48, -1, + 641, 51, -1, 53, 54, 55, 56, 57, -1, 59, + 60, -1, -1, 63, 64, 21, 22, 67, -1, -1, + -1, -1, 72, 73, 74, -1, 32, -1, -1, -1, + 80, 81, 51, 1227, 53, 54, 55, -1, -1, 89, + -1, 91, -1, 93, 63, -1, -1, -1, 98, 690, + 100, 101, 102, -1, -1, 105, 106, 10, 11, 704, + 110, 80, 81, 113, 114, 115, 116, -1, -1, 119, + -1, 121, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 100, 101, -1, 134, 1279, -1, 137, 138, 139, + 1008, -1, 142, -1, 144, 145, -1, 116, -1, 149, + -1, -1, 121, -1, -1, -1, -1, 3, 4, 5, 6, -1, 8, 9, 10, 11, -1, -1, 14, -1, - -1, -1, -1, -1, 51, -1, 53, 54, 55, -1, - -1, -1, -1, -1, -1, -1, 63, -1, -1, 15, - 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, - -1, 47, 48, 80, 81, 51, 32, 53, 54, 55, - 56, 57, -1, 59, 60, -1, -1, 63, 64, -1, - -1, 67, -1, 100, 101, -1, 72, 73, 74, -1, - -1, -1, -1, -1, 80, 81, -1, -1, -1, 116, - -1, -1, -1, 89, 121, 91, -1, 93, -1, -1, - -1, 97, 98, -1, 100, 101, 102, -1, -1, 105, - 106, -1, -1, -1, 110, -1, -1, 113, 114, 115, - 116, -1, -1, 119, -1, 121, 3, 4, 5, 6, - -1, 8, 9, 10, 11, -1, -1, 14, 134, -1, + 73, 74, -1, -1, -1, 144, -1, -1, -1, -1, + -1, 137, 138, 139, 140, 141, 781, 143, 144, 145, + 93, 94, -1, 96, -1, -1, -1, -1, 101, -1, + 103, 47, 48, 798, -1, 51, 801, 53, 54, 55, + 56, 57, -1, 59, 60, -1, 1084, 63, 64, -1, + -1, 67, -1, 126, -1, -1, 72, 73, 74, -1, + -1, -1, -1, -1, 80, 81, 51, -1, 53, 54, + 55, -1, -1, 89, -1, 91, -1, 93, 63, -1, + -1, 97, 98, -1, 100, 101, 102, 1125, -1, 105, + 106, -1, -1, -1, 110, 80, 81, 113, 114, 115, + 116, -1, -1, 119, -1, 121, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 100, 101, -1, 134, -1, -1, 137, 138, -1, -1, -1, 142, -1, 144, -1, - -1, -1, -1, 149, -1, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, - 47, 48, 148, -1, 51, -1, 53, 54, 55, 56, - 57, -1, 59, 60, -1, -1, 63, 64, -1, -1, - 67, -1, -1, -1, -1, 72, 73, 74, -1, -1, - -1, -1, -1, 80, 81, -1, -1, -1, -1, -1, - -1, -1, 89, -1, 91, -1, 93, -1, -1, -1, - 97, 98, -1, 100, 101, 102, -1, -1, 105, 106, - -1, -1, -1, 110, -1, -1, 113, 114, 115, 116, - -1, -1, 119, -1, 121, 3, 4, 5, 6, -1, - 8, 9, 10, 11, -1, 10, 11, 134, -1, -1, - 137, 138, -1, -1, -1, 142, -1, 144, -1, -1, - -1, -1, 149, 17, 18, 19, 20, 21, 22, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 32, 47, - -1, -1, -1, 51, -1, 53, 54, 55, -1, -1, - -1, 59, -1, -1, -1, 63, 64, -1, -1, -1, - -1, -1, -1, -1, 72, 73, 74, -1, 73, 74, - -1, -1, 80, 81, -1, -1, -1, -1, -1, -1, - -1, 89, -1, 91, -1, 93, -1, -1, 93, 94, - 98, 96, 100, 101, 102, -1, 101, 105, 103, 10, - 11, -1, 110, -1, -1, 113, -1, -1, 116, 3, - 4, 5, 6, 121, 8, 9, 10, 11, -1, -1, - -1, 126, -1, -1, -1, -1, 134, -1, -1, 137, - 138, 139, -1, -1, 142, -1, 144, 145, 146, 133, - 134, 149, -1, 137, 138, 139, 140, 141, -1, 143, - 144, 145, -1, 47, -1, -1, -1, 51, -1, 53, - 54, 55, 73, 74, -1, 59, -1, -1, -1, 63, + -1, 116, -1, 149, -1, -1, 121, -1, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 1186, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 1198, -1, -1, -1, -1, -1, -1, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, -1, -1, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, -1, -1, -1, + -1, -1, 87, 88, 89, -1, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, -1, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, -1, -1, + -1, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, -1, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, -1, -1, -1, + -1, -1, -1, -1, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, + -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, -1, -1, -1, -1, -1, 87, + 88, 89, -1, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, -1, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, -1, -1, -1, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, -1, + 148, 149, 3, 4, 5, 6, -1, 8, 9, 10, + 11, -1, -1, 14, -1, -1, -1, -1, -1, 51, + -1, 53, 54, 55, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 15, 16, 17, 18, 19, 20, + 21, 22, -1, -1, -1, -1, 47, 48, 80, 81, + 51, 32, 53, 54, 55, 56, 57, -1, 59, 60, + -1, -1, 63, 64, -1, -1, 67, -1, 100, 101, + -1, 72, 73, 74, -1, -1, -1, -1, -1, 80, + 81, -1, -1, -1, 116, -1, -1, -1, 89, 121, + 91, -1, 93, -1, -1, -1, 97, 98, -1, 100, + 101, 102, -1, -1, 105, 106, -1, -1, -1, 110, + -1, -1, 113, 114, 115, 116, -1, -1, 119, -1, + 121, 3, 4, 5, 6, -1, 8, 9, 10, 11, + -1, 10, 11, 134, -1, -1, 137, 138, -1, -1, + -1, 142, -1, 144, -1, -1, -1, -1, 149, -1, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, -1, 143, 144, 145, 47, -1, 148, -1, 51, + -1, 53, 54, 55, -1, -1, -1, 59, -1, 61, + 62, 63, 64, 51, -1, 53, 54, 55, -1, -1, + 72, 73, 74, -1, 73, 74, -1, -1, 80, 81, + -1, -1, -1, -1, -1, -1, -1, 89, -1, 91, + -1, 93, 80, 81, 93, 94, 98, 96, 100, 101, + 102, -1, 101, 105, 103, -1, -1, -1, 110, 10, + 11, 113, 100, 101, 116, 3, 4, 5, 6, 121, + 8, 9, 10, 11, 126, -1, -1, 126, 116, -1, + -1, -1, 134, 121, -1, 137, 138, 139, -1, -1, + 142, -1, 144, 145, -1, -1, -1, 149, -1, -1, + 51, -1, 53, 54, 55, -1, 144, -1, -1, 47, + -1, -1, 63, 51, -1, 53, 54, 55, -1, -1, + -1, 59, -1, 74, -1, 63, 64, -1, -1, 80, + 81, -1, -1, -1, 72, 73, 74, -1, -1, -1, + -1, -1, 80, 81, 51, -1, 53, 54, 55, 100, + 101, 89, -1, 91, -1, 93, -1, -1, -1, -1, + 98, -1, 100, 101, 102, 116, -1, 105, 119, -1, + 121, -1, 110, 80, 81, 113, -1, -1, 116, 3, + 4, 5, 6, 121, 8, 9, 10, 11, -1, 10, + 11, -1, -1, 100, 101, -1, 134, -1, -1, 137, + 138, 139, -1, -1, 142, -1, 144, 145, 146, 116, + -1, 149, -1, -1, 121, -1, -1, -1, -1, -1, + -1, -1, -1, 47, -1, -1, -1, 51, -1, 53, + 54, 55, -1, -1, -1, 59, -1, 144, -1, 63, 64, 51, -1, 53, 54, 55, -1, -1, 72, 73, - 74, -1, 93, 94, -1, 96, 80, 81, -1, -1, - 101, -1, 103, -1, -1, 89, -1, 91, -1, 93, - 80, 81, -1, -1, 98, -1, 100, 101, 102, -1, - -1, 105, -1, -1, -1, 126, 110, 10, 11, 113, + 74, -1, 73, 74, -1, -1, 80, 81, -1, -1, + -1, -1, -1, -1, -1, 89, -1, 91, -1, 93, + 80, 81, 93, 94, 98, 96, 100, 101, 102, -1, + 101, 105, 103, 10, 11, -1, 110, -1, -1, 113, 100, 101, 116, 3, 4, 5, 6, 121, 8, 9, 10, 11, 126, -1, -1, -1, 116, -1, -1, -1, 134, 121, -1, 137, 138, 139, -1, -1, 142, -1, - 144, 145, -1, -1, -1, 149, -1, -1, 51, -1, - 53, 54, 55, -1, 144, -1, -1, 47, -1, -1, - 63, 51, -1, 53, 54, 55, -1, -1, -1, 59, - -1, 74, -1, 63, 64, -1, -1, 80, 81, -1, - -1, -1, 72, 73, 74, -1, -1, -1, -1, -1, - 80, 81, 51, -1, 53, 54, 55, 100, 101, 89, - -1, 91, -1, 93, 63, -1, -1, -1, 98, -1, - 100, 101, 102, 116, -1, 105, 119, -1, 121, -1, - 110, 80, 81, 113, -1, -1, 116, 3, 4, 5, + 144, 145, -1, -1, -1, 149, -1, -1, -1, -1, + -1, -1, -1, -1, 144, -1, -1, 47, -1, -1, + -1, 51, -1, 53, 54, 55, 73, 74, -1, 59, + -1, -1, -1, 63, 64, -1, -1, -1, -1, -1, + -1, 88, 72, 73, 74, -1, 93, 94, -1, 96, + 80, 81, -1, -1, 101, -1, 103, -1, -1, 89, + -1, 91, -1, 93, -1, -1, -1, -1, 98, -1, + 100, 101, 102, -1, -1, 105, -1, -1, -1, -1, + 110, -1, -1, 113, -1, -1, 116, 3, 4, 5, 6, 121, 8, 9, 10, 11, -1, -1, -1, -1, - -1, 100, 101, -1, 134, -1, -1, 137, 138, 139, - -1, -1, 142, -1, 144, 145, 146, 116, -1, 149, - -1, -1, 121, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 134, -1, -1, 137, 138, 139, + -1, -1, 142, -1, 144, 145, 146, -1, -1, 149, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 47, -1, -1, -1, 51, -1, 53, 54, 55, - -1, -1, -1, 59, -1, 144, -1, 63, 64, 51, - -1, 53, 54, 55, -1, -1, 72, 73, 74, -1, - -1, -1, -1, -1, 80, 81, 51, -1, 53, 54, - 55, -1, -1, 89, -1, 91, -1, 93, 80, 81, + -1, -1, -1, 59, -1, -1, -1, 63, 64, -1, + -1, -1, -1, -1, -1, -1, 72, 73, 74, -1, + -1, -1, -1, -1, 80, 81, -1, -1, -1, -1, + -1, -1, -1, 89, -1, 91, -1, 93, -1, -1, -1, -1, 98, -1, 100, 101, 102, -1, -1, 105, - -1, 10, 11, -1, 110, 80, 81, 113, 100, 101, + -1, -1, -1, -1, 110, -1, -1, 113, -1, -1, 116, 3, 4, 5, 6, 121, 8, 9, 10, 11, - 126, -1, -1, -1, 116, 100, 101, -1, 134, 121, + 126, -1, -1, -1, -1, -1, -1, -1, 134, -1, -1, 137, 138, 139, -1, -1, 142, -1, 144, 145, - -1, 116, -1, 149, -1, -1, 121, -1, -1, -1, - -1, -1, 144, -1, -1, 47, -1, -1, -1, 51, - -1, 53, 54, 55, 73, 74, -1, 59, -1, 144, - -1, 63, 64, 51, -1, 53, 54, 55, -1, 88, - 72, 73, 74, -1, 93, 94, -1, 96, 80, 81, - -1, -1, 101, -1, 103, -1, -1, 89, -1, 91, - -1, 93, 80, 81, -1, -1, 98, -1, 100, 101, + -1, -1, -1, 149, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 47, -1, -1, -1, 51, + -1, 53, 54, 55, -1, -1, -1, 59, -1, -1, + -1, 63, 64, -1, -1, -1, -1, -1, -1, -1, + 72, 73, 74, -1, -1, -1, -1, -1, 80, 81, + -1, -1, -1, -1, -1, -1, -1, 89, -1, 91, + -1, 93, -1, -1, -1, -1, 98, -1, 100, 101, 102, -1, -1, 105, -1, -1, -1, -1, 110, -1, - -1, 113, 100, 101, 116, 3, 4, 5, 6, 121, - 8, 9, 10, 11, -1, -1, -1, -1, 116, -1, - -1, -1, 134, 121, -1, 137, 138, 139, -1, -1, + -1, 113, -1, -1, 116, 3, 4, 5, 6, 121, + 8, 9, 10, 11, -1, -1, -1, -1, -1, -1, + -1, -1, 134, -1, -1, 137, 138, 139, -1, -1, 142, -1, 144, 145, 146, -1, -1, 149, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 47, -1, -1, -1, 51, -1, 53, 54, 55, -1, -1, -1, 59, -1, -1, -1, 63, 64, -1, -1, -1, - -1, -1, -1, -1, 72, 73, 74, -1, -1, -1, - -1, -1, 80, 81, -1, -1, -1, -1, -1, -1, - -1, 89, -1, 91, -1, 93, -1, -1, -1, -1, + -1, -1, -1, -1, 72, 73, 74, 19, 20, 21, + 22, -1, 80, 81, -1, -1, 10, 11, -1, -1, + 32, 89, -1, 91, -1, 93, -1, -1, -1, -1, 98, -1, 100, 101, 102, -1, -1, 105, -1, -1, -1, -1, 110, -1, -1, 113, -1, -1, 116, 3, 4, 5, 6, 121, 8, 9, 10, -1, -1, -1, - -1, -1, -1, 10, 11, -1, 134, -1, -1, 137, - 138, 139, -1, -1, 142, -1, 144, 145, -1, -1, - -1, 149, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 47, -1, -1, -1, -1, -1, -1, - -1, 48, -1, -1, 51, 59, 53, 54, 55, 56, - 64, -1, -1, 60, -1, -1, 63, -1, 72, 73, - 67, -1, -1, -1, -1, -1, -1, 74, 0, -1, - -1, -1, -1, 80, 81, -1, -1, 91, -1, 93, - -1, -1, -1, -1, 98, -1, -1, -1, 102, -1, - -1, 105, -1, 100, 101, -1, 110, -1, -1, 106, - -1, -1, -1, -1, -1, -1, -1, 114, 115, 116, - -1, -1, 119, -1, 121, -1, -1, 49, 50, -1, - 134, -1, -1, 137, 138, 139, 58, -1, 142, -1, - 144, 145, -1, -1, 66, 149, 68, 69, 70, 71, - -1, -1, -1, 75, -1, -1, -1, 79, -1, -1, - -1, 83, 84, 85, 86, 87, 88, 19, 20, 21, - 22, -1, 94, 95, 96, 97, -1, -1, -1, -1, - 32, 103, 104, -1, -1, 107, 108, -1, -1, -1, - 112, -1, -1, -1, -1, 117, 118, -1, 120, 6, - -1, -1, -1, -1, -1, -1, 128, -1, 15, 16, - 17, 18, 19, 20, 21, 22, -1, 10, 11, -1, - -1, -1, -1, 145, -1, 32, -1, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 15, - 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, - -1, -1, -1, -1, -1, 62, 32, -1, -1, -1, - -1, -1, -1, 56, -1, -1, -1, -1, -1, -1, + -1, -1, 56, -1, -1, -1, 134, -1, -1, 137, + 138, 139, -1, -1, 142, -1, 144, 145, -1, 73, + 74, 149, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 47, -1, -1, -1, -1, -1, 93, + 94, 95, 96, 10, 11, 59, -1, 101, -1, 103, + 64, -1, 106, -1, -1, -1, -1, -1, 72, 73, + 114, 115, -1, -1, 118, 137, 138, 139, 140, 141, + -1, 143, 144, 145, -1, -1, -1, 91, -1, 93, + -1, -1, -1, 0, 98, -1, -1, -1, 102, 56, + -1, 105, -1, -1, -1, -1, 110, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 73, 74, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 73, 74, 89, -1, -1, 137, 138, 139, 140, 141, - -1, 143, 144, 145, -1, -1, -1, -1, -1, -1, - 93, 94, -1, 96, -1, -1, -1, -1, 101, -1, - 103, -1, -1, 106, -1, -1, -1, -1, -1, -1, - 127, 114, 115, 130, -1, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, -1, 144, 145, 10, - 11, -1, 149, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, - 10, 11, 148, -1, -1, -1, -1, 48, -1, -1, - 51, -1, 53, 54, 55, 56, 57, -1, -1, 60, - -1, -1, 63, -1, -1, -1, 67, -1, -1, -1, - -1, -1, -1, 74, -1, -1, -1, -1, 48, 80, - 81, 51, -1, 53, 54, 55, 56, 57, -1, -1, - 60, 92, -1, 63, -1, -1, -1, 67, -1, 100, - 101, -1, -1, -1, 74, 106, -1, -1, -1, -1, - 80, 81, -1, 114, 115, 116, 10, 11, 119, -1, - 121, -1, 92, -1, -1, 126, -1, -1, -1, -1, - 100, 101, -1, -1, -1, -1, 106, -1, -1, -1, - -1, 142, -1, -1, 114, 115, 116, -1, -1, 119, - -1, 121, -1, -1, 48, -1, -1, 51, -1, 53, - 54, 55, 56, 57, -1, -1, 60, -1, -1, 63, - -1, -1, 142, 67, -1, -1, -1, -1, -1, -1, - 74, -1, -1, -1, -1, -1, 80, 81, 15, 16, - 17, 18, 19, 20, 21, 22, -1, -1, 92, -1, - -1, -1, -1, -1, -1, 32, 100, 101, -1, -1, - -1, -1, 106, -1, -1, -1, -1, -1, -1, -1, - 114, 115, 116, -1, -1, 119, -1, 121, 15, 16, - 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 32, -1, -1, 142, 15, - 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 32, 15, 16, 17, - 18, 19, 20, 21, 22, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 32, 15, 16, 17, 18, 19, - 20, 21, 22, -1, -1, -1, -1, -1, -1, -1, - 127, -1, 32, -1, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, + 134, -1, -1, 137, 138, 139, 93, 94, 142, 96, + 144, 145, 49, 50, 101, 149, 103, -1, -1, 106, + 57, 58, -1, -1, -1, -1, -1, 114, 115, 66, + -1, 68, 69, 70, 71, -1, -1, -1, 75, -1, + -1, -1, 79, -1, -1, -1, 83, 84, 85, 86, + 87, 88, -1, -1, -1, -1, -1, 94, 95, 96, + 97, -1, -1, -1, -1, -1, 103, 104, -1, -1, + 107, 108, -1, -1, -1, 112, -1, -1, -1, -1, + 117, 118, -1, 120, 6, -1, -1, -1, -1, -1, + -1, 128, -1, 15, 16, 17, 18, 19, 20, 21, + 22, -1, -1, -1, -1, -1, -1, -1, 145, -1, + 32, -1, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 15, 16, 17, 18, 19, 20, + 21, 22, -1, -1, -1, -1, -1, -1, -1, -1, + 62, 32, 15, 16, 17, 18, 19, 20, 21, 22, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, + -1, -1, -1, -1, -1, -1, -1, 89, -1, -1, + -1, -1, -1, 16, 17, 18, 19, 20, 21, 22, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 127, -1, -1, 130, -1, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, -1, 144, 145, -1, -1, -1, 149, -1, -1, + -1, -1, -1, -1, -1, 10, 11, -1, -1, -1, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, -1, 143, 144, 145, -1, -1, 148, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, + 143, 144, 145, 48, -1, 148, 51, -1, 53, 54, + 55, 56, -1, -1, -1, 60, -1, -1, 63, 132, + 133, 134, 67, -1, 137, 138, 139, 140, 141, 74, + 143, 144, 145, -1, -1, 80, 81, -1, -1, 10, + 11, -1, -1, -1, -1, -1, -1, 92, -1, -1, + -1, -1, -1, -1, -1, 100, 101, -1, -1, -1, + -1, 106, -1, -1, -1, -1, -1, -1, -1, 114, + 115, 116, -1, -1, 119, -1, 121, 48, -1, -1, + 51, 126, 53, 54, 55, 56, -1, -1, -1, 60, + -1, -1, 63, -1, -1, -1, 67, 142, -1, -1, + -1, -1, -1, 74, -1, -1, -1, -1, -1, 80, + 81, 10, 11, -1, -1, -1, -1, -1, -1, -1, + -1, 92, -1, -1, -1, -1, -1, -1, -1, 100, + 101, -1, -1, -1, -1, 106, -1, -1, -1, -1, + -1, -1, -1, 114, 115, 116, -1, -1, 119, 48, + 121, -1, 51, -1, 53, 54, 55, 56, -1, -1, + -1, 60, -1, -1, 63, -1, -1, -1, 67, -1, + -1, 142, -1, -1, -1, 74, -1, -1, -1, -1, + -1, 80, 81, 15, 16, 17, 18, 19, 20, 21, + 22, -1, -1, 92, -1, -1, -1, -1, -1, -1, + 32, 100, 101, -1, -1, -1, -1, 106, -1, -1, + -1, -1, -1, -1, -1, 114, 115, 116, -1, -1, + 119, -1, 121, 15, 16, 17, 18, 19, 20, 21, + 22, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 32, -1, -1, 142, 15, 16, 17, 18, 19, 20, + 21, 22, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 32, 15, 16, 17, 18, 19, 20, 21, 22, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 32, -1, -1, - -1, -1, -1, -1, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, - -1, -1, -1, -1, -1, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, - 146, -1, -1, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, - -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, -1, 143, 144, 145, 146, 15, 16, 17, - 18, 19, 20, 21, 22, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 32, -1, 131, 132, 133, 134, + -1, -1, -1, -1, -1, 127, -1, 32, -1, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + -1, 143, 144, 145, 146, 15, 16, 17, 18, 19, + 20, 21, 22, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 32, -1, -1, -1, -1, -1, -1, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + -1, 143, 144, 145, 146, -1, -1, -1, -1, -1, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, -1, 143, 144, 145, 146, -1, -1, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, + 143, 144, 145, 146, -1, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, - -1, 15, 16, 17, 18, 19, 20, 21, 22, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 32, 15, - 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 32, 15, 16, 17, + -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, -1, 143, 144, 145, 146, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 32, -1, -1, -1, -1, -1, - -1, 129, -1, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, -1, 143, 144, 145, -1, 15, - 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, - -1, -1, -1, -1, -1, 128, 32, -1, 131, 132, + -1, -1, -1, -1, 32, -1, 15, 16, 17, 18, + 19, 20, 21, 22, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 32, 15, 16, 17, 18, 19, 20, + 21, 22, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 32, 15, 16, 17, 18, 19, 20, 21, 22, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, + -1, -1, -1, -1, -1, -1, 129, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, - 143, 144, 145, 127, -1, -1, -1, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, -1, 143, - 144, 145, -1, 129, -1, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, - -1, -1, -1, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, -1, 143, 144, 145, 15, 16, - 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 32, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, -1, 143, 144, 145, - 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 32, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 17, 18, 19, 20, 21, 22, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 32, -1, -1, - 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 32, -1, -1, -1, -1, - -1, -1, 129, -1, 131, 132, 133, 134, -1, -1, - 137, 138, 139, 140, 141, -1, 143, 144, 145, -1, - -1, -1, -1, -1, 11, -1, -1, 14, -1, 16, - -1, -1, -1, -1, -1, -1, 17, 18, 19, 20, - 21, 22, -1, -1, -1, -1, 131, 132, 133, 134, - -1, 32, 137, 138, 139, 140, 141, -1, 143, 144, - 145, 48, -1, -1, 51, -1, 53, 54, 55, 56, - 57, -1, -1, 60, -1, -1, 63, 132, 133, 134, - 67, -1, 137, 138, 139, 140, 141, 74, 143, 144, - 145, -1, -1, 80, 81, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, -1, 143, 144, 145, -1, - 97, -1, -1, 100, 101, 10, 11, -1, -1, 106, - 17, 18, 19, 20, 21, 22, -1, 114, 115, 116, - -1, -1, 119, -1, 121, 32, 17, 18, 19, 20, - 21, 22, -1, -1, -1, -1, -1, 134, -1, -1, - -1, 32, 139, 134, 135, 136, 137, 138, 139, 140, - 141, 56, 143, 144, 145, 17, 18, 19, 20, 21, - 22, -1, -1, -1, -1, -1, -1, -1, 73, 74, + 143, 144, 145, -1, 15, 16, 17, 18, 19, 20, + 21, 22, -1, -1, -1, -1, -1, -1, -1, -1, + 128, 32, -1, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, -1, 143, 144, 145, 127, -1, + -1, -1, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, -1, 143, 144, 145, -1, 129, -1, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, -1, 143, 144, 145, -1, -1, -1, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, + 143, 144, 145, 15, 16, 17, 18, 19, 20, 21, + 22, -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 93, 94, - 95, 96, -1, -1, -1, -1, 101, -1, 103, -1, - -1, 106, -1, -1, -1, -1, -1, -1, -1, 114, - 115, -1, -1, 118, -1, -1, 10, 11, -1, -1, - -1, -1, -1, -1, -1, -1, 133, 134, 135, 136, - 137, 138, 139, 140, 141, -1, 143, 144, 145, -1, - -1, -1, -1, 134, -1, -1, 137, 138, 139, 140, - 141, -1, 143, 144, 145, -1, -1, 51, -1, 53, - 54, 55, 56, 57, -1, -1, -1, -1, -1, 63, - -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, - 74, 143, 144, 145, -1, -1, 80, 81, -1, 11, - -1, -1, 14, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 100, 101, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 114, -1, 116, -1, -1, 119, 48, 121, -1, 51, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, -1, 143, 144, 145, 15, 16, 17, 18, 19, + 20, 21, 22, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 32, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 17, 18, 19, + 20, 21, 22, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 32, -1, 17, 18, 19, 20, 21, 22, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, + -1, -1, -1, -1, -1, -1, -1, 129, -1, 131, + 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, + -1, 143, 144, 145, -1, -1, -1, -1, -1, 11, + -1, -1, 14, -1, 16, -1, -1, -1, -1, -1, + -1, 17, 18, 19, 20, 21, 22, -1, -1, -1, + -1, 131, 132, 133, 134, -1, 32, 137, 138, 139, + 140, 141, -1, 143, 144, 145, 48, -1, -1, 51, -1, 53, 54, 55, 56, 57, -1, -1, 60, -1, - -1, 63, -1, -1, -1, 67, -1, -1, -1, -1, - -1, -1, 74, -1, -1, -1, -1, -1, 80, 81, - -1, 11, -1, -1, 14, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 97, -1, -1, 100, 101, - -1, -1, -1, -1, 106, -1, -1, -1, -1, -1, - -1, -1, 114, 115, 116, -1, -1, 119, 48, 121, - -1, 51, -1, 53, 54, 55, 56, 57, -1, -1, - 60, -1, -1, 63, -1, -1, -1, 67, -1, -1, - -1, -1, -1, -1, 74, -1, -1, -1, -1, -1, - 80, 81, -1, 11, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 97, -1, -1, - 100, 101, -1, -1, -1, 11, 106, -1, -1, -1, - -1, -1, -1, -1, 114, 115, 116, -1, -1, 119, - 48, 121, -1, 51, -1, 53, 54, 55, 56, 57, - -1, -1, 60, -1, -1, 63, -1, -1, -1, 67, - -1, -1, 48, -1, -1, 51, 74, 53, 54, 55, - 56, 57, 80, 81, 60, -1, -1, 63, -1, -1, - -1, 67, -1, -1, -1, -1, -1, -1, 74, 97, - -1, -1, 100, 101, 80, 81, -1, 11, 106, -1, - -1, -1, -1, -1, -1, -1, 114, 115, 116, -1, - -1, 119, -1, 121, 100, 101, -1, -1, -1, -1, - 106, -1, -1, -1, -1, -1, -1, -1, 114, 115, - 116, -1, -1, 119, 48, 121, -1, 51, -1, 53, - 54, 55, 56, 57, -1, -1, 60, -1, -1, 63, - -1, -1, -1, 67, 11, -1, -1, -1, -1, -1, - 74, -1, -1, -1, -1, -1, 80, 81, -1, -1, - -1, -1, -1, -1, -1, -1, 11, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 100, 101, -1, -1, - -1, 48, 106, -1, 51, -1, 53, 54, 55, 56, - 114, 115, 116, 60, -1, 119, 63, 121, -1, -1, - 67, -1, -1, 48, -1, -1, 51, 74, 53, 54, - 55, 56, 57, 80, 81, 60, -1, -1, 63, -1, - -1, -1, 67, 11, -1, -1, -1, -1, -1, 74, - 97, -1, -1, 100, 101, 80, 81, -1, -1, 106, - -1, -1, -1, -1, -1, 11, -1, 114, 115, 116, - -1, -1, 119, -1, 121, 100, 101, -1, -1, -1, - 48, 106, -1, 51, -1, 53, 54, 55, 56, 114, - 115, 116, 60, -1, 119, 63, 121, -1, -1, 67, - -1, -1, 48, 10, 11, 51, 74, 53, 54, 55, - 56, -1, 80, 81, 60, -1, -1, 63, -1, 10, - 11, 67, -1, -1, -1, -1, -1, -1, 74, -1, - -1, -1, 100, 101, 80, 81, -1, -1, 106, -1, - -1, -1, -1, -1, -1, -1, 114, 115, 116, 56, - -1, 119, -1, 121, 100, 101, -1, -1, 10, 11, - 106, -1, -1, -1, -1, 56, 73, 74, 114, 115, - 116, -1, -1, 119, -1, 121, -1, -1, -1, -1, - -1, -1, 73, 74, -1, -1, 93, 94, -1, 96, - -1, -1, -1, -1, 101, -1, 103, -1, -1, 106, - -1, -1, 93, 94, 56, 96, -1, 114, 115, -1, - 101, 118, 103, -1, -1, 106, -1, -1, -1, -1, - -1, 73, 74, 114, 115, -1, -1, 118, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, - -1, 93, 94, -1, 96, -1, -1, 58, -1, 101, - -1, 103, -1, -1, 106, 66, -1, 68, 69, 70, - 71, -1, 114, 115, 75, -1, 118, -1, 79, -1, + -1, 63, 132, 133, 134, 67, -1, 137, 138, 139, + 140, 141, 74, 143, 144, 145, -1, -1, 80, 81, + 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, + 143, 144, 145, -1, -1, 97, -1, -1, 100, 101, + 10, 11, -1, -1, 106, 17, 18, 19, 20, 21, + 22, -1, 114, 115, 116, -1, -1, 119, -1, 121, + 32, 17, 18, 19, 20, 21, 22, -1, -1, -1, + -1, -1, 134, -1, -1, -1, 32, 139, 134, 135, + 136, 137, 138, 139, 140, 141, 56, 143, 144, 145, + 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, + -1, -1, -1, 73, 74, 32, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 93, 94, -1, 96, -1, -1, -1, + -1, 101, -1, 103, -1, -1, 106, -1, -1, -1, + -1, -1, -1, -1, 114, 115, -1, -1, 118, -1, + -1, 10, 11, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 135, 136, 137, 138, 139, 140, 141, + -1, 143, 144, 145, -1, -1, -1, 133, 134, -1, + -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, + -1, -1, 51, -1, 53, 54, 55, 56, 57, -1, + -1, -1, -1, -1, 63, -1, -1, 134, -1, -1, + 137, 138, 139, 140, 141, 74, 143, 144, 145, -1, + -1, 80, 81, -1, 11, -1, -1, 14, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 100, 101, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 114, -1, 116, -1, -1, + 119, 48, 121, -1, 51, -1, 53, 54, 55, 56, + 57, -1, -1, 60, -1, -1, 63, -1, -1, -1, + 67, -1, -1, -1, -1, -1, -1, 74, -1, -1, + -1, -1, -1, 80, 81, -1, 11, -1, -1, 14, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 97, -1, -1, 100, 101, -1, -1, -1, -1, 106, + -1, -1, -1, -1, -1, -1, -1, 114, 115, 116, + -1, -1, 119, 48, 121, -1, 51, -1, 53, 54, + 55, 56, 57, -1, -1, 60, -1, -1, 63, -1, + -1, -1, 67, -1, -1, -1, -1, -1, -1, 74, + -1, -1, -1, -1, -1, 80, 81, -1, 11, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 97, -1, -1, 100, 101, -1, -1, -1, + 11, 106, -1, -1, -1, -1, -1, -1, -1, 114, + 115, 116, -1, -1, 119, 48, 121, -1, 51, -1, + 53, 54, 55, 56, 57, -1, -1, 60, -1, -1, + 63, -1, -1, -1, 67, -1, -1, 48, -1, -1, + 51, 74, 53, 54, 55, 56, 57, 80, 81, 60, + -1, -1, 63, -1, -1, -1, 67, -1, -1, -1, + -1, -1, -1, 74, 97, -1, -1, 100, 101, 80, + 81, -1, 11, 106, -1, -1, -1, -1, -1, -1, + -1, 114, 115, 116, -1, -1, 119, -1, 121, 100, + 101, -1, -1, -1, -1, 106, -1, -1, -1, -1, + -1, -1, -1, 114, 115, 116, -1, -1, 119, 48, + 121, -1, 51, -1, 53, 54, 55, 56, 57, -1, + -1, 60, -1, -1, 63, -1, -1, -1, 67, 11, + -1, -1, -1, -1, -1, 74, -1, -1, -1, -1, + -1, 80, 81, -1, -1, -1, -1, -1, -1, -1, + -1, 11, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 100, 101, -1, -1, -1, 48, 106, -1, 51, + -1, 53, 54, 55, 56, 114, 115, 116, 60, -1, + 119, 63, 121, -1, -1, 67, -1, -1, 48, -1, + -1, 51, 74, 53, 54, 55, 56, 57, 80, 81, + 60, -1, -1, 63, -1, -1, -1, 67, 11, -1, + -1, -1, -1, -1, 74, 97, -1, -1, 100, 101, + 80, 81, -1, -1, 106, -1, -1, -1, -1, -1, + 11, -1, 114, 115, 116, -1, -1, 119, -1, 121, + 100, 101, -1, -1, -1, 48, 106, -1, 51, -1, + 53, 54, 55, 56, 114, 115, 116, 60, -1, 119, + 63, 121, -1, -1, 67, -1, -1, 48, 10, 11, + 51, 74, 53, 54, 55, 56, -1, 80, 81, 60, + -1, -1, 63, -1, 10, 11, 67, -1, -1, -1, + -1, -1, -1, 74, -1, -1, -1, 100, 101, 80, + 81, -1, -1, 106, -1, -1, -1, -1, -1, -1, + -1, 114, 115, 116, 56, -1, 119, -1, 121, 100, + 101, -1, -1, -1, -1, 106, -1, -1, -1, -1, + 56, 73, 74, 114, 115, 116, -1, -1, 119, -1, + 121, -1, -1, -1, -1, -1, -1, 73, 74, -1, + -1, 93, 94, -1, 96, -1, -1, -1, -1, 101, + -1, 103, -1, -1, 106, -1, -1, 93, 94, -1, + 96, -1, 114, 115, -1, 101, 118, 103, 49, 50, + 106, -1, -1, -1, -1, -1, 57, 58, 114, 115, + -1, -1, 118, -1, -1, 66, -1, 68, 69, 70, + 71, -1, -1, -1, 75, -1, -1, -1, 79, -1, -1, -1, 83, 84, 85, 86, 87, 88, -1, -1, -1, -1, -1, 94, 95, 96, 97, -1, -1, -1, -1, -1, 103, 104, 49, 50, 107, 108, -1, -1, - -1, 112, -1, 58, -1, -1, 117, 118, -1, 120, + -1, 112, 57, 58, -1, -1, 117, 118, -1, 120, -1, 66, -1, 68, 69, 70, 71, 128, -1, -1, 75, -1, -1, -1, 79, -1, -1, -1, 83, 84, 85, 86, 87, 88, 145, -1, 147, -1, -1, 94, 95, 96, 97, -1, -1, -1, -1, -1, 103, 104, - 49, 50, 107, 108, -1, -1, -1, 112, -1, 58, + 49, 50, 107, 108, -1, -1, -1, 112, 57, 58, -1, -1, 117, 118, -1, 120, -1, 66, -1, 68, 69, 70, 71, 128, -1, -1, 75, -1, -1, -1, 79, -1, -1, -1, 83, 84, 85, 86, 87, 88, 145, -1, 147, -1, -1, 94, 95, 96, 97, -1, -1, -1, -1, -1, 103, 104, 49, 50, 107, 108, - -1, -1, -1, 112, -1, 58, -1, -1, 117, 118, + -1, -1, -1, 112, 57, 58, -1, -1, 117, 118, -1, 120, -1, 66, -1, 68, 69, 70, 71, 128, -1, -1, 75, -1, -1, -1, 79, -1, -1, -1, 83, 84, 85, 86, 87, 88, 145, -1, 147, -1, -1, 94, 95, 96, 97, -1, -1, -1, -1, -1, 103, 104, 49, 50, 107, 108, -1, -1, -1, 112, - -1, 58, -1, -1, 117, 118, -1, 120, -1, 66, + 57, 58, -1, -1, 117, 118, -1, 120, -1, 66, -1, 68, 69, 70, 71, 128, -1, -1, 75, -1, -1, -1, 79, -1, -1, -1, 83, 84, 85, 86, 87, 88, 145, -1, 147, -1, -1, 94, 95, 96, 97, -1, -1, -1, -1, -1, 103, 104, 49, 50, - 107, 108, -1, -1, -1, 112, -1, 58, -1, -1, + 107, 108, -1, -1, -1, 112, 57, 58, -1, -1, 117, 118, -1, 120, -1, 66, -1, 68, 69, 70, 71, 128, -1, -1, 75, -1, -1, -1, 79, -1, -1, -1, 83, 84, 85, 86, 87, 88, 145, -1, 147, -1, -1, 94, 95, 96, 97, -1, -1, -1, -1, -1, 103, 104, 49, 50, 107, 108, -1, -1, - -1, 112, -1, 58, -1, -1, 117, 118, -1, 120, + -1, 112, 57, 58, -1, -1, 117, 118, -1, 120, -1, 66, -1, 68, 69, 70, 71, 128, -1, -1, 75, -1, -1, -1, 79, -1, -1, -1, 83, 84, 85, 86, 87, 88, 145, -1, 147, -1, -1, 94, 95, 96, 97, -1, -1, -1, -1, -1, 103, 104, - 49, 50, 107, 108, -1, -1, -1, 112, -1, 58, + 49, 50, 107, 108, -1, -1, -1, 112, 57, 58, -1, -1, 117, 118, -1, 120, -1, 66, -1, 68, 69, 70, 71, 128, -1, -1, 75, -1, -1, -1, - 79, -1, -1, 50, 83, 84, 85, 86, 87, 88, - 145, 58, 147, -1, -1, 94, 95, 96, 97, -1, - -1, 68, 69, 70, 103, 104, -1, -1, 107, 108, - -1, -1, 79, 112, -1, -1, -1, -1, 117, 118, - 87, 120, -1, -1, -1, -1, -1, -1, -1, 50, - 97, -1, -1, -1, -1, -1, 103, 58, -1, -1, - -1, 108, -1, -1, -1, -1, 145, 68, 69, 70, - 117, 118, -1, 120, -1, 50, -1, -1, 79, -1, - -1, -1, -1, 58, -1, -1, 87, -1, 135, -1, - -1, -1, -1, 68, 69, 70, 97, -1, 145, -1, - -1, -1, 103, -1, 79, -1, 107, 108, -1, -1, - -1, -1, 87, 88, -1, -1, 117, 118, 50, 120, - -1, -1, 97, -1, -1, -1, 58, -1, 103, -1, - -1, -1, -1, 108, -1, -1, 68, 69, 70, -1, - -1, -1, -1, 118, 145, 120, -1, 79, -1, -1, - -1, -1, -1, -1, -1, 87, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 97, -1, -1, -1, -1, - 145, 103, -1, -1, -1, -1, 108, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 118, -1, 120, -1, + 79, -1, -1, -1, 83, 84, 85, 86, 87, 88, + 145, -1, 147, -1, -1, 94, 95, 96, 97, -1, + -1, -1, -1, -1, 103, 104, -1, 50, 107, 108, + -1, -1, -1, 112, 57, 58, -1, -1, 117, 118, + -1, 120, -1, -1, -1, 68, 69, 70, -1, -1, + -1, -1, -1, 50, -1, -1, 79, -1, -1, -1, + 57, 58, -1, -1, 87, -1, 145, -1, -1, -1, + -1, 68, 69, 70, 97, -1, -1, -1, -1, -1, + 103, -1, 79, -1, -1, 108, -1, -1, -1, -1, + 87, -1, -1, -1, 117, 118, 50, 120, -1, -1, + 97, -1, -1, 57, 58, -1, 103, -1, -1, -1, + 107, 108, 135, -1, 68, 69, 70, -1, -1, -1, + 117, 118, 145, 120, -1, 79, -1, -1, -1, -1, + -1, -1, 50, 87, 88, -1, -1, -1, -1, 57, + 58, -1, -1, 97, -1, -1, -1, -1, 145, 103, + 68, 69, 70, -1, 108, -1, -1, -1, -1, -1, + -1, 79, -1, -1, 118, -1, 120, -1, -1, 87, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 97, + -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, + 108, 145, -1, -1, -1, -1, -1, -1, -1, -1, + 118, -1, 120, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 145 + -1, -1, -1, -1, -1, -1, -1, 145 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ -static const yytype_uint16 yystos[] = +static const yytype_uint8 yystos[] = { - 0, 123, 124, 125, 151, 152, 258, 3, 4, 5, + 0, 123, 124, 125, 151, 152, 253, 3, 4, 5, 6, 8, 9, 10, 11, 47, 51, 53, 54, 55, 59, 63, 64, 72, 73, 74, 80, 81, 89, 91, 93, 98, 100, 101, 102, 105, 110, 113, 116, 121, - 134, 137, 138, 139, 142, 144, 145, 149, 248, 249, - 257, 11, 48, 51, 53, 54, 55, 56, 57, 60, + 134, 137, 138, 139, 142, 144, 145, 149, 243, 244, + 252, 11, 48, 51, 53, 54, 55, 56, 57, 60, 63, 67, 74, 80, 81, 100, 101, 106, 114, 115, - 116, 119, 121, 212, 216, 217, 219, 225, 226, 230, - 231, 236, 237, 238, 239, 0, 49, 50, 58, 66, - 68, 69, 70, 71, 75, 79, 83, 84, 85, 86, - 87, 88, 94, 95, 96, 97, 103, 104, 107, 108, - 112, 117, 118, 120, 128, 145, 155, 157, 158, 160, - 163, 164, 186, 232, 235, 258, 144, 144, 144, 144, + 116, 119, 121, 207, 211, 212, 214, 220, 221, 225, + 226, 231, 232, 233, 234, 0, 49, 50, 57, 58, + 66, 68, 69, 70, 71, 75, 79, 83, 84, 85, + 86, 87, 88, 94, 95, 96, 97, 103, 104, 107, + 108, 112, 117, 118, 120, 128, 145, 155, 157, 158, + 160, 163, 181, 227, 230, 253, 144, 144, 144, 144, 144, 144, 135, 144, 135, 144, 144, 144, 11, 48, - 60, 114, 214, 230, 231, 236, 135, 144, 144, 144, - 135, 144, 144, 144, 248, 248, 248, 248, 248, 11, + 60, 114, 209, 225, 226, 231, 135, 144, 144, 144, + 135, 144, 144, 144, 243, 243, 243, 243, 243, 11, 51, 53, 54, 55, 63, 74, 80, 81, 100, 101, - 116, 121, 216, 246, 248, 10, 11, 73, 74, 93, - 94, 96, 101, 103, 130, 134, 252, 253, 255, 258, - 248, 15, 16, 17, 18, 19, 20, 21, 22, 32, + 116, 121, 211, 241, 243, 10, 11, 73, 74, 93, + 94, 96, 101, 103, 130, 134, 247, 248, 250, 253, + 243, 15, 16, 17, 18, 19, 20, 21, 22, 32, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 143, 144, 145, 6, 8, 212, 144, 56, 106, - 63, 81, 237, 237, 237, 255, 237, 12, 16, 57, - 120, 134, 139, 144, 210, 211, 258, 126, 10, 11, - 93, 129, 256, 10, 11, 93, 126, 255, 256, 79, - 160, 160, 160, 6, 160, 160, 129, 159, 88, 160, - 144, 144, 144, 144, 160, 126, 255, 129, 129, 129, - 160, 160, 144, 160, 163, 187, 160, 160, 169, 88, - 255, 160, 160, 145, 10, 11, 48, 57, 60, 92, - 114, 126, 142, 174, 177, 213, 215, 217, 219, 225, - 230, 231, 236, 245, 246, 258, 216, 245, 245, 245, - 245, 216, 245, 216, 245, 245, 245, 144, 255, 144, - 255, 255, 216, 245, 245, 216, 216, 216, 248, 245, - 245, 146, 127, 146, 255, 148, 127, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, 146, 246, - 248, 211, 248, 139, 12, 16, 57, 120, 134, 139, - 210, 258, 210, 211, 210, 211, 210, 210, 14, 16, - 57, 97, 134, 139, 196, 197, 206, 212, 258, 145, - 228, 229, 258, 11, 227, 237, 129, 218, 220, 160, - 157, 126, 255, 255, 255, 255, 255, 152, 126, 248, - 135, 10, 11, 57, 177, 213, 215, 255, 128, 130, - 161, 162, 255, 144, 144, 10, 11, 215, 144, 57, - 212, 255, 156, 255, 126, 128, 129, 130, 202, 126, - 128, 130, 203, 128, 165, 255, 256, 255, 146, 146, - 146, 146, 146, 146, 136, 146, 136, 146, 146, 146, - 248, 245, 136, 146, 146, 146, 136, 146, 146, 146, - 146, 248, 248, 57, 144, 183, 258, 252, 129, 146, - 148, 146, 210, 139, 210, 210, 210, 210, 210, 145, - 210, 97, 212, 206, 210, 210, 146, 14, 127, 12, - 16, 57, 120, 134, 139, 144, 209, 256, 258, 244, - 248, 258, 255, 147, 227, 152, 73, 221, 258, 152, - 126, 127, 127, 127, 127, 147, 233, 127, 146, 10, - 11, 56, 57, 114, 188, 189, 190, 191, 236, 258, - 144, 215, 203, 170, 128, 216, 148, 127, 144, 175, - 12, 139, 176, 166, 248, 212, 12, 16, 57, 120, - 134, 139, 208, 256, 258, 152, 144, 240, 241, 153, - 154, 255, 61, 62, 240, 61, 62, 126, 248, 12, - 16, 57, 92, 120, 134, 139, 144, 167, 192, 194, - 256, 129, 144, 144, 146, 146, 144, 144, 196, 32, - 73, 87, 90, 93, 109, 195, 258, 248, 210, 244, - 146, 212, 209, 146, 146, 183, 14, 206, 139, 209, - 209, 209, 209, 209, 209, 130, 145, 201, 258, 148, - 127, 130, 147, 129, 222, 223, 258, 147, 234, 10, - 10, 10, 10, 152, 257, 128, 255, 191, 255, 136, - 127, 209, 171, 172, 194, 128, 148, 161, 3, 4, - 5, 9, 10, 14, 47, 59, 64, 72, 73, 89, - 91, 93, 98, 102, 105, 110, 113, 134, 137, 138, - 142, 144, 149, 198, 199, 206, 207, 250, 251, 257, - 258, 196, 139, 192, 196, 168, 194, 146, 208, 139, - 208, 208, 208, 208, 208, 144, 145, 147, 178, 147, - 242, 258, 126, 127, 126, 144, 128, 128, 147, 128, - 128, 126, 204, 205, 248, 258, 128, 139, 192, 192, - 6, 15, 16, 17, 18, 19, 20, 21, 22, 32, + 141, 143, 144, 145, 6, 8, 207, 144, 56, 106, + 63, 81, 232, 232, 232, 250, 232, 12, 16, 57, + 120, 134, 139, 144, 205, 206, 253, 126, 10, 11, + 93, 129, 251, 10, 11, 93, 126, 250, 251, 79, + 160, 160, 160, 160, 6, 160, 160, 129, 159, 88, + 160, 144, 144, 144, 144, 160, 126, 250, 129, 129, + 129, 160, 160, 144, 160, 163, 182, 160, 160, 166, + 88, 250, 160, 160, 145, 10, 11, 48, 60, 92, + 114, 126, 142, 169, 172, 208, 210, 212, 214, 220, + 225, 226, 231, 240, 241, 253, 211, 240, 240, 240, + 240, 211, 240, 211, 240, 240, 240, 144, 250, 144, + 250, 250, 211, 240, 240, 211, 211, 211, 243, 240, + 240, 146, 127, 146, 250, 148, 127, 243, 243, 243, + 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, + 243, 243, 243, 243, 243, 243, 243, 243, 146, 241, + 243, 206, 243, 139, 12, 16, 57, 120, 134, 139, + 205, 253, 205, 206, 205, 206, 205, 205, 14, 16, + 57, 97, 134, 139, 191, 192, 201, 207, 253, 145, + 223, 224, 253, 11, 222, 232, 129, 213, 215, 160, + 157, 126, 250, 250, 250, 250, 250, 152, 126, 243, + 135, 10, 11, 172, 208, 210, 250, 128, 130, 161, + 162, 250, 144, 144, 144, 57, 207, 250, 156, 250, + 126, 128, 129, 130, 197, 126, 128, 130, 198, 128, + 164, 250, 251, 250, 146, 146, 146, 146, 146, 146, + 136, 146, 136, 146, 146, 146, 243, 240, 136, 146, + 146, 146, 136, 146, 146, 146, 146, 243, 243, 57, + 144, 178, 253, 247, 129, 146, 148, 146, 205, 139, + 205, 205, 205, 205, 205, 145, 205, 97, 207, 201, + 205, 205, 146, 14, 127, 12, 16, 57, 120, 134, + 139, 144, 204, 251, 253, 239, 243, 253, 250, 147, + 222, 152, 73, 216, 253, 152, 126, 127, 127, 127, + 127, 147, 228, 127, 146, 10, 11, 56, 57, 114, + 183, 184, 185, 186, 231, 253, 144, 198, 167, 128, + 211, 148, 127, 144, 170, 12, 139, 171, 243, 207, + 12, 16, 57, 120, 134, 139, 203, 251, 253, 152, + 144, 235, 236, 153, 154, 250, 61, 62, 235, 61, + 62, 126, 243, 12, 16, 57, 92, 120, 134, 139, + 144, 165, 187, 189, 251, 129, 144, 144, 146, 146, + 144, 144, 191, 32, 73, 87, 90, 93, 109, 190, + 253, 243, 205, 239, 146, 207, 204, 146, 146, 178, + 14, 201, 139, 204, 204, 204, 204, 204, 204, 130, + 145, 196, 253, 148, 127, 130, 147, 129, 217, 218, + 253, 147, 229, 10, 10, 10, 10, 152, 252, 128, + 250, 186, 250, 136, 127, 204, 168, 189, 128, 148, + 161, 3, 4, 5, 9, 10, 14, 47, 59, 64, + 72, 73, 89, 91, 93, 98, 102, 105, 110, 113, + 134, 137, 138, 142, 144, 149, 193, 194, 201, 202, + 245, 246, 252, 253, 191, 139, 187, 191, 146, 203, + 139, 203, 203, 203, 203, 203, 144, 145, 147, 173, + 147, 237, 253, 126, 127, 126, 144, 128, 128, 147, + 128, 128, 126, 199, 200, 243, 253, 128, 139, 187, + 187, 6, 15, 16, 17, 18, 19, 20, 21, 22, + 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 62, 89, 127, 130, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 144, 145, + 149, 179, 187, 187, 187, 187, 129, 144, 145, 190, + 130, 196, 198, 222, 241, 241, 241, 241, 146, 57, + 209, 144, 126, 148, 144, 204, 196, 144, 144, 190, + 204, 146, 243, 239, 243, 94, 95, 96, 114, 118, + 219, 226, 249, 250, 126, 127, 152, 127, 146, 127, + 127, 127, 147, 146, 130, 204, 130, 163, 180, 181, + 185, 130, 195, 253, 196, 198, 160, 144, 135, 135, + 209, 135, 144, 135, 144, 243, 243, 243, 243, 211, + 241, 243, 146, 14, 127, 15, 16, 17, 18, 19, + 20, 21, 22, 32, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 143, 144, 145, 146, 187, + 146, 146, 144, 203, 176, 239, 191, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 62, 89, 127, 130, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 144, 145, 149, - 184, 192, 192, 192, 192, 129, 144, 145, 195, 130, - 201, 203, 227, 246, 246, 246, 246, 146, 57, 214, - 144, 126, 148, 144, 209, 201, 144, 144, 195, 209, - 146, 248, 244, 248, 94, 95, 96, 114, 118, 224, - 231, 254, 255, 126, 127, 152, 127, 146, 127, 127, - 127, 147, 146, 130, 209, 130, 163, 185, 186, 190, - 130, 200, 258, 173, 194, 201, 203, 160, 144, 135, - 135, 214, 135, 144, 135, 144, 248, 248, 248, 248, - 216, 246, 248, 146, 14, 127, 15, 16, 17, 18, - 19, 20, 21, 22, 32, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 143, 144, 145, 146, - 192, 146, 146, 201, 203, 144, 208, 181, 244, 196, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 67, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 87, 88, 89, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 148, 149, 243, 240, 154, 245, 245, 204, - 147, 127, 192, 10, 146, 148, 146, 4, 193, 244, - 248, 127, 146, 146, 146, 146, 183, 214, 211, 146, - 255, 240, 196, 201, 196, 196, 144, 148, 127, 118, - 254, 118, 254, 118, 254, 255, 94, 95, 96, 255, - 152, 224, 147, 10, 128, 10, 10, 10, 128, 216, - 200, 216, 47, 59, 64, 98, 102, 105, 134, 137, - 138, 139, 142, 144, 149, 247, 249, 201, 203, 127, - 216, 216, 216, 144, 216, 216, 216, 216, 248, 146, - 146, 14, 207, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 146, 246, 248, 183, 146, 144, - 183, 127, 182, 196, 148, 146, 242, 147, 147, 146, - 147, 126, 248, 198, 148, 167, 195, 211, 146, 147, - 146, 146, 146, 196, 254, 254, 254, 254, 254, 254, - 147, 127, 146, 127, 146, 146, 127, 146, 144, 135, - 135, 135, 144, 135, 247, 247, 247, 247, 247, 216, - 246, 247, 15, 16, 17, 18, 19, 20, 21, 22, - 32, 131, 132, 133, 134, 137, 138, 139, 140, 141, - 143, 144, 145, 127, 172, 146, 136, 136, 245, 136, - 146, 136, 146, 146, 248, 129, 146, 148, 144, 179, - 168, 196, 146, 183, 147, 204, 146, 126, 183, 183, - 183, 146, 10, 128, 10, 128, 128, 10, 128, 216, - 216, 216, 216, 216, 216, 146, 146, 247, 247, 247, - 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, - 247, 247, 247, 247, 247, 247, 146, 246, 248, 173, - 144, 144, 146, 144, 144, 248, 180, 196, 146, 183, - 147, 183, 240, 195, 195, 195, 183, 146, 127, 127, - 146, 146, 136, 136, 136, 146, 136, 247, 129, 146, - 148, 246, 246, 246, 246, 196, 146, 183, 147, 128, - 10, 10, 128, 144, 144, 144, 144, 247, 146, 146, - 146, 146, 146, 183, 146, 146, 246, 246, 246, 246, - 183, 195, 128, 128, 146, 146, 146, 146, 195 + 44, 45, 46, 47, 48, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 67, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 87, 88, 89, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, + 149, 238, 235, 154, 240, 240, 199, 147, 127, 187, + 10, 146, 148, 146, 4, 188, 239, 243, 127, 146, + 146, 146, 146, 178, 209, 206, 146, 250, 235, 191, + 196, 191, 191, 144, 148, 127, 118, 249, 118, 249, + 118, 249, 250, 94, 95, 96, 250, 152, 219, 147, + 10, 128, 10, 10, 10, 128, 211, 195, 211, 47, + 59, 64, 98, 102, 105, 134, 137, 138, 139, 142, + 144, 149, 242, 244, 127, 211, 211, 211, 144, 211, + 211, 211, 211, 243, 146, 146, 14, 202, 243, 243, + 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, + 243, 243, 243, 243, 243, 243, 243, 243, 243, 146, + 241, 243, 178, 146, 144, 178, 177, 191, 148, 146, + 237, 147, 147, 146, 147, 126, 243, 193, 148, 165, + 190, 206, 146, 147, 146, 146, 146, 191, 249, 249, + 249, 249, 249, 249, 147, 127, 146, 127, 146, 146, + 127, 146, 144, 135, 135, 135, 144, 135, 242, 242, + 242, 242, 242, 211, 241, 242, 15, 16, 17, 18, + 19, 20, 21, 22, 32, 131, 132, 133, 134, 137, + 138, 139, 140, 141, 143, 144, 145, 168, 146, 136, + 136, 240, 136, 146, 136, 146, 146, 243, 129, 146, + 148, 144, 174, 191, 146, 178, 147, 199, 146, 126, + 178, 178, 178, 146, 10, 128, 10, 128, 128, 10, + 128, 211, 211, 211, 211, 211, 211, 146, 146, 242, + 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, + 242, 242, 242, 242, 242, 242, 242, 242, 146, 241, + 243, 144, 144, 146, 144, 144, 243, 175, 191, 146, + 178, 147, 178, 235, 190, 190, 190, 178, 146, 127, + 127, 146, 146, 136, 136, 136, 146, 136, 242, 129, + 146, 148, 241, 241, 241, 241, 191, 146, 178, 147, + 128, 10, 10, 128, 144, 144, 144, 144, 242, 146, + 146, 146, 146, 146, 178, 146, 146, 241, 241, 241, + 241, 178, 190, 128, 128, 146, 146, 146, 146, 190 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint16 yyr1[] = +static const yytype_uint8 yyr1[] = { 0, 150, 151, 151, 151, 152, 152, 152, 153, 153, 154, 154, 156, 155, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 159, 158, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 161, 161, 162, 162, 163, 163, - 163, 163, 163, 165, 164, 166, 164, 167, 167, 168, - 168, 170, 169, 171, 169, 169, 172, 172, 173, 173, - 175, 174, 176, 174, 178, 177, 179, 177, 180, 177, - 181, 177, 182, 177, 177, 183, 183, 183, 183, 183, - 183, 183, 183, 184, 184, 184, 184, 184, 184, 184, - 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, - 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, - 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, - 184, 184, 185, 185, 187, 186, 186, 188, 188, 189, - 189, 190, 190, 190, 190, 190, 190, 191, 191, 191, - 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, - 192, 193, 192, 194, 194, 195, 195, 195, 196, 196, - 196, 196, 196, 197, 197, 198, 198, 198, 198, 198, - 199, 199, 200, 200, 201, 201, 202, 202, 202, 202, - 202, 203, 203, 203, 203, 203, 203, 204, 204, 204, - 205, 205, 205, 205, 206, 206, 206, 206, 207, 207, - 208, 208, 208, 208, 208, 208, 208, 208, 208, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 210, 210, 210, 210, 210, 210, 210, 210, 211, 211, - 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, - 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, - 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, - 213, 214, 214, 214, 214, 214, 214, 214, 215, 215, - 216, 216, 218, 217, 220, 219, 221, 221, 222, 222, - 223, 223, 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 225, 226, 226, 226, 226, 227, 227, 228, - 228, 228, 229, 229, 229, 230, 230, 230, 231, 231, - 231, 233, 232, 234, 232, 232, 232, 235, 235, 235, - 236, 236, 236, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 238, 238, 238, - 239, 241, 240, 242, 242, 243, 243, 243, 243, 243, + 160, 160, 160, 160, 160, 161, 161, 162, 162, 164, + 163, 163, 163, 163, 163, 165, 165, 167, 166, 166, + 168, 168, 170, 169, 171, 169, 173, 172, 174, 172, + 175, 172, 176, 172, 177, 172, 172, 178, 178, 178, + 178, 178, 178, 178, 178, 179, 179, 179, 179, 179, + 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, + 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, + 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, + 179, 179, 179, 179, 180, 180, 182, 181, 181, 183, + 183, 184, 184, 185, 185, 185, 185, 185, 185, 186, + 186, 186, 187, 187, 187, 187, 187, 187, 187, 187, + 187, 187, 187, 188, 187, 189, 189, 190, 190, 190, + 191, 191, 191, 191, 191, 192, 192, 193, 193, 193, + 193, 193, 194, 194, 195, 195, 196, 196, 197, 197, + 197, 197, 197, 198, 198, 198, 198, 198, 198, 199, + 199, 199, 200, 200, 200, 200, 201, 201, 201, 201, + 202, 202, 203, 203, 203, 203, 203, 203, 203, 203, + 203, 204, 204, 204, 204, 204, 204, 204, 204, 204, + 204, 204, 205, 205, 205, 205, 205, 205, 205, 205, + 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, + 206, 206, 207, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 208, 208, 208, 208, 208, 208, 208, 208, + 208, 208, 208, 209, 209, 209, 209, 209, 209, 209, + 210, 210, 211, 211, 213, 212, 215, 214, 216, 216, + 217, 217, 218, 218, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 220, 221, 221, 221, 221, 222, + 222, 223, 223, 223, 224, 224, 224, 225, 225, 225, + 226, 226, 226, 228, 227, 229, 227, 227, 227, 230, + 230, 230, 231, 231, 231, 232, 232, 232, 232, 232, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 233, + 233, 233, 234, 236, 235, 237, 237, 238, 238, 238, + 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, + 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, + 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, + 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, + 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, + 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, + 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, + 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, + 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, + 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, + 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, + 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, + 238, 239, 239, 240, 240, 241, 241, 242, 242, 242, + 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, + 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, + 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, + 242, 242, 242, 242, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 244, - 244, 245, 245, 246, 246, 247, 247, 247, 247, 247, - 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, - 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, - 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, - 247, 247, 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, 249, 249, - 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, - 249, 250, 250, 250, 250, 250, 250, 250, 250, 250, - 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, - 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, - 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, - 250, 250, 250, 251, 251, 251, 251, 251, 251, 251, - 251, 251, 251, 251, 252, 252, 252, 253, 253, 253, - 253, 254, 254, 254, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 256, 256, 256, 257, 257, 257, 257, - 258 + 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, + 244, 244, 244, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 246, 246, 246, 246, 246, + 246, 246, 246, 246, 246, 246, 247, 247, 247, 248, + 248, 248, 248, 249, 249, 249, 250, 250, 250, 250, + 250, 250, 250, 250, 250, 251, 251, 251, 252, 252, + 252, 252, 253 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ @@ -2709,39 +2703,38 @@ static const yytype_uint8 yyr2[] = 4, 4, 0, 5, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 2, 2, 7, 9, 11, 9, 11, 13, 9, 13, 9, 7, 5, 0, 3, 1, - 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 6, 1, 3, 1, 4, 1, 3, - 3, 3, 1, 0, 4, 0, 5, 2, 4, 2, - 4, 0, 4, 0, 5, 3, 2, 4, 2, 4, - 0, 6, 0, 6, 0, 7, 0, 11, 0, 12, - 0, 8, 0, 9, 1, 1, 1, 2, 2, 2, - 2, 4, 5, 1, 1, 1, 1, 1, 1, 1, + 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 6, 1, 3, 1, 4, 0, + 4, 3, 3, 3, 1, 2, 4, 0, 4, 3, + 2, 4, 0, 6, 0, 6, 0, 7, 0, 11, + 0, 12, 0, 8, 0, 9, 1, 1, 1, 2, + 2, 2, 2, 4, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, - 1, 1, 1, 1, 0, 6, 2, 1, 1, 1, - 3, 2, 4, 2, 4, 3, 4, 1, 1, 1, - 1, 2, 3, 2, 2, 2, 2, 2, 3, 4, - 3, 0, 6, 2, 3, 1, 3, 4, 1, 1, - 1, 3, 2, 1, 3, 1, 1, 1, 3, 2, - 1, 3, 1, 2, 1, 2, 1, 3, 5, 3, - 3, 1, 3, 3, 3, 3, 4, 1, 1, 2, - 1, 3, 3, 5, 3, 4, 5, 2, 1, 1, - 1, 1, 2, 2, 2, 2, 2, 3, 4, 1, - 1, 2, 2, 2, 2, 2, 3, 4, 7, 3, - 1, 2, 2, 2, 2, 2, 3, 4, 1, 2, - 2, 2, 2, 2, 3, 4, 5, 9, 9, 9, - 1, 1, 2, 1, 1, 1, 2, 4, 4, 1, - 1, 1, 2, 1, 1, 1, 2, 4, 2, 4, - 1, 1, 1, 2, 2, 2, 4, 1, 1, 1, - 2, 3, 0, 5, 0, 8, 1, 1, 1, 1, - 2, 3, 1, 2, 2, 2, 3, 3, 3, 3, - 3, 3, 4, 3, 1, 4, 2, 1, 1, 1, - 3, 5, 1, 2, 4, 1, 2, 2, 1, 1, - 1, 0, 6, 0, 7, 4, 5, 3, 5, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 2, 2, 2, 2, 1, 1, 2, - 1, 0, 2, 1, 2, 1, 1, 1, 1, 1, + 2, 2, 1, 1, 1, 1, 0, 6, 2, 1, + 1, 1, 3, 2, 4, 2, 4, 3, 4, 1, + 1, 1, 1, 2, 3, 2, 2, 2, 2, 2, + 3, 4, 3, 0, 6, 2, 3, 1, 3, 4, + 1, 1, 1, 3, 2, 1, 3, 1, 1, 1, + 3, 2, 1, 3, 1, 2, 1, 2, 1, 3, + 5, 3, 3, 1, 3, 3, 3, 3, 4, 1, + 1, 2, 1, 3, 3, 5, 3, 4, 5, 2, + 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, + 4, 1, 1, 2, 2, 2, 2, 2, 3, 4, + 7, 3, 1, 2, 2, 2, 2, 2, 3, 4, + 1, 2, 2, 2, 2, 2, 3, 4, 5, 9, + 9, 9, 1, 1, 2, 1, 1, 1, 2, 4, + 4, 1, 1, 1, 2, 1, 1, 1, 2, 4, + 2, 4, 1, 1, 1, 2, 2, 2, 4, 1, + 1, 1, 2, 3, 0, 5, 0, 8, 1, 1, + 1, 1, 2, 3, 1, 2, 2, 2, 3, 3, + 3, 3, 3, 3, 4, 3, 1, 4, 2, 1, + 1, 1, 3, 5, 1, 2, 4, 1, 2, 2, + 1, 1, 1, 0, 6, 0, 7, 4, 5, 3, + 5, 4, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, + 1, 2, 1, 0, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -2753,27 +2746,27 @@ static const yytype_uint8 yyr2[] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, - 1, 1, 1, 1, 3, 1, 4, 7, 7, 7, - 7, 4, 4, 2, 2, 2, 2, 2, 2, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 5, 4, 4, 3, 3, - 3, 3, 1, 4, 7, 7, 7, 7, 4, 4, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 3, 1, 1, 1, 1, 1, 3, 1, 4, 7, + 7, 7, 7, 4, 4, 2, 2, 2, 2, 2, + 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 5, 4, 4, + 3, 3, 3, 3, 1, 4, 7, 7, 7, 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 2, 5, 4, 4, 2, 2, 2, - 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, + 4, 4, 4, 4, 4, 2, 5, 4, 4, 2, + 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 5, 4, 4, 3, 3, 3, 3, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, - 11, 1, 4, 7, 7, 7, 7, 4, 4, 2, - 5, 4, 4, 2, 2, 2, 2, 2, 3, 3, + 3, 3, 3, 5, 4, 4, 3, 3, 3, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 8, 11, 1, 4, 7, 7, 7, 7, 4, + 4, 2, 5, 4, 4, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 5, 4, 4, 3, - 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 3, 1, 1, 2, - 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, - 0 + 3, 3, 3, 3, 3, 3, 3, 3, 5, 4, + 4, 3, 3, 3, 3, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, + 1, 2, 1, 1, 2, 2, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 2, 0 }; @@ -3553,7 +3546,7 @@ yyreduce: { current_expr = (yyvsp[0].u.expr); } -#line 3557 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3550 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 4: @@ -3561,7 +3554,7 @@ yyreduce: { current_type = (yyvsp[0].u.type); } -#line 3565 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3558 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 10: @@ -3569,7 +3562,7 @@ yyreduce: { delete (yyvsp[-1].u.expr); } -#line 3573 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3566 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 11: @@ -3577,7 +3570,7 @@ yyreduce: { delete (yyvsp[-1].u.expr); } -#line 3581 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3574 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 12: @@ -3586,7 +3579,7 @@ yyreduce: push_storage_class((current_storage_class & ~CPPInstance::SC_c_binding) | ((yyvsp[-1].u.integer) & CPPInstance::SC_c_binding)); } -#line 3590 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3583 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 13: @@ -3594,7 +3587,7 @@ yyreduce: { pop_storage_class(); } -#line 3598 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3591 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 20: @@ -3611,7 +3604,7 @@ yyreduce: publish_nest_level++; current_scope->set_current_vis(V_published); } -#line 3615 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3608 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 21: @@ -3624,7 +3617,7 @@ yyreduce: } publish_nest_level = 0; } -#line 3628 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3621 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 22: @@ -3632,7 +3625,7 @@ yyreduce: { current_scope->set_current_vis(V_published); } -#line 3636 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3629 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 23: @@ -3644,7 +3637,7 @@ yyreduce: current_scope->set_current_vis(V_public); } } -#line 3648 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3641 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 24: @@ -3652,7 +3645,7 @@ yyreduce: { current_scope->set_current_vis(V_protected); } -#line 3656 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3649 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 25: @@ -3660,7 +3653,7 @@ yyreduce: { current_scope->set_current_vis(V_private); } -#line 3664 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3657 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 26: @@ -3675,7 +3668,7 @@ yyreduce: CPPMakeProperty *make_property = new CPPMakeProperty((yyvsp[-4].u.identifier), getter->as_function_group(), NULL, current_scope, (yylsp[-6]).file); current_scope->add_declaration(make_property, global_scope, current_lexer, (yylsp[-6])); } -#line 3679 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3672 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 27: @@ -3700,7 +3693,7 @@ yyreduce: current_scope->add_declaration(make_property, global_scope, current_lexer, (yylsp[-8])); } } -#line 3704 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3697 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 28: @@ -3734,7 +3727,7 @@ yyreduce: current_scope->add_declaration(make_property, global_scope, current_lexer, (yylsp[-10])); } } -#line 3738 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3731 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 29: @@ -3755,7 +3748,7 @@ yyreduce: make_property->_length_function = length_getter->as_function_group(); current_scope->add_declaration(make_property, global_scope, current_lexer, (yylsp[-8])); } -#line 3759 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3752 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 30: @@ -3787,7 +3780,7 @@ yyreduce: current_scope->add_declaration(make_property, global_scope, current_lexer, (yylsp[-10])); } } -#line 3791 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3784 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 31: @@ -3828,7 +3821,7 @@ yyreduce: current_scope->add_declaration(make_property, global_scope, current_lexer, (yylsp[-12])); } } -#line 3832 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3825 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 32: @@ -3854,7 +3847,7 @@ yyreduce: current_scope->add_declaration(make_property, global_scope, current_lexer, (yylsp[-8])); } } -#line 3858 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3851 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 33: @@ -3891,7 +3884,7 @@ yyreduce: current_scope->add_declaration(make_property, global_scope, current_lexer, (yylsp[-12])); } } -#line 3895 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3888 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 34: @@ -3917,7 +3910,7 @@ yyreduce: current_scope->add_declaration(make_seq, global_scope, current_lexer, (yylsp[-8])); } } -#line 3921 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3914 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 35: @@ -3932,7 +3925,7 @@ yyreduce: yywarning("static_assert failed: " + str.str(), (yylsp[-4])); } } -#line 3936 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3929 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 36: @@ -3946,7 +3939,7 @@ yyreduce: yywarning("static_assert failed", (yylsp[-2])); } } -#line 3950 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3943 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 37: @@ -3956,7 +3949,7 @@ yyreduce: V_public); push_scope(new_scope); } -#line 3960 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3953 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 38: @@ -3965,7 +3958,7 @@ yyreduce: delete current_scope; pop_scope(); } -#line 3969 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3962 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 39: @@ -3973,19 +3966,28 @@ yyreduce: { (yyval.u.integer) = 0; } -#line 3977 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3970 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 40: #line 788 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_extern; + // This isn't really a storage class, but it helps with parsing. + (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_const; } -#line 3985 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3979 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 41: -#line 792 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 793 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_extern; +} +#line 3987 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 42: +#line 797 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_extern; if ((yyvsp[-1].str) == "C") { @@ -3996,116 +3998,131 @@ yyreduce: yywarning("Ignoring unknown linkage type \"" + (yyvsp[-1].str) + "\"", (yylsp[-1])); } } -#line 4000 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 42: -#line 803 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_static; -} -#line 4008 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4002 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 43: -#line 807 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 808 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_inline; + (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_static; } -#line 4016 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4010 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 44: -#line 811 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 812 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_virtual; + (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_inline; } -#line 4024 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4018 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 45: -#line 815 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 816 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_explicit; + (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_virtual; } -#line 4032 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4026 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 46: -#line 819 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 820 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_register; + (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_explicit; } -#line 4040 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4034 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 47: -#line 823 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 824 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_volatile; + (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_register; } -#line 4048 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4042 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 48: -#line 827 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 828 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_mutable; + (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_volatile; } -#line 4056 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4050 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 49: -#line 831 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 832 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_constexpr; + (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_mutable; } -#line 4064 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4058 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 50: -#line 835 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 836 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_blocking; + (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_constexpr; } -#line 4072 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4066 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 51: -#line 839 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 840 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_extension; + (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_blocking; } -#line 4080 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4074 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 52: -#line 843 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 844 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_thread_local; + (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_extension; } -#line 4088 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4082 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 53: -#line 847 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 848 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_thread_local; +} +#line 4090 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 54: +#line 852 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // Ignore attribute specifiers for now. (yyval.u.integer) = (yyvsp[0].u.integer); } -#line 4097 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 58: -#line 865 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - /* multiple_var_declaration adds itself to the scope. */ -} -#line 4105 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4099 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 59: -#line 869 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 870 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + // We don't need to push/pop type, because we can't nest + // type_like_declaration. + if ((yyvsp[0].u.decl)->as_type_declaration()) { + current_type = (yyvsp[0].u.decl)->as_type_declaration()->_type; + } else { + current_type = (yyvsp[0].u.decl)->as_type(); + } + push_storage_class((yyvsp[-1].u.integer)); +} +#line 4114 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 60: +#line 881 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + pop_storage_class(); +} +#line 4122 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 61: +#line 886 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // We don't really care about the storage class here. In fact, it's // not actually legal to define a class or struct using a particular @@ -4114,11 +4131,11 @@ yyreduce: current_scope->add_declaration((yyvsp[-1].u.decl), global_scope, current_lexer, (yylsp[-1])); } -#line 4118 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4135 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 60: -#line 878 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 62: +#line 895 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { if ((yyvsp[-1].u.instance) != (CPPInstance *)NULL) { (yyvsp[-1].u.instance)->_storage_class |= (current_storage_class | (yyvsp[-2].u.integer)); @@ -4126,23 +4143,53 @@ yyreduce: (yyvsp[-1].u.instance)->set_initializer((yyvsp[0].u.expr)); } } -#line 4130 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 61: -#line 886 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - if ((yyvsp[-1].u.instance) != (CPPInstance *)NULL) { - (yyvsp[-1].u.instance)->_storage_class |= (current_storage_class | (yyvsp[-2].u.integer)); - current_scope->add_declaration((yyvsp[-1].u.instance), global_scope, current_lexer, (yylsp[-1])); - (yyvsp[-1].u.instance)->set_initializer((yyvsp[0].u.expr)); - } -} -#line 4142 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4147 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 63: -#line 898 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 903 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + if ((yyvsp[-1].u.instance) != (CPPInstance *)NULL) { + (yyvsp[-1].u.instance)->_storage_class |= (current_storage_class | (yyvsp[-2].u.integer)); + current_scope->add_declaration((yyvsp[-1].u.instance), global_scope, current_lexer, (yylsp[-1])); + (yyvsp[-1].u.instance)->set_initializer((yyvsp[0].u.expr)); + } +} +#line 4159 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 65: +#line 919 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + if (current_storage_class & CPPInstance::SC_const) { + (yyvsp[-1].u.inst_ident)->add_modifier(IIT_const); + } + CPPInstance *inst = new CPPInstance(current_type, (yyvsp[-1].u.inst_ident), + current_storage_class, + (yylsp[-1]).file); + inst->set_initializer((yyvsp[0].u.expr)); + current_scope->add_declaration(inst, global_scope, current_lexer, (yylsp[-1])); +} +#line 4174 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 66: +#line 930 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + if (current_storage_class & CPPInstance::SC_const) { + (yyvsp[-3].u.inst_ident)->add_modifier(IIT_const); + } + CPPInstance *inst = new CPPInstance(current_type, (yyvsp[-3].u.inst_ident), + current_storage_class, + (yylsp[-3]).file); + inst->set_initializer((yyvsp[-2].u.expr)); + current_scope->add_declaration(inst, global_scope, current_lexer, (yylsp[-3])); +} +#line 4189 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 67: +#line 945 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // We don't need to push/pop type, because we can't nest // multiple_var_declarations. @@ -4153,138 +4200,19 @@ yyreduce: } push_storage_class((yyvsp[-1].u.integer)); } -#line 4157 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 64: -#line 909 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - pop_storage_class(); -} -#line 4165 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 65: -#line 913 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - // We don't need to push/pop type, because we can't nest - // multiple_var_declarations. - if ((yyvsp[0].u.decl)->as_type_declaration()) { - current_type = (yyvsp[0].u.decl)->as_type_declaration()->_type; - } else { - current_type = (yyvsp[0].u.decl)->as_type(); - } - push_storage_class((yyvsp[-2].u.integer)); -} -#line 4180 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 66: -#line 924 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - pop_storage_class(); -} -#line 4188 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 67: -#line 935 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - CPPInstance *inst = new CPPInstance(current_type, (yyvsp[-1].u.inst_ident), - current_storage_class, - (yylsp[-1]).file); - inst->set_initializer((yyvsp[0].u.expr)); - current_scope->add_declaration(inst, global_scope, current_lexer, (yylsp[-1])); -} -#line 4200 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4204 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 68: -#line 943 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 956 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - CPPInstance *inst = new CPPInstance(current_type, (yyvsp[-3].u.inst_ident), - current_storage_class, - (yylsp[-3]).file); - inst->set_initializer((yyvsp[-2].u.expr)); - current_scope->add_declaration(inst, global_scope, current_lexer, (yylsp[-3])); + pop_storage_class(); } #line 4212 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 69: -#line 954 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyvsp[-1].u.inst_ident)->add_modifier(IIT_const); - CPPInstance *inst = new CPPInstance(current_type, (yyvsp[-1].u.inst_ident), - current_storage_class, - (yylsp[-1]).file); - inst->set_initializer((yyvsp[0].u.expr)); - current_scope->add_declaration(inst, global_scope, current_lexer, (yylsp[-1])); -} -#line 4225 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 70: -#line 963 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyvsp[-3].u.inst_ident)->add_modifier(IIT_const); - CPPInstance *inst = new CPPInstance(current_type, (yyvsp[-3].u.inst_ident), - current_storage_class, - (yylsp[-3]).file); - inst->set_initializer((yyvsp[-2].u.expr)); - current_scope->add_declaration(inst, global_scope, current_lexer, (yylsp[-3])); -} -#line 4238 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 71: -#line 976 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - // We don't need to push/pop type, because we can't nest - // multiple_var_declarations. - if ((yyvsp[0].u.decl)->as_type_declaration()) { - current_type = (yyvsp[0].u.decl)->as_type_declaration()->_type; - } else { - current_type = (yyvsp[0].u.decl)->as_type(); - } - push_storage_class((yyvsp[-1].u.integer)); -} -#line 4253 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 72: -#line 987 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - pop_storage_class(); -} -#line 4261 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 73: -#line 991 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - // We don't need to push/pop type, because we can't nest - // multiple_var_declarations. - if ((yyvsp[0].u.decl)->as_type_declaration()) { - current_type = (yyvsp[0].u.decl)->as_type_declaration()->_type; - } else { - current_type = (yyvsp[0].u.decl)->as_type(); - } - push_storage_class((yyvsp[-2].u.integer)); -} -#line 4276 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 74: -#line 1002 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - pop_storage_class(); -} -#line 4284 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 75: -#line 1006 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 960 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { if ((yyvsp[-1].u.instance) != (CPPDeclaration *)NULL) { CPPInstance *inst = (yyvsp[-1].u.instance)->as_instance(); @@ -4296,61 +4224,45 @@ yyreduce: } } } -#line 4300 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4228 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 76: -#line 1021 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 70: +#line 975 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { + if (current_storage_class & CPPInstance::SC_const) { + (yyvsp[-1].u.inst_ident)->add_modifier(IIT_const); + } CPPType *target_type = current_type; CPPTypedefType *typedef_type = new CPPTypedefType(target_type, (yyvsp[-1].u.inst_ident), current_scope, (yylsp[-1]).file); current_scope->add_declaration(CPPType::new_type(typedef_type), global_scope, current_lexer, (yylsp[-1])); } -#line 4310 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4241 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 77: -#line 1027 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 71: +#line 984 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { + if (current_storage_class & CPPInstance::SC_const) { + (yyvsp[-3].u.inst_ident)->add_modifier(IIT_const); + } CPPType *target_type = current_type; CPPTypedefType *typedef_type = new CPPTypedefType(target_type, (yyvsp[-3].u.inst_ident), current_scope, (yylsp[-3]).file); current_scope->add_declaration(CPPType::new_type(typedef_type), global_scope, current_lexer, (yylsp[-3])); } -#line 4320 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4254 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 78: -#line 1036 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyvsp[-1].u.inst_ident)->add_modifier(IIT_const); - CPPType *target_type = current_type; - CPPTypedefType *typedef_type = new CPPTypedefType(target_type, (yyvsp[-1].u.inst_ident), current_scope, (yylsp[-1]).file); - current_scope->add_declaration(CPPType::new_type(typedef_type), global_scope, current_lexer, (yylsp[-1])); -} -#line 4331 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 79: -#line 1043 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyvsp[-3].u.inst_ident)->add_modifier(IIT_const); - CPPType *target_type = current_type; - CPPTypedefType *typedef_type = new CPPTypedefType(target_type, (yyvsp[-3].u.inst_ident), current_scope, (yylsp[-3]).file); - current_scope->add_declaration(CPPType::new_type(typedef_type), global_scope, current_lexer, (yylsp[-3])); -} -#line 4342 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 80: -#line 1055 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 72: +#line 998 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { push_scope((yyvsp[-1].u.identifier)->get_scope(current_scope, global_scope)); } -#line 4350 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4262 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 81: -#line 1059 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 73: +#line 1002 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type; if ((yyvsp[-5].u.identifier)->get_simple_name() == current_scope->get_simple_name() || @@ -4370,19 +4282,19 @@ yyreduce: (yyval.u.instance) = new CPPInstance(type, ii, 0, (yylsp[-5]).file); } -#line 4374 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4286 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 82: -#line 1079 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 74: +#line 1022 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { push_scope((yyvsp[-1].u.identifier)->get_scope(current_scope, global_scope)); } -#line 4382 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4294 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 83: -#line 1083 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 75: +#line 1026 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { pop_scope(); CPPType *type; @@ -4400,19 +4312,19 @@ yyreduce: (yyval.u.instance) = new CPPInstance(type, ii, 0, (yylsp[-5]).file); } -#line 4404 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4316 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 84: -#line 1106 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 76: +#line 1049 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { push_scope((yyvsp[-1].u.identifier)->get_scope(current_scope, global_scope)); } -#line 4412 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4324 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 85: -#line 1110 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 77: +#line 1053 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { pop_scope(); if ((yyvsp[-5].u.identifier)->is_scoped()) { @@ -4431,19 +4343,19 @@ yyreduce: (yyval.u.instance) = new CPPInstance(type, ii, 0, (yylsp[-5]).file); } } -#line 4435 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4347 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 86: -#line 1136 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 78: +#line 1079 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { push_scope((yyvsp[-2].u.inst_ident)->get_scope(current_scope, global_scope)); } -#line 4443 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4355 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 87: -#line 1140 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 79: +#line 1083 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { pop_scope(); CPPType *type = (yyvsp[-10].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); @@ -4457,19 +4369,19 @@ yyreduce: ii->add_func_modifier((yyvsp[-3].u.param_list), (yyvsp[-1].u.integer)); (yyval.u.instance) = new CPPInstance(type, ii, 0, (yylsp[-10]).file); } -#line 4461 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4373 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 88: -#line 1154 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 80: +#line 1097 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { push_scope((yyvsp[-2].u.inst_ident)->get_scope(current_scope, global_scope)); } -#line 4469 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4381 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 89: -#line 1158 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 81: +#line 1101 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { pop_scope(); CPPType *type = (yyvsp[-11].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); @@ -4483,21 +4395,21 @@ yyreduce: ii->add_func_modifier((yyvsp[-3].u.param_list), (yyvsp[-1].u.integer)); (yyval.u.instance) = new CPPInstance(type, ii, 0, (yylsp[-11]).file); } -#line 4487 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4399 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 90: -#line 1174 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 82: +#line 1117 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { if ((yyvsp[-3].u.identifier) != NULL) { push_scope((yyvsp[-3].u.identifier)->get_scope(current_scope, global_scope)); } } -#line 4497 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4409 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 91: -#line 1180 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 83: +#line 1123 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { if ((yyvsp[-7].u.identifier) != NULL) { pop_scope(); @@ -4522,21 +4434,21 @@ yyreduce: (yyval.u.instance) = CPPInstance::make_typecast_function (new CPPInstance((yyvsp[-6].u.type), (yyvsp[-5].u.inst_ident), 0, (yylsp[-5]).file), ident, (yyvsp[-2].u.param_list), (yyvsp[0].u.integer)); } -#line 4526 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4438 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 92: -#line 1205 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 84: +#line 1148 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { if ((yyvsp[-4].u.identifier) != NULL) { push_scope((yyvsp[-4].u.identifier)->get_scope(current_scope, global_scope)); } } -#line 4536 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4448 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 93: -#line 1211 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 85: +#line 1154 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { if ((yyvsp[-8].u.identifier) != NULL) { pop_scope(); @@ -4552,11 +4464,11 @@ yyreduce: (yyval.u.instance) = CPPInstance::make_typecast_function (new CPPInstance((yyvsp[-6].u.type), (yyvsp[-5].u.inst_ident), 0, (yylsp[-5]).file), ident, (yyvsp[-2].u.param_list), (yyvsp[0].u.integer)); } -#line 4556 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4468 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 94: -#line 1231 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 86: +#line 1174 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPDeclaration *decl = (yyvsp[0].u.identifier)->find_symbol(current_scope, global_scope, current_lexer); @@ -4566,494 +4478,494 @@ yyreduce: (yyval.u.instance) = (CPPInstance *)NULL; } } -#line 4570 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4482 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 95: -#line 1244 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 87: +#line 1187 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.integer) = 0; } -#line 4578 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4490 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 96: -#line 1248 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 88: +#line 1191 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.integer) = (int)CPPFunctionType::F_const_method; } -#line 4586 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4498 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 97: -#line 1252 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 89: +#line 1195 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.integer) = (int)CPPFunctionType::F_noexcept; } -#line 4594 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4506 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 98: -#line 1256 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 90: +#line 1199 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.integer) = (int)CPPFunctionType::F_final; } -#line 4602 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4514 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 99: -#line 1260 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 91: +#line 1203 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.integer) = (int)CPPFunctionType::F_override; } -#line 4610 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4522 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 100: -#line 1264 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 92: +#line 1207 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // Used for lambdas, currently ignored. (yyval.u.integer) = 0; } -#line 4619 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4531 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 93: +#line 1212 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.integer) = (yyvsp[-3].u.integer); +} +#line 4539 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 94: +#line 1216 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.integer) = (yyvsp[-4].u.integer); +} +#line 4547 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 95: +#line 1227 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.str) = "!"; +} +#line 4555 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 96: +#line 1231 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.str) = "~"; +} +#line 4563 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 97: +#line 1235 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.str) = "*"; +} +#line 4571 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 98: +#line 1239 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.str) = "/"; +} +#line 4579 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 99: +#line 1243 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.str) = "%"; +} +#line 4587 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 100: +#line 1247 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.str) = "+"; +} +#line 4595 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 101: -#line 1269 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1251 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[-3].u.integer); + (yyval.str) = "-"; +} +#line 4603 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 102: +#line 1255 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.str) = "|"; +} +#line 4611 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 103: +#line 1259 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.str) = "&"; +} +#line 4619 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 104: +#line 1263 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.str) = "^"; } #line 4627 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 102: -#line 1273 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 105: +#line 1267 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[-4].u.integer); + (yyval.str) = "||"; } #line 4635 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 103: -#line 1284 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 106: +#line 1271 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "!"; + (yyval.str) = "&&"; } #line 4643 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 104: -#line 1288 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 107: +#line 1275 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "~"; + (yyval.str) = "=="; } #line 4651 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 105: -#line 1292 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 108: +#line 1279 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "*"; + (yyval.str) = "!="; } #line 4659 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 106: -#line 1296 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 109: +#line 1283 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "/"; + (yyval.str) = "<="; } #line 4667 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 107: -#line 1300 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 110: +#line 1287 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "%"; + (yyval.str) = ">="; } #line 4675 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 108: -#line 1304 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 111: +#line 1291 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "+"; + (yyval.str) = "<"; } #line 4683 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 109: -#line 1308 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 112: +#line 1295 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "-"; + (yyval.str) = ">"; } #line 4691 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 110: -#line 1312 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 113: +#line 1299 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "|"; + (yyval.str) = "<<"; } #line 4699 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 111: -#line 1316 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 114: +#line 1303 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "&"; + (yyval.str) = ">>"; } #line 4707 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 112: -#line 1320 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 115: +#line 1307 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "^"; + (yyval.str) = "="; } #line 4715 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 113: -#line 1324 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 116: +#line 1311 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "||"; + (yyval.str) = ","; } #line 4723 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 114: -#line 1328 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 117: +#line 1315 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "&&"; + (yyval.str) = "++"; } #line 4731 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 115: -#line 1332 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 118: +#line 1319 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "=="; + (yyval.str) = "--"; } #line 4739 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 116: -#line 1336 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 119: +#line 1323 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "!="; + (yyval.str) = "*="; } #line 4747 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 117: -#line 1340 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 120: +#line 1327 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "<="; + (yyval.str) = "/="; } #line 4755 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 118: -#line 1344 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 121: +#line 1331 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = ">="; + (yyval.str) = "%="; } #line 4763 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 119: -#line 1348 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 122: +#line 1335 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "<"; + (yyval.str) = "+="; } #line 4771 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 120: -#line 1352 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 123: +#line 1339 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = ">"; + (yyval.str) = "-="; } #line 4779 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 121: -#line 1356 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 124: +#line 1343 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "<<"; + (yyval.str) = "|="; } #line 4787 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 122: -#line 1360 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 125: +#line 1347 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = ">>"; + (yyval.str) = "&="; } #line 4795 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 123: -#line 1364 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 126: +#line 1351 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "="; + (yyval.str) = "^="; } #line 4803 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 124: -#line 1368 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 127: +#line 1355 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = ","; + (yyval.str) = "<<="; } #line 4811 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 125: -#line 1372 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 128: +#line 1359 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "++"; + (yyval.str) = ">>="; } #line 4819 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 126: -#line 1376 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 129: +#line 1363 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "--"; + (yyval.str) = "->"; } #line 4827 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 127: -#line 1380 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 130: +#line 1367 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "*="; + (yyval.str) = "[]"; } #line 4835 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 128: -#line 1384 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 131: +#line 1371 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "/="; + (yyval.str) = "()"; } #line 4843 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 129: -#line 1388 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 132: +#line 1375 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "%="; + (yyval.str) = "new"; } #line 4851 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 130: -#line 1392 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 133: +#line 1379 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "+="; + (yyval.str) = "delete"; } #line 4859 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 131: -#line 1396 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 136: +#line 1391 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "-="; + push_scope(new CPPTemplateScope(current_scope)); } #line 4867 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 132: -#line 1400 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 137: +#line 1395 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "|="; + pop_scope(); } #line 4875 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 133: -#line 1404 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.str) = "&="; -} -#line 4883 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 134: + case 141: #line 1408 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "^="; + CPPTemplateScope *ts = current_scope->as_template_scope(); + assert(ts != NULL); + ts->add_template_parameter((yyvsp[0].u.decl)); } -#line 4891 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4885 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 135: -#line 1412 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 142: +#line 1414 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "<<="; + CPPTemplateScope *ts = current_scope->as_template_scope(); + assert(ts != NULL); + ts->add_template_parameter((yyvsp[0].u.decl)); } -#line 4899 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4895 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 136: -#line 1416 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 143: +#line 1423 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = ">>="; + (yyval.u.decl) = CPPType::new_type(new CPPClassTemplateParameter((yyvsp[0].u.identifier))); } -#line 4907 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 137: -#line 1420 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.str) = "->"; -} -#line 4915 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 138: -#line 1424 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.str) = "[]"; -} -#line 4923 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 139: -#line 1428 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.str) = "()"; -} -#line 4931 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 140: -#line 1432 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.str) = "new"; -} -#line 4939 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 141: -#line 1436 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.str) = "delete"; -} -#line 4947 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4903 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 144: -#line 1448 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1427 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - push_scope(new CPPTemplateScope(current_scope)); + (yyval.u.decl) = CPPType::new_type(new CPPClassTemplateParameter((yyvsp[-2].u.identifier), (yyvsp[0].u.type))); } -#line 4955 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4911 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 145: -#line 1452 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - pop_scope(); -} -#line 4963 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 149: -#line 1465 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - CPPTemplateScope *ts = current_scope->as_template_scope(); - assert(ts != NULL); - ts->add_template_parameter((yyvsp[0].u.decl)); -} -#line 4973 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 150: -#line 1471 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - CPPTemplateScope *ts = current_scope->as_template_scope(); - assert(ts != NULL); - ts->add_template_parameter((yyvsp[0].u.decl)); -} -#line 4983 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 151: -#line 1480 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1431 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.decl) = CPPType::new_type(new CPPClassTemplateParameter((yyvsp[0].u.identifier))); } -#line 4991 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4919 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 152: -#line 1484 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 146: +#line 1435 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.decl) = CPPType::new_type(new CPPClassTemplateParameter((yyvsp[-2].u.identifier), (yyvsp[0].u.type))); } -#line 4999 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4927 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 153: -#line 1488 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.decl) = CPPType::new_type(new CPPClassTemplateParameter((yyvsp[0].u.identifier))); -} -#line 5007 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 154: -#line 1492 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.decl) = CPPType::new_type(new CPPClassTemplateParameter((yyvsp[-2].u.identifier), (yyvsp[0].u.type))); -} -#line 5015 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 155: -#line 1496 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 147: +#line 1439 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPInstance *inst = new CPPInstance((yyvsp[-2].u.type), (yyvsp[-1].u.inst_ident), 0, (yylsp[-1]).file); inst->set_initializer((yyvsp[0].u.expr)); (yyval.u.decl) = inst; } -#line 5025 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4937 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 156: -#line 1502 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 148: +#line 1445 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyvsp[-1].u.inst_ident)->add_modifier(IIT_const); CPPInstance *inst = new CPPInstance((yyvsp[-2].u.type), (yyvsp[-1].u.inst_ident), 0, (yylsp[-1]).file); inst->set_initializer((yyvsp[0].u.expr)); (yyval.u.decl) = inst; } -#line 5036 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4948 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 157: -#line 1512 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 149: +#line 1455 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = CPPType::new_type((yyvsp[0].u.simple_type)); } -#line 5044 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4956 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 158: -#line 1516 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 150: +#line 1459 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { yywarning("Not a type: " + (yyvsp[0].u.identifier)->get_fully_scoped_name(), (yylsp[0])); (yyval.u.type) = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_unknown)); } -#line 5053 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4965 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 159: -#line 1521 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 151: +#line 1464 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if ((yyval.u.type) == NULL) { @@ -5061,19 +4973,19 @@ yyreduce: } assert((yyval.u.type) != NULL); } -#line 5065 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4977 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 160: -#line 1533 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 152: +#line 1476 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[0].u.identifier)); } -#line 5073 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4985 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 161: -#line 1537 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 153: +#line 1480 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // For an operator function. We implement this simply by building a // ficticious name for the function; in other respects it's just @@ -5087,11 +4999,11 @@ yyreduce: (yyval.u.inst_ident) = new CPPInstanceIdentifier(ident); } -#line 5091 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5003 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 162: -#line 1551 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 154: +#line 1494 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // A C++11 literal operator. if (!(yyvsp[-1].str).empty()) { @@ -5106,91 +5018,91 @@ yyreduce: (yyval.u.inst_ident) = new CPPInstanceIdentifier(ident); } -#line 5110 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5022 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 163: -#line 1566 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 155: +#line 1509 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_const); } -#line 5119 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5031 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 164: -#line 1571 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 156: +#line 1514 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_volatile); } -#line 5128 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5040 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 165: -#line 1576 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 157: +#line 1519 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_pointer); } -#line 5137 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5049 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 166: -#line 1581 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 158: +#line 1524 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_reference); } -#line 5146 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5058 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 167: -#line 1586 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 159: +#line 1529 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); } -#line 5155 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5067 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 168: -#line 1591 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 160: +#line 1534 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[-2].u.identifier)); } -#line 5164 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5076 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 169: -#line 1596 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 161: +#line 1539 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[-3].u.inst_ident); (yyval.u.inst_ident)->add_array_modifier((yyvsp[-1].u.expr)); } -#line 5173 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5085 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 170: -#line 1601 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 162: +#line 1544 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[-1].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_paren); } -#line 5182 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5094 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 171: -#line 1606 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 163: +#line 1549 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { push_scope((yyvsp[-1].u.inst_ident)->get_scope(current_scope, global_scope)); } -#line 5190 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5102 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 172: -#line 1610 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 164: +#line 1553 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { pop_scope(); (yyval.u.inst_ident) = (yyvsp[-5].u.inst_ident); @@ -5204,11 +5116,11 @@ yyreduce: (yyval.u.inst_ident)->add_func_modifier((yyvsp[-2].u.param_list), (yyvsp[0].u.integer)); } } -#line 5208 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5120 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 173: -#line 1628 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 165: +#line 1571 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // This is handled a bit awkwardly right now. Ideally it'd be wrapped // up in the instance_identifier rule, but then more needs to happen in @@ -5218,721 +5130,721 @@ yyreduce: } (yyval.u.inst_ident) = (yyvsp[-1].u.inst_ident); } -#line 5222 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5134 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 174: -#line 1638 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 166: +#line 1581 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // Bitfield definition. (yyvsp[-2].u.inst_ident)->_bit_width = (yyvsp[0].u.integer); (yyval.u.inst_ident) = (yyvsp[-2].u.inst_ident); } -#line 5232 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5144 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 175: -#line 1648 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 167: +#line 1591 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = NULL; } -#line 5240 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5152 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 176: -#line 1652 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 168: +#line 1595 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = (yyvsp[0].u.inst_ident)->unroll_type((yyvsp[-1].u.type)); } -#line 5248 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5160 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 177: -#line 1656 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 169: +#line 1599 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyvsp[0].u.inst_ident)->add_modifier(IIT_const); (yyval.u.type) = (yyvsp[0].u.inst_ident)->unroll_type((yyvsp[-1].u.type)); } -#line 5257 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5169 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 178: -#line 1665 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 170: +#line 1608 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.param_list) = new CPPParameterList; } -#line 5265 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5177 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 179: -#line 1669 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 171: +#line 1612 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.param_list) = new CPPParameterList; (yyval.u.param_list)->_includes_ellipsis = true; } -#line 5274 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5186 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 172: +#line 1617 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.param_list) = (yyvsp[0].u.param_list); +} +#line 5194 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 173: +#line 1621 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.param_list) = (yyvsp[-2].u.param_list); + (yyval.u.param_list)->_includes_ellipsis = true; +} +#line 5203 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 174: +#line 1626 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.param_list) = (yyvsp[-1].u.param_list); + (yyval.u.param_list)->_includes_ellipsis = true; +} +#line 5212 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 175: +#line 1634 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.param_list) = new CPPParameterList; + (yyval.u.param_list)->_parameters.push_back((yyvsp[0].u.instance)); +} +#line 5221 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 176: +#line 1639 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.param_list) = (yyvsp[-2].u.param_list); + (yyval.u.param_list)->_parameters.push_back((yyvsp[0].u.instance)); +} +#line 5230 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 177: +#line 1647 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.param_list) = new CPPParameterList; +} +#line 5238 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 178: +#line 1651 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.param_list) = new CPPParameterList; + (yyval.u.param_list)->_includes_ellipsis = true; +} +#line 5247 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 179: +#line 1656 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.param_list) = (yyvsp[0].u.param_list); +} +#line 5255 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 180: -#line 1674 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1660 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.param_list) = (yyvsp[0].u.param_list); + (yyval.u.param_list) = (yyvsp[-2].u.param_list); + (yyval.u.param_list)->_includes_ellipsis = true; +} +#line 5264 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 181: +#line 1665 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.param_list) = (yyvsp[-1].u.param_list); + (yyval.u.param_list)->_includes_ellipsis = true; +} +#line 5273 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 182: +#line 1673 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.param_list) = new CPPParameterList; + (yyval.u.param_list)->_parameters.push_back((yyvsp[0].u.instance)); } #line 5282 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 181: + case 183: #line 1678 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.param_list) = (yyvsp[-2].u.param_list); - (yyval.u.param_list)->_includes_ellipsis = true; + (yyval.u.param_list)->_parameters.push_back((yyvsp[0].u.instance)); } #line 5291 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 182: -#line 1683 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.param_list) = (yyvsp[-1].u.param_list); - (yyval.u.param_list)->_includes_ellipsis = true; -} -#line 5300 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 183: -#line 1691 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.param_list) = new CPPParameterList; - (yyval.u.param_list)->_parameters.push_back((yyvsp[0].u.instance)); -} -#line 5309 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - case 184: -#line 1696 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1686 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.param_list) = (yyvsp[-2].u.param_list); - (yyval.u.param_list)->_parameters.push_back((yyvsp[0].u.instance)); + (yyval.u.expr) = (CPPExpression *)NULL; } -#line 5318 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5299 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 185: -#line 1704 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1690 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.param_list) = new CPPParameterList; + (yyval.u.expr) = (yyvsp[0].u.expr); } -#line 5326 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5307 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 186: -#line 1708 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1697 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.param_list) = new CPPParameterList; - (yyval.u.param_list)->_includes_ellipsis = true; + (yyval.u.expr) = (CPPExpression *)NULL; } -#line 5335 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5315 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 187: -#line 1713 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1701 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.param_list) = (yyvsp[0].u.param_list); + (yyval.u.expr) = (yyvsp[0].u.expr); } -#line 5343 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5323 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 188: -#line 1717 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1708 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.param_list) = (yyvsp[-2].u.param_list); - (yyval.u.param_list)->_includes_ellipsis = true; + (yyval.u.expr) = (CPPExpression *)NULL; } -#line 5352 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5331 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 189: -#line 1722 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1712 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.param_list) = (yyvsp[-1].u.param_list); - (yyval.u.param_list)->_includes_ellipsis = true; + (yyval.u.expr) = (CPPExpression *)NULL; } -#line 5361 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5339 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 190: -#line 1730 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1716 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.param_list) = new CPPParameterList; - (yyval.u.param_list)->_parameters.push_back((yyvsp[0].u.instance)); + (yyval.u.expr) = (CPPExpression *)NULL; } -#line 5370 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5347 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 191: +#line 1720 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::get_default()); +} +#line 5355 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 192: +#line 1724 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::get_delete()); +} +#line 5363 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 193: +#line 1731 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (CPPExpression *)NULL; +} +#line 5371 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 194: #line 1735 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.param_list) = (yyvsp[-2].u.param_list); - (yyval.u.param_list)->_parameters.push_back((yyvsp[0].u.instance)); + (yyval.u.expr) = (CPPExpression *)NULL; } #line 5379 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 192: -#line 1743 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 195: +#line 1739 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = (CPPExpression *)NULL; + (yyval.u.expr) = (yyvsp[-1].u.expr); } #line 5387 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 193: -#line 1747 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 196: +#line 1743 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = (yyvsp[0].u.expr); + (yyval.u.expr) = new CPPExpression(CPPExpression::get_default()); } #line 5395 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 194: -#line 1754 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 197: +#line 1747 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = (CPPExpression *)NULL; + (yyval.u.expr) = new CPPExpression(CPPExpression::get_delete()); } #line 5403 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 195: -#line 1758 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 198: +#line 1751 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = (yyvsp[0].u.expr); + (yyval.u.expr) = (CPPExpression *)NULL; } #line 5411 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 196: -#line 1765 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (CPPExpression *)NULL; -} -#line 5419 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 197: -#line 1769 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (CPPExpression *)NULL; -} -#line 5427 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 198: -#line 1773 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (CPPExpression *)NULL; -} -#line 5435 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 199: -#line 1777 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::get_default()); -} -#line 5443 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 200: -#line 1781 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::get_delete()); -} -#line 5451 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 201: -#line 1788 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (CPPExpression *)NULL; -} -#line 5459 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - case 202: -#line 1792 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1764 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = (CPPExpression *)NULL; } -#line 5467 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 203: -#line 1796 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (yyvsp[-1].u.expr); -} -#line 5475 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 204: -#line 1800 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::get_default()); -} -#line 5483 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 205: -#line 1804 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::get_delete()); -} -#line 5491 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5418 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 206: -#line 1808 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (CPPExpression *)NULL; -} -#line 5499 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 210: -#line 1821 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { -} -#line 5506 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 214: -#line 1830 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1773 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.instance) = new CPPInstance((yyvsp[-2].u.type), (yyvsp[-1].u.inst_ident), 0, (yylsp[-1]).file); (yyval.u.instance)->set_initializer((yyvsp[0].u.expr)); } -#line 5515 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5427 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 215: -#line 1835 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 207: +#line 1778 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyvsp[-1].u.inst_ident)->add_modifier(IIT_const); (yyval.u.instance) = new CPPInstance((yyvsp[-2].u.type), (yyvsp[-1].u.inst_ident), 0, (yylsp[-1]).file); (yyval.u.instance)->set_initializer((yyvsp[0].u.expr)); } -#line 5525 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5437 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 216: -#line 1841 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 208: +#line 1784 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyvsp[-1].u.inst_ident)->add_modifier(IIT_const); (yyval.u.instance) = new CPPInstance((yyvsp[-2].u.type), (yyvsp[-1].u.inst_ident), 0, (yylsp[-2]).file); (yyval.u.instance)->set_initializer((yyvsp[0].u.expr)); } -#line 5535 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5447 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 217: -#line 1847 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 209: +#line 1790 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.instance) = (yyvsp[0].u.instance); } -#line 5543 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5455 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 218: -#line 1858 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 210: +#line 1801 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.instance) = (yyvsp[0].u.instance); } -#line 5551 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5463 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 219: -#line 1862 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 211: +#line 1805 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_parameter)); (yyval.u.instance) = new CPPInstance(type, "expr"); (yyval.u.instance)->set_initializer((yyvsp[0].u.expr)); } -#line 5562 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5474 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 220: -#line 1872 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 212: +#line 1815 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); } -#line 5570 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5482 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 213: +#line 1819 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[0].u.identifier)); +} +#line 5490 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 214: +#line 1823 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_const); +} +#line 5499 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 215: +#line 1828 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_volatile); +} +#line 5508 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 216: +#line 1833 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_pointer); +} +#line 5517 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 217: +#line 1838 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_reference); +} +#line 5526 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 218: +#line 1843 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); +} +#line 5535 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 219: +#line 1848 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[-2].u.identifier)); +} +#line 5544 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 220: +#line 1853 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[-3].u.inst_ident); + (yyval.u.inst_ident)->add_array_modifier((yyvsp[-1].u.expr)); +} +#line 5553 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 221: -#line 1876 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1861 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); +} +#line 5561 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 222: +#line 1865 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[0].u.identifier)); } +#line 5569 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 223: +#line 1869 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_const); +} #line 5578 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 222: -#line 1880 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 224: +#line 1874 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_const); + (yyval.u.inst_ident)->add_modifier(IIT_volatile); } #line 5587 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 223: -#line 1885 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 225: +#line 1879 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_volatile); + (yyval.u.inst_ident)->add_modifier(IIT_pointer); } #line 5596 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 224: -#line 1890 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 226: +#line 1884 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_pointer); + (yyval.u.inst_ident)->add_modifier(IIT_reference); } #line 5605 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 225: -#line 1895 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 227: +#line 1889 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_reference); + (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); } #line 5614 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 226: -#line 1900 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 228: +#line 1894 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); + (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[-2].u.identifier)); } #line 5623 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 227: -#line 1905 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 229: +#line 1899 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[-2].u.identifier)); + (yyval.u.inst_ident) = (yyvsp[-3].u.inst_ident); + (yyval.u.inst_ident)->add_array_modifier((yyvsp[-1].u.expr)); } #line 5632 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 228: -#line 1910 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[-3].u.inst_ident); - (yyval.u.inst_ident)->add_array_modifier((yyvsp[-1].u.expr)); -} -#line 5641 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 229: -#line 1918 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); -} -#line 5649 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - case 230: -#line 1922 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[0].u.identifier)); -} -#line 5657 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 231: -#line 1926 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_const); -} -#line 5666 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 232: -#line 1931 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_volatile); -} -#line 5675 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 233: -#line 1936 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_pointer); -} -#line 5684 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 234: -#line 1941 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_reference); -} -#line 5693 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 235: -#line 1946 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); -} -#line 5702 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 236: -#line 1951 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[-2].u.identifier)); -} -#line 5711 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 237: -#line 1956 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[-3].u.inst_ident); - (yyval.u.inst_ident)->add_array_modifier((yyvsp[-1].u.expr)); -} -#line 5720 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 238: -#line 1961 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1904 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[-5].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_paren); (yyval.u.inst_ident)->add_func_modifier((yyvsp[-2].u.param_list), (yyvsp[0].u.integer)); } -#line 5730 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5642 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 239: -#line 1967 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 231: +#line 1910 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[-1].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_paren); } -#line 5739 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5651 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 240: -#line 1975 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 232: +#line 1918 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); } -#line 5747 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5659 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 241: -#line 1979 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 233: +#line 1922 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_const); } -#line 5756 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5668 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 242: -#line 1984 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 234: +#line 1927 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_volatile); } -#line 5765 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5677 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 243: -#line 1989 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 235: +#line 1932 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_pointer); } -#line 5774 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5686 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 244: -#line 1994 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 236: +#line 1937 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_reference); } -#line 5783 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5695 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 245: -#line 1999 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 237: +#line 1942 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); } -#line 5792 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5704 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 246: -#line 2004 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 238: +#line 1947 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[-2].u.identifier)); } -#line 5801 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5713 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 247: -#line 2009 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 239: +#line 1952 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[-3].u.inst_ident); (yyval.u.inst_ident)->add_array_modifier((yyvsp[-1].u.expr)); } -#line 5810 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5722 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 248: -#line 2017 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 240: +#line 1960 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); } -#line 5818 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5730 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 249: -#line 2021 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 241: +#line 1964 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_const); } -#line 5827 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5739 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 250: -#line 2026 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 242: +#line 1969 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_volatile); } +#line 5748 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 243: +#line 1974 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_pointer); +} +#line 5757 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 244: +#line 1979 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_reference); +} +#line 5766 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 245: +#line 1984 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); +} +#line 5775 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 246: +#line 1989 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[-2].u.identifier)); +} +#line 5784 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 247: +#line 1994 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[-3].u.inst_ident); + (yyval.u.inst_ident)->add_array_modifier((yyvsp[-1].u.expr)); +} +#line 5793 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 248: +#line 1999 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); + (yyval.u.inst_ident)->add_modifier(IIT_paren); + (yyval.u.inst_ident)->add_func_modifier((yyvsp[-3].u.param_list), (yyvsp[-1].u.integer), (yyvsp[0].u.type)); +} +#line 5803 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 249: +#line 2005 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[-6].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_pointer); + (yyval.u.inst_ident)->add_modifier(IIT_paren); + (yyval.u.inst_ident)->add_func_modifier((yyvsp[-3].u.param_list), (yyvsp[-1].u.integer), (yyvsp[0].u.type)); +} +#line 5814 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 250: +#line 2012 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[-6].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_reference); + (yyval.u.inst_ident)->add_modifier(IIT_paren); + (yyval.u.inst_ident)->add_func_modifier((yyvsp[-3].u.param_list), (yyvsp[-1].u.integer), (yyvsp[0].u.type)); +} +#line 5825 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 251: +#line 2019 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[-6].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); + (yyval.u.inst_ident)->add_modifier(IIT_paren); + (yyval.u.inst_ident)->add_func_modifier((yyvsp[-3].u.param_list), (yyvsp[-1].u.integer), (yyvsp[0].u.type)); +} #line 5836 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 251: -#line 2031 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_pointer); -} -#line 5845 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - case 252: -#line 2036 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_reference); -} -#line 5854 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 253: -#line 2041 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); -} -#line 5863 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 254: -#line 2046 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[-2].u.identifier)); -} -#line 5872 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 255: -#line 2051 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[-3].u.inst_ident); - (yyval.u.inst_ident)->add_array_modifier((yyvsp[-1].u.expr)); -} -#line 5881 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 256: -#line 2056 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); - (yyval.u.inst_ident)->add_modifier(IIT_paren); - (yyval.u.inst_ident)->add_func_modifier((yyvsp[-3].u.param_list), (yyvsp[-1].u.integer), (yyvsp[0].u.type)); -} -#line 5891 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 257: -#line 2062 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[-6].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_pointer); - (yyval.u.inst_ident)->add_modifier(IIT_paren); - (yyval.u.inst_ident)->add_func_modifier((yyvsp[-3].u.param_list), (yyvsp[-1].u.integer), (yyvsp[0].u.type)); -} -#line 5902 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 258: -#line 2069 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[-6].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_reference); - (yyval.u.inst_ident)->add_modifier(IIT_paren); - (yyval.u.inst_ident)->add_func_modifier((yyvsp[-3].u.param_list), (yyvsp[-1].u.integer), (yyvsp[0].u.type)); -} -#line 5913 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 259: -#line 2076 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[-6].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); - (yyval.u.inst_ident)->add_modifier(IIT_paren); - (yyval.u.inst_ident)->add_func_modifier((yyvsp[-3].u.param_list), (yyvsp[-1].u.integer), (yyvsp[0].u.type)); -} -#line 5924 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 260: -#line 2086 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 2029 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = CPPType::new_type((yyvsp[0].u.simple_type)); } -#line 5932 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5844 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 261: -#line 2090 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 253: +#line 2033 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if ((yyval.u.type) == NULL) { @@ -5940,43 +5852,43 @@ yyreduce: } assert((yyval.u.type) != NULL); } -#line 5944 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5856 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 262: -#line 2098 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 254: +#line 2041 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = CPPType::new_type(new CPPTBDType((yyvsp[0].u.identifier))); } -#line 5952 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5864 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 263: -#line 2102 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 255: +#line 2045 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = CPPType::new_type((yyvsp[0].u.struct_type)); } -#line 5960 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5872 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 264: -#line 2106 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 256: +#line 2049 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = CPPType::new_type((yyvsp[0].u.struct_type)); } -#line 5968 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5880 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 265: -#line 2110 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 257: +#line 2053 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = CPPType::new_type((yyvsp[0].u.enum_type)); } -#line 5976 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5888 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 266: -#line 2114 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 258: +#line 2057 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if (type != NULL) { @@ -5992,11 +5904,11 @@ yyreduce: (yyval.u.type) = et; } } -#line 5996 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5908 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 267: -#line 2130 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 259: +#line 2073 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = (yyvsp[-2].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if (type != NULL) { @@ -6012,11 +5924,11 @@ yyreduce: (yyval.u.type) = et; } } -#line 6016 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5928 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 268: -#line 2146 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 260: +#line 2089 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = (yyvsp[-1].u.expr)->determine_type(); if ((yyval.u.type) == (CPPType *)NULL) { @@ -6025,27 +5937,27 @@ yyreduce: yyerror("could not determine type of " + str.str(), (yylsp[-1])); } } -#line 6029 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5941 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 269: -#line 2155 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 261: +#line 2098 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_auto)); } -#line 6037 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5949 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 270: -#line 2162 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 262: +#line 2105 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.decl) = CPPType::new_type((yyvsp[0].u.simple_type)); } -#line 6045 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5957 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 271: -#line 2166 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 263: +#line 2109 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.decl) = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if ((yyval.u.decl) == NULL) { @@ -6053,43 +5965,43 @@ yyreduce: } assert((yyval.u.decl) != NULL); } -#line 6057 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5969 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 272: -#line 2174 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 264: +#line 2117 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.decl) = CPPType::new_type(new CPPTBDType((yyvsp[0].u.identifier))); } -#line 6065 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5977 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 273: -#line 2178 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 265: +#line 2121 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.decl) = CPPType::new_type((yyvsp[0].u.struct_type)); } -#line 6073 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5985 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 274: -#line 2182 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 266: +#line 2125 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.decl) = new CPPTypeDeclaration(CPPType::new_type((yyvsp[0].u.struct_type))); } -#line 6081 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5993 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 275: -#line 2186 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 267: +#line 2129 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.decl) = new CPPTypeDeclaration(CPPType::new_type((yyvsp[0].u.enum_type))); } -#line 6089 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6001 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 276: -#line 2190 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 268: +#line 2133 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if (type != NULL) { @@ -6105,11 +6017,11 @@ yyreduce: (yyval.u.decl) = et; } } -#line 6109 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6021 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 277: -#line 2206 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 269: +#line 2149 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = (yyvsp[-2].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if (type != NULL) { @@ -6125,11 +6037,11 @@ yyreduce: (yyval.u.decl) = et; } } -#line 6129 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6041 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 278: -#line 2222 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 270: +#line 2165 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { yywarning(string("C++ does not permit forward declaration of untyped enum ") + (yyvsp[0].u.identifier)->get_fully_scoped_name(), (yylsp[-1])); @@ -6147,11 +6059,11 @@ yyreduce: (yyval.u.decl) = et; } } -#line 6151 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6063 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 279: -#line 2240 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 271: +#line 2183 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.decl) = (yyvsp[-1].u.expr)->determine_type(); if ((yyval.u.decl) == (CPPType *)NULL) { @@ -6160,27 +6072,27 @@ yyreduce: yyerror("could not determine type of " + str.str(), (yylsp[-1])); } } -#line 6164 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6076 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 280: -#line 2249 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 272: +#line 2192 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.decl) = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_auto)); } -#line 6172 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6084 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 281: -#line 2256 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 273: +#line 2199 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = CPPType::new_type((yyvsp[0].u.simple_type)); } -#line 6180 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6092 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 282: -#line 2260 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 274: +#line 2203 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if ((yyval.u.type) == NULL) { @@ -6188,19 +6100,19 @@ yyreduce: } assert((yyval.u.type) != NULL); } -#line 6192 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6104 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 283: -#line 2268 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 275: +#line 2211 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = CPPType::new_type(new CPPTBDType((yyvsp[0].u.identifier))); } -#line 6200 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6112 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 284: -#line 2272 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 276: +#line 2215 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if (type != NULL) { @@ -6216,11 +6128,11 @@ yyreduce: (yyval.u.type) = et; } } -#line 6220 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6132 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 285: -#line 2288 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 277: +#line 2231 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if (type != NULL) { @@ -6236,11 +6148,11 @@ yyreduce: (yyval.u.type) = et; } } -#line 6240 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6152 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 286: -#line 2304 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 278: +#line 2247 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = (yyvsp[-1].u.expr)->determine_type(); if ((yyval.u.type) == (CPPType *)NULL) { @@ -6249,54 +6161,54 @@ yyreduce: yyerror("could not determine type of " + str.str(), (yylsp[-1])); } } -#line 6253 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6165 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 287: -#line 2313 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 279: +#line 2256 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_auto)); } -#line 6261 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6173 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 288: -#line 2320 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 280: +#line 2263 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.decl) = (yyvsp[0].u.decl); } -#line 6269 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6181 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 289: -#line 2324 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 281: +#line 2267 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { yyerror(string("unknown type '") + (yyvsp[0].u.identifier)->get_fully_scoped_name() + "'", (yylsp[0])); (yyval.u.decl) = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_unknown)); } -#line 6279 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6191 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 290: -#line 2332 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 282: +#line 2275 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = (yyvsp[0].u.inst_ident)->unroll_type((yyvsp[-1].u.type)); } -#line 6287 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6199 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 291: -#line 2336 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 283: +#line 2279 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyvsp[0].u.inst_ident)->add_modifier(IIT_const); (yyval.u.type) = (yyvsp[0].u.inst_ident)->unroll_type((yyvsp[-1].u.type)); } -#line 6296 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6208 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 292: -#line 2344 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 284: +#line 2287 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPVisibility starting_vis = ((yyvsp[-1].u.extension_enum) == CPPExtensionType::T_class) ? V_private : V_public; @@ -6310,22 +6222,22 @@ yyreduce: push_scope(new_scope); push_struct(st); } -#line 6314 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6226 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 293: -#line 2358 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 285: +#line 2301 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.struct_type) = current_struct; current_struct->_incomplete = false; pop_struct(); pop_scope(); } -#line 6325 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6237 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 294: -#line 2368 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 286: +#line 2311 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPVisibility starting_vis = ((yyvsp[-1].u.extension_enum) == CPPExtensionType::T_class) ? V_private : V_public; @@ -6345,253 +6257,253 @@ yyreduce: push_scope(new_scope); push_struct(st); } -#line 6349 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6261 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 295: -#line 2388 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 287: +#line 2331 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.struct_type) = current_struct; current_struct->_incomplete = false; pop_struct(); pop_scope(); } -#line 6360 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6272 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 297: -#line 2399 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 289: +#line 2342 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_struct->_final = true; } -#line 6368 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6280 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 302: -#line 2416 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 294: +#line 2359 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_struct->append_derivation((yyvsp[0].u.type), V_unknown, false); } -#line 6376 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6288 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 303: -#line 2420 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 295: +#line 2363 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_struct->append_derivation((yyvsp[0].u.type), V_public, false); } -#line 6384 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6296 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 304: -#line 2424 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 296: +#line 2367 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_struct->append_derivation((yyvsp[0].u.type), V_protected, false); } -#line 6392 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6304 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 305: -#line 2428 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 297: +#line 2371 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_struct->append_derivation((yyvsp[0].u.type), V_private, false); } -#line 6400 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6312 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 306: -#line 2432 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 298: +#line 2375 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_struct->append_derivation((yyvsp[0].u.type), V_public, true); } -#line 6408 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6320 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 307: -#line 2436 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 299: +#line 2379 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_struct->append_derivation((yyvsp[0].u.type), V_protected, true); } -#line 6416 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6328 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 308: -#line 2440 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 300: +#line 2383 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_struct->append_derivation((yyvsp[0].u.type), V_private, true); } -#line 6424 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6336 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 309: -#line 2444 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 301: +#line 2387 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_struct->append_derivation((yyvsp[0].u.type), V_public, true); } -#line 6432 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6344 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 310: -#line 2448 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 302: +#line 2391 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_struct->append_derivation((yyvsp[0].u.type), V_protected, true); } -#line 6440 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6352 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 311: -#line 2452 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 303: +#line 2395 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_struct->append_derivation((yyvsp[0].u.type), V_private, true); } -#line 6448 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6360 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 312: -#line 2459 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 304: +#line 2402 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.enum_type) = current_enum; current_enum = NULL; } -#line 6457 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6369 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 313: -#line 2467 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 305: +#line 2410 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_enum = new CPPEnumType((yyvsp[-2].u.extension_enum), NULL, (yyvsp[0].u.type), current_scope, NULL, (yylsp[-2]).file); } -#line 6465 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6377 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 314: -#line 2471 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 306: +#line 2414 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_enum = new CPPEnumType((yyvsp[0].u.extension_enum), NULL, current_scope, NULL, (yylsp[0]).file); } -#line 6473 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6385 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 315: -#line 2475 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 307: +#line 2418 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPScope *new_scope = new CPPScope(current_scope, (yyvsp[-2].u.identifier)->_names.back(), V_public); current_enum = new CPPEnumType((yyvsp[-3].u.extension_enum), (yyvsp[-2].u.identifier), (yyvsp[0].u.type), current_scope, new_scope, (yylsp[-3]).file); } -#line 6482 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6394 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 316: -#line 2480 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 308: +#line 2423 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPScope *new_scope = new CPPScope(current_scope, (yyvsp[0].u.identifier)->_names.back(), V_public); current_enum = new CPPEnumType((yyvsp[-1].u.extension_enum), (yyvsp[0].u.identifier), current_scope, new_scope, (yylsp[-1]).file); } -#line 6491 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6403 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 317: -#line 2488 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 309: +#line 2431 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = CPPType::new_type((yyvsp[0].u.simple_type)); } -#line 6499 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6411 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 318: -#line 2492 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 310: +#line 2435 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); } -#line 6507 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6419 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 320: -#line 2500 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 312: +#line 2443 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { assert(current_enum != NULL); current_enum->add_element((yyvsp[-1].u.identifier)->get_simple_name(), NULL, current_lexer, (yylsp[-1])); } -#line 6516 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6428 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 321: -#line 2505 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 313: +#line 2448 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { assert(current_enum != NULL); current_enum->add_element((yyvsp[-3].u.identifier)->get_simple_name(), (yyvsp[-1].u.expr), current_lexer, (yylsp[-3])); } -#line 6525 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6437 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 323: -#line 2513 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 315: +#line 2456 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { assert(current_enum != NULL); current_enum->add_element((yyvsp[0].u.identifier)->get_simple_name(), NULL, current_lexer, (yylsp[0])); } -#line 6534 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6446 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 324: -#line 2518 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 316: +#line 2461 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { assert(current_enum != NULL); current_enum->add_element((yyvsp[-2].u.identifier)->get_simple_name(), (yyvsp[0].u.expr), current_lexer, (yylsp[-2])); } -#line 6543 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6455 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 325: -#line 2526 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 317: +#line 2469 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.extension_enum) = CPPExtensionType::T_enum; } -#line 6551 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6463 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 326: -#line 2530 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 318: +#line 2473 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.extension_enum) = CPPExtensionType::T_enum_class; } -#line 6559 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6471 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 327: -#line 2534 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 319: +#line 2477 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.extension_enum) = CPPExtensionType::T_enum_struct; } -#line 6567 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6479 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 328: -#line 2541 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 320: +#line 2484 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.extension_enum) = CPPExtensionType::T_class; } -#line 6575 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6487 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 329: -#line 2545 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 321: +#line 2488 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.extension_enum) = CPPExtensionType::T_struct; } -#line 6583 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6495 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 330: -#line 2549 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 322: +#line 2492 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.extension_enum) = CPPExtensionType::T_union; } -#line 6591 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6503 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 331: -#line 2556 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 323: +#line 2499 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPScope *scope = (yyvsp[-1].u.identifier)->find_scope(current_scope, global_scope, current_lexer); if (scope == NULL) { @@ -6609,19 +6521,19 @@ yyreduce: current_scope->define_namespace(nspace); push_scope(scope); } -#line 6613 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6525 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 332: -#line 2574 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 324: +#line 2517 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { pop_scope(); } -#line 6621 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6533 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 333: -#line 2578 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 325: +#line 2521 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPScope *scope = (yyvsp[-1].u.identifier)->find_scope(current_scope, global_scope, current_lexer); if (scope == NULL) { @@ -6640,143 +6552,143 @@ yyreduce: current_scope->define_namespace(nspace); push_scope(scope); } -#line 6644 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6556 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 334: -#line 2597 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 326: +#line 2540 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { pop_scope(); } -#line 6652 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6564 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 337: -#line 2606 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 329: +#line 2549 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPUsing *using_decl = new CPPUsing((yyvsp[-1].u.identifier), false, (yylsp[-2]).file); current_scope->add_declaration(using_decl, global_scope, current_lexer, (yylsp[-2])); current_scope->add_using(using_decl, global_scope, current_lexer); } -#line 6662 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6574 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 338: -#line 2612 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 330: +#line 2555 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // This is really just an alternative way to declare a typedef. CPPTypedefType *typedef_type = new CPPTypedefType((yyvsp[-1].u.type), (yyvsp[-3].u.identifier), current_scope); typedef_type->_using = true; current_scope->add_declaration(CPPType::new_type(typedef_type), global_scope, current_lexer, (yylsp[-4])); } -#line 6673 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6585 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 339: -#line 2619 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 331: +#line 2562 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPUsing *using_decl = new CPPUsing((yyvsp[-1].u.identifier), true, (yylsp[-3]).file); current_scope->add_declaration(using_decl, global_scope, current_lexer, (yylsp[-3])); current_scope->add_using(using_decl, global_scope, current_lexer); } -#line 6683 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6595 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 343: -#line 2634 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 335: +#line 2577 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_bool); } -#line 6691 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6603 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 344: -#line 2638 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 336: +#line 2581 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_char); } -#line 6699 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6611 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 345: -#line 2642 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 337: +#line 2585 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_wchar_t); } -#line 6707 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6619 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 346: -#line 2646 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 338: +#line 2589 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_char16_t); } -#line 6715 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6627 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 347: -#line 2650 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 339: +#line 2593 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_char32_t); } -#line 6723 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6635 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 348: -#line 2654 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 340: +#line 2597 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_short); } -#line 6732 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6644 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 349: -#line 2659 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 341: +#line 2602 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_long); } -#line 6741 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6653 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 350: -#line 2664 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 342: +#line 2607 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_unsigned); } -#line 6750 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6662 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 351: -#line 2669 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 343: +#line 2612 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_signed); } -#line 6759 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6671 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 352: -#line 2674 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 344: +#line 2617 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int); } -#line 6767 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6679 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 353: -#line 2678 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 345: +#line 2621 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = (yyvsp[0].u.simple_type); (yyval.u.simple_type)->_flags |= CPPSimpleType::F_short; } -#line 6776 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6688 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 354: -#line 2683 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 346: +#line 2626 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = (yyvsp[0].u.simple_type); if ((yyval.u.simple_type)->_flags & CPPSimpleType::F_long) { @@ -6785,477 +6697,477 @@ yyreduce: (yyval.u.simple_type)->_flags |= CPPSimpleType::F_long; } } -#line 6789 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6701 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 355: -#line 2692 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 347: +#line 2635 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = (yyvsp[0].u.simple_type); (yyval.u.simple_type)->_flags |= CPPSimpleType::F_unsigned; } -#line 6798 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6710 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 356: -#line 2697 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 348: +#line 2640 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = (yyvsp[0].u.simple_type); (yyval.u.simple_type)->_flags |= CPPSimpleType::F_signed; } -#line 6807 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6719 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 357: -#line 2705 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 349: +#line 2648 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_float); } -#line 6815 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6727 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 358: -#line 2709 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 350: +#line 2652 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_double); } -#line 6823 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6735 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 359: -#line 2713 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 351: +#line 2656 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_double, CPPSimpleType::F_long); } -#line 6832 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6744 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 360: -#line 2721 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 352: +#line 2664 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_void); } -#line 6840 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6752 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 361: -#line 2730 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 353: +#line 2673 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_lexer->_resolve_identifiers = false; } -#line 6848 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6760 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 362: -#line 2734 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 354: +#line 2677 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_lexer->_resolve_identifiers = true; } -#line 6856 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6768 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 465: -#line 2775 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 457: +#line 2718 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { } +#line 6775 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 481: +#line 2727 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (CPPExpression *)NULL; +} +#line 6783 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 482: +#line 2731 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (yyvsp[0].u.expr); +} +#line 6791 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 483: +#line 2738 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (CPPExpression *)NULL; +} +#line 6799 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 484: +#line 2742 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (yyvsp[0].u.expr); +} +#line 6807 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 485: +#line 2749 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (yyvsp[0].u.expr); +} +#line 6815 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 486: +#line 2753 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(',', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 6823 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 487: +#line 2760 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (yyvsp[0].u.expr); +} +#line 6831 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 488: +#line 2764 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-2].u.type), (yyvsp[0].u.expr))); +} +#line 6839 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 489: +#line 2768 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_static_cast)); +} +#line 6847 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 490: +#line 2772 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_dynamic_cast)); +} +#line 6855 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 491: +#line 2776 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_const_cast)); +} #line 6863 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 489: -#line 2784 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 492: +#line 2780 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = (CPPExpression *)NULL; + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_reinterpret_cast)); } #line 6871 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 490: -#line 2788 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 493: +#line 2784 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = (yyvsp[0].u.expr); + (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_func((yyvsp[-1].u.type))); } #line 6879 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 491: -#line 2795 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 494: +#line 2788 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = (CPPExpression *)NULL; + (yyval.u.expr) = new CPPExpression(CPPExpression::alignof_func((yyvsp[-1].u.type))); } #line 6887 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 492: -#line 2799 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 495: +#line 2792 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = (yyvsp[0].u.expr); + (yyval.u.expr) = new CPPExpression(UNARY_NOT, (yyvsp[0].u.expr)); } #line 6895 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 493: -#line 2806 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 496: +#line 2796 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = (yyvsp[0].u.expr); + (yyval.u.expr) = new CPPExpression(UNARY_NEGATE, (yyvsp[0].u.expr)); } #line 6903 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 494: -#line 2810 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 497: +#line 2800 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(',', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(UNARY_MINUS, (yyvsp[0].u.expr)); } #line 6911 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 495: -#line 2817 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 498: +#line 2804 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = (yyvsp[0].u.expr); + (yyval.u.expr) = new CPPExpression(UNARY_PLUS, (yyvsp[0].u.expr)); } #line 6919 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 496: -#line 2821 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 499: +#line 2808 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-2].u.type), (yyvsp[0].u.expr))); + (yyval.u.expr) = new CPPExpression(UNARY_STAR, (yyvsp[0].u.expr)); } #line 6927 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 497: -#line 2825 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 500: +#line 2812 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_static_cast)); + (yyval.u.expr) = new CPPExpression(UNARY_REF, (yyvsp[0].u.expr)); } #line 6935 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 498: -#line 2829 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 501: +#line 2816 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_dynamic_cast)); + (yyval.u.expr) = new CPPExpression('*', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 6943 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 499: -#line 2833 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 502: +#line 2820 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_const_cast)); + (yyval.u.expr) = new CPPExpression('/', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 6951 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 500: -#line 2837 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 503: +#line 2824 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_reinterpret_cast)); + (yyval.u.expr) = new CPPExpression('%', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 6959 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 501: -#line 2841 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 504: +#line 2828 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_func((yyvsp[-1].u.type))); + (yyval.u.expr) = new CPPExpression('+', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 6967 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 502: -#line 2845 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 505: +#line 2832 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(CPPExpression::alignof_func((yyvsp[-1].u.type))); + (yyval.u.expr) = new CPPExpression('-', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 6975 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 503: -#line 2849 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 506: +#line 2836 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(UNARY_NOT, (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression('|', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 6983 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 504: -#line 2853 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 507: +#line 2840 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(UNARY_NEGATE, (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression('^', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 6991 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 505: -#line 2857 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 508: +#line 2844 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(UNARY_MINUS, (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression('&', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 6999 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 506: -#line 2861 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 509: +#line 2848 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(UNARY_PLUS, (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(OROR, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7007 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 507: -#line 2865 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 510: +#line 2852 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(UNARY_STAR, (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(ANDAND, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7015 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 508: -#line 2869 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 511: +#line 2856 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(UNARY_REF, (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(EQCOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7023 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 509: -#line 2873 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 512: +#line 2860 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('*', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(NECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7031 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 510: -#line 2877 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 513: +#line 2864 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('/', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(LECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7039 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 511: -#line 2881 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 514: +#line 2868 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('%', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(GECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7047 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 512: -#line 2885 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 515: +#line 2872 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('+', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(LSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7055 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 513: -#line 2889 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 516: +#line 2876 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('-', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(RSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7063 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 514: -#line 2893 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 517: +#line 2880 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('|', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression('?', (yyvsp[-4].u.expr), (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7071 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 515: -#line 2897 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 518: +#line 2884 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('^', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression('[', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); } #line 7079 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 516: -#line 2901 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 519: +#line 2888 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('&', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression('f', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); } #line 7087 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 517: -#line 2905 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 520: +#line 2892 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(OROR, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression('f', (yyvsp[-2].u.expr)); } #line 7095 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 518: -#line 2909 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 521: +#line 2896 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(ANDAND, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression('.', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7103 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 519: -#line 2913 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 522: +#line 2900 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(EQCOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7111 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 520: -#line 2917 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 523: +#line 2904 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(NECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = (yyvsp[-1].u.expr); } #line 7119 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 521: -#line 2921 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 524: +#line 2912 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(LECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = (yyvsp[0].u.expr); } #line 7127 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 522: -#line 2925 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 525: +#line 2916 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(GECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-2].u.type), (yyvsp[0].u.expr))); } #line 7135 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 523: -#line 2929 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 526: +#line 2920 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(LSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_static_cast)); } #line 7143 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 524: -#line 2933 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 527: +#line 2924 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(RSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_dynamic_cast)); } #line 7151 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 525: -#line 2937 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 528: +#line 2928 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('?', (yyvsp[-4].u.expr), (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_const_cast)); } #line 7159 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 526: -#line 2941 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 529: +#line 2932 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('[', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_reinterpret_cast)); } #line 7167 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 527: -#line 2945 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); -} -#line 7175 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 528: -#line 2949 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[-2].u.expr)); -} -#line 7183 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 529: -#line 2953 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('.', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7191 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - case 530: -#line 2957 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7199 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 531: -#line 2961 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (yyvsp[-1].u.expr); -} -#line 7207 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 532: -#line 2969 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (yyvsp[0].u.expr); -} -#line 7215 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 533: -#line 2973 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-2].u.type), (yyvsp[0].u.expr))); -} -#line 7223 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 534: -#line 2977 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_static_cast)); -} -#line 7231 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 535: -#line 2981 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_dynamic_cast)); -} -#line 7239 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 536: -#line 2985 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_const_cast)); -} -#line 7247 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 537: -#line 2989 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_reinterpret_cast)); -} -#line 7255 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 538: -#line 2993 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 2936 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // A constructor call. CPPType *type = (yyvsp[-3].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); @@ -7265,167 +7177,167 @@ yyreduce: assert(type != NULL); (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } -#line 7269 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7181 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 539: -#line 3003 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 531: +#line 2946 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int)); (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } -#line 7279 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7191 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 540: -#line 3009 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 532: +#line 2952 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_char)); (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } -#line 7289 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7201 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 541: -#line 3015 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 533: +#line 2958 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_wchar_t)); (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } -#line 7299 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7211 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 542: -#line 3021 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 534: +#line 2964 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_char16_t)); (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } -#line 7309 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7221 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 543: -#line 3027 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 535: +#line 2970 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_char32_t)); (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } -#line 7319 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7231 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 544: -#line 3033 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 536: +#line 2976 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_bool)); (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } -#line 7329 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7241 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 545: -#line 3039 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 537: +#line 2982 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_short)); (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } -#line 7340 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7252 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 546: -#line 3046 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 538: +#line 2989 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_long)); (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } -#line 7351 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7263 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 547: -#line 3053 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 539: +#line 2996 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_unsigned)); (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } -#line 7362 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7274 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 548: -#line 3060 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 540: +#line 3003 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_signed)); (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } -#line 7373 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7285 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 549: -#line 3067 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 541: +#line 3010 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_float)); (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } -#line 7383 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7295 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 550: -#line 3073 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 542: +#line 3016 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_double)); (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } -#line 7393 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7305 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 551: -#line 3079 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 543: +#line 3022 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_func((yyvsp[-1].u.type))); } -#line 7401 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7313 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 552: -#line 3083 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 544: +#line 3026 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression(CPPExpression::alignof_func((yyvsp[-1].u.type))); } -#line 7409 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7321 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 553: -#line 3087 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 545: +#line 3030 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[0].u.type))); } -#line 7417 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7329 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 554: -#line 3091 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 546: +#line 3034 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[-3].u.type), (yyvsp[-1].u.expr))); } -#line 7425 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7337 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 555: -#line 3095 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 547: +#line 3038 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPIdentifier ident(""); ident.add_name("std"); @@ -7436,11 +7348,11 @@ yyreduce: } (yyval.u.expr) = new CPPExpression(CPPExpression::typeid_op((yyvsp[-1].u.type), std_type_info)); } -#line 7440 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7352 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 556: -#line 3106 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 548: +#line 3049 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPIdentifier ident(""); ident.add_name("std"); @@ -7451,447 +7363,447 @@ yyreduce: } (yyval.u.expr) = new CPPExpression(CPPExpression::typeid_op((yyvsp[-1].u.expr), std_type_info)); } +#line 7367 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 549: +#line 3060 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(UNARY_NOT, (yyvsp[0].u.expr)); +} +#line 7375 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 550: +#line 3064 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(UNARY_NEGATE, (yyvsp[0].u.expr)); +} +#line 7383 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 551: +#line 3068 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(UNARY_MINUS, (yyvsp[0].u.expr)); +} +#line 7391 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 552: +#line 3072 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(UNARY_PLUS, (yyvsp[0].u.expr)); +} +#line 7399 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 553: +#line 3076 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(UNARY_STAR, (yyvsp[0].u.expr)); +} +#line 7407 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 554: +#line 3080 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(UNARY_REF, (yyvsp[0].u.expr)); +} +#line 7415 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 555: +#line 3084 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('*', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7423 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 556: +#line 3088 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('/', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7431 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 557: +#line 3092 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('%', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7439 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 558: +#line 3096 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('+', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7447 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 559: +#line 3100 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('-', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} #line 7455 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 557: -#line 3117 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 560: +#line 3104 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(UNARY_NOT, (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression('|', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7463 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 558: -#line 3121 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 561: +#line 3108 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(UNARY_NEGATE, (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression('^', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7471 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 559: -#line 3125 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 562: +#line 3112 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(UNARY_MINUS, (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression('&', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7479 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 560: -#line 3129 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 563: +#line 3116 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(UNARY_PLUS, (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(OROR, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7487 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 561: -#line 3133 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 564: +#line 3120 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(UNARY_STAR, (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(ANDAND, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7495 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 562: -#line 3137 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 565: +#line 3124 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(UNARY_REF, (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(EQCOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7503 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 563: -#line 3141 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 566: +#line 3128 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('*', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(NECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7511 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 564: -#line 3145 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 567: +#line 3132 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('/', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(LECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7519 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 565: -#line 3149 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 568: +#line 3136 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('%', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(GECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7527 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 566: -#line 3153 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 569: +#line 3140 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('+', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression('<', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7535 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 567: -#line 3157 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 570: +#line 3144 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('-', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression('>', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7543 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 568: -#line 3161 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 571: +#line 3148 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('|', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(LSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7551 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 569: -#line 3165 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 572: +#line 3152 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('^', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(RSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7559 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 570: -#line 3169 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 573: +#line 3156 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('&', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression('?', (yyvsp[-4].u.expr), (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7567 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 571: -#line 3173 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 574: +#line 3160 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(OROR, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression('[', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); } #line 7575 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 572: -#line 3177 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 575: +#line 3164 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(ANDAND, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression('f', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); } #line 7583 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 573: -#line 3181 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 576: +#line 3168 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(EQCOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression('f', (yyvsp[-2].u.expr)); } #line 7591 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 574: -#line 3185 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 577: +#line 3172 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(NECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression('.', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7599 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 575: -#line 3189 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 578: +#line 3176 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(LECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7607 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 576: -#line 3193 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 579: +#line 3180 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(GECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = (yyvsp[-1].u.expr); } #line 7615 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 577: -#line 3197 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 580: +#line 3187 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('<', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression((yyvsp[0].u.integer)); } #line 7623 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 578: -#line 3201 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 581: +#line 3191 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('>', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(true); } #line 7631 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 579: -#line 3205 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 582: +#line 3195 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(LSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(false); } #line 7639 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 580: -#line 3209 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 583: +#line 3199 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(RSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression((yyvsp[0].u.integer)); } #line 7647 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 581: -#line 3213 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 584: +#line 3203 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('?', (yyvsp[-4].u.expr), (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression((yyvsp[0].u.real)); } #line 7655 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 582: -#line 3217 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 585: +#line 3207 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('[', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); + (yyval.u.expr) = (yyvsp[0].u.expr); } #line 7663 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 583: -#line 3221 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 586: +#line 3211 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); + (yyval.u.expr) = (yyvsp[0].u.expr); } #line 7671 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 584: -#line 3225 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 587: +#line 3215 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[-2].u.expr)); + (yyval.u.expr) = new CPPExpression((yyvsp[0].u.identifier), current_scope, global_scope, current_lexer); } #line 7679 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 585: -#line 3229 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('.', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7687 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 586: -#line 3233 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7695 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 587: -#line 3237 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (yyvsp[-1].u.expr); -} -#line 7703 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - case 588: -#line 3244 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression((yyvsp[0].u.integer)); -} -#line 7711 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 589: -#line 3248 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(true); -} -#line 7719 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 590: -#line 3252 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(false); -} -#line 7727 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 591: -#line 3256 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression((yyvsp[0].u.integer)); -} -#line 7735 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 592: -#line 3260 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression((yyvsp[0].u.real)); -} -#line 7743 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 593: -#line 3264 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (yyvsp[0].u.expr); -} -#line 7751 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 594: -#line 3268 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (yyvsp[0].u.expr); -} -#line 7759 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 595: -#line 3272 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression((yyvsp[0].u.identifier), current_scope, global_scope, current_lexer); -} -#line 7767 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 596: -#line 3276 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 3219 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // A variable named "final". C++11 explicitly permits this. CPPIdentifier *ident = new CPPIdentifier("final", (yylsp[0])); (yyval.u.expr) = new CPPExpression(ident, current_scope, global_scope, current_lexer); } -#line 7777 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7689 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 597: -#line 3282 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 589: +#line 3225 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // A variable named "override". C++11 explicitly permits this. CPPIdentifier *ident = new CPPIdentifier("override", (yylsp[0])); (yyval.u.expr) = new CPPExpression(ident, current_scope, global_scope, current_lexer); } -#line 7787 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7699 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 590: +#line 3231 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::get_nullptr()); +} +#line 7707 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 591: +#line 3235 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = NULL; +} +#line 7715 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 592: +#line 3239 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = NULL; +} +#line 7723 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 593: +#line 3253 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (yyvsp[0].u.expr); +} +#line 7731 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 594: +#line 3257 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-2].u.type), (yyvsp[0].u.expr))); +} +#line 7739 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 595: +#line 3261 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_static_cast)); +} +#line 7747 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 596: +#line 3265 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_dynamic_cast)); +} +#line 7755 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 597: +#line 3269 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_const_cast)); +} +#line 7763 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 598: -#line 3288 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 3273 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(CPPExpression::get_nullptr()); + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_reinterpret_cast)); +} +#line 7771 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 599: +#line 3277 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_func((yyvsp[-1].u.type))); +} +#line 7779 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 600: +#line 3281 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::alignof_func((yyvsp[-1].u.type))); +} +#line 7787 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 601: +#line 3285 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[0].u.type))); } #line 7795 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 599: -#line 3292 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 602: +#line 3289 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = NULL; + (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[-3].u.type), (yyvsp[-1].u.expr))); } #line 7803 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 600: -#line 3296 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = NULL; -} -#line 7811 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 601: -#line 3310 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (yyvsp[0].u.expr); -} -#line 7819 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 602: -#line 3314 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-2].u.type), (yyvsp[0].u.expr))); -} -#line 7827 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - case 603: -#line 3318 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_static_cast)); -} -#line 7835 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 604: -#line 3322 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_dynamic_cast)); -} -#line 7843 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 605: -#line 3326 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_const_cast)); -} -#line 7851 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 606: -#line 3330 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_reinterpret_cast)); -} -#line 7859 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 607: -#line 3334 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_func((yyvsp[-1].u.type))); -} -#line 7867 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 608: -#line 3338 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::alignof_func((yyvsp[-1].u.type))); -} -#line 7875 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 609: -#line 3342 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[0].u.type))); -} -#line 7883 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 610: -#line 3346 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[-3].u.type), (yyvsp[-1].u.expr))); -} -#line 7891 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 611: -#line 3350 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 3293 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPIdentifier ident(""); ident.add_name("std"); @@ -7902,11 +7814,11 @@ yyreduce: } (yyval.u.expr) = new CPPExpression(CPPExpression::typeid_op((yyvsp[-1].u.type), std_type_info)); } -#line 7906 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7818 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 612: -#line 3361 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 604: +#line 3304 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPIdentifier ident(""); ident.add_name("std"); @@ -7917,343 +7829,343 @@ yyreduce: } (yyval.u.expr) = new CPPExpression(CPPExpression::typeid_op((yyvsp[-1].u.expr), std_type_info)); } -#line 7921 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7833 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 605: +#line 3315 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(UNARY_NOT, (yyvsp[0].u.expr)); +} +#line 7841 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 606: +#line 3319 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(UNARY_NEGATE, (yyvsp[0].u.expr)); +} +#line 7849 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 607: +#line 3323 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(UNARY_MINUS, (yyvsp[0].u.expr)); +} +#line 7857 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 608: +#line 3327 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(UNARY_PLUS, (yyvsp[0].u.expr)); +} +#line 7865 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 609: +#line 3331 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(UNARY_REF, (yyvsp[0].u.expr)); +} +#line 7873 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 610: +#line 3335 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('*', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7881 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 611: +#line 3339 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('/', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7889 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 612: +#line 3343 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('%', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7897 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 613: -#line 3372 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 3347 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(UNARY_NOT, (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression('+', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7905 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 614: +#line 3351 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('-', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7913 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 615: +#line 3355 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('|', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7921 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 616: +#line 3359 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('^', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7929 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 614: -#line 3376 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 617: +#line 3363 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(UNARY_NEGATE, (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression('&', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7937 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 615: -#line 3380 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 618: +#line 3367 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(UNARY_MINUS, (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(OROR, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7945 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 616: -#line 3384 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 619: +#line 3371 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(UNARY_PLUS, (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(ANDAND, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7953 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 617: -#line 3388 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 620: +#line 3375 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(UNARY_REF, (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(EQCOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7961 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 618: -#line 3392 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 621: +#line 3379 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('*', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(NECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7969 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 619: -#line 3396 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 622: +#line 3383 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('/', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(LECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7977 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 620: -#line 3400 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 623: +#line 3387 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('%', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(GECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7985 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 621: -#line 3404 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 624: +#line 3391 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('+', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression('<', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 7993 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 622: -#line 3408 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 625: +#line 3395 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('-', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression('>', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 8001 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 623: -#line 3412 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 626: +#line 3399 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('|', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(LSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 8009 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 624: -#line 3416 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 627: +#line 3403 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('^', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(RSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 8017 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 625: -#line 3420 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 628: +#line 3407 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('&', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression('?', (yyvsp[-4].u.expr), (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 8025 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 626: -#line 3424 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 629: +#line 3411 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(OROR, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression('[', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); } #line 8033 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 627: -#line 3428 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 630: +#line 3415 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(ANDAND, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression('f', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); } #line 8041 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 628: -#line 3432 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 631: +#line 3419 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(EQCOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression('f', (yyvsp[-2].u.expr)); } #line 8049 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 629: -#line 3436 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 632: +#line 3423 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(NECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression('.', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 8057 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 630: -#line 3440 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 633: +#line 3427 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(LECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } #line 8065 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 631: -#line 3444 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 634: +#line 3431 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(GECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = (yyvsp[-1].u.expr); } #line 8073 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 632: -#line 3448 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 635: +#line 3438 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('<', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression((yyvsp[0].u.integer)); } #line 8081 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 633: -#line 3452 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 636: +#line 3442 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('>', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(true); } #line 8089 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 634: -#line 3456 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 637: +#line 3446 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(LSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression(false); } #line 8097 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 635: -#line 3460 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 638: +#line 3450 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(RSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression((yyvsp[0].u.integer)); } #line 8105 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 636: -#line 3464 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 639: +#line 3454 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('?', (yyvsp[-4].u.expr), (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); + (yyval.u.expr) = new CPPExpression((yyvsp[0].u.real)); } #line 8113 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 637: -#line 3468 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 640: +#line 3458 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('[', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); + (yyval.u.expr) = (yyvsp[0].u.expr); } #line 8121 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 638: -#line 3472 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 641: +#line 3462 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); + (yyval.u.expr) = (yyvsp[0].u.expr); } #line 8129 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 639: -#line 3476 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 642: +#line 3466 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[-2].u.expr)); + (yyval.u.expr) = new CPPExpression((yyvsp[0].u.identifier), current_scope, global_scope, current_lexer); } #line 8137 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 640: -#line 3480 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('.', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 8145 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 641: -#line 3484 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 8153 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 642: -#line 3488 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (yyvsp[-1].u.expr); -} -#line 8161 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - case 643: -#line 3495 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression((yyvsp[0].u.integer)); -} -#line 8169 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 644: -#line 3499 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(true); -} -#line 8177 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 645: -#line 3503 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(false); -} -#line 8185 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 646: -#line 3507 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression((yyvsp[0].u.integer)); -} -#line 8193 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 647: -#line 3511 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression((yyvsp[0].u.real)); -} -#line 8201 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 648: -#line 3515 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (yyvsp[0].u.expr); -} -#line 8209 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 649: -#line 3519 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (yyvsp[0].u.expr); -} -#line 8217 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 650: -#line 3523 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression((yyvsp[0].u.identifier), current_scope, global_scope, current_lexer); -} -#line 8225 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 651: -#line 3527 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 3470 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // A variable named "final". C++11 explicitly permits this. CPPIdentifier *ident = new CPPIdentifier("final", (yylsp[0])); (yyval.u.expr) = new CPPExpression(ident, current_scope, global_scope, current_lexer); } -#line 8235 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8147 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 652: -#line 3533 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 644: +#line 3476 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // A variable named "override". C++11 explicitly permits this. CPPIdentifier *ident = new CPPIdentifier("override", (yylsp[0])); (yyval.u.expr) = new CPPExpression(ident, current_scope, global_scope, current_lexer); } -#line 8245 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8157 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 653: -#line 3539 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 645: +#line 3482 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression(CPPExpression::get_nullptr()); } -#line 8253 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8165 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 661: -#line 3560 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 653: +#line 3503 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, true); if (type == NULL) { @@ -8261,11 +8173,11 @@ yyreduce: } (yyval.u.type) = type; } -#line 8265 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8177 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 662: -#line 3568 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 654: +#line 3511 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, true, current_lexer); if (type == NULL) { @@ -8273,143 +8185,143 @@ yyreduce: } (yyval.u.type) = type; } -#line 8277 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8189 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 663: -#line 3576 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 655: +#line 3519 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = CPPType::new_type(new CPPTBDType((yyvsp[0].u.identifier))); } -#line 8285 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8197 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 664: -#line 3604 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 656: +#line 3547 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.identifier) = (yyvsp[0].u.identifier); } -#line 8293 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8205 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 665: -#line 3608 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 657: +#line 3551 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.identifier) = (yyvsp[0].u.identifier); } -#line 8301 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8213 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 666: -#line 3612 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 658: +#line 3555 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.identifier) = new CPPIdentifier("final", (yylsp[0])); } -#line 8309 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8221 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 667: -#line 3616 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 659: +#line 3559 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.identifier) = new CPPIdentifier("override", (yylsp[0])); } -#line 8317 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8229 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 668: -#line 3620 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 660: +#line 3563 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // This is not a keyword in Python, so it is useful to be able to use this // in MAKE_PROPERTY definitions, etc. (yyval.u.identifier) = new CPPIdentifier("signed", (yylsp[0])); } -#line 8327 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8239 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 669: -#line 3626 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 661: +#line 3569 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.identifier) = new CPPIdentifier("float", (yylsp[0])); } -#line 8335 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8247 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 670: -#line 3630 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 662: +#line 3573 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.identifier) = new CPPIdentifier("public", (yylsp[0])); } -#line 8343 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8255 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 671: -#line 3634 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 663: +#line 3577 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.identifier) = new CPPIdentifier("private", (yylsp[0])); } -#line 8351 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8263 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 672: -#line 3638 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 664: +#line 3581 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.identifier) = new CPPIdentifier("static", (yylsp[0])); } -#line 8359 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8271 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 673: -#line 3649 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 665: +#line 3592 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.identifier) = (yyvsp[0].u.identifier); } -#line 8367 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8279 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 674: -#line 3653 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 666: +#line 3596 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.identifier) = (yyvsp[0].u.identifier); } -#line 8375 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8287 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 675: -#line 3657 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 667: +#line 3600 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.identifier) = new CPPIdentifier("override", (yylsp[0])); } -#line 8383 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8295 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 676: -#line 3665 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 668: +#line 3608 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression((yyvsp[0].str)); } -#line 8391 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8303 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 677: -#line 3669 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 669: +#line 3612 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = (yyvsp[0].u.expr); } -#line 8399 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8311 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 678: -#line 3673 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 670: +#line 3616 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // The right string takes on the literal type of the left. (yyval.u.expr) = (yyvsp[-1].u.expr); (yyval.u.expr)->_str += (yyvsp[0].str); } -#line 8409 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8321 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 679: -#line 3679 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 671: +#line 3622 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // We have to check that the two literal types match up. (yyval.u.expr) = (yyvsp[-1].u.expr); @@ -8418,11 +8330,11 @@ yyreduce: } (yyval.u.expr)->_str += (yyvsp[0].u.expr)->_str; } -#line 8422 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8334 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; -#line 8426 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8338 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires diff --git a/dtool/src/cppparser/cppBison.yxx b/dtool/src/cppparser/cppBison.yxx index b8600975b8..d2d9da8458 100644 --- a/dtool/src/cppparser/cppBison.yxx +++ b/dtool/src/cppparser/cppBison.yxx @@ -783,6 +783,11 @@ storage_class: empty { $$ = 0; +} + | KW_CONST storage_class +{ + // This isn't really a storage class, but it helps with parsing. + $$ = $2 | (int)CPPInstance::SC_const; } | KW_EXTERN storage_class { @@ -861,10 +866,22 @@ attribute_specifier: ; type_like_declaration: - multiple_var_declaration + storage_class var_type_decl { - /* multiple_var_declaration adds itself to the scope. */ + // We don't need to push/pop type, because we can't nest + // type_like_declaration. + if ($2->as_type_declaration()) { + current_type = $2->as_type_declaration()->_type; + } else { + current_type = $2->as_type(); + } + push_storage_class($1); } + multiple_instance_identifiers +{ + pop_storage_class(); +} + | storage_class type_decl ';' { // We don't really care about the storage class here. In fact, it's @@ -891,39 +908,6 @@ type_like_declaration: } } | using_declaration - ; - -multiple_var_declaration: - storage_class var_type_decl -{ - // We don't need to push/pop type, because we can't nest - // multiple_var_declarations. - if ($2->as_type_declaration()) { - current_type = $2->as_type_declaration()->_type; - } else { - current_type = $2->as_type(); - } - push_storage_class($1); -} - multiple_instance_identifiers -{ - pop_storage_class(); -} - | storage_class KW_CONST var_type_decl -{ - // We don't need to push/pop type, because we can't nest - // multiple_var_declarations. - if ($3->as_type_declaration()) { - current_type = $3->as_type_declaration()->_type; - } else { - current_type = $3->as_type(); - } - push_storage_class($1); -} - multiple_const_instance_identifiers -{ - pop_storage_class(); -} /* We don't need to include a rule for variables that point to functions, because we get those from the function_prototype @@ -933,6 +917,9 @@ multiple_var_declaration: multiple_instance_identifiers: instance_identifier_and_maybe_trailing_return_type maybe_initialize_or_function_body { + if (current_storage_class & CPPInstance::SC_const) { + $1->add_modifier(IIT_const); + } CPPInstance *inst = new CPPInstance(current_type, $1, current_storage_class, @1.file); @@ -941,27 +928,9 @@ multiple_instance_identifiers: } | instance_identifier_and_maybe_trailing_return_type maybe_initialize ',' multiple_instance_identifiers { - CPPInstance *inst = new CPPInstance(current_type, $1, - current_storage_class, - @1.file); - inst->set_initializer($2); - current_scope->add_declaration(inst, global_scope, current_lexer, @1); -} - ; - -multiple_const_instance_identifiers: - instance_identifier_and_maybe_trailing_return_type maybe_initialize_or_function_body -{ - $1->add_modifier(IIT_const); - CPPInstance *inst = new CPPInstance(current_type, $1, - current_storage_class, - @1.file); - inst->set_initializer($2); - current_scope->add_declaration(inst, global_scope, current_lexer, @1); -} - | instance_identifier_and_maybe_trailing_return_type maybe_initialize ',' multiple_const_instance_identifiers -{ - $1->add_modifier(IIT_const); + if (current_storage_class & CPPInstance::SC_const) { + $1->add_modifier(IIT_const); + } CPPInstance *inst = new CPPInstance(current_type, $1, current_storage_class, @1.file); @@ -986,21 +955,6 @@ typedef_declaration: typedef_instance_identifiers { pop_storage_class(); -} - | storage_class KW_CONST var_type_decl -{ - // We don't need to push/pop type, because we can't nest - // multiple_var_declarations. - if ($3->as_type_declaration()) { - current_type = $3->as_type_declaration()->_type; - } else { - current_type = $3->as_type(); - } - push_storage_class($1); -} - typedef_const_instance_identifiers -{ - pop_storage_class(); } | storage_class function_prototype maybe_initialize_or_function_body { @@ -1019,29 +973,18 @@ typedef_declaration: typedef_instance_identifiers: instance_identifier_and_maybe_trailing_return_type maybe_initialize_or_function_body { + if (current_storage_class & CPPInstance::SC_const) { + $1->add_modifier(IIT_const); + } CPPType *target_type = current_type; CPPTypedefType *typedef_type = new CPPTypedefType(target_type, $1, current_scope, @1.file); current_scope->add_declaration(CPPType::new_type(typedef_type), global_scope, current_lexer, @1); } | instance_identifier_and_maybe_trailing_return_type maybe_initialize ',' typedef_instance_identifiers { - CPPType *target_type = current_type; - CPPTypedefType *typedef_type = new CPPTypedefType(target_type, $1, current_scope, @1.file); - current_scope->add_declaration(CPPType::new_type(typedef_type), global_scope, current_lexer, @1); -} - ; - -typedef_const_instance_identifiers: - instance_identifier_and_maybe_trailing_return_type maybe_initialize_or_function_body -{ - $1->add_modifier(IIT_const); - CPPType *target_type = current_type; - CPPTypedefType *typedef_type = new CPPTypedefType(target_type, $1, current_scope, @1.file); - current_scope->add_declaration(CPPType::new_type(typedef_type), global_scope, current_lexer, @1); -} - | instance_identifier_and_maybe_trailing_return_type maybe_initialize ',' typedef_const_instance_identifiers -{ - $1->add_modifier(IIT_const); + if (current_storage_class & CPPInstance::SC_const) { + $1->add_modifier(IIT_const); + } CPPType *target_type = current_type; CPPTypedefType *typedef_type = new CPPTypedefType(target_type, $1, current_scope, @1.file); current_scope->add_declaration(CPPType::new_type(typedef_type), global_scope, current_lexer, @1); diff --git a/dtool/src/cppparser/cppEnumType.h b/dtool/src/cppparser/cppEnumType.h index c22742203c..a218feead4 100644 --- a/dtool/src/cppparser/cppEnumType.h +++ b/dtool/src/cppparser/cppEnumType.h @@ -16,6 +16,7 @@ #include "dtoolbase.h" +#include "cppBisonDefs.h" #include "cppExtensionType.h" #include diff --git a/dtool/src/cppparser/cppInstance.h b/dtool/src/cppparser/cppInstance.h index 5e6459fbda..74473df660 100644 --- a/dtool/src/cppparser/cppInstance.h +++ b/dtool/src/cppparser/cppInstance.h @@ -64,6 +64,10 @@ public: SC_deleted = 0x8000, SC_thread_local = 0x10000, + + // This isn't really a storage class. It's only used temporarily by the + // parser, to make parsing specifier sequences a bit easier. + SC_const = 0x20000, }; CPPInstance(CPPType *type, const string &name, int storage_class = 0); diff --git a/dtool/src/cppparser/cppManifest.cxx b/dtool/src/cppparser/cppManifest.cxx index 18a747d241..bb8f315c39 100644 --- a/dtool/src/cppparser/cppManifest.cxx +++ b/dtool/src/cppparser/cppManifest.cxx @@ -370,10 +370,8 @@ save_expansion(const string &exp, const vector_string ¶meter_names) { // Is this identifier one of our parameters? int pnum = -1; - bool va_args = false; if (ident == "__VA_ARGS__") { - va_args = true; // C99-style variadics, ie. #define macro(...) __VA_ARGS__ pnum = _variadic_param; diff --git a/dtool/src/cppparser/cppPreprocessor.cxx b/dtool/src/cppparser/cppPreprocessor.cxx index 24116a240a..f0fe1c9819 100644 --- a/dtool/src/cppparser/cppPreprocessor.cxx +++ b/dtool/src/cppparser/cppPreprocessor.cxx @@ -806,7 +806,7 @@ expand_manifests(const string &input_expr, bool expand_undefined, Manifests::const_iterator mi = _manifests.find(ident); if (mi != _manifests.end()) { const CPPManifest *manifest = (*mi).second; - expand_manifest_inline(expr, q, p, (*mi).second); + expand_manifest_inline(expr, q, p, manifest); manifest_found = true; } else if (expand_undefined && ident != "true" && ident != "false") { @@ -1192,8 +1192,6 @@ skip_c_comment(int c) { } else { CPPFile first_file = get_file(); - int first_line_number = get_line_number(); - int first_col_number = get_col_number() - 2; while (c != EOF) { if (c == '*') { @@ -1816,8 +1814,9 @@ get_identifier(int c) { type = CPPExpression::T_u16string; } else if (name == "U") { type = CPPExpression::T_u32string; + } else { + type = CPPExpression::T_string; } - get(); string str = scan_quoted(c); diff --git a/dtool/src/cppparser/cppScope.cxx b/dtool/src/cppparser/cppScope.cxx index e61b42f19e..9945a1a72d 100644 --- a/dtool/src/cppparser/cppScope.cxx +++ b/dtool/src/cppparser/cppScope.cxx @@ -18,6 +18,7 @@ #include "cppTypedefType.h" #include "cppTypeDeclaration.h" #include "cppExtensionType.h" +#include "cppEnumType.h" #include "cppInstance.h" #include "cppInstanceIdentifier.h" #include "cppIdentifier.h" diff --git a/dtool/src/cppparser/cppToken.cxx b/dtool/src/cppparser/cppToken.cxx index b6f03d8d49..025590113a 100644 --- a/dtool/src/cppparser/cppToken.cxx +++ b/dtool/src/cppparser/cppToken.cxx @@ -40,7 +40,7 @@ CPPToken(int token, int line_number, int col_number, */ CPPToken:: CPPToken(int token, const YYLTYPE &loc, const string &str, const YYSTYPE &val) : - _token(token), _lloc(loc), _lval(val) + _token(token), _lval(val), _lloc(loc) { _lval.str = str; } diff --git a/dtool/src/cppparser/cppTypedefType.cxx b/dtool/src/cppparser/cppTypedefType.cxx index 7f3443f600..aaede09529 100644 --- a/dtool/src/cppparser/cppTypedefType.cxx +++ b/dtool/src/cppparser/cppTypedefType.cxx @@ -14,6 +14,8 @@ #include "cppTypedefType.h" #include "cppIdentifier.h" #include "cppInstanceIdentifier.h" +#include "cppTemplateScope.h" +#include "indent.h" /** * diff --git a/dtool/src/dtoolbase/dtoolbase.h b/dtool/src/dtoolbase/dtoolbase.h index 7ec1cb6f04..712e7172e4 100644 --- a/dtool/src/dtoolbase/dtoolbase.h +++ b/dtool/src/dtoolbase/dtoolbase.h @@ -70,23 +70,25 @@ #else // #pragma message("VC 6.0") #endif +#endif /* WIN32_VC */ + +#ifndef __has_builtin +#define __has_builtin(x) 0 +#endif // Use NODEFAULT to optimize a switch() stmt to tell MSVC to automatically go // to the final untested case after it has failed all the other cases (i.e. // 'assume at least one of the cases is always true') #ifdef _DEBUG -# define NODEFAULT default: assert(0); +#define NODEFAULT default: assert(0); break; +#elif defined(_MSC_VER) +#define NODEFAULT default: __assume(0); // special VC keyword +#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) || __has_builtin(__builtin_unreachable) +#define NODEFAULT default: __builtin_unreachable(); #else -# define NODEFAULT default: __assume(0); // special VC keyword +#define NODEFAULT #endif -#else /* if !WIN32_VC */ -#ifdef _DEBUG -# define NODEFAULT default: assert(0); -#else -# define NODEFAULT -#endif -#endif /* WIN32_VC */ /* include win32 defns for everything up to WinServer2003, and assume diff --git a/dtool/src/dtoolbase/typeRegistry.cxx b/dtool/src/dtoolbase/typeRegistry.cxx index 99ac09be10..7349d20dd4 100644 --- a/dtool/src/dtoolbase/typeRegistry.cxx +++ b/dtool/src/dtoolbase/typeRegistry.cxx @@ -341,6 +341,8 @@ get_root_class(int n) { TypeHandle handle; if (n >= 0 && n < (int)_root_classes.size()) { handle = _root_classes[n]->_handle; + } else { + handle = TypeHandle::none(); } _lock->release(); @@ -380,6 +382,8 @@ get_parent_class(TypeHandle child, int index) const { assert(rnode != (TypeRegistryNode *)NULL); if (index >= 0 && index < (int)rnode->_parent_classes.size()) { handle = rnode->_parent_classes[index]->_handle; + } else { + handle = TypeHandle::none(); } _lock->release(); return handle; @@ -415,6 +419,8 @@ get_child_class(TypeHandle child, int index) const { assert(rnode != (TypeRegistryNode *)NULL); if (index >= 0 && index < (int)rnode->_child_classes.size()) { handle = rnode->_child_classes[index]->_handle; + } else { + handle = TypeHandle::none(); } _lock->release(); return handle; diff --git a/dtool/src/dtoolutil/filename.cxx b/dtool/src/dtoolutil/filename.cxx index 8d6fa1e415..169f4bee05 100644 --- a/dtool/src/dtoolutil/filename.cxx +++ b/dtool/src/dtoolutil/filename.cxx @@ -443,7 +443,11 @@ temporary(const string &dirname, const string &prefix, const string &suffix, // generate a 6-character hex code. int hash = (clock() * time(NULL)) & 0xffffff; char hex_code[10]; - sprintf(hex_code, "%06x", hash); +#ifdef _WIN32 + sprintf_s(hex_code, 10, "%06x", hash); +#else + snprintf(hex_code, 10, "%06x", hash); +#endif result = Filename(fdirname, Filename(prefix + hex_code + suffix)); result.set_type(type); } while (result.exists()); diff --git a/dtool/src/dtoolutil/pandaFileStreamBuf.cxx b/dtool/src/dtoolutil/pandaFileStreamBuf.cxx index ca78c0a551..037d421469 100644 --- a/dtool/src/dtoolutil/pandaFileStreamBuf.cxx +++ b/dtool/src/dtoolutil/pandaFileStreamBuf.cxx @@ -323,7 +323,7 @@ seekoff(streamoff off, ios_seekdir dir, ios_openmode which) { // Posix case. { off_t li = lseek(_fd, off, SEEK_END); - if (li == (size_t)-1) { + if (li == (off_t)-1) { return -1; } new_pos = (size_t)li; diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index 5d18fca7be..46073abee3 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -1259,9 +1259,16 @@ write_module_support(ostream &out, ostream *out_h, InterrogateModuleDef *def) { if (is_cpp_type_legal(object->_itype._cpptype) && isExportThisRun(object->_itype._cpptype)) { string class_name = make_safe_name(object->_itype.get_scoped_name()); - bool is_typed = HasAGetClassTypeFunction(object->_itype._cpptype); + bool is_typed = has_get_class_type_function(object->_itype._cpptype); if (is_typed) { + if (has_init_type_function(object->_itype._cpptype)) { + // Call the init_type function. This isn't necessary for all + // types as many of them are automatically initialized at static + // init type, but for some extension classes it's useful. + out << " " << object->_itype._cpptype->get_local_name(&parser) + << "::init_type();\n"; + } out << " Dtool_" << class_name << "._type = " << object->_itype._cpptype->get_local_name(&parser) << "::get_class_type();\n" @@ -1291,7 +1298,7 @@ write_module_support(ostream &out, ostream *out_h, InterrogateModuleDef *def) { string class_name = (*ii)->get_local_name(&parser); string safe_name = make_safe_name(class_name); - if (HasAGetClassTypeFunction(*ii)) { + if (has_get_class_type_function(*ii)) { out << " Dtool_Ptr_" << safe_name << " = LookupRuntimeTypedClass(" << class_name << "::get_class_type());\n"; } else { out << " Dtool_Ptr_" << safe_name << " = LookupNamedClass(\"" << class_name << "\");\n"; @@ -1541,7 +1548,7 @@ write_module_class(ostream &out, Object *obj) { std::string export_class_name = classNameFromCppName(obj->_itype.get_name(), false); bool is_runtime_typed = IsPandaTypedObject(obj->_itype._cpptype->as_struct_type()); - if (!is_runtime_typed && HasAGetClassTypeFunction(obj->_itype._cpptype)) { + if (!is_runtime_typed && has_get_class_type_function(obj->_itype._cpptype)) { is_runtime_typed = true; } @@ -4196,7 +4203,7 @@ write_function_forset(ostream &out, return; } - FunctionRemap *remap; + FunctionRemap *remap = NULL; std::set::iterator sii; bool all_nonconst = false; @@ -7010,7 +7017,7 @@ DoesInheritFromIsClass(const CPPStructType *inclass, const std::string &name) { */ bool InterfaceMakerPythonNative:: -HasAGetClassTypeFunction(CPPType *type) { +has_get_class_type_function(CPPType *type) { while (type->get_subtype() == CPPDeclaration::ST_typedef) { type = type->as_typedef_type()->_type; } @@ -7025,6 +7032,43 @@ HasAGetClassTypeFunction(CPPType *type) { return scope->_functions.find("get_class_type") != scope->_functions.end(); } +/** + * + */ +bool InterfaceMakerPythonNative:: +has_init_type_function(CPPType *type) { + while (type->get_subtype() == CPPDeclaration::ST_typedef) { + type = type->as_typedef_type()->_type; + } + + CPPStructType *struct_type = type->as_struct_type(); + if (struct_type == NULL) { + return false; + } + + CPPScope *scope = struct_type->get_scope(); + CPPScope::Functions::const_iterator it = scope->_functions.find("init_type"); + if (it == scope->_functions.end()) { + return false; + } + const CPPFunctionGroup *group = it->second; + + CPPFunctionGroup::Instances::const_iterator ii; + for (ii = group->_instances.begin(); ii != group->_instances.end(); ++ii) { + const CPPInstance *cppinst = *ii; + const CPPFunctionType *cppfunc = cppinst->_type->as_function_type(); + + if (cppfunc != NULL && + cppfunc->_parameters != NULL && + cppfunc->_parameters->_parameters.size() == 0 && + (cppinst->_storage_class & CPPInstance::SC_static) != 0) { + return true; + } + } + + return false; +} + /** * Returns -1 if the class does not define write() (and therefore cannot * support a __str__ function). diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.h b/dtool/src/interrogate/interfaceMakerPythonNative.h index a571e3323f..8f66fcf3b0 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.h +++ b/dtool/src/interrogate/interfaceMakerPythonNative.h @@ -201,7 +201,8 @@ public: bool DoesInheritFromIsClass(const CPPStructType * inclass, const std::string &name); bool IsPandaTypedObject(CPPStructType * inclass) { return DoesInheritFromIsClass(inclass,"TypedObject"); }; void write_python_instance(ostream &out, int indent_level, const std::string &return_expr, bool owns_memory, const InterrogateType &itype, bool is_const); - bool HasAGetClassTypeFunction(CPPType *type); + bool has_get_class_type_function(CPPType *type); + bool has_init_type_function(CPPType *type); int NeedsAStrFunction(const InterrogateType &itype_class); int NeedsAReprFunction(const InterrogateType &itype_class); bool NeedsARichCompareFunction(const InterrogateType &itype_class); diff --git a/dtool/src/interrogate/interrogate.cxx b/dtool/src/interrogate/interrogate.cxx index 86d2ae9a6e..206132bb31 100644 --- a/dtool/src/interrogate/interrogate.cxx +++ b/dtool/src/interrogate/interrogate.cxx @@ -19,7 +19,6 @@ #include "pnotify.h" #include "panda_getopt_long.h" #include "preprocess_argv.h" -#include "pystub.h" #include CPPParser parser; @@ -306,9 +305,6 @@ predefine_macro(CPPParser& parser, const string& inoption) { int main(int argc, char **argv) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - preprocess_argv(argc, argv); string command_line; int i; diff --git a/dtool/src/interrogate/interrogateBuilder.cxx b/dtool/src/interrogate/interrogateBuilder.cxx index 342ffdd4b9..11ac166440 100644 --- a/dtool/src/interrogate/interrogateBuilder.cxx +++ b/dtool/src/interrogate/interrogateBuilder.cxx @@ -1851,9 +1851,9 @@ get_make_property(CPPMakeProperty *make_property, CPPStructType *struct_type, CP } // The getter must either take no arguments, or all defaults. - if (ftype->_parameters->_parameters.size() == (int)is_seq || - (ftype->_parameters->_parameters.size() > (int)is_seq && - ftype->_parameters->_parameters[(int)is_seq]->_initializer != NULL)) { + if (ftype->_parameters->_parameters.size() == (size_t)is_seq || + (ftype->_parameters->_parameters.size() > (size_t)is_seq && + ftype->_parameters->_parameters[(size_t)is_seq]->_initializer != NULL)) { // If this is a sequence getter, it must take an index argument. if (is_seq && !TypeManager::is_integer(ftype->_parameters->_parameters[0]->_type)) { continue; @@ -1909,7 +1909,7 @@ get_make_property(CPPMakeProperty *make_property, CPPStructType *struct_type, CP for (fi = fgroup->_instances.begin(); fi != fgroup->_instances.end(); ++fi) { CPPInstance *function = (*fi); CPPFunctionType *ftype = function->_type->as_function_type(); - if (ftype != NULL && ftype->_parameters->_parameters.size() == (int)is_seq) { + if (ftype != NULL && ftype->_parameters->_parameters.size() == (size_t)is_seq) { deleter = function; break; } diff --git a/dtool/src/interrogate/interrogate_module.cxx b/dtool/src/interrogate/interrogate_module.cxx index 9a8cff85bf..8e397d8b9e 100644 --- a/dtool/src/interrogate/interrogate_module.cxx +++ b/dtool/src/interrogate/interrogate_module.cxx @@ -19,7 +19,6 @@ #include "interrogate_interface.h" #include "interrogate_request.h" #include "load_dso.h" -#include "pystub.h" #include "pnotify.h" #include "panda_getopt_long.h" #include "preprocess_argv.h" @@ -380,9 +379,6 @@ int main(int argc, char *argv[]) { extern int optind; int flag; - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - preprocess_argv(argc, argv); flag = getopt_long_only(argc, argv, short_options, long_options, NULL); while (flag != EOF) { diff --git a/dtool/src/interrogate/typeManager.cxx b/dtool/src/interrogate/typeManager.cxx index 7c9b6582a3..db5b07f58a 100644 --- a/dtool/src/interrogate/typeManager.cxx +++ b/dtool/src/interrogate/typeManager.cxx @@ -41,7 +41,7 @@ resolve_type(CPPType *type, CPPScope *scope) { scope = &parser; } - CPPType *orig_type = type; + //CPPType *orig_type = type; type = type->resolve_type(scope, &parser); string name = type->get_local_name(&parser); if (name.empty()) { @@ -1740,7 +1740,8 @@ is_Py_buffer(CPPType *type) { case CPPDeclaration::ST_extension: case CPPDeclaration::ST_struct: - return (type->get_local_name(&parser) == "Py_buffer"); + return (type->get_local_name(&parser) == "Py_buffer" || + type->get_local_name(&parser) == "bufferinfo"); case CPPDeclaration::ST_typedef: return is_Py_buffer(type->as_typedef_type()->_type); diff --git a/dtool/src/interrogatedb/extension.h b/dtool/src/interrogatedb/extension.h index 878c997f86..dd995081c1 100644 --- a/dtool/src/interrogatedb/extension.h +++ b/dtool/src/interrogatedb/extension.h @@ -31,7 +31,7 @@ public: * extended should create a specialization of this class template. */ template -class EXPCL_INTERROGATEDB Extension : public ExtensionBase { +class Extension : public ExtensionBase { }; /** diff --git a/dtool/src/interrogatedb/interrogate_request.cxx b/dtool/src/interrogatedb/interrogate_request.cxx index 49ccff4333..3e02a9eecb 100644 --- a/dtool/src/interrogatedb/interrogate_request.cxx +++ b/dtool/src/interrogatedb/interrogate_request.cxx @@ -20,7 +20,11 @@ void interrogate_request_database(const char *database_filename) { InterrogateModuleDef *def = new InterrogateModuleDef; memset(def, 0, sizeof(InterrogateModuleDef)); +#ifdef _WIN32 + def->database_filename = _strdup(database_filename); +#else def->database_filename = strdup(database_filename); +#endif // Don't think of this as a leak; think of it as a one-time database // allocation. diff --git a/dtool/src/interrogatedb/py_panda.I b/dtool/src/interrogatedb/py_panda.I index 3b171f14c7..0a06358beb 100644 --- a/dtool/src/interrogatedb/py_panda.I +++ b/dtool/src/interrogatedb/py_panda.I @@ -107,7 +107,15 @@ ALWAYS_INLINE PyObject *Dtool_WrapValue(long long value) { } ALWAYS_INLINE PyObject *Dtool_WrapValue(unsigned long long value) { + // size_t is sometimes defined as unsigned long long, and we want to map + // that to int in Python 2 so it can be returned from a __len__. +#if PY_MAJOR_VERSION >= 3 return PyLong_FromUnsignedLongLong(value); +#else + return (value > LONG_MAX) + ? PyLong_FromUnsignedLongLong(value) + : PyInt_FromLong((long)value); +#endif } ALWAYS_INLINE PyObject *Dtool_WrapValue(bool value) { diff --git a/dtool/src/interrogatedb/py_panda.cxx b/dtool/src/interrogatedb/py_panda.cxx index a25a5c614b..9fe9916573 100644 --- a/dtool/src/interrogatedb/py_panda.cxx +++ b/dtool/src/interrogatedb/py_panda.cxx @@ -67,7 +67,7 @@ void DTOOL_Call_ExtractThisPointerForType(PyObject *self, Dtool_PyTypedObject *c * was of the wrong type, raises an AttributeError. */ bool Dtool_Call_ExtractThisPointer(PyObject *self, Dtool_PyTypedObject &classdef, void **answer) { - if (self == NULL || !DtoolCanThisBeAPandaInstance(self)) { + if (self == NULL || !DtoolCanThisBeAPandaInstance(self) || ((Dtool_PyInstDef *)self)->_ptr_to_object == NULL) { Dtool_Raise_TypeError("C++ object is not yet constructed, or already destructed."); return false; } @@ -87,7 +87,7 @@ bool Dtool_Call_ExtractThisPointer(PyObject *self, Dtool_PyTypedObject &classdef bool Dtool_Call_ExtractThisPointer_NonConst(PyObject *self, Dtool_PyTypedObject &classdef, void **answer, const char *method_name) { - if (self == NULL || !DtoolCanThisBeAPandaInstance(self)) { + if (self == NULL || !DtoolCanThisBeAPandaInstance(self) || ((Dtool_PyInstDef *)self)->_ptr_to_object == NULL) { Dtool_Raise_TypeError("C++ object is not yet constructed, or already destructed."); return false; } @@ -816,6 +816,7 @@ PyObject *DTOOL_PyObject_RichCompare(PyObject *v1, PyObject *v2, int op) { int cmpval = DTOOL_PyObject_Compare(v1, v2); bool result; switch (op) { + NODEFAULT case Py_LT: result = (cmpval < 0); break; @@ -833,6 +834,7 @@ PyObject *DTOOL_PyObject_RichCompare(PyObject *v1, PyObject *v2, int op) { break; case Py_GE: result = (cmpval >= 0); + break; } return PyBool_FromLong(result); } diff --git a/dtool/src/interrogatedb/py_panda.h b/dtool/src/interrogatedb/py_panda.h index 8491c7529f..f5e77e0dbb 100644 --- a/dtool/src/interrogatedb/py_panda.h +++ b/dtool/src/interrogatedb/py_panda.h @@ -219,9 +219,10 @@ static PyObject *Dtool_new_##CLASS_NAME(PyTypeObject *type, PyObject *args, PyOb } // The following used to be in the above macro, but it doesn't seem to be -// necessary as tp_alloc memsets the object to 0. ((Dtool_PyInstDef -// *)self)->_ptr_to_object = NULL;\ ((Dtool_PyInstDef *)self)->_memory_rules = -// false;\ ((Dtool_PyInstDef *)self)->_is_const = false;\ +// necessary as tp_alloc memsets the object to 0. +// ((Dtool_PyInstDef *)self)->_ptr_to_object = NULL; +// ((Dtool_PyInstDef *)self)->_memory_rules = false; +// ((Dtool_PyInstDef *)self)->_is_const = false; // Delete functions.. #ifdef NDEBUG diff --git a/dtool/src/parser-inc/Python.h b/dtool/src/parser-inc/Python.h index b687f1b5cb..ddd660072d 100644 --- a/dtool/src/parser-inc/Python.h +++ b/dtool/src/parser-inc/Python.h @@ -30,7 +30,7 @@ typedef struct {} PyUnicodeObject; class PyThreadState; typedef int Py_ssize_t; -struct Py_buffer; +typedef struct bufferinfo Py_buffer; // We need to define these accurately since interrogate may want to // write these out to default value assignments. diff --git a/dtool/src/prc/configVariableFilename.cxx b/dtool/src/prc/configVariableFilename.cxx index dc82a88f45..3939199148 100644 --- a/dtool/src/prc/configVariableFilename.cxx +++ b/dtool/src/prc/configVariableFilename.cxx @@ -19,16 +19,28 @@ */ void ConfigVariableFilename:: reload_cache() { - nassertv(_core != (ConfigVariableCore *)NULL); - mark_cache_valid(_local_modified); + // NB. MSVC doesn't guarantee that this mutex is initialized in a + // thread-safe manner. But chances are that the first time this is called + // is at static init time, when there is no risk of data races. + static MutexImpl lock; + lock.acquire(); - const ConfigDeclaration *decl = _core->get_declaration(0); - const ConfigPage *page = decl->get_page(); + // We check again for cache validity since another thread may have beaten + // us to the punch while we were waiting for the lock. + if (!is_cache_valid(_local_modified)) { + nassertv(_core != (ConfigVariableCore *)NULL); - Filename page_filename(page->get_name()); - Filename page_dirname = page_filename.get_dirname(); - ExecutionEnvironment::shadow_environment_variable("THIS_PRC_DIR", page_dirname.to_os_specific()); + const ConfigDeclaration *decl = _core->get_declaration(0); + const ConfigPage *page = decl->get_page(); - _cache = Filename::expand_from(decl->get_string_value()); - ExecutionEnvironment::clear_shadow("THIS_PRC_DIR"); + Filename page_filename(page->get_name()); + Filename page_dirname = page_filename.get_dirname(); + ExecutionEnvironment::shadow_environment_variable("THIS_PRC_DIR", page_dirname.to_os_specific()); + + _cache = Filename::expand_from(decl->get_string_value()); + ExecutionEnvironment::clear_shadow("THIS_PRC_DIR"); + + mark_cache_valid(_local_modified); + } + lock.release(); } diff --git a/dtool/src/prc/configVariableString.I b/dtool/src/prc/configVariableString.I index b3b88b90fe..1adbbe6797 100644 --- a/dtool/src/prc/configVariableString.I +++ b/dtool/src/prc/configVariableString.I @@ -127,8 +127,7 @@ INLINE const string &ConfigVariableString:: get_value() const { TAU_PROFILE("const string &ConfigVariableString::get_value() const", " ", TAU_USER); if (!is_cache_valid(_local_modified)) { - mark_cache_valid(((ConfigVariableString *)this)->_local_modified); - ((ConfigVariableString *)this)->_cache = get_string_value(); + ((ConfigVariableString *)this)->reload_cache(); } return _cache; } diff --git a/dtool/src/prc/configVariableString.cxx b/dtool/src/prc/configVariableString.cxx index 125c8841a9..3dcaaf6deb 100644 --- a/dtool/src/prc/configVariableString.cxx +++ b/dtool/src/prc/configVariableString.cxx @@ -12,3 +12,24 @@ */ #include "configVariableString.h" + +/** + * Refreshes the variable's cached value. + */ +void ConfigVariableString:: +reload_cache() { + // NB. MSVC doesn't guarantee that this mutex is initialized in a + // thread-safe manner. But chances are that the first time this is called + // is at static init time, when there is no risk of data races. + static MutexImpl lock; + lock.acquire(); + + // We check again for cache validity since another thread may have beaten + // us to the punch while we were waiting for the lock. + if (!is_cache_valid(_local_modified)) { + _cache = get_string_value(); + mark_cache_valid(_local_modified); + } + + lock.release(); +} diff --git a/dtool/src/prc/configVariableString.h b/dtool/src/prc/configVariableString.h index 08709e1ac1..1592e0b836 100644 --- a/dtool/src/prc/configVariableString.h +++ b/dtool/src/prc/configVariableString.h @@ -49,6 +49,9 @@ PUBLISHED: INLINE string get_word(size_t n) const; INLINE void set_word(size_t n, const string &value); +private: + void reload_cache(); + private: AtomicAdjust::Integer _local_modified; string _cache; diff --git a/dtool/src/prc/notifyCategory.cxx b/dtool/src/prc/notifyCategory.cxx index e44b33dffa..a6e0a0181c 100644 --- a/dtool/src/prc/notifyCategory.cxx +++ b/dtool/src/prc/notifyCategory.cxx @@ -74,10 +74,15 @@ out(NotifySeverity severity, bool prefix) const { if (get_notify_timestamp()) { // Format a timestamp to include as a prefix as well. time_t now = time(NULL) + _server_delta; - struct tm *ptm = localtime(&now); + struct tm atm; +#ifdef _WIN32 + localtime_s(&atm, &now); +#else + localtime_r(&now, &atm); +#endif char buffer[128]; - strftime(buffer, 128, ":%m-%d-%Y %H:%M:%S ", ptm); + strftime(buffer, 128, ":%m-%d-%Y %H:%M:%S ", &atm); nout << buffer; } diff --git a/dtool/src/test_interrogate/test_interrogate.cxx b/dtool/src/test_interrogate/test_interrogate.cxx index f715a6f366..f9aa7c1ab4 100644 --- a/dtool/src/test_interrogate/test_interrogate.cxx +++ b/dtool/src/test_interrogate/test_interrogate.cxx @@ -17,7 +17,6 @@ #include "interrogate_request.h" #include "load_dso.h" #include "filename.h" -#include "pystub.h" #include "panda_getopt.h" #include "preprocess_argv.h" diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 4865b2b65a..1413aa379b 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -758,8 +758,8 @@ if (COMPILER=="GCC"): # 64-bits OS X doesn't have Carbon. PkgDisable("CARBON") - if (PkgSkip("PYTHON")==0): - IncDirectory("ALWAYS", SDK["PYTHON"]) + #if (PkgSkip("PYTHON")==0): + # IncDirectory("PYTHON", SDK["PYTHON"]) if (GetHost() == "darwin"): if (PkgSkip("FREETYPE")==0 and not os.path.isdir(GetThirdpartyDir() + 'freetype')): IncDirectory("FREETYPE", "/usr/X11/include") @@ -827,10 +827,7 @@ if (COMPILER=="GCC"): SmartPkgEnable("ROCKET", "", rocket_libs, "Rocket/Core.h") if not PkgSkip("PYTHON"): - if GetTarget() == "darwin" and not RTDIST and not PkgHasCustomLocation("PYTHON"): - LibName("PYTHON", "-framework Python") - else: - SmartPkgEnable("PYTHON", "", SDK["PYTHONVERSION"], (SDK["PYTHONVERSION"], SDK["PYTHONVERSION"] + "/Python.h"), tool = SDK["PYTHONVERSION"] + "-config") + SmartPkgEnable("PYTHON", "", SDK["PYTHONVERSION"], (SDK["PYTHONVERSION"], SDK["PYTHONVERSION"] + "/Python.h"), tool = SDK["PYTHONVERSION"] + "-config") SmartPkgEnable("OPENSSL", "openssl", ("ssl", "crypto"), ("openssl/ssl.h", "openssl/crypto.h")) SmartPkgEnable("ZLIB", "zlib", ("z"), "zlib.h") @@ -1056,7 +1053,7 @@ def CompileCxx(obj,src,opts): cmd = "cl " if GetTargetArch() == 'x64': cmd += "/favor:blend " - cmd += "/wd4996 /wd4275 /wd4267 /wd4101 /wd4273 " + cmd += "/wd4996 /wd4275 /wd4273 " # Enable Windows 7 interfaces if we need Touchinput. if PkgSkip("TOUCHINPUT") == 0: @@ -1241,7 +1238,7 @@ def CompileCxx(obj,src,opts): cmd += ' -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__' cmd += ' -fstack-protector -march=armv5te -mtune=xscale -msoft-float' elif arch == 'mips': - cmd += ' -fno-strict-aliasing -finline-functions -fmessage-length=0' + cmd += ' -finline-functions -fmessage-length=0' cmd += ' -fno-inline-functions-called-once -fgcse-after-reload' cmd += ' -frerun-cse-after-loop -frename-registers' @@ -1251,17 +1248,13 @@ def CompileCxx(obj,src,opts): if optlevel >= 3: cmd += " -fomit-frame-pointer" if arch.startswith('arm'): - cmd += ' -fno-strict-aliasing -finline-limit=64 -mthumb' - elif arch == 'x86': - cmd += ' -fstrict-aliasing' + cmd += ' -finline-limit=64 -mthumb' elif arch == 'mips': cmd += ' -funswitch-loops -finline-limit=300' else: cmd += ' -fno-omit-frame-pointer' if arch.startswith('arm'): cmd += ' -marm' - elif arch == 'x86': - cmd += ' -fno-strict-aliasing' # Enable SIMD instructions if requested if arch.startswith('arm') and PkgSkip("NEON") == 0: @@ -1289,6 +1282,9 @@ def CompileCxx(obj,src,opts): if ('SSE2' in opts or not PkgSkip("SSE2")) and not arch.startswith("arm"): cmd += " -msse2" + # Needed by both Python, Panda, Eigen, all of which break aliasing rules. + cmd += " -fno-strict-aliasing" + if optlevel >= 3: cmd += " -ffast-math" if optlevel == 3: @@ -3152,10 +3148,6 @@ COMMON_EGG2X_LIBS=[ 'libpandaegg.dll', ] + COMMON_PANDA_LIBS -COMMON_DTOOL_LIBS_PYSTUB = COMMON_DTOOL_LIBS + ['libp3pystub.lib'] -COMMON_PANDA_LIBS_PYSTUB = COMMON_PANDA_LIBS + ['libp3pystub.lib'] -COMMON_EGG2X_LIBS_PYSTUB = COMMON_EGG2X_LIBS + ['libp3pystub.lib'] - ######################################################################## # # This section contains a list of all the files that need to be compiled. @@ -3259,7 +3251,7 @@ TargetAdd('libp3dtoolconfig.dll', opts=['ADVAPI', 'OPENSSL', 'WINGDI', 'WINUSER' # DIRECTORY: dtool/src/interrogatedb/ # -OPTS=['DIR:dtool/src/interrogatedb', 'BUILDING:INTERROGATEDB'] +OPTS=['DIR:dtool/src/interrogatedb', 'BUILDING:INTERROGATEDB', 'PYTHON'] TargetAdd('p3interrogatedb_composite1.obj', opts=OPTS, input='p3interrogatedb_composite1.cxx') TargetAdd('p3interrogatedb_composite2.obj', opts=OPTS, input='p3interrogatedb_composite2.cxx') TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite1.obj') @@ -3271,7 +3263,7 @@ TargetAdd('libp3interrogatedb.dll', opts=['PYTHON']) if not PkgSkip("PYTHON"): # This used to be called dtoolconfig.pyd, but it just contains the interrogatedb # stuff, so it has been renamed appropriately. - OPTS=['DIR:dtool/metalibs/dtoolconfig'] + OPTS=['DIR:dtool/metalibs/dtoolconfig', 'PYTHON'] TargetAdd('interrogatedb_pydtool.obj', opts=OPTS, input="pydtool.cxx") TargetAdd('interrogatedb.pyd', input='interrogatedb_pydtool.obj') TargetAdd('interrogatedb.pyd', input='libp3dtool.dll') @@ -3283,11 +3275,12 @@ if not PkgSkip("PYTHON"): # DIRECTORY: dtool/src/pystub/ # -OPTS=['DIR:dtool/src/pystub'] -TargetAdd('p3pystub_pystub.obj', opts=OPTS, input='pystub.cxx') -TargetAdd('libp3pystub.lib', input='p3pystub_pystub.obj') -#TargetAdd('libp3pystub.lib', input='libp3dtool.dll') -TargetAdd('libp3pystub.lib', opts=['ADVAPI']) +if not RUNTIME and not RTDIST: + OPTS=['DIR:dtool/src/pystub'] + TargetAdd('p3pystub_pystub.obj', opts=OPTS, input='pystub.cxx') + TargetAdd('libp3pystub.lib', input='p3pystub_pystub.obj') + #TargetAdd('libp3pystub.lib', input='libp3dtool.dll') + TargetAdd('libp3pystub.lib', opts=['ADVAPI']) # # DIRECTORY: dtool/src/interrogate/ @@ -3300,14 +3293,14 @@ if (not RUNTIME): TargetAdd('interrogate.exe', input='interrogate_composite1.obj') TargetAdd('interrogate.exe', input='interrogate_composite2.obj') TargetAdd('interrogate.exe', input='libp3cppParser.ilb') - TargetAdd('interrogate.exe', input=COMMON_DTOOL_LIBS_PYSTUB) + TargetAdd('interrogate.exe', input=COMMON_DTOOL_LIBS) TargetAdd('interrogate.exe', input='libp3interrogatedb.dll') TargetAdd('interrogate.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER']) TargetAdd('interrogate_module_interrogate_module.obj', opts=OPTS, input='interrogate_module.cxx') TargetAdd('interrogate_module.exe', input='interrogate_module_interrogate_module.obj') TargetAdd('interrogate_module.exe', input='libp3cppParser.ilb') - TargetAdd('interrogate_module.exe', input=COMMON_DTOOL_LIBS_PYSTUB) + TargetAdd('interrogate_module.exe', input=COMMON_DTOOL_LIBS) TargetAdd('interrogate_module.exe', input='libp3interrogatedb.dll') TargetAdd('interrogate_module.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER']) @@ -3315,7 +3308,7 @@ if (not RUNTIME): TargetAdd('parse_file_parse_file.obj', opts=OPTS, input='parse_file.cxx') TargetAdd('parse_file.exe', input='parse_file_parse_file.obj') TargetAdd('parse_file.exe', input='libp3cppParser.ilb') - TargetAdd('parse_file.exe', input=COMMON_DTOOL_LIBS_PYSTUB) + TargetAdd('parse_file.exe', input=COMMON_DTOOL_LIBS) TargetAdd('parse_file.exe', input='libp3interrogatedb.dll') TargetAdd('parse_file.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER']) @@ -3327,7 +3320,7 @@ if (PkgSkip("OPENSSL")==0 and not RUNTIME and not RTDIST): OPTS=['DIR:dtool/src/prckeys', 'OPENSSL'] TargetAdd('make-prc-key_makePrcKey.obj', opts=OPTS, input='makePrcKey.cxx') TargetAdd('make-prc-key.exe', input='make-prc-key_makePrcKey.obj') - TargetAdd('make-prc-key.exe', input=COMMON_DTOOL_LIBS_PYSTUB) + TargetAdd('make-prc-key.exe', input=COMMON_DTOOL_LIBS) TargetAdd('make-prc-key.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER']) # @@ -3339,7 +3332,7 @@ if (not RTDIST and not RUNTIME): TargetAdd('test_interrogate_test_interrogate.obj', opts=OPTS, input='test_interrogate.cxx') TargetAdd('test_interrogate.exe', input='test_interrogate_test_interrogate.obj') TargetAdd('test_interrogate.exe', input='libp3interrogatedb.dll') - TargetAdd('test_interrogate.exe', input=COMMON_DTOOL_LIBS_PYSTUB) + TargetAdd('test_interrogate.exe', input=COMMON_DTOOL_LIBS) TargetAdd('test_interrogate.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER']) # @@ -3357,7 +3350,7 @@ OPTS=['DIR:panda/src/express', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB'] TargetAdd('p3express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx') TargetAdd('p3express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx') -OPTS=['DIR:panda/src/express', 'OPENSSL', 'ZLIB'] +OPTS=['DIR:panda/src/express', 'OPENSSL', 'ZLIB', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/express', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3express.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3express.in', opts=['IMOD:panda3d.core', 'ILIB:libp3express', 'SRCDIR:panda/src/express']) @@ -3372,7 +3365,7 @@ OPTS=['DIR:panda/src/downloader', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB'] TargetAdd('p3downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx') TargetAdd('p3downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx') -OPTS=['DIR:panda/src/downloader', 'OPENSSL', 'ZLIB'] +OPTS=['DIR:panda/src/downloader', 'OPENSSL', 'ZLIB', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/downloader', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3downloader.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3downloader.in', opts=['IMOD:panda3d.core', 'ILIB:libp3downloader', 'SRCDIR:panda/src/downloader']) @@ -3404,11 +3397,12 @@ if (not RUNTIME): TargetAdd('p3pipeline_composite2.obj', opts=OPTS, input='p3pipeline_composite2.cxx') TargetAdd('p3pipeline_contextSwitch.obj', opts=OPTS, input='contextSwitch.c') - OPTS=['DIR:panda/src/pipeline'] + OPTS=['DIR:panda/src/pipeline', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/pipeline', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3pipeline.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3pipeline.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pipeline', 'SRCDIR:panda/src/pipeline']) TargetAdd('libp3pipeline_igate.obj', input='libp3pipeline.in', opts=["DEPENDENCYONLY"]) + TargetAdd('p3pipeline_pythonThread.obj', opts=OPTS, input='pythonThread.cxx') # # DIRECTORY: panda/src/linmath/ @@ -3419,7 +3413,7 @@ if (not RUNTIME): TargetAdd('p3linmath_composite1.obj', opts=OPTS, input='p3linmath_composite1.cxx') TargetAdd('p3linmath_composite2.obj', opts=OPTS, input='p3linmath_composite2.cxx') - OPTS=['DIR:panda/src/linmath'] + OPTS=['DIR:panda/src/linmath', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/linmath', ["*.h", "*_composite*.cxx"]) for ifile in IGATEFILES[:]: if "_src." in ifile: @@ -3440,7 +3434,7 @@ if (not RUNTIME): TargetAdd('p3putil_composite1.obj', opts=OPTS, input='p3putil_composite1.cxx') TargetAdd('p3putil_composite2.obj', opts=OPTS, input='p3putil_composite2.cxx') - OPTS=['DIR:panda/src/putil', 'ZLIB'] + OPTS=['DIR:panda/src/putil', 'ZLIB', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/putil', ["*.h", "*_composite*.cxx"]) IGATEFILES.remove("test_bam.h") TargetAdd('libp3putil.in', opts=OPTS, input=IGATEFILES) @@ -3456,7 +3450,7 @@ if (not RUNTIME): OPTS=['DIR:panda/src/audio', 'BUILDING:PANDA'] TargetAdd('p3audio_composite1.obj', opts=OPTS, input='p3audio_composite1.cxx') - OPTS=['DIR:panda/src/audio'] + OPTS=['DIR:panda/src/audio', 'PYTHON'] IGATEFILES=["audio.h"] TargetAdd('libp3audio.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3audio.in', opts=['IMOD:panda3d.core', 'ILIB:libp3audio', 'SRCDIR:panda/src/audio']) @@ -3471,7 +3465,7 @@ if (not RUNTIME): TargetAdd('p3event_composite1.obj', opts=OPTS, input='p3event_composite1.cxx') TargetAdd('p3event_composite2.obj', opts=OPTS, input='p3event_composite2.cxx') - OPTS=['DIR:panda/src/event'] + OPTS=['DIR:panda/src/event', 'PYTHON'] TargetAdd('p3event_pythonTask.obj', opts=OPTS, input='pythonTask.cxx') IGATEFILES=GetDirectoryContents('panda/src/event', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3event.in', opts=OPTS, input=IGATEFILES) @@ -3487,7 +3481,7 @@ if (not RUNTIME): TargetAdd('p3mathutil_composite1.obj', opts=OPTS, input='p3mathutil_composite1.cxx') TargetAdd('p3mathutil_composite2.obj', opts=OPTS, input='p3mathutil_composite2.cxx') - OPTS=['DIR:panda/src/mathutil', 'FFTW'] + OPTS=['DIR:panda/src/mathutil', 'FFTW', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/mathutil', ["*.h", "*_composite*.cxx"]) for ifile in IGATEFILES[:]: if "_src." in ifile: @@ -3504,7 +3498,7 @@ if (not RUNTIME): OPTS=['DIR:panda/src/gsgbase', 'BUILDING:PANDA'] TargetAdd('p3gsgbase_composite1.obj', opts=OPTS, input='p3gsgbase_composite1.cxx') - OPTS=['DIR:panda/src/gsgbase'] + OPTS=['DIR:panda/src/gsgbase', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/gsgbase', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3gsgbase.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3gsgbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gsgbase', 'SRCDIR:panda/src/gsgbase']) @@ -3520,7 +3514,7 @@ if (not RUNTIME): TargetAdd('p3pnmimage_composite2.obj', opts=OPTS, input='p3pnmimage_composite2.cxx') TargetAdd('p3pnmimage_convert_srgb_sse2.obj', opts=OPTS+['SSE2'], input='convert_srgb_sse2.cxx') - OPTS=['DIR:panda/src/pnmimage', 'ZLIB'] + OPTS=['DIR:panda/src/pnmimage', 'ZLIB', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/pnmimage', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3pnmimage.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3pnmimage.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmimage', 'SRCDIR:panda/src/pnmimage']) @@ -3535,7 +3529,7 @@ if (not RUNTIME): OPTS=['DIR:panda/src/nativenet', 'OPENSSL', 'BUILDING:PANDA'] TargetAdd('p3nativenet_composite1.obj', opts=OPTS, input='p3nativenet_composite1.cxx') - OPTS=['DIR:panda/src/nativenet', 'OPENSSL'] + OPTS=['DIR:panda/src/nativenet', 'OPENSSL', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/nativenet', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3nativenet.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3nativenet.in', opts=['IMOD:panda3d.core', 'ILIB:libp3nativenet', 'SRCDIR:panda/src/nativenet']) @@ -3550,7 +3544,7 @@ if (not RUNTIME): TargetAdd('p3net_composite1.obj', opts=OPTS, input='p3net_composite1.cxx') TargetAdd('p3net_composite2.obj', opts=OPTS, input='p3net_composite2.cxx') - OPTS=['DIR:panda/src/net'] + OPTS=['DIR:panda/src/net', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/net', ["*.h", "*_composite*.cxx"]) IGATEFILES.remove("datagram_ui.h") TargetAdd('libp3net.in', opts=OPTS, input=IGATEFILES) @@ -3566,7 +3560,7 @@ if (not RUNTIME): TargetAdd('p3pstatclient_composite1.obj', opts=OPTS, input='p3pstatclient_composite1.cxx') TargetAdd('p3pstatclient_composite2.obj', opts=OPTS, input='p3pstatclient_composite2.cxx') - OPTS=['DIR:panda/src/pstatclient'] + OPTS=['DIR:panda/src/pstatclient', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/pstatclient', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3pstatclient.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3pstatclient.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pstatclient', 'SRCDIR:panda/src/pstatclient']) @@ -3581,7 +3575,7 @@ if (not RUNTIME): TargetAdd('p3gobj_composite1.obj', opts=OPTS, input='p3gobj_composite1.cxx') TargetAdd('p3gobj_composite2.obj', opts=OPTS, input='p3gobj_composite2.cxx') - OPTS=['DIR:panda/src/gobj', 'NVIDIACG', 'ZLIB', 'SQUISH'] + OPTS=['DIR:panda/src/gobj', 'NVIDIACG', 'ZLIB', 'SQUISH', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/gobj', ["*.h", "*_composite*.cxx"]) if ("cgfx_states.h" in IGATEFILES): IGATEFILES.remove("cgfx_states.h") TargetAdd('libp3gobj.in', opts=OPTS, input=IGATEFILES) @@ -3598,7 +3592,7 @@ if (not RUNTIME): TargetAdd('p3pgraphnodes_composite1.obj', opts=OPTS, input='p3pgraphnodes_composite1.cxx') TargetAdd('p3pgraphnodes_composite2.obj', opts=OPTS, input='p3pgraphnodes_composite2.cxx') - OPTS=['DIR:panda/src/pgraphnodes'] + OPTS=['DIR:panda/src/pgraphnodes', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/pgraphnodes', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3pgraphnodes.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3pgraphnodes.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraphnodes', 'SRCDIR:panda/src/pgraphnodes']) @@ -3616,7 +3610,7 @@ if (not RUNTIME): TargetAdd('p3pgraph_composite3.obj', opts=OPTS, input='p3pgraph_composite3.cxx') TargetAdd('p3pgraph_composite4.obj', opts=OPTS, input='p3pgraph_composite4.cxx') - OPTS=['DIR:panda/src/pgraph'] + OPTS=['DIR:panda/src/pgraph', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/pgraph', ["*.h", "nodePath.cxx", "*_composite*.cxx"]) TargetAdd('libp3pgraph.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3pgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraph', 'SRCDIR:panda/src/pgraph']) @@ -3632,7 +3626,7 @@ if (not RUNTIME): TargetAdd('p3cull_composite1.obj', opts=OPTS, input='p3cull_composite1.cxx') TargetAdd('p3cull_composite2.obj', opts=OPTS, input='p3cull_composite2.cxx') - OPTS=['DIR:panda/src/cull'] + OPTS=['DIR:panda/src/cull', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/cull', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3cull.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3cull.in', opts=['IMOD:panda3d.core', 'ILIB:libp3cull', 'SRCDIR:panda/src/cull']) @@ -3647,7 +3641,7 @@ if (not RUNTIME): TargetAdd('p3chan_composite1.obj', opts=OPTS, input='p3chan_composite1.cxx') TargetAdd('p3chan_composite2.obj', opts=OPTS, input='p3chan_composite2.cxx') - OPTS=['DIR:panda/src/chan'] + OPTS=['DIR:panda/src/chan', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/chan', ["*.h", "*_composite*.cxx"]) IGATEFILES.remove('movingPart.h') IGATEFILES.remove('animChannelFixed.h') @@ -3664,7 +3658,7 @@ if (not RUNTIME): TargetAdd('p3char_composite1.obj', opts=OPTS, input='p3char_composite1.cxx') TargetAdd('p3char_composite2.obj', opts=OPTS, input='p3char_composite2.cxx') - OPTS=['DIR:panda/src/char'] + OPTS=['DIR:panda/src/char', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/char', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3char.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3char.in', opts=['IMOD:panda3d.core', 'ILIB:libp3char', 'SRCDIR:panda/src/char']) @@ -3679,7 +3673,7 @@ if (not RUNTIME): TargetAdd('p3dgraph_composite1.obj', opts=OPTS, input='p3dgraph_composite1.cxx') TargetAdd('p3dgraph_composite2.obj', opts=OPTS, input='p3dgraph_composite2.cxx') - OPTS=['DIR:panda/src/dgraph'] + OPTS=['DIR:panda/src/dgraph', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/dgraph', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3dgraph.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3dgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dgraph', 'SRCDIR:panda/src/dgraph']) @@ -3694,7 +3688,7 @@ if (not RUNTIME): TargetAdd('p3display_composite1.obj', opts=OPTS, input='p3display_composite1.cxx') TargetAdd('p3display_composite2.obj', opts=OPTS, input='p3display_composite2.cxx') - OPTS=['DIR:panda/src/display'] + OPTS=['DIR:panda/src/display', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/display', ["*.h", "*_composite*.cxx"]) IGATEFILES.remove("renderBuffer.h") TargetAdd('libp3display.in', opts=OPTS, input=IGATEFILES) @@ -3718,7 +3712,7 @@ if (not RUNTIME): TargetAdd('p3device_composite1.obj', opts=OPTS, input='p3device_composite1.cxx') TargetAdd('p3device_composite2.obj', opts=OPTS, input='p3device_composite2.cxx') - OPTS=['DIR:panda/src/device'] + OPTS=['DIR:panda/src/device', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/device', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3device.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3device.in', opts=['IMOD:panda3d.core', 'ILIB:libp3device', 'SRCDIR:panda/src/device']) @@ -3732,7 +3726,7 @@ if (PkgSkip("FREETYPE")==0 and not RUNTIME): OPTS=['DIR:panda/src/pnmtext', 'BUILDING:PANDA', 'FREETYPE'] TargetAdd('p3pnmtext_composite1.obj', opts=OPTS, input='p3pnmtext_composite1.cxx') - OPTS=['DIR:panda/src/pnmtext', 'FREETYPE'] + OPTS=['DIR:panda/src/pnmtext', 'FREETYPE', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/pnmtext', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3pnmtext.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3pnmtext.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmtext', 'SRCDIR:panda/src/pnmtext']) @@ -3747,7 +3741,7 @@ if (not RUNTIME): TargetAdd('p3text_composite1.obj', opts=OPTS, input='p3text_composite1.cxx') TargetAdd('p3text_composite2.obj', opts=OPTS, input='p3text_composite2.cxx') - OPTS=['DIR:panda/src/text', 'ZLIB', 'FREETYPE'] + OPTS=['DIR:panda/src/text', 'ZLIB', 'FREETYPE', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/text', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3text.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3text.in', opts=['IMOD:panda3d.core', 'ILIB:libp3text', 'SRCDIR:panda/src/text']) @@ -3761,7 +3755,7 @@ if (not RUNTIME): OPTS=['DIR:panda/src/movies', 'BUILDING:PANDA', 'VORBIS'] TargetAdd('p3movies_composite1.obj', opts=OPTS, input='p3movies_composite1.cxx') - OPTS=['DIR:panda/src/movies', 'VORBIS'] + OPTS=['DIR:panda/src/movies', 'VORBIS', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/movies', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3movies.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3movies.in', opts=['IMOD:panda3d.core', 'ILIB:libp3movies', 'SRCDIR:panda/src/movies']) @@ -3777,7 +3771,7 @@ if (not RUNTIME): TargetAdd('p3grutil_composite1.obj', opts=OPTS, input='p3grutil_composite1.cxx') TargetAdd('p3grutil_composite2.obj', opts=OPTS, input='p3grutil_composite2.cxx') - OPTS=['DIR:panda/src/grutil'] + OPTS=['DIR:panda/src/grutil', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/grutil', ["*.h", "*_composite*.cxx"]) if 'convexHull.h' in IGATEFILES: IGATEFILES.remove('convexHull.h') TargetAdd('libp3grutil.in', opts=OPTS, input=IGATEFILES) @@ -3793,7 +3787,7 @@ if (not RUNTIME): TargetAdd('p3tform_composite1.obj', opts=OPTS, input='p3tform_composite1.cxx') TargetAdd('p3tform_composite2.obj', opts=OPTS, input='p3tform_composite2.cxx') - OPTS=['DIR:panda/src/tform'] + OPTS=['DIR:panda/src/tform', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/tform', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3tform.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3tform.in', opts=['IMOD:panda3d.core', 'ILIB:libp3tform', 'SRCDIR:panda/src/tform']) @@ -3808,7 +3802,7 @@ if (not RUNTIME): TargetAdd('p3collide_composite1.obj', opts=OPTS, input='p3collide_composite1.cxx') TargetAdd('p3collide_composite2.obj', opts=OPTS, input='p3collide_composite2.cxx') - OPTS=['DIR:panda/src/collide'] + OPTS=['DIR:panda/src/collide', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/collide', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3collide.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3collide.in', opts=['IMOD:panda3d.core', 'ILIB:libp3collide', 'SRCDIR:panda/src/collide']) @@ -3823,7 +3817,7 @@ if (not RUNTIME): TargetAdd('p3parametrics_composite1.obj', opts=OPTS, input='p3parametrics_composite1.cxx') TargetAdd('p3parametrics_composite2.obj', opts=OPTS, input='p3parametrics_composite2.cxx') - OPTS=['DIR:panda/src/parametrics'] + OPTS=['DIR:panda/src/parametrics', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/parametrics', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3parametrics.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3parametrics.in', opts=['IMOD:panda3d.core', 'ILIB:libp3parametrics', 'SRCDIR:panda/src/parametrics']) @@ -3838,7 +3832,7 @@ if (not RUNTIME): TargetAdd('p3pgui_composite1.obj', opts=OPTS, input='p3pgui_composite1.cxx') TargetAdd('p3pgui_composite2.obj', opts=OPTS, input='p3pgui_composite2.cxx') - OPTS=['DIR:panda/src/pgui'] + OPTS=['DIR:panda/src/pgui', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/pgui', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3pgui.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3pgui.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgui', 'SRCDIR:panda/src/pgui']) @@ -3862,7 +3856,7 @@ if (not RUNTIME): TargetAdd('p3recorder_composite1.obj', opts=OPTS, input='p3recorder_composite1.cxx') TargetAdd('p3recorder_composite2.obj', opts=OPTS, input='p3recorder_composite2.cxx') - OPTS=['DIR:panda/src/recorder'] + OPTS=['DIR:panda/src/recorder', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/recorder', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3recorder.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3recorder.in', opts=['IMOD:panda3d.core', 'ILIB:libp3recorder', 'SRCDIR:panda/src/recorder']) @@ -3882,7 +3876,7 @@ if (not RUNTIME): OPTS=['DIR:panda/src/dxml', 'BUILDING:PANDA', 'TINYXML'] TargetAdd('p3dxml_composite1.obj', opts=OPTS, input='p3dxml_composite1.cxx') - OPTS=['DIR:panda/src/dxml', 'TINYXML'] + OPTS=['DIR:panda/src/dxml', 'TINYXML', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/dxml', ["*.h", "p3dxml_composite1.cxx"]) TargetAdd('libp3dxml.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3dxml.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dxml', 'SRCDIR:panda/src/dxml']) @@ -4008,6 +4002,7 @@ if (not RUNTIME): if PkgSkip("FREETYPE")==0: TargetAdd('core_module.obj', input='libp3pnmtext.in') + TargetAdd('core_module.obj', opts=['PYTHON']) TargetAdd('core_module.obj', opts=['IMOD:panda3d.core', 'ILIB:core']) TargetAdd('core.pyd', input='libp3downloader_igate.obj') @@ -4047,6 +4042,7 @@ if (not RUNTIME): if PkgSkip("FREETYPE")==0: TargetAdd('core.pyd', input="libp3pnmtext_igate.obj") + TargetAdd('core.pyd', input='p3pipeline_pythonThread.obj') TargetAdd('core.pyd', input='p3putil_ext_composite.obj') TargetAdd('core.pyd', input='p3pnmimage_pfmFile_ext.obj') TargetAdd('core.pyd', input='p3event_pythonTask.obj') @@ -4075,7 +4071,7 @@ if (PkgSkip("VISION") == 0) and (not RUNTIME): TargetAdd('libp3vision.dll', input=COMMON_PANDA_LIBS) TargetAdd('libp3vision.dll', opts=OPTS) - OPTS=['DIR:panda/src/vision', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS'] + OPTS=['DIR:panda/src/vision', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/vision', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3vision.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3vision.in', opts=['IMOD:panda3d.vision', 'ILIB:libp3vision', 'SRCDIR:panda/src/vision']) @@ -4097,14 +4093,14 @@ if (PkgSkip("VISION") == 0) and (not RUNTIME): # if (PkgSkip("ROCKET") == 0) and (not RUNTIME): - OPTS=['DIR:panda/src/rocket', 'BUILDING:ROCKET', 'ROCKET'] + OPTS=['DIR:panda/src/rocket', 'BUILDING:ROCKET', 'ROCKET', 'PYTHON'] TargetAdd('p3rocket_composite1.obj', opts=OPTS, input='p3rocket_composite1.cxx') TargetAdd('libp3rocket.dll', input='p3rocket_composite1.obj') TargetAdd('libp3rocket.dll', input=COMMON_PANDA_LIBS) TargetAdd('libp3rocket.dll', opts=OPTS) - OPTS=['DIR:panda/src/rocket', 'ROCKET', 'RTTI', 'EXCEPTIONS'] + OPTS=['DIR:panda/src/rocket', 'ROCKET', 'RTTI', 'EXCEPTIONS', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/rocket', ["rocketInputHandler.h", "rocketInputHandler.cxx", "rocketRegion.h", "rocketRegion.cxx", "rocketRegion_ext.h"]) TargetAdd('libp3rocket.in', opts=OPTS, input=IGATEFILES) @@ -4134,7 +4130,7 @@ if PkgSkip("AWESOMIUM") == 0 and not RUNTIME: TargetAdd('libp3awesomium.dll', input=COMMON_PANDA_LIBS) TargetAdd('libp3awesomium.dll', opts=OPTS) - OPTS=['DIR:panda/src/awesomium', 'AWESOMIUM'] + OPTS=['DIR:panda/src/awesomium', 'AWESOMIUM', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/awesomium', ["*.h", "*_composite1.cxx"]) TargetAdd('libp3awesomium.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3awesomium.in', opts=['IMOD:panda3d.awesomium', 'ILIB:libp3awesomium', 'SRCDIR:panda/src/awesomium']) @@ -4159,7 +4155,7 @@ if (PkgSkip('SKEL')==0) and (not RUNTIME): OPTS=['DIR:panda/src/skel', 'BUILDING:PANDASKEL', 'ADVAPI'] TargetAdd('p3skel_composite1.obj', opts=OPTS, input='p3skel_composite1.cxx') - OPTS=['DIR:panda/src/skel', 'ADVAPI'] + OPTS=['DIR:panda/src/skel', 'ADVAPI', 'PYTHON'] IGATEFILES=GetDirectoryContents("panda/src/skel", ["*.h", "*_composite*.cxx"]) TargetAdd('libp3skel.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3skel.in', opts=['IMOD:panda3d.skel', 'ILIB:libp3skel', 'SRCDIR:panda/src/skel']) @@ -4175,7 +4171,9 @@ if (PkgSkip('SKEL')==0) and (not RUNTIME): TargetAdd('libpandaskel.dll', input=COMMON_PANDA_LIBS) TargetAdd('libpandaskel.dll', opts=OPTS) + OPTS=['PYTHON'] TargetAdd('skel_module.obj', input='libp3skel.in') + TargetAdd('skel_module.obj', opts=OPTS) TargetAdd('skel_module.obj', opts=['IMOD:panda3d.skel', 'ILIB:skel', 'IMPORT:panda3d.core']) TargetAdd('skel.pyd', input='skel_module.obj') @@ -4193,7 +4191,7 @@ if (PkgSkip('PANDAFX')==0) and (not RUNTIME): OPTS=['DIR:panda/src/distort', 'BUILDING:PANDAFX'] TargetAdd('p3distort_composite1.obj', opts=OPTS, input='p3distort_composite1.cxx') - OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG'] + OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/distort', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3distort.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3distort.in', opts=['IMOD:panda3d.fx', 'ILIB:libp3distort', 'SRCDIR:panda/src/distort']) @@ -4212,7 +4210,7 @@ if (PkgSkip('PANDAFX')==0) and (not RUNTIME): TargetAdd('libpandafx.dll', input=COMMON_PANDA_LIBS) TargetAdd('libpandafx.dll', opts=['ADVAPI', 'NVIDIACG']) - OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG'] + OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG', 'PYTHON'] TargetAdd('fx_module.obj', input='libp3distort.in') TargetAdd('fx_module.obj', opts=OPTS) TargetAdd('fx_module.obj', opts=['IMOD:panda3d.fx', 'ILIB:fx', 'IMPORT:panda3d.core']) @@ -4235,7 +4233,7 @@ if (PkgSkip("VRPN")==0 and not RUNTIME): TargetAdd('libp3vrpn.dll', input=COMMON_PANDA_LIBS) TargetAdd('libp3vrpn.dll', opts=['VRPN']) - OPTS=['DIR:panda/src/vrpn', 'VRPN'] + OPTS=['DIR:panda/src/vrpn', 'VRPN', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/vrpn', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3vrpn.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3vrpn.in', opts=['IMOD:panda3d.vrpn', 'ILIB:libp3vrpn', 'SRCDIR:panda/src/vrpn']) @@ -4289,43 +4287,43 @@ if (PkgSkip("OPENSSL")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOL TargetAdd('apply_patch_apply_patch.obj', opts=OPTS, input='apply_patch.cxx') TargetAdd('apply_patch.exe', input=['apply_patch_apply_patch.obj']) - TargetAdd('apply_patch.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('apply_patch.exe', input=COMMON_PANDA_LIBS) TargetAdd('apply_patch.exe', opts=OPTS) TargetAdd('build_patch_build_patch.obj', opts=OPTS, input='build_patch.cxx') TargetAdd('build_patch.exe', input=['build_patch_build_patch.obj']) - TargetAdd('build_patch.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('build_patch.exe', input=COMMON_PANDA_LIBS) TargetAdd('build_patch.exe', opts=OPTS) if not PkgSkip("ZLIB"): TargetAdd('check_adler_check_adler.obj', opts=OPTS, input='check_adler.cxx') TargetAdd('check_adler.exe', input=['check_adler_check_adler.obj']) - TargetAdd('check_adler.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('check_adler.exe', input=COMMON_PANDA_LIBS) TargetAdd('check_adler.exe', opts=OPTS) TargetAdd('check_crc_check_crc.obj', opts=OPTS, input='check_crc.cxx') TargetAdd('check_crc.exe', input=['check_crc_check_crc.obj']) - TargetAdd('check_crc.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('check_crc.exe', input=COMMON_PANDA_LIBS) TargetAdd('check_crc.exe', opts=OPTS) TargetAdd('check_md5_check_md5.obj', opts=OPTS, input='check_md5.cxx') TargetAdd('check_md5.exe', input=['check_md5_check_md5.obj']) - TargetAdd('check_md5.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('check_md5.exe', input=COMMON_PANDA_LIBS) TargetAdd('check_md5.exe', opts=OPTS) TargetAdd('pdecrypt_pdecrypt.obj', opts=OPTS, input='pdecrypt.cxx') TargetAdd('pdecrypt.exe', input=['pdecrypt_pdecrypt.obj']) - TargetAdd('pdecrypt.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('pdecrypt.exe', input=COMMON_PANDA_LIBS) TargetAdd('pdecrypt.exe', opts=OPTS) TargetAdd('pencrypt_pencrypt.obj', opts=OPTS, input='pencrypt.cxx') TargetAdd('pencrypt.exe', input=['pencrypt_pencrypt.obj']) - TargetAdd('pencrypt.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('pencrypt.exe', input=COMMON_PANDA_LIBS) TargetAdd('pencrypt.exe', opts=OPTS) TargetAdd('show_ddb_show_ddb.obj', opts=OPTS, input='show_ddb.cxx') TargetAdd('show_ddb.exe', input=['show_ddb_show_ddb.obj']) - TargetAdd('show_ddb.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('show_ddb.exe', input=COMMON_PANDA_LIBS) TargetAdd('show_ddb.exe', opts=OPTS) # @@ -4337,17 +4335,17 @@ if (PkgSkip("ZLIB")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS") TargetAdd('multify_multify.obj', opts=OPTS, input='multify.cxx') TargetAdd('multify.exe', input=['multify_multify.obj']) - TargetAdd('multify.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('multify.exe', input=COMMON_PANDA_LIBS) TargetAdd('multify.exe', opts=OPTS) TargetAdd('pzip_pzip.obj', opts=OPTS, input='pzip.cxx') TargetAdd('pzip.exe', input=['pzip_pzip.obj']) - TargetAdd('pzip.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('pzip.exe', input=COMMON_PANDA_LIBS) TargetAdd('pzip.exe', opts=OPTS) TargetAdd('punzip_punzip.obj', opts=OPTS, input='punzip.cxx') TargetAdd('punzip.exe', input=['punzip_punzip.obj']) - TargetAdd('punzip.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('punzip.exe', input=COMMON_PANDA_LIBS) TargetAdd('punzip.exe', opts=OPTS) # @@ -4393,7 +4391,7 @@ if (not RUNTIME): TargetAdd('p3egg_composite1.obj', opts=OPTS, input='p3egg_composite1.cxx') TargetAdd('p3egg_composite2.obj', opts=OPTS, input='p3egg_composite2.cxx') - OPTS=['DIR:panda/src/egg', 'ZLIB'] + OPTS=['DIR:panda/src/egg', 'ZLIB', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/egg', ["*.h", "*_composite*.cxx"]) if "parser.h" in IGATEFILES: IGATEFILES.remove("parser.h") TargetAdd('libp3egg.in', opts=OPTS, input=IGATEFILES) @@ -4410,7 +4408,7 @@ if (not RUNTIME): TargetAdd('p3egg2pg_composite1.obj', opts=OPTS, input='p3egg2pg_composite1.cxx') TargetAdd('p3egg2pg_composite2.obj', opts=OPTS, input='p3egg2pg_composite2.cxx') - OPTS=['DIR:panda/src/egg2pg'] + OPTS=['DIR:panda/src/egg2pg', 'PYTHON'] IGATEFILES=['load_egg_file.h'] TargetAdd('libp3egg2pg.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3egg2pg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg2pg', 'SRCDIR:panda/src/egg2pg']) @@ -4472,7 +4470,7 @@ if (not RUNTIME): TargetAdd('libpandaegg.dll', input=COMMON_PANDA_LIBS) TargetAdd('libpandaegg.dll', opts=['ADVAPI']) - OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg'] + OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg', 'PYTHON'] TargetAdd('egg_module.obj', input='libp3egg2pg.in') TargetAdd('egg_module.obj', input='libp3egg.in') TargetAdd('egg_module.obj', opts=OPTS) @@ -4609,12 +4607,12 @@ if (PkgSkip("EGL")==0 and PkgSkip("GLES2")==0 and PkgSkip("X11")==0 and not RUNT # DIRECTORY: panda/src/ode/ # if (PkgSkip("ODE")==0 and not RUNTIME): - OPTS=['DIR:panda/src/ode', 'BUILDING:PANDAODE', 'ODE'] + OPTS=['DIR:panda/src/ode', 'BUILDING:PANDAODE', 'ODE', 'PYTHON'] TargetAdd('p3ode_composite1.obj', opts=OPTS, input='p3ode_composite1.cxx') TargetAdd('p3ode_composite2.obj', opts=OPTS, input='p3ode_composite2.cxx') TargetAdd('p3ode_composite3.obj', opts=OPTS, input='p3ode_composite3.cxx') - OPTS=['DIR:panda/src/ode', 'ODE'] + OPTS=['DIR:panda/src/ode', 'ODE', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/ode', ["*.h", "*_composite*.cxx"]) IGATEFILES.remove("odeConvexGeom.h") IGATEFILES.remove("odeHeightFieldGeom.h") @@ -4638,7 +4636,7 @@ if (PkgSkip("ODE")==0 and not RUNTIME): TargetAdd('libpandaode.dll', input=COMMON_PANDA_LIBS) TargetAdd('libpandaode.dll', opts=['WINUSER', 'ODE']) - OPTS=['DIR:panda/metalibs/pandaode', 'ODE'] + OPTS=['DIR:panda/metalibs/pandaode', 'ODE', 'PYTHON'] TargetAdd('ode_module.obj', input='libpandaode.in') TargetAdd('ode_module.obj', opts=OPTS) TargetAdd('ode_module.obj', opts=['IMOD:panda3d.ode', 'ILIB:ode', 'IMPORT:panda3d.core']) @@ -4658,7 +4656,7 @@ if (PkgSkip("BULLET")==0 and not RUNTIME): OPTS=['DIR:panda/src/bullet', 'BUILDING:PANDABULLET', 'BULLET'] TargetAdd('p3bullet_composite.obj', opts=OPTS, input='p3bullet_composite.cxx') - OPTS=['DIR:panda/src/bullet', 'BULLET'] + OPTS=['DIR:panda/src/bullet', 'BULLET', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/bullet', ["*.h", "*_composite*.cxx"]) TargetAdd('libpandabullet.in', opts=OPTS, input=IGATEFILES) TargetAdd('libpandabullet.in', opts=['IMOD:panda3d.bullet', 'ILIB:libpandabullet', 'SRCDIR:panda/src/bullet']) @@ -4676,7 +4674,7 @@ if (PkgSkip("BULLET")==0 and not RUNTIME): TargetAdd('libpandabullet.dll', input=COMMON_PANDA_LIBS) TargetAdd('libpandabullet.dll', opts=['WINUSER', 'BULLET']) - OPTS=['DIR:panda/metalibs/pandabullet', 'BULLET'] + OPTS=['DIR:panda/metalibs/pandabullet', 'BULLET', 'PYTHON'] TargetAdd('bullet_module.obj', input='libpandabullet.in') TargetAdd('bullet_module.obj', opts=OPTS) TargetAdd('bullet_module.obj', opts=['IMOD:panda3d.bullet', 'ILIB:bullet', 'IMPORT:panda3d.core']) @@ -4696,7 +4694,7 @@ if (PkgSkip("PHYSX")==0): OPTS=['DIR:panda/src/physx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC'] TargetAdd('p3physx_composite.obj', opts=OPTS, input='p3physx_composite.cxx') - OPTS=['DIR:panda/src/physx', 'PHYSX', 'NOARCH:PPC'] + OPTS=['DIR:panda/src/physx', 'PHYSX', 'NOARCH:PPC', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/physx', ["*.h", "*_composite*.cxx"]) TargetAdd('libpandaphysx.in', opts=OPTS, input=IGATEFILES) TargetAdd('libpandaphysx.in', opts=['IMOD:panda3d.physx', 'ILIB:libpandaphysx', 'SRCDIR:panda/src/physx']) @@ -4715,7 +4713,7 @@ if (PkgSkip("PHYSX")==0): TargetAdd('libpandaphysx.dll', input=COMMON_PANDA_LIBS) TargetAdd('libpandaphysx.dll', opts=['WINUSER', 'PHYSX', 'NOARCH:PPC']) - OPTS=['DIR:panda/metalibs/pandaphysx', 'PHYSX', 'NOARCH:PPC'] + OPTS=['DIR:panda/metalibs/pandaphysx', 'PHYSX', 'NOARCH:PPC', 'PYTHON'] TargetAdd('physx_module.obj', input='libpandaphysx.in') TargetAdd('physx_module.obj', opts=OPTS) TargetAdd('physx_module.obj', opts=['IMOD:panda3d.physx', 'ILIB:physx', 'IMPORT:panda3d.core']) @@ -4736,7 +4734,7 @@ if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME): TargetAdd('p3physics_composite1.obj', opts=OPTS, input='p3physics_composite1.cxx') TargetAdd('p3physics_composite2.obj', opts=OPTS, input='p3physics_composite2.cxx') - OPTS=['DIR:panda/src/physics'] + OPTS=['DIR:panda/src/physics', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/physics', ["*.h", "*_composite*.cxx"]) IGATEFILES.remove("forces.h") TargetAdd('libp3physics.in', opts=OPTS, input=IGATEFILES) @@ -4752,7 +4750,7 @@ if (PkgSkip("PANDAPHYSICS")==0) and (PkgSkip("PANDAPARTICLESYSTEM")==0) and (not TargetAdd('p3particlesystem_composite1.obj', opts=OPTS, input='p3particlesystem_composite1.cxx') TargetAdd('p3particlesystem_composite2.obj', opts=OPTS, input='p3particlesystem_composite2.cxx') - OPTS=['DIR:panda/src/particlesystem'] + OPTS=['DIR:panda/src/particlesystem', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/particlesystem', ["*.h", "*_composite*.cxx"]) IGATEFILES.remove('orientedParticle.h') IGATEFILES.remove('orientedParticleFactory.h') @@ -4779,7 +4777,7 @@ if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME): TargetAdd('libpandaphysics.dll', input=COMMON_PANDA_LIBS) TargetAdd('libpandaphysics.dll', opts=['ADVAPI']) - OPTS=['DIR:panda/metalibs/pandaphysics'] + OPTS=['DIR:panda/metalibs/pandaphysics', 'PYTHON'] TargetAdd('physics_module.obj', input='libp3physics.in') if (PkgSkip("PANDAPARTICLESYSTEM")==0): TargetAdd('physics_module.obj', input='libp3particlesystem.in') @@ -4800,7 +4798,7 @@ if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME): # if (PkgSkip("SPEEDTREE")==0): - OPTS=['DIR:panda/src/speedtree', 'BUILDING:PANDASPEEDTREE', 'SPEEDTREE'] + OPTS=['DIR:panda/src/speedtree', 'BUILDING:PANDASPEEDTREE', 'SPEEDTREE', 'PYTHON'] TargetAdd('pandaspeedtree_composite1.obj', opts=OPTS, input='pandaspeedtree_composite1.cxx') IGATEFILES=GetDirectoryContents('panda/src/speedtree', ["*.h", "*_composite*.cxx"]) TargetAdd('libpandaspeedtree.in', opts=OPTS, input=IGATEFILES) @@ -4829,7 +4827,7 @@ if (not RTDIST and not RUNTIME and PkgSkip("PVIEW")==0 and GetTarget() != 'andro TargetAdd('pview.exe', input='pview_pview.obj') TargetAdd('pview.exe', input='libp3framework.dll') TargetAdd('pview.exe', input='libpandaegg.dll') - TargetAdd('pview.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('pview.exe', input=COMMON_PANDA_LIBS) TargetAdd('pview.exe', opts=['ADVAPI', 'WINSOCK2', 'WINSHELL']) # @@ -4856,7 +4854,7 @@ if (not RUNTIME and GetTarget() == 'android'): TargetAdd('pview.exe', input='libp3framework.dll') TargetAdd('pview.exe', input='libpandaegg.dll') TargetAdd('pview.exe', input='libp3android.dll') - TargetAdd('pview.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('pview.exe', input=COMMON_PANDA_LIBS) TargetAdd('AndroidManifest.xml', opts=OPTS, input='pview_manifest.xml') # @@ -4933,7 +4931,7 @@ if (PkgSkip("DIRECT")==0): # if (PkgSkip("DIRECT")==0): - OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA', 'BUILDING:DIRECT', 'BISONPREFIX_dcyy'] + OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA', 'BISONPREFIX_dcyy', 'PYTHON'] CreateFile(GetOutputDir()+"/include/dcParser.h") TargetAdd('p3dcparser_dcParser.obj', opts=OPTS, input='dcParser.yxx') TargetAdd('dcParser.h', input='p3dcparser_dcParser.obj', opts=['DEPENDENCYONLY']) @@ -4941,7 +4939,7 @@ if (PkgSkip("DIRECT")==0): TargetAdd('p3dcparser_composite1.obj', opts=OPTS, input='p3dcparser_composite1.cxx') TargetAdd('p3dcparser_composite2.obj', opts=OPTS, input='p3dcparser_composite2.cxx') - OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA'] + OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA', 'PYTHON'] IGATEFILES=GetDirectoryContents('direct/src/dcparser', ["*.h", "*_composite*.cxx"]) if "dcParser.h" in IGATEFILES: IGATEFILES.remove("dcParser.h") if "dcmsgtypes.h" in IGATEFILES: IGATEFILES.remove('dcmsgtypes.h') @@ -4957,7 +4955,7 @@ if (PkgSkip("DIRECT")==0): OPTS=['DIR:direct/src/deadrec', 'BUILDING:DIRECT'] TargetAdd('p3deadrec_composite1.obj', opts=OPTS, input='p3deadrec_composite1.cxx') - OPTS=['DIR:direct/src/deadrec'] + OPTS=['DIR:direct/src/deadrec', 'PYTHON'] IGATEFILES=GetDirectoryContents('direct/src/deadrec', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3deadrec.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3deadrec.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3deadrec', 'SRCDIR:direct/src/deadrec']) @@ -4968,12 +4966,12 @@ if (PkgSkip("DIRECT")==0): # if (PkgSkip("DIRECT")==0): - OPTS=['DIR:direct/src/distributed', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'BUILDING:DIRECT', 'OPENSSL'] + OPTS=['DIR:direct/src/distributed', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'BUILDING:DIRECT', 'OPENSSL', 'PYTHON'] TargetAdd('p3distributed_config_distributed.obj', opts=OPTS, input='config_distributed.cxx') TargetAdd('p3distributed_cConnectionRepository.obj', opts=OPTS, input='cConnectionRepository.cxx') TargetAdd('p3distributed_cDistributedSmoothNodeBase.obj', opts=OPTS, input='cDistributedSmoothNodeBase.cxx') - OPTS=['DIR:direct/src/distributed', 'WITHINPANDA', 'OPENSSL'] + OPTS=['DIR:direct/src/distributed', 'WITHINPANDA', 'OPENSSL', 'PYTHON'] IGATEFILES=GetDirectoryContents('direct/src/distributed', ["*.h", "*.cxx"]) TargetAdd('libp3distributed.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3distributed.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3distributed', 'SRCDIR:direct/src/distributed']) @@ -4987,7 +4985,7 @@ if (PkgSkip("DIRECT")==0): OPTS=['DIR:direct/src/interval', 'BUILDING:DIRECT'] TargetAdd('p3interval_composite1.obj', opts=OPTS, input='p3interval_composite1.cxx') - OPTS=['DIR:direct/src/interval'] + OPTS=['DIR:direct/src/interval', 'PYTHON'] IGATEFILES=GetDirectoryContents('direct/src/interval', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3interval.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3interval.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3interval', 'SRCDIR:direct/src/interval']) @@ -5003,7 +5001,7 @@ if (PkgSkip("DIRECT")==0): if GetTarget() == 'darwin': TargetAdd('p3showbase_showBase_assist.obj', opts=OPTS, input='showBase_assist.mm') - OPTS=['DIR:direct/src/showbase'] + OPTS=['DIR:direct/src/showbase', 'PYTHON'] IGATEFILES=GetDirectoryContents('direct/src/showbase', ["*.h", "showBase.cxx"]) TargetAdd('libp3showbase.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3showbase.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3showbase', 'SRCDIR:direct/src/showbase']) @@ -5018,7 +5016,7 @@ if (PkgSkip("DIRECT")==0): TargetAdd('p3motiontrail_cMotionTrail.obj', opts=OPTS, input='cMotionTrail.cxx') TargetAdd('p3motiontrail_config_motiontrail.obj', opts=OPTS, input='config_motiontrail.cxx') - OPTS=['DIR:direct/src/motiontrail'] + OPTS=['DIR:direct/src/motiontrail', 'PYTHON'] IGATEFILES=GetDirectoryContents('direct/src/motiontrail', ["*.h", "cMotionTrail.cxx"]) TargetAdd('libp3motiontrail.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3motiontrail.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3motiontrail', 'SRCDIR:direct/src/motiontrail']) @@ -5034,24 +5032,17 @@ if (PkgSkip("DIRECT")==0): TargetAdd('libp3direct.dll', input='p3direct_direct.obj') TargetAdd('libp3direct.dll', input='p3directbase_directbase.obj') - TargetAdd('libp3direct.dll', input='p3dcparser_composite1.obj') - TargetAdd('libp3direct.dll', input='p3dcparser_composite2.obj') - TargetAdd('libp3direct.dll', input='p3dcparser_dcParser.obj') - TargetAdd('libp3direct.dll', input='p3dcparser_dcLexer.obj') TargetAdd('libp3direct.dll', input='p3showbase_showBase.obj') if GetTarget() == 'darwin': TargetAdd('libp3direct.dll', input='p3showbase_showBase_assist.obj') TargetAdd('libp3direct.dll', input='p3deadrec_composite1.obj') TargetAdd('libp3direct.dll', input='p3interval_composite1.obj') - TargetAdd('libp3direct.dll', input='p3distributed_config_distributed.obj') - TargetAdd('libp3direct.dll', input='p3distributed_cConnectionRepository.obj') - TargetAdd('libp3direct.dll', input='p3distributed_cDistributedSmoothNodeBase.obj') TargetAdd('libp3direct.dll', input='p3motiontrail_config_motiontrail.obj') TargetAdd('libp3direct.dll', input='p3motiontrail_cMotionTrail.obj') TargetAdd('libp3direct.dll', input=COMMON_PANDA_LIBS) TargetAdd('libp3direct.dll', opts=['ADVAPI', 'OPENSSL', 'WINUSER', 'WINGDI']) - OPTS=['DIR:direct/metalibs/direct'] + OPTS=['DIR:direct/metalibs/direct', 'PYTHON'] TargetAdd('direct_module.obj', input='libp3dcparser.in') TargetAdd('direct_module.obj', input='libp3showbase.in') TargetAdd('direct_module.obj', input='libp3deadrec.in') @@ -5068,6 +5059,17 @@ if (PkgSkip("DIRECT")==0): TargetAdd('direct.pyd', input='libp3distributed_igate.obj') TargetAdd('direct.pyd', input='libp3motiontrail_igate.obj') + # These are part of direct.pyd, not libp3direct.dll, because they rely on + # the Python libraries. If a C++ user needs these modules, we can move them + # back and filter out the Python-specific code. + TargetAdd('direct.pyd', input='p3dcparser_composite1.obj') + TargetAdd('direct.pyd', input='p3dcparser_composite2.obj') + TargetAdd('direct.pyd', input='p3dcparser_dcParser.obj') + TargetAdd('direct.pyd', input='p3dcparser_dcLexer.obj') + TargetAdd('direct.pyd', input='p3distributed_config_distributed.obj') + TargetAdd('direct.pyd', input='p3distributed_cConnectionRepository.obj') + TargetAdd('direct.pyd', input='p3distributed_cDistributedSmoothNodeBase.obj') + TargetAdd('direct.pyd', input='direct_module.obj') TargetAdd('direct.pyd', input='libp3direct.dll') TargetAdd('direct.pyd', input='libp3interrogatedb.dll') @@ -5079,12 +5081,16 @@ if (PkgSkip("DIRECT")==0): # if (PkgSkip("PYTHON")==0 and PkgSkip("DIRECT")==0 and not RTDIST and not RUNTIME): - OPTS=['DIR:direct/src/dcparse', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'ADVAPI'] + OPTS=['DIR:direct/src/dcparse', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'ADVAPI', 'PYTHON'] TargetAdd('dcparse_dcparse.obj', opts=OPTS, input='dcparse.cxx') + TargetAdd('p3dcparse.exe', input='p3dcparser_composite1.obj') + TargetAdd('p3dcparse.exe', input='p3dcparser_composite2.obj') + TargetAdd('p3dcparse.exe', input='p3dcparser_dcParser.obj') + TargetAdd('p3dcparse.exe', input='p3dcparser_dcLexer.obj') TargetAdd('p3dcparse.exe', input='dcparse_dcparse.obj') TargetAdd('p3dcparse.exe', input='libp3direct.dll') - TargetAdd('p3dcparse.exe', input=COMMON_PANDA_LIBS_PYSTUB) - TargetAdd('p3dcparse.exe', opts=['ADVAPI']) + TargetAdd('p3dcparse.exe', input=COMMON_PANDA_LIBS) + TargetAdd('p3dcparse.exe', opts=['ADVAPI', 'PYTHON']) # # DIRECTORY: direct/src/plugin/ @@ -5133,9 +5139,10 @@ if (RTDIST or RUNTIME): if (PkgSkip("PYTHON")==0 and RTDIST): # Freeze VFSImporter and its dependency modules into p3dpython. # Mark panda3d.core as a dependency to make sure to build that first. - TargetAdd('p3dpython_frozen.obj', input='VFSImporter.py', opts=['DIR:direct/src/showbase', 'FREEZE_STARTUP']) + TargetAdd('p3dpython_frozen.obj', input='VFSImporter.py', opts=['DIR:direct/src/showbase', 'FREEZE_STARTUP', 'PYTHON']) TargetAdd('p3dpython_frozen.obj', dep='core.pyd') + OPTS += ['PYTHON'] TargetAdd('p3dpython_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx') TargetAdd('p3dpython_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx') TargetAdd('p3dpython.exe', input='p3dpython_p3dpython_composite1.obj') @@ -5166,7 +5173,7 @@ if (RTDIST or RUNTIME): TargetAdd('p3dpythonw.exe', input='libp3interrogatedb.dll') TargetAdd('p3dpythonw.exe', opts=['SUBSYSTEM:WINDOWS', 'PYTHON', 'WINUSER']) - if (PkgSkip("OPENSSL")==0 and RTDIST): + if (PkgSkip("OPENSSL")==0 and RTDIST and False): OPTS=['DIR:direct/src/plugin', 'DIR:panda/src/express', 'OPENSSL'] if GetTarget() == 'darwin': OPTS += ['OPT:2'] @@ -5287,7 +5294,7 @@ if (RUNTIME): TargetAdd('panda3d.exe', input='libpandaexpress.dll') TargetAdd('panda3d.exe', input='libp3dtoolconfig.dll') TargetAdd('panda3d.exe', input='libp3dtool.dll') - TargetAdd('panda3d.exe', input='libp3pystub.lib') + #TargetAdd('panda3d.exe', input='libp3pystub.lib') TargetAdd('panda3d.exe', input='libp3tinyxml.ilb') TargetAdd('panda3d.exe', opts=['NOICON', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON']) @@ -5301,7 +5308,7 @@ if (RUNTIME): TargetAdd('Panda3D.app', input='libpandaexpress.dll') TargetAdd('Panda3D.app', input='libp3dtoolconfig.dll') TargetAdd('Panda3D.app', input='libp3dtool.dll') - TargetAdd('Panda3D.app', input='libp3pystub.lib') + #TargetAdd('Panda3D.app', input='libp3pystub.lib') TargetAdd('Panda3D.app', input='libp3tinyxml.ilb') TargetAdd('Panda3D.app', input='panda3d_mac.plist', ipath=OPTS) TargetAdd('Panda3D.app', input='models/plugin_images/panda3d.icns') @@ -5316,7 +5323,7 @@ if (RUNTIME): TargetAdd('panda3dw.exe', input='libpandaexpress.dll') TargetAdd('panda3dw.exe', input='libp3dtoolconfig.dll') TargetAdd('panda3dw.exe', input='libp3dtool.dll') - TargetAdd('panda3dw.exe', input='libp3pystub.lib') + #TargetAdd('panda3dw.exe', input='libp3pystub.lib') TargetAdd('panda3dw.exe', input='libp3tinyxml.ilb') TargetAdd('panda3dw.exe', opts=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON']) @@ -5327,7 +5334,7 @@ if (RTDIST): TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx') TargetAdd('plugin_standalone_p3dEmbedMain.obj', opts=OPTS, input='p3dEmbedMain.cxx') TargetAdd('plugin_standalone_p3dEmbed.obj', opts=OPTS, input='p3dEmbed.cxx') - TargetAdd('plugin_standalone_pystub.obj', opts=OPTS, input='pystub.cxx') + #TargetAdd('plugin_standalone_pystub.obj', opts=OPTS, input='pystub.cxx') TargetAdd('plugin_standalone_dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx') TargetAdd('plugin_standalone_dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx') TargetAdd('plugin_standalone_lookup3.obj', opts=OPTS, input='lookup3.c') @@ -5346,7 +5353,7 @@ if (RTDIST): TargetAdd('p3dembed.exe', input='plugin_standalone_panda3dBase.obj') TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbedMain.obj') TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbed.obj') - TargetAdd('p3dembed.exe', input='plugin_standalone_pystub.obj') + #TargetAdd('p3dembed.exe', input='plugin_standalone_pystub.obj') TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite1.obj') TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite2.obj') TargetAdd('p3dembed.exe', input='plugin_standalone_lookup3.obj') @@ -5377,7 +5384,7 @@ if (RTDIST): TargetAdd('p3dembedw.exe', input='plugin_standalone_panda3dBase.obj') TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbedWinMain.obj') TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbed.obj') - TargetAdd('p3dembedw.exe', input='plugin_standalone_pystub.obj') + #TargetAdd('p3dembedw.exe', input='plugin_standalone_pystub.obj') TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite1.obj') TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite2.obj') TargetAdd('p3dembedw.exe', input='plugin_standalone_lookup3.obj') @@ -5445,17 +5452,17 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('bam-info.exe', input='libp3progbase.lib') TargetAdd('bam-info.exe', input='libp3pandatoolbase.lib') TargetAdd('bam-info.exe', input='libpandaegg.dll') - TargetAdd('bam-info.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('bam-info.exe', input=COMMON_PANDA_LIBS) TargetAdd('bam-info.exe', opts=['ADVAPI', 'FFTW']) TargetAdd('bam2egg_bamToEgg.obj', opts=OPTS, input='bamToEgg.cxx') TargetAdd('bam2egg.exe', input='bam2egg_bamToEgg.obj') - TargetAdd('bam2egg.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('bam2egg.exe', input=COMMON_EGG2X_LIBS) TargetAdd('bam2egg.exe', opts=['ADVAPI', 'FFTW']) TargetAdd('egg2bam_eggToBam.obj', opts=OPTS, input='eggToBam.cxx') TargetAdd('egg2bam.exe', input='egg2bam_eggToBam.obj') - TargetAdd('egg2bam.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg2bam.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg2bam.exe', opts=['ADVAPI', 'FFTW']) # @@ -5494,7 +5501,7 @@ if (PkgSkip("PANDATOOL")==0 and PkgSkip("FCOLLADA")==0): TargetAdd('dae2egg_daeToEgg.obj', opts=OPTS, input='daeToEgg.cxx') TargetAdd('dae2egg.exe', input='dae2egg_daeToEgg.obj') TargetAdd('dae2egg.exe', input='libp3daeegg.lib') - TargetAdd('dae2egg.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('dae2egg.exe', input=COMMON_EGG2X_LIBS) TargetAdd('dae2egg.exe', opts=['WINUSER', 'FCOLLADA', 'CARBON']) # @@ -5528,14 +5535,14 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('dxf-points.exe', input='libp3progbase.lib') TargetAdd('dxf-points.exe', input='libp3dxf.lib') TargetAdd('dxf-points.exe', input='libp3pandatoolbase.lib') - TargetAdd('dxf-points.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('dxf-points.exe', input=COMMON_PANDA_LIBS) TargetAdd('dxf-points.exe', opts=['ADVAPI', 'FFTW']) TargetAdd('dxf2egg_dxfToEgg.obj', opts=OPTS, input='dxfToEgg.cxx') TargetAdd('dxf2egg.exe', input='dxf2egg_dxfToEgg.obj') TargetAdd('dxf2egg.exe', input='libp3dxfegg.lib') TargetAdd('dxf2egg.exe', input='libp3dxf.lib') - TargetAdd('dxf2egg.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('dxf2egg.exe', input=COMMON_EGG2X_LIBS) TargetAdd('dxf2egg.exe', opts=['ADVAPI', 'FFTW']) TargetAdd('egg2dxf_eggToDXF.obj', opts=OPTS, input='eggToDXF.cxx') @@ -5543,7 +5550,7 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXF.obj') TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXFLayer.obj') TargetAdd('egg2dxf.exe', input='libp3dxf.lib') - TargetAdd('egg2dxf.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg2dxf.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg2dxf.exe', opts=['ADVAPI', 'FFTW']) # @@ -5568,12 +5575,12 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('obj2egg_objToEgg.obj', opts=OPTS, input='objToEgg.cxx') TargetAdd('obj2egg.exe', input='obj2egg_objToEgg.obj') TargetAdd('obj2egg.exe', input='libp3objegg.lib') - TargetAdd('obj2egg.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('obj2egg.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg2obj_eggToObj.obj', opts=OPTS, input='eggToObj.cxx') TargetAdd('egg2obj.exe', input='egg2obj_eggToObj.obj') TargetAdd('egg2obj.exe', input='libp3objegg.lib') - TargetAdd('egg2obj.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg2obj.exe', input=COMMON_EGG2X_LIBS) # # DIRECTORY: pandatool/src/palettizer/ @@ -5597,7 +5604,7 @@ if (PkgSkip("FREETYPE")==0) and (PkgSkip("PANDATOOL")==0): TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeDescription.obj') TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeIterator.obj') TargetAdd('egg-mkfont.exe', input='libp3palettizer.lib') - TargetAdd('egg-mkfont.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg-mkfont.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg-mkfont.exe', opts=['ADVAPI', 'FREETYPE']) # @@ -5624,7 +5631,7 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptcharUserData.obj') TargetAdd('egg-optchar.exe', input='egg-optchar_vertexMembership.obj') TargetAdd('egg-optchar.exe', input='libp3eggcharbase.lib') - TargetAdd('egg-optchar.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg-optchar.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg-optchar.exe', opts=['ADVAPI', 'FREETYPE']) # @@ -5636,7 +5643,7 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('egg-palettize_eggPalettize.obj', opts=OPTS, input='eggPalettize.cxx') TargetAdd('egg-palettize.exe', input='egg-palettize_eggPalettize.obj') TargetAdd('egg-palettize.exe', input='libp3palettizer.lib') - TargetAdd('egg-palettize.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg-palettize.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg-palettize.exe', opts=['ADVAPI']) # @@ -5650,7 +5657,7 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('egg-qtess.exe', input='libp3eggbase.lib') TargetAdd('egg-qtess.exe', input='libp3progbase.lib') TargetAdd('egg-qtess.exe', input='libp3converter.lib') - TargetAdd('egg-qtess.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg-qtess.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg-qtess.exe', opts=['ADVAPI']) # @@ -5661,49 +5668,49 @@ if (PkgSkip("PANDATOOL")==0): OPTS=['DIR:pandatool/src/eggprogs'] TargetAdd('egg-crop_eggCrop.obj', opts=OPTS, input='eggCrop.cxx') TargetAdd('egg-crop.exe', input='egg-crop_eggCrop.obj') - TargetAdd('egg-crop.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg-crop.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg-crop.exe', opts=['ADVAPI']) TargetAdd('egg-make-tube_eggMakeTube.obj', opts=OPTS, input='eggMakeTube.cxx') TargetAdd('egg-make-tube.exe', input='egg-make-tube_eggMakeTube.obj') - TargetAdd('egg-make-tube.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg-make-tube.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg-make-tube.exe', opts=['ADVAPI']) TargetAdd('egg-texture-cards_eggTextureCards.obj', opts=OPTS, input='eggTextureCards.cxx') TargetAdd('egg-texture-cards.exe', input='egg-texture-cards_eggTextureCards.obj') - TargetAdd('egg-texture-cards.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg-texture-cards.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg-texture-cards.exe', opts=['ADVAPI']) TargetAdd('egg-topstrip_eggTopstrip.obj', opts=OPTS, input='eggTopstrip.cxx') TargetAdd('egg-topstrip.exe', input='egg-topstrip_eggTopstrip.obj') TargetAdd('egg-topstrip.exe', input='libp3eggcharbase.lib') - TargetAdd('egg-topstrip.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg-topstrip.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg-topstrip.exe', opts=['ADVAPI']) TargetAdd('egg-trans_eggTrans.obj', opts=OPTS, input='eggTrans.cxx') TargetAdd('egg-trans.exe', input='egg-trans_eggTrans.obj') - TargetAdd('egg-trans.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg-trans.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg-trans.exe', opts=['ADVAPI']) TargetAdd('egg2c_eggToC.obj', opts=OPTS, input='eggToC.cxx') TargetAdd('egg2c.exe', input='egg2c_eggToC.obj') - TargetAdd('egg2c.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg2c.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg2c.exe', opts=['ADVAPI']) TargetAdd('egg-rename_eggRename.obj', opts=OPTS, input='eggRename.cxx') TargetAdd('egg-rename.exe', input='egg-rename_eggRename.obj') - TargetAdd('egg-rename.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg-rename.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg-rename.exe', opts=['ADVAPI']) TargetAdd('egg-retarget-anim_eggRetargetAnim.obj', opts=OPTS, input='eggRetargetAnim.cxx') TargetAdd('egg-retarget-anim.exe', input='egg-retarget-anim_eggRetargetAnim.obj') TargetAdd('egg-retarget-anim.exe', input='libp3eggcharbase.lib') - TargetAdd('egg-retarget-anim.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg-retarget-anim.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg-retarget-anim.exe', opts=['ADVAPI']) TargetAdd('egg-list-textures_eggListTextures.obj', opts=OPTS, input='eggListTextures.cxx') TargetAdd('egg-list-textures.exe', input='egg-list-textures_eggListTextures.obj') - TargetAdd('egg-list-textures.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg-list-textures.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg-list-textures.exe', opts=['ADVAPI']) # @@ -5734,33 +5741,33 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('egg2flt_eggToFlt.obj', opts=OPTS, input='eggToFlt.cxx') TargetAdd('egg2flt.exe', input='egg2flt_eggToFlt.obj') TargetAdd('egg2flt.exe', input='libp3flt.lib') - TargetAdd('egg2flt.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg2flt.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg2flt.exe', opts=['ADVAPI']) TargetAdd('flt-info_fltInfo.obj', opts=OPTS, input='fltInfo.cxx') TargetAdd('flt-info.exe', input='flt-info_fltInfo.obj') TargetAdd('flt-info.exe', input='libp3flt.lib') - TargetAdd('flt-info.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('flt-info.exe', input=COMMON_EGG2X_LIBS) TargetAdd('flt-info.exe', opts=['ADVAPI']) TargetAdd('flt-trans_fltTrans.obj', opts=OPTS, input='fltTrans.cxx') TargetAdd('flt-trans.exe', input='flt-trans_fltTrans.obj') TargetAdd('flt-trans.exe', input='libp3flt.lib') - TargetAdd('flt-trans.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('flt-trans.exe', input=COMMON_EGG2X_LIBS) TargetAdd('flt-trans.exe', opts=['ADVAPI']) TargetAdd('flt2egg_fltToEgg.obj', opts=OPTS, input='fltToEgg.cxx') TargetAdd('flt2egg.exe', input='flt2egg_fltToEgg.obj') TargetAdd('flt2egg.exe', input='libp3flt.lib') TargetAdd('flt2egg.exe', input='libp3fltegg.lib') - TargetAdd('flt2egg.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('flt2egg.exe', input=COMMON_EGG2X_LIBS) TargetAdd('flt2egg.exe', opts=['ADVAPI']) TargetAdd('fltcopy_fltCopy.obj', opts=OPTS, input='fltCopy.cxx') TargetAdd('fltcopy.exe', input='fltcopy_fltCopy.obj') TargetAdd('fltcopy.exe', input='libp3cvscopy.lib') TargetAdd('fltcopy.exe', input='libp3flt.lib') - TargetAdd('fltcopy.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('fltcopy.exe', input=COMMON_EGG2X_LIBS) TargetAdd('fltcopy.exe', opts=['ADVAPI']) @@ -5786,7 +5793,6 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('image-info.exe', input='libp3pandatoolbase.lib') TargetAdd('image-info.exe', input='libpandaegg.dll') TargetAdd('image-info.exe', input=COMMON_PANDA_LIBS) - TargetAdd('image-info.exe', input='libp3pystub.lib') TargetAdd('image-info.exe', opts=['ADVAPI']) TargetAdd('image-resize_imageResize.obj', opts=OPTS, input='imageResize.cxx') @@ -5796,7 +5802,6 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('image-resize.exe', input='libp3pandatoolbase.lib') TargetAdd('image-resize.exe', input='libpandaegg.dll') TargetAdd('image-resize.exe', input=COMMON_PANDA_LIBS) - TargetAdd('image-resize.exe', input='libp3pystub.lib') TargetAdd('image-resize.exe', opts=['ADVAPI']) TargetAdd('image-trans_imageTrans.obj', opts=OPTS, input='imageTrans.cxx') @@ -5806,7 +5811,6 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('image-trans.exe', input='libp3pandatoolbase.lib') TargetAdd('image-trans.exe', input='libpandaegg.dll') TargetAdd('image-trans.exe', input=COMMON_PANDA_LIBS) - TargetAdd('image-trans.exe', input='libp3pystub.lib') TargetAdd('image-trans.exe', opts=['ADVAPI']) # @@ -5820,7 +5824,6 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('pfm-trans.exe', input='libp3progbase.lib') TargetAdd('pfm-trans.exe', input='libp3pandatoolbase.lib') TargetAdd('pfm-trans.exe', input=COMMON_PANDA_LIBS) - TargetAdd('pfm-trans.exe', input='libp3pystub.lib') TargetAdd('pfm-trans.exe', opts=['ADVAPI']) TargetAdd('pfm-bba_pfmBba.obj', opts=OPTS, input='pfmBba.cxx') @@ -5830,7 +5833,6 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('pfm-bba.exe', input='libp3progbase.lib') TargetAdd('pfm-bba.exe', input='libp3pandatoolbase.lib') TargetAdd('pfm-bba.exe', input=COMMON_PANDA_LIBS) - TargetAdd('pfm-bba.exe', input='libp3pystub.lib') TargetAdd('pfm-bba.exe', opts=['ADVAPI']) # @@ -5864,14 +5866,13 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('lwo-scan.exe', input='libp3pandatoolbase.lib') TargetAdd('lwo-scan.exe', input='libpandaegg.dll') TargetAdd('lwo-scan.exe', input=COMMON_PANDA_LIBS) - TargetAdd('lwo-scan.exe', input='libp3pystub.lib') TargetAdd('lwo-scan.exe', opts=['ADVAPI']) TargetAdd('lwo2egg_lwoToEgg.obj', opts=OPTS, input='lwoToEgg.cxx') TargetAdd('lwo2egg.exe', input='lwo2egg_lwoToEgg.obj') TargetAdd('lwo2egg.exe', input='libp3lwo.lib') TargetAdd('lwo2egg.exe', input='libp3lwoegg.lib') - TargetAdd('lwo2egg.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('lwo2egg.exe', input=COMMON_EGG2X_LIBS) TargetAdd('lwo2egg.exe', opts=['ADVAPI']) # @@ -5912,7 +5913,7 @@ for VER in MAXVERSIONS: TargetAdd('maxegg'+VNUM+'.dlo', input='maxegg'+VNUM+'_composite1.obj') TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg'+VNUM+'.res') TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg.def', ipath=OPTS) - TargetAdd('maxegg'+VNUM+'.dlo', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('maxegg'+VNUM+'.dlo', input=COMMON_EGG2X_LIBS) TargetAdd('maxegg'+VNUM+'.dlo', opts=OPTS) # @@ -6062,7 +6063,6 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('softcvs.exe', input='libp3pandatoolbase.lib') TargetAdd('softcvs.exe', input='libpandaegg.dll') TargetAdd('softcvs.exe', input=COMMON_PANDA_LIBS) - TargetAdd('softcvs.exe', input='libp3pystub.lib') TargetAdd('softcvs.exe', opts=['ADVAPI']) # @@ -6080,7 +6080,6 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('text-stats.exe', input='libp3pandatoolbase.lib') TargetAdd('text-stats.exe', input='libpandaegg.dll') TargetAdd('text-stats.exe', input=COMMON_PANDA_LIBS) - TargetAdd('text-stats.exe', input='libp3pystub.lib') TargetAdd('text-stats.exe', opts=['ADVAPI']) # @@ -6095,14 +6094,13 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('vrml-trans.exe', input='libp3progbase.lib') TargetAdd('vrml-trans.exe', input='libp3pandatoolbase.lib') TargetAdd('vrml-trans.exe', input=COMMON_PANDA_LIBS) - TargetAdd('vrml-trans.exe', input='libp3pystub.lib') TargetAdd('vrml-trans.exe', opts=['ADVAPI']) TargetAdd('vrml2egg_vrmlToEgg.obj', opts=OPTS, input='vrmlToEgg.cxx') TargetAdd('vrml2egg.exe', input='vrml2egg_vrmlToEgg.obj') TargetAdd('vrml2egg.exe', input='libp3vrmlegg.lib') TargetAdd('vrml2egg.exe', input='libp3vrml.lib') - TargetAdd('vrml2egg.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('vrml2egg.exe', input=COMMON_EGG2X_LIBS) TargetAdd('vrml2egg.exe', opts=['ADVAPI']) # @@ -6122,7 +6120,6 @@ if (PkgSkip("PANDATOOL")==0 and (GetTarget() == 'windows' or PkgSkip("GTK2")==0) TargetAdd('pstats.exe', input='libp3progbase.lib') TargetAdd('pstats.exe', input='libp3pandatoolbase.lib') TargetAdd('pstats.exe', input=COMMON_PANDA_LIBS) - TargetAdd('pstats.exe', input='libp3pystub.lib') TargetAdd('pstats.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSOCK', 'WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'GTK2']) # @@ -6135,7 +6132,7 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('egg2x.exe', input='egg2x_eggToX.obj') TargetAdd('egg2x.exe', input='libp3xfileegg.lib') TargetAdd('egg2x.exe', input='libp3xfile.lib') - TargetAdd('egg2x.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg2x.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg2x.exe', opts=['ADVAPI']) TargetAdd('x-trans_xFileTrans.obj', opts=OPTS, input='xFileTrans.cxx') @@ -6144,14 +6141,13 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('x-trans.exe', input='libp3xfile.lib') TargetAdd('x-trans.exe', input='libp3pandatoolbase.lib') TargetAdd('x-trans.exe', input=COMMON_PANDA_LIBS) - TargetAdd('x-trans.exe', input='libp3pystub.lib') TargetAdd('x-trans.exe', opts=['ADVAPI']) TargetAdd('x2egg_xFileToEgg.obj', opts=OPTS, input='xFileToEgg.cxx') TargetAdd('x2egg.exe', input='x2egg_xFileToEgg.obj') TargetAdd('x2egg.exe', input='libp3xfileegg.lib') TargetAdd('x2egg.exe', input='libp3xfile.lib') - TargetAdd('x2egg.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('x2egg.exe', input=COMMON_EGG2X_LIBS) TargetAdd('x2egg.exe', opts=['ADVAPI']) # @@ -6176,8 +6172,8 @@ for VER in MAYAVERSIONS: TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaeggimport'+VNUM+'_mayaeggimport.obj') TargetAdd('mayaeggimport'+VNUM+'.mll', input='libpandaegg.dll') TargetAdd('mayaeggimport'+VNUM+'.mll', input=COMMON_PANDA_LIBS) - if GetTarget() == 'windows': - TargetAdd('mayaeggimport'+VNUM+'.mll', input='libp3pystub.lib') + #if GetTarget() == 'windows': + # TargetAdd('mayaeggimport'+VNUM+'.mll', input='libp3pystub.lib') TargetAdd('mayaeggimport'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS) TargetAdd('mayaloader'+VNUM+'_config_mayaloader.obj', opts=OPTS, input='config_mayaloader.cxx') @@ -6210,7 +6206,7 @@ for VER in MAYAVERSIONS: TargetAdd('libmayapview'+VNUM+'.mll', input='libmaya'+VNUM+'.lib') TargetAdd('libmayapview'+VNUM+'.mll', input='libp3framework.dll') if GetTarget() == 'windows': - TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS) else: TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS) TargetAdd('libmayapview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS) @@ -6220,7 +6216,7 @@ for VER in MAYAVERSIONS: TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib') TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib') if GetTarget() == 'windows': - TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS) else: TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS) TargetAdd('maya2egg'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS) @@ -6230,7 +6226,7 @@ for VER in MAYAVERSIONS: TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib') TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib') if GetTarget() == 'windows': - TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS) else: TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg2maya'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS) @@ -6240,7 +6236,7 @@ for VER in MAYAVERSIONS: TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libp3cvscopy.lib') TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib') if GetTarget() == 'windows': - TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS) else: TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS) TargetAdd('mayacopy'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS) @@ -6253,17 +6249,17 @@ for VER in MAYAVERSIONS: TargetAdd('maya2egg'+VNUM+'.exe', input='mayapath'+VNUM+'.obj') TargetAdd('maya2egg'+VNUM+'.exe', input='libpandaexpress.dll') - TargetAdd('maya2egg'+VNUM+'.exe', input=COMMON_DTOOL_LIBS_PYSTUB) + TargetAdd('maya2egg'+VNUM+'.exe', input=COMMON_DTOOL_LIBS) TargetAdd('maya2egg'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS) TargetAdd('egg2maya'+VNUM+'.exe', input='mayapath'+VNUM+'.obj') TargetAdd('egg2maya'+VNUM+'.exe', input='libpandaexpress.dll') - TargetAdd('egg2maya'+VNUM+'.exe', input=COMMON_DTOOL_LIBS_PYSTUB) + TargetAdd('egg2maya'+VNUM+'.exe', input=COMMON_DTOOL_LIBS) TargetAdd('egg2maya'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS) TargetAdd('mayacopy'+VNUM+'.exe', input='mayapath'+VNUM+'.obj') TargetAdd('mayacopy'+VNUM+'.exe', input='libpandaexpress.dll') - TargetAdd('mayacopy'+VNUM+'.exe', input=COMMON_DTOOL_LIBS_PYSTUB) + TargetAdd('mayacopy'+VNUM+'.exe', input=COMMON_DTOOL_LIBS) TargetAdd('mayacopy'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS) # @@ -6275,7 +6271,7 @@ if (PkgSkip("CONTRIB")==0 and not RUNTIME): TargetAdd('libpandaai.dll', input='p3ai_composite1.obj') TargetAdd('libpandaai.dll', input=COMMON_PANDA_LIBS) - OPTS=['DIR:contrib/src/ai'] + OPTS=['DIR:contrib/src/ai', 'PYTHON'] IGATEFILES=GetDirectoryContents('contrib/src/ai', ["*.h", "*_composite*.cxx"]) TargetAdd('libpandaai.in', opts=OPTS, input=IGATEFILES) TargetAdd('libpandaai.in', opts=['IMOD:panda3d.ai', 'ILIB:libpandaai', 'SRCDIR:contrib/src/ai']) @@ -6954,8 +6950,10 @@ def MakeInstallerOSX(): oscmd("cp -R %s/lib/libp3fmod_audio.* dstroot/fmodex/Developer/Panda3D/lib/" % GetOutputDir()) oscmd("cp -R %s/lib/libfmodex* dstroot/fmodex/Developer/Panda3D/lib/" % GetOutputDir()) - oscmd("mkdir -p dstroot/headers/Developer/Panda3D") + oscmd("mkdir -p dstroot/headers/Developer/Panda3D/lib") oscmd("cp -R %s/include dstroot/headers/Developer/Panda3D/include" % GetOutputDir()) + if os.path.isfile(GetOutputDir() + "/lib/libp3pystub.a"): + oscmd("cp -R -P %s/lib/libp3pystub.a dstroot/headers/Developer/Panda3D/lib/" % GetOutputDir()) if os.path.isdir("samples"): oscmd("mkdir -p dstroot/samples/Developer/Examples/Panda3D") diff --git a/panda/src/android/pview.cxx b/panda/src/android/pview.cxx index 60ee5eada6..9a29b94574 100644 --- a/panda/src/android/pview.cxx +++ b/panda/src/android/pview.cxx @@ -13,7 +13,6 @@ #include "pandaFramework.h" #include "pandaSystem.h" -#include "pystub.h" #include "texturePool.h" #include "multitexReducer.h" #include "sceneGraphReducer.h" @@ -29,9 +28,6 @@ #include "checkPandaVersion.h" int main(int argc, char **argv) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - PandaFramework framework; framework.open_framework(argc, argv); framework.set_window_title("Panda Viewer"); diff --git a/panda/src/audio/audioManager.cxx b/panda/src/audio/audioManager.cxx index bde70f8dba..8dd52a8786 100644 --- a/panda/src/audio/audioManager.cxx +++ b/panda/src/audio/audioManager.cxx @@ -40,7 +40,7 @@ Create_AudioManager_proc *AudioManager::_create_AudioManager = NULL; void AudioManager:: register_AudioManager_creator(Create_AudioManager_proc* proc) { - nassertv(_create_AudioManager == NULL); + nassertv(_create_AudioManager == NULL || _create_AudioManager == proc); _create_AudioManager = proc; } @@ -71,7 +71,7 @@ PT(AudioManager) AudioManager::create_AudioManager() { if (handle == (void *)NULL) { audio_error(" load_dso(" << dl_name << ") failed, will use NullAudioManager"); audio_error(" "<; +template class AnimChannelFixed; diff --git a/panda/src/chan/animChannelFixed.h b/panda/src/chan/animChannelFixed.h index 8835cc6db2..9940f5bdcf 100644 --- a/panda/src/chan/animChannelFixed.h +++ b/panda/src/chan/animChannelFixed.h @@ -62,6 +62,8 @@ private: static TypeHandle _type_handle; }; +EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_CHAN, EXPTP_PANDA_CHAN, AnimChannelFixed); +EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_CHAN, EXPTP_PANDA_CHAN, AnimChannelFixed); #include "animChannelFixed.I" diff --git a/panda/src/chan/p3chan_composite1.cxx b/panda/src/chan/p3chan_composite1.cxx index 411d6c0a9f..99bac712c7 100644 --- a/panda/src/chan/p3chan_composite1.cxx +++ b/panda/src/chan/p3chan_composite1.cxx @@ -3,6 +3,7 @@ #include "animBundleNode.cxx" #include "animChannel.cxx" #include "animChannelBase.cxx" +#include "animChannelFixed.cxx" #include "animChannelMatrixDynamic.cxx" #include "animChannelMatrixFixed.cxx" #include "animChannelMatrixXfmTable.cxx" diff --git a/panda/src/char/character.cxx b/panda/src/char/character.cxx index a57ec2eda6..ed28ac491e 100644 --- a/panda/src/char/character.cxx +++ b/panda/src/char/character.cxx @@ -228,7 +228,7 @@ calc_tight_bounds(LPoint3 &min_point, LPoint3 &max_point, bool &found_any, // around this, we will force-recompute all of the bounding volumes of our // parent nodes immediately. Parents parents = get_parents(); - for (int i = 0; i < parents.get_num_parents(); ++i) { + for (size_t i = 0; i < parents.get_num_parents(); ++i) { PandaNode *parent = parents.get_parent(i); parent->get_bounds(); } diff --git a/panda/src/cocoadisplay/cocoaGraphicsStateGuardian.mm b/panda/src/cocoadisplay/cocoaGraphicsStateGuardian.mm index 19ee0e8517..30630036ab 100644 --- a/panda/src/cocoadisplay/cocoaGraphicsStateGuardian.mm +++ b/panda/src/cocoadisplay/cocoaGraphicsStateGuardian.mm @@ -97,6 +97,26 @@ get_properties(FrameBufferProperties &properties, NSOpenGLPixelFormat* pixel_for } // TODO: add aux buffers + // Cocoa doesn't provide individual RGB bits. Make assumptions. + // Note that color_size seems to be returning values like 32, which + // suggests that it contains the alpha size as well. + + if (color_size == 24 || color_size == 32) { + properties.set_rgba_bits(8, 8, 8, alpha_size); + + } else if (color_size == 64) { + properties.set_rgba_bits(16, 16, 16, alpha_size); + + } else if (color_size == 128) { + properties.set_rgba_bits(32, 32, 32, alpha_size); + + } else if (color_size >= 3) { + // Assume it's giving us at least one of each. + properties.set_red_bits(1); + properties.set_green_bits(1); + properties.set_blue_bits(1); + } + // Extract the renderer ID bits and check if our renderer matches the known // software renderers. renderer_id &= kCGLRendererIDMatchingMask; diff --git a/panda/src/display/config_display.cxx b/panda/src/display/config_display.cxx index 0b46da0252..391a7e8676 100644 --- a/panda/src/display/config_display.cxx +++ b/panda/src/display/config_display.cxx @@ -298,6 +298,15 @@ ConfigVariableBool allow_incomplete_render "geometry is always paged in immediately when needed, holding up " "the frame render if necessary.")); +ConfigVariableBool old_alpha_blend +("old-alpha-blend", false, + PRC_DESC("Set this to true to enable the old alpha blending behavior from " + "Panda 1.9 in which the alpha value written out to the framebuffer " + "is squared. The new behavior is more intuitive when compositing " + "an semitransparent image produced using render-to-texture. You " + "should generally leave this false unless you have an effect that " + "relies on the old behavior, or you suspect an implementation bug.")); + ConfigVariableInt win_size ("win-size", "800 600", PRC_DESC("This is the default size at which to open a new window. This " diff --git a/panda/src/display/config_display.h b/panda/src/display/config_display.h index 1196389f5a..0b76e06472 100644 --- a/panda/src/display/config_display.h +++ b/panda/src/display/config_display.h @@ -68,6 +68,7 @@ extern EXPCL_PANDA_DISPLAY ConfigVariableBool default_stereo_camera; extern EXPCL_PANDA_DISPLAY ConfigVariableBool color_scale_via_lighting; extern EXPCL_PANDA_DISPLAY ConfigVariableBool alpha_scale_via_texture; extern EXPCL_PANDA_DISPLAY ConfigVariableBool allow_incomplete_render; +extern EXPCL_PANDA_DISPLAY ConfigVariableBool old_alpha_blend; extern EXPCL_PANDA_DISPLAY ConfigVariableInt win_size; extern EXPCL_PANDA_DISPLAY ConfigVariableInt win_origin; diff --git a/panda/src/display/displayRegion.cxx b/panda/src/display/displayRegion.cxx index d0eb6362b2..c8f7626468 100644 --- a/panda/src/display/displayRegion.cxx +++ b/panda/src/display/displayRegion.cxx @@ -638,9 +638,6 @@ do_compute_pixels(int i, int x_size, int y_size, CData *cdata) { Region ®ion = cdata->_regions[i]; - int old_w = region._pixels[1] - region._pixels[0]; - int old_h = region._pixels[3] - region._pixels[2]; - region._pixels[0] = int((region._dimensions[0] * x_size) + 0.5); region._pixels[1] = int((region._dimensions[1] * x_size) + 0.5); region._pixels_i[0] = region._pixels[0]; diff --git a/panda/src/display/graphicsEngine.cxx b/panda/src/display/graphicsEngine.cxx index 7052db532c..ad3aa3caa6 100644 --- a/panda/src/display/graphicsEngine.cxx +++ b/panda/src/display/graphicsEngine.cxx @@ -118,6 +118,23 @@ PStatCollector GraphicsEngine::_occlusion_passed_pcollector("Occlusion results:V PStatCollector GraphicsEngine::_occlusion_failed_pcollector("Occlusion results:Occluded"); PStatCollector GraphicsEngine::_occlusion_tests_pcollector("Occlusion tests"); +// This is used to keep track of which scenes we have already culled. +struct CullKey { + GraphicsStateGuardian *_gsg; + NodePath _camera; + int _lens_index; +}; + +INLINE static bool operator < (const CullKey &a, const CullKey &b) { + if (a._gsg != b._gsg) { + return a._gsg < b._gsg; + } + if (a._camera != b._camera) { + return a._camera < b._camera; + } + return a._lens_index < b._lens_index; +} + /** * Creates a new GraphicsEngine object. The Pipeline is normally left to * default to NULL, which indicates the global render pipeline, but it may be @@ -597,6 +614,9 @@ remove_all_windows() { // And, hey, let's stop the vertex paging threads, if any. VertexDataPage::stop_threads(); + // Stopping the tasks means we have to release the Python GIL while + // this method runs (hence it is marked BLOCKING), so that any + // Python tasks on other threads won't deadlock grabbing the GIL. AsyncTaskManager::get_global_ptr()->stop_threads(); #ifdef DO_PSTATS @@ -1372,7 +1392,6 @@ cull_to_bins(const GraphicsEngine::Windows &wlist, Thread *current_thread) { // Keep track of the cameras we have already used in this thread to render // DisplayRegions. - typedef pair CullKey; typedef pmap AlreadyCulled; AlreadyCulled already_culled; @@ -1387,10 +1406,13 @@ cull_to_bins(const GraphicsEngine::Windows &wlist, Thread *current_thread) { if (dr != (DisplayRegion *)NULL) { DisplayRegionPipelineReader *dr_reader = new DisplayRegionPipelineReader(dr, current_thread); - NodePath camera = dr_reader->get_camera(); - int lens_index = dr_reader->get_lens_index(); - AlreadyCulled::iterator aci = already_culled.insert(AlreadyCulled::value_type(CullKey(camera, lens_index), (DisplayRegion *)NULL)).first; + CullKey key; + key._gsg = win->get_gsg(); + key._camera = dr_reader->get_camera(); + key._lens_index = dr_reader->get_lens_index(); + + AlreadyCulled::iterator aci = already_culled.insert(AlreadyCulled::value_type(key, (DisplayRegion *)NULL)).first; if ((*aci).second == NULL) { // We have not used this camera already in this thread. Perform // the cull operation. @@ -1505,7 +1527,7 @@ draw_bins(const GraphicsEngine::Windows &wlist, Thread *current_thread) { // We have to place this collector inside begin_frame, because we need // a current context for PStatGPUTimer to work. { - PStatGPUTimer timer(win->get_gsg(), win->get_draw_window_pcollector(), current_thread); + PStatGPUTimer timer(gsg, win->get_draw_window_pcollector(), current_thread); win->clear(current_thread); if (display_cat.is_spam()) { @@ -1525,8 +1547,8 @@ draw_bins(const GraphicsEngine::Windows &wlist, Thread *current_thread) { if (_auto_flip) { #ifdef DO_PSTATS // This is a good time to perform a latency query. - if (win->get_gsg()->get_timer_queries_active()) { - win->get_gsg()->issue_timer_query(GraphicsStateGuardian::_command_latency_pcollector.get_index()); + if (gsg->get_timer_queries_active()) { + gsg->issue_timer_query(GraphicsStateGuardian::_command_latency_pcollector.get_index()); } #endif @@ -1538,7 +1560,7 @@ draw_bins(const GraphicsEngine::Windows &wlist, Thread *current_thread) { win->begin_flip(); } { - PStatGPUTimer timer(win->get_gsg(), GraphicsEngine::_flip_end_pcollector, current_thread); + PStatGPUTimer timer(gsg, GraphicsEngine::_flip_end_pcollector, current_thread); win->end_flip(); } } diff --git a/panda/src/display/graphicsEngine.h b/panda/src/display/graphicsEngine.h index 1775b49e61..89cfb7c616 100644 --- a/panda/src/display/graphicsEngine.h +++ b/panda/src/display/graphicsEngine.h @@ -53,7 +53,7 @@ class Texture; class EXPCL_PANDA_DISPLAY GraphicsEngine : public ReferenceCount { PUBLISHED: GraphicsEngine(Pipeline *pipeline = NULL); - ~GraphicsEngine(); + BLOCKING ~GraphicsEngine(); void set_threading_model(const GraphicsThreadingModel &threading_model); GraphicsThreadingModel get_threading_model() const; @@ -94,7 +94,7 @@ PUBLISHED: bool add_window(GraphicsOutput *window, int sort); bool remove_window(GraphicsOutput *window); - void remove_all_windows(); + BLOCKING void remove_all_windows(); void reset_all_windows(bool swapchain); bool is_empty() const; diff --git a/panda/src/display/graphicsPipeSelection.cxx b/panda/src/display/graphicsPipeSelection.cxx index 9ac0e8aa1f..cef68b22c2 100644 --- a/panda/src/display/graphicsPipeSelection.cxx +++ b/panda/src/display/graphicsPipeSelection.cxx @@ -105,6 +105,8 @@ get_pipe_type(int n) const { LightMutexHolder holder(_lock); if (n >= 0 && n < (int)_pipe_types.size()) { result = _pipe_types[n]._type; + } else { + result = TypeHandle::none(); } } return result; diff --git a/panda/src/display/graphicsStateGuardian.cxx b/panda/src/display/graphicsStateGuardian.cxx index 18d35d7f78..ad532c5643 100644 --- a/panda/src/display/graphicsStateGuardian.cxx +++ b/panda/src/display/graphicsStateGuardian.cxx @@ -235,6 +235,7 @@ GraphicsStateGuardian(CoordinateSystem internal_coordinate_system, _supports_basic_shaders = false; _supports_geometry_shaders = false; _supports_tessellation_shaders = false; + _supports_compute_shaders = false; _supports_glsl = false; _supports_hlsl = false; @@ -2060,8 +2061,6 @@ flush_timer_queries() { _last_num_queried = first; - int frame_index = ClockObject::get_global_clock()->get_frame_count(); - for (int i = 0; i < first; ++i) { CPT(TimerQueryContext) query = _pending_timer_queries[i]; diff --git a/panda/src/display/standardMunger.I b/panda/src/display/standardMunger.I index 4ebd308de2..e9dd4b43f8 100644 --- a/panda/src/display/standardMunger.I +++ b/panda/src/display/standardMunger.I @@ -18,13 +18,3 @@ INLINE GraphicsStateGuardian *StandardMunger:: get_gsg() const { return (GraphicsStateGuardian *)GeomMunger::get_gsg(); } - -/** - * Returns the render mode active on this munger. Intended for derived - * classes that may have to munge differently depending on render mode. - */ -INLINE RenderModeAttrib::Mode StandardMunger:: -get_render_mode() const { - return (_render_mode != NULL) ? _render_mode->get_mode() - : RenderModeAttrib::M_filled; -} diff --git a/panda/src/display/standardMunger.cxx b/panda/src/display/standardMunger.cxx index 1f88f23c46..b6bc1ada2a 100644 --- a/panda/src/display/standardMunger.cxx +++ b/panda/src/display/standardMunger.cxx @@ -38,9 +38,6 @@ StandardMunger(GraphicsStateGuardianBase *gsg, const RenderState *state, _auto_shader(false), _shader_skinning(false) { - _render_mode = (const RenderModeAttrib *) - state->get_attrib(RenderModeAttrib::get_class_slot()); - if (!get_gsg()->get_runtime_color_scale()) { // We might need to munge the colors. const ColorAttrib *color_attrib; @@ -183,14 +180,14 @@ munge_geom_impl(CPT(Geom) &geom, CPT(GeomVertexData) &vertex_data, // it rather than draw them one by one. if ((unsupported_bits & Geom::GR_composite_bits) != 0 || (unsupported_bits & Geom::GR_strip_cut_index) != 0) { -/* - * This decomposes everything in the primitive, so that if (for instance) the - * primitive contained both strips and fans, but the GSG didn't support fans, - * it would decompose the strips too. To handle this correctly, we'd need a - * separate decompose_fans() and decompose_strips() call; but for now, we'll - * just say it's good enough. In practice, we don't have any GSG's that can - * support strips without also supporting fans. - */ + + // This decomposes everything in the primitive, so that if (for + // instance) the primitive contained both strips and fans, but the GSG + // didn't support fans, it would decompose the strips too. To handle + // this correctly, we'd need a separate decompose_fans() and + // decompose_strips() call; but for now, we'll just say it's good + // enough. In practice, we don't have any GSG's that can support strips + // without also supporting fans. geom = geom->decompose(); // Decomposing might produce an indexed Geom, so re-check the @@ -228,14 +225,14 @@ premunge_geom_impl(CPT(Geom) &geom, CPT(GeomVertexData) &vertex_data) { // it rather than draw them one by one. if ((unsupported_bits & Geom::GR_composite_bits) != 0 || (unsupported_bits & Geom::GR_strip_cut_index) != 0) { -/* - * This decomposes everything in the primitive, so that if (for instance) the - * primitive contained both strips and fans, but the GSG didn't support fans, - * it would decompose the strips too. To handle this correctly, we'd need a - * separate decompose_fans() and decompose_strips() call; but for now, we'll - * just say it's good enough. In practice, we don't have any GSG's that can - * support strips without also supporting fans. - */ + + // This decomposes everything in the primitive, so that if (for + // instance) the primitive contained both strips and fans, but the GSG + // didn't support fans, it would decompose the strips too. To handle + // this correctly, we'd need a separate decompose_fans() and + // decompose_strips() call; but for now, we'll just say it's good + // enough. In practice, we don't have any GSG's that can support strips + // without also supporting fans. geom = geom->decompose(); // Decomposing might produce an indexed Geom, so re-check the @@ -267,10 +264,6 @@ int StandardMunger:: compare_to_impl(const GeomMunger *other) const { const StandardMunger *om = (const StandardMunger *)other; - if (_render_mode != om->_render_mode) { - return _render_mode < om->_render_mode ? -1 : 1; - } - if (_munge_color != om->_munge_color) { return (int)_munge_color - (int)om->_munge_color; } diff --git a/panda/src/display/standardMunger.h b/panda/src/display/standardMunger.h index 6a6dd9e675..05e8ee0344 100644 --- a/panda/src/display/standardMunger.h +++ b/panda/src/display/standardMunger.h @@ -46,13 +46,10 @@ protected: virtual int geom_compare_to_impl(const GeomMunger *other) const; virtual CPT(RenderState) munge_state_impl(const RenderState *state); - INLINE RenderModeAttrib::Mode get_render_mode() const; - private: int _num_components; NumericType _numeric_type; Contents _contents; - CPT(RenderModeAttrib) _render_mode; bool _munge_color; bool _munge_color_scale; diff --git a/panda/src/downloader/httpDate.cxx b/panda/src/downloader/httpDate.cxx index e2df9d1530..f3d156fc6a 100644 --- a/panda/src/downloader/httpDate.cxx +++ b/panda/src/downloader/httpDate.cxx @@ -223,8 +223,9 @@ HTTPDate(const string &format) { struct tm *tp = localtime(&now); _time -= tp->tm_gmtoff; #elif defined(_WIN32) - extern long int _timezone; - _time -= _timezone; + long int timezone; + _get_timezone(&timezone); + _time -= timezone; #else extern long int timezone; _time -= timezone; diff --git a/panda/src/downloader/multiplexStreamBuf.cxx b/panda/src/downloader/multiplexStreamBuf.cxx index e78eb1d838..daa2d78ed9 100644 --- a/panda/src/downloader/multiplexStreamBuf.cxx +++ b/panda/src/downloader/multiplexStreamBuf.cxx @@ -12,6 +12,7 @@ */ #include "multiplexStreamBuf.h" +#include "lightMutexHolder.h" #if defined(WIN32_VC) || defined(WIN64_VC) #define WINDOWS_LEAN_AND_MEAN @@ -113,10 +114,8 @@ void MultiplexStreamBuf:: add_output(MultiplexStreamBuf::BufferType buffer_type, MultiplexStreamBuf::OutputType output_type, ostream *out, FILE *fout, bool owns_obj) { -#ifdef OLD_HAVE_IPC // Ensure that we have the mutex while we fiddle with the list of outputs. - mutex_lock m(_lock); -#endif + LightMutexHolder holder(_lock); Output o; o._buffer_type = buffer_type; @@ -133,9 +132,7 @@ add_output(MultiplexStreamBuf::BufferType buffer_type, */ void MultiplexStreamBuf:: flush() { -#ifdef OLD_HAVE_IPC - mutex_lock m(_lock); -#endif + LightMutexHolder holder(_lock); write_chars("", 0, true); } @@ -146,9 +143,7 @@ flush() { */ int MultiplexStreamBuf:: overflow(int ch) { -#ifdef OLD_HAVE_IPC - mutex_lock m(_lock); -#endif + LightMutexHolder holder(_lock); streamsize n = pptr() - pbase(); @@ -172,9 +167,7 @@ overflow(int ch) { */ int MultiplexStreamBuf:: sync() { -#ifdef OLD_HAVE_IPC - mutex_lock m(_lock); -#endif + LightMutexHolder holder(_lock); streamsize n = pptr() - pbase(); @@ -242,5 +235,4 @@ write_chars(const char *start, int length, bool flush) { break; } } - } diff --git a/panda/src/downloader/multiplexStreamBuf.h b/panda/src/downloader/multiplexStreamBuf.h index e2d0f589b5..52a75c5ff9 100644 --- a/panda/src/downloader/multiplexStreamBuf.h +++ b/panda/src/downloader/multiplexStreamBuf.h @@ -17,6 +17,7 @@ #include "pandabase.h" #include "pvector.h" +#include "lightMutex.h" #include /** @@ -69,6 +70,7 @@ private: typedef pvector Outputs; Outputs _outputs; + LightMutex _lock; string _line_buffer; }; diff --git a/panda/src/downloadertools/apply_patch.cxx b/panda/src/downloadertools/apply_patch.cxx index 105064f3c9..908f3c8189 100644 --- a/panda/src/downloadertools/apply_patch.cxx +++ b/panda/src/downloadertools/apply_patch.cxx @@ -10,7 +10,6 @@ */ #include "pandabase.h" -#include "pystub.h" #include "panda_getopt.h" #include "preprocess_argv.h" #include "patchfile.h" @@ -18,9 +17,6 @@ int main(int argc, char **argv) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - preprocess_argv(argc, argv); if (argc < 3) { diff --git a/panda/src/downloadertools/build_patch.cxx b/panda/src/downloadertools/build_patch.cxx index a107c45ad6..d14e27db9f 100644 --- a/panda/src/downloadertools/build_patch.cxx +++ b/panda/src/downloadertools/build_patch.cxx @@ -10,7 +10,6 @@ */ #include "pandabase.h" -#include "pystub.h" #include "panda_getopt.h" #include "preprocess_argv.h" #include "patchfile.h" @@ -51,9 +50,6 @@ help() { int main(int argc, char **argv) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - Filename patch_file; bool complete_file = false; int footprint_length = 0; diff --git a/panda/src/downloadertools/check_adler.cxx b/panda/src/downloadertools/check_adler.cxx index 8c98b4c3d6..b53eb2839f 100644 --- a/panda/src/downloadertools/check_adler.cxx +++ b/panda/src/downloadertools/check_adler.cxx @@ -10,13 +10,9 @@ */ #include "download_utils.h" -#include "pystub.h" int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - if (argc < 2) { cerr << "Usage: check_adler " << endl; return 1; diff --git a/panda/src/downloadertools/check_crc.cxx b/panda/src/downloadertools/check_crc.cxx index 49313f818b..9afadd4fb2 100644 --- a/panda/src/downloadertools/check_crc.cxx +++ b/panda/src/downloadertools/check_crc.cxx @@ -10,13 +10,9 @@ */ #include "download_utils.h" -#include "pystub.h" int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - if (argc < 2) { cerr << "Usage: check_crc " << endl; return 1; diff --git a/panda/src/downloadertools/check_md5.cxx b/panda/src/downloadertools/check_md5.cxx index c706d4fb2a..5b386c7c1e 100644 --- a/panda/src/downloadertools/check_md5.cxx +++ b/panda/src/downloadertools/check_md5.cxx @@ -10,7 +10,6 @@ */ #include "pandabase.h" -#include "pystub.h" #include "hashVal.h" #include "filename.h" #include "panda_getopt.h" @@ -65,9 +64,6 @@ output_hash(const string &filename, const HashVal &hash) { int main(int argc, char **argv) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - extern char *optarg; extern int optind; const char *optstr = "i:db:qh"; diff --git a/panda/src/downloadertools/multify.cxx b/panda/src/downloadertools/multify.cxx index 72506f4095..8f3df9ce14 100644 --- a/panda/src/downloadertools/multify.cxx +++ b/panda/src/downloadertools/multify.cxx @@ -10,7 +10,6 @@ */ #include "pandabase.h" -#include "pystub.h" #include "panda_getopt.h" #include "preprocess_argv.h" #include "multifile.h" @@ -758,9 +757,6 @@ tokenize_extensions(const string &str, pset &extensions) { int main(int argc, char **argv) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - preprocess_argv(argc, argv); if (argc < 2) { usage(); diff --git a/panda/src/downloadertools/pdecrypt.cxx b/panda/src/downloadertools/pdecrypt.cxx index 55791f14c3..73a242fda1 100644 --- a/panda/src/downloadertools/pdecrypt.cxx +++ b/panda/src/downloadertools/pdecrypt.cxx @@ -11,7 +11,6 @@ * @date 2004-09-01 */ -#include "pystub.h" #include "filename.h" #include "encrypt_string.h" #include "pnotify.h" @@ -46,9 +45,6 @@ usage() { int main(int argc, char **argv) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - extern char *optarg; extern int optind; const char *optstr = "o:p:h"; diff --git a/panda/src/downloadertools/pencrypt.cxx b/panda/src/downloadertools/pencrypt.cxx index d37cd64a48..5f8774c4d9 100644 --- a/panda/src/downloadertools/pencrypt.cxx +++ b/panda/src/downloadertools/pencrypt.cxx @@ -11,7 +11,6 @@ * @date 2004-09-01 */ -#include "pystub.h" #include "filename.h" #include "encrypt_string.h" #include "pnotify.h" diff --git a/panda/src/downloadertools/punzip.cxx b/panda/src/downloadertools/punzip.cxx index 82d3693522..5753f7b6ec 100644 --- a/panda/src/downloadertools/punzip.cxx +++ b/panda/src/downloadertools/punzip.cxx @@ -9,7 +9,6 @@ * @file punzip.cxx */ -#include "pystub.h" #include "filename.h" #include "compress_string.h" #include "pnotify.h" @@ -31,9 +30,6 @@ usage() { int main(int argc, char **argv) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - extern char *optarg; extern int optind; const char *optstr = "o:ch"; diff --git a/panda/src/downloadertools/pzip.cxx b/panda/src/downloadertools/pzip.cxx index 25eb02ac7c..6364be0130 100644 --- a/panda/src/downloadertools/pzip.cxx +++ b/panda/src/downloadertools/pzip.cxx @@ -9,7 +9,6 @@ * @file pzip.cxx */ -#include "pystub.h" #include "filename.h" #include "compress_string.h" #include "pnotify.h" @@ -55,9 +54,6 @@ usage() { int main(int argc, char **argv) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - extern char *optarg; extern int optind; const char *optstr = "o:c123456789h"; diff --git a/panda/src/downloadertools/show_ddb.cxx b/panda/src/downloadertools/show_ddb.cxx index 6d82df7f02..d19c3be9cd 100644 --- a/panda/src/downloadertools/show_ddb.cxx +++ b/panda/src/downloadertools/show_ddb.cxx @@ -12,15 +12,11 @@ */ #include "pandabase.h" -#include "pystub.h" #include "downloadDb.h" #include "filename.h" int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - if (argc != 3) { cerr << "Usage: show_ddb server.ddb client.ddb\n"; return 1; diff --git a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx index 43bf6d3311..4b5efc2b8c 100644 --- a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx +++ b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx @@ -403,10 +403,35 @@ extract_texture_data(Texture *tex) { */ ShaderContext *DXGraphicsStateGuardian9:: prepare_shader(Shader *se) { + PStatTimer timer(_prepare_shader_pcollector); + + switch (se->get_language()) { + case Shader::SL_GLSL: + dxgsg9_cat.error() + << "Tried to load GLSL shader, but GLSL shaders not supported by Direct3D 9.\n"; + return NULL; + + case Shader::SL_Cg: #ifdef HAVE_CG - CLP(ShaderContext) *result = new CLP(ShaderContext)(se, this); - return result; + if (_supports_basic_shaders) { + return new DXShaderContext9(se, this); + } else { + dxgsg9_cat.error() + << "Tried to load Cg shader, but basic shaders not supported.\n"; + return NULL; + } +#else + dxgsg9_cat.error() + << "Tried to load Cg shader, but Cg support not compiled in.\n"; + return NULL; #endif + + default: + dxgsg9_cat.error() + << "Tried to load shader with unsupported shader language!\n"; + return NULL; + } + return NULL; } @@ -415,7 +440,7 @@ prepare_shader(Shader *se) { */ void DXGraphicsStateGuardian9:: release_shader(ShaderContext *sc) { - CLP(ShaderContext) *gsc = DCAST(CLP(ShaderContext), sc); + DXShaderContext9 *gsc = DCAST(DXShaderContext9, sc); delete gsc; } @@ -429,9 +454,9 @@ release_shader(ShaderContext *sc) { * This function should not be called directly to prepare a buffer. Instead, * call Geom::prepare(). */ -VertexBufferContext *CLP(GraphicsStateGuardian):: +VertexBufferContext *DXGraphicsStateGuardian9:: prepare_vertex_buffer(GeomVertexArrayData *data) { - CLP(VertexBufferContext) *dvbc = new CLP(VertexBufferContext)(this, _prepared_objects, data); + DXVertexBufferContext9 *dvbc = new DXVertexBufferContext9(this, _prepared_objects, data); DWORD usage; D3DPOOL pool; @@ -458,7 +483,7 @@ prepare_vertex_buffer(GeomVertexArrayData *data) { if (!FAILED(hr)) { #if 0 - if (dxgsg9_cat.is_debug() && CLP(debug_buffers)) { + if (dxgsg9_cat.is_debug() && DXdebug_buffers9) { dxgsg9_cat.debug() << "creating vertex buffer " << dvbc->_vbuffer << ": " << data->get_num_rows() << " vertices " @@ -481,16 +506,16 @@ prepare_vertex_buffer(GeomVertexArrayData *data) { * Updates the vertex buffer with the current data, and makes it the current * vertex buffer for rendering. */ -bool CLP(GraphicsStateGuardian):: +bool DXGraphicsStateGuardian9:: apply_vertex_buffer(VertexBufferContext *vbc, const GeomVertexArrayDataHandle *reader, bool force ) { - CLP(VertexBufferContext) *dvbc = DCAST(CLP(VertexBufferContext), vbc); + DXVertexBufferContext9 *dvbc = DCAST(DXVertexBufferContext9, vbc); if (dvbc->was_modified(reader)) { int num_bytes = reader->get_data_size_bytes(); #if 0 - if (dxgsg9_cat.is_debug() && CLP(debug_buffers)) { + if (dxgsg9_cat.is_debug() && DXdebug_buffers9) { dxgsg9_cat.debug() << "copying " << num_bytes << " bytes into vertex buffer " << dvbc->_vbuffer << "\n"; @@ -544,13 +569,13 @@ apply_vertex_buffer(VertexBufferContext *vbc, * should never be called directly; instead, call Data::release() (or simply * let the Data destruct). */ -void CLP(GraphicsStateGuardian):: +void DXGraphicsStateGuardian9:: release_vertex_buffer(VertexBufferContext *vbc) { - CLP(VertexBufferContext) *dvbc = DCAST(CLP(VertexBufferContext), vbc); + DXVertexBufferContext9 *dvbc = DCAST(DXVertexBufferContext9, vbc); #if 0 - if (dxgsg9_cat.is_debug() && CLP(debug_buffers)) { + if (dxgsg9_cat.is_debug() && DXdebug_buffers9) { dxgsg9_cat.debug() << "deleting vertex buffer " << dvbc->_vbuffer << "\n"; } @@ -575,8 +600,8 @@ release_vertex_buffer(VertexBufferContext *vbc) { * If force is not true, the function may return false indicating the data is * not currently available. */ -bool CLP(GraphicsStateGuardian):: -setup_array_data(CLP(VertexBufferContext)*& dvbc, +bool DXGraphicsStateGuardian9:: +setup_array_data(DXVertexBufferContext9*& dvbc, const GeomVertexArrayDataHandle* array_reader, bool force) { @@ -587,7 +612,7 @@ setup_array_data(CLP(VertexBufferContext)*& dvbc, return false; } - dvbc = (CLP(VertexBufferContext)*)vbc; + dvbc = (DXVertexBufferContext9*)vbc; return true; } @@ -1028,17 +1053,17 @@ end_scene() { if (_vertex_array_shader_context != 0) { _vertex_array_shader_context->disable_shader_vertex_arrays(this); _vertex_array_shader = (Shader *)NULL; - _vertex_array_shader_context = (CLP(ShaderContext) *)NULL; + _vertex_array_shader_context = (DXShaderContext9 *)NULL; } if (_texture_binding_shader_context != 0) { _texture_binding_shader_context->disable_shader_texture_bindings(this); _texture_binding_shader = (Shader *)NULL; - _texture_binding_shader_context = (CLP(ShaderContext) *)NULL; + _texture_binding_shader_context = (DXShaderContext9 *)NULL; } if (_current_shader_context != 0) { _current_shader_context->unbind(this); _current_shader = (Shader *)NULL; - _current_shader_context = (CLP(ShaderContext) *)NULL; + _current_shader_context = (DXShaderContext9 *)NULL; } _dlights.clear(); @@ -1242,7 +1267,7 @@ begin_draw_primitives(const GeomPipelineReader *geom_reader, * pipeline is about to be used - dxShaderContexts are responsible for setting * up their own vertex arrays. */ -bool CLP(GraphicsStateGuardian):: +bool DXGraphicsStateGuardian9:: update_standard_vertex_arrays(bool force) { int fvf = 0; @@ -1257,7 +1282,7 @@ update_standard_vertex_arrays(bool force) { } // Get the vertex buffer for this array. - CLP(VertexBufferContext)* dvbc; + DXVertexBufferContext9* dvbc; if (!setup_array_data(dvbc, array_reader, force)) { dxgsg9_cat.error() << "Unable to setup vertex buffer for array " << array_index << "\n"; return false; @@ -1290,7 +1315,7 @@ update_standard_vertex_arrays(bool force) { * so, the standard streams need to be disabled to get them "out of the way." * Called only from begin_draw_primitives. */ -void CLP(GraphicsStateGuardian):: +void DXGraphicsStateGuardian9:: disable_standard_vertex_arrays() { for ( int array_index = 0; array_index < _num_bound_streams; ++array_index ) { @@ -2184,7 +2209,8 @@ reset() { Geom::GR_point_perspective | Geom::GR_point_sprite | Geom::GR_indexed_other | Geom::GR_triangle_strip | Geom::GR_triangle_fan | - Geom::GR_flat_first_vertex; + Geom::GR_flat_first_vertex | + Geom::GR_render_mode_wireframe | Geom::GR_render_mode_point; // overwrite gsg defaults with these values @@ -2383,7 +2409,7 @@ reset() { // OVERRIDE SUPPORT SINCE IT DOES NOT WORK WELL _screen->_supports_automatic_mipmap_generation = false; - this -> reset_render_states ( ); + reset_render_states(); _max_vertices_per_array = d3d_caps.MaxVertexIndex; _max_vertices_per_primitive = d3d_caps.MaxPrimitiveCount; @@ -2646,11 +2672,11 @@ reset() { set_render_state(D3DRS_BLENDOP, D3DBLENDOP_ADD); _current_shader = (Shader *)NULL; - _current_shader_context = (CLP(ShaderContext) *)NULL; + _current_shader_context = (DXShaderContext9 *)NULL; _vertex_array_shader = (Shader *)NULL; - _vertex_array_shader_context = (CLP(ShaderContext) *)NULL; + _vertex_array_shader_context = (DXShaderContext9 *)NULL; _texture_binding_shader = (Shader *)NULL; - _texture_binding_shader_context = (CLP(ShaderContext) *)NULL; + _texture_binding_shader_context = (DXShaderContext9 *)NULL; PRINT_REFCNT(dxgsg9, _d3d_device); @@ -2775,13 +2801,13 @@ do_issue_alpha_test() { void DXGraphicsStateGuardian9:: do_issue_shader() { - CLP(ShaderContext) *context = 0; + DXShaderContext9 *context = 0; Shader *shader = 0; if (_target_shader) { shader = (Shader *)(_target_shader->get_shader()); } if (shader) { - context = (CLP(ShaderContext) *)(shader->prepare_now(get_prepared_objects(), this)); + context = (DXShaderContext9 *)(shader->prepare_now(get_prepared_objects(), this)); } if (context == 0 || (context && context -> valid (this) == false)) { @@ -2819,7 +2845,8 @@ do_issue_shader() { */ void DXGraphicsStateGuardian9:: do_issue_render_mode() { - const RenderModeAttrib *target_render_mode = DCAST(RenderModeAttrib, _target_rs->get_attrib_def(RenderModeAttrib::get_class_slot())); + const RenderModeAttrib *target_render_mode; + _target_rs->get_attrib_def(target_render_mode); RenderModeAttrib::Mode mode = target_render_mode->get_mode(); switch (mode) { @@ -3395,6 +3422,8 @@ bind_light(Spotlight *light_obj, const NodePath &light, int light_id) { D3DFORMAT DXGraphicsStateGuardian9:: get_index_type(Geom::NumericType numeric_type) { switch (numeric_type) { + // NT_uint8 is automatically promoted to uint16. + case Geom::NT_uint8: case Geom::NT_uint16: return D3DFMT_INDEX16; @@ -3798,7 +3827,14 @@ do_issue_blending() { case TransparencyAttrib::M_multisample_mask: case TransparencyAttrib::M_dual: set_render_state(D3DRS_ALPHABLENDENABLE, TRUE); - set_render_state(D3DRS_SEPARATEALPHABLENDENABLE, FALSE); + if (old_alpha_blend) { + set_render_state(D3DRS_SEPARATEALPHABLENDENABLE, FALSE); + } else { + set_render_state(D3DRS_SEPARATEALPHABLENDENABLE, TRUE); + set_render_state(D3DRS_BLENDOPALPHA, D3DBLENDOP_ADD); + set_render_state(D3DRS_SRCBLENDALPHA, D3DBLEND_ONE); + set_render_state(D3DRS_DESTBLENDALPHA, D3DBLEND_INVSRCALPHA); + } set_render_state(D3DRS_BLENDOP, D3DBLENDOP_ADD); set_render_state(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); set_render_state(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); @@ -4532,7 +4568,7 @@ reset_d3d_device(D3DPRESENT_PARAMETERS *presentation_params, } } - this -> mark_new(); + mark_new(); hr = _d3d_device->Reset(&_presentation_reset); if (FAILED(hr) && hr != D3DERR_DEVICELOST) { return hr; diff --git a/panda/src/dxgsg9/dxGraphicsStateGuardian9.h b/panda/src/dxgsg9/dxGraphicsStateGuardian9.h index 512cedbda2..21bb0d7265 100644 --- a/panda/src/dxgsg9/dxGraphicsStateGuardian9.h +++ b/panda/src/dxgsg9/dxGraphicsStateGuardian9.h @@ -79,7 +79,7 @@ public: bool force); virtual void release_vertex_buffer(VertexBufferContext *vbc); - bool setup_array_data(CLP(VertexBufferContext)*& vbc, + bool setup_array_data(DXVertexBufferContext9 *&vbc, const GeomVertexArrayDataHandle* data, bool force); @@ -295,12 +295,12 @@ protected: CullFaceAttrib::Mode _cull_face_mode; RenderModeAttrib::Mode _current_fill_mode; //point/wireframe/solid - PT(Shader) _current_shader; - CLP(ShaderContext) *_current_shader_context; - PT(Shader) _vertex_array_shader; - CLP(ShaderContext) *_vertex_array_shader_context; - PT(Shader) _texture_binding_shader; - CLP(ShaderContext) *_texture_binding_shader_context; + PT(Shader) _current_shader; + DXShaderContext9 *_current_shader_context; + PT(Shader) _vertex_array_shader; + DXShaderContext9 *_vertex_array_shader_context; + PT(Shader) _texture_binding_shader; + DXShaderContext9 *_texture_binding_shader_context; const DXIndexBufferContext9 *_active_ibuffer; diff --git a/panda/src/dxgsg9/dxIndexBufferContext9.cxx b/panda/src/dxgsg9/dxIndexBufferContext9.cxx index 51429d67c8..6cf6a78c84 100644 --- a/panda/src/dxgsg9/dxIndexBufferContext9.cxx +++ b/panda/src/dxgsg9/dxIndexBufferContext9.cxx @@ -27,9 +27,8 @@ TypeHandle DXIndexBufferContext9::_type_handle; DXIndexBufferContext9:: DXIndexBufferContext9(PreparedGraphicsObjects *pgo, GeomPrimitive *data) : IndexBufferContext(pgo, data), - _ibuffer(NULL) -{ - _managed = -1; + _ibuffer(NULL), + _managed(-1) { } /** @@ -37,8 +36,7 @@ DXIndexBufferContext9(PreparedGraphicsObjects *pgo, GeomPrimitive *data) : */ DXIndexBufferContext9:: ~DXIndexBufferContext9() { - - this -> free_ibuffer ( ); + free_ibuffer(); } /** @@ -70,13 +68,10 @@ free_ibuffer(void) { << "deleting index buffer " << _ibuffer << "\n"; } - if (DEBUG_INDEX_BUFFER) - { + if (DEBUG_INDEX_BUFFER) { RELEASE(_ibuffer, dxgsg9, "index buffer", RELEASE_ONCE); - } - else - { - _ibuffer -> Release ( ); + } else { + _ibuffer->Release(); } _ibuffer = NULL; @@ -99,6 +94,11 @@ allocate_ibuffer(DXScreenData &scrn, data_size = reader->get_data_size_bytes(); + if (reader->get_index_type() == GeomEnums::NT_uint8) { + // We widen 8-bits indices to 16-bits. + data_size *= 2; + } + _managed = scrn._managed_index_buffers; if (_managed) { @@ -147,16 +147,12 @@ create_ibuffer(DXScreenData &scrn, nassertv(reader->get_object() == get_data()); Thread *current_thread = reader->get_current_thread(); - this -> free_ibuffer ( ); + free_ibuffer(); PStatTimer timer(GraphicsStateGuardian::_create_index_buffer_pcollector, current_thread); - int data_size; - - data_size = reader->get_data_size_bytes(); - - this -> allocate_ibuffer(scrn, reader); + allocate_ibuffer(scrn, reader); } /** @@ -175,6 +171,11 @@ upload_data(const GeomPrimitivePipelineReader *reader, bool force) { } int data_size = reader->get_data_size_bytes(); + if (reader->get_index_type() == GeomEnums::NT_uint8) { + // We widen 8-bits indices to 16-bits. + data_size *= 2; + } + if (dxgsg9_cat.is_spam()) { dxgsg9_cat.spam() << "copying " << data_size @@ -186,12 +187,9 @@ upload_data(const GeomPrimitivePipelineReader *reader, bool force) { HRESULT hr; BYTE *local_pointer; - if (_managed) - { + if (_managed) { hr = _ibuffer->Lock(0, data_size, (void **) &local_pointer, 0); - } - else - { + } else { hr = _ibuffer->Lock(0, data_size, (void **) &local_pointer, D3DLOCK_DISCARD); } if (FAILED(hr)) { @@ -201,7 +199,16 @@ upload_data(const GeomPrimitivePipelineReader *reader, bool force) { } GraphicsStateGuardian::_data_transferred_pcollector.add_level(data_size); - memcpy(local_pointer, data_pointer, data_size); + + if (reader->get_index_type() == GeomEnums::NT_uint8) { + // Widen to 16-bits, as DirectX doesn't support 8-bits indices. + uint16_t *ptr = (uint16_t *)local_pointer; + for (size_t i = 0; i < data_size; i += 2) { + *ptr++ = (uint16_t)*data_pointer++; + } + } else { + memcpy(local_pointer, data_pointer, data_size); + } _ibuffer->Unlock(); return true; diff --git a/panda/src/dxgsg9/dxOcclusionQueryContext9.h b/panda/src/dxgsg9/dxOcclusionQueryContext9.h index f930bc71e0..c2e54dedc2 100644 --- a/panda/src/dxgsg9/dxOcclusionQueryContext9.h +++ b/panda/src/dxgsg9/dxOcclusionQueryContext9.h @@ -41,7 +41,7 @@ public: } static void init_type() { OcclusionQueryContext::init_type(); - register_type(_type_handle, CLASSPREFIX_QUOTED "OcclusionQueryContext", + register_type(_type_handle, "DXOcclusionQueryContext9", OcclusionQueryContext::get_class_type()); } virtual TypeHandle get_type() const { diff --git a/panda/src/dxgsg9/dxShaderContext9.I b/panda/src/dxgsg9/dxShaderContext9.I index ba79e89d74..74590ff2c0 100644 --- a/panda/src/dxgsg9/dxShaderContext9.I +++ b/panda/src/dxgsg9/dxShaderContext9.I @@ -17,7 +17,7 @@ * shader, or if the current video card isn't shader-capable, or if no shader * languages are compiled into panda. */ -INLINE bool CLP(ShaderContext):: +INLINE bool DXShaderContext9:: valid(GSG *gsg) { #ifdef HAVE_CG return (_cg_program != 0); diff --git a/panda/src/dxgsg9/dxShaderContext9.cxx b/panda/src/dxgsg9/dxShaderContext9.cxx index 2dbfd6da9c..9d151ac44a 100644 --- a/panda/src/dxgsg9/dxShaderContext9.cxx +++ b/panda/src/dxgsg9/dxShaderContext9.cxx @@ -28,13 +28,13 @@ #define DEBUG_SHADER 0 -TypeHandle CLP(ShaderContext)::_type_handle; +TypeHandle DXShaderContext9::_type_handle; /** * xyz */ -CLP(ShaderContext):: -CLP(ShaderContext)(Shader *s, GSG *gsg) : ShaderContext(s) { +DXShaderContext9:: +DXShaderContext9(Shader *s, GSG *gsg) : ShaderContext(s) { _vertex_element_array = NULL; _vertex_declaration = NULL; @@ -46,7 +46,6 @@ CLP(ShaderContext)(Shader *s, GSG *gsg) : ShaderContext(s) { CGcontext context = DCAST(DXGraphicsStateGuardian9, gsg)->_cg_context; if (s->get_language() == Shader::SL_Cg) { - // Ask the shader to compile itself for us and to give us the resulting Cg // program objects. if (!s->cg_compile_for(gsg->_shader_caps, context, @@ -63,7 +62,7 @@ CLP(ShaderContext)(Shader *s, GSG *gsg) : ShaderContext(s) { HRESULT hr; bool success = true; hr = cgD3D9LoadProgram(_cg_program, FALSE, assembly_flags); - if (FAILED (hr)) { + if (FAILED(hr)) { dxgsg9_cat.error() << "cgD3D9LoadProgram failed " << D3DERRORSTRING(hr); @@ -80,46 +79,26 @@ CLP(ShaderContext)(Shader *s, GSG *gsg) : ShaderContext(s) { /** * xyz */ -CLP(ShaderContext):: -~CLP(ShaderContext)() { +DXShaderContext9:: +~DXShaderContext9() { release_resources(); - if ( _vertex_declaration != NULL ) { + if (_vertex_declaration != NULL) { _vertex_declaration->Release(); _vertex_declaration = NULL; } - if ( _vertex_element_array != NULL ) { + if (_vertex_element_array != NULL) { delete _vertex_element_array; _vertex_element_array = NULL; } } -/* - * int save_file (int size, void *data, char *file_path) { int state; int - * file_handle; state = false; file_handle = _open (file_path, _O_CREAT | - * _O_RDWR | _O_TRUNC, _S_IREAD | _S_IWRITE); if (file_handle != -1) { if - * (_write (file_handle, data, size) == size) { state = true; } _close - * (file_handle); } return state; } if (dxgsg9_cat.is_debug()) { DEBUG: output - * the generated program const char *vertex_program; const char - * *pixel_program; vertex_program = cgGetProgramString (_cg_program[0], - * CG_COMPILED_PROGRAM); pixel_program = cgGetProgramString (_cg_program[1], - * CG_COMPILED_PROGRAM); dxgsg9_cat.debug() << vertex_program << "\n"; - * dxgsg9_cat.debug() << pixel_program << "\n"; save the generated program to - * a file int size; char file_path [512]; char drive[_MAX_DRIVE]; char - * dir[_MAX_DIR]; char fname[_MAX_FNAME]; char ext[_MAX_EXT]; _splitpath - * (_name.c_str ( ), drive, dir, fname, ext); size = strlen (vertex_program); - * sprintf (file_path, "%s.vasm", fname); save_file (size, (void *) - * vertex_program, file_path); size = strlen (pixel_program); sprintf - * (file_path, "%s.pasm", fname); save_file (size, (void *) pixel_program, - * file_path); } - */ - /** * Should deallocate all system resources (such as vertex program handles or * Cg contexts). */ -void CLP(ShaderContext):: +void DXShaderContext9:: release_resources() { #ifdef HAVE_CG if (_cg_program) { @@ -139,9 +118,8 @@ release_resources() { * This function is to be called to enable a new shader. It also initializes * all of the shader's input parameters. */ -bool CLP(ShaderContext):: +bool DXShaderContext9:: bind(GSG *gsg) { - bool bind_state = false; #ifdef HAVE_CG @@ -149,7 +127,7 @@ bind(GSG *gsg) { // clear the last cached FVF to make sure the next SetFVF call goes // through - gsg -> _last_fvf = 0; + gsg->_last_fvf = 0; // Pass in k-parameters and transform-parameters issue_parameters(gsg, Shader::SSD_general); @@ -159,7 +137,7 @@ bind(GSG *gsg) { // Bind the shaders. bind_state = true; hr = cgD3D9BindProgram(_cg_program); - if (FAILED (hr)) { + if (FAILED(hr)) { dxgsg9_cat.error() << "cgD3D9BindProgram failed " << D3DERRORSTRING(hr); CGerror error = cgGetError(); @@ -178,9 +156,8 @@ bind(GSG *gsg) { /** * This function disables a currently-bound shader. */ -void CLP(ShaderContext):: +void DXShaderContext9:: unbind(GSG *gsg) { - #ifdef HAVE_CG if (_cg_program) { HRESULT hr; @@ -211,48 +188,59 @@ InternalName *global_internal_name_0 = 0; InternalName *global_internal_name_1 = 0; #endif -void CLP(ShaderContext):: +void DXShaderContext9:: issue_parameters(GSG *gsg, int altered) { #ifdef HAVE_CG if (_cg_program) { - // Iterate through _ptr parameters - for (int i=0; i<(int)_shader->_ptr_spec.size(); i++) { - if(altered & (_shader->_ptr_spec[i]._dep[0] | _shader->_ptr_spec[i]._dep[1])){ -#ifdef HAVE_CG - const Shader::ShaderPtrSpec& _ptr = _shader->_ptr_spec[i]; - Shader::ShaderPtrData* _ptr_data = - const_cast< Shader::ShaderPtrData*>(gsg->fetch_ptr_parameter(_ptr)); + // Iterate through _ptr parameters + for (size_t i = 0; i < _shader->_ptr_spec.size(); ++i) { + const Shader::ShaderPtrSpec &spec = _shader->_ptr_spec[i]; - if (_ptr_data == NULL){ //the input is not contained in ShaderPtrData + if (altered & (spec._dep[0] | spec._dep[1])) { + const Shader::ShaderPtrData *ptr_data = gsg->fetch_ptr_parameter(spec); + + if (ptr_data == NULL) { //the input is not contained in ShaderPtrData release_resources(); return; } - CGparameter p = _cg_parameter_map[_ptr._id._seqno]; + // Calculate how many elements to transfer; no more than it expects, + // but certainly no more than we have. + int input_size = min(abs(spec._dim[0] * spec._dim[1] * spec._dim[2]), ptr_data->_size); + + CGparameter p = _cg_parameter_map[spec._id._seqno]; + switch (ptr_data->_type) { + case Shader::SPT_int: + cgSetParameterValueic(p, input_size, (int *)ptr_data->_ptr); + break; + + case Shader::SPT_double: + cgSetParameterValuedc(p, input_size, (double *)ptr_data->_ptr); + break; - switch(_ptr_data->_type) { case Shader::SPT_float: - cgD3D9SetUniform(p, (PN_stdfloat*)_ptr_data->_ptr); + cgSetParameterValuefc(p, input_size, (float *)ptr_data->_ptr); break; default: dxgsg9_cat.error() - << _ptr._id._name << ":" << "unrecognized parameter type\n"; + << spec._id._name << ": unrecognized parameter type\n"; release_resources(); return; } } -#endif } - for (int i=0; i<(int)_shader->_mat_spec.size(); i++) { - if (altered & (_shader->_mat_spec[i]._dep[0] | _shader->_mat_spec[i]._dep[1])) { - CGparameter p = _cg_parameter_map[_shader->_mat_spec[i]._id._seqno]; + for (size_t i = 0; i < _shader->_mat_spec.size(); ++i) { + Shader::ShaderMatSpec &spec = _shader->_mat_spec[i]; + + if (altered & (spec._dep[0] | spec._dep[1])) { + CGparameter p = _cg_parameter_map[spec._id._seqno]; if (p == NULL) { continue; } - const LMatrix4 *val = gsg->fetch_specified_value(_shader->_mat_spec[i], altered); + const LMatrix4 *val = gsg->fetch_specified_value(spec, altered); if (val) { HRESULT hr; PN_stdfloat v [4]; @@ -263,83 +251,79 @@ issue_parameters(GSG *gsg, int altered) { const float *data; data = temp_matrix.get_data(); - #if DEBUG_SHADER +#if DEBUG_SHADER // DEBUG - global_data = (PN_stdfloat *) data; - global_shader_mat_spec = &_shader->_mat_spec[i]; - global_internal_name_0 = global_shader_mat_spec -> _arg [0]; - global_internal_name_1 = global_shader_mat_spec -> _arg [1]; - #endif + global_data = (PN_stdfloat *)data; + global_shader_mat_spec = &spec; + global_internal_name_0 = global_shader_mat_spec->_arg[0]; + global_internal_name_1 = global_shader_mat_spec->_arg[1]; +#endif - switch (_shader->_mat_spec[i]._piece) { + switch (spec._piece) { case Shader::SMP_whole: // TRANSPOSE REQUIRED temp_matrix.transpose_in_place(); data = temp_matrix.get_data(); - hr = cgD3D9SetUniform (p, data); + hr = cgD3D9SetUniform(p, data); break; case Shader::SMP_transpose: // NO TRANSPOSE REQUIRED - hr = cgD3D9SetUniform (p, data); + hr = cgD3D9SetUniform(p, data); break; case Shader::SMP_row0: - hr = cgD3D9SetUniform (p, data + 0); + hr = cgD3D9SetUniform(p, data + 0); break; case Shader::SMP_row1: - hr = cgD3D9SetUniform (p, data + 4); + hr = cgD3D9SetUniform(p, data + 4); break; case Shader::SMP_row2: - hr = cgD3D9SetUniform (p, data + 8); + hr = cgD3D9SetUniform(p, data + 8); break; case Shader::SMP_row3x1: case Shader::SMP_row3x2: case Shader::SMP_row3x3: case Shader::SMP_row3: - hr = cgD3D9SetUniform (p, data + 12); + hr = cgD3D9SetUniform(p, data + 12); break; case Shader::SMP_col0: v[0] = data[0]; v[1] = data[4]; v[2] = data[8]; v[3] = data[12]; - hr = cgD3D9SetUniform (p, v); + hr = cgD3D9SetUniform(p, v); break; case Shader::SMP_col1: v[0] = data[1]; v[1] = data[5]; v[2] = data[9]; v[3] = data[13]; - hr = cgD3D9SetUniform (p, v); + hr = cgD3D9SetUniform(p, v); break; case Shader::SMP_col2: v[0] = data[2]; v[1] = data[6]; v[2] = data[10]; v[3] = data[14]; - hr = cgD3D9SetUniform (p, v); + hr = cgD3D9SetUniform(p, v); break; case Shader::SMP_col3: v[0] = data[3]; v[1] = data[7]; v[2] = data[11]; v[3] = data[15]; - hr = cgD3D9SetUniform (p, v); + hr = cgD3D9SetUniform(p, v); break; default: dxgsg9_cat.error() - << "issue_parameters ( ) SMP parameter type not implemented " << _shader->_mat_spec[i]._piece << "\n"; + << "issue_parameters () SMP parameter type not implemented " << spec._piece << "\n"; break; } - if (FAILED (hr)) { - + if (FAILED(hr)) { string name = "unnamed"; - if (_shader->_mat_spec[i]._arg [0]) { - name = _shader->_mat_spec[i]._arg [0] -> get_basename ( ); + if (spec._arg[0]) { + name = spec._arg[0]->get_basename(); } dxgsg9_cat.error() - << "NAME " << name << "\n" - << "MAT TYPE " - << _shader->_mat_spec[i]._piece - << " cgD3D9SetUniform failed " - << D3DERRORSTRING(hr); + << "NAME " << name << "\n" << "MAT TYPE " << spec._piece + << " cgD3D9SetUniform failed " << D3DERRORSTRING(hr); - CGerror error = cgGetError (); + CGerror error = cgGetError(); if (error != CG_NO_ERROR) { dxgsg9_cat.error() << " CG ERROR: " << cgGetErrorString(error) << "\n"; } @@ -354,13 +338,12 @@ issue_parameters(GSG *gsg, int altered) { /** * Disable all the vertex arrays used by this shader. */ -void CLP(ShaderContext):: +void DXShaderContext9:: disable_shader_vertex_arrays(GSG *gsg) { LPDIRECT3DDEVICE9 device = gsg->_screen->_d3d_device; - for ( int array_index = 0; array_index < _num_bound_streams; ++array_index ) - { - device->SetStreamSource( array_index, NULL, 0, 0 ); + for (int array_index = 0; array_index < _num_bound_streams; ++array_index) { + device->SetStreamSource(array_index, NULL, 0, 0); } _num_bound_streams = 0; } @@ -372,8 +355,8 @@ disable_shader_vertex_arrays(GSG *gsg) { * because it may unnecessarily disable arrays then immediately reenable them. * We may optimize this someday. */ -bool CLP(ShaderContext):: -update_shader_vertex_arrays(CLP(ShaderContext) *prev, GSG *gsg, bool force) { +bool DXShaderContext9:: +update_shader_vertex_arrays(DXShaderContext9 *prev, GSG *gsg, bool force) { if (prev) prev->disable_shader_vertex_arrays(gsg); #ifdef HAVE_CG if (!_cg_program) { @@ -394,7 +377,7 @@ update_shader_vertex_arrays(CLP(ShaderContext) *prev, GSG *gsg, bool force) { // Discard and recreate the VertexElementArray. This thrashes pretty // bad.... - if ( _vertex_element_array != NULL ) { + if (_vertex_element_array != NULL) { delete _vertex_element_array; } _vertex_element_array = new VertexElementArray(nvarying + 2); @@ -408,17 +391,17 @@ update_shader_vertex_arrays(CLP(ShaderContext) *prev, GSG *gsg, bool force) { // out only those for a single stream. int number_of_arrays = gsg->_data_reader->get_num_arrays(); - for ( int array_index = 0; array_index < number_of_arrays; ++array_index ) { + for (int array_index = 0; array_index < number_of_arrays; ++array_index) { const GeomVertexArrayDataHandle* array_reader = - gsg->_data_reader->get_array_reader( array_index ); - if ( array_reader == NULL ) { + gsg->_data_reader->get_array_reader(array_index); + if (array_reader == NULL) { dxgsg9_cat.error() << "Unable to get reader for array " << array_index << "\n"; continue; } - for ( int var_index = 0; var_index < nvarying; ++var_index ) { + for (int var_index = 0; var_index < nvarying; ++var_index) { CGparameter p = _cg_parameter_map[_shader->_var_spec[var_index]._id._seqno]; - if ( p == NULL ) { + if (p == NULL) { dxgsg9_cat.info() << "No parameter in map for parameter " << var_index << " (probably optimized away)\n"; @@ -440,14 +423,12 @@ update_shader_vertex_arrays(CLP(ShaderContext) *prev, GSG *gsg, bool force) { } } - const GeomVertexArrayDataHandle* param_array_reader; + const GeomVertexArrayDataHandle *param_array_reader; Geom::NumericType numeric_type; - int num_values; - int start; - int stride; - if ( gsg->_data_reader->get_array_info( name, - param_array_reader, num_values, numeric_type, - start, stride ) == false ) { + int num_values, start, stride; + if (!gsg->_data_reader->get_array_info(name, param_array_reader, + num_values, numeric_type, + start, stride)) { // This is apparently not an error (actually I think it is, just not // a fatal one). The GL implementation fails silently in this case, // but the net result is that we end up not supplying input for a @@ -458,105 +439,105 @@ update_shader_vertex_arrays(CLP(ShaderContext) *prev, GSG *gsg, bool force) { } // If not associated with the array we're working on, move on. - if ( param_array_reader != array_reader ) { + if (param_array_reader != array_reader) { continue; } - const char* semantic = cgGetParameterSemantic( p ); - if ( semantic == NULL ) { + const char *semantic = cgGetParameterSemantic(p); + if (semantic == NULL) { dxgsg9_cat.error() << "Unable to retrieve semantic for parameter " << var_index << "\n"; continue; } - if ( strncmp( semantic, "POSITION", strlen( "POSITION" ) ) == 0 ) { + if (strncmp(semantic, "POSITION", strlen("POSITION")) == 0) { if (numeric_type == Geom::NT_float32) { switch (num_values) { - case 3: - vertex_element_array->add_position_xyz_vertex_element(array_index, start); - break; - case 4: - vertex_element_array->add_position_xyzw_vertex_element(array_index, start); - break; - default: - dxgsg9_cat.error() << "VE ERROR: invalid number of vertex coordinate elements " << num_values << "\n"; - break; + case 3: + vertex_element_array->add_position_xyz_vertex_element(array_index, start); + break; + case 4: + vertex_element_array->add_position_xyzw_vertex_element(array_index, start); + break; + default: + dxgsg9_cat.error() << "VE ERROR: invalid number of vertex coordinate elements " << num_values << "\n"; + break; } } else { dxgsg9_cat.error() << "VE ERROR: invalid vertex type " << numeric_type << "\n"; } - } else if ( strncmp( semantic, "TEXCOORD", strlen( "TEXCOORD" ) ) == 0 ) { - int slot = atoi( semantic + strlen( "TEXCOORD" ) ); + } else if (strncmp(semantic, "TEXCOORD", strlen("TEXCOORD")) == 0) { + int slot = atoi(semantic + strlen("TEXCOORD")); if (numeric_type == Geom::NT_float32) { switch (num_values) { - case 1: - vertex_element_array->add_u_vertex_element(array_index, start, slot); - break; - case 2: - vertex_element_array->add_uv_vertex_element(array_index, start, slot); - break; - case 3: - vertex_element_array->add_uvw_vertex_element(array_index, start, slot); - break; - case 4: - vertex_element_array->add_xyzw_vertex_element(array_index, start, slot); - break; - default: - dxgsg9_cat.error() << "VE ERROR: invalid number of vertex texture coordinate elements " << num_values << "\n"; - break; + case 1: + vertex_element_array->add_u_vertex_element(array_index, start, slot); + break; + case 2: + vertex_element_array->add_uv_vertex_element(array_index, start, slot); + break; + case 3: + vertex_element_array->add_uvw_vertex_element(array_index, start, slot); + break; + case 4: + vertex_element_array->add_xyzw_vertex_element(array_index, start, slot); + break; + default: + dxgsg9_cat.error() << "VE ERROR: invalid number of vertex texture coordinate elements " << num_values << "\n"; + break; } } else { dxgsg9_cat.error() << "VE ERROR: invalid texture coordinate type " << numeric_type << "\n"; } - } else if ( strncmp( semantic, "COLOR", strlen( "COLOR" ) ) == 0 ) { + } else if (strncmp(semantic, "COLOR", strlen("COLOR")) == 0) { if (numeric_type == Geom::NT_packed_dcba || numeric_type == Geom::NT_packed_dabc || numeric_type == Geom::NT_uint8) { switch (num_values) { - case 4: - vertex_element_array->add_diffuse_color_vertex_element(array_index, start); - break; - default: - dxgsg9_cat.error() << "VE ERROR: invalid color coordinates " << num_values << "\n"; - break; + case 4: + vertex_element_array->add_diffuse_color_vertex_element(array_index, start); + break; + default: + dxgsg9_cat.error() << "VE ERROR: invalid color coordinates " << num_values << "\n"; + break; } } else { dxgsg9_cat.error() << "VE ERROR: invalid color type " << numeric_type << "\n"; } - } else if ( strncmp( semantic, "NORMAL", strlen( "NORMAL" ) ) == 0 ) { + } else if (strncmp(semantic, "NORMAL", strlen("NORMAL")) == 0) { if (numeric_type == Geom::NT_float32) { switch (num_values) { - case 3: - vertex_element_array->add_normal_vertex_element(array_index, start); - break; - default: - dxgsg9_cat.error() << "VE ERROR: invalid number of normal coordinate elements " << num_values << "\n"; - break; + case 3: + vertex_element_array->add_normal_vertex_element(array_index, start); + break; + default: + dxgsg9_cat.error() << "VE ERROR: invalid number of normal coordinate elements " << num_values << "\n"; + break; } } else { dxgsg9_cat.error() << "VE ERROR: invalid normal type " << numeric_type << "\n"; } - } else if ( strncmp( semantic, "BINORMAL", strlen( "BINORMAL" ) ) == 0 ) { + } else if (strncmp(semantic, "BINORMAL", strlen("BINORMAL")) == 0) { if (numeric_type == Geom::NT_float32) { switch (num_values) { - case 3: - vertex_element_array->add_binormal_vertex_element(array_index, start); - break; - default: - dxgsg9_cat.error() << "VE ERROR: invalid number of binormal coordinate elements " << num_values << "\n"; - break; + case 3: + vertex_element_array->add_binormal_vertex_element(array_index, start); + break; + default: + dxgsg9_cat.error() << "VE ERROR: invalid number of binormal coordinate elements " << num_values << "\n"; + break; } } else { dxgsg9_cat.error() << "VE ERROR: invalid binormal type " << numeric_type << "\n"; } - } else if ( strncmp( semantic, "TANGENT", strlen( "TANGENT" ) ) == 0 ) { + } else if (strncmp(semantic, "TANGENT", strlen("TANGENT")) == 0) { if (numeric_type == Geom::NT_float32) { switch (num_values) { - case 3: - vertex_element_array->add_tangent_vertex_element(array_index, start); - break; - default: - dxgsg9_cat.error() << "VE ERROR: invalid number of tangent coordinate elements " << num_values << "\n"; - break; + case 3: + vertex_element_array->add_tangent_vertex_element(array_index, start); + break; + default: + dxgsg9_cat.error() << "VE ERROR: invalid number of tangent coordinate elements " << num_values << "\n"; + break; } } else { dxgsg9_cat.error() << "VE ERROR: invalid tangent type " << numeric_type << "\n"; @@ -567,15 +548,15 @@ update_shader_vertex_arrays(CLP(ShaderContext) *prev, GSG *gsg, bool force) { } // Get the vertex buffer for this array. - CLP(VertexBufferContext)* dvbc; + DXVertexBufferContext9 *dvbc; if (!gsg->setup_array_data(dvbc, array_reader, force)) { dxgsg9_cat.error() << "Unable to setup vertex buffer for array " << array_index << "\n"; continue; } // Bind this array as the data source for the corresponding stream. - const GeomVertexArrayFormat* array_format = array_reader->get_array_format(); - hr = device->SetStreamSource( array_index, dvbc->_vbuffer, 0, array_format->get_stride() ); + const GeomVertexArrayFormat *array_format = array_reader->get_array_format(); + hr = device->SetStreamSource(array_index, dvbc->_vbuffer, 0, array_format->get_stride()); if (FAILED(hr)) { dxgsg9_cat.error() << "SetStreamSource failed" << D3DERRORSTRING(hr); } @@ -583,8 +564,8 @@ update_shader_vertex_arrays(CLP(ShaderContext) *prev, GSG *gsg, bool force) { _num_bound_streams = number_of_arrays; - if (( _vertex_element_array != NULL ) && - ( _vertex_element_array->add_end_vertex_element() != false )) { + if (_vertex_element_array != NULL && + _vertex_element_array->add_end_vertex_element()) { if (dxgsg9_cat.is_debug()) { // Note that the currently generated vertex declaration works but // never validates. My theory is that this is due to the shader @@ -599,17 +580,17 @@ update_shader_vertex_arrays(CLP(ShaderContext) *prev, GSG *gsg, bool force) { } // Discard the old VertexDeclaration. This thrashes pretty bad.... - if ( _vertex_declaration != NULL ) { + if (_vertex_declaration != NULL) { _vertex_declaration->Release(); _vertex_declaration = NULL; } - hr = device->CreateVertexDeclaration( _vertex_element_array->_vertex_element_array, - &_vertex_declaration ); - if (FAILED (hr)) { + hr = device->CreateVertexDeclaration(_vertex_element_array->_vertex_element_array, + &_vertex_declaration); + if (FAILED(hr)) { dxgsg9_cat.error() << "CreateVertexDeclaration failed" << D3DERRORSTRING(hr); } else { - hr = device->SetVertexDeclaration( _vertex_declaration ); + hr = device->SetVertexDeclaration(_vertex_declaration); if (FAILED(hr)) { dxgsg9_cat.error() << "SetVertexDeclaration failed" << D3DERRORSTRING(hr); } @@ -626,12 +607,11 @@ update_shader_vertex_arrays(CLP(ShaderContext) *prev, GSG *gsg, bool force) { /** * Disable all the texture bindings used by this shader. */ -void CLP(ShaderContext):: -disable_shader_texture_bindings(GSG *gsg) -{ +void DXShaderContext9:: +disable_shader_texture_bindings(GSG *gsg) { #ifdef HAVE_CG if (_cg_program) { - for (int i=0; i<(int)_shader->_tex_spec.size(); i++) { + for (size_t i = 0; i < _shader->_tex_spec.size(); ++i) { CGparameter p = _cg_parameter_map[_shader->_tex_spec[i]._id._seqno]; if (p == NULL) { continue; @@ -640,12 +620,10 @@ disable_shader_texture_bindings(GSG *gsg) HRESULT hr; - hr = gsg -> _d3d_device -> SetTexture (texunit, NULL); - if (FAILED (hr)) { + hr = gsg->_d3d_device->SetTexture(texunit, NULL); + if (FAILED(hr)) { dxgsg9_cat.error() - << "SetTexture (" - << texunit - << ", NULL) failed " + << "SetTexture(" << texunit << ", NULL) failed " << D3DERRORSTRING(hr); } } @@ -660,60 +638,44 @@ disable_shader_texture_bindings(GSG *gsg) * because it may unnecessarily disable textures then immediately reenable * them. We may optimize this someday. */ -void CLP(ShaderContext):: -update_shader_texture_bindings(CLP(ShaderContext) *prev, GSG *gsg) -{ - if (prev) prev->disable_shader_texture_bindings(gsg); +void DXShaderContext9:: +update_shader_texture_bindings(DXShaderContext9 *prev, GSG *gsg) { + if (prev) { + prev->disable_shader_texture_bindings(gsg); + } #ifdef HAVE_CG if (_cg_program) { - - for (int i=0; i<(int)_shader->_tex_spec.size(); i++) { - CGparameter p = _cg_parameter_map[_shader->_tex_spec[i]._id._seqno]; + for (size_t i = 0; i < _shader->_tex_spec.size(); ++i) { + Shader::ShaderTexSpec &spec = _shader->_tex_spec[i]; + CGparameter p = _cg_parameter_map[spec._id._seqno]; if (p == NULL) { continue; } - Texture *tex = NULL; + int view = gsg->get_current_tex_view_offset(); - InternalName *id = _shader->_tex_spec[i]._name; SamplerState sampler; - if (id != NULL) { - const ShaderInput *input = gsg->_target_shader->get_shader_input(id); - tex = input->get_texture(); - sampler = input->get_sampler(); - - } else { - // We get the TextureAttrib directly from the _target_rs, not the - // filtered TextureAttrib in _target_texture. - const TextureAttrib *texattrib = DCAST(TextureAttrib, gsg->_target_rs->get_attrib_def(TextureAttrib::get_class_slot())); - nassertv(texattrib != (TextureAttrib *)NULL); - - if (_shader->_tex_spec[i]._stage >= texattrib->get_num_on_stages()) { - continue; - } - TextureStage *stage = texattrib->get_on_stage(_shader->_tex_spec[i]._stage); - tex = texattrib->get_on_texture(stage); - sampler = texattrib->get_on_sampler(stage); - view += stage->get_tex_view_offset(); - } - if (_shader->_tex_spec[i]._suffix != 0) { - // The suffix feature is inefficient. It is a temporary hack. - if (tex == 0) { - continue; - } - tex = tex->load_related(_shader->_tex_spec[i]._suffix); - } - if ((tex == 0) || (tex->get_texture_type() != _shader->_tex_spec[i]._desired_type)) { + PT(Texture) tex = gsg->fetch_specified_texture(spec, sampler, view); + if (tex.is_null()) { continue; } + + if (spec._suffix != 0) { + // The suffix feature is inefficient. It is a temporary hack. + tex = tex->load_related(spec._suffix); + } + + if (tex->get_texture_type() != spec._desired_type) { + continue; + } + TextureContext *tc = tex->prepare_now(view, gsg->_prepared_objects, gsg); if (tc == (TextureContext*)NULL) { continue; } int texunit = cgGetParameterResourceIndex(p); - gsg->apply_texture(texunit, tc, sampler); } } @@ -721,8 +683,7 @@ update_shader_texture_bindings(CLP(ShaderContext) *prev, GSG *gsg) } // DEBUG CODE TO TEST ASM CODE GENERATED BY Cg -void assemble_shader_test(char *file_path) -{ +void assemble_shader_test(char *file_path) { int flags; D3DXMACRO *defines; LPD3DXINCLUDE include; @@ -735,17 +696,15 @@ void assemble_shader_test(char *file_path) shader = 0; error_messages = 0; - D3DXAssembleShaderFromFile (file_path, defines, include, flags, &shader, &error_messages); - if (error_messages) - { + D3DXAssembleShaderFromFile(file_path, defines, include, flags, &shader, &error_messages); + if (error_messages) { char *error_message; - error_message = (char *) (error_messages -> GetBufferPointer ( )); - if (error_message) - { + error_message = (char *)error_messages->GetBufferPointer(); + if (error_message) { dxgsg9_cat.error() << error_message; } - error_messages -> Release ( ); + error_messages->Release(); } } diff --git a/panda/src/dxgsg9/dxShaderContext9.h b/panda/src/dxgsg9/dxShaderContext9.h index df873e3c1b..8f0a543e50 100644 --- a/panda/src/dxgsg9/dxShaderContext9.h +++ b/panda/src/dxgsg9/dxShaderContext9.h @@ -21,33 +21,46 @@ #include "shader.h" #include "shaderContext.h" -#define CLP(name) DX##name##9 -#define CLASSPREFIX_QUOTED "DX" - class VertexElementArray; -class CLP(GraphicsStateGuardian); +class DXGraphicsStateGuardian9; -/* - * Caution: adding HLSL support is going to be tricky, as the parsing needs to - * be done in the cull thread, which cannot use the DX API. - Josh typedef - * struct { int vertex_shader; int total_constant_descriptions; - * D3DXCONSTANT_DESC *constant_description_array; } DX_PARAMETER; typedef - * struct { int state; union { DIRECT_3D_VERTEX_SHADER - * direct_3d_vertex_shader; DIRECT_3D_PIXEL_SHADER direct_3d_pixel_shader; }; - * LPD3DXCONSTANTTABLE constant_table; D3DXCONSTANTTABLE_DESC - * constant_table_description; int total_semantics; D3DXSEMANTIC - * *semantic_array; } DIRECT_3D_SHADER; - */ +// Caution: adding HLSL support is going to be tricky, as the parsing needs to +// be done in the cull thread, which cannot use the DX API. - Josh +// +// +// typedef struct +// { +// int vertex_shader; +// int total_constant_descriptions; +// D3DXCONSTANT_DESC *constant_description_array; +// } +// DX_PARAMETER; +// +// typedef struct +// { +// int state; +// union +// { +// DIRECT_3D_VERTEX_SHADER direct_3d_vertex_shader; +// DIRECT_3D_PIXEL_SHADER direct_3d_pixel_shader; +// }; +// LPD3DXCONSTANTTABLE constant_table; +// D3DXCONSTANTTABLE_DESC constant_table_description; +// +// int total_semantics; +// D3DXSEMANTIC *semantic_array; +// } +// DIRECT_3D_SHADER; /** * xyz */ -class EXPCL_PANDADX CLP(ShaderContext) : public ShaderContext { +class EXPCL_PANDADX DXShaderContext9 : public ShaderContext { public: - typedef CLP(GraphicsStateGuardian) GSG; + typedef DXGraphicsStateGuardian9 GSG; - CLP(ShaderContext)(Shader *s, GSG *gsg); - ~CLP(ShaderContext)(); + DXShaderContext9(Shader *s, GSG *gsg); + ~DXShaderContext9(); INLINE bool valid(GSG *gsg); bool bind(GSG *gsg); @@ -55,10 +68,10 @@ public: void issue_parameters(GSG *gsg, int altered); void issue_transform(GSG *gsg); void disable_shader_vertex_arrays(GSG *gsg); - bool update_shader_vertex_arrays(CLP(ShaderContext) *prev, GSG *gsg, + bool update_shader_vertex_arrays(DXShaderContext9 *prev, GSG *gsg, bool force); void disable_shader_texture_bindings(GSG *gsg); - void update_shader_texture_bindings(CLP(ShaderContext) *prev, GSG *gsg); + void update_shader_texture_bindings(DXShaderContext9 *prev, GSG *gsg); class VertexElementArray* _vertex_element_array; LPDIRECT3DVERTEXDECLARATION9 _vertex_declaration; @@ -83,7 +96,7 @@ public: } static void init_type() { TypedObject::init_type(); - register_type(_type_handle, CLASSPREFIX_QUOTED "ShaderContext", + register_type(_type_handle, "DXShaderContext9", TypedObject::get_class_type()); } virtual TypeHandle get_type() const { diff --git a/panda/src/dxgsg9/dxVertexBufferContext9.cxx b/panda/src/dxgsg9/dxVertexBufferContext9.cxx index b5374b1afd..48eb65fc6e 100644 --- a/panda/src/dxgsg9/dxVertexBufferContext9.cxx +++ b/panda/src/dxgsg9/dxVertexBufferContext9.cxx @@ -26,10 +26,10 @@ TypeHandle DXVertexBufferContext9::_type_handle; /** * */ -CLP(VertexBufferContext):: -CLP(VertexBufferContext)(CLP(GraphicsStateGuardian) *dxgsg, - PreparedGraphicsObjects *pgo, - GeomVertexArrayData *data) : +DXVertexBufferContext9:: +DXVertexBufferContext9(DXGraphicsStateGuardian9 *dxgsg, + PreparedGraphicsObjects *pgo, + GeomVertexArrayData *data) : VertexBufferContext(pgo, data), _vbuffer(NULL) { @@ -170,7 +170,7 @@ CLP(VertexBufferContext)(CLP(GraphicsStateGuardian) *dxgsg, * epoch), or requeue itself on the tail of the queue (in which case the * eviction will be requested again much later). */ -void CLP(VertexBufferContext):: +void DXVertexBufferContext9:: evict_lru() { dequeue_lru(); diff --git a/panda/src/dxgsg9/dxVertexBufferContext9.h b/panda/src/dxgsg9/dxVertexBufferContext9.h index 9295dcb07c..84966360ee 100644 --- a/panda/src/dxgsg9/dxVertexBufferContext9.h +++ b/panda/src/dxgsg9/dxVertexBufferContext9.h @@ -19,17 +19,17 @@ #include "vertexBufferContext.h" #include "deletedChain.h" -class CLP(GraphicsStateGuardian); +class DXGraphicsStateGuardian9; /** * Caches a GeomVertexArrayData in the DirectX device as a vertex buffer. */ -class EXPCL_PANDADX CLP(VertexBufferContext) : public VertexBufferContext { +class EXPCL_PANDADX DXVertexBufferContext9 : public VertexBufferContext { public: - CLP(VertexBufferContext)(CLP(GraphicsStateGuardian) *dxgsg, + DXVertexBufferContext9(DXGraphicsStateGuardian9 *dxgsg, PreparedGraphicsObjects *pgo, GeomVertexArrayData *data); - ALLOC_DELETED_CHAIN(CLP(VertexBufferContext)); + ALLOC_DELETED_CHAIN(DXVertexBufferContext9); virtual void evict_lru(); diff --git a/panda/src/dxgsg9/wdxGraphicsBuffer9.cxx b/panda/src/dxgsg9/wdxGraphicsBuffer9.cxx index f1853879ae..3cde32fc16 100644 --- a/panda/src/dxgsg9/wdxGraphicsBuffer9.cxx +++ b/panda/src/dxgsg9/wdxGraphicsBuffer9.cxx @@ -312,16 +312,18 @@ rebuild_bitplanes() { case RTP_aux_float_3: { CDWriter cdataw(_cycler, cdata, false); - nassertr(cdata->_textures.size() == cdataw->_textures.size(), false); cdataw->_textures[i]._rtm_mode = RTM_none; } + // Creating the CDWriter invalidated the CDLockedReader. + cdata = CDLockedReader(_cycler); break; default: { CDWriter cdataw(_cycler, cdata, false); - nassertr(cdata->_textures.size() == cdataw->_textures.size(), false); cdataw->_textures[i]._rtm_mode = RTM_copy_texture; } + // Creating the CDWriter invalidated the CDLockedReader. + cdata = CDLockedReader(_cycler); break; } } diff --git a/panda/src/dxml/config_dxml.cxx b/panda/src/dxml/config_dxml.cxx index 48c9161805..e6691bc676 100644 --- a/panda/src/dxml/config_dxml.cxx +++ b/panda/src/dxml/config_dxml.cxx @@ -94,7 +94,15 @@ BEGIN_PUBLISH void print_xml_to_file(const Filename &filename, TiXmlNode *xnode) { string os_name = filename.to_os_specific(); +#ifdef _WIN32 + FILE *file; + if (fopen_s(&file, os_name.c_str(), "w") != 0) { +#else FILE *file = fopen(os_name.c_str(), "w"); + if (file == NULL) { +#endif + dxml_cat.error() << "Failed to open " << filename << " for writing\n"; + } xnode->Print(file, 0); fclose(file); } diff --git a/panda/src/egg/eggVertex.cxx b/panda/src/egg/eggVertex.cxx index 973f583b7b..7663fd4eb3 100644 --- a/panda/src/egg/eggVertex.cxx +++ b/panda/src/egg/eggVertex.cxx @@ -138,11 +138,7 @@ has_uvw(const string &name) const { bool EggVertex:: has_aux(const string &name) const { AuxMap::const_iterator xi = _aux_map.find(name); - if (xi != _aux_map.end()) { - EggVertexAux *aux_obj = (*xi).second; - return true; - } - return false; + return (xi != _aux_map.end()); } /** diff --git a/panda/src/egg2pg/eggSaver.cxx b/panda/src/egg2pg/eggSaver.cxx index 6767d5c287..652bb0ea97 100644 --- a/panda/src/egg2pg/eggSaver.cxx +++ b/panda/src/egg2pg/eggSaver.cxx @@ -92,7 +92,7 @@ add_node(PandaNode *node) { _data->add_child(_vpool); NodePath root(node); - convert_node(WorkingNodePath(root), _data, false); + convert_node(WorkingNodePath(root), _data, false, NULL); // Remove the vertex pool if it has no vertices. if (_vpool->empty()) { @@ -107,22 +107,22 @@ add_node(PandaNode *node) { */ void EggSaver:: convert_node(const WorkingNodePath &node_path, EggGroupNode *egg_parent, - bool has_decal) { + bool has_decal, CharacterJointMap *joint_map) { PandaNode *node = node_path.node(); if (node->is_geom_node()) { - convert_geom_node(DCAST(GeomNode, node), node_path, egg_parent, has_decal); + convert_geom_node(DCAST(GeomNode, node), node_path, egg_parent, has_decal, joint_map); } else if (node->is_of_type(LODNode::get_class_type())) { - convert_lod_node(DCAST(LODNode, node), node_path, egg_parent, has_decal); + convert_lod_node(DCAST(LODNode, node), node_path, egg_parent, has_decal, joint_map); } else if (node->is_of_type(SequenceNode::get_class_type())) { - convert_sequence_node(DCAST(SequenceNode, node), node_path, egg_parent, has_decal); + convert_sequence_node(DCAST(SequenceNode, node), node_path, egg_parent, has_decal, joint_map); } else if (node->is_of_type(SwitchNode::get_class_type())) { - convert_switch_node(DCAST(SwitchNode, node), node_path, egg_parent, has_decal); + convert_switch_node(DCAST(SwitchNode, node), node_path, egg_parent, has_decal, joint_map); } else if (node->is_of_type(CollisionNode::get_class_type())) { - convert_collision_node(DCAST(CollisionNode, node), node_path, egg_parent, has_decal); + convert_collision_node(DCAST(CollisionNode, node), node_path, egg_parent, has_decal, joint_map); } else if (node->is_of_type(AnimBundleNode::get_class_type())) { convert_anim_node(DCAST(AnimBundleNode, node), node_path, egg_parent, has_decal); @@ -136,7 +136,7 @@ convert_node(const WorkingNodePath &node_path, EggGroupNode *egg_parent, egg_parent->add_child(egg_group); apply_node_properties(egg_group, node); - recurse_nodes(node_path, egg_group, has_decal); + recurse_nodes(node_path, egg_group, has_decal, joint_map); } } @@ -145,7 +145,8 @@ convert_node(const WorkingNodePath &node_path, EggGroupNode *egg_parent, */ void EggSaver:: convert_lod_node(LODNode *node, const WorkingNodePath &node_path, - EggGroupNode *egg_parent, bool has_decal) { + EggGroupNode *egg_parent, bool has_decal, + CharacterJointMap *joint_map) { // An LOD node gets converted to an ordinary EggGroup, but we apply the // appropriate switch conditions to each of our children. EggGroup *egg_group = new EggGroup(node->get_name()); @@ -162,7 +163,7 @@ convert_lod_node(LODNode *node, const WorkingNodePath &node_path, // Convert just this one node to an EggGroup. PT(EggGroup) next_group = new EggGroup; - convert_node(WorkingNodePath(node_path, child), next_group, has_decal); + convert_node(WorkingNodePath(node_path, child), next_group, has_decal, joint_map); if (next_group->size() == 1) { // If we have exactly one child, and that child is an EggGroup, @@ -190,7 +191,8 @@ convert_lod_node(LODNode *node, const WorkingNodePath &node_path, */ void EggSaver:: convert_sequence_node(SequenceNode *node, const WorkingNodePath &node_path, - EggGroupNode *egg_parent, bool has_decal) { + EggGroupNode *egg_parent, bool has_decal, + CharacterJointMap *joint_map) { // A sequence node gets converted to an ordinary EggGroup, we only apply the // appropriate switch attributes to turn it into a sequence EggGroup *egg_group = new EggGroup(node->get_name()); @@ -208,7 +210,7 @@ convert_sequence_node(SequenceNode *node, const WorkingNodePath &node_path, // Convert just this one node to an EggGroup. PT(EggGroup) next_group = new EggGroup; - convert_node(WorkingNodePath(node_path, child), next_group, has_decal); + convert_node(WorkingNodePath(node_path, child), next_group, has_decal, joint_map); egg_group->add_child(next_group.p()); } @@ -220,7 +222,8 @@ convert_sequence_node(SequenceNode *node, const WorkingNodePath &node_path, */ void EggSaver:: convert_switch_node(SwitchNode *node, const WorkingNodePath &node_path, - EggGroupNode *egg_parent, bool has_decal) { + EggGroupNode *egg_parent, bool has_decal, + CharacterJointMap *joint_map) { // A sequence node gets converted to an ordinary EggGroup, we only apply the // appropriate switch attributes to turn it into a sequence EggGroup *egg_group = new EggGroup(node->get_name()); @@ -237,7 +240,7 @@ convert_switch_node(SwitchNode *node, const WorkingNodePath &node_path, // Convert just this one node to an EggGroup. PT(EggGroup) next_group = new EggGroup; - convert_node(WorkingNodePath(node_path, child), next_group, has_decal); + convert_node(WorkingNodePath(node_path, child), next_group, has_decal, joint_map); egg_group->add_child(next_group.p()); } @@ -314,7 +317,7 @@ convert_anim_node(AnimBundleNode *node, const WorkingNodePath &node_path, * structure. */ void EggSaver:: -convert_character_bundle(PartGroup *bundleNode, EggGroupNode *egg_parent, CharacterJointMap *jointMap) { +convert_character_bundle(PartGroup *bundleNode, EggGroupNode *egg_parent, CharacterJointMap *joint_map) { int num_children = bundleNode->get_num_children(); EggGroupNode *joint_group = egg_parent; @@ -329,9 +332,9 @@ convert_character_bundle(PartGroup *bundleNode, EggGroupNode *egg_parent, Charac joint->set_group_type(EggGroup::GT_joint); joint_group = joint; egg_parent->add_child(joint_group); - if (jointMap!=NULL) { - CharacterJointMap::iterator mi = jointMap->find(character_joint); - if (mi != jointMap->end()) { + if (joint_map != NULL) { + CharacterJointMap::iterator mi = joint_map->find(character_joint); + if (mi != joint_map->end()) { pvector > &joint_vertices = (*mi).second; pvector >::const_iterator vi; for (vi = joint_vertices.begin(); vi != joint_vertices.end(); ++vi) { @@ -343,7 +346,7 @@ convert_character_bundle(PartGroup *bundleNode, EggGroupNode *egg_parent, Charac for (int i = 0; i < num_children ; i++) { PartGroup *partGroup= bundleNode->get_child(i); - convert_character_bundle(partGroup, joint_group, jointMap); + convert_character_bundle(partGroup, joint_group, joint_map); } } @@ -353,7 +356,7 @@ convert_character_bundle(PartGroup *bundleNode, EggGroupNode *egg_parent, Charac */ void EggSaver:: convert_character_node(Character *node, const WorkingNodePath &node_path, - EggGroupNode *egg_parent, bool has_decal) { + EggGroupNode *egg_parent, bool has_decal) { // A sequence node gets converted to an ordinary EggGroup, we only apply the // appropriate switch attributes to turn it into a sequence @@ -362,26 +365,16 @@ convert_character_node(Character *node, const WorkingNodePath &node_path, egg_parent->add_child(egg_group); apply_node_properties(egg_group, node); - CharacterJointMap jointMap; + CharacterJointMap joint_map; + recurse_nodes(node_path, egg_group, has_decal, &joint_map); // turn it into a switch.. egg_group->set_switch_flag(true); - int num_children = node->get_num_children(); int num_bundles = node->get_num_bundles(); - - for (int i = 0; i < num_children; i++) { - PandaNode *child = node->get_child(i); - - if (child->is_geom_node()) { - convert_geom_node(DCAST(GeomNode, child), WorkingNodePath(node_path, child), egg_group, has_decal, &jointMap); - } + for (int i = 0; i < num_bundles; ++i) { + PartBundle *bundle = node->get_bundle(i); + convert_character_bundle(bundle, egg_group, &joint_map); } - - for (int i = 0; i < num_bundles ; i++) { - PartBundle *bundle= node->get_bundle(i); - convert_character_bundle(bundle, egg_group, &jointMap); - } - } @@ -390,7 +383,8 @@ convert_character_node(Character *node, const WorkingNodePath &node_path, */ void EggSaver:: convert_collision_node(CollisionNode *node, const WorkingNodePath &node_path, - EggGroupNode *egg_parent, bool has_decal) { + EggGroupNode *egg_parent, bool has_decal, + CharacterJointMap *joint_map) { // A sequence node gets converted to an ordinary EggGroup, we only apply the // appropriate switch attributes to turn it into a sequence EggGroup *egg_group = new EggGroup(node->get_name()); @@ -510,7 +504,7 @@ convert_collision_node(CollisionNode *node, const WorkingNodePath &node_path, } // recurse over children - hm. do I need to do this? - recurse_nodes(node_path, egg_group, has_decal); + recurse_nodes(node_path, egg_group, has_decal, joint_map); } /** @@ -518,7 +512,7 @@ convert_collision_node(CollisionNode *node, const WorkingNodePath &node_path, */ void EggSaver:: convert_geom_node(GeomNode *node, const WorkingNodePath &node_path, - EggGroupNode *egg_parent, bool has_decal, CharacterJointMap *jointMap) { + EggGroupNode *egg_parent, bool has_decal, CharacterJointMap *joint_map) { PT(EggGroup) egg_group = new EggGroup(node->get_name()); bool fancy_attributes = apply_node_properties(egg_group, node); @@ -558,11 +552,11 @@ convert_geom_node(GeomNode *node, const WorkingNodePath &node_path, CPT(GeomVertexData) vdata = geom->get_vertex_data(); // vdata = vdata->animate_vertices(true, Thread::get_current_thread()); convert_primitive(vdata, simple, geom_state, - net_mat, egg_parent, jointMap); + net_mat, egg_parent, joint_map); } } - recurse_nodes(node_path, egg_parent, has_decal); + recurse_nodes(node_path, egg_parent, has_decal, joint_map); } /** @@ -573,7 +567,7 @@ convert_primitive(const GeomVertexData *vertex_data, const GeomPrimitive *primitive, const RenderState *net_state, const LMatrix4 &net_mat, EggGroupNode *egg_parent, - CharacterJointMap *jointMap) { + CharacterJointMap *joint_map) { GeomVertexReader reader(vertex_data); // Check for a color scale. @@ -811,8 +805,8 @@ convert_primitive(const GeomVertexData *vertex_data, EggVertex *new_egg_vert = _vpool->create_unique_vertex(egg_vert); - if ((vertex_data->has_column(InternalName::get_transform_blend())) && - (jointMap!=NULL) && (transformBlendTable!=NULL)) { + if (vertex_data->has_column(InternalName::get_transform_blend()) && + joint_map != NULL && transformBlendTable != NULL) { reader.set_column(InternalName::get_transform_blend()); int idx = reader.get_data1i(); const TransformBlend &blend = transformBlendTable->get_blend(idx); @@ -824,9 +818,9 @@ convert_primitive(const GeomVertexData *vertex_data, if (vertex_transform->is_of_type(JointVertexTransform::get_class_type())) { const JointVertexTransform *joint_vertex_transform = DCAST(const JointVertexTransform, vertex_transform); - CharacterJointMap::iterator mi = jointMap->find(joint_vertex_transform->get_joint()); - if (mi == jointMap->end()) { - mi = jointMap->insert(CharacterJointMap::value_type(joint_vertex_transform->get_joint(), pvector >())).first; + CharacterJointMap::iterator mi = joint_map->find(joint_vertex_transform->get_joint()); + if (mi == joint_map->end()) { + mi = joint_map->insert(CharacterJointMap::value_type(joint_vertex_transform->get_joint(), pvector >())).first; } pvector > &joint_vertices = (*mi).second; joint_vertices.push_back(pair(new_egg_vert, weight)); @@ -845,13 +839,13 @@ convert_primitive(const GeomVertexData *vertex_data, */ void EggSaver:: recurse_nodes(const WorkingNodePath &node_path, EggGroupNode *egg_parent, - bool has_decal) { + bool has_decal, CharacterJointMap *joint_map) { PandaNode *node = node_path.node(); int num_children = node->get_num_children(); for (int i = 0; i < num_children; i++) { PandaNode *child = node->get_child(i); - convert_node(WorkingNodePath(node_path, child), egg_parent, has_decal); + convert_node(WorkingNodePath(node_path, child), egg_parent, has_decal, joint_map); } } diff --git a/panda/src/egg2pg/eggSaver.h b/panda/src/egg2pg/eggSaver.h index 0944f0a4eb..170e5fe46c 100644 --- a/panda/src/egg2pg/eggSaver.h +++ b/panda/src/egg2pg/eggSaver.h @@ -61,13 +61,16 @@ private: typedef pmap > > CharacterJointMap; void convert_node(const WorkingNodePath &node_path, EggGroupNode *egg_parent, - bool has_decal); + bool has_decal, CharacterJointMap *joint_map); void convert_lod_node(LODNode *node, const WorkingNodePath &node_path, - EggGroupNode *egg_parent, bool has_decal); + EggGroupNode *egg_parent, bool has_decal, + CharacterJointMap *joint_map); void convert_sequence_node(SequenceNode *node, const WorkingNodePath &node_path, - EggGroupNode *egg_parent, bool has_decal); + EggGroupNode *egg_parent, bool has_decal, + CharacterJointMap *joint_map); void convert_switch_node(SwitchNode *node, const WorkingNodePath &node_path, - EggGroupNode *egg_parent, bool has_decal); + EggGroupNode *egg_parent, bool has_decal, + CharacterJointMap *joint_map); EggGroupNode *convert_animGroup_node(AnimGroup *animGroup, double fps ); void convert_anim_node(AnimBundleNode *node, const WorkingNodePath &node_path, EggGroupNode *egg_parent, bool has_decal); @@ -75,7 +78,8 @@ private: EggGroupNode *egg_parent, bool has_decal); void convert_character_bundle(PartGroup *bundleNode, EggGroupNode *egg_parent, CharacterJointMap *jointMap); void convert_collision_node(CollisionNode *node, const WorkingNodePath &node_path, - EggGroupNode *egg_parent, bool has_decal); + EggGroupNode *egg_parent, bool has_decal, + CharacterJointMap *joint_map); void convert_geom_node(GeomNode *node, const WorkingNodePath &node_path, EggGroupNode *egg_parent, bool has_decal, CharacterJointMap *jointMap=NULL); void convert_primitive(const GeomVertexData *vertex_data, @@ -85,7 +89,7 @@ private: CharacterJointMap *jointMap); void recurse_nodes(const WorkingNodePath &node_path, EggGroupNode *egg_parent, - bool has_decal); + bool has_decal, CharacterJointMap *joint_map); bool apply_node_properties(EggGroup *egg_group, PandaNode *node, bool allow_backstage = true); bool apply_tags(EggGroup *egg_group, PandaNode *node); bool apply_tag(EggGroup *egg_group, PandaNode *node, const string &tag); diff --git a/panda/src/event/asyncTask.cxx b/panda/src/event/asyncTask.cxx index 2a83740b52..fb251aebd6 100644 --- a/panda/src/event/asyncTask.cxx +++ b/panda/src/event/asyncTask.cxx @@ -18,10 +18,6 @@ #include "throw_event.h" #include "eventParameter.h" -#ifdef HAVE_PYTHON -#include "py_panda.h" -#endif - AtomicAdjust::Integer AsyncTask::_next_task_id; PStatCollector AsyncTask::_show_code_pcollector("App:Show code"); TypeHandle AsyncTask::_type_handle; @@ -48,9 +44,6 @@ AsyncTask(const string &name) : _total_dt(0.0), _num_frames(0) { -#ifdef HAVE_PYTHON - _python_object = NULL; -#endif // HAVE_PYTHON set_name(name); // Carefully copy _next_task_id and increment it so that we get a unique ID. @@ -68,9 +61,6 @@ AsyncTask(const string &name) : AsyncTask:: ~AsyncTask() { nassertv(_state == S_inactive && _manager == NULL && _chain == NULL); -#ifdef HAVE_PYTHON - set_python_object(NULL); -#endif } /** @@ -355,35 +345,6 @@ set_priority(int priority) { } } -#ifdef HAVE_PYTHON -/** - * Specifies an arbitrary Python object that will be piggybacked on the task - * object. - */ -void AsyncTask:: -set_python_object(PyObject *python_object) { - Py_XINCREF(python_object); - Py_XDECREF(_python_object); - _python_object = python_object; -} -#endif // HAVE_PYTHON - -#ifdef HAVE_PYTHON -/** - * Returns the Python object that was specified to set_python_object(), if - * any, or None if no object was specified. - */ -PyObject *AsyncTask:: -get_python_object() const { - if (_python_object != (PyObject *)NULL) { - Py_XINCREF(_python_object); - return _python_object; - } - Py_INCREF(Py_None); - return Py_None; -} -#endif // HAVE_PYTHON - /** * */ diff --git a/panda/src/event/asyncTask.h b/panda/src/event/asyncTask.h index 48633a9d91..97176df0a3 100644 --- a/panda/src/event/asyncTask.h +++ b/panda/src/event/asyncTask.h @@ -92,11 +92,6 @@ PUBLISHED: INLINE void set_done_event(const string &done_event); INLINE const string &get_done_event() const; -#ifdef HAVE_PYTHON - void set_python_object(PyObject *python_object); - PyObject *get_python_object() const; -#endif // HAVE_PYTHON - INLINE double get_dt() const; INLINE double get_max_dt() const; INLINE double get_average_dt() const; @@ -140,11 +135,6 @@ protected: static PStatCollector _show_code_pcollector; PStatCollector _task_pcollector; -private: -#ifdef HAVE_PYTHON - PyObject *_python_object; -#endif // HAVE_PYTHON - public: static TypeHandle get_class_type() { return _type_handle; diff --git a/panda/src/event/pythonTask.I b/panda/src/event/pythonTask.I index 7b2e5d5082..b2f9a0ef07 100644 --- a/panda/src/event/pythonTask.I +++ b/panda/src/event/pythonTask.I @@ -10,37 +10,3 @@ * @author drose * @date 2008-09-16 */ - -/** - * If None is passed, calls clear_delay, otherwise sets the delay time. See - * AsyncTask::set_delay() and AsyncTask::clear_delay(). - */ -INLINE void PythonTask:: -set_delay(PyObject *delay) { - if (delay == Py_None) { - AsyncTask::clear_delay(); - return; - } - - PyObject *value = PyNumber_Float(delay); - if (value == NULL) { - return; - } - - AsyncTask::set_delay(PyFloat_AS_DOUBLE(value)); - Py_DECREF(value); -} - -/** - * Returns the delay time if set, None otherwise. See AsyncTask::has_delay() - * and AsyncTask::get_delay(). - */ -INLINE PyObject *PythonTask:: -get_delay() const { - if (AsyncTask::has_delay()) { - return PyFloat_FromDouble(AsyncTask::get_delay()); - } else { - Py_INCREF(Py_None); - return Py_None; - } -} diff --git a/panda/src/event/pythonTask.cxx b/panda/src/event/pythonTask.cxx index 61068759f1..3ca6178803 100644 --- a/panda/src/event/pythonTask.cxx +++ b/panda/src/event/pythonTask.cxx @@ -18,12 +18,9 @@ #ifdef HAVE_PYTHON #include "py_panda.h" -TypeHandle PythonTask::_type_handle; +#include "pythonThread.h" -Configure(config_pythonTask); -ConfigureFn(config_pythonTask) { - PythonTask::init_type(); -} +TypeHandle PythonTask::_type_handle; #ifndef CPPPARSER extern struct Dtool_PyTypedObject Dtool_TypedReferenceCount; @@ -188,6 +185,19 @@ get_upon_death() { */ void PythonTask:: set_owner(PyObject *owner) { +#ifndef NDEBUG + if (owner != Py_None) { + PyObject *add = PyObject_GetAttrString(owner, "_addTask"); + PyObject *clear = PyObject_GetAttrString(owner, "_clearTask"); + + if (add == NULL || !PyCallable_Check(add) || + clear == NULL || !PyCallable_Check(clear)) { + Dtool_Raise_TypeError("owner object should have _addTask and _clearTask methods"); + return; + } + } +#endif + if (_owner != NULL && _owner != Py_None && _state != S_inactive) { unregister_from_owner(); } @@ -391,8 +401,7 @@ do_python_task() { if (_generator == (PyObject *)NULL) { // We are calling the function directly. PyObject *args = get_args(); - result = - Thread::get_current_thread()->call_python_func(_function, args); + result = PythonThread::call_python_func(_function, args); Py_DECREF(args); #ifdef PyGen_Check @@ -494,10 +503,16 @@ do_python_task() { ostringstream strm; #if PY_MAJOR_VERSION >= 3 PyObject *str = PyObject_ASCII(result); + if (str == NULL) { + str = PyUnicode_FromString(""); + } strm << *this << " returned " << PyUnicode_AsUTF8(str); #else PyObject *str = PyObject_Repr(result); + if (str == NULL) { + str = PyString_FromString(""); + } strm << *this << " returned " << PyString_AsString(str); #endif @@ -606,18 +621,9 @@ call_owner_method(const char *method_name) { if (_owner != Py_None) { PyObject *func = PyObject_GetAttrString(_owner, (char *)method_name); if (func == (PyObject *)NULL) { -#if PY_MAJOR_VERSION >= 3 - PyObject *str = PyObject_ASCII(_owner); task_cat.error() - << "Owner object " << PyUnicode_AsUTF8(str) << " added to " - << *this << " has no method " << method_name << "().\n"; -#else - PyObject *str = PyObject_Repr(_owner); - task_cat.error() - << "Owner object " << PyString_AsString(str) << " added to " - << *this << " has no method " << method_name << "().\n"; -#endif - Py_DECREF(str); + << "Owner object added to " << *this << " has no method " + << method_name << "().\n"; } else { call_function(func); diff --git a/panda/src/event/pythonTask.h b/panda/src/event/pythonTask.h index 558fb7c5a8..d97be5795e 100644 --- a/panda/src/event/pythonTask.h +++ b/panda/src/event/pythonTask.h @@ -50,9 +50,6 @@ PUBLISHED: int __traverse__(visitproc visit, void *arg); int __clear__(); - INLINE void set_delay(PyObject *delay); - INLINE PyObject *get_delay() const; - PUBLISHED: // The name of this task. MAKE_PROPERTY(name, get_name, set_name); @@ -72,10 +69,10 @@ PUBLISHED: MAKE_PROPERTY(wakeTime, get_wake_time); // The delay value that has been set on this task, if any, or None. - MAKE_PROPERTY(delay_time, get_delay, set_delay); + MAKE_PROPERTY2(delay_time, has_delay, get_delay, set_delay, clear_delay); // Alias of delay_time. - MAKE_PROPERTY(delayTime, get_delay, set_delay); + MAKE_PROPERTY2(delayTime, has_delay, get_delay, set_delay, clear_delay); // The number of frames that have elapsed since the task was started, // according to the task manager's clock. diff --git a/panda/src/express/memoryInfo.cxx b/panda/src/express/memoryInfo.cxx index 815e57448d..d12b7313a0 100644 --- a/panda/src/express/memoryInfo.cxx +++ b/panda/src/express/memoryInfo.cxx @@ -108,7 +108,7 @@ determine_dynamic_type() { return; } - TypeHandle orig_type = _dynamic_type; + //TypeHandle orig_type = _dynamic_type; update_type_handle(_dynamic_type, got_type); } } diff --git a/panda/src/express/nodeReferenceCount.I b/panda/src/express/nodeReferenceCount.I index d27fa0a43a..4273f0b78c 100644 --- a/panda/src/express/nodeReferenceCount.I +++ b/panda/src/express/nodeReferenceCount.I @@ -129,7 +129,7 @@ node_ref() const { #endif ref(); - AtomicAdjust::inc(((NodeReferenceCount *)this)->_node_ref_count); + AtomicAdjust::inc(_node_ref_count); } /** @@ -174,7 +174,7 @@ node_unref_only() const { // you can't use PointerTo's? nassertv(_node_ref_count > 0); - AtomicAdjust::dec(((NodeReferenceCount *)this)->_node_ref_count); + AtomicAdjust::dec(_node_ref_count); } /** diff --git a/panda/src/express/nodeReferenceCount.h b/panda/src/express/nodeReferenceCount.h index 349d66660b..2312508f1b 100644 --- a/panda/src/express/nodeReferenceCount.h +++ b/panda/src/express/nodeReferenceCount.h @@ -42,14 +42,13 @@ PUBLISHED: INLINE void node_ref() const; INLINE bool node_unref() const; INLINE bool test_ref_count_integrity() const; - -protected: INLINE void node_unref_only() const; +protected: bool do_test_ref_count_integrity() const; private: - AtomicAdjust::Integer _node_ref_count; + mutable AtomicAdjust::Integer _node_ref_count; public: static TypeHandle get_class_type() { diff --git a/panda/src/express/ordered_vector.T b/panda/src/express/ordered_vector.T index 6a7100f90f..7ea866e52f 100644 --- a/panda/src/express/ordered_vector.T +++ b/panda/src/express/ordered_vector.T @@ -280,7 +280,6 @@ TYPENAME ordered_vector::SIZE_TYPE ordered_vector::CONST_ITERATOR first, TYPENAME ordered_vector::CONST_ITERATOR last, const TYPENAME ordered_vector::KEY_TYPE &key) const { - typedef pair::CONST_ITERATOR, TYPENAME ordered_vector::CONST_ITERATOR> pair_type; if (first == last) { // The list is empty; the key is not on the list. diff --git a/panda/src/express/pointerToArray.h b/panda/src/express/pointerToArray.h index 5632a8246f..2485f28759 100644 --- a/panda/src/express/pointerToArray.h +++ b/panda/src/express/pointerToArray.h @@ -102,11 +102,9 @@ PUBLISHED: INLINE int get_node_ref_count() const; #ifdef HAVE_PYTHON -#if PY_VERSION_HEX >= 0x02060000 EXTENSION(int __getbuffer__(PyObject *self, Py_buffer *view, int flags)); EXTENSION(void __releasebuffer__(PyObject *self, Py_buffer *view) const); #endif -#endif #else // CPPPARSER // This is the actual, complete interface. @@ -257,11 +255,9 @@ PUBLISHED: INLINE int get_node_ref_count() const; #ifdef HAVE_PYTHON -#if PY_VERSION_HEX >= 0x02060000 EXTENSION(int __getbuffer__(PyObject *self, Py_buffer *view, int flags) const); EXTENSION(void __releasebuffer__(PyObject *self, Py_buffer *view) const); #endif -#endif #else // CPPPARSER // This is the actual, complete interface. diff --git a/panda/src/express/pointerToArray_ext.I b/panda/src/express/pointerToArray_ext.I index 82ba097d24..7502334e6e 100644 --- a/panda/src/express/pointerToArray_ext.I +++ b/panda/src/express/pointerToArray_ext.I @@ -175,7 +175,6 @@ __getitem__(size_t n) const { return (*this->_this)[n]; } -#if PY_VERSION_HEX >= 0x02060000 /** * This is used to implement the buffer protocol, in order to allow efficient * access to the array data through a Python multiview object. @@ -183,7 +182,7 @@ __getitem__(size_t n) const { template INLINE int Extension >:: __getbuffer__(PyObject *self, Py_buffer *view, int flags) { - +#if PY_VERSION_HEX >= 0x02060000 const char *format = get_format_code(Element); if (format == NULL) { // Not supported. @@ -222,6 +221,9 @@ __getbuffer__(PyObject *self, Py_buffer *view, int flags) { view->internal = (void*) this->_this; return 0; +#else + return -1; +#endif } /** @@ -230,13 +232,14 @@ __getbuffer__(PyObject *self, Py_buffer *view, int flags) { template INLINE void Extension >:: __releasebuffer__(PyObject *self, Py_buffer *view) const { +#if PY_VERSION_HEX >= 0x02060000 // Note: PyBuffer_Release automatically decrements view->obj. - if (view->internal != NULL) { // Oh, right, let's not forget to unref this. unref_delete((const PointerToArray *)view->internal); view->internal = NULL; } +#endif } /** @@ -246,7 +249,7 @@ __releasebuffer__(PyObject *self, Py_buffer *view) const { template INLINE int Extension >:: __getbuffer__(PyObject *self, Py_buffer *view, int flags) const { - +#if PY_VERSION_HEX >= 0x02060000 if ((flags & PyBUF_WRITABLE) == PyBUF_WRITABLE) { PyErr_SetString(PyExc_BufferError, "Object is not writable."); @@ -291,6 +294,9 @@ __getbuffer__(PyObject *self, Py_buffer *view, int flags) const { view->internal = (void*) this->_this; return 0; +#else + return -1; +#endif } /** @@ -299,12 +305,12 @@ __getbuffer__(PyObject *self, Py_buffer *view, int flags) const { template INLINE void Extension >:: __releasebuffer__(PyObject *self, Py_buffer *view) const { +#if PY_VERSION_HEX >= 0x02060000 // Note: PyBuffer_Release automatically decrements obj->view. - if (view->internal != NULL) { // Oh, right, let's not forget to unref this. unref_delete((const PointerToArray *)view->internal); view->internal = NULL; } +#endif } -#endif // PY_VERSION_HEX diff --git a/panda/src/express/pointerToArray_ext.h b/panda/src/express/pointerToArray_ext.h index d5c3fd5824..73ec780675 100644 --- a/panda/src/express/pointerToArray_ext.h +++ b/panda/src/express/pointerToArray_ext.h @@ -35,10 +35,8 @@ public: INLINE const Element &__getitem__(size_t n) const; INLINE void __setitem__(size_t n, const Element &value); -#if PY_VERSION_HEX >= 0x02060000 INLINE int __getbuffer__(PyObject *self, Py_buffer *view, int flags); INLINE void __releasebuffer__(PyObject *self, Py_buffer *view) const; -#endif }; /** @@ -55,10 +53,8 @@ public: INLINE const Element &__getitem__(size_t n) const; -#if PY_VERSION_HEX >= 0x02060000 INLINE int __getbuffer__(PyObject *self, Py_buffer *view, int flags) const; INLINE void __releasebuffer__(PyObject *self, Py_buffer *view) const; -#endif }; #ifdef _MSC_VER diff --git a/panda/src/framework/pandaFramework.cxx b/panda/src/framework/pandaFramework.cxx index 3703793fac..d5c6b49829 100644 --- a/panda/src/framework/pandaFramework.cxx +++ b/panda/src/framework/pandaFramework.cxx @@ -94,7 +94,7 @@ open_framework(int &argc, char **&argv) { extern EXPCL_PANDAGL void init_libpandagl(); init_libpandagl(); #elif defined(HAVE_DX9) - extern EXPCL_PANDADX9 void init_libpandadx9(); + extern EXPCL_PANDADX void init_libpandadx9(); init_libpandadx9(); #elif defined(HAVE_TINYDISPLAY) extern EXPCL_TINYDISPLAY void init_libtinydisplay(); diff --git a/panda/src/framework/windowFramework.cxx b/panda/src/framework/windowFramework.cxx index 7ac9e89fa2..898aae50a1 100644 --- a/panda/src/framework/windowFramework.cxx +++ b/panda/src/framework/windowFramework.cxx @@ -602,16 +602,10 @@ load_model(const NodePath &parent, Filename filename) { if (model_type == (LoaderFileType *)NULL) { // The extension isn't a known model file type; is it a known image file // extension? - if (extension == "txo" || downcase(extension) == "dds") { - // A texture object. Not exactly an image, but certainly a texture. + TexturePool *texture_pool = TexturePool::get_global_ptr(); + if (texture_pool->get_texture_type(extension) != NULL) { + // It is a known image file extension. is_image = true; - - } else { - TexturePool *texture_pool = TexturePool::get_global_ptr(); - if (texture_pool->get_texture_type(extension) != NULL) { - // It is a known image file extension. - is_image = true; - } } } } diff --git a/panda/src/gles2gsg/gles2gsg.h b/panda/src/gles2gsg/gles2gsg.h index f88d40c3fc..8d80e690eb 100644 --- a/panda/src/gles2gsg/gles2gsg.h +++ b/panda/src/gles2gsg/gles2gsg.h @@ -231,6 +231,16 @@ typedef char GLchar; #define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311 #define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313 #define GL_ALL_BARRIER_BITS 0xFFFFFFFF +#define GL_COMPRESSED_R11_EAC 0x9270 +#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 +#define GL_COMPRESSED_RG11_EAC 0x9272 +#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 +#define GL_COMPRESSED_RGB8_ETC2 0x9274 +#define GL_COMPRESSED_SRGB8_ETC2 0x9275 +#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 +#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 +#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 +#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 #undef SUPPORT_IMMEDIATE_MODE #define APIENTRY diff --git a/panda/src/glesgsg/glesgsg.h b/panda/src/glesgsg/glesgsg.h index 416e5737cb..c0afb58b56 100644 --- a/panda/src/glesgsg/glesgsg.h +++ b/panda/src/glesgsg/glesgsg.h @@ -132,6 +132,17 @@ #define GL_DEBUG_SEVERITY_LOW 0x9148 #define GL_DEBUG_OUTPUT 0x92E0 +#define GL_COMPRESSED_R11_EAC 0x9270 +#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 +#define GL_COMPRESSED_RG11_EAC 0x9272 +#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 +#define GL_COMPRESSED_RGB8_ETC2 0x9274 +#define GL_COMPRESSED_SRGB8_ETC2 0x9275 +#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 +#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 +#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 +#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 + #undef SUPPORT_IMMEDIATE_MODE #define APIENTRY #define APIENTRYP * diff --git a/panda/src/glstuff/glGeomMunger_src.cxx b/panda/src/glstuff/glGeomMunger_src.cxx index e9a98e82fc..b26f2bbb10 100644 --- a/panda/src/glstuff/glGeomMunger_src.cxx +++ b/panda/src/glstuff/glGeomMunger_src.cxx @@ -409,41 +409,6 @@ premunge_format_impl(const GeomVertexFormat *orig) { return format; } -#ifdef OPENGLES -/** - * Converts a Geom and/or its data as necessary. - */ -void CLP(GeomMunger):: -munge_geom_impl(CPT(Geom) &geom, CPT(GeomVertexData) &vertex_data, - Thread *current_thread) { - StandardMunger::munge_geom_impl(geom, vertex_data, current_thread); - - // OpenGL ES has no polygon mode, so we have to emulate it. - RenderModeAttrib::Mode render_mode = get_render_mode(); - if (render_mode == RenderModeAttrib::M_point) { - geom = geom->make_points(); - } else if (render_mode == RenderModeAttrib::M_wireframe) { - geom = geom->make_lines(); - } -} - -/** - * Converts a Geom and/or its data as necessary. - */ -void CLP(GeomMunger):: -premunge_geom_impl(CPT(Geom) &geom, CPT(GeomVertexData) &vertex_data) { - StandardMunger::premunge_geom_impl(geom, vertex_data); - - // OpenGL ES has no polygon mode, so we have to emulate it. - RenderModeAttrib::Mode render_mode = get_render_mode(); - if (render_mode == RenderModeAttrib::M_point) { - geom = geom->make_points(); - } else if (render_mode == RenderModeAttrib::M_wireframe) { - geom = geom->make_lines(); - } -} -#endif // OPENGLES - /** * Called to compare two GeomMungers who are known to be of the same type, for * an apples-to-apples comparison. This will never be called on two pointers @@ -473,11 +438,6 @@ compare_to_impl(const GeomMunger *other) const { int CLP(GeomMunger):: geom_compare_to_impl(const GeomMunger *other) const { const CLP(GeomMunger) *om = (CLP(GeomMunger) *)other; -#ifdef OPENGLES - if (get_render_mode() != om->get_render_mode()) { - return get_render_mode() < om->get_render_mode() ? -1 : 1; - } -#endif if (_texture != om->_texture) { return _texture < om->_texture ? -1 : 1; } diff --git a/panda/src/glstuff/glGeomMunger_src.h b/panda/src/glstuff/glGeomMunger_src.h index 5122dda25f..a3eae7c8b4 100644 --- a/panda/src/glstuff/glGeomMunger_src.h +++ b/panda/src/glstuff/glGeomMunger_src.h @@ -40,12 +40,6 @@ protected: const GeomVertexAnimationSpec &animation); virtual CPT(GeomVertexFormat) premunge_format_impl(const GeomVertexFormat *orig); -#ifdef OPENGLES - virtual void munge_geom_impl(CPT(Geom) &geom, CPT(GeomVertexData) &data, - Thread *current_thread); - virtual void premunge_geom_impl(CPT(Geom) &geom, CPT(GeomVertexData) &data); -#endif - virtual int compare_to_impl(const GeomMunger *other) const; virtual int geom_compare_to_impl(const GeomMunger *other) const; diff --git a/panda/src/glstuff/glGraphicsBuffer_src.cxx b/panda/src/glstuff/glGraphicsBuffer_src.cxx index 7e055364e4..ad09596f9c 100644 --- a/panda/src/glstuff/glGraphicsBuffer_src.cxx +++ b/panda/src/glstuff/glGraphicsBuffer_src.cxx @@ -514,7 +514,8 @@ rebuild_bitplanes() { if (num_fbos > _fbo.size()) { // Generate more FBO handles. int start = _fbo.size(); - _fbo.resize(num_fbos, 0); + GLuint zero = 0; + _fbo.resize(num_fbos, zero); glgsg->_glGenFramebuffers(num_fbos - start, &_fbo[start]); } @@ -1752,7 +1753,7 @@ resolve_multisamples() { if (_rbm[RTP_depth_stencil] != 0 || _rbm[RTP_depth] != 0) { if (_shared_depth_buffer) { CLP(GraphicsBuffer) *graphics_buffer = NULL; - CLP(GraphicsBuffer) *highest_sort_graphics_buffer = NULL; + //CLP(GraphicsBuffer) *highest_sort_graphics_buffer = NULL; list ::iterator graphics_buffer_iterator; int max_sort_order = 0; @@ -1764,7 +1765,7 @@ resolve_multisamples() { // this call removes the entry from the list if (graphics_buffer->get_sort() >= max_sort_order) { max_sort_order = graphics_buffer->get_sort(); - highest_sort_graphics_buffer = graphics_buffer; + //highest_sort_graphics_buffer = graphics_buffer; } } } diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index f078ce0d8b..0b36265eb6 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -628,6 +628,9 @@ reset() { } _supported_geom_rendering = +#ifndef OPENGLES + Geom::GR_render_mode_wireframe | Geom::GR_render_mode_point | +#endif Geom::GR_indexed_point | Geom::GR_point | Geom::GR_point_uniform_size | Geom::GR_indexed_other | @@ -1053,6 +1056,24 @@ reset() { break; #endif + case GL_COMPRESSED_R11_EAC: + case GL_COMPRESSED_RG11_EAC: + _compressed_texture_formats.set_bit(Texture::CM_eac); + break; + + case GL_COMPRESSED_RGB8_ETC2: + case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: + case GL_COMPRESSED_RGBA8_ETC2_EAC: + _compressed_texture_formats.set_bit(Texture::CM_etc1); + _compressed_texture_formats.set_bit(Texture::CM_etc2); + break; + +#ifdef OPENGLES + case GL_ETC1_RGB8_OES: + _compressed_texture_formats.set_bit(Texture::CM_etc1); + break; +#endif + default: break; } @@ -7120,11 +7141,20 @@ do_issue_blending() { enable_multisample_alpha_mask(false); enable_blend(true); _glBlendEquation(GL_FUNC_ADD); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + if (old_alpha_blend) { + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + } else { + _glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + } if (GLCAT.is_spam()) { GLCAT.spam() << "glBlendEquation(GL_FUNC_ADD)\n"; - GLCAT.spam() << "glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)\n"; + if (_supports_blend_equation_separate && !old_alpha_blend) { + GLCAT.spam() << "glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA)\n"; + } else { + GLCAT.spam() << "glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)\n"; + } } return; @@ -8057,6 +8087,12 @@ get_texture_target(Texture::TextureType texture_type) const { return GL_TEXTURE_1D; #endif + case Texture::TT_1d_texture_array: + // There are no 1D array textures in OpenGL ES. Fall back to 2D textures. +#ifndef OPENGLES + return GL_TEXTURE_1D_ARRAY; +#endif + case Texture::TT_2d_texture: return GL_TEXTURE_2D; @@ -8273,6 +8309,11 @@ get_component_type(Texture::ComponentType component_type) { return GL_HALF_FLOAT; #endif +#ifndef OPENGLES_1 + case Texture::T_unsigned_int: + return GL_UNSIGNED_INT; +#endif + default: GLCAT.error() << "Invalid Texture::Type value!\n"; return GL_UNSIGNED_BYTE; @@ -8435,9 +8476,9 @@ get_external_image_format(Texture *tex) const { case Texture::CM_rgtc: #ifndef OPENGLES - if (tex->get_format() == Texture::F_luminance) { + if (format == Texture::F_luminance) { return GL_COMPRESSED_LUMINANCE_LATC1_EXT; - } else if (tex->get_format() == Texture::F_luminance_alpha) { + } else if (format == Texture::F_luminance_alpha) { return GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT; } else if (tex->get_num_components() == 1) { return GL_COMPRESSED_RED_RGTC1; @@ -8447,6 +8488,41 @@ get_external_image_format(Texture *tex) const { #endif break; + case Texture::CM_etc1: +#ifdef OPENGLES + return GL_ETC1_RGB8_OES; +#endif + // Fall through - ETC2 is backward compatible + case Texture::CM_etc2: + if (format == Texture::F_rgbm) { + return GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2; + } else if (format == Texture::F_srgb_alpha) { + return GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC; + } else if (format == Texture::F_srgb) { + return GL_COMPRESSED_SRGB8_ETC2; + } else if (Texture::has_alpha(format)) { + return GL_COMPRESSED_RGBA8_ETC2_EAC; + } else { + return GL_COMPRESSED_RGB8_ETC2; + } + break; + + case Texture::CM_eac: + if (Texture::is_unsigned(tex->get_component_type())) { + if (tex->get_num_components() == 1) { + return GL_COMPRESSED_R11_EAC; + } else { + return GL_COMPRESSED_RG11_EAC; + } + } else { + if (tex->get_num_components() == 1) { + return GL_COMPRESSED_SIGNED_R11_EAC; + } else { + return GL_COMPRESSED_SIGNED_RG11_EAC; + } + } + break; + case Texture::CM_default: case Texture::CM_off: case Texture::CM_dxt2: @@ -8556,7 +8632,7 @@ get_external_image_format(Texture *tex) const { } GLCAT.error() << "Invalid Texture::Format value in get_external_image_format(): " - << tex->get_format() << "\n"; + << format << "\n"; return GL_RGB; } @@ -8606,10 +8682,14 @@ get_internal_image_format(Texture *tex, bool force_sized) const { break; case Texture::F_rgbm: + case Texture::F_rgba5: case Texture::F_rgb10_a2: if (get_supports_compressed_texture_format(Texture::CM_dxt1) && !is_3d) { return GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; } + if (get_supports_compressed_texture_format(Texture::CM_etc2) && !is_3d) { + return GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2; + } #ifndef OPENGLES if (get_supports_compressed_texture_format(Texture::CM_fxt1) && !is_3d) { return GL_COMPRESSED_RGBA_FXT1_3DFX; @@ -8624,6 +8704,9 @@ get_internal_image_format(Texture *tex, bool force_sized) const { return GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; } #endif + if (get_supports_compressed_texture_format(Texture::CM_etc2) && !is_3d) { + return GL_COMPRESSED_RGBA8_ETC2_EAC; + } #ifndef OPENGLES if (get_supports_compressed_texture_format(Texture::CM_fxt1) && !is_3d) { return GL_COMPRESSED_RGBA_FXT1_3DFX; @@ -8642,6 +8725,9 @@ get_internal_image_format(Texture *tex, bool force_sized) const { return GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; } #endif + if (get_supports_compressed_texture_format(Texture::CM_etc2) && !is_3d) { + return GL_COMPRESSED_RGBA8_ETC2_EAC; + } #ifndef OPENGLES if (get_supports_compressed_texture_format(Texture::CM_fxt1) && !is_3d) { return GL_COMPRESSED_RGBA_FXT1_3DFX; @@ -8652,7 +8738,6 @@ get_internal_image_format(Texture *tex, bool force_sized) const { case Texture::F_rgb: case Texture::F_rgb5: - case Texture::F_rgba5: case Texture::F_rgb8: case Texture::F_rgb12: case Texture::F_rgb332: @@ -8661,7 +8746,14 @@ get_internal_image_format(Texture *tex, bool force_sized) const { if (get_supports_compressed_texture_format(Texture::CM_dxt1) && !is_3d) { return GL_COMPRESSED_RGB_S3TC_DXT1_EXT; } -#ifndef OPENGLES + if (get_supports_compressed_texture_format(Texture::CM_etc2) && !is_3d) { + return GL_COMPRESSED_RGB8_ETC2; + } +#ifdef OPENGLES + if (get_supports_compressed_texture_format(Texture::CM_etc1) && !is_3d) { + return GL_ETC1_RGB8_OES; + } +#else if (get_supports_compressed_texture_format(Texture::CM_fxt1) && !is_3d) { return GL_COMPRESSED_RGB_FXT1_3DFX; } @@ -8693,6 +8785,13 @@ get_internal_image_format(Texture *tex, bool force_sized) const { return GL_COMPRESSED_RED_RGTC1; } #endif + if (get_supports_compressed_texture_format(Texture::CM_eac) && !is_3d) { + if (Texture::is_unsigned(tex->get_component_type())) { + return GL_COMPRESSED_R11_EAC; + } else { + return GL_COMPRESSED_SIGNED_R11_EAC; + } + } if (get_supports_compressed_texture_format(Texture::CM_dxt1) && !is_3d) { return GL_COMPRESSED_RGB_S3TC_DXT1_EXT; } @@ -8712,6 +8811,13 @@ get_internal_image_format(Texture *tex, bool force_sized) const { return GL_COMPRESSED_RG_RGTC2; } #endif + if (get_supports_compressed_texture_format(Texture::CM_eac) && !is_3d) { + if (Texture::is_unsigned(tex->get_component_type())) { + return GL_COMPRESSED_RG11_EAC; + } else { + return GL_COMPRESSED_SIGNED_RG11_EAC; + } + } if (get_supports_compressed_texture_format(Texture::CM_dxt1) && !is_3d) { return GL_COMPRESSED_RGB_S3TC_DXT1_EXT; } @@ -8755,12 +8861,18 @@ get_internal_image_format(Texture *tex, bool force_sized) const { if (get_supports_compressed_texture_format(Texture::CM_dxt1) && !is_3d) { return GL_COMPRESSED_SRGB_S3TC_DXT1_EXT; } + if (get_supports_compressed_texture_format(Texture::CM_etc2) && !is_3d) { + return GL_COMPRESSED_SRGB8_ETC2; + } return GL_COMPRESSED_SRGB; case Texture::F_srgb_alpha: if (get_supports_compressed_texture_format(Texture::CM_dxt5) && !is_3d) { return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT; } + if (get_supports_compressed_texture_format(Texture::CM_etc2) && !is_3d) { + return GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC; + } return GL_COMPRESSED_SRGB_ALPHA; case Texture::F_sluminance: @@ -8846,9 +8958,9 @@ get_internal_image_format(Texture *tex, bool force_sized) const { case Texture::CM_rgtc: #ifndef OPENGLES - if (tex->get_format() == Texture::F_luminance) { + if (format == Texture::F_luminance) { return GL_COMPRESSED_LUMINANCE_LATC1_EXT; - } else if (tex->get_format() == Texture::F_luminance_alpha) { + } else if (format == Texture::F_luminance_alpha) { return GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT; } else if (tex->get_num_components() == 1) { return GL_COMPRESSED_RED_RGTC1; @@ -8858,6 +8970,41 @@ get_internal_image_format(Texture *tex, bool force_sized) const { #endif break; + case Texture::CM_etc1: +#ifdef OPENGLES + return GL_ETC1_RGB8_OES; +#endif + // Fall through - ETC2 is backward compatible + case Texture::CM_etc2: + if (format == Texture::F_rgbm) { + return GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2; + } else if (format == Texture::F_srgb_alpha) { + return GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC; + } else if (format == Texture::F_srgb) { + return GL_COMPRESSED_SRGB8_ETC2; + } else if (Texture::has_alpha(format)) { + return GL_COMPRESSED_RGBA8_ETC2_EAC; + } else { + return GL_COMPRESSED_RGB8_ETC2; + } + break; + + case Texture::CM_eac: + if (Texture::is_unsigned(tex->get_component_type())) { + if (tex->get_num_components() == 1) { + return GL_COMPRESSED_R11_EAC; + } else { + return GL_COMPRESSED_RG11_EAC; + } + } else { + if (tex->get_num_components() == 1) { + return GL_COMPRESSED_SIGNED_R11_EAC; + } else { + return GL_COMPRESSED_SIGNED_RG11_EAC; + } + } + break; + case Texture::CM_default: case Texture::CM_off: case Texture::CM_dxt2: @@ -9188,7 +9335,7 @@ get_internal_image_format(Texture *tex, bool force_sized) const { default: GLCAT.error() << "Invalid image format in get_internal_image_format(): " - << (int)tex->get_format() << "\n"; + << (int)format << "\n"; return force_sized ? GL_RGB8 : GL_RGB; } } @@ -10795,8 +10942,6 @@ do_issue_tex_matrix() { */ void CLP(GraphicsStateGuardian):: do_issue_tex_gen() { - bool force_normal = false; - nassertv(_num_active_texture_stages <= _max_texture_stages); // These are passed in for the four OBJECT_PLANE or EYE_PLANE values; they @@ -10840,7 +10985,6 @@ do_issue_tex_gen() { glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); - force_normal = true; break; case TexGenAttrib::M_eye_cube_map: @@ -10863,7 +11007,6 @@ do_issue_tex_gen() { glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); glEnable(GL_TEXTURE_GEN_R); - force_normal = true; } break; @@ -10891,7 +11034,6 @@ do_issue_tex_gen() { glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); glEnable(GL_TEXTURE_GEN_R); - force_normal = true; } break; @@ -10915,7 +11057,6 @@ do_issue_tex_gen() { glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); glEnable(GL_TEXTURE_GEN_R); - force_normal = true; } break; @@ -10943,7 +11084,6 @@ do_issue_tex_gen() { glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); glEnable(GL_TEXTURE_GEN_R); - force_normal = true; } break; @@ -11659,6 +11799,7 @@ upload_texture(CLP(TextureContext) *gtc, bool force, bool uses_mipmaps) { break; case Texture::TT_2d_texture: case Texture::TT_cube_map: + case Texture::TT_1d_texture_array: _glTexStorage2D(target, num_levels, internal_format, width, height); break; case Texture::TT_3d_texture: @@ -12117,6 +12258,14 @@ upload_texture_image(CLP(TextureContext) *gtc, bool needs_reload, // fill it in with the correct clear color, which we can then // upload. ptimage = tex->make_ram_mipmap_image(n); + + } else if (image_compression != Texture::CM_off) { + // We can't upload a NULL compressed texture. + if (_supports_texture_max_level) { + // Tell the GL we have no more mipmaps for it to use. + glTexParameteri(texture_target, GL_TEXTURE_MAX_LEVEL, n - mipmap_bias); + } + break; } } image_ptr = ptimage; diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index b5262ade6a..60563af5db 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -510,7 +510,6 @@ reflect_uniform_block(int i, const char *name, char *name_buffer, GLsizei name_b GLint data_size = 0; GLint param_count = 0; - GLsizei param_size; _glgsg->_glGetActiveUniformBlockiv(_glsl_program, i, GL_UNIFORM_BLOCK_DATA_SIZE, &data_size); _glgsg->_glGetActiveUniformBlockiv(_glsl_program, i, GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS, ¶m_count); @@ -1297,12 +1296,15 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { case GL_SAMPLER_2D_ARRAY_SHADOW: #ifndef OPENGLES case GL_INT_SAMPLER_1D: + case GL_INT_SAMPLER_1D_ARRAY: case GL_INT_SAMPLER_BUFFER: case GL_INT_SAMPLER_CUBE_MAP_ARRAY: case GL_UNSIGNED_INT_SAMPLER_1D: + case GL_UNSIGNED_INT_SAMPLER_1D_ARRAY: case GL_UNSIGNED_INT_SAMPLER_BUFFER: case GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY: case GL_SAMPLER_1D: + case GL_SAMPLER_1D_ARRAY: case GL_SAMPLER_1D_SHADOW: case GL_SAMPLER_BUFFER: case GL_SAMPLER_CUBE_MAP_ARRAY: @@ -1598,6 +1600,12 @@ get_sampler_texture_type(int &out, GLenum param_type) { case GL_SAMPLER_1D: out = Texture::TT_1d_texture; return true; + + case GL_INT_SAMPLER_1D_ARRAY: + case GL_UNSIGNED_INT_SAMPLER_1D_ARRAY: + case GL_SAMPLER_1D_ARRAY: + out = Texture::TT_1d_texture_array; + return true; #endif case GL_INT_SAMPLER_2D: @@ -2146,7 +2154,8 @@ update_shader_vertex_arrays(ShaderContext *prev, bool force) { // Bind the vertex buffer to the binding index. if (ai >= _glgsg->_current_vertex_buffers.size()) { - _glgsg->_current_vertex_buffers.resize(ai + 1, 0); + GLuint zero = 0; + _glgsg->_current_vertex_buffers.resize(ai + 1, zero); } if (_glgsg->_current_vertex_buffers[ai] != gvbc->_index) { _glgsg->_glBindVertexBuffer(ai, gvbc->_index, 0, stride); diff --git a/panda/src/glstuff/panda_glext.h b/panda/src/glstuff/panda_glext.h index 61b983ed7a..3be88b13c5 100644 --- a/panda/src/glstuff/panda_glext.h +++ b/panda/src/glstuff/panda_glext.h @@ -4493,8 +4493,6 @@ GLAPI void APIENTRY glVertexBlendARB (GLint count); #ifndef GL_ARB_vertex_buffer_object #define GL_ARB_vertex_buffer_object 1 -typedef ptrdiff_t GLsizeiptrARB; -typedef ptrdiff_t GLintptrARB; #define GL_BUFFER_SIZE_ARB 0x8764 #define GL_BUFFER_USAGE_ARB 0x8765 #define GL_ARRAY_BUFFER_ARB 0x8892 @@ -4530,9 +4528,9 @@ typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers); typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers); typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const void *data, GLenum usage); -typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void *data); -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, void *data); +typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptr offset, GLsizeiptr size, void *data); typedef void *(APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target); typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params); @@ -4542,9 +4540,9 @@ GLAPI void APIENTRY glBindBufferARB (GLenum target, GLuint buffer); GLAPI void APIENTRY glDeleteBuffersARB (GLsizei n, const GLuint *buffers); GLAPI void APIENTRY glGenBuffersARB (GLsizei n, GLuint *buffers); GLAPI GLboolean APIENTRY glIsBufferARB (GLuint buffer); -GLAPI void APIENTRY glBufferDataARB (GLenum target, GLsizeiptrARB size, const void *data, GLenum usage); -GLAPI void APIENTRY glBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void *data); -GLAPI void APIENTRY glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, void *data); +GLAPI void APIENTRY glBufferDataARB (GLenum target, GLsizeiptr size, const void *data, GLenum usage); +GLAPI void APIENTRY glBufferSubDataARB (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); +GLAPI void APIENTRY glGetBufferSubDataARB (GLenum target, GLintptr offset, GLsizeiptr size, void *data); GLAPI void *APIENTRY glMapBufferARB (GLenum target, GLenum access); GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum target); GLAPI void APIENTRY glGetBufferParameterivARB (GLenum target, GLenum pname, GLint *params); @@ -10881,7 +10879,7 @@ GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint index, GLenum pname, GLuint #define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B #define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C typedef void (APIENTRYP PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot); -typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); +typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptr offset); typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); typedef void (APIENTRYP PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot); typedef void (APIENTRYP PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint *params); @@ -10894,7 +10892,7 @@ typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_ typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glBeginVideoCaptureNV (GLuint video_capture_slot); -GLAPI void APIENTRY glBindVideoCaptureStreamBufferNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); +GLAPI void APIENTRY glBindVideoCaptureStreamBufferNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptr offset); GLAPI void APIENTRY glBindVideoCaptureStreamTextureNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); GLAPI void APIENTRY glEndVideoCaptureNV (GLuint video_capture_slot); GLAPI void APIENTRY glGetVideoCaptureivNV (GLuint video_capture_slot, GLenum pname, GLint *params); diff --git a/panda/src/glxdisplay/glxGraphicsWindow.cxx b/panda/src/glxdisplay/glxGraphicsWindow.cxx index 2a8a44e819..7dd43c8675 100644 --- a/panda/src/glxdisplay/glxGraphicsWindow.cxx +++ b/panda/src/glxdisplay/glxGraphicsWindow.cxx @@ -174,7 +174,6 @@ open_window() { << "No X visual: cannot open window.\n"; return false; } - Visual *visual = _visual_info->visual; if (glxgsg->_fbconfig != None) { setup_colormap(glxgsg->_fbconfig); diff --git a/panda/src/gobj/geomEnums.h b/panda/src/gobj/geomEnums.h index 42af6bb0f1..7d55a797a1 100644 --- a/panda/src/gobj/geomEnums.h +++ b/panda/src/gobj/geomEnums.h @@ -128,6 +128,10 @@ PUBLISHED: // The union of the above shade model types. GR_shade_model_bits = 0x06000, + + // If a particular non-fill polygon mode is used. + GR_render_mode_wireframe= 0x40000, + GR_render_mode_point = 0x80000, }; // The shade model specifies whether the per-vertex colors and normals diff --git a/panda/src/gobj/geomVertexArrayData.h b/panda/src/gobj/geomVertexArrayData.h index 8058409cea..e52876d376 100644 --- a/panda/src/gobj/geomVertexArrayData.h +++ b/panda/src/gobj/geomVertexArrayData.h @@ -113,7 +113,7 @@ PUBLISHED: static void lru_epoch(); INLINE static VertexDataBook &get_book(); -#if PY_VERSION_HEX >= 0x02060000 +#ifdef HAVE_PYTHON EXTENSION(int __getbuffer__(PyObject *self, Py_buffer *view, int flags)); EXTENSION(int __getbuffer__(PyObject *self, Py_buffer *view, int flags) const); EXTENSION(void __releasebuffer__(PyObject *self, Py_buffer *view) const); diff --git a/panda/src/gobj/geomVertexArrayData_ext.cxx b/panda/src/gobj/geomVertexArrayData_ext.cxx index 1ddf599dfd..72b206c469 100644 --- a/panda/src/gobj/geomVertexArrayData_ext.cxx +++ b/panda/src/gobj/geomVertexArrayData_ext.cxx @@ -22,14 +22,13 @@ struct InternalBufferData { string _format; }; -#if PY_VERSION_HEX >= 0x02060000 /** * This is used to implement the buffer protocol, in order to allow efficient * access to the array data through a Python multiview object. */ int Extension:: __getbuffer__(PyObject *self, Py_buffer *view, int flags) { - +#if PY_VERSION_HEX >= 0x02060000 PT(GeomVertexArrayDataHandle) handle = _this->modify_handle(); CPT(GeomVertexArrayFormat) format = handle->get_array_format(); @@ -79,6 +78,9 @@ __getbuffer__(PyObject *self, Py_buffer *view, int flags) { view->suboffsets = NULL; return 0; +#else + return -1; +#endif } /** @@ -86,7 +88,7 @@ __getbuffer__(PyObject *self, Py_buffer *view, int flags) { */ int Extension:: __getbuffer__(PyObject *self, Py_buffer *view, int flags) const { - +#if PY_VERSION_HEX >= 0x02060000 if ((flags & PyBUF_WRITABLE) == PyBUF_WRITABLE) { PyErr_SetString(PyExc_BufferError, "Object is not writable."); @@ -142,6 +144,9 @@ __getbuffer__(PyObject *self, Py_buffer *view, int flags) const { view->suboffsets = NULL; return 0; +#else + return -1; +#endif } /** @@ -149,8 +154,8 @@ __getbuffer__(PyObject *self, Py_buffer *view, int flags) const { */ void Extension:: __releasebuffer__(PyObject *self, Py_buffer *view) const { +#if PY_VERSION_HEX >= 0x02060000 // Note: PyBuffer_Release automatically decrements view->obj. - InternalBufferData *data; data = (InternalBufferData *) view->internal; if (data == NULL) { @@ -158,10 +163,9 @@ __releasebuffer__(PyObject *self, Py_buffer *view) const { } delete data; view->internal = NULL; +#endif } -#endif // PY_VERSION_HEX >= 0x02060000 - /** * Copies all data from the given buffer object. The array is rescaled as * necessary. diff --git a/panda/src/gobj/geomVertexArrayData_ext.h b/panda/src/gobj/geomVertexArrayData_ext.h index d892ef5a2d..51649d5976 100644 --- a/panda/src/gobj/geomVertexArrayData_ext.h +++ b/panda/src/gobj/geomVertexArrayData_ext.h @@ -29,11 +29,9 @@ template<> class Extension : public ExtensionBase { public: -#if PY_VERSION_HEX >= 0x02060000 int __getbuffer__(PyObject *self, Py_buffer *view, int flags); int __getbuffer__(PyObject *self, Py_buffer *view, int flags) const; void __releasebuffer__(PyObject *self, Py_buffer *view) const; -#endif }; /** diff --git a/panda/src/gobj/matrixLens.cxx b/panda/src/gobj/matrixLens.cxx index f501e7c6d4..147870a954 100644 --- a/panda/src/gobj/matrixLens.cxx +++ b/panda/src/gobj/matrixLens.cxx @@ -14,6 +14,7 @@ #include "matrixLens.h" #include "indent.h" #include "bamReader.h" +#include "bamWriter.h" TypeHandle MatrixLens::_type_handle; diff --git a/panda/src/gobj/shader.I b/panda/src/gobj/shader.I index 166343f10d..fe74b2bda6 100644 --- a/panda/src/gobj/shader.I +++ b/panda/src/gobj/shader.I @@ -792,25 +792,3 @@ operator < (const Shader::ShaderFile &other) const { } return false; } - -/** - * Returns the filename of the included shader with the given source file - * index (as recorded in the #line statement in r_preprocess_source). We use - * this to associate error messages with included files. - */ -INLINE Filename Shader:: -get_filename_from_index(int index, ShaderType type) const { - if (index == 0) { - Filename fn = get_filename(type); - if (!fn.empty()) { - return fn; - } - } else if (glsl_preprocess && index >= 2048 && - (index - 2048) < (int)_included_files.size()) { - return _included_files[(size_t)index - 2048]; - } - // Must be a mistake. Quietly put back the integer. - char str[32]; - sprintf(str, "%d", index); - return Filename(str); -} diff --git a/panda/src/gobj/shader.cxx b/panda/src/gobj/shader.cxx index 4b7c396577..d9cf151e83 100644 --- a/panda/src/gobj/shader.cxx +++ b/panda/src/gobj/shader.cxx @@ -21,6 +21,7 @@ #include "virtualFileSystem.h" #include "config_util.h" #include "bamCache.h" +#include "string_utils.h" #ifdef HAVE_CG #include @@ -1625,11 +1626,11 @@ cg_compile_entry_point(const char *entry, const ShaderCaps &caps, compiler_args[nargs++] = "ATI_draw_buffers"; } - char version_arg[16]; + string version_arg; if (!cg_glsl_version.empty() && active != CG_PROFILE_UNKNOWN && cgGetProfileProperty((CGprofile) active, CG_IS_GLSL_PROFILE)) { - string version_arg("version="); + version_arg = "version="; version_arg += cg_glsl_version; compiler_args[nargs++] = "-po"; @@ -1764,6 +1765,69 @@ cg_compile_shader(const ShaderCaps &caps, CGcontext context) { return false; } + // This is present to work around a bug in the Cg compiler for Direct3D 9. + // It generates "texld_sat" instructions that the result in an + // D3DXERR_INVALIDDATA error when trying to load the shader, since the _sat + // modifier may not be used on tex* instructions. + if (_cg_fprofile == CG_PROFILE_PS_2_0 || + _cg_fprofile == CG_PROFILE_PS_2_X || + _cg_fprofile == CG_PROFILE_PS_3_0) { + vector_string lines; + tokenize(cgGetProgramString(_cg_fprogram, CG_COMPILED_PROGRAM), lines, "\n"); + + ostringstream out; + int num_modified = 0; + + for (size_t i = 0; i < lines.size(); ++i) { + const string &line = lines[i]; + + size_t space = line.find(' '); + if (space == string::npos) { + out << line << '\n'; + continue; + } + + string instr = line.substr(0, space); + + // Look for a texld instruction with _sat modifier. + if (instr.compare(0, 5, "texld") == 0 && + instr.compare(instr.size() - 4, 4, "_sat") == 0) { + // Which destination register are we operating on? + string reg = line.substr(space + 1, line.find(',', space) - space - 1); + + // Move the saturation operation to a separate instruction. + instr.resize(instr.size() - 4); + out << instr << ' ' << line.substr(space + 1) << '\n'; + out << "mov_sat " << reg << ", " << reg << '\n'; + ++num_modified; + } else { + out << line << '\n'; + } + } + + if (num_modified > 0) { + string result = out.str(); + CGprogram new_program; + new_program = cgCreateProgram(context, CG_OBJECT, result.c_str(), + (CGprofile)_cg_fprofile, "fshader", + (const char**)NULL); + if (new_program) { + cgDestroyProgram(_cg_fprogram); + _cg_fprogram = new_program; + + if (shader_cat.is_debug()) { + shader_cat.debug() + << "Replaced " << num_modified << " invalid texld_sat instruction" + << ((num_modified == 1) ? "" : "s") << " in compiled shader\n"; + } + } else { + shader_cat.warning() + << "Failed to load shader with fixed texld_sat instructions: " + << cgGetErrorString(cgGetError()) << "\n"; + } + } + } + // DEBUG: output the generated program if (shader_cat.is_debug()) { const char *vertex_program; @@ -1880,59 +1944,95 @@ cg_analyze_shader(const ShaderCaps &caps) { // Assign sequence numbers to all parameters. GLCgShaderContext relies on // the fact that the varyings start at seqno 0. int seqno = 0; - for (int i=0; i<(int)_var_spec.size(); i++) { + for (size_t i = 0; i < _var_spec.size(); ++i) { _var_spec[i]._id._seqno = seqno++; } - for (int i=0; i<(int)_mat_spec.size(); i++) { + for (size_t i = 0; i < _mat_spec.size(); ++i) { _mat_spec[i]._id._seqno = seqno++; } - for (int i=0; i<(int)_tex_spec.size(); i++) { + for (size_t i = 0; i < _tex_spec.size(); ++i) { _tex_spec[i]._id._seqno = seqno++; } - for (int i=0; i<(int)_ptr_spec.size(); i++) { + for (size_t i = 0; i < _ptr_spec.size(); ++i) { _ptr_spec[i]._id._seqno = seqno++; _ptr_spec[i]._info._id = _ptr_spec[i]._id; } -/* - * The following code is present to work around a bug in the Cg compiler. It - * does not generate correct code for shadow map lookups when using arbfp1. - * This is a particularly onerous limitation, given that arbfp1 is the only Cg - * target that works on radeons. I suspect this is an intentional omission on - * nvidia's part. The following code fetches the output listing, detects the - * error, repairs the code, and resumbits the repaired code to Cg. if - * ((_cg_fprofile == CG_PROFILE_ARBFP1) && (gsghint->_supports_shadow_filter)) - * { bool shadowunit[32]; bool anyshadow = false; memset(shadowunit, 0, - * sizeof(shadowunit)); vector_string lines; - * tokenize(cgGetProgramString(_cg_program[SHADER_type_frag], - * CG_COMPILED_PROGRAM), lines, "\n"); figure out which texture units contain - * shadow maps. for (int lineno=0; lineno<(int)lines.size(); lineno++) { if - * (lines[lineno].compare(0,21,"#var sampler2DSHADOW ")) { continue; } - * vector_string fields; tokenize(lines[lineno], fields, ":"); if - * (fields.size()!=5) { continue; } vector_string words; - * tokenize(trim(fields[2]), words, " "); if (words.size()!=2) { continue; } - * int unit = atoi(words[1].c_str()); if ((unit < 0)||(unit >= 32)) { - * continue; } anyshadow = true; shadowunit[unit] = true; } modify all TEX - * statements that use the relevant texture units. if (anyshadow) { for (int - * lineno=0; lineno<(int)lines.size(); lineno++) { if - * (lines[lineno].compare(0,4,"TEX ")) { continue; } vector_string fields; - * tokenize(lines[lineno], fields, ","); if - * ((fields.size()!=4)||(trim(fields[3]) != "2D;")) { continue; } - * vector_string texunitf; tokenize(trim(fields[2]), texunitf, "[]"); if - * ((texunitf.size()!=3)||(texunitf[0] != "texture")||(texunitf[2]!="")) { - * continue; } int unit = atoi(texunitf[1].c_str()); if ((unit < 0) || (unit - * >= 32) || (shadowunit[unit]==false)) { continue; } lines[lineno] = - * fields[0]+","+fields[1]+","+fields[2]+", SHADOW2D;"; } string result = - * "!!ARBfp1.0\nOPTION ARB_fragment_program_shadow;\n"; for (int lineno=1; - * lineno<(int)lines.size(); lineno++) { result += (lines[lineno] + "\n"); } - * _cg_program[2] = _cg_program[SHADER_type_frag]; - * _cg_program[SHADER_type_frag] = cgCreateProgram(_cg_context, CG_OBJECT, - * result.c_str(), _cg_profile[SHADER_type_frag], "fshader", (const - * char**)NULL); cg_report_errors(s->get_name(), _cg_context); if - * (_cg_program[SHADER_type_frag]==0) { release_resources(); return false; } } - * } - */ + /* + // The following code is present to work around a bug in the Cg compiler. + // It does not generate correct code for shadow map lookups when using arbfp1. + // This is a particularly onerous limitation, given that arbfp1 is the only + // Cg target that works on radeons. I suspect this is an intentional + // omission on nvidia's part. The following code fetches the output listing, + // detects the error, repairs the code, and resumbits the repaired code to Cg. + if ((_cg_fprofile == CG_PROFILE_ARBFP1) && (gsghint->_supports_shadow_filter)) { + bool shadowunit[32]; + bool anyshadow = false; + memset(shadowunit, 0, sizeof(shadowunit)); + vector_string lines; + tokenize(cgGetProgramString(_cg_program[SHADER_type_frag], + CG_COMPILED_PROGRAM), lines, "\n"); + // figure out which texture units contain shadow maps. + for (int lineno=0; lineno<(int)lines.size(); lineno++) { + if (lines[lineno].compare(0,21,"#var sampler2DSHADOW ")) { + continue; + } + vector_string fields; + tokenize(lines[lineno], fields, ":"); + if (fields.size()!=5) { + continue; + } + vector_string words; + tokenize(trim(fields[2]), words, " "); + if (words.size()!=2) { + continue; + } + int unit = atoi(words[1].c_str()); + if ((unit < 0)||(unit >= 32)) { + continue; + } + anyshadow = true; + shadowunit[unit] = true; + } + // modify all TEX statements that use the relevant texture units. + if (anyshadow) { + for (int lineno=0; lineno<(int)lines.size(); lineno++) { + if (lines[lineno].compare(0,4,"TEX ")) { + continue; + } + vector_string fields; + tokenize(lines[lineno], fields, ","); + if ((fields.size()!=4)||(trim(fields[3]) != "2D;")) { + continue; + } + vector_string texunitf; + tokenize(trim(fields[2]), texunitf, "[]"); + if ((texunitf.size()!=3)||(texunitf[0] != "texture")||(texunitf[2]!="")) { + continue; + } + int unit = atoi(texunitf[1].c_str()); + if ((unit < 0) || (unit >= 32) || (shadowunit[unit]==false)) { + continue; + } + lines[lineno] = fields[0]+","+fields[1]+","+fields[2]+", SHADOW2D;"; + } + string result = "!!ARBfp1.0\nOPTION ARB_fragment_program_shadow;\n"; + for (int lineno=1; lineno<(int)lines.size(); lineno++) { + result += (lines[lineno] + "\n"); + } + _cg_program[2] = _cg_program[SHADER_type_frag]; + _cg_program[SHADER_type_frag] = + cgCreateProgram(_cg_context, CG_OBJECT, result.c_str(), + _cg_profile[SHADER_type_frag], "fshader", (const char**)NULL); + cg_report_errors(s->get_name(), _cg_context); + if (_cg_program[SHADER_type_frag]==0) { + release_resources(); + return false; + } + } + } + */ cg_release_resources(); return true; @@ -2285,7 +2385,7 @@ do_read_source(string &into, const Filename &fn, BamCacheRecord *record) { /** * Loads a given GLSL file line by line, and processes any #pragma include and - * once statements. + * once statements, as well as removes any comments. * * The set keeps track of which files we have already included, for checking * recursive includes. @@ -2298,7 +2398,8 @@ r_preprocess_source(ostream &out, const Filename &fn, if (depth > glsl_include_recursion_limit) { shader_cat.error() - << "#pragma include nested too deeply\n"; + << "GLSL includes nested too deeply, raise glsl-include-recursion-limit" + " if necessary\n"; return false; } @@ -2359,56 +2460,226 @@ r_preprocess_source(ostream &out, const Filename &fn, // Iterate over the lines for things we may need to preprocess. string line; + int ext_google_include = 0; // 1 = warn, 2 = enable + int ext_google_line = 0; bool had_include = false; int lineno = 0; while (getline(*source, line)) { ++lineno; - // Check if this line contains a #pragma. - char pragma[64]; - if (line.size() < 8 || - sscanf(line.c_str(), " # pragma %63s", pragma) != 1) { - // Just pass the line through unmodified. - out << line << "\n"; - - // One exception: check for an #endif after an include. We have to - // restore the line number in case the include happened under an #if - // block. - int nread = 0; - if (had_include && sscanf(line.c_str(), " # endif %n", &nread) == 0 && nread >= 6) { - out << "#line " << (lineno + 1) << " " << fileno << "\n"; - } + if (line.empty()) { + out.put('\n'); continue; } - int nread = 0; - if (strcmp(pragma, "include") == 0) { - // Allow both double quotes and angle brackets. - Filename incfn, source_dir; - { - char incfile[2048]; - if (sscanf(line.c_str(), " # pragma%*[ \t]include \"%2047[^\"]\" %n", incfile, &nread) == 1 - && nread == line.size()) { - // A regular include, with double quotes. Probably a local file. - source_dir = full_fn.get_dirname(); - incfn = incfile; + // If the line ends with a backslash, concatenate the following line. + // Preprocessor definitions may be broken up into multiple lines. + while (line[line.size() - 1] == '\\') { + line.resize(line.size() - 1); + string line2; - } else if (sscanf(line.c_str(), " # pragma%*[ \t]include <%2047[^\"]> %n", incfile, &nread) == 1 - && nread == line.size()) { - // Angled includes are also OK, but we don't search in the directory - // of the source file. - incfn = incfile; + if (getline(*source, line2)) { + line += line2; + out.put('\n'); + ++lineno; + } else { + break; + } + } + // Look for comments to strip. This is necessary because comments may + // appear in the middle of or around a preprocessor definition. + size_t line_comment = line.find("//"); + size_t block_comment = line.find("/*"); + if (line_comment < block_comment) { + // A line comment - strip off the rest of the line. + line.resize(line_comment); + + } else if (block_comment < line_comment) { + // A block comment. Search for closing block. + string line2 = line.substr(block_comment + 2); + + // According to the GLSL specification, a block comment is replaced with + // a single whitespace character. + line.resize(block_comment); + line += ' '; + + size_t block_end = line2.find("*/"); + while (block_end == string::npos) { + // Didn't find it - look in the next line. + if (getline(*source, line2)) { + out.put('\n'); + ++lineno; + block_end = line2.find("*/"); } else { - // Couldn't parse it. shader_cat.error() - << "Malformed #pragma include at line " << lineno - << " of file " << fn << ":\n " << line << "\n"; + << "Expected */ before end of file " << fn << "\n"; return false; } } + line += line2.substr(block_end + 2); + } + + // Check if this line contains a #directive. + char directive[64]; + if (line.size() < 8 || sscanf(line.c_str(), " # %63s", directive) != 1) { + // Nope. Just pass the line through unmodified. + out << line << "\n"; + continue; + } + + char pragma[64]; + int nread = 0; + // What kind of directive is it? + if (strcmp(directive, "pragma") == 0 && + sscanf(line.c_str(), " # pragma %63s", pragma) == 1) { + if (strcmp(pragma, "include") == 0) { + // Allow both double quotes and angle brackets. + Filename incfn, source_dir; + { + char incfile[2048]; + if (sscanf(line.c_str(), " # pragma%*[ \t]include \"%2047[^\"]\" %n", incfile, &nread) == 1 + && nread == line.size()) { + // A regular include, with double quotes. Probably a local file. + source_dir = full_fn.get_dirname(); + incfn = incfile; + + } else if (sscanf(line.c_str(), " # pragma%*[ \t]include <%2047[^\"]> %n", incfile, &nread) == 1 + && nread == line.size()) { + // Angled includes are also OK, but we don't search in the directory + // of the source file. + incfn = incfile; + + } else { + // Couldn't parse it. + shader_cat.error() + << "Malformed #pragma include at line " << lineno + << " of file " << fn << ":\n " << line << "\n"; + return false; + } + } + + // OK, great. Process the include. + if (!r_preprocess_source(out, incfn, source_dir, once_files, record, depth + 1)) { + // An error occurred. Pass on the failure. + shader_cat.error(false) << "included at line " + << lineno << " of file " << fn << ":\n " << line << "\n"; + return false; + } + + // Restore the line counter. + out << "#line " << (lineno + 1) << " " << fileno << " // " << fn << "\n"; + had_include = true; + + } else if (strcmp(pragma, "once") == 0) { + // Do a stricter syntax check, just to be extra safe. + if (sscanf(line.c_str(), " # pragma%*[ \t]once %n", &nread) != 0 || + nread != line.size()) { + shader_cat.error() + << "Malformed #pragma once at line " << lineno + << " of file " << fn << ":\n " << line << "\n"; + return false; + } + + once_files.insert(full_fn); + + } else { + // Forward it, the driver will ignore it if it doesn't know it. + out << line << "\n"; + } + + } else if (strcmp(directive, "endif") == 0) { + // Check for an #endif after an include. We have to restore the line + // number in case the include happened under an #if block. + out << line << "\n"; + int nread = 0; + if (had_include) { + out << "#line " << (lineno + 1) << " " << fileno << "\n"; + } + + } else if (strcmp(directive, "extension") == 0) { + // Check for special preprocessing extensions. + char extension[256]; + char behavior[9]; + if (sscanf(line.c_str(), " # extension%*[ \t]%255s%*[ \t]:%*[ \t]%8s", extension, behavior) == 2) { + // Parse the behavior string. + int mode; + if (strcmp(behavior, "require") == 0 || strcmp(behavior, "enable") == 0) { + mode = 2; + } else if (strcmp(behavior, "warn") == 0) { + mode = 1; + } else if (strcmp(behavior, "disable") == 0) { + mode = 0; + } else { + shader_cat.error() + << "Extension directive specifies invalid behavior at line " + << lineno << " of file " << fn << ":\n " << line << "\n"; + return false; + } + + if (strcmp(extension, "all") == 0) { + if (mode == 2) { + shader_cat.error() + << "Extension directive for 'all' may only specify 'warn' or " + "'disable' at line " << lineno << " of file " << fn + << ":\n " << line << "\n"; + return false; + } + ext_google_include = mode; + ext_google_line = mode; + out << line << "\n"; + + } else if (strcmp(extension, "GL_GOOGLE_include_directive") == 0) { + // Enable the Google extension support for #include statements. + // This also implicitly enables GL_GOOGLE_cpp_style_line_directive. + // This matches the behavior of Khronos' glslang reference compiler. + ext_google_include = mode; + ext_google_line = mode; + + } else if (strcmp(extension, "GL_GOOGLE_cpp_style_line_directive") == 0) { + // Enables strings in #line statements. + ext_google_line = mode; + + } else { + // It's an extension the driver should worry about. + out << line << "\n"; + } + } else { + shader_cat.error() + << "Failed to parse extension directive at line " + << lineno << " of file " << fn << ":\n " << line << "\n"; + return false; + } + } else if (ext_google_include > 0 && strcmp(directive, "include") == 0) { + // Warn about extension use if requested. + if (ext_google_include == 1) { + shader_cat.warning() + << "Extension GL_GOOGLE_include_directive is being used at line " + << lineno << " of file " << fn +#ifndef NDEBUG + << ":\n " << line +#endif + << "\n"; + } + + // This syntax allows only double quotes, not angle brackets. + Filename incfn; + { + char incfile[2048]; + if (sscanf(line.c_str(), " # include%*[ \t]\"%2047[^\"]\" %n", incfile, &nread) != 1 + || nread != line.size()) { + // Couldn't parse it. + shader_cat.error() + << "Malformed #include at line " << lineno + << " of file " << fn << ":\n " << line << "\n"; + return false; + } + incfn = incfile; + } + // OK, great. Process the include. + Filename source_dir = full_fn.get_dirname(); if (!r_preprocess_source(out, incfn, source_dir, once_files, record, depth + 1)) { // An error occurred. Pass on the failure. shader_cat.error(false) << "included at line " @@ -2420,28 +2691,36 @@ r_preprocess_source(ostream &out, const Filename &fn, out << "#line " << (lineno + 1) << " " << fileno << " // " << fn << "\n"; had_include = true; - } else if (strcmp(pragma, "once") == 0) { - // Do a stricter syntax check, just to be extra safe. - if (sscanf(line.c_str(), " # pragma%*[ \t]once %n", &nread) != 0 || - nread != line.size()) { - shader_cat.error() - << "Malformed #pragma once at line " << lineno - << " of file " << fn << ":\n " << line << "\n"; - return false; + } else if (ext_google_line > 0 && strcmp(directive, "line") == 0) { + // It's a #line directive. See if it uses a string instead of number. + char filestr[2048]; + if (sscanf(line.c_str(), " # line%*[ \t]%d%*[ \t]\"%2047[^\"]\" %n", &lineno, filestr, &nread) == 2 + && nread == line.size()) { + // Warn about extension use if requested. + if (ext_google_line == 1) { + shader_cat.warning() + << "Extension GL_GOOGLE_cpp_style_line_directive is being used at line " + << lineno << " of file " << fn +#ifndef NDEBUG + << ":\n " << line +#endif + << "\n"; + } + + // Replace the string line number with an integer. This is something + // we can substitute later when parsing the GLSL log from the driver. + fileno = 2048 + _included_files.size(); + _included_files.push_back(Filename(filestr)); + + out << "#line " << lineno << " " << fileno << " // " << filestr << "\n"; + + } else { + // We couldn't parse the #line directive. Pass it through unmodified. + out << line << "\n"; } - - once_files.insert(full_fn); - - } else if (strcmp(pragma, "optionNV") == 0) { - // This is processed by NVIDIA drivers. Don't touch it. - out << line << "\n"; - } else { - // Forward it, the driver will ignore it if it doesn't know it. + // Different directive (eg. #version). Leave it untouched. out << line << "\n"; - shader_cat.warning() - << "Ignoring unknown pragma directive \"" << pragma << "\" at line " - << lineno << " of file " << fn << ":\n " << line << "\n"; } } @@ -2615,6 +2894,27 @@ Shader:: }*/ } +/** + * Returns the filename of the included shader with the given source file + * index (as recorded in the #line statement in r_preprocess_source). We use + * this to associate error messages with included files. + */ +Filename Shader:: +get_filename_from_index(int index, ShaderType type) const { + if (index == 0) { + Filename fn = get_filename(type); + if (!fn.empty()) { + return fn; + } + } else if (glsl_preprocess && index >= 2048 && + (index - 2048) < (int)_included_files.size()) { + return _included_files[(size_t)index - 2048]; + } + // Must be a mistake. Quietly put back the integer. + string str = format_string(index); + return Filename(str); +} + /** * Loads the shader with the given filename. */ diff --git a/panda/src/gobj/shader.h b/panda/src/gobj/shader.h index 106350066a..e7e843b9c6 100644 --- a/panda/src/gobj/shader.h +++ b/panda/src/gobj/shader.h @@ -556,10 +556,10 @@ public: #endif public: - pvector _ptr_spec; - epvector _mat_spec; - pvector _tex_spec; - pvector _var_spec; + pvector _ptr_spec; + epvector _mat_spec; + pvector _tex_spec; + pvector _var_spec; int _mat_deps; bool _error_flag; @@ -616,7 +616,7 @@ private: public: ~Shader(); - INLINE Filename get_filename_from_index(int index, ShaderType type) const; + Filename get_filename_from_index(int index, ShaderType type) const; public: static void register_with_read_factory(); diff --git a/panda/src/gobj/texture.I b/panda/src/gobj/texture.I index b608a39c00..47ce9e233f 100644 --- a/panda/src/gobj/texture.I +++ b/panda/src/gobj/texture.I @@ -2318,8 +2318,8 @@ get_unsigned_short(const unsigned char *&p) { } /** - * Returns true if the indicated filename ends in .txo or .txo.pz, false - * otherwise. + * Returns true if the indicated filename ends in .txo or .txo.pz or .txo.gz, + * false otherwise. */ INLINE bool Texture:: is_txo_filename(const Filename &fullpath) { @@ -2333,8 +2333,8 @@ is_txo_filename(const Filename &fullpath) { } /** - * Returns true if the indicated filename ends in .dds or .dds.pz, false - * otherwise. + * Returns true if the indicated filename ends in .dds or .dds.pz or .dds.gz, + * false otherwise. */ INLINE bool Texture:: is_dds_filename(const Filename &fullpath) { @@ -2347,6 +2347,21 @@ is_dds_filename(const Filename &fullpath) { return (downcase(extension) == "dds"); } +/** + * Returns true if the indicated filename ends in .ktx or .ktx.pz or .ktx.gz, + * false otherwise. + */ +INLINE bool Texture:: +is_ktx_filename(const Filename &fullpath) { + string extension = fullpath.get_extension(); +#ifdef HAVE_ZLIB + if (extension == "pz" || extension == "gz") { + extension = Filename(fullpath.get_basename_wo_extension()).get_extension(); + } +#endif // HAVE_ZLIB + return (downcase(extension) == "ktx"); +} + /** * */ diff --git a/panda/src/gobj/texture.cxx b/panda/src/gobj/texture.cxx index 8368dcf926..a3ce86c7dd 100644 --- a/panda/src/gobj/texture.cxx +++ b/panda/src/gobj/texture.cxx @@ -132,6 +132,231 @@ struct DDSHeader { DDSCaps2 caps; }; +// Stuff to read KTX files. +enum KTXType { + KTX_BYTE = 0x1400, + KTX_UNSIGNED_BYTE = 0x1401, + KTX_SHORT = 0x1402, + KTX_UNSIGNED_SHORT = 0x1403, + KTX_INT = 0x1404, + KTX_UNSIGNED_INT = 0x1405, + KTX_FLOAT = 0x1406, + KTX_HALF_FLOAT = 0x140B, + KTX_UNSIGNED_BYTE_3_3_2 = 0x8032, + KTX_UNSIGNED_SHORT_4_4_4_4 = 0x8033, + KTX_UNSIGNED_SHORT_5_5_5_1 = 0x8034, + KTX_UNSIGNED_INT_8_8_8_8 = 0x8035, + KTX_UNSIGNED_INT_10_10_10_2 = 0x8036, + KTX_UNSIGNED_BYTE_2_3_3_REV = 0x8362, + KTX_UNSIGNED_SHORT_5_6_5 = 0x8363, + KTX_UNSIGNED_SHORT_5_6_5_REV = 0x8364, + KTX_UNSIGNED_SHORT_4_4_4_4_REV = 0x8365, + KTX_UNSIGNED_SHORT_1_5_5_5_REV = 0x8366, + KTX_UNSIGNED_INT_8_8_8_8_REV = 0x8367, + KTX_UNSIGNED_INT_2_10_10_10_REV = 0x8368, + KTX_UNSIGNED_INT_24_8 = 0x84FA, + KTX_UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B, + KTX_UNSIGNED_INT_5_9_9_9_REV = 0x8C3E, + KTX_FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD, +}; + +enum KTXFormat { + KTX_ALPHA = 0x1906, + KTX_ALPHA12 = 0x803D, + KTX_ALPHA16 = 0x803E, + KTX_ALPHA16_SNORM = 0x9018, + KTX_ALPHA4 = 0x803B, + KTX_ALPHA8 = 0x803C, + KTX_ALPHA8_SNORM = 0x9014, + KTX_ALPHA_SNORM = 0x9010, + KTX_BGR = 0x80E0, + KTX_BGR_INTEGER = 0x8D9A, + KTX_BGRA = 0x80E1, + KTX_BGRA_INTEGER = 0x8D9B, + KTX_BLUE = 0x1905, + KTX_BLUE_INTEGER = 0x8D96, + KTX_COLOR_INDEX = 0x1900, + KTX_DEPTH24_STENCIL8 = 0x88F0, + KTX_DEPTH32F_STENCIL8 = 0x8CAD, + KTX_DEPTH_COMPONENT = 0x1902, + KTX_DEPTH_COMPONENT16 = 0x81A5, + KTX_DEPTH_COMPONENT24 = 0x81A6, + KTX_DEPTH_COMPONENT32 = 0x81A7, + KTX_DEPTH_COMPONENT32F = 0x8CAC, + KTX_DEPTH_STENCIL = 0x84F9, + KTX_GREEN = 0x1904, + KTX_GREEN_INTEGER = 0x8D95, + KTX_INTENSITY = 0x8049, + KTX_INTENSITY12 = 0x804C, + KTX_INTENSITY16 = 0x804D, + KTX_INTENSITY16_SNORM = 0x901B, + KTX_INTENSITY4 = 0x804A, + KTX_INTENSITY8 = 0x804B, + KTX_INTENSITY8_SNORM = 0x9017, + KTX_INTENSITY_SNORM = 0x9013, + KTX_LUMINANCE = 0x1909, + KTX_LUMINANCE12 = 0x8041, + KTX_LUMINANCE12_ALPHA12 = 0x8047, + KTX_LUMINANCE12_ALPHA4 = 0x8046, + KTX_LUMINANCE16 = 0x8042, + KTX_LUMINANCE16_ALPHA16 = 0x8048, + KTX_LUMINANCE16_ALPHA16_SNORM = 0x901A, + KTX_LUMINANCE16_SNORM = 0x9019, + KTX_LUMINANCE4 = 0x803F, + KTX_LUMINANCE4_ALPHA4 = 0x8043, + KTX_LUMINANCE6_ALPHA2 = 0x8044, + KTX_LUMINANCE8 = 0x8040, + KTX_LUMINANCE8_ALPHA8 = 0x8045, + KTX_LUMINANCE8_ALPHA8_SNORM = 0x9016, + KTX_LUMINANCE8_SNORM = 0x9015, + KTX_LUMINANCE_ALPHA = 0x190A, + KTX_LUMINANCE_ALPHA_SNORM = 0x9012, + KTX_LUMINANCE_SNORM = 0x9011, + KTX_R11F_G11F_B10F = 0x8C3A, + KTX_R16 = 0x822A, + KTX_R16_SNORM = 0x8F98, + KTX_R16F = 0x822D, + KTX_R16I = 0x8233, + KTX_R16UI = 0x8234, + KTX_R32F = 0x822E, + KTX_R32I = 0x8235, + KTX_R32UI = 0x8236, + KTX_R3_G3_B2 = 0x2A10, + KTX_R8 = 0x8229, + KTX_R8_SNORM = 0x8F94, + KTX_R8I = 0x8231, + KTX_R8UI = 0x8232, + KTX_RED = 0x1903, + KTX_RED_INTEGER = 0x8D94, + KTX_RED_SNORM = 0x8F90, + KTX_RG = 0x8227, + KTX_RG16 = 0x822C, + KTX_RG16_SNORM = 0x8F99, + KTX_RG16F = 0x822F, + KTX_RG16I = 0x8239, + KTX_RG16UI = 0x823A, + KTX_RG32F = 0x8230, + KTX_RG32I = 0x823B, + KTX_RG32UI = 0x823C, + KTX_RG8 = 0x822B, + KTX_RG8_SNORM = 0x8F95, + KTX_RG8I = 0x8237, + KTX_RG8UI = 0x8238, + KTX_RG_INTEGER = 0x8228, + KTX_RG_SNORM = 0x8F91, + KTX_RGB = 0x1907, + KTX_RGB10 = 0x8052, + KTX_RGB10_A2 = 0x8059, + KTX_RGB12 = 0x8053, + KTX_RGB16 = 0x8054, + KTX_RGB16_SNORM = 0x8F9A, + KTX_RGB16F = 0x881B, + KTX_RGB16I = 0x8D89, + KTX_RGB16UI = 0x8D77, + KTX_RGB2 = 0x804E, + KTX_RGB32F = 0x8815, + KTX_RGB32I = 0x8D83, + KTX_RGB32UI = 0x8D71, + KTX_RGB4 = 0x804F, + KTX_RGB5 = 0x8050, + KTX_RGB5_A1 = 0x8057, + KTX_RGB8 = 0x8051, + KTX_RGB8_SNORM = 0x8F96, + KTX_RGB8I = 0x8D8F, + KTX_RGB8UI = 0x8D7D, + KTX_RGB9_E5 = 0x8C3D, + KTX_RGB_INTEGER = 0x8D98, + KTX_RGB_SNORM = 0x8F92, + KTX_RGBA = 0x1908, + KTX_RGBA12 = 0x805A, + KTX_RGBA16 = 0x805B, + KTX_RGBA16_SNORM = 0x8F9B, + KTX_RGBA16F = 0x881A, + KTX_RGBA16I = 0x8D88, + KTX_RGBA16UI = 0x8D76, + KTX_RGBA2 = 0x8055, + KTX_RGBA32F = 0x8814, + KTX_RGBA32I = 0x8D82, + KTX_RGBA32UI = 0x8D70, + KTX_RGBA4 = 0x8056, + KTX_RGBA8 = 0x8058, + KTX_RGBA8_SNORM = 0x8F97, + KTX_RGBA8I = 0x8D8E, + KTX_RGBA8UI = 0x8D7C, + KTX_RGBA_INTEGER = 0x8D99, + KTX_RGBA_SNORM = 0x8F93, + KTX_SLUMINANCE = 0x8C46, + KTX_SLUMINANCE8 = 0x8C47, + KTX_SLUMINANCE8_ALPHA8 = 0x8C45, + KTX_SLUMINANCE_ALPHA = 0x8C44, + KTX_SRGB = 0x8C40, + KTX_SRGB8 = 0x8C41, + KTX_SRGB8_ALPHA8 = 0x8C43, + KTX_SRGB_ALPHA = 0x8C42, + KTX_STENCIL_INDEX = 0x1901, + KTX_STENCIL_INDEX1 = 0x8D46, + KTX_STENCIL_INDEX16 = 0x8D49, + KTX_STENCIL_INDEX4 = 0x8D47, + KTX_STENCIL_INDEX8 = 0x8D48, +}; + +enum KTXCompressedFormat { + KTX_COMPRESSED_LUMINANCE_ALPHA_LATC2 = 0x8C72, + KTX_COMPRESSED_LUMINANCE_LATC1 = 0x8C70, + KTX_COMPRESSED_R11_EAC = 0x9270, + KTX_COMPRESSED_RED = 0x8225, + KTX_COMPRESSED_RED_RGTC1 = 0x8DBB, + KTX_COMPRESSED_RG = 0x8226, + KTX_COMPRESSED_RG11_EAC = 0x9272, + KTX_COMPRESSED_RG_RGTC2 = 0x8DBD, + KTX_COMPRESSED_RGB = 0x84ED, + KTX_COMPRESSED_RGB8_ETC2 = 0x9274, + KTX_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276, + KTX_COMPRESSED_RGB_BPTC_SIGNED_FLOAT = 0x8E8E, + KTX_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT = 0x8E8F, + KTX_COMPRESSED_RGB_FXT1_3DFX = 0x86B0, + KTX_COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 0x8C01, + KTX_COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00, + KTX_COMPRESSED_RGB_S3TC_DXT1 = 0x83F0, + KTX_COMPRESSED_RGBA = 0x84EE, + KTX_COMPRESSED_RGBA8_ETC2_EAC = 0x9278, + KTX_COMPRESSED_RGBA_BPTC_UNORM = 0x8E8C, + KTX_COMPRESSED_RGBA_FXT1_3DFX = 0x86B1, + KTX_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8C03, + KTX_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG = 0x9137, + KTX_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8C02, + KTX_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG = 0x9138, + KTX_COMPRESSED_RGBA_S3TC_DXT1 = 0x83F1, + KTX_COMPRESSED_RGBA_S3TC_DXT3 = 0x83F2, + KTX_COMPRESSED_RGBA_S3TC_DXT5 = 0x83F3, + KTX_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2 = 0x8C73, + KTX_COMPRESSED_SIGNED_LUMINANCE_LATC1 = 0x8C71, + KTX_COMPRESSED_SIGNED_R11_EAC = 0x9271, + KTX_COMPRESSED_SIGNED_RED_RGTC1 = 0x8DBC, + KTX_COMPRESSED_SIGNED_RG11_EAC = 0x9273, + KTX_COMPRESSED_SIGNED_RG_RGTC2 = 0x8DBE, + KTX_COMPRESSED_SLUMINANCE = 0x8C4A, + KTX_COMPRESSED_SLUMINANCE_ALPHA = 0x8C4B, + KTX_COMPRESSED_SRGB = 0x8C48, + KTX_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279, + KTX_COMPRESSED_SRGB8_ETC2 = 0x9275, + KTX_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277, + KTX_COMPRESSED_SRGB_ALPHA = 0x8C49, + KTX_COMPRESSED_SRGB_ALPHA_BPTC_UNORM = 0x8E8D, + KTX_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1 = 0x8A56, + KTX_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV2 = 0x93F0, + KTX_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1 = 0x8A57, + KTX_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV2 = 0x93F1, + KTX_COMPRESSED_SRGB_ALPHA_S3TC_DXT1 = 0x8C4D, + KTX_COMPRESSED_SRGB_ALPHA_S3TC_DXT3 = 0x8C4E, + KTX_COMPRESSED_SRGB_ALPHA_S3TC_DXT5 = 0x8C4F, + KTX_COMPRESSED_SRGB_PVRTC_2BPPV1 = 0x8A54, + KTX_COMPRESSED_SRGB_PVRTC_4BPPV1 = 0x8A55, + KTX_COMPRESSED_SRGB_S3TC_DXT1 = 0x8C4C, + KTX_ETC1_RGB8 = 0x8D64, + KTX_ETC1_SRGB8 = 0x88EE, +}; + /** * Constructs an empty texture. The default is to set up the texture as an * empty 2-d texture; follow up with one of the variants of setup_texture() if @@ -709,6 +934,23 @@ read_dds(istream &in, const string &filename, bool header_only) { return do_read_dds(cdata, in, filename, header_only); } +/** + * Reads the texture from a KTX file object. This is a Khronos-defined file + * format; it is similar in principle to a dds object, in that it is designed + * to contain the texture image in a form as similar as possible to its + * runtime image, and it can contain mipmaps, pre-compressed textures, and so + * on. + * + * As with read_dds, the filename is just for reference. + */ +bool Texture:: +read_ktx(istream &in, const string &filename, bool header_only) { + CDWriter cdata(_cycler, true); + cdata->inc_properties_modified(); + cdata->inc_image_modified(); + return do_read_ktx(cdata, in, filename, header_only); +} + /** * Loads a texture whose filename is derived by concatenating a suffix to the * filename of this texture. May return NULL, for example, if this texture @@ -1412,6 +1654,10 @@ write(ostream &out, int indent_level) const { case TT_buffer_texture: out << "buffer, " << cdata->_x_size; break; + + case TT_1d_texture_array: + out << "1-d array, " << cdata->_x_size << " x " << cdata->_y_size; + break; } if (cdata->_num_views > 1) { @@ -1439,6 +1685,7 @@ write(ostream &out, int indent_level) const { case T_unsigned_int_24_8: case T_int: + case T_unsigned_int: out << " ints"; break; @@ -1810,6 +2057,8 @@ format_texture_type(TextureType tt) { return "cube_map_array"; case TT_buffer_texture: return "buffer_texture"; + case TT_1d_texture_array: + return "1d_texture_array"; } return "**invalid**"; } @@ -1862,6 +2111,8 @@ format_component_type(ComponentType ct) { return "short"; case T_half_float: return "half_float"; + case T_unsigned_int: + return "unsigned_int"; } return "**invalid**"; @@ -1888,6 +2139,8 @@ string_component_type(const string &str) { return T_short; } else if (cmp_nocase(str, "half_float") == 0) { return T_half_float; + } else if (cmp_nocase(str, "unsigned_int") == 0) { + return T_unsigned_int; } gobj_cat->error() @@ -1956,7 +2209,7 @@ format_format(Format format) { case F_r16: return "r16"; case F_r16i: - return "r16i"; + return "r16i"; case F_rg16: return "rg16"; case F_rgb16: @@ -2123,6 +2376,12 @@ format_compression_mode(CompressionMode cm) { return "pvr1_4bpp"; case CM_rgtc: return "rgtc"; + case CM_etc1: + return "etc1"; + case CM_etc2: + return "etc2"; + case CM_eac: + return "eac"; } return "**invalid**"; @@ -2158,6 +2417,12 @@ string_compression_mode(const string &str) { return CM_pvr1_4bpp; } else if (cmp_nocase_uh(str, "rgtc") == 0) { return CM_rgtc; + } else if (cmp_nocase_uh(str, "etc1") == 0) { + return CM_etc1; + } else if (cmp_nocase_uh(str, "etc2") == 0) { + return CM_etc2; + } else if (cmp_nocase_uh(str, "eac") == 0) { + return CM_eac; } gobj_cat->error() @@ -2272,7 +2537,8 @@ bool Texture:: is_unsigned(Texture::ComponentType ctype) { return (ctype == T_unsigned_byte || ctype == T_unsigned_short || - ctype == T_unsigned_int_24_8); + ctype == T_unsigned_int_24_8 || + ctype == T_unsigned_int); } /** @@ -2535,6 +2801,13 @@ do_read(CData *cdata, const Filename &fullpath, const Filename &alpha_fullpath, return do_read_dds_file(cdata, fullpath, header_only); } + if (is_ktx_filename(fullpath)) { + if (record != (BamCacheRecord *)NULL) { + record->add_dependent_file(fullpath); + } + return do_read_ktx_file(cdata, fullpath, header_only); + } + // If read_pages or read_mipmaps is specified, then z and n actually // indicate z_size and n_size, respectively--the numerical limits on which // to search for filenames. @@ -3374,7 +3647,7 @@ do_read_dds(CData *cdata, istream &in, const string &filename, bool header_only) unsigned int dimension = dds.get_uint32(); unsigned int misc_flag = dds.get_uint32(); unsigned int array_size = dds.get_uint32(); - unsigned int alpha_mode = dds.get_uint32(); + /*unsigned int alpha_mode = */dds.get_uint32(); switch (format) { case 2: // DXGI_FORMAT_R32G32B32A32_FLOAT @@ -3820,6 +4093,770 @@ do_read_dds(CData *cdata, istream &in, const string &filename, bool header_only) return true; } +/** + * Called internally when read() detects a KTX file. Assumes the lock is + * already held. + */ +bool Texture:: +do_read_ktx_file(CData *cdata, const Filename &fullpath, bool header_only) { + VirtualFileSystem *vfs = VirtualFileSystem::get_global_ptr(); + + Filename filename = Filename::binary_filename(fullpath); + PT(VirtualFile) file = vfs->get_file(filename); + if (file == (VirtualFile *)NULL) { + // No such file. + gobj_cat.error() + << "Could not find " << fullpath << "\n"; + return false; + } + + if (gobj_cat.is_debug()) { + gobj_cat.debug() + << "Reading KTX file " << filename << "\n"; + } + + istream *in = file->open_read_file(true); + bool success = do_read_ktx(cdata, *in, fullpath, header_only); + vfs->close_read_file(in); + + if (!has_name()) { + set_name(fullpath.get_basename_wo_extension()); + } + + cdata->_fullpath = fullpath; + cdata->_alpha_fullpath = Filename(); + cdata->_keep_ram_image = false; + + return success; +} + +/** + * + */ +bool Texture:: +do_read_ktx(CData *cdata, istream &in, const string &filename, bool header_only) { + StreamReader ktx(in); + + if (ktx.extract_bytes(12) != "\xABKTX 11\xBB\r\n\x1A\n") { + gobj_cat.error() + << filename << " is not a KTX file.\n"; + return false; + } + + // See: https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/ + uint32_t gl_type, type_size, gl_format, internal_format, gl_base_format, + width, height, depth, num_array_elements, num_faces, num_mipmap_levels, + kvdata_size; + + bool big_endian; + if (ktx.get_uint32() == 0x04030201) { + big_endian = false; + gl_type = ktx.get_uint32(); + type_size = ktx.get_uint32(); + gl_format = ktx.get_uint32(); + internal_format = ktx.get_uint32(); + gl_base_format = ktx.get_uint32(); + width = ktx.get_uint32(); + height = ktx.get_uint32(); + depth = ktx.get_uint32(); + num_array_elements = ktx.get_uint32(); + num_faces = ktx.get_uint32(); + num_mipmap_levels = ktx.get_uint32(); + kvdata_size = ktx.get_uint32(); + } else { + big_endian = true; + gl_type = ktx.get_be_uint32(); + type_size = ktx.get_be_uint32(); + gl_format = ktx.get_be_uint32(); + internal_format = ktx.get_be_uint32(); + gl_base_format = ktx.get_be_uint32(); + width = ktx.get_be_uint32(); + height = ktx.get_be_uint32(); + depth = ktx.get_be_uint32(); + num_array_elements = ktx.get_be_uint32(); + num_faces = ktx.get_be_uint32(); + num_mipmap_levels = ktx.get_be_uint32(); + kvdata_size = ktx.get_be_uint32(); + } + + // Skip metadata section. + ktx.skip_bytes(kvdata_size); + + ComponentType type; + CompressionMode compression; + Format format; + bool swap_bgr = false; + + if (gl_type == 0 || gl_format == 0) { + // Compressed texture. + if (gl_type > 0 || gl_format > 0) { + gobj_cat.error() + << "Compressed textures must have both type and format set to 0.\n"; + return false; + } + type = T_unsigned_byte; + compression = CM_on; + + KTXFormat base_format; + switch ((KTXCompressedFormat)internal_format) { + case KTX_COMPRESSED_RED: + format = F_red; + base_format = KTX_RED; + break; + case KTX_COMPRESSED_RG: + format = F_rg; + base_format = KTX_RG; + break; + case KTX_COMPRESSED_RGB: + format = F_rgb; + base_format = KTX_RGB; + break; + case KTX_COMPRESSED_RGBA: + format = F_rgba; + base_format = KTX_RGBA; + break; + case KTX_COMPRESSED_SRGB: + format = F_srgb; + base_format = KTX_SRGB; + break; + case KTX_COMPRESSED_SRGB_ALPHA: + format = F_srgb_alpha; + base_format = KTX_SRGB_ALPHA; + break; + case KTX_COMPRESSED_RGB_FXT1_3DFX: + format = F_rgb; + base_format = KTX_RGB; + compression = CM_fxt1; + break; + case KTX_COMPRESSED_RGBA_FXT1_3DFX: + format = F_rgba; + base_format = KTX_RGBA; + compression = CM_fxt1; + break; + case KTX_COMPRESSED_RGB_S3TC_DXT1: + format = F_rgb; + base_format = KTX_RGB; + compression = CM_dxt1; + break; + case KTX_COMPRESSED_RGBA_S3TC_DXT1: + format = F_rgbm; + base_format = KTX_RGB; + compression = CM_dxt1; + break; + case KTX_COMPRESSED_RGBA_S3TC_DXT3: + format = F_rgba; + base_format = KTX_RGBA; + compression = CM_dxt3; + break; + case KTX_COMPRESSED_RGBA_S3TC_DXT5: + format = F_rgba; + base_format = KTX_RGBA; + compression = CM_dxt5; + break; + case KTX_COMPRESSED_SRGB_ALPHA_S3TC_DXT1: + format = F_srgb_alpha; + base_format = KTX_SRGB_ALPHA; + compression = CM_dxt1; + break; + case KTX_COMPRESSED_SRGB_ALPHA_S3TC_DXT3: + format = F_srgb_alpha; + base_format = KTX_SRGB_ALPHA; + compression = CM_dxt3; + break; + case KTX_COMPRESSED_SRGB_ALPHA_S3TC_DXT5: + format = F_srgb_alpha; + base_format = KTX_SRGB_ALPHA; + compression = CM_dxt5; + break; + case KTX_COMPRESSED_SRGB_S3TC_DXT1: + format = F_srgb; + base_format = KTX_SRGB; + compression = CM_dxt1; + break; + case KTX_COMPRESSED_RED_RGTC1: + case KTX_COMPRESSED_SIGNED_RED_RGTC1: + format = F_red; + base_format = KTX_RED; + compression = CM_rgtc; + break; + case KTX_COMPRESSED_RG_RGTC2: + case KTX_COMPRESSED_SIGNED_RG_RGTC2: + format = F_rg; + base_format = KTX_RG; + compression = CM_rgtc; + break; + case KTX_ETC1_RGB8: + format = F_rgb; + base_format = KTX_RGB; + compression = CM_etc1; + break; + case KTX_ETC1_SRGB8: + format = F_srgb; + base_format = KTX_SRGB; + compression = CM_etc1; + break; + case KTX_COMPRESSED_RGB8_ETC2: + format = F_rgb; + base_format = KTX_RGB; + compression = CM_etc2; + break; + case KTX_COMPRESSED_SRGB8_ETC2: + format = F_srgb; + base_format = KTX_SRGB; + compression = CM_etc2; + break; + case KTX_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: + format = F_rgbm; + base_format = KTX_RGBA; + compression = CM_etc2; + break; + case KTX_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: + format = F_rgbm; + base_format = KTX_SRGB8_ALPHA8; + compression = CM_etc2; + break; + case KTX_COMPRESSED_RGBA8_ETC2_EAC: + format = F_rgba; + base_format = KTX_RGBA; + compression = CM_etc2; + break; + case KTX_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: + format = F_srgb_alpha; + base_format = KTX_SRGB8_ALPHA8; + compression = CM_etc2; + break; + case KTX_COMPRESSED_R11_EAC: + case KTX_COMPRESSED_SIGNED_R11_EAC: + format = F_red; + base_format = KTX_RED; + compression = CM_eac; + break; + case KTX_COMPRESSED_RG11_EAC: + case KTX_COMPRESSED_SIGNED_RG11_EAC: + format = F_rg; + base_format = KTX_RG; + compression = CM_eac; + break; + case KTX_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1: + format = F_srgb_alpha; + base_format = KTX_SRGB_ALPHA; + compression = CM_pvr1_2bpp; + break; + case KTX_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1: + format = F_srgb_alpha; + base_format = KTX_SRGB_ALPHA; + compression = CM_pvr1_4bpp; + break; + case KTX_COMPRESSED_RGBA_BPTC_UNORM: + case KTX_COMPRESSED_SRGB_ALPHA_BPTC_UNORM: + case KTX_COMPRESSED_RGB_BPTC_SIGNED_FLOAT: + case KTX_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT: + default: + gobj_cat.error() + << filename << " has unsupported compressed internal format " << internal_format << "\n"; + return false; + } + + if (base_format != gl_base_format) { + gobj_cat.error() + << filename << " has internal format that is incompatible with base " + "format (0x" << hex << gl_base_format << ", expected 0x" + << base_format << dec << ")\n"; + return false; + } + + } else { + // Uncompressed texture. + compression = CM_off; + switch ((KTXType)gl_type) { + case KTX_BYTE: + type = T_byte; + break; + case KTX_UNSIGNED_BYTE: + type = T_unsigned_byte; + break; + case KTX_SHORT: + type = T_short; + break; + case KTX_UNSIGNED_SHORT: + type = T_unsigned_short; + break; + case KTX_INT: + type = T_int; + break; + case KTX_UNSIGNED_INT: + type = T_unsigned_int; + break; + case KTX_FLOAT: + type = T_float; + break; + case KTX_HALF_FLOAT: + type = T_half_float; + break; + case KTX_UNSIGNED_INT_24_8: + type = T_unsigned_int_24_8; + break; + default: + gobj_cat.error() + << filename << " has unsupported component type " << gl_type << "\n"; + return false; + } + + if (gl_format != gl_base_format) { + gobj_cat.error() + << filename << " has mismatched formats: " << gl_format << " != " + << gl_base_format << "\n"; + } + + switch (gl_format) { + case KTX_DEPTH_COMPONENT: + switch (internal_format) { + case KTX_DEPTH_COMPONENT: + format = F_depth_component; + break; + case KTX_DEPTH_COMPONENT16: + format = F_depth_component16; + break; + case KTX_DEPTH_COMPONENT24: + format = F_depth_component24; + break; + case KTX_DEPTH_COMPONENT32: + case KTX_DEPTH_COMPONENT32F: + format = F_depth_component32; + break; + default: + format = F_depth_component; + gobj_cat.warning() + << filename << " has unsupported depth component format " << internal_format << "\n"; + } + break; + + case KTX_DEPTH_STENCIL: + format = F_depth_stencil; + if (internal_format != KTX_DEPTH_STENCIL && + internal_format != KTX_DEPTH24_STENCIL8) { + gobj_cat.warning() + << filename << " has unsupported depth stencil format " << internal_format << "\n"; + } + break; + + case KTX_RED: + switch (internal_format) { + case KTX_RED: + case KTX_RED_SNORM: + case KTX_R8: + case KTX_R8_SNORM: + format = F_red; + break; + case KTX_R16: + case KTX_R16_SNORM: + case KTX_R16F: + format = F_r16; + break; + case KTX_R32F: + format = F_r32; + break; + default: + format = F_red; + gobj_cat.warning() + << filename << " has unsupported red format " << internal_format << "\n"; + } + break; + + case KTX_RED_INTEGER: + switch (internal_format) { + case KTX_R8I: + case KTX_R8UI: + format = F_r8i; + break; + case KTX_R16I: + case KTX_R16UI: + format = F_r16i; + break; + case KTX_R32I: + case KTX_R32UI: + format = F_r32i; + break; + default: + gobj_cat.error() + << filename << " has unsupported red integer format " << internal_format << "\n"; + return false; + } + break; + + case KTX_GREEN: + format = F_green; + if (internal_format != KTX_GREEN) { + gobj_cat.warning() + << filename << " has unsupported green format " << internal_format << "\n"; + } + break; + + case KTX_BLUE: + format = F_blue; + if (internal_format != KTX_BLUE) { + gobj_cat.warning() + << filename << " has unsupported blue format " << internal_format << "\n"; + } + break; + + case KTX_RG: + switch (internal_format) { + case KTX_RG: + case KTX_RG_SNORM: + case KTX_RG8: + case KTX_RG8_SNORM: + format = F_rg; + break; + case KTX_RG16: + case KTX_RG16_SNORM: + case KTX_RG16F: + format = F_rg16; + break; + case KTX_RG32F: + format = F_rg32; + break; + default: + format = F_rg; + gobj_cat.warning() + << filename << " has unsupported RG format " << internal_format << "\n"; + } + break; + + case KTX_RG_INTEGER: + switch (internal_format) { + case KTX_RG8I: + case KTX_RG8UI: + format = F_rg8i; + break; + case KTX_RG16I: + case KTX_RG16UI: + case KTX_RG32I: + case KTX_RG32UI: + default: + gobj_cat.error() + << filename << " has unsupported RG integer format " << internal_format << "\n"; + return false; + } + break; + + case KTX_RGB: + swap_bgr = true; + case KTX_BGR: + switch (internal_format) { + case KTX_RGB: + case KTX_RGB_SNORM: + format = F_rgb; + break; + case KTX_RGB5: + format = F_rgb5; + break; + case KTX_RGB12: + format = F_rgb12; + break; + case KTX_R3_G3_B2: + format = F_rgb332; + break; + case KTX_RGB9_E5: + format = F_rgb9_e5; + break; + case KTX_R11F_G11F_B10F: + format = F_r11_g11_b10; + break; + case KTX_RGB8: + case KTX_RGB8_SNORM: + format = F_rgb8; + break; + case KTX_RGB16: + case KTX_RGB16_SNORM: + case KTX_RGB16F: + format = F_rgb16; + break; + case KTX_RGB32F: + format = F_rgb32; + break; + case KTX_SRGB: + case KTX_SRGB8: + format = F_srgb; + break; + default: + format = F_rgb; + gobj_cat.warning() + << filename << " has unsupported RGB format " << internal_format << "\n"; + } + break; + + case KTX_RGB_INTEGER: + swap_bgr = true; + case KTX_BGR_INTEGER: + switch (internal_format) { + case KTX_RGB8I: + case KTX_RGB8UI: + format = F_rgb8i; + break; + case KTX_RGB16I: + case KTX_RGB16UI: + case KTX_RGB32I: + case KTX_RGB32UI: + default: + gobj_cat.error() + << filename << " has unsupported RGB integer format " << internal_format << "\n"; + return false; + } + break; + + case KTX_RGBA: + swap_bgr = true; + case KTX_BGRA: + switch (internal_format) { + case KTX_RGBA: + case KTX_RGBA_SNORM: + format = F_rgba; + break; + case KTX_RGBA4: + format = F_rgba4; + break; + case KTX_RGB5_A1: + format = F_rgba5; + break; + case KTX_RGBA12: + format = F_rgba12; + break; + case KTX_RGB10_A2: + format = F_rgb10_a2; + break; + case KTX_RGBA8: + case KTX_RGBA8_SNORM: + format = F_rgba8; + break; + case KTX_RGBA16: + case KTX_RGBA16_SNORM: + case KTX_RGBA16F: + format = F_rgba16; + break; + case KTX_RGBA32F: + format = F_rgba32; + break; + case KTX_SRGB_ALPHA: + case KTX_SRGB8_ALPHA8: + format = F_srgb_alpha; + break; + default: + format = F_rgba; + gobj_cat.warning() + << filename << " has unsupported RGBA format " << internal_format << "\n"; + } + break; + break; + + case KTX_RGBA_INTEGER: + swap_bgr = true; + case KTX_BGRA_INTEGER: + switch (internal_format) { + case KTX_RGBA8I: + case KTX_RGBA8UI: + format = F_rgba8i; + break; + case KTX_RGBA16I: + case KTX_RGBA16UI: + case KTX_RGBA32I: + case KTX_RGBA32UI: + default: + gobj_cat.error() + << filename << " has unsupported RGBA integer format " << internal_format << "\n"; + return false; + } + break; + + case KTX_LUMINANCE: + format = F_luminance; + break; + + case KTX_LUMINANCE_ALPHA: + format = F_luminance_alpha; + break; + + case KTX_ALPHA: + format = F_alpha; + break; + + case KTX_STENCIL_INDEX: + default: + gobj_cat.error() + << filename << " has unsupported format " << gl_format << "\n"; + return false; + } + } + + TextureType texture_type; + if (depth > 0) { + texture_type = TT_3d_texture; + + } else if (num_faces > 1) { + if (num_faces != 6) { + gobj_cat.error() + << filename << " has " << num_faces << " cube map faces, expected 6\n"; + return false; + } + if (width != height) { + gobj_cat.error() + << filename << " is cube map, but does not have square dimensions\n"; + return false; + } + if (num_array_elements > 0) { + depth = num_array_elements * 6; + texture_type = TT_cube_map_array; + } else { + depth = 6; + texture_type = TT_cube_map; + } + + } else if (height > 0) { + if (num_array_elements > 0) { + depth = num_array_elements; + texture_type = TT_2d_texture_array; + } else { + depth = 1; + texture_type = TT_2d_texture; + } + + } else if (width > 0) { + depth = 1; + if (num_array_elements > 0) { + height = num_array_elements; + texture_type = TT_1d_texture_array; + } else { + height = 1; + texture_type = TT_1d_texture; + } + + } else { + gobj_cat.error() + << filename << " has zero size\n"; + return false; + } + + do_setup_texture(cdata, texture_type, width, height, depth, type, format); + + cdata->_orig_file_x_size = cdata->_x_size; + cdata->_orig_file_y_size = cdata->_y_size; + cdata->_compression = compression; + cdata->_ram_image_compression = compression; + + if (!header_only) { + bool generate_mipmaps = false; + if (num_mipmap_levels == 0) { + generate_mipmaps = true; + num_mipmap_levels = 1; + } + + for (uint32_t n = 0; n < num_mipmap_levels; ++n) { + uint32_t image_size; + if (big_endian) { + image_size = ktx.get_be_uint32(); + } else { + image_size = ktx.get_uint32(); + } + PTA_uchar image; + + if (compression == CM_off) { + uint32_t row_size = do_get_expected_mipmap_x_size(cdata, (int)n) * cdata->_num_components * cdata->_component_width; + uint32_t num_rows = do_get_expected_mipmap_y_size(cdata, (int)n) * do_get_expected_mipmap_z_size(cdata, (int)n); + uint32_t row_padded = (row_size + 3) & ~3; + + if (image_size == row_size * num_rows) { + if (row_padded != row_size) { + // Someone tightly packed the image. This is invalid, but because + // we like it tightly packed too, we'll read it anyway. + gobj_cat.warning() + << filename << " does not have proper row padding for mipmap " + "level " << n << "\n"; + } + image = PTA_uchar::empty_array(image_size); + ktx.extract_bytes(image.p(), image_size); + + } else if (image_size != row_padded * num_rows) { + gobj_cat.error() + << filename << " has invalid image size " << image_size + << " for mipmap level " << n << " (expected " + << row_padded * num_rows << ")\n"; + return false; + + } else { + // Read it row by row. + image = PTA_uchar::empty_array(row_size * num_rows); + uint32_t skip = row_padded - row_size; + unsigned char *p = image.p(); + for (uint32_t row = 0; row < num_rows; ++row) { + ktx.extract_bytes(p, row_size); + ktx.skip_bytes(skip); + p += row_size; + } + } + + // Swap red and blue channels if necessary to match Panda conventions. + if (swap_bgr) { + unsigned char *begin = image.p(); + const unsigned char *end = image.p() + image.size(); + size_t skip = cdata->_num_components; + nassertr(skip == 3 || skip == 4, false); + + switch (cdata->_component_width) { + case 1: + for (unsigned char *p = begin; p < end; p += skip) { + swap(p[0], p[2]); + } + break; + case 2: + for (short *p = (short *)begin; p < (short *)end; p += skip) { + swap(p[0], p[2]); + } + break; + case 4: + for (int *p = (int *)begin; p < (int *)end; p += skip) { + swap(p[0], p[2]); + } + break; + default: + nassertr(false, false); + break; + } + } + + do_set_ram_mipmap_image(cdata, (int)n, MOVE(image), + row_size * do_get_expected_mipmap_y_size(cdata, (int)n)); + + } else { + // Compressed image. We'll trust that the file has the right size. + image = PTA_uchar::empty_array(image_size); + ktx.extract_bytes(image.p(), image_size); + do_set_ram_mipmap_image(cdata, (int)n, MOVE(image), image_size / depth); + } + + ktx.skip_bytes(3 - ((image_size + 3) & 3)); + } + + cdata->_has_read_pages = true; + cdata->_has_read_mipmaps = true; + cdata->_num_mipmap_levels_read = cdata->_ram_images.size(); + + if (generate_mipmaps) { + do_generate_ram_mipmap_images(cdata, false); + } + } + + if (in.fail() || in.eof()) { + gobj_cat.error() + << filename << ": truncated KTX file.\n"; + return false; + } + + cdata->_loaded_from_image = true; + cdata->_loaded_from_txo = true; + + return true; +} + /** * Internal method to write a series of pages and/or mipmap levels to disk * files. @@ -4607,6 +5644,27 @@ do_get_clear_data(const CData *cdata, unsigned char *into) const { } break; } + + case T_unsigned_int: + { + // Note: there are no 32-bit UNORM textures. Therefore, we don't do any + // normalization here, either. + switch (cdata->_num_components) { + case 2: + ((unsigned int *)into)[1] = (unsigned int)cdata->_clear_color[1]; + case 1: + ((unsigned int *)into)[0] = (unsigned int)cdata->_clear_color[0]; + break; + case 4: + ((unsigned int *)into)[3] = (unsigned int)cdata->_clear_color[3]; + case 3: // BGR <-> RGB + ((unsigned int *)into)[0] = (unsigned int)cdata->_clear_color[2]; + ((unsigned int *)into)[1] = (unsigned int)cdata->_clear_color[1]; + ((unsigned int *)into)[2] = (unsigned int)cdata->_clear_color[0]; + break; + } + break; + } } return cdata->_num_components * cdata->_component_width; @@ -4692,18 +5750,24 @@ do_compress_ram_image(CData *cdata, Texture::CompressionMode compression, case Texture::F_rgb10_a2: if (gsg == NULL || gsg->get_supports_compressed_texture_format(CM_dxt1)) { compression = CM_dxt1; - } else if (gsg == NULL || gsg->get_supports_compressed_texture_format(CM_dxt3)) { + } else if (gsg->get_supports_compressed_texture_format(CM_dxt3)) { compression = CM_dxt3; - } else if (gsg == NULL || gsg->get_supports_compressed_texture_format(CM_dxt5)) { + } else if (gsg->get_supports_compressed_texture_format(CM_dxt5)) { compression = CM_dxt5; + } else if (gsg->get_supports_compressed_texture_format(CM_etc2)) { + compression = CM_etc2; + } else if (gsg->get_supports_compressed_texture_format(CM_etc1)) { + compression = CM_etc1; } break; case Texture::F_rgba4: if (gsg == NULL || gsg->get_supports_compressed_texture_format(CM_dxt3)) { compression = CM_dxt3; - } else if (gsg == NULL || gsg->get_supports_compressed_texture_format(CM_dxt5)) { + } else if (gsg->get_supports_compressed_texture_format(CM_dxt5)) { compression = CM_dxt5; + } else if (gsg->get_supports_compressed_texture_format(CM_etc2)) { + compression = CM_etc2; } break; @@ -4714,6 +5778,8 @@ do_compress_ram_image(CData *cdata, Texture::CompressionMode compression, case Texture::F_rgba32: if (gsg == NULL || gsg->get_supports_compressed_texture_format(CM_dxt5)) { compression = CM_dxt5; + } else if (gsg->get_supports_compressed_texture_format(CM_etc2)) { + compression = CM_etc2; } break; @@ -4721,6 +5787,8 @@ do_compress_ram_image(CData *cdata, Texture::CompressionMode compression, case Texture::F_rg: if (gsg == NULL || gsg->get_supports_compressed_texture_format(CM_rgtc)) { compression = CM_rgtc; + } else if (gsg->get_supports_compressed_texture_format(CM_eac)) { + compression = CM_eac; } break; @@ -4947,8 +6015,8 @@ do_compress_ram_image_bc4(const RamImage &uncompressed_image, // of the secondary interpolation mode supported by BC4. This is not // important for most textures, but it may be added in the future. - nassertv(x_blocks * y_blocks * 4 * 4 <= uncompressed_image._page_size); - nassertv(x_size * y_size == uncompressed_image._page_size); + nassertv((size_t)x_blocks * (size_t)y_blocks * 4 * 4 <= uncompressed_image._page_size); + nassertv((size_t)x_size * (size_t)y_size == uncompressed_image._page_size); static const int remap[] = {1, 7, 6, 5, 4, 3, 2, 0}; @@ -5046,8 +6114,8 @@ do_compress_ram_image_bc5(const RamImage &uncompressed_image, // BC5 uses the same compression algorithm as BC4, except repeated for two // channels. - nassertv(x_blocks * y_blocks * 4 * 4 * 2 <= uncompressed_image._page_size); - nassertv(stride * y_size == uncompressed_image._page_size); + nassertv((size_t)x_blocks * (size_t)y_blocks * 4 * 4 * 2 <= uncompressed_image._page_size); + nassertv((size_t)stride * (size_t)y_size == uncompressed_image._page_size); static const int remap[] = {1, 7, 6, 5, 4, 3, 2, 0}; @@ -5706,6 +6774,10 @@ do_setup_texture(CData *cdata, Texture::TextureType texture_type, case TT_buffer_texture: nassertv(y_size == 1 && z_size == 1); break; + + case TT_1d_texture_array: + nassertv(z_size == 1); + break; } if (texture_type != TT_2d_texture) { @@ -5822,14 +6894,9 @@ do_set_component_type(CData *cdata, Texture::ComponentType component_type) { break; case T_float: - cdata->_component_width = 4; - break; - case T_unsigned_int_24_8: - cdata->_component_width = 4; - break; - case T_int: + case T_unsigned_int: cdata->_component_width = 4; break; } @@ -6472,7 +7539,12 @@ do_generate_ram_mipmap_images(CData *cdata, bool allow_recompress) { // Now try to get the uncompressed source image. do_get_uncompressed_ram_image(cdata); - nassertv(cdata->_ram_image_compression == CM_off); + if (cdata->_ram_image_compression != CM_off) { + gobj_cat.error() + << "Cannot generate mipmap levels for image with compression " + << cdata->_ram_image_compression << "\n"; + return; + } } do_clear_ram_mipmap_images(cdata); @@ -8970,6 +10042,7 @@ make_this_from_bam(const FactoryParams ¶ms) { case TT_buffer_texture: case TT_1d_texture: case TT_2d_texture: + case TT_1d_texture_array: if (alpha_filename.empty()) { me = TexturePool::load_texture(filename, primary_file_num_channels, has_read_mipmaps, options); diff --git a/panda/src/gobj/texture.h b/panda/src/gobj/texture.h index 71d5784dcf..1f125fd7ce 100644 --- a/panda/src/gobj/texture.h +++ b/panda/src/gobj/texture.h @@ -40,7 +40,6 @@ #include "cycleDataStageWriter.h" #include "pipelineCycler.h" #include "samplerState.h" -#include "pnmImage.h" #include "colorSpace.h" #include "geomEnums.h" #include "bamCacheRecord.h" @@ -80,6 +79,7 @@ PUBLISHED: TT_cube_map, TT_buffer_texture, TT_cube_map_array, + TT_1d_texture_array, }; enum ComponentType { @@ -91,6 +91,7 @@ PUBLISHED: T_byte, T_short, T_half_float, + T_unsigned_int, }; enum Format { @@ -207,6 +208,9 @@ PUBLISHED: CM_pvr1_2bpp, CM_pvr1_4bpp, CM_rgtc, // BC4/BC5: 1 or 2 channels, individually compressed. + CM_etc1, + CM_etc2, + CM_eac, // EAC: 1 or 2 channels. }; enum QualityLevel { @@ -285,6 +289,7 @@ PUBLISHED: BLOCKING static PT(Texture) make_from_txo(istream &in, const string &filename = ""); BLOCKING bool write_txo(ostream &out, const string &filename = "") const; BLOCKING bool read_dds(istream &in, const string &filename = "", bool header_only = false); + BLOCKING bool read_ktx(istream &in, const string &filename = "", bool header_only = false); BLOCKING INLINE bool load(const PNMImage &pnmimage, const LoaderOptions &options = LoaderOptions()); BLOCKING INLINE bool load(const PNMImage &pnmimage, int z, int n, const LoaderOptions &options = LoaderOptions()); @@ -658,6 +663,8 @@ protected: bool do_read_txo(CData *cdata, istream &in, const string &filename); bool do_read_dds_file(CData *cdata, const Filename &fullpath, bool header_only); bool do_read_dds(CData *cdata, istream &in, const string &filename, bool header_only); + bool do_read_ktx_file(CData *cdata, const Filename &fullpath, bool header_only); + bool do_read_ktx(CData *cdata, istream &in, const string &filename, bool header_only); bool do_write(CData *cdata, const Filename &fullpath, int z, int n, bool write_pages, bool write_mipmaps); @@ -841,6 +848,7 @@ private: INLINE static bool is_txo_filename(const Filename &fullpath); INLINE static bool is_dds_filename(const Filename &fullpath); + INLINE static bool is_ktx_filename(const Filename &fullpath); void do_filter_2d_mipmap_pages(const CData *cdata, RamImage &to, const RamImage &from, diff --git a/panda/src/gobj/texturePeeker.I b/panda/src/gobj/texturePeeker.I index d41ee14db9..ccf6bdcc45 100644 --- a/panda/src/gobj/texturePeeker.I +++ b/panda/src/gobj/texturePeeker.I @@ -53,6 +53,6 @@ get_z_size() const { * Returns whether a given coordinate is inside of the texture dimensions. */ INLINE bool TexturePeeker:: -has_pixel(size_t x, size_t y) const { - return x < _x_size && y < _y_size; +has_pixel(int x, int y) const { + return x >= 0 && y >= 0 && x < _x_size && y < _y_size; } diff --git a/panda/src/gobj/texturePeeker.cxx b/panda/src/gobj/texturePeeker.cxx index cbe9003def..42e619e501 100644 --- a/panda/src/gobj/texturePeeker.cxx +++ b/panda/src/gobj/texturePeeker.cxx @@ -176,7 +176,7 @@ lookup(LColor &color, PN_stdfloat u, PN_stdfloat v) const { * coordinates are used. */ void TexturePeeker:: -fetch_pixel(LColor& color, size_t x, size_t y) const { +fetch_pixel(LColor& color, int x, int y) const { nassertv(x >= 0 && x < _x_size && y >= 0 && y < _y_size); const unsigned char *p = _image.p() + (y * _x_size + x) * _pixel_width; (*_get_texel)(color, p, _get_component); diff --git a/panda/src/gobj/texturePeeker.h b/panda/src/gobj/texturePeeker.h index e9af394dec..cb503bf041 100644 --- a/panda/src/gobj/texturePeeker.h +++ b/panda/src/gobj/texturePeeker.h @@ -36,10 +36,10 @@ PUBLISHED: INLINE int get_y_size() const; INLINE int get_z_size() const; - INLINE bool has_pixel(size_t x, size_t y) const; + INLINE bool has_pixel(int x, int y) const; void lookup(LColor &color, PN_stdfloat u, PN_stdfloat v) const; void lookup(LColor &color, PN_stdfloat u, PN_stdfloat v, PN_stdfloat w) const; - void fetch_pixel(LColor &color, size_t x, size_t y) const; + void fetch_pixel(LColor &color, int x, int y) const; bool lookup_bilinear(LColor &color, PN_stdfloat u, PN_stdfloat v) const; void filter_rect(LColor &color, PN_stdfloat min_u, PN_stdfloat min_v, diff --git a/panda/src/gobj/texturePool.cxx b/panda/src/gobj/texturePool.cxx index cf73364cde..5c05040d83 100644 --- a/panda/src/gobj/texturePool.cxx +++ b/panda/src/gobj/texturePool.cxx @@ -90,7 +90,7 @@ get_texture_type(const string &extension) const { // Check the PNM type registry. PNMFileTypeRegistry *pnm_reg = PNMFileTypeRegistry::get_global_ptr(); PNMFileType *type = pnm_reg->get_type_from_extension(c); - if (type != (PNMFileType *)NULL) { + if (type != (PNMFileType *)NULL || c == "txo" || c == "dds" || c == "ktx") { // This is a known image type; create an ordinary Texture. ((TexturePool *)this)->_type_registry[c] = Texture::make_texture; return Texture::make_texture; @@ -109,6 +109,11 @@ void TexturePool:: write_texture_types(ostream &out, int indent_level) const { MutexHolder holder(_lock); + // These are supported out of the box. + indent(out, indent_level) << "Texture Object .txo\n"; + indent(out, indent_level) << "DirectDraw Surface .dds\n"; + indent(out, indent_level) << "Khronos Texture .ktx\n"; + PNMFileTypeRegistry *pnm_reg = PNMFileTypeRegistry::get_global_ptr(); pnm_reg->write(out, indent_level); diff --git a/panda/src/grutil/multitexReducer.cxx b/panda/src/grutil/multitexReducer.cxx index ea300e7902..8481444a2d 100644 --- a/panda/src/grutil/multitexReducer.cxx +++ b/panda/src/grutil/multitexReducer.cxx @@ -756,17 +756,13 @@ make_texture_layer(const NodePath &render, case TextureStage::CM_modulate: { TextureStage::CombineSource source0 = stage_info._stage->get_combine_rgb_source0(); - TextureStage::CombineOperand operand0 = stage_info._stage->get_combine_rgb_operand0(); TextureStage::CombineSource source1 = stage_info._stage->get_combine_rgb_source1(); - TextureStage::CombineOperand operand1 = stage_info._stage->get_combine_rgb_operand1(); // Since modulate doesn't care about order, let's establish the // convention that the lowest-numbered source operand is in slot 0 // (just for purposes of comparison). if (source1 < source0) { source0 = stage_info._stage->get_combine_rgb_source1(); - operand0 = stage_info._stage->get_combine_rgb_operand1(); source1 = stage_info._stage->get_combine_rgb_source0(); - operand1 = stage_info._stage->get_combine_rgb_operand0(); } if (source0 == TextureStage::CS_primary_color && diff --git a/panda/src/grutil/pipeOcclusionCullTraverser.cxx b/panda/src/grutil/pipeOcclusionCullTraverser.cxx index ca4316c5cc..91ebeb6559 100644 --- a/panda/src/grutil/pipeOcclusionCullTraverser.cxx +++ b/panda/src/grutil/pipeOcclusionCullTraverser.cxx @@ -673,8 +673,6 @@ show_results(int num_fragments, const Geom *geom, TransparencyAttrib::make(TransparencyAttrib::M_alpha), ColorAttrib::make_flat(color)); - GraphicsStateGuardian *gsg = _buffer->get_gsg(); - CullableObject *internal_viz = new CullableObject(geom, state, internal_transform); _internal_cull_handler->record_object(internal_viz, _internal_trav); diff --git a/panda/src/grutil/shaderTerrainMesh.cxx b/panda/src/grutil/shaderTerrainMesh.cxx index 8e655de000..8c2d03cdd4 100644 --- a/panda/src/grutil/shaderTerrainMesh.cxx +++ b/panda/src/grutil/shaderTerrainMesh.cxx @@ -534,7 +534,7 @@ void ShaderTerrainMesh::add_for_draw(CullTraverser *trav, CullTraverserData &dat // After rendering, increment the view index ++_current_view_index; - if (_current_view_index > stm_max_views) { + if (_current_view_index > (size_t)stm_max_views) { shader_terrain_cat.error() << "More views than supported! Increase the stm-max-views config variable!" << endl; } diff --git a/panda/src/linmath/lvecBase2_src.I b/panda/src/linmath/lvecBase2_src.I index 7a8cddc5a0..9ddce8966c 100644 --- a/panda/src/linmath/lvecBase2_src.I +++ b/panda/src/linmath/lvecBase2_src.I @@ -393,9 +393,8 @@ INLINE_LINMATH size_t FLOATNAME(LVecBase2):: add_hash(size_t hash) const { TAU_PROFILE("size_t LVecBase2::add_hash(size_t)", " ", TAU_USER); #ifdef FLOATTYPE_IS_INT - int_hash ihasher; - hash = ihasher.add_hash(hash, _v(0)); - hash = ihasher.add_hash(hash, _v(1)); + hash = int_hash::add_hash(hash, _v(0)); + hash = int_hash::add_hash(hash, _v(1)); return hash; #else return add_hash(hash, NEARLY_ZERO(FLOATTYPE)); diff --git a/panda/src/linmath/lvecBase3_src.I b/panda/src/linmath/lvecBase3_src.I index ec9cc7be39..b7011da0ca 100644 --- a/panda/src/linmath/lvecBase3_src.I +++ b/panda/src/linmath/lvecBase3_src.I @@ -528,10 +528,9 @@ INLINE_LINMATH size_t FLOATNAME(LVecBase3):: add_hash(size_t hash) const { TAU_PROFILE("size_t LVecBase3::add_hash(size_t)", " ", TAU_USER); #ifdef FLOATTYPE_IS_INT - int_hash ihasher; - hash = ihasher.add_hash(hash, _v(0)); - hash = ihasher.add_hash(hash, _v(1)); - hash = ihasher.add_hash(hash, _v(2)); + hash = int_hash::add_hash(hash, _v(0)); + hash = int_hash::add_hash(hash, _v(1)); + hash = int_hash::add_hash(hash, _v(2)); return hash; #else return add_hash(hash, NEARLY_ZERO(FLOATTYPE)); diff --git a/panda/src/linmath/lvecBase4_src.I b/panda/src/linmath/lvecBase4_src.I index 6771e563ff..7890a6f8f0 100644 --- a/panda/src/linmath/lvecBase4_src.I +++ b/panda/src/linmath/lvecBase4_src.I @@ -521,11 +521,10 @@ INLINE_LINMATH size_t FLOATNAME(LVecBase4):: add_hash(size_t hash) const { TAU_PROFILE("size_t LVecBase4::add_hash(size_t)", " ", TAU_USER); #ifdef FLOATTYPE_IS_INT - int_hash ihasher; - hash = ihasher.add_hash(hash, _v(0)); - hash = ihasher.add_hash(hash, _v(1)); - hash = ihasher.add_hash(hash, _v(2)); - hash = ihasher.add_hash(hash, _v(3)); + hash = int_hash::add_hash(hash, _v(0)); + hash = int_hash::add_hash(hash, _v(1)); + hash = int_hash::add_hash(hash, _v(2)); + hash = int_hash::add_hash(hash, _v(3)); return hash; #else return add_hash(hash, NEARLY_ZERO(FLOATTYPE)); diff --git a/panda/src/movies/flacAudioCursor.cxx b/panda/src/movies/flacAudioCursor.cxx index 3ea294c7ce..839fc8724c 100644 --- a/panda/src/movies/flacAudioCursor.cxx +++ b/panda/src/movies/flacAudioCursor.cxx @@ -12,7 +12,9 @@ */ #include "flacAudioCursor.h" +#include "flacAudio.h" #include "virtualFileSystem.h" +#include "config_movies.h" #define DR_FLAC_IMPLEMENTATION #define DR_FLAC_NO_STDIO diff --git a/panda/src/nativenet/buffered_datagramconnection.cxx b/panda/src/nativenet/buffered_datagramconnection.cxx index 22bfab5215..b9abc6a406 100644 --- a/panda/src/nativenet/buffered_datagramconnection.cxx +++ b/panda/src/nativenet/buffered_datagramconnection.cxx @@ -13,10 +13,6 @@ #include "buffered_datagramconnection.h" -#ifdef HAVE_PYTHON -#include "py_panda.h" -#endif - TypeHandle Buffered_DatagramConnection::_type_handle; /** @@ -34,22 +30,6 @@ SendMessage(const Datagram &msg) { // Raise an exception to give us more information at the python level nativenet_cat.warning() << "Buffered_DatagramConnection::SendMessage->Error On Write--Out Buffer = " << _Writer.AmountBuffered() << "\n"; -#ifdef HAVE_PYTHON - ostringstream s; - -#if PY_VERSION_HEX >= 0x03030000 - PyObject *exc_type = PyExc_ConnectionError; -#else - PyObject *exc_type = PyExc_OSError; -#endif - - s << endl << "Error sending message: " << endl; - msg.dump_hex(s); - s << "Message data: " << msg.get_data() << endl; - - string message = s.str(); - PyErr_SetString(exc_type, message.c_str()); -#endif ClearAll(); } diff --git a/panda/src/nativenet/socket_address.I b/panda/src/nativenet/socket_address.I index cb36122c2a..87213df01d 100644 --- a/panda/src/nativenet/socket_address.I +++ b/panda/src/nativenet/socket_address.I @@ -11,6 +11,8 @@ * @date 2014-10-19 */ +#include "pnotify.h" + /** * Constructor that lets us set a port value */ diff --git a/panda/src/nativenet/time_clock.h b/panda/src/nativenet/time_clock.h index b02d4af01c..2c326fd7da 100644 --- a/panda/src/nativenet/time_clock.h +++ b/panda/src/nativenet/time_clock.h @@ -1,182 +1,176 @@ #ifndef __Time_H__ #define __Time_H__ -/** - * This class is to provide a consistant interface and storage to clock time - * .. Epoch based time to the second - * - * jan-2000 .. rhh changing all time to use sub second timing... - * - */ - #include class Time_Span; -class Time_Clock -{ - friend class Time_Span; +/** + * This class is to provide a consistant interface and storage to clock time + * .. Epoch based time to the second + * + * jan-2000 .. rhh changing all time to use sub second timing... + */ +class Time_Clock { + friend class Time_Span; public: - // Constructors - static Time_Clock GetCurrentTime(); - void ToCurrentTime(); - Time_Clock( timeval &in_mytime) - { - _my_time = in_mytime; - }; - Time_Clock(); - Time_Clock(time_t time); - Time_Clock(long secs, long usecs); - Time_Clock(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, long microseconds = 0, int nDST = -1); - Time_Clock(const Time_Clock& timeSrc); + // Constructors + static Time_Clock GetCurrentTime(); + void ToCurrentTime(); + inline Time_Clock(const timeval &in_mytime) { + _my_time = in_mytime; + } + Time_Clock(); + Time_Clock(time_t time); + Time_Clock(long secs, long usecs); + Time_Clock(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, long microseconds = 0, int nDST = -1); + Time_Clock(const Time_Clock& timeSrc); - inline const Time_Clock& operator=(const Time_Clock& timeSrc); - inline const Time_Clock& operator=(time_t t); + inline const Time_Clock &operator=(const Time_Clock& timeSrc); + inline const Time_Clock &operator=(time_t t); - // Attributes - struct tm* GetGmtTm(struct tm* ptm = NULL) const; - struct tm* GetLocalTm(struct tm* ptm = NULL) const; + // Attributes + struct tm *GetGmtTm(struct tm *ptm) const; + struct tm *GetLocalTm(struct tm *ptm) const; - time_t GetTime() const; - int GetYear() const; - int GetMonth() const; // month of year (1 = Jan) - int GetDay() const; // day of month - int GetHour() const; - int GetMinute() const; - int GetSecond() const; - int GetDayOfWeek() const; // 1=Sun, 2=Mon, ..., 7=Sat + time_t GetTime() const; + int GetYear() const; + int GetMonth() const; // month of year (1 = Jan) + int GetDay() const; // day of month + int GetHour() const; + int GetMinute() const; + int GetSecond() const; + int GetDayOfWeek() const; // 1=Sun, 2=Mon, ..., 7=Sat - void Set(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, long microseconds = 0, int nDST = -1); + void Set(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, long microseconds = 0, int nDST = -1); + // Operations time math + const Time_Clock& operator+=(const Time_Span &Time_Span); + const Time_Clock& operator-=(const Time_Span &Time_Span); + bool operator==(const Time_Clock &time) const; + bool operator!=(const Time_Clock &time) const; + bool operator<(const Time_Clock &time) const; + bool operator>(const Time_Clock &time) const; + bool operator<=(const Time_Clock &time) const; + bool operator>=(const Time_Clock &time) const; - // Operations time math - const Time_Clock& operator+=(const Time_Span &Time_Span); - const Time_Clock& operator-=(const Time_Span &Time_Span); - bool operator==(const Time_Clock &time) const; - bool operator!=(const Time_Clock &time) const; - bool operator<(const Time_Clock &time) const; - bool operator>(const Time_Clock &time) const; - bool operator<=(const Time_Clock &time) const; - bool operator>=(const Time_Clock &time) const; + inline time_t GetTime_t() { + return _my_time.tv_sec; + } + inline long GetUsecPart() { + return _my_time.tv_usec; + } + // formatting using "C" strftime + std::string Format(const char *pFormat) const; + std::string FormatGmt(const char *pFormat) const; - time_t GetTime_t() - { - return _my_time.tv_sec; - }; - long GetUsecPart() - { - return _my_time.tv_usec; - }; + const timeval &GetTval() { + return _my_time; + } + const timeval &GetTval() const { + return _my_time; + } - // formatting using "C" strftime - std::string Format(const char * pFormat) const; - std::string FormatGmt(const char * pFormat) const; - const timeval & GetTval() - { - return _my_time; - }; - const timeval & GetTval() const - { - return _my_time; - } ; - private: - struct timeval _my_time; +private: + struct timeval _my_time; }; /** * Construction from parts */ -inline Time_Clock::Time_Clock(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, long microseconds , int nDST) -{ - struct tm atm; - atm.tm_sec = nSec; - atm.tm_min = nMin; - atm.tm_hour = nHour; - assert(nDay >= 1 && nDay <= 31); - atm.tm_mday = nDay; - assert(nMonth >= 1 && nMonth <= 12); - atm.tm_mon = nMonth - 1; // tm_mon is 0 based - assert(nYear >= 1900); - atm.tm_year = nYear - 1900; // tm_year is 1900 based - atm.tm_isdst = nDST; - _my_time.tv_sec = (long)mktime(&atm); - assert(_my_time.tv_sec != -1); // indicates an illegal input time - _my_time.tv_usec = microseconds; - assert(_my_time.tv_usec < 1000000); +inline Time_Clock:: +Time_Clock(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, long microseconds, int nDST) { + struct tm atm; + atm.tm_sec = nSec; + atm.tm_min = nMin; + atm.tm_hour = nHour; + assert(nDay >= 1 && nDay <= 31); + atm.tm_mday = nDay; + assert(nMonth >= 1 && nMonth <= 12); + atm.tm_mon = nMonth - 1; // tm_mon is 0 based + assert(nYear >= 1900); + atm.tm_year = nYear - 1900; // tm_year is 1900 based + atm.tm_isdst = nDST; + _my_time.tv_sec = (long)mktime(&atm); + assert(_my_time.tv_sec != -1); // indicates an illegal input time + _my_time.tv_usec = microseconds; + assert(_my_time.tv_usec < 1000000); } + /** * */ -inline void Time_Clock::Set(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, long microseconds , int nDST) -{ - struct tm atm; - atm.tm_sec = nSec; - atm.tm_min = nMin; - atm.tm_hour = nHour; - assert(nDay >= 1 && nDay <= 31); - atm.tm_mday = nDay; - assert(nMonth >= 1 && nMonth <= 12); - atm.tm_mon = nMonth - 1; // tm_mon is 0 based - assert(nYear >= 1900); - atm.tm_year = nYear - 1900; // tm_year is 1900 based - atm.tm_isdst = nDST; - _my_time.tv_sec = (long)mktime(&atm); - assert(_my_time.tv_sec != -1); // indicates an illegal input time - _my_time.tv_usec = microseconds; - assert(_my_time.tv_usec < 1000000); +inline void Time_Clock:: +Set(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, long microseconds , int nDST) { + struct tm atm; + atm.tm_sec = nSec; + atm.tm_min = nMin; + atm.tm_hour = nHour; + assert(nDay >= 1 && nDay <= 31); + atm.tm_mday = nDay; + assert(nMonth >= 1 && nMonth <= 12); + atm.tm_mon = nMonth - 1; // tm_mon is 0 based + assert(nYear >= 1900); + atm.tm_year = nYear - 1900; // tm_year is 1900 based + atm.tm_isdst = nDST; + _my_time.tv_sec = (long)mktime(&atm); + assert(_my_time.tv_sec != -1); // indicates an illegal input time + _my_time.tv_usec = microseconds; + assert(_my_time.tv_usec < 1000000); } + /** * The Default no param constructor.. Will set time to current system time */ -inline Time_Clock Time_Clock::GetCurrentTime() -{ - return Time_Clock(); +inline Time_Clock Time_Clock:: +GetCurrentTime() { + return Time_Clock(); } + /** * */ -inline Time_Clock::Time_Clock() -{ - gettimeofday(&_my_time, NULL); +inline Time_Clock:: +Time_Clock() { + gettimeofday(&_my_time, NULL); } + /** * Load this object with the current OS time */ -inline void Time_Clock::ToCurrentTime() -{ - gettimeofday(&_my_time, NULL); +inline void Time_Clock:: +ToCurrentTime() { + gettimeofday(&_my_time, NULL); } + /** * Access the stored time and converts to a struct tm format If storage * location is specified then it will stor information in the provided buffer * else it will use the library's internal buffer space */ -inline struct tm* Time_Clock::GetGmtTm(struct tm* ptm) const -{ - if (ptm != NULL) - { - *ptm = *gmtime((const time_t *)&_my_time.tv_sec); - return ptm; - } else - return gmtime((const time_t *)&_my_time.tv_sec); +inline struct tm *Time_Clock:: +GetGmtTm(struct tm *ptm) const { + nassertr(ptm != NULL, NULL); +#ifdef _WIN32 + return (gmtime_s(ptm, (const time_t *)&_my_time.tv_sec) == 0) ? ptm : NULL; +#else + return gmtime_r((const time_t *)&_my_time.tv_sec, ptm); +#endif } /** * Gets The local time in a tm structre from the internal time value */ -inline struct tm* Time_Clock::GetLocalTm(struct tm* ptm) const -{ - if (ptm != NULL) - { - struct tm* ptmTemp = localtime((const time_t *)&_my_time.tv_sec); - if (ptmTemp == NULL) - return NULL; // indicates the _my_time.tv_sec was not initialized! - *ptm = *ptmTemp; - return ptm; - } else - return localtime((const time_t *)&_my_time.tv_sec); +inline struct tm *Time_Clock:: +GetLocalTm(struct tm *ptm) const { + nassertr(ptm != NULL, NULL); +#ifdef _WIN32 + return (localtime_s(ptm, (const time_t *)&_my_time.tv_sec) == 0) ? ptm : NULL; +#else + return localtime_r((const time_t *)&_my_time.tv_sec, ptm); +#endif } // String formatting Verifies will fail if the needed buffer size is too large #define maxTimeBufferSize 4096 @@ -184,235 +178,260 @@ inline struct tm* Time_Clock::GetLocalTm(struct tm* ptm) const /** * Used to allow access to the "C" library strftime functions.. */ -inline std::string Time_Clock::Format(const char * pFormat) const -{ +inline std::string Time_Clock:: +Format(const char *pFormat) const { + char szBuffer[maxTimeBufferSize]; + char ch, ch1; + char *pch = szBuffer; - char szBuffer[maxTimeBufferSize]; - char ch, ch1; - char * pch = szBuffer; - - while ((ch = *pFormat++) != '\0') - { - assert(pch < &szBuffer[maxTimeBufferSize]); - if (ch == '%') - { - switch (ch1 = *pFormat++) - { - default: - *pch++ = ch; - *pch++ = ch1; - break; - case 'N': - pch += sprintf(pch, "%03ld", (long)(_my_time.tv_usec / 1000)); - break; - } - } - else - { - *pch++ = ch; - } + while ((ch = *pFormat++) != '\0') { + assert(pch < &szBuffer[maxTimeBufferSize]); + if (ch == '%') { + switch (ch1 = *pFormat++) { + default: + *pch++ = ch; + *pch++ = ch1; + break; + case 'N': +#ifdef _WIN32 + pch += sprintf_s(pch, maxTimeBufferSize, "%03ld", (long)(_my_time.tv_usec / 1000)); +#else + pch += snprintf(pch, maxTimeBufferSize, "%03ld", (long)(_my_time.tv_usec / 1000)); +#endif + break; + } + } else { + *pch++ = ch; } + } - *pch = '\0'; + *pch = '\0'; - char szBuffer1[maxTimeBufferSize]; + char szBuffer1[maxTimeBufferSize]; - struct tm* ptmTemp = localtime((const time_t *)&_my_time.tv_sec); - if (ptmTemp == NULL || - !strftime(szBuffer1, sizeof(szBuffer1), szBuffer, ptmTemp)) - szBuffer1[0] = '\0'; - return std::string(szBuffer1); + struct tm tmTemp; + if (GetLocalTm(&tmTemp) == NULL || + !strftime(szBuffer1, sizeof(szBuffer1), szBuffer, &tmTemp)) { + szBuffer1[0] = '\0'; + } + return std::string(szBuffer1); } + /** * A Wraper to size_t strftime( char *strDest, size_t maxsize, const char * *format, const struct tm *timeptr ); * */ -inline std::string Time_Clock::FormatGmt(const char * pFormat) const -{ +inline std::string Time_Clock:: +FormatGmt(const char *pFormat) const { + char szBuffer[maxTimeBufferSize]; + char ch, ch1; + char *pch = szBuffer; - char szBuffer[maxTimeBufferSize]; - char ch, ch1; - char * pch = szBuffer; - - while ((ch = *pFormat++) != '\0') - { - assert(pch < &szBuffer[maxTimeBufferSize]); - if (ch == '%') - { - switch (ch1 = *pFormat++) - { - default: - *pch++ = ch; - *pch++ = ch1; - break; - case 'N': - pch += sprintf(pch, "%03ld", (long)(_my_time.tv_usec / 1000)); - break; - } - } - else - { - *pch++ = ch; - } + while ((ch = *pFormat++) != '\0') { + assert(pch < &szBuffer[maxTimeBufferSize]); + if (ch == '%') { + switch (ch1 = *pFormat++) { + default: + *pch++ = ch; + *pch++ = ch1; + break; + case 'N': +#ifdef _WIN32 + pch += sprintf_s(pch, maxTimeBufferSize, "%03ld", (long)(_my_time.tv_usec / 1000)); +#else + pch += snprintf(pch, maxTimeBufferSize, "%03ld", (long)(_my_time.tv_usec / 1000)); +#endif + break; + } + } else { + *pch++ = ch; } - *pch = '\0'; + } + *pch = '\0'; - char szBuffer1[maxTimeBufferSize]; + char szBuffer1[maxTimeBufferSize]; - struct tm* ptmTemp = gmtime((const time_t *)&_my_time.tv_sec); - if (ptmTemp == NULL || - !strftime(szBuffer1, sizeof(szBuffer1), szBuffer, ptmTemp)) - szBuffer1[0] = '\0'; - return std::string(szBuffer1); + struct tm tmTemp; + if (GetGmtTm(&tmTemp) == NULL || + !strftime(szBuffer1, sizeof(szBuffer1), szBuffer, &tmTemp)) { + szBuffer1[0] = '\0'; + } + return std::string(szBuffer1); } + /** * The Constructor that take a time_t objext */ -inline Time_Clock::Time_Clock(time_t time) -{ - _my_time.tv_sec = (long)time; - _my_time.tv_usec = 0; -}; +inline Time_Clock:: +Time_Clock(time_t time) { + _my_time.tv_sec = (long)time; + _my_time.tv_usec = 0; +} + /** * Constructor that takes in sec and usecs.. */ -inline Time_Clock::Time_Clock(long secs, long usecs) -{ - _my_time.tv_sec = secs; - _my_time.tv_usec = usecs; - NormalizeTime(_my_time); -}; +inline Time_Clock:: +Time_Clock(long secs, long usecs) { + _my_time.tv_sec = secs; + _my_time.tv_usec = usecs; + NormalizeTime(_my_time); +} + /** * yet another constructor */ -inline Time_Clock::Time_Clock(const Time_Clock& timeSrc) -{ - _my_time.tv_sec = timeSrc._my_time.tv_sec; - _my_time.tv_usec = timeSrc._my_time.tv_usec; +inline Time_Clock:: +Time_Clock(const Time_Clock& timeSrc) { + _my_time.tv_sec = timeSrc._my_time.tv_sec; + _my_time.tv_usec = timeSrc._my_time.tv_usec; } + /** * .. is time equal */ -inline bool Time_Clock::operator==(const Time_Clock &time) const -{ - return ((_my_time.tv_sec == time._my_time.tv_sec) && (_my_time.tv_usec == time._my_time.tv_usec)); +inline bool Time_Clock:: +operator==(const Time_Clock &time) const { + return ((_my_time.tv_sec == time._my_time.tv_sec) && (_my_time.tv_usec == time._my_time.tv_usec)); } + /** * .is time != */ -inline bool Time_Clock::operator!=(const Time_Clock &time) const -{ - return ((_my_time.tv_sec != time._my_time.tv_sec) || (_my_time.tv_usec != time._my_time.tv_usec)); +inline bool Time_Clock:: +operator!=(const Time_Clock &time) const { + return ((_my_time.tv_sec != time._my_time.tv_sec) || (_my_time.tv_usec != time._my_time.tv_usec)); } /** * */ -inline bool Time_Clock::operator<(const Time_Clock &time) const -{ - return ((_my_time.tv_sec < time._my_time.tv_sec) || - ((_my_time.tv_sec == time._my_time.tv_sec) && (_my_time.tv_usec < time._my_time.tv_usec))); +inline bool Time_Clock:: +operator<(const Time_Clock &time) const { + return ((_my_time.tv_sec < time._my_time.tv_sec) || + ((_my_time.tv_sec == time._my_time.tv_sec) && (_my_time.tv_usec < time._my_time.tv_usec))); } -/** - * - */ -inline bool Time_Clock::operator>(const Time_Clock &time) const -{ - return ((_my_time.tv_sec > time._my_time.tv_sec) || - ((_my_time.tv_sec == time._my_time.tv_sec) && (_my_time.tv_usec > time._my_time.tv_usec))); -} -/** - * - */ -inline bool Time_Clock::operator<=(const Time_Clock &time) const -{ - return ((_my_time.tv_sec < time._my_time.tv_sec) || - ((_my_time.tv_sec == time._my_time.tv_sec) && (_my_time.tv_usec <= time._my_time.tv_usec))); -} -/** - * - */ -inline bool Time_Clock::operator>=(const Time_Clock &time) const -{ - return ((_my_time.tv_sec > time._my_time.tv_sec) || - ((_my_time.tv_sec == time._my_time.tv_sec) && (_my_time.tv_usec >= time._my_time.tv_usec))); -} -/** - * - */ -inline const Time_Clock& Time_Clock::operator=(const Time_Clock& timeSrc) -{ - if (&timeSrc == this) - return * this; - _my_time = timeSrc._my_time; +/** + * + */ +inline bool Time_Clock:: +operator>(const Time_Clock &time) const { + return ((_my_time.tv_sec > time._my_time.tv_sec) || + ((_my_time.tv_sec == time._my_time.tv_sec) && (_my_time.tv_usec > time._my_time.tv_usec))); +} + +/** + * + */ +inline bool Time_Clock:: +operator<=(const Time_Clock &time) const { + return ((_my_time.tv_sec < time._my_time.tv_sec) || + ((_my_time.tv_sec == time._my_time.tv_sec) && (_my_time.tv_usec <= time._my_time.tv_usec))); +} + +/** + * + */ +inline bool Time_Clock:: +operator>=(const Time_Clock &time) const { + return ((_my_time.tv_sec > time._my_time.tv_sec) || + ((_my_time.tv_sec == time._my_time.tv_sec) && (_my_time.tv_usec >= time._my_time.tv_usec))); +} + +/** + * + */ +inline const Time_Clock& Time_Clock:: +operator=(const Time_Clock& timeSrc) { + if (&timeSrc == this) { return *this; + } + + _my_time = timeSrc._my_time; + return *this; } + /** * */ -inline const Time_Clock& Time_Clock::operator=(time_t t) -{ - _my_time.tv_sec = (long)t; - _my_time.tv_usec = 0; - return *this; +inline const Time_Clock& Time_Clock:: +operator=(time_t t) { + _my_time.tv_sec = (long)t; + _my_time.tv_usec = 0; + return *this; } + /** * */ -inline time_t Time_Clock::GetTime() const -{ - return _my_time.tv_sec; +inline time_t Time_Clock:: +GetTime() const { + return _my_time.tv_sec; } + /** * */ -inline int Time_Clock::GetYear() const -{ - return (GetLocalTm(NULL)->tm_year) + 1900; +inline int Time_Clock:: +GetYear() const { + struct tm atm; + return (GetLocalTm(&atm)->tm_year) + 1900; } + /** * */ -inline int Time_Clock::GetMonth() const -{ - return GetLocalTm(NULL)->tm_mon + 1; +inline int Time_Clock:: +GetMonth() const { + struct tm atm; + return GetLocalTm(&atm)->tm_mon + 1; } + /** * */ -inline int Time_Clock::GetDay() const -{ - return GetLocalTm(NULL)->tm_mday; +inline int Time_Clock:: +GetDay() const { + struct tm atm; + return GetLocalTm(&atm)->tm_mday; } + /** * */ -inline int Time_Clock::GetHour() const -{ - return GetLocalTm(NULL)->tm_hour; +inline int Time_Clock:: +GetHour() const { + struct tm atm; + return GetLocalTm(&atm)->tm_hour; } + /** * */ -inline int Time_Clock::GetMinute() const -{ - return GetLocalTm(NULL)->tm_min; +inline int Time_Clock:: +GetMinute() const { + struct tm atm; + return GetLocalTm(&atm)->tm_min; } + /** * */ -inline int Time_Clock::GetSecond() const -{ - return GetLocalTm(NULL)->tm_sec; +inline int Time_Clock:: +GetSecond() const { + struct tm atm; + return GetLocalTm(&atm)->tm_sec; } + /** * */ -inline int Time_Clock::GetDayOfWeek() const -{ - return GetLocalTm(NULL)->tm_wday + 1; +inline int Time_Clock:: +GetDayOfWeek() const { + struct tm atm; + return GetLocalTm(&atm)->tm_wday + 1; } #endif //__Time_H__ diff --git a/panda/src/nativenet/time_general.h b/panda/src/nativenet/time_general.h index cb7a756ea9..5fac081a32 100644 --- a/panda/src/nativenet/time_general.h +++ b/panda/src/nativenet/time_general.h @@ -1,128 +1,82 @@ #ifndef __TIME_GENERAL_H__ #define __TIME_GENERAL_H__ - Time_Span TimeDifference(const Time_Clock &time1, const Time_Clock &time2); -Time_Clock TimeDifference( const Time_Clock &time1, const Time_Span &Time_Span); +Time_Clock TimeDifference(const Time_Clock &time1, const Time_Span &Time_Span); Time_Clock TimeAddition(const Time_Clock &time1, Time_Span &Time_Span); - Time_Clock operator+(const Time_Clock &tm, const Time_Span &ts); Time_Clock operator-(const Time_Clock &tm, const Time_Span &ts); - -bool SetFromTimeStr(const char * str, Time_Clock & outtime); -std::string GetTimeStr(const Time_Clock & intime); +/** + * + */ +inline Time_Span TimeDifference(const Time_Clock &time1, const Time_Clock &time2) { + timeval ans; + TimeDif(time2.GetTval(), time1.GetTval(), ans); + return Time_Span(ans); +} /** * */ -inline Time_Span TimeDifference(const Time_Clock &time1, const Time_Clock &time2) -{ - timeval ans; - TimeDif(time2.GetTval(), time1.GetTval(), ans); - return Time_Span(ans); -} -/** - * - */ -inline Time_Clock TimeDifference( const Time_Clock &time1, const Time_Span &Time_Span) -{ - timeval ans; - TimeDif(Time_Span.GetTval(), time1.GetTval(), ans); - return Time_Clock(ans); +inline Time_Clock TimeDifference(const Time_Clock &time1, const Time_Span &Time_Span) { + timeval ans; + TimeDif(Time_Span.GetTval(), time1.GetTval(), ans); + return Time_Clock(ans); } + /** * */ inline Time_Clock TimeAddition(const Time_Clock &time1, Time_Span &Time_Span) { - timeval ans; - TimeAdd(time1.GetTval(), Time_Span.GetTval(), ans); - return Time_Clock(ans); + timeval ans; + TimeAdd(time1.GetTval(), Time_Span.GetTval(), ans); + return Time_Clock(ans); } -/** - * - */ -inline const Time_Clock& Time_Clock::operator+=(const Time_Span &Time_Span) -{ - _my_time.tv_usec += Time_Span._my_time.tv_usec; - _my_time.tv_sec += Time_Span._my_time.tv_sec; - NormalizeTime(_my_time); - return *this; -} -/** - * - */ -inline Time_Clock operator+(const Time_Clock &tm, const Time_Span &ts) -{ - Time_Clock work(tm); - work += ts; - return work; -} -/** - * - */ -inline Time_Clock operator-(const Time_Clock &tm, const Time_Span &ts) -{ - return TimeDifference(tm, ts); -} -/** - * - */ -inline const Time_Clock& Time_Clock::operator-=(const Time_Span &Time_Span) -{ - _my_time.tv_usec -= Time_Span._my_time.tv_usec; - _my_time.tv_sec -= Time_Span._my_time.tv_sec; - NormalizeTime(_my_time); - return *this; -} -/** - * - */ -inline Time_Span operator-(const Time_Clock &tm1, const Time_Clock &tm2) -{ - return TimeDifference(tm1, tm2); -} -/** - * - */ -inline std::string GetTimeStr(const Time_Clock & intime) -{ - static std::string ts; - static Time_Clock prev_time; - if (prev_time != intime || ts.empty()) - { - ts = intime.Format("%Y-%m-%d %H:%M:%S"); - prev_time = intime; - } - return ts; -} /** * */ -inline std::string GetTimeStr() -{ - return GetTimeStr(Time_Clock::GetCurrentTime()); +inline const Time_Clock &Time_Clock::operator+=(const Time_Span &Time_Span) { + _my_time.tv_usec += Time_Span._my_time.tv_usec; + _my_time.tv_sec += Time_Span._my_time.tv_sec; + NormalizeTime(_my_time); + return *this; } + /** * */ -inline bool SetFromTimeStr(const char * str, Time_Clock & outtime) -{ - int year = 0; - int month = 0; - int day = 0; - int hour = 0; - int min = 0; - int sec = 0; +inline Time_Clock operator+(const Time_Clock &tm, const Time_Span &ts) { + Time_Clock work(tm); + work += ts; + return work; +} - if (sscanf(str, "%d-%d-%d %d:%d:%d", &year, &month, &day, &hour, &min, &sec) != 6) - return false; +/** + * + */ +inline Time_Clock operator-(const Time_Clock &tm, const Time_Span &ts) { + return TimeDifference(tm, ts); +} - outtime.Set(year, month, day, hour, min, sec); - return true; +/** + * + */ +inline const Time_Clock& Time_Clock::operator-=(const Time_Span &Time_Span) { + _my_time.tv_usec -= Time_Span._my_time.tv_usec; + _my_time.tv_sec -= Time_Span._my_time.tv_sec; + NormalizeTime(_my_time); + return *this; +} + +/** + * + */ +inline Time_Span operator-(const Time_Clock &tm1, const Time_Clock &tm2) { + return TimeDifference(tm1, tm2); } #endif //__TIME_GENERAL_H__ diff --git a/panda/src/nativenet/time_span.h b/panda/src/nativenet/time_span.h index f27d7401ab..4633ffef3c 100644 --- a/panda/src/nativenet/time_span.h +++ b/panda/src/nativenet/time_span.h @@ -1,360 +1,376 @@ #ifndef __TIME_SPAN_H__ #define __TIME_SPAN_H__ + /** * */ -class Time_Span -{ +class Time_Span { public: - // Constructors - Time_Span() - { - } + // Constructors + Time_Span() {} - Time_Span(struct timeval time) - { - _my_time = time;NormalizeTime(_my_time); - } + Time_Span(struct timeval time) { + _my_time = time; + NormalizeTime(_my_time); + } - Time_Span(time_t time); - Time_Span(long lDays, int nHours, int nMins, int nSecs, int usecs); - Time_Span(long seconds, int usecs ) ; - Time_Span(const Time_Span& Time_SpanSrc); - Time_Span(const Time_Clock& Time_SpanSrc); - Time_Span(PN_stdfloat Seconds); + Time_Span(time_t time); + Time_Span(long lDays, int nHours, int nMins, int nSecs, int usecs); + Time_Span(long seconds, int usecs); + Time_Span(const Time_Span &Time_SpanSrc); + Time_Span(const Time_Clock &Time_SpanSrc); + Time_Span(PN_stdfloat Seconds); + const Time_Span &operator=(const Time_Span &Time_SpanSrc); - const Time_Span& operator=(const Time_Span& Time_SpanSrc); + // Attributes extract parts + long GetDays() const; // total # of days + long GetTotalHours() const; + int GetHours() const; + long GetTotalMinutes() const; + int GetMinutes() const; + long GetTotalSeconds() const; + int GetSeconds() const; + long GetTotalMSeconds() const; + long GetTotal100Seconds() const; + long GetMSeconds() const; - // Attributes extract parts - long GetDays() const; // total # of days - long GetTotalHours() const; - int GetHours() const; - long GetTotalMinutes() const; - int GetMinutes() const; - long GetTotalSeconds() const; - int GetSeconds() const; - long GetTotalMSeconds() const; - long GetTotal100Seconds() const; - long GetMSeconds() const; + // Operations time math + const Time_Span &operator+=(Time_Span &Time_Span); + const Time_Span &operator-=(Time_Span &Time_Span); + bool operator==(Time_Span &Time_Span) const; + bool operator!=(Time_Span &Time_Span) const; + bool operator<(Time_Span &Time_Span) const; + bool operator>(Time_Span &Time_Span) const; + bool operator<=(Time_Span &Time_Span) const; + bool operator>=(Time_Span &Time_Span) const; + const timeval &GetTval() const { + return _my_time; + } - // Operations time math - const Time_Span& operator+=(Time_Span &Time_Span); - const Time_Span& operator-=(Time_Span &Time_Span); - bool operator==(Time_Span &Time_Span) const; - bool operator!=(Time_Span &Time_Span) const; - bool operator<(Time_Span &Time_Span) const; - bool operator>(Time_Span &Time_Span) const; - bool operator<=(Time_Span &Time_Span) const; - bool operator>=(Time_Span &Time_Span) const; - const timeval & GetTval() const - { - return _my_time; - } + void Set(long lDays, int nHours, int nMins, int nSecs, int usecs); + std::string Format(char *pFormat) const; - void Set(long lDays, int nHours, int nMins, int nSecs, int usecs); - - std::string Format(char *pFormat) const; private: - struct timeval _my_time; - friend class Time_Clock; + struct timeval _my_time; + friend class Time_Clock; }; + /** * */ -inline Time_Span::Time_Span(long seconds, int usecs) -{ - _my_time.tv_sec = seconds; - _my_time.tv_usec = usecs; - NormalizeTime(_my_time); +inline Time_Span:: +Time_Span(long seconds, int usecs) { + _my_time.tv_sec = seconds; + _my_time.tv_usec = usecs; + NormalizeTime(_my_time); } + /** * */ -inline Time_Span::Time_Span(time_t time) -{ - _my_time.tv_usec = 0; - _my_time.tv_sec = (long)time; +inline Time_Span:: +Time_Span(time_t time) { + _my_time.tv_usec = 0; + _my_time.tv_sec = (long)time; } + /** * */ -inline Time_Span::Time_Span(PN_stdfloat Seconds) -{ - _my_time.tv_sec = (long)Seconds; // this truncats .. desired result.. - _my_time.tv_usec = (long)((Seconds - (double)_my_time.tv_sec) * (double)USEC); +inline Time_Span:: +Time_Span(PN_stdfloat Seconds) { + _my_time.tv_sec = (long)Seconds; // this truncats .. desired result.. + _my_time.tv_usec = (long)((Seconds - (double)_my_time.tv_sec) * (double)USEC); } + /** * */ -inline Time_Span::Time_Span(long lDays, int nHours, int nMins, int nSecs, int usecs) -{ - _my_time.tv_sec = nSecs + 60 * (nMins + 60 * (nHours + 24 * lDays)); - _my_time.tv_usec = usecs; +inline Time_Span:: +Time_Span(long lDays, int nHours, int nMins, int nSecs, int usecs) { + _my_time.tv_sec = nSecs + 60 * (nMins + 60 * (nHours + 24 * lDays)); + _my_time.tv_usec = usecs; } /** * */ -inline void Time_Span::Set(long lDays, int nHours, int nMins, int nSecs, int usecs) -{ - _my_time.tv_sec = nSecs + 60 * (nMins + 60 * (nHours + 24 * lDays)); - _my_time.tv_usec = usecs; +inline void Time_Span:: +Set(long lDays, int nHours, int nMins, int nSecs, int usecs) { + _my_time.tv_sec = nSecs + 60 * (nMins + 60 * (nHours + 24 * lDays)); + _my_time.tv_usec = usecs; } /** * */ -inline Time_Span::Time_Span(const Time_Span& Time_SpanSrc) -{ - _my_time = Time_SpanSrc._my_time; +inline Time_Span:: +Time_Span(const Time_Span &Time_SpanSrc) { + _my_time = Time_SpanSrc._my_time; } /** * */ -inline Time_Span::Time_Span(const Time_Clock& Time_SpanSrc) -{ - _my_time = Time_SpanSrc._my_time; +inline Time_Span:: +Time_Span(const Time_Clock &Time_SpanSrc) { + _my_time = Time_SpanSrc._my_time; } /** * */ -inline const Time_Span& Time_Span::operator=(const Time_Span& Time_SpanSrc) -{ - if (&Time_SpanSrc == this) - return * this; - _my_time = Time_SpanSrc._my_time; return *this; -} - -/** - * - */ -inline long Time_Span::GetDays() const -{ - return _my_time.tv_sec / (24*3600L); -} - -/** - * - */ -inline long Time_Span::GetTotalHours() const -{ - return _my_time.tv_sec / 3600; -} - -/** - * - */ -inline int Time_Span::GetHours() const -{ - return (int)(GetTotalHours() - GetDays()*24); -} - -/** - * - */ -inline long Time_Span::GetTotalMinutes() const -{ - return _my_time.tv_sec / 60; -} - -/** - * - */ -inline int Time_Span::GetMinutes() const -{ - return (int)(GetTotalMinutes() - GetTotalHours()*60); -} - -/** - * - */ -inline long Time_Span::GetTotalSeconds() const -{ - return _my_time.tv_sec; -} - -/** - * - */ -inline long Time_Span::GetTotalMSeconds() const -{ - return (_my_time.tv_sec * 1000) + (_my_time.tv_usec / 1000); -} - - -inline long Time_Span::GetTotal100Seconds() const -{ - return (_my_time.tv_sec * 100) + (_my_time.tv_usec / 10000); -} - - - -/** - * - */ -inline long Time_Span::GetMSeconds() const -{ - return (_my_time.tv_usec / 1000); -} - - -/** - * - */ -inline int Time_Span::GetSeconds() const -{ - return (int)(GetTotalSeconds() - GetTotalMinutes()*60); -} - -/** - * - */ -inline Time_Span TimeDifference(const Time_Span &Time_Span1, const Time_Span &Time_Span2) -{ - timeval ans; - TimeDif(Time_Span2.GetTval(), Time_Span1.GetTval(), ans); - return Time_Span(ans); -} - -/** - * - */ -inline Time_Span TimeAddition(const Time_Span &Time_Span1, const Time_Span &Time_Span2) -{ - timeval ans; - TimeAdd(Time_Span2.GetTval(), Time_Span1.GetTval(), ans); - return Time_Span(ans); -} - -/** - * - */ -inline const Time_Span& Time_Span::operator+=(Time_Span &Time_Span) -{ - _my_time.tv_usec += Time_Span._my_time.tv_usec; - _my_time.tv_sec += Time_Span._my_time.tv_sec; - NormalizeTime(_my_time); +inline const Time_Span &Time_Span:: +operator=(const Time_Span &Time_SpanSrc) { + if (&Time_SpanSrc == this) { return *this; + } + _my_time = Time_SpanSrc._my_time; + return *this; } /** * */ -inline const Time_Span& Time_Span::operator-=(Time_Span &Time_Span) -{ - _my_time.tv_usec -= Time_Span._my_time.tv_usec; - _my_time.tv_sec -= Time_Span._my_time.tv_sec; - NormalizeTime(_my_time); - return *this; +inline long Time_Span:: +GetDays() const { + return _my_time.tv_sec / (24*3600L); } /** * */ -inline bool Time_Span::operator==(Time_Span &Time_Span) const -{ - return ((_my_time.tv_sec == Time_Span._my_time.tv_sec) && (_my_time.tv_usec == Time_Span._my_time.tv_usec)); +inline long Time_Span:: +GetTotalHours() const { + return _my_time.tv_sec / 3600; } /** * */ -inline bool Time_Span::operator!=(Time_Span &Time_Span) const -{ - return ((_my_time.tv_sec != Time_Span._my_time.tv_sec) || (_my_time.tv_usec != Time_Span._my_time.tv_usec)); +inline int Time_Span:: +GetHours() const { + return (int)(GetTotalHours() - GetDays()*24); } /** * */ -inline bool Time_Span::operator<(Time_Span &Time_Span) const -{ - return ((_my_time.tv_sec < Time_Span._my_time.tv_sec) || - ((_my_time.tv_sec == Time_Span._my_time.tv_sec) && (_my_time.tv_usec < Time_Span._my_time.tv_usec))); +inline long Time_Span:: +GetTotalMinutes() const { + return _my_time.tv_sec / 60; } /** * */ -inline bool Time_Span::operator>(Time_Span &Time_Span) const -{ - return ((_my_time.tv_sec > Time_Span._my_time.tv_sec) || - ((_my_time.tv_sec == Time_Span._my_time.tv_sec) && (_my_time.tv_usec > Time_Span._my_time.tv_usec))); +inline int Time_Span:: +GetMinutes() const { + return (int)(GetTotalMinutes() - GetTotalHours()*60); } /** * */ -inline bool Time_Span::operator<=(Time_Span &Time_Span) const -{ - return ((_my_time.tv_sec < Time_Span._my_time.tv_sec) || - ((_my_time.tv_sec == Time_Span._my_time.tv_sec) && (_my_time.tv_usec <= Time_Span._my_time.tv_usec))); +inline long Time_Span:: +GetTotalSeconds() const { + return _my_time.tv_sec; } /** * */ -inline bool Time_Span::operator>=(Time_Span &Time_Span) const -{ - return ((_my_time.tv_sec > Time_Span._my_time.tv_sec) || - ((_my_time.tv_sec == Time_Span._my_time.tv_sec) && (_my_time.tv_usec >= Time_Span._my_time.tv_usec))); +inline long Time_Span:: +GetTotalMSeconds() const { + return (_my_time.tv_sec * 1000) + (_my_time.tv_usec / 1000); +} + +inline long Time_Span:: +GetTotal100Seconds() const { + return (_my_time.tv_sec * 100) + (_my_time.tv_usec / 10000); } /** * */ -inline std::string Time_Span::Format(char * pFormat) const +inline long Time_Span:: +GetMSeconds() const { + return (_my_time.tv_usec / 1000); +} + +/** + * + */ +inline int Time_Span:: +GetSeconds() const { + return (int)(GetTotalSeconds() - GetTotalMinutes()*60); +} + +/** + * + */ +inline Time_Span TimeDifference(const Time_Span &Time_Span1, const Time_Span &Time_Span2) { + timeval ans; + TimeDif(Time_Span2.GetTval(), Time_Span1.GetTval(), ans); + return Time_Span(ans); +} + +/** + * + */ +inline Time_Span TimeAddition(const Time_Span &Time_Span1, const Time_Span &Time_Span2) { + timeval ans; + TimeAdd(Time_Span2.GetTval(), Time_Span1.GetTval(), ans); + return Time_Span(ans); +} + +/** + * + */ +inline const Time_Span &Time_Span:: +operator+=(Time_Span &Time_Span) { + _my_time.tv_usec += Time_Span._my_time.tv_usec; + _my_time.tv_sec += Time_Span._my_time.tv_sec; + NormalizeTime(_my_time); + return *this; +} + +/** + * + */ +inline const Time_Span &Time_Span:: +operator-=(Time_Span &Time_Span) { + _my_time.tv_usec -= Time_Span._my_time.tv_usec; + _my_time.tv_sec -= Time_Span._my_time.tv_sec; + NormalizeTime(_my_time); + return *this; +} + +/** + * + */ +inline bool Time_Span:: +operator==(Time_Span &Time_Span) const { + return ((_my_time.tv_sec == Time_Span._my_time.tv_sec) && (_my_time.tv_usec == Time_Span._my_time.tv_usec)); +} + +/** + * + */ +inline bool Time_Span:: +operator!=(Time_Span &Time_Span) const { + return ((_my_time.tv_sec != Time_Span._my_time.tv_sec) || (_my_time.tv_usec != Time_Span._my_time.tv_usec)); +} + +/** + * + */ +inline bool Time_Span:: +operator<(Time_Span &Time_Span) const { + return ((_my_time.tv_sec < Time_Span._my_time.tv_sec) || + ((_my_time.tv_sec == Time_Span._my_time.tv_sec) && (_my_time.tv_usec < Time_Span._my_time.tv_usec))); +} + +/** + * + */ +inline bool Time_Span:: +operator>(Time_Span &Time_Span) const { + return ((_my_time.tv_sec > Time_Span._my_time.tv_sec) || + ((_my_time.tv_sec == Time_Span._my_time.tv_sec) && (_my_time.tv_usec > Time_Span._my_time.tv_usec))); +} + +/** + * + */ +inline bool Time_Span:: +operator<=(Time_Span &Time_Span) const { + return ((_my_time.tv_sec < Time_Span._my_time.tv_sec) || + ((_my_time.tv_sec == Time_Span._my_time.tv_sec) && (_my_time.tv_usec <= Time_Span._my_time.tv_usec))); +} + +/** + * + */ +inline bool Time_Span:: +operator>=(Time_Span &Time_Span) const { + return ((_my_time.tv_sec > Time_Span._my_time.tv_sec) || + ((_my_time.tv_sec == Time_Span._my_time.tv_sec) && (_my_time.tv_usec >= Time_Span._my_time.tv_usec))); +} + +/** + * + */ +inline std::string Time_Span:: +Format(char *pFormat) const { /* - * formatting Time_Spans is a little trickier than formatting * we are only - * interested in relative time formats, ie. it is illegal to format anything - * dealing with absolute time (i.e. years, months, day of week, day of year, - * timezones, ...) * the only valid formats: %D - # of days -- NEW !!! %H - - * hour in 24 hour format %M - minute (0-59) %S - seconds (0-59) %% - percent - * sign %N - nanosecs - */ -{ - char szBuffer[maxTimeBufferSize]; - char ch; - char * pch = szBuffer; +* formatting Time_Spans is a little trickier than formatting * we are only +* interested in relative time formats, ie. it is illegal to format anything +* dealing with absolute time (i.e. years, months, day of week, day of year, +* timezones, ...) * the only valid formats: %D - # of days -- NEW !!! %H - +* hour in 24 hour format %M - minute (0-59) %S - seconds (0-59) %% - percent +* sign %N - nanosecs +*/ + char szBuffer[maxTimeBufferSize]; + char ch; + char *pch = szBuffer; - while ((ch = *pFormat++) != '\0') { - assert(pch < &szBuffer[maxTimeBufferSize]); - if (ch == '%') { - switch (ch = *pFormat++) { - default: - assert(false); // probably a bad format character - case '%': - *pch++ = ch; - break; - case 'D': - pch += sprintf(pch, "%ld", GetDays()); - break; - case 'H': - pch += sprintf(pch, "%02d", GetHours()); - break; - case 'M': - pch += sprintf(pch, "%02d", GetMinutes()); - break; - case 'S': - pch += sprintf(pch, "%02d", GetSeconds()); - break; - case 'N': - pch += sprintf(pch, "%03ld", (long)(_my_time.tv_usec / 1000)); - break; - } - } else { - *pch++ = ch; - } + while ((ch = *pFormat++) != '\0') { + assert(pch < &szBuffer[maxTimeBufferSize]); + if (ch == '%') { + switch (ch = *pFormat++) { + default: + assert(false); // probably a bad format character + case '%': + *pch++ = ch; + break; + case 'D': +#ifdef _WIN32 + pch += sprintf_s(pch, maxTimeBufferSize, "%ld", GetDays()); +#else + pch += snprintf(pch, maxTimeBufferSize, "%ld", GetDays()); +#endif + break; + case 'H': +#ifdef _WIN32 + pch += sprintf_s(pch, maxTimeBufferSize, "%02d", GetHours()); +#else + pch += snprintf(pch, maxTimeBufferSize, "%02d", GetHours()); +#endif + break; + case 'M': +#ifdef _WIN32 + pch += sprintf_s(pch, maxTimeBufferSize, "%02d", GetMinutes()); +#else + pch += snprintf(pch, maxTimeBufferSize, "%02d", GetMinutes()); +#endif + break; + case 'S': +#ifdef _WIN32 + pch += sprintf_s(pch, maxTimeBufferSize, "%02d", GetSeconds()); +#else + pch += snprintf(pch, maxTimeBufferSize, "%02d", GetSeconds()); +#endif + break; + case 'N': +#ifdef _WIN32 + pch += sprintf_s(pch, maxTimeBufferSize, "%03ld", (long)(_my_time.tv_usec / 1000)); +#else + pch += snprintf(pch, maxTimeBufferSize, "%03ld", (long)(_my_time.tv_usec / 1000)); +#endif + break; + } + } else { + *pch++ = ch; } + } - *pch = '\0'; - return std::string(szBuffer); + *pch = '\0'; + return std::string(szBuffer); } #endif //__TIME_SPAN_H__ diff --git a/panda/src/parametrics/curveFitter.cxx b/panda/src/parametrics/curveFitter.cxx index 0cc20c20fa..6592d7aff2 100644 --- a/panda/src/parametrics/curveFitter.cxx +++ b/panda/src/parametrics/curveFitter.cxx @@ -154,11 +154,9 @@ void CurveFitter:: sample(ParametricCurveCollection *curves, int count) { nassertv(curves != (ParametricCurveCollection *)NULL); PN_stdfloat max_t = curves->get_max_t(); - PN_stdfloat t, last_t, d; + PN_stdfloat t; DataPoint dp; - last_t = 0.0f; - d = 0.0f; int i; for (i = 0; i < count; i++) { t = max_t * (PN_stdfloat)i / (PN_stdfloat)(count-1); diff --git a/panda/src/pgraph/clipPlaneAttrib.cxx b/panda/src/pgraph/clipPlaneAttrib.cxx index 7fd2da2d83..e62a3d6e24 100644 --- a/panda/src/pgraph/clipPlaneAttrib.cxx +++ b/panda/src/pgraph/clipPlaneAttrib.cxx @@ -911,7 +911,7 @@ complete_pointers(TypedWritable **p_list, BamReader *manager) { AttribNodeRegistry *areg = AttribNodeRegistry::get_global_ptr(); if (manager->get_file_minor_ver() >= 40) { - for (int i = 0; i < _off_planes.size(); ++i) { + for (size_t i = 0; i < _off_planes.size(); ++i) { pi += _off_planes[i].complete_pointers(p_list + pi, manager); int n = areg->find_node(_off_planes[i]); @@ -921,7 +921,7 @@ complete_pointers(TypedWritable **p_list, BamReader *manager) { } } - for (int i = 0; i < _on_planes.size(); ++i) { + for (size_t i = 0; i < _on_planes.size(); ++i) { pi += _on_planes[i].complete_pointers(p_list + pi, manager); int n = areg->find_node(_on_planes[i]); diff --git a/panda/src/pgraph/cullableObject.cxx b/panda/src/pgraph/cullableObject.cxx index 33503de0eb..0bd7a0fe5f 100644 --- a/panda/src/pgraph/cullableObject.cxx +++ b/panda/src/pgraph/cullableObject.cxx @@ -59,7 +59,20 @@ munge_geom(GraphicsStateGuardianBase *gsg, if (_geom != (Geom *)NULL) { _munger = munger; + GraphicsStateGuardianBase *gsg = traverser->get_gsg(); + int gsg_bits = gsg->get_supported_geom_rendering(); + if (!hardware_point_sprites) { + // If support for hardware point sprites or perspective-scaled points is + // disabled, we don't allow the GSG to tell us it supports them. + gsg_bits &= ~(Geom::GR_point_perspective | Geom::GR_point_sprite); + } + if (!hardware_points) { + // If hardware-points is off, we don't allow any kind of point + // rendering, except plain old one-pixel points; + gsg_bits &= ~(Geom::GR_point_bits & ~Geom::GR_point); + } int geom_rendering; + int unsupported_bits; { GeomPipelineReader geom_reader(_geom, current_thread); @@ -76,31 +89,24 @@ munge_geom(GraphicsStateGuardianBase *gsg, geom_rendering = geom_reader.get_geom_rendering(); geom_rendering = _state->get_geom_rendering(geom_rendering); geom_rendering = _internal_transform->get_geom_rendering(geom_rendering); + unsupported_bits = geom_rendering & ~gsg_bits; if (geom_rendering & Geom::GR_point_bits) { if (geom_reader.get_primitive_type() != Geom::PT_points) { - if (singular_points) { + if (singular_points || + (unsupported_bits & Geom::GR_render_mode_point) != 0) { // Isolate the points so there's no unneeded overlap. _geom = _geom->make_points(); } } } + if (unsupported_bits & Geom::GR_render_mode_wireframe) { + if (geom_reader.get_primitive_type() != Geom::PT_lines) { + _geom = _geom->make_lines(); + } + } } - GraphicsStateGuardianBase *gsg = traverser->get_gsg(); - int gsg_bits = gsg->get_supported_geom_rendering(); - if (!hardware_point_sprites) { - // If support for hardware point sprites or perspective-scaled points is - // disabled, we don't allow the GSG to tell us it supports them. - gsg_bits &= ~(Geom::GR_point_perspective | Geom::GR_point_sprite); - } - if (!hardware_points) { - // If hardware-points is off, we don't allow any kind of point - // rendering, except plain old one-pixel points; - gsg_bits &= ~(Geom::GR_point_bits & ~Geom::GR_point); - } - int unsupported_bits = geom_rendering & ~gsg_bits; - if ((unsupported_bits & Geom::GR_point_bits) != 0) { // The GSG doesn't support rendering these fancy points directly; we // have to render them in software instead. Munge them into quads. diff --git a/panda/src/pgraph/lightAttrib.cxx b/panda/src/pgraph/lightAttrib.cxx index a677345b8a..b80eb3b428 100644 --- a/panda/src/pgraph/lightAttrib.cxx +++ b/panda/src/pgraph/lightAttrib.cxx @@ -935,11 +935,11 @@ complete_pointers(TypedWritable **p_list, BamReader *manager) { int pi = RenderAttrib::complete_pointers(p_list, manager); if (manager->get_file_minor_ver() >= 40) { - for (int i = 0; i < _off_lights.size(); ++i) { + for (size_t i = 0; i < _off_lights.size(); ++i) { pi += _off_lights[i].complete_pointers(p_list + pi, manager); } - for (int i = 0; i < _on_lights.size(); ++i) { + for (size_t i = 0; i < _on_lights.size(); ++i) { pi += _on_lights[i].complete_pointers(p_list + pi, manager); } @@ -978,7 +978,7 @@ finalize(BamReader *manager) { // Check if any of the nodes we loaded are mentioned in the // AttribNodeRegistry. If so, replace them. - for (int i = 0; i < _off_lights.size(); ++i) { + for (size_t i = 0; i < _off_lights.size(); ++i) { int n = areg->find_node(_off_lights[i]); if (n != -1) { // If it's in the registry, replace it. @@ -986,7 +986,7 @@ finalize(BamReader *manager) { } } - for (int i = 0; i < _on_lights.size(); ++i) { + for (size_t i = 0; i < _on_lights.size(); ++i) { int n = areg->find_node(_on_lights[i]); if (n != -1) { // If it's in the registry, replace it. @@ -1067,12 +1067,12 @@ fillin(DatagramIterator &scan, BamReader *manager) { if (manager->get_file_minor_ver() >= 40) { _off_lights.resize(scan.get_uint16()); - for (int i = 0; i < _off_lights.size(); ++i) { + for (size_t i = 0; i < _off_lights.size(); ++i) { _off_lights[i].fillin(scan, manager); } _on_lights.resize(scan.get_uint16()); - for (int i = 0; i < _on_lights.size(); ++i) { + for (size_t i = 0; i < _on_lights.size(); ++i) { _on_lights[i].fillin(scan, manager); } } else { diff --git a/panda/src/pgraph/loader.cxx b/panda/src/pgraph/loader.cxx index 671a40c638..32187508e0 100644 --- a/panda/src/pgraph/loader.cxx +++ b/panda/src/pgraph/loader.cxx @@ -431,8 +431,6 @@ save_file(const Filename &filename, const LoaderOptions &options, return false; } - VirtualFileSystem *vfs = VirtualFileSystem::get_global_ptr(); - bool result = try_save_file(this_filename, this_options, node, requested_type); if (!result) { if (report_errors) { @@ -451,10 +449,7 @@ save_file(const Filename &filename, const LoaderOptions &options, bool Loader:: try_save_file(const Filename &pathname, const LoaderOptions &options, PandaNode *node, LoaderFileType *requested_type) const { - bool report_errors = ((options.get_flags() & LoaderOptions::LF_report_errors) != 0 || loader_cat.is_debug()); - - bool result = requested_type->save_file(pathname, options, node); - return result; + return requested_type->save_file(pathname, options, node); } /** diff --git a/panda/src/pgraph/modelFlattenRequest.h b/panda/src/pgraph/modelFlattenRequest.h index 0cea9d87d2..5716635f82 100644 --- a/panda/src/pgraph/modelFlattenRequest.h +++ b/panda/src/pgraph/modelFlattenRequest.h @@ -38,6 +38,10 @@ PUBLISHED: INLINE bool is_ready() const; INLINE PandaNode *get_model() const; + MAKE_PROPERTY(orig, get_orig); + MAKE_PROPERTY(ready, is_ready); + MAKE_PROPERTY(model, get_model); + protected: virtual DoneStatus do_task(); diff --git a/panda/src/pgraph/modelLoadRequest.h b/panda/src/pgraph/modelLoadRequest.h index 06d4307236..00f55e8052 100644 --- a/panda/src/pgraph/modelLoadRequest.h +++ b/panda/src/pgraph/modelLoadRequest.h @@ -45,6 +45,12 @@ PUBLISHED: INLINE bool is_ready() const; INLINE PandaNode *get_model() const; + MAKE_PROPERTY(filename, get_filename); + MAKE_PROPERTY(options, get_options); + MAKE_PROPERTY(loader, get_loader); + MAKE_PROPERTY(ready, is_ready); + MAKE_PROPERTY(model, get_model); + protected: virtual DoneStatus do_task(); diff --git a/panda/src/pgraph/modelSaveRequest.h b/panda/src/pgraph/modelSaveRequest.h index 2180813f76..878e28edee 100644 --- a/panda/src/pgraph/modelSaveRequest.h +++ b/panda/src/pgraph/modelSaveRequest.h @@ -46,6 +46,13 @@ PUBLISHED: INLINE bool is_ready() const; INLINE bool get_success() const; + MAKE_PROPERTY(filename, get_filename); + MAKE_PROPERTY(options, get_options); + MAKE_PROPERTY(node, get_node); + MAKE_PROPERTY(loader, get_loader); + MAKE_PROPERTY(ready, is_ready); + MAKE_PROPERTY(success, get_success); + protected: virtual DoneStatus do_task(); diff --git a/panda/src/pgraph/nodePath.h b/panda/src/pgraph/nodePath.h index 78c2520faa..a30fc1d40d 100644 --- a/panda/src/pgraph/nodePath.h +++ b/panda/src/pgraph/nodePath.h @@ -905,15 +905,19 @@ PUBLISHED: NodePath find_net_tag(const string &key) const; EXTENSION(INLINE PyObject *get_tag_keys() const); - EXTENSION(INLINE void set_python_tag(const string &key, PyObject *value)); - EXTENSION(INLINE PyObject *get_python_tag(const string &key) const); - EXTENSION(INLINE void get_python_tag_keys(vector_string &keys) const); + + EXTENSION(PyObject *get_python_tags()); + EXTENSION(INLINE void set_python_tag(PyObject *keys, PyObject *value)); + EXTENSION(INLINE PyObject *get_python_tag(PyObject *keys) const); EXTENSION(INLINE PyObject *get_python_tag_keys() const); - EXTENSION(INLINE bool has_python_tag(const string &key) const); - EXTENSION(INLINE void clear_python_tag(const string &key)); - EXTENSION(INLINE PyObject *get_net_python_tag(const string &key) const); - EXTENSION(INLINE bool has_net_python_tag(const string &key) const); - EXTENSION(NodePath find_net_python_tag(const string &key) const); + EXTENSION(INLINE bool has_python_tag(PyObject *keys) const); + EXTENSION(INLINE void clear_python_tag(PyObject *keys)); + EXTENSION(INLINE PyObject *get_net_python_tag(PyObject *keys) const); + EXTENSION(INLINE bool has_net_python_tag(PyObject *keys) const); + EXTENSION(NodePath find_net_python_tag(PyObject *keys) const); + MAKE_PROPERTY(python_tags, get_python_tags); + + EXTENSION(int __traverse__(visitproc visit, void *arg)); INLINE void list_tags() const; diff --git a/panda/src/pgraph/nodePath_ext.I b/panda/src/pgraph/nodePath_ext.I index 0931d2d794..5bc6c78c5a 100644 --- a/panda/src/pgraph/nodePath_ext.I +++ b/panda/src/pgraph/nodePath_ext.I @@ -14,15 +14,19 @@ #include "pandaNode_ext.h" /** - * Fills the given vector up with the list of Python tags on this PandaNode. - * - * It is the user's responsibility to ensure that the keys vector is empty - * before making this call; otherwise, the new files will be appended to it. + * Returns a dictionary of Python tags that is associated with the current + * node. This is similar to the regular tags, except this can store any + * Python object instead of just a string. However, the Python object is not + * recorded to a bam file. */ -INLINE void Extension:: -get_python_tag_keys(vector_string &keys) const { - nassertv_always(!_this->is_empty()); - invoke_extension(_this->node()).get_python_tag_keys(keys); +INLINE PyObject *Extension:: +get_python_tags() { + // An empty NodePath returns None + if (_this->is_empty()) { + Py_INCREF(Py_None); + return Py_None; + } + return invoke_extension(_this->node()).get_python_tags(); } /** @@ -63,7 +67,7 @@ get_python_tag_keys() const { * of any one key's object. */ INLINE void Extension:: -set_python_tag(const string &key, PyObject *value) { +set_python_tag(PyObject *key, PyObject *value) { nassertv_always(!_this->is_empty()); invoke_extension(_this->node()).set_python_tag(key, value); } @@ -74,7 +78,7 @@ set_python_tag(const string &key, PyObject *value) { * None. See also get_net_python_tag(). */ INLINE PyObject *Extension:: -get_python_tag(const string &key) const { +get_python_tag(PyObject *key) const { // An empty NodePath quietly returns no tags. This makes // get_net_python_tag() easier to implement. if (_this->is_empty()) { @@ -90,7 +94,7 @@ get_python_tag(const string &key) const { * value has been set. See also has_net_python_tag(). */ INLINE bool Extension:: -has_python_tag(const string &key) const { +has_python_tag(PyObject *key) const { // An empty NodePath quietly has no tags. This makes has_net_python_tag() // easier to implement. if (_this->is_empty()) { @@ -105,7 +109,7 @@ has_python_tag(const string &key) const { * the indicated key. */ INLINE void Extension:: -clear_python_tag(const string &key) { +clear_python_tag(PyObject *key) { nassertv_always(!_this->is_empty()); invoke_extension(_this->node()).clear_python_tag(key); } @@ -117,7 +121,7 @@ clear_python_tag(const string &key) { * get_python_tag(). */ INLINE PyObject *Extension:: -get_net_python_tag(const string &key) const { +get_net_python_tag(PyObject *key) const { NodePath tag_np = find_net_python_tag(key); return invoke_extension(&tag_np).get_python_tag(key); } @@ -127,6 +131,17 @@ get_net_python_tag(const string &key) const { * or on any ancestor node, or false otherwise. See also has_python_tag(). */ INLINE bool Extension:: -has_net_python_tag(const string &key) const { +has_net_python_tag(PyObject *key) const { return !find_net_python_tag(key).is_empty(); } + +/** + * Called by Python to implement cycle detection. + */ +INLINE int Extension:: +__traverse__(visitproc visit, void *arg) { + if (_this->is_empty()) { + return 0; + } + return invoke_extension(_this->node()).__traverse__(visit, arg); +} diff --git a/panda/src/pgraph/nodePath_ext.cxx b/panda/src/pgraph/nodePath_ext.cxx index 656802b8f0..081a69a814 100644 --- a/panda/src/pgraph/nodePath_ext.cxx +++ b/panda/src/pgraph/nodePath_ext.cxx @@ -172,7 +172,7 @@ __reduce_persist__(PyObject *self, PyObject *pickler) const { * node contains this tag definition. See set_python_tag(). */ NodePath Extension:: -find_net_python_tag(const string &key) const { +find_net_python_tag(PyObject *key) const { if (_this->is_empty()) { return NodePath::not_found(); } diff --git a/panda/src/pgraph/nodePath_ext.h b/panda/src/pgraph/nodePath_ext.h index 93573ed6ad..3b0b8db42a 100644 --- a/panda/src/pgraph/nodePath_ext.h +++ b/panda/src/pgraph/nodePath_ext.h @@ -35,15 +35,19 @@ public: PyObject *__reduce_persist__(PyObject *self, PyObject *pickler) const; INLINE PyObject *get_tag_keys() const; - INLINE void set_python_tag(const string &key, PyObject *value); - INLINE PyObject *get_python_tag(const string &key) const; - INLINE void get_python_tag_keys(vector_string &keys) const; + + INLINE PyObject *get_python_tags(); + INLINE void set_python_tag(PyObject *key, PyObject *value); + INLINE PyObject *get_python_tag(PyObject *key) const; INLINE PyObject *get_python_tag_keys() const; - INLINE bool has_python_tag(const string &key) const; - INLINE void clear_python_tag(const string &key); - INLINE PyObject *get_net_python_tag(const string &key) const; - INLINE bool has_net_python_tag(const string &key) const; - NodePath find_net_python_tag(const string &key) const; + INLINE bool has_python_tag(PyObject *key) const; + INLINE void clear_python_tag(PyObject *key); + INLINE PyObject *get_net_python_tag(PyObject *key) const; + INLINE bool has_net_python_tag(PyObject *key) const; + NodePath find_net_python_tag(PyObject *key) const; + + // This is defined to implement cycle detection in Python tags. + INLINE int __traverse__(visitproc visit, void *arg); PyObject *get_tight_bounds(const NodePath &other = NodePath()) const; }; diff --git a/panda/src/pgraph/occluderEffect.cxx b/panda/src/pgraph/occluderEffect.cxx index 36c874a1f2..f27c486d88 100644 --- a/panda/src/pgraph/occluderEffect.cxx +++ b/panda/src/pgraph/occluderEffect.cxx @@ -47,10 +47,6 @@ add_on_occluder(const NodePath &occluder) const { nassertr(!occluder.is_empty() && occluder.node()->is_of_type(OccluderNode::get_class_type()), this); OccluderEffect *effect = new OccluderEffect(*this); effect->_on_occluders.insert(occluder); - - pair insert_result = - effect->_on_occluders.insert(Occluders::value_type(occluder)); - return return_new(effect); } @@ -170,7 +166,7 @@ complete_pointers(TypedWritable **p_list, BamReader *manager) { AttribNodeRegistry *areg = AttribNodeRegistry::get_global_ptr(); if (manager->get_file_minor_ver() >= 40) { - for (int i = 0; i < _on_occluders.size(); ++i) { + for (size_t i = 0; i < _on_occluders.size(); ++i) { pi += _on_occluders[i].complete_pointers(p_list + pi, manager); int n = areg->find_node(_on_occluders[i]); diff --git a/panda/src/pgraph/pandaNode.I b/panda/src/pgraph/pandaNode.I index fa60e11b41..747f322a36 100644 --- a/panda/src/pgraph/pandaNode.I +++ b/panda/src/pgraph/pandaNode.I @@ -380,7 +380,10 @@ has_tags() const { return true; } #ifdef HAVE_PYTHON - if (!cdata->_python_tag_data.empty()) { + // This is a bit awkward, since it doesn't catch cases where the Python tags + // are cleared. Maybe we should make this behavior deprecated, so that + // has_tags will not consider the Python tags. + if (!_python_tag_data.is_null()) { return true; } #endif // HAVE_PYTHON diff --git a/panda/src/pgraph/pandaNode.cxx b/panda/src/pgraph/pandaNode.cxx index 38a1c5f096..f74f7fc24d 100644 --- a/panda/src/pgraph/pandaNode.cxx +++ b/panda/src/pgraph/pandaNode.cxx @@ -27,7 +27,6 @@ #include "config_mathutil.h" #include "lightReMutexHolder.h" #include "graphicsStateGuardianBase.h" -#include "py_panda.h" // This category is just temporary for debugging convenience. NotifyCategoryDecl(drawmask, EXPCL_PANDA_PGRAPH, EXPTP_PANDA_PGRAPH); @@ -131,7 +130,8 @@ PandaNode(const PandaNode ©) : TypedWritableReferenceCount(copy), Namable(copy), _paths_lock("PandaNode::_paths_lock"), - _dirty_prev_transform(false) + _dirty_prev_transform(false), + _python_tag_data(copy._python_tag_data) { if (pgraph_cat.is_debug()) { pgraph_cat.debug() @@ -172,12 +172,6 @@ PandaNode(const PandaNode ©) : ++cdata->_internal_bounds_mark; cdata->_final_bounds = copy_cdata->_final_bounds; cdata->_fancy_bits = copy_cdata->_fancy_bits; - -#ifdef HAVE_PYTHON - // Copy and increment all of the Python objects held by the other node. - cdata->_python_tag_data = copy_cdata->_python_tag_data; - cdata->inc_py_refs(); -#endif // HAVE_PYTHON } } @@ -1270,32 +1264,13 @@ copy_tags(PandaNode *other) { cdataw->_tag_data[(*ti).first] = (*ti).second; } cdataw->set_fancy_bit(FB_tag, !cdataw->_tag_data.empty()); - -#ifdef HAVE_PYTHON - PythonTagData::const_iterator pti; - for (pti = cdatar->_python_tag_data.begin(); - pti != cdatar->_python_tag_data.end(); - ++pti) { - const string &key = (*pti).first; - PyObject *value = (*pti).second; - Py_XINCREF(value); - - pair result; - result = cdataw->_python_tag_data.insert(PythonTagData::value_type(key, value)); - - if (!result.second) { - // The insert was unsuccessful; that means the key was already present - // in the map. In this case, we should decrement the original value's - // reference count and replace it with the new object. - PythonTagData::iterator wpti = result.first; - PyObject *old_value = (*wpti).second; - Py_XDECREF(old_value); - (*wpti).second = value; - } - } -#endif // HAVE_PYTHON } CLOSE_ITERATE_CURRENT_AND_UPSTREAM(_cycler); + + // It's okay to copy the tags by pointer, because get_python_tags does a + // copy-on-write. + _python_tag_data = other->_python_tag_data; + mark_bam_modified(); } @@ -1321,20 +1296,9 @@ list_tags(ostream &out, const string &separator) const { } } -#ifdef HAVE_PYTHON - if (!cdata->_python_tag_data.empty()) { - if (!cdata->_tag_data.empty()) { - out << separator; - } - PythonTagData::const_iterator ti = cdata->_python_tag_data.begin(); - out << (*ti).first; - ++ti; - while (ti != cdata->_python_tag_data.end()) { - out << separator << (*ti).first; - ++ti; - } - } -#endif // HAVE_PYTHON + // We used to list the Python tags here. That's a bit awkward, though, + // since that means calling up into Python code to print the keys. If + // someone finds it useful, we can implement it in an extension method. } /** @@ -1393,50 +1357,11 @@ compare_tags(const PandaNode *other) const { return -1; } -#ifdef HAVE_PYTHON - PythonTagData::const_iterator api = cdata->_python_tag_data.begin(); - PythonTagData::const_iterator bpi = cdata_other->_python_tag_data.begin(); - while (api != cdata->_python_tag_data.end() && - bpi != cdata_other->_python_tag_data.end()) { - int cmp = strcmp((*api).first.c_str(), (*bpi).first.c_str()); - if (cmp != 0) { - return cmp; - } - -#if PY_MAJOR_VERSION >= 3 - if (PyObject_RichCompareBool((*api).second, (*bpi).second, Py_LT) == 1) { - return -1; - } else if (PyObject_RichCompareBool((*api).second, (*bpi).second, Py_GT) == 1) { - return 1; - } else if (PyObject_RichCompareBool((*api).second, (*bpi).second, Py_EQ) == 1) { - cmp = 0; - } else { -#else - if (PyObject_Cmp((*api).second, (*bpi).second, &cmp) == -1) { -#endif - // Unable to compare objects; just compare pointers. - if ((*api).second != (*bpi).second) { - cmp = (*api).second < (*bpi).second ? -1 : 1; - } else { - cmp = 0; - } - } - if (cmp != 0) { - return cmp; - } - - ++api; - ++bpi; + // We compare these by pointer, since it's problematic to call up into + // Python from arbitrary C++ code. + if (_python_tag_data != other->_python_tag_data) { + return (_python_tag_data < other->_python_tag_data) ? -1 : 1; } - if (api != cdata->_python_tag_data.end()) { - // list A is longer. - return 1; - } - if (bpi != cdata_other->_python_tag_data.end()) { - // list B is longer. - return -1; - } -#endif // HAVE_PYTHON return 0; } @@ -1494,30 +1419,6 @@ copy_all_properties(PandaNode *other) { cdataw->_tag_data[(*ti).first] = (*ti).second; } -#ifdef HAVE_PYTHON - PythonTagData::const_iterator pti; - for (pti = cdatar->_python_tag_data.begin(); - pti != cdatar->_python_tag_data.end(); - ++pti) { - const string &key = (*pti).first; - PyObject *value = (*pti).second; - Py_XINCREF(value); - - pair result; - result = cdataw->_python_tag_data.insert(PythonTagData::value_type(key, value)); - - if (!result.second) { - // The insert was unsuccessful; that means the key was already present - // in the map. In this case, we should decrement the original value's - // reference count and replace it with the new object. - PythonTagData::iterator wpti = result.first; - PyObject *old_value = (*wpti).second; - Py_XDECREF(old_value); - (*wpti).second = value; - } - } -#endif // HAVE_PYTHON - static const int change_bits = (FB_transform | FB_state | FB_effects | FB_tag | FB_draw_mask); cdataw->_fancy_bits = @@ -1532,6 +1433,10 @@ copy_all_properties(PandaNode *other) { } CLOSE_ITERATE_CURRENT_AND_UPSTREAM(_cycler); + // It's okay to copy the tags by pointer, because get_python_tags does a + // copy-on-write. + _python_tag_data = other->_python_tag_data; + if (any_transform_changed || any_state_changed || any_draw_mask_changed) { mark_bounds_stale(current_thread); @@ -1597,7 +1502,7 @@ replace_node(PandaNode *other) { // Switch the parents. Thread *current_thread = Thread::get_current_thread(); Parents other_parents = other->get_parents(); - for (int i = 0; i < other_parents.get_num_parents(); ++i) { + for (size_t i = 0; i < other_parents.get_num_parents(); ++i) { PandaNode *parent = other_parents.get_parent(i); if (find_parent(parent) != -1) { // This node was already a child of this parent; don't change it. @@ -1902,7 +1807,7 @@ is_under_scene_root() const { } Parents parents = get_parents(); - for (int i = 0; i < parents.get_num_parents(); ++i) { + for (size_t i = 0; i < parents.get_num_parents(); ++i) { PandaNode *parent = parents.get_parent(i); if (parent->find_stashed((PandaNode *)this) == -1) { if (parent->is_under_scene_root()) { @@ -2401,7 +2306,7 @@ void PandaNode:: r_mark_geom_bounds_stale(Thread *current_thread) { Children children = get_children(current_thread); - int i; + size_t i; for (i = 0; i < children.get_num_children(); i++) { PandaNode *child = children.get_child(i); child->r_mark_geom_bounds_stale(current_thread); @@ -2550,7 +2455,7 @@ r_prepare_scene(GraphicsStateGuardianBase *gsg, const RenderState *node_state, Children children = get_children(current_thread); // We must call get_num_children() each time through the loop, in case we're // running SIMPLE_THREADS and we get interrupted. - int i; + size_t i; for (i = 0; i < children.get_num_children(); i++) { PandaNode *child = children.get_child(i); CPT(RenderState) child_state = node_state->compose(child->get_state()); @@ -2760,7 +2665,7 @@ find_node_above(PandaNode *node) { } Parents parents = get_parents(); - for (int i = 0; i < parents.get_num_parents(); ++i) { + for (size_t i = 0; i < parents.get_num_parents(); ++i) { PandaNode *parent = parents.get_parent(i); if (parent->find_node_above(node)) { return true; @@ -3810,7 +3715,6 @@ CData(const PandaNode::CData ©) : _effects(copy._effects), _tag_data(copy._tag_data), - // _python_tag_data appears below. _draw_control_mask(copy._draw_control_mask), _draw_show_mask(copy._draw_show_mask), _into_collide_mask(copy._into_collide_mask), @@ -3836,12 +3740,6 @@ CData(const PandaNode::CData ©) : // Note that this copy constructor is not used by the PandaNode copy // constructor! Any elements that must be copied between nodes should also // be explicitly copied there. - -#ifdef HAVE_PYTHON - // Copy and increment all of the Python objects held by the other node. - _python_tag_data = copy._python_tag_data; - inc_py_refs(); -#endif // HAVE_PYTHON } /** @@ -3849,10 +3747,6 @@ CData(const PandaNode::CData ©) : */ PandaNode::CData:: ~CData() { -#ifdef HAVE_PYTHON - // Free all of the Python objects held by this node. - dec_py_refs(); -#endif // HAVE_PYTHON } /** @@ -4029,62 +3923,6 @@ fillin(DatagramIterator &scan, BamReader *manager) { fillin_down_list(*modify_stashed(), "stashed", scan, manager); } -#ifdef HAVE_PYTHON -/** - * Increments the reference counts on all held Python objects. - */ -void PandaNode::CData:: -inc_py_refs() { - if (!_python_tag_data.empty()) { -#if defined(HAVE_THREADS) && !defined(SIMPLE_THREADS) - // This might happen at any time, so be sure the Python state is ready for - // it. - PyGILState_STATE gstate; - gstate = PyGILState_Ensure(); -#endif - PythonTagData::const_iterator ti; - for (ti = _python_tag_data.begin(); - ti != _python_tag_data.end(); - ++ti) { - PyObject *value = (*ti).second; - Py_XINCREF(value); - } -#if defined(HAVE_THREADS) && !defined(SIMPLE_THREADS) - PyGILState_Release(gstate); -#endif - } -} -#endif // HAVE_PYTHON - -#ifdef HAVE_PYTHON -/** - * Decrements the reference counts on all held Python objects. - */ -void PandaNode::CData:: -dec_py_refs() { - if (!_python_tag_data.empty()) { -#if defined(HAVE_THREADS) && !defined(SIMPLE_THREADS) - // This might happen at any time, so be sure the Python state is ready for - // it. - PyGILState_STATE gstate; - gstate = PyGILState_Ensure(); -#endif - - PythonTagData::const_iterator ti; - for (ti = _python_tag_data.begin(); - ti != _python_tag_data.end(); - ++ti) { - PyObject *value = (*ti).second; - Py_XDECREF(value); - } - -#if defined(HAVE_THREADS) && !defined(SIMPLE_THREADS) - PyGILState_Release(gstate); -#endif - } -} -#endif // HAVE_PYTHON - /** * Writes the indicated list of parent node pointers to the datagram. */ diff --git a/panda/src/pgraph/pandaNode.h b/panda/src/pgraph/pandaNode.h index 05bbcaadba..0bbc984117 100644 --- a/panda/src/pgraph/pandaNode.h +++ b/panda/src/pgraph/pandaNode.h @@ -200,12 +200,15 @@ PUBLISHED: EXTENSION(PyObject *get_tag_keys() const); - EXTENSION(void set_python_tag(const string &key, PyObject *value)); - EXTENSION(PyObject *get_python_tag(const string &key) const); - EXTENSION(bool has_python_tag(const string &key) const); - EXTENSION(void clear_python_tag(const string &key)); - EXTENSION(void get_python_tag_keys(vector_string &keys) const); + EXTENSION(PyObject *get_python_tags()); + EXTENSION(void set_python_tag(PyObject *key, PyObject *value)); + EXTENSION(PyObject *get_python_tag(PyObject *key) const); + EXTENSION(bool has_python_tag(PyObject *key) const); + EXTENSION(void clear_python_tag(PyObject *key)); EXTENSION(PyObject *get_python_tag_keys() const); + MAKE_PROPERTY(python_tags, get_python_tags); + + EXTENSION(int __traverse__(visitproc visit, void *arg)); INLINE bool has_tags() const; void copy_tags(PandaNode *other); @@ -507,9 +510,16 @@ private: // This is used to maintain a table of keyed data on each node, for the // user's purposes. typedef phash_map TagData; -#ifdef HAVE_PYTHON - typedef phash_map PythonTagData; -#endif // HAVE_PYTHON + + // This is actually implemented in pandaNode_ext.h, but defined here so + // that we can destruct it from the C++ side. Note that it isn't cycled, + // because I imagine it's rare to see a Python thread on a stage other than + // stage 0, and let's not make things unnecessarily complicated. + class PythonTagData : public ReferenceCount { + public: + virtual ~PythonTagData() {}; + }; + PT(PythonTagData) _python_tag_data; #ifndef NDEBUG unsigned int _unexpected_change_flags; @@ -555,9 +565,6 @@ private: CPT(RenderEffects) _effects; TagData _tag_data; -#ifdef HAVE_PYTHON - PythonTagData _python_tag_data; -#endif // HAVE_PYTHON // These two together determine the per-camera visibility of this node. // See adjust_draw_mask() for details. diff --git a/panda/src/pgraph/pandaNode_ext.cxx b/panda/src/pgraph/pandaNode_ext.cxx index 9395a56e3b..aa24e623ee 100644 --- a/panda/src/pgraph/pandaNode_ext.cxx +++ b/panda/src/pgraph/pandaNode_ext.cxx @@ -71,116 +71,7 @@ __deepcopy__(PyObject *self, PyObject *memo) const { } /** - * Associates an arbitrary Python object with a user-defined key which is - * stored on the node. This is similar to set_tag(), except it can store any - * Python object instead of just a string. However, the Python object is not - * recorded to a bam file. - * - * Each unique key stores a different string value. There is no effective - * limit on the number of different keys that may be stored or on the length - * of any one key's value. - */ -void Extension:: -set_python_tag(const string &key, PyObject *value) { - Thread *current_thread = Thread::get_current_thread(); - int pipeline_stage = current_thread->get_pipeline_stage(); - nassertv(pipeline_stage == 0); - - PandaNode::CDWriter cdata(_this->_cycler); - Py_XINCREF(value); - - pair result; - result = cdata->_python_tag_data.insert(PandaNode::PythonTagData::value_type(key, value)); - - if (!result.second) { - // The insert was unsuccessful; that means the key was already present in - // the map. In this case, we should decrement the original value's - // reference count and replace it with the new object. - PandaNode::PythonTagData::iterator ti = result.first; - PyObject *old_value = (*ti).second; - Py_XDECREF(old_value); - (*ti).second = value; - } - - // Even though the python tag isn't recorded in the bam stream? - _this->mark_bam_modified(); -} - -/** - * Retrieves the Python object that was previously set on this node for the - * particular key, if any. If no value has been previously set, returns None. - */ -PyObject *Extension:: -get_python_tag(const string &key) const { - PandaNode::CDReader cdata(_this->_cycler); - PandaNode::PythonTagData::const_iterator ti; - ti = cdata->_python_tag_data.find(key); - if (ti != cdata->_python_tag_data.end()) { - PyObject *result = (*ti).second; - Py_XINCREF(result); - return result; - } - Py_INCREF(Py_None); - return Py_None; -} - -/** - * Returns true if a Python object has been defined on this node for the - * particular key (even if that object is None), or false if no object has - * been set. - */ -bool Extension:: -has_python_tag(const string &key) const { - PandaNode::CDReader cdata(_this->_cycler); - PandaNode::PythonTagData::const_iterator ti; - ti = cdata->_python_tag_data.find(key); - return (ti != cdata->_python_tag_data.end()); -} - -/** - * Removes the Python object defined for this key on this particular node. - * After a call to clear_python_tag(), has_python_tag() will return false for - * the indicated key. - */ -void Extension:: -clear_python_tag(const string &key) { - Thread *current_thread = Thread::get_current_thread(); - int pipeline_stage = current_thread->get_pipeline_stage(); - nassertv(pipeline_stage == 0); - - PandaNode::CDWriter cdata(_this->_cycler, current_thread); - PandaNode::PythonTagData::iterator ti; - ti = cdata->_python_tag_data.find(key); - if (ti != cdata->_python_tag_data.end()) { - PyObject *value = (*ti).second; - Py_XDECREF(value); - cdata->_python_tag_data.erase(ti); - } - - // Even though the python tag isn't recorded in the bam stream? - _this->mark_bam_modified(); -} - -/** - * Fills the given vector up with the list of Python tags on this PandaNode. - * - * It is the user's responsibility to ensure that the keys vector is empty - * before making this call; otherwise, the new files will be appended to it. - */ -void Extension:: -get_python_tag_keys(vector_string &keys) const { - PandaNode::CDReader cdata(_this->_cycler); - if (!cdata->_python_tag_data.empty()) { - PandaNode::PythonTagData::const_iterator ti = cdata->_python_tag_data.begin(); - while (ti != cdata->_python_tag_data.end()) { - keys.push_back((*ti).first); - ++ti; - } - } -} - -/** - * This variant on get_tag_keys returns a Python list of strings. + * This variant on get_tag_keys returns a Python tuple of strings keys. */ PyObject *Extension:: get_tag_keys() const { @@ -195,20 +86,138 @@ get_tag_keys() const { return result; } +/** + * Returns a dictionary of Python tags that is associated with the current + * node. This is similar to the regular tags, except this can store any + * Python object instead of just a string. However, the Python object is not + * recorded to a bam file. + */ +PyObject *Extension:: +get_python_tags() { + if (_this->_python_tag_data == NULL) { + _this->_python_tag_data = new PythonTagDataImpl; + + } else if (_this->_python_tag_data->get_ref_count() > 1) { + // Copy-on-write. + _this->_python_tag_data = new PythonTagDataImpl(*(PythonTagDataImpl *)_this->_python_tag_data.p()); + } + return ((PythonTagDataImpl *)_this->_python_tag_data.p())->_dict; +} + +/** + * Associates an arbitrary Python object with a user-defined key which is + * stored on the node. This is similar to set_tag(), except it can store any + * Python object instead of just a string. However, the Python object is not + * recorded to a bam file. + * + * Each unique key stores a different string value. There is no effective + * limit on the number of different keys that may be stored or on the length + * of any one key's value. + */ +int Extension:: +set_python_tag(PyObject *key, PyObject *value) { + return PyDict_SetItem(get_python_tags(), key, value); +} + +/** + * Retrieves the Python object that was previously set on this node for the + * particular key, if any. If no value has been previously set, returns None. + */ +PyObject *Extension:: +get_python_tag(PyObject *key) const { + if (_this->_python_tag_data == NULL) { + Py_INCREF(Py_None); + return Py_None; + } + + PyObject *dict = ((PythonTagDataImpl *)_this->_python_tag_data.p())->_dict; + PyObject *value = PyDict_GetItem(dict, key); + if (value == NULL) { + value = Py_None; + } + // PyDict_GetItem returns a borrowed reference. + Py_INCREF(value); + return value; +} + +/** + * Returns true if a Python object has been defined on this node for the + * particular key (even if that object is None), or false if no object has + * been set. + */ +bool Extension:: +has_python_tag(PyObject *key) const { + if (_this->_python_tag_data == NULL) { + return false; + } + + PyObject *dict = ((PythonTagDataImpl *)_this->_python_tag_data.p())->_dict; + return (PyDict_GetItem(dict, key) != NULL); +} + +/** + * Removes the Python object defined for this key on this particular node. + * After a call to clear_python_tag(), has_python_tag() will return false for + * the indicated key. + */ +void Extension:: +clear_python_tag(PyObject *key) { + if (_this->_python_tag_data == NULL) { + return; + } + + PyObject *dict = get_python_tags(); + if (PyDict_GetItem(dict, key) != NULL) { + PyDict_DelItem(dict, key); + } +} + /** * This variant on get_python_tag_keys returns a Python list of strings. */ PyObject *Extension:: get_python_tag_keys() const { - vector_string keys; - get_python_tag_keys(keys); - - PyObject *result = PyTuple_New(keys.size()); - for (size_t i = 0; i < keys.size(); ++i) { - PyTuple_SET_ITEM(result, i, Dtool_WrapValue(keys[i])); + if (_this->_python_tag_data == NULL) { + return PyTuple_New(0); } - return result; + PyObject *dict = ((PythonTagDataImpl *)_this->_python_tag_data.p())->_dict; + return PyDict_Keys(dict); +} + +/** + * Called by Python to implement cycle detection. + */ +int Extension:: +__traverse__(visitproc visit, void *arg) { + // To fully implement cycle breaking, we also have to recurse into all of + // the node's children. However, this seems like it would be potentially + // quite expensive, so I'd rather not do it unless we had some optimization + // that would allow us to quickly find out whether there are children with + // Python tags. + if (_this->_python_tag_data != NULL) { + Py_VISIT(((PythonTagDataImpl *)_this->_python_tag_data.p())->_dict); + } + return 0; +} + +/** + * Destroys the tags associated with the node. + */ +Extension::PythonTagDataImpl:: +~PythonTagDataImpl() { +#if defined(HAVE_THREADS) && !defined(SIMPLE_THREADS) + // This might happen at any time, so be sure the Python state is ready for + // it. + PyGILState_STATE gstate; + gstate = PyGILState_Ensure(); +#endif + + Py_CLEAR(_dict); + +#if defined(HAVE_THREADS) && !defined(SIMPLE_THREADS) + PyGILState_Release(gstate); +#endif } #endif // HAVE_PYTHON diff --git a/panda/src/pgraph/pandaNode_ext.h b/panda/src/pgraph/pandaNode_ext.h index f4be38279e..86527d42d4 100644 --- a/panda/src/pgraph/pandaNode_ext.h +++ b/panda/src/pgraph/pandaNode_ext.h @@ -34,12 +34,26 @@ public: PyObject *get_tag_keys() const; - void set_python_tag(const string &key, PyObject *value); - PyObject *get_python_tag(const string &key) const; - bool has_python_tag(const string &key) const; - void clear_python_tag(const string &key); - void get_python_tag_keys(vector_string &keys) const; + PyObject *get_python_tags(); + int set_python_tag(PyObject *keys, PyObject *value); + PyObject *get_python_tag(PyObject *keys) const; + bool has_python_tag(PyObject *keys) const; + void clear_python_tag(PyObject *keys); PyObject *get_python_tag_keys() const; + + // This is defined to implement cycle detection in Python tags. + int __traverse__(visitproc visit, void *arg); + +private: + // This is what actually stores the Python tags. + class PythonTagDataImpl : public PandaNode::PythonTagData { + public: + PythonTagDataImpl() : _dict(PyDict_New()) {}; + PythonTagDataImpl(const PythonTagDataImpl ©) : _dict(PyDict_Copy(copy._dict)) {}; + virtual ~PythonTagDataImpl(); + + PyObject *_dict; + }; }; #endif // HAVE_PYTHON diff --git a/panda/src/pgraph/renderModeAttrib.I b/panda/src/pgraph/renderModeAttrib.I index 5c42e42f53..8034b5cbc3 100644 --- a/panda/src/pgraph/renderModeAttrib.I +++ b/panda/src/pgraph/renderModeAttrib.I @@ -71,8 +71,12 @@ get_wireframe_color() const { INLINE int RenderModeAttrib:: get_geom_rendering(int geom_rendering) const { if (_mode == M_point) { - geom_rendering |= Geom::GR_point; + geom_rendering |= Geom::GR_point | Geom::GR_render_mode_point; + + } else if (_mode == M_wireframe) { + geom_rendering |= Geom::GR_render_mode_wireframe; } + if ((geom_rendering & Geom::GR_point) != 0) { if (_perspective) { geom_rendering |= (Geom::GR_point_perspective | Geom::GR_point_uniform_size); diff --git a/panda/src/pgraph/shaderInput.cxx b/panda/src/pgraph/shaderInput.cxx index 6ba5499490..3ee38ef70a 100644 --- a/panda/src/pgraph/shaderInput.cxx +++ b/panda/src/pgraph/shaderInput.cxx @@ -100,9 +100,15 @@ get_texture() const { */ const SamplerState &ShaderInput:: get_sampler() const { - return (_type == M_texture_sampler) - ? DCAST(ParamTextureSampler, _value)->get_sampler() - : get_texture()->get_default_sampler(); + if (_type == M_texture_sampler) { + return DCAST(ParamTextureSampler, _value)->get_sampler(); + + } else if (!_value.is_null()) { + return get_texture()->get_default_sampler(); + + } else { + return SamplerState::get_default(); + } } /** diff --git a/panda/src/pgraphnodes/sphereLight.h b/panda/src/pgraphnodes/sphereLight.h index da36d71fc2..4e4c885f7c 100644 --- a/panda/src/pgraphnodes/sphereLight.h +++ b/panda/src/pgraphnodes/sphereLight.h @@ -17,6 +17,7 @@ #include "pandabase.h" #include "lightLensNode.h" +#include "pointLight.h" /** * A sphere light is like a point light, except that it represents a sphere diff --git a/panda/src/physx/physxFileStream.h b/panda/src/physx/physxFileStream.h index a8cc858b1b..5b7682c9e0 100644 --- a/panda/src/physx/physxFileStream.h +++ b/panda/src/physx/physxFileStream.h @@ -17,6 +17,7 @@ #include "pandabase.h" #include "virtualFile.h" #include "filename.h" +#include #include "physx_includes.h" diff --git a/panda/src/pipeline/config_pipeline.cxx b/panda/src/pipeline/config_pipeline.cxx index 2dd7106dee..24b23da485 100644 --- a/panda/src/pipeline/config_pipeline.cxx +++ b/panda/src/pipeline/config_pipeline.cxx @@ -17,7 +17,6 @@ #include "externalThread.h" #include "genericThread.h" #include "thread.h" -#include "pythonThread.h" #include "pandaSystem.h" #include "dconfig.h" @@ -73,9 +72,6 @@ init_libpipeline() { ExternalThread::init_type(); GenericThread::init_type(); Thread::init_type(); -#ifdef HAVE_PYTHON - PythonThread::init_type(); -#endif // HAVE_PYTHON #ifdef HAVE_THREADS { diff --git a/panda/src/pipeline/cycleDataLockedReader.I b/panda/src/pipeline/cycleDataLockedReader.I index 05a66c6213..0ac88ebb67 100644 --- a/panda/src/pipeline/cycleDataLockedReader.I +++ b/panda/src/pipeline/cycleDataLockedReader.I @@ -61,6 +61,36 @@ operator = (const CycleDataLockedReader ©) { _cycler->increment_read(_pointer); } +#ifdef USE_MOVE_SEMANTICS +/** + * + */ +template +INLINE CycleDataLockedReader:: +CycleDataLockedReader(CycleDataLockedReader &&from) NOEXCEPT : + _cycler(from._cycler), + _current_thread(from._current_thread), + _pointer(from._pointer) +{ + from._pointer = NULL; +} + +/** + * + */ +template +INLINE void CycleDataLockedReader:: +operator = (CycleDataLockedReader &&from) NOEXCEPT { + nassertv(_pointer == (CycleDataType *)NULL); + nassertv(_current_thread == from._current_thread); + + _cycler = from._cycler; + _pointer = from._pointer; + + from._pointer = NULL; +} +#endif // USE_MOVE_SEMANTICS + /** * */ diff --git a/panda/src/pipeline/cycleDataLockedReader.h b/panda/src/pipeline/cycleDataLockedReader.h index 80deaf3dce..f66143fab4 100644 --- a/panda/src/pipeline/cycleDataLockedReader.h +++ b/panda/src/pipeline/cycleDataLockedReader.h @@ -47,6 +47,11 @@ public: INLINE CycleDataLockedReader(const CycleDataLockedReader ©); INLINE void operator = (const CycleDataLockedReader ©); +#if defined(USE_MOVE_SEMANTICS) && defined(DO_PIPELINING) + INLINE CycleDataLockedReader(CycleDataLockedReader &&from) NOEXCEPT; + INLINE void operator = (CycleDataLockedReader &&from) NOEXCEPT; +#endif + INLINE ~CycleDataLockedReader(); INLINE const CycleDataType *operator -> () const; diff --git a/panda/src/pipeline/cycleDataLockedStageReader.I b/panda/src/pipeline/cycleDataLockedStageReader.I index 521df13494..9f2c74d23a 100644 --- a/panda/src/pipeline/cycleDataLockedStageReader.I +++ b/panda/src/pipeline/cycleDataLockedStageReader.I @@ -64,6 +64,38 @@ operator = (const CycleDataLockedStageReader ©) { _cycler->increment_read(_pointer); } +#ifdef USE_MOVE_SEMANTICS +/** + * + */ +template +INLINE CycleDataLockedStageReader:: +CycleDataLockedStageReader(CycleDataLockedStageReader &&from) NOEXCEPT : + _cycler(from._cycler), + _current_thread(from._current_thread), + _pointer(from._pointer), + _stage(from._stage) +{ + from._pointer = NULL; +} + +/** + * + */ +template +INLINE void CycleDataLockedStageReader:: +operator = (CycleDataLockedStageReader &&from) NOEXCEPT { + nassertv(_pointer == (CycleDataType *)NULL); + nassertv(_current_thread == from._current_thread); + + _cycler = from._cycler; + _pointer = from._pointer; + _stage = from._stage; + + from._pointer = NULL; +} +#endif // USE_MOVE_SEMANTICS + /** * */ diff --git a/panda/src/pipeline/cycleDataLockedStageReader.h b/panda/src/pipeline/cycleDataLockedStageReader.h index 5b7e84cc19..6837a6edf4 100644 --- a/panda/src/pipeline/cycleDataLockedStageReader.h +++ b/panda/src/pipeline/cycleDataLockedStageReader.h @@ -34,6 +34,11 @@ public: INLINE CycleDataLockedStageReader(const CycleDataLockedStageReader ©); INLINE void operator = (const CycleDataLockedStageReader ©); +#if defined(USE_MOVE_SEMANTICS) && defined(DO_PIPELINING) + INLINE CycleDataLockedStageReader(CycleDataLockedStageReader &&from) NOEXCEPT; + INLINE void operator = (CycleDataLockedStageReader &&from) NOEXCEPT; +#endif + INLINE ~CycleDataLockedStageReader(); INLINE const CycleDataType *operator -> () const; diff --git a/panda/src/pipeline/cycleDataStageWriter.I b/panda/src/pipeline/cycleDataStageWriter.I index ab6c53544d..3e6d464768 100644 --- a/panda/src/pipeline/cycleDataStageWriter.I +++ b/panda/src/pipeline/cycleDataStageWriter.I @@ -114,6 +114,38 @@ CycleDataStageWriter(PipelineCycler &cycler, int stage, force_to_0, _current_thread); } +#ifdef USE_MOVE_SEMANTICS +/** + * + */ +template +INLINE CycleDataStageWriter:: +CycleDataStageWriter(CycleDataStageWriter &&from) NOEXCEPT : + _cycler(from._cycler), + _current_thread(from._current_thread), + _pointer(from._pointer), + _stage(from._stage) +{ + from._pointer = NULL; +} + +/** + * + */ +template +INLINE void CycleDataStageWriter:: +operator = (CycleDataStageWriter &&from) NOEXCEPT { + nassertv(_pointer == (CycleDataType *)NULL); + nassertv(_current_thread == from._current_thread); + + _cycler = from._cycler; + _pointer = from._pointer; + _stage = from._stage; + + from._pointer = NULL; +} +#endif // USE_MOVE_SEMANTICS + /** * */ diff --git a/panda/src/pipeline/cycleDataStageWriter.h b/panda/src/pipeline/cycleDataStageWriter.h index 967a367284..d154adb6d8 100644 --- a/panda/src/pipeline/cycleDataStageWriter.h +++ b/panda/src/pipeline/cycleDataStageWriter.h @@ -47,6 +47,11 @@ public: CycleDataLockedStageReader &take_from, bool force_to_0); +#if defined(USE_MOVE_SEMANTICS) && defined(DO_PIPELINING) + INLINE CycleDataStageWriter(CycleDataStageWriter &&from) NOEXCEPT; + INLINE void operator = (CycleDataStageWriter &&from) NOEXCEPT; +#endif + INLINE ~CycleDataStageWriter(); INLINE CycleDataType *operator -> (); diff --git a/panda/src/pipeline/cycleDataWriter.I b/panda/src/pipeline/cycleDataWriter.I index 0f0bc481eb..3706468612 100644 --- a/panda/src/pipeline/cycleDataWriter.I +++ b/panda/src/pipeline/cycleDataWriter.I @@ -122,7 +122,7 @@ template INLINE CycleDataWriter:: CycleDataWriter(PipelineCycler &cycler, CycleDataLockedReader &take_from, - bool force_to_0) : + bool force_to_0) : _cycler(&cycler), _current_thread(take_from.get_current_thread()) { @@ -130,6 +130,36 @@ CycleDataWriter(PipelineCycler &cycler, force_to_0, _current_thread); } +#ifdef USE_MOVE_SEMANTICS +/** + * + */ +template +INLINE CycleDataWriter:: +CycleDataWriter(CycleDataWriter &&from) NOEXCEPT : + _cycler(from._cycler), + _current_thread(from._current_thread), + _pointer(from._pointer) +{ + from._pointer = NULL; +} + +/** + * + */ +template +INLINE void CycleDataWriter:: +operator = (CycleDataWriter &&from) NOEXCEPT { + nassertv(_pointer == (CycleDataType *)NULL); + nassertv(_current_thread == from._current_thread); + + _cycler = from._cycler; + _pointer = from._pointer; + + from._pointer = NULL; +} +#endif // USE_MOVE_SEMANTICS + /** * */ diff --git a/panda/src/pipeline/cycleDataWriter.h b/panda/src/pipeline/cycleDataWriter.h index c62f034ca3..e2a4da7831 100644 --- a/panda/src/pipeline/cycleDataWriter.h +++ b/panda/src/pipeline/cycleDataWriter.h @@ -49,6 +49,11 @@ public: INLINE CycleDataWriter(PipelineCycler &cycler, CycleDataLockedReader &take_from); INLINE CycleDataWriter(PipelineCycler &cycler, CycleDataLockedReader &take_from, bool force_to_0); +#if defined(USE_MOVE_SEMANTICS) && defined(DO_PIPELINING) + INLINE CycleDataWriter(CycleDataWriter &&from) NOEXCEPT; + INLINE void operator = (CycleDataWriter &&from) NOEXCEPT; +#endif + INLINE ~CycleDataWriter(); INLINE CycleDataType *operator -> (); diff --git a/panda/src/pipeline/p3pipeline_composite2.cxx b/panda/src/pipeline/p3pipeline_composite2.cxx index e5ee007a77..e6607a6ebf 100644 --- a/panda/src/pipeline/p3pipeline_composite2.cxx +++ b/panda/src/pipeline/p3pipeline_composite2.cxx @@ -10,7 +10,6 @@ #include "pipelineCyclerTrueImpl.cxx" #include "pmutex.cxx" #include "psemaphore.cxx" -#include "pythonThread.cxx" #include "reMutex.cxx" #include "reMutexDirect.cxx" #include "reMutexHolder.cxx" diff --git a/panda/src/pipeline/pipelineCyclerTrueImpl.I b/panda/src/pipeline/pipelineCyclerTrueImpl.I index d2e78fca2d..2c393d0546 100644 --- a/panda/src/pipeline/pipelineCyclerTrueImpl.I +++ b/panda/src/pipeline/pipelineCyclerTrueImpl.I @@ -368,7 +368,13 @@ get_write_count() const { INLINE PT(CycleData) PipelineCyclerTrueImpl:: cycle_2() { TAU_PROFILE("PT(CycleData) PipelineCyclerTrueImpl::cycle_2()", " ", TAU_USER); - PT(CycleData) last_val = _data[1]._cdata.p(); + + // This trick moves an NPT into a PT without unnecessarily incrementing and + // subsequently decrementing the regular reference count. + PT(CycleData) last_val; + last_val.swap(_data[1]._cdata); + last_val->node_unref_only(); + nassertr(_lock.debug_is_locked(), last_val); nassertr(_dirty, last_val); nassertr(_num_stages == 2, last_val); @@ -389,7 +395,13 @@ cycle_2() { INLINE PT(CycleData) PipelineCyclerTrueImpl:: cycle_3() { TAU_PROFILE("PT(CycleData) PipelineCyclerTrueImpl::cycle_3()", " ", TAU_USER); - PT(CycleData) last_val = _data[2]._cdata.p(); + + // This trick moves an NPT into a PT without unnecessarily incrementing and + // subsequently decrementing the regular reference count. + PT(CycleData) last_val; + last_val.swap(_data[2]._cdata); + last_val->node_unref_only(); + nassertr(_lock.debug_is_locked(), last_val); nassertr(_dirty, last_val); nassertr(_num_stages == 3, last_val); diff --git a/panda/src/pipeline/pipelineCyclerTrueImpl.cxx b/panda/src/pipeline/pipelineCyclerTrueImpl.cxx index 9610a98bb9..b1466ce155 100644 --- a/panda/src/pipeline/pipelineCyclerTrueImpl.cxx +++ b/panda/src/pipeline/pipelineCyclerTrueImpl.cxx @@ -255,7 +255,12 @@ write_stage_upstream(int pipeline_stage, bool force_to_0, Thread *current_thread */ PT(CycleData) PipelineCyclerTrueImpl:: cycle() { - PT(CycleData) last_val = _data[_num_stages - 1]._cdata.p(); + // This trick moves an NPT into a PT without unnecessarily incrementing and + // subsequently decrementing the regular reference count. + PT(CycleData) last_val; + last_val.swap(_data[_num_stages - 1]._cdata); + last_val->node_unref_only(); + nassertr(_lock.debug_is_locked(), last_val); nassertr(_dirty, last_val); diff --git a/panda/src/pipeline/pythonThread.cxx b/panda/src/pipeline/pythonThread.cxx index 5800368b77..976e13aa57 100644 --- a/panda/src/pipeline/pythonThread.cxx +++ b/panda/src/pipeline/pythonThread.cxx @@ -36,18 +36,7 @@ PythonThread(PyObject *function, PyObject *args, nassert_raise("Invalid function passed to PythonThread constructor"); } - if (args == Py_None) { - // None means no arguments; create an empty tuple. - _args = PyTuple_New(0); - } else { - _args = NULL; - if (PySequence_Check(args)) { - _args = PySequence_Tuple(args); - } - if (_args == NULL) { - nassert_raise("Invalid args passed to PythonThread constructor"); - } - } + set_args(args); } /** @@ -73,13 +62,198 @@ join() { if (_result == NULL) { // No result; return None. - return Py_BuildValue(""); + Py_INCREF(Py_None); + return Py_None; } Py_INCREF(_result); return _result; } +/** + * + */ +PyObject *PythonThread:: +get_args() const { + return _args; +} + +/** + * + */ +void PythonThread:: +set_args(PyObject *args) { + Py_XDECREF(_args); + + if (args == Py_None) { + // None means no arguments; create an empty tuple. + _args = PyTuple_New(0); + } else { + _args = NULL; + if (PySequence_Check(args)) { + _args = PySequence_Tuple(args); + } + if (_args == NULL) { + Dtool_Raise_TypeError("PythonThread args must be a tuple"); + } + } +} + +#ifdef HAVE_PYTHON +/** + * Internal function to safely call a Python function within a sub-thread, + * that might execute in parallel with existing Python code. The return value + * is the return value of the Python function, or NULL if there was an + * exception. + */ +PyObject *PythonThread:: +call_python_func(PyObject *function, PyObject *args) { + Thread *current_thread = get_current_thread(); + + // Create a new Python thread state data structure, so Python can properly + // lock itself. + PyObject *result = NULL; + + if (current_thread == get_main_thread()) { + // In the main thread, just call the function. + result = PyObject_Call(function, args, NULL); + + if (result == (PyObject *)NULL) { + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_SystemExit)) { + // If we caught SystemExit, let it pass by without bothering to print + // a callback. + + } else { + // Temporarily save and restore the exception state so we can print a + // callback on-the-spot. + PyObject *exc, *val, *tb; + PyErr_Fetch(&exc, &val, &tb); + + Py_XINCREF(exc); + Py_XINCREF(val); + Py_XINCREF(tb); + PyErr_Restore(exc, val, tb); + PyErr_Print(); + + PyErr_Restore(exc, val, tb); + } + } + + } else { +#ifndef HAVE_THREADS + // Shouldn't be possible to come here without having some kind of + // threading support enabled. + nassertr(false, NULL); +#else + +#ifdef SIMPLE_THREADS + // We can't use the PyGILState interface, which assumes we are using true + // OS-level threading. PyGILState enforces policies like only one thread + // state per OS-level thread, which is not true in the case of + // SIMPLE_THREADS. + + // For some reason I don't fully understand, I'm getting a crash when I + // clean up old PyThreadState objects with PyThreadState_Delete(). It + // appears that the thread state is still referenced somewhere at the time + // I call delete, and the crash occurs because I've deleted an active + // pointer. + + // Storing these pointers in a vector for permanent recycling seems to + // avoid this problem. I wish I understood better what's going wrong, but + // I guess this workaround will do. + static pvector thread_states; + + PyThreadState *orig_thread_state = PyThreadState_Get(); + PyInterpreterState *istate = orig_thread_state->interp; + PyThreadState *new_thread_state; + if (thread_states.empty()) { + new_thread_state = PyThreadState_New(istate); + } else { + new_thread_state = thread_states.back(); + thread_states.pop_back(); + } + PyThreadState_Swap(new_thread_state); + + // Call the user's function. + result = PyObject_Call(function, args, NULL); + if (result == (PyObject *)NULL && PyErr_Occurred()) { + // We got an exception. Move the exception from the current thread into + // the main thread, so it can be handled there. + PyObject *exc, *val, *tb; + PyErr_Fetch(&exc, &val, &tb); + + thread_cat.error() + << "Exception occurred within " << *current_thread << "\n"; + + // Temporarily restore the exception state so we can print a callback + // on-the-spot. + Py_XINCREF(exc); + Py_XINCREF(val); + Py_XINCREF(tb); + PyErr_Restore(exc, val, tb); + PyErr_Print(); + + PyThreadState_Swap(orig_thread_state); + thread_states.push_back(new_thread_state); + // PyThreadState_Clear(new_thread_state); + // PyThreadState_Delete(new_thread_state); + + PyErr_Restore(exc, val, tb); + + // Now attempt to force the main thread to the head of the ready queue, + // so it can respond to the exception immediately. This only works if + // the main thread is not blocked, of course. + Thread::get_main_thread()->preempt(); + + } else { + // No exception. Restore the thread state normally. + PyThreadState *state = PyThreadState_Swap(orig_thread_state); + thread_states.push_back(new_thread_state); + // PyThreadState_Clear(new_thread_state); + // PyThreadState_Delete(new_thread_state); + } + +#else // SIMPLE_THREADS + // With true threading enabled, we're better off using PyGILState. + PyGILState_STATE gstate; + gstate = PyGILState_Ensure(); + + // Call the user's function. + result = PyObject_Call(function, args, NULL); + if (result == (PyObject *)NULL && PyErr_Occurred()) { + // We got an exception. Move the exception from the current thread into + // the main thread, so it can be handled there. + PyObject *exc, *val, *tb; + PyErr_Fetch(&exc, &val, &tb); + + thread_cat.error() + << "Exception occurred within " << *current_thread << "\n"; + + // Temporarily restore the exception state so we can print a callback + // on-the-spot. + Py_XINCREF(exc); + Py_XINCREF(val); + Py_XINCREF(tb); + PyErr_Restore(exc, val, tb); + PyErr_Print(); + + PyGILState_Release(gstate); + + PyErr_Restore(exc, val, tb); + } else { + // No exception. Restore the thread state normally. + PyGILState_Release(gstate); + } + + +#endif // SIMPLE_THREADS +#endif // HAVE_THREADS + } + + return result; +} +#endif // HAVE_PYTHON + /** * */ diff --git a/panda/src/pipeline/pythonThread.h b/panda/src/pipeline/pythonThread.h index f5b015deae..ea3adc2ac2 100644 --- a/panda/src/pipeline/pythonThread.h +++ b/panda/src/pipeline/pythonThread.h @@ -24,7 +24,7 @@ * the Python level. It will spawn a thread that executes an arbitrary Python * functor. */ -class EXPCL_PANDA_PIPELINE PythonThread : public Thread { +class PythonThread : public Thread { PUBLISHED: PythonThread(PyObject *function, PyObject *args, const string &name, const string &sync_name); @@ -32,6 +32,15 @@ PUBLISHED: BLOCKING PyObject *join(); +public: + PyObject *get_args() const; + void set_args(PyObject *); + + static PyObject *call_python_func(PyObject *function, PyObject *args); + +PUBLISHED: + MAKE_PROPERTY(args, get_args, set_args); + protected: virtual void thread_main(); diff --git a/panda/src/pipeline/thread.I b/panda/src/pipeline/thread.I index 159f764d6d..b721486c72 100644 --- a/panda/src/pipeline/thread.I +++ b/panda/src/pipeline/thread.I @@ -48,6 +48,16 @@ get_pstats_index() const { return _pstats_index; } +/** + * Returns the Python index associated with this thread, or -1 if no index has + * yet been associated with this thread. This is used internally by the + * direct.stdpy.thread module; you should not need to call this directly. + */ +INLINE int Thread:: +get_python_index() const { + return _python_index; +} + /** * Returns a string that is guaranteed to be unique to this thread, across all * processes on the machine, during at least the lifetime of this process. @@ -263,6 +273,15 @@ get_current_task() const { return _current_task; } +/** + * Stores a Python index to be associated with this thread. This is used + * internally by the thread module; you should not need to call this directly. + */ +INLINE void Thread:: +set_python_index(int python_index) { + _python_index = python_index; +} + /** * Should be called by the main thread just before exiting the program, this * blocks until any remaining thread cleanup has finished. diff --git a/panda/src/pipeline/thread.cxx b/panda/src/pipeline/thread.cxx index db22ee5803..6a0f0278fc 100644 --- a/panda/src/pipeline/thread.cxx +++ b/panda/src/pipeline/thread.cxx @@ -19,10 +19,6 @@ #include "conditionVarDebug.h" #include "conditionVarFullDebug.h" -#ifdef HAVE_PYTHON -#include "py_panda.h" -#endif - Thread *Thread::_main_thread; Thread *Thread::_external_thread; TypeHandle Thread::_type_handle; @@ -47,33 +43,17 @@ Thread(const string &name, const string &sync_name) : { _started = false; _pstats_index = -1; + _python_index = -1; _pstats_callback = NULL; _pipeline_stage = 0; _joinable = false; _current_task = NULL; -#ifdef HAVE_PYTHON - _python_data = Py_None; - Py_INCREF(_python_data); -#endif - #ifdef DEBUG_THREADS _blocked_on_mutex = NULL; _waiting_on_cvar = NULL; _waiting_on_cvar_full = NULL; #endif - -#if defined(HAVE_PYTHON) && !defined(SIMPLE_THREADS) - // Ensure that the Python threading system is initialized and ready to go. -#ifdef WITH_THREAD // This symbol defined within Python.h - -#if PY_VERSION_HEX >= 0x03020000 - Py_Initialize(); -#endif - - PyEval_InitThreads(); -#endif -#endif } /** @@ -81,10 +61,6 @@ Thread(const string &name, const string &sync_name) : */ Thread:: ~Thread() { -#ifdef HAVE_PYTHON - Py_DECREF(_python_data); -#endif - #ifdef DEBUG_THREADS nassertv(_blocked_on_mutex == NULL && _waiting_on_cvar == NULL && @@ -225,242 +201,6 @@ start(ThreadPriority priority, bool joinable) { return _started; } -#ifdef HAVE_PYTHON -/** - * Sets an arbitrary Python object that may be associated with this thread - * object. This is just for the purposes of associated arbitrary Python data - * with the C++ object; other than managing the reference count, the C++ code - * does nothing with this object. - */ -void Thread:: -set_python_data(PyObject *python_data) { - Py_DECREF(_python_data); - _python_data = python_data; - Py_INCREF(_python_data); -} -#endif // HAVE_PYTHON - -#ifdef HAVE_PYTHON -/** - * Returns the Python object that was set with set_python_data(). - */ -PyObject *Thread:: -get_python_data() const { - Py_INCREF(_python_data); - return _python_data; -} -#endif // HAVE_PYTHON - -#ifdef HAVE_PYTHON -/** - * Internal function to safely call a Python function within a sub-thread, - * that might execute in parallel with existing Python code. The return value - * is the return value of the Python function, or NULL if there was an - * exception. - */ -PyObject *Thread:: -call_python_func(PyObject *function, PyObject *args) { - nassertr(this == get_current_thread(), NULL); - - // Create a new Python thread state data structure, so Python can properly - // lock itself. - PyObject *result = NULL; - - if (this == get_main_thread()) { - // In the main thread, just call the function. - result = PyObject_Call(function, args, NULL); - - if (result == (PyObject *)NULL) { - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_SystemExit)) { - // If we caught SystemExit, let it pass by without bothering to print - // a callback. - - } else { - // Temporarily save and restore the exception state so we can print a - // callback on-the-spot. - PyObject *exc, *val, *tb; - PyErr_Fetch(&exc, &val, &tb); - - Py_XINCREF(exc); - Py_XINCREF(val); - Py_XINCREF(tb); - PyErr_Restore(exc, val, tb); - PyErr_Print(); - - PyErr_Restore(exc, val, tb); - } - } - - } else { -#ifndef HAVE_THREADS - // Shouldn't be possible to come here without having some kind of - // threading support enabled. - nassertr(false, NULL); -#else - -#ifdef SIMPLE_THREADS - // We can't use the PyGILState interface, which assumes we are using true - // OS-level threading. PyGILState enforces policies like only one thread - // state per OS-level thread, which is not true in the case of - // SIMPLE_THREADS. - - // For some reason I don't fully understand, I'm getting a crash when I - // clean up old PyThreadState objects with PyThreadState_Delete(). It - // appears that the thread state is still referenced somewhere at the time - // I call delete, and the crash occurs because I've deleted an active - // pointer. - - // Storing these pointers in a vector for permanent recycling seems to - // avoid this problem. I wish I understood better what's going wrong, but - // I guess this workaround will do. - static pvector thread_states; - - PyThreadState *orig_thread_state = PyThreadState_Get(); - PyInterpreterState *istate = orig_thread_state->interp; - PyThreadState *new_thread_state; - if (thread_states.empty()) { - new_thread_state = PyThreadState_New(istate); - } else { - new_thread_state = thread_states.back(); - thread_states.pop_back(); - } - PyThreadState_Swap(new_thread_state); - - // Call the user's function. - result = PyObject_Call(function, args, NULL); - if (result == (PyObject *)NULL && PyErr_Occurred()) { - // We got an exception. Move the exception from the current thread into - // the main thread, so it can be handled there. - PyObject *exc, *val, *tb; - PyErr_Fetch(&exc, &val, &tb); - - thread_cat.error() - << "Exception occurred within " << *this << "\n"; - - // Temporarily restore the exception state so we can print a callback - // on-the-spot. - Py_XINCREF(exc); - Py_XINCREF(val); - Py_XINCREF(tb); - PyErr_Restore(exc, val, tb); - PyErr_Print(); - - PyThreadState_Swap(orig_thread_state); - thread_states.push_back(new_thread_state); - // PyThreadState_Clear(new_thread_state); - // PyThreadState_Delete(new_thread_state); - - PyErr_Restore(exc, val, tb); - - // Now attempt to force the main thread to the head of the ready queue, - // so it can respond to the exception immediately. This only works if - // the main thread is not blocked, of course. - Thread::get_main_thread()->preempt(); - - } else { - // No exception. Restore the thread state normally. - PyThreadState *state = PyThreadState_Swap(orig_thread_state); - thread_states.push_back(new_thread_state); - // PyThreadState_Clear(new_thread_state); - // PyThreadState_Delete(new_thread_state); - } - -#else // SIMPLE_THREADS - // With true threading enabled, we're better off using PyGILState. - PyGILState_STATE gstate; - gstate = PyGILState_Ensure(); - - // Call the user's function. - result = PyObject_Call(function, args, NULL); - if (result == (PyObject *)NULL && PyErr_Occurred()) { - // We got an exception. Move the exception from the current thread into - // the main thread, so it can be handled there. - PyObject *exc, *val, *tb; - PyErr_Fetch(&exc, &val, &tb); - - thread_cat.error() - << "Exception occurred within " << *this << "\n"; - - // Temporarily restore the exception state so we can print a callback - // on-the-spot. - Py_XINCREF(exc); - Py_XINCREF(val); - Py_XINCREF(tb); - PyErr_Restore(exc, val, tb); - PyErr_Print(); - - PyGILState_Release(gstate); - - PyErr_Restore(exc, val, tb); - } else { - // No exception. Restore the thread state normally. - PyGILState_Release(gstate); - } - - -#endif // SIMPLE_THREADS -#endif // HAVE_THREADS - } - - return result; -} -#endif // HAVE_PYTHON - -#ifdef HAVE_PYTHON -/** - * Called when a Python exception is raised during processing of a thread. - * Gets the error string and passes it back to the calling Python process in a - * sensible way. - */ -void Thread:: -handle_python_exception() { - /* - PyObject *exc, *val, *tb; - PyErr_Fetch(&exc, &val, &tb); - - ostringstream strm; - strm << "\n"; - - if (PyObject_HasAttrString(exc, "__name__")) { - PyObject *exc_name = PyObject_GetAttrString(exc, "__name__"); - PyObject *exc_str = PyObject_Str(exc_name); - strm << PyString_AsString(exc_str); - Py_DECREF(exc_str); - Py_DECREF(exc_name); - } else { - PyObject *exc_str = PyObject_Str(exc); - strm << PyString_AsString(exc_str); - Py_DECREF(exc_str); - } - Py_DECREF(exc); - - if (val != (PyObject *)NULL) { - PyObject *val_str = PyObject_Str(val); - strm << ": " << PyString_AsString(val_str); - Py_DECREF(val_str); - Py_DECREF(val); - } - if (tb != (PyObject *)NULL) { - Py_DECREF(tb); - } - - strm << "\nException occurred within thread " << get_name(); - string message = strm.str(); - nout << message << "\n"; - - nassert_raise(message); - */ - - thread_cat.error() - << "Exception occurred within " << *this << "\n"; - - // Now attempt to force the main thread to the head of the ready queue, so - // it will be the one to receive the above assertion. This mainly only has - // an effect if SIMPLE_THREADS is in use. - Thread::get_main_thread()->preempt(); -} -#endif // HAVE_PYTHON - /** * Creates the Thread object that represents the main thread. */ diff --git a/panda/src/pipeline/thread.h b/panda/src/pipeline/thread.h index 71cbe8bcce..2240174f02 100644 --- a/panda/src/pipeline/thread.h +++ b/panda/src/pipeline/thread.h @@ -59,6 +59,7 @@ PUBLISHED: INLINE const string &get_sync_name() const; INLINE int get_pstats_index() const; + INLINE int get_python_index() const; INLINE string get_unique_id() const; INLINE int get_pipeline_stage() const; @@ -88,15 +89,21 @@ PUBLISHED: BLOCKING INLINE void join(); INLINE void preempt(); -#ifdef HAVE_PYTHON - void set_python_data(PyObject *python_data); - PyObject *get_python_data() const; -#endif - INLINE AsyncTaskBase *get_current_task() const; + INLINE void set_python_index(int index); + INLINE static void prepare_for_exit(); + MAKE_PROPERTY(sync_name, get_sync_name); + MAKE_PROPERTY(pstats_index, get_pstats_index); + MAKE_PROPERTY(python_index, get_python_index); + MAKE_PROPERTY(unique_id, get_unique_id); + MAKE_PROPERTY(pipeline_stage, get_pipeline_stage, set_pipeline_stage); + MAKE_PROPERTY(started, is_started); + MAKE_PROPERTY(joinable, is_joinable); + MAKE_PROPERTY(current_task, get_current_task); + public: // This class allows integration with PStats, particularly in the // SIMPLE_THREADS case. @@ -111,12 +118,6 @@ public: INLINE void set_pstats_callback(PStatsCallback *pstats_callback); INLINE PStatsCallback *get_pstats_callback() const; -#ifdef HAVE_PYTHON - // Integration with Python. - PyObject *call_python_func(PyObject *function, PyObject *args); - void handle_python_exception(); -#endif // HAVE_PYTHON - private: static void init_main_thread(); static void init_external_thread(); @@ -133,9 +134,7 @@ private: bool _joinable; AsyncTaskBase *_current_task; -#ifdef HAVE_PYTHON - PyObject *_python_data; -#endif + int _python_index; #ifdef DEBUG_THREADS MutexDebug *_blocked_on_mutex; diff --git a/panda/src/pnmimage/pfmFile.cxx b/panda/src/pnmimage/pfmFile.cxx index 214c028dd7..d0424fcafe 100644 --- a/panda/src/pnmimage/pfmFile.cxx +++ b/panda/src/pnmimage/pfmFile.cxx @@ -86,7 +86,8 @@ clear() { void PfmFile:: clear(int x_size, int y_size, int num_channels) { nassertv(x_size >= 0 && y_size >= 0); - nassertv(num_channels > 0 && num_channels <= 4 || (x_size == 0 && y_size == 0 && num_channels == 0)); + nassertv((num_channels > 0 && num_channels <= 4) || + (x_size == 0 && y_size == 0 && num_channels == 0)); _x_size = x_size; _y_size = y_size; @@ -632,7 +633,6 @@ calc_average_point(LPoint3f &result, PN_float32 x, PN_float32 y, PN_float32 radi continue; } - const LPoint3f &p = get_point(xi, yi); int gi = (yi - min_y) * y_size + (xi - min_x); nassertr(gi >= 0 && gi < size, false); mini_grid[gi]._sxi = xi; @@ -1544,7 +1544,7 @@ apply_crop(int x_begin, int x_end, int y_begin, int y_end) { int new_x_size = x_end - x_begin; int new_y_size = y_end - y_begin; Table new_table; - int new_size = new_x_size * new_y_size * _num_channels; + size_t new_size = (size_t)new_x_size * (size_t)new_y_size * (size_t)_num_channels; // We allocate a little bit bigger to allow safe overflow: you can call // get_point3() or get_point4() on the last point of a 1- or 3-channel diff --git a/panda/src/pnmimage/pfmFile.h b/panda/src/pnmimage/pfmFile.h index d1bb93bcc4..74eda76bce 100644 --- a/panda/src/pnmimage/pfmFile.h +++ b/panda/src/pnmimage/pfmFile.h @@ -170,9 +170,9 @@ PUBLISHED: void output(ostream &out) const; +#ifdef HAVE_PYTHON EXTENSION(PyObject *get_points() const); -#if PY_VERSION_HEX >= 0x02060000 EXTENSION(int __getbuffer__(PyObject *self, Py_buffer *view, int flags) const); #endif diff --git a/panda/src/pnmimage/pfmFile_ext.cxx b/panda/src/pnmimage/pfmFile_ext.cxx index a6306cbbf4..4e041e986f 100644 --- a/panda/src/pnmimage/pfmFile_ext.cxx +++ b/panda/src/pnmimage/pfmFile_ext.cxx @@ -70,7 +70,6 @@ get_points() const { return list; } -#if PY_VERSION_HEX >= 0x02060000 /** * This is a very low-level function that returns a read-only multiview into * the internal table of floating-point numbers. Use this method at your own @@ -78,7 +77,7 @@ get_points() const { */ int Extension:: __getbuffer__(PyObject *self, Py_buffer *view, int flags) const { - +#if PY_VERSION_HEX >= 0x02060000 if ((flags & PyBUF_WRITABLE) == PyBUF_WRITABLE) { PyErr_SetString(PyExc_BufferError, "Object is not writable."); @@ -118,8 +117,9 @@ __getbuffer__(PyObject *self, Py_buffer *view, int flags) const { view->suboffsets = NULL; return 0; +#else + return -1; +#endif } -#endif // PY_VERSION_HEX >= 0x02060000 - #endif // HAVE_PYTHON diff --git a/panda/src/pnmimage/pfmFile_ext.h b/panda/src/pnmimage/pfmFile_ext.h index cf8d4b20aa..0476e7d3e8 100644 --- a/panda/src/pnmimage/pfmFile_ext.h +++ b/panda/src/pnmimage/pfmFile_ext.h @@ -31,9 +31,7 @@ class Extension : public ExtensionBase { public: PyObject *get_points() const; -#if PY_VERSION_HEX >= 0x02060000 int __getbuffer__(PyObject *self, Py_buffer *view, int flags) const; -#endif }; #endif // HAVE_PYTHON diff --git a/panda/src/pnmimage/pnm-image-filter-core.cxx b/panda/src/pnmimage/pnm-image-filter-core.cxx index 8907068b50..273a4b0713 100644 --- a/panda/src/pnmimage/pnm-image-filter-core.cxx +++ b/panda/src/pnmimage/pnm-image-filter-core.cxx @@ -25,7 +25,6 @@ FUNCTION_NAME(IMAGETYPE &dest, const IMAGETYPE &source, // the image xelvals scaled in the A direction only. This will hold the // adjusted xel data from our first pass. - typedef StoreType *StoreTypeP; StoreType **matrix = (StoreType **)PANDA_MALLOC_ARRAY(dest.ASIZE() * sizeof(StoreType *)); int a, b; diff --git a/panda/src/pnmimage/pnm-image-filter-sparse-core.cxx b/panda/src/pnmimage/pnm-image-filter-sparse-core.cxx index 0709c25cd3..4edf632ee4 100644 --- a/panda/src/pnmimage/pnm-image-filter-sparse-core.cxx +++ b/panda/src/pnmimage/pnm-image-filter-sparse-core.cxx @@ -27,7 +27,6 @@ FUNCTION_NAME(IMAGETYPE &dest, const IMAGETYPE &source, // the image xelvals scaled in the A direction only. This will hold the // adjusted xel data from our first pass. - typedef StoreType *StoreTypeP; StoreType **matrix = (StoreType **)PANDA_MALLOC_ARRAY(dest.ASIZE() * sizeof(StoreType *)); StoreType **matrix_weight = (StoreType **)PANDA_MALLOC_ARRAY(dest.ASIZE() * sizeof(StoreType *)); diff --git a/panda/src/pnmimagetypes/pnmFileTypeBMPReader.cxx b/panda/src/pnmimagetypes/pnmFileTypeBMPReader.cxx index 8d5336b75b..5d33812216 100644 --- a/panda/src/pnmimagetypes/pnmFileTypeBMPReader.cxx +++ b/panda/src/pnmimagetypes/pnmFileTypeBMPReader.cxx @@ -226,7 +226,7 @@ BMPreadinfoheader( * for the required total. */ if (classv != C_OS2) { - for (int i = 0; i < cbFix - 16; i += 4) { + for (int i = 0; i < (int)cbFix - 16; i += 4) { GetLong(fp); } } diff --git a/panda/src/pnmimagetypes/pnmFileTypePNM.cxx b/panda/src/pnmimagetypes/pnmFileTypePNM.cxx index d1ada1a078..efbee9e646 100644 --- a/panda/src/pnmimagetypes/pnmFileTypePNM.cxx +++ b/panda/src/pnmimagetypes/pnmFileTypePNM.cxx @@ -649,10 +649,10 @@ writePackedRawRow(ostream * const fileP, const unsigned char * const packed_bits, int const cols) { - int bytesWritten; fileP->write((const char *)packed_bits, pbm_packed_bytes(cols)); - if (fileP->fail()) + if (fileP->fail()) { pm_error("I/O error writing packed row to raw PBM file."); + } } static void diff --git a/panda/src/pnmimagetypes/pnmFileTypeStbImage.cxx b/panda/src/pnmimagetypes/pnmFileTypeStbImage.cxx index 2c8932f7c9..2807ee1b18 100644 --- a/panda/src/pnmimagetypes/pnmFileTypeStbImage.cxx +++ b/panda/src/pnmimagetypes/pnmFileTypeStbImage.cxx @@ -114,10 +114,10 @@ static void cb_skip(void *user, int n) { // Implement skip by just reading and discarding the result. static const int size = 4096; - char data[4096]; - while (n > 4096) { - in->read(data, 4096); - n -= 4096; + char data[size]; + while (n > size) { + in->read(data, size); + n -= size; } if (n > 0) { in->read(data, n); diff --git a/panda/src/pnmtext/freetypeFont.cxx b/panda/src/pnmtext/freetypeFont.cxx index d66bcee868..f42b5b72bc 100644 --- a/panda/src/pnmtext/freetypeFont.cxx +++ b/panda/src/pnmtext/freetypeFont.cxx @@ -241,8 +241,8 @@ copy_bitmap_to_pnmimage(const FT_Bitmap &bitmap, PNMImage &image) { // This is the easy case: we can copy the rendered glyph directly into our // image, one pixel at a time. unsigned char *buffer_row = bitmap.buffer; - for (int yi = 0; yi < bitmap.rows; yi++) { - for (int xi = 0; xi < bitmap.width; xi++) { + for (int yi = 0; yi < (int)bitmap.rows; yi++) { + for (int xi = 0; xi < (int)bitmap.width; xi++) { image.set_gray_val(xi, yi, buffer_row[xi]); } buffer_row += bitmap.pitch; @@ -252,11 +252,11 @@ copy_bitmap_to_pnmimage(const FT_Bitmap &bitmap, PNMImage &image) { // This is a little bit more work: we have to expand the one-bit-per-pixel // bitmap into a one-byte-per-pixel image. unsigned char *buffer_row = bitmap.buffer; - for (int yi = 0; yi < bitmap.rows; yi++) { + for (int yi = 0; yi < (int)bitmap.rows; yi++) { xelval maxval = image.get_maxval(); int bit = 0x80; unsigned char *b = buffer_row; - for (int xi = 0; xi < bitmap.width; xi++) { + for (int xi = 0; xi < (int)bitmap.width; xi++) { if (*b & bit) { image.set_gray_val(xi, yi, maxval); } else { @@ -277,8 +277,8 @@ copy_bitmap_to_pnmimage(const FT_Bitmap &bitmap, PNMImage &image) { // Here we must expand a grayscale pixmap with n levels of gray into our // 256-level texture. unsigned char *buffer_row = bitmap.buffer; - for (int yi = 0; yi < bitmap.rows; yi++) { - for (int xi = 0; xi < bitmap.width; xi++) { + for (int yi = 0; yi < (int)bitmap.rows; yi++) { + for (int xi = 0; xi < (int)bitmap.width; xi++) { image.set_gray(xi, yi, (PN_stdfloat)buffer_row[xi] / (bitmap.num_grays - 1)); } buffer_row += bitmap.pitch; @@ -691,7 +691,6 @@ outline_nurbs(NurbsCurveResult *ncr) { PN_stdfloat st0 = st, st1 = st; if (i > 0) { - PN_stdfloat last_t = ncr->get_sample_t(i - 1); st0 = ncr->get_sample_t(i - 1) * 0.1f + st * 0.9f; } if (i < num_samples - 1) { diff --git a/panda/src/pstatclient/pStatClient.I b/panda/src/pstatclient/pStatClient.I index 5416b31234..8ce9381978 100644 --- a/panda/src/pstatclient/pStatClient.I +++ b/panda/src/pstatclient/pStatClient.I @@ -11,47 +11,6 @@ * @date 2000-07-16 */ -/** - * Sets the name of the client. This is reported to the PStatsServer, and - * will presumably be written in the title bar or something. - */ -INLINE void PStatClient:: -set_client_name(const string &name) { - get_impl()->set_client_name(name); -} - -/** - * Retrieves the name of the client as set. - */ -INLINE string PStatClient:: -get_client_name() const { - return get_impl()->get_client_name(); -} - -/** - * Controls the number of packets that will be sent to the server. Normally, - * one packet is sent per frame, but this can flood the server with more - * packets than it can handle if the frame rate is especially good (e.g. if - * nothing is onscreen at the moment). Set this parameter to a reasonable - * number to prevent this from happening. - * - * This number specifies the maximum number of packets that will be sent to - * the server per second, per thread. - */ -INLINE void PStatClient:: -set_max_rate(double rate) { - get_impl()->set_max_rate(rate); -} - -/** - * Returns the maximum number of packets that will be sent to the server per - * second, per thread. See set_max_rate(). - */ -INLINE double PStatClient:: -get_max_rate() const { - return get_impl()->get_max_rate(); -} - /** * Returns the total number of collectors the Client knows about. */ @@ -111,20 +70,6 @@ get_thread_object(int index) const { return thread->_thread; } -/** - * Returns the time according to to the PStatClient's clock object. It keeps - * its own clock, instead of using the global clock object, so the stats won't - * get mucked up if you put the global clock in non-real-time mode or - * something. - */ -INLINE double PStatClient:: -get_real_time() const { - if (has_impl()) { - return _impl->get_real_time(); - } - return 0.0f; -} - /** * Attempts to establish a connection to the indicated PStatServer. Returns * true if successful, false on failure. @@ -161,36 +106,6 @@ resume_after_pause() { get_global_pstats()->client_resume_after_pause(); } -/** - * The nonstatic implementation of connect(). - */ -INLINE bool PStatClient:: -client_connect(string hostname, int port) { - ReMutexHolder holder(_lock); - client_disconnect(); - return get_impl()->client_connect(hostname, port); -} - -/** - * The nonstatic implementation of is_connected(). - */ -INLINE bool PStatClient:: -client_is_connected() const { - return has_impl() && _impl->client_is_connected(); -} - -/** - * Resumes the PStatClient after the simulation has been paused for a while. - * This allows the stats to continue exactly where it left off, instead of - * leaving a big gap that would represent a chug. - */ -INLINE void PStatClient:: -client_resume_after_pause() { - if (has_impl()) { - _impl->client_resume_after_pause(); - } -} - /** * Returns true if the PStatClientImpl object has been created for this object * yet, false otherwise. @@ -208,9 +123,8 @@ INLINE PStatClientImpl *PStatClient:: get_impl() { ReMutexHolder holder(_lock); if (_impl == (PStatClientImpl *)NULL) { - _impl = new PStatClientImpl(this); + make_impl(); } - return _impl; } @@ -220,7 +134,11 @@ get_impl() { */ INLINE const PStatClientImpl *PStatClient:: get_impl() const { - return ((PStatClient *)this)->get_impl(); + ReMutexHolder holder(_lock); + if (_impl == (PStatClientImpl *)NULL) { + make_impl(); + } + return _impl; } /** diff --git a/panda/src/pstatclient/pStatClient.cxx b/panda/src/pstatclient/pStatClient.cxx index 9d87a13036..906d99a29a 100644 --- a/panda/src/pstatclient/pStatClient.cxx +++ b/panda/src/pstatclient/pStatClient.cxx @@ -104,6 +104,47 @@ PStatClient:: disconnect(); } +/** + * Sets the name of the client. This is reported to the PStatsServer, and + * will presumably be written in the title bar or something. + */ +void PStatClient:: +set_client_name(const string &name) { + get_impl()->set_client_name(name); +} + +/** + * Retrieves the name of the client as set. + */ +string PStatClient:: +get_client_name() const { + return get_impl()->get_client_name(); +} + +/** + * Controls the number of packets that will be sent to the server. Normally, + * one packet is sent per frame, but this can flood the server with more + * packets than it can handle if the frame rate is especially good (e.g. if + * nothing is onscreen at the moment). Set this parameter to a reasonable + * number to prevent this from happening. + * + * This number specifies the maximum number of packets that will be sent to + * the server per second, per thread. + */ +void PStatClient:: +set_max_rate(double rate) { + get_impl()->set_max_rate(rate); +} + +/** + * Returns the maximum number of packets that will be sent to the server per + * second, per thread. See set_max_rate(). + */ +double PStatClient:: +get_max_rate() const { + return get_impl()->get_max_rate(); +} + /** * Returns the nth collector. */ @@ -175,6 +216,20 @@ get_current_thread() const { return PStatThread(Thread::get_current_thread(), (PStatClient *)this); } +/** + * Returns the time according to to the PStatClient's clock object. It keeps + * its own clock, instead of using the global clock object, so the stats won't + * get mucked up if you put the global clock in non-real-time mode or + * something. + */ +double PStatClient:: +get_real_time() const { + if (has_impl()) { + return _impl->get_real_time(); + } + return 0.0f; +} + /** * A convenience function to call new_frame() on the global PStatClient's main * thread, and any other threads with a sync_name of "Main". @@ -383,6 +438,16 @@ client_thread_tick(const string &sync_name) { } } +/** + * The nonstatic implementation of connect(). + */ +bool PStatClient:: +client_connect(string hostname, int port) { + ReMutexHolder holder(_lock); + client_disconnect(); + return get_impl()->client_connect(hostname, port); +} + /** * The nonstatic implementation of disconnect(). */ @@ -416,6 +481,26 @@ client_disconnect() { } } +/** + * The nonstatic implementation of is_connected(). + */ +bool PStatClient:: +client_is_connected() const { + return has_impl() && _impl->client_is_connected(); +} + +/** + * Resumes the PStatClient after the simulation has been paused for a while. + * This allows the stats to continue exactly where it left off, instead of + * leaving a big gap that would represent a chug. + */ +void PStatClient:: +client_resume_after_pause() { + if (has_impl()) { + _impl->client_resume_after_pause(); + } +} + /** * Returns a pointer to the global PStatClient object. It's legal to declare * your own PStatClient locally, but it's also convenient to have a global one @@ -433,6 +518,14 @@ get_global_pstats() { return _global_pstats; } +/** + * Creates the PStatClientImpl class for this PStatClient. + */ +void PStatClient:: +make_impl() const { + _impl = new PStatClientImpl((PStatClient *)this); +} + /** * Returns a PStatCollector suitable for measuring categories with the * indicated name. This is normally called by a PStatCollector constructor. diff --git a/panda/src/pstatclient/pStatClient.h b/panda/src/pstatclient/pStatClient.h index 05d5dbadea..2d285c6f8a 100644 --- a/panda/src/pstatclient/pStatClient.h +++ b/panda/src/pstatclient/pStatClient.h @@ -17,7 +17,6 @@ #include "pandabase.h" #include "pStatFrameData.h" -#include "pStatClientImpl.h" #include "pStatCollectorDef.h" #include "reMutex.h" #include "lightMutex.h" @@ -31,6 +30,7 @@ #include "numeric_types.h" #include "bitArray.h" +class PStatClientImpl; class PStatCollector; class PStatCollectorDef; class PStatThread; @@ -50,16 +50,16 @@ class GraphicsStateGuardian; * is therefore defined as a stub class. */ #ifdef DO_PSTATS -class EXPCL_PANDA_PSTATCLIENT PStatClient : public ConnectionManager, public Thread::PStatsCallback { +class EXPCL_PANDA_PSTATCLIENT PStatClient : public Thread::PStatsCallback { public: PStatClient(); ~PStatClient(); PUBLISHED: - INLINE void set_client_name(const string &name); - INLINE string get_client_name() const; - INLINE void set_max_rate(double rate); - INLINE double get_max_rate() const; + void set_client_name(const string &name); + string get_client_name() const; + void set_max_rate(double rate); + double get_max_rate() const; INLINE int get_num_collectors() const; PStatCollector get_collector(int index) const; @@ -78,7 +78,7 @@ PUBLISHED: PStatThread get_main_thread() const; PStatThread get_current_thread() const; - INLINE double get_real_time() const; + double get_real_time() const; MAKE_PROPERTY(client_name, get_client_name, set_client_name); MAKE_PROPERTY(max_rate, get_max_rate, set_max_rate); @@ -99,11 +99,11 @@ PUBLISHED: void client_main_tick(); void client_thread_tick(const string &sync_name); - INLINE bool client_connect(string hostname, int port); + bool client_connect(string hostname, int port); void client_disconnect(); - INLINE bool client_is_connected() const; + bool client_is_connected() const; - INLINE void client_resume_after_pause(); + void client_resume_after_pause(); static PStatClient *get_global_pstats(); @@ -111,6 +111,7 @@ private: INLINE bool has_impl() const; INLINE PStatClientImpl *get_impl(); INLINE const PStatClientImpl *get_impl() const; + void make_impl() const; PStatCollector make_collector_with_relname(int parent_index, string relname); PStatCollector make_collector_with_name(int parent_index, const string &name); @@ -227,7 +228,7 @@ private: AtomicAdjust::Integer _threads_size; // size of the allocated array AtomicAdjust::Integer _num_threads; // number of in-use elements within the array - PStatClientImpl *_impl; + mutable PStatClientImpl *_impl; static PStatCollector _heap_total_size_pcollector; static PStatCollector _heap_overhead_size_pcollector; diff --git a/panda/src/pstatclient/pStatThread.I b/panda/src/pstatclient/pStatThread.I index fcfa992576..4fd43c5669 100644 --- a/panda/src/pstatclient/pStatThread.I +++ b/panda/src/pstatclient/pStatThread.I @@ -75,32 +75,6 @@ operator = (const PStatThread ©) { _index = copy._index; } -/** - * This must be called at the start of every "frame", whatever a frame may be - * deemed to be, to accumulate all the stats that have collected so far for - * the thread and ship them off to the server. - * - * Calling PStatClient::thread_tick() will automatically call this for any - * threads with the indicated sync name. - */ -INLINE void PStatThread:: -new_frame() { -#ifdef DO_PSTATS - _client->get_impl()->new_frame(_index); -#endif -} - -/** - * This is a slightly lower-level version of new_frame that also specifies the - * data to send for this frame. - */ -INLINE void PStatThread:: -add_frame(const PStatFrameData &frame_data) { -#ifdef DO_PSTATS - _client->get_impl()->add_frame(_index, frame_data); -#endif -} - /** * Returns the index number of this particular thread within the PStatClient. */ diff --git a/panda/src/pstatclient/pStatThread.cxx b/panda/src/pstatclient/pStatThread.cxx index 533fd10789..e263ac089a 100644 --- a/panda/src/pstatclient/pStatThread.cxx +++ b/panda/src/pstatclient/pStatThread.cxx @@ -13,6 +13,33 @@ #include "pStatThread.h" #include "pStatClient.h" +#include "pStatClientImpl.h" + +/** + * This must be called at the start of every "frame", whatever a frame may be + * deemed to be, to accumulate all the stats that have collected so far for + * the thread and ship them off to the server. + * + * Calling PStatClient::thread_tick() will automatically call this for any + * threads with the indicated sync name. + */ +void PStatThread:: +new_frame() { +#ifdef DO_PSTATS + _client->get_impl()->new_frame(_index); +#endif +} + +/** + * This is a slightly lower-level version of new_frame that also specifies the + * data to send for this frame. + */ +void PStatThread:: +add_frame(const PStatFrameData &frame_data) { +#ifdef DO_PSTATS + _client->get_impl()->add_frame(_index, frame_data); +#endif +} /** * Returns the Panda Thread object associated with this particular diff --git a/panda/src/pstatclient/pStatThread.h b/panda/src/pstatclient/pStatThread.h index 23ba20af8e..0ad8567c7a 100644 --- a/panda/src/pstatclient/pStatThread.h +++ b/panda/src/pstatclient/pStatThread.h @@ -36,8 +36,8 @@ PUBLISHED: INLINE PStatThread(const PStatThread ©); INLINE void operator = (const PStatThread ©); - INLINE void new_frame(); - INLINE void add_frame(const PStatFrameData &frame_data); + void new_frame(); + void add_frame(const PStatFrameData &frame_data); Thread *get_thread() const; INLINE int get_index() const; diff --git a/panda/src/putil/bamCache.cxx b/panda/src/putil/bamCache.cxx index 06211b5690..5576e16a43 100644 --- a/panda/src/putil/bamCache.cxx +++ b/panda/src/putil/bamCache.cxx @@ -310,13 +310,24 @@ emergency_read_only() { */ void BamCache:: consider_flush_index() { - ReMutexHolder holder(_lock); +#if defined(HAVE_THREADS) || defined(DEBUG_THREADS) + if (!_lock.try_acquire()) { + // If we can't grab the lock, no big deal. We don't want to hold up + // the frame waiting for a cache operation. We can try again later. + return; + } +#endif + if (_index_stale_since != 0) { int elapsed = (int)time(NULL) - (int)_index_stale_since; if (elapsed > _flush_time) { flush_index(); } } + +#if defined(HAVE_THREADS) || defined(DEBUG_THREADS) + _lock.release(); +#endif } /** diff --git a/panda/src/putil/bamCacheRecord.cxx b/panda/src/putil/bamCacheRecord.cxx index b13f1807ef..487d2b1e5d 100644 --- a/panda/src/putil/bamCacheRecord.cxx +++ b/panda/src/putil/bamCacheRecord.cxx @@ -232,15 +232,20 @@ format_timestamp(time_t timestamp) { } time_t now = time(NULL); - struct tm *tm_p = localtime(×tamp); + struct tm atm; +#ifdef _WIN32 + localtime_s(&atm, ×tamp); +#else + localtime_r(×tamp, &atm); +#endif if (timestamp > now || (now - timestamp > 86400 * 365)) { // A timestamp in the future, or more than a year in the past, gets a year // appended. - strftime(buffer, buffer_size, "%b %d %Y", tm_p); + strftime(buffer, buffer_size, "%b %d %Y", &atm); } else { // Otherwise, within the past year, show the date and time. - strftime(buffer, buffer_size, "%b %d %H:%M", tm_p); + strftime(buffer, buffer_size, "%b %d %H:%M", &atm); } return buffer; diff --git a/panda/src/putil/bamReader_ext.cxx b/panda/src/putil/bamReader_ext.cxx index 4a490f90d9..1648d7e24c 100644 --- a/panda/src/putil/bamReader_ext.cxx +++ b/panda/src/putil/bamReader_ext.cxx @@ -13,6 +13,7 @@ #include "bamReader_ext.h" #include "config_util.h" +#include "pythonThread.h" #ifdef HAVE_PYTHON @@ -45,8 +46,7 @@ static TypedWritable *factory_callback(const FactoryParams ¶ms){ PyObject *args = PyTuple_Pack(2, py_scan, py_manager); // Now call the Python function. - Thread *current_thread = Thread::get_current_thread(); - PyObject *result = current_thread->call_python_func(func, args); + PyObject *result = PythonThread::call_python_func(func, args); Py_DECREF(args); Py_DECREF(py_scan); Py_DECREF(py_manager); diff --git a/panda/src/putil/doubleBitMask.I b/panda/src/putil/doubleBitMask.I index 6d21ad2ffb..a6997af549 100644 --- a/panda/src/putil/doubleBitMask.I +++ b/panda/src/putil/doubleBitMask.I @@ -700,7 +700,7 @@ operator ^= (const DoubleBitMask &other) { template INLINE void DoubleBitMask:: operator <<= (int shift) { - _hi = (_hi << shift) | ((_lo >> half_bits - shift) & BitMaskType::lower_on(shift)); + _hi = (_hi << shift) | ((_lo >> (half_bits - shift)) & BitMaskType::lower_on(shift)); _lo <<= shift; } @@ -710,7 +710,7 @@ operator <<= (int shift) { template INLINE void DoubleBitMask:: operator >>= (int shift) { - _lo = (_lo >> shift) | ((_hi & BitMaskType::lower_on(shift)) << half_bits - shift); + _lo = (_lo >> shift) | ((_hi & BitMaskType::lower_on(shift)) << (half_bits - shift)); _hi >>= shift; } diff --git a/panda/src/putil/pythonCallbackObject.cxx b/panda/src/putil/pythonCallbackObject.cxx index 0679a4c473..fd1c9aa64f 100644 --- a/panda/src/putil/pythonCallbackObject.cxx +++ b/panda/src/putil/pythonCallbackObject.cxx @@ -16,7 +16,7 @@ #ifdef HAVE_PYTHON #include "py_panda.h" -#include "thread.h" +#include "pythonThread.h" #include "callbackData.h" #include "config_util.h" @@ -121,8 +121,7 @@ do_python_callback(CallbackData *cbdata) { PyObject *args = Py_BuildValue("(O)", pycbdata); Py_DECREF(pycbdata); - PyObject *result = - Thread::get_current_thread()->call_python_func(_function, args); + PyObject *result = PythonThread::call_python_func(_function, args); Py_DECREF(args); if (result == (PyObject *)NULL) { diff --git a/panda/src/putil/simpleHashMap.I b/panda/src/putil/simpleHashMap.I index 67db8830b9..d68fae9542 100644 --- a/panda/src/putil/simpleHashMap.I +++ b/panda/src/putil/simpleHashMap.I @@ -553,7 +553,6 @@ expand_table() { nassertv(_num_entries == 0); // Now copy the entries from the old table into the new table. - int num_added = 0; for (size_t i = 0; i < old_table_size; ++i) { if (old_map.has_element(i)) { size_t new_index = get_hash(old_map._table[i]._key); diff --git a/panda/src/putil/weakKeyHashMap.I b/panda/src/putil/weakKeyHashMap.I index ea5aa43e9a..c80e47723d 100644 --- a/panda/src/putil/weakKeyHashMap.I +++ b/panda/src/putil/weakKeyHashMap.I @@ -600,7 +600,6 @@ expand_table() { nassertv(_num_entries == 0); // Now copy the entries from the old table into the new table. - int num_added = 0; for (size_t i = 0; i < old_table_size; ++i) { if (old_map.has_element(i)) { size_t new_index = get_hash(old_map._table[i]._key.get_orig()); diff --git a/panda/src/rocket/rocketInputHandler.cxx b/panda/src/rocket/rocketInputHandler.cxx index 5451beda9e..fcfa6dc2cf 100644 --- a/panda/src/rocket/rocketInputHandler.cxx +++ b/panda/src/rocket/rocketInputHandler.cxx @@ -152,7 +152,6 @@ get_rocket_key(const ButtonHandle handle) { void RocketInputHandler:: do_transmit_data(DataGraphTraverser *trav, const DataNodeTransmit &input, DataNodeTransmit &output) { - Thread *current_thread = trav->get_current_thread(); MutexHolder holder(_lock); if (input.has_data(_pixel_xy_input)) { diff --git a/panda/src/rocket/rocketRegion_ext.cxx b/panda/src/rocket/rocketRegion_ext.cxx index adc73a219e..cb79f467a1 100644 --- a/panda/src/rocket/rocketRegion_ext.cxx +++ b/panda/src/rocket/rocketRegion_ext.cxx @@ -40,7 +40,8 @@ get_context() const { context->AddReference(); return py_context.ptr(); - } catch (const python::error_already_set& e) { + } catch (const python::error_already_set &e) { + (void)e; // Return NULL, which will trigger the exception in Python } return NULL; diff --git a/panda/src/testbed/pgrid.cxx b/panda/src/testbed/pgrid.cxx index 76f56a58d9..e028e6c03c 100644 --- a/panda/src/testbed/pgrid.cxx +++ b/panda/src/testbed/pgrid.cxx @@ -12,7 +12,6 @@ */ #include "pandaFramework.h" -#include "pystub.h" #include "pandaNode.h" #include "transformState.h" #include "clockObject.h" @@ -385,9 +384,6 @@ load_gridded_models(WindowFramework *window, int main(int argc, char **argv) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - preprocess_argv(argc, argv); PandaFramework framework; framework.open_framework(argc, argv); diff --git a/panda/src/testbed/pview.cxx b/panda/src/testbed/pview.cxx index f656a5de3d..c31537e2c5 100644 --- a/panda/src/testbed/pview.cxx +++ b/panda/src/testbed/pview.cxx @@ -13,7 +13,6 @@ #include "pandaFramework.h" #include "pandaSystem.h" -#include "pystub.h" #include "textNode.h" #include "configVariableBool.h" #include "texturePool.h" @@ -234,9 +233,6 @@ report_version() { int main(int argc, char **argv) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - preprocess_argv(argc, argv); framework.open_framework(argc, argv); framework.set_window_title("Panda Viewer"); diff --git a/panda/src/text/dynamicTextFont.cxx b/panda/src/text/dynamicTextFont.cxx index 705bd1a943..09369a12b9 100644 --- a/panda/src/text/dynamicTextFont.cxx +++ b/panda/src/text/dynamicTextFont.cxx @@ -220,7 +220,6 @@ write(ostream &out, int indent_level) const { Cache::const_iterator ci; for (ci = _cache.begin(); ci != _cache.end(); ++ci) { int glyph_index = (*ci).first; - const TextGlyph *glyph = (*ci).second; indent(out, indent_level + 2) << glyph_index; @@ -630,7 +629,7 @@ copy_bitmap_to_texture(const FT_Bitmap &bitmap, DynamicTextGlyph *glyph) { // This is the easy case: we can memcpy the rendered glyph directly into // our texture image, one row at a time. unsigned char *buffer_row = bitmap.buffer; - for (int yi = 0; yi < bitmap.rows; yi++) { + for (int yi = 0; yi < (int)bitmap.rows; yi++) { unsigned char *texture_row = glyph->get_row(yi); nassertv(texture_row != (unsigned char *)NULL); @@ -642,13 +641,13 @@ copy_bitmap_to_texture(const FT_Bitmap &bitmap, DynamicTextGlyph *glyph) { // This is a little bit more work: we have to expand the one-bit-per-pixel // bitmap into a one-byte-per-pixel texture. unsigned char *buffer_row = bitmap.buffer; - for (int yi = 0; yi < bitmap.rows; yi++) { + for (int yi = 0; yi < (int)bitmap.rows; yi++) { unsigned char *texture_row = glyph->get_row(yi); nassertv(texture_row != (unsigned char *)NULL); int bit = 0x80; unsigned char *b = buffer_row; - for (int xi = 0; xi < bitmap.width; xi++) { + for (int xi = 0; xi < (int)bitmap.width; xi++) { if (*b & bit) { texture_row[xi] = 0xff; } else { @@ -669,10 +668,10 @@ copy_bitmap_to_texture(const FT_Bitmap &bitmap, DynamicTextGlyph *glyph) { // Here we must expand a grayscale pixmap with n levels of gray into our // 256-level texture. unsigned char *buffer_row = bitmap.buffer; - for (int yi = 0; yi < bitmap.rows; yi++) { + for (int yi = 0; yi < (int)bitmap.rows; yi++) { unsigned char *texture_row = glyph->get_row(yi); nassertv(texture_row != (unsigned char *)NULL); - for (int xi = 0; xi < bitmap.width; xi++) { + for (int xi = 0; xi < (int)bitmap.width; xi++) { texture_row[xi] = (int)(buffer_row[xi] * 255) / (bitmap.num_grays - 1); } buffer_row += bitmap.pitch; diff --git a/panda/src/text/textAssembler.cxx b/panda/src/text/textAssembler.cxx index 996713a85a..4829576407 100644 --- a/panda/src/text/textAssembler.cxx +++ b/panda/src/text/textAssembler.cxx @@ -544,32 +544,34 @@ assemble_text() { } } - if (properties->has_shadow()) { + if (!placement._glyph.is_null()) { + if (properties->has_shadow()) { + if (_dynamic_merge) { + if (placement._glyph->has_quad()) { + placement.assign_quad_to(quad_shadow_map, shadow_state, shadow); + } else { + placement.assign_append_to(geom_shadow_collector_map, shadow_state, shadow); + } + } else { + placement.assign_to(shadow_geom_node, shadow_state, shadow); + } + + // Don't shadow the graphics. That can result in duplication of button + // objects, plus it looks weird. If you want a shadowed graphic, you + // can shadow it yourself before you add it. + // placement.copy_graphic_to(shadow_node, shadow_state, shadow); + any_shadow = true; + } + if (_dynamic_merge) { if (placement._glyph->has_quad()) { - placement.assign_quad_to(quad_shadow_map, shadow_state, shadow); + placement.assign_quad_to(quad_map, text_state); } else { - placement.assign_append_to(geom_shadow_collector_map, shadow_state, shadow); + placement.assign_append_to(geom_collector_map, text_state); } } else { - placement.assign_to(shadow_geom_node, shadow_state, shadow); + placement.assign_to(text_geom_node, text_state); } - - // Don't shadow the graphics. That can result in duplication of button - // objects, plus it looks weird. If you want a shadowed graphic, you - // can shadow it yourself before you add it. - // placement.copy_graphic_to(shadow_node, shadow_state, shadow); - any_shadow = true; - } - - if (_dynamic_merge) { - if (placement._glyph->has_quad()) { - placement.assign_quad_to(quad_map, text_state); - } else { - placement.assign_append_to(geom_collector_map, text_state); - } - } else { - placement.assign_to(text_geom_node, text_state); } placement.copy_graphic_to(text_node, text_state); } @@ -1327,10 +1329,9 @@ assemble_paragraph(TextAssembler::PlacedGlyphs &placed_glyphs) { // width is defined by the wordwrap size with the upper left corner // starting from 0,0,0 if the wordwrap size is unspecified the alignment // could eventually result wrong. - PN_stdfloat xpos; + PN_stdfloat xpos = 0; switch (align) { case TextProperties::A_left: - xpos = 0.0f; _lr[0] = max(_lr[0], row_width); break; @@ -1346,7 +1347,6 @@ assemble_paragraph(TextAssembler::PlacedGlyphs &placed_glyphs) { break; case TextProperties::A_boxed_left: - xpos = 0.0f; _lr[0] = max(_lr[0], max(row_width, wordwrap)); break; @@ -1487,6 +1487,7 @@ assemble_row(TextAssembler::TextRow &row, placement._scale = properties->get_glyph_scale(); placement._xpos = (xpos - frame[0]); placement._ypos = (properties->get_glyph_shift() - frame[2]); + placement._slant = properties->get_slant(); placement._properties = properties; placed_glyphs.push_back(placement); diff --git a/panda/src/text/textNode.cxx b/panda/src/text/textNode.cxx index b9bfd22125..454c7dd7f3 100644 --- a/panda/src/text/textNode.cxx +++ b/panda/src/text/textNode.cxx @@ -911,7 +911,7 @@ count_geoms(PandaNode *node) { } Children children = node->get_children(); - for (int i = 0; i < children.get_num_children(); ++i) { + for (size_t i = 0; i < children.get_num_children(); ++i) { num_geoms += count_geoms(children.get_child(i)); } diff --git a/panda/src/tform/mouseWatcher.cxx b/panda/src/tform/mouseWatcher.cxx index 7f6355c135..30f2c4762e 100644 --- a/panda/src/tform/mouseWatcher.cxx +++ b/panda/src/tform/mouseWatcher.cxx @@ -1474,10 +1474,10 @@ do_transmit_data(DataGraphTraverser *trav, const DataNodeTransmit &input, << " seconds of inactivity; releasing held buttons.\n"; } { - for (int i = 0; i < _current_buttons_down.get_num_bits(); ++i) { + for (size_t i = 0; i < _current_buttons_down.get_num_bits(); ++i) { if (_current_buttons_down.get_bit(i)) { - release(ButtonHandle(i)); - new_button_events.add_event(ButtonEvent(ButtonHandle(i), ButtonEvent::T_up)); + release(ButtonHandle((int)i)); + new_button_events.add_event(ButtonEvent(ButtonHandle((int)i), ButtonEvent::T_up)); } } } @@ -1488,10 +1488,10 @@ do_transmit_data(DataGraphTraverser *trav, const DataNodeTransmit &input, case IS_inactive_to_active: // "Press" all of the buttons we "released" before. { - for (int i = 0; i < _current_buttons_down.get_num_bits(); ++i) { + for (size_t i = 0; i < _current_buttons_down.get_num_bits(); ++i) { if (_current_buttons_down.get_bit(i)) { - press(ButtonHandle(i), false); - new_button_events.add_event(ButtonEvent(ButtonHandle(i), ButtonEvent::T_down)); + press(ButtonHandle((int)i), false); + new_button_events.add_event(ButtonEvent(ButtonHandle((int)i), ButtonEvent::T_down)); } } } diff --git a/panda/src/tinydisplay/tinyGraphicsStateGuardian.cxx b/panda/src/tinydisplay/tinyGraphicsStateGuardian.cxx index 9e37c67037..7f8296a7a2 100644 --- a/panda/src/tinydisplay/tinyGraphicsStateGuardian.cxx +++ b/panda/src/tinydisplay/tinyGraphicsStateGuardian.cxx @@ -114,7 +114,8 @@ reset() { Geom::GR_point | Geom::GR_indexed_other | Geom::GR_triangle_strip | - Geom::GR_flat_last_vertex; + Geom::GR_flat_last_vertex | + Geom::GR_render_mode_wireframe | Geom::GR_render_mode_point; _max_texture_dimension = (1 << ZB_POINT_ST_FRAC_BITS); _max_texture_stages = MAX_TEXTURE_STAGES; diff --git a/panda/src/tinydisplay/zbuffer.h b/panda/src/tinydisplay/zbuffer.h index 46190ef4e6..ced08b5e31 100644 --- a/panda/src/tinydisplay/zbuffer.h +++ b/panda/src/tinydisplay/zbuffer.h @@ -107,23 +107,26 @@ typedef unsigned int PIXEL; #define PCOMPONENT_BLEND(c1, c2, a2) \ ((((unsigned int)(c1) * ((unsigned int)0xffff - (unsigned int)(a2)) + (unsigned int)(c2) * (unsigned int)(a2))) >> 16) -#define _BLEND_RGB(r1, g1, b1, r2, g2, b2, a2) \ +#define PALPHA_BLEND(a1, a2) \ + ((((unsigned int)(a1) * ((unsigned int)0xffff - (unsigned int)(a2))) >> 16) + (unsigned int)(a2)) + +#define _BLEND_RGB(r1, g1, b1, a1, r2, g2, b2, a2) \ RGBA_TO_PIXEL(PCOMPONENT_BLEND(r1, r2, a2), \ PCOMPONENT_BLEND(g1, g2, a2), \ PCOMPONENT_BLEND(b1, b2, a2), \ - a2) + PALPHA_BLEND(a1, a2)) -#define _BLEND_SRGB(r1, g1, b1, r2, g2, b2, a2) \ +#define _BLEND_SRGB(r1, g1, b1, a1, r2, g2, b2, a2) \ SRGBA_TO_PIXEL(PCOMPONENT_BLEND(r1, r2, a2), \ PCOMPONENT_BLEND(g1, g2, a2), \ PCOMPONENT_BLEND(b1, b2, a2), \ - a2) + PALPHA_BLEND(a1, a2)) #define PIXEL_BLEND_RGB(rgb, r, g, b, a) \ - _BLEND_RGB(PIXEL_R(rgb), PIXEL_G(rgb), PIXEL_B(rgb), r, g, b, a) + _BLEND_RGB(PIXEL_R(rgb), PIXEL_G(rgb), PIXEL_B(rgb), PIXEL_A(rgb), r, g, b, a) #define PIXEL_BLEND_SRGB(rgb, r, g, b, a) \ - _BLEND_SRGB(PIXEL_SR(rgb), PIXEL_SG(rgb), PIXEL_SB(rgb), r, g, b, a) + _BLEND_SRGB(PIXEL_SR(rgb), PIXEL_SG(rgb), PIXEL_SB(rgb), PIXEL_A(rgb), r, g, b, a) typedef struct { diff --git a/panda/src/tinydisplay/ztriangle_two.h b/panda/src/tinydisplay/ztriangle_two.h index d1c5a56916..6bb255ce01 100644 --- a/panda/src/tinydisplay/ztriangle_two.h +++ b/panda/src/tinydisplay/ztriangle_two.h @@ -81,7 +81,7 @@ FNAME(smooth_untextured) (ZBuffer *zb, #define EARLY_OUT() \ { \ - int c0, c1, c2; \ + unsigned int c0, c1, c2; \ c0 = RGBA_TO_PIXEL(p0->r, p0->g, p0->b, p0->a); \ c1 = RGBA_TO_PIXEL(p1->r, p1->g, p1->b, p1->a); \ c2 = RGBA_TO_PIXEL(p2->r, p2->g, p2->b, p2->a); \ @@ -223,7 +223,7 @@ FNAME(smooth_textured) (ZBuffer *zb, #define EARLY_OUT() \ { \ - int c0, c1, c2; \ + unsigned int c0, c1, c2; \ c0 = RGBA_TO_PIXEL(p0->r, p0->g, p0->b, p0->a); \ c1 = RGBA_TO_PIXEL(p1->r, p1->g, p1->b, p1->a); \ c2 = RGBA_TO_PIXEL(p2->r, p2->g, p2->b, p2->a); \ diff --git a/panda/src/vision/config_vision.cxx b/panda/src/vision/config_vision.cxx index 91c6acac86..3b53c0ed02 100644 --- a/panda/src/vision/config_vision.cxx +++ b/panda/src/vision/config_vision.cxx @@ -60,8 +60,8 @@ init_libvision() { PandaSystem *ps = PandaSystem::get_global_ptr(); ps->add_system("OpenCV"); - TexturePool *ts = TexturePool::get_global_ptr(); #ifndef HAVE_FFMPEG + TexturePool *ts = TexturePool::get_global_ptr(); ts->register_texture_type(OpenCVTexture::make_texture, "avi"); #endif #endif diff --git a/panda/src/vision/webcamVideoCursorV4L.cxx b/panda/src/vision/webcamVideoCursorV4L.cxx index c12568882d..64090c53aa 100644 --- a/panda/src/vision/webcamVideoCursorV4L.cxx +++ b/panda/src/vision/webcamVideoCursorV4L.cxx @@ -305,7 +305,7 @@ WebcamVideoCursorV4L(WebcamVideoV4L *src) : MovieVideoCursor(src) { // Set up the mmap buffers struct v4l2_buffer buf; - for (int i = 0; i < _bufcount; ++i) { + for (unsigned int i = 0; i < (unsigned int)_bufcount; ++i) { memset(&buf, 0, sizeof buf); buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; buf.memory = V4L2_MEMORY_MMAP; @@ -367,7 +367,7 @@ WebcamVideoCursorV4L:: close(_fd); } if (_buffers) { - for (int i = 0; i < _bufcount; ++i) { + for (unsigned int i = 0; i < (unsigned int)_bufcount; ++i) { munmap(_buffers[i], _buflens[i]); } free(_buffers); @@ -455,7 +455,7 @@ fetch_buffer() { } // Flip the image vertically - for (size_t row = 0; row < _size_y; ++row) { + for (int row = 0; row < _size_y; ++row) { memcpy(block + (_size_y - row - 1) * new_bpl, newbuf + row * new_bpl, new_bpl); } free(newbuf); diff --git a/panda/src/vision/webcamVideoOpenCV.cxx b/panda/src/vision/webcamVideoOpenCV.cxx index 92a22dc4a5..d4c68070fa 100644 --- a/panda/src/vision/webcamVideoOpenCV.cxx +++ b/panda/src/vision/webcamVideoOpenCV.cxx @@ -33,7 +33,7 @@ find_all_webcams_opencv() { "numbers that are assumed to be available via OpenCV to the " "WebcamVideo interface. The default camera index is 0. " "Specify empty string if there are no available cameras.")); - for (int i = 0; i < wemcam_opencv_camera_index.get_num_words(); ++i) { + for (size_t i = 0; i < wemcam_opencv_camera_index.get_num_words(); ++i) { PT(WebcamVideo) wc = new WebcamVideoOpenCV(wemcam_opencv_camera_index[i]); WebcamVideoOpenCV::_all_webcams.push_back(wc); } diff --git a/pandatool/src/bam/bamInfo.cxx b/pandatool/src/bam/bamInfo.cxx index 9c3403dc00..44d015c2fe 100644 --- a/pandatool/src/bam/bamInfo.cxx +++ b/pandatool/src/bam/bamInfo.cxx @@ -24,7 +24,6 @@ #include "pvector.h" #include "bamCacheRecord.h" #include "bamCacheIndex.h" -#include "pystub.h" /** * @@ -322,9 +321,6 @@ list_hierarchy(PandaNode *node, int indent_level) { } int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - BamInfo prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/bam/bamToEgg.cxx b/pandatool/src/bam/bamToEgg.cxx index b3a2c48535..7f70255ce9 100644 --- a/pandatool/src/bam/bamToEgg.cxx +++ b/pandatool/src/bam/bamToEgg.cxx @@ -13,7 +13,6 @@ #include "bamToEgg.h" #include "save_egg_file.h" -#include "pystub.h" #include "string_utils.h" #include "bamFile.h" #include "bamCacheRecord.h" @@ -98,9 +97,6 @@ run() { } int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - BamToEgg prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/bam/eggToBam.cxx b/pandatool/src/bam/eggToBam.cxx index ce9f2884a6..238eba17cf 100644 --- a/pandatool/src/bam/eggToBam.cxx +++ b/pandatool/src/bam/eggToBam.cxx @@ -31,7 +31,6 @@ #include "load_prc_file.h" #include "windowProperties.h" #include "frameBufferProperties.h" -#include "pystub.h" /** * @@ -485,9 +484,6 @@ make_buffer() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggToBam prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/bam/ptsToBam.cxx b/pandatool/src/bam/ptsToBam.cxx index d1d55056e4..5f570d309b 100644 --- a/pandatool/src/bam/ptsToBam.cxx +++ b/pandatool/src/bam/ptsToBam.cxx @@ -19,7 +19,6 @@ #include "pandaNode.h" #include "geomNode.h" #include "dcast.h" -#include "pystub.h" #include "string_utils.h" #include "config_egg2pg.h" @@ -230,9 +229,6 @@ close_vertex_data() { } int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - PtsToBam prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/cvscopy/testCopy.cxx b/pandatool/src/cvscopy/testCopy.cxx index 8f9fbce3a4..4947bc8d5c 100644 --- a/pandatool/src/cvscopy/testCopy.cxx +++ b/pandatool/src/cvscopy/testCopy.cxx @@ -13,7 +13,6 @@ #include "testCopy.h" #include "cvsSourceDirectory.h" -#include "pystub.h" /** * @@ -59,9 +58,6 @@ copy_file(const Filename &source, const Filename &dest, int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - TestCopy prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/daeegg/daeCharacter.cxx b/pandatool/src/daeegg/daeCharacter.cxx index 0d6e0d1e39..31d8db02cb 100644 --- a/pandatool/src/daeegg/daeCharacter.cxx +++ b/pandatool/src/daeegg/daeCharacter.cxx @@ -177,7 +177,7 @@ influence_vertex(int index, EggVertex *vertex) { for (size_t pa = 0; pa < influence->GetPairCount(); ++pa) { const FCDJointWeightPair* jwpair = influence->GetPair(pa); - if (jwpair->jointIndex >= 0 && jwpair->jointIndex < _joints.size()) { + if (jwpair->jointIndex >= 0 && jwpair->jointIndex < (int)_joints.size()) { EggGroup *joint = _joints[jwpair->jointIndex]._group.p(); if (joint != NULL) { joint->ref_vertex(vertex, jwpair->weight); diff --git a/pandatool/src/daeprogs/daeToEgg.cxx b/pandatool/src/daeprogs/daeToEgg.cxx index c96f656100..c3ba781361 100644 --- a/pandatool/src/daeprogs/daeToEgg.cxx +++ b/pandatool/src/daeprogs/daeToEgg.cxx @@ -14,7 +14,6 @@ #include "daeToEgg.h" #include "daeToEggConverter.h" -#include "pystub.h" /** * @@ -76,9 +75,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - DAEToEgg prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/daeprogs/eggToDAE.cxx b/pandatool/src/daeprogs/eggToDAE.cxx index 31b8f24d5d..dff2286b88 100644 --- a/pandatool/src/daeprogs/eggToDAE.cxx +++ b/pandatool/src/daeprogs/eggToDAE.cxx @@ -13,7 +13,6 @@ #include "eggToDAE.h" #include "dcast.h" -#include "pystub.h" #include "pandaVersion.h" #include "FCDocument/FCDocument.h" @@ -165,9 +164,6 @@ void EggToDAE::apply_transform(FCDSceneNode* to, const PT(EggGroup) from) { } int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggToDAE prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/dxfprogs/dxfPoints.cxx b/pandatool/src/dxfprogs/dxfPoints.cxx index 2dba8ae801..c0002b2826 100644 --- a/pandatool/src/dxfprogs/dxfPoints.cxx +++ b/pandatool/src/dxfprogs/dxfPoints.cxx @@ -12,7 +12,6 @@ */ #include "dxfPoints.h" -#include "pystub.h" /** * @@ -83,9 +82,6 @@ handle_args(ProgramBase::Args &args) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - DXFPoints prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/dxfprogs/dxfToEgg.cxx b/pandatool/src/dxfprogs/dxfToEgg.cxx index 512c790b96..4ca66f0a94 100644 --- a/pandatool/src/dxfprogs/dxfToEgg.cxx +++ b/pandatool/src/dxfprogs/dxfToEgg.cxx @@ -14,7 +14,6 @@ #include "dxfToEgg.h" #include "dxfToEggConverter.h" -#include "pystub.h" /** * @@ -68,9 +67,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - DXFToEgg prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/dxfprogs/eggToDXF.cxx b/pandatool/src/dxfprogs/eggToDXF.cxx index 3a3b24d564..e3fb8a85d5 100644 --- a/pandatool/src/dxfprogs/eggToDXF.cxx +++ b/pandatool/src/dxfprogs/eggToDXF.cxx @@ -14,7 +14,6 @@ #include "eggToDXF.h" #include "eggPolygon.h" #include "dcast.h" -#include "pystub.h" /** * @@ -143,9 +142,6 @@ write_entities(ostream &out) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggToDXF prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/egg-mkfont/eggMakeFont.cxx b/pandatool/src/egg-mkfont/eggMakeFont.cxx index f51fbebc7a..024f302199 100644 --- a/pandatool/src/egg-mkfont/eggMakeFont.cxx +++ b/pandatool/src/egg-mkfont/eggMakeFont.cxx @@ -29,7 +29,6 @@ #include "eggVertex.h" #include "string_utils.h" #include "dcast.h" -#include "pystub.h" #include @@ -737,9 +736,6 @@ is_numeric(const string &str) { } int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggMakeFont prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/egg-optchar/eggOptchar.cxx b/pandatool/src/egg-optchar/eggOptchar.cxx index d6f541045e..bc1d3058b3 100644 --- a/pandatool/src/egg-optchar/eggOptchar.cxx +++ b/pandatool/src/egg-optchar/eggOptchar.cxx @@ -31,7 +31,6 @@ #include "pset.h" #include "compose_matrix.h" #include "fftCompressor.h" -#include "pystub.h" #include @@ -1508,13 +1507,10 @@ do_defpose() { nassertv(anim_index != -1); // Now we can recursively apply the default pose to the hierarchy. - ch->get_root_joint()->apply_default_pose(anim_index, frame); + root_joint->apply_default_pose(anim_index, frame); } int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggOptchar prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/egg-palettize/eggPalettize.cxx b/pandatool/src/egg-palettize/eggPalettize.cxx index cefec3d589..200b62e798 100644 --- a/pandatool/src/egg-palettize/eggPalettize.cxx +++ b/pandatool/src/egg-palettize/eggPalettize.cxx @@ -23,7 +23,6 @@ #include "pnotify.h" #include "notifyCategory.h" #include "notifySeverity.h" -#include "pystub.h" #include @@ -866,9 +865,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggPalettize prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/egg-qtess/eggQtess.cxx b/pandatool/src/egg-qtess/eggQtess.cxx index df0e63e830..21bc6317fb 100644 --- a/pandatool/src/egg-qtess/eggQtess.cxx +++ b/pandatool/src/egg-qtess/eggQtess.cxx @@ -14,7 +14,6 @@ #include "eggQtess.h" #include "qtessGlobals.h" #include "dcast.h" -#include "pystub.h" /** * @@ -331,9 +330,6 @@ find_surfaces(EggNode *egg_node) { } int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggQtess prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/eggprogs/eggCrop.cxx b/pandatool/src/eggprogs/eggCrop.cxx index 64f2e017b4..38edb93284 100644 --- a/pandatool/src/eggprogs/eggCrop.cxx +++ b/pandatool/src/eggprogs/eggCrop.cxx @@ -17,7 +17,6 @@ #include "eggPrimitive.h" #include "eggVertex.h" #include "dcast.h" -#include "pystub.h" /** * @@ -118,9 +117,6 @@ strip_prims(EggGroupNode *group) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggCrop prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/eggprogs/eggListTextures.cxx b/pandatool/src/eggprogs/eggListTextures.cxx index 3174e5ad87..c804a8110b 100644 --- a/pandatool/src/eggprogs/eggListTextures.cxx +++ b/pandatool/src/eggprogs/eggListTextures.cxx @@ -14,7 +14,6 @@ #include "eggListTextures.h" #include "eggTextureCollection.h" #include "pnmImageHeader.h" -#include "pystub.h" /** * @@ -59,9 +58,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggListTextures prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/eggprogs/eggMakeTube.cxx b/pandatool/src/eggprogs/eggMakeTube.cxx index efda24d353..37adfd8d59 100644 --- a/pandatool/src/eggprogs/eggMakeTube.cxx +++ b/pandatool/src/eggprogs/eggMakeTube.cxx @@ -18,7 +18,6 @@ #include "eggPolygon.h" #include "pointerTo.h" #include "look_at.h" -#include "pystub.h" /** * @@ -264,9 +263,6 @@ add_polygon(EggVertex *a, EggVertex *b, EggVertex *c, EggVertex *d) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggMakeTube prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/eggprogs/eggRename.cxx b/pandatool/src/eggprogs/eggRename.cxx index ac28ae39b6..abde299e2d 100644 --- a/pandatool/src/eggprogs/eggRename.cxx +++ b/pandatool/src/eggprogs/eggRename.cxx @@ -12,7 +12,6 @@ */ #include "eggRename.h" -#include "pystub.h" /** * @@ -52,9 +51,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggRename prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/eggprogs/eggRetargetAnim.cxx b/pandatool/src/eggprogs/eggRetargetAnim.cxx index 82a825a8cc..f354eb57b9 100644 --- a/pandatool/src/eggprogs/eggRetargetAnim.cxx +++ b/pandatool/src/eggprogs/eggRetargetAnim.cxx @@ -21,7 +21,6 @@ #include "eggJointPointer.h" #include "eggTable.h" #include "compose_matrix.h" -#include "pystub.h" /** * @@ -186,9 +185,6 @@ retarget_anim(EggCharacterData *char_data, EggJointData *joint_data, int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggRetargetAnim prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/eggprogs/eggTextureCards.cxx b/pandatool/src/eggprogs/eggTextureCards.cxx index e0363af75a..03cb811809 100644 --- a/pandatool/src/eggprogs/eggTextureCards.cxx +++ b/pandatool/src/eggprogs/eggTextureCards.cxx @@ -19,7 +19,6 @@ #include "eggTexture.h" #include "eggPolygon.h" #include "pnmImageHeader.h" -#include "pystub.h" #include @@ -483,9 +482,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggTextureCards prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/eggprogs/eggToC.cxx b/pandatool/src/eggprogs/eggToC.cxx index 9a25e1615d..28fcb2f36e 100644 --- a/pandatool/src/eggprogs/eggToC.cxx +++ b/pandatool/src/eggprogs/eggToC.cxx @@ -21,7 +21,6 @@ #include "eggPolysetMaker.h" #include "eggBin.h" #include "string_utils.h" -#include "pystub.h" /** * @@ -364,9 +363,6 @@ write_bin(EggBin *bin) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggToC prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/eggprogs/eggTopstrip.cxx b/pandatool/src/eggprogs/eggTopstrip.cxx index 16c7b3371a..e0bbcf4e7e 100644 --- a/pandatool/src/eggprogs/eggTopstrip.cxx +++ b/pandatool/src/eggprogs/eggTopstrip.cxx @@ -21,7 +21,6 @@ #include "eggJointPointer.h" #include "eggTable.h" #include "compose_matrix.h" -#include "pystub.h" /** * @@ -343,9 +342,6 @@ adjust_transform(LMatrix4d &mat) const { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggTopstrip prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/eggprogs/eggTrans.cxx b/pandatool/src/eggprogs/eggTrans.cxx index 3f86d54903..28d439e617 100644 --- a/pandatool/src/eggprogs/eggTrans.cxx +++ b/pandatool/src/eggprogs/eggTrans.cxx @@ -13,7 +13,6 @@ #include "eggTrans.h" #include "eggGroupUniquifier.h" -#include "pystub.h" /** * @@ -131,9 +130,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggTrans prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/fltprogs/eggToFlt.cxx b/pandatool/src/fltprogs/eggToFlt.cxx index 36351af679..90e9d123a3 100644 --- a/pandatool/src/fltprogs/eggToFlt.cxx +++ b/pandatool/src/fltprogs/eggToFlt.cxx @@ -34,7 +34,6 @@ #include "dcast.h" #include "string_utils.h" #include "vector_string.h" -#include "pystub.h" /** * @@ -666,9 +665,6 @@ get_flt_texture(EggTexture *egg_texture) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggToFlt prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/fltprogs/fltCopy.cxx b/pandatool/src/fltprogs/fltCopy.cxx index ea5dfbde07..6ecb3b7833 100644 --- a/pandatool/src/fltprogs/fltCopy.cxx +++ b/pandatool/src/fltprogs/fltCopy.cxx @@ -19,7 +19,6 @@ #include "fltExternalReference.h" #include "fltError.h" #include "dcast.h" -#include "pystub.h" /** * @@ -231,9 +230,6 @@ scan_flt(FltRecord *record, FltCopy::Refs &refs, FltCopy::Textures &textures) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - FltCopy prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/fltprogs/fltInfo.cxx b/pandatool/src/fltprogs/fltInfo.cxx index 8f35093c73..a6d4649bff 100644 --- a/pandatool/src/fltprogs/fltInfo.cxx +++ b/pandatool/src/fltprogs/fltInfo.cxx @@ -15,7 +15,6 @@ #include "fltHeader.h" #include "indent.h" -#include "pystub.h" /** * @@ -91,9 +90,6 @@ handle_args(ProgramBase::Args &args) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - FltInfo prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/fltprogs/fltToEgg.cxx b/pandatool/src/fltprogs/fltToEgg.cxx index 6935e29c68..c08a8381d9 100644 --- a/pandatool/src/fltprogs/fltToEgg.cxx +++ b/pandatool/src/fltprogs/fltToEgg.cxx @@ -15,7 +15,6 @@ #include "fltToEggConverter.h" #include "config_flt.h" -#include "pystub.h" /** * @@ -99,9 +98,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - init_libflt(); FltToEgg prog; prog.parse_command_line(argc, argv); diff --git a/pandatool/src/fltprogs/fltTrans.cxx b/pandatool/src/fltprogs/fltTrans.cxx index 3fd6ae9656..692f8e374b 100644 --- a/pandatool/src/fltprogs/fltTrans.cxx +++ b/pandatool/src/fltprogs/fltTrans.cxx @@ -14,7 +14,6 @@ #include "fltTrans.h" #include "fltHeader.h" -#include "pystub.h" /** * @@ -127,9 +126,6 @@ handle_args(ProgramBase::Args &args) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - FltTrans prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/gtk-stats/gtkStats.cxx b/pandatool/src/gtk-stats/gtkStats.cxx index 9ad165fa29..b76bc292f3 100644 --- a/pandatool/src/gtk-stats/gtkStats.cxx +++ b/pandatool/src/gtk-stats/gtkStats.cxx @@ -15,7 +15,6 @@ #include "gtkStats.h" #include "gtkStatsServer.h" #include "config_pstats.h" -#include "pystub.h" GtkWidget *main_window; static GtkStatsServer *server = NULL; @@ -53,9 +52,6 @@ timer(gpointer data) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - gtk_init(&argc, &argv); main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); diff --git a/pandatool/src/imageprogs/imageFixHiddenColor.cxx b/pandatool/src/imageprogs/imageFixHiddenColor.cxx index 46ff3e5636..bb56bcc659 100644 --- a/pandatool/src/imageprogs/imageFixHiddenColor.cxx +++ b/pandatool/src/imageprogs/imageFixHiddenColor.cxx @@ -13,7 +13,6 @@ #include "imageFixHiddenColor.h" #include "string_utils.h" -#include "pystub.h" /** * @@ -143,9 +142,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - ImageFixHiddenColor prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/imageprogs/imageInfo.cxx b/pandatool/src/imageprogs/imageInfo.cxx index d445e028ee..175a5dba1d 100644 --- a/pandatool/src/imageprogs/imageInfo.cxx +++ b/pandatool/src/imageprogs/imageInfo.cxx @@ -13,7 +13,6 @@ #include "imageInfo.h" #include "pnmImageHeader.h" -#include "pystub.h" /** * @@ -88,9 +87,6 @@ is_power_2(int value) const { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - ImageInfo prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/imageprogs/imageResize.cxx b/pandatool/src/imageprogs/imageResize.cxx index 6b6a877490..ae5a746c1a 100644 --- a/pandatool/src/imageprogs/imageResize.cxx +++ b/pandatool/src/imageprogs/imageResize.cxx @@ -13,7 +13,6 @@ #include "imageResize.h" #include "string_utils.h" -#include "pystub.h" /** * @@ -117,9 +116,6 @@ dispatch_size_request(const string &opt, const string &arg, void *var) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - ImageResize prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/imageprogs/imageTrans.cxx b/pandatool/src/imageprogs/imageTrans.cxx index 68187459a7..da33516eeb 100644 --- a/pandatool/src/imageprogs/imageTrans.cxx +++ b/pandatool/src/imageprogs/imageTrans.cxx @@ -13,7 +13,6 @@ #include "imageTrans.h" #include "string_utils.h" -#include "pystub.h" /** * @@ -203,9 +202,6 @@ extract_alpha() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - ImageTrans prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/imageprogs/imageTransformColors.cxx b/pandatool/src/imageprogs/imageTransformColors.cxx index 2dfec7eab2..a18629f798 100644 --- a/pandatool/src/imageprogs/imageTransformColors.cxx +++ b/pandatool/src/imageprogs/imageTransformColors.cxx @@ -13,7 +13,6 @@ #include "imageTransformColors.h" #include "string_utils.h" -#include "pystub.h" #include "pnmImage.h" #include @@ -471,9 +470,6 @@ process_image(PNMImage &image) { } int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - ImageTransformColors prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/lwo/test_lwo.cxx b/pandatool/src/lwo/test_lwo.cxx index 3d06358ef5..b541fb8360 100644 --- a/pandatool/src/lwo/test_lwo.cxx +++ b/pandatool/src/lwo/test_lwo.cxx @@ -14,13 +14,9 @@ #include "lwoInputFile.h" #include "lwoChunk.h" #include "config_lwo.h" -#include "pystub.h" int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - init_liblwo(); if (argc != 2) { nout << "test_lwo file.lwo\n"; diff --git a/pandatool/src/lwoprogs/lwoScan.cxx b/pandatool/src/lwoprogs/lwoScan.cxx index 5b72a5be2d..a7fbf46933 100644 --- a/pandatool/src/lwoprogs/lwoScan.cxx +++ b/pandatool/src/lwoprogs/lwoScan.cxx @@ -16,7 +16,6 @@ #include "lwoInputFile.h" #include "lwoChunk.h" #include "config_lwo.h" -#include "pystub.h" /** * @@ -77,9 +76,6 @@ handle_args(ProgramBase::Args &args) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - init_liblwo(); LwoScan prog; prog.parse_command_line(argc, argv); diff --git a/pandatool/src/lwoprogs/lwoToEgg.cxx b/pandatool/src/lwoprogs/lwoToEgg.cxx index bfdc45cd33..a2e54b48ea 100644 --- a/pandatool/src/lwoprogs/lwoToEgg.cxx +++ b/pandatool/src/lwoprogs/lwoToEgg.cxx @@ -17,7 +17,6 @@ #include "lwoHeader.h" #include "lwoInputFile.h" #include "config_lwo.h" -#include "pystub.h" /** * @@ -80,9 +79,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - init_liblwo(); LwoToEgg prog; prog.parse_command_line(argc, argv); diff --git a/pandatool/src/maya/mayaApi.cxx b/pandatool/src/maya/mayaApi.cxx index be7c36ed6a..015ce7d4c6 100644 --- a/pandatool/src/maya/mayaApi.cxx +++ b/pandatool/src/maya/mayaApi.cxx @@ -184,9 +184,10 @@ open_api(string program_name, bool view_license, bool revertdir) { size_t dot2 = runtime_version.find('.', dot1 + 1); if (dot2 == string::npos) { - rtver_b = 0; + string_to_int(runtime_version.substr(dot1 + 1), rtver_b); + } else { - string_to_int(runtime_version.substr(dot1, dot2 - dot1), rtver_b); + string_to_int(runtime_version.substr(dot1 + 1, dot2 - dot1 - 1), rtver_b); simple_runtime_version = runtime_version.substr(0, dot2); } } diff --git a/pandatool/src/maya/pre_maya_include.h b/pandatool/src/maya/pre_maya_include.h index 2556db5129..d1b18b21de 100644 --- a/pandatool/src/maya/pre_maya_include.h +++ b/pandatool/src/maya/pre_maya_include.h @@ -61,8 +61,12 @@ typedef istream maya_istream; #endif // PHAVE_IOSTREAM #ifdef __MACH__ -#undef _BOOL -#include "maya/OpenMayaMac.h" +#define OSMac_ 1 +// This defines MAYA_API_VERSION +#include +#if MAYA_API_VERSION < 201600 +#include +#endif #endif #endif // MAYA_PRE_5_0 diff --git a/pandatool/src/mayaprogs/eggToMaya.cxx b/pandatool/src/mayaprogs/eggToMaya.cxx index 48ac972aea..da944e58e6 100644 --- a/pandatool/src/mayaprogs/eggToMaya.cxx +++ b/pandatool/src/mayaprogs/eggToMaya.cxx @@ -14,9 +14,6 @@ #include "eggToMaya.h" #include "mayaEggLoader.h" #include "mayaApi.h" -#ifdef _WIN32 - #include "pystub.h" -#endif // We must define this to prevent Maya from doubly-declaring its MApiVersion // string in this file as well as in libmayaegg. @@ -128,13 +125,6 @@ run() { } int main(int argc, char *argv[]) { - // We don't want pystub on linux, since it gives problems with Maya's - // python. -#ifdef _WIN32 - // A call to pystub() to force libpystub.so to be linked in. - pystub(); -#endif - EggToMaya prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/mayaprogs/mayaCopy.cxx b/pandatool/src/mayaprogs/mayaCopy.cxx index eeb11eda4e..70cb614a2d 100644 --- a/pandatool/src/mayaprogs/mayaCopy.cxx +++ b/pandatool/src/mayaprogs/mayaCopy.cxx @@ -18,9 +18,6 @@ #include "cvsSourceDirectory.h" #include "mayaShader.h" #include "dcast.h" -#ifdef _WIN32 - #include "pystub.h" -#endif #include "pre_maya_include.h" #include @@ -449,13 +446,6 @@ collect_shader_for_node(const MDagPath &dag_path) { int main(int argc, char *argv[]) { - // We don't want pystub on linux, since it gives problems with Maya's - // python. -#ifdef _WIN32 - // A call to pystub() to force libpystub.so to be linked in. - pystub(); -#endif - MayaCopy prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/mayaprogs/mayaSavePview.h b/pandatool/src/mayaprogs/mayaSavePview.h index cf961633f1..d8f31d6688 100644 --- a/pandatool/src/mayaprogs/mayaSavePview.h +++ b/pandatool/src/mayaprogs/mayaSavePview.h @@ -25,8 +25,12 @@ #endif #ifdef __MACH__ -#undef _BOOL -#include "maya/OpenMayaMac.h" +#define OSMac_ 1 +// This defines MAYA_API_VERSION +#include +#if MAYA_API_VERSION < 201600 +#include +#endif #endif // Even though we don't include any Panda headers, it's safe to include this diff --git a/pandatool/src/mayaprogs/mayaToEgg.cxx b/pandatool/src/mayaprogs/mayaToEgg.cxx index a7a4cfe7c6..5ceb4cf1ee 100644 --- a/pandatool/src/mayaprogs/mayaToEgg.cxx +++ b/pandatool/src/mayaprogs/mayaToEgg.cxx @@ -43,9 +43,6 @@ #include "config_mayaegg.h" #include "config_maya.h" // for maya_cat #include "globPattern.h" -#ifdef _WIN32 - #include "pystub.h" -#endif /** * @@ -336,13 +333,6 @@ dispatch_transform_type(const string &opt, const string &arg, void *var) { } int main(int argc, char *argv[]) { - // We don't want pystub on linux, since it gives problems with Maya's - // python. -#ifdef _WIN32 - // A call to pystub() to force libpystub.so to be linked in. - pystub(); -#endif - MayaToEgg prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/mayaprogs/mayaToEgg_client.cxx b/pandatool/src/mayaprogs/mayaToEgg_client.cxx index d5d3f40c9f..dfde2661c1 100644 --- a/pandatool/src/mayaprogs/mayaToEgg_client.cxx +++ b/pandatool/src/mayaprogs/mayaToEgg_client.cxx @@ -12,9 +12,6 @@ */ #include "mayaToEgg_client.h" -#ifdef _WIN32 - #include "pystub.h" -#endif /** * @@ -31,13 +28,6 @@ MayaToEggClient() : } int main(int argc, char *argv[]) { - // We don't want pystub on linux, since it gives problems with Maya's - // python. -#ifdef _WIN32 - // A call to pystub() to force libpystub.so to be linked in. - pystub(); -#endif - MayaToEggClient prog; // Open a connection to the server process PT(Connection) con = prog.qManager->open_TCP_client_connection(prog.server,0); diff --git a/pandatool/src/mayaprogs/mayaToEgg_server.cxx b/pandatool/src/mayaprogs/mayaToEgg_server.cxx index 19fd9ac22f..30f88f99d0 100644 --- a/pandatool/src/mayaprogs/mayaToEgg_server.cxx +++ b/pandatool/src/mayaprogs/mayaToEgg_server.cxx @@ -19,9 +19,6 @@ #include "config_mayaegg.h" #include "config_maya.h" // for maya_cat #include "globPattern.h" -#ifdef _WIN32 - #include "pystub.h" -#endif /** * @@ -458,13 +455,6 @@ poll() { } // poll int main(int argc, char *argv[]) { - // We don't want pystub on linux, since it gives problems with Maya's - // python. -#ifdef _WIN32 - // A call to pystub() to force libpystub.so to be linked in. - pystub(); -#endif - MayaToEggServer prog; // Open a rendezvous port for receiving new connections from the client PT(Connection) rend = prog.qManager->open_TCP_server_rendezvous(4242, 50); diff --git a/pandatool/src/mayaprogs/mayapath.cxx b/pandatool/src/mayaprogs/mayapath.cxx index b0576147f0..aac472759d 100644 --- a/pandatool/src/mayaprogs/mayapath.cxx +++ b/pandatool/src/mayaprogs/mayapath.cxx @@ -49,10 +49,6 @@ #include #endif -#ifdef HAVE_PYTHON -#include "pystub.h" -#endif - #define QUOTESTR(x) #x #define TOSTRING(x) QUOTESTR(x) @@ -187,11 +183,6 @@ get_maya_location(const char *ver, string &loc) { int main(int argc, char *argv[]) { -#ifdef HAVE_PYTHON - // Force pystub to be linked in. - pystub(); -#endif - // First, get the command line and append _bin, so we will actually run // maya2egg_bin.exe, egg2maya_bin.exe, etc. Filename command = Filename::from_os_specific(argv[0]); diff --git a/pandatool/src/miscprogs/binToC.cxx b/pandatool/src/miscprogs/binToC.cxx index 3f1b188441..8d1ee2dec8 100644 --- a/pandatool/src/miscprogs/binToC.cxx +++ b/pandatool/src/miscprogs/binToC.cxx @@ -12,7 +12,6 @@ */ #include "binToC.h" -#include "pystub.h" // The number of bytes across the page to write. static const int col_width = 11; @@ -144,9 +143,6 @@ handle_args(ProgramBase::Args &args) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - BinToC prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/objprogs/eggToObj.cxx b/pandatool/src/objprogs/eggToObj.cxx index a3f7a79171..aac15220e9 100644 --- a/pandatool/src/objprogs/eggToObj.cxx +++ b/pandatool/src/objprogs/eggToObj.cxx @@ -12,7 +12,6 @@ */ #include "eggToObj.h" -#include "pystub.h" #include "eggPolygon.h" #include "eggGroupNode.h" #include "dcast.h" @@ -76,9 +75,6 @@ handle_args(ProgramBase::Args &args) { } int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggToObj prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/objprogs/objToEgg.cxx b/pandatool/src/objprogs/objToEgg.cxx index db551440ae..9a46aa7166 100644 --- a/pandatool/src/objprogs/objToEgg.cxx +++ b/pandatool/src/objprogs/objToEgg.cxx @@ -14,7 +14,6 @@ #include "objToEgg.h" #include "objToEggConverter.h" -#include "pystub.h" /** * @@ -68,9 +67,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - ObjToEgg prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/pfmprogs/pfmBba.cxx b/pandatool/src/pfmprogs/pfmBba.cxx index cf9d47d2ab..5517e45a63 100644 --- a/pandatool/src/pfmprogs/pfmBba.cxx +++ b/pandatool/src/pfmprogs/pfmBba.cxx @@ -14,7 +14,6 @@ #include "pfmBba.h" #include "config_pfm.h" #include "pfmFile.h" -#include "pystub.h" /** * @@ -136,9 +135,6 @@ handle_args(ProgramBase::Args &args) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - PfmBba prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/pfmprogs/pfmTrans.cxx b/pandatool/src/pfmprogs/pfmTrans.cxx index 02608c60f0..270d6a03af 100644 --- a/pandatool/src/pfmprogs/pfmTrans.cxx +++ b/pandatool/src/pfmprogs/pfmTrans.cxx @@ -15,7 +15,6 @@ #include "config_pfm.h" #include "pfmFile.h" #include "pfmVizzer.h" -#include "pystub.h" #include "texture.h" #include "texturePool.h" #include "pointerTo.h" @@ -504,9 +503,6 @@ dispatch_translate(const string &opt, const string &arg, void *var) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - PfmTrans prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/progbase/test_prog.cxx b/pandatool/src/progbase/test_prog.cxx index 7a4cd02529..5123385cc5 100644 --- a/pandatool/src/progbase/test_prog.cxx +++ b/pandatool/src/progbase/test_prog.cxx @@ -14,7 +14,6 @@ #include "programBase.h" #include "pnotify.h" -#include "pystub.h" class TestProgram : public ProgramBase { public: @@ -59,9 +58,6 @@ TestProgram() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - TestProgram t; t.parse_command_line(argc, argv); diff --git a/pandatool/src/softprogs/softCVS.cxx b/pandatool/src/softprogs/softCVS.cxx index bbc932659a..22329eb8c5 100644 --- a/pandatool/src/softprogs/softCVS.cxx +++ b/pandatool/src/softprogs/softCVS.cxx @@ -15,7 +15,6 @@ #include "pnotify.h" #include "multifile.h" -#include "pystub.h" #include @@ -580,9 +579,6 @@ cvs_add_or_remove(const string &cvs_command, const vector_string &paths) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - SoftCVS prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/text-stats/textStats.cxx b/pandatool/src/text-stats/textStats.cxx index 5b975cb798..2cbf69b4d9 100644 --- a/pandatool/src/text-stats/textStats.cxx +++ b/pandatool/src/text-stats/textStats.cxx @@ -16,7 +16,6 @@ #include "pStatServer.h" #include "config_pstats.h" -#include "pystub.h" #include @@ -99,9 +98,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - TextStats prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/vrmlprogs/vrmlToEgg.cxx b/pandatool/src/vrmlprogs/vrmlToEgg.cxx index 613f55c84b..dee6b5eb39 100644 --- a/pandatool/src/vrmlprogs/vrmlToEgg.cxx +++ b/pandatool/src/vrmlprogs/vrmlToEgg.cxx @@ -14,7 +14,6 @@ #include "vrmlToEgg.h" #include "vrmlToEggConverter.h" -#include "pystub.h" /** * @@ -66,9 +65,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - VRMLToEgg prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/vrmlprogs/vrmlTrans.cxx b/pandatool/src/vrmlprogs/vrmlTrans.cxx index fd485eada0..e03075b0e5 100644 --- a/pandatool/src/vrmlprogs/vrmlTrans.cxx +++ b/pandatool/src/vrmlprogs/vrmlTrans.cxx @@ -13,7 +13,6 @@ #include "vrmlTrans.h" #include "parse_vrml.h" -#include "pystub.h" /** * @@ -88,9 +87,6 @@ handle_args(ProgramBase::Args &args) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - VRMLTrans prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/win-stats/winStats.cxx b/pandatool/src/win-stats/winStats.cxx index 35e58f6367..e8995edaba 100644 --- a/pandatool/src/win-stats/winStats.cxx +++ b/pandatool/src/win-stats/winStats.cxx @@ -15,7 +15,6 @@ #include "winStatsServer.h" #include "config_pstats.h" -#include "pystub.h" #include @@ -79,17 +78,7 @@ create_toplevel_window(HINSTANCE application) { return toplevel_window; } - -// WinMain() is the correct way to start a Windows-only application, but it is -// sometimes more convenient during development to use main() instead, which -// doesn't squelch the stderr output. - -#ifndef DEVELOP_WINSTATS -int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) -#else -int main(int argc, char *argv[]) -#endif -{ +int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) { HINSTANCE application = GetModuleHandle(NULL); HWND toplevel_window = create_toplevel_window(application); @@ -128,3 +117,11 @@ int main(int argc, char *argv[]) return (0); } + +// WinMain() is the correct way to start a Windows-only application, but it is +// sometimes more convenient during development to use main() instead, which +// doesn't squelch the stderr output. + +int main(int argc, char *argv[]) { + return WinMain(NULL, NULL, NULL, 0); +} diff --git a/pandatool/src/xfileprogs/eggToX.cxx b/pandatool/src/xfileprogs/eggToX.cxx index 37c0fc8658..a677a38176 100644 --- a/pandatool/src/xfileprogs/eggToX.cxx +++ b/pandatool/src/xfileprogs/eggToX.cxx @@ -13,7 +13,6 @@ #include "eggToX.h" #include "config_xfile.h" -#include "pystub.h" /** * @@ -70,9 +69,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - init_libxfile(); EggToX prog; prog.parse_command_line(argc, argv); diff --git a/pandatool/src/xfileprogs/xFileToEgg.cxx b/pandatool/src/xfileprogs/xFileToEgg.cxx index e7026b6642..fd0c90e77a 100644 --- a/pandatool/src/xfileprogs/xFileToEgg.cxx +++ b/pandatool/src/xfileprogs/xFileToEgg.cxx @@ -14,7 +14,6 @@ #include "xFileToEgg.h" #include "xFileToEggConverter.h" #include "config_xfile.h" -#include "pystub.h" /** * @@ -114,9 +113,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - init_libxfile(); XFileToEgg prog; prog.parse_command_line(argc, argv); diff --git a/pandatool/src/xfileprogs/xFileTrans.cxx b/pandatool/src/xfileprogs/xFileTrans.cxx index 0c5335055b..afe58b2538 100644 --- a/pandatool/src/xfileprogs/xFileTrans.cxx +++ b/pandatool/src/xfileprogs/xFileTrans.cxx @@ -13,7 +13,6 @@ #include "xFileTrans.h" #include "xFile.h" -#include "pystub.h" /** * @@ -90,9 +89,6 @@ handle_args(ProgramBase::Args &args) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - XFileTrans prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/samples/shadows/advanced.py b/samples/shadows/advanced.py index 7211f9a087..988e78df32 100755 --- a/samples/shadows/advanced.py +++ b/samples/shadows/advanced.py @@ -50,6 +50,7 @@ class World(DirectObject): props, winprops, GraphicsPipe.BFRefuseWindow, base.win.getGsg(), base.win) + self.buffer = LBuffer if not LBuffer: self.t = addTitle( @@ -73,9 +74,10 @@ class World(DirectObject): self.inst_w = addInstructions(0.12, 'W : stop/start the Walk Cycle') self.inst_t = addInstructions(0.18, 'T : stop/start the Teapot') self.inst_l = addInstructions(0.24, 'L : move light source far or close') - self.inst_v = addInstructions(0.30, 'V: View the Depth-Texture results') - self.inst_x = addInstructions(0.36, 'Left/Right Arrow : switch camera angles') - self.inst_a = addInstructions(0.42, 'Something about A/Z and push bias') + self.inst_v = addInstructions(0.30, 'V : View the Depth-Texture results') + self.inst_u = addInstructions(0.36, 'U : toggle updating the shadow map') + self.inst_x = addInstructions(0.42, 'Left/Right Arrow : switch camera angles') + self.inst_a = addInstructions(0.48, 'Something about A/Z and push bias') base.setBackgroundColor(0, 0, 0.2, 1) @@ -120,20 +122,14 @@ class World(DirectObject): self.accept("arrow_left", self.incrementCameraPosition, [-1]) self.accept("arrow_right", self.incrementCameraPosition, [1]) self.accept("p", self.toggleInterval, [self.pandaMovement]) - self.accept("P", self.toggleInterval, [self.pandaMovement]) self.accept("t", self.toggleInterval, [self.teapotMovement]) - self.accept("T", self.toggleInterval, [self.teapotMovement]) self.accept("w", self.toggleInterval, [self.pandaWalk]) - self.accept("W", self.toggleInterval, [self.pandaWalk]) self.accept("v", base.bufferViewer.toggleEnable) - self.accept("V", base.bufferViewer.toggleEnable) + self.accept("u", self.toggleUpdateShadowMap) self.accept("l", self.incrementLightPosition, [1]) - self.accept("L", self.incrementLightPosition, [1]) self.accept("o", base.oobe) self.accept('a', self.adjustPushBias, [1.1]) - self.accept('A', self.adjustPushBias, [1.1]) self.accept('z', self.adjustPushBias, [0.9]) - self.accept('Z', self.adjustPushBias, [0.9]) self.LCam = base.makeCamera(LBuffer) self.LCam.node().setScene(render) @@ -180,6 +176,9 @@ class World(DirectObject): else: ival.resume() + def toggleUpdateShadowMap(self): + self.buffer.active = not self.buffer.active + def incrementCameraPosition(self, n): self.cameraSelection = (self.cameraSelection + n) % 6 if (self.cameraSelection == 0): diff --git a/samples/shadows/basic.py b/samples/shadows/basic.py index 95de1198a2..843b9b9b27 100755 --- a/samples/shadows/basic.py +++ b/samples/shadows/basic.py @@ -42,8 +42,9 @@ class World(DirectObject): self.inst_w = addInstructions(0.12, 'W : stop/start the Walk Cycle') self.inst_t = addInstructions(0.18, 'T : stop/start the Teapot') self.inst_l = addInstructions(0.24, 'L : move light source far or close') - self.inst_v = addInstructions(0.30, 'V: View the Depth-Texture results') - self.inst_x = addInstructions(0.36, 'Left/Right Arrow : switch camera angles') + self.inst_v = addInstructions(0.30, 'V : View the Depth-Texture results') + self.inst_u = addInstructions(0.36, 'U : toggle updating the shadow map') + self.inst_x = addInstructions(0.42, 'Left/Right Arrow : switch camera angles') base.setBackgroundColor(0, 0, 0.2, 1) @@ -88,15 +89,11 @@ class World(DirectObject): self.accept("arrow_left", self.incrementCameraPosition, [-1]) self.accept("arrow_right", self.incrementCameraPosition, [1]) self.accept("p", self.toggleInterval, [self.pandaMovement]) - self.accept("P", self.toggleInterval, [self.pandaMovement]) self.accept("t", self.toggleInterval, [self.teapotMovement]) - self.accept("T", self.toggleInterval, [self.teapotMovement]) self.accept("w", self.toggleInterval, [self.pandaWalk]) - self.accept("W", self.toggleInterval, [self.pandaWalk]) self.accept("v", base.bufferViewer.toggleEnable) - self.accept("V", base.bufferViewer.toggleEnable) + self.accept("u", self.toggleUpdateShadowMap) self.accept("l", self.incrementLightPosition, [1]) - self.accept("L", self.incrementLightPosition, [1]) self.accept("o", base.oobe) self.light = render.attachNewNode(Spotlight("Spot")) @@ -127,6 +124,10 @@ class World(DirectObject): else: ival.resume() + def toggleUpdateShadowMap(self): + buffer = self.light.node().getShadowBuffer(base.win.gsg) + buffer.active = not buffer.active + def incrementCameraPosition(self, n): self.cameraSelection = (self.cameraSelection + n) % 6 if (self.cameraSelection == 0):