From 82e4500d2abc1da73b1bcdf24889cdc1fe335b74 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 27 Jul 2014 12:10:52 +0000 Subject: [PATCH 01/52] Add p3d_ModelMatrix, p3d_ViewMatrix, and p3d_ViewProjectionMatrix. Fix osg_ViewMatrix and osg_InverseViewMatrix. --- panda/src/glstuff/glShaderContext_src.cxx | 56 +++++++++++++++-------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index fc19c31199..bc8c515453 100755 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -267,6 +267,7 @@ CLP(ShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderContext if (size > 6 && matrix_name.compare(size - 6, 6, "Matrix") == 0) { Shader::ShaderMatSpec bind; bind._id = arg_id; + bind._func = Shader::SMF_compose; if (transpose) { bind._piece = Shader::SMP_transpose; } else { @@ -274,9 +275,10 @@ CLP(ShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderContext } bind._arg[0] = NULL; bind._arg[1] = NULL; + bind._dep[0] = Shader::SSD_general | Shader::SSD_transform; + bind._dep[1] = Shader::SSD_general | Shader::SSD_transform; if (matrix_name == "ModelViewProjectionMatrix") { - bind._func = Shader::SMF_compose; if (inverse) { bind._part[0] = Shader::SMO_apiclip_to_view; bind._part[1] = Shader::SMO_view_to_model; @@ -284,11 +286,8 @@ CLP(ShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderContext bind._part[0] = Shader::SMO_model_to_view; bind._part[1] = Shader::SMO_view_to_apiclip; } - bind._dep[0] = Shader::SSD_general | Shader::SSD_transform; - bind._dep[1] = Shader::SSD_general | Shader::SSD_transform; } else if (matrix_name == "ModelViewMatrix") { - bind._func = Shader::SMF_compose; if (inverse) { bind._part[0] = Shader::SMO_apiview_to_view; bind._part[1] = Shader::SMO_view_to_model; @@ -296,11 +295,8 @@ CLP(ShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderContext bind._part[0] = Shader::SMO_model_to_view; bind._part[1] = Shader::SMO_view_to_apiview; } - bind._dep[0] = Shader::SSD_general | Shader::SSD_transform; - bind._dep[1] = Shader::SSD_general | Shader::SSD_transform; } else if (matrix_name == "ProjectionMatrix") { - bind._func = Shader::SMF_compose; if (inverse) { bind._part[0] = Shader::SMO_apiclip_to_view; bind._part[1] = Shader::SMO_view_to_apiview; @@ -308,12 +304,9 @@ CLP(ShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderContext bind._part[0] = Shader::SMO_apiview_to_view; bind._part[1] = Shader::SMO_view_to_apiclip; } - bind._dep[0] = Shader::SSD_general | Shader::SSD_transform; - bind._dep[1] = Shader::SSD_general | Shader::SSD_transform; } else if (matrix_name == "NormalMatrix") { // This is really the upper 3x3 of the ModelViewMatrixInverseTranspose. - bind._func = Shader::SMF_compose; if (inverse) { bind._part[0] = Shader::SMO_model_to_view; bind._part[1] = Shader::SMO_view_to_apiview; @@ -321,8 +314,6 @@ CLP(ShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderContext bind._part[0] = Shader::SMO_apiview_to_view; bind._part[1] = Shader::SMO_view_to_model; } - bind._dep[0] = Shader::SSD_general | Shader::SSD_transform; - bind._dep[1] = Shader::SSD_general | Shader::SSD_transform; if (transpose) { bind._piece = Shader::SMP_upper3x3; @@ -330,6 +321,33 @@ CLP(ShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderContext bind._piece = Shader::SMP_transpose3x3; } + } else if (matrix_name == "ModelMatrix") { + if (inverse) { + bind._part[0] = Shader::SMO_world_to_view; + bind._part[1] = Shader::SMO_view_to_model; + } else { + bind._part[0] = Shader::SMO_model_to_view; + bind._part[1] = Shader::SMO_view_to_world; + } + + } else if (matrix_name == "ViewMatrix") { + if (inverse) { + bind._part[0] = Shader::SMO_apiview_to_view; + bind._part[1] = Shader::SMO_view_to_world; + } else { + bind._part[0] = Shader::SMO_world_to_view; + bind._part[1] = Shader::SMO_view_to_apiview; + } + + } else if (matrix_name == "ViewProjectionMatrix") { + if (inverse) { + bind._part[0] = Shader::SMO_apiclip_to_view; + bind._part[1] = Shader::SMO_view_to_world; + } else { + bind._part[0] = Shader::SMO_world_to_view; + bind._part[1] = Shader::SMO_view_to_apiclip; + } + } else { GLCAT.error() << "Unrecognized uniform matrix name '" << matrix_name << "'!\n"; continue; @@ -410,21 +428,21 @@ CLP(ShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderContext if (param_name == "osg_ViewMatrix") { bind._piece = Shader::SMP_whole; - bind._func = Shader::SMF_first; + bind._func = Shader::SMF_compose; bind._part[0] = Shader::SMO_world_to_view; - bind._part[1] = Shader::SMO_identity; + bind._part[1] = Shader::SMO_view_to_apiview; bind._dep[0] = Shader::SSD_general | Shader::SSD_transform; - bind._dep[1] = Shader::SSD_NONE; + bind._dep[1] = Shader::SSD_general | Shader::SSD_transform; s->_mat_spec.push_back(bind); continue; } else if (param_name == "osg_InverseViewMatrix") { bind._piece = Shader::SMP_whole; - bind._func = Shader::SMF_first; - bind._part[0] = Shader::SMO_view_to_world; - bind._part[1] = Shader::SMO_identity; + bind._func = Shader::SMF_compose; + bind._part[0] = Shader::SMO_apiview_to_view; + bind._part[1] = Shader::SMO_view_to_world; bind._dep[0] = Shader::SSD_general | Shader::SSD_transform; - bind._dep[1] = Shader::SSD_NONE; + bind._dep[1] = Shader::SSD_general | Shader::SSD_transform; s->_mat_spec.push_back(bind); continue; From 24d705b031a1925b2545a7a9db637a00a07988e0 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 29 Jul 2014 11:15:12 +0000 Subject: [PATCH 02/52] The "null" ButtonHandle and TypeHandle now evaluate to false --- dtool/src/dtoolbase/typeHandle.I | 12 +++++++++++- dtool/src/dtoolbase/typeHandle.h | 1 + panda/src/putil/buttonHandle.I | 13 ++++++++++++- panda/src/putil/buttonHandle.h | 2 ++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/dtool/src/dtoolbase/typeHandle.I b/dtool/src/dtoolbase/typeHandle.I index 9304fd400c..482d0996db 100644 --- a/dtool/src/dtoolbase/typeHandle.I +++ b/dtool/src/dtoolbase/typeHandle.I @@ -275,6 +275,17 @@ none() { return _none; } +//////////////////////////////////////////////////////////////////// +// Function: TypeHandle::operator bool +// Access: Published +// Description: TypeHandle::none() evaluates to false, everything +// else evaluates to true. +//////////////////////////////////////////////////////////////////// +INLINE TypeHandle:: +operator bool () const { + return (_index != 0); +} + //////////////////////////////////////////////////////////////////// // Function: get_best_parent_from_Set // Access: Published @@ -295,4 +306,3 @@ INLINE int TypeHandle::get_best_parent_from_Set(const std::set< int > &legal_va } return -1; } - diff --git a/dtool/src/dtoolbase/typeHandle.h b/dtool/src/dtoolbase/typeHandle.h index 5d0bfa34fb..2ca06169e3 100644 --- a/dtool/src/dtoolbase/typeHandle.h +++ b/dtool/src/dtoolbase/typeHandle.h @@ -146,6 +146,7 @@ PUBLISHED: INLINE int get_index() const; INLINE void output(ostream &out) const; INLINE static TypeHandle none(); + INLINE operator bool () const; private: int _index; diff --git a/panda/src/putil/buttonHandle.I b/panda/src/putil/buttonHandle.I index e692cef07e..0da0f9a782 100644 --- a/panda/src/putil/buttonHandle.I +++ b/panda/src/putil/buttonHandle.I @@ -135,7 +135,7 @@ get_index() const { //////////////////////////////////////////////////////////////////// // Function: ButtonHandle::output // Access: Published -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE void ButtonHandle:: output(ostream &out) const { @@ -152,3 +152,14 @@ INLINE ButtonHandle ButtonHandle:: none() { return _none; } + +//////////////////////////////////////////////////////////////////// +// Function: ButtonHandle::operator bool +// Access: Published +// Description: ButtonHandle::none() evaluates to false, everything +// else evaluates to true. +//////////////////////////////////////////////////////////////////// +INLINE ButtonHandle:: +operator bool () const { + return (_index != 0); +} diff --git a/panda/src/putil/buttonHandle.h b/panda/src/putil/buttonHandle.h index 909458c32c..3e4a5f0e4d 100644 --- a/panda/src/putil/buttonHandle.h +++ b/panda/src/putil/buttonHandle.h @@ -51,6 +51,8 @@ PUBLISHED: INLINE void output(ostream &out) const; INLINE static ButtonHandle none(); + INLINE operator bool () const; + private: int _index; static ButtonHandle _none; From 0dc6c663a1a237474090b5afc015f7dad44398cf Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 29 Jul 2014 13:22:26 +0000 Subject: [PATCH 03/52] Add get_children et al to PandaNode --- panda/src/pgraph/pandaNode.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/panda/src/pgraph/pandaNode.h b/panda/src/pgraph/pandaNode.h index 9cde4a9943..d7d19efba4 100644 --- a/panda/src/pgraph/pandaNode.h +++ b/panda/src/pgraph/pandaNode.h @@ -125,11 +125,13 @@ PUBLISHED: INLINE int get_num_parents(Thread *current_thread = Thread::get_current_thread()) const; INLINE PandaNode *get_parent(int n, Thread *current_thread = Thread::get_current_thread()) const; INLINE int find_parent(PandaNode *node, Thread *current_thread = Thread::get_current_thread()) const; + MAKE_SEQ(get_parents, get_num_parents, get_parent); INLINE int get_num_children(Thread *current_thread = Thread::get_current_thread()) const; INLINE PandaNode *get_child(int n, Thread *current_thread = Thread::get_current_thread()) const; INLINE int get_child_sort(int n, Thread *current_thread = Thread::get_current_thread()) const; INLINE int find_child(PandaNode *node, Thread *current_thread = Thread::get_current_thread()) const; + MAKE_SEQ(get_children, get_num_children, get_child); int count_num_descendants() const; @@ -153,6 +155,7 @@ PUBLISHED: INLINE PandaNode *get_stashed(int n, Thread *current_thread = Thread::get_current_thread()) const; INLINE int get_stashed_sort(int n, Thread *current_thread = Thread::get_current_thread()) const; INLINE int find_stashed(PandaNode *node, Thread *current_thread = Thread::get_current_thread()) const; + MAKE_SEQ(get_stashed, get_num_stashed, get_stashed); void add_stashed(PandaNode *child_node, int sort = 0, Thread *current_thread = Thread::get_current_thread()); void remove_stashed(int child_index, Thread *current_thread = Thread::get_current_thread()); From 3d19752dc087e78fb391fd312b4d598f3ad55642 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 29 Jul 2014 13:25:43 +0000 Subject: [PATCH 04/52] Add proper comparison operators and get_hash to ButtonHandle --- panda/src/putil/buttonHandle.I | 53 ++++++++++++++++++++++++++++++++++ panda/src/putil/buttonHandle.h | 11 ++++--- 2 files changed, 60 insertions(+), 4 deletions(-) diff --git a/panda/src/putil/buttonHandle.I b/panda/src/putil/buttonHandle.I index 0da0f9a782..59d68ec609 100644 --- a/panda/src/putil/buttonHandle.I +++ b/panda/src/putil/buttonHandle.I @@ -76,6 +76,59 @@ operator < (const ButtonHandle &other) const { return (_index < other._index); } +//////////////////////////////////////////////////////////////////// +// Function: ButtonHandle::Ordering Operator +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +INLINE bool ButtonHandle:: +operator <= (const ButtonHandle &other) const { + return (_index <= other._index); +} + +//////////////////////////////////////////////////////////////////// +// Function: ButtonHandle::Ordering Operator +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +INLINE bool ButtonHandle:: +operator > (const ButtonHandle &other) const { + return (_index > other._index); +} + +//////////////////////////////////////////////////////////////////// +// Function: ButtonHandle::Ordering Operator +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +INLINE bool ButtonHandle:: +operator >= (const ButtonHandle &other) const { + return (_index >= other._index); +} + +//////////////////////////////////////////////////////////////////// +// Function: ButtonHandle::compare_to +// Access: Published +// Description: Sorts ButtonHandles arbitrarily (according to <, >, +// etc.). Returns a number less than 0 if this type +// sorts before the other one, greater than zero if it +// sorts after, 0 if they are equivalent. +//////////////////////////////////////////////////////////////////// +INLINE int ButtonHandle:: +compare_to(const ButtonHandle &other) const { + return _index - other._index; +} + +//////////////////////////////////////////////////////////////////// +// Function: ButtonHandle::get_hash +// Access: Published +// Description: Returns a hash code suitable for phash_map. +//////////////////////////////////////////////////////////////////// +INLINE size_t ButtonHandle:: +get_hash() const { + return (size_t)_index; +} + //////////////////////////////////////////////////////////////////// // Function: ButtonHandle::has_ascii_equivalent // Access: Published diff --git a/panda/src/putil/buttonHandle.h b/panda/src/putil/buttonHandle.h index 3e4a5f0e4d..c53f9a6ac9 100644 --- a/panda/src/putil/buttonHandle.h +++ b/panda/src/putil/buttonHandle.h @@ -29,16 +29,19 @@ class EXPCL_PANDA_PUTIL ButtonHandle { PUBLISHED: INLINE ButtonHandle(); INLINE ButtonHandle(int index); + INLINE ButtonHandle(const ButtonHandle ©); ButtonHandle(const string &name); -public: - INLINE ButtonHandle(const ButtonHandle ©); - +PUBLISHED: INLINE bool operator == (const ButtonHandle &other) const; INLINE bool operator != (const ButtonHandle &other) const; INLINE bool operator < (const ButtonHandle &other) const; + INLINE bool operator <= (const ButtonHandle &other) const; + INLINE bool operator > (const ButtonHandle &other) const; + INLINE bool operator >= (const ButtonHandle &other) const; + INLINE int compare_to(const ButtonHandle &other) const; + INLINE size_t get_hash() const; -PUBLISHED: string get_name() const; INLINE bool has_ascii_equivalent() const; INLINE char get_ascii_equivalent() const; From aaca66cdc1d391ac68f1be3fcdb2acb8e0937782 Mon Sep 17 00:00:00 2001 From: enn0x Date: Mon, 4 Aug 2014 22:41:31 +0000 Subject: [PATCH 05/52] Exposing BulletShape.getBounds --- panda/src/bullet/bulletShape.cxx | 28 ++++++++++++++++++++++++++++ panda/src/bullet/bulletShape.h | 3 +++ 2 files changed, 31 insertions(+) diff --git a/panda/src/bullet/bulletShape.cxx b/panda/src/bullet/bulletShape.cxx index 769f46ff39..77871b2c34 100644 --- a/panda/src/bullet/bulletShape.cxx +++ b/panda/src/bullet/bulletShape.cxx @@ -73,3 +73,31 @@ set_local_scale(const LVecBase3 &scale) { ptr()->setLocalScaling(LVecBase3_to_btVector3(scale)); } +//////////////////////////////////////////////////////////////////// +// Function: BulletShape::get_bounds +// Access: Published +// Description: Returns the current bounds of this collision shape. +//////////////////////////////////////////////////////////////////// +BoundingSphere BulletShape:: +get_bounds() const { + +/* + btTransform tr; + tr.setIdentity(); + btVector3 aabbMin,aabbMax; + ptr()->getAabb(tr,aabbMin,aabbMax); + btVector3 o = tr.getOrigin(); +cout << "aabbMin " << aabbMin.x() << " " << aabbMin.y() << " " << aabbMin.z() << endl; +cout << "aabbMax " << aabbMax.x() << " " << aabbMax.y() << " " << aabbMax.z() << endl; +cout << "origin " << aabbMin.x() << " " << aabbMin.y() << " " << aabbMin.z() << endl; +*/ + + btVector3 center; + btScalar radius; + + ptr()->getBoundingSphere(center, radius); + BoundingSphere bounds(btVector3_to_LPoint3(center), (PN_stdfloat)radius); + + return bounds; +} + diff --git a/panda/src/bullet/bulletShape.h b/panda/src/bullet/bulletShape.h index a42c3cb71c..afdd35f947 100644 --- a/panda/src/bullet/bulletShape.h +++ b/panda/src/bullet/bulletShape.h @@ -20,6 +20,7 @@ #include "bullet_includes.h" #include "typedReferenceCount.h" +#include "boundingSphere.h" //////////////////////////////////////////////////////////////////// // Class : BulletShape @@ -43,6 +44,8 @@ PUBLISHED: PN_stdfloat get_margin() const; + BoundingSphere get_bounds() const; + public: virtual btCollisionShape *ptr() const = 0; From d658ba72540b67199e2d90a3e3f5e894263c55f7 Mon Sep 17 00:00:00 2001 From: enn0x Date: Wed, 6 Aug 2014 22:35:15 +0000 Subject: [PATCH 06/52] Bullet: exposing bounds for single shape and all shapes. --- panda/src/bullet/bulletBodyNode.cxx | 32 +++++++++++++++++++++++++++++ panda/src/bullet/bulletBodyNode.h | 2 ++ panda/src/bullet/bulletShape.cxx | 4 ++-- panda/src/bullet/bulletShape.h | 2 +- 4 files changed, 37 insertions(+), 3 deletions(-) diff --git a/panda/src/bullet/bulletBodyNode.cxx b/panda/src/bullet/bulletBodyNode.cxx index f0bea49a05..ef1a68df96 100644 --- a/panda/src/bullet/bulletBodyNode.cxx +++ b/panda/src/bullet/bulletBodyNode.cxx @@ -668,3 +668,35 @@ set_transform_dirty() { transform_changed(); } +//////////////////////////////////////////////////////////////////// +// Function: BulletBodyNode::get_shape_bounds +// Access: Published +// Description: Returns the current bounds of all collision shapes +// owned by this body. +//////////////////////////////////////////////////////////////////// +BoundingSphere BulletBodyNode:: +get_shape_bounds() const { + +/* + btTransform tr; + tr.setIdentity(); + btVector3 aabbMin,aabbMax; + ptr()->getAabb(tr,aabbMin,aabbMax); + btVector3 o = tr.getOrigin(); +cout << "aabbMin " << aabbMin.x() << " " << aabbMin.y() << " " << aabbMin.z() << endl; +cout << "aabbMax " << aabbMax.x() << " " << aabbMax.y() << " " << aabbMax.z() << endl; +cout << "origin " << aabbMin.x() << " " << aabbMin.y() << " " << aabbMin.z() << endl; +*/ + + btVector3 center; + btScalar radius; + + if (_shape) { + _shape->getBoundingSphere(center, radius); + } + + BoundingSphere bounds(btVector3_to_LPoint3(center), (PN_stdfloat)radius); + + return bounds; +} + diff --git a/panda/src/bullet/bulletBodyNode.h b/panda/src/bullet/bulletBodyNode.h index c5be54eb47..59c1ecb32c 100644 --- a/panda/src/bullet/bulletBodyNode.h +++ b/panda/src/bullet/bulletBodyNode.h @@ -24,6 +24,7 @@ #include "collideMask.h" #include "collisionNode.h" #include "transformState.h" +#include "boundingSphere.h" class BulletShape; @@ -47,6 +48,7 @@ PUBLISHED: LPoint3 get_shape_pos(int idx) const; LMatrix4 get_shape_mat(int idx) const; + BoundingSphere get_shape_bounds() const; void add_shapes_from_collision_solids(CollisionNode *cnode); diff --git a/panda/src/bullet/bulletShape.cxx b/panda/src/bullet/bulletShape.cxx index 77871b2c34..c0398e3922 100644 --- a/panda/src/bullet/bulletShape.cxx +++ b/panda/src/bullet/bulletShape.cxx @@ -74,12 +74,12 @@ set_local_scale(const LVecBase3 &scale) { } //////////////////////////////////////////////////////////////////// -// Function: BulletShape::get_bounds +// Function: BulletShape::get_shape_bounds // Access: Published // Description: Returns the current bounds of this collision shape. //////////////////////////////////////////////////////////////////// BoundingSphere BulletShape:: -get_bounds() const { +get_shape_bounds() const { /* btTransform tr; diff --git a/panda/src/bullet/bulletShape.h b/panda/src/bullet/bulletShape.h index afdd35f947..de98ebf1eb 100644 --- a/panda/src/bullet/bulletShape.h +++ b/panda/src/bullet/bulletShape.h @@ -44,7 +44,7 @@ PUBLISHED: PN_stdfloat get_margin() const; - BoundingSphere get_bounds() const; + BoundingSphere get_shape_bounds() const; public: virtual btCollisionShape *ptr() const = 0; From f8acde64f7a56c0c217b6712088aef04ea0be77a Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 14 Aug 2014 18:08:31 +0000 Subject: [PATCH 07/52] taskMgr.destroy() should imply stop() --- direct/src/task/Task.py | 1 + 1 file changed, 1 insertion(+) diff --git a/direct/src/task/Task.py b/direct/src/task/Task.py index bffe8fa82d..f105e8f33c 100644 --- a/direct/src/task/Task.py +++ b/direct/src/task/Task.py @@ -136,6 +136,7 @@ class TaskManager: def destroy(self): # This should be safe to call multiple times. + self.running = False self.notify.info("TaskManager.destroy()") self.destroyed = True self._frameProfileQueue.clear() From 1055c2e0fd4a71116b3fcc13794653865dff8def Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 17 Aug 2014 16:41:19 +0000 Subject: [PATCH 08/52] Use glClearBufferfv to clear MRTs more efficiently (without having to call glDrawBuffers several times) --- panda/src/glstuff/glGraphicsBuffer_src.cxx | 2 +- .../glstuff/glGraphicsStateGuardian_src.cxx | 174 ++++++++++++------ .../src/glstuff/glGraphicsStateGuardian_src.h | 2 + 3 files changed, 118 insertions(+), 60 deletions(-) diff --git a/panda/src/glstuff/glGraphicsBuffer_src.cxx b/panda/src/glstuff/glGraphicsBuffer_src.cxx index bc13a435c7..79de507955 100644 --- a/panda/src/glstuff/glGraphicsBuffer_src.cxx +++ b/panda/src/glstuff/glGraphicsBuffer_src.cxx @@ -1280,7 +1280,7 @@ open_buffer() { // A lot of code seems to depend on being able to get a // color buffer by just setting the rgb_color bit. if (_fb_properties.get_color_bits() == 0 && - _fb_properties.get_rgb_color() > 0) { + _fb_properties.get_rgb_color()) { _fb_properties.set_color_bits(1); } diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 6aed4d7335..dee772d370 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -1423,6 +1423,7 @@ reset() { } _glDrawBuffers = NULL; + _glClearBufferfv = NULL; #ifndef OPENGLES if (is_at_least_gl_version(2, 0)) { _glDrawBuffers = (PFNGLDRAWBUFFERSPROC) @@ -1438,6 +1439,11 @@ reset() { glGetIntegerv(GL_MAX_DRAW_BUFFERS, &max_draw_buffers); _max_color_targets = max_draw_buffers; } + + if (is_at_least_gl_version(3, 0)) { + _glClearBufferfv = (PFNGLCLEARBUFFERFVPROC) + get_extension_func("glClearBufferfv"); + } #endif // OPENGLES #ifndef OPENGLES @@ -2178,9 +2184,7 @@ clear(DrawableRegion *clearable) { PStatTimer timer(_clear_pcollector); report_my_gl_errors(); - if ((!clearable->get_clear_color_active())&& - (!clearable->get_clear_depth_active())&& - (!clearable->get_clear_stencil_active())) { + if (!clearable->is_any_clear_active()) { return; } @@ -2188,56 +2192,110 @@ clear(DrawableRegion *clearable) { int mask = 0; - for (int i=0; i<_current_properties->get_aux_rgba(); i++) { - int layerid = GraphicsOutput::RTP_aux_rgba_0 + i; - int layerbit = RenderBuffer::T_aux_rgba_0 << i; - if (clearable->get_clear_active(layerid)) { - LColor v = clearable->get_clear_value(layerid); - glClearColor(v[0],v[1],v[2],v[3]); - set_draw_buffer(layerbit); - glClear(GL_COLOR_BUFFER_BIT); - } - } - for (int i=0; i<_current_properties->get_aux_hrgba(); i++) { - int layerid = GraphicsOutput::RTP_aux_hrgba_0 + i; - int layerbit = RenderBuffer::T_aux_hrgba_0 << i; - if (clearable->get_clear_active(layerid)) { - LColor v = clearable->get_clear_value(layerid); - glClearColor(v[0],v[1],v[2],v[3]); - set_draw_buffer(layerbit); - glClear(GL_COLOR_BUFFER_BIT); - } - } - for (int i=0; i<_current_properties->get_aux_float(); i++) { - int layerid = GraphicsOutput::RTP_aux_float_0 + i; - int layerbit = RenderBuffer::T_aux_float_0 << i; - if (clearable->get_clear_active(layerid)) { - LColor v = clearable->get_clear_value(layerid); - glClearColor(v[0],v[1],v[2],v[3]); - set_draw_buffer(layerbit); - glClear(GL_COLOR_BUFFER_BIT); - } - } +#ifndef OPENGLES + if (_current_fbo != 0 && _glClearBufferfv != NULL) { + // We can use glClearBuffer to clear all the color attachments, + // which protects us from the overhead of having to call set_draw_buffer + // for every single attachment. + int index = 0; - // In the past, it was possible to set the draw buffer - // once in prepare_display_region and then forget about it. - // Now, with aux layers, it is necessary to occasionally - // change the draw buffer. In time, I think there will need - // to be a draw buffer attrib. Until then, this little hack - // to put things back the way they were after - // prepare_display_region will do. - - set_draw_buffer(_draw_buffer_type); - - if (_current_properties->get_color_bits() > 0) { - if (clearable->get_clear_color_active()) { - LColor v = clearable->get_clear_color(); - glClearColor(v[0],v[1],v[2],v[3]); - if (gl_color_mask) { - glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); + if (_current_properties->get_color_bits() > 0) { + if (_current_properties->is_stereo()) { + // Clear both left and right attachments. + if (clearable->get_clear_active(GraphicsOutput::RTP_color)) { + LColorf v = LCAST(float, clearable->get_clear_value(GraphicsOutput::RTP_color)); + _glClearBufferfv(GL_COLOR, index, v.get_data()); + _glClearBufferfv(GL_COLOR, index + 1, v.get_data()); + } + index += 2; + } else { + if (clearable->get_clear_active(GraphicsOutput::RTP_color)) { + LColorf v = LCAST(float, clearable->get_clear_value(GraphicsOutput::RTP_color)); + _glClearBufferfv(GL_COLOR, index, v.get_data()); + } + ++index; + } + } + for (int i = 0; i < _current_properties->get_aux_rgba(); ++i) { + int layerid = GraphicsOutput::RTP_aux_rgba_0 + i; + if (clearable->get_clear_active(layerid)) { + LColorf v = LCAST(float, clearable->get_clear_value(layerid)); + _glClearBufferfv(GL_COLOR, index, v.get_data()); + } + ++index; + } + for (int i = 0; i < _current_properties->get_aux_hrgba(); ++i) { + int layerid = GraphicsOutput::RTP_aux_hrgba_0 + i; + if (clearable->get_clear_active(layerid)) { + LColorf v = LCAST(float, clearable->get_clear_value(layerid)); + _glClearBufferfv(GL_COLOR, index, v.get_data()); + } + ++index; + } + for (int i = 0; i < _current_properties->get_aux_float(); ++i) { + int layerid = GraphicsOutput::RTP_aux_float_0 + i; + if (clearable->get_clear_active(layerid)) { + LColorf v = LCAST(float, clearable->get_clear_value(layerid)); + _glClearBufferfv(GL_COLOR, index, v.get_data()); + } + ++index; + } + } else +#endif + { + if (_current_properties->get_aux_mask() != 0) { + for (int i = 0; i < _current_properties->get_aux_rgba(); ++i) { + int layerid = GraphicsOutput::RTP_aux_rgba_0 + i; + int layerbit = RenderBuffer::T_aux_rgba_0 << i; + if (clearable->get_clear_active(layerid)) { + LColor v = clearable->get_clear_value(layerid); + glClearColor(v[0], v[1], v[2], v[3]); + set_draw_buffer(layerbit); + glClear(GL_COLOR_BUFFER_BIT); + } + } + for (int i = 0; i < _current_properties->get_aux_hrgba(); ++i) { + int layerid = GraphicsOutput::RTP_aux_hrgba_0 + i; + int layerbit = RenderBuffer::T_aux_hrgba_0 << i; + if (clearable->get_clear_active(layerid)) { + LColor v = clearable->get_clear_value(layerid); + glClearColor(v[0], v[1], v[2], v[3]); + set_draw_buffer(layerbit); + glClear(GL_COLOR_BUFFER_BIT); + } + } + for (int i = 0; i < _current_properties->get_aux_float(); ++i) { + int layerid = GraphicsOutput::RTP_aux_float_0 + i; + int layerbit = RenderBuffer::T_aux_float_0 << i; + if (clearable->get_clear_active(layerid)) { + LColor v = clearable->get_clear_value(layerid); + glClearColor(v[0], v[1], v[2], v[3]); + set_draw_buffer(layerbit); + glClear(GL_COLOR_BUFFER_BIT); + } + } + + // In the past, it was possible to set the draw buffer + // once in prepare_display_region and then forget about it. + // Now, with aux layers, it is necessary to occasionally + // change the draw buffer. In time, I think there will need + // to be a draw buffer attrib. Until then, this little hack + // to put things back the way they were after + // prepare_display_region will do. + + set_draw_buffer(_draw_buffer_type); + } + + if (_current_properties->get_color_bits() > 0) { + if (clearable->get_clear_color_active()) { + LColor v = clearable->get_clear_color(); + glClearColor(v[0], v[1], v[2], v[3]); + if (gl_color_mask) { + glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); + } + _state_mask.clear_bit(ColorWriteAttrib::get_class_slot()); + mask |= GL_COLOR_BUFFER_BIT; } - _state_mask.clear_bit(ColorWriteAttrib::get_class_slot()); - mask |= GL_COLOR_BUFFER_BIT; } } @@ -6322,19 +6380,19 @@ set_draw_buffer(int rbtype) { ++index; } } - for (int i=0; i<_current_properties->get_aux_rgba(); i++) { + for (int i = 0; i < _current_properties->get_aux_rgba(); ++i) { if (rbtype & (RenderBuffer::T_aux_rgba_0 << i)) { buffers[nbuffers++] = GL_COLOR_ATTACHMENT0_EXT + index; } ++index; } - for (int i=0; i<_current_properties->get_aux_hrgba(); i++) { + for (int i = 0; i < _current_properties->get_aux_hrgba(); ++i) { if (rbtype & (RenderBuffer::T_aux_hrgba_0 << i)) { buffers[nbuffers++] = GL_COLOR_ATTACHMENT0_EXT + index; } ++index; } - for (int i=0; i<_current_properties->get_aux_float(); i++) { + for (int i = 0; i < _current_properties->get_aux_float(); ++i) { if (rbtype & (RenderBuffer::T_aux_float_0 << i)) { buffers[nbuffers++] = GL_COLOR_ATTACHMENT0_EXT + index; } @@ -6423,19 +6481,19 @@ set_read_buffer(int rbtype) { } ++index; } - for (int i=0; i<_current_properties->get_aux_rgba(); i++) { + for (int i = 0; i < _current_properties->get_aux_rgba(); ++i) { if (rbtype & (RenderBuffer::T_aux_rgba_0 << i)) { buffer = GL_COLOR_ATTACHMENT0_EXT + index; } ++index; } - for (int i=0; i<_current_properties->get_aux_hrgba(); i++) { + for (int i = 0; i < _current_properties->get_aux_hrgba(); ++i) { if (rbtype & (RenderBuffer::T_aux_hrgba_0 << i)) { buffer = GL_COLOR_ATTACHMENT0_EXT + index; } ++index; } - for (int i=0; i<_current_properties->get_aux_float(); i++) { + for (int i = 0; i < _current_properties->get_aux_float(); ++i) { if (rbtype & (RenderBuffer::T_aux_float_0 << i)) { buffer = GL_COLOR_ATTACHMENT0_EXT + index; } @@ -6487,8 +6545,6 @@ set_read_buffer(int rbtype) { #endif // OPENGLES } - - //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::get_numeric_type // Access: Protected, Static diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.h b/panda/src/glstuff/glGraphicsStateGuardian_src.h index fa3bbcccfd..6eba1a7632 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.h +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.h @@ -88,6 +88,7 @@ typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs); +typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value); typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers); typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); @@ -689,6 +690,7 @@ public: INLINE bool get_supports_framebuffer_blit(); PFNGLBLITFRAMEBUFFEREXTPROC _glBlitFramebuffer; PFNGLDRAWBUFFERSPROC _glDrawBuffers; + PFNGLCLEARBUFFERFVPROC _glClearBufferfv; int _max_fb_samples; bool _supports_viewport_arrays; bool _supports_bindless_texture; From cd79de19b2f41a36dc454a620097c56021ae098c Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 19 Aug 2014 20:22:57 +0000 Subject: [PATCH 09/52] Add more parameters for binding images to shaders. --- panda/src/glstuff/glShaderContext_src.cxx | 80 ++++--- panda/src/glstuff/glTextureContext_src.I | 1 - panda/src/glstuff/glTextureContext_src.cxx | 17 +- panda/src/glstuff/glTextureContext_src.h | 7 +- panda/src/pgraph/nodePath.cxx | 262 +-------------------- panda/src/pgraph/nodePath.h | 31 +-- panda/src/pgraph/shaderInput.I | 189 ++++++++++++--- panda/src/pgraph/shaderInput.h | 17 +- 8 files changed, 248 insertions(+), 356 deletions(-) diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index bc8c515453..f8dadb991f 100755 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -1153,9 +1153,14 @@ disable_shader_texture_bindings() { if (gl_enable_memory_barriers) { for (int i = 0; i < num_image_units; ++i) { - // We don't distinguish between read-only and read-write/write-only - // image access, so we have to assume that the shader wrote to it. - _glsl_img_textures[i]->mark_incoherent(); + const InternalName *name = _glsl_img_inputs[i]; + const ShaderInput *input = _glgsg->_target_shader->get_shader_input(name); + + if ((input->_access & ShaderInput::A_write) != 0) { + _glsl_img_textures[i]->mark_incoherent(true); + } else { + _glsl_img_textures[i]->mark_incoherent(false); + } _glsl_img_textures[i] = NULL; } } @@ -1193,21 +1198,18 @@ update_shader_texture_bindings(ShaderContext *prev) { int num_image_units = min(_glsl_img_inputs.size(), (size_t)_glgsg->_max_image_units); if (num_image_units > 0) { - GLuint *multi_img = NULL; - // If we support multi-bind, prepare an array. - if (_glgsg->_supports_multi_bind) { - multi_img = new GLuint[num_image_units]; - } - for (int i = 0; i < num_image_units; ++i) { const InternalName *name = _glsl_img_inputs[i]; - Texture *tex = _glgsg->_target_shader->get_shader_input_texture(name); + const ShaderInput *input = _glgsg->_target_shader->get_shader_input(name); + Texture *tex = input->get_texture(); GLuint gl_tex = 0; + CLP(TextureContext) *gtc; + if (tex != NULL) { int view = _glgsg->get_current_tex_view_offset(); - CLP(TextureContext) *gtc = DCAST(CLP(TextureContext), tex->prepare_now(view, _glgsg->_prepared_objects, _glgsg)); + gtc = DCAST(CLP(TextureContext), tex->prepare_now(view, _glgsg->_prepared_objects, _glgsg)); if (gtc != (TextureContext*)NULL) { _glsl_img_textures[i] = gtc; @@ -1220,26 +1222,44 @@ update_shader_texture_bindings(ShaderContext *prev) { } } - if (multi_img != NULL) { - // Put in array so we can multi-bind later. - multi_img[i] = gl_tex; - + if (gl_tex == 0) { + _glgsg->_glBindImageTexture(i, 0, 0, GL_FALSE, 0, GL_READ_ONLY, GL_R8); } else { - // We don't support multi-bind, so bind now in the same way that multi-bind would have done it. - if (gl_tex == 0) { - _glgsg->_glBindImageTexture(i, 0, 0, GL_FALSE, 0, GL_READ_ONLY, GL_R8); - } else { - //TODO: automatically convert to sized type instead of plain GL_RGBA - // If a base type is used, it will crash. - GLint internal_format = _glgsg->get_internal_image_format(tex); - _glgsg->_glBindImageTexture(i, gl_tex, 0, GL_TRUE, 0, GL_READ_WRITE, internal_format); - } - } - } + //TODO: automatically convert to sized type instead of plain GL_RGBA + // If a base type is used, it will crash. + if (gtc->_internal_format == GL_RGBA || gtc->_internal_format == GL_RGB) { + GLCAT.error() + << "Texture " << tex->get_name() << " has an unsized format. Textures bound " + << "to a shader as an image need a sized format.\n"; - if (multi_img != NULL) { - _glgsg->_glBindImageTextures(0, num_image_units, multi_img); - delete[] multi_img; + // This may not actually be right, but may still prevent a crash. + if (gtc->_internal_format == GL_RGBA) { + gtc->_internal_format = GL_RGBA8; + } else { + gtc->_internal_format = GL_RGB8; + } + } + + GLenum access = GL_READ_ONLY; + GLboolean layered = (input->_access & ShaderInput::A_layered) != 0; + + if ((input->_access & ShaderInput::A_read) != 0 && + (input->_access & ShaderInput::A_write) != 0) { + access = GL_READ_WRITE; + + } else if ((input->_access & ShaderInput::A_read) != 0) { + access = GL_READ_ONLY; + + } else if ((input->_access & ShaderInput::A_write) != 0) { + access = GL_WRITE_ONLY; + + } else { + access = GL_READ_ONLY; + gl_tex = 0; + } + _glgsg->_glBindImageTexture(i, gl_tex, input->_bind_level, layered, + input->_bind_layer, access, gtc->_internal_format); + } } } #endif @@ -1332,7 +1352,7 @@ update_shader_texture_bindings(ShaderContext *prev) { #ifndef OPENGLES if (barriers != 0) { - // Issue a memory barrier. + // Issue a memory barrier prior to this shader's execution. _glgsg->issue_memory_barrier(barriers); } #endif diff --git a/panda/src/glstuff/glTextureContext_src.I b/panda/src/glstuff/glTextureContext_src.I index 50704ce14e..687a2e1f3b 100644 --- a/panda/src/glstuff/glTextureContext_src.I +++ b/panda/src/glstuff/glTextureContext_src.I @@ -28,7 +28,6 @@ CLP(TextureContext)(CLP(GraphicsStateGuardian) *glgsg, glGenTextures(1, &_index); _handle = 0; - _needs_barrier = false; _has_storage = false; _immutable = false; _uses_mipmaps = false; diff --git a/panda/src/glstuff/glTextureContext_src.cxx b/panda/src/glstuff/glTextureContext_src.cxx index 30effdd052..4c42ab07c8 100644 --- a/panda/src/glstuff/glTextureContext_src.cxx +++ b/panda/src/glstuff/glTextureContext_src.cxx @@ -87,7 +87,6 @@ reset_data() { _handle = 0; _handle_resident = false; - _needs_barrier = false; _has_storage = false; _immutable = false; @@ -169,15 +168,25 @@ needs_barrier(GLbitfield barrier) { // Function: GLTextureContext::mark_incoherent // Access: Public // Description: Mark a texture as needing a memory barrier, since -// a non-coherent write just happened to it. +// a non-coherent read or write just happened to it. +// If 'wrote' is true, it was written to. //////////////////////////////////////////////////////////////////// void CLP(TextureContext):: -mark_incoherent() { +mark_incoherent(bool wrote) { if (!gl_enable_memory_barriers) { return; } - _glgsg->_textures_needing_fetch_barrier.insert(this); + // If we only read from it, the next read operation won't need + // another barrier, since it'll be reading the same data. + if (wrote) { + _glgsg->_textures_needing_fetch_barrier.insert(this); + } + + // We could still write to it before we read from it, so we have + // to always insert these barriers. This could be slightly + // optimized so that we don't issue a barrier between consecutive + // image reads, but that may not be worth the trouble. _glgsg->_textures_needing_image_access_barrier.insert(this); _glgsg->_textures_needing_update_barrier.insert(this); _glgsg->_textures_needing_framebuffer_barrier.insert(this); diff --git a/panda/src/glstuff/glTextureContext_src.h b/panda/src/glstuff/glTextureContext_src.h index 92e90a8276..3eb7515297 100644 --- a/panda/src/glstuff/glTextureContext_src.h +++ b/panda/src/glstuff/glTextureContext_src.h @@ -40,7 +40,7 @@ public: CONSTEXPR bool needs_barrier(GLbitfield barrier) { return false; }; #else bool needs_barrier(GLbitfield barrier); - void mark_incoherent(); + void mark_incoherent(bool wrote); #endif // This is the GL "name" of the texture object. @@ -50,11 +50,6 @@ public: GLuint64 _handle; bool _handle_resident; - // This is true if the texture was recently written to in a - // non-coherent way, and Panda may have to call glMemoryBarrier - // for the results of this write to become visible. - bool _needs_barrier; - // These are the parameters that we specified with the last // glTexImage2D() or glTexStorage2D() call. If none of these have // changed, we can reload the texture image with a glTexSubImage2D(). diff --git a/panda/src/pgraph/nodePath.cxx b/panda/src/pgraph/nodePath.cxx index 2e88f06184..3aae0f7ba6 100644 --- a/panda/src/pgraph/nodePath.cxx +++ b/panda/src/pgraph/nodePath.cxx @@ -3995,6 +3995,16 @@ set_shader_input(const InternalName *id, Texture *tex, int priority) { set_shader_input(new ShaderInput(id,tex,priority)); } +//////////////////////////////////////////////////////////////////// +// Function: NodePath::set_shader_input +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +void NodePath:: +set_shader_input(const InternalName *id, Texture *tex, bool read, bool write, int z, int n, int priority) { + set_shader_input(new ShaderInput(id,tex,read,write,z,n,priority)); +} + //////////////////////////////////////////////////////////////////// // Function: NodePath::set_shader_input // Access: Published @@ -4025,258 +4035,6 @@ set_shader_input(const InternalName *id, PN_stdfloat n1, PN_stdfloat n2, PN_stdf set_shader_input(new ShaderInput(id, LVecBase4(n1, n2, n3, n4), priority)); } -//////////////////////////////////////////////////////////////////// -// Function: NodePath::set_shader_input -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -void NodePath:: -set_shader_input(const string &id, const PTA_float &v, int priority) { - set_shader_input(new ShaderInput(InternalName::make(id),v,priority)); -} - -//////////////////////////////////////////////////////////////////// -// Function: NodePath::set_shader_input -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -void NodePath:: -set_shader_input(const string &id, const PTA_double &v, int priority) { - set_shader_input(new ShaderInput(InternalName::make(id),v,priority)); -} - -//////////////////////////////////////////////////////////////////// -// Function: NodePath::set_shader_input -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -void NodePath:: -set_shader_input(const string &id, const PTA_int &v, int priority) { - set_shader_input(new ShaderInput(InternalName::make(id),v,priority)); -} - -//////////////////////////////////////////////////////////////////// -// Function: NodePath::set_shader_input -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -void NodePath:: -set_shader_input(const string &id, const PTA_LVecBase4 &v, int priority) { - set_shader_input(new ShaderInput(InternalName::make(id),v,priority)); -} - -//////////////////////////////////////////////////////////////////// -// Function: NodePath::set_shader_input -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -void NodePath:: -set_shader_input(const string &id, const PTA_LVecBase3 &v, int priority) { - set_shader_input(new ShaderInput(InternalName::make(id),v,priority)); -} - - -//////////////////////////////////////////////////////////////////// -// Function: NodePath::set_shader_input -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -void NodePath:: -set_shader_input(const string &id, const PTA_LVecBase2 &v, int priority) { - set_shader_input(new ShaderInput(InternalName::make(id),v,priority)); -} - -//////////////////////////////////////////////////////////////////// -// Function: NodePath::set_shader_input -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -void NodePath:: -set_shader_input(const string &id, const LVecBase4 &v, int priority) { - set_shader_input(new ShaderInput(InternalName::make(id),v,priority)); -} - -//////////////////////////////////////////////////////////////////// -// Function: NodePath::set_shader_input -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -void NodePath:: -set_shader_input(const string &id, const LVecBase3 &v, int priority) { - set_shader_input(new ShaderInput(InternalName::make(id),v,priority)); -} - - -//////////////////////////////////////////////////////////////////// -// Function: NodePath::set_shader_input -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -void NodePath:: -set_shader_input(const string &id, const PTA_LVecBase4i &v, int priority) { - set_shader_input(new ShaderInput(InternalName::make(id),v,priority)); -} - -//////////////////////////////////////////////////////////////////// -// Function: NodePath::set_shader_input -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -void NodePath:: -set_shader_input(const string &id, const PTA_LVecBase3i &v, int priority) { - set_shader_input(new ShaderInput(InternalName::make(id),v,priority)); -} - - -//////////////////////////////////////////////////////////////////// -// Function: NodePath::set_shader_input -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -void NodePath:: -set_shader_input(const string &id, const PTA_LVecBase2i &v, int priority) { - set_shader_input(new ShaderInput(InternalName::make(id),v,priority)); -} - -//////////////////////////////////////////////////////////////////// -// Function: NodePath::set_shader_input -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -void NodePath:: -set_shader_input(const string &id, const LVecBase4i &v, int priority) { - set_shader_input(new ShaderInput(InternalName::make(id),v,priority)); -} - -//////////////////////////////////////////////////////////////////// -// Function: NodePath::set_shader_input -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -void NodePath:: -set_shader_input(const string &id, const LVecBase3i &v, int priority) { - set_shader_input(new ShaderInput(InternalName::make(id),v,priority)); -} - -//////////////////////////////////////////////////////////////////// -// Function: NodePath::set_shader_input -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -void NodePath:: -set_shader_input(const string &id, const LVecBase2i &v, int priority) { - set_shader_input(new ShaderInput(InternalName::make(id),v,priority)); -} - -//////////////////////////////////////////////////////////////////// -// Function: NodePath::set_shader_input -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -void NodePath:: -set_shader_input(const string &id, const LVecBase2 &v, int priority) { - set_shader_input(new ShaderInput(InternalName::make(id),v,priority)); -} - -//////////////////////////////////////////////////////////////////// -// Function: NodePath::set_shader_input -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -void NodePath:: -set_shader_input(const string &id, const PTA_LMatrix4 &v, int priority) { - set_shader_input(new ShaderInput(InternalName::make(id),v,priority)); -} - -//////////////////////////////////////////////////////////////////// -// Function: NodePath::set_shader_input -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -void NodePath:: -set_shader_input(const string &id, const PTA_LMatrix3 &v, int priority) { - set_shader_input(new ShaderInput(InternalName::make(id),v,priority)); -} - -//////////////////////////////////////////////////////////////////// -// Function: NodePath::set_shader_input -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -void NodePath:: -set_shader_input(const string &id, const LMatrix4 &v, int priority) { - set_shader_input(new ShaderInput(InternalName::make(id),v,priority)); -} - -//////////////////////////////////////////////////////////////////// -// Function: NodePath::set_shader_input -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -void NodePath:: -set_shader_input(const string &id, const LMatrix3 &v, int priority) { - set_shader_input(new ShaderInput(InternalName::make(id),v,priority)); -} -//////////////////////////////////////////////////////////////////// -// Function: NodePath::set_shader_input -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -void NodePath:: -set_shader_input(const string &id, Texture *tex, int priority) { - set_shader_input(new ShaderInput(InternalName::make(id),tex,priority)); -} - -//////////////////////////////////////////////////////////////////// -// Function: NodePath::set_shader_input -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -void NodePath:: -set_shader_input(const string &id, const NodePath &np, int priority) { - set_shader_input(new ShaderInput(InternalName::make(id),np,priority)); -} - -//////////////////////////////////////////////////////////////////// -// Function: NodePath::set_shader_input -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -void NodePath:: -set_shader_input(const string &id, int n1, int n2, int n3, int n4, int priority) { - set_shader_input(new ShaderInput(InternalName::make(id), LVecBase4i(n1, n2, n3, n4), priority)); -} - -//////////////////////////////////////////////////////////////////// -// Function: NodePath::set_shader_input -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -void NodePath:: -set_shader_input(const string &id, PN_stdfloat n1, PN_stdfloat n2, PN_stdfloat n3, PN_stdfloat n4, int priority) { - set_shader_input(new ShaderInput(InternalName::make(id), LVecBase4(n1, n2, n3, n4), priority)); -} - -//////////////////////////////////////////////////////////////////// -// Function: NodePath::get_shader_input -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -const ShaderInput *NodePath:: -get_shader_input(const string &id) const { - return get_shader_input(InternalName::make(id)); -} - -//////////////////////////////////////////////////////////////////// -// Function: NodePath::clear_shader_input -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -void NodePath:: -clear_shader_input(const string &id) { - clear_shader_input(InternalName::make(id)); -} - //////////////////////////////////////////////////////////////////// // Function: NodePath::set_instance_count // Access: Published diff --git a/panda/src/pgraph/nodePath.h b/panda/src/pgraph/nodePath.h index 5b2b2f3cd5..a89c99d0f1 100644 --- a/panda/src/pgraph/nodePath.h +++ b/panda/src/pgraph/nodePath.h @@ -615,6 +615,7 @@ PUBLISHED: void set_shader_input(const ShaderInput *inp); void set_shader_input(const InternalName *id, Texture *tex, int priority=0); + void set_shader_input(const InternalName *id, Texture *tex, bool read, bool write, int z=-1, int n=0, int priority=0); void set_shader_input(const InternalName *id, const NodePath &np, int priority=0); void set_shader_input(const InternalName *id, const PTA_float &v, int priority=0); void set_shader_input(const InternalName *id, const PTA_double &v, int priority=0); @@ -640,41 +641,13 @@ PUBLISHED: void set_shader_input(const InternalName *id, PN_stdfloat n1, PN_stdfloat n2=0, PN_stdfloat n3=0, PN_stdfloat n4=0, int priority=0); - void set_shader_input(const string &id, Texture *tex, int priority=0); - void set_shader_input(const string &id, const NodePath &np, int priority=0); - void set_shader_input(const string &id, const PTA_float &v, int priority=0); - void set_shader_input(const string &id, const PTA_double &v, int priority=0); - void set_shader_input(const string &id, const PTA_int &v, int priority=0); - void set_shader_input(const string &id, const PTA_LVecBase4 &v, int priority=0); - void set_shader_input(const string &id, const PTA_LVecBase3 &v, int priority=0); - void set_shader_input(const string &id, const PTA_LVecBase2 &v, int priority=0); - void set_shader_input(const string &id, const PTA_LMatrix4 &v, int priority=0); - void set_shader_input(const string &id, const PTA_LMatrix3 &v, int priority=0); - void set_shader_input(const string &id, const LVecBase4 &v, int priority=0); - void set_shader_input(const string &id, const LVecBase3 &v, int priority=0); - void set_shader_input(const string &id, const LVecBase2 &v, int priority=0); - void set_shader_input(const string &id, const LMatrix4 &v, int priority=0); - void set_shader_input(const string &id, const LMatrix3 &v, int priority=0); - void set_shader_input(const string &id, const PTA_LVecBase4i &v, int priority=0); - void set_shader_input(const string &id, const PTA_LVecBase3i &v, int priority=0); - void set_shader_input(const string &id, const PTA_LVecBase2i &v, int priority=0); - void set_shader_input(const string &id, const LVecBase4i &v, int priority=0); - void set_shader_input(const string &id, const LVecBase3i &v, int priority=0); - void set_shader_input(const string &id, const LVecBase2i &v, int priority=0); - void set_shader_input(const string &id, int n1, int n2=0, int n3=0, - int n4=0, int priority=0); - void set_shader_input(const string &id, PN_stdfloat n1, PN_stdfloat n2=0, - PN_stdfloat n3=0, PN_stdfloat n4=0, int priority=0); - void clear_shader_input(const InternalName *id); - void clear_shader_input(const string &id); void set_instance_count(int instance_count); const Shader *get_shader() const; const ShaderInput *get_shader_input(const InternalName *id) const; - const ShaderInput *get_shader_input(const string &id) const; const int get_instance_count() const; - + void set_tex_transform(TextureStage *stage, const TransformState *transform); void clear_tex_transform(); void clear_tex_transform(TextureStage *stage); diff --git a/panda/src/pgraph/shaderInput.I b/panda/src/pgraph/shaderInput.I index 21dd429695..8268d8a78c 100644 --- a/panda/src/pgraph/shaderInput.I +++ b/panda/src/pgraph/shaderInput.I @@ -31,7 +31,10 @@ INLINE ShaderInput:: ShaderInput(const InternalName *name, int priority) : _name(name), _type(M_invalid), - _priority(priority) + _priority(priority), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -45,10 +48,42 @@ ShaderInput(const InternalName *name, Texture *tex, int priority) : _name(name), _type(M_texture), _priority(priority), - _stored_texture(tex) + _stored_texture(tex), + _bind_layer(0), + _bind_level(0), + _access(A_read | A_write | A_layered) { } +//////////////////////////////////////////////////////////////////// +// Function: ShaderInput::Constructor +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +INLINE ShaderInput:: +ShaderInput(const InternalName *name, Texture *tex, bool read, bool write, int z, int n, int priority) : + _name(name), + _type(M_texture), + _priority(priority), + _stored_texture(tex), + _bind_layer(z), + _bind_level(n), + _access(0) +{ + if (read) { + _access |= A_read; + } + if (write) { + _access |= A_write; + } + if (z >= 0) { + _bind_layer = z; + } else { + _bind_layer = 0; + _access |= A_layered; + } +} + //////////////////////////////////////////////////////////////////// // Function: ShaderInput::Constructor // Access: Published @@ -59,7 +94,10 @@ ShaderInput(const InternalName *name, const NodePath &np, int priority) : _name(name), _type(M_nodepath), _priority(priority), - _stored_nodepath(np) + _stored_nodepath(np), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -73,7 +111,10 @@ ShaderInput(const InternalName *name, const PTA_float &ptr, int priority) : _name(name), _type(M_numeric), _priority(priority), - _stored_ptr(ptr) + _stored_ptr(ptr), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -87,7 +128,10 @@ ShaderInput(const InternalName *name, const PTA_LVecBase4f &ptr, int priority) : _name(name), _type(M_numeric), _priority(priority), - _stored_ptr(ptr) + _stored_ptr(ptr), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -101,7 +145,10 @@ ShaderInput(const InternalName *name, const PTA_LVecBase3f &ptr, int priority) : _name(name), _type(M_numeric), _priority(priority), - _stored_ptr(ptr) + _stored_ptr(ptr), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -115,7 +162,10 @@ ShaderInput(const InternalName *name, const PTA_LVecBase2f &ptr, int priority) : _name(name), _type(M_numeric), _priority(priority), - _stored_ptr(ptr) + _stored_ptr(ptr), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -130,7 +180,10 @@ ShaderInput(const InternalName *name, const LVecBase4f &vec, int priority) : _type(M_numeric), _priority(priority), _stored_ptr(vec), - _stored_vector(LCAST(PN_stdfloat, vec)) + _stored_vector(LCAST(PN_stdfloat, vec)), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -145,7 +198,10 @@ ShaderInput(const InternalName *name, const LVecBase3f &vec, int priority) : _type(M_numeric), _priority(priority), _stored_ptr(vec), - _stored_vector(vec.get_x(), vec.get_y(), vec.get_z(), 0.0) + _stored_vector(vec.get_x(), vec.get_y(), vec.get_z(), 0.0), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -160,7 +216,10 @@ ShaderInput(const InternalName *name, const LVecBase2f &vec, int priority) : _type(M_numeric), _priority(priority), _stored_ptr(vec), - _stored_vector(vec.get_x(), vec.get_y(), 0.0, 0.0) + _stored_vector(vec.get_x(), vec.get_y(), 0.0, 0.0), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -174,7 +233,10 @@ ShaderInput(const InternalName *name, const PTA_LMatrix4f &ptr, int priority) : _name(name), _type(M_numeric), _priority(priority), - _stored_ptr(ptr) + _stored_ptr(ptr), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -188,7 +250,10 @@ ShaderInput(const InternalName *name, const PTA_LMatrix3f &ptr, int priority) : _name(name), _type(M_numeric), _priority(priority), - _stored_ptr(ptr) + _stored_ptr(ptr), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -202,7 +267,10 @@ ShaderInput(const InternalName *name, const LMatrix4f &mat, int priority) : _name(name), _type(M_numeric), _priority(priority), - _stored_ptr(mat) + _stored_ptr(mat), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -216,7 +284,10 @@ ShaderInput(const InternalName *name, const LMatrix3f &mat, int priority) : _name(name), _type(M_numeric), _priority(priority), - _stored_ptr(mat) + _stored_ptr(mat), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -230,7 +301,10 @@ ShaderInput(const InternalName *name, const PTA_double &ptr, int priority) : _name(name), _type(M_numeric), _priority(priority), - _stored_ptr(ptr) + _stored_ptr(ptr), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -244,7 +318,10 @@ ShaderInput(const InternalName *name, const PTA_LVecBase4d &ptr, int priority) : _name(name), _type(M_numeric), _priority(priority), - _stored_ptr(ptr) + _stored_ptr(ptr), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -258,7 +335,10 @@ ShaderInput(const InternalName *name, const PTA_LVecBase3d &ptr, int priority) : _name(name), _type(M_numeric), _priority(priority), - _stored_ptr(ptr) + _stored_ptr(ptr), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -272,7 +352,10 @@ ShaderInput(const InternalName *name, const PTA_LVecBase2d &ptr, int priority) : _name(name), _type(M_numeric), _priority(priority), - _stored_ptr(ptr) + _stored_ptr(ptr), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -287,7 +370,10 @@ ShaderInput(const InternalName *name, const LVecBase4d &vec, int priority) : _type(M_numeric), _priority(priority), _stored_ptr(vec), - _stored_vector(LCAST(PN_stdfloat, vec)) + _stored_vector(LCAST(PN_stdfloat, vec)), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -302,7 +388,10 @@ ShaderInput(const InternalName *name, const LVecBase3d &vec, int priority) : _type(M_numeric), _priority(priority), _stored_ptr(vec), - _stored_vector(vec.get_x(), vec.get_y(), vec.get_z(), 0.0) + _stored_vector(vec.get_x(), vec.get_y(), vec.get_z(), 0.0), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -317,7 +406,10 @@ ShaderInput(const InternalName *name, const LVecBase2d &vec, int priority) : _type(M_numeric), _priority(priority), _stored_ptr(vec), - _stored_vector(vec.get_x(), vec.get_y(), 0.0, 0.0) + _stored_vector(vec.get_x(), vec.get_y(), 0.0, 0.0), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -331,7 +423,10 @@ ShaderInput(const InternalName *name, const PTA_LMatrix4d &ptr, int priority) : _name(name), _type(M_numeric), _priority(priority), - _stored_ptr(ptr) + _stored_ptr(ptr), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -345,7 +440,10 @@ ShaderInput(const InternalName *name, const PTA_LMatrix3d &ptr, int priority) : _name(name), _type(M_numeric), _priority(priority), - _stored_ptr(ptr) + _stored_ptr(ptr), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -359,7 +457,10 @@ ShaderInput(const InternalName *name, const LMatrix4d &mat, int priority) : _name(name), _type(M_numeric), _priority(priority), - _stored_ptr(mat) + _stored_ptr(mat), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -373,7 +474,10 @@ ShaderInput(const InternalName *name, const LMatrix3d &mat, int priority) : _name(name), _type(M_numeric), _priority(priority), - _stored_ptr(mat) + _stored_ptr(mat), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -387,7 +491,10 @@ ShaderInput(const InternalName *name, const PTA_int &ptr, int priority) : _name(name), _type(M_numeric), _priority(priority), - _stored_ptr(ptr) + _stored_ptr(ptr), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -401,7 +508,10 @@ ShaderInput(const InternalName *name, const PTA_LVecBase4i &ptr, int priority) : _name(name), _type(M_numeric), _priority(priority), - _stored_ptr(ptr) + _stored_ptr(ptr), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -415,7 +525,10 @@ ShaderInput(const InternalName *name, const PTA_LVecBase3i &ptr, int priority) : _name(name), _type(M_numeric), _priority(priority), - _stored_ptr(ptr) + _stored_ptr(ptr), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -429,7 +542,10 @@ ShaderInput(const InternalName *name, const PTA_LVecBase2i &ptr, int priority) : _name(name), _type(M_numeric), _priority(priority), - _stored_ptr(ptr) + _stored_ptr(ptr), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -444,7 +560,10 @@ ShaderInput(const InternalName *name, const LVecBase4i &vec, int priority) : _type(M_numeric), _priority(priority), _stored_ptr(vec), - _stored_vector((int)vec.get_x(), (int)vec.get_y(), (int)vec.get_z(), (int)vec.get_w()) + _stored_vector((int)vec.get_x(), (int)vec.get_y(), (int)vec.get_z(), (int)vec.get_w()), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -459,7 +578,10 @@ ShaderInput(const InternalName *name, const LVecBase3i &vec, int priority) : _type(M_numeric), _priority(priority), _stored_ptr(vec), - _stored_vector((int)vec.get_x(), (int)vec.get_y(), (int)vec.get_z(), 0.0) + _stored_vector((int)vec.get_x(), (int)vec.get_y(), (int)vec.get_z(), 0.0), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } @@ -474,7 +596,10 @@ ShaderInput(const InternalName *name, const LVecBase2i &vec, int priority) : _type(M_numeric), _priority(priority), _stored_ptr(vec), - _stored_vector((int)vec.get_x(), (int)vec.get_y(), 0.0, 0.0) + _stored_vector((int)vec.get_x(), (int)vec.get_y(), 0.0, 0.0), + _bind_layer(0), + _bind_level(0), + _access(A_read) { } diff --git a/panda/src/pgraph/shaderInput.h b/panda/src/pgraph/shaderInput.h index 5a7e5135fb..4e1433e239 100644 --- a/panda/src/pgraph/shaderInput.h +++ b/panda/src/pgraph/shaderInput.h @@ -43,10 +43,18 @@ public: INLINE ~ShaderInput(); PUBLISHED: + // Used when binding texture images. + enum AccessFlags { + A_read = 0x01, + A_write = 0x02, + A_layered = 0x04, + }; + static const ShaderInput *get_blank(); INLINE ShaderInput(const InternalName *id, int priority=0); INLINE ShaderInput(const InternalName *id, const NodePath &np, int priority=0); INLINE ShaderInput(const InternalName *id, Texture *tex, int priority=0); + INLINE ShaderInput(const InternalName *id, Texture *tex, bool read, bool write, int z=-1, int n=0, int priority=0); INLINE ShaderInput(const InternalName *id, const PTA_float &ptr, int priority=0); INLINE ShaderInput(const InternalName *id, const PTA_LVecBase4f &ptr, int priority=0); INLINE ShaderInput(const InternalName *id, const PTA_LVecBase3f &ptr, int priority=0); @@ -85,9 +93,9 @@ PUBLISHED: M_nodepath, M_numeric }; - + INLINE const InternalName *get_name() const; - + INLINE int get_value_type() const; INLINE int get_priority() const; INLINE Texture *get_texture() const; @@ -107,6 +115,11 @@ private: NodePath _stored_nodepath; LVecBase4 _stored_vector; +public: + int _bind_layer; + int _bind_level; + int _access; + public: static TypeHandle get_class_type() { return _type_handle; From 515f93a0b8db61be0b8dae9d91c3142f76c50988 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 20 Aug 2014 19:32:11 +0000 Subject: [PATCH 10/52] Better handling of nan/infinity. Previously, these weren't working on Windows in config strings. --- dtool/src/dtoolbase/cmath.I | 104 +++++++++++++++-------- dtool/src/dtoolbase/cmath.h | 8 +- dtool/src/dtoolbase/pstrtod.cxx | 144 ++++++++++++++++++++------------ 3 files changed, 163 insertions(+), 93 deletions(-) diff --git a/dtool/src/dtoolbase/cmath.I b/dtool/src/dtoolbase/cmath.I index 8b975bf924..b731b19b77 100644 --- a/dtool/src/dtoolbase/cmath.I +++ b/dtool/src/dtoolbase/cmath.I @@ -16,11 +16,11 @@ // see float.h #define FPU_CONTROLWORD_WRITEMASK 0xFFFFF // if you look at defn of _CW_DEFAULT, all settings fall within 0xFFFFF #define FPU_CONTROLWORD_NEW_SETTING _CW_DEFAULT -#endif +#endif //////////////////////////////////////////////////////////////////// // Function: csqrt -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE float csqrt(float v) { @@ -29,7 +29,7 @@ csqrt(float v) { //////////////////////////////////////////////////////////////////// // Function: csin -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE float csin(float v) { @@ -38,7 +38,7 @@ csin(float v) { //////////////////////////////////////////////////////////////////// // Function: ccos -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE float ccos(float v) { @@ -47,7 +47,7 @@ ccos(float v) { //////////////////////////////////////////////////////////////////// // Function: ctan -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE float ctan(float v) { return tanf(v); @@ -55,7 +55,7 @@ INLINE float ctan(float v) { //////////////////////////////////////////////////////////////////// // Function: csincos -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE void csincos(float v, float *sin_result, float *cos_result) { @@ -80,7 +80,7 @@ csincos(float v, float *sin_result, float *cos_result) { // Function: csin_over_x // Description: Computes sin(x) / x, well-behaved as x approaches 0. //////////////////////////////////////////////////////////////////// -INLINE float +INLINE float csin_over_x(float v) { if (1.0f + v * v == 1.0f) { return 1.0f; @@ -91,7 +91,7 @@ csin_over_x(float v) { //////////////////////////////////////////////////////////////////// // Function: cabs -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE float cabs(float v) { @@ -100,7 +100,7 @@ cabs(float v) { //////////////////////////////////////////////////////////////////// // Function: catan -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE float catan(float v) { @@ -109,7 +109,7 @@ catan(float v) { //////////////////////////////////////////////////////////////////// // Function: catan2 -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE float catan2(float y, float x) { @@ -118,7 +118,7 @@ catan2(float y, float x) { //////////////////////////////////////////////////////////////////// // Function: casin -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE float casin(float v) { @@ -127,7 +127,7 @@ casin(float v) { //////////////////////////////////////////////////////////////////// // Function: cacos -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE float cacos(float v) { @@ -147,7 +147,7 @@ cmod(float x, float y) { //////////////////////////////////////////////////////////////////// // Function: cpow -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE float cpow(float x, float y) { @@ -157,7 +157,7 @@ cpow(float x, float y) { //////////////////////////////////////////////////////////////////// // Function: cfloor -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE double cfloor(double f) { @@ -169,13 +169,13 @@ cfloor(double f) { _controlfp(saved_fpu_control_word,FPU_CONTROLWORD_WRITEMASK); return retval; #else - return floor(f); + return floor(f); #endif } //////////////////////////////////////////////////////////////////// // Function: cceil -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE double cceil(double f) { @@ -187,7 +187,7 @@ cceil(double f) { _controlfp(saved_fpu_control_word,FPU_CONTROLWORD_WRITEMASK); return retval; #else - return ceil(f); + return ceil(f); #endif } @@ -202,7 +202,7 @@ cfrac(double f) { //////////////////////////////////////////////////////////////////// // Function: csqrt -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE double csqrt(double v) { @@ -211,7 +211,7 @@ csqrt(double v) { //////////////////////////////////////////////////////////////////// // Function: csin -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE double csin(double v) { @@ -220,7 +220,7 @@ csin(double v) { //////////////////////////////////////////////////////////////////// // Function: ccos -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE double ccos(double v) { @@ -229,7 +229,7 @@ ccos(double v) { //////////////////////////////////////////////////////////////////// // Function: ctan -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE double ctan(double v) { @@ -238,7 +238,7 @@ ctan(double v) { //////////////////////////////////////////////////////////////////// // Function: csincos -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE void csincos(double v, double *sin_result, double *cos_result) { @@ -262,7 +262,7 @@ csincos(double v, double *sin_result, double *cos_result) { // Function: csin_over_x // Description: Computes sin(x) / x, well-behaved as x approaches 0. //////////////////////////////////////////////////////////////////// -INLINE double +INLINE double csin_over_x(double v) { if (1.0 + v * v == 1.0) { return 1.0; @@ -273,7 +273,7 @@ csin_over_x(double v) { //////////////////////////////////////////////////////////////////// // Function: cabs -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE double cabs(double v) { @@ -282,7 +282,7 @@ cabs(double v) { //////////////////////////////////////////////////////////////////// // Function: catan -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE double catan(double v) { @@ -291,7 +291,7 @@ catan(double v) { //////////////////////////////////////////////////////////////////// // Function: catan2 -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE double catan2(double y, double x) { @@ -300,7 +300,7 @@ catan2(double y, double x) { //////////////////////////////////////////////////////////////////// // Function: casin -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE double casin(double v) { @@ -309,7 +309,7 @@ casin(double v) { //////////////////////////////////////////////////////////////////// // Function: cacos -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE double cacos(double v) { @@ -329,7 +329,7 @@ cmod(double x, double y) { //////////////////////////////////////////////////////////////////// // Function: cpow -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE double cpow(double x, double y) { @@ -338,7 +338,7 @@ cpow(double x, double y) { //////////////////////////////////////////////////////////////////// // Function: cpow -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE int cpow(int x, int y) { @@ -360,43 +360,73 @@ cpow(int x, int y) { //////////////////////////////////////////////////////////////////// // Function: cnan -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE bool cnan(double v) { #ifndef _WIN32 - return (std::isnan(v) != 0); + return std::isnan(v); #else return (_isnan(v) != 0); #endif } +//////////////////////////////////////////////////////////////////// +// Function: cinf +// Description: +//////////////////////////////////////////////////////////////////// +INLINE bool +cinf(double v) { +#ifndef _WIN32 + return std::isinf(v); +#else + return (_isnan(v) == 0 && _finite(v) == 0); +#endif +} + //////////////////////////////////////////////////////////////////// // Function: make_nan -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE float make_nan(float) { #ifndef _WIN32 return nanf(""); #else - return numeric_limits::quiet_NaN(); + return std::numeric_limits::quiet_NaN(); #endif } //////////////////////////////////////////////////////////////////// // Function: make_nan -// Description: +// Description: //////////////////////////////////////////////////////////////////// -INLINE double +INLINE double make_nan(double) { #ifndef _WIN32 return nan(""); #else - return numeric_limits::quiet_NaN(); + return std::numeric_limits::quiet_NaN(); #endif } +//////////////////////////////////////////////////////////////////// +// Function: make_inf +// Description: +//////////////////////////////////////////////////////////////////// +INLINE float +make_inf(float) { + return std::numeric_limits::infinity(); +} + +//////////////////////////////////////////////////////////////////// +// Function: make_inf +// Description: +//////////////////////////////////////////////////////////////////// +INLINE double +make_inf(double) { + return std::numeric_limits::infinity(); +} //////////////////////////////////////////////////////////////////// // Function: cmod diff --git a/dtool/src/dtoolbase/cmath.h b/dtool/src/dtoolbase/cmath.h index d4494f81ca..3a815b01a8 100644 --- a/dtool/src/dtoolbase/cmath.h +++ b/dtool/src/dtoolbase/cmath.h @@ -68,13 +68,17 @@ INLINE int cpow(int x, int y); // or infinity. INLINE bool cnan(double v); -// Returns NaN. +// Returns true if the number is infinity. +INLINE bool cinf(double v); + +// Return NaN and infinity, respectively. INLINE float make_nan(float); INLINE double make_nan(double); +INLINE float make_inf(float); +INLINE double make_inf(double); INLINE int cmod(int x, int y); #include "cmath.I" #endif - diff --git a/dtool/src/dtoolbase/pstrtod.cxx b/dtool/src/dtoolbase/pstrtod.cxx index 74e1d750df..2c68ade752 100644 --- a/dtool/src/dtoolbase/pstrtod.cxx +++ b/dtool/src/dtoolbase/pstrtod.cxx @@ -17,6 +17,9 @@ #include #include +#ifdef _WIN32 +#define strncasecmp _strnicmp +#endif //////////////////////////////////////////////////////////////////// // Function: pstrtod @@ -45,67 +48,100 @@ pstrtod(const char *nptr, char **endptr) { double value = 0.0; if (isalpha(*p)) { - // For special cases like "inf" and "nan", pass these up to the - // system implementation of strtod. - return strtod(nptr, endptr); - } + // Windows' implementation of strtod doesn't support "inf" or + // "nan", so check for those here. + if (strncasecmp(p, "inf", 3) == 0) { + p += 3; + if (strncasecmp(p, "inity", 5) == 0) { + p += 5; + } + value = std::numeric_limits::infinity(); + + } else if (strncasecmp(p, "nan", 3) == 0) { + p += 3; + + if (*p == 's' || *p == 'S') { + value = std::numeric_limits::signaling_NaN(); + ++p; + } else { + if (*p == 'q' || *p == 'Q') { + ++p; + } + value = std::numeric_limits::quiet_NaN(); + } + + // It is optionally possible to include a character sequence + // between parentheses after "nan", to be passed to the new + // nan() function. Since it isn't supported universally, we + // will only accept a pair of empty parentheses. + if (strncmp(p, "()", 2) == 0) { + p += 2; + } - // Start reading decimal digits to the left of the decimal point. - bool found_digits = false; - while (isdigit(*p)) { - value = (value * 10.0) + (*p - '0'); - found_digits = true; - ++p; - } - - if (*p == '.') { - ++p; - // Read decimal digits to the right of the decimal point. - double multiplicand = 0.1; - while (isdigit(*p)) { - value += (*p - '0') * multiplicand; - ++p; - found_digits = true; - multiplicand *= 0.1; - } - } - - if (!found_digits) { - // Not a valid float. - if (endptr != NULL) { - *endptr = (char *)nptr; - } - return 0.0; - } - - if (tolower(*p) == 'e') { - // There's an exponent. - ++p; - - char esign = '+'; - if (*p == '+' || *p == '-') { - esign = *p; - ++p; - } - - // Start reading decimal digits to the left of the decimal point. - double evalue = 0.0; - while (isdigit(*p)) { - evalue = (evalue * 10.0) + (*p - '0'); - ++p; - } - - if (esign == '-') { - value /= pow(evalue, 10.0); } else { - value *= pow(evalue, 10.0); + // Pass it up to the system implementation of strtod; + // perhaps it knows how to deal with this string. + return strtod(nptr, endptr); } - } + + } else { + // Start reading decimal digits to the left of the decimal point. + bool found_digits = false; + while (isdigit(*p)) { + value = (value * 10.0) + (*p - '0'); + found_digits = true; + ++p; + } + + if (*p == '.') { + ++p; + // Read decimal digits to the right of the decimal point. + double multiplicand = 0.1; + while (isdigit(*p)) { + value += (*p - '0') * multiplicand; + ++p; + found_digits = true; + multiplicand *= 0.1; + } + } + + if (!found_digits) { + // Not a valid float. + if (endptr != NULL) { + *endptr = (char *)nptr; + } + return 0.0; + } + + if (tolower(*p) == 'e') { + // There's an exponent. + ++p; + + char esign = '+'; + if (*p == '+' || *p == '-') { + esign = *p; + ++p; + } + + // Start reading decimal digits to the left of the decimal point. + double evalue = 0.0; + while (isdigit(*p)) { + evalue = (evalue * 10.0) + (*p - '0'); + ++p; + } + + if (esign == '-') { + value /= pow(evalue, 10.0); + } else { + value *= pow(evalue, 10.0); + } + } + } if (sign == '-') { value = -value; } - + if (endptr != NULL) { *endptr = (char *)p; } From a7f2f502361fcee3f7d390b1a900de79430b7293 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 20 Aug 2014 19:33:55 +0000 Subject: [PATCH 11/52] Move string_utils.* to from putil to dtoolutil --- dtool/src/dtoolutil/Sources.pp | 3 ++ .../src/dtoolutil/p3dtoolutil_composite2.cxx | 1 + .../src/dtoolutil}/string_utils.I | 0 .../src/dtoolutil}/string_utils.cxx | 0 .../src/dtoolutil}/string_utils.h | 42 +++++++++---------- panda/src/putil/Sources.pp | 3 -- panda/src/putil/p3putil_composite2.cxx | 1 - 7 files changed, 25 insertions(+), 25 deletions(-) rename {panda/src/putil => dtool/src/dtoolutil}/string_utils.I (100%) rename {panda/src/putil => dtool/src/dtoolutil}/string_utils.cxx (100%) rename {panda/src/putil => dtool/src/dtoolutil}/string_utils.h (53%) diff --git a/dtool/src/dtoolutil/Sources.pp b/dtool/src/dtoolutil/Sources.pp index b73ee2e067..7c2638caa6 100644 --- a/dtool/src/dtoolutil/Sources.pp +++ b/dtool/src/dtoolutil/Sources.pp @@ -24,6 +24,7 @@ panda_getopt.h panda_getopt_long.h panda_getopt_impl.h \ pfstream.h pfstream.I pfstreamBuf.h \ preprocess_argv.h \ + string_utils.h string_utils.I \ stringDecoder.h stringDecoder.I \ textEncoder.h textEncoder.I \ unicodeLatinMap.h \ @@ -43,6 +44,7 @@ panda_getopt_impl.cxx \ pfstreamBuf.cxx pfstream.cxx \ preprocess_argv.cxx \ + string_utils.cxx \ stringDecoder.cxx \ textEncoder.cxx \ unicodeLatinMap.cxx \ @@ -63,6 +65,7 @@ panda_getopt.h panda_getopt_long.h panda_getopt_impl.h \ pfstream.h pfstream.I pfstreamBuf.h \ preprocess_argv.h \ + string_utils.h string_utils.I \ stringDecoder.h stringDecoder.I \ textEncoder.h textEncoder.I \ unicodeLatinMap.h \ diff --git a/dtool/src/dtoolutil/p3dtoolutil_composite2.cxx b/dtool/src/dtoolutil/p3dtoolutil_composite2.cxx index 7d1198beda..289ce8f1e9 100644 --- a/dtool/src/dtoolutil/p3dtoolutil_composite2.cxx +++ b/dtool/src/dtoolutil/p3dtoolutil_composite2.cxx @@ -4,6 +4,7 @@ #include "pfstream.cxx" #include "pfstreamBuf.cxx" #include "preprocess_argv.cxx" +#include "string_utils.cxx" #include "stringDecoder.cxx" #include "textEncoder.cxx" #include "unicodeLatinMap.cxx" diff --git a/panda/src/putil/string_utils.I b/dtool/src/dtoolutil/string_utils.I similarity index 100% rename from panda/src/putil/string_utils.I rename to dtool/src/dtoolutil/string_utils.I diff --git a/panda/src/putil/string_utils.cxx b/dtool/src/dtoolutil/string_utils.cxx similarity index 100% rename from panda/src/putil/string_utils.cxx rename to dtool/src/dtoolutil/string_utils.cxx diff --git a/panda/src/putil/string_utils.h b/dtool/src/dtoolutil/string_utils.h similarity index 53% rename from panda/src/putil/string_utils.h rename to dtool/src/dtoolutil/string_utils.h index 3e8c04d2f5..8fda82a8b0 100644 --- a/panda/src/putil/string_utils.h +++ b/dtool/src/dtoolutil/string_utils.h @@ -15,51 +15,51 @@ #ifndef STRING_UTILS_H #define STRING_UTILS_H -#include "pandabase.h" +#include "dtoolbase.h" #include #include "vector_string.h" // Case-insensitive string comparison, from Stroustrup's C++ third edition. // Works like strcmp(). -EXPCL_PANDA_PUTIL int cmp_nocase(const string &s, const string &s2); +EXPCL_DTOOL int cmp_nocase(const string &s, const string &s2); // Similar, except it also accepts hyphen and underscore as equivalent. -EXPCL_PANDA_PUTIL int cmp_nocase_uh(const string &s, const string &s2); +EXPCL_DTOOL int cmp_nocase_uh(const string &s, const string &s2); // Returns the string converted to lowercase. -EXPCL_PANDA_PUTIL string downcase(const string &s); +EXPCL_DTOOL string downcase(const string &s); // Returns the string converted to uppercase. -EXPCL_PANDA_PUTIL string upcase(const string &s); +EXPCL_DTOOL string upcase(const string &s); // Separates the string into words according to whitespace. -EXPCL_PANDA_PUTIL int extract_words(const string &str, vector_string &words); -EXPCL_PANDA_PUTIL int extract_words(const wstring &str, pvector &words); +EXPCL_DTOOL int extract_words(const string &str, vector_string &words); +EXPCL_DTOOL int extract_words(const wstring &str, pvector &words); // Separates the string into words according to the indicated delimiters. -EXPCL_PANDA_PUTIL void tokenize(const string &str, vector_string &words, +EXPCL_DTOOL void tokenize(const string &str, vector_string &words, const string &delimiters, bool discard_repeated_delimiters = false); -EXPCL_PANDA_PUTIL void tokenize(const wstring &str, pvector &words, +EXPCL_DTOOL void tokenize(const wstring &str, pvector &words, const wstring &delimiters, bool discard_repeated_delimiters = false); // Trims leading and/or trailing whitespace from the string. -EXPCL_PANDA_PUTIL string trim_left(const string &str); -EXPCL_PANDA_PUTIL wstring trim_left(const wstring &str); -EXPCL_PANDA_PUTIL string trim_right(const string &str); -EXPCL_PANDA_PUTIL wstring trim_right(const wstring &str); -EXPCL_PANDA_PUTIL string trim(const string &str); -EXPCL_PANDA_PUTIL wstring trim(const wstring &str); +EXPCL_DTOOL string trim_left(const string &str); +EXPCL_DTOOL wstring trim_left(const wstring &str); +EXPCL_DTOOL string trim_right(const string &str); +EXPCL_DTOOL wstring trim_right(const wstring &str); +EXPCL_DTOOL string trim(const string &str); +EXPCL_DTOOL wstring trim(const wstring &str); // Functions to parse numeric values out of a string. -EXPCL_PANDA_PUTIL int string_to_int(const string &str, string &tail); -EXPCL_PANDA_PUTIL bool string_to_int(const string &str, int &result); -EXPCL_PANDA_PUTIL double string_to_double(const string &str, string &tail); -EXPCL_PANDA_PUTIL bool string_to_double(const string &str, double &result); -EXPCL_PANDA_PUTIL bool string_to_float(const string &str, float &result); -EXPCL_PANDA_PUTIL bool string_to_stdfloat(const string &str, PN_stdfloat &result); +EXPCL_DTOOL int string_to_int(const string &str, string &tail); +EXPCL_DTOOL bool string_to_int(const string &str, int &result); +EXPCL_DTOOL double string_to_double(const string &str, string &tail); +EXPCL_DTOOL bool string_to_double(const string &str, double &result); +EXPCL_DTOOL bool string_to_float(const string &str, float &result); +EXPCL_DTOOL bool string_to_stdfloat(const string &str, PN_stdfloat &result); // Convenience function to make a string from anything that has an // ostream operator. diff --git a/panda/src/putil/Sources.pp b/panda/src/putil/Sources.pp index a3046d68fe..7e98890b70 100644 --- a/panda/src/putil/Sources.pp +++ b/panda/src/putil/Sources.pp @@ -63,7 +63,6 @@ pythonCallbackObject.h pythonCallbackObject.I \ simpleHashMap.I simpleHashMap.h \ sparseArray.I sparseArray.h \ - string_utils.I string_utils.N string_utils.h \ timedCycle.I timedCycle.h typedWritable.I \ typedWritable.h typedWritable_ext.h typedWritable_ext.cxx \ typedWritableReferenceCount.I \ @@ -113,7 +112,6 @@ pythonCallbackObject.cxx \ simpleHashMap.cxx \ sparseArray.cxx \ - string_utils.cxx \ timedCycle.cxx typedWritable.cxx \ typedWritableReferenceCount.cxx updateSeq.cxx \ uniqueIdAllocator.cxx \ @@ -175,7 +173,6 @@ pythonCallbackObject.h pythonCallbackObject.I \ simpleHashMap.I simpleHashMap.h \ sparseArray.I sparseArray.h \ - string_utils.I string_utils.h \ timedCycle.I timedCycle.h typedWritable.I \ typedWritable.h typedWritable_ext.h typedWritableReferenceCount.I \ typedWritableReferenceCount.h updateSeq.I updateSeq.h \ diff --git a/panda/src/putil/p3putil_composite2.cxx b/panda/src/putil/p3putil_composite2.cxx index 256accfc64..9cae69467c 100644 --- a/panda/src/putil/p3putil_composite2.cxx +++ b/panda/src/putil/p3putil_composite2.cxx @@ -17,7 +17,6 @@ #include "pythonCallbackObject.cxx" #include "simpleHashMap.cxx" #include "sparseArray.cxx" -#include "string_utils.cxx" #include "timedCycle.cxx" #include "typedWritable.cxx" #include "typedWritableReferenceCount.cxx" From 70f73a5ea17b7afd4b6c6ef2a5e9a3bbffa15960 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 20 Aug 2014 19:39:13 +0000 Subject: [PATCH 12/52] linmath no longer depends on putil --- panda/src/linmath/Sources.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/linmath/Sources.pp b/panda/src/linmath/Sources.pp index 0e84fb271e..92c6916504 100644 --- a/panda/src/linmath/Sources.pp +++ b/panda/src/linmath/Sources.pp @@ -4,7 +4,7 @@ #begin lib_target #define TARGET p3linmath #define LOCAL_LIBS \ - p3putil + p3express p3pandabase #define COMBINED_SOURCES $[TARGET]_composite1.cxx $[TARGET]_composite2.cxx From bb7a6a3ec4662a8e3cb3ab12a4a1e8cfb25ebdae Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 20 Aug 2014 20:24:13 +0000 Subject: [PATCH 13/52] Fix broken convergence distance calculation, adding a configuration variable to restore the old behavior if needed. --- panda/src/gobj/config_gobj.cxx | 14 ++++++++-- panda/src/gobj/config_gobj.h | 1 + panda/src/gobj/lens.I | 42 +++++++++++++++++++----------- panda/src/gobj/perspectiveLens.cxx | 13 ++++++--- 4 files changed, 50 insertions(+), 20 deletions(-) diff --git a/panda/src/gobj/config_gobj.cxx b/panda/src/gobj/config_gobj.cxx index c60c75fb95..9357816d67 100644 --- a/panda/src/gobj/config_gobj.cxx +++ b/panda/src/gobj/config_gobj.cxx @@ -510,6 +510,16 @@ ConfigVariableInt lens_geom_segments "lens; for a normal perspective or orthographic lens, the " "wireframe is not subdivided.")); +ConfigVariableBool stereo_lens_old_convergence +("stereo-lens-old-convergence", false, + PRC_DESC("In Panda3D 1.8 and below, when using a stereo lens, Panda " + "generate an incorrect frustum skew for a given convergence " + "distance, meaning that the left-right images wouldn't " + "overlap at the configured distance. This calculation has " + "since been corrected, but if your application relies on the " + "old, incorrect behavior, this may be set to 'true' to switch " + "back to the old calculation.")); + ConfigVariableString cg_glsl_version ("cg-glsl-version", "", PRC_DESC("If this is set, it forces the Cg compiler to generate GLSL " @@ -604,10 +614,10 @@ operator << (ostream &out, ShaderUtilization sgc) { switch (sgc) { case SUT_none: return out << "none"; - + case SUT_basic: return out << "basic"; - + case SUT_advanced: return out << "advanced"; diff --git a/panda/src/gobj/config_gobj.h b/panda/src/gobj/config_gobj.h index c6e34fafa5..eed2ef4010 100644 --- a/panda/src/gobj/config_gobj.h +++ b/panda/src/gobj/config_gobj.h @@ -98,6 +98,7 @@ extern EXPCL_PANDA_GOBJ ConfigVariableDouble adaptive_lru_weight; extern EXPCL_PANDA_GOBJ ConfigVariableInt adaptive_lru_max_updates_per_frame; extern EXPCL_PANDA_GOBJ ConfigVariableDouble async_load_delay; extern EXPCL_PANDA_GOBJ ConfigVariableInt lens_geom_segments; +extern EXPCL_PANDA_GOBJ ConfigVariableBool stereo_lens_old_convergence; extern EXPCL_PANDA_GOBJ ConfigVariableString cg_glsl_version; diff --git a/panda/src/gobj/lens.I b/panda/src/gobj/lens.I index cf1c2e4d09..efb1600bea 100644 --- a/panda/src/gobj/lens.I +++ b/panda/src/gobj/lens.I @@ -608,14 +608,26 @@ get_interocular_distance() const { // PerspectiveLens. // // This parameter must be greater than 0, but may be as -// large as you like. It controls the amount to which -// the two eyes are directed inwards towards each other, -// which is a normal property of stereo vision. It is a -// distance, not an angle; normally this should be set -// to the distance from the camera to the area of -// interest in your scene. If you want to simulate -// parallel stereo, set this value to a very large -// number. +// large as you like. It controls the distance at +// which the two stereo images will appear to converge, +// which is a normal property of stereo vision. Normally +// this should be set to the distance from the camera to +// the area of interest in your scene. Anything beyond +// this distance will appear to go into the screen, and +// anything closer will appear to come out of the screen. +// If you want to simulate parallel stereo, set this +// to infinity. +// +// Note that this creates an off-axis frustum, which +// means that the lenses are still pointing in the +// same direction, which is usually more desirable +// than the more naive toe-in approach, where the +// two lenses are simply tilted toward each other. +// +// Prior to Panda3D 1.9.0, the convergence was being +// calculated incorrectly. It has since been corrected. +// To restore the legacy behavior you can set the +// stereo-lens-old-convergence variable to true. // // Also see set_interocular_distance(), which relates. //////////////////////////////////////////////////////////////////// @@ -807,7 +819,7 @@ do_adjust_comp_flags(CData *cdata, int clear_flags, int set_flags) { //////////////////////////////////////////////////////////////////// // Function: Lens::do_set_film_offset // Access: Protected -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE void Lens:: do_set_film_offset(CData *cdata, const LVecBase2 &film_offset) { @@ -819,7 +831,7 @@ do_set_film_offset(CData *cdata, const LVecBase2 &film_offset) { //////////////////////////////////////////////////////////////////// // Function: Lens::do_get_film_offset // Access: Protected -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE const LVector2 &Lens:: do_get_film_offset(const CData *cdata) const { @@ -829,7 +841,7 @@ do_get_film_offset(const CData *cdata) const { //////////////////////////////////////////////////////////////////// // Function: Lens::do_set_near // Access: Protected -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE void Lens:: do_set_near(CData *cdata, PN_stdfloat near_distance) { @@ -841,7 +853,7 @@ do_set_near(CData *cdata, PN_stdfloat near_distance) { //////////////////////////////////////////////////////////////////// // Function: Lens::do_get_near // Access: Protected -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE PN_stdfloat Lens:: do_get_near(const CData *cdata) const { @@ -851,7 +863,7 @@ do_get_near(const CData *cdata) const { //////////////////////////////////////////////////////////////////// // Function: Lens::do_set_far // Access: Protected -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE void Lens:: do_set_far(CData *cdata, PN_stdfloat far_distance) { @@ -863,7 +875,7 @@ do_set_far(CData *cdata, PN_stdfloat far_distance) { //////////////////////////////////////////////////////////////////// // Function: Lens::do_get_far // Access: Protected -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE PN_stdfloat Lens:: do_get_far(const CData *cdata) const { @@ -873,7 +885,7 @@ do_get_far(const CData *cdata) const { //////////////////////////////////////////////////////////////////// // Function: Lens::do_set_near_far // Access: Protected -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE void Lens:: do_set_near_far(CData *cdata, PN_stdfloat near_distance, PN_stdfloat far_distance) { diff --git a/panda/src/gobj/perspectiveLens.cxx b/panda/src/gobj/perspectiveLens.cxx index 9f32caa26f..b1fdb0ab6e 100644 --- a/panda/src/gobj/perspectiveLens.cxx +++ b/panda/src/gobj/perspectiveLens.cxx @@ -137,10 +137,17 @@ do_compute_projection_mat(Lens::CData *lens_cdata) { LVector3 iod = lens_cdata->_interocular_distance * 0.5f * LVector3::left(lens_cdata->_cs); lens_cdata->_projection_mat_left = do_get_lens_mat_inv(lens_cdata) * LMatrix4::translate_mat(-iod) * canonical * do_get_film_mat(lens_cdata); lens_cdata->_projection_mat_right = do_get_lens_mat_inv(lens_cdata) * LMatrix4::translate_mat(iod) * canonical * do_get_film_mat(lens_cdata); - - if (lens_cdata->_user_flags & UF_convergence_distance) { + + if ((lens_cdata->_user_flags & UF_convergence_distance) != 0 && + !cinf(lens_cdata->_convergence_distance)) { nassertv(lens_cdata->_convergence_distance != 0.0f); - LVector3 cd = (0.25f / lens_cdata->_convergence_distance) * LVector3::left(lens_cdata->_cs); + LVector3 cd; + if (stereo_lens_old_convergence) { // The old, incorrect calculation was requested. + cd = (0.25f / lens_cdata->_convergence_distance) * LVector3::left(lens_cdata->_cs); + } else { + const LVecBase2 &fov = do_get_fov(lens_cdata); + cd = (2.0f / fov_to_film(fov[0], lens_cdata->_convergence_distance, true)) * iod; + } lens_cdata->_projection_mat_left *= LMatrix4::translate_mat(cd); lens_cdata->_projection_mat_right *= LMatrix4::translate_mat(-cd); } From 0eaebaf2588607c2dae6cdc1db4f3b501c2646b1 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 21 Aug 2014 13:00:36 +0000 Subject: [PATCH 14/52] Fix bison/flex location, and fix debug Python on Windows with makepanda --- makepanda/makepandacore.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index 5ee36e6c91..cdd8684017 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -430,6 +430,8 @@ def GetBison(): # We don't strictly need it, so don't give an error return None + return BISON + FLEX = None def GetFlex(): global FLEX @@ -445,6 +447,8 @@ def GetFlex(): # We don't strictly need it, so don't give an error return None + return FLEX + ######################################################################## ## ## LocateBinary @@ -1842,13 +1846,18 @@ def SdkLocatePython(force_use_sys_executable = False): exit("Could not find %s!" % SDK["PYTHONEXEC"]) # Determine which version it is by checking which dll is in the directory. - py_dlls = glob.glob(SDK["PYTHON"] + "/python[0-9][0-9].dll") + if (GetOptimize() <= 2): + py_dlls = glob.glob(SDK["PYTHON"] + "/python[0-9][0-9]_d.dll") + else: + py_dlls = glob.glob(SDK["PYTHON"] + "/python[0-9][0-9].dll") + if len(py_dlls) == 0: exit("Could not find the Python dll in %s." % (SDK["PYTHON"])) elif len(py_dlls) > 1: exit("Found multiple Python dlls in %s." % (SDK["PYTHON"])) - SDK["PYTHONVERSION"] = "python" + py_dlls[0][-6] + "." + py_dlls[0][-5] + py_dll = os.path.basename(py_dlls[0]) + SDK["PYTHONVERSION"] = "python" + py_dll[6] + "." + py_dll[7] elif (GetTarget() == 'windows'): SDK["PYTHON"] = os.path.dirname(sysconfig.get_python_inc()) @@ -2581,7 +2590,7 @@ def CalcLocation(fn, ipath): if (fn.endswith(".res")): return OUTPUTDIR+"/tmp/"+fn if (fn.endswith(".tlb")): return OUTPUTDIR+"/tmp/"+fn if (fn.endswith(".dll")): return OUTPUTDIR+"/bin/"+fn[:-4]+dllext+".dll" - if (fn.endswith(".pyd")): return OUTPUTDIR+"/panda3d/"+fn[:-4]+dllext+".pyd" + if (fn.endswith(".pyd")): return OUTPUTDIR+"/panda3d/"+fn[:-4]+".pyd" if (fn.endswith(".ocx")): return OUTPUTDIR+"/plugins/"+fn[:-4]+dllext+".ocx" if (fn.endswith(".mll")): return OUTPUTDIR+"/plugins/"+fn[:-4]+dllext+".mll" if (fn.endswith(".dlo")): return OUTPUTDIR+"/plugins/"+fn[:-4]+dllext+".dlo" From 4db966f43101b8faf82be67fe1e7a09159638abe Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 21 Aug 2014 16:54:44 +0000 Subject: [PATCH 15/52] GNU needs #include for numeric_limits --- dtool/src/dtoolbase/pstrtod.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/dtool/src/dtoolbase/pstrtod.cxx b/dtool/src/dtoolbase/pstrtod.cxx index 2c68ade752..dbc19b94a0 100644 --- a/dtool/src/dtoolbase/pstrtod.cxx +++ b/dtool/src/dtoolbase/pstrtod.cxx @@ -16,6 +16,7 @@ #include #include +#include #ifdef _WIN32 #define strncasecmp _strnicmp From ab5e4f496bc146777f9ef7181e1df43d669876b0 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 21 Aug 2014 17:00:57 +0000 Subject: [PATCH 16/52] Fix cmath includes on GNU --- dtool/src/dtoolbase/cmath.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/dtool/src/dtoolbase/cmath.h b/dtool/src/dtoolbase/cmath.h index 3a815b01a8..6e5c1ef8e8 100644 --- a/dtool/src/dtoolbase/cmath.h +++ b/dtool/src/dtoolbase/cmath.h @@ -24,13 +24,8 @@ #include "dtoolbase.h" #include - -// Windows defines isnan() in a different place and with a different -// name than everyone else. Sheesh. -#ifdef _WIN32 -#include +#include #include -#endif INLINE float csqrt(float v); INLINE float csin(float v); From bee278e8d1f7f872e0e2dd0c4890a300171d5aa0 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 21 Aug 2014 18:03:32 +0000 Subject: [PATCH 17/52] Fix missing return statement --- pandatool/src/ptloader/loaderFileTypePandatool.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandatool/src/ptloader/loaderFileTypePandatool.cxx b/pandatool/src/ptloader/loaderFileTypePandatool.cxx index 6d6bd5e227..7dda5f1052 100644 --- a/pandatool/src/ptloader/loaderFileTypePandatool.cxx +++ b/pandatool/src/ptloader/loaderFileTypePandatool.cxx @@ -244,6 +244,6 @@ save_file(const Filename &path, const LoaderOptions &options, saver->set_egg_data(egg_data); bool result = saver->write_file(path); - delete saver; + return result; } From e468b293d162536a13cf6206bb5c9b6909d62b32 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 26 Aug 2014 17:17:37 +0000 Subject: [PATCH 18/52] Fix a longstanding memory leak in certain interrogate exception handlers. Raise MemoryError when constructor returns NULL. Properly check argument count of constructors that take no arguments. --- dtool/src/interrogate/functionRemap.cxx | 13 ++- dtool/src/interrogate/interfaceMaker.cxx | 53 ++++++++- dtool/src/interrogate/interfaceMaker.h | 6 + .../interfaceMakerPythonNative.cxx | 103 ++++++++++++------ dtool/src/pystub/pystub.cxx | 2 + 5 files changed, 137 insertions(+), 40 deletions(-) diff --git a/dtool/src/interrogate/functionRemap.cxx b/dtool/src/interrogate/functionRemap.cxx index eae6299a03..94fcf5b00c 100644 --- a/dtool/src/interrogate/functionRemap.cxx +++ b/dtool/src/interrogate/functionRemap.cxx @@ -102,7 +102,8 @@ get_parameter_name(int n) const { // are returning a value, or the empty string if we // return nothing. //////////////////////////////////////////////////////////////////// -string FunctionRemap::call_function(ostream &out, int indent_level, bool convert_result, +string FunctionRemap:: +call_function(ostream &out, int indent_level, bool convert_result, const string &container, const vector_string &pexprs) const { string return_expr; @@ -117,11 +118,11 @@ string FunctionRemap::call_function(ostream &out, int indent_level, bool convert InterfaceMaker::indent(out, indent_level) << "unref_delete(" << container << ");\n"; } else { - if (inside_python_native) { - InterfaceMaker::indent(out, indent_level) << "Dtool_Py_Delete(self); \n"; - } else { - InterfaceMaker::indent(out, indent_level) << " delete " << container << ";\n"; - } + if (inside_python_native) { + InterfaceMaker::indent(out, indent_level) << "Dtool_Py_Delete(self);\n"; + } else { + InterfaceMaker::indent(out, indent_level) << "delete " << container << ";\n"; + } } } else if (_type == T_typecast_method) { diff --git a/dtool/src/interrogate/interfaceMaker.cxx b/dtool/src/interrogate/interfaceMaker.cxx index b980f6b8b0..e392d25895 100644 --- a/dtool/src/interrogate/interfaceMaker.cxx +++ b/dtool/src/interrogate/interfaceMaker.cxx @@ -837,6 +837,27 @@ manage_return_value(ostream &out, int indent_level, return return_expr; } +//////////////////////////////////////////////////////////////////// +// Function: InterfaceMaker::delete_return_value +// Access: Protected +// Description: Cleans up the given return value by deleting it or +// decrementing its reference count or whatever is +// appropriate. +//////////////////////////////////////////////////////////////////// +void InterfaceMaker:: +delete_return_value(ostream &out, int indent_level, + FunctionRemap *remap, const string &return_expr) const { + if (remap->_manage_reference_count) { + // If we're managing reference counts, and we're about to return a + // reference countable object, then decrement its count. + output_unref(out, indent_level, remap, return_expr); + + } else if (remap->_return_value_needs_management) { + // We should just delete it directly. + indent(out, indent_level) << "delete " << return_expr << ";\n"; + } +} + //////////////////////////////////////////////////////////////////// // Function: InterfaceMaker::output_ref // Access: Protected @@ -859,7 +880,7 @@ output_ref(ostream &out, int indent_level, FunctionRemap *remap, indent(out, indent_level) << "if (" << varname << " != (" - << remap->_return_type->get_new_type()->get_local_name(&parser) << ")0) {\n"; + << remap->_return_type->get_new_type()->get_local_name(&parser) << ")NULL) {\n"; indent(out, indent_level + 2) << varname << "->ref();\n"; indent(out, indent_level) @@ -867,6 +888,36 @@ output_ref(ostream &out, int indent_level, FunctionRemap *remap, } } +//////////////////////////////////////////////////////////////////// +// Function: InterfaceMaker::output_unref +// Access: Protected +// Description: Outputs the code to decrement the reference count for +// the indicated variable name. +//////////////////////////////////////////////////////////////////// +void InterfaceMaker:: +output_unref(ostream &out, int indent_level, FunctionRemap *remap, + const string &varname) const { + if (remap->_type == FunctionRemap::T_constructor || + remap->_type == FunctionRemap::T_typecast) { + // In either of these cases, we can safely assume the pointer will + // never be NULL. + indent(out, indent_level) + << "unref_delete(" << varname << ");\n"; + + } else { + // However, in the general case, we have to check for that before + // we attempt to ref it. + + indent(out, indent_level) + << "if (" << varname << " != (" + << remap->_return_type->get_new_type()->get_local_name(&parser) << ")NULL) {\n"; + indent(out, indent_level + 2) + << "unref_delete(" << varname << ");\n"; + indent(out, indent_level) + << "}\n"; + } +} + //////////////////////////////////////////////////////////////////// // Function: InterfaceMaker::hash_function_signature // Access: Protected diff --git a/dtool/src/interrogate/interfaceMaker.h b/dtool/src/interrogate/interfaceMaker.h index 2b5fbc4e83..189460d94b 100644 --- a/dtool/src/interrogate/interfaceMaker.h +++ b/dtool/src/interrogate/interfaceMaker.h @@ -177,8 +177,14 @@ public: manage_return_value(ostream &out, int indent_level, FunctionRemap *remap, const string &return_expr) const; + void + delete_return_value(ostream &out, int indent_level, + FunctionRemap *remap, const string &return_expr) const; + void output_ref(ostream &out, int indent_level, FunctionRemap *remap, const string &varname) const; + void output_unref(ostream &out, int indent_level, FunctionRemap *remap, + const string &varname) const; void write_spam_message(ostream &out, FunctionRemap *remap) const; protected: diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index 0b66924342..ad9583629c 100755 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -1514,7 +1514,7 @@ write_module_class(ostream &out, Object *obj) { // *need* to raise IndexError if we're out of bounds. We have to // assume the bounds are 0 .. this->size() (this is the same // assumption that Python makes). - out << " if (index < 0 || index >= local_this->size()) {\n"; + out << " if (index < 0 || index >= (Py_ssize_t) local_this->size()) {\n"; out << " PyErr_SetString(PyExc_IndexError, \"" << ClassName << " index out of range\");\n"; out << " return NULL;\n"; out << " }\n"; @@ -1554,7 +1554,7 @@ write_module_class(ostream &out, Object *obj) { out << " return -1;\n"; out << " }\n\n"; - out << " if (index < 0 || index >= local_this->size()) {\n"; + out << " if (index < 0 || index >= (Py_ssize_t) local_this->size()) {\n"; out << " PyErr_SetString(PyExc_IndexError, \"" << ClassName << " index out of range\");\n"; out << " return -1;\n"; out << " }\n"; @@ -2485,12 +2485,9 @@ write_function_for_name(ostream &out1, InterfaceMaker::Object *obj, InterfaceMak switch (args_type) { case AT_keyword_args: indent(out, 2) << "int parameter_count = PyTuple_Size(args);\n"; - - if (args_type == AT_keyword_args) { - indent(out, 2) << "if (kwds != NULL && PyDict_Check(kwds)) {\n"; - indent(out, 2) << " parameter_count += PyDict_Size(kwds);\n"; - indent(out, 2) << "}\n"; - } + indent(out, 2) << "if (kwds != NULL) {\n"; + indent(out, 2) << " parameter_count += PyDict_Size(kwds);\n"; + indent(out, 2) << "}\n"; break; case AT_varargs: @@ -2498,7 +2495,7 @@ write_function_for_name(ostream &out1, InterfaceMaker::Object *obj, InterfaceMak break; case AT_single_arg: - // It shouldÅ„'t get here, but we'll handle these cases nonetheless. + // It shouldn't get here, but we'll handle these cases nonetheless. indent(out, 2) << "const int parameter_count = 1;\n"; break; @@ -2575,11 +2572,47 @@ write_function_for_name(ostream &out1, InterfaceMaker::Object *obj, InterfaceMak } else { string expected_params = ""; - for (mii = MapSets.begin(); mii != MapSets.end(); mii++) { - write_function_forset(out, obj, func, mii->second, expected_params, 2, is_inplace, - coercion_allowed, coercion_attempted, args_type, return_int); + mii = MapSets.begin(); + + // If no parameters are accepted, we do need to check that the argument + // count is indeed 0, since we won't check that in write_function_instance. + if (mii->first == 0 && args_type != AT_no_args) { + switch (args_type) { + case AT_keyword_args: + out << " if (PyTuple_Size(args) > 0 || (kwds != NULL && PyDict_Size(kwds) > 0)) {\n"; + out << " int parameter_count = PyTuple_Size(args);\n"; + out << " if (kwds != NULL) {\n"; + out << " parameter_count += PyDict_Size(kwds);\n"; + out << " }\n"; + break; + case AT_varargs: + out << " if (PyTuple_Size(args) > 0) {\n"; + out << " const int parameter_count = PyTuple_GET_SIZE(args);\n"; + break; + case AT_single_arg: + default: + // Shouldn't happen, but let's handle this case nonetheless. + out << " {\n"; + out << " const int parameter_count = 1;\n"; + break; + } + + out << " PyErr_Format(PyExc_TypeError,\n" + << " \"" << methodNameFromCppName(func, "", false) + << "() takes no arguments (%d given)\",\n" + << " parameter_count);\n"; + + if (return_int) { + out << " return -1;\n"; + } else { + out << " return (PyObject *) NULL;\n"; + } + out << " }\n"; } + write_function_forset(out, obj, func, mii->second, expected_params, 2, is_inplace, + coercion_allowed, coercion_attempted, args_type, return_int); + out << " if (!PyErr_Occurred()) {\n"; out << " PyErr_SetString(PyExc_TypeError,\n"; out << " \"Arguments must match:\\n\"\n"; @@ -2921,7 +2954,6 @@ write_function_instance(ostream &out, InterfaceMaker::Object *obj, string extra_convert; string extra_param_check; string extra_cleanup; - string direct_assign; bool is_constructor = (remap->_type == FunctionRemap::T_constructor); @@ -2999,12 +3031,11 @@ write_function_instance(ostream &out, InterfaceMaker::Object *obj, parameter_list += ", &" + param_name; extra_convert += " Py_ssize_t " + param_name + "_len = PyUnicode_GetSize((PyObject *)" + param_name + ");" - " wchar_t *" + param_name + "_str = new wchar_t[" + param_name + "_len + 1];" + " wchar_t *" + param_name + "_str = (wchar_t *)alloca(sizeof(wchar_t) * (" + param_name + "_len + 1));" " PyUnicode_AsWideChar(" + param_name + ", " + param_name + "_str, " + param_name + "_len);" " " + param_name + "_str[" + param_name + "_len] = 0;"; pexpr_string = param_name + "_str"; - extra_cleanup += " delete[] " + param_name + "_str;"; expected_params += "unicode"; } else if (TypeManager::is_wstring(orig_type)) { @@ -3017,14 +3048,13 @@ write_function_instance(ostream &out, InterfaceMaker::Object *obj, parameter_list += ", &" + param_name; extra_convert += " Py_ssize_t " + param_name + "_len = PyUnicode_GetSize((PyObject *)" + param_name + ");" - " wchar_t *" + param_name + "_str = new wchar_t[" + param_name + "_len];" + " wchar_t *" + param_name + "_str = (wchar_t *)alloca(sizeof(wchar_t) * " + param_name + "_len);" " PyUnicode_AsWideChar(" + param_name + ", " + param_name + "_str, " + param_name + "_len);"; - pexpr_string = "basic_string((wchar_t *)" + + pexpr_string = "basic_string(" + param_name + "_str, " + param_name + "_len)"; - extra_cleanup += " delete[] " + param_name + "_str;"; expected_params += "unicode"; } else if (TypeManager::is_const_ptr_to_basic_string_wchar(orig_type)) { @@ -3037,14 +3067,13 @@ write_function_instance(ostream &out, InterfaceMaker::Object *obj, parameter_list += ", &" + param_name; extra_convert += " Py_ssize_t " + param_name + "_len = PyUnicode_GetSize((PyObject *)" + param_name + ");" - " wchar_t *" + param_name + "_str = new wchar_t[" + param_name + "_len];" + " wchar_t *" + param_name + "_str = (wchar_t *)alloca(sizeof(wchar_t) * " + param_name + "_len);" " PyUnicode_AsWideChar(" + param_name + ", " + param_name + "_str, " + param_name + "_len);"; - pexpr_string = "&basic_string((wchar_t *)" + + pexpr_string = "&basic_string(" + param_name + "_str, " + param_name + "_len)"; - extra_cleanup += " delete[] " + param_name + "_str;"; expected_params += "unicode"; } else { @@ -3056,7 +3085,7 @@ write_function_instance(ostream &out, InterfaceMaker::Object *obj, << param_name << "_str = PyUnicode_AsUTF8AndSize(arg, &" << param_name << "_len);\n"; out << "#else\n"; - indent(out, indent_level) << "if (PyString_AsStringAndSize(arg, &" + indent(out, indent_level) << "if (PyString_AsStringAndSize(arg, &" << param_name << "_str, &" << param_name << "_len) == -1) {\n"; indent(out, indent_level + 2) << param_name << "_str = NULL;\n"; indent(out, indent_level) << "}\n"; @@ -3395,6 +3424,7 @@ write_function_instance(ostream &out, InterfaceMaker::Object *obj, } string return_expr; + if (!remap->_void_return && remap->_return_type->new_type_is_atomic_string()) { // Treat strings as a special case. We don't want to format the @@ -3474,6 +3504,7 @@ write_function_instance(ostream &out, InterfaceMaker::Object *obj, type->output_instance(out, "return_value", &parser); out << " = " << return_expr << ";\n"; } + if (track_interpreter) { indent(out, indent_level) << "in_interpreter = 1;\n"; } @@ -3486,14 +3517,25 @@ write_function_instance(ostream &out, InterfaceMaker::Object *obj, if (!extra_cleanup.empty()) { indent(out, indent_level) << extra_cleanup << "\n"; } - - if (!is_inplace) { - return_expr = manage_return_value(out, indent_level, remap, "return_value"); - } if (coercion_possible) { indent(out, indent_level) << "Py_XDECREF(coerced);\n"; } + if (!is_inplace) { + if (remap->_return_type->return_value_needs_management()) { + // If a constructor returns NULL, that means allocation failed. + indent(out, indent_level) << "if (return_value == NULL) {\n"; + if (return_int) { + indent(out, indent_level) << " PyErr_NoMemory();\n"; + indent(out, indent_level) << " return -1;\n"; + } else { + indent(out, indent_level) << " return PyErr_NoMemory();\n"; + } + indent(out, indent_level) << "}\n"; + } + + return_expr = manage_return_value(out, indent_level, remap, "return_value"); + } return_expr = remap->_return_type->temporary_to_return(return_expr); } } @@ -3502,10 +3544,7 @@ write_function_instance(ostream &out, InterfaceMaker::Object *obj, if (check_exceptions) { indent(out, indent_level) << "if (PyErr_Occurred()) {\n"; - if (return_int && !return_expr.empty()) { - indent(out, indent_level + 2) - << "delete return_value;\n"; - } + delete_return_value(out, indent_level, remap, return_expr); indent(out, indent_level) << " if (PyErr_ExceptionMatches(PyExc_TypeError)) {\n"; indent(out, indent_level) @@ -3540,10 +3579,8 @@ write_function_instance(ostream &out, InterfaceMaker::Object *obj, << "PyErr_SetString(PyExc_AssertionError, notify->get_assert_error_message().c_str());\n"; indent(out, indent_level + 2) << "notify->clear_assert_failed();\n"; + delete_return_value(out, indent_level + 2, remap, return_expr); if (return_int) { - if (!return_expr.empty()) { - indent(out, indent_level + 2) << "delete return_value;\n"; - } indent(out, indent_level + 2) << "return -1;\n"; } else { indent(out, indent_level + 2) << "return (PyObject *)NULL;\n"; diff --git a/dtool/src/pystub/pystub.cxx b/dtool/src/pystub/pystub.cxx index 214ea01ba0..5fde787a8c 100644 --- a/dtool/src/pystub/pystub.cxx +++ b/dtool/src/pystub/pystub.cxx @@ -40,6 +40,7 @@ extern "C" { EXPCL_PYSTUB int PyErr_ExceptionMatches(...); EXPCL_PYSTUB int PyErr_Fetch(...); EXPCL_PYSTUB int PyErr_Format(...); + EXPCL_PYSTUB int PyErr_NoMemory(...); EXPCL_PYSTUB int PyErr_Occurred(...); EXPCL_PYSTUB int PyErr_Print(...); EXPCL_PYSTUB int PyErr_Restore(...); @@ -214,6 +215,7 @@ int PyErr_Clear(...) { return 0; }; int PyErr_ExceptionMatches(...) { return 0; }; int PyErr_Fetch(...) { return 0; } int PyErr_Format(...) { return 0; }; +int PyErr_NoMemory(...) { return 0; } int PyErr_Occurred(...) { return 0; } int PyErr_Print(...) { return 0; } int PyErr_Restore(...) { return 0; } From a044561be5bec6a51fe449f6533d6616cb626125 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 26 Aug 2014 21:01:12 +0000 Subject: [PATCH 19/52] *Always* check for exceptions in C++ methods, otherwise we miss important exceptions thrown in Python code called by C++ methods (like SystemExit!) --- .../interrogate/interfaceMakerPythonNative.cxx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index ad9583629c..22c50809c6 100755 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -2985,7 +2985,7 @@ write_function_instance(ostream &out, InterfaceMaker::Object *obj, int num_params = 0; bool only_pyobjects = true; - bool check_exceptions = false; + //bool check_exceptions = false; int pn; for (pn = 0; pn < (int)remap->_parameters.size(); ++pn) { @@ -3232,7 +3232,7 @@ write_function_instance(ostream &out, InterfaceMaker::Object *obj, // It's reasonable to assume that a function taking a PyObject // might also throw a TypeError if the type is incorrect. - check_exceptions = true; + //check_exceptions = true; } else if (TypeManager::is_pointer_to_Py_buffer(type)) { if (args_type == AT_single_arg) { @@ -3248,7 +3248,7 @@ write_function_instance(ostream &out, InterfaceMaker::Object *obj, extra_cleanup += "Py_XDECREF(" + param_name + "_buffer);"; expected_params += "memoryview"; ++num_params; - check_exceptions = true; + //check_exceptions = true; } else if (TypeManager::is_pointer(type)) { CPPType *obj_type = TypeManager::unwrap(TypeManager::resolve_type(type)); @@ -3351,9 +3351,9 @@ write_function_instance(ostream &out, InterfaceMaker::Object *obj, // If this is the only overload, don't bother checking for type errors. // Any type error that is raised will simply pass through to below. - if (func->_remaps.size() == 1) { - check_exceptions = false; - } + //if (func->_remaps.size() == 1) { + // check_exceptions = false; + //} // Track how many curly braces we've opened. short open_scopes = 0; @@ -3541,7 +3541,8 @@ write_function_instance(ostream &out, InterfaceMaker::Object *obj, } // If a method raises TypeError, continue. - if (check_exceptions) { + //if (check_exceptions) { + if (true) { indent(out, indent_level) << "if (PyErr_Occurred()) {\n"; delete_return_value(out, indent_level, remap, return_expr); From 031005d55e7f0461e1fc4fe6eb837db50c513f37 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 8 Sep 2014 11:14:40 +0000 Subject: [PATCH 20/52] Fixes for webcams on Linux with MJPEG streams that omit Huffman tables --- panda/src/vision/webcamVideoCursorV4L.cxx | 84 ++++++++++++++++++++--- 1 file changed, 74 insertions(+), 10 deletions(-) diff --git a/panda/src/vision/webcamVideoCursorV4L.cxx b/panda/src/vision/webcamVideoCursorV4L.cxx index 8231a5d6d0..9513b9bfe1 100644 --- a/panda/src/vision/webcamVideoCursorV4L.cxx +++ b/panda/src/vision/webcamVideoCursorV4L.cxx @@ -30,12 +30,6 @@ extern "C" { #include #endif -// This is supposed to be defined in jpegint.h, -// but not all implementations of JPEG provide that file. -#ifndef DSTATE_READY -#define DSTATE_READY 202 -#endif - TypeHandle WebcamVideoCursorV4L::_type_handle; #define clamp(x) min(max(x, 0.0), 255.0) @@ -121,6 +115,69 @@ static void my_skip_input_data(j_decompress_ptr cinfo, long num_bytes) { static void my_term_source(j_decompress_ptr cinfo) { } +// Huffman tables used for MJPEG streams that omit them. +static JHUFF_TBL dc_luminance_tbl = { + {0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}, + {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, + FALSE +}; + +static JHUFF_TBL dc_chrominance_tbl = { + {0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0}, + {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, + FALSE +}; + +static JHUFF_TBL ac_luminance_tbl = { + {0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d}, + { + 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, 0x21, + 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, 0x22, 0x71, + 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08, 0x23, 0x42, 0xb1, + 0xc1, 0x15, 0x52, 0xd1, 0xf0, 0x24, 0x33, 0x62, 0x72, + 0x82, 0x09, 0x0a, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x25, + 0x26, 0x27, 0x28, 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, + 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, + 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, + 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x83, + 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x92, 0x93, + 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, + 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, + 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, + 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, + 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2, + 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xf1, + 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa + }, + FALSE +}; + +static JHUFF_TBL ac_chrominance_tbl = { + {0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77}, + { + 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, 0x31, + 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, 0x13, 0x22, + 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, 0xa1, 0xb1, 0xc1, + 0x09, 0x23, 0x33, 0x52, 0xf0, 0x15, 0x62, 0x72, 0xd1, + 0x0a, 0x16, 0x24, 0x34, 0xe1, 0x25, 0xf1, 0x17, 0x18, + 0x19, 0x1a, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, + 0x37, 0x38, 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, + 0x48, 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, + 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, + 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, + 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, + 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, + 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, + 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, + 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, + 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, + 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, + 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa + }, + FALSE +}; + #endif //////////////////////////////////////////////////////////////////// @@ -343,18 +400,25 @@ fetch_buffer() { // Establish the setjmp return context for my_error_exit to use if (setjmp(jerr.setjmp_buffer)) { - if (_cinfo->global_state > DSTATE_READY) { - jpeg_abort_decompress(_cinfo); - } + jpeg_abort_decompress(_cinfo); } else { // Set up data pointer _cinfo->src->bytes_in_buffer = bufsize; _cinfo->src->next_input_byte = buf; if (jpeg_read_header(_cinfo, TRUE) == JPEG_HEADER_OK) { + if (_cinfo->dc_huff_tbl_ptrs[0] == NULL) { + // Many MJPEG streams do not include huffman tables. Remedy this. + _cinfo->dc_huff_tbl_ptrs[0] = &dc_luminance_tbl; + _cinfo->dc_huff_tbl_ptrs[1] = &dc_chrominance_tbl; + _cinfo->ac_huff_tbl_ptrs[0] = &ac_luminance_tbl; + _cinfo->ac_huff_tbl_ptrs[1] = &ac_chrominance_tbl; + } + _cinfo->scale_num = 1; _cinfo->scale_denom = 1; _cinfo->out_color_space = JCS_RGB; + _cinfo->dct_method = JDCT_IFAST; if (jpeg_start_decompress(_cinfo) && _cinfo->output_components == 3 && _size_x == _cinfo->output_width && _size_y == _cinfo->output_height) { @@ -363,7 +427,7 @@ fetch_buffer() { JSAMPLE *rowptr = newbuf; while (_cinfo->output_scanline < _cinfo->output_height) { nassertd(rowptr + new_bpl <= buffer_end) break; - jpeg_read_scanlines(_cinfo, &rowptr, 1); + jpeg_read_scanlines(_cinfo, &rowptr, _cinfo->output_height); rowptr += new_bpl; } From 02e95bdba3e741959f73655950939f47e6ba98e5 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 13 Sep 2014 17:21:38 +0000 Subject: [PATCH 21/52] PNMTextMaker constructor should take FreetypeFont --- panda/src/pnmtext/pnmTextMaker.cxx | 17 +++++++++++++++-- panda/src/pnmtext/pnmTextMaker.h | 1 + 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/panda/src/pnmtext/pnmTextMaker.cxx b/panda/src/pnmtext/pnmTextMaker.cxx index db727773ea..e48e9e0445 100644 --- a/panda/src/pnmtext/pnmTextMaker.cxx +++ b/panda/src/pnmtext/pnmTextMaker.cxx @@ -46,7 +46,7 @@ PNMTextMaker(const char *font_data, int data_length, int face_index) { //////////////////////////////////////////////////////////////////// // Function: PNMTextMaker::Copy Constructor // Access: Public -// Description: +// Description: //////////////////////////////////////////////////////////////////// PNMTextMaker:: PNMTextMaker(const PNMTextMaker ©) : @@ -59,10 +59,23 @@ PNMTextMaker(const PNMTextMaker ©) : { } +//////////////////////////////////////////////////////////////////// +// Function: PNMTextMaker::Copy Constructor +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +PNMTextMaker:: +PNMTextMaker(const FreetypeFont ©) : + FreetypeFont(copy), + _is_valid(true) +{ + initialize(); +} + //////////////////////////////////////////////////////////////////// // Function: PNMTextMaker::Destructor // Access: Public -// Description: +// Description: //////////////////////////////////////////////////////////////////// PNMTextMaker:: ~PNMTextMaker() { diff --git a/panda/src/pnmtext/pnmTextMaker.h b/panda/src/pnmtext/pnmTextMaker.h index 4f61b9b49a..e524465d27 100644 --- a/panda/src/pnmtext/pnmTextMaker.h +++ b/panda/src/pnmtext/pnmTextMaker.h @@ -41,6 +41,7 @@ PUBLISHED: PNMTextMaker(const Filename &font_filename, int face_index); PNMTextMaker(const char *font_data, int data_length, int face_index); PNMTextMaker(const PNMTextMaker ©); + PNMTextMaker(const FreetypeFont ©); ~PNMTextMaker(); enum Alignment { From 340169c80c0a61c30d029146d664e20b6d933e64 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 13 Sep 2014 19:49:17 +0000 Subject: [PATCH 22/52] Add load_sub_image --- panda/src/gobj/texture.I | 17 +++++++++ panda/src/gobj/texture.cxx | 76 ++++++++++++++++++++++++++++++++------ panda/src/gobj/texture.h | 16 +++++--- 3 files changed, 91 insertions(+), 18 deletions(-) diff --git a/panda/src/gobj/texture.I b/panda/src/gobj/texture.I index af06f05e08..f2813cc2a0 100644 --- a/panda/src/gobj/texture.I +++ b/panda/src/gobj/texture.I @@ -351,6 +351,23 @@ load(const PfmFile &pfm, int z, int n, const LoaderOptions &options) { return false; } +//////////////////////////////////////////////////////////////////// +// Function: Texture::load_sub_image +// Access: Published +// Description: Stores the indicated image in a region of the +// texture. The texture properties remain unchanged. +// This can be more efficient than updating an entire +// texture, but has a few restrictions: for one, you +// must ensure that the texture is still in RAM (eg. +// using set_keep_ram_image) and it may not be +// compressed. +//////////////////////////////////////////////////////////////////// +INLINE bool Texture:: +load_sub_image(const PNMImage &image, int x, int y, int z, int n) { + CDWriter cdata(_cycler, true); + return do_load_sub_image(cdata, image, x, y, z, n); +} + //////////////////////////////////////////////////////////////////// // Function: Texture::store // Access: Published diff --git a/panda/src/gobj/texture.cxx b/panda/src/gobj/texture.cxx index 6f973c2c65..99b4e2dc37 100644 --- a/panda/src/gobj/texture.cxx +++ b/panda/src/gobj/texture.cxx @@ -1332,7 +1332,7 @@ generate_simple_ram_image() { size_t expected_page_size = (size_t)(x_size * y_size * 4); PTA_uchar image = PTA_uchar::empty_array(expected_page_size, get_class_type()); - convert_from_pnmimage(image, expected_page_size, 0, scaled, 4, 1); + convert_from_pnmimage(image, expected_page_size, x_size, 0, 0, 0, scaled, 4, 1); do_set_simple_ram_image(cdata, image, x_size, y_size); cdata->_simple_image_date_generated = (PN_int32)time(NULL); @@ -3368,7 +3368,7 @@ do_read_one(CData *cdata, const Filename &fullpath, const Filename &alpha_fullpa image.take_from(new_image); } } - + if (!do_load_one(cdata, image, fullpath.get_basename(), z, n, options)) { return false; } @@ -3438,14 +3438,16 @@ do_load_one(CData *cdata, const PNMImage &pnmimage, const string &name, int z, i Thread::consider_yield(); convert_from_pnmimage(cdata->_ram_images[n]._image, - do_get_expected_ram_mipmap_page_size(cdata, n), z, - scaled, cdata->_num_components, cdata->_component_width); + do_get_expected_ram_mipmap_page_size(cdata, n), + x_size, 0, 0, z, scaled, + cdata->_num_components, cdata->_component_width); } else { // Now copy the pixel data from the PNMImage into our internal // cdata->_image component. convert_from_pnmimage(cdata->_ram_images[n]._image, - do_get_expected_ram_mipmap_page_size(cdata, n), z, - pnmimage, cdata->_num_components, cdata->_component_width); + do_get_expected_ram_mipmap_page_size(cdata, n), + x_size, 0, 0, z, pnmimage, + cdata->_num_components, cdata->_component_width); } Thread::consider_yield(); @@ -3520,6 +3522,40 @@ do_load_one(CData *cdata, const PfmFile &pfm, const string &name, int z, int n, return true; } +//////////////////////////////////////////////////////////////////// +// Function: Texture::do_load_sub_image +// Access: Protected, Virtual +// Description: Internal method to load an image into a section of +// a texture page or mipmap level. +//////////////////////////////////////////////////////////////////// +bool Texture:: +do_load_sub_image(CData *cdata, const PNMImage &image, int x, int y, int z, int n) { + nassertr(n >= 0 && n < cdata->_ram_images.size(), false); + + int tex_x_size = do_get_expected_mipmap_x_size(cdata, n); + int tex_y_size = do_get_expected_mipmap_y_size(cdata, n); + int tex_z_size = do_get_expected_mipmap_z_size(cdata, n); + + nassertr(x >= 0 && x < tex_x_size, false); + nassertr(y >= 0 && y < tex_y_size, false); + nassertr(z >= 0 && z < tex_z_size, false); + + nassertr(image.get_x_size() + x < tex_x_size, false); + nassertr(image.get_y_size() + y < tex_y_size, false); + + // Flip y + y = cdata->_y_size - (image.get_y_size() + y); + + cdata->inc_image_modified(); + do_modify_ram_mipmap_image(cdata, n); + convert_from_pnmimage(cdata->_ram_images[n]._image, + do_get_expected_ram_mipmap_page_size(cdata, n), + tex_x_size, x, y, z, image, + cdata->_num_components, cdata->_component_width); + + return true; +} + //////////////////////////////////////////////////////////////////// // Function: Texture::do_read_txo_file // Access: Protected @@ -6009,12 +6045,22 @@ do_get_bam_rawdata(CData *cdata) { // indicated PNMImage into the given ram_image. //////////////////////////////////////////////////////////////////// void Texture:: -convert_from_pnmimage(PTA_uchar &image, size_t page_size, int z, - const PNMImage &pnmimage, - int num_components, int component_width) { +convert_from_pnmimage(PTA_uchar &image, size_t page_size, + int row_stride, int x, int y, int z, + const PNMImage &pnmimage, int num_components, + int component_width) { int x_size = pnmimage.get_x_size(); int y_size = pnmimage.get_y_size(); xelval maxval = pnmimage.get_maxval(); + int pixel_size = num_components * component_width; + + int row_skip = 0; + if (row_stride == 0) { + row_stride = x_size; + } else { + row_skip = (row_stride - x_size) * pixel_size; + nassertv(row_skip >= 0); + } bool is_grayscale = (num_components == 1 || num_components == 2); bool has_alpha = (num_components == 2 || num_components == 4); @@ -6024,6 +6070,10 @@ convert_from_pnmimage(PTA_uchar &image, size_t page_size, int z, nassertv(idx + page_size <= image.size()); unsigned char *p = &image[idx]; + if (x != 0 || y != 0) { + p += (row_stride * y + x) * pixel_size; + } + if (maxval == 255 && component_width == 1) { // Most common case: one byte per pixel, and the source image // shows a maxval of 255. No scaling is necessary. @@ -6044,6 +6094,7 @@ convert_from_pnmimage(PTA_uchar &image, size_t page_size, int z, } } } + p += row_skip; } } else if (maxval == 65535 && component_width == 2) { @@ -6052,7 +6103,7 @@ convert_from_pnmimage(PTA_uchar &image, size_t page_size, int z, for (int j = y_size-1; j >= 0; j--) { for (int i = 0; i < x_size; i++) { if (is_grayscale) { - store_unscaled_short(p, pnmimage.get_gray_val(i, j)); + store_unscaled_short(p, pnmimage.get_gray_val(i, j)); } else { store_unscaled_short(p, pnmimage.get_blue_val(i, j)); store_unscaled_short(p, pnmimage.get_green_val(i, j)); @@ -6066,6 +6117,7 @@ convert_from_pnmimage(PTA_uchar &image, size_t page_size, int z, } } } + p += row_skip; } } else if (component_width == 1) { @@ -6091,6 +6143,7 @@ convert_from_pnmimage(PTA_uchar &image, size_t page_size, int z, } } } + p += row_skip; } } else { // component_width == 2 @@ -6116,10 +6169,9 @@ convert_from_pnmimage(PTA_uchar &image, size_t page_size, int z, } } } + p += row_skip; } } - - nassertv(p == &image[idx] + page_size); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/gobj/texture.h b/panda/src/gobj/texture.h index d0d0d47462..1198dc67d6 100644 --- a/panda/src/gobj/texture.h +++ b/panda/src/gobj/texture.h @@ -279,6 +279,7 @@ PUBLISHED: BLOCKING INLINE bool load(const PNMImage &pnmimage, int z, int n, const LoaderOptions &options = LoaderOptions()); BLOCKING INLINE bool load(const PfmFile &pfm, const LoaderOptions &options = LoaderOptions()); BLOCKING INLINE bool load(const PfmFile &pfm, int z, int n, const LoaderOptions &options = LoaderOptions()); + BLOCKING INLINE bool load_sub_image(const PNMImage &pnmimage, int x, int y, int z=0, int n=0); BLOCKING INLINE bool store(PNMImage &pnmimage) const; BLOCKING INLINE bool store(PNMImage &pnmimage, int z, int n) const; BLOCKING INLINE bool store(PfmFile &pfm) const; @@ -569,6 +570,8 @@ protected: virtual bool do_load_one(CData *cdata, const PfmFile &pfm, const string &name, int z, int n, const LoaderOptions &options); + virtual bool do_load_sub_image(CData *cdata, const PNMImage &image, + int x, int y, int z, int n); bool do_read_txo_file(CData *cdata, const Filename &fullpath); bool do_read_txo(CData *cdata, istream &in, const string &filename); bool do_read_dds_file(CData *cdata, const Filename &fullpath, bool header_only); @@ -682,19 +685,20 @@ protected: }; private: - static void convert_from_pnmimage(PTA_uchar &image, size_t page_size, - int z, const PNMImage &pnmimage, + static void convert_from_pnmimage(PTA_uchar &image, size_t page_size, + int row_stride, int x, int y, int z, + const PNMImage &pnmimage, int num_components, int component_width); - static void convert_from_pfm(PTA_uchar &image, size_t page_size, - int z, const PfmFile &pfm, + static void convert_from_pfm(PTA_uchar &image, size_t page_size, + int z, const PfmFile &pfm, int num_components, int component_width); static bool convert_to_pnmimage(PNMImage &pnmimage, int x_size, int y_size, int num_components, int component_width, - CPTA_uchar image, size_t page_size, + CPTA_uchar image, size_t page_size, int z); static bool convert_to_pfm(PfmFile &pfm, int x_size, int y_size, int num_components, int component_width, - CPTA_uchar image, size_t page_size, + CPTA_uchar image, size_t page_size, int z); static PTA_uchar read_dds_level_bgr8(Texture *tex, CData *cdata, const DDSHeader &header, int n, istream &in); From 12862649521fafcf4d1ad49d3bdf080d6dba4000 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 14 Sep 2014 10:17:13 +0000 Subject: [PATCH 23/52] publish textglyph interfaces to make it easier for people to implement their own font rendering algorithm --- panda/src/text/dynamicTextFont.cxx | 3 +- panda/src/text/dynamicTextGlyph.I | 94 ++++++++++++++++++++++++++++- panda/src/text/dynamicTextGlyph.cxx | 38 ++++++------ panda/src/text/dynamicTextGlyph.h | 16 ++++- panda/src/text/textFont.I | 17 ++++++ panda/src/text/textFont.h | 1 + panda/src/text/textGlyph.h | 1 + 7 files changed, 148 insertions(+), 22 deletions(-) diff --git a/panda/src/text/dynamicTextFont.cxx b/panda/src/text/dynamicTextFont.cxx index 4c290ce15e..c089926002 100644 --- a/panda/src/text/dynamicTextFont.cxx +++ b/panda/src/text/dynamicTextFont.cxx @@ -539,6 +539,7 @@ make_glyph(int character, FT_Face face, int glyph_index) { render_polygon_contours(glyph, true, true); return glyph; + case RM_texture: default: break; } @@ -610,7 +611,7 @@ make_glyph(int character, FT_Face face, int glyph_index) { copy_pnmimage_to_texture(reduced, glyph); } } - + glyph->make_geom((int)floor(slot->bitmap_top + outline * _scale_factor + 0.5f), (int)floor(slot->bitmap_left - outline * _scale_factor + 0.5f), advance, _poly_margin, diff --git a/panda/src/text/dynamicTextGlyph.I b/panda/src/text/dynamicTextGlyph.I index c6bc155f67..0320486a5e 100644 --- a/panda/src/text/dynamicTextGlyph.I +++ b/panda/src/text/dynamicTextGlyph.I @@ -26,7 +26,9 @@ DynamicTextGlyph(int character, DynamicTextPage *page, int x, int y, _page(page), _x(x), _y(y), _x_size(x_size), _y_size(y_size), - _margin(margin) + _margin(margin), + _top(0), _left(0), _bottom(0), _right(0), + _uv_top(0), _uv_left(0), _uv_bottom(0), _uv_right(0) { _geom_count = 0; } @@ -74,7 +76,7 @@ operator = (const DynamicTextGlyph &) { //////////////////////////////////////////////////////////////////// // Function: DynamicTextGlyph::intersects -// Access: Public +// Access: Published // Description: Returns true if the particular position this glyph // has been assigned to overlaps the rectangle whose // top left corner is at x, y and whose size is given by @@ -91,3 +93,91 @@ intersects(int x, int y, int x_size, int y_size) const { return !(x >= mright || hright <= _x || y >= mbot || hbot <= _y); } + +//////////////////////////////////////////////////////////////////// +// Function: DynamicTextGlyph::get_top +// Access: Published +// Description: Returns the vertex coordinates that can be used when +// creating a custom text renderer. +//////////////////////////////////////////////////////////////////// +INLINE PN_stdfloat DynamicTextGlyph:: +get_top() const { + return _top; +} + +//////////////////////////////////////////////////////////////////// +// Function: DynamicTextGlyph::get_left +// Access: Published +// Description: Returns the vertex coordinates that can be used when +// creating a custom text renderer. +//////////////////////////////////////////////////////////////////// +INLINE PN_stdfloat DynamicTextGlyph:: +get_left() const { + return _left; +} + +//////////////////////////////////////////////////////////////////// +// Function: DynamicTextGlyph::get_bottom +// Access: Published +// Description: Returns the vertex coordinates that can be used when +// creating a custom text renderer. +//////////////////////////////////////////////////////////////////// +INLINE PN_stdfloat DynamicTextGlyph:: +get_bottom() const { + return _bottom; +} + +//////////////////////////////////////////////////////////////////// +// Function: DynamicTextGlyph::get_right +// Access: Published +// Description: Returns the vertex coordinates that can be used when +// creating a custom text renderer. +//////////////////////////////////////////////////////////////////// +INLINE PN_stdfloat DynamicTextGlyph:: +get_right() const { + return _right; +} + +//////////////////////////////////////////////////////////////////// +// Function: DynamicTextGlyph::get_uv_top +// Access: Published +// Description: Returns the UV coordinates that can be used when +// creating a custom text renderer. +//////////////////////////////////////////////////////////////////// +INLINE PN_stdfloat DynamicTextGlyph:: +get_uv_top() const { + return _uv_top; +} + +//////////////////////////////////////////////////////////////////// +// Function: DynamicTextGlyph::get_uv_left +// Access: Published +// Description: Returns the UV coordinates that can be used when +// creating a custom text renderer. +//////////////////////////////////////////////////////////////////// +INLINE PN_stdfloat DynamicTextGlyph:: +get_uv_left() const { + return _uv_left; +} + +//////////////////////////////////////////////////////////////////// +// Function: DynamicTextGlyph::get_uv_bottom +// Access: Published +// Description: Returns the UV coordinates that can be used when +// creating a custom text renderer. +//////////////////////////////////////////////////////////////////// +INLINE PN_stdfloat DynamicTextGlyph:: +get_uv_bottom() const { + return _uv_bottom; +} + +//////////////////////////////////////////////////////////////////// +// Function: DynamicTextGlyph::get_uv_right +// Access: Published +// Description: Returns the UV coordinates that can be used when +// creating a custom text renderer. +//////////////////////////////////////////////////////////////////// +INLINE PN_stdfloat DynamicTextGlyph:: +get_uv_right() const { + return _uv_right; +} diff --git a/panda/src/text/dynamicTextGlyph.cxx b/panda/src/text/dynamicTextGlyph.cxx index dd1c1f02e9..250b8ce677 100644 --- a/panda/src/text/dynamicTextGlyph.cxx +++ b/panda/src/text/dynamicTextGlyph.cxx @@ -110,38 +110,42 @@ make_geom(int bitmap_top, int bitmap_left, PN_stdfloat advance, PN_stdfloat poly PN_stdfloat tex_poly_margin = poly_margin / tex_pixels_per_unit; PN_stdfloat origin_y = bitmap_top / font_pixels_per_unit; PN_stdfloat origin_x = bitmap_left / font_pixels_per_unit; - PN_stdfloat top = origin_y + tex_poly_margin; - PN_stdfloat left = origin_x - tex_poly_margin; - PN_stdfloat bottom = origin_y - tex_y_size / tex_pixels_per_unit - tex_poly_margin; - PN_stdfloat right = origin_x + tex_x_size / tex_pixels_per_unit + tex_poly_margin; + _top = origin_y + tex_poly_margin; + _left = origin_x - tex_poly_margin; + _bottom = origin_y - tex_y_size / tex_pixels_per_unit - tex_poly_margin; + _right = origin_x + tex_x_size / tex_pixels_per_unit + tex_poly_margin; // And the corresponding corners in UV units. We add 0.5f to center // the UV in the middle of its texel, to minimize roundoff errors // when we are close to 1-to-1 pixel size. - PN_stdfloat uv_top = 1.0f - ((PN_stdfloat)(_y - poly_margin) + 0.5f) / _page->get_y_size(); - PN_stdfloat uv_left = ((PN_stdfloat)(_x - poly_margin) + 0.5f) / _page->get_x_size(); - PN_stdfloat uv_bottom = 1.0f - ((PN_stdfloat)(_y + poly_margin + tex_y_size) + 0.5f) / _page->get_y_size(); - PN_stdfloat uv_right = ((PN_stdfloat)(_x + poly_margin + tex_x_size) + 0.5f) / _page->get_x_size(); + _uv_top = 1.0f - ((PN_stdfloat)(_y - poly_margin) + 0.5f) / _page->get_y_size(); + _uv_left = ((PN_stdfloat)(_x - poly_margin) + 0.5f) / _page->get_x_size(); + _uv_bottom = 1.0f - ((PN_stdfloat)(_y + poly_margin + tex_y_size) + 0.5f) / _page->get_y_size(); + _uv_right = ((PN_stdfloat)(_x + poly_margin + tex_x_size) + 0.5f) / _page->get_x_size(); + // Create a corresponding triangle pair. We use a pair of indexed // triangles rather than a single triangle strip, to avoid the bad // vertex duplication behavior with lots of two-triangle strips. PT(GeomVertexData) vdata = new GeomVertexData (string(), GeomVertexFormat::get_v3t2(), Geom::UH_static); + vdata->unclean_set_num_rows(4); + GeomVertexWriter vertex(vdata, InternalName::get_vertex()); GeomVertexWriter texcoord(vdata, InternalName::get_texcoord()); - vertex.add_data3(left, 0, top); - vertex.add_data3(left, 0, bottom); - vertex.add_data3(right, 0, top); - vertex.add_data3(right, 0, bottom); + vertex.add_data3(_left, 0, _top); + vertex.add_data3(_left, 0, _bottom); + vertex.add_data3(_right, 0, _top); + vertex.add_data3(_right, 0, _bottom); - texcoord.add_data2(uv_left, uv_top); - texcoord.add_data2(uv_left, uv_bottom); - texcoord.add_data2(uv_right, uv_top); - texcoord.add_data2(uv_right, uv_bottom); + texcoord.add_data2(_uv_left, _uv_top); + texcoord.add_data2(_uv_left, _uv_bottom); + texcoord.add_data2(_uv_right, _uv_top); + texcoord.add_data2(_uv_right, _uv_bottom); PT(GeomTriangles) tris = new GeomTriangles(Geom::UH_static); + tris->reserve_num_vertices(6); tris->add_vertex(0); tris->add_vertex(1); tris->add_vertex(2); @@ -167,7 +171,6 @@ make_geom(int bitmap_top, int bitmap_left, PN_stdfloat advance, PN_stdfloat poly _advance = advance / font_pixels_per_unit; } - //////////////////////////////////////////////////////////////////// // Function: DynamicTextGlyph::set_geom // Access: Public @@ -205,5 +208,4 @@ is_whitespace() const { return (_page == (DynamicTextPage *)NULL); } - #endif // HAVE_FREETYPE diff --git a/panda/src/text/dynamicTextGlyph.h b/panda/src/text/dynamicTextGlyph.h index 46e57c45e5..217c6430d2 100644 --- a/panda/src/text/dynamicTextGlyph.h +++ b/panda/src/text/dynamicTextGlyph.h @@ -41,10 +41,22 @@ private: INLINE DynamicTextGlyph(const DynamicTextGlyph ©); INLINE void operator = (const DynamicTextGlyph ©); -public: +PUBLISHED: virtual ~DynamicTextGlyph(); INLINE bool intersects(int x, int y, int x_size, int y_size) const; + + INLINE PN_stdfloat get_top() const; + INLINE PN_stdfloat get_left() const; + INLINE PN_stdfloat get_bottom() const; + INLINE PN_stdfloat get_right() const; + + INLINE PN_stdfloat get_uv_top() const; + INLINE PN_stdfloat get_uv_left() const; + INLINE PN_stdfloat get_uv_bottom() const; + INLINE PN_stdfloat get_uv_right() const; + +public: unsigned char *get_row(int y); void erase(DynamicTextFont *font); void make_geom(int top, int left, PN_stdfloat advance, PN_stdfloat poly_margin, @@ -60,6 +72,8 @@ public: int _x, _y; int _x_size, _y_size; int _margin; + PN_stdfloat _top, _left, _bottom, _right; + PN_stdfloat _uv_top, _uv_left, _uv_bottom, _uv_right; }; #include "dynamicTextGlyph.I" diff --git a/panda/src/text/textFont.I b/panda/src/text/textFont.I index d4dc16d88f..030f96d28d 100644 --- a/panda/src/text/textFont.I +++ b/panda/src/text/textFont.I @@ -76,3 +76,20 @@ INLINE void TextFont:: set_space_advance(PN_stdfloat space_advance) { _space_advance = space_advance; } + +//////////////////////////////////////////////////////////////////// +// Function: DynamicTextFont::get_glyph +// Access: Public, Virtual +// Description: Gets the glyph associated with the given character +// code, as well as an optional scaling parameter that +// should be applied to the glyph's geometry and advance +// parameters. Returns the glyph on success. On failure, +// it may still return a printable glyph, or it may +// return NULL. +//////////////////////////////////////////////////////////////////// +INLINE const TextGlyph *TextFont:: +get_glyph(int character) { + const TextGlyph *glyph = NULL; + get_glyph(character, glyph); + return glyph; +} diff --git a/panda/src/text/textFont.h b/panda/src/text/textFont.h index 190a2e793e..193616c298 100644 --- a/panda/src/text/textFont.h +++ b/panda/src/text/textFont.h @@ -78,6 +78,7 @@ PUBLISHED: INLINE PN_stdfloat get_space_advance() const; INLINE void set_space_advance(PN_stdfloat space_advance); + INLINE const TextGlyph *get_glyph(int character); virtual void write(ostream &out, int indent_level) const; diff --git a/panda/src/text/textGlyph.h b/panda/src/text/textGlyph.h index ac153d11a8..293fb3cc9b 100644 --- a/panda/src/text/textGlyph.h +++ b/panda/src/text/textGlyph.h @@ -37,6 +37,7 @@ public: INLINE void operator = (const TextGlyph ©); virtual ~TextGlyph(); +PUBLISHED: INLINE int get_character() const; INLINE PT(Geom) get_geom(Geom::UsageHint usage_hint) const; INLINE const RenderState *get_state() const; From 3b60afb12bd4393e32e69a04a970a8bd9ca01f40 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 14 Sep 2014 10:34:01 +0000 Subject: [PATCH 24/52] Make TextGlyph typed --- panda/src/text/config_text.cxx | 4 ++++ panda/src/text/dynamicTextGlyph.cxx | 2 ++ panda/src/text/dynamicTextGlyph.h | 17 +++++++++++++++++ panda/src/text/textGlyph.cxx | 4 +++- panda/src/text/textGlyph.h | 19 ++++++++++++++++++- 5 files changed, 44 insertions(+), 2 deletions(-) diff --git a/panda/src/text/config_text.cxx b/panda/src/text/config_text.cxx index 8372aa96a1..a963413467 100644 --- a/panda/src/text/config_text.cxx +++ b/panda/src/text/config_text.cxx @@ -15,9 +15,11 @@ #include "config_text.h" #include "staticTextFont.h" #include "textFont.h" +#include "textGlyph.h" #include "textNode.h" #include "textProperties.h" #include "dynamicTextFont.h" +#include "dynamicTextGlyph.h" #include "dynamicTextPage.h" #include "geomTextGlyph.h" #include "geomTextGlyph.h" @@ -217,11 +219,13 @@ init_libtext() { StaticTextFont::init_type(); TextFont::init_type(); + TextGlyph::init_type(); TextNode::init_type(); TextProperties::init_type(); #ifdef HAVE_FREETYPE DynamicTextFont::init_type(); + DynamicTextGlyph::init_type(); DynamicTextPage::init_type(); GeomTextGlyph::init_type(); GeomTextGlyph::init_type(); diff --git a/panda/src/text/dynamicTextGlyph.cxx b/panda/src/text/dynamicTextGlyph.cxx index 250b8ce677..a63615340c 100644 --- a/panda/src/text/dynamicTextGlyph.cxx +++ b/panda/src/text/dynamicTextGlyph.cxx @@ -28,6 +28,8 @@ #include "renderState.h" #include "config_gobj.h" +TypeHandle DynamicTextGlyph::_type_handle; + //////////////////////////////////////////////////////////////////// // Function: DynamicTextGlyph::Destructor // Access: Public, Virtual diff --git a/panda/src/text/dynamicTextGlyph.h b/panda/src/text/dynamicTextGlyph.h index 217c6430d2..6c8339032e 100644 --- a/panda/src/text/dynamicTextGlyph.h +++ b/panda/src/text/dynamicTextGlyph.h @@ -74,6 +74,23 @@ public: int _margin; PN_stdfloat _top, _left, _bottom, _right; PN_stdfloat _uv_top, _uv_left, _uv_bottom, _uv_right; + +public: + static TypeHandle get_class_type() { + return _type_handle; + } + static void init_type() { + TextGlyph::init_type(); + register_type(_type_handle, "DynamicTextGlyph", + TextGlyph::get_class_type()); + } + virtual TypeHandle get_type() const { + return get_class_type(); + } + virtual TypeHandle force_init_type() {init_type(); return get_class_type();} + +private: + static TypeHandle _type_handle; }; #include "dynamicTextGlyph.I" diff --git a/panda/src/text/textGlyph.cxx b/panda/src/text/textGlyph.cxx index f0bda6f96b..7c1c6ff4a6 100644 --- a/panda/src/text/textGlyph.cxx +++ b/panda/src/text/textGlyph.cxx @@ -14,10 +14,12 @@ #include "textGlyph.h" +TypeHandle TextGlyph::_type_handle; + //////////////////////////////////////////////////////////////////// // Function: TextGlyph::Destructor // Access: Public -// Description: +// Description: //////////////////////////////////////////////////////////////////// TextGlyph:: ~TextGlyph() { diff --git a/panda/src/text/textGlyph.h b/panda/src/text/textGlyph.h index 293fb3cc9b..fc321fbaf9 100644 --- a/panda/src/text/textGlyph.h +++ b/panda/src/text/textGlyph.h @@ -28,7 +28,7 @@ // font. This is a piece of renderable geometry of some // kind. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA_TEXT TextGlyph : public ReferenceCount { +class EXPCL_PANDA_TEXT TextGlyph : public TypedReferenceCount { public: INLINE TextGlyph(int character); INLINE TextGlyph(int character, const Geom *geom, @@ -50,6 +50,23 @@ protected: CPT(Geom) _geom; CPT(RenderState) _state; PN_stdfloat _advance; + +public: + static TypeHandle get_class_type() { + return _type_handle; + } + static void init_type() { + TypedReferenceCount::init_type(); + register_type(_type_handle, "TextGlyph", + TypedReferenceCount::get_class_type()); + } + virtual TypeHandle get_type() const { + return get_class_type(); + } + virtual TypeHandle force_init_type() {init_type(); return get_class_type();} + +private: + static TypeHandle _type_handle; }; #include "textGlyph.I" From 0e1649740150895a516399f2f95ff8805ff7d904 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 14 Sep 2014 10:42:06 +0000 Subject: [PATCH 25/52] Expose DynamicTextGlyph::get_page --- panda/src/text/dynamicTextGlyph.I | 11 +++++++++++ panda/src/text/dynamicTextGlyph.h | 2 ++ panda/src/text/dynamicTextPage.h | 7 ++++--- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/panda/src/text/dynamicTextGlyph.I b/panda/src/text/dynamicTextGlyph.I index 0320486a5e..4f6e589d03 100644 --- a/panda/src/text/dynamicTextGlyph.I +++ b/panda/src/text/dynamicTextGlyph.I @@ -74,6 +74,17 @@ operator = (const DynamicTextGlyph &) { nassertv(false); } + +//////////////////////////////////////////////////////////////////// +// Function: DynamicTextGlyph::get_page +// Access: Published +// Description: Returns the DynamicTextPage that this glyph is on. +//////////////////////////////////////////////////////////////////// +INLINE DynamicTextPage *DynamicTextGlyph:: +get_page() const { + return _page; +} + //////////////////////////////////////////////////////////////////// // Function: DynamicTextGlyph::intersects // Access: Published diff --git a/panda/src/text/dynamicTextGlyph.h b/panda/src/text/dynamicTextGlyph.h index 6c8339032e..08dc4094c4 100644 --- a/panda/src/text/dynamicTextGlyph.h +++ b/panda/src/text/dynamicTextGlyph.h @@ -44,6 +44,8 @@ private: PUBLISHED: virtual ~DynamicTextGlyph(); + INLINE DynamicTextPage *get_page() const; + INLINE bool intersects(int x, int y, int x_size, int y_size) const; INLINE PN_stdfloat get_top() const; diff --git a/panda/src/text/dynamicTextPage.h b/panda/src/text/dynamicTextPage.h index 780e65cb5e..d0266df9f0 100644 --- a/panda/src/text/dynamicTextPage.h +++ b/panda/src/text/dynamicTextPage.h @@ -40,14 +40,15 @@ public: DynamicTextGlyph *slot_glyph(int character, int x_size, int y_size, int margin); +PUBLISHED: INLINE int get_x_size() const; INLINE int get_y_size() const; - void fill_region(int x, int y, int x_size, int y_size, const LColor &color); - -PUBLISHED: INLINE bool is_empty() const; +public: + void fill_region(int x, int y, int x_size, int y_size, const LColor &color); + private: int garbage_collect(DynamicTextFont *font); From 5437a3e5a9fca365e94cca3330c09a2f5e9b9a4b Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 14 Sep 2014 22:02:16 +0000 Subject: [PATCH 26/52] Allow const variables with initializers to be used in expressions (like enum definitions). Also fix compiler warning. --- dtool/src/cppparser/cppExpression.cxx | 31 +++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/dtool/src/cppparser/cppExpression.cxx b/dtool/src/cppparser/cppExpression.cxx index 7dd2f18833..2bd295193d 100644 --- a/dtool/src/cppparser/cppExpression.cxx +++ b/dtool/src/cppparser/cppExpression.cxx @@ -132,10 +132,10 @@ void *CPPExpression::Result:: as_pointer() const { switch (_type) { case RT_integer: - return (void *)_u._integer; + return reinterpret_cast((long)_u._integer); case RT_real: - return (void *)(int)_u._real; + return reinterpret_cast((long)_u._real); case RT_pointer: return _u._pointer; @@ -400,6 +400,16 @@ evaluate() const { return Result(); case T_variable: + if (_u._variable->_type != NULL && + _u._variable->_initializer != NULL) { + // A const variable. Fetch its assigned value. + CPPConstType *const_type = _u._variable->_type->as_const_type(); + if (const_type != NULL) { + return _u._variable->_initializer->evaluate(); + } + } + return Result(); + case T_function: return Result(); @@ -889,6 +899,14 @@ bool CPPExpression:: is_tbd() const { switch (_type) { case T_variable: + if (_u._variable->_type != NULL && + _u._variable->_initializer != NULL) { + CPPConstType *const_type = _u._variable->_type->as_const_type(); + if (const_type != NULL) { + return false; + } + } + return true; case T_typecast: @@ -978,6 +996,15 @@ output(ostream &out, int indent_level, CPPScope *scope, bool) const { break; case T_variable: + if (_u._variable->_type != NULL && + _u._variable->_initializer != NULL) { + // A const variable. Fetch its assigned value. + CPPConstType *const_type = _u._variable->_type->as_const_type(); + if (const_type != NULL) { + _u._variable->_initializer->output(out, indent_level, scope, false); + break; + } + } _u._variable->_ident->output(out, scope); break; From 87910799b6511ca3868c45691671ab9e1ac2befe Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 14 Sep 2014 22:04:36 +0000 Subject: [PATCH 27/52] Split off epvector.h into its own file in an attempt to cut down compilation time --- direct/src/motiontrail/cMotionTrail.cxx | 2 +- direct/src/motiontrail/cMotionTrail.h | 87 +++++++++---------- dtool/src/dtoolbase/Sources.pp | 6 +- dtool/src/dtoolbase/epvector.h | 61 +++++++++++++ dtool/src/dtoolbase/pvector.h | 42 --------- panda/src/collide/collisionHandlerPusher.cxx | 7 +- panda/src/collide/collisionPolygon.cxx | 5 +- panda/src/egg/eggGroupNode.cxx | 1 + panda/src/egg/eggMorphList.h | 2 +- panda/src/gobj/shader.h | 1 + panda/src/mathutil/stackedPerlinNoise3.h | 2 +- panda/src/parametrics/nurbsBasisVector.h | 2 +- panda/src/parametrics/nurbsCurve.cxx | 2 +- panda/src/parametrics/nurbsCurve.h | 2 +- panda/src/parametrics/nurbsCurveEvaluator.h | 1 + panda/src/parametrics/nurbsCurveResult.h | 9 +- panda/src/parametrics/nurbsSurfaceEvaluator.h | 1 + panda/src/parametrics/nurbsSurfaceResult.h | 11 +-- panda/src/physics/baseIntegrator.h | 3 +- pandatool/src/objegg/objToEggConverter.h | 8 +- pandatool/src/vrmlegg/indexedFaceSet.h | 7 +- pandatool/src/xfileegg/xFileAnimationSet.h | 2 +- pandatool/src/xfileegg/xFileMesh.h | 1 + 23 files changed, 148 insertions(+), 117 deletions(-) create mode 100644 dtool/src/dtoolbase/epvector.h diff --git a/direct/src/motiontrail/cMotionTrail.cxx b/direct/src/motiontrail/cMotionTrail.cxx index 942fd5d021..5d5e7173ce 100644 --- a/direct/src/motiontrail/cMotionTrail.cxx +++ b/direct/src/motiontrail/cMotionTrail.cxx @@ -114,7 +114,7 @@ enable (bool enable) { // Description: Set the GeomNode. //////////////////////////////////////////////////////////////////// void CMotionTrail:: -set_geom_node (PT(GeomNode) geom_node) { +set_geom_node (GeomNode *geom_node) { _geom_node = geom_node; } diff --git a/direct/src/motiontrail/cMotionTrail.h b/direct/src/motiontrail/cMotionTrail.h index 32f73a5ff5..7ca61a2951 100644 --- a/direct/src/motiontrail/cMotionTrail.h +++ b/direct/src/motiontrail/cMotionTrail.h @@ -24,7 +24,7 @@ #include "luse.h" #include "nurbsCurveEvaluator.h" #include "plist.h" -#include "pvector.h" +#include "epvector.h" class CMotionTrailVertex { public: @@ -32,7 +32,7 @@ public: LVecBase4 _start_color; LVecBase4 _end_color; PN_stdfloat _v; - + PT(NurbsCurveEvaluator) _nurbs_curve_evaluator; }; @@ -44,71 +44,68 @@ public: //////////////////////////////////////////////////////////////////// // Class : CMotionTrail -// Description : The method used in creating the motion trail is -// based on taking samples of time and transformations +// Description : The method used in creating the motion trail is +// based on taking samples of time and transformations // (the position and orientation matrix) in real-time. -// The method also requires a number of vertices -// (positions) that determines "shape" of the motion -// trail (i.e. the edge of a blade). A start color -// and end color is also required for each vertex. +// The method also requires a number of vertices +// (positions) that determines "shape" of the motion +// trail (i.e. the edge of a blade). A start color +// and end color is also required for each vertex. // The color is interpolated as function of time. // The colors are typically used to fade the motion // trail so the end color is typically black. // -// The vertices are submitted via the "add_vertex" -// function. For each frame, a sample is submited via -// the "update_motion_trail" function. During the -// "update_motion_trail" function, the motion trail -// geometry is created dynamically from the sample -// history and the vertices. +// The vertices are submitted via the "add_vertex" +// function. For each frame, a sample is submited via +// the "update_motion_trail" function. During the +// "update_motion_trail" function, the motion trail +// geometry is created dynamically from the sample +// history and the vertices. // -// The user must specifiy a GeomNode via +// The user must specifiy a GeomNode via // "set_geom_node". // -// The duration of the sample history is specified by -// a time window. A larger time window creates longer -// motion trails (given constant speed). Samples that -// are no longer within the time window are +// The duration of the sample history is specified by +// a time window. A larger time window creates longer +// motion trails (given constant speed). Samples that +// are no longer within the time window are // automatically discarded. // -// The nurbs option can be used to create smooth -// interpolated curves from the samples. The nurbs -// option is useful for animations that lack sampling -// to begin with, animations that move very quickly, +// The nurbs option can be used to create smooth +// interpolated curves from the samples. The nurbs +// option is useful for animations that lack sampling +// to begin with, animations that move very quickly, // or low frame rates. // -// The texture option be used to create variation to -// the motion trail. The u coordinate of the texture -// corresponds to time and the v coordinate +// The texture option be used to create variation to +// the motion trail. The u coordinate of the texture +// corresponds to time and the v coordinate // corresponds to the "shape" of the motion trail. //////////////////////////////////////////////////////////////////// - class EXPCL_DIRECT CMotionTrail : public TypedReferenceCount { - PUBLISHED: + CMotionTrail(); + ~CMotionTrail(); - CMotionTrail ( ); - ~CMotionTrail ( ); + void reset(); + void reset_vertex_list(); - void reset ( ); - void reset_vertex_list ( ); + void enable(bool enable); - void enable (bool enable); + void set_geom_node(GeomNode *geom_node); + void add_vertex(LVector4 *vertex, LVector4 *start_color, LVector4 *end_color, PN_stdfloat v); - void set_geom_node (PT(GeomNode) geom_node); - void add_vertex (LVector4 *vertex, LVector4 *start_color, LVector4 *end_color, PN_stdfloat v); + void set_parameters(PN_stdfloat sampling_time, PN_stdfloat time_window, bool use_texture, bool calculate_relative_matrix, bool use_nurbs, PN_stdfloat resolution_distance); - void set_parameters (PN_stdfloat sampling_time, PN_stdfloat time_window, bool use_texture, bool calculate_relative_matrix, bool use_nurbs, PN_stdfloat resolution_distance); - - int check_for_update (PN_stdfloat current_time); - void update_motion_trail (PN_stdfloat current_time, LMatrix4 *transform); + int check_for_update(PN_stdfloat current_time); + void update_motion_trail(PN_stdfloat current_time, LMatrix4 *transform); public: - void begin_geometry ( ); - void add_geometry_quad (LVector3 &v0, LVector3 &v1, LVector3 &v2, LVector3 &v3, LVector4 &c0, LVector4 &c1, LVector4 &c2, LVector4 &c3, LVector2 &t0, LVector2 &t1, LVector2 &t2, LVector2 &t3); - void add_geometry_quad (LVector4 &v0, LVector4 &v1, LVector4 &v2, LVector4 &v3, LVector4 &c0, LVector4 &c1, LVector4 &c2, LVector4 &c3, LVector2 &t0, LVector2 &t1, LVector2 &t2, LVector2 &t3); - void end_geometry ( ); + void begin_geometry(); + void add_geometry_quad(LVector3 &v0, LVector3 &v1, LVector3 &v2, LVector3 &v3, LVector4 &c0, LVector4 &c1, LVector4 &c2, LVector4 &c3, LVector2 &t0, LVector2 &t1, LVector2 &t2, LVector2 &t3); + void add_geometry_quad(LVector4 &v0, LVector4 &v1, LVector4 &v2, LVector4 &v3, LVector4 &c0, LVector4 &c1, LVector4 &c2, LVector4 &c3, LVector2 &t0, LVector2 &t1, LVector2 &t2, LVector2 &t3); + void end_geometry(); int _active; int _enable; @@ -143,14 +140,14 @@ public: // geom PT(GeomNode) _geom_node; - + // real-time data int _vertex_index; PT(GeomVertexData) _vertex_data; GeomVertexWriter _vertex_writer; GeomVertexWriter _color_writer; GeomVertexWriter _texture_writer; - PT(GeomTriangles) _triangles; + PT(GeomTriangles) _triangles; CMotionTrailVertex *_vertex_array; diff --git a/dtool/src/dtoolbase/Sources.pp b/dtool/src/dtoolbase/Sources.pp index de0eb225e3..e6387f27e7 100644 --- a/dtool/src/dtoolbase/Sources.pp +++ b/dtool/src/dtoolbase/Sources.pp @@ -39,7 +39,8 @@ typeRegistryNode.I typeRegistryNode.h \ typedObject.I typedObject.h \ pallocator.T pallocator.h \ - pdeque.h plist.h pmap.h pset.h pvector.h \ + pdeque.h plist.h pmap.h pset.h \ + pvector.h epvector.h \ lookup3.h lookup3.c \ dlmalloc_src.cxx ptmalloc2_smp_src.cxx @@ -97,7 +98,8 @@ typeRegistryNode.I typeRegistryNode.h \ typedObject.I typedObject.h \ pallocator.T pallocator.h \ - pdeque.h plist.h pmap.h pset.h pvector.h \ + pdeque.h plist.h pmap.h pset.h \ + pvector.h epvector.h \ lookup3.h #end lib_target diff --git a/dtool/src/dtoolbase/epvector.h b/dtool/src/dtoolbase/epvector.h new file mode 100644 index 0000000000..a6baad77af --- /dev/null +++ b/dtool/src/dtoolbase/epvector.h @@ -0,0 +1,61 @@ +// Filename: epvector.h +// Created by: drose (19Dec11) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) Carnegie Mellon University. All rights reserved. +// +// All use of this software is subject to the terms of the revised BSD +// license. You should have received a copy of this license along +// with this source code in a file named "LICENSE." +// +//////////////////////////////////////////////////////////////////// + +#ifndef EPVECTOR_H +#define EPVECTOR_H + +#include "pvector.h" + +#if defined(HAVE_EIGEN) && defined(_WIN32) && !defined(CPPPARSER) + +#include + +//////////////////////////////////////////////////////////////////// +// Class : epvector +// Description : Unfortunately, on Windows, std::vector can't be used +// for classes with explicitly alignment requirements, +// due to a minor mistake in the template definition +// (one of the vector methods receives a concrete +// object, which the compiler flags as an error, even if +// the method is never called). +// +// As a workaround, Eigen provides their own +// specialization of vector, using their own aligned +// allocator. We define that here as epvector, which is +// meant to be a drop-in replacement for pvector for +// classes that include a linmath object that requires +// alignment. Unfortunately, this means we can't use +// the Panda allocator, so memory allocated for this +// vector class won't be tracked as part of Panda's +// memory tracking system. Them's the breaks, kids. +//////////////////////////////////////////////////////////////////// +template +class epvector : public vector > { +public: + typedef Eigen::aligned_allocator allocator; + typedef vector base_class; + typedef TYPENAME base_class::size_type size_type; + + epvector(TypeHandle type_handle = pvector_type_handle) : base_class(allocator()) { } + epvector(const epvector ©) : base_class(copy) { } + epvector(size_type n, TypeHandle type_handle = pvector_type_handle) : base_class(n, Type(), allocator()) { } + epvector(size_type n, const Type &value, TypeHandle type_handle = pvector_type_handle) : base_class(n, value, allocator()) { } + epvector(const Type *begin, const Type *end, TypeHandle type_handle = pvector_type_handle) : base_class(begin, end, allocator()) { } +}; + +#else // HAVE_EIGEN +#define epvector pvector +#endif // HAVE_EIGEN + +#endif diff --git a/dtool/src/dtoolbase/pvector.h b/dtool/src/dtoolbase/pvector.h index 613774b6e1..2bf930c591 100644 --- a/dtool/src/dtoolbase/pvector.h +++ b/dtool/src/dtoolbase/pvector.h @@ -51,46 +51,4 @@ public: #endif // USE_STL_ALLOCATOR -#if defined(HAVE_EIGEN) && defined(_WIN32) && !defined(CPPPARSER) - -#include - -//////////////////////////////////////////////////////////////////// -// Class : epvector -// Description : Unfortunately, on Windows, std::vector can't be used -// for classes with explicitly alignment requirements, -// due to a minor mistake in the template definition -// (one of the vector methods receives a concrete -// object, which the compiler flags as an error, even if -// the method is never called). -// -// As a workaround, Eigen provides their own -// specialization of vector, using their own aligned -// allocator. We define that here as epvector, which is -// meant to be a drop-in replacement for pvector for -// classes that include a linmath object that requires -// alignment. Unfortunately, this means we can't use -// the Panda allocator, so memory allocated for this -// vector class won't be tracked as part of Panda's -// memory tracking system. Them's the breaks, kids. -//////////////////////////////////////////////////////////////////// -template -class epvector : public vector > { -public: - typedef Eigen::aligned_allocator allocator; - typedef vector base_class; - typedef TYPENAME base_class::size_type size_type; - - epvector(TypeHandle type_handle = pvector_type_handle) : base_class(allocator()) { } - epvector(const epvector ©) : base_class(copy) { } - epvector(size_type n, TypeHandle type_handle = pvector_type_handle) : base_class(n, Type(), allocator()) { } - epvector(size_type n, const Type &value, TypeHandle type_handle = pvector_type_handle) : base_class(n, value, allocator()) { } - epvector(const Type *begin, const Type *end, TypeHandle type_handle = pvector_type_handle) : base_class(begin, end, allocator()) { } -}; - -#else // HAVE_EIGEN -#define epvector pvector -#endif // HAVE_EIGEN - #endif - diff --git a/panda/src/collide/collisionHandlerPusher.cxx b/panda/src/collide/collisionHandlerPusher.cxx index 33e46cce0c..a87cfb99fe 100644 --- a/panda/src/collide/collisionHandlerPusher.cxx +++ b/panda/src/collide/collisionHandlerPusher.cxx @@ -18,6 +18,7 @@ #include "collisionPolygon.h" #include "config_collide.h" #include "dcast.h" +#include "epvector.h" TypeHandle CollisionHandlerPusher::_type_handle; @@ -95,7 +96,7 @@ handle_entries() { // shove. We hack around this by testing if two shove vectors // share nearly the same direction, and if so, we keep only the // longer of the two. - + typedef epvector Shoves; Shoves shoves; @@ -110,13 +111,13 @@ handle_entries() { LPoint3 interior_point; if (!entry->get_all(def._target, surface_point, normal, interior_point)) { - #ifndef NDEBUG +#ifndef NDEBUG if (collide_cat.is_debug()) { collide_cat.debug() << "Cannot shove on " << from_node_path << " for collision into " << entry->get_into_node_path() << "; no normal/depth information.\n"; } - #endif +#endif } else { // Shove it just enough to clear the volume. if (!surface_point.almost_equal(interior_point)) { diff --git a/panda/src/collide/collisionPolygon.cxx b/panda/src/collide/collisionPolygon.cxx index d5358950a1..a193d5836c 100644 --- a/panda/src/collide/collisionPolygon.cxx +++ b/panda/src/collide/collisionPolygon.cxx @@ -37,6 +37,7 @@ #include "geomLinestrips.h" #include "geomVertexWriter.h" #include "renderState.h" +#include "epvector.h" #include @@ -1490,14 +1491,14 @@ fillin(DatagramIterator &scan, BamReader *manager) { if (_points.size() >= 3) { LMatrix4 to_3d_mat; rederive_to_3d_mat(to_3d_mat); - + epvector verts; verts.reserve(_points.size()); Points::const_iterator pi; for (pi = _points.begin(); pi != _points.end(); ++pi) { verts.push_back(to_3d((*pi)._p, to_3d_mat)); } - + const LPoint3 *verts_begin = &verts[0]; const LPoint3 *verts_end = verts_begin + verts.size(); setup_points(verts_begin, verts_end); diff --git a/panda/src/egg/eggGroupNode.cxx b/panda/src/egg/eggGroupNode.cxx index 13da740b27..d21158e87a 100644 --- a/panda/src/egg/eggGroupNode.cxx +++ b/panda/src/egg/eggGroupNode.cxx @@ -25,6 +25,7 @@ #include "eggVertex.h" #include "eggTextureCollection.h" #include "eggMaterialCollection.h" +#include "epvector.h" #include "pt_EggTexture.h" #include "pt_EggMaterial.h" #include "config_egg.h" diff --git a/panda/src/egg/eggMorphList.h b/panda/src/egg/eggMorphList.h index ceca659960..fb6013190e 100644 --- a/panda/src/egg/eggMorphList.h +++ b/panda/src/egg/eggMorphList.h @@ -21,7 +21,7 @@ #include "indent.h" -#include "pvector.h" +#include "epvector.h" //////////////////////////////////////////////////////////////////// // Class : EggMorphList diff --git a/panda/src/gobj/shader.h b/panda/src/gobj/shader.h index 2acf3f8470..cc0f2208b0 100755 --- a/panda/src/gobj/shader.h +++ b/panda/src/gobj/shader.h @@ -28,6 +28,7 @@ #include "pta_LVecBase4.h" #include "pta_LVecBase3.h" #include "pta_LVecBase2.h" +#include "epvector.h" #ifdef HAVE_CG // I don't want to include the Cg header file into panda as a diff --git a/panda/src/mathutil/stackedPerlinNoise3.h b/panda/src/mathutil/stackedPerlinNoise3.h index 773fc95acb..e5c54e86db 100644 --- a/panda/src/mathutil/stackedPerlinNoise3.h +++ b/panda/src/mathutil/stackedPerlinNoise3.h @@ -17,7 +17,7 @@ #include "pandabase.h" #include "perlinNoise3.h" -#include "pvector.h" +#include "epvector.h" //////////////////////////////////////////////////////////////////// // Class : StackedPerlinNoise3 diff --git a/panda/src/parametrics/nurbsBasisVector.h b/panda/src/parametrics/nurbsBasisVector.h index 0712954ee9..9324f3c447 100644 --- a/panda/src/parametrics/nurbsBasisVector.h +++ b/panda/src/parametrics/nurbsBasisVector.h @@ -17,7 +17,7 @@ #include "pandabase.h" #include "luse.h" -#include "pvector.h" +#include "epvector.h" #include "pmap.h" class NurbsVertex; diff --git a/panda/src/parametrics/nurbsCurve.cxx b/panda/src/parametrics/nurbsCurve.cxx index 4f21250ee1..42f76e4bf7 100644 --- a/panda/src/parametrics/nurbsCurve.cxx +++ b/panda/src/parametrics/nurbsCurve.cxx @@ -20,10 +20,10 @@ #include "datagramIterator.h" #include "bamWriter.h" #include "bamReader.h" +#include "epvector.h" TypeHandle NurbsCurve::_type_handle; - //////////////////////////////////////////////////////////////////// // Function: NurbsCurve::Constructor // Access: Published diff --git a/panda/src/parametrics/nurbsCurve.h b/panda/src/parametrics/nurbsCurve.h index a0e87c922b..de1bccf396 100644 --- a/panda/src/parametrics/nurbsCurve.h +++ b/panda/src/parametrics/nurbsCurve.h @@ -20,6 +20,7 @@ #include "piecewiseCurve.h" #include "nurbsCurveInterface.h" #include "cubicCurveseg.h" +#include "epvector.h" //////////////////////////////////////////////////////////////////// // Class : NurbsCurve @@ -112,7 +113,6 @@ protected: epvector _cvs; - // TypedWritable stuff public: static void register_with_read_factory(); diff --git a/panda/src/parametrics/nurbsCurveEvaluator.h b/panda/src/parametrics/nurbsCurveEvaluator.h index f7ccb9e549..3d2299dc47 100644 --- a/panda/src/parametrics/nurbsCurveEvaluator.h +++ b/panda/src/parametrics/nurbsCurveEvaluator.h @@ -22,6 +22,7 @@ #include "pointerTo.h" #include "vector_stdfloat.h" #include "pvector.h" +#include "epvector.h" #include "nodePath.h" #include "referenceCount.h" #include "luse.h" diff --git a/panda/src/parametrics/nurbsCurveResult.h b/panda/src/parametrics/nurbsCurveResult.h index 0829bb0bdb..269ce6ba40 100644 --- a/panda/src/parametrics/nurbsCurveResult.h +++ b/panda/src/parametrics/nurbsCurveResult.h @@ -19,6 +19,7 @@ #include "referenceCount.h" #include "nurbsBasisVector.h" #include "vector_stdfloat.h" +#include "epvector.h" class NurbsVertex; @@ -52,7 +53,7 @@ PUBLISHED: INLINE PN_stdfloat eval_extended_point(PN_stdfloat t, int d); INLINE bool eval_extended_points(PN_stdfloat t, int d, PN_stdfloat result[], int num_values); - + INLINE int get_num_segments() const; void eval_segment_point(int segment, PN_stdfloat t, LVecBase3 &point) const; void eval_segment_tangent(int segment, PN_stdfloat t, LVecBase3 &tangent) const; @@ -67,14 +68,14 @@ PUBLISHED: INLINE const LPoint3 &get_sample_point(int n) const; MAKE_SEQ(get_sample_ts, get_num_samples, get_sample_t); MAKE_SEQ(get_sample_points, get_num_samples, get_sample_points); - + private: int find_segment(PN_stdfloat t); int r_find_segment(PN_stdfloat t, int top, int bot) const; - void r_adaptive_sample(int segment, PN_stdfloat t0, const LPoint3 &p0, + void r_adaptive_sample(int segment, PN_stdfloat t0, const LPoint3 &p0, PN_stdfloat t1, const LPoint3 &p1, PN_stdfloat tolerance_2); - static PN_stdfloat sqr_dist_to_line(const LPoint3 &point, const LPoint3 &origin, + static PN_stdfloat sqr_dist_to_line(const LPoint3 &point, const LPoint3 &origin, const LVector3 &vec); NurbsBasisVector _basis; diff --git a/panda/src/parametrics/nurbsSurfaceEvaluator.h b/panda/src/parametrics/nurbsSurfaceEvaluator.h index 5cd8f39a7d..e02e4bc4ea 100644 --- a/panda/src/parametrics/nurbsSurfaceEvaluator.h +++ b/panda/src/parametrics/nurbsSurfaceEvaluator.h @@ -22,6 +22,7 @@ #include "pointerTo.h" #include "vector_stdfloat.h" #include "pvector.h" +#include "epvector.h" #include "nodePath.h" #include "referenceCount.h" #include "luse.h" diff --git a/panda/src/parametrics/nurbsSurfaceResult.h b/panda/src/parametrics/nurbsSurfaceResult.h index 81c673400d..f5a055f44e 100644 --- a/panda/src/parametrics/nurbsSurfaceResult.h +++ b/panda/src/parametrics/nurbsSurfaceResult.h @@ -18,6 +18,7 @@ #include "pandabase.h" #include "referenceCount.h" #include "nurbsBasisVector.h" +#include "epvector.h" class NurbsVertex; @@ -30,8 +31,8 @@ class NurbsVertex; //////////////////////////////////////////////////////////////////// class EXPCL_PANDA_PARAMETRICS NurbsSurfaceResult : public ReferenceCount { public: - NurbsSurfaceResult(const NurbsBasisVector &u_basis, - const NurbsBasisVector &v_basis, + NurbsSurfaceResult(const NurbsBasisVector &u_basis, + const NurbsBasisVector &v_basis, const LVecBase4 vecs[], const NurbsVertex *verts, int num_u_vertices, int num_v_vertices); @@ -47,9 +48,9 @@ PUBLISHED: INLINE bool eval_point(PN_stdfloat u, PN_stdfloat v, LVecBase3 &point); INLINE bool eval_normal(PN_stdfloat u, PN_stdfloat v, LVecBase3 &normal); INLINE PN_stdfloat eval_extended_point(PN_stdfloat u, PN_stdfloat v, int d); - INLINE bool eval_extended_points(PN_stdfloat u, PN_stdfloat v, int d, + INLINE bool eval_extended_points(PN_stdfloat u, PN_stdfloat v, int d, PN_stdfloat result[], int num_values); - + INLINE int get_num_u_segments() const; INLINE int get_num_v_segments() const; void eval_segment_point(int ui, int vi, PN_stdfloat u, PN_stdfloat v, LVecBase3 &point) const; @@ -59,7 +60,7 @@ PUBLISHED: PN_stdfloat result[], int num_values) const; INLINE PN_stdfloat get_segment_u(int ui, PN_stdfloat u) const; INLINE PN_stdfloat get_segment_v(int vi, PN_stdfloat v) const; - + private: INLINE int verti(int ui, int vi) const; INLINE int segi(int ui, int vi) const; diff --git a/panda/src/physics/baseIntegrator.h b/panda/src/physics/baseIntegrator.h index a39dda8c65..66ba0177b3 100644 --- a/panda/src/physics/baseIntegrator.h +++ b/panda/src/physics/baseIntegrator.h @@ -24,6 +24,7 @@ #include "angularForce.h" #include "pvector.h" +#include "epvector.h" class Physical; @@ -41,7 +42,7 @@ public: virtual ~BaseIntegrator(); -PUBLISHED: +PUBLISHED: virtual void output(ostream &out) const; virtual void write_precomputed_linear_matrices(ostream &out, unsigned int indent=0) const; diff --git a/pandatool/src/objegg/objToEggConverter.h b/pandatool/src/objegg/objToEggConverter.h index e18487466e..fd081c6516 100755 --- a/pandatool/src/objegg/objToEggConverter.h +++ b/pandatool/src/objegg/objToEggConverter.h @@ -25,6 +25,8 @@ #include "geomPrimitive.h" #include "geomNode.h" #include "pandaNode.h" +#include "pvector.h" +#include "epvector.h" //////////////////////////////////////////////////////////////////// // Class : ObjToEggConverter @@ -83,7 +85,7 @@ protected: Vec2Table _xvt_table; Vec3Table _synth_vn_table; UniqueVec3Table _unique_synth_vn_table; - LVecBase2 _ref_plane_res; + LVecBase2 _ref_plane_res; bool _v4_given, _vt3_given; bool _f_given; @@ -122,8 +124,8 @@ protected: VertexData(PandaNode *parent, const string &name); int add_vertex(const ObjToEggConverter *converter, const VertexEntry &entry); - void add_triangle(const ObjToEggConverter *converter, const VertexEntry &v0, - const VertexEntry &v1, const VertexEntry &v2, + void add_triangle(const ObjToEggConverter *converter, const VertexEntry &v0, + const VertexEntry &v1, const VertexEntry &v2, int synth_vni); void close_geom(const ObjToEggConverter *converter); diff --git a/pandatool/src/vrmlegg/indexedFaceSet.h b/pandatool/src/vrmlegg/indexedFaceSet.h index 3153c5fae4..f5ad84812a 100644 --- a/pandatool/src/vrmlegg/indexedFaceSet.h +++ b/pandatool/src/vrmlegg/indexedFaceSet.h @@ -1,6 +1,6 @@ // Filename: indexedFaceSet.h // Created by: drose (24Jun99) -// +// //////////////////////////////////////////////////////////////////// // PANDA 3D SOFTWARE // Copyright (c) Carnegie Mellon University. All rights reserved. @@ -15,6 +15,7 @@ #include "pandatoolbase.h" #include "pvector.h" +#include "epvector.h" #include "pset.h" #include "eggPolygon.h" #include "eggVertex.h" @@ -43,9 +44,9 @@ private: void get_polys(); void get_vrml_colors(const VrmlNode *color_node, double transparency, pvector &color_list); - void get_vrml_normals(const VrmlNode *normal_node, + void get_vrml_normals(const VrmlNode *normal_node, pvector &normal_list); - void get_vrml_uvs(const VrmlNode *texCoord_node, + void get_vrml_uvs(const VrmlNode *texCoord_node, pvector &uv_list); bool get_colors(); diff --git a/pandatool/src/xfileegg/xFileAnimationSet.h b/pandatool/src/xfileegg/xFileAnimationSet.h index 9a13c66d63..3b38331989 100644 --- a/pandatool/src/xfileegg/xFileAnimationSet.h +++ b/pandatool/src/xfileegg/xFileAnimationSet.h @@ -17,7 +17,7 @@ #include "pandatoolbase.h" #include "pmap.h" -#include "pvector.h" +#include "epvector.h" #include "luse.h" #include "namable.h" diff --git a/pandatool/src/xfileegg/xFileMesh.h b/pandatool/src/xfileegg/xFileMesh.h index 89e2b18b4c..8e60722aae 100644 --- a/pandatool/src/xfileegg/xFileMesh.h +++ b/pandatool/src/xfileegg/xFileMesh.h @@ -17,6 +17,7 @@ #include "pandatoolbase.h" #include "pvector.h" +#include "epvector.h" #include "pmap.h" #include "indirectCompareTo.h" #include "namable.h" From 3200bb44432299a56604a288aa1594797e43861e Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 14 Sep 2014 23:41:36 +0000 Subject: [PATCH 28/52] fix compilation error on 32-bit Windows with Eigen --- panda/src/display/displayRegion.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/panda/src/display/displayRegion.h b/panda/src/display/displayRegion.h index b648fe307b..2d3dfd1bbe 100644 --- a/panda/src/display/displayRegion.h +++ b/panda/src/display/displayRegion.h @@ -38,6 +38,7 @@ #include "cullTraverser.h" #include "callbackObject.h" #include "luse.h" +#include "epvector.h" class GraphicsOutput; class GraphicsPipe; @@ -172,7 +173,7 @@ public: LVecBase4i _pixels; LVecBase4i _pixels_i; }; - typedef pvector Regions; + typedef epvector Regions; private: class CData; @@ -214,10 +215,10 @@ private: Regions _regions; int _lens_index; // index into which lens of a camera is associated with this display region. 0 is default - + NodePath _camera; Camera *_camera_node; - + bool _active; int _sort; Lens::StereoChannel _stereo_channel; From 0a999d2b6bcb6e991ca72b7f610ceb2bbc6c9409 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 15 Sep 2014 12:51:30 +0000 Subject: [PATCH 29/52] Remove two includes that are not supported in 64-bit windows --- direct/src/plugin_activex/stdafx.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/direct/src/plugin_activex/stdafx.h b/direct/src/plugin_activex/stdafx.h index 968b3cf20e..a651a9c0f4 100644 --- a/direct/src/plugin_activex/stdafx.h +++ b/direct/src/plugin_activex/stdafx.h @@ -35,10 +35,6 @@ #include // MFC support for Windows Common Controls #endif // _AFX_NO_AFXCMN_SUPPORT -// Delete the two includes below if you do not wish to use the MFC -// database classes -#include // MFC database classes -#include // MFC DAO database classes #include #include From 2b26ef1e3408d61bbe97ba3c0c7aa18a2607b427 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 15 Sep 2014 12:54:30 +0000 Subject: [PATCH 30/52] Python 2.5 has no 0o### number syntax --- direct/src/plugin_installer/make_installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direct/src/plugin_installer/make_installer.py b/direct/src/plugin_installer/make_installer.py index 5846e05955..f98950026e 100755 --- a/direct/src/plugin_installer/make_installer.py +++ b/direct/src/plugin_installer/make_installer.py @@ -441,7 +441,7 @@ def makeInstaller(): if not os.path.exists(dst_panda3dapp): os.makedirs(os.path.dirname(dst_panda3dapp)) shutil.copytree(pluginFiles[npapi], dst_npapi) shutil.copyfile(pluginFiles[panda3d], dst_panda3d) - os.chmod(dst_panda3d, 0o755) + os.chmod(dst_panda3d, 493) # 0o755 shutil.copytree(pluginFiles[panda3dapp], dst_panda3dapp) tmpresdir = tempfile.mktemp('', 'p3d-resources') From 9184fe71a9bcfd77f6831323cbea724cf8f35f51 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 15 Sep 2014 14:39:11 +0000 Subject: [PATCH 31/52] vectors and matrices should be passed by reference. Fixes compile error on 32-bit windows --- panda/src/physx/physxActor.cxx | 2 +- panda/src/physx/physxActor.h | 2 +- panda/src/physx/physxBodyDesc.cxx | 4 ++-- panda/src/physx/physxBodyDesc.h | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/panda/src/physx/physxActor.cxx b/panda/src/physx/physxActor.cxx index 4c7ad866e2..996aea2245 100644 --- a/panda/src/physx/physxActor.cxx +++ b/panda/src/physx/physxActor.cxx @@ -163,7 +163,7 @@ get_name() const { // transform from the controller's transform. //////////////////////////////////////////////////////////////////// void PhysxActor:: -update_transform(const LMatrix4f m) { +update_transform(const LMatrix4f &m) { // Active transforms are update AFTER scene.fetchResults() has // been called, and thus can contain removed objects. So either diff --git a/panda/src/physx/physxActor.h b/panda/src/physx/physxActor.h index b9864d7e4f..b8bfa9773c 100644 --- a/panda/src/physx/physxActor.h +++ b/panda/src/physx/physxActor.h @@ -180,7 +180,7 @@ PUBLISHED: INLINE void ls(ostream &out, int indent_level=0) const; public: - void update_transform(const LMatrix4f m); + void update_transform(const LMatrix4f &m); //////////////////////////////////////////////////////////////////// PUBLISHED: diff --git a/panda/src/physx/physxBodyDesc.cxx b/panda/src/physx/physxBodyDesc.cxx index 59242ec53e..9dfbeca7a2 100644 --- a/panda/src/physx/physxBodyDesc.cxx +++ b/panda/src/physx/physxBodyDesc.cxx @@ -279,7 +279,7 @@ get_sleep_damping() const { // of mass. //////////////////////////////////////////////////////////////////// void PhysxBodyDesc:: -set_mass_local_mat(const LMatrix4f mat) { +set_mass_local_mat(const LMatrix4f &mat) { _desc.massLocalPose = PhysxManager::mat4_to_nxMat34(mat); } @@ -303,7 +303,7 @@ get_mass_local_mat() const { // bodies mass frame. //////////////////////////////////////////////////////////////////// void PhysxBodyDesc:: -set_mass_space_inertia(const LVector3f inertia) { +set_mass_space_inertia(const LVector3f &inertia) { _desc.massSpaceInertia = PhysxManager::vec3_to_nxVec3(inertia); } diff --git a/panda/src/physx/physxBodyDesc.h b/panda/src/physx/physxBodyDesc.h index b191c68e32..e4aca2ac23 100644 --- a/panda/src/physx/physxBodyDesc.h +++ b/panda/src/physx/physxBodyDesc.h @@ -46,8 +46,8 @@ PUBLISHED: void set_solver_iteration_count(unsigned int count); void set_sleep_energy_threshold(float threshold); void set_sleep_damping(float damping); - void set_mass_local_mat(const LMatrix4f mat); - void set_mass_space_inertia(const LVector3f inertia); + void set_mass_local_mat(const LMatrix4f &mat); + void set_mass_space_inertia(const LVector3f &inertia); void set_flag(PhysxBodyFlag flag, bool value); void set_ccd_motion_threshold(float threshold); void set_wake_up_counter(float value); From e5ec2eaf505c01b6f81fb9424c3c9f781a14aac1 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 15 Sep 2014 16:46:28 +0000 Subject: [PATCH 32/52] Fix bug on Windows when resizing windows in any way other than dragging them --- panda/src/windisplay/winGraphicsWindow.cxx | 26 +++++----------------- panda/src/windisplay/winGraphicsWindow.h | 1 - 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/panda/src/windisplay/winGraphicsWindow.cxx b/panda/src/windisplay/winGraphicsWindow.cxx index c3bddb7d1b..1e65e6ce69 100644 --- a/panda/src/windisplay/winGraphicsWindow.cxx +++ b/panda/src/windisplay/winGraphicsWindow.cxx @@ -94,7 +94,6 @@ WinGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe, _ime_open = false; _ime_active = false; _tracking_mouse_leaving = false; - _maximized = false; _cursor = 0; _lost_keypresses = false; _lshift_down = false; @@ -1469,7 +1468,7 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { // When a fullscreen window goes inactive, it automatically // gets minimized. properties.set_minimized(true); - + // It seems order is important here. We must minimize the // window before restoring the display settings, or risk // losing the graphics context. @@ -1483,31 +1482,18 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { adjust_z_order(); system_changed_properties(properties); break; - + case WM_SIZE: if (windisplay_cat.is_debug()) { windisplay_cat.debug() << "WM_SIZE: " << hwnd << ", " << wparam << "\n"; } - // for maximized, unmaximize, need to call resize code - // artificially since no WM_EXITSIZEMOVE is generated. - if (wparam == SIZE_MAXIMIZED) { - _maximized = true; - handle_reshape(); - - } else if (wparam == SIZE_RESTORED && _maximized) { - // SIZE_RESTORED might mean we restored to its original size - // before the maximize, but it might also be called while the - // user is resizing the window by hand. Checking the _maximized - // flag that we set above allows us to differentiate the two - // cases. - _maximized = false; - handle_reshape(); - } + + handle_reshape(); break; case WM_EXITSIZEMOVE: - handle_reshape(); + //handle_reshape(); break; case WM_WINDOWPOSCHANGED: @@ -1526,7 +1512,7 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { _got_expose_event = true; } break; - + case WM_LBUTTONDOWN: if (_lost_keypresses) { resend_lost_keypresses(); diff --git a/panda/src/windisplay/winGraphicsWindow.h b/panda/src/windisplay/winGraphicsWindow.h index a8fe6bd8cd..cbd7c46bb6 100644 --- a/panda/src/windisplay/winGraphicsWindow.h +++ b/panda/src/windisplay/winGraphicsWindow.h @@ -160,7 +160,6 @@ private: bool _ime_open; bool _ime_active; bool _tracking_mouse_leaving; - bool _maximized; bool _bCursor_in_WindowClientArea; HANDLE _input_device_handle[32]; HCURSOR _cursor; From 321555d888c274040c4bbfb1ca3c256c5ea247de Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 16 Sep 2014 13:15:47 +0000 Subject: [PATCH 33/52] Commit patch by Juha Jeronen that fixes SSAO shader to work with ARB profiles. --- direct/src/filter/CommonFilters.py | 60 +++++++++++++++++++++++++++++- direct/src/filter/filter-ssao.sha | 48 ------------------------ 2 files changed, 59 insertions(+), 49 deletions(-) delete mode 100644 direct/src/filter/filter-ssao.sha diff --git a/direct/src/filter/CommonFilters.py b/direct/src/filter/CommonFilters.py index a9836fdca4..3bfb715dcb 100644 --- a/direct/src/filter/CommonFilters.py +++ b/direct/src/filter/CommonFilters.py @@ -39,6 +39,60 @@ float cartoon_thresh = saturate(dot(cartoon_mx - cartoon_mn, float4(3,3,0,0)) - o_color = lerp(o_color, k_cartooncolor, cartoon_thresh); """ +# Some GPUs do not support variable-length loops. +# +# We fill in the actual value of numsamples in the loop limit +# when the shader is configured. +# +SSAO_BODY="""//Cg + +void vshader(float4 vtx_position : POSITION, + out float4 l_position : POSITION, + out float2 l_texcoord : TEXCOORD0, + out float2 l_texcoordD : TEXCOORD1, + out float2 l_texcoordN : TEXCOORD2, + uniform float4 texpad_depth, + uniform float4 texpad_normal, + uniform float4x4 mat_modelproj) +{ + l_position = mul(mat_modelproj, vtx_position); + l_texcoord = vtx_position.xz; + l_texcoordD = (vtx_position.xz * texpad_depth.xy) + texpad_depth.xy; + l_texcoordN = (vtx_position.xz * texpad_normal.xy) + texpad_normal.xy; +} + +float3 sphere[16] = float3[](float3(0.53812504, 0.18565957, -0.43192),float3(0.13790712, 0.24864247, 0.44301823),float3(0.33715037, 0.56794053, -0.005789503),float3(-0.6999805, -0.04511441, -0.0019965635),float3(0.06896307, -0.15983082, -0.85477847),float3(0.056099437, 0.006954967, -0.1843352),float3(-0.014653638, 0.14027752, 0.0762037),float3(0.010019933, -0.1924225, -0.034443386),float3(-0.35775623, -0.5301969, -0.43581226),float3(-0.3169221, 0.106360726, 0.015860917),float3(0.010350345, -0.58698344, 0.0046293875),float3(-0.08972908, -0.49408212, 0.3287904),float3(0.7119986, -0.0154690035, -0.09183723),float3(-0.053382345, 0.059675813, -0.5411899),float3(0.035267662, -0.063188605, 0.54602677),float3(-0.47761092, 0.2847911, -0.0271716)); + +void fshader(out float4 o_color : COLOR, + uniform float4 k_params1, + uniform float4 k_params2, + float2 l_texcoord : TEXCOORD0, + float2 l_texcoordD : TEXCOORD1, + float2 l_texcoordN : TEXCOORD2, + uniform sampler2D k_random : TEXUNIT0, + uniform sampler2D k_depth : TEXUNIT1, + uniform sampler2D k_normal : TEXUNIT2) +{ + float pixel_depth = tex2D(k_depth, l_texcoordD).a; + float3 pixel_normal = (tex2D(k_normal, l_texcoordN).xyz * 2.0 - 1.0); + float3 random_vector = normalize((tex2D(k_random, l_texcoord * 18.0 + pixel_depth + pixel_normal.xy).xyz * 2.0) - float3(1.0)).xyz; + float occlusion = 0.0; + float radius = k_params1.z / pixel_depth; + float depth_difference; + float3 sample_normal; + float3 ray; + for(int i = 0; i < %d; ++i) { + ray = radius * reflect(sphere[i], random_vector); + sample_normal = (tex2D(k_normal, l_texcoordN + ray.xy).xyz * 2.0 - 1.0); + depth_difference = (pixel_depth - tex2D(k_depth,l_texcoordD + ray.xy).r); + occlusion += step(k_params2.y, depth_difference) * (1.0 - dot(sample_normal.xyz, pixel_normal)) * (1.0 - smoothstep(k_params2.y, k_params2.x, depth_difference)); + } + o_color.rgb = 1.0 + (occlusion * k_params1.y); + o_color.a = 1.0; +} +""" + + class FilterConfig: pass @@ -140,7 +194,7 @@ class CommonFilters: self.ssao[0].setShaderInput("depth", self.textures["depth"]) self.ssao[0].setShaderInput("normal", self.textures["aux"]) self.ssao[0].setShaderInput("random", loader.loadTexture("maps/random.rgb")) - self.ssao[0].setShader(self.loadShader("filter-ssao.sha")) + self.ssao[0].setShader(Shader.make(SSAO_BODY % configuration["AmbientOcclusion"].numsamples)) self.ssao[1].setShaderInput("src", ssao0) self.ssao[1].setShader(self.loadShader("filter-blurx.sha")) self.ssao[2].setShaderInput("src", ssao1) @@ -431,6 +485,10 @@ class CommonFilters: def setAmbientOcclusion(self, numsamples = 16, radius = 0.05, amount = 2.0, strength = 0.01, falloff = 0.000002): fullrebuild = (("AmbientOcclusion" in self.configuration) == False) + + if (not fullrebuild): + fullrebuild = (numsamples != self.configuration["AmbientOcclusion"].numsamples) + newconfig = FilterConfig() newconfig.numsamples = numsamples newconfig.radius = radius diff --git a/direct/src/filter/filter-ssao.sha b/direct/src/filter/filter-ssao.sha deleted file mode 100644 index 2faa196bec..0000000000 --- a/direct/src/filter/filter-ssao.sha +++ /dev/null @@ -1,48 +0,0 @@ -//Cg - - -void vshader(float4 vtx_position : POSITION, - out float4 l_position : POSITION, - out float2 l_texcoord : TEXCOORD0, - out float2 l_texcoordD : TEXCOORD1, - out float2 l_texcoordN : TEXCOORD2, - uniform float4 texpad_depth, - uniform float4 texpad_normal, - uniform float4x4 mat_modelproj) -{ - l_position = mul(mat_modelproj, vtx_position); - l_texcoord = vtx_position.xz; - l_texcoordD = (vtx_position.xz * texpad_depth.xy) + texpad_depth.xy; - l_texcoordN = (vtx_position.xz * texpad_normal.xy) + texpad_normal.xy; -} - -float3 sphere[16] = float3[](float3(0.53812504, 0.18565957, -0.43192),float3(0.13790712, 0.24864247, 0.44301823),float3(0.33715037, 0.56794053, -0.005789503),float3(-0.6999805, -0.04511441, -0.0019965635),float3(0.06896307, -0.15983082, -0.85477847),float3(0.056099437, 0.006954967, -0.1843352),float3(-0.014653638, 0.14027752, 0.0762037),float3(0.010019933, -0.1924225, -0.034443386),float3(-0.35775623, -0.5301969, -0.43581226),float3(-0.3169221, 0.106360726, 0.015860917),float3(0.010350345, -0.58698344, 0.0046293875),float3(-0.08972908, -0.49408212, 0.3287904),float3(0.7119986, -0.0154690035, -0.09183723),float3(-0.053382345, 0.059675813, -0.5411899),float3(0.035267662, -0.063188605, 0.54602677),float3(-0.47761092, 0.2847911, -0.0271716)); - -void fshader(out float4 o_color : COLOR, - uniform float4 k_params1, - uniform float4 k_params2, - float2 l_texcoord : TEXCOORD0, - float2 l_texcoordD : TEXCOORD1, - float2 l_texcoordN : TEXCOORD2, - uniform sampler2D k_random : TEXUNIT0, - uniform sampler2D k_depth : TEXUNIT1, - uniform sampler2D k_normal : TEXUNIT2) -{ - float pixel_depth = tex2D(k_depth, l_texcoordD).a; - float3 pixel_normal = (tex2D(k_normal, l_texcoordN).xyz * 2.0 - 1.0); - float3 random_vector = normalize((tex2D(k_random, l_texcoord * 18.0 + pixel_depth + pixel_normal.xy).xyz * 2.0) - float3(1.0)).xyz; - float occlusion = 0.0; - float radius = k_params1.z / pixel_depth; - float depth_difference; - float3 sample_normal; - float3 ray; - for(int i = 0; i < k_params1.x; ++i) { - ray = radius * reflect(sphere[i], random_vector); - sample_normal = (tex2D(k_normal, l_texcoordN + ray.xy).xyz * 2.0 - 1.0); - depth_difference = (pixel_depth - tex2D(k_depth,l_texcoordD + ray.xy).r); - occlusion += step(k_params2.y, depth_difference) * (1.0 - dot(sample_normal.xyz, pixel_normal)) * (1.0 - smoothstep(k_params2.y, k_params2.x, depth_difference)); - } - o_color.rgb = 1.0 + (occlusion * k_params1.y); - o_color.a = 1.0; -} - From 89b824597c0abffabe3bcb9d196b98faf160fa9e Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 16 Sep 2014 13:25:18 +0000 Subject: [PATCH 34/52] fix LP bug 1219422: fix ShaderGenerator errors when LightRampAttrib is in use but no diffuse is present --- panda/src/pgraphnodes/shaderGenerator.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/panda/src/pgraphnodes/shaderGenerator.cxx b/panda/src/pgraphnodes/shaderGenerator.cxx index 434ad240eb..47c8aed5b8 100644 --- a/panda/src/pgraphnodes/shaderGenerator.cxx +++ b/panda/src/pgraphnodes/shaderGenerator.cxx @@ -1160,7 +1160,7 @@ synthesize_shader(const RenderState *rs) { } } const LightRampAttrib *light_ramp = DCAST(LightRampAttrib, rs->get_attrib_def(LightRampAttrib::get_class_slot())); - if(_auto_ramp_on) { + if (_auto_ramp_on && _have_diffuse) { switch (light_ramp->get_mode()) { case LightRampAttrib::LRT_single_threshold: { @@ -1406,7 +1406,7 @@ synthesize_shader(const RenderState *rs) { text << "\t result.rgb = result.rgb + tot_specular.rgb;\n"; } } - if(_auto_ramp_on) { + if (_auto_ramp_on) { const LightRampAttrib *light_ramp = DCAST(LightRampAttrib, rs->get_attrib_def(LightRampAttrib::get_class_slot())); switch (light_ramp->get_mode()) { case LightRampAttrib::LRT_hdr0: From b24adbcad1b0820f10062a475a3a53fbf49085f8 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 16 Sep 2014 14:51:13 +0000 Subject: [PATCH 35/52] Fix issues resizing OpenGL FBOs. Use LVecBase2i for storing buffer size. --- panda/src/display/graphicsBuffer.cxx | 6 ++-- panda/src/display/graphicsBuffer.h | 2 +- panda/src/display/graphicsOutput.I | 35 ++++++++++++++++----- panda/src/display/graphicsOutput.cxx | 22 ++++++------- panda/src/display/graphicsOutput.h | 16 +++++----- panda/src/display/graphicsWindow.cxx | 3 +- panda/src/display/parasiteBuffer.cxx | 36 ++++++++++------------ panda/src/glstuff/glGraphicsBuffer_src.cxx | 19 +++++++----- panda/src/glxdisplay/glxGraphicsBuffer.cxx | 12 ++++---- panda/src/glxdisplay/glxGraphicsPixmap.cxx | 4 +-- 10 files changed, 86 insertions(+), 69 deletions(-) diff --git a/panda/src/display/graphicsBuffer.cxx b/panda/src/display/graphicsBuffer.cxx index 702bc0509f..b98dc38b34 100644 --- a/panda/src/display/graphicsBuffer.cxx +++ b/panda/src/display/graphicsBuffer.cxx @@ -41,19 +41,19 @@ GraphicsBuffer(GraphicsEngine *engine, GraphicsPipe *pipe, << "Creating new offscreen buffer " << get_name() << "\n"; } - _overlay_display_region->compute_pixels(_x_size, _y_size); + _overlay_display_region->compute_pixels(_size.get_x(), _size.get_y()); _open_request = OR_none; } //////////////////////////////////////////////////////////////////// // Function: GraphicsBuffer::Destructor // Access: Published, Virtual -// Description: +// Description: //////////////////////////////////////////////////////////////////// GraphicsBuffer:: ~GraphicsBuffer() { } - + //////////////////////////////////////////////////////////////////// // Function: GraphicsBuffer::set_size // Access: Public, Virtual diff --git a/panda/src/display/graphicsBuffer.h b/panda/src/display/graphicsBuffer.h index 5cda4fa5b5..cf6600347b 100644 --- a/panda/src/display/graphicsBuffer.h +++ b/panda/src/display/graphicsBuffer.h @@ -40,7 +40,7 @@ protected: PUBLISHED: virtual ~GraphicsBuffer(); - void set_size(int x, int y); + virtual void set_size(int x, int y); public: virtual void request_open(); diff --git a/panda/src/display/graphicsOutput.I b/panda/src/display/graphicsOutput.I index c5afb051c7..2b746ff09d 100644 --- a/panda/src/display/graphicsOutput.I +++ b/panda/src/display/graphicsOutput.I @@ -150,6 +150,25 @@ get_rtm_mode(int i) const { return cdata->_textures[i]._rtm_mode; } +//////////////////////////////////////////////////////////////////// +// Function: GraphicsOutput::get_size +// Access: Published +// Description: Returns the visible size of the window or buffer, if +// it is known. In certain cases (e.g. fullscreen +// windows), the size may not be known until after the +// object has been fully created. Check has_size() +// first. +// +// Certain objects (like windows) may change size +// spontaneously; this method is not thread-safe. To +// get the size of a window in a thread-safe manner, +// query get_properties(). +//////////////////////////////////////////////////////////////////// +INLINE const LVecBase2i &GraphicsOutput:: +get_size() const { + return _size; +} + //////////////////////////////////////////////////////////////////// // Function: GraphicsOutput::get_x_size // Access: Published @@ -166,7 +185,7 @@ get_rtm_mode(int i) const { //////////////////////////////////////////////////////////////////// INLINE int GraphicsOutput:: get_x_size() const { - return _x_size; + return _size.get_x(); } //////////////////////////////////////////////////////////////////// @@ -185,7 +204,7 @@ get_x_size() const { //////////////////////////////////////////////////////////////////// INLINE int GraphicsOutput:: get_y_size() const { - return _y_size; + return _size.get_y(); } //////////////////////////////////////////////////////////////////// @@ -198,7 +217,7 @@ get_y_size() const { //////////////////////////////////////////////////////////////////// INLINE int GraphicsOutput:: get_fb_x_size() const { - return max(int(_x_size * get_pixel_factor()), 1); + return max(int(_size.get_x() * get_pixel_factor()), 1); } //////////////////////////////////////////////////////////////////// @@ -211,7 +230,7 @@ get_fb_x_size() const { //////////////////////////////////////////////////////////////////// INLINE int GraphicsOutput:: get_fb_y_size() const { - return max(int(_y_size * get_pixel_factor()), 1); + return max(int(_size.get_y() * get_pixel_factor()), 1); } //////////////////////////////////////////////////////////////////// @@ -226,7 +245,7 @@ get_fb_y_size() const { INLINE int GraphicsOutput:: get_sbs_left_x_size() const { PN_stdfloat left_w = _sbs_left_dimensions[1] - _sbs_left_dimensions[0]; - return max(int(_x_size * left_w), 1); + return max(int(_size.get_x() * left_w), 1); } //////////////////////////////////////////////////////////////////// @@ -241,7 +260,7 @@ get_sbs_left_x_size() const { INLINE int GraphicsOutput:: get_sbs_left_y_size() const { PN_stdfloat left_h = _sbs_left_dimensions[3] - _sbs_left_dimensions[2]; - return max(int(_y_size * left_h), 1); + return max(int(_size.get_y() * left_h), 1); } //////////////////////////////////////////////////////////////////// @@ -256,7 +275,7 @@ get_sbs_left_y_size() const { INLINE int GraphicsOutput:: get_sbs_right_x_size() const { PN_stdfloat right_w = _sbs_right_dimensions[1] - _sbs_right_dimensions[0]; - return max(int(_x_size * right_w), 1); + return max(int(_size.get_x() * right_w), 1); } //////////////////////////////////////////////////////////////////// @@ -271,7 +290,7 @@ get_sbs_right_x_size() const { INLINE int GraphicsOutput:: get_sbs_right_y_size() const { PN_stdfloat right_h = _sbs_right_dimensions[3] - _sbs_right_dimensions[2]; - return max(int(_y_size * right_h), 1); + return max(int(_size.get_y() * right_h), 1); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/display/graphicsOutput.cxx b/panda/src/display/graphicsOutput.cxx index 273c9d9ae7..4fd7ccc435 100644 --- a/panda/src/display/graphicsOutput.cxx +++ b/panda/src/display/graphicsOutput.cxx @@ -78,7 +78,8 @@ GraphicsOutput(GraphicsEngine *engine, GraphicsPipe *pipe, bool default_stereo_flags) : _lock("GraphicsOutput"), _cull_window_pcollector(_cull_pcollector, name), - _draw_window_pcollector(_draw_pcollector, name) + _draw_window_pcollector(_draw_pcollector, name), + _size(0, 0) { #ifdef DO_MEMORY_USAGE MemoryUsage::update_type(this, this); @@ -90,13 +91,11 @@ GraphicsOutput(GraphicsEngine *engine, GraphicsPipe *pipe, _fb_properties = fb_prop; _name = name; _creation_flags = flags; - _x_size = _y_size = 0; _has_size = win_prop.has_size(); _is_nonzero_size = false; if (_has_size) { - _x_size = win_prop.get_x_size(); - _y_size = win_prop.get_y_size(); - _is_nonzero_size = (_x_size > 0 && _y_size > 0); + _size = win_prop.get_size(); + _is_nonzero_size = (_size[0] > 0 && _size[1] > 0); } if (_creation_flags & GraphicsPipe::BF_size_track_host) { // If we're tracking the host size, we assume we'll be nonzero @@ -546,14 +545,14 @@ set_inverted(bool inverted) { if (_inverted != inverted) { _inverted = inverted; - if (_y_size != 0) { + if (get_y_size() != 0) { // All of our DisplayRegions need to recompute their pixel // positions now. TotalDisplayRegions::iterator dri; for (dri = _total_display_regions.begin(); dri != _total_display_regions.end(); ++dri) { - (*dri)->compute_pixels(_x_size, _y_size); + (*dri)->compute_pixels(get_x_size(), get_y_size()); } } } @@ -1102,7 +1101,7 @@ make_cube_map(const string &name, int size, NodePath &camera_rig, NodePath GraphicsOutput:: get_texture_card() { if (_texture_card == 0) { - PT(GeomVertexData) vdata = create_texture_card_vdata(_x_size, _y_size); + PT(GeomVertexData) vdata = create_texture_card_vdata(get_x_size(), get_y_size()); PT(GeomTristrips) strip = new GeomTristrips(Geom::UH_static); strip->set_shade_model(Geom::SM_uniform); strip->add_next_vertices(4); @@ -1262,11 +1261,10 @@ clear_pipe() { //////////////////////////////////////////////////////////////////// void GraphicsOutput:: set_size_and_recalc(int x, int y) { - _x_size = x; - _y_size = y; + _size.set(x, y); _has_size = true; - _is_nonzero_size = (_x_size > 0 && _y_size > 0); + _is_nonzero_size = (x > 0 && y > 0); int fb_x_size = get_fb_x_size(); int fb_y_size = get_fb_y_size(); @@ -1498,7 +1496,7 @@ process_events() { void GraphicsOutput:: pixel_factor_changed() { if (_has_size) { - set_size_and_recalc(_x_size, _y_size); + set_size_and_recalc(get_x_size(), get_y_size()); } } diff --git a/panda/src/display/graphicsOutput.h b/panda/src/display/graphicsOutput.h index f138a64433..7196fc2bcf 100644 --- a/panda/src/display/graphicsOutput.h +++ b/panda/src/display/graphicsOutput.h @@ -128,10 +128,11 @@ PUBLISHED: INLINE RenderTexturePlane get_texture_plane(int i=0) const; INLINE RenderTextureMode get_rtm_mode(int i=0) const; void clear_render_textures(); - void add_render_texture(Texture *tex, RenderTextureMode mode, + void add_render_texture(Texture *tex, RenderTextureMode mode, RenderTexturePlane bitplane=RTP_COUNT); void setup_render_texture(Texture *tex, bool allow_bind, bool to_ram); + INLINE const LVecBase2i &get_size() const; INLINE int get_x_size() const; INLINE int get_y_size() const; INLINE int get_fb_x_size() const; @@ -290,7 +291,7 @@ protected: private: PT(GeomVertexData) create_texture_card_vdata(int x, int y); - + DisplayRegion *add_display_region(DisplayRegion *display_region); bool do_remove_display_region(DisplayRegion *display_region); @@ -323,7 +324,7 @@ protected: RenderTextureMode _rtm_mode; }; typedef pvector RenderTextures; - + private: int _sort; int _child_sort; @@ -346,9 +347,9 @@ protected: // have, we don't auto-close the buffer (since that would deallocate // the memory associated with the texture). pvector _hold_textures; - + protected: - LightMutex _lock; + LightMutex _lock; // protects _display_regions. PT(DisplayRegion) _overlay_display_region; typedef pvector< PT(DisplayRegion) > TotalDisplayRegions; @@ -382,8 +383,7 @@ protected: protected: int _creation_flags; - int _x_size; - int _y_size; + LVecBase2i _size; bool _has_size; bool _is_valid; bool _is_nonzero_size; @@ -394,7 +394,7 @@ protected: static PStatCollector _draw_pcollector; PStatCollector _cull_window_pcollector; PStatCollector _draw_window_pcollector; - + public: static TypeHandle get_class_type() { return _type_handle; diff --git a/panda/src/display/graphicsWindow.cxx b/panda/src/display/graphicsWindow.cxx index 36be7cb270..cd4e3c3e43 100644 --- a/panda/src/display/graphicsWindow.cxx +++ b/panda/src/display/graphicsWindow.cxx @@ -170,8 +170,7 @@ request_properties(const WindowProperties &requested_properties) { // stick. This is helpful for the MultitexReducer, which needs to // know the size of the textures that it will be working with, // even if the texture hasn't been fully generated yet. - _x_size = _requested_properties.get_x_size(); - _y_size = _requested_properties.get_y_size(); + _size = _requested_properties.get_size(); // Don't set _has_size yet, because we don't really know yet. } diff --git a/panda/src/display/parasiteBuffer.cxx b/panda/src/display/parasiteBuffer.cxx index b90f76f070..cd49d18ca8 100644 --- a/panda/src/display/parasiteBuffer.cxx +++ b/panda/src/display/parasiteBuffer.cxx @@ -27,15 +27,15 @@ TypeHandle ParasiteBuffer::_type_handle; ParasiteBuffer:: ParasiteBuffer(GraphicsOutput *host, const string &name, int x_size, int y_size, int flags) : - GraphicsOutput(host->get_engine(), host->get_pipe(), + GraphicsOutput(host->get_engine(), host->get_pipe(), name, host->get_fb_properties(), - WindowProperties::size(x_size, y_size), flags, + WindowProperties::size(x_size, y_size), flags, host->get_gsg(), host, false) { #ifdef DO_MEMORY_USAGE MemoryUsage::update_type(this, this); #endif - + if (display_cat.is_debug()) { display_cat.debug() << "Creating new parasite buffer " << get_name() @@ -43,25 +43,24 @@ ParasiteBuffer(GraphicsOutput *host, const string &name, } _creation_flags = flags; - + if (flags & GraphicsPipe::BF_size_track_host) { - x_size = host->get_x_size(); - y_size = host->get_y_size(); + _size = host->get_size(); + } else { + _size.set(x_size, y_size); } - - _x_size = x_size; - _y_size = y_size; + _has_size = true; - _overlay_display_region->compute_pixels(_x_size, _y_size); + _overlay_display_region->compute_pixels(_size.get_x(), _size.get_y()); _is_valid = true; - + set_inverted(host->get_gsg()->get_copy_texture_inverted()); } //////////////////////////////////////////////////////////////////// // Function: ParasiteBuffer::Destructor // Access: Published, Virtual -// Description: +// Description: //////////////////////////////////////////////////////////////////// ParasiteBuffer:: ~ParasiteBuffer() { @@ -201,19 +200,18 @@ begin_frame(FrameMode mode, Thread *current_thread) { } if (_creation_flags & GraphicsPipe::BF_size_track_host) { - if ((_host->get_x_size() != _x_size)|| - (_host->get_y_size() != _y_size)) { + if (_host->get_size() != _size) { set_size_and_recalc(_host->get_x_size(), _host->get_y_size()); } } else { - if (_host->get_x_size() < _x_size || - _host->get_y_size() < _y_size) { - set_size_and_recalc(min(_x_size, _host->get_x_size()), - min(_y_size, _host->get_y_size())); + if (_host->get_x_size() < get_x_size() || + _host->get_y_size() < get_y_size()) { + set_size_and_recalc(min(get_x_size(), _host->get_x_size()), + min(get_y_size(), _host->get_y_size())); } } - + clear_cube_map_selection(); return true; } diff --git a/panda/src/glstuff/glGraphicsBuffer_src.cxx b/panda/src/glstuff/glGraphicsBuffer_src.cxx index 79de507955..232d33044a 100644 --- a/panda/src/glstuff/glGraphicsBuffer_src.cxx +++ b/panda/src/glstuff/glGraphicsBuffer_src.cxx @@ -155,8 +155,7 @@ begin_frame(FrameMode mode, Thread *current_thread) { } } if (_creation_flags & GraphicsPipe::BF_size_track_host) { - if ((_host->get_x_size() != _x_size)|| - (_host->get_y_size() != _y_size)) { + if (_host->get_size() != _size) { // We also need to rebuild if we need to change size. _needs_rebuild = true; } @@ -277,14 +276,14 @@ rebuild_bitplanes() { // Calculate bitplane size. This can be larger than the buffer. if (_creation_flags & GraphicsPipe::BF_size_track_host) { - if ((_host->get_x_size() != _x_size)|| - (_host->get_y_size() != _y_size)) { + if (_host->get_size() != _size) { set_size_and_recalc(_host->get_x_size(), _host->get_y_size()); } } - int bitplane_x = _x_size; - int bitplane_y = _y_size; + + int bitplane_x = get_x_size(); + int bitplane_y = get_y_size(); if (Texture::get_textures_power_2() != ATS_none) { bitplane_x = Texture::up_to_power_2(bitplane_x); bitplane_y = Texture::up_to_power_2(bitplane_y); @@ -602,7 +601,7 @@ bind_slot(int layer, bool rb_resize, Texture **attach, RenderTexturePlane slot, if (tex->get_texture_type() != Texture::TT_cube_map && _rb_size_z > 1) { tex->set_z_size(_rb_size_z); } - tex->set_pad_size(_rb_size_x - _x_size, _rb_size_y - _y_size); + tex->set_pad_size(_rb_size_x - get_x_size(), _rb_size_y - get_y_size()); // Adjust the texture format based on the requested framebuffer settings. switch (slot) { @@ -1072,6 +1071,10 @@ attach_tex(int layer, int view, Texture *attach, GLenum attachpoint) { gtc->set_active(true); _texture_contexts.push_back(gtc); + // It seems that binding the texture is necessary before binding + // to a framebuffer attachment. + glgsg->apply_texture(gtc); + #ifndef OPENGLES GLclampf priority = 1.0f; glPrioritizeTextures(1, >c->_index, &priority); @@ -1191,7 +1194,7 @@ end_frame(FrameMode mode, Thread *current_thread) { //////////////////////////////////////////////////////////////////// void CLP(GraphicsBuffer):: set_size(int x, int y) { - if (_x_size != x || _y_size != y) { + if (_size.get_x() != x || _size.get_y() != y) { _needs_rebuild = true; } diff --git a/panda/src/glxdisplay/glxGraphicsBuffer.cxx b/panda/src/glxdisplay/glxGraphicsBuffer.cxx index f21a08d62d..1e2ead3f44 100644 --- a/panda/src/glxdisplay/glxGraphicsBuffer.cxx +++ b/panda/src/glxdisplay/glxGraphicsBuffer.cxx @@ -178,7 +178,7 @@ open_buffer() { // new one that shares with the old gsg. DCAST_INTO_R(glxgsg, _gsg, false); - if (!glxgsg->_context_has_pbuffer || + if (!glxgsg->_context_has_pbuffer || !glxgsg->get_fb_properties().subsumes(_fb_properties)) { // We need a new pixel format, and hence a new GSG. glxgsg = new glxGraphicsStateGuardian(_engine, _pipe, glxgsg); @@ -186,7 +186,7 @@ open_buffer() { _gsg = glxgsg; } } - + if (glxgsg->_fbconfig == None || !glxgsg->_context_has_pbuffer) { // If we didn't use an fbconfig to create the GSG, or it doesn't // support buffers, we can't create a PBuffer. @@ -204,15 +204,15 @@ open_buffer() { nassertr(n < max_attrib_list, false); attrib_list[n] = (int)None; _pbuffer = glxgsg->_glXCreateGLXPbufferSGIX(glxgsg->_display, glxgsg->_fbconfig, - _x_size, _y_size, attrib_list); + get_x_size(), get_y_size(), attrib_list); } else { // The official GLX 1.3 version passes in the size in the attrib // list. attrib_list[n++] = GLX_PBUFFER_WIDTH; - attrib_list[n++] = _x_size; + attrib_list[n++] = get_x_size(); attrib_list[n++] = GLX_PBUFFER_HEIGHT; - attrib_list[n++] = _y_size; - + attrib_list[n++] = get_y_size(); + nassertr(n < max_attrib_list, false); attrib_list[n] = (int)None; _pbuffer = glxgsg->_glXCreatePbuffer(glxgsg->_display, glxgsg->_fbconfig, diff --git a/panda/src/glxdisplay/glxGraphicsPixmap.cxx b/panda/src/glxdisplay/glxGraphicsPixmap.cxx index 29585ae324..e98e338df0 100644 --- a/panda/src/glxdisplay/glxGraphicsPixmap.cxx +++ b/panda/src/glxdisplay/glxGraphicsPixmap.cxx @@ -213,8 +213,8 @@ open_buffer() { } } - _x_pixmap = XCreatePixmap(_display, _drawable, - _x_size, _y_size, visual_info->depth); + _x_pixmap = XCreatePixmap(_display, _drawable, + get_x_size(), get_y_size(), visual_info->depth); if (_x_pixmap == None) { glxdisplay_cat.error() << "Failed to create X pixmap.\n"; From 52e79afd4ad5775d6226df2ce3a1e52f5db39286 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 16 Sep 2014 14:53:25 +0000 Subject: [PATCH 36/52] Enable multisampling in FilterManager if main window had multisampling as well --- direct/src/filter/FilterManager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direct/src/filter/FilterManager.py b/direct/src/filter/FilterManager.py index b3500e8014..a7d702918e 100644 --- a/direct/src/filter/FilterManager.py +++ b/direct/src/filter/FilterManager.py @@ -283,7 +283,7 @@ class FilterManager(DirectObject): winprops = WindowProperties() winprops.setSize(xsize, ysize) - props = FrameBufferProperties() + props = FrameBufferProperties(self.win.getFbProperties()) props.setRgbColor(1) props.setDepthBits(depthbits) depthtex, colortex, auxtex0, auxtex1 = texgroup From 579f4c7f478db85f0b83e31cb5a13556c04ca3a3 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 16 Sep 2014 19:40:43 +0000 Subject: [PATCH 37/52] fix compile error --- panda/src/wgldisplay/wglGraphicsBuffer.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/panda/src/wgldisplay/wglGraphicsBuffer.cxx b/panda/src/wgldisplay/wglGraphicsBuffer.cxx index 5fa7095864..def16d8b23 100644 --- a/panda/src/wgldisplay/wglGraphicsBuffer.cxx +++ b/panda/src/wgldisplay/wglGraphicsBuffer.cxx @@ -171,7 +171,8 @@ bind_texture_to_pbuffer() { _pbuffer_bound->release(wglgsg->get_prepared_objects()); _pbuffer_bound = 0; } - tex->set_size_padded(_x_size, _y_size); + tex->set_size_padded(get_x_size(), get_y_size()); + if (tex->get_match_framebuffer_format()) { if (_fb_properties.get_alpha_bits()) { tex->set_format(Texture::F_rgba); @@ -449,19 +450,18 @@ rebuild_bitplanes() { release_pbuffer(); } } - + // Determine what pbuffer attributes are needed // for currently-applicable textures. if ((_host != 0)&&(_creation_flags & GraphicsPipe::BF_size_track_host)) { - if ((_host->get_x_size() != _x_size)|| - (_host->get_y_size() != _y_size)) { + if (_host->get_size() != _size) { set_size_and_recalc(_host->get_x_size(), _host->get_y_size()); } } - int desired_x = _x_size; - int desired_y = _y_size; + int desired_x = get_x_size(); + int desired_y = get_y_size(); if ((bindtexture != 0)&&(Texture::get_textures_power_2() != ATS_none)) { desired_x = Texture::up_to_power_2(desired_x); desired_y = Texture::up_to_power_2(desired_y); @@ -483,7 +483,7 @@ rebuild_bitplanes() { } // Release the old pbuffer, if there was one. - + release_pbuffer(); // Allocate the new pbuffer. From 8b7217b4f9d80284a3b4e9fcb15d34c24add11bd Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 16 Sep 2014 20:44:39 +0000 Subject: [PATCH 38/52] Add an "off" ScissorAttrib, don't apply scissoring to overlay display region so that a full-window clear is truly a full-window clear --- direct/src/filter/FilterManager.py | 41 ++++++++------ panda/src/display/displayRegion.I | 38 +++++++++++++ panda/src/display/displayRegion.cxx | 8 ++- panda/src/display/displayRegion.h | 5 ++ panda/src/display/graphicsOutput.cxx | 1 + .../glstuff/glGraphicsStateGuardian_src.cxx | 56 ++++++++++++------- panda/src/pgraph/scissorAttrib.I | 12 ++++ panda/src/pgraph/scissorAttrib.cxx | 52 +++++++++++++---- panda/src/pgraph/scissorAttrib.h | 7 ++- panda/src/putil/bam.h | 4 +- 10 files changed, 171 insertions(+), 53 deletions(-) diff --git a/direct/src/filter/FilterManager.py b/direct/src/filter/FilterManager.py index a7d702918e..bd14c7c6f6 100644 --- a/direct/src/filter/FilterManager.py +++ b/direct/src/filter/FilterManager.py @@ -42,18 +42,18 @@ class FilterManager(DirectObject): # Create the notify category - if (FilterManager.notify == None): + if FilterManager.notify is None: FilterManager.notify = directNotify.newCategory("FilterManager") # Find the appropriate display region. region = None - for i in range(win.getNumDisplayRegions()): - dr = win.getDisplayRegion(i) + for dr in win.getDisplayRegions(): drcam = dr.getCamera() - if (drcam == cam): region=dr + if drcam == cam: + region = dr - if (region == None): + if region is None: self.notify.error('Could not find appropriate DisplayRegion to filter') return False @@ -218,16 +218,18 @@ class FilterManager(DirectObject): self.region.setCamera(quadcam) - dr = buffer.getDisplayRegion(0) - self.setStackedClears(dr, self.rclears, self.wclears) + self.setStackedClears(buffer, self.rclears, self.wclears) if (auxtex0): - dr.setClearActive(GraphicsOutput.RTPAuxRgba0, 1) - dr.setClearValue(GraphicsOutput.RTPAuxRgba0, Vec4(0.5, 0.5, 1.0, 0.0)) + buffer.setClearActive(GraphicsOutput.RTPAuxRgba0, 1) + buffer.setClearValue(GraphicsOutput.RTPAuxRgba0, Vec4(0.5, 0.5, 1.0, 0.0)) if (auxtex1): - dr.setClearActive(GraphicsOutput.RTPAuxRgba1, 1) + buffer.setClearActive(GraphicsOutput.RTPAuxRgba1, 1) self.region.disableClears() if (self.isFullscreen()): self.win.disableClears() + + dr = buffer.makeDisplayRegion() + dr.disableClears() dr.setCamera(self.camera) dr.setActive(1) @@ -249,7 +251,7 @@ class FilterManager(DirectObject): winx, winy = self.getScaledSize(mul, div, align) depthbits = bool(depthtex != None) - + buffer = self.createBuffer("filter-stage", winx, winy, texgroup, depthbits) if (buffer == None): @@ -269,9 +271,18 @@ class FilterManager(DirectObject): lens.setNearFar(-1000, 1000) quadcamnode.setLens(lens) quadcam = quad.attachNewNode(quadcamnode) - - buffer.getDisplayRegion(0).setCamera(quadcam) - buffer.getDisplayRegion(0).setActive(1) + + dr = buffer.makeDisplayRegion((0, 1, 0, 1)) + dr.disableClears() + dr.setCamera(quadcam) + dr.setActive(True) + dr.setScissorEnabled(False) + + # This clear stage is important if the buffer is padded, so that + # any pixels accidentally sampled in the padded region won't + # be reading from unititialised memory. + buffer.setClearColor((0, 0, 0, 1)) + buffer.setClearColorActive(True) self.buffers.append(buffer) self.sizes.append((mul, div, align)) @@ -307,7 +318,6 @@ class FilterManager(DirectObject): buffer.addRenderTexture(auxtex1, GraphicsOutput.RTMBindOrCopy, GraphicsOutput.RTPAuxRgba1) buffer.setSort(self.nextsort) buffer.disableClears() - buffer.getDisplayRegion(0).disableClears() self.nextsort += 1 return buffer @@ -339,4 +349,3 @@ class FilterManager(DirectObject): self.nextsort = self.win.getSort() - 1000 self.basex = 0 self.basey = 0 - diff --git a/panda/src/display/displayRegion.I b/panda/src/display/displayRegion.I index 1e30c2c55b..5f14074538 100644 --- a/panda/src/display/displayRegion.I +++ b/panda/src/display/displayRegion.I @@ -331,6 +331,32 @@ get_target_tex_page() const { return cdata->_target_tex_page; } +//////////////////////////////////////////////////////////////////// +// Function: DisplayRegion::set_scissor_enabled +// Access: Published +// Description: Sets whether or not scissor testing is enabled +// for this region. The default is true, except for +// the overlay display region. +//////////////////////////////////////////////////////////////////// +INLINE void DisplayRegion:: +set_scissor_enabled(bool scissor_enabled) { + CDWriter cdata(_cycler); + cdata->_scissor_enabled = scissor_enabled; +} + +//////////////////////////////////////////////////////////////////// +// Function: DisplayRegion::get_scissor_enabled +// Access: Published +// Description: Returns whether or not scissor testing is enabled +// for this region. The default is true, except for +// the overlay display region. +//////////////////////////////////////////////////////////////////// +INLINE bool DisplayRegion:: +get_scissor_enabled() const { + CDReader cdata(_cycler); + return cdata->_scissor_enabled; +} + //////////////////////////////////////////////////////////////////// // Function: DisplayRegion::set_cull_callback // Access: Published @@ -941,6 +967,18 @@ get_target_tex_page() const { return _cdata->_target_tex_page; } +//////////////////////////////////////////////////////////////////// +// Function: DisplayRegionPipelineReader::get_scissor_enabled +// Access: Published +// Description: Returns whether or not scissor testing is enabled +// for this region. The default is true, except for +// the overlay display region. +//////////////////////////////////////////////////////////////////// +INLINE bool DisplayRegionPipelineReader:: +get_scissor_enabled() const { + return _cdata->_scissor_enabled; +} + //////////////////////////////////////////////////////////////////// // Function: DisplayRegionPipelineReader::get_draw_callback // Access: Published diff --git a/panda/src/display/displayRegion.cxx b/panda/src/display/displayRegion.cxx index c540d5ac5f..f6a6189737 100644 --- a/panda/src/display/displayRegion.cxx +++ b/panda/src/display/displayRegion.cxx @@ -392,7 +392,7 @@ get_cull_traverser() { // Access: Published, Virtual // Description: This is a special parameter that is only used when // rendering the faces of a cube map or multipage and/or -// multiview texture. +// multiview texture. // // This sets up the DisplayRegion to render to the ith // page and jth view of its associated texture(s); the @@ -832,7 +832,8 @@ CData() : _sort(0), _stereo_channel(Lens::SC_mono), _tex_view_offset(0), - _target_tex_page(-1) + _target_tex_page(-1), + _scissor_enabled(true) { _regions.push_back(Region()); } @@ -852,7 +853,8 @@ CData(const DisplayRegion::CData ©) : _sort(copy._sort), _stereo_channel(copy._stereo_channel), _tex_view_offset(copy._tex_view_offset), - _target_tex_page(copy._target_tex_page) + _target_tex_page(copy._target_tex_page), + _scissor_enabled(copy._scissor_enabled) { } diff --git a/panda/src/display/displayRegion.h b/panda/src/display/displayRegion.h index 2d3dfd1bbe..811b913e5c 100644 --- a/panda/src/display/displayRegion.h +++ b/panda/src/display/displayRegion.h @@ -121,6 +121,9 @@ PUBLISHED: virtual void set_target_tex_page(int page); INLINE int get_target_tex_page() const; + INLINE void set_scissor_enabled(bool scissor_enabled); + INLINE bool get_scissor_enabled() const; + INLINE void set_cull_callback(CallbackObject *object); INLINE void clear_cull_callback(); INLINE CallbackObject *get_cull_callback() const; @@ -224,6 +227,7 @@ private: Lens::StereoChannel _stereo_channel; int _tex_view_offset; int _target_tex_page; + bool _scissor_enabled; PT(CallbackObject) _cull_callback; PT(CallbackObject) _draw_callback; @@ -324,6 +328,7 @@ public: INLINE int get_tex_view_offset(); INLINE bool get_clear_depth_between_eyes() const; INLINE int get_target_tex_page() const; + INLINE bool get_scissor_enabled() const; INLINE CallbackObject *get_draw_callback() const; INLINE void get_pixels(int &pl, int &pr, int &pb, int &pt) const; diff --git a/panda/src/display/graphicsOutput.cxx b/panda/src/display/graphicsOutput.cxx index 4fd7ccc435..78f7c3f429 100644 --- a/panda/src/display/graphicsOutput.cxx +++ b/panda/src/display/graphicsOutput.cxx @@ -151,6 +151,7 @@ GraphicsOutput(GraphicsEngine *engine, GraphicsPipe *pipe, // clear() and get_screenshot(). _overlay_display_region = make_mono_display_region(0.0f, 1.0f, 0.0f, 1.0f); _overlay_display_region->set_active(false); + _overlay_display_region->set_scissor_enabled(false); // Make sure the "active" flag is set true for pipeline stage 0. { diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index dee772d370..3dea898c7b 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -2282,7 +2282,7 @@ clear(DrawableRegion *clearable) { // to be a draw buffer attrib. Until then, this little hack // to put things back the way they were after // prepare_display_region will do. - + set_draw_buffer(_draw_buffer_type); } @@ -2298,7 +2298,7 @@ clear(DrawableRegion *clearable) { } } } - + if (clearable->get_clear_depth_active()) { #ifdef OPENGLES glClearDepthf(clearable->get_clear_depth()); @@ -2369,12 +2369,16 @@ prepare_display_region(DisplayRegionPipelineReader *dr) { _draw_buffer_type |= _current_properties->get_aux_mask(); set_draw_buffer(_draw_buffer_type); - glEnable(GL_SCISSOR_TEST); + if (dr->get_scissor_enabled()) { + glEnable(GL_SCISSOR_TEST); + } else { + glDisable(GL_SCISSOR_TEST); + } if (_supports_viewport_arrays) { int count = dr->get_num_regions(); - GLfloat *viewports = new GLfloat[4 * count]; - GLint *scissors = new GLint[4 * count]; + GLfloat *viewports = (GLfloat *)alloca(sizeof(GLfloat) * 4 * count); + GLint *scissors = (GLint *)alloca(sizeof(GLint) * 4 * count); for (int i = 0; i < count; ++i) { GLint *sr = scissors + i * 4; @@ -2386,13 +2390,15 @@ prepare_display_region(DisplayRegionPipelineReader *dr) { vr[3] = (GLfloat) sr[3]; } _glViewportArrayv(0, count, viewports); - _glScissorArrayv(0, count, scissors); - delete[] viewports; - delete[] scissors; + if (dr->get_scissor_enabled()) { + _glScissorArrayv(0, count, scissors); + } } else { - glScissor(x, y, width, height); glViewport(x, y, width, height); + if (dr->get_scissor_enabled()) { + glScissor(x, y, width, height); + } } report_my_gl_errors(); @@ -11112,7 +11118,6 @@ bind_fbo(GLuint fbo) { _current_fbo = fbo; } - //////////////////////////////////////////////////////////////////// // GL stencil code section //////////////////////////////////////////////////////////////////// @@ -11348,9 +11353,9 @@ do_issue_stencil() { } } - if (stencil -> get_render_state (StencilAttrib::SRS_clear)) { + if (stencil -> get_render_state (StencilAttrib::SRS_clear)) { GLbitfield mask = 0; - + // clear stencil buffer glClearStencil(stencil -> get_render_state (StencilAttrib::SRS_clear_value)); mask |= GL_STENCIL_BUFFER_BIT; @@ -11366,18 +11371,29 @@ do_issue_stencil() { //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::do_issue_scissor // Access: Protected -// Description: +// Description: //////////////////////////////////////////////////////////////////// void CLP(GraphicsStateGuardian):: do_issue_scissor() { const ScissorAttrib *target_scissor = DCAST(ScissorAttrib, _target_rs->get_attrib_def(ScissorAttrib::get_class_slot())); - const LVecBase4 &frame = target_scissor->get_frame(); - int x = (int)(_viewport_x + _viewport_width * frame[0] + 0.5f); - int y = (int)(_viewport_y + _viewport_height * frame[2] + 0.5f); - int width = (int)(_viewport_width * (frame[1] - frame[0]) + 0.5f); - int height = (int)(_viewport_height * (frame[3] - frame[2]) + 0.5f); + if (target_scissor->is_off()) { + if (_current_display_region->get_scissor_enabled()) { + glDisable(GL_SCISSOR_TEST); + } + } else { + if (!_current_display_region->get_scissor_enabled()) { + glEnable(GL_SCISSOR_TEST); + } - glEnable(GL_SCISSOR_TEST); - glScissor(x, y, width, height); + const LVecBase4 &frame = target_scissor->get_frame(); + + int x = (int)(_viewport_x + _viewport_width * frame[0] + 0.5f); + int y = (int)(_viewport_y + _viewport_height * frame[2] + 0.5f); + int width = (int)(_viewport_width * (frame[1] - frame[0]) + 0.5f); + int height = (int)(_viewport_height * (frame[3] - frame[2]) + 0.5f); + + glEnable(GL_SCISSOR_TEST); + glScissor(x, y, width, height); + } } diff --git a/panda/src/pgraph/scissorAttrib.I b/panda/src/pgraph/scissorAttrib.I index d04829cabc..30dc087324 100644 --- a/panda/src/pgraph/scissorAttrib.I +++ b/panda/src/pgraph/scissorAttrib.I @@ -26,6 +26,18 @@ make(PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top) { return make(LVecBase4(left, right, bottom, top)); } +//////////////////////////////////////////////////////////////////// +// Function: ScissorAttrib::is_off +// Access: Published +// Description: Returns true if the ScissorAttrib is an 'off' +// ScissorAttrib, indicating that scissor testing is +// disabled. +//////////////////////////////////////////////////////////////////// +INLINE bool ScissorAttrib:: +is_off() const { + return _off; +} + //////////////////////////////////////////////////////////////////// // Function: ScissorAttrib::get_frame // Access: Published diff --git a/panda/src/pgraph/scissorAttrib.cxx b/panda/src/pgraph/scissorAttrib.cxx index cafc949bc6..24b5111f99 100644 --- a/panda/src/pgraph/scissorAttrib.cxx +++ b/panda/src/pgraph/scissorAttrib.cxx @@ -22,7 +22,7 @@ TypeHandle ScissorAttrib::_type_handle; int ScissorAttrib::_attrib_slot; -CPT(RenderAttrib) ScissorAttrib::_off; +CPT(RenderAttrib) ScissorAttrib::_off_attrib; //////////////////////////////////////////////////////////////////// // Function: ScissorAttrib::Constructor @@ -32,7 +32,8 @@ CPT(RenderAttrib) ScissorAttrib::_off; //////////////////////////////////////////////////////////////////// ScissorAttrib:: ScissorAttrib(const LVecBase4 &frame) : - _frame(frame) + _frame(frame), + _off(false) { // Impose sensible bounds. _frame[0] = max(min(_frame[0], (PN_stdfloat)1.0), (PN_stdfloat)0.0); @@ -49,12 +50,13 @@ ScissorAttrib(const LVecBase4 &frame) : //////////////////////////////////////////////////////////////////// CPT(RenderAttrib) ScissorAttrib:: make_off() { - if (_off != 0) { - return _off; + if (_off_attrib != NULL) { + return _off_attrib; } ScissorAttrib *attrib = new ScissorAttrib(LVecBase4(0.0f, 1.0f, 0.0f, 1.0f)); - _off = return_new(attrib); - return _off; + attrib->_off = true; + _off_attrib = return_new(attrib); + return _off_attrib; } //////////////////////////////////////////////////////////////////// @@ -80,13 +82,14 @@ make(const LVecBase4 &frame) { //////////////////////////////////////////////////////////////////// CPT(RenderAttrib) ScissorAttrib:: make_default() { - return return_new(new ScissorAttrib(LVecBase4(0.0f, 1.0f, 0.0f, 1.0f))); + return make_off(); + //return return_new(new ScissorAttrib(LVecBase4(0.0f, 1.0f, 0.0f, 1.0f))); } //////////////////////////////////////////////////////////////////// // Function: ScissorAttrib::output // Access: Public, Virtual -// Description: +// Description: //////////////////////////////////////////////////////////////////// void ScissorAttrib:: output(ostream &out) const { @@ -112,6 +115,19 @@ int ScissorAttrib:: compare_to_impl(const RenderAttrib *other) const { const ScissorAttrib *ta; DCAST_INTO_R(ta, other, 0); + + if (!_off && !ta->_off) { + return 0; + } + + if (_off && !ta->_off) { + return -1; + } + + if (!_off && ta->_off) { + return 1; + } + return _frame.compare_to(ta->_frame); } @@ -128,7 +144,9 @@ compare_to_impl(const RenderAttrib *other) const { size_t ScissorAttrib:: get_hash_impl() const { size_t hash = 0; - hash = _frame.add_hash(hash); + if (!_off) { + hash = _frame.add_hash(hash); + } return hash; } @@ -151,14 +169,22 @@ get_hash_impl() const { //////////////////////////////////////////////////////////////////// CPT(RenderAttrib) ScissorAttrib:: compose_impl(const RenderAttrib *other) const { + if (_off) { + return other; + } + const ScissorAttrib *ta; DCAST_INTO_R(ta, other, 0); + if (ta->_off) { + return this; + } + LVecBase4 new_frame(max(ta->_frame[0], _frame[0]), min(ta->_frame[1], _frame[1]), max(ta->_frame[2], _frame[2]), min(ta->_frame[3], _frame[3])); - + ScissorAttrib *attrib = new ScissorAttrib(new_frame); return return_new(attrib); } @@ -185,6 +211,7 @@ write_datagram(BamWriter *manager, Datagram &dg) { RenderAttrib::write_datagram(manager, dg); _frame.write_datagram(dg); + dg.add_bool(_off); } //////////////////////////////////////////////////////////////////// @@ -219,4 +246,9 @@ fillin(DatagramIterator &scan, BamReader *manager) { RenderAttrib::fillin(scan, manager); _frame.read_datagram(scan); + _off = false; + + if (manager->get_file_minor_ver() >= 34) { + _off = scan.get_bool(); + } } diff --git a/panda/src/pgraph/scissorAttrib.h b/panda/src/pgraph/scissorAttrib.h index 0004ccc7c2..e3e63f6685 100644 --- a/panda/src/pgraph/scissorAttrib.h +++ b/panda/src/pgraph/scissorAttrib.h @@ -48,6 +48,8 @@ PUBLISHED: static CPT(RenderAttrib) make(const LVecBase4 &frame); static CPT(RenderAttrib) make_default(); + INLINE bool is_off() const; + INLINE const LVecBase4 &get_frame() const; public: @@ -60,7 +62,8 @@ protected: private: LVecBase4 _frame; - static CPT(RenderAttrib) _off; + bool _off; + static CPT(RenderAttrib) _off_attrib; PUBLISHED: static int get_class_slot() { @@ -77,7 +80,7 @@ public: protected: static TypedWritable *make_from_bam(const FactoryParams ¶ms); void fillin(DatagramIterator &scan, BamReader *manager); - + public: static TypeHandle get_class_type() { return _type_handle; diff --git a/panda/src/putil/bam.h b/panda/src/putil/bam.h index 2f1907f36b..cbc4e583f4 100644 --- a/panda/src/putil/bam.h +++ b/panda/src/putil/bam.h @@ -33,7 +33,7 @@ static const unsigned short _bam_major_ver = 6; // Bumped to major version 6 on 2/11/06 to factor out PandaNode::CData. static const unsigned short _bam_first_minor_ver = 14; -static const unsigned short _bam_minor_ver = 33; +static const unsigned short _bam_minor_ver = 34; // Bumped to minor version 14 on 12/19/07 to change default ColorAttrib. // Bumped to minor version 15 on 4/9/08 to add TextureAttrib::_implicit_sort. // Bumped to minor version 16 on 5/13/08 to add Texture::_quality_level. @@ -54,6 +54,6 @@ static const unsigned short _bam_minor_ver = 33; // Bumped to minor version 31 on 2/16/12 to add DepthOffsetAttrib::_min_value, _max_value. // Bumped to minor version 32 on 6/11/12 to add Texture::_has_read_mipmaps. // Bumped to minor version 33 on 8/17/13 to add UvScrollNode::_w_speed. - +// Bumped to minor version 34 on 9/16/14 to add ScissorAttrib::_off. #endif From dc384942b656964f2d89549089009663e3a998f7 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 16 Sep 2014 21:25:54 +0000 Subject: [PATCH 39/52] oops, don't ask for a back buffer --- direct/src/filter/FilterManager.py | 1 + 1 file changed, 1 insertion(+) diff --git a/direct/src/filter/FilterManager.py b/direct/src/filter/FilterManager.py index bd14c7c6f6..213091906a 100644 --- a/direct/src/filter/FilterManager.py +++ b/direct/src/filter/FilterManager.py @@ -295,6 +295,7 @@ class FilterManager(DirectObject): winprops = WindowProperties() winprops.setSize(xsize, ysize) props = FrameBufferProperties(self.win.getFbProperties()) + props.setBackBuffers(0) props.setRgbColor(1) props.setDepthBits(depthbits) depthtex, colortex, auxtex0, auxtex1 = texgroup From 4be5346a1a82e21a1fd89f51fe7aea39a18a197e Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 17 Sep 2014 21:01:49 +0000 Subject: [PATCH 40/52] Creating a TypeHandle from Python should properly initialize it to TypeHandle::none() --- panda/src/express/config_express.N | 2 ++ 1 file changed, 2 insertions(+) diff --git a/panda/src/express/config_express.N b/panda/src/express/config_express.N index e4440cdffd..823d65541e 100644 --- a/panda/src/express/config_express.N +++ b/panda/src/express/config_express.N @@ -1,3 +1,5 @@ +defconstruct TypeHandle new TypeHandle(TypeHandle::none()) + forcetype PandaSystem forcetype DSearchPath forcetype DSearchPath::Results From 30d8cc29b335dda09853a27feec1874d96074ed7 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 19 Sep 2014 15:14:11 +0000 Subject: [PATCH 41/52] Rewrite handling of stringify and token-paste operators to work better. Add support for variadic macros. --- dtool/src/cppparser/cppManifest.cxx | 212 ++++++++++++--- dtool/src/cppparser/cppManifest.h | 9 +- dtool/src/cppparser/cppPreprocessor.cxx | 334 +++++++++++++----------- dtool/src/cppparser/cppPreprocessor.h | 5 +- 4 files changed, 367 insertions(+), 193 deletions(-) diff --git a/dtool/src/cppparser/cppManifest.cxx b/dtool/src/cppparser/cppManifest.cxx index 30964deca5..1b4f2c845d 100644 --- a/dtool/src/cppparser/cppManifest.cxx +++ b/dtool/src/cppparser/cppManifest.cxx @@ -24,8 +24,8 @@ // Description: //////////////////////////////////////////////////////////////////// CPPManifest::ExpansionNode:: -ExpansionNode(int parm_number) : - _parm_number(parm_number) +ExpansionNode(int parm_number, bool stringify, bool paste) : + _parm_number(parm_number), _stringify(stringify), _paste(paste) { } @@ -35,8 +35,8 @@ ExpansionNode(int parm_number) : // Description: //////////////////////////////////////////////////////////////////// CPPManifest::ExpansionNode:: -ExpansionNode(const string &str) : - _parm_number(-1), _str(str) +ExpansionNode(const string &str, bool paste) : + _parm_number(-1), _stringify(false), _paste(paste), _str(str) { } @@ -46,7 +46,11 @@ ExpansionNode(const string &str) : // Description: //////////////////////////////////////////////////////////////////// CPPManifest:: -CPPManifest(const string &args, const CPPFile &file) : _file(file) { +CPPManifest(const string &args, const CPPFile &file) : + _file(file), + _variadic_param(-1), + _expr((CPPExpression *)NULL) +{ assert(!args.empty()); assert(!isspace(args[0])); @@ -69,6 +73,7 @@ CPPManifest(const string &args, const CPPFile &file) : _file(file) { _has_parameters = true; parse_parameters(args, p, parameter_names); _num_parameters = parameter_names.size(); + p++; } else { _has_parameters = false; @@ -83,7 +88,6 @@ CPPManifest(const string &args, const CPPFile &file) : _file(file) { save_expansion(args.substr(p), parameter_names); } - //////////////////////////////////////////////////////////////////// // Function: CPPManifest::Destructor // Access: Public @@ -96,7 +100,58 @@ CPPManifest:: } } +//////////////////////////////////////////////////////////////////// +// Function: CPPManifest::stringify +// Access: Public, Static +// Description: This implements the stringification operator, #. +//////////////////////////////////////////////////////////////////// +string CPPManifest:: +stringify(const string &source) { + string result("\""); + enum { + S_escaped = 0x01, + S_single_quoted = 0x02, + S_double_quoted = 0x04, + S_quoted = 0x06, + }; + int state = 0; + + string::const_iterator it; + for (it = source.begin(); it != source.end(); ++it) { + char c = *it; + + if ((state & S_escaped) == 0) { + switch (c) { + case '\\': + if (state & S_quoted) { + state |= S_escaped; + result += '\\'; + } + break; + + case '\'': + state ^= S_single_quoted; + break; + + case '"': + state ^= S_double_quoted; + result += '\\'; + break; + } + } else { + if (c == '\\' || c == '"') { + result += '\\'; + } + state &= ~S_escaped; + } + + result += c; + } + + result += '"'; + return result; +} //////////////////////////////////////////////////////////////////// // Function: CPPManifest::expand @@ -111,14 +166,45 @@ expand(const vector_string &args) const { for (ei = _expansion.begin(); ei != _expansion.end(); ++ei) { if ((*ei)._parm_number >= 0) { int i = (*ei)._parm_number; + + string subst; if (i < (int)args.size()) { - result += " " + args[i] + " "; - } else { - result += " "; + subst = args[i]; + + if (i == _variadic_param) { + for (++i; i < (int)args.size(); ++i) { + subst += ", " + args[i]; + } + } + if ((*ei)._stringify) { + subst = stringify(subst); + } + } else if (i == _variadic_param && (*ei)._paste) { + // Special case GCC behavior: if __VA_ARGS__ is pasted + // to a comma and no arguments are passed, the comma + // is removed. MSVC does this automatically. Not sure + // if we should allow MSVC behavior as well. + if (*result.rbegin() == ',') { + result.resize(result.size() - 1); + } + } + + if (!subst.empty()) { + if (result.empty() || (*ei)._paste) { + result += subst; + } else { + result += ' '; + result += subst; + } } } if (!(*ei)._str.empty()) { - result += (*ei)._str; + if (result.empty() || (*ei)._paste) { + result += (*ei)._str; + } else { + result += ' '; + result += (*ei)._str; + } } } @@ -151,20 +237,40 @@ output(ostream &out) const { if (_has_parameters) { out << "("; if (_num_parameters > 0) { - out << "$1"; + if (_variadic_param == 0) { + out << "..."; + } else { + out << "$1"; + } + for (int i = 1; i < _num_parameters; ++i) { - out << ", $" << i + 1; + if (_variadic_param == i) { + out << ", ..."; + } else { + out << ", $" << i + 1; + } } } out << ")"; } - out << " "; - Expansion::const_iterator ei; for (ei = _expansion.begin(); ei != _expansion.end(); ++ei) { + if ((*ei)._paste) { + out << " ## "; + } else { + out << " "; + } + if ((*ei)._parm_number >= 0) { - out << " $" << (*ei)._parm_number + 1 << " "; + if (stringify) { + out << "#"; + } + if ((*ei)._parm_number == _variadic_param) { + out << "__VA_ARGS__"; + } else { + out << "$" << (*ei)._parm_number + 1; + } } if (!(*ei)._str.empty()) { out << (*ei)._str; @@ -172,8 +278,6 @@ output(ostream &out) const { } } - - //////////////////////////////////////////////////////////////////// // Function: CPPManifest::parse_parameters // Access: Private @@ -197,7 +301,16 @@ parse_parameters(const string &args, size_t &p, args[p] != ')' && args[p] != ',') { p++; } - parameter_names.push_back(args.substr(q, p - q)); + + // Check if it's a variadic parameter by checking if it ends + // with "...". This picks up both C99-style variadic macros + // and GCC-style variadic macros. + if (p - q >= 3 && args.compare(p - 3, 3, "...") == 0) { + _variadic_param = parameter_names.size(); + parameter_names.push_back(args.substr(q, p - q - 3)); + } else { + parameter_names.push_back(args.substr(q, p - q)); + } // Skip whitespace after the parameter name. while (p < args.size() && isspace(args[p])) { @@ -221,16 +334,12 @@ parse_parameters(const string &args, size_t &p, //////////////////////////////////////////////////////////////////// void CPPManifest:: save_expansion(const string &exp, const vector_string ¶meter_names) { - if (parameter_names.empty()) { - // No parameters; this is an easy case. - _expansion.push_back(ExpansionNode(exp)); - return; - } - // Walk through the expansion string. For each substring that is an // identifier, check it against parameter_names. size_t p = 0; size_t last = 0; + bool stringify = false; + bool paste = false; while (p < exp.size()) { if (isalpha(exp[p]) || exp[p] == '_') { // Here's the start of an identifier. Find the end of it. @@ -244,26 +353,67 @@ save_expansion(const string &exp, const vector_string ¶meter_names) { // Is this identifier one of our parameters? int pnum = -1; - for (int i = 0; pnum == -1 && i < (int)parameter_names.size(); ++i) { - if (parameter_names[i] == ident) { - pnum = i; + bool va_args = false; + + if (ident == "__VA_ARGS__") { + va_args = true; + // C99-style variadics, ie. #define macro(...) __VA_ARGS__ + pnum = _variadic_param; + + } else { + for (int i = 0; pnum == -1 && i < (int)parameter_names.size(); ++i) { + const string &pname = parameter_names[i]; + if (pname == ident) { + pnum = i; + } } } if (pnum != -1) { // Yep! if (last != q) { - _expansion.push_back(ExpansionNode(exp.substr(last, q - last))); + _expansion.push_back(ExpansionNode(exp.substr(last, q - last), paste)); + paste = false; } - _expansion.push_back(pnum); + _expansion.push_back(ExpansionNode(pnum, stringify, paste)); + stringify = false; + paste = false; last = p; } + } else if (exp[p] == '#') { + // This may be a stringification operator. + if (last != p) { + _expansion.push_back(ExpansionNode(exp.substr(last, p - last), paste)); + paste = false; + } + + ++p; + + if (p < exp.size() && exp[p] == '#') { + // Woah, this is a token-pasting operator. + paste = true; + ++p; + } else { + // Mark that the next argument should be stringified. + stringify = true; + } + last = p; + + } else if (isspace(exp[p])) { + if (last != p) { + _expansion.push_back(ExpansionNode(exp.substr(last, p - last), paste)); + paste = false; + } + + ++p; + last = p; + } else { - p++; + ++p; } } if (last != p) { - _expansion.push_back(exp.substr(last, p - last)); + _expansion.push_back(ExpansionNode(exp.substr(last, p - last), paste)); } } diff --git a/dtool/src/cppparser/cppManifest.h b/dtool/src/cppparser/cppManifest.h index dc0c6be822..5717ad408a 100644 --- a/dtool/src/cppparser/cppManifest.h +++ b/dtool/src/cppparser/cppManifest.h @@ -33,6 +33,8 @@ class CPPManifest { public: CPPManifest(const string &args, const CPPFile &file = CPPFile()); ~CPPManifest(); + + static string stringify(const string &source); string expand(const vector_string &args = vector_string()) const; CPPType *determine_type() const; @@ -42,6 +44,7 @@ public: string _name; bool _has_parameters; int _num_parameters; + int _variadic_param; CPPFile _file; CPPExpression *_expr; @@ -59,9 +62,11 @@ private: class ExpansionNode { public: - ExpansionNode(int parm_number); - ExpansionNode(const string &str); + ExpansionNode(int parm_number, bool stringify, bool paste); + ExpansionNode(const string &str, bool paste = false); int _parm_number; + bool _stringify; + bool _paste; string _str; }; typedef vector Expansion; diff --git a/dtool/src/cppparser/cppPreprocessor.cxx b/dtool/src/cppparser/cppPreprocessor.cxx index 9715c26b8f..9e0690e952 100644 --- a/dtool/src/cppparser/cppPreprocessor.cxx +++ b/dtool/src/cppparser/cppPreprocessor.cxx @@ -315,23 +315,6 @@ get_next_token0() { int first_col = token._lloc.first_column; CPPFile first_file = token._lloc.file; - if (token._token == '#') { - // Stringify. - token = internal_get_next_token(); - if (token._token == SIMPLE_IDENTIFIER || - token._token == INTEGER || - token._token == REAL || - token._token == STRING) { - token._token = STRING; - } else { - // Stringify nothing. - - _saved_tokens.push_back(token); - token._token = STRING; - token._lval.str = ""; - } - } - if (_resolve_identifiers && (token._token == SIMPLE_IDENTIFIER || token._token == SCOPE)) { // We will be returning a scoped identifier, or a scoping. Keep @@ -366,59 +349,41 @@ get_next_token0() { } } - while (token._token == SCOPE || token._token == TOKENPASTE) { - if (token._token == TOKENPASTE) { - // The token-pasting operator creates one continuous - // identifier across whitespace. - token = internal_get_next_token(); - if (token._token == SIMPLE_IDENTIFIER || - token._token == INTEGER || - token._token == REAL) { - name += token._lval.str; - ident->_names.back().append_name(token._lval.str); - - token = internal_get_next_token(); - - } else { - // Token-paste with nothing. - } - - } else { // token._token == SCOPE - name += "::"; - token = internal_get_next_token(); - string token_prefix; - - if (token._token == '~') { - // A scoping operator followed by a tilde can only be the - // start of a scoped destructor name. Make the tilde be part - // of the name. - name += "~"; - token_prefix = "~"; - token = internal_get_next_token(); - } - - if (token._token != SIMPLE_IDENTIFIER) { - // The last useful token was a SCOPE, thus this is a scoping - // token. - - if (token._token == KW_OPERATOR) { - // Unless the last token we came across was the "operator" - // keyword. We make a special case for this, because it's - // occasionally scoped in normal use. - token._lval = result; - return token; - } - _saved_tokens.push_back(token); - return CPPToken(SCOPING, first_line, first_col, first_file, - name, result); - } - - name += token._lval.str; - ident->_names.push_back(token_prefix + token._lval.str); + while (token._token == SCOPE) { + name += "::"; + token = internal_get_next_token(); + string token_prefix; + if (token._token == '~') { + // A scoping operator followed by a tilde can only be the + // start of a scoped destructor name. Make the tilde be part + // of the name. + name += "~"; + token_prefix = "~"; token = internal_get_next_token(); } + if (token._token != SIMPLE_IDENTIFIER) { + // The last useful token was a SCOPE, thus this is a scoping + // token. + + if (token._token == KW_OPERATOR) { + // Unless the last token we came across was the "operator" + // keyword. We make a special case for this, because it's + // occasionally scoped in normal use. + token._lval = result; + return token; + } + _saved_tokens.push_back(token); + return CPPToken(SCOPING, first_line, first_col, first_file, + name, result); + } + + name += token._lval.str; + ident->_names.push_back(token_prefix + token._lval.str); + + token = internal_get_next_token(); + if (token._token == '<') { // If the next token is an angle bracket and the current // indentifier wants template instantiation, assume the angle @@ -887,11 +852,6 @@ internal_get_next_token() { case '%': if (next_c == '=') return CPPToken(MODEQUAL, first_line, first_col, first_file); break; - - // These are actually preprocessor operators, but it's useful to - // treat them as tokens. - case '#': - if (next_c == '#') return CPPToken(TOKENPASTE, first_line, first_col, first_file); } // It wasn't any of the two- or three-character tokens, so put back @@ -945,11 +905,13 @@ skip_whitespace(int c) { c = skip_comment(c); if (c == '\\') { - // A backslash character is an unusual thing to encounter in the - // middle of unquoted C++ code. But it seems to be legal, and - // it seems to mean the same thing it does within quotes: to - // escape the following character. We simply ignore it. + // This does not usually occur in the middle of unquoted C++ + // code, except before a newline character. c = get(); + if (c != '\n') { + unget(c); + return '\\'; + } } if (!isspace(c)) { @@ -1633,7 +1595,8 @@ expand_manifest(const CPPManifest *manifest) { if (manifest->_has_parameters) { // Hmm, we're expecting arguments. - extract_manifest_args(manifest->_name, manifest->_num_parameters, args); + extract_manifest_args(manifest->_name, manifest->_num_parameters, + manifest->_variadic_param, args); } string expanded = " " + manifest->expand(args) + " "; @@ -1659,7 +1622,7 @@ expand_manifest(const CPPManifest *manifest) { // Description: //////////////////////////////////////////////////////////////////// void CPPPreprocessor:: -extract_manifest_args(const string &name, int num_args, +extract_manifest_args(const string &name, int num_args, int va_arg, vector_string &args) { CPPFile first_file = get_file(); int first_line = get_line_number(); @@ -1683,12 +1646,14 @@ extract_manifest_args(const string &name, int num_args, } else { // Skip paren. - c = get(); + c = skip_whitespace(get()); + int paren_level = 1; string arg; - while (c != EOF && c != ')') { - if (c == ',') { + while (c != EOF) { + if (c == ',' && paren_level == 1) { args.push_back(arg); arg = ""; + c = get(); } else if (c == '"' || c == '\'') { // Quoted string or character. @@ -1706,35 +1671,55 @@ extract_manifest_args(const string &name, int num_args, } } arg += c; + c = get(); } else if (c == '(') { - // Nested parens. - int paren_level = 1; - while (c != EOF && paren_level > 0) { - arg += c; - c = get(); - if (c == '(') { - paren_level++; - } else if (c == ')') { - paren_level--; - } + arg += '('; + ++paren_level; + c = get(); + + } else if (c == ')') { + --paren_level; + if (paren_level == 0) { + break; } - if (c != EOF) { - arg += c; + arg += ')'; + c = get(); + + } else if (isspace(c)) { + // Skip extra whitespace. + c = skip_whitespace(c); + if (!arg.empty()) { + arg += ' '; + } + + } else if (c == '\\') { + // It could be a slash before a newline. + // If so, that's whitespace as well. + c = get(); + if (c != '\n') { + arg += '\\'; + } else if (!arg.empty()) { + arg += ' '; + c = skip_whitespace(get()); } } else { arg += c; + c = get(); } - c = get(); } if (num_args != 0 || !arg.empty()) { args.push_back(arg); } } - if ((int)args.size() != num_args) { - warning("Wrong number of arguments for manifest " + name, + if ((int)args.size() < num_args) { + warning("Not enough arguments for manifest " + name, + first_line, first_col, first_file); + + } else if (va_arg < 0 && (int)args.size() > num_args) { + warning("Too many arguments for manifest " + name, first_line, first_col, first_file); } } @@ -1742,14 +1727,15 @@ extract_manifest_args(const string &name, int num_args, //////////////////////////////////////////////////////////////////// // Function: CPPPreprocessor::expand_defined_function // Access: Private -// Description: +// Description: Expands the defined(manifest) function to either +// 1 or 0, depending on whether the manifest exists. //////////////////////////////////////////////////////////////////// void CPPPreprocessor:: expand_defined_function(string &expr, size_t q, size_t &p) { string result; vector_string args; - extract_manifest_args_inline("defined", 1, args, expr, p); + extract_manifest_args_inline("defined", 1, -1, args, expr, p); if (args.size() >= 1) { const string &manifest_name = args[0]; Manifests::const_iterator mi = _manifests.find(manifest_name); @@ -1777,7 +1763,7 @@ expand_manifest_inline(string &expr, size_t q, size_t &p, vector_string args; if (manifest->_has_parameters) { extract_manifest_args_inline(manifest->_name, manifest->_num_parameters, - args, expr, p); + manifest->_variadic_param, args, expr, p); } string result = manifest->expand(args); @@ -1792,7 +1778,7 @@ expand_manifest_inline(string &expr, size_t q, size_t &p, //////////////////////////////////////////////////////////////////// void CPPPreprocessor:: extract_manifest_args_inline(const string &name, int num_args, - vector_string &args, + int va_arg, vector_string &args, const string &expr, size_t &p) { // Skip whitespace till paren. while (p < expr.size() && isspace(expr[p])) { @@ -1819,7 +1805,7 @@ extract_manifest_args_inline(const string &name, int num_args, } } p++; - + } else { // Skip paren. p++; @@ -1850,8 +1836,11 @@ extract_manifest_args_inline(const string &name, int num_args, } } - if ((int)args.size() != num_args) { - warning("Wrong number of arguments for manifest " + name); + if ((int)args.size() < num_args) { + warning("Not enough arguments for manifest " + name); + + } else if (va_arg < 0 && (int)args.size() > num_args) { + warning("Too many arguments for manifest " + name); } } @@ -2035,6 +2024,90 @@ check_keyword(const string &name) { return 0; } +//////////////////////////////////////////////////////////////////// +// Function: CPPPreprocessor::scan_escape_sequence +// Access: Private +// Description: +//////////////////////////////////////////////////////////////////// +int CPPPreprocessor:: +scan_escape_sequence(int c) { + if (c != '\\') { + return c; + } + + c = get(); + switch (c) { + case 'a': + return '\a'; + + case 'b': + return '\b'; + + case 'f': + return '\f'; + + case 'n': + return '\n'; + + case 'r': + return '\r'; + + case 't': + return '\t'; + + case 'v': + return '\v'; + + case 'e': + // \e is non-standard, buT GCC supports it. + return '\x1B'; + + case 'x': + // hex character. + c = get(); + if (isxdigit(c)) { + int val = hex_val(c); + c = get(); + if (isxdigit(c)) { + val = (val << 4) | hex_val(c); + } else { + unget(c); + } + return val; + } + break; + + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + // Octal character. + { + int val = (c - '0'); + c = get(); + if (c >= '0' && c <= '7') { + val = (val << 3) | (c - '0'); + c = get(); + if (c >= '0' && c <= '7') { + val = (val << 3) | (c - '0'); + } else { + unget(c); + } + } else { + unget(c); + } + return val; + } + } + + // Simply output the following character. + return c; +} + //////////////////////////////////////////////////////////////////// // Function: CPPPreprocessor::scan_quoted // Access: Private @@ -2049,62 +2122,7 @@ scan_quoted(int c) { while (c != EOF && c != '\n' && c != quote_mark) { if (c == '\\') { // Backslash means a special character follows. - c = get(); - switch (c) { - case 'n': - c = '\n'; - break; - - case 't': - c = '\t'; - break; - - case 'r': - c = '\r'; - break; - - case 'x': - // hex character. - c = get(); - if (isxdigit(c)) { - int val = hex_val(c); - c = get(); - if (isxdigit(c)) { - val = (val << 4) | hex_val(c); - } else { - unget(c); - } - c = val; - } - break; - - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - // Octal character. - { - int val = (c - '0'); - c = get(); - if (c >= '0' && c <= '7') { - val = (val << 3) | (c - '0'); - c = get(); - if (c >= '0' && c <= '7') { - val = (val << 3) | (c - '0'); - } else { - unget(c); - } - } else { - unget(c); - } - c = val; - } - break; - } + c = scan_escape_sequence(c); } str += c; diff --git a/dtool/src/cppparser/cppPreprocessor.h b/dtool/src/cppparser/cppPreprocessor.h index b73953fdf3..48a9dafa0b 100644 --- a/dtool/src/cppparser/cppPreprocessor.h +++ b/dtool/src/cppparser/cppPreprocessor.h @@ -142,16 +142,17 @@ private: CPPToken get_identifier(int c); CPPToken expand_manifest(const CPPManifest *manifest); void extract_manifest_args(const string &name, int num_args, - vector_string &args); + int va_arg, vector_string &args); void expand_defined_function(string &expr, size_t q, size_t &p); void expand_manifest_inline(string &expr, size_t q, size_t &p, const CPPManifest *manifest); void extract_manifest_args_inline(const string &name, int num_args, - vector_string &args, + int va_arg, vector_string &args, const string &expr, size_t &p); CPPToken get_number(int c, int c2 = 0); static int check_keyword(const string &name); + int scan_escape_sequence(int c); string scan_quoted(int c); bool should_ignore_manifest(const CPPManifest *manifest) const; From 8afd8b1f57e12e442dd72ece6066c718b79a82ff Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 19 Sep 2014 15:18:08 +0000 Subject: [PATCH 42/52] interrogatedb v2.3: elements can have comments --- dtool/src/interrogate/interrogateBuilder.cxx | 6 ++++++ .../src/interrogatedb/interrogateDatabase.cxx | 2 +- dtool/src/interrogatedb/interrogateElement.I | 21 +++++++++++++++++++ .../src/interrogatedb/interrogateElement.cxx | 5 +++++ dtool/src/interrogatedb/interrogateElement.h | 4 ++++ 5 files changed, 37 insertions(+), 1 deletion(-) diff --git a/dtool/src/interrogate/interrogateBuilder.cxx b/dtool/src/interrogate/interrogateBuilder.cxx index 1d1a3e868d..56ba78e345 100644 --- a/dtool/src/interrogate/interrogateBuilder.cxx +++ b/dtool/src/interrogate/interrogateBuilder.cxx @@ -1357,6 +1357,11 @@ scan_element(CPPInstance *element, CPPStructType *struct_type, ielement._name = element->get_local_name(scope); ielement._scoped_name = descope(element->get_local_name(&parser)); + // See if there happens to be a comment before the element. + if (element->_leading_comment != (CPPCommentBlock *)NULL) { + ielement._comment = trim_blanks(element->_leading_comment->_comment); + } + ielement._type = get_type(TypeManager::unwrap_reference(element_type), false); if (ielement._type == 0) { // If we can't understand what type it is, forget it. @@ -1641,6 +1646,7 @@ get_function(CPPInstance *function, string description, CPPStructType *struct_type, CPPScope *scope, int flags, const string &expression) { + // Get a unique function signature. Make sure we tell the function // where its native scope is, so we get a fully-scoped signature. diff --git a/dtool/src/interrogatedb/interrogateDatabase.cxx b/dtool/src/interrogatedb/interrogateDatabase.cxx index 69499f8dbc..c800b81ed3 100644 --- a/dtool/src/interrogatedb/interrogateDatabase.cxx +++ b/dtool/src/interrogatedb/interrogateDatabase.cxx @@ -21,7 +21,7 @@ InterrogateDatabase *InterrogateDatabase::_global_ptr = NULL; int InterrogateDatabase::_file_major_version = 0; int InterrogateDatabase::_file_minor_version = 0; int InterrogateDatabase::_current_major_version = 2; -int InterrogateDatabase::_current_minor_version = 2; +int InterrogateDatabase::_current_minor_version = 3; //////////////////////////////////////////////////////////////////// // Function: InterrogateDatabase::Constructor diff --git a/dtool/src/interrogatedb/interrogateElement.I b/dtool/src/interrogatedb/interrogateElement.I index 9faa823077..5f9cca0b52 100644 --- a/dtool/src/interrogatedb/interrogateElement.I +++ b/dtool/src/interrogatedb/interrogateElement.I @@ -48,6 +48,7 @@ operator = (const InterrogateElement ©) { InterrogateComponent::operator = (copy); _flags = copy._flags; _scoped_name = copy._scoped_name; + _comment = copy._comment; _type = copy._type; _getter = copy._getter; _setter = copy._setter; @@ -85,6 +86,26 @@ get_scoped_name() const { return _scoped_name; } +//////////////////////////////////////////////////////////////////// +// Function: InterrogateElement::has_comment +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE bool InterrogateElement:: +has_comment() const { + return !_comment.empty(); +} + +//////////////////////////////////////////////////////////////////// +// Function: InterrogateElement::get_comment +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE const string &InterrogateElement:: +get_comment() const { + return _comment; +} + //////////////////////////////////////////////////////////////////// // Element: InterrogateElement::get_type // Access: Public diff --git a/dtool/src/interrogatedb/interrogateElement.cxx b/dtool/src/interrogatedb/interrogateElement.cxx index c472d79289..1c74a208d6 100644 --- a/dtool/src/interrogatedb/interrogateElement.cxx +++ b/dtool/src/interrogatedb/interrogateElement.cxx @@ -30,6 +30,7 @@ output(ostream &out) const { << _getter << " " << _setter << " "; idf_output_string(out, _scoped_name); + idf_output_string(out, _comment, '\n'); } //////////////////////////////////////////////////////////////////// @@ -43,6 +44,10 @@ input(istream &in) { InterrogateComponent::input(in); in >> _flags >> _type >> _getter >> _setter; idf_input_string(in, _scoped_name); + + if (InterrogateDatabase::get_file_minor_version() >= 3) { + idf_input_string(in, _comment); + } } //////////////////////////////////////////////////////////////////// diff --git a/dtool/src/interrogatedb/interrogateElement.h b/dtool/src/interrogatedb/interrogateElement.h index 5134f5b57f..863e502545 100644 --- a/dtool/src/interrogatedb/interrogateElement.h +++ b/dtool/src/interrogatedb/interrogateElement.h @@ -37,6 +37,9 @@ public: INLINE bool has_scoped_name() const; INLINE const string &get_scoped_name() const; + INLINE bool has_comment() const; + INLINE const string &get_comment() const; + INLINE TypeIndex get_type() const; INLINE bool has_getter() const; INLINE FunctionIndex get_getter() const; @@ -57,6 +60,7 @@ private: int _flags; string _scoped_name; + string _comment; TypeIndex _type; FunctionIndex _getter; FunctionIndex _setter; From c178aba6394e3616fae5e7523018dba7bbe63816 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 19 Sep 2014 15:23:52 +0000 Subject: [PATCH 43/52] Add property support to interrogate (using MAKE_PROPERTY or using published members) --- contrib/src/ai/aiNode.h | 15 +-- dtool/src/cppparser/Sources.pp | 4 +- dtool/src/cppparser/cppBison.yxx | 35 +++++- dtool/src/cppparser/cppDeclaration.cxx | 11 +- dtool/src/cppparser/cppDeclaration.h | 7 +- dtool/src/cppparser/cppMakeProperty.cxx | 99 ++++++++++++++++ dtool/src/cppparser/cppMakeProperty.h | 51 ++++++++ dtool/src/cppparser/cppPreprocessor.cxx | 1 + dtool/src/cppparser/cppToken.cxx | 4 - .../src/cppparser/p3cppParser_composite1.cxx | 1 + dtool/src/dtoolbase/dtoolbase.h | 5 +- dtool/src/interrogate/functionRemap.cxx | 3 +- dtool/src/interrogate/interfaceMaker.cxx | 30 ++++- dtool/src/interrogate/interfaceMaker.h | 17 ++- dtool/src/interrogate/interfaceMakerC.cxx | 8 +- .../interfaceMakerPythonNative.cxx | 111 +++++++++++++++--- .../interrogate/interfaceMakerPythonNative.h | 2 +- .../interrogate/interfaceMakerPythonObj.cxx | 8 +- .../interfaceMakerPythonSimple.cxx | 12 +- dtool/src/interrogate/interrogateBuilder.cxx | 91 +++++++++++++- dtool/src/interrogate/interrogateBuilder.h | 6 + panda/src/egg/eggSwitchCondition.h | 2 +- 22 files changed, 459 insertions(+), 64 deletions(-) create mode 100644 dtool/src/cppparser/cppMakeProperty.cxx create mode 100644 dtool/src/cppparser/cppMakeProperty.h diff --git a/contrib/src/ai/aiNode.h b/contrib/src/ai/aiNode.h index b84fe56c0f..77f6036500 100644 --- a/contrib/src/ai/aiNode.h +++ b/contrib/src/ai/aiNode.h @@ -29,13 +29,7 @@ // on the mesh. //////////////////////////////////////////////////////////////////// class EXPCL_PANDAAI AINode { -PUBLISHED: - // This variable specifies whether the node is an obtacle or not. - // Used for dynamic obstacle addition to the environment. - // obstacle = false - // navigational = true - bool _type; - +public: // This variable specifies the node status whether open, close // or neutral. // open = belongs to _open_list. @@ -48,6 +42,12 @@ PUBLISHED: }; Status _status; + // This variable specifies whether the node is an obtacle or not. + // Used for dynamic obstacle addition to the environment. + // obstacle = false + // navigational = true + bool _type; + // The score is used to compute the traversal expense to nodes // when using A*. // _score = _cost + heuristic @@ -76,6 +76,7 @@ PUBLISHED: // is written into navmesh.csv file. AINode *_next; +PUBLISHED: AINode(int grid_x, int grid_y, LVecBase3f pos, float w, float l, float h); ~AINode(); diff --git a/dtool/src/cppparser/Sources.pp b/dtool/src/cppparser/Sources.pp index 96bb4c7ff3..c5ff050468 100644 --- a/dtool/src/cppparser/Sources.pp +++ b/dtool/src/cppparser/Sources.pp @@ -15,7 +15,7 @@ cppExpressionParser.h cppExtensionType.h cppFile.h \ cppFunctionGroup.h cppFunctionType.h cppGlobals.h \ cppIdentifier.h cppInstance.h cppInstanceIdentifier.h \ - cppMakeSeq.h cppManifest.h \ + cppMakeProperty.h cppMakeSeq.h cppManifest.h \ cppNameComponent.h cppNamespace.h \ cppParameterList.h cppParser.h cppPointerType.h \ cppPreprocessor.h cppReferenceType.h cppScope.h \ @@ -31,7 +31,7 @@ cppExtensionType.cxx cppFile.cxx cppFunctionGroup.cxx \ cppFunctionType.cxx cppGlobals.cxx cppIdentifier.cxx \ cppInstance.cxx cppInstanceIdentifier.cxx \ - cppMakeSeq.cxx cppManifest.cxx \ + cppMakeProperty.cxx cppMakeSeq.cxx cppManifest.cxx \ cppNameComponent.cxx cppNamespace.cxx cppParameterList.cxx \ cppParser.cxx cppPointerType.cxx cppPreprocessor.cxx \ cppReferenceType.cxx cppScope.cxx cppSimpleType.cxx \ diff --git a/dtool/src/cppparser/cppBison.yxx b/dtool/src/cppparser/cppBison.yxx index 6d533f80d1..5a166ad8ae 100644 --- a/dtool/src/cppparser/cppBison.yxx +++ b/dtool/src/cppparser/cppBison.yxx @@ -14,6 +14,7 @@ #include "cppEnumType.h" #include "cppFunctionType.h" #include "cppTBDType.h" +#include "cppMakeProperty.h" #include "cppMakeSeq.h" #include "cppParameterList.h" #include "cppInstance.h" @@ -234,7 +235,6 @@ pop_struct() { %token XOREQUAL %token LSHIFTEQUAL %token RSHIFTEQUAL -%token TOKENPASTE %token KW_BEGIN_PUBLISH %token KW_BLOCKING @@ -264,6 +264,7 @@ pop_struct() { %token KW_INT %token KW_LONG %token KW_LONGLONG +%token KW_MAKE_PROPERTY %token KW_MAKE_SEQ %token KW_MUTABLE %token KW_NAMESPACE @@ -475,7 +476,35 @@ declaration: { current_scope->set_current_vis(V_private); } - | KW_MAKE_SEQ '(' name ',' name ',' name ')' ';' + | KW_MAKE_PROPERTY '(' IDENTIFIER ',' IDENTIFIER ')' ';' +{ + + CPPDeclaration *getter = $5->find_symbol(current_scope, global_scope, current_lexer); + if (getter == (CPPDeclaration *)NULL || getter->get_subtype() != CPPDeclaration::ST_function_group) { + yyerror("Reference to non-existent or invalid getter: " + $5->get_fully_scoped_name(), @1); + } + + CPPMakeProperty *make_property = new CPPMakeProperty($3, getter->as_function_group(), NULL, current_scope, @1.file); + current_scope->add_declaration(make_property, global_scope, current_lexer, @1); +} + | KW_MAKE_PROPERTY '(' IDENTIFIER ',' IDENTIFIER ',' IDENTIFIER ')' ';' +{ + CPPDeclaration *getter = $5->find_symbol(current_scope, global_scope, current_lexer); + if (getter == (CPPDeclaration *)NULL || getter->get_subtype() != CPPDeclaration::ST_function_group) { + yyerror("Reference to non-existent or invalid getter: " + $5->get_fully_scoped_name(), @1); + } + + CPPDeclaration *setter = $7->find_symbol(current_scope, global_scope, current_lexer); + if (setter == (CPPDeclaration *)NULL || setter->get_subtype() != CPPDeclaration::ST_function_group) { + yyerror("Reference to non-existent or invalid setter: " + $7->get_fully_scoped_name(), @1); + } + + CPPMakeProperty *make_property = new CPPMakeProperty($3, getter->as_function_group(), + setter->as_function_group(), + current_scope, @1.file); + current_scope->add_declaration(make_property, global_scope, current_lexer, @1); +} + | KW_MAKE_SEQ '(' name ',' name ',' name ')' ';' { CPPMakeSeq *make_seq = new CPPMakeSeq($3->get_simple_name(), $5->get_simple_name(), $7->get_simple_name(), @1.file); current_scope->add_declaration(make_seq, global_scope, current_lexer, @1); @@ -2086,7 +2115,7 @@ element: | KW_SHORT | KW_SIGNED | KW_SIZEOF | KW_STATIC | KW_STATIC_CAST | KW_STRUCT | KW_THROW | KW_TRUE | KW_TRY | KW_TYPEDEF | KW_TYPENAME | KW_UNION | KW_UNSIGNED | KW_VIRTUAL | KW_VOID | KW_VOLATILE - | KW_WHILE | TOKENPASTE + | KW_WHILE | KW_OPERATOR { } diff --git a/dtool/src/cppparser/cppDeclaration.cxx b/dtool/src/cppparser/cppDeclaration.cxx index fcc60903ca..c124e797c0 100644 --- a/dtool/src/cppparser/cppDeclaration.cxx +++ b/dtool/src/cppparser/cppDeclaration.cxx @@ -356,6 +356,16 @@ as_type_proxy() { return (CPPTypeProxy *)NULL; } +//////////////////////////////////////////////////////////////////// +// Function: CPPDeclaration::as_make_property +// Access: Public, Virtual +// Description: +//////////////////////////////////////////////////////////////////// +CPPMakeProperty *CPPDeclaration:: +as_make_property() { + return (CPPMakeProperty *)NULL; +} + //////////////////////////////////////////////////////////////////// // Function: CPPDeclaration::as_make_seq // Access: Public, Virtual @@ -366,7 +376,6 @@ as_make_seq() { return (CPPMakeSeq *)NULL; } - //////////////////////////////////////////////////////////////////// // Function: CPPDeclaration::is_equal // Access: Protected, Virtual diff --git a/dtool/src/cppparser/cppDeclaration.h b/dtool/src/cppparser/cppDeclaration.h index f4f6474013..ba4c515142 100644 --- a/dtool/src/cppparser/cppDeclaration.h +++ b/dtool/src/cppparser/cppDeclaration.h @@ -47,6 +47,7 @@ class CPPExtensionType; class CPPStructType; class CPPEnumType; class CPPTypeProxy; +class CPPMakeProperty; class CPPMakeSeq; class CPPClassTemplateParameter; class CPPTBDType; @@ -69,6 +70,7 @@ public: ST_type, ST_namespace, ST_using, + ST_make_property, ST_make_seq, // Subtypes of CPPType @@ -136,6 +138,7 @@ public: virtual CPPEnumType *as_enum_type(); virtual CPPTBDType *as_tbd_type(); virtual CPPTypeProxy *as_type_proxy(); + virtual CPPMakeProperty *as_make_property(); virtual CPPMakeSeq *as_make_seq(); CPPVisibility _vis; @@ -154,8 +157,4 @@ operator << (ostream &out, const CPPDeclaration &decl) { return out; } - #endif - - - diff --git a/dtool/src/cppparser/cppMakeProperty.cxx b/dtool/src/cppparser/cppMakeProperty.cxx new file mode 100644 index 0000000000..d7d4fa9e67 --- /dev/null +++ b/dtool/src/cppparser/cppMakeProperty.cxx @@ -0,0 +1,99 @@ +// Filename: cppMakeProperty.cxx +// Created by: rdb (18Sep14) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) Carnegie Mellon University. All rights reserved. +// +// All use of this software is subject to the terms of the revised BSD +// license. You should have received a copy of this license along +// with this source code in a file named "LICENSE." +// +//////////////////////////////////////////////////////////////////// + +#include "cppMakeProperty.h" +#include "cppFunctionGroup.h" + +//////////////////////////////////////////////////////////////////// +// Function: CPPMakeProperty::Constructor +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +CPPMakeProperty:: +CPPMakeProperty(CPPIdentifier *ident, + CPPFunctionGroup *getter, CPPFunctionGroup *setter, + CPPScope *current_scope, const CPPFile &file) : + CPPDeclaration(file), + _ident(ident), + _getter(getter), + _setter(setter) +{ + _ident->_native_scope = current_scope; +} + +//////////////////////////////////////////////////////////////////// +// Function: CPPMakeProperty::get_simple_name +// Access: Public, Virtual +// Description: +//////////////////////////////////////////////////////////////////// +string CPPMakeProperty:: +get_simple_name() const { + return _ident->get_simple_name(); +} + +//////////////////////////////////////////////////////////////////// +// Function: CPPMakeProperty::get_local_name +// Access: Public, Virtual +// Description: +//////////////////////////////////////////////////////////////////// +string CPPMakeProperty:: +get_local_name(CPPScope *scope) const { + return _ident->get_local_name(scope); +} + +//////////////////////////////////////////////////////////////////// +// Function: CPPMakeProperty::get_fully_scoped_name +// Access: Public, Virtual +// Description: +//////////////////////////////////////////////////////////////////// +string CPPMakeProperty:: +get_fully_scoped_name() const { + return _ident->get_fully_scoped_name(); +} + +//////////////////////////////////////////////////////////////////// +// Function: CPPMakeProperty::output +// Access: Public, Virtual +// Description: +//////////////////////////////////////////////////////////////////// +void CPPMakeProperty:: +output(ostream &out, int indent_level, CPPScope *scope, bool complete) const { + out << "__make_property(" << _ident->get_local_name(scope) + << ", " << _getter->_name; + + if (_setter != NULL) { + out << ", " << _setter->_name; + } + out << ");"; +} + +//////////////////////////////////////////////////////////////////// +// Function: CPPMakeProperty::get_subtype +// Access: Public, Virtual +// Description: +//////////////////////////////////////////////////////////////////// +CPPDeclaration::SubType CPPMakeProperty:: +get_subtype() const { + return ST_make_property; +} + +//////////////////////////////////////////////////////////////////// +// Function: CPPMakeProperty::as_make_property +// Access: Public, Virtual +// Description: +//////////////////////////////////////////////////////////////////// +CPPMakeProperty *CPPMakeProperty:: +as_make_property() { + return this; +} diff --git a/dtool/src/cppparser/cppMakeProperty.h b/dtool/src/cppparser/cppMakeProperty.h new file mode 100644 index 0000000000..816f9d4958 --- /dev/null +++ b/dtool/src/cppparser/cppMakeProperty.h @@ -0,0 +1,51 @@ +// Filename: cppMakeProperty.h +// Created by: rdb (18Sep14) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) Carnegie Mellon University. All rights reserved. +// +// All use of this software is subject to the terms of the revised BSD +// license. You should have received a copy of this license along +// with this source code in a file named "LICENSE." +// +//////////////////////////////////////////////////////////////////// + +#ifndef CPPMAKEPROPERTY_H +#define CPPMAKEPROPERTY_H + +#include "dtoolbase.h" + +#include "cppDeclaration.h" + +/////////////////////////////////////////////////////////////////// +// Class : CPPMakeProperty +// Description : This is a MAKE_PROPERTY() declaration appearing +// within a class body. It means to generate a property +// within Python, replacing (for instance) +// get_something()/set_something() with a synthetic +// 'something' attribute. +//////////////////////////////////////////////////////////////////// +class CPPMakeProperty : public CPPDeclaration { +public: + CPPMakeProperty(CPPIdentifier *ident, + CPPFunctionGroup *getter, CPPFunctionGroup *setter, + CPPScope *current_scope, const CPPFile &file); + + virtual string get_simple_name() const; + virtual string get_local_name(CPPScope *scope = NULL) const; + virtual string get_fully_scoped_name() const; + + virtual void output(ostream &out, int indent_level, CPPScope *scope, + bool complete) const; + + virtual SubType get_subtype() const; + virtual CPPMakeProperty *as_make_property(); + + CPPIdentifier *_ident; + CPPFunctionGroup *_getter; + CPPFunctionGroup *_setter; +}; + +#endif diff --git a/dtool/src/cppparser/cppPreprocessor.cxx b/dtool/src/cppparser/cppPreprocessor.cxx index 9e0690e952..d0ed51f9b9 100644 --- a/dtool/src/cppparser/cppPreprocessor.cxx +++ b/dtool/src/cppparser/cppPreprocessor.cxx @@ -1987,6 +1987,7 @@ check_keyword(const string &name) { if (name == "inline") return KW_INLINE; if (name == "int") return KW_INT; if (name == "long") return KW_LONG; + if (name == "__make_property") return KW_MAKE_PROPERTY; if (name == "__make_seq") return KW_MAKE_SEQ; if (name == "mutable") return KW_MUTABLE; if (name == "namespace") return KW_NAMESPACE; diff --git a/dtool/src/cppparser/cppToken.cxx b/dtool/src/cppparser/cppToken.cxx index 75856748ea..9cb6102440 100644 --- a/dtool/src/cppparser/cppToken.cxx +++ b/dtool/src/cppparser/cppToken.cxx @@ -247,10 +247,6 @@ output(ostream &out) const { out << "RSHIFTEQUAL"; break; - case TOKENPASTE: - out << "TOKENPASTE"; - break; - case KW_BOOL: out << "KW_BOOL"; break; diff --git a/dtool/src/cppparser/p3cppParser_composite1.cxx b/dtool/src/cppparser/p3cppParser_composite1.cxx index f14b966480..b8a7452e98 100644 --- a/dtool/src/cppparser/p3cppParser_composite1.cxx +++ b/dtool/src/cppparser/p3cppParser_composite1.cxx @@ -4,6 +4,7 @@ #include "cppCommentBlock.cxx" #include "cppConstType.cxx" #include "cppDeclaration.cxx" +#include "cppMakeProperty.cxx" #include "cppMakeSeq.cxx" #include "cppParameterList.cxx" #include "cppParser.cxx" diff --git a/dtool/src/dtoolbase/dtoolbase.h b/dtool/src/dtoolbase/dtoolbase.h index 160128e22e..8dfb7e2127 100644 --- a/dtool/src/dtoolbase/dtoolbase.h +++ b/dtool/src/dtoolbase/dtoolbase.h @@ -397,17 +397,16 @@ #define BEGIN_PUBLISH __begin_publish #define END_PUBLISH __end_publish #define BLOCKING __blocking +#define MAKE_PROPERTY(property_name, ...) __make_property(property_name, __VA_ARGS__) #define MAKE_SEQ(seq_name, num_name, element_name) __make_seq(seq_name, num_name, element_name) #undef USE_STL_ALLOCATOR /* Don't try to parse these template classes in interrogate. */ #define EXTENSION(x) __extension x #define EXTEND __extension -#define EXT_FUNC(func) ::func() -#define EXT_FUNC_ARGS(func, ...) ::func(__VA_ARGS__) -#define CALL_EXT_FUNC(func, ...) ::func (__VA_ARGS__) #else #define BEGIN_PUBLISH #define END_PUBLISH #define BLOCKING +#define MAKE_PROPERTY(property_name, ...) #define MAKE_SEQ(seq_name, num_name, element_name) #define EXTENSION(x) #define EXTEND diff --git a/dtool/src/interrogate/functionRemap.cxx b/dtool/src/interrogate/functionRemap.cxx index 94fcf5b00c..bc4da08534 100644 --- a/dtool/src/interrogate/functionRemap.cxx +++ b/dtool/src/interrogate/functionRemap.cxx @@ -371,7 +371,8 @@ get_call_str(const string &container, const vector_string &pexprs) const { } call << " = "; - _parameters[0]._remap->pass_parameter(call, get_parameter_expr(_first_true_parameter, pexprs)); + _parameters[_first_true_parameter]._remap->pass_parameter(call, + get_parameter_expr(_first_true_parameter, pexprs)); } else { const char *separator = ""; diff --git a/dtool/src/interrogate/interfaceMaker.cxx b/dtool/src/interrogate/interfaceMaker.cxx index e392d25895..a5b62ac27b 100644 --- a/dtool/src/interrogate/interfaceMaker.cxx +++ b/dtool/src/interrogate/interfaceMaker.cxx @@ -87,6 +87,19 @@ MakeSeq(const string &name, CPPMakeSeq *cpp_make_seq) : { } +//////////////////////////////////////////////////////////////////// +// Function: InterfaceMaker::Property::Constructor +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +InterfaceMaker::Property:: +Property(const InterrogateElement &ielement) : + _ielement(ielement), + _getter(NULL), + _setter(NULL) +{ +} + //////////////////////////////////////////////////////////////////// // Function: InterfaceMaker::Object::Constructor // Access: Public @@ -156,6 +169,8 @@ check_protocols() { _protocol_types |= PT_iter; } + InterrogateDatabase *idb = InterrogateDatabase::get_ptr(); + // Now are there any make_seq requests within this class? if (_itype._cpptype != NULL) { CPPStructType *stype = _itype._cpptype->as_struct_type(); @@ -230,9 +245,9 @@ InterfaceMaker:: Object *object = (*oi).second; delete object; } - Functions::iterator fi; + FunctionsByIndex::iterator fi; for (fi = _functions.begin(); fi != _functions.end(); ++fi) { - delete (*fi); + delete (*fi).second; } } @@ -501,9 +516,9 @@ wrap_global_functions() { //////////////////////////////////////////////////////////////////// void InterfaceMaker:: get_function_remaps(vector &remaps) { - Functions::iterator fi; + FunctionsByIndex::iterator fi; for (fi = _functions.begin(); fi != _functions.end(); ++fi) { - Function *func = (*fi); + Function *func = (*fi).second; Function::Remaps::const_iterator ri; for (ri = func->_remaps.begin(); ri != func->_remaps.end(); ++ri) { FunctionRemap *remap = (*ri); @@ -617,12 +632,17 @@ get_unique_prefix() { //////////////////////////////////////////////////////////////////// InterfaceMaker::Function *InterfaceMaker:: record_function(const InterrogateType &itype, FunctionIndex func_index) { + if (_functions.count(func_index)) { + // Already exists. + return _functions[func_index]; + } + InterrogateDatabase *idb = InterrogateDatabase::get_ptr(); const InterrogateFunction &ifunc = idb->get_function(func_index); string wrapper_name = get_wrapper_name(itype, ifunc, func_index); Function *func = new Function(wrapper_name, itype, ifunc); - _functions.push_back(func); + _functions[func_index] = func; // printf(" Function Name = %s\n", ifunc.get_name().c_str()); diff --git a/dtool/src/interrogate/interfaceMaker.h b/dtool/src/interrogate/interfaceMaker.h index 189460d94b..6e94895ae7 100644 --- a/dtool/src/interrogate/interfaceMaker.h +++ b/dtool/src/interrogate/interfaceMaker.h @@ -29,8 +29,9 @@ class ParameterRemap; class CPPType; class CPPInstance; class InterrogateBuilder; -class InterrogateType; +class InterrogateElement; class InterrogateFunction; +class InterrogateType; //////////////////////////////////////////////////////////////////// // Class : InterfaceMaker @@ -107,8 +108,9 @@ public: int _flags; ArgsType _args_type; }; + typedef map FunctionsByIndex; typedef vector Functions; - Functions _functions; + FunctionsByIndex _functions; class MakeSeq { public: @@ -121,6 +123,16 @@ public: }; typedef vector MakeSeqs; + class Property { + public: + Property(const InterrogateElement &ielement); + + const InterrogateElement &_ielement; + Function *_getter; + Function *_setter; + }; + typedef vector Properties; + class Object { public: Object(const InterrogateType &itype); @@ -133,6 +145,7 @@ public: Functions _constructors; Functions _methods; MakeSeqs _make_seqs; + Properties _properties; enum ProtocolTypes { PT_sequence = 0x0001, diff --git a/dtool/src/interrogate/interfaceMakerC.cxx b/dtool/src/interrogate/interfaceMakerC.cxx index 223f2ee08d..a1019241ed 100644 --- a/dtool/src/interrogate/interfaceMakerC.cxx +++ b/dtool/src/interrogate/interfaceMakerC.cxx @@ -53,9 +53,9 @@ InterfaceMakerC:: //////////////////////////////////////////////////////////////////// void InterfaceMakerC:: write_prototypes(ostream &out,ostream *out_h) { - Functions::iterator fi; + FunctionsByIndex::iterator fi; for (fi = _functions.begin(); fi != _functions.end(); ++fi) { - Function *func = (*fi); + Function *func = (*fi).second; write_prototype_for(out, func); } @@ -72,9 +72,9 @@ write_prototypes(ostream &out,ostream *out_h) { //////////////////////////////////////////////////////////////////// void InterfaceMakerC:: write_functions(ostream &out) { - Functions::iterator fi; + FunctionsByIndex::iterator fi; for (fi = _functions.begin(); fi != _functions.end(); ++fi) { - Function *func = (*fi); + Function *func = (*fi).second; write_function_for(out, func); } diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index 22c50809c6..eb25546d83 100755 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -817,9 +817,9 @@ write_functions(ostream &out) { out << "//********************************************************************\n"; out << "//*** Functions for .. Global\n" ; out << "//********************************************************************\n"; - Functions::iterator fi; + FunctionsByIndex::iterator fi; for (fi = _functions.begin(); fi != _functions.end(); ++fi) { - Function *func = (*fi); + Function *func = (*fi).second; if (!func->_itype.is_global() && is_function_legal(func)) { write_function_for_top(out, NULL, func); } @@ -876,6 +876,23 @@ write_class_details(ostream &out, Object *obj) { } } + Properties::const_iterator pit; + for (pit = obj->_properties.begin(); pit != obj->_properties.end(); ++pit) { + Property *property = (*pit); + const InterrogateElement &ielem = property->_ielement; + bool coercion_attempted = false; + + if (property->_getter != NULL) { + std::string fname = "PyObject *Dtool_" + ClassName + "_" + ielem.get_name() + "_Getter(PyObject *self, void *)"; + write_function_for_name(out, obj, property->_getter, fname, true, coercion_attempted, AT_no_args, false, false); + } + + if (property->_setter != NULL) { + std::string fname = "int Dtool_" + ClassName + "_" + ielem.get_name() + "_Setter(PyObject *self, PyObject *arg, void *)"; + write_function_for_name(out, obj, property->_setter, fname, true, coercion_attempted, AT_single_arg, true, false); + } + } + if (obj->_constructors.size() == 0) { out << "int Dtool_Init_" + ClassName + "(PyObject *self, PyObject *args, PyObject *kwds) {\n" << " PyErr_SetString(PyExc_TypeError, \"cannot init constant class (" << cClassName << ")\");\n" @@ -893,7 +910,7 @@ write_class_details(ostream &out, Object *obj) { Function *func = (*fi); std::string fname = "int Dtool_Init_" + ClassName + "(PyObject *self, PyObject *args, PyObject *kwds)"; - write_function_for_name(out, obj, func, fname, true, coercion_attempted, AT_keyword_args, true); + write_function_for_name(out, obj, func, fname, true, coercion_attempted, AT_keyword_args, true, false); } if (coercion_attempted) { // If a coercion attempt was written into the above constructor, @@ -903,7 +920,7 @@ write_class_details(ostream &out, Object *obj) { Function *func = (*fi); std::string fname = "int Dtool_InitNoCoerce_" + ClassName + "(PyObject *self, PyObject *args)"; - write_function_for_name(out, obj, func, fname, false, coercion_attempted, AT_varargs, true); + write_function_for_name(out, obj, func, fname, false, coercion_attempted, AT_varargs, true, false); } } else { // Otherwise, since the above constructor didn't involve any @@ -1114,9 +1131,9 @@ write_module_support(ostream &out, ostream *out_h, InterrogateModuleDef *def) { bool force_base_functions = true; out << "static PyMethodDef python_simple_funcs[] = {\n"; - Functions::iterator fi; + FunctionsByIndex::iterator fi; for (fi = _functions.begin(); fi != _functions.end(); ++fi) { - Function *func = (*fi); + Function *func = (*fi).second; if (!func->_itype.is_global() && is_function_legal(func)) { string name1 = methodNameFromCppName(func, "", false); string name2 = methodNameFromCppName(func, "", true); @@ -2078,6 +2095,44 @@ write_module_class(ostream &out, Object *obj) { out << "}\n\n"; } + if (obj->_properties.size() > 0) { + // Write out the array of properties, telling Python which getter and setter + // to call when they are assigned or queried in Python code. + out << "PyGetSetDef Dtool_Properties_" << ClassName << "[] = {\n"; + + Properties::const_iterator pit; + for (pit = obj->_properties.begin(); pit != obj->_properties.end(); ++pit) { + Property *property = (*pit); + const InterrogateElement &ielem = property->_ielement; + if (property->_getter == NULL || !is_function_legal(property->_getter)) { + continue; + } + + out << " {(char *)\"" << ielem.get_name() << "\"," + << " &Dtool_" << ClassName << "_" << ielem.get_name() << "_Getter,"; + + if (property->_setter == NULL || !is_function_legal(property->_setter)) { + out << " NULL,"; + } else { + out << " &Dtool_" << ClassName << "_" << ielem.get_name() << "_Setter,"; + } + + if (ielem.has_comment()) { + out << "(char *)\n"; + output_quoted(out, 4, ielem.get_comment()); + out << ",\n "; + } else { + out << " NULL, "; + } + + // Extra void* argument; we don't make use of it. + out << "NULL},\n"; + } + + out << " {NULL},\n"; + out << "};\n\n"; + } + out << "void Dtool_PyModuleClassInit_" << ClassName << "(PyObject *module) {\n"; out << " static bool initdone = false;\n"; out << " if (!initdone) {\n"; @@ -2190,6 +2245,11 @@ write_module_class(ostream &out, Object *obj) { out << " Dtool_" << ClassName << ".As_PyTypeObject().tp_str = &Dtool_Repr_" << ClassName << ";\n"; } + if (obj->_properties.size() > 0) { + // GetSet descriptor slots. + out << " Dtool_" << ClassName << ".As_PyTypeObject().tp_getset = Dtool_Properties_" << ClassName << ";\n"; + } + int num_nested = obj->_itype.number_of_nested_types(); for (int ni = 0; ni < num_nested; ni++) { TypeIndex nested_index = obj->_itype.get_nested_type(ni); @@ -2395,7 +2455,7 @@ write_function_for_top(ostream &out, InterfaceMaker::Object *obj, InterfaceMaker fname += ")"; bool coercion_attempted = false; - write_function_for_name(out, obj, func, fname, true, coercion_attempted, func->_args_type, false); + write_function_for_name(out, obj, func, fname, true, coercion_attempted, func->_args_type, false, true); } //////////////////////////////////////////////////////////////////// @@ -2407,7 +2467,7 @@ void InterfaceMakerPythonNative:: write_function_for_name(ostream &out1, InterfaceMaker::Object *obj, InterfaceMaker::Function *func, const std::string &function_name, bool coercion_allowed, bool &coercion_attempted, - ArgsType args_type, bool return_int) { + ArgsType args_type, bool return_int, bool write_comment) { ostringstream out; std::map > MapSets; @@ -2462,7 +2522,11 @@ write_function_for_name(ostream &out1, InterfaceMaker::Object *obj, InterfaceMak // Other functions should raise an exception if the this // pointer isn't set or is the wrong type. out << " PyErr_SetString(PyExc_AttributeError, \"C++ object is not yet constructed, or already destructed.\");\n"; - out << " return NULL;\n"; + if (return_int) { + out << " return -1;\n"; + } else { + out << " return NULL;\n"; + } } out << " }\n"; } @@ -2639,7 +2703,7 @@ write_function_for_name(ostream &out1, InterfaceMaker::Object *obj, InterfaceMak FunctionComment = FunctionComment1 + "\n" + FunctionComment; } - if (!return_int) { + if (write_comment) { // Write out the function doc string. We only do this if it is // not a constructor, since we don't have a place to put the // constructor doc string. @@ -4004,13 +4068,30 @@ record_object(TypeIndex type_index) { for (int ei = 0; ei < num_elements; ei++) { ElementIndex element_index = itype.get_element(ei); const InterrogateElement &ielement = idb->get_element(element_index); - if (ielement.has_getter()) { - FunctionIndex func_index = ielement.get_getter(); - record_function(itype, func_index); - } + + Property *property = new Property(ielement); + if (ielement.has_setter()) { FunctionIndex func_index = ielement.get_setter(); - record_function(itype, func_index); + Function *setter = record_function(itype, func_index); + if (is_function_legal(setter)) { + property->_setter = setter; + } + } + + if (ielement.has_getter()) { + FunctionIndex func_index = ielement.get_getter(); + Function *getter = record_function(itype, func_index); + if (is_function_legal(getter)) { + property->_getter = getter; + } + } + + if (property->_getter != NULL) { + object->_properties.push_back(property); + } else { + // No use exporting a property without a getter. + delete property; } } diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.h b/dtool/src/interrogate/interfaceMakerPythonNative.h index a7c20598db..7c7c35b317 100755 --- a/dtool/src/interrogate/interfaceMakerPythonNative.h +++ b/dtool/src/interrogate/interfaceMakerPythonNative.h @@ -95,7 +95,7 @@ private: void write_function_for_name(ostream &out, Object *obj, Function *func, const std::string &name, bool coercion_allowed, bool &coercion_attempted, - ArgsType args_type, bool return_int); + ArgsType args_type, bool return_int, bool write_comment); void write_function_forset(ostream &out, Object *obj, Function *func, std::set &remaps, string &expected_params, diff --git a/dtool/src/interrogate/interfaceMakerPythonObj.cxx b/dtool/src/interrogate/interfaceMakerPythonObj.cxx index f38497c299..497d506cdc 100644 --- a/dtool/src/interrogate/interfaceMakerPythonObj.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonObj.cxx @@ -55,9 +55,9 @@ InterfaceMakerPythonObj:: //////////////////////////////////////////////////////////////////// void InterfaceMakerPythonObj:: write_prototypes(ostream &out, ostream *out_h) { - Functions::iterator fi; + FunctionsByIndex::iterator fi; for (fi = _functions.begin(); fi != _functions.end(); ++fi) { - Function *func = (*fi); + Function *func = (*fi).second; write_prototype_for(out, func); } @@ -74,9 +74,9 @@ write_prototypes(ostream &out, ostream *out_h) { //////////////////////////////////////////////////////////////////// void InterfaceMakerPythonObj:: write_functions(ostream &out) { - Functions::iterator fi; + FunctionsByIndex::iterator fi; for (fi = _functions.begin(); fi != _functions.end(); ++fi) { - Function *func = (*fi); + Function *func = (*fi).second; write_function_for(out, func); } diff --git a/dtool/src/interrogate/interfaceMakerPythonSimple.cxx b/dtool/src/interrogate/interfaceMakerPythonSimple.cxx index b0e68c6683..6709c8e399 100644 --- a/dtool/src/interrogate/interfaceMakerPythonSimple.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonSimple.cxx @@ -53,9 +53,9 @@ InterfaceMakerPythonSimple:: //////////////////////////////////////////////////////////////////// void InterfaceMakerPythonSimple:: write_prototypes(ostream &out,ostream *out_h) { - Functions::iterator fi; + FunctionsByIndex::iterator fi; for (fi = _functions.begin(); fi != _functions.end(); ++fi) { - Function *func = (*fi); + Function *func = (*fi).second; write_prototype_for(out, func); } @@ -72,9 +72,9 @@ write_prototypes(ostream &out,ostream *out_h) { //////////////////////////////////////////////////////////////////// void InterfaceMakerPythonSimple:: write_functions(ostream &out) { - Functions::iterator fi; + FunctionsByIndex::iterator fi; for (fi = _functions.begin(); fi != _functions.end(); ++fi) { - Function *func = (*fi); + Function *func = (*fi).second; write_function_for(out, func); } @@ -93,9 +93,9 @@ write_module(ostream &out,ostream *out_h, InterrogateModuleDef *def) { out << "static PyMethodDef python_simple_funcs[] = {\n"; - Functions::iterator fi; + FunctionsByIndex::iterator fi; for (fi = _functions.begin(); fi != _functions.end(); ++fi) { - Function *func = (*fi); + Function *func = (*fi).second; Function::Remaps::const_iterator ri; for (ri = func->_remaps.begin(); ri != func->_remaps.end(); ++ri) { FunctionRemap *remap = (*ri); diff --git a/dtool/src/interrogate/interrogateBuilder.cxx b/dtool/src/interrogate/interrogateBuilder.cxx index 56ba78e345..a064c00590 100644 --- a/dtool/src/interrogate/interrogateBuilder.cxx +++ b/dtool/src/interrogate/interrogateBuilder.cxx @@ -44,6 +44,7 @@ #include "cppTypeDeclaration.h" #include "cppEnumType.h" #include "cppCommentBlock.h" +#include "cppMakeProperty.h" #include "cppMakeSeq.h" #include "pnotify.h" @@ -1357,7 +1358,7 @@ scan_element(CPPInstance *element, CPPStructType *struct_type, ielement._name = element->get_local_name(scope); ielement._scoped_name = descope(element->get_local_name(&parser)); - // See if there happens to be a comment before the element. + // See if there happens to be a comment before the MAKE_PROPERTY macro. if (element->_leading_comment != (CPPCommentBlock *)NULL) { ielement._comment = trim_blanks(element->_leading_comment->_comment); } @@ -1774,6 +1775,90 @@ get_function(CPPInstance *function, string description, return index; } +//////////////////////////////////////////////////////////////////// +// Function: InterrogateBuilder::get_make_property +// Access: Private +// Description: Adds the indicated make_property to the database, +// if it is not already present. In either case, +// returns the MakeSeqIndex of the make_seq within the +// database. +//////////////////////////////////////////////////////////////////// +ElementIndex InterrogateBuilder:: +get_make_property(CPPMakeProperty *make_property, CPPStructType *struct_type) { + string property_name = make_property->get_local_name(&parser); + + // First, check to see if it's already there. + PropertiesByName::const_iterator tni = + _properties_by_name.find(property_name); + if (tni != _properties_by_name.end()) { + ElementIndex index = (*tni).second; + return index; + } + + // Find the getter so we can get its return type. + CPPInstance *getter = NULL; + CPPType *return_type = NULL; + + CPPFunctionGroup *fgroup = make_property->_getter; + CPPFunctionGroup::Instances::const_iterator fi; + 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() == 0) { + getter = function; + return_type = ftype->_return_type; + + // The return type of the non-const method probably better represents + // the type of the property we are creating. + if ((ftype->_flags & CPPFunctionType::F_const_method) == 0) { + break; + } + } + } + + if (getter == NULL || return_type == NULL) { + cerr << "No instance of getter '" + << make_property->_getter->_name << "' is suitable!\n"; + return 0; + } + + InterrogateDatabase *idb = InterrogateDatabase::get_ptr(); + // It isn't here, so we'll have to define it. + ElementIndex index = idb->get_next_index(); + _properties_by_name[property_name] = index; + + InterrogateElement iproperty; + iproperty._name = make_property->get_simple_name(); + iproperty._scoped_name = descope(make_property->get_local_name(&parser)); + + iproperty._type = get_type(return_type, false); + + iproperty._flags |= InterrogateElement::F_has_getter; + iproperty._getter = get_function(getter, "", struct_type, + struct_type->get_scope(), 0); + + // See if there happens to be a comment before the element. + if (make_property->_leading_comment != (CPPCommentBlock *)NULL) { + iproperty._comment = trim_blanks(make_property->_leading_comment->_comment); + } + + // Now look for setters. + fgroup = make_property->_setter; + if (fgroup != NULL) { + for (fi = fgroup->_instances.begin(); fi != fgroup->_instances.end(); ++fi) { + CPPInstance *function = (*fi); + iproperty._flags |= InterrogateElement::F_has_setter; + iproperty._setter = get_function(function, "", struct_type, + struct_type->get_scope(), 0); + } + } + + idb->add_element(index, iproperty); + + return index; +} + //////////////////////////////////////////////////////////////////// // Function: InterrogateBuilder::get_make_seq // Access: Private @@ -2285,6 +2370,10 @@ define_struct_type(InterrogateType &itype, CPPStructType *cpptype, TypeIndex nested_index = get_type(type, false); itype._nested_types.push_back(nested_index); } + + } else if ((*di)->get_subtype() == CPPDeclaration::ST_make_property) { + ElementIndex element_index = get_make_property((*di)->as_make_property(), cpptype); + itype._elements.push_back(element_index); } } diff --git a/dtool/src/interrogate/interrogateBuilder.h b/dtool/src/interrogate/interrogateBuilder.h index 06b60f6fea..63a0814abb 100644 --- a/dtool/src/interrogate/interrogateBuilder.h +++ b/dtool/src/interrogate/interrogateBuilder.h @@ -38,6 +38,7 @@ class CPPScope; class CPPIdentifier; class CPPNameComponent; class CPPManifest; +class CPPMakeProperty; class CPPMakeSeq; class InterrogateType; class InterrogateFunction; @@ -108,6 +109,9 @@ public: CPPStructType *struct_type, CPPScope *scope, int flags, const string &expression = string()); + ElementIndex + get_make_property(CPPMakeProperty *make_property, CPPStructType *struct_type); + MakeSeqIndex get_make_seq(CPPMakeSeq *make_seq, CPPStructType *struct_type); @@ -132,10 +136,12 @@ public: typedef map TypesByName; typedef map FunctionsByName; typedef map MakeSeqsByName; + typedef map PropertiesByName; TypesByName _types_by_name; FunctionsByName _functions_by_name; MakeSeqsByName _make_seqs_by_name; + PropertiesByName _properties_by_name; typedef map IncludeFiles; IncludeFiles _include_files; diff --git a/panda/src/egg/eggSwitchCondition.h b/panda/src/egg/eggSwitchCondition.h index 3ba07e4b07..5fcc2dc8de 100644 --- a/panda/src/egg/eggSwitchCondition.h +++ b/panda/src/egg/eggSwitchCondition.h @@ -73,11 +73,11 @@ PUBLISHED: virtual void transform(const LMatrix4d &mat); +public: double _switch_in, _switch_out, _fade; LPoint3d _center; public: - static TypeHandle get_class_type() { return _type_handle; } From cf6fe5fd2af858939d51665b41b937dc95e33ad9 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 19 Sep 2014 22:39:20 +0000 Subject: [PATCH 44/52] Delete apparently defunct script --- direct/src/plugin/FileSpec.py | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100755 direct/src/plugin/FileSpec.py diff --git a/direct/src/plugin/FileSpec.py b/direct/src/plugin/FileSpec.py deleted file mode 100755 index 493d3a3652..0000000000 --- a/direct/src/plugin/FileSpec.py +++ /dev/null @@ -1,21 +0,0 @@ -from pandac.PandaModules import HashVal - -class FileSpec: - """ Used by make_package and make_contents. Represents a single - file in the directory, and its associated timestamp, size, and md5 - hash. """ - - def __init__(self, filename, pathname): - self.filename = filename - self.pathname = pathname - - self.size = pathname.getFileSize() - self.timestamp = pathname.getTimestamp() - - hv = HashVal() - hv.hashFile(pathname) - self.hash = hv.asHex() - - def getParams(self): - return 'filename="%s" size="%s" timestamp="%s" hash="%s"' % ( - self.filename, self.size, self.timestamp, self.hash) From 39e0889b549f49019eed04390b291d6b315c1bba Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 19 Sep 2014 23:30:47 +0000 Subject: [PATCH 45/52] compilation of panda3d.dtoolconfig --- makepanda/makepanda.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 71aac8d25d..c66a5670d1 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -2877,14 +2877,8 @@ TargetAdd('p3interrogatedb_composite2.obj', opts=OPTS, input='p3interrogatedb_co # OPTS=['DIR:dtool/metalibs/dtoolconfig', 'BUILDING:DTOOLCONFIG'] -if (PkgSkip("PYTHON")): - TargetAdd('p3dtoolconfig_pydtool.obj', opts=OPTS, input="null.cxx") -else: - TargetAdd('p3dtoolconfig_pydtool.obj', opts=OPTS, input="pydtool.cxx") TargetAdd('p3dtoolconfig_dtoolconfig.obj', opts=OPTS, input='dtoolconfig.cxx') -TargetAdd('p3dtoolconfig_pydtool.obj', dep='dtool_have_python.dat') TargetAdd('libp3dtoolconfig.dll', input='p3dtoolconfig_dtoolconfig.obj') -TargetAdd('libp3dtoolconfig.dll', input='p3dtoolconfig_pydtool.obj') TargetAdd('libp3dtoolconfig.dll', input='p3interrogatedb_composite1.obj') TargetAdd('libp3dtoolconfig.dll', input='p3interrogatedb_composite2.obj') TargetAdd('libp3dtoolconfig.dll', input='p3dconfig_composite1.obj') @@ -2893,6 +2887,13 @@ TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite2.obj') TargetAdd('libp3dtoolconfig.dll', input='libp3dtool.dll') TargetAdd('libp3dtoolconfig.dll', opts=['ADVAPI', 'OPENSSL', 'WINGDI', 'WINUSER']) +if not PkgSkip("PYTHON"): + TargetAdd('dtoolconfig_pydtool.obj', opts=OPTS, input="pydtool.cxx") + TargetAdd('dtoolconfig.pyd', input='dtoolconfig_pydtool.obj') + TargetAdd('dtoolconfig.pyd', input='libp3dtoolconfig.dll') + TargetAdd('dtoolconfig.pyd', input='libp3dtool.dll') + TargetAdd('dtoolconfig.pyd', opts=['PYTHON']) + # # DIRECTORY: dtool/src/pystub/ # From a6229f1fac5e55fa7d768128e2341d011282373a Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 19 Sep 2014 23:34:11 +0000 Subject: [PATCH 46/52] Support for comments in enums. Improve comment handling in C++ parser. Improve doxygen reference. Update interrogate interface. (Addendum to interrogatedb v2.3.) --- dtool/metalibs/dtoolconfig/pydtool.cxx | 834 ++++++++++-------- dtool/src/cppparser/cppBison.yxx | 40 +- dtool/src/cppparser/cppEnumType.cxx | 6 +- dtool/src/cppparser/cppEnumType.h | 4 +- dtool/src/cppparser/cppPreprocessor.cxx | 52 +- dtool/src/cppparser/cppPreprocessor.h | 3 +- dtool/src/cppparser/cppScope.cxx | 14 +- dtool/src/cppparser/cppScope.h | 4 +- dtool/src/cppparser/cppTemplateScope.cxx | 5 +- dtool/src/cppparser/cppTemplateScope.h | 4 +- .../src/interrogate/interfaceMakerPython.cxx | 3 +- .../interrogate/interfaceMakerPythonObj.cxx | 10 +- .../interfaceMakerPythonSimple.cxx | 12 +- dtool/src/interrogate/interrogateBuilder.cxx | 8 +- dtool/src/interrogatedb/interrogateType.I | 13 + dtool/src/interrogatedb/interrogateType.cxx | 5 + dtool/src/interrogatedb/interrogateType.h | 2 + .../interrogatedb/interrogate_interface.cxx | 18 + .../src/interrogatedb/interrogate_interface.h | 3 + 19 files changed, 600 insertions(+), 440 deletions(-) diff --git a/dtool/metalibs/dtoolconfig/pydtool.cxx b/dtool/metalibs/dtoolconfig/pydtool.cxx index d2e11b31d3..0c4b807bb1 100644 --- a/dtool/metalibs/dtoolconfig/pydtool.cxx +++ b/dtool/metalibs/dtoolconfig/pydtool.cxx @@ -1,6 +1,6 @@ /* * This file generated by: - * interrogate -D EXPCL_DTOOLCONFIG= -nodb -python -promiscuous -I /usr/local/panda/include -module dtoolconfig -library libp3dtoolconfig -true-names -do-module -oc pydtool.cxx ../../src/interrogatedb/interrogate_interface.h + * interrogate -D EXPCL_DTOOLCONFIG= -nodb -python -promiscuous -I~/panda3d/include -module panda3d.dtoolconfig -library dtoolconfig -true-names -do-module -oc pydtool.cxx ../../src/interrogatedb/interrogate_interface.h * */ @@ -9,145 +9,145 @@ #include "../../src/interrogatedb/interrogate_interface.h" #include "dtoolbase.h" -#undef HAVE_LONG_LONG #undef _POSIX_C_SOURCE +#define PY_SSIZE_T_CLEAN 1 #if PYTHON_FRAMEWORK #include "Python/Python.h" #else #include "Python.h" #endif -#ifdef HAVE_LONG_LONG -#undef HAVE_LONG_LONG -#endif -static PyObject *_inPzUjAtbRf(PyObject *self, PyObject *args); -static PyObject *_inPzUjAda_g(PyObject *self, PyObject *args); -static PyObject *_inPzUjA4RgX(PyObject *self, PyObject *args); -static PyObject *_inPzUjA3Gip(PyObject *self, PyObject *args); -static PyObject *_inPzUjARKDz(PyObject *self, PyObject *args); -static PyObject *_inPzUjAgZ9N(PyObject *self, PyObject *args); -static PyObject *_inPzUjARQIx(PyObject *self, PyObject *args); -static PyObject *_inPzUjAGVSj(PyObject *self, PyObject *args); -static PyObject *_inPzUjAznM6(PyObject *self, PyObject *args); -static PyObject *_inPzUjAjiLg(PyObject *self, PyObject *args); -static PyObject *_inPzUjA_yjE(PyObject *self, PyObject *args); -static PyObject *_inPzUjAzK9F(PyObject *self, PyObject *args); -static PyObject *_inPzUjAJju_(PyObject *self, PyObject *args); -static PyObject *_inPzUjAZktk(PyObject *self, PyObject *args); -static PyObject *_inPzUjAG71J(PyObject *self, PyObject *args); -static PyObject *_inPzUjAgeUs(PyObject *self, PyObject *args); -static PyObject *_inPzUjAkg95(PyObject *self, PyObject *args); -static PyObject *_inPzUjAluRc(PyObject *self, PyObject *args); -static PyObject *_inPzUjAwtTf(PyObject *self, PyObject *args); -static PyObject *_inPzUjArfao(PyObject *self, PyObject *args); -static PyObject *_inPzUjAcedk(PyObject *self, PyObject *args); -static PyObject *_inPzUjAXmoo(PyObject *self, PyObject *args); -static PyObject *_inPzUjAclIo(PyObject *self, PyObject *args); -static PyObject *_inPzUjAU2_B(PyObject *self, PyObject *args); -static PyObject *_inPzUjAHFO2(PyObject *self, PyObject *args); -static PyObject *_inPzUjAcfjm(PyObject *self, PyObject *args); -static PyObject *_inPzUjA3Sjw(PyObject *self, PyObject *args); -static PyObject *_inPzUjAgJcX(PyObject *self, PyObject *args); -static PyObject *_inPzUjAYlw6(PyObject *self, PyObject *args); -static PyObject *_inPzUjA3gns(PyObject *self, PyObject *args); -static PyObject *_inPzUjAN968(PyObject *self, PyObject *args); -static PyObject *_inPzUjAFJVJ(PyObject *self, PyObject *args); -static PyObject *_inPzUjAndTW(PyObject *self, PyObject *args); -static PyObject *_inPzUjApjWj(PyObject *self, PyObject *args); -static PyObject *_inPzUjANcQW(PyObject *self, PyObject *args); -static PyObject *_inPzUjAP_SX(PyObject *self, PyObject *args); -static PyObject *_inPzUjA1iRq(PyObject *self, PyObject *args); -static PyObject *_inPzUjAEmel(PyObject *self, PyObject *args); -static PyObject *_inPzUjA20Vx(PyObject *self, PyObject *args); -static PyObject *_inPzUjAKcdW(PyObject *self, PyObject *args); -static PyObject *_inPzUjAhUs9(PyObject *self, PyObject *args); -static PyObject *_inPzUjAhF25(PyObject *self, PyObject *args); -static PyObject *_inPzUjAu1qB(PyObject *self, PyObject *args); -static PyObject *_inPzUjAKMkY(PyObject *self, PyObject *args); -static PyObject *_inPzUjARx9W(PyObject *self, PyObject *args); -static PyObject *_inPzUjA0C9G(PyObject *self, PyObject *args); -static PyObject *_inPzUjAhaPp(PyObject *self, PyObject *args); -static PyObject *_inPzUjAt_1v(PyObject *self, PyObject *args); -static PyObject *_inPzUjA8KQG(PyObject *self, PyObject *args); -static PyObject *_inPzUjAEtIl(PyObject *self, PyObject *args); -static PyObject *_inPzUjARFmo(PyObject *self, PyObject *args); -static PyObject *_inPzUjAWHA0(PyObject *self, PyObject *args); -static PyObject *_inPzUjAcyIl(PyObject *self, PyObject *args); -static PyObject *_inPzUjABnBv(PyObject *self, PyObject *args); -static PyObject *_inPzUjAUvW7(PyObject *self, PyObject *args); -static PyObject *_inPzUjAPdXf(PyObject *self, PyObject *args); -static PyObject *_inPzUjAd0dl(PyObject *self, PyObject *args); -static PyObject *_inPzUjAdVbH(PyObject *self, PyObject *args); -static PyObject *_inPzUjABwF0(PyObject *self, PyObject *args); -static PyObject *_inPzUjA9dPK(PyObject *self, PyObject *args); -static PyObject *_inPzUjAhUwR(PyObject *self, PyObject *args); -static PyObject *_inPzUjAA1eF(PyObject *self, PyObject *args); -static PyObject *_inPzUjA8pBy(PyObject *self, PyObject *args); -static PyObject *_inPzUjA85oW(PyObject *self, PyObject *args); -static PyObject *_inPzUjAYZz0(PyObject *self, PyObject *args); -static PyObject *_inPzUjAzKCA(PyObject *self, PyObject *args); -static PyObject *_inPzUjAsxxs(PyObject *self, PyObject *args); -static PyObject *_inPzUjAMT0z(PyObject *self, PyObject *args); -static PyObject *_inPzUjAiW3v(PyObject *self, PyObject *args); -static PyObject *_inPzUjA4Px8(PyObject *self, PyObject *args); -static PyObject *_inPzUjANHcs(PyObject *self, PyObject *args); -static PyObject *_inPzUjAqHrb(PyObject *self, PyObject *args); -static PyObject *_inPzUjAaOqq(PyObject *self, PyObject *args); -static PyObject *_inPzUjAvue5(PyObject *self, PyObject *args); -static PyObject *_inPzUjAB_n_(PyObject *self, PyObject *args); -static PyObject *_inPzUjADFET(PyObject *self, PyObject *args); -static PyObject *_inPzUjAUyNE(PyObject *self, PyObject *args); -static PyObject *_inPzUjApDlm(PyObject *self, PyObject *args); -static PyObject *_inPzUjAAscF(PyObject *self, PyObject *args); -static PyObject *_inPzUjAYjbU(PyObject *self, PyObject *args); -static PyObject *_inPzUjAWmpU(PyObject *self, PyObject *args); -static PyObject *_inPzUjAnegH(PyObject *self, PyObject *args); -static PyObject *_inPzUjArrnF(PyObject *self, PyObject *args); -static PyObject *_inPzUjA7ShX(PyObject *self, PyObject *args); -static PyObject *_inPzUjAx_aO(PyObject *self, PyObject *args); -static PyObject *_inPzUjApofZ(PyObject *self, PyObject *args); -static PyObject *_inPzUjA2J9C(PyObject *self, PyObject *args); -static PyObject *_inPzUjAA6iz(PyObject *self, PyObject *args); -static PyObject *_inPzUjAa78E(PyObject *self, PyObject *args); -static PyObject *_inPzUjAWD3W(PyObject *self, PyObject *args); -static PyObject *_inPzUjAYuud(PyObject *self, PyObject *args); -static PyObject *_inPzUjAlmJS(PyObject *self, PyObject *args); -static PyObject *_inPzUjALlrr(PyObject *self, PyObject *args); -static PyObject *_inPzUjAw_wy(PyObject *self, PyObject *args); -static PyObject *_inPzUjAgk_l(PyObject *self, PyObject *args); -static PyObject *_inPzUjAXpHY(PyObject *self, PyObject *args); -static PyObject *_inPzUjAHhIg(PyObject *self, PyObject *args); -static PyObject *_inPzUjAff0T(PyObject *self, PyObject *args); -static PyObject *_inPzUjA5PPX(PyObject *self, PyObject *args); -static PyObject *_inPzUjAPww5(PyObject *self, PyObject *args); -static PyObject *_inPzUjAPke3(PyObject *self, PyObject *args); -static PyObject *_inPzUjAJmw3(PyObject *self, PyObject *args); -static PyObject *_inPzUjAR0Lc(PyObject *self, PyObject *args); -static PyObject *_inPzUjAc6gE(PyObject *self, PyObject *args); -static PyObject *_inPzUjA1iT0(PyObject *self, PyObject *args); -static PyObject *_inPzUjAz1Mn(PyObject *self, PyObject *args); -static PyObject *_inPzUjAWlf2(PyObject *self, PyObject *args); -static PyObject *_inPzUjA1q8q(PyObject *self, PyObject *args); -static PyObject *_inPzUjAobo6(PyObject *self, PyObject *args); -static PyObject *_inPzUjAjevK(PyObject *self, PyObject *args); -static PyObject *_inPzUjAeBpM(PyObject *self, PyObject *args); -static PyObject *_inPzUjAfmeN(PyObject *self, PyObject *args); -static PyObject *_inPzUjAKBCl(PyObject *self, PyObject *args); -static PyObject *_inPzUjA936K(PyObject *self, PyObject *args); -static PyObject *_inPzUjAPPXQ(PyObject *self, PyObject *args); -static PyObject *_inPzUjAnu86(PyObject *self, PyObject *args); -static PyObject *_inPzUjAngiq(PyObject *self, PyObject *args); -static PyObject *_inPzUjAUXR0(PyObject *self, PyObject *args); -static PyObject *_inPzUjADO7D(PyObject *self, PyObject *args); -static PyObject *_inPzUjAhZFz(PyObject *self, PyObject *args); -static PyObject *_inPzUjAnKPe(PyObject *self, PyObject *args); -static PyObject *_inPzUjAP3lS(PyObject *self, PyObject *args); -static PyObject *_inPzUjAUlLp(PyObject *self, PyObject *args); -static PyObject *_inPzUjA9Xei(PyObject *self, PyObject *args); -static PyObject *_inPzUjAaGkE(PyObject *self, PyObject *args); -static PyObject *_inPzUjAoe_l(PyObject *self, PyObject *args); -static PyObject *_inPzUjAuEdH(PyObject *self, PyObject *args); +static PyObject *_inPU7VHtbRf(PyObject *self, PyObject *args); +static PyObject *_inPU7VHda_g(PyObject *self, PyObject *args); +static PyObject *_inPU7VH4RgX(PyObject *self, PyObject *args); +static PyObject *_inPU7VH3Gip(PyObject *self, PyObject *args); +static PyObject *_inPU7VHRKDz(PyObject *self, PyObject *args); +static PyObject *_inPU7VHgZ9N(PyObject *self, PyObject *args); +static PyObject *_inPU7VHRQIx(PyObject *self, PyObject *args); +static PyObject *_inPU7VHGVSj(PyObject *self, PyObject *args); +static PyObject *_inPU7VHznM6(PyObject *self, PyObject *args); +static PyObject *_inPU7VHjiLg(PyObject *self, PyObject *args); +static PyObject *_inPU7VH_yjE(PyObject *self, PyObject *args); +static PyObject *_inPU7VHzK9F(PyObject *self, PyObject *args); +static PyObject *_inPU7VHJju_(PyObject *self, PyObject *args); +static PyObject *_inPU7VHZktk(PyObject *self, PyObject *args); +static PyObject *_inPU7VHG71J(PyObject *self, PyObject *args); +static PyObject *_inPU7VHgeUs(PyObject *self, PyObject *args); +static PyObject *_inPU7VH5Gsy(PyObject *self, PyObject *args); +static PyObject *_inPU7VHCSJJ(PyObject *self, PyObject *args); +static PyObject *_inPU7VHkg95(PyObject *self, PyObject *args); +static PyObject *_inPU7VHluRc(PyObject *self, PyObject *args); +static PyObject *_inPU7VHwtTf(PyObject *self, PyObject *args); +static PyObject *_inPU7VHrfao(PyObject *self, PyObject *args); +static PyObject *_inPU7VHcedk(PyObject *self, PyObject *args); +static PyObject *_inPU7VHXmoo(PyObject *self, PyObject *args); +static PyObject *_inPU7VHclIo(PyObject *self, PyObject *args); +static PyObject *_inPU7VHU2_B(PyObject *self, PyObject *args); +static PyObject *_inPU7VHHFO2(PyObject *self, PyObject *args); +static PyObject *_inPU7VHcfjm(PyObject *self, PyObject *args); +static PyObject *_inPU7VH3Sjw(PyObject *self, PyObject *args); +static PyObject *_inPU7VHgJcX(PyObject *self, PyObject *args); +static PyObject *_inPU7VHYlw6(PyObject *self, PyObject *args); +static PyObject *_inPU7VH3gns(PyObject *self, PyObject *args); +static PyObject *_inPU7VHN968(PyObject *self, PyObject *args); +static PyObject *_inPU7VHFJVJ(PyObject *self, PyObject *args); +static PyObject *_inPU7VHndTW(PyObject *self, PyObject *args); +static PyObject *_inPU7VHpjWj(PyObject *self, PyObject *args); +static PyObject *_inPU7VHNcQW(PyObject *self, PyObject *args); +static PyObject *_inPU7VHP_SX(PyObject *self, PyObject *args); +static PyObject *_inPU7VH1iRq(PyObject *self, PyObject *args); +static PyObject *_inPU7VHEmel(PyObject *self, PyObject *args); +static PyObject *_inPU7VH20Vx(PyObject *self, PyObject *args); +static PyObject *_inPU7VHKcdW(PyObject *self, PyObject *args); +static PyObject *_inPU7VHhUs9(PyObject *self, PyObject *args); +static PyObject *_inPU7VHhF25(PyObject *self, PyObject *args); +static PyObject *_inPU7VHu1qB(PyObject *self, PyObject *args); +static PyObject *_inPU7VHKMkY(PyObject *self, PyObject *args); +static PyObject *_inPU7VHRx9W(PyObject *self, PyObject *args); +static PyObject *_inPU7VH0C9G(PyObject *self, PyObject *args); +static PyObject *_inPU7VHhaPp(PyObject *self, PyObject *args); +static PyObject *_inPU7VHt_1v(PyObject *self, PyObject *args); +static PyObject *_inPU7VH8KQG(PyObject *self, PyObject *args); +static PyObject *_inPU7VHEtIl(PyObject *self, PyObject *args); +static PyObject *_inPU7VHRFmo(PyObject *self, PyObject *args); +static PyObject *_inPU7VHWHA0(PyObject *self, PyObject *args); +static PyObject *_inPU7VHcyIl(PyObject *self, PyObject *args); +static PyObject *_inPU7VHBnBv(PyObject *self, PyObject *args); +static PyObject *_inPU7VHUvW7(PyObject *self, PyObject *args); +static PyObject *_inPU7VHPdXf(PyObject *self, PyObject *args); +static PyObject *_inPU7VHd0dl(PyObject *self, PyObject *args); +static PyObject *_inPU7VHdVbH(PyObject *self, PyObject *args); +static PyObject *_inPU7VHBwF0(PyObject *self, PyObject *args); +static PyObject *_inPU7VH9dPK(PyObject *self, PyObject *args); +static PyObject *_inPU7VHhUwR(PyObject *self, PyObject *args); +static PyObject *_inPU7VHA1eF(PyObject *self, PyObject *args); +static PyObject *_inPU7VH8pBy(PyObject *self, PyObject *args); +static PyObject *_inPU7VH85oW(PyObject *self, PyObject *args); +static PyObject *_inPU7VHYZz0(PyObject *self, PyObject *args); +static PyObject *_inPU7VHzKCA(PyObject *self, PyObject *args); +static PyObject *_inPU7VHsxxs(PyObject *self, PyObject *args); +static PyObject *_inPU7VHMT0z(PyObject *self, PyObject *args); +static PyObject *_inPU7VHiW3v(PyObject *self, PyObject *args); +static PyObject *_inPU7VH4Px8(PyObject *self, PyObject *args); +static PyObject *_inPU7VHNHcs(PyObject *self, PyObject *args); +static PyObject *_inPU7VHqHrb(PyObject *self, PyObject *args); +static PyObject *_inPU7VHaOqq(PyObject *self, PyObject *args); +static PyObject *_inPU7VHvue5(PyObject *self, PyObject *args); +static PyObject *_inPU7VHB_n_(PyObject *self, PyObject *args); +static PyObject *_inPU7VHDFET(PyObject *self, PyObject *args); +static PyObject *_inPU7VHUyNE(PyObject *self, PyObject *args); +static PyObject *_inPU7VHpDlm(PyObject *self, PyObject *args); +static PyObject *_inPU7VHAscF(PyObject *self, PyObject *args); +static PyObject *_inPU7VHYjbU(PyObject *self, PyObject *args); +static PyObject *_inPU7VHWmpU(PyObject *self, PyObject *args); +static PyObject *_inPU7VHnegH(PyObject *self, PyObject *args); +static PyObject *_inPU7VHrrnF(PyObject *self, PyObject *args); +static PyObject *_inPU7VH7ShX(PyObject *self, PyObject *args); +static PyObject *_inPU7VHx_aO(PyObject *self, PyObject *args); +static PyObject *_inPU7VHpofZ(PyObject *self, PyObject *args); +static PyObject *_inPU7VH2J9C(PyObject *self, PyObject *args); +static PyObject *_inPU7VHA6iz(PyObject *self, PyObject *args); +static PyObject *_inPU7VHa78E(PyObject *self, PyObject *args); +static PyObject *_inPU7VHWD3W(PyObject *self, PyObject *args); +static PyObject *_inPU7VHYuud(PyObject *self, PyObject *args); +static PyObject *_inPU7VHlmJS(PyObject *self, PyObject *args); +static PyObject *_inPU7VHLlrr(PyObject *self, PyObject *args); +static PyObject *_inPU7VHw_wy(PyObject *self, PyObject *args); +static PyObject *_inPU7VHgk_l(PyObject *self, PyObject *args); +static PyObject *_inPU7VHXpHY(PyObject *self, PyObject *args); +static PyObject *_inPU7VHHhIg(PyObject *self, PyObject *args); +static PyObject *_inPU7VHff0T(PyObject *self, PyObject *args); +static PyObject *_inPU7VH5PPX(PyObject *self, PyObject *args); +static PyObject *_inPU7VHCIt5(PyObject *self, PyObject *args); +static PyObject *_inPU7VHPww5(PyObject *self, PyObject *args); +static PyObject *_inPU7VHPke3(PyObject *self, PyObject *args); +static PyObject *_inPU7VHJmw3(PyObject *self, PyObject *args); +static PyObject *_inPU7VHR0Lc(PyObject *self, PyObject *args); +static PyObject *_inPU7VHc6gE(PyObject *self, PyObject *args); +static PyObject *_inPU7VH1iT0(PyObject *self, PyObject *args); +static PyObject *_inPU7VHz1Mn(PyObject *self, PyObject *args); +static PyObject *_inPU7VHWlf2(PyObject *self, PyObject *args); +static PyObject *_inPU7VH1q8q(PyObject *self, PyObject *args); +static PyObject *_inPU7VHobo6(PyObject *self, PyObject *args); +static PyObject *_inPU7VHjevK(PyObject *self, PyObject *args); +static PyObject *_inPU7VHeBpM(PyObject *self, PyObject *args); +static PyObject *_inPU7VHfmeN(PyObject *self, PyObject *args); +static PyObject *_inPU7VHKBCl(PyObject *self, PyObject *args); +static PyObject *_inPU7VH936K(PyObject *self, PyObject *args); +static PyObject *_inPU7VHPPXQ(PyObject *self, PyObject *args); +static PyObject *_inPU7VHnu86(PyObject *self, PyObject *args); +static PyObject *_inPU7VHngiq(PyObject *self, PyObject *args); +static PyObject *_inPU7VHUXR0(PyObject *self, PyObject *args); +static PyObject *_inPU7VHDO7D(PyObject *self, PyObject *args); +static PyObject *_inPU7VHhZFz(PyObject *self, PyObject *args); +static PyObject *_inPU7VHnKPe(PyObject *self, PyObject *args); +static PyObject *_inPU7VHP3lS(PyObject *self, PyObject *args); +static PyObject *_inPU7VHUlLp(PyObject *self, PyObject *args); +static PyObject *_inPU7VH9Xei(PyObject *self, PyObject *args); +static PyObject *_inPU7VHaGkE(PyObject *self, PyObject *args); +static PyObject *_inPU7VHoe_l(PyObject *self, PyObject *args); +static PyObject *_inPU7VHuEdH(PyObject *self, PyObject *args); /* @@ -155,7 +155,7 @@ static PyObject *_inPzUjAuEdH(PyObject *self, PyObject *args); * void interrogate_add_search_directory(char const *dirname) */ static PyObject * -_inPzUjAtbRf(PyObject *, PyObject *args) { +_inPU7VHtbRf(PyObject *, PyObject *args) { char *param0; if (PyArg_ParseTuple(args, "s", ¶m0)) { interrogate_add_search_directory((char const *)param0); @@ -169,7 +169,7 @@ _inPzUjAtbRf(PyObject *, PyObject *args) { * void interrogate_add_search_path(char const *pathstring) */ static PyObject * -_inPzUjAda_g(PyObject *, PyObject *args) { +_inPU7VHda_g(PyObject *, PyObject *args) { char *param0; if (PyArg_ParseTuple(args, "s", ¶m0)) { interrogate_add_search_path((char const *)param0); @@ -183,7 +183,7 @@ _inPzUjAda_g(PyObject *, PyObject *args) { * bool interrogate_error_flag(void) */ static PyObject * -_inPzUjA4RgX(PyObject *, PyObject *args) { +_inPU7VH4RgX(PyObject *, PyObject *args) { if (PyArg_ParseTuple(args, "")) { bool return_value = interrogate_error_flag(); return PyBool_FromLong(return_value); @@ -196,7 +196,7 @@ _inPzUjA4RgX(PyObject *, PyObject *args) { * int interrogate_number_of_manifests(void) */ static PyObject * -_inPzUjA3Gip(PyObject *, PyObject *args) { +_inPU7VH3Gip(PyObject *, PyObject *args) { if (PyArg_ParseTuple(args, "")) { int return_value = interrogate_number_of_manifests(); #if PY_MAJOR_VERSION >= 3 @@ -213,7 +213,7 @@ _inPzUjA3Gip(PyObject *, PyObject *args) { * int interrogate_get_manifest(int n) */ static PyObject * -_inPzUjARKDz(PyObject *, PyObject *args) { +_inPU7VHRKDz(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_get_manifest((int)param0); @@ -231,7 +231,7 @@ _inPzUjARKDz(PyObject *, PyObject *args) { * int interrogate_get_manifest_by_name(char const *manifest_name) */ static PyObject * -_inPzUjAgZ9N(PyObject *, PyObject *args) { +_inPU7VHgZ9N(PyObject *, PyObject *args) { char *param0; if (PyArg_ParseTuple(args, "s", ¶m0)) { int return_value = interrogate_get_manifest_by_name((char const *)param0); @@ -249,7 +249,7 @@ _inPzUjAgZ9N(PyObject *, PyObject *args) { * char const *interrogate_manifest_name(int manifest) */ static PyObject * -_inPzUjARQIx(PyObject *, PyObject *args) { +_inPU7VHRQIx(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_manifest_name((int)param0); @@ -267,7 +267,7 @@ _inPzUjARQIx(PyObject *, PyObject *args) { * char const *interrogate_manifest_definition(int manifest) */ static PyObject * -_inPzUjAGVSj(PyObject *, PyObject *args) { +_inPU7VHGVSj(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_manifest_definition((int)param0); @@ -285,7 +285,7 @@ _inPzUjAGVSj(PyObject *, PyObject *args) { * bool interrogate_manifest_has_type(int manifest) */ static PyObject * -_inPzUjAznM6(PyObject *, PyObject *args) { +_inPU7VHznM6(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_manifest_has_type((int)param0); @@ -299,7 +299,7 @@ _inPzUjAznM6(PyObject *, PyObject *args) { * int interrogate_manifest_get_type(int manifest) */ static PyObject * -_inPzUjAjiLg(PyObject *, PyObject *args) { +_inPU7VHjiLg(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_manifest_get_type((int)param0); @@ -317,7 +317,7 @@ _inPzUjAjiLg(PyObject *, PyObject *args) { * bool interrogate_manifest_has_getter(int manifest) */ static PyObject * -_inPzUjA_yjE(PyObject *, PyObject *args) { +_inPU7VH_yjE(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_manifest_has_getter((int)param0); @@ -331,7 +331,7 @@ _inPzUjA_yjE(PyObject *, PyObject *args) { * int interrogate_manifest_getter(int manifest) */ static PyObject * -_inPzUjAzK9F(PyObject *, PyObject *args) { +_inPU7VHzK9F(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_manifest_getter((int)param0); @@ -349,7 +349,7 @@ _inPzUjAzK9F(PyObject *, PyObject *args) { * bool interrogate_manifest_has_int_value(int manifest) */ static PyObject * -_inPzUjAJju_(PyObject *, PyObject *args) { +_inPU7VHJju_(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_manifest_has_int_value((int)param0); @@ -363,7 +363,7 @@ _inPzUjAJju_(PyObject *, PyObject *args) { * int interrogate_manifest_get_int_value(int manifest) */ static PyObject * -_inPzUjAZktk(PyObject *, PyObject *args) { +_inPU7VHZktk(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_manifest_get_int_value((int)param0); @@ -381,7 +381,7 @@ _inPzUjAZktk(PyObject *, PyObject *args) { * char const *interrogate_element_name(int element) */ static PyObject * -_inPzUjAG71J(PyObject *, PyObject *args) { +_inPU7VHG71J(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_element_name((int)param0); @@ -399,7 +399,7 @@ _inPzUjAG71J(PyObject *, PyObject *args) { * char const *interrogate_element_scoped_name(int element) */ static PyObject * -_inPzUjAgeUs(PyObject *, PyObject *args) { +_inPU7VHgeUs(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_element_scoped_name((int)param0); @@ -412,12 +412,44 @@ _inPzUjAgeUs(PyObject *, PyObject *args) { return (PyObject *)NULL; } +/* + * Python simple wrapper for + * bool interrogate_element_has_comment(int element) + */ +static PyObject * +_inPU7VH5Gsy(PyObject *, PyObject *args) { + int param0; + if (PyArg_ParseTuple(args, "i", ¶m0)) { + bool return_value = interrogate_element_has_comment((int)param0); + return PyBool_FromLong(return_value); + } + return (PyObject *)NULL; +} + +/* + * Python simple wrapper for + * char const *interrogate_element_comment(int element) + */ +static PyObject * +_inPU7VHCSJJ(PyObject *, PyObject *args) { + int param0; + if (PyArg_ParseTuple(args, "i", ¶m0)) { + char const *return_value = interrogate_element_comment((int)param0); +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(return_value); +#else + return PyString_FromString(return_value); +#endif + } + return (PyObject *)NULL; +} + /* * Python simple wrapper for * int interrogate_get_element_by_name(char const *element_name) */ static PyObject * -_inPzUjAkg95(PyObject *, PyObject *args) { +_inPU7VHkg95(PyObject *, PyObject *args) { char *param0; if (PyArg_ParseTuple(args, "s", ¶m0)) { int return_value = interrogate_get_element_by_name((char const *)param0); @@ -435,7 +467,7 @@ _inPzUjAkg95(PyObject *, PyObject *args) { * int interrogate_get_element_by_scoped_name(char const *element_name) */ static PyObject * -_inPzUjAluRc(PyObject *, PyObject *args) { +_inPU7VHluRc(PyObject *, PyObject *args) { char *param0; if (PyArg_ParseTuple(args, "s", ¶m0)) { int return_value = interrogate_get_element_by_scoped_name((char const *)param0); @@ -453,7 +485,7 @@ _inPzUjAluRc(PyObject *, PyObject *args) { * int interrogate_element_type(int element) */ static PyObject * -_inPzUjAwtTf(PyObject *, PyObject *args) { +_inPU7VHwtTf(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_element_type((int)param0); @@ -471,7 +503,7 @@ _inPzUjAwtTf(PyObject *, PyObject *args) { * bool interrogate_element_has_getter(int element) */ static PyObject * -_inPzUjArfao(PyObject *, PyObject *args) { +_inPU7VHrfao(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_element_has_getter((int)param0); @@ -485,7 +517,7 @@ _inPzUjArfao(PyObject *, PyObject *args) { * int interrogate_element_getter(int element) */ static PyObject * -_inPzUjAcedk(PyObject *, PyObject *args) { +_inPU7VHcedk(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_element_getter((int)param0); @@ -503,7 +535,7 @@ _inPzUjAcedk(PyObject *, PyObject *args) { * bool interrogate_element_has_setter(int element) */ static PyObject * -_inPzUjAXmoo(PyObject *, PyObject *args) { +_inPU7VHXmoo(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_element_has_setter((int)param0); @@ -517,7 +549,7 @@ _inPzUjAXmoo(PyObject *, PyObject *args) { * int interrogate_element_setter(int element) */ static PyObject * -_inPzUjAclIo(PyObject *, PyObject *args) { +_inPU7VHclIo(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_element_setter((int)param0); @@ -535,7 +567,7 @@ _inPzUjAclIo(PyObject *, PyObject *args) { * int interrogate_number_of_globals(void) */ static PyObject * -_inPzUjAU2_B(PyObject *, PyObject *args) { +_inPU7VHU2_B(PyObject *, PyObject *args) { if (PyArg_ParseTuple(args, "")) { int return_value = interrogate_number_of_globals(); #if PY_MAJOR_VERSION >= 3 @@ -552,7 +584,7 @@ _inPzUjAU2_B(PyObject *, PyObject *args) { * int interrogate_get_global(int n) */ static PyObject * -_inPzUjAHFO2(PyObject *, PyObject *args) { +_inPU7VHHFO2(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_get_global((int)param0); @@ -570,7 +602,7 @@ _inPzUjAHFO2(PyObject *, PyObject *args) { * int interrogate_number_of_global_functions(void) */ static PyObject * -_inPzUjAcfjm(PyObject *, PyObject *args) { +_inPU7VHcfjm(PyObject *, PyObject *args) { if (PyArg_ParseTuple(args, "")) { int return_value = interrogate_number_of_global_functions(); #if PY_MAJOR_VERSION >= 3 @@ -587,7 +619,7 @@ _inPzUjAcfjm(PyObject *, PyObject *args) { * int interrogate_get_global_function(int n) */ static PyObject * -_inPzUjA3Sjw(PyObject *, PyObject *args) { +_inPU7VH3Sjw(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_get_global_function((int)param0); @@ -605,7 +637,7 @@ _inPzUjA3Sjw(PyObject *, PyObject *args) { * int interrogate_number_of_functions(void) */ static PyObject * -_inPzUjAgJcX(PyObject *, PyObject *args) { +_inPU7VHgJcX(PyObject *, PyObject *args) { if (PyArg_ParseTuple(args, "")) { int return_value = interrogate_number_of_functions(); #if PY_MAJOR_VERSION >= 3 @@ -622,7 +654,7 @@ _inPzUjAgJcX(PyObject *, PyObject *args) { * int interrogate_get_function(int n) */ static PyObject * -_inPzUjAYlw6(PyObject *, PyObject *args) { +_inPU7VHYlw6(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_get_function((int)param0); @@ -640,7 +672,7 @@ _inPzUjAYlw6(PyObject *, PyObject *args) { * char const *interrogate_function_name(int function) */ static PyObject * -_inPzUjA3gns(PyObject *, PyObject *args) { +_inPU7VH3gns(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_function_name((int)param0); @@ -658,7 +690,7 @@ _inPzUjA3gns(PyObject *, PyObject *args) { * char const *interrogate_function_scoped_name(int function) */ static PyObject * -_inPzUjAN968(PyObject *, PyObject *args) { +_inPU7VHN968(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_function_scoped_name((int)param0); @@ -676,7 +708,7 @@ _inPzUjAN968(PyObject *, PyObject *args) { * bool interrogate_function_has_comment(int function) */ static PyObject * -_inPzUjAFJVJ(PyObject *, PyObject *args) { +_inPU7VHFJVJ(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_function_has_comment((int)param0); @@ -690,7 +722,7 @@ _inPzUjAFJVJ(PyObject *, PyObject *args) { * char const *interrogate_function_comment(int function) */ static PyObject * -_inPzUjAndTW(PyObject *, PyObject *args) { +_inPU7VHndTW(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_function_comment((int)param0); @@ -708,7 +740,7 @@ _inPzUjAndTW(PyObject *, PyObject *args) { * char const *interrogate_function_prototype(int function) */ static PyObject * -_inPzUjApjWj(PyObject *, PyObject *args) { +_inPU7VHpjWj(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_function_prototype((int)param0); @@ -726,7 +758,7 @@ _inPzUjApjWj(PyObject *, PyObject *args) { * bool interrogate_function_is_method(int function) */ static PyObject * -_inPzUjANcQW(PyObject *, PyObject *args) { +_inPU7VHNcQW(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_function_is_method((int)param0); @@ -740,7 +772,7 @@ _inPzUjANcQW(PyObject *, PyObject *args) { * int interrogate_function_class(int function) */ static PyObject * -_inPzUjAP_SX(PyObject *, PyObject *args) { +_inPU7VHP_SX(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_function_class((int)param0); @@ -758,7 +790,7 @@ _inPzUjAP_SX(PyObject *, PyObject *args) { * bool interrogate_function_has_module_name(int function) */ static PyObject * -_inPzUjA1iRq(PyObject *, PyObject *args) { +_inPU7VH1iRq(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_function_has_module_name((int)param0); @@ -772,7 +804,7 @@ _inPzUjA1iRq(PyObject *, PyObject *args) { * char const *interrogate_function_module_name(int function) */ static PyObject * -_inPzUjAEmel(PyObject *, PyObject *args) { +_inPU7VHEmel(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_function_module_name((int)param0); @@ -790,7 +822,7 @@ _inPzUjAEmel(PyObject *, PyObject *args) { * bool interrogate_function_has_library_name(int function) */ static PyObject * -_inPzUjA20Vx(PyObject *, PyObject *args) { +_inPU7VH20Vx(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_function_has_library_name((int)param0); @@ -804,7 +836,7 @@ _inPzUjA20Vx(PyObject *, PyObject *args) { * char const *interrogate_function_library_name(int function) */ static PyObject * -_inPzUjAKcdW(PyObject *, PyObject *args) { +_inPU7VHKcdW(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_function_library_name((int)param0); @@ -822,7 +854,7 @@ _inPzUjAKcdW(PyObject *, PyObject *args) { * bool interrogate_function_is_virtual(int function) */ static PyObject * -_inPzUjAhUs9(PyObject *, PyObject *args) { +_inPU7VHhUs9(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_function_is_virtual((int)param0); @@ -836,7 +868,7 @@ _inPzUjAhUs9(PyObject *, PyObject *args) { * int interrogate_function_number_of_c_wrappers(int function) */ static PyObject * -_inPzUjAhF25(PyObject *, PyObject *args) { +_inPU7VHhF25(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_function_number_of_c_wrappers((int)param0); @@ -854,7 +886,7 @@ _inPzUjAhF25(PyObject *, PyObject *args) { * int interrogate_function_c_wrapper(int function, int n) */ static PyObject * -_inPzUjAu1qB(PyObject *, PyObject *args) { +_inPU7VHu1qB(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -873,7 +905,7 @@ _inPzUjAu1qB(PyObject *, PyObject *args) { * int interrogate_function_number_of_python_wrappers(int function) */ static PyObject * -_inPzUjAKMkY(PyObject *, PyObject *args) { +_inPU7VHKMkY(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_function_number_of_python_wrappers((int)param0); @@ -891,7 +923,7 @@ _inPzUjAKMkY(PyObject *, PyObject *args) { * int interrogate_function_python_wrapper(int function, int n) */ static PyObject * -_inPzUjARx9W(PyObject *, PyObject *args) { +_inPU7VHRx9W(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -910,7 +942,7 @@ _inPzUjARx9W(PyObject *, PyObject *args) { * char const *interrogate_wrapper_name(int wrapper) */ static PyObject * -_inPzUjA0C9G(PyObject *, PyObject *args) { +_inPU7VH0C9G(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_wrapper_name((int)param0); @@ -928,7 +960,7 @@ _inPzUjA0C9G(PyObject *, PyObject *args) { * bool interrogate_wrapper_is_callable_by_name(int wrapper) */ static PyObject * -_inPzUjAhaPp(PyObject *, PyObject *args) { +_inPU7VHhaPp(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_wrapper_is_callable_by_name((int)param0); @@ -942,7 +974,7 @@ _inPzUjAhaPp(PyObject *, PyObject *args) { * bool interrogate_wrapper_has_comment(int wrapper) */ static PyObject * -_inPzUjAt_1v(PyObject *, PyObject *args) { +_inPU7VHt_1v(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_wrapper_has_comment((int)param0); @@ -956,7 +988,7 @@ _inPzUjAt_1v(PyObject *, PyObject *args) { * char const *interrogate_wrapper_comment(int wrapper) */ static PyObject * -_inPzUjA8KQG(PyObject *, PyObject *args) { +_inPU7VH8KQG(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_wrapper_comment((int)param0); @@ -974,7 +1006,7 @@ _inPzUjA8KQG(PyObject *, PyObject *args) { * bool interrogate_wrapper_has_return_value(int wrapper) */ static PyObject * -_inPzUjAEtIl(PyObject *, PyObject *args) { +_inPU7VHEtIl(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_wrapper_has_return_value((int)param0); @@ -988,7 +1020,7 @@ _inPzUjAEtIl(PyObject *, PyObject *args) { * int interrogate_wrapper_return_type(int wrapper) */ static PyObject * -_inPzUjARFmo(PyObject *, PyObject *args) { +_inPU7VHRFmo(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_wrapper_return_type((int)param0); @@ -1006,7 +1038,7 @@ _inPzUjARFmo(PyObject *, PyObject *args) { * bool interrogate_wrapper_caller_manages_return_value(int wrapper) */ static PyObject * -_inPzUjAWHA0(PyObject *, PyObject *args) { +_inPU7VHWHA0(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_wrapper_caller_manages_return_value((int)param0); @@ -1020,7 +1052,7 @@ _inPzUjAWHA0(PyObject *, PyObject *args) { * int interrogate_wrapper_return_value_destructor(int wrapper) */ static PyObject * -_inPzUjAcyIl(PyObject *, PyObject *args) { +_inPU7VHcyIl(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_wrapper_return_value_destructor((int)param0); @@ -1038,7 +1070,7 @@ _inPzUjAcyIl(PyObject *, PyObject *args) { * int interrogate_wrapper_number_of_parameters(int wrapper) */ static PyObject * -_inPzUjABnBv(PyObject *, PyObject *args) { +_inPU7VHBnBv(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_wrapper_number_of_parameters((int)param0); @@ -1056,7 +1088,7 @@ _inPzUjABnBv(PyObject *, PyObject *args) { * int interrogate_wrapper_parameter_type(int wrapper, int n) */ static PyObject * -_inPzUjAUvW7(PyObject *, PyObject *args) { +_inPU7VHUvW7(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -1075,7 +1107,7 @@ _inPzUjAUvW7(PyObject *, PyObject *args) { * bool interrogate_wrapper_parameter_has_name(int wrapper, int n) */ static PyObject * -_inPzUjAPdXf(PyObject *, PyObject *args) { +_inPU7VHPdXf(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -1090,7 +1122,7 @@ _inPzUjAPdXf(PyObject *, PyObject *args) { * char const *interrogate_wrapper_parameter_name(int wrapper, int n) */ static PyObject * -_inPzUjAd0dl(PyObject *, PyObject *args) { +_inPU7VHd0dl(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -1109,7 +1141,7 @@ _inPzUjAd0dl(PyObject *, PyObject *args) { * bool interrogate_wrapper_parameter_is_this(int wrapper, int n) */ static PyObject * -_inPzUjAdVbH(PyObject *, PyObject *args) { +_inPU7VHdVbH(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -1124,7 +1156,7 @@ _inPzUjAdVbH(PyObject *, PyObject *args) { * bool interrogate_wrapper_has_pointer(int wrapper) */ static PyObject * -_inPzUjABwF0(PyObject *, PyObject *args) { +_inPU7VHBwF0(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_wrapper_has_pointer((int)param0); @@ -1138,7 +1170,7 @@ _inPzUjABwF0(PyObject *, PyObject *args) { * void *interrogate_wrapper_pointer(int wrapper) */ static PyObject * -_inPzUjA9dPK(PyObject *, PyObject *args) { +_inPU7VH9dPK(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { interrogate_wrapper_pointer((int)param0); @@ -1152,7 +1184,7 @@ _inPzUjA9dPK(PyObject *, PyObject *args) { * char const *interrogate_wrapper_unique_name(int wrapper) */ static PyObject * -_inPzUjAhUwR(PyObject *, PyObject *args) { +_inPU7VHhUwR(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_wrapper_unique_name((int)param0); @@ -1170,7 +1202,7 @@ _inPzUjAhUwR(PyObject *, PyObject *args) { * int interrogate_get_wrapper_by_unique_name(char const *unique_name) */ static PyObject * -_inPzUjAA1eF(PyObject *, PyObject *args) { +_inPU7VHA1eF(PyObject *, PyObject *args) { char *param0; if (PyArg_ParseTuple(args, "s", ¶m0)) { int return_value = interrogate_get_wrapper_by_unique_name((char const *)param0); @@ -1188,7 +1220,7 @@ _inPzUjAA1eF(PyObject *, PyObject *args) { * int interrogate_make_seq_class(int make_seq) */ static PyObject * -_inPzUjA8pBy(PyObject *, PyObject *args) { +_inPU7VH8pBy(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_make_seq_class((int)param0); @@ -1206,7 +1238,7 @@ _inPzUjA8pBy(PyObject *, PyObject *args) { * char const *interrogate_make_seq_seq_name(int make_seq) */ static PyObject * -_inPzUjA85oW(PyObject *, PyObject *args) { +_inPU7VH85oW(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_make_seq_seq_name((int)param0); @@ -1224,7 +1256,7 @@ _inPzUjA85oW(PyObject *, PyObject *args) { * char const *interrogate_make_seq_num_name(int make_seq) */ static PyObject * -_inPzUjAYZz0(PyObject *, PyObject *args) { +_inPU7VHYZz0(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_make_seq_num_name((int)param0); @@ -1242,7 +1274,7 @@ _inPzUjAYZz0(PyObject *, PyObject *args) { * char const *interrogate_make_seq_element_name(int make_seq) */ static PyObject * -_inPzUjAzKCA(PyObject *, PyObject *args) { +_inPU7VHzKCA(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_make_seq_element_name((int)param0); @@ -1260,7 +1292,7 @@ _inPzUjAzKCA(PyObject *, PyObject *args) { * int interrogate_number_of_global_types(void) */ static PyObject * -_inPzUjAsxxs(PyObject *, PyObject *args) { +_inPU7VHsxxs(PyObject *, PyObject *args) { if (PyArg_ParseTuple(args, "")) { int return_value = interrogate_number_of_global_types(); #if PY_MAJOR_VERSION >= 3 @@ -1277,7 +1309,7 @@ _inPzUjAsxxs(PyObject *, PyObject *args) { * int interrogate_get_global_type(int n) */ static PyObject * -_inPzUjAMT0z(PyObject *, PyObject *args) { +_inPU7VHMT0z(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_get_global_type((int)param0); @@ -1295,7 +1327,7 @@ _inPzUjAMT0z(PyObject *, PyObject *args) { * int interrogate_number_of_types(void) */ static PyObject * -_inPzUjAiW3v(PyObject *, PyObject *args) { +_inPU7VHiW3v(PyObject *, PyObject *args) { if (PyArg_ParseTuple(args, "")) { int return_value = interrogate_number_of_types(); #if PY_MAJOR_VERSION >= 3 @@ -1312,7 +1344,7 @@ _inPzUjAiW3v(PyObject *, PyObject *args) { * int interrogate_get_type(int n) */ static PyObject * -_inPzUjA4Px8(PyObject *, PyObject *args) { +_inPU7VH4Px8(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_get_type((int)param0); @@ -1330,7 +1362,7 @@ _inPzUjA4Px8(PyObject *, PyObject *args) { * int interrogate_get_type_by_name(char const *type_name) */ static PyObject * -_inPzUjANHcs(PyObject *, PyObject *args) { +_inPU7VHNHcs(PyObject *, PyObject *args) { char *param0; if (PyArg_ParseTuple(args, "s", ¶m0)) { int return_value = interrogate_get_type_by_name((char const *)param0); @@ -1348,7 +1380,7 @@ _inPzUjANHcs(PyObject *, PyObject *args) { * int interrogate_get_type_by_scoped_name(char const *type_name) */ static PyObject * -_inPzUjAqHrb(PyObject *, PyObject *args) { +_inPU7VHqHrb(PyObject *, PyObject *args) { char *param0; if (PyArg_ParseTuple(args, "s", ¶m0)) { int return_value = interrogate_get_type_by_scoped_name((char const *)param0); @@ -1366,7 +1398,7 @@ _inPzUjAqHrb(PyObject *, PyObject *args) { * int interrogate_get_type_by_true_name(char const *type_name) */ static PyObject * -_inPzUjAaOqq(PyObject *, PyObject *args) { +_inPU7VHaOqq(PyObject *, PyObject *args) { char *param0; if (PyArg_ParseTuple(args, "s", ¶m0)) { int return_value = interrogate_get_type_by_true_name((char const *)param0); @@ -1384,7 +1416,7 @@ _inPzUjAaOqq(PyObject *, PyObject *args) { * char const *interrogate_type_name(int type) */ static PyObject * -_inPzUjAvue5(PyObject *, PyObject *args) { +_inPU7VHvue5(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_type_name((int)param0); @@ -1402,7 +1434,7 @@ _inPzUjAvue5(PyObject *, PyObject *args) { * char const *interrogate_type_scoped_name(int type) */ static PyObject * -_inPzUjAB_n_(PyObject *, PyObject *args) { +_inPU7VHB_n_(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_type_scoped_name((int)param0); @@ -1420,7 +1452,7 @@ _inPzUjAB_n_(PyObject *, PyObject *args) { * char const *interrogate_type_true_name(int type) */ static PyObject * -_inPzUjADFET(PyObject *, PyObject *args) { +_inPU7VHDFET(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_type_true_name((int)param0); @@ -1438,7 +1470,7 @@ _inPzUjADFET(PyObject *, PyObject *args) { * bool interrogate_type_is_nested(int type) */ static PyObject * -_inPzUjAUyNE(PyObject *, PyObject *args) { +_inPU7VHUyNE(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_nested((int)param0); @@ -1452,7 +1484,7 @@ _inPzUjAUyNE(PyObject *, PyObject *args) { * int interrogate_type_outer_class(int type) */ static PyObject * -_inPzUjApDlm(PyObject *, PyObject *args) { +_inPU7VHpDlm(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_type_outer_class((int)param0); @@ -1470,7 +1502,7 @@ _inPzUjApDlm(PyObject *, PyObject *args) { * bool interrogate_type_has_comment(int type) */ static PyObject * -_inPzUjAAscF(PyObject *, PyObject *args) { +_inPU7VHAscF(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_has_comment((int)param0); @@ -1484,7 +1516,7 @@ _inPzUjAAscF(PyObject *, PyObject *args) { * char const *interrogate_type_comment(int type) */ static PyObject * -_inPzUjAYjbU(PyObject *, PyObject *args) { +_inPU7VHYjbU(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_type_comment((int)param0); @@ -1502,7 +1534,7 @@ _inPzUjAYjbU(PyObject *, PyObject *args) { * bool interrogate_type_has_module_name(int type) */ static PyObject * -_inPzUjAWmpU(PyObject *, PyObject *args) { +_inPU7VHWmpU(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_has_module_name((int)param0); @@ -1516,7 +1548,7 @@ _inPzUjAWmpU(PyObject *, PyObject *args) { * char const *interrogate_type_module_name(int type) */ static PyObject * -_inPzUjAnegH(PyObject *, PyObject *args) { +_inPU7VHnegH(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_type_module_name((int)param0); @@ -1534,7 +1566,7 @@ _inPzUjAnegH(PyObject *, PyObject *args) { * bool interrogate_type_has_library_name(int type) */ static PyObject * -_inPzUjArrnF(PyObject *, PyObject *args) { +_inPU7VHrrnF(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_has_library_name((int)param0); @@ -1548,7 +1580,7 @@ _inPzUjArrnF(PyObject *, PyObject *args) { * char const *interrogate_type_library_name(int type) */ static PyObject * -_inPzUjA7ShX(PyObject *, PyObject *args) { +_inPU7VH7ShX(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_type_library_name((int)param0); @@ -1566,7 +1598,7 @@ _inPzUjA7ShX(PyObject *, PyObject *args) { * bool interrogate_type_is_atomic(int type) */ static PyObject * -_inPzUjAx_aO(PyObject *, PyObject *args) { +_inPU7VHx_aO(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_atomic((int)param0); @@ -1580,7 +1612,7 @@ _inPzUjAx_aO(PyObject *, PyObject *args) { * AtomicToken interrogate_type_atomic_token(int type) */ static PyObject * -_inPzUjApofZ(PyObject *, PyObject *args) { +_inPU7VHpofZ(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { AtomicToken return_value = interrogate_type_atomic_token((int)param0); @@ -1598,7 +1630,7 @@ _inPzUjApofZ(PyObject *, PyObject *args) { * bool interrogate_type_is_unsigned(int type) */ static PyObject * -_inPzUjA2J9C(PyObject *, PyObject *args) { +_inPU7VH2J9C(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_unsigned((int)param0); @@ -1612,7 +1644,7 @@ _inPzUjA2J9C(PyObject *, PyObject *args) { * bool interrogate_type_is_signed(int type) */ static PyObject * -_inPzUjAA6iz(PyObject *, PyObject *args) { +_inPU7VHA6iz(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_signed((int)param0); @@ -1626,7 +1658,7 @@ _inPzUjAA6iz(PyObject *, PyObject *args) { * bool interrogate_type_is_long(int type) */ static PyObject * -_inPzUjAa78E(PyObject *, PyObject *args) { +_inPU7VHa78E(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_long((int)param0); @@ -1640,7 +1672,7 @@ _inPzUjAa78E(PyObject *, PyObject *args) { * bool interrogate_type_is_longlong(int type) */ static PyObject * -_inPzUjAWD3W(PyObject *, PyObject *args) { +_inPU7VHWD3W(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_longlong((int)param0); @@ -1654,7 +1686,7 @@ _inPzUjAWD3W(PyObject *, PyObject *args) { * bool interrogate_type_is_short(int type) */ static PyObject * -_inPzUjAYuud(PyObject *, PyObject *args) { +_inPU7VHYuud(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_short((int)param0); @@ -1668,7 +1700,7 @@ _inPzUjAYuud(PyObject *, PyObject *args) { * bool interrogate_type_is_wrapped(int type) */ static PyObject * -_inPzUjAlmJS(PyObject *, PyObject *args) { +_inPU7VHlmJS(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_wrapped((int)param0); @@ -1682,7 +1714,7 @@ _inPzUjAlmJS(PyObject *, PyObject *args) { * bool interrogate_type_is_pointer(int type) */ static PyObject * -_inPzUjALlrr(PyObject *, PyObject *args) { +_inPU7VHLlrr(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_pointer((int)param0); @@ -1696,7 +1728,7 @@ _inPzUjALlrr(PyObject *, PyObject *args) { * bool interrogate_type_is_const(int type) */ static PyObject * -_inPzUjAw_wy(PyObject *, PyObject *args) { +_inPU7VHw_wy(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_const((int)param0); @@ -1710,7 +1742,7 @@ _inPzUjAw_wy(PyObject *, PyObject *args) { * int interrogate_type_wrapped_type(int type) */ static PyObject * -_inPzUjAgk_l(PyObject *, PyObject *args) { +_inPU7VHgk_l(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_type_wrapped_type((int)param0); @@ -1728,7 +1760,7 @@ _inPzUjAgk_l(PyObject *, PyObject *args) { * bool interrogate_type_is_enum(int type) */ static PyObject * -_inPzUjAXpHY(PyObject *, PyObject *args) { +_inPU7VHXpHY(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_enum((int)param0); @@ -1742,7 +1774,7 @@ _inPzUjAXpHY(PyObject *, PyObject *args) { * int interrogate_type_number_of_enum_values(int type) */ static PyObject * -_inPzUjAHhIg(PyObject *, PyObject *args) { +_inPU7VHHhIg(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_type_number_of_enum_values((int)param0); @@ -1760,7 +1792,7 @@ _inPzUjAHhIg(PyObject *, PyObject *args) { * char const *interrogate_type_enum_value_name(int type, int n) */ static PyObject * -_inPzUjAff0T(PyObject *, PyObject *args) { +_inPU7VHff0T(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -1779,7 +1811,7 @@ _inPzUjAff0T(PyObject *, PyObject *args) { * char const *interrogate_type_enum_value_scoped_name(int type, int n) */ static PyObject * -_inPzUjA5PPX(PyObject *, PyObject *args) { +_inPU7VH5PPX(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -1793,12 +1825,31 @@ _inPzUjA5PPX(PyObject *, PyObject *args) { return (PyObject *)NULL; } +/* + * Python simple wrapper for + * char const *interrogate_type_enum_value_comment(int type, int n) + */ +static PyObject * +_inPU7VHCIt5(PyObject *, PyObject *args) { + int param0; + int param1; + if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { + char const *return_value = interrogate_type_enum_value_comment((int)param0, (int)param1); +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(return_value); +#else + return PyString_FromString(return_value); +#endif + } + return (PyObject *)NULL; +} + /* * Python simple wrapper for * int interrogate_type_enum_value(int type, int n) */ static PyObject * -_inPzUjAPww5(PyObject *, PyObject *args) { +_inPU7VHPww5(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -1817,7 +1868,7 @@ _inPzUjAPww5(PyObject *, PyObject *args) { * bool interrogate_type_is_struct(int type) */ static PyObject * -_inPzUjAPke3(PyObject *, PyObject *args) { +_inPU7VHPke3(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_struct((int)param0); @@ -1831,7 +1882,7 @@ _inPzUjAPke3(PyObject *, PyObject *args) { * bool interrogate_type_is_class(int type) */ static PyObject * -_inPzUjAJmw3(PyObject *, PyObject *args) { +_inPU7VHJmw3(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_class((int)param0); @@ -1845,7 +1896,7 @@ _inPzUjAJmw3(PyObject *, PyObject *args) { * bool interrogate_type_is_union(int type) */ static PyObject * -_inPzUjAR0Lc(PyObject *, PyObject *args) { +_inPU7VHR0Lc(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_union((int)param0); @@ -1859,7 +1910,7 @@ _inPzUjAR0Lc(PyObject *, PyObject *args) { * bool interrogate_type_is_fully_defined(int type) */ static PyObject * -_inPzUjAc6gE(PyObject *, PyObject *args) { +_inPU7VHc6gE(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_fully_defined((int)param0); @@ -1873,7 +1924,7 @@ _inPzUjAc6gE(PyObject *, PyObject *args) { * bool interrogate_type_is_unpublished(int type) */ static PyObject * -_inPzUjA1iT0(PyObject *, PyObject *args) { +_inPU7VH1iT0(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_unpublished((int)param0); @@ -1887,7 +1938,7 @@ _inPzUjA1iT0(PyObject *, PyObject *args) { * int interrogate_type_number_of_constructors(int type) */ static PyObject * -_inPzUjAz1Mn(PyObject *, PyObject *args) { +_inPU7VHz1Mn(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_type_number_of_constructors((int)param0); @@ -1905,7 +1956,7 @@ _inPzUjAz1Mn(PyObject *, PyObject *args) { * int interrogate_type_get_constructor(int type, int n) */ static PyObject * -_inPzUjAWlf2(PyObject *, PyObject *args) { +_inPU7VHWlf2(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -1924,7 +1975,7 @@ _inPzUjAWlf2(PyObject *, PyObject *args) { * bool interrogate_type_has_destructor(int type) */ static PyObject * -_inPzUjA1q8q(PyObject *, PyObject *args) { +_inPU7VH1q8q(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_has_destructor((int)param0); @@ -1938,7 +1989,7 @@ _inPzUjA1q8q(PyObject *, PyObject *args) { * bool interrogate_type_destructor_is_inherited(int type) */ static PyObject * -_inPzUjAobo6(PyObject *, PyObject *args) { +_inPU7VHobo6(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_destructor_is_inherited((int)param0); @@ -1952,7 +2003,7 @@ _inPzUjAobo6(PyObject *, PyObject *args) { * int interrogate_type_get_destructor(int type) */ static PyObject * -_inPzUjAjevK(PyObject *, PyObject *args) { +_inPU7VHjevK(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_type_get_destructor((int)param0); @@ -1970,7 +2021,7 @@ _inPzUjAjevK(PyObject *, PyObject *args) { * int interrogate_type_number_of_elements(int type) */ static PyObject * -_inPzUjAeBpM(PyObject *, PyObject *args) { +_inPU7VHeBpM(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_type_number_of_elements((int)param0); @@ -1988,7 +2039,7 @@ _inPzUjAeBpM(PyObject *, PyObject *args) { * int interrogate_type_get_element(int type, int n) */ static PyObject * -_inPzUjAfmeN(PyObject *, PyObject *args) { +_inPU7VHfmeN(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2007,7 +2058,7 @@ _inPzUjAfmeN(PyObject *, PyObject *args) { * int interrogate_type_number_of_methods(int type) */ static PyObject * -_inPzUjAKBCl(PyObject *, PyObject *args) { +_inPU7VHKBCl(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_type_number_of_methods((int)param0); @@ -2025,7 +2076,7 @@ _inPzUjAKBCl(PyObject *, PyObject *args) { * int interrogate_type_get_method(int type, int n) */ static PyObject * -_inPzUjA936K(PyObject *, PyObject *args) { +_inPU7VH936K(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2044,7 +2095,7 @@ _inPzUjA936K(PyObject *, PyObject *args) { * int interrogate_type_number_of_make_seqs(int type) */ static PyObject * -_inPzUjAPPXQ(PyObject *, PyObject *args) { +_inPU7VHPPXQ(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_type_number_of_make_seqs((int)param0); @@ -2062,7 +2113,7 @@ _inPzUjAPPXQ(PyObject *, PyObject *args) { * int interrogate_type_get_make_seq(int type, int n) */ static PyObject * -_inPzUjAnu86(PyObject *, PyObject *args) { +_inPU7VHnu86(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2081,7 +2132,7 @@ _inPzUjAnu86(PyObject *, PyObject *args) { * int interrogate_type_number_of_casts(int type) */ static PyObject * -_inPzUjAngiq(PyObject *, PyObject *args) { +_inPU7VHngiq(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_type_number_of_casts((int)param0); @@ -2099,7 +2150,7 @@ _inPzUjAngiq(PyObject *, PyObject *args) { * int interrogate_type_get_cast(int type, int n) */ static PyObject * -_inPzUjAUXR0(PyObject *, PyObject *args) { +_inPU7VHUXR0(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2118,7 +2169,7 @@ _inPzUjAUXR0(PyObject *, PyObject *args) { * int interrogate_type_number_of_derivations(int type) */ static PyObject * -_inPzUjADO7D(PyObject *, PyObject *args) { +_inPU7VHDO7D(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_type_number_of_derivations((int)param0); @@ -2136,7 +2187,7 @@ _inPzUjADO7D(PyObject *, PyObject *args) { * int interrogate_type_get_derivation(int type, int n) */ static PyObject * -_inPzUjAhZFz(PyObject *, PyObject *args) { +_inPU7VHhZFz(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2155,7 +2206,7 @@ _inPzUjAhZFz(PyObject *, PyObject *args) { * bool interrogate_type_derivation_has_upcast(int type, int n) */ static PyObject * -_inPzUjAnKPe(PyObject *, PyObject *args) { +_inPU7VHnKPe(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2170,7 +2221,7 @@ _inPzUjAnKPe(PyObject *, PyObject *args) { * int interrogate_type_get_upcast(int type, int n) */ static PyObject * -_inPzUjAP3lS(PyObject *, PyObject *args) { +_inPU7VHP3lS(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2189,7 +2240,7 @@ _inPzUjAP3lS(PyObject *, PyObject *args) { * bool interrogate_type_derivation_downcast_is_impossible(int type, int n) */ static PyObject * -_inPzUjAUlLp(PyObject *, PyObject *args) { +_inPU7VHUlLp(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2204,7 +2255,7 @@ _inPzUjAUlLp(PyObject *, PyObject *args) { * bool interrogate_type_derivation_has_downcast(int type, int n) */ static PyObject * -_inPzUjA9Xei(PyObject *, PyObject *args) { +_inPU7VH9Xei(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2219,7 +2270,7 @@ _inPzUjA9Xei(PyObject *, PyObject *args) { * int interrogate_type_get_downcast(int type, int n) */ static PyObject * -_inPzUjAaGkE(PyObject *, PyObject *args) { +_inPU7VHaGkE(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2238,7 +2289,7 @@ _inPzUjAaGkE(PyObject *, PyObject *args) { * int interrogate_type_number_of_nested_types(int type) */ static PyObject * -_inPzUjAoe_l(PyObject *, PyObject *args) { +_inPU7VHoe_l(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_type_number_of_nested_types((int)param0); @@ -2256,7 +2307,7 @@ _inPzUjAoe_l(PyObject *, PyObject *args) { * int interrogate_type_get_nested_type(int type, int n) */ static PyObject * -_inPzUjAuEdH(PyObject *, PyObject *args) { +_inPU7VHuEdH(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2272,149 +2323,152 @@ _inPzUjAuEdH(PyObject *, PyObject *args) { static PyMethodDef python_simple_funcs[] = { - { "interrogate_add_search_directory", &_inPzUjAtbRf, METH_VARARGS }, - { "interrogate_add_search_path", &_inPzUjAda_g, METH_VARARGS }, - { "interrogate_error_flag", &_inPzUjA4RgX, METH_VARARGS }, - { "interrogate_number_of_manifests", &_inPzUjA3Gip, METH_VARARGS }, - { "interrogate_get_manifest", &_inPzUjARKDz, METH_VARARGS }, - { "interrogate_get_manifest_by_name", &_inPzUjAgZ9N, METH_VARARGS }, - { "interrogate_manifest_name", &_inPzUjARQIx, METH_VARARGS }, - { "interrogate_manifest_definition", &_inPzUjAGVSj, METH_VARARGS }, - { "interrogate_manifest_has_type", &_inPzUjAznM6, METH_VARARGS }, - { "interrogate_manifest_get_type", &_inPzUjAjiLg, METH_VARARGS }, - { "interrogate_manifest_has_getter", &_inPzUjA_yjE, METH_VARARGS }, - { "interrogate_manifest_getter", &_inPzUjAzK9F, METH_VARARGS }, - { "interrogate_manifest_has_int_value", &_inPzUjAJju_, METH_VARARGS }, - { "interrogate_manifest_get_int_value", &_inPzUjAZktk, METH_VARARGS }, - { "interrogate_element_name", &_inPzUjAG71J, METH_VARARGS }, - { "interrogate_element_scoped_name", &_inPzUjAgeUs, METH_VARARGS }, - { "interrogate_get_element_by_name", &_inPzUjAkg95, METH_VARARGS }, - { "interrogate_get_element_by_scoped_name", &_inPzUjAluRc, METH_VARARGS }, - { "interrogate_element_type", &_inPzUjAwtTf, METH_VARARGS }, - { "interrogate_element_has_getter", &_inPzUjArfao, METH_VARARGS }, - { "interrogate_element_getter", &_inPzUjAcedk, METH_VARARGS }, - { "interrogate_element_has_setter", &_inPzUjAXmoo, METH_VARARGS }, - { "interrogate_element_setter", &_inPzUjAclIo, METH_VARARGS }, - { "interrogate_number_of_globals", &_inPzUjAU2_B, METH_VARARGS }, - { "interrogate_get_global", &_inPzUjAHFO2, METH_VARARGS }, - { "interrogate_number_of_global_functions", &_inPzUjAcfjm, METH_VARARGS }, - { "interrogate_get_global_function", &_inPzUjA3Sjw, METH_VARARGS }, - { "interrogate_number_of_functions", &_inPzUjAgJcX, METH_VARARGS }, - { "interrogate_get_function", &_inPzUjAYlw6, METH_VARARGS }, - { "interrogate_function_name", &_inPzUjA3gns, METH_VARARGS }, - { "interrogate_function_scoped_name", &_inPzUjAN968, METH_VARARGS }, - { "interrogate_function_has_comment", &_inPzUjAFJVJ, METH_VARARGS }, - { "interrogate_function_comment", &_inPzUjAndTW, METH_VARARGS }, - { "interrogate_function_prototype", &_inPzUjApjWj, METH_VARARGS }, - { "interrogate_function_is_method", &_inPzUjANcQW, METH_VARARGS }, - { "interrogate_function_class", &_inPzUjAP_SX, METH_VARARGS }, - { "interrogate_function_has_module_name", &_inPzUjA1iRq, METH_VARARGS }, - { "interrogate_function_module_name", &_inPzUjAEmel, METH_VARARGS }, - { "interrogate_function_has_library_name", &_inPzUjA20Vx, METH_VARARGS }, - { "interrogate_function_library_name", &_inPzUjAKcdW, METH_VARARGS }, - { "interrogate_function_is_virtual", &_inPzUjAhUs9, METH_VARARGS }, - { "interrogate_function_number_of_c_wrappers", &_inPzUjAhF25, METH_VARARGS }, - { "interrogate_function_c_wrapper", &_inPzUjAu1qB, METH_VARARGS }, - { "interrogate_function_number_of_python_wrappers", &_inPzUjAKMkY, METH_VARARGS }, - { "interrogate_function_python_wrapper", &_inPzUjARx9W, METH_VARARGS }, - { "interrogate_wrapper_name", &_inPzUjA0C9G, METH_VARARGS }, - { "interrogate_wrapper_is_callable_by_name", &_inPzUjAhaPp, METH_VARARGS }, - { "interrogate_wrapper_has_comment", &_inPzUjAt_1v, METH_VARARGS }, - { "interrogate_wrapper_comment", &_inPzUjA8KQG, METH_VARARGS }, - { "interrogate_wrapper_has_return_value", &_inPzUjAEtIl, METH_VARARGS }, - { "interrogate_wrapper_return_type", &_inPzUjARFmo, METH_VARARGS }, - { "interrogate_wrapper_caller_manages_return_value", &_inPzUjAWHA0, METH_VARARGS }, - { "interrogate_wrapper_return_value_destructor", &_inPzUjAcyIl, METH_VARARGS }, - { "interrogate_wrapper_number_of_parameters", &_inPzUjABnBv, METH_VARARGS }, - { "interrogate_wrapper_parameter_type", &_inPzUjAUvW7, METH_VARARGS }, - { "interrogate_wrapper_parameter_has_name", &_inPzUjAPdXf, METH_VARARGS }, - { "interrogate_wrapper_parameter_name", &_inPzUjAd0dl, METH_VARARGS }, - { "interrogate_wrapper_parameter_is_this", &_inPzUjAdVbH, METH_VARARGS }, - { "interrogate_wrapper_has_pointer", &_inPzUjABwF0, METH_VARARGS }, - { "interrogate_wrapper_pointer", &_inPzUjA9dPK, METH_VARARGS }, - { "interrogate_wrapper_unique_name", &_inPzUjAhUwR, METH_VARARGS }, - { "interrogate_get_wrapper_by_unique_name", &_inPzUjAA1eF, METH_VARARGS }, - { "interrogate_make_seq_class", &_inPzUjA8pBy, METH_VARARGS }, - { "interrogate_make_seq_seq_name", &_inPzUjA85oW, METH_VARARGS }, - { "interrogate_make_seq_num_name", &_inPzUjAYZz0, METH_VARARGS }, - { "interrogate_make_seq_element_name", &_inPzUjAzKCA, METH_VARARGS }, - { "interrogate_number_of_global_types", &_inPzUjAsxxs, METH_VARARGS }, - { "interrogate_get_global_type", &_inPzUjAMT0z, METH_VARARGS }, - { "interrogate_number_of_types", &_inPzUjAiW3v, METH_VARARGS }, - { "interrogate_get_type", &_inPzUjA4Px8, METH_VARARGS }, - { "interrogate_get_type_by_name", &_inPzUjANHcs, METH_VARARGS }, - { "interrogate_get_type_by_scoped_name", &_inPzUjAqHrb, METH_VARARGS }, - { "interrogate_get_type_by_true_name", &_inPzUjAaOqq, METH_VARARGS }, - { "interrogate_type_name", &_inPzUjAvue5, METH_VARARGS }, - { "interrogate_type_scoped_name", &_inPzUjAB_n_, METH_VARARGS }, - { "interrogate_type_true_name", &_inPzUjADFET, METH_VARARGS }, - { "interrogate_type_is_nested", &_inPzUjAUyNE, METH_VARARGS }, - { "interrogate_type_outer_class", &_inPzUjApDlm, METH_VARARGS }, - { "interrogate_type_has_comment", &_inPzUjAAscF, METH_VARARGS }, - { "interrogate_type_comment", &_inPzUjAYjbU, METH_VARARGS }, - { "interrogate_type_has_module_name", &_inPzUjAWmpU, METH_VARARGS }, - { "interrogate_type_module_name", &_inPzUjAnegH, METH_VARARGS }, - { "interrogate_type_has_library_name", &_inPzUjArrnF, METH_VARARGS }, - { "interrogate_type_library_name", &_inPzUjA7ShX, METH_VARARGS }, - { "interrogate_type_is_atomic", &_inPzUjAx_aO, METH_VARARGS }, - { "interrogate_type_atomic_token", &_inPzUjApofZ, METH_VARARGS }, - { "interrogate_type_is_unsigned", &_inPzUjA2J9C, METH_VARARGS }, - { "interrogate_type_is_signed", &_inPzUjAA6iz, METH_VARARGS }, - { "interrogate_type_is_long", &_inPzUjAa78E, METH_VARARGS }, - { "interrogate_type_is_longlong", &_inPzUjAWD3W, METH_VARARGS }, - { "interrogate_type_is_short", &_inPzUjAYuud, METH_VARARGS }, - { "interrogate_type_is_wrapped", &_inPzUjAlmJS, METH_VARARGS }, - { "interrogate_type_is_pointer", &_inPzUjALlrr, METH_VARARGS }, - { "interrogate_type_is_const", &_inPzUjAw_wy, METH_VARARGS }, - { "interrogate_type_wrapped_type", &_inPzUjAgk_l, METH_VARARGS }, - { "interrogate_type_is_enum", &_inPzUjAXpHY, METH_VARARGS }, - { "interrogate_type_number_of_enum_values", &_inPzUjAHhIg, METH_VARARGS }, - { "interrogate_type_enum_value_name", &_inPzUjAff0T, METH_VARARGS }, - { "interrogate_type_enum_value_scoped_name", &_inPzUjA5PPX, METH_VARARGS }, - { "interrogate_type_enum_value", &_inPzUjAPww5, METH_VARARGS }, - { "interrogate_type_is_struct", &_inPzUjAPke3, METH_VARARGS }, - { "interrogate_type_is_class", &_inPzUjAJmw3, METH_VARARGS }, - { "interrogate_type_is_union", &_inPzUjAR0Lc, METH_VARARGS }, - { "interrogate_type_is_fully_defined", &_inPzUjAc6gE, METH_VARARGS }, - { "interrogate_type_is_unpublished", &_inPzUjA1iT0, METH_VARARGS }, - { "interrogate_type_number_of_constructors", &_inPzUjAz1Mn, METH_VARARGS }, - { "interrogate_type_get_constructor", &_inPzUjAWlf2, METH_VARARGS }, - { "interrogate_type_has_destructor", &_inPzUjA1q8q, METH_VARARGS }, - { "interrogate_type_destructor_is_inherited", &_inPzUjAobo6, METH_VARARGS }, - { "interrogate_type_get_destructor", &_inPzUjAjevK, METH_VARARGS }, - { "interrogate_type_number_of_elements", &_inPzUjAeBpM, METH_VARARGS }, - { "interrogate_type_get_element", &_inPzUjAfmeN, METH_VARARGS }, - { "interrogate_type_number_of_methods", &_inPzUjAKBCl, METH_VARARGS }, - { "interrogate_type_get_method", &_inPzUjA936K, METH_VARARGS }, - { "interrogate_type_number_of_make_seqs", &_inPzUjAPPXQ, METH_VARARGS }, - { "interrogate_type_get_make_seq", &_inPzUjAnu86, METH_VARARGS }, - { "interrogate_type_number_of_casts", &_inPzUjAngiq, METH_VARARGS }, - { "interrogate_type_get_cast", &_inPzUjAUXR0, METH_VARARGS }, - { "interrogate_type_number_of_derivations", &_inPzUjADO7D, METH_VARARGS }, - { "interrogate_type_get_derivation", &_inPzUjAhZFz, METH_VARARGS }, - { "interrogate_type_derivation_has_upcast", &_inPzUjAnKPe, METH_VARARGS }, - { "interrogate_type_get_upcast", &_inPzUjAP3lS, METH_VARARGS }, - { "interrogate_type_derivation_downcast_is_impossible", &_inPzUjAUlLp, METH_VARARGS }, - { "interrogate_type_derivation_has_downcast", &_inPzUjA9Xei, METH_VARARGS }, - { "interrogate_type_get_downcast", &_inPzUjAaGkE, METH_VARARGS }, - { "interrogate_type_number_of_nested_types", &_inPzUjAoe_l, METH_VARARGS }, - { "interrogate_type_get_nested_type", &_inPzUjAuEdH, METH_VARARGS }, + { "interrogate_add_search_directory", &_inPU7VHtbRf, METH_VARARGS }, + { "interrogate_add_search_path", &_inPU7VHda_g, METH_VARARGS }, + { "interrogate_error_flag", &_inPU7VH4RgX, METH_VARARGS }, + { "interrogate_number_of_manifests", &_inPU7VH3Gip, METH_VARARGS }, + { "interrogate_get_manifest", &_inPU7VHRKDz, METH_VARARGS }, + { "interrogate_get_manifest_by_name", &_inPU7VHgZ9N, METH_VARARGS }, + { "interrogate_manifest_name", &_inPU7VHRQIx, METH_VARARGS }, + { "interrogate_manifest_definition", &_inPU7VHGVSj, METH_VARARGS }, + { "interrogate_manifest_has_type", &_inPU7VHznM6, METH_VARARGS }, + { "interrogate_manifest_get_type", &_inPU7VHjiLg, METH_VARARGS }, + { "interrogate_manifest_has_getter", &_inPU7VH_yjE, METH_VARARGS }, + { "interrogate_manifest_getter", &_inPU7VHzK9F, METH_VARARGS }, + { "interrogate_manifest_has_int_value", &_inPU7VHJju_, METH_VARARGS }, + { "interrogate_manifest_get_int_value", &_inPU7VHZktk, METH_VARARGS }, + { "interrogate_element_name", &_inPU7VHG71J, METH_VARARGS }, + { "interrogate_element_scoped_name", &_inPU7VHgeUs, METH_VARARGS }, + { "interrogate_element_has_comment", &_inPU7VH5Gsy, METH_VARARGS }, + { "interrogate_element_comment", &_inPU7VHCSJJ, METH_VARARGS }, + { "interrogate_get_element_by_name", &_inPU7VHkg95, METH_VARARGS }, + { "interrogate_get_element_by_scoped_name", &_inPU7VHluRc, METH_VARARGS }, + { "interrogate_element_type", &_inPU7VHwtTf, METH_VARARGS }, + { "interrogate_element_has_getter", &_inPU7VHrfao, METH_VARARGS }, + { "interrogate_element_getter", &_inPU7VHcedk, METH_VARARGS }, + { "interrogate_element_has_setter", &_inPU7VHXmoo, METH_VARARGS }, + { "interrogate_element_setter", &_inPU7VHclIo, METH_VARARGS }, + { "interrogate_number_of_globals", &_inPU7VHU2_B, METH_VARARGS }, + { "interrogate_get_global", &_inPU7VHHFO2, METH_VARARGS }, + { "interrogate_number_of_global_functions", &_inPU7VHcfjm, METH_VARARGS }, + { "interrogate_get_global_function", &_inPU7VH3Sjw, METH_VARARGS }, + { "interrogate_number_of_functions", &_inPU7VHgJcX, METH_VARARGS }, + { "interrogate_get_function", &_inPU7VHYlw6, METH_VARARGS }, + { "interrogate_function_name", &_inPU7VH3gns, METH_VARARGS }, + { "interrogate_function_scoped_name", &_inPU7VHN968, METH_VARARGS }, + { "interrogate_function_has_comment", &_inPU7VHFJVJ, METH_VARARGS }, + { "interrogate_function_comment", &_inPU7VHndTW, METH_VARARGS }, + { "interrogate_function_prototype", &_inPU7VHpjWj, METH_VARARGS }, + { "interrogate_function_is_method", &_inPU7VHNcQW, METH_VARARGS }, + { "interrogate_function_class", &_inPU7VHP_SX, METH_VARARGS }, + { "interrogate_function_has_module_name", &_inPU7VH1iRq, METH_VARARGS }, + { "interrogate_function_module_name", &_inPU7VHEmel, METH_VARARGS }, + { "interrogate_function_has_library_name", &_inPU7VH20Vx, METH_VARARGS }, + { "interrogate_function_library_name", &_inPU7VHKcdW, METH_VARARGS }, + { "interrogate_function_is_virtual", &_inPU7VHhUs9, METH_VARARGS }, + { "interrogate_function_number_of_c_wrappers", &_inPU7VHhF25, METH_VARARGS }, + { "interrogate_function_c_wrapper", &_inPU7VHu1qB, METH_VARARGS }, + { "interrogate_function_number_of_python_wrappers", &_inPU7VHKMkY, METH_VARARGS }, + { "interrogate_function_python_wrapper", &_inPU7VHRx9W, METH_VARARGS }, + { "interrogate_wrapper_name", &_inPU7VH0C9G, METH_VARARGS }, + { "interrogate_wrapper_is_callable_by_name", &_inPU7VHhaPp, METH_VARARGS }, + { "interrogate_wrapper_has_comment", &_inPU7VHt_1v, METH_VARARGS }, + { "interrogate_wrapper_comment", &_inPU7VH8KQG, METH_VARARGS }, + { "interrogate_wrapper_has_return_value", &_inPU7VHEtIl, METH_VARARGS }, + { "interrogate_wrapper_return_type", &_inPU7VHRFmo, METH_VARARGS }, + { "interrogate_wrapper_caller_manages_return_value", &_inPU7VHWHA0, METH_VARARGS }, + { "interrogate_wrapper_return_value_destructor", &_inPU7VHcyIl, METH_VARARGS }, + { "interrogate_wrapper_number_of_parameters", &_inPU7VHBnBv, METH_VARARGS }, + { "interrogate_wrapper_parameter_type", &_inPU7VHUvW7, METH_VARARGS }, + { "interrogate_wrapper_parameter_has_name", &_inPU7VHPdXf, METH_VARARGS }, + { "interrogate_wrapper_parameter_name", &_inPU7VHd0dl, METH_VARARGS }, + { "interrogate_wrapper_parameter_is_this", &_inPU7VHdVbH, METH_VARARGS }, + { "interrogate_wrapper_has_pointer", &_inPU7VHBwF0, METH_VARARGS }, + { "interrogate_wrapper_pointer", &_inPU7VH9dPK, METH_VARARGS }, + { "interrogate_wrapper_unique_name", &_inPU7VHhUwR, METH_VARARGS }, + { "interrogate_get_wrapper_by_unique_name", &_inPU7VHA1eF, METH_VARARGS }, + { "interrogate_make_seq_class", &_inPU7VH8pBy, METH_VARARGS }, + { "interrogate_make_seq_seq_name", &_inPU7VH85oW, METH_VARARGS }, + { "interrogate_make_seq_num_name", &_inPU7VHYZz0, METH_VARARGS }, + { "interrogate_make_seq_element_name", &_inPU7VHzKCA, METH_VARARGS }, + { "interrogate_number_of_global_types", &_inPU7VHsxxs, METH_VARARGS }, + { "interrogate_get_global_type", &_inPU7VHMT0z, METH_VARARGS }, + { "interrogate_number_of_types", &_inPU7VHiW3v, METH_VARARGS }, + { "interrogate_get_type", &_inPU7VH4Px8, METH_VARARGS }, + { "interrogate_get_type_by_name", &_inPU7VHNHcs, METH_VARARGS }, + { "interrogate_get_type_by_scoped_name", &_inPU7VHqHrb, METH_VARARGS }, + { "interrogate_get_type_by_true_name", &_inPU7VHaOqq, METH_VARARGS }, + { "interrogate_type_name", &_inPU7VHvue5, METH_VARARGS }, + { "interrogate_type_scoped_name", &_inPU7VHB_n_, METH_VARARGS }, + { "interrogate_type_true_name", &_inPU7VHDFET, METH_VARARGS }, + { "interrogate_type_is_nested", &_inPU7VHUyNE, METH_VARARGS }, + { "interrogate_type_outer_class", &_inPU7VHpDlm, METH_VARARGS }, + { "interrogate_type_has_comment", &_inPU7VHAscF, METH_VARARGS }, + { "interrogate_type_comment", &_inPU7VHYjbU, METH_VARARGS }, + { "interrogate_type_has_module_name", &_inPU7VHWmpU, METH_VARARGS }, + { "interrogate_type_module_name", &_inPU7VHnegH, METH_VARARGS }, + { "interrogate_type_has_library_name", &_inPU7VHrrnF, METH_VARARGS }, + { "interrogate_type_library_name", &_inPU7VH7ShX, METH_VARARGS }, + { "interrogate_type_is_atomic", &_inPU7VHx_aO, METH_VARARGS }, + { "interrogate_type_atomic_token", &_inPU7VHpofZ, METH_VARARGS }, + { "interrogate_type_is_unsigned", &_inPU7VH2J9C, METH_VARARGS }, + { "interrogate_type_is_signed", &_inPU7VHA6iz, METH_VARARGS }, + { "interrogate_type_is_long", &_inPU7VHa78E, METH_VARARGS }, + { "interrogate_type_is_longlong", &_inPU7VHWD3W, METH_VARARGS }, + { "interrogate_type_is_short", &_inPU7VHYuud, METH_VARARGS }, + { "interrogate_type_is_wrapped", &_inPU7VHlmJS, METH_VARARGS }, + { "interrogate_type_is_pointer", &_inPU7VHLlrr, METH_VARARGS }, + { "interrogate_type_is_const", &_inPU7VHw_wy, METH_VARARGS }, + { "interrogate_type_wrapped_type", &_inPU7VHgk_l, METH_VARARGS }, + { "interrogate_type_is_enum", &_inPU7VHXpHY, METH_VARARGS }, + { "interrogate_type_number_of_enum_values", &_inPU7VHHhIg, METH_VARARGS }, + { "interrogate_type_enum_value_name", &_inPU7VHff0T, METH_VARARGS }, + { "interrogate_type_enum_value_scoped_name", &_inPU7VH5PPX, METH_VARARGS }, + { "interrogate_type_enum_value_comment", &_inPU7VHCIt5, METH_VARARGS }, + { "interrogate_type_enum_value", &_inPU7VHPww5, METH_VARARGS }, + { "interrogate_type_is_struct", &_inPU7VHPke3, METH_VARARGS }, + { "interrogate_type_is_class", &_inPU7VHJmw3, METH_VARARGS }, + { "interrogate_type_is_union", &_inPU7VHR0Lc, METH_VARARGS }, + { "interrogate_type_is_fully_defined", &_inPU7VHc6gE, METH_VARARGS }, + { "interrogate_type_is_unpublished", &_inPU7VH1iT0, METH_VARARGS }, + { "interrogate_type_number_of_constructors", &_inPU7VHz1Mn, METH_VARARGS }, + { "interrogate_type_get_constructor", &_inPU7VHWlf2, METH_VARARGS }, + { "interrogate_type_has_destructor", &_inPU7VH1q8q, METH_VARARGS }, + { "interrogate_type_destructor_is_inherited", &_inPU7VHobo6, METH_VARARGS }, + { "interrogate_type_get_destructor", &_inPU7VHjevK, METH_VARARGS }, + { "interrogate_type_number_of_elements", &_inPU7VHeBpM, METH_VARARGS }, + { "interrogate_type_get_element", &_inPU7VHfmeN, METH_VARARGS }, + { "interrogate_type_number_of_methods", &_inPU7VHKBCl, METH_VARARGS }, + { "interrogate_type_get_method", &_inPU7VH936K, METH_VARARGS }, + { "interrogate_type_number_of_make_seqs", &_inPU7VHPPXQ, METH_VARARGS }, + { "interrogate_type_get_make_seq", &_inPU7VHnu86, METH_VARARGS }, + { "interrogate_type_number_of_casts", &_inPU7VHngiq, METH_VARARGS }, + { "interrogate_type_get_cast", &_inPU7VHUXR0, METH_VARARGS }, + { "interrogate_type_number_of_derivations", &_inPU7VHDO7D, METH_VARARGS }, + { "interrogate_type_get_derivation", &_inPU7VHhZFz, METH_VARARGS }, + { "interrogate_type_derivation_has_upcast", &_inPU7VHnKPe, METH_VARARGS }, + { "interrogate_type_get_upcast", &_inPU7VHP3lS, METH_VARARGS }, + { "interrogate_type_derivation_downcast_is_impossible", &_inPU7VHUlLp, METH_VARARGS }, + { "interrogate_type_derivation_has_downcast", &_inPU7VH9Xei, METH_VARARGS }, + { "interrogate_type_get_downcast", &_inPU7VHaGkE, METH_VARARGS }, + { "interrogate_type_number_of_nested_types", &_inPU7VHoe_l, METH_VARARGS }, + { "interrogate_type_get_nested_type", &_inPU7VHuEdH, METH_VARARGS }, { NULL, NULL } }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef python_simple_module = { PyModuleDef_HEAD_INIT, - "libp3dtoolconfig", + "dtoolconfig", NULL, -1, python_simple_funcs, NULL, NULL, NULL, NULL }; -#define INIT_FUNC PyObject *PyInit_libp3dtoolconfig +#define INIT_FUNC PyObject *PyInit_dtoolconfig #else -#define INIT_FUNC void initlibp3dtoolconfig +#define INIT_FUNC void initdtoolconfig #endif #ifdef _WIN32 @@ -2427,7 +2481,7 @@ INIT_FUNC() { #if PY_MAJOR_VERSION >= 3 return PyModule_Create(&python_simple_module); #else - Py_InitModule("libp3dtoolconfig", python_simple_funcs); + Py_InitModule("dtoolconfig", python_simple_funcs); #endif } diff --git a/dtool/src/cppparser/cppBison.yxx b/dtool/src/cppparser/cppBison.yxx index 5a166ad8ae..238c4f578b 100644 --- a/dtool/src/cppparser/cppBison.yxx +++ b/dtool/src/cppparser/cppBison.yxx @@ -1857,32 +1857,34 @@ named_enum: } ; -enum_body: +enum_body_trailing_comma: empty - | enum_body_no_trailing_comma - | enum_body_no_trailing_comma ',' - ; + | enum_body_trailing_comma name ',' +{ + assert(current_enum != NULL); + CPPInstance *inst = current_enum->add_element($2->get_simple_name()); + current_scope->add_enum_value(inst, current_lexer, @2); +} + | enum_body_trailing_comma name '=' const_expr ',' +{ + assert(current_enum != NULL); + CPPInstance *inst = current_enum->add_element($2->get_simple_name(), $4); + current_scope->add_enum_value(inst, current_lexer, @2); +}; -enum_body_no_trailing_comma: - name +enum_body: + enum_body_trailing_comma + | enum_body_trailing_comma name { assert(current_enum != NULL); - current_enum->add_element($1->get_simple_name(), current_scope); + CPPInstance *inst = current_enum->add_element($2->get_simple_name()); + current_scope->add_enum_value(inst, current_lexer, @2); } - | name '=' const_expr + | enum_body_trailing_comma name '=' const_expr { assert(current_enum != NULL); - current_enum->add_element($1->get_simple_name(), current_scope, $3); -} - | enum_body_no_trailing_comma ',' name -{ - assert(current_enum != NULL); - current_enum->add_element($3->get_simple_name(), current_scope); -} - | enum_body_no_trailing_comma ',' name '=' const_expr -{ - assert(current_enum != NULL); - current_enum->add_element($3->get_simple_name(), current_scope, $5); + CPPInstance *inst = current_enum->add_element($2->get_simple_name(), $4); + current_scope->add_enum_value(inst, current_lexer, @2); } ; diff --git a/dtool/src/cppparser/cppEnumType.cxx b/dtool/src/cppparser/cppEnumType.cxx index 35b24ab4b3..216d8a7abb 100644 --- a/dtool/src/cppparser/cppEnumType.cxx +++ b/dtool/src/cppparser/cppEnumType.cxx @@ -38,8 +38,8 @@ CPPEnumType(CPPIdentifier *ident, CPPScope *current_scope, // Access: Public // Description: //////////////////////////////////////////////////////////////////// -void CPPEnumType:: -add_element(const string &name, CPPScope *scope, CPPExpression *value) { +CPPInstance *CPPEnumType:: +add_element(const string &name, CPPExpression *value) { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_unsigned)); @@ -47,7 +47,7 @@ add_element(const string &name, CPPScope *scope, CPPExpression *value) { CPPInstance *inst = new CPPInstance(type, ident); inst->_initializer = value; _elements.push_back(inst); - scope->add_enum_value(inst); + return inst; } //////////////////////////////////////////////////////////////////// diff --git a/dtool/src/cppparser/cppEnumType.h b/dtool/src/cppparser/cppEnumType.h index 207b25342e..e559eb7b53 100644 --- a/dtool/src/cppparser/cppEnumType.h +++ b/dtool/src/cppparser/cppEnumType.h @@ -35,8 +35,8 @@ public: CPPEnumType(CPPIdentifier *ident, CPPScope *current_scope, const CPPFile &file); - void add_element(const string &name, CPPScope *scope, - CPPExpression *value = (CPPExpression *)NULL); + CPPInstance *add_element(const string &name, + CPPExpression *value = (CPPExpression *)NULL); virtual bool is_incomplete() const; diff --git a/dtool/src/cppparser/cppPreprocessor.cxx b/dtool/src/cppparser/cppPreprocessor.cxx index d0ed51f9b9..474063e4a7 100644 --- a/dtool/src/cppparser/cppPreprocessor.cxx +++ b/dtool/src/cppparser/cppPreprocessor.cxx @@ -528,6 +528,34 @@ get_comment_before(int line, CPPFile file) { return (CPPCommentBlock *)NULL; } +//////////////////////////////////////////////////////////////////// +// Function: CPPPreprocessor::get_comment_on +// Access: Public +// Description: Returns the CPPCommentBlock that starts on the +// indicated line, if any. If there is no such +// comment, returns NULL. +//////////////////////////////////////////////////////////////////// +CPPCommentBlock *CPPPreprocessor:: +get_comment_on(int line, CPPFile file) { + CPPComments::reverse_iterator ci; + ci = _comments.rbegin(); + + while (ci != _comments.rend()) { + CPPCommentBlock *comment = (*ci); + if (comment->_file == file) { + if (comment->_line_number == line) { + return comment; + } else if (comment->_line_number < line) { + return (CPPCommentBlock *)NULL; + } + } + + ++ci; + } + + return (CPPCommentBlock *)NULL; +} + //////////////////////////////////////////////////////////////////// // Function: CPPPreprocessor::init_cpp // Access: Protected @@ -891,6 +919,10 @@ internal_get_next_token() { } } + // We skip whitespace here again, so that we can read any comments + // after this point before we parse this line. + _last_c = skip_whitespace(_last_c); + return CPPToken(c, first_line, first_col, first_file); } @@ -1019,11 +1051,19 @@ skip_cpp_comment(int c) { if (_save_comments) { CPPCommentBlock *comment; - if (_last_cpp_comment) { + int line_number = get_line_number(); + if (c == '\n') { + // We have to subtract one from the line number as we just + // fetched a newline. + --line_number; + } + + if (_last_cpp_comment && !_comments.empty() && + _comments.back()->_last_line >= line_number - 1) { // If the last non-whitespace character read was also part of a // C++ comment, then this is just a continuation of that comment - // block. - assert(!_comments.empty()); + // block. However, if there was a line without comment in between, + // it starts a new block anyway. comment = _comments.back(); assert(!comment->_c_style); comment->_comment += "//"; @@ -1033,8 +1073,8 @@ skip_cpp_comment(int c) { comment = new CPPCommentBlock; comment->_file = get_file(); - comment->_line_number = get_line_number(); - comment->_last_line = get_line_number(); + comment->_line_number = line_number; + comment->_last_line = line_number; comment->_col_number = get_col_number() - 2; comment->_c_style = false; comment->_comment = "//"; @@ -1048,7 +1088,7 @@ skip_cpp_comment(int c) { } comment->_comment += '\n'; - comment->_last_line = get_line_number(); + comment->_last_line = line_number; _last_cpp_comment = true; diff --git a/dtool/src/cppparser/cppPreprocessor.h b/dtool/src/cppparser/cppPreprocessor.h index 48a9dafa0b..34647193c8 100644 --- a/dtool/src/cppparser/cppPreprocessor.h +++ b/dtool/src/cppparser/cppPreprocessor.h @@ -64,6 +64,7 @@ public: CPPFile file = CPPFile()); CPPCommentBlock *get_comment_before(int line, CPPFile file); + CPPCommentBlock *get_comment_on(int line, CPPFile file); int get_warning_count() const; int get_error_count() const; @@ -75,7 +76,7 @@ public: DSearchPath _quote_include_path; DSearchPath _angle_include_path; bool _noangles; - + CPPComments _comments; typedef set ParsedFiles; diff --git a/dtool/src/cppparser/cppScope.cxx b/dtool/src/cppparser/cppScope.cxx index 802c7dfafe..eb8008583b 100644 --- a/dtool/src/cppparser/cppScope.cxx +++ b/dtool/src/cppparser/cppScope.cxx @@ -145,9 +145,21 @@ add_declaration(CPPDeclaration *decl, CPPScope *global_scope, // Description: //////////////////////////////////////////////////////////////////// void CPPScope:: -add_enum_value(CPPInstance *inst) { +add_enum_value(CPPInstance *inst, CPPPreprocessor *preprocessor, + const cppyyltype &pos) { inst->_vis = _current_vis; + if (inst->_leading_comment == (CPPCommentBlock *)NULL) { + // Same-line comment? + inst->_leading_comment = + preprocessor->get_comment_on(pos.first_line, pos.file); + + if (inst->_leading_comment == (CPPCommentBlock *)NULL) { + inst->_leading_comment = + preprocessor->get_comment_before(pos.first_line, pos.file); + } + } + string name = inst->get_simple_name(); if (!name.empty()) { _enum_values[name] = inst; diff --git a/dtool/src/cppparser/cppScope.h b/dtool/src/cppparser/cppScope.h index 850972a5e4..324eb91766 100644 --- a/dtool/src/cppparser/cppScope.h +++ b/dtool/src/cppparser/cppScope.h @@ -63,7 +63,9 @@ public: virtual void add_declaration(CPPDeclaration *decl, CPPScope *global_scope, CPPPreprocessor *preprocessor, const cppyyltype &pos); - virtual void add_enum_value(CPPInstance *inst); + virtual void add_enum_value(CPPInstance *inst, + CPPPreprocessor *preprocessor, + const cppyyltype &pos); virtual void define_extension_type(CPPExtensionType *type); virtual void define_namespace(CPPNamespace *scope); virtual void add_using(CPPUsing *using_decl, CPPScope *global_scope, diff --git a/dtool/src/cppparser/cppTemplateScope.cxx b/dtool/src/cppparser/cppTemplateScope.cxx index 24ed3818b1..e4b6f5a922 100644 --- a/dtool/src/cppparser/cppTemplateScope.cxx +++ b/dtool/src/cppparser/cppTemplateScope.cxx @@ -51,10 +51,11 @@ add_declaration(CPPDeclaration *decl, CPPScope *global_scope, // Description: //////////////////////////////////////////////////////////////////// void CPPTemplateScope:: -add_enum_value(CPPInstance *inst) { +add_enum_value(CPPInstance *inst, CPPPreprocessor *preprocessor, + const cppyyltype &pos) { inst->_template_scope = this; assert(_parent_scope != NULL); - _parent_scope->add_enum_value(inst); + _parent_scope->add_enum_value(inst, preprocessor, pos); } //////////////////////////////////////////////////////////////////// diff --git a/dtool/src/cppparser/cppTemplateScope.h b/dtool/src/cppparser/cppTemplateScope.h index b504aece1e..40a7feb74c 100644 --- a/dtool/src/cppparser/cppTemplateScope.h +++ b/dtool/src/cppparser/cppTemplateScope.h @@ -36,7 +36,9 @@ public: virtual void add_declaration(CPPDeclaration *decl, CPPScope *global_scope, CPPPreprocessor *preprocessor, const cppyyltype &pos); - virtual void add_enum_value(CPPInstance *inst); + virtual void add_enum_value(CPPInstance *inst, + CPPPreprocessor *preprocessor, + const cppyyltype &pos); virtual void define_extension_type(CPPExtensionType *type); virtual void define_namespace(CPPNamespace *scope); virtual void add_using(CPPUsing *using_decl, CPPScope *global_scope, diff --git a/dtool/src/interrogate/interfaceMakerPython.cxx b/dtool/src/interrogate/interfaceMakerPython.cxx index 213966c900..a9f8227dce 100644 --- a/dtool/src/interrogate/interfaceMakerPython.cxx +++ b/dtool/src/interrogate/interfaceMakerPython.cxx @@ -36,7 +36,8 @@ InterfaceMakerPython(InterrogateModuleDef *def) : void InterfaceMakerPython:: write_includes(ostream &out) { InterfaceMaker::write_includes(out); - out << "#undef _POSIX_C_SOURCE\n\n" + out << "#undef _POSIX_C_SOURCE\n" + << "#define PY_SSIZE_T_CLEAN 1\n\n" << "#if PYTHON_FRAMEWORK\n" << " #include \"Python/Python.h\"\n" << "#else\n" diff --git a/dtool/src/interrogate/interfaceMakerPythonObj.cxx b/dtool/src/interrogate/interfaceMakerPythonObj.cxx index 497d506cdc..9081c435bd 100644 --- a/dtool/src/interrogate/interfaceMakerPythonObj.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonObj.cxx @@ -360,21 +360,21 @@ write_function_instance(ostream &out, int indent_level, CPPType *orig_type = remap->_parameters[pn]._remap->get_orig_type(); CPPType *type = remap->_parameters[pn]._remap->get_new_type(); string param_name = remap->get_parameter_name(pn); - + // This is the string to convert our local variable to the // appropriate C++ type. Normally this is just a cast. string pexpr_string = "(" + type->get_local_name(&parser) + ")" + param_name; - + if (remap->_parameters[pn]._remap->new_type_is_atomic_string()) { if (TypeManager::is_char_pointer(orig_type)) { out << "char *" << param_name; format_specifiers += "s"; parameter_list += ", &" + param_name; - + } else { out << "char *" << param_name - << "_str; int " << param_name << "_len"; + << "_str; Py_ssize_t " << param_name << "_len"; format_specifiers += "s#"; parameter_list += ", &" + param_name + "_str, &" + param_name + "_len"; @@ -383,7 +383,7 @@ write_function_instance(ostream &out, int indent_level, param_name + "_len)"; } expected_params += "string"; - + } else if (TypeManager::is_bool(type)) { out << "PyObject *" << param_name; format_specifiers += "O"; diff --git a/dtool/src/interrogate/interfaceMakerPythonSimple.cxx b/dtool/src/interrogate/interfaceMakerPythonSimple.cxx index 6709c8e399..d6e0684db7 100644 --- a/dtool/src/interrogate/interfaceMakerPythonSimple.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonSimple.cxx @@ -270,21 +270,21 @@ void InterfaceMakerPythonSimple::write_function_instance(ostream &out, Interface CPPType *orig_type = remap->_parameters[pn]._remap->get_orig_type(); CPPType *type = remap->_parameters[pn]._remap->get_new_type(); string param_name = remap->get_parameter_name(pn); - + // This is the string to convert our local variable to the // appropriate C++ type. Normally this is just a cast. string pexpr_string = "(" + type->get_local_name(&parser) + ")" + param_name; - + if (remap->_parameters[pn]._remap->new_type_is_atomic_string()) { if (TypeManager::is_char_pointer(orig_type)) { out << "char *" << param_name; format_specifiers += "s"; parameter_list += ", &" + param_name; - + } else if (TypeManager::is_wstring(orig_type)) { out << "Py_UNICODE *" << param_name - << "_str; int " << param_name << "_len"; + << "_str; Py_ssize_t " << param_name << "_len"; format_specifiers += "u#"; parameter_list += ", &" + param_name + "_str, &" + param_name + "_len"; @@ -294,7 +294,7 @@ void InterfaceMakerPythonSimple::write_function_instance(ostream &out, Interface } else { out << "char *" << param_name - << "_str; int " << param_name << "_len"; + << "_str; Py_ssize_t " << param_name << "_len"; format_specifiers += "s#"; parameter_list += ", &" + param_name + "_str, &" + param_name + "_len"; @@ -302,7 +302,7 @@ void InterfaceMakerPythonSimple::write_function_instance(ostream &out, Interface param_name + "_str, " + param_name + "_len)"; } - + } else if (TypeManager::is_bool(type)) { out << "PyObject *" << param_name; format_specifiers += "O"; diff --git a/dtool/src/interrogate/interrogateBuilder.cxx b/dtool/src/interrogate/interrogateBuilder.cxx index a064c00590..a752e2b67c 100644 --- a/dtool/src/interrogate/interrogateBuilder.cxx +++ b/dtool/src/interrogate/interrogateBuilder.cxx @@ -1358,7 +1358,7 @@ scan_element(CPPInstance *element, CPPStructType *struct_type, ielement._name = element->get_local_name(scope); ielement._scoped_name = descope(element->get_local_name(&parser)); - // See if there happens to be a comment before the MAKE_PROPERTY macro. + // See if there happens to be a comment before the element. if (element->_leading_comment != (CPPCommentBlock *)NULL) { ielement._comment = trim_blanks(element->_leading_comment->_comment); } @@ -1838,7 +1838,7 @@ get_make_property(CPPMakeProperty *make_property, CPPStructType *struct_type) { iproperty._getter = get_function(getter, "", struct_type, struct_type->get_scope(), 0); - // See if there happens to be a comment before the element. + // See if there happens to be a comment before the MAKE_PROPERTY macro. if (make_property->_leading_comment != (CPPCommentBlock *)NULL) { iproperty._comment = trim_blanks(make_property->_leading_comment->_comment); } @@ -2661,6 +2661,10 @@ define_enum_type(InterrogateType &itype, CPPEnumType *cpptype) { evalue._name = element->get_simple_name(); evalue._scoped_name = descope(element->get_local_name(&parser)); + if (element->_leading_comment != (CPPCommentBlock *)NULL) { + evalue._comment = trim_blanks(element->_leading_comment->_comment); + } + if (element->_initializer != (CPPExpression *)NULL) { CPPExpression::Result result = element->_initializer->evaluate(); next_value = result.as_integer(); diff --git a/dtool/src/interrogatedb/interrogateType.I b/dtool/src/interrogatedb/interrogateType.I index 4c31cd18b7..681efc39e9 100644 --- a/dtool/src/interrogatedb/interrogateType.I +++ b/dtool/src/interrogatedb/interrogateType.I @@ -263,6 +263,19 @@ get_enum_value_scoped_name(int n) const { return _empty_string; } +//////////////////////////////////////////////////////////////////// +// Function: InterrogateType::get_enum_value_comment +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE const string &InterrogateType:: +get_enum_value_comment(int n) const { + if (n >= 0 && n < (int)_enum_values.size()) { + return _enum_values[n]._comment; + } + return _empty_string; +} + //////////////////////////////////////////////////////////////////// // Function: InterrogateType::get_enum_value // Access: Public diff --git a/dtool/src/interrogatedb/interrogateType.cxx b/dtool/src/interrogatedb/interrogateType.cxx index 2e31feb884..2f79dddce2 100644 --- a/dtool/src/interrogatedb/interrogateType.cxx +++ b/dtool/src/interrogatedb/interrogateType.cxx @@ -15,6 +15,7 @@ #include "interrogateType.h" #include "indexRemapper.h" #include "interrogate_datafile.h" +#include "interrogateDatabase.h" #include @@ -76,6 +77,7 @@ void InterrogateType::EnumValue:: output(ostream &out) const { idf_output_string(out, _name); idf_output_string(out, _scoped_name); + idf_output_string(out, _comment, '\n'); out << _value; } @@ -88,6 +90,9 @@ void InterrogateType::EnumValue:: input(istream &in) { idf_input_string(in, _name); idf_input_string(in, _scoped_name); + if (InterrogateDatabase::get_file_minor_version() >= 3) { + idf_input_string(in, _comment); + } in >> _value; } diff --git a/dtool/src/interrogatedb/interrogateType.h b/dtool/src/interrogatedb/interrogateType.h index a96f6e7d37..bcdd6ce2bb 100644 --- a/dtool/src/interrogatedb/interrogateType.h +++ b/dtool/src/interrogatedb/interrogateType.h @@ -66,6 +66,7 @@ public: INLINE int number_of_enum_values() const; INLINE const string &get_enum_value_name(int n) const; INLINE const string &get_enum_value_scoped_name(int n) const; + INLINE const string &get_enum_value_comment(int n) const; INLINE int get_enum_value(int n) const; INLINE bool is_struct() const; @@ -189,6 +190,7 @@ public: string _name; string _scoped_name; + string _comment; int _value; }; diff --git a/dtool/src/interrogatedb/interrogate_interface.cxx b/dtool/src/interrogatedb/interrogate_interface.cxx index cfa6639a92..2595a2a751 100644 --- a/dtool/src/interrogatedb/interrogate_interface.cxx +++ b/dtool/src/interrogatedb/interrogate_interface.cxx @@ -120,6 +120,18 @@ interrogate_element_scoped_name(ElementIndex element) { return InterrogateDatabase::get_ptr()->get_element(element).get_scoped_name().c_str(); } +bool +interrogate_element_has_comment(ElementIndex element) { + //cerr << "interrogate_element_has_comment(" << element << ")\n"; + return InterrogateDatabase::get_ptr()->get_element(element).has_comment(); +} + +const char * +interrogate_element_comment(ElementIndex element) { + //cerr << "interrogate_element_comment(" << element << ")\n"; + return InterrogateDatabase::get_ptr()->get_element(element).get_comment().c_str(); +} + ElementIndex interrogate_get_element_by_name(const char *element_name) { //cerr << "interrogate_get_element_by_name(" << element_name << ")\n"; @@ -631,6 +643,12 @@ interrogate_type_enum_value_scoped_name(TypeIndex type, int n) { return InterrogateDatabase::get_ptr()->get_type(type).get_enum_value_scoped_name(n).c_str(); } +const char * +interrogate_type_enum_value_comment(TypeIndex type, int n) { + //cerr << "interrogate_type_enum_value_comment(" << type << ", " << n << ")\n"; + return InterrogateDatabase::get_ptr()->get_type(type).get_enum_value_comment(n).c_str(); +} + int interrogate_type_enum_value(TypeIndex type, int n) { //cerr << "interrogate_type_enum_value(" << type << ", " << n << ")\n"; diff --git a/dtool/src/interrogatedb/interrogate_interface.h b/dtool/src/interrogatedb/interrogate_interface.h index 148eb71bc9..5d5352721a 100644 --- a/dtool/src/interrogatedb/interrogate_interface.h +++ b/dtool/src/interrogatedb/interrogate_interface.h @@ -138,6 +138,8 @@ EXPCL_DTOOLCONFIG int interrogate_manifest_get_int_value(ManifestIndex manifest) EXPCL_DTOOLCONFIG const char *interrogate_element_name(ElementIndex element); EXPCL_DTOOLCONFIG const char *interrogate_element_scoped_name(ElementIndex element); +EXPCL_DTOOLCONFIG bool interrogate_element_has_comment(ElementIndex element); +EXPCL_DTOOLCONFIG const char *interrogate_element_comment(ElementIndex element); EXPCL_DTOOLCONFIG ElementIndex interrogate_get_element_by_name(const char *element_name); EXPCL_DTOOLCONFIG ElementIndex interrogate_get_element_by_scoped_name(const char *element_name); @@ -454,6 +456,7 @@ EXPCL_DTOOLCONFIG bool interrogate_type_is_enum(TypeIndex type); EXPCL_DTOOLCONFIG int interrogate_type_number_of_enum_values(TypeIndex type); EXPCL_DTOOLCONFIG const char *interrogate_type_enum_value_name(TypeIndex type, int n); EXPCL_DTOOLCONFIG const char *interrogate_type_enum_value_scoped_name(TypeIndex type, int n); +EXPCL_DTOOLCONFIG const char *interrogate_type_enum_value_comment(TypeIndex type, int n); EXPCL_DTOOLCONFIG int interrogate_type_enum_value(TypeIndex type, int n); // If none of the above is true, the type is some extension type. It From ba1e18ce8baae13e03af32f466349f5574a28f53 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 20 Sep 2014 11:51:33 +0000 Subject: [PATCH 47/52] Improve Python API ref --- direct/src/directscripts/Doxyfile.python | 15 +++-- direct/src/directscripts/extract_docs.py | 86 ++++++++++++++++++------ 2 files changed, 75 insertions(+), 26 deletions(-) diff --git a/direct/src/directscripts/Doxyfile.python b/direct/src/directscripts/Doxyfile.python index 3e45fcd346..0e8f507f89 100644 --- a/direct/src/directscripts/Doxyfile.python +++ b/direct/src/directscripts/Doxyfile.python @@ -176,7 +176,7 @@ QT_AUTOBRIEF = YES # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. -MULTILINE_CPP_IS_BRIEF = NO +MULTILINE_CPP_IS_BRIEF = YES # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it @@ -612,8 +612,7 @@ WARN_LOGFILE = # directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = pandadoc.hpp \ - direct +INPUT = pandadoc.hpp built/direct # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is @@ -644,7 +643,15 @@ RECURSIVE = YES # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. -EXCLUDE = direct/src/test +EXCLUDE = built/direct/test \ + built/direct/plugin \ + built/direct/plugin_npapi \ + built/direct/plugin_activex \ + built/direct/plugin_installer \ + built/direct/plugin_standalone \ + built/direct/extensions \ + built/direct/extensions_native \ + built/direct/directscripts # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded diff --git a/direct/src/directscripts/extract_docs.py b/direct/src/directscripts/extract_docs.py index 03f6e0b76e..2f76ed4a53 100644 --- a/direct/src/directscripts/extract_docs.py +++ b/direct/src/directscripts/extract_docs.py @@ -17,15 +17,34 @@ All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named \"LICENSE.\"""".split("\n") -libraries = {} -for m, lib in panda3d.modules.items(): - if not isinstance(lib, str): - for l in lib: - libraries[l.replace("lib", "")] = m - else: - libraries[lib.replace("lib", "")] = m - def comment(code): + if not code: + return "" + + comment = '' + + empty_line = False + for line in code.splitlines(False): + line = line.strip('\t\n /') + if line: + if empty_line: + # New paragraph. + comment += '\n\n' + elif comment: + comment += '\n' + comment += '/// ' + line + else: + empty_line = True + + if comment: + return comment + else: + return '' + +def block_comment(code): + if not code: + return "" + lines = code.split("\n") newlines = [] indent = 0 @@ -38,18 +57,18 @@ def comment(code): line = line.rstrip() strline = line.lstrip('/ \t') if reading_desc: - newlines.append(line[min(indent, len(line) - len(strline)):]) + newlines.append('/// ' + line[min(indent, len(line) - len(strline)):]) else: # A "Description:" text starts the description. if strline.startswith("Description"): strline = strline[11:].lstrip(': \t') indent = len(line) - len(strline) reading_desc = True - newlines.append(strline) + newlines.append('/// ' + strline) - newcode = "\n".join(newlines) + newcode = '\n'.join(newlines) if len(newcode) > 0: - return "/** " + newcode + " */" + return newcode else: return "" @@ -67,6 +86,11 @@ def translateFunctionName(name): return new def translated_type_name(type): + if interrogate_type_is_atomic(type): + token = interrogate_type_atomic_token(type) + if token == 7: + return 'str' + typename = interrogate_type_name(type) typename = typename.replace("< ", "").replace(" >", "") return typename @@ -76,13 +100,24 @@ def translateTypeSpec(name): name = name.replace("BitMask< unsigned int, 32 >", "BitMask32") name = name.replace("atomic ", "") name = name.replace("< ", "").replace(" >", "") + if name == '_object': + name = 'object' + elif name == '_typeobject': + name = 'type' return name +def processElement(handle, element): + if interrogate_element_has_comment(element): + print >>handle, comment(interrogate_element_comment(element)) + + print >>handle, translateTypeSpec(translated_type_name(interrogate_element_type(element))), + print >>handle, interrogate_element_name(element) + ';' + def processFunction(handle, function, isConstructor = False): for i_wrapper in xrange(interrogate_function_number_of_python_wrappers(function)): wrapper = interrogate_function_python_wrapper(function, i_wrapper) if interrogate_wrapper_has_comment(wrapper): - print >>handle, comment(interrogate_wrapper_comment(wrapper)) + print >>handle, block_comment(interrogate_wrapper_comment(wrapper)) if not isConstructor: if not interrogate_wrapper_number_of_parameters(wrapper) > 0 or not interrogate_wrapper_parameter_is_this(wrapper, 0): @@ -114,11 +149,14 @@ def processType(handle, type): derivations = [ translated_type_name(interrogate_type_get_derivation(type, n)) for n in range(interrogate_type_number_of_derivations(type)) ] if interrogate_type_has_comment(type): - print >>handle, comment(interrogate_type_comment(type)) + print >>handle, block_comment(interrogate_type_comment(type)) if interrogate_type_is_enum(type): print >>handle, "enum %s {" % typename for i_value in range(interrogate_type_number_of_enum_values(type)): + docstring = comment(interrogate_type_enum_value_comment(type, i_value)) + if docstring: + print >>handle, docstring print >>handle, translateFunctionName(interrogate_type_enum_value_name(type, i_value)), "=", interrogate_type_enum_value(type, i_value), "," else: if interrogate_type_is_struct(type): @@ -148,6 +186,9 @@ def processType(handle, type): for i_method in xrange(interrogate_type_number_of_make_seqs(type)): print >>handle, "list", translateFunctionName(interrogate_make_seq_seq_name(interrogate_type_get_make_seq(type, i_method))), "();" + + for i_element in xrange(interrogate_type_number_of_elements(type)): + processElement(handle, interrogate_type_get_element(type, i_element)) print >>handle, "};" @@ -161,20 +202,22 @@ if __name__ == "__main__": interrogate_add_search_directory(os.path.join(os.path.dirname(pandac.__file__), "..", "..", "etc")) interrogate_add_search_directory(os.path.join(os.path.dirname(pandac.__file__), "input")) - try: - panda3d.__load__() - except ImportError, msg: - print msg + import panda3d.core + + for lib in os.listdir(os.path.dirname(panda3d.__file__)): + if lib.endswith(('.pyd', '.so')) and not lib.startswith('core.'): + __import__('panda3d.' + os.path.splitext(lib)[0]) lastpkg = None for i_type in xrange(interrogate_number_of_global_types()): type = interrogate_get_global_type(i_type) if interrogate_type_has_module_name(type): - package = libraries[interrogate_type_module_name(type)] + package = interrogate_type_module_name(type) if lastpkg != package: - print >>handle, "}" - print >>handle, "namespace panda3d.%s {" % package + if lastpkg is not None: + print >>handle, "}" + print >>handle, "namespace %s {" % package lastpkg = package processType(handle, type) @@ -184,4 +227,3 @@ if __name__ == "__main__": if lastpkg is not None: print >>handle, "}" handle.close() - From d9c529a5d01793ac55d8629ea78d3361114f7b87 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 20 Sep 2014 11:54:04 +0000 Subject: [PATCH 48/52] Update prebuild cppBison files --- dtool/src/cppparser/cppBison.cxx.prebuilt | 6454 ++++++++++----------- dtool/src/cppparser/cppBison.h.prebuilt | 150 +- 2 files changed, 3205 insertions(+), 3399 deletions(-) diff --git a/dtool/src/cppparser/cppBison.cxx.prebuilt b/dtool/src/cppparser/cppBison.cxx.prebuilt index f8f2469c31..5d4ffbb537 100644 --- a/dtool/src/cppparser/cppBison.cxx.prebuilt +++ b/dtool/src/cppparser/cppBison.cxx.prebuilt @@ -1,10 +1,8 @@ +/* A Bison parser, made by GNU Bison 2.7. */ -/* A Bison parser, made by GNU Bison 2.4.1. */ - -/* Skeleton implementation for Bison's Yacc-like parsers in C +/* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -46,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.4.1" +#define YYBISON_VERSION "2.7" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -60,8 +58,6 @@ /* Pull parsers. */ #define YYPULL 1 -/* Using locations. */ -#define YYLSP_NEEDED 1 /* Substitute the variable and function names. */ #define yyparse cppyyparse @@ -74,9 +70,8 @@ #define yylloc cppyylloc /* Copy the first part of user declarations. */ - -/* Line 189 of yacc.c */ -#line 6 "cppBison.yxx" +/* Line 371 of yacc.c */ +#line 6 "dtool/src/cppparser/cppBison.yxx" #include "cppBisonDefs.h" @@ -88,6 +83,7 @@ #include "cppEnumType.h" #include "cppFunctionType.h" #include "cppTBDType.h" +#include "cppMakeProperty.h" #include "cppMakeSeq.h" #include "cppParameterList.h" #include "cppInstance.h" @@ -264,14 +260,16 @@ pop_struct() { } +/* Line 371 of yacc.c */ +#line 265 "built/tmp/cppBison.yxx.c" -/* Line 189 of yacc.c */ -#line 270 "y.tab.c" - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif +# ifndef YY_NULL +# if defined __cplusplus && 201103L <= __cplusplus +# define YY_NULL nullptr +# else +# define YY_NULL 0 +# endif +# endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE @@ -281,11 +279,17 @@ pop_struct() { # define YYERROR_VERBOSE 0 #endif -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 +/* In a future release of Bison, this section will be replaced + by #include "cppBison.yxx.h". */ +#ifndef YY_CPPYY_BUILT_TMP_CPPBISON_YXX_H_INCLUDED +# define YY_CPPYY_BUILT_TMP_CPPBISON_YXX_H_INCLUDED +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int cppyydebug; #endif - /* Tokens. */ #ifndef YYTOKENTYPE @@ -333,35 +337,35 @@ pop_struct() { XOREQUAL = 295, LSHIFTEQUAL = 296, RSHIFTEQUAL = 297, - TOKENPASTE = 298, - KW_BEGIN_PUBLISH = 299, - KW_BLOCKING = 300, - KW_BOOL = 301, - KW_CATCH = 302, - KW_CHAR = 303, - KW_WCHAR_T = 304, - KW_CLASS = 305, - KW_CONST = 306, - KW_DELETE = 307, - KW_DOUBLE = 308, - KW_DYNAMIC_CAST = 309, - KW_ELSE = 310, - KW_END_PUBLISH = 311, - KW_ENUM = 312, - KW_EXTENSION = 313, - KW_EXTERN = 314, - KW_EXPLICIT = 315, - KW_PUBLISHED = 316, - KW_FALSE = 317, - KW_FLOAT = 318, - KW_FRIEND = 319, - KW_FOR = 320, - KW_GOTO = 321, - KW_IF = 322, - KW_INLINE = 323, - KW_INT = 324, - KW_LONG = 325, - KW_LONGLONG = 326, + KW_BEGIN_PUBLISH = 298, + KW_BLOCKING = 299, + KW_BOOL = 300, + KW_CATCH = 301, + KW_CHAR = 302, + KW_WCHAR_T = 303, + KW_CLASS = 304, + KW_CONST = 305, + KW_DELETE = 306, + KW_DOUBLE = 307, + KW_DYNAMIC_CAST = 308, + KW_ELSE = 309, + KW_END_PUBLISH = 310, + KW_ENUM = 311, + KW_EXTENSION = 312, + KW_EXTERN = 313, + KW_EXPLICIT = 314, + KW_PUBLISHED = 315, + KW_FALSE = 316, + KW_FLOAT = 317, + KW_FRIEND = 318, + KW_FOR = 319, + KW_GOTO = 320, + KW_IF = 321, + KW_INLINE = 322, + KW_INT = 323, + KW_LONG = 324, + KW_LONGLONG = 325, + KW_MAKE_PROPERTY = 326, KW_MAKE_SEQ = 327, KW_MUTABLE = 328, KW_NAMESPACE = 329, @@ -437,35 +441,35 @@ pop_struct() { #define XOREQUAL 295 #define LSHIFTEQUAL 296 #define RSHIFTEQUAL 297 -#define TOKENPASTE 298 -#define KW_BEGIN_PUBLISH 299 -#define KW_BLOCKING 300 -#define KW_BOOL 301 -#define KW_CATCH 302 -#define KW_CHAR 303 -#define KW_WCHAR_T 304 -#define KW_CLASS 305 -#define KW_CONST 306 -#define KW_DELETE 307 -#define KW_DOUBLE 308 -#define KW_DYNAMIC_CAST 309 -#define KW_ELSE 310 -#define KW_END_PUBLISH 311 -#define KW_ENUM 312 -#define KW_EXTENSION 313 -#define KW_EXTERN 314 -#define KW_EXPLICIT 315 -#define KW_PUBLISHED 316 -#define KW_FALSE 317 -#define KW_FLOAT 318 -#define KW_FRIEND 319 -#define KW_FOR 320 -#define KW_GOTO 321 -#define KW_IF 322 -#define KW_INLINE 323 -#define KW_INT 324 -#define KW_LONG 325 -#define KW_LONGLONG 326 +#define KW_BEGIN_PUBLISH 298 +#define KW_BLOCKING 299 +#define KW_BOOL 300 +#define KW_CATCH 301 +#define KW_CHAR 302 +#define KW_WCHAR_T 303 +#define KW_CLASS 304 +#define KW_CONST 305 +#define KW_DELETE 306 +#define KW_DOUBLE 307 +#define KW_DYNAMIC_CAST 308 +#define KW_ELSE 309 +#define KW_END_PUBLISH 310 +#define KW_ENUM 311 +#define KW_EXTENSION 312 +#define KW_EXTERN 313 +#define KW_EXPLICIT 314 +#define KW_PUBLISHED 315 +#define KW_FALSE 316 +#define KW_FLOAT 317 +#define KW_FRIEND 318 +#define KW_FOR 319 +#define KW_GOTO 320 +#define KW_IF 321 +#define KW_INLINE 322 +#define KW_INT 323 +#define KW_LONG 324 +#define KW_LONGLONG 325 +#define KW_MAKE_PROPERTY 326 #define KW_MAKE_SEQ 327 #define KW_MUTABLE 328 #define KW_NAMESPACE 329 @@ -501,7 +505,6 @@ pop_struct() { - #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -522,11 +525,26 @@ typedef struct YYLTYPE #endif +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int cppyyparse (void *YYPARSE_PARAM); +#else +int cppyyparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int cppyyparse (void); +#else +int cppyyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + +#endif /* !YY_CPPYY_BUILT_TMP_CPPBISON_YXX_H_INCLUDED */ + /* Copy the second part of user declarations. */ - -/* Line 264 of yacc.c */ -#line 530 "y.tab.c" +/* Line 390 of yacc.c */ +#line 548 "built/tmp/cppBison.yxx.c" #ifdef short # undef short @@ -576,27 +594,27 @@ typedef short int yytype_int16; #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ -# if YYENABLE_NLS +# if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ -# define YY_(msgid) msgid +# define YY_(Msgid) Msgid # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) +# define YYUSE(E) ((void) (E)) #else -# define YYUSE(e) /* empty */ +# define YYUSE(E) /* empty */ #endif /* Identity function, used to suppress warnings about constant conditions. */ #ifndef lint -# define YYID(n) (n) +# define YYID(N) (N) #else #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) @@ -629,11 +647,12 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 # endif # endif # endif @@ -656,24 +675,24 @@ YYID (yyi) # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif -# if (defined __cplusplus && ! defined _STDLIB_H \ +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif @@ -704,23 +723,7 @@ union yyalloc ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + 2 * YYSTACK_GAP_MAXIMUM) -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif +# define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of @@ -740,19 +743,39 @@ union yyalloc #endif +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from SRC to DST. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) +# else +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + /* YYFINAL -- State number of the termination state. */ #define YYFINAL 69 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 3490 +#define YYLAST 3555 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 128 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 94 /* YYNRULES -- Number of rules. */ -#define YYNRULES 534 +#define YYNRULES 535 /* YYNRULES -- Number of states. */ -#define YYNSTATES 958 +#define YYNSTATES 968 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -809,58 +832,58 @@ static const yytype_uint16 yyprhs[] = { 0, 0, 3, 6, 9, 12, 14, 17, 20, 22, 26, 31, 32, 38, 40, 42, 44, 46, 48, 50, - 53, 55, 57, 60, 63, 66, 69, 79, 80, 84, - 86, 89, 93, 96, 99, 102, 105, 108, 111, 114, - 117, 120, 122, 126, 130, 131, 136, 137, 143, 146, - 151, 154, 159, 160, 165, 166, 172, 176, 179, 184, - 187, 192, 193, 200, 201, 208, 209, 217, 218, 229, - 230, 242, 243, 252, 253, 263, 265, 267, 269, 274, - 280, 282, 284, 286, 288, 290, 292, 294, 296, 298, - 300, 302, 304, 306, 308, 310, 312, 314, 316, 318, - 320, 322, 324, 326, 328, 330, 332, 334, 336, 338, - 340, 342, 344, 346, 348, 350, 353, 356, 358, 360, - 362, 364, 365, 372, 374, 376, 378, 382, 385, 390, - 394, 399, 401, 403, 405, 408, 410, 413, 416, 419, - 422, 426, 431, 435, 439, 440, 447, 449, 451, 453, - 457, 460, 462, 466, 468, 471, 473, 476, 478, 482, - 488, 492, 497, 499, 501, 504, 506, 510, 514, 520, - 524, 528, 533, 535, 537, 539, 541, 544, 547, 550, - 554, 559, 561, 563, 565, 568, 571, 574, 578, 583, - 591, 595, 597, 600, 603, 606, 610, 615, 623, 625, - 627, 630, 632, 634, 636, 638, 641, 644, 646, 648, - 651, 653, 655, 657, 659, 662, 665, 667, 669, 672, - 675, 678, 681, 685, 686, 692, 693, 701, 703, 705, - 708, 712, 715, 718, 721, 725, 729, 733, 737, 741, - 745, 746, 752, 753, 760, 762, 764, 767, 769, 773, - 777, 783, 785, 787, 789, 791, 792, 799, 804, 807, - 811, 813, 815, 817, 819, 821, 823, 825, 827, 829, - 831, 833, 835, 838, 841, 844, 847, 849, 852, 854, - 858, 861, 863, 864, 867, 869, 872, 874, 876, 878, - 880, 882, 884, 886, 888, 890, 892, 894, 896, 898, - 900, 902, 904, 906, 908, 910, 912, 914, 916, 918, - 920, 922, 924, 926, 928, 930, 932, 934, 936, 938, - 940, 942, 944, 946, 948, 950, 952, 954, 956, 958, - 960, 962, 964, 966, 968, 970, 972, 974, 976, 978, - 980, 982, 984, 986, 988, 990, 992, 994, 996, 998, - 1000, 1002, 1004, 1006, 1008, 1010, 1012, 1014, 1016, 1018, - 1020, 1022, 1024, 1026, 1028, 1030, 1032, 1034, 1036, 1038, - 1040, 1042, 1044, 1046, 1048, 1050, 1052, 1054, 1056, 1058, - 1060, 1062, 1064, 1066, 1068, 1070, 1072, 1074, 1076, 1078, - 1080, 1084, 1086, 1088, 1090, 1092, 1094, 1098, 1100, 1105, - 1113, 1121, 1126, 1129, 1132, 1135, 1138, 1141, 1145, 1149, - 1153, 1157, 1161, 1165, 1169, 1173, 1177, 1181, 1185, 1189, - 1193, 1197, 1201, 1205, 1211, 1216, 1221, 1225, 1229, 1233, - 1237, 1239, 1244, 1252, 1260, 1265, 1270, 1275, 1280, 1285, - 1290, 1295, 1300, 1305, 1310, 1315, 1320, 1323, 1329, 1332, - 1335, 1338, 1341, 1344, 1348, 1352, 1356, 1360, 1364, 1368, - 1372, 1376, 1380, 1384, 1388, 1392, 1396, 1400, 1404, 1408, - 1412, 1416, 1422, 1427, 1432, 1436, 1440, 1444, 1448, 1450, - 1452, 1454, 1456, 1458, 1460, 1462, 1464, 1469, 1477, 1485, - 1490, 1493, 1499, 1502, 1505, 1508, 1511, 1515, 1519, 1523, - 1527, 1531, 1535, 1539, 1543, 1547, 1551, 1555, 1559, 1563, - 1567, 1571, 1575, 1579, 1583, 1589, 1594, 1599, 1603, 1607, - 1611, 1615, 1617, 1619, 1621, 1623, 1625, 1627, 1629, 1632, - 1635, 1637, 1639, 1641, 1644 + 53, 55, 57, 60, 63, 66, 69, 77, 87, 97, + 98, 102, 104, 107, 111, 114, 117, 120, 123, 126, + 129, 132, 135, 138, 140, 144, 148, 149, 154, 155, + 161, 164, 169, 172, 177, 178, 183, 184, 190, 194, + 197, 202, 205, 210, 211, 218, 219, 226, 227, 235, + 236, 247, 248, 260, 261, 270, 271, 281, 283, 285, + 287, 292, 298, 300, 302, 304, 306, 308, 310, 312, + 314, 316, 318, 320, 322, 324, 326, 328, 330, 332, + 334, 336, 338, 340, 342, 344, 346, 348, 350, 352, + 354, 356, 358, 360, 362, 364, 366, 368, 371, 374, + 376, 378, 380, 382, 383, 390, 392, 394, 396, 400, + 403, 408, 411, 416, 420, 425, 427, 429, 431, 433, + 436, 439, 442, 445, 449, 454, 458, 462, 463, 470, + 472, 474, 476, 480, 483, 485, 489, 491, 494, 496, + 499, 501, 505, 511, 515, 520, 522, 524, 527, 529, + 533, 537, 543, 547, 551, 556, 558, 560, 562, 564, + 567, 570, 573, 577, 582, 584, 586, 588, 591, 594, + 597, 601, 606, 614, 618, 620, 623, 626, 629, 633, + 638, 646, 648, 650, 653, 655, 657, 659, 661, 664, + 667, 669, 671, 674, 676, 678, 680, 682, 685, 688, + 690, 692, 695, 698, 701, 704, 708, 709, 715, 716, + 724, 726, 728, 731, 735, 738, 741, 744, 748, 752, + 756, 760, 764, 768, 769, 775, 776, 783, 785, 789, + 795, 797, 800, 805, 807, 809, 811, 813, 814, 821, + 826, 829, 833, 835, 837, 839, 841, 843, 845, 847, + 849, 851, 853, 855, 857, 860, 863, 866, 869, 871, + 874, 876, 880, 883, 885, 886, 889, 891, 894, 896, + 898, 900, 902, 904, 906, 908, 910, 912, 914, 916, + 918, 920, 922, 924, 926, 928, 930, 932, 934, 936, + 938, 940, 942, 944, 946, 948, 950, 952, 954, 956, + 958, 960, 962, 964, 966, 968, 970, 972, 974, 976, + 978, 980, 982, 984, 986, 988, 990, 992, 994, 996, + 998, 1000, 1002, 1004, 1006, 1008, 1010, 1012, 1014, 1016, + 1018, 1020, 1022, 1024, 1026, 1028, 1030, 1032, 1034, 1036, + 1038, 1040, 1042, 1044, 1046, 1048, 1050, 1052, 1054, 1056, + 1058, 1060, 1062, 1064, 1066, 1068, 1070, 1072, 1074, 1076, + 1078, 1080, 1082, 1084, 1086, 1088, 1090, 1092, 1094, 1096, + 1098, 1100, 1104, 1106, 1108, 1110, 1112, 1114, 1118, 1120, + 1125, 1133, 1141, 1146, 1149, 1152, 1155, 1158, 1161, 1165, + 1169, 1173, 1177, 1181, 1185, 1189, 1193, 1197, 1201, 1205, + 1209, 1213, 1217, 1221, 1225, 1231, 1236, 1241, 1245, 1249, + 1253, 1257, 1259, 1264, 1272, 1280, 1285, 1290, 1295, 1300, + 1305, 1310, 1315, 1320, 1325, 1330, 1335, 1340, 1343, 1349, + 1352, 1355, 1358, 1361, 1364, 1368, 1372, 1376, 1380, 1384, + 1388, 1392, 1396, 1400, 1404, 1408, 1412, 1416, 1420, 1424, + 1428, 1432, 1436, 1442, 1447, 1452, 1456, 1460, 1464, 1468, + 1470, 1472, 1474, 1476, 1478, 1480, 1482, 1484, 1489, 1497, + 1505, 1510, 1513, 1519, 1522, 1525, 1528, 1531, 1535, 1539, + 1543, 1547, 1551, 1555, 1559, 1563, 1567, 1571, 1575, 1579, + 1583, 1587, 1591, 1595, 1599, 1603, 1609, 1614, 1619, 1623, + 1627, 1631, 1635, 1637, 1639, 1641, 1643, 1645, 1647, 1649, + 1652, 1655, 1657, 1659, 1661, 1664 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ @@ -871,105 +894,107 @@ static const yytype_int16 yyrhs[] = 132, -1, 131, 105, 132, -1, 219, 122, 211, 124, -1, -1, 138, 104, 134, 130, 125, -1, 139, -1, 161, -1, 133, -1, 199, -1, 201, -1, 136, -1, - 92, 145, -1, 44, -1, 56, -1, 61, 107, -1, - 79, 107, -1, 78, 107, -1, 77, 107, -1, 72, - 122, 219, 105, 219, 105, 219, 124, 106, -1, -1, - 64, 137, 135, -1, 221, -1, 138, 59, -1, 138, - 59, 220, -1, 138, 85, -1, 138, 68, -1, 138, - 97, -1, 138, 60, -1, 138, 99, -1, 138, 73, - -1, 138, 80, -1, 138, 45, -1, 138, 58, -1, - 140, -1, 138, 181, 106, -1, 138, 150, 173, -1, - -1, 138, 181, 141, 143, -1, -1, 138, 51, 180, - 142, 144, -1, 167, 173, -1, 167, 172, 105, 143, - -1, 167, 173, -1, 167, 172, 105, 144, -1, -1, - 138, 181, 146, 148, -1, -1, 138, 51, 180, 147, - 149, -1, 138, 150, 173, -1, 167, 173, -1, 167, - 172, 105, 148, -1, 167, 173, -1, 167, 172, 105, - 149, -1, -1, 8, 122, 151, 169, 124, 158, -1, - -1, 9, 122, 152, 169, 124, 158, -1, -1, 120, - 219, 122, 153, 169, 124, 158, -1, -1, 9, 122, - 117, 167, 124, 122, 154, 169, 124, 158, -1, -1, - 9, 122, 10, 117, 167, 124, 122, 155, 169, 124, - 158, -1, -1, 76, 180, 177, 122, 156, 169, 124, - 158, -1, -1, 76, 51, 180, 177, 122, 157, 169, - 124, 158, -1, 8, -1, 221, -1, 51, -1, 158, - 89, 122, 124, -1, 158, 89, 122, 219, 124, -1, - 126, -1, 120, -1, 117, -1, 118, -1, 119, -1, - 115, -1, 116, -1, 110, -1, 112, -1, 111, -1, - 13, -1, 14, -1, 15, -1, 16, -1, 17, -1, - 18, -1, 113, -1, 114, -1, 19, -1, 20, -1, - 108, -1, 105, -1, 31, -1, 32, -1, 33, -1, - 34, -1, 35, -1, 36, -1, 37, -1, 38, -1, - 39, -1, 40, -1, 41, -1, 42, -1, 29, -1, - 123, 127, -1, 122, 124, -1, 75, -1, 52, -1, - 139, -1, 161, -1, -1, 88, 162, 113, 163, 114, - 160, -1, 221, -1, 164, -1, 165, -1, 164, 105, - 165, -1, 50, 219, -1, 50, 219, 108, 183, -1, - 166, 178, 171, -1, 51, 166, 178, 171, -1, 202, - -1, 8, -1, 9, -1, 93, 219, -1, 219, -1, - 76, 159, -1, 51, 167, -1, 117, 167, -1, 112, - 167, -1, 10, 117, 167, -1, 167, 123, 210, 127, - -1, 167, 107, 4, -1, 122, 167, 124, -1, -1, - 167, 122, 168, 169, 124, 158, -1, 221, -1, 12, - -1, 170, -1, 170, 105, 12, -1, 170, 12, -1, - 176, -1, 170, 105, 176, -1, 221, -1, 108, 213, - -1, 221, -1, 108, 214, -1, 106, -1, 104, 206, - 125, -1, 107, 131, 104, 206, 125, -1, 108, 214, - 106, -1, 108, 104, 174, 125, -1, 221, -1, 175, - -1, 175, 105, -1, 214, -1, 104, 174, 125, -1, - 175, 105, 214, -1, 175, 105, 104, 174, 125, -1, - 180, 178, 172, -1, 8, 178, 172, -1, 51, 180, - 178, 172, -1, 216, -1, 221, -1, 8, -1, 9, - -1, 51, 177, -1, 117, 177, -1, 112, 177, -1, - 10, 117, 177, -1, 177, 123, 210, 127, -1, 221, - -1, 8, -1, 9, -1, 51, 178, -1, 117, 178, - -1, 112, 178, -1, 10, 117, 178, -1, 178, 123, - 210, 127, -1, 122, 178, 124, 122, 169, 124, 158, - -1, 122, 178, 124, -1, 221, -1, 51, 179, -1, - 117, 179, -1, 112, 179, -1, 10, 117, 179, -1, - 179, 123, 210, 127, -1, 122, 179, 124, 122, 169, - 124, 158, -1, 202, -1, 9, -1, 93, 219, -1, - 184, -1, 186, -1, 191, -1, 193, -1, 198, 219, - -1, 197, 219, -1, 202, -1, 9, -1, 93, 219, - -1, 184, -1, 186, -1, 191, -1, 193, -1, 198, - 219, -1, 197, 219, -1, 202, -1, 9, -1, 93, - 219, -1, 198, 219, -1, 197, 219, -1, 180, 179, - -1, 51, 180, 179, -1, -1, 198, 104, 185, 130, - 125, -1, -1, 198, 219, 187, 188, 104, 130, 125, - -1, 221, -1, 189, -1, 107, 190, -1, 189, 105, - 190, -1, 79, 218, -1, 78, 218, -1, 77, 218, - -1, 97, 79, 218, -1, 97, 78, 218, -1, 97, - 77, 218, -1, 79, 97, 218, -1, 78, 97, 218, - -1, 77, 97, 218, -1, -1, 197, 104, 192, 195, - 125, -1, -1, 197, 219, 104, 194, 195, 125, -1, - 221, -1, 196, -1, 196, 105, -1, 219, -1, 219, - 108, 214, -1, 196, 105, 219, -1, 196, 105, 219, - 108, 214, -1, 57, -1, 50, -1, 87, -1, 94, - -1, -1, 74, 219, 104, 200, 130, 125, -1, 74, - 104, 130, 125, -1, 96, 219, -1, 96, 74, 219, - -1, 203, -1, 204, -1, 205, -1, 46, -1, 48, - -1, 49, -1, 82, -1, 70, -1, 71, -1, 95, - -1, 83, -1, 69, -1, 82, 203, -1, 70, 203, - -1, 95, 203, -1, 83, 203, -1, 63, -1, 70, - 63, -1, 53, -1, 70, 70, 63, -1, 70, 53, - -1, 98, -1, -1, 207, 208, -1, 221, -1, 208, - 209, -1, 3, -1, 4, -1, 6, -1, 5, -1, - 8, -1, 9, -1, 10, -1, 7, -1, 12, -1, - 13, -1, 14, -1, 15, -1, 16, -1, 17, -1, - 18, -1, 19, -1, 20, -1, 21, -1, 22, -1, - 29, -1, 30, -1, 31, -1, 32, -1, 33, -1, - 34, -1, 35, -1, 36, -1, 37, -1, 38, -1, - 39, -1, 40, -1, 41, -1, 42, -1, 46, -1, - 47, -1, 48, -1, 49, -1, 50, -1, 51, -1, - 52, -1, 53, -1, 54, -1, 55, -1, 57, -1, - 59, -1, 60, -1, 62, -1, 63, -1, 64, -1, - 65, -1, 66, -1, 67, -1, 68, -1, 69, -1, - 70, -1, 73, -1, 75, -1, 77, -1, 78, -1, - 79, -1, 61, -1, 80, -1, 81, -1, 82, -1, - 83, -1, 84, -1, 85, -1, 86, -1, 87, -1, - 89, -1, 90, -1, 91, -1, 92, -1, 93, -1, - 94, -1, 95, -1, 97, -1, 98, -1, 99, -1, - 100, -1, 43, -1, 76, -1, 115, -1, 116, -1, + 92, 145, -1, 43, -1, 55, -1, 60, 107, -1, + 79, 107, -1, 78, 107, -1, 77, 107, -1, 71, + 122, 8, 105, 8, 124, 106, -1, 71, 122, 8, + 105, 8, 105, 8, 124, 106, -1, 72, 122, 219, + 105, 219, 105, 219, 124, 106, -1, -1, 63, 137, + 135, -1, 221, -1, 138, 58, -1, 138, 58, 220, + -1, 138, 85, -1, 138, 67, -1, 138, 97, -1, + 138, 59, -1, 138, 99, -1, 138, 73, -1, 138, + 80, -1, 138, 44, -1, 138, 57, -1, 140, -1, + 138, 181, 106, -1, 138, 150, 173, -1, -1, 138, + 181, 141, 143, -1, -1, 138, 50, 180, 142, 144, + -1, 167, 173, -1, 167, 172, 105, 143, -1, 167, + 173, -1, 167, 172, 105, 144, -1, -1, 138, 181, + 146, 148, -1, -1, 138, 50, 180, 147, 149, -1, + 138, 150, 173, -1, 167, 173, -1, 167, 172, 105, + 148, -1, 167, 173, -1, 167, 172, 105, 149, -1, + -1, 8, 122, 151, 169, 124, 158, -1, -1, 9, + 122, 152, 169, 124, 158, -1, -1, 120, 219, 122, + 153, 169, 124, 158, -1, -1, 9, 122, 117, 167, + 124, 122, 154, 169, 124, 158, -1, -1, 9, 122, + 10, 117, 167, 124, 122, 155, 169, 124, 158, -1, + -1, 76, 180, 177, 122, 156, 169, 124, 158, -1, + -1, 76, 50, 180, 177, 122, 157, 169, 124, 158, + -1, 8, -1, 221, -1, 50, -1, 158, 89, 122, + 124, -1, 158, 89, 122, 219, 124, -1, 126, -1, + 120, -1, 117, -1, 118, -1, 119, -1, 115, -1, + 116, -1, 110, -1, 112, -1, 111, -1, 13, -1, + 14, -1, 15, -1, 16, -1, 17, -1, 18, -1, + 113, -1, 114, -1, 19, -1, 20, -1, 108, -1, + 105, -1, 31, -1, 32, -1, 33, -1, 34, -1, + 35, -1, 36, -1, 37, -1, 38, -1, 39, -1, + 40, -1, 41, -1, 42, -1, 29, -1, 123, 127, + -1, 122, 124, -1, 75, -1, 51, -1, 139, -1, + 161, -1, -1, 88, 162, 113, 163, 114, 160, -1, + 221, -1, 164, -1, 165, -1, 164, 105, 165, -1, + 49, 219, -1, 49, 219, 108, 183, -1, 93, 219, + -1, 93, 219, 108, 183, -1, 166, 178, 171, -1, + 50, 166, 178, 171, -1, 202, -1, 8, -1, 9, + -1, 219, -1, 76, 159, -1, 50, 167, -1, 117, + 167, -1, 112, 167, -1, 10, 117, 167, -1, 167, + 123, 210, 127, -1, 167, 107, 4, -1, 122, 167, + 124, -1, -1, 167, 122, 168, 169, 124, 158, -1, + 221, -1, 12, -1, 170, -1, 170, 105, 12, -1, + 170, 12, -1, 176, -1, 170, 105, 176, -1, 221, + -1, 108, 213, -1, 221, -1, 108, 214, -1, 106, + -1, 104, 206, 125, -1, 107, 131, 104, 206, 125, + -1, 108, 214, 106, -1, 108, 104, 174, 125, -1, + 221, -1, 175, -1, 175, 105, -1, 214, -1, 104, + 174, 125, -1, 175, 105, 214, -1, 175, 105, 104, + 174, 125, -1, 180, 178, 172, -1, 8, 178, 172, + -1, 50, 180, 178, 172, -1, 216, -1, 221, -1, + 8, -1, 9, -1, 50, 177, -1, 117, 177, -1, + 112, 177, -1, 10, 117, 177, -1, 177, 123, 210, + 127, -1, 221, -1, 8, -1, 9, -1, 50, 178, + -1, 117, 178, -1, 112, 178, -1, 10, 117, 178, + -1, 178, 123, 210, 127, -1, 122, 178, 124, 122, + 169, 124, 158, -1, 122, 178, 124, -1, 221, -1, + 50, 179, -1, 117, 179, -1, 112, 179, -1, 10, + 117, 179, -1, 179, 123, 210, 127, -1, 122, 179, + 124, 122, 169, 124, 158, -1, 202, -1, 9, -1, + 93, 219, -1, 184, -1, 186, -1, 191, -1, 193, + -1, 198, 219, -1, 197, 219, -1, 202, -1, 9, + -1, 93, 219, -1, 184, -1, 186, -1, 191, -1, + 193, -1, 198, 219, -1, 197, 219, -1, 202, -1, + 9, -1, 93, 219, -1, 198, 219, -1, 197, 219, + -1, 180, 179, -1, 50, 180, 179, -1, -1, 198, + 104, 185, 130, 125, -1, -1, 198, 219, 187, 188, + 104, 130, 125, -1, 221, -1, 189, -1, 107, 190, + -1, 189, 105, 190, -1, 79, 218, -1, 78, 218, + -1, 77, 218, -1, 97, 79, 218, -1, 97, 78, + 218, -1, 97, 77, 218, -1, 79, 97, 218, -1, + 78, 97, 218, -1, 77, 97, 218, -1, -1, 197, + 104, 192, 196, 125, -1, -1, 197, 219, 104, 194, + 196, 125, -1, 221, -1, 195, 219, 105, -1, 195, + 219, 108, 214, 105, -1, 195, -1, 195, 219, -1, + 195, 219, 108, 214, -1, 56, -1, 49, -1, 87, + -1, 94, -1, -1, 74, 219, 104, 200, 130, 125, + -1, 74, 104, 130, 125, -1, 96, 219, -1, 96, + 74, 219, -1, 203, -1, 204, -1, 205, -1, 45, + -1, 47, -1, 48, -1, 82, -1, 69, -1, 70, + -1, 95, -1, 83, -1, 68, -1, 82, 203, -1, + 69, 203, -1, 95, 203, -1, 83, 203, -1, 62, + -1, 69, 62, -1, 52, -1, 69, 69, 62, -1, + 69, 52, -1, 98, -1, -1, 207, 208, -1, 221, + -1, 208, 209, -1, 3, -1, 4, -1, 6, -1, + 5, -1, 8, -1, 9, -1, 10, -1, 7, -1, + 12, -1, 13, -1, 14, -1, 15, -1, 16, -1, + 17, -1, 18, -1, 19, -1, 20, -1, 21, -1, + 22, -1, 29, -1, 30, -1, 31, -1, 32, -1, + 33, -1, 34, -1, 35, -1, 36, -1, 37, -1, + 38, -1, 39, -1, 40, -1, 41, -1, 42, -1, + 45, -1, 46, -1, 47, -1, 48, -1, 49, -1, + 50, -1, 51, -1, 52, -1, 53, -1, 54, -1, + 56, -1, 58, -1, 59, -1, 61, -1, 62, -1, + 63, -1, 64, -1, 65, -1, 66, -1, 67, -1, + 68, -1, 69, -1, 73, -1, 75, -1, 77, -1, + 78, -1, 79, -1, 60, -1, 80, -1, 81, -1, + 82, -1, 83, -1, 84, -1, 85, -1, 86, -1, + 87, -1, 89, -1, 90, -1, 91, -1, 92, -1, + 93, -1, 94, -1, 95, -1, 97, -1, 98, -1, + 99, -1, 100, -1, 76, -1, 115, -1, 116, -1, 117, -1, 118, -1, 112, -1, 110, -1, 111, -1, 126, -1, 120, -1, 108, -1, 119, -1, 113, -1, 114, -1, 122, -1, 124, -1, 121, -1, 105, -1, @@ -977,7 +1002,7 @@ static const yytype_int16 yyrhs[] = 104, 208, 125, -1, 221, -1, 214, -1, 221, -1, 212, -1, 214, -1, 212, 105, 214, -1, 215, -1, 122, 183, 124, 213, -1, 86, 113, 183, 114, 122, - 212, 124, -1, 54, 113, 183, 114, 122, 212, 124, + 212, 124, -1, 53, 113, 183, 114, 122, 212, 124, -1, 84, 122, 183, 124, -1, 126, 213, -1, 120, 213, -1, 116, 213, -1, 117, 213, -1, 112, 213, -1, 213, 117, 213, -1, 213, 118, 213, -1, 213, @@ -991,13 +1016,13 @@ static const yytype_int16 yyrhs[] = -1, 213, 122, 124, -1, 213, 121, 213, -1, 213, 29, 213, -1, 122, 212, 124, -1, 215, -1, 122, 183, 124, 214, -1, 86, 113, 183, 114, 122, 212, - 124, -1, 54, 113, 183, 114, 122, 212, 124, -1, - 9, 122, 211, 124, -1, 69, 122, 211, 124, -1, - 48, 122, 211, 124, -1, 49, 122, 211, 124, -1, - 46, 122, 211, 124, -1, 82, 122, 211, 124, -1, - 70, 122, 211, 124, -1, 95, 122, 211, 124, -1, - 83, 122, 211, 124, -1, 63, 122, 211, 124, -1, - 53, 122, 211, 124, -1, 84, 122, 183, 124, -1, + 124, -1, 53, 113, 183, 114, 122, 212, 124, -1, + 9, 122, 211, 124, -1, 68, 122, 211, 124, -1, + 47, 122, 211, 124, -1, 48, 122, 211, 124, -1, + 45, 122, 211, 124, -1, 82, 122, 211, 124, -1, + 69, 122, 211, 124, -1, 95, 122, 211, 124, -1, + 83, 122, 211, 124, -1, 62, 122, 211, 124, -1, + 52, 122, 211, 124, -1, 84, 122, 183, 124, -1, 75, 182, -1, 75, 182, 122, 211, 124, -1, 126, 214, -1, 120, 214, -1, 116, 214, -1, 117, 214, -1, 112, 214, -1, 214, 117, 214, -1, 214, 118, @@ -1011,9 +1036,9 @@ static const yytype_int16 yyrhs[] = 214, -1, 214, 123, 214, 127, -1, 214, 122, 212, 124, -1, 214, 122, 124, -1, 214, 121, 214, -1, 214, 29, 214, -1, 122, 212, 124, -1, 4, -1, - 90, -1, 62, -1, 5, -1, 3, -1, 220, -1, + 90, -1, 61, -1, 5, -1, 3, -1, 220, -1, 8, -1, 217, -1, 122, 183, 124, 214, -1, 86, - 113, 183, 114, 122, 212, 124, -1, 54, 113, 183, + 113, 183, 114, 122, 212, 124, -1, 53, 113, 183, 114, 122, 212, 124, -1, 84, 122, 183, 124, -1, 75, 182, -1, 75, 182, 122, 211, 124, -1, 126, 214, -1, 120, 214, -1, 116, 214, -1, 112, 214, @@ -1027,7 +1052,7 @@ static const yytype_int16 yyrhs[] = 20, 214, -1, 216, 109, 214, 107, 214, -1, 216, 123, 214, 127, -1, 216, 122, 212, 124, -1, 216, 122, 124, -1, 216, 121, 214, -1, 216, 29, 214, - -1, 122, 212, 124, -1, 4, -1, 90, -1, 62, + -1, 122, 212, 124, -1, 4, -1, 90, -1, 61, -1, 5, -1, 3, -1, 220, -1, 219, -1, 198, 219, -1, 93, 219, -1, 8, -1, 9, -1, 6, -1, 220, 6, -1, -1 @@ -1036,64 +1061,64 @@ static const yytype_int16 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 382, 382, 383, 387, 394, 395, 396, 400, 401, - 405, 418, 417, 429, 430, 431, 432, 433, 434, 435, - 436, 449, 458, 462, 470, 474, 478, 487, 486, 501, - 505, 509, 520, 524, 528, 532, 536, 540, 544, 548, - 552, 559, 563, 572, 584, 583, 599, 598, 616, 624, - 635, 644, 658, 657, 673, 672, 683, 697, 705, 716, - 725, 740, 739, 762, 761, 786, 785, 816, 815, 831, - 830, 848, 847, 879, 878, 904, 917, 921, 925, 929, - 936, 940, 944, 948, 952, 956, 960, 964, 968, 972, - 976, 980, 984, 988, 992, 996, 1000, 1004, 1008, 1012, - 1016, 1020, 1024, 1028, 1032, 1036, 1040, 1044, 1048, 1052, - 1056, 1060, 1064, 1068, 1072, 1076, 1080, 1084, 1088, 1095, - 1096, 1101, 1100, 1111, 1112, 1116, 1122, 1131, 1135, 1139, - 1145, 1155, 1159, 1164, 1169, 1177, 1181, 1195, 1200, 1205, - 1210, 1215, 1220, 1225, 1231, 1230, 1252, 1256, 1261, 1265, - 1270, 1278, 1283, 1291, 1295, 1302, 1306, 1313, 1317, 1321, - 1325, 1329, 1336, 1337, 1338, 1342, 1345, 1346, 1347, 1351, - 1356, 1364, 1370, 1380, 1384, 1388, 1392, 1397, 1402, 1407, - 1412, 1420, 1424, 1428, 1432, 1437, 1442, 1447, 1452, 1457, - 1463, 1471, 1475, 1480, 1485, 1490, 1495, 1500, 1509, 1513, - 1518, 1522, 1526, 1530, 1534, 1538, 1554, 1573, 1577, 1582, - 1586, 1590, 1594, 1598, 1602, 1618, 1637, 1641, 1646, 1650, - 1666, 1685, 1691, 1702, 1701, 1726, 1725, 1755, 1756, 1760, - 1761, 1765, 1769, 1773, 1777, 1781, 1785, 1789, 1793, 1797, - 1805, 1804, 1817, 1816, 1828, 1829, 1830, 1834, 1839, 1844, - 1849, 1857, 1864, 1868, 1872, 1880, 1879, 1901, 1905, 1911, - 1920, 1921, 1922, 1926, 1930, 1934, 1938, 1943, 1948, 1953, - 1958, 1963, 1967, 1972, 1981, 1986, 1994, 1998, 2003, 2007, - 2012, 2020, 2030, 2030, 2040, 2041, 2045, 2048, 2051, 2054, - 2057, 2060, 2063, 2066, 2069, 2069, 2069, 2070, 2070, 2070, - 2070, 2071, 2071, 2071, 2071, 2071, 2072, 2072, 2072, 2073, - 2073, 2073, 2073, 2073, 2074, 2074, 2074, 2074, 2074, 2075, - 2075, 2075, 2075, 2075, 2075, 2076, 2076, 2076, 2076, 2076, - 2077, 2077, 2077, 2078, 2078, 2078, 2078, 2079, 2079, 2079, - 2080, 2080, 2080, 2080, 2080, 2081, 2081, 2081, 2081, 2082, - 2082, 2082, 2082, 2082, 2083, 2083, 2083, 2083, 2083, 2083, - 2084, 2084, 2084, 2084, 2084, 2085, 2085, 2086, 2089, 2089, - 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2090, - 2090, 2090, 2090, 2090, 2090, 2090, 2090, 2090, 2090, 2091, - 2091, 2095, 2099, 2106, 2110, 2117, 2121, 2128, 2132, 2136, - 2140, 2144, 2148, 2152, 2156, 2168, 2172, 2176, 2180, 2184, - 2188, 2192, 2196, 2200, 2204, 2208, 2212, 2216, 2220, 2224, - 2228, 2232, 2236, 2240, 2244, 2248, 2252, 2256, 2260, 2264, - 2272, 2276, 2280, 2284, 2288, 2295, 2301, 2307, 2313, 2319, - 2326, 2333, 2340, 2347, 2353, 2359, 2363, 2367, 2371, 2375, - 2379, 2391, 2395, 2399, 2403, 2407, 2411, 2415, 2419, 2423, - 2427, 2431, 2435, 2439, 2443, 2447, 2451, 2455, 2459, 2463, - 2467, 2471, 2475, 2479, 2483, 2487, 2491, 2495, 2502, 2506, - 2510, 2514, 2518, 2522, 2526, 2540, 2544, 2548, 2552, 2556, - 2560, 2564, 2568, 2572, 2576, 2588, 2592, 2596, 2600, 2604, - 2608, 2612, 2616, 2620, 2624, 2628, 2632, 2636, 2640, 2644, - 2648, 2652, 2656, 2660, 2664, 2668, 2672, 2676, 2680, 2684, - 2688, 2695, 2699, 2703, 2707, 2711, 2715, 2722, 2730, 2738, - 2761, 2765, 2772, 2776, 2782 + 0, 383, 383, 384, 388, 395, 396, 397, 401, 402, + 406, 419, 418, 430, 431, 432, 433, 434, 435, 436, + 437, 450, 459, 463, 471, 475, 479, 490, 507, 516, + 515, 530, 534, 538, 549, 553, 557, 561, 565, 569, + 573, 577, 581, 588, 592, 601, 613, 612, 628, 627, + 645, 653, 664, 673, 687, 686, 702, 701, 712, 726, + 734, 745, 754, 769, 768, 791, 790, 815, 814, 845, + 844, 860, 859, 877, 876, 908, 907, 933, 946, 950, + 954, 958, 965, 969, 973, 977, 981, 985, 989, 993, + 997, 1001, 1005, 1009, 1013, 1017, 1021, 1025, 1029, 1033, + 1037, 1041, 1045, 1049, 1053, 1057, 1061, 1065, 1069, 1073, + 1077, 1081, 1085, 1089, 1093, 1097, 1101, 1105, 1109, 1113, + 1117, 1124, 1125, 1130, 1129, 1140, 1141, 1145, 1151, 1160, + 1164, 1168, 1172, 1176, 1182, 1192, 1196, 1201, 1210, 1214, + 1228, 1233, 1238, 1243, 1248, 1253, 1258, 1264, 1263, 1285, + 1289, 1294, 1298, 1303, 1311, 1316, 1324, 1328, 1335, 1339, + 1346, 1350, 1354, 1358, 1362, 1369, 1370, 1371, 1375, 1378, + 1379, 1380, 1384, 1389, 1397, 1403, 1413, 1417, 1421, 1425, + 1430, 1435, 1440, 1445, 1453, 1457, 1461, 1465, 1470, 1475, + 1480, 1485, 1490, 1496, 1504, 1508, 1513, 1518, 1523, 1528, + 1533, 1542, 1546, 1551, 1555, 1559, 1563, 1567, 1571, 1587, + 1606, 1610, 1615, 1619, 1623, 1627, 1631, 1635, 1651, 1670, + 1674, 1679, 1683, 1699, 1718, 1724, 1735, 1734, 1759, 1758, + 1788, 1789, 1793, 1794, 1798, 1802, 1806, 1810, 1814, 1818, + 1822, 1826, 1830, 1838, 1837, 1850, 1849, 1861, 1862, 1868, + 1876, 1877, 1883, 1892, 1899, 1903, 1907, 1915, 1914, 1936, + 1940, 1946, 1955, 1956, 1957, 1961, 1965, 1969, 1973, 1978, + 1983, 1988, 1993, 1998, 2002, 2007, 2016, 2021, 2029, 2033, + 2038, 2042, 2047, 2055, 2065, 2065, 2075, 2076, 2080, 2083, + 2086, 2089, 2092, 2095, 2098, 2101, 2104, 2104, 2104, 2105, + 2105, 2105, 2105, 2106, 2106, 2106, 2106, 2106, 2107, 2107, + 2107, 2108, 2108, 2108, 2108, 2108, 2109, 2109, 2109, 2109, + 2109, 2110, 2110, 2110, 2110, 2110, 2110, 2111, 2111, 2111, + 2111, 2111, 2112, 2112, 2112, 2113, 2113, 2113, 2113, 2114, + 2114, 2114, 2115, 2115, 2115, 2115, 2115, 2116, 2116, 2116, + 2116, 2117, 2117, 2117, 2117, 2117, 2118, 2118, 2118, 2118, + 2118, 2118, 2119, 2119, 2119, 2119, 2119, 2120, 2121, 2124, + 2124, 2124, 2124, 2124, 2124, 2124, 2124, 2124, 2124, 2124, + 2125, 2125, 2125, 2125, 2125, 2125, 2125, 2125, 2125, 2125, + 2126, 2126, 2130, 2134, 2141, 2145, 2152, 2156, 2163, 2167, + 2171, 2175, 2179, 2183, 2187, 2191, 2203, 2207, 2211, 2215, + 2219, 2223, 2227, 2231, 2235, 2239, 2243, 2247, 2251, 2255, + 2259, 2263, 2267, 2271, 2275, 2279, 2283, 2287, 2291, 2295, + 2299, 2307, 2311, 2315, 2319, 2323, 2330, 2336, 2342, 2348, + 2354, 2361, 2368, 2375, 2382, 2388, 2394, 2398, 2402, 2406, + 2410, 2414, 2426, 2430, 2434, 2438, 2442, 2446, 2450, 2454, + 2458, 2462, 2466, 2470, 2474, 2478, 2482, 2486, 2490, 2494, + 2498, 2502, 2506, 2510, 2514, 2518, 2522, 2526, 2530, 2537, + 2541, 2545, 2549, 2553, 2557, 2561, 2575, 2579, 2583, 2587, + 2591, 2595, 2599, 2603, 2607, 2611, 2623, 2627, 2631, 2635, + 2639, 2643, 2647, 2651, 2655, 2659, 2663, 2667, 2671, 2675, + 2679, 2683, 2687, 2691, 2695, 2699, 2703, 2707, 2711, 2715, + 2719, 2723, 2730, 2734, 2738, 2742, 2746, 2750, 2757, 2765, + 2773, 2796, 2800, 2807, 2811, 2817 }; #endif -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +#if YYDEBUG || YYERROR_VERBOSE || 0 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = @@ -1106,24 +1131,24 @@ static const char *const yytname[] = "UNARY_STAR", "UNARY_REF", "POINTSAT", "SCOPE", "PLUSPLUS", "MINUSMINUS", "TIMESEQUAL", "DIVIDEEQUAL", "MODEQUAL", "PLUSEQUAL", "MINUSEQUAL", "OREQUAL", "ANDEQUAL", "XOREQUAL", "LSHIFTEQUAL", "RSHIFTEQUAL", - "TOKENPASTE", "KW_BEGIN_PUBLISH", "KW_BLOCKING", "KW_BOOL", "KW_CATCH", - "KW_CHAR", "KW_WCHAR_T", "KW_CLASS", "KW_CONST", "KW_DELETE", - "KW_DOUBLE", "KW_DYNAMIC_CAST", "KW_ELSE", "KW_END_PUBLISH", "KW_ENUM", + "KW_BEGIN_PUBLISH", "KW_BLOCKING", "KW_BOOL", "KW_CATCH", "KW_CHAR", + "KW_WCHAR_T", "KW_CLASS", "KW_CONST", "KW_DELETE", "KW_DOUBLE", + "KW_DYNAMIC_CAST", "KW_ELSE", "KW_END_PUBLISH", "KW_ENUM", "KW_EXTENSION", "KW_EXTERN", "KW_EXPLICIT", "KW_PUBLISHED", "KW_FALSE", "KW_FLOAT", "KW_FRIEND", "KW_FOR", "KW_GOTO", "KW_IF", "KW_INLINE", - "KW_INT", "KW_LONG", "KW_LONGLONG", "KW_MAKE_SEQ", "KW_MUTABLE", - "KW_NAMESPACE", "KW_NEW", "KW_OPERATOR", "KW_PRIVATE", "KW_PROTECTED", - "KW_PUBLIC", "KW_REGISTER", "KW_RETURN", "KW_SHORT", "KW_SIGNED", - "KW_SIZEOF", "KW_STATIC", "KW_STATIC_CAST", "KW_STRUCT", "KW_TEMPLATE", - "KW_THROW", "KW_TRUE", "KW_TRY", "KW_TYPEDEF", "KW_TYPENAME", "KW_UNION", - "KW_UNSIGNED", "KW_USING", "KW_VIRTUAL", "KW_VOID", "KW_VOLATILE", - "KW_WHILE", "START_CPP", "START_CONST_EXPR", "START_TYPE", "'{'", "','", - "';'", "':'", "'='", "'?'", "'|'", "'^'", "'&'", "'<'", "'>'", "'+'", - "'-'", "'*'", "'/'", "'%'", "'~'", "'.'", "'('", "'['", "')'", "'}'", - "'!'", "']'", "$accept", "grammar", "cpp", "constructor_inits", - "constructor_init", "extern_c", "$@1", "declaration", - "friend_declaration", "$@2", "storage_class", "type_like_declaration", - "multiple_var_declaration", "$@3", "$@4", + "KW_INT", "KW_LONG", "KW_LONGLONG", "KW_MAKE_PROPERTY", "KW_MAKE_SEQ", + "KW_MUTABLE", "KW_NAMESPACE", "KW_NEW", "KW_OPERATOR", "KW_PRIVATE", + "KW_PROTECTED", "KW_PUBLIC", "KW_REGISTER", "KW_RETURN", "KW_SHORT", + "KW_SIGNED", "KW_SIZEOF", "KW_STATIC", "KW_STATIC_CAST", "KW_STRUCT", + "KW_TEMPLATE", "KW_THROW", "KW_TRUE", "KW_TRY", "KW_TYPEDEF", + "KW_TYPENAME", "KW_UNION", "KW_UNSIGNED", "KW_USING", "KW_VIRTUAL", + "KW_VOID", "KW_VOLATILE", "KW_WHILE", "START_CPP", "START_CONST_EXPR", + "START_TYPE", "'{'", "','", "';'", "':'", "'='", "'?'", "'|'", "'^'", + "'&'", "'<'", "'>'", "'+'", "'-'", "'*'", "'/'", "'%'", "'~'", "'.'", + "'('", "'['", "')'", "'}'", "'!'", "']'", "$accept", "grammar", "cpp", + "constructor_inits", "constructor_init", "extern_c", "$@1", + "declaration", "friend_declaration", "$@2", "storage_class", + "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", "function_prototype", "$@7", "$@8", @@ -1140,15 +1165,15 @@ static const char *const yytname[] = "empty_instance_identifier", "type", "type_decl", "predefined_type", "full_type", "anonymous_struct", "$@16", "named_struct", "$@17", "maybe_class_derivation", "class_derivation", "base_specification", - "anonymous_enum", "$@18", "named_enum", "$@19", "enum_body", - "enum_body_no_trailing_comma", "enum_keyword", "struct_keyword", - "namespace_declaration", "$@20", "using_declaration", "simple_type", - "simple_int_type", "simple_float_type", "simple_void_type", "code", - "$@21", "code_block", "element", "optional_const_expr", - "optional_const_expr_comma", "const_expr_comma", + "anonymous_enum", "$@18", "named_enum", "$@19", + "enum_body_trailing_comma", "enum_body", "enum_keyword", + "struct_keyword", "namespace_declaration", "$@20", "using_declaration", + "simple_type", "simple_int_type", "simple_float_type", + "simple_void_type", "code", "$@21", "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", "class_derivation_name", - "name", "string", "empty", 0 + "name", "string", "empty", YY_NULL }; #endif @@ -1178,33 +1203,33 @@ static const yytype_uint8 yyr1[] = { 0, 128, 129, 129, 129, 130, 130, 130, 131, 131, 132, 134, 133, 135, 135, 135, 135, 135, 135, 135, - 135, 135, 135, 135, 135, 135, 135, 137, 136, 138, - 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, - 138, 139, 139, 139, 141, 140, 142, 140, 143, 143, - 144, 144, 146, 145, 147, 145, 145, 148, 148, 149, - 149, 151, 150, 152, 150, 153, 150, 154, 150, 155, - 150, 156, 150, 157, 150, 150, 158, 158, 158, 158, + 135, 135, 135, 135, 135, 135, 135, 135, 135, 137, + 136, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 139, 139, 139, 141, 140, 142, 140, + 143, 143, 144, 144, 146, 145, 147, 145, 145, 148, + 148, 149, 149, 151, 150, 152, 150, 153, 150, 154, + 150, 155, 150, 156, 150, 157, 150, 150, 158, 158, + 158, 158, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, - 159, 159, 159, 159, 159, 159, 159, 159, 159, 160, - 160, 162, 161, 163, 163, 164, 164, 165, 165, 165, - 165, 166, 166, 166, 166, 167, 167, 167, 167, 167, - 167, 167, 167, 167, 168, 167, 169, 169, 169, 169, - 169, 170, 170, 171, 171, 172, 172, 173, 173, 173, - 173, 173, 174, 174, 174, 175, 175, 175, 175, 176, - 176, 176, 176, 177, 177, 177, 177, 177, 177, 177, - 177, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 179, 179, 179, 179, 179, 179, 179, 180, 180, - 180, 180, 180, 180, 180, 180, 180, 181, 181, 181, - 181, 181, 181, 181, 181, 181, 182, 182, 182, 182, - 182, 183, 183, 185, 184, 187, 186, 188, 188, 189, - 189, 190, 190, 190, 190, 190, 190, 190, 190, 190, - 192, 191, 194, 193, 195, 195, 195, 196, 196, 196, - 196, 197, 198, 198, 198, 200, 199, 199, 201, 201, - 202, 202, 202, 203, 203, 203, 203, 203, 203, 203, - 203, 203, 203, 203, 203, 203, 204, 204, 204, 204, - 204, 205, 207, 206, 208, 208, 209, 209, 209, 209, + 159, 160, 160, 162, 161, 163, 163, 164, 164, 165, + 165, 165, 165, 165, 165, 166, 166, 166, 167, 167, + 167, 167, 167, 167, 167, 167, 167, 168, 167, 169, + 169, 169, 169, 169, 170, 170, 171, 171, 172, 172, + 173, 173, 173, 173, 173, 174, 174, 174, 175, 175, + 175, 175, 176, 176, 176, 176, 177, 177, 177, 177, + 177, 177, 177, 177, 178, 178, 178, 178, 178, 178, + 178, 178, 178, 178, 179, 179, 179, 179, 179, 179, + 179, 180, 180, 180, 180, 180, 180, 180, 180, 180, + 181, 181, 181, 181, 181, 181, 181, 181, 181, 182, + 182, 182, 182, 182, 183, 183, 185, 184, 187, 186, + 188, 188, 189, 189, 190, 190, 190, 190, 190, 190, + 190, 190, 190, 192, 191, 194, 193, 195, 195, 195, + 196, 196, 196, 197, 198, 198, 198, 200, 199, 199, + 201, 201, 202, 202, 202, 203, 203, 203, 203, 203, + 203, 203, 203, 203, 203, 203, 203, 203, 204, 204, + 204, 204, 204, 205, 207, 206, 208, 208, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, @@ -1215,21 +1240,21 @@ static const yytype_uint8 yyr1[] = 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 210, 210, 211, 211, 212, 212, 213, 213, 213, + 209, 209, 210, 210, 211, 211, 212, 212, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, + 213, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, - 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, - 214, 214, 214, 214, 214, 214, 214, 214, 215, 215, - 215, 215, 215, 215, 215, 216, 216, 216, 216, 216, + 214, 214, 214, 214, 214, 214, 214, 214, 214, 215, + 215, 215, 215, 215, 215, 215, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, - 216, 217, 217, 217, 217, 217, 217, 218, 218, 218, - 219, 219, 220, 220, 221 + 216, 216, 217, 217, 217, 217, 217, 217, 218, 218, + 218, 219, 219, 220, 220, 221 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -1237,33 +1262,33 @@ static const yytype_uint8 yyr2[] = { 0, 2, 2, 2, 2, 1, 2, 2, 1, 3, 4, 0, 5, 1, 1, 1, 1, 1, 1, 2, - 1, 1, 2, 2, 2, 2, 9, 0, 3, 1, - 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 1, 3, 3, 0, 4, 0, 5, 2, 4, - 2, 4, 0, 4, 0, 5, 3, 2, 4, 2, - 4, 0, 6, 0, 6, 0, 7, 0, 10, 0, - 11, 0, 8, 0, 9, 1, 1, 1, 4, 5, + 1, 1, 2, 2, 2, 2, 7, 9, 9, 0, + 3, 1, 2, 3, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 1, 3, 3, 0, 4, 0, 5, + 2, 4, 2, 4, 0, 4, 0, 5, 3, 2, + 4, 2, 4, 0, 6, 0, 6, 0, 7, 0, + 10, 0, 11, 0, 8, 0, 9, 1, 1, 1, + 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, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, - 1, 0, 6, 1, 1, 1, 3, 2, 4, 3, - 4, 1, 1, 1, 2, 1, 2, 2, 2, 2, - 3, 4, 3, 3, 0, 6, 1, 1, 1, 3, - 2, 1, 3, 1, 2, 1, 2, 1, 3, 5, - 3, 4, 1, 1, 2, 1, 3, 3, 5, 3, - 3, 4, 1, 1, 1, 1, 2, 2, 2, 3, - 4, 1, 1, 1, 2, 2, 2, 3, 4, 7, - 3, 1, 2, 2, 2, 3, 4, 7, 1, 1, - 2, 1, 1, 1, 1, 2, 2, 1, 1, 2, - 1, 1, 1, 1, 2, 2, 1, 1, 2, 2, - 2, 2, 3, 0, 5, 0, 7, 1, 1, 2, - 3, 2, 2, 2, 3, 3, 3, 3, 3, 3, - 0, 5, 0, 6, 1, 1, 2, 1, 3, 3, - 5, 1, 1, 1, 1, 0, 6, 4, 2, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 2, 2, 2, 1, 2, 1, 3, - 2, 1, 0, 2, 1, 2, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, + 1, 1, 1, 0, 6, 1, 1, 1, 3, 2, + 4, 2, 4, 3, 4, 1, 1, 1, 1, 2, + 2, 2, 2, 3, 4, 3, 3, 0, 6, 1, + 1, 1, 3, 2, 1, 3, 1, 2, 1, 2, + 1, 3, 5, 3, 4, 1, 1, 2, 1, 3, + 3, 5, 3, 3, 4, 1, 1, 1, 1, 2, + 2, 2, 3, 4, 1, 1, 1, 2, 2, 2, + 3, 4, 7, 3, 1, 2, 2, 2, 3, 4, + 7, 1, 1, 2, 1, 1, 1, 1, 2, 2, + 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, + 1, 2, 2, 2, 2, 3, 0, 5, 0, 7, + 1, 1, 2, 3, 2, 2, 2, 3, 3, 3, + 3, 3, 3, 0, 5, 0, 6, 1, 3, 5, + 1, 2, 4, 1, 1, 1, 1, 0, 6, 4, + 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 2, 2, 2, 2, 1, 2, + 1, 3, 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, @@ -1274,970 +1299,989 @@ 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, - 3, 1, 1, 1, 1, 1, 3, 1, 4, 7, - 7, 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, 4, 7, 7, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 2, 5, 2, 2, - 2, 2, 2, 3, 3, 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, 4, 7, 7, 4, - 2, 5, 2, 2, 2, 2, 3, 3, 3, 3, + 1, 3, 1, 1, 1, 1, 1, 3, 1, 4, + 7, 7, 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, 2, 2, - 1, 1, 1, 2, 0 + 3, 1, 4, 7, 7, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 2, 5, 2, + 2, 2, 2, 2, 3, 3, 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, 4, 7, 7, + 4, 2, 5, 2, 2, 2, 2, 3, 3, 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, 2, + 2, 1, 1, 1, 2, 0 }; -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero +/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint16 yydefact[] = { - 0, 534, 0, 0, 0, 534, 5, 482, 478, 481, - 532, 484, 0, 0, 0, 0, 0, 0, 480, 0, - 0, 0, 0, 0, 0, 0, 0, 479, 0, 0, - 0, 0, 0, 0, 0, 3, 430, 483, 199, 263, - 264, 265, 252, 0, 278, 251, 276, 271, 267, 268, - 266, 270, 253, 0, 254, 269, 281, 534, 4, 201, - 202, 203, 204, 0, 0, 198, 260, 261, 262, 1, - 20, 21, 0, 27, 0, 0, 0, 0, 0, 121, - 534, 0, 6, 15, 7, 18, 0, 13, 41, 14, - 16, 17, 29, 534, 534, 534, 534, 534, 0, 534, - 534, 534, 217, 0, 446, 0, 0, 216, 534, 534, - 0, 0, 534, 452, 450, 451, 449, 199, 263, 264, - 265, 278, 276, 271, 267, 266, 270, 269, 0, 0, - 395, 448, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 535, 0, 0, 0, 535, 5, 483, 479, 482, + 533, 485, 0, 0, 0, 0, 0, 0, 481, 0, + 0, 0, 0, 0, 0, 0, 0, 480, 0, 0, + 0, 0, 0, 0, 0, 3, 431, 484, 202, 265, + 266, 267, 254, 0, 280, 253, 278, 273, 269, 270, + 268, 272, 255, 0, 256, 271, 283, 535, 4, 204, + 205, 206, 207, 0, 0, 201, 262, 263, 264, 1, + 20, 21, 0, 29, 0, 0, 0, 0, 0, 0, + 123, 535, 0, 6, 15, 7, 18, 0, 13, 43, + 14, 16, 17, 31, 535, 535, 535, 535, 535, 0, + 535, 535, 535, 220, 0, 447, 0, 0, 219, 535, + 535, 0, 0, 535, 453, 451, 452, 450, 202, 265, + 266, 267, 280, 278, 273, 269, 268, 272, 271, 0, + 0, 396, 449, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 533, 534, 280, 277, 267, - 273, 267, 272, 275, 530, 531, 200, 274, 0, 534, - 534, 534, 534, 221, 191, 240, 206, 223, 205, 22, - 534, 0, 534, 0, 25, 24, 23, 0, 0, 19, - 0, 258, 75, 208, 39, 0, 40, 30, 35, 33, - 37, 0, 38, 32, 0, 34, 36, 11, 0, 0, - 44, 210, 211, 212, 213, 0, 0, 207, 0, 394, - 393, 0, 0, 0, 0, 0, 0, 0, 0, 218, - 534, 220, 219, 0, 0, 0, 0, 0, 0, 0, - 477, 461, 462, 463, 464, 465, 466, 469, 470, 476, - 0, 458, 459, 460, 467, 468, 456, 457, 453, 454, - 455, 475, 474, 0, 0, 222, 279, 534, 192, 194, - 193, 0, 534, 534, 242, 534, 534, 28, 0, 534, - 255, 534, 0, 0, 52, 259, 61, 63, 46, 31, - 0, 534, 209, 534, 0, 282, 157, 0, 0, 43, - 42, 0, 215, 214, 434, 438, 436, 437, 444, 0, - 443, 435, 440, 0, 439, 442, 445, 0, 441, 431, - 396, 0, 473, 472, 195, 0, 0, 392, 391, 0, - 245, 247, 244, 534, 534, 0, 0, 228, 227, 0, - 257, 534, 132, 133, 0, 0, 0, 0, 124, 125, - 534, 131, 123, 54, 56, 0, 534, 0, 0, 534, - 0, 534, 174, 175, 0, 534, 534, 534, 0, 173, - 534, 65, 0, 534, 0, 8, 0, 534, 0, 0, - 0, 0, 0, 0, 0, 45, 534, 135, 0, 447, - 0, 471, 534, 196, 241, 246, 0, 0, 224, 0, - 0, 0, 0, 229, 534, 0, 0, 534, 127, 534, - 134, 534, 0, 182, 183, 0, 534, 534, 534, 534, - 534, 181, 0, 53, 534, 525, 521, 524, 534, 147, - 0, 0, 523, 0, 0, 0, 522, 0, 0, 0, - 0, 0, 0, 148, 151, 534, 172, 485, 526, 146, - 0, 0, 0, 47, 534, 0, 534, 176, 178, 177, - 71, 534, 12, 534, 158, 283, 284, 282, 0, 534, - 534, 0, 163, 165, 162, 160, 0, 137, 90, 91, - 92, 93, 94, 95, 98, 99, 114, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 118, - 117, 101, 100, 87, 89, 88, 96, 97, 85, 86, - 82, 83, 84, 81, 0, 0, 80, 136, 139, 138, - 0, 0, 0, 144, 534, 0, 48, 155, 0, 0, - 0, 249, 248, 243, 0, 0, 0, 233, 527, 0, - 232, 0, 231, 0, 0, 0, 534, 230, 0, 256, - 0, 534, 0, 119, 122, 120, 126, 534, 184, 186, - 185, 0, 0, 534, 129, 153, 55, 534, 0, 57, - 534, 534, 0, 490, 0, 0, 495, 494, 493, 0, - 0, 492, 534, 150, 0, 534, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 534, 535, 282, 279, + 269, 275, 269, 274, 277, 531, 532, 203, 276, 0, + 535, 535, 535, 535, 224, 194, 243, 209, 226, 208, + 22, 535, 0, 0, 535, 0, 25, 24, 23, 0, + 0, 19, 0, 260, 77, 211, 41, 0, 42, 32, + 37, 35, 39, 0, 40, 34, 0, 36, 38, 11, + 0, 0, 46, 213, 214, 215, 216, 0, 0, 210, + 0, 395, 394, 0, 0, 0, 0, 0, 0, 0, + 0, 221, 535, 223, 222, 0, 0, 0, 0, 0, + 0, 0, 478, 462, 463, 464, 465, 466, 467, 470, + 471, 477, 0, 459, 460, 461, 468, 469, 457, 458, + 454, 455, 456, 476, 475, 0, 0, 225, 281, 535, + 195, 197, 196, 0, 535, 535, 245, 535, 535, 30, + 0, 0, 535, 257, 535, 0, 0, 54, 261, 63, + 65, 48, 33, 0, 535, 212, 535, 0, 284, 160, + 0, 0, 45, 44, 0, 218, 217, 435, 439, 437, + 438, 445, 0, 444, 436, 441, 0, 440, 443, 446, + 0, 442, 432, 397, 0, 474, 473, 198, 0, 0, + 393, 392, 250, 0, 247, 535, 535, 0, 0, 231, + 230, 0, 0, 259, 535, 136, 137, 0, 0, 0, + 0, 126, 127, 535, 135, 125, 56, 58, 0, 535, + 0, 0, 535, 0, 535, 177, 178, 0, 535, 535, + 535, 0, 176, 535, 67, 0, 535, 0, 8, 0, + 535, 0, 0, 0, 0, 0, 0, 0, 47, 535, + 138, 0, 448, 0, 472, 535, 199, 251, 244, 0, + 227, 0, 0, 0, 0, 232, 535, 0, 0, 0, + 535, 129, 535, 131, 535, 0, 185, 186, 0, 535, + 535, 535, 535, 535, 184, 0, 55, 535, 526, 522, + 525, 535, 150, 0, 0, 524, 0, 0, 0, 523, + 0, 0, 0, 0, 0, 0, 151, 154, 535, 175, + 486, 527, 149, 0, 0, 0, 49, 535, 0, 535, + 179, 181, 180, 73, 535, 12, 535, 161, 285, 286, + 284, 0, 535, 535, 0, 166, 168, 165, 163, 0, + 140, 92, 93, 94, 95, 96, 97, 100, 101, 116, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 120, 119, 103, 102, 89, 91, 90, 98, + 99, 87, 88, 84, 85, 86, 83, 0, 0, 82, + 139, 142, 141, 0, 0, 0, 147, 535, 0, 50, + 158, 0, 0, 0, 248, 0, 246, 0, 0, 0, + 236, 528, 0, 235, 0, 234, 0, 0, 0, 535, + 233, 0, 0, 0, 258, 0, 535, 0, 0, 121, + 124, 122, 128, 535, 187, 189, 188, 0, 0, 535, + 133, 156, 57, 535, 0, 59, 535, 535, 0, 491, + 0, 0, 496, 495, 494, 0, 0, 493, 535, 153, + 0, 535, 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, 0, 535, 0, + 52, 75, 182, 535, 0, 0, 288, 289, 291, 290, + 295, 292, 293, 294, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, + 332, 333, 348, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 368, 345, 346, 347, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + 361, 362, 363, 364, 365, 366, 367, 535, 385, 386, + 387, 378, 390, 374, 375, 373, 380, 381, 369, 370, + 371, 372, 379, 377, 384, 382, 388, 383, 376, 389, + 287, 0, 9, 0, 0, 164, 167, 143, 118, 117, + 146, 145, 159, 535, 0, 0, 434, 433, 535, 252, + 530, 242, 529, 241, 240, 239, 238, 237, 229, 0, + 26, 0, 130, 134, 132, 190, 193, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 157, 398, 0, 0, + 61, 0, 0, 173, 535, 0, 535, 0, 0, 0, + 521, 79, 64, 78, 152, 155, 172, 505, 506, 507, + 508, 509, 510, 513, 514, 520, 0, 502, 503, 504, + 511, 512, 500, 501, 497, 498, 499, 519, 518, 0, + 0, 0, 69, 66, 0, 535, 0, 183, 535, 0, + 162, 10, 169, 535, 170, 0, 144, 51, 200, 249, + 0, 0, 535, 0, 0, 0, 407, 405, 406, 404, + 0, 0, 403, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 534, 0, 50, 73, 179, 534, 0, 0, - 286, 287, 289, 288, 293, 290, 291, 292, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 366, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 346, 332, 333, - 334, 335, 336, 337, 338, 339, 340, 341, 342, 367, - 343, 344, 345, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, - 364, 365, 534, 384, 385, 386, 377, 389, 373, 374, - 372, 379, 380, 368, 369, 370, 371, 378, 376, 383, - 381, 387, 382, 375, 388, 285, 0, 9, 0, 0, - 161, 164, 140, 116, 115, 143, 142, 156, 534, 0, - 0, 433, 432, 534, 0, 529, 239, 528, 238, 237, - 236, 235, 234, 226, 0, 128, 130, 187, 190, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 154, 397, - 0, 0, 59, 0, 0, 170, 534, 0, 534, 0, - 0, 0, 520, 77, 62, 76, 149, 152, 169, 504, - 505, 506, 507, 508, 509, 512, 513, 519, 0, 501, - 502, 503, 510, 511, 499, 500, 496, 497, 498, 518, - 517, 0, 0, 0, 67, 64, 0, 534, 0, 180, - 534, 0, 159, 10, 166, 534, 167, 0, 141, 49, - 197, 250, 0, 534, 0, 0, 0, 406, 404, 405, - 403, 0, 0, 402, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 188, 0, 58, 156, 171, - 0, 0, 489, 0, 486, 0, 0, 516, 515, 69, - 534, 51, 0, 534, 66, 390, 0, 534, 26, 0, - 0, 0, 0, 0, 429, 415, 416, 417, 418, 419, - 420, 421, 422, 428, 0, 412, 413, 414, 410, 411, - 407, 408, 409, 427, 426, 0, 0, 60, 0, 491, - 0, 0, 514, 534, 0, 534, 72, 168, 145, 534, - 0, 401, 0, 398, 0, 425, 424, 0, 0, 78, - 0, 0, 534, 74, 189, 0, 0, 423, 488, 487, - 79, 534, 68, 0, 0, 70, 400, 399 + 0, 0, 0, 0, 191, 0, 60, 159, 174, 0, + 0, 490, 0, 487, 0, 0, 517, 516, 71, 535, + 53, 0, 535, 68, 391, 0, 535, 27, 28, 0, + 0, 0, 0, 0, 430, 416, 417, 418, 419, 420, + 421, 422, 423, 429, 0, 413, 414, 415, 411, 412, + 408, 409, 410, 428, 427, 0, 0, 62, 0, 492, + 0, 0, 515, 535, 0, 535, 74, 171, 148, 535, + 0, 402, 0, 399, 0, 426, 425, 0, 0, 80, + 0, 0, 535, 76, 192, 0, 0, 424, 489, 488, + 81, 535, 70, 0, 0, 72, 401, 400 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 4, 5, 374, 375, 83, 293, 84, 85, 180, - 86, 87, 88, 301, 360, 385, 453, 189, 355, 422, - 423, 566, 209, 356, 359, 463, 880, 923, 617, 817, - 784, 517, 554, 89, 187, 347, 348, 349, 350, 386, - 738, 442, 443, 564, 525, 299, 471, 472, 444, 368, - 420, 173, 57, 210, 104, 58, 59, 275, 60, 276, - 336, 337, 403, 61, 273, 62, 333, 329, 330, 63, - 64, 90, 341, 91, 65, 66, 67, 68, 372, 373, - 465, 725, 326, 218, 219, 768, 130, 36, 446, 447, - 537, 387, 37, 220 + -1, 4, 5, 377, 378, 84, 296, 85, 86, 181, + 87, 88, 89, 304, 363, 388, 456, 191, 358, 425, + 426, 572, 211, 359, 362, 466, 889, 933, 623, 825, + 792, 520, 560, 90, 189, 350, 351, 352, 353, 389, + 743, 445, 446, 570, 528, 302, 474, 475, 447, 371, + 423, 174, 57, 212, 105, 58, 59, 277, 60, 278, + 338, 339, 405, 61, 275, 62, 335, 332, 333, 63, + 64, 91, 344, 92, 65, 66, 67, 68, 375, 376, + 468, 730, 329, 220, 221, 776, 131, 36, 449, 450, + 540, 390, 37, 222 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -453 +#define YYPACT_NINF -508 static const yytype_int16 yypact[] = { - -29, -453, 2069, 3071, 30, 232, -453, -453, -453, -453, - -453, -453, -90, -86, -82, -58, -44, -61, -453, -20, - -15, -8, 3173, 27, 44, 56, 6, -453, 58, 2069, - 2069, 2069, 2069, 1341, 2069, 2512, -453, 118, -453, -453, - -453, -453, -453, 3224, -453, -453, -453, -453, 1690, -453, - 1823, 1823, -453, 164, -453, 1823, -453, 17, -453, -453, - -453, -453, -453, 49, 61, -453, -453, -453, -453, -453, - -453, -453, 45, -453, 60, 123, 144, 152, 166, -453, - -453, 38, -453, -453, -453, -453, 2282, -453, -453, -453, - -453, -453, -453, 2069, 2069, 2069, 2069, 2069, 3071, 2069, - 2069, 2069, -453, 164, 111, 164, 164, -453, 2069, 2069, - 3071, 3071, 2069, 125, 125, 125, 125, -90, -86, -82, - -58, -44, -20, -15, 1647, 1337, 1529, 1735, 153, -57, - 2512, 125, 2069, 2069, 2069, 2069, 2069, 2069, 2069, 2069, - 2069, 2069, 2069, 2069, 2069, 2069, 2069, 2069, 2069, 2069, - 2069, 2069, 2069, 681, 2069, -453, 17, -453, -453, 1778, - -453, 1823, -453, -453, -453, -453, -453, -453, 162, 17, - 17, 17, 17, 120, -453, -453, 187, -453, -22, -453, - 2869, 164, -453, 195, -453, -453, -453, 206, 2348, -453, - 164, -453, 214, 217, -453, 3224, -453, 324, -453, -453, - -453, 3122, -453, -453, 164, -453, -453, -453, 164, 341, - 237, -453, -453, -453, -453, 49, 61, -453, 224, 248, - -453, 233, 235, 244, 250, 261, 256, 257, 260, -453, - 2069, -453, -453, 262, 265, 270, 281, 278, 2069, 2069, - -453, 2673, 2704, 740, 740, 712, 712, 372, 372, -453, - 1359, 2719, 2734, 2858, 712, 712, 119, 119, 125, 125, - 125, -453, -453, -43, 891, 120, -453, 17, 120, 120, - 120, 106, 2069, 164, -453, -453, 300, -453, 304, 3236, - -453, 2989, 3224, 341, -453, -453, -453, 10, -453, 118, - 3224, 33, -453, -453, 289, -453, -453, 164, 1629, -453, - -453, 29, 187, -22, -453, -453, -453, -453, -453, 298, - -453, -453, -453, 297, -453, -453, -453, 309, -453, 125, - 2512, 2069, -453, -453, 120, 320, 295, 2512, -453, 301, - 338, 344, -453, 164, 3277, 208, 350, 351, -453, 164, - -453, -453, -453, -453, 164, 3020, 164, 343, 353, -453, - 25, -453, -453, -453, -453, 29, 1437, 342, 29, 1437, - 29, 33, -453, -453, 346, 33, 33, 33, 142, -453, - 3302, -453, 336, -453, 177, -453, 348, 1717, 1551, 347, - 29, 2203, 29, 29, 29, -453, 194, -453, 2069, -453, - 2069, 2512, 1437, -453, -453, 164, 2069, 349, -453, 379, - 555, 697, 178, -453, -453, 208, 373, 3340, 371, 25, - -453, 392, 2989, -453, -453, 375, 25, 25, 25, 25, - -48, -453, 29, -453, 194, -453, -453, -453, 25, -453, - 3224, 383, -453, 3173, 376, 386, -453, 2069, 2069, 2069, - 1341, 2069, 377, 54, -453, 25, 2529, -453, 118, -453, - 29, 228, 378, -453, 194, 203, 33, 381, 381, 381, - -453, 2069, -453, 1437, -453, 1215, -453, -453, 164, 2069, - 1717, 380, 406, 2512, -453, -453, 29, 223, -453, -453, - -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, - -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, - -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, - -453, -453, -453, -453, 388, 397, -453, -453, 223, 223, - 255, 107, 1629, -453, 2069, 414, -453, -453, -16, 59, - 405, 425, 2512, -453, 164, 306, 164, -453, -453, 306, - -453, 306, -453, 306, 306, 306, 3365, -453, 164, -453, - 3071, -48, 2404, -453, -453, -453, -453, 25, 411, 411, - 411, 247, 592, 2069, -453, -453, -453, 194, 432, -453, - 12, 25, 3071, 421, 3071, 3071, 125, 125, 125, 420, - 121, 125, 497, -453, 1533, 12, 2069, 2069, 2069, 2069, - 2069, 2069, 2069, 2069, 2069, 2069, 2069, 2069, 2069, 2069, - 2069, 2069, 2069, 2069, 2069, 2069, 2069, 1805, 2069, 317, - 548, 431, 497, 450, -453, -453, 381, 1437, 430, 434, - -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, - -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, - -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, - -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, - -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, - -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, - -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, - -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, - -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, - -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, - -453, -453, -453, -453, -453, -453, 435, -453, 441, 442, - -453, 1893, 223, -453, -453, -453, -453, 1551, 1437, 444, - 29, -453, -453, 497, 2069, -453, -453, -453, -453, -453, - -453, -453, -453, -453, 448, -453, -453, 411, 437, 455, - 451, 461, 592, 592, 592, 592, 1341, 592, 2563, -453, - 449, 470, -453, 29, 2069, -453, 12, 463, 2069, 454, - 468, 2069, -453, -453, 498, -453, -453, -453, -453, 2673, - 2704, 740, 740, 712, 712, 372, 372, -453, 2491, 2719, - 2734, 2858, 712, 712, 119, 119, 125, 125, 125, -453, - -453, 126, 2153, 466, -453, 498, 29, 1437, 465, -453, - 497, 1090, -453, -453, -453, 1717, 2512, 475, -453, -453, - 498, 2512, 486, 1437, 3071, 3071, 3071, 146, 146, 146, - 146, 477, 129, 146, 592, 592, 592, 592, 592, 592, - 592, 592, 592, 592, 592, 592, 592, 592, 592, 592, - 592, 592, 592, 1981, 2069, -453, 29, -453, 2512, -453, - 480, 482, -453, 485, 125, 487, 2069, -453, -453, -453, - 1437, -453, 484, 497, 498, -453, 488, 497, -453, 490, - 496, 491, 503, 592, -453, 2689, 2749, 935, 935, 753, - 753, 399, 399, -453, 2546, 2873, 2888, 2903, 315, 315, - 146, 146, 146, -453, -453, 165, 2183, -453, 2069, -453, - 2069, 20, 2512, 1437, 494, 497, 498, -453, 498, 497, - 499, -453, 500, 146, 592, -453, -453, 189, 198, -453, - 495, 501, 497, 498, 498, 2069, 2069, 2563, -453, -453, - -453, 497, 498, 207, 218, 498, -453, -453 + 177, -508, 2097, 3129, 8, 424, -508, -508, -508, -508, + -508, -508, -80, -73, -35, -31, -6, -17, -508, 3, + 28, 56, 3233, 60, 62, 67, 48, -508, 75, 2097, + 2097, 2097, 2097, 1281, 2097, 2689, -508, 189, -508, -508, + -508, -508, -508, 3285, -508, -508, -508, -508, 1676, -508, + 668, 668, -508, 113, -508, 668, -508, 23, -508, -508, + -508, -508, -508, 32, 39, -508, -508, -508, -508, -508, + -508, -508, 98, -508, 127, 140, 58, 162, 165, 168, + -508, -508, 52, -508, -508, -508, -508, 2425, -508, -508, + -508, -508, -508, -508, 2097, 2097, 2097, 2097, 2097, 3129, + 2097, 2097, 2097, -508, 113, 170, 113, 113, -508, 2097, + 2097, 3129, 3129, 2097, 112, 112, 112, 112, -80, -73, + -35, -31, -6, 3, 28, 2357, 1469, 1865, 1953, 188, + -104, 2689, 112, 2097, 2097, 2097, 2097, 2097, 2097, 2097, + 2097, 2097, 2097, 2097, 2097, 2097, 2097, 2097, 2097, 2097, + 2097, 2097, 2097, 2097, 1569, 2097, -508, 23, -508, -508, + 3125, -508, 668, -508, -508, -508, -508, -508, -508, 200, + 23, 23, 23, 23, 195, -508, -508, 216, -508, -30, + -508, 3456, 321, 113, -508, 227, -508, -508, -508, 224, + 2491, -508, 113, -508, 219, 226, -508, 3285, -508, 343, + -508, -508, -508, 3181, -508, -508, 113, -508, -508, -508, + 113, 132, 247, -508, -508, -508, -508, 32, 39, -508, + 236, 260, -508, 240, 246, 262, 272, 287, 278, 279, + 282, -508, 2097, -508, -508, 283, 284, 286, 298, 290, + 2097, 2097, -508, 1298, 608, 2156, 2156, 1561, 1561, 448, + 448, -508, 908, 2849, 2864, 2894, 1561, 1561, 259, 259, + 112, 112, 112, -508, -508, -70, 2181, 195, -508, 23, + 195, 195, 195, 31, 2097, -508, -508, -508, 309, -508, + 322, 324, 3314, -508, 3034, 3285, 132, -508, -508, -508, + 22, -508, 189, 3285, 149, -508, -508, 312, -508, -508, + 113, 1657, -508, -508, 234, 216, -30, -508, -508, -508, + -508, -508, 314, -508, -508, -508, 307, -508, -508, -508, + 319, -508, 112, 2689, 2097, -508, -508, 195, 320, 308, + 2689, -508, 113, 323, -508, -508, 3344, -15, 340, 341, + -508, 441, 113, -508, -508, -508, -508, 113, 2346, 113, + 336, 347, -508, 138, -508, -508, -508, -508, 234, 1377, + 338, 234, 1377, 234, 149, -508, -508, 342, 149, 149, + 149, 41, -508, 3370, -508, 332, -508, 194, -508, 339, + 1745, 2634, 345, 234, 2345, 234, 234, 234, -508, 183, + -508, 2097, -508, 2097, 2689, 1377, -508, 12, -508, 348, + -508, 222, 245, 346, 313, -508, -508, -15, -27, 359, + 3400, 358, 138, 360, 382, 3034, -508, -508, 354, 138, + 138, 138, 138, 1, -508, 234, -508, 183, -508, -508, + -508, 138, -508, 3285, 362, -508, 3233, 356, 363, -508, + 2097, 2097, 2097, 1281, 2097, 361, 26, -508, 138, 2706, + -508, 189, -508, 234, 178, 365, -508, 183, 181, 149, + 367, 367, 367, -508, 2097, -508, 1377, -508, 1156, -508, + -508, 113, 2097, 1745, 357, 389, 2689, -508, -508, 234, + 185, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, 375, 373, -508, + -508, 185, 185, 204, 77, 1657, -508, 2097, 400, -508, + -508, -26, 9, 387, -508, 2097, -508, 113, 510, 113, + -508, -508, 510, -508, 510, -508, 510, 510, 510, 3430, + -508, 498, 415, 113, -508, 3129, 1, 3129, 2547, -508, + -508, -508, -508, 138, 399, 399, 399, 221, 688, 2097, + -508, -508, -508, 183, 418, -508, 44, 138, 3129, 402, + 3129, 3129, 112, 112, 112, 401, 13, 112, 478, -508, + 1473, 44, 2097, 2097, 2097, 2097, 2097, 2097, 2097, 2097, + 2097, 2097, 2097, 2097, 2097, 2097, 2097, 2097, 2097, 2097, + 2097, 2097, 2097, 1833, 2097, 276, 532, 416, 478, 444, + -508, -508, 367, 1377, 427, 432, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, 426, -508, 433, 449, -508, 1921, 185, -508, -508, + -508, -508, 2634, 1377, 431, 234, -508, -508, 478, 2655, + -508, -508, -508, -508, -508, -508, -508, -508, -508, 454, + -508, 455, -508, -508, -508, 399, 451, 467, 459, 471, + 688, 688, 688, 688, 1281, 688, 2834, -508, 458, 481, + -508, 234, 2097, -508, 44, 474, 2097, 465, 477, 2097, + -508, -508, 503, -508, -508, -508, -508, 1298, 608, 2156, + 2156, 1561, 1561, 448, 448, -508, 2672, 2849, 2864, 2894, + 1561, 1561, 259, 259, 112, 112, 112, -508, -508, 14, + 2211, 473, -508, 503, 234, 1377, 472, -508, 478, 1031, + -508, -508, -508, 1745, 2689, 475, -508, -508, 503, -508, + 495, 496, 1377, 3129, 3129, 3129, 136, 136, 136, 136, + 482, 18, 136, 688, 688, 688, 688, 688, 688, 688, + 688, 688, 688, 688, 688, 688, 688, 688, 688, 688, + 688, 688, 2009, 2097, -508, 234, -508, 2689, -508, 483, + 485, -508, 488, 112, 490, 2097, -508, -508, -508, 1377, + -508, 491, 478, 503, -508, 489, 478, -508, -508, 492, + 493, 494, 505, 688, -508, 1490, 2879, 3046, 3046, 1737, + 1737, 676, 676, -508, 2817, 3003, 3018, 3033, 422, 422, + 136, 136, 136, -508, -508, 61, 2230, -508, 2097, -508, + 2097, 20, 2689, 1377, 497, 478, 503, -508, 503, 478, + 507, -508, 508, 136, 688, -508, -508, 72, 122, -508, + 509, 511, 478, 503, 503, 2097, 2097, 2834, -508, -508, + -508, 478, 503, 146, 158, 503, -508, -508 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -453, -453, -165, -453, 155, -453, -453, 440, -453, -453, - -77, 213, -453, -453, -453, -113, -188, -453, -453, -453, - -144, -235, 445, -453, -453, -453, -453, -453, -453, -453, - -416, -453, -453, 225, -453, -453, -453, 222, 290, -222, - -453, -333, -453, 88, -393, -230, -452, -453, 57, -316, - -322, -79, -38, 452, 210, 11, -84, -453, -75, -453, - -453, -453, 240, -71, -453, -70, -453, 314, -453, -21, - -3, -453, -453, -453, 2, 136, -453, -453, 183, -453, - -51, -453, -438, -87, -27, 184, 69, 134, -453, -453, - -346, 422, -134, -1 + -508, -508, -169, -508, 160, -508, -508, 460, -508, -508, + -74, 218, -508, -508, -508, -109, -185, -508, -508, -508, + -141, -232, 457, -508, -508, -508, -508, -508, -508, -508, + -507, -508, -508, 235, -508, -508, -508, 241, 303, -293, + -508, -356, -508, 99, -400, -276, -471, -508, 68, -269, + -376, -120, -29, 469, 225, -28, -84, -508, -78, -508, + -508, -508, 250, -75, -508, -61, -508, -508, 325, -11, + 106, -508, -508, -508, 2, 197, -508, -508, 192, -508, + -44, -508, -439, -79, -20, 130, 73, 15, -508, -508, + -344, 428, -130, -1 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -226 + number is the opposite. If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -229 static const yytype_int16 yytable[] = { - 6, 105, 211, 188, 92, 156, 129, 221, 222, 223, - 224, 212, 226, 227, 228, 213, 214, 279, 729, 106, - 357, 233, 234, 618, 107, 237, 452, 168, 164, 165, - 69, 568, 93, 413, 414, 415, 94, 164, 165, 379, - 95, 362, 363, 364, 128, 455, 164, 165, 239, 457, - 458, 459, 98, 354, 540, 542, 174, 164, 165, 530, - 562, 613, 239, 289, 96, 215, 583, 240, 169, 164, - 165, 35, 1, 2, 3, 563, 416, 265, 97, 92, - 380, 322, -225, 216, 365, -225, 739, 551, 217, 239, - 268, 269, 270, 271, 558, 559, 560, 561, 113, 114, - 115, 116, 99, 131, 211, 381, 570, 100, 741, 225, - 334, 736, 190, 212, 101, 164, 165, 213, 214, 111, - 774, 235, 236, 585, 155, 770, 263, 358, 370, 170, - 619, 164, 165, 424, 171, 563, 451, 417, 454, 172, - 616, 382, 418, 313, 939, 366, 383, 419, 140, 108, - 367, 384, 179, 175, 140, 174, 526, 288, 477, 584, - 518, 519, 520, 291, 239, 177, 109, 215, 174, 174, - 174, 174, 164, 165, 771, 852, 407, 775, 110, 92, - 112, 6, 181, 742, 160, 216, 162, 163, 324, 746, - 217, 167, 788, 748, 569, 749, 815, 750, 751, 752, - 567, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 448, 264, 614, 448, 239, 182, 609, 272, - 325, 239, -2, 230, 239, 757, 149, 150, 151, 546, - 152, 153, 154, 272, 353, 782, 152, 153, 154, 776, - 877, 184, 361, 894, 732, 543, 544, 545, 448, 185, - 160, 162, 163, 167, 460, 461, 174, 862, 863, 864, - 239, 328, 332, 186, 6, 338, 70, 238, 92, 267, - 352, 467, 468, 351, 818, 399, 400, 401, 71, 935, - 369, 274, 6, 72, 239, 160, 73, 160, 295, 280, - 296, 521, 522, 239, 74, 402, 75, 319, 320, 76, - 77, 78, 239, 948, 164, 165, 523, 524, 445, 281, - 79, 445, 949, 239, 80, 615, 461, 830, 81, 448, - 10, 956, 332, 92, 552, 610, 286, 772, 82, 287, - 6, 327, 957, 300, 852, 523, 524, 351, 304, 421, - 523, 524, 611, 239, 445, 449, 42, 305, 449, 306, - 369, 528, 610, 529, 369, 369, 369, 378, 307, 92, - 563, 758, 466, 886, 308, 309, 474, 523, 524, 735, - 310, 311, 728, 869, 312, 527, 314, 164, 165, 315, - 391, 449, 571, 52, 316, 317, 536, 536, 536, 534, - 54, 140, 318, 6, 884, 827, 92, 335, 421, 339, - 92, 371, 105, 580, 351, 421, 421, 421, 421, 565, - 388, 389, 393, 527, 610, 445, 394, 421, 852, 42, - 106, 390, 859, 860, 861, 107, 862, 863, 864, 523, - 524, 813, 392, 395, 421, 295, 473, 296, 297, 298, - 448, 579, 396, 527, 404, 369, 405, 411, 412, 450, - 328, 464, 449, 456, 476, 532, 52, 926, 211, 474, - 469, 928, 534, 54, 533, 166, 535, 212, 548, 550, - 79, 213, 214, 448, 882, 176, 178, 147, 148, 149, - 150, 151, 557, 152, 153, 154, 572, 183, 574, 575, - 889, 582, 612, 191, 461, 730, 576, 577, 578, 943, - 581, 731, 733, 944, 857, 858, 859, 860, 861, 740, - 862, 863, 864, 328, 734, 229, 952, 231, 232, 743, - 327, 215, 536, 744, 563, 955, 536, 773, 536, 473, - 536, 536, 536, 778, 781, 92, 445, 924, 783, 216, - 565, 424, 736, 814, 217, 816, 421, 819, 820, 833, - 822, 755, 328, 164, 165, 823, 527, 824, 834, 527, - 421, 828, 832, 835, 836, 866, 865, 870, 872, 445, - 811, 785, 873, 777, 527, 779, 780, 875, 879, 883, - 941, 737, 888, 327, 454, 7, 8, 9, 10, 887, - 11, 893, 918, 278, 448, 42, 919, 920, 925, 921, - 930, 785, 285, 927, 929, 931, 449, 932, 942, 950, - 277, 945, 946, 727, 553, 951, 292, 829, 881, 867, - 294, 917, 327, 283, 556, 409, 555, 302, 303, 756, - 284, 787, 52, 573, 567, 547, 759, 397, 534, 54, - 726, 821, 539, 0, 18, 789, 790, 791, 792, 793, - 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, - 804, 805, 806, 807, 808, 809, 760, 812, 761, 0, - 0, 0, 27, 448, 7, 8, 9, 10, 0, 11, - 12, 871, 0, 0, 0, 331, 769, 0, 0, 448, - 445, 466, 0, 0, 762, 164, 165, 0, 763, 764, - 0, 0, 765, 0, 766, 0, 0, 0, 767, 376, - 0, 0, 0, 0, 0, 0, 0, 13, 0, 14, - 15, 138, 139, 0, 16, 17, 0, 449, 0, 842, - 0, 140, 785, 18, 19, 0, 448, 42, 0, 0, - 20, 21, 0, 0, 0, 331, 22, 136, 137, 138, - 139, 406, 0, 23, 24, 25, 408, 26, 410, 140, - 0, 27, 850, 851, 0, 527, 28, 841, 0, 445, - 0, 0, 852, 0, 52, 0, 0, 0, 0, 448, - 534, 54, 0, 29, 541, 445, 0, 30, 31, 0, - 826, 32, 0, 33, 0, 262, 0, 34, 0, 0, - 0, 0, 0, 831, 0, 0, 449, 531, 0, 785, - 0, 538, 538, 538, 474, 0, 0, 147, 148, 149, - 150, 151, 449, 152, 153, 154, 915, 0, 0, 0, - 0, 0, 445, 868, 0, 890, 891, 892, 0, 0, - 874, 0, 0, 145, 146, 147, 148, 149, 150, 151, - 0, 152, 153, 154, 0, 0, 0, 0, 857, 858, - 859, 860, 861, 0, 862, 863, 864, 0, 0, 449, - 0, 0, 785, 0, 0, 445, 785, 0, 0, 0, - 376, 937, 0, 938, 473, 0, 769, 769, 769, 769, - 0, 769, 0, 0, 132, 133, 134, 135, 136, 137, - 138, 139, 0, 0, 0, 0, 0, 0, 953, 954, - 140, 0, 449, 0, 785, 0, 0, 0, 785, 0, - 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, - 0, 785, 0, 376, 0, 922, 837, 838, 839, 840, - 785, 843, 848, 849, 850, 851, 745, 538, 747, 0, - 0, 538, 0, 538, 852, 538, 538, 538, 0, 0, - 754, 0, 0, 0, 0, 0, 0, 0, 769, 769, - 769, 769, 769, 769, 769, 769, 769, 769, 769, 769, - 769, 769, 769, 769, 769, 769, 769, 0, 0, 0, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 0, 152, 153, 154, 0, 0, 0, 323, 0, - 0, 0, 0, 0, 0, 0, 0, 769, 895, 896, - 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, - 907, 908, 909, 910, 911, 912, 913, 0, 0, 0, - 857, 858, 859, 860, 861, 0, 862, 863, 864, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 769, 0, - 0, 0, 0, 0, 0, 0, 0, 933, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 620, 621, 622, 623, 624, 625, 626, - 627, 0, 628, 629, 630, 631, 632, 633, 634, 635, - 636, 637, 638, 0, 0, 0, 0, 0, 947, 639, - 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, - 650, 651, 652, 653, 0, 0, 654, 655, 656, 657, - 658, 659, 660, 661, 662, 663, 0, 664, 0, 665, - 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, - 676, 0, 0, 677, 0, 678, 679, 680, 681, 682, - 683, 684, 685, 686, 687, 688, 689, 690, 0, 691, - 692, 693, 694, 695, 696, 697, 0, 698, 699, 700, - 701, 0, 0, 0, 702, 703, 704, 705, 706, 707, - 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, - 718, 719, 720, 721, 722, 885, 723, 724, 620, 621, - 622, 623, 624, 625, 626, 627, 0, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 0, 0, - 0, 0, 0, 0, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 0, - 0, 654, 655, 656, 657, 658, 659, 660, 661, 662, - 663, 0, 664, 0, 665, 666, 667, 668, 669, 670, - 671, 672, 673, 674, 675, 676, 0, 0, 677, 0, - 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, - 688, 689, 690, 0, 691, 692, 693, 694, 695, 696, - 697, 0, 698, 699, 700, 701, 0, 0, 0, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, - 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, - 0, 723, 724, 940, 7, 8, 9, 10, 0, 11, - 117, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 132, 133, 134, 135, 136, 137, 138, 139, - 0, 0, 0, 39, 0, 40, 41, 118, 140, 119, - 120, 42, 43, 0, 121, 17, 0, 0, 45, 0, - 0, 0, 0, 18, 122, 0, 47, 161, 49, 0, - 123, 124, 49, 0, 0, 0, 22, 0, 0, 50, - 51, 0, 0, 125, 126, 25, 0, 26, 52, 0, - 0, 27, 55, 0, 53, 54, 127, 0, 0, 56, - 425, 426, 427, 10, 0, 428, 38, 0, 0, 429, - 0, 0, 0, 29, 0, 0, 0, 30, 31, 108, - 0, 32, 0, 33, 0, 0, 321, 34, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 0, - 152, 153, 154, 39, 0, 40, 41, 42, 430, 0, - 44, 431, 0, 0, 45, 0, 0, 0, 0, 432, - 46, 0, 0, 0, 0, 0, 47, 48, 49, 0, - 0, 0, 433, 0, 0, 0, 0, 0, 0, 50, - 51, 434, 0, 435, 52, 0, 0, 436, 0, 0, - 53, 54, 55, 0, 0, 56, 425, 426, 427, 10, - 0, 428, 38, 0, 0, 786, 0, 0, 0, 437, - 0, 0, 0, 438, 0, 0, 0, 439, 0, 440, - 0, 0, 0, 441, 132, 133, 134, 135, 136, 137, - 138, 139, 0, 0, 0, 39, 0, 40, 41, 39, - 140, 40, 41, 42, 430, 0, 44, 431, 0, 0, - 45, 0, 0, 0, 0, 432, 46, 0, 47, 161, - 49, 0, 47, 48, 49, 0, 0, 0, 433, 0, - 0, 50, 51, 0, 0, 50, 51, 434, 0, 435, - 52, 0, 0, 436, 55, 0, 53, 54, 55, 0, - 0, 56, 7, 8, 9, 10, 0, 11, 12, 0, - 0, 0, 0, 0, 0, 437, 0, 0, 0, 438, - 0, 109, 0, 439, 0, 440, 0, 475, 0, 441, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 0, 152, 153, 154, 13, 0, 14, 15, 0, - 0, 0, 16, 17, 0, 0, 0, 0, 0, 0, - 0, 18, 19, 39, 0, 40, 41, 0, 20, 21, - 157, 0, 0, 0, 22, 0, 0, 0, 0, 0, - 158, 23, 24, 25, 0, 26, 47, 159, 49, 27, - 7, 8, 9, 10, 28, 11, 12, 0, 0, 50, - 51, 0, 0, 377, 0, 0, 39, 0, 40, 41, - 0, 29, 55, 157, 0, 30, 31, 0, 0, 32, - 0, 33, 0, 158, 0, 34, 0, 0, 0, 47, - 159, 49, 0, 13, 0, 14, 15, 0, 0, 101, - 16, 17, 50, 51, 0, 0, 0, 0, 0, 18, - 19, 39, 0, 40, 41, 55, 20, 21, 0, 0, - 0, 0, 22, 0, 0, 0, 0, 0, 0, 23, - 24, 25, 0, 26, 47, 161, 49, 27, 7, 8, - 9, 10, 28, 11, 12, 0, 0, 50, 51, 0, - 0, 470, 0, 0, 39, 0, 40, 41, 0, 29, - 55, 0, 0, 30, 31, 0, 0, 32, 0, 33, - 0, 266, 0, 34, 0, 0, 0, 47, 161, 49, - 0, 13, 0, 14, 15, 0, 0, 112, 16, 17, - 50, 51, 0, 0, 0, 0, 0, 18, 19, 39, - 0, 40, 41, 55, 20, 21, 0, 0, 0, 0, - 22, 0, 0, 0, 0, 0, 0, 23, 24, 25, - 0, 26, 47, 161, 49, 27, 7, 8, 9, 10, - 28, 11, 12, 0, 0, 50, 51, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 29, 55, 0, - 0, 30, 31, 0, 0, 32, 0, 33, 0, 810, - 0, 34, 0, 0, 0, 0, 0, 0, 0, 13, - 0, 14, 15, 0, 0, 0, 16, 17, 0, 0, - 0, 0, 0, 0, 0, 18, 19, 0, 0, 0, - 0, 0, 20, 21, 0, 0, 0, 0, 22, 0, - 0, 0, 0, 0, 0, 23, 24, 25, 0, 26, - 0, 0, 0, 27, 7, 8, 9, 10, 28, 11, - 12, 0, 0, 0, 0, 0, 0, 825, 0, 0, - 0, 0, 0, 0, 0, 29, 0, 0, 0, 30, - 31, 0, 0, 32, 0, 33, 0, 0, 0, 34, - 0, 0, 0, 0, 0, 0, 0, 13, 0, 14, - 15, 0, 0, 0, 16, 17, 0, 0, 0, 0, - 0, 0, 0, 18, 19, 0, 0, 0, 0, 0, - 20, 21, 0, 0, 0, 0, 22, 0, 0, 0, - 0, 0, 0, 23, 24, 25, 0, 26, 0, 0, - 0, 27, 7, 8, 9, 10, 28, 11, 12, 0, + 6, 241, 734, 213, 93, 129, 455, 190, 69, 214, + 357, 106, 215, 130, 157, 282, 223, 224, 225, 226, + 242, 228, 229, 230, 108, 624, 216, 574, 165, 166, + 235, 236, 360, 169, 239, 241, 556, 267, 589, 533, + 165, 166, 94, 564, 565, 566, 567, 165, 166, 95, + 270, 271, 272, 273, 325, 576, 175, 619, 543, 545, + 165, 166, 401, 402, 403, 427, 165, 166, 454, 292, + 457, 227, 591, 170, -228, 35, 217, -228, 551, 241, + 93, 741, 404, 237, 238, 165, 166, 96, 744, 219, + 480, 97, 521, 522, 523, 458, 99, 552, 746, 460, + 461, 462, 114, 115, 116, 117, 213, 132, 336, 568, + 625, 823, 214, 529, 241, 215, 98, 534, 241, 241, + 535, 165, 166, 241, 569, 100, 192, 373, 107, 216, + 778, 590, 573, 747, 265, 171, 176, 790, 886, 361, + 172, 141, 904, 178, 949, 173, 416, 417, 418, 327, + 101, 575, 782, 316, 274, 328, 175, 365, 366, 367, + 615, 112, 184, 463, 464, 861, 241, 569, 291, 175, + 175, 175, 175, 779, 294, 410, 783, 241, 102, 217, + 93, 620, 109, 6, 110, 945, 737, 765, 419, 111, + 622, 796, 219, 218, 751, 156, 958, 113, 753, 368, + 754, 784, 755, 756, 757, 180, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 241, 266, 451, + 165, 166, 451, 153, 154, 155, 298, 549, 299, 300, + 301, 838, 165, 166, 382, 161, 959, 163, 164, 182, + 420, 241, 168, 165, 166, 421, 356, 871, 872, 873, + 422, 369, 183, 241, 364, 451, 370, 826, 175, 186, + 966, 42, 187, 331, 334, 188, 6, 340, 1, 2, + 3, 93, 967, 355, 383, 616, 354, 298, 141, 299, + 524, 525, 232, 372, 42, 6, 218, 780, 470, 471, + 526, 527, 617, 621, 464, 526, 527, 526, 527, 52, + 384, 616, 240, 322, 323, 537, 54, 269, 274, 538, + 276, 893, 161, 163, 164, 168, 526, 527, 740, 280, + 448, 283, 52, 448, 334, 93, 451, 284, 537, 54, + 558, 289, 542, 6, 569, 766, 385, 330, 290, 10, + 354, 386, 424, 303, 165, 166, 387, 161, 452, 161, + 307, 452, 895, 372, 308, 241, 448, 372, 372, 372, + 309, 531, 93, 532, 381, 469, 150, 151, 152, 477, + 153, 154, 155, 616, 878, 936, 310, 835, 530, 938, + 546, 547, 548, 733, 452, 42, 311, 394, 526, 527, + 821, 312, 313, 314, 577, 6, 315, 317, 318, 93, + 319, 424, 320, 93, 321, 585, 337, 354, 424, 424, + 424, 424, 571, 586, -2, 106, 530, 341, 953, 342, + 424, 392, 954, 52, 374, 396, 391, 448, 108, 537, + 54, 393, 395, 544, 406, 962, 407, 424, 398, 408, + 414, 861, 415, 476, 965, 453, 530, 467, 372, 459, + 451, 472, 479, 331, 553, 452, 555, 70, 557, 891, + 80, 563, 477, 536, 213, 578, 581, 141, 580, 71, + 214, 167, 735, 215, 72, 588, 899, 73, 427, 618, + 464, 177, 179, 451, 736, 74, 75, 216, 76, 738, + 739, 77, 78, 79, 185, 745, 759, 539, 539, 539, + 193, 748, 80, 582, 583, 584, 81, 587, 165, 166, + 82, 760, 569, 781, 786, 789, 331, 762, 791, 764, + 83, 457, 231, 934, 233, 234, 741, 330, 822, 868, + 869, 870, 107, 871, 872, 873, 476, 217, 93, 824, + 785, 830, 787, 788, 827, 571, 828, 831, 836, 42, + 219, 448, 424, 148, 149, 150, 151, 152, 331, 153, + 154, 155, 530, 842, 832, 530, 424, 951, 840, 841, + 843, 844, 573, 777, 845, 874, 875, 793, 879, 881, + 530, 882, 884, 819, 448, 888, 892, 52, 742, 896, + 330, 897, 898, 537, 54, 928, 903, 940, 749, 929, + 930, 281, 931, 451, 937, 935, 939, 793, 941, 942, + 288, 952, 452, 135, 136, 137, 138, 139, 140, 955, + 956, 732, 559, 960, 295, 961, 837, 141, 297, 890, + 876, 279, 330, 927, 539, 305, 306, 286, 539, 561, + 539, 412, 539, 539, 539, 763, 562, 550, 795, 287, + 399, 579, 731, 829, 218, 797, 798, 799, 800, 801, + 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, + 812, 813, 814, 815, 816, 817, 0, 820, 0, 0, + 0, 7, 8, 9, 10, 451, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 861, 469, 880, 0, 0, + 0, 0, 451, 39, 448, 40, 41, 0, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 379, 153, + 154, 155, 0, 0, 0, 0, 47, 162, 49, 0, + 0, 767, 452, 0, 0, 0, 850, 793, 0, 18, + 50, 51, 0, 0, 851, 0, 0, 0, 0, 451, + 397, 0, 0, 55, 0, 0, 0, 0, 0, 0, + 409, 0, 768, 0, 769, 411, 0, 413, 27, 0, + 0, 0, 0, 530, 0, 777, 777, 777, 777, 0, + 777, 866, 867, 868, 869, 870, 448, 871, 872, 873, + 770, 0, 0, 451, 771, 772, 0, 0, 773, 834, + 774, 0, 0, 448, 775, 900, 901, 902, 0, 0, + 0, 0, 0, 0, 452, 0, 0, 793, 0, 541, + 541, 541, 477, 0, 0, 0, 0, 0, 0, 0, + 0, 452, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 925, 0, 0, 877, 0, 0, 0, 0, + 448, 0, 883, 0, 0, 0, 0, 0, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 0, 452, 0, + 0, 793, 0, 0, 0, 793, 0, 0, 0, 379, + 846, 847, 848, 849, 448, 852, 476, 0, 947, 0, + 948, 0, 0, 0, 0, 0, 0, 0, 777, 0, + 0, 133, 134, 135, 136, 137, 138, 139, 140, 0, + 0, 0, 452, 0, 793, 963, 964, 141, 793, 0, + 0, 0, 0, 0, 0, 0, 926, 0, 0, 0, + 0, 793, 379, 0, 0, 0, 0, 0, 932, 777, + 793, 0, 0, 0, 0, 750, 541, 752, 0, 0, + 541, 0, 541, 0, 541, 541, 541, 0, 0, 0, + 0, 761, 0, 905, 906, 907, 908, 909, 910, 911, + 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, + 922, 923, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 324, 0, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 0, 153, + 154, 155, 0, 943, 626, 627, 628, 629, 630, 631, + 632, 633, 0, 634, 635, 636, 637, 638, 639, 640, + 641, 642, 643, 644, 0, 0, 0, 0, 0, 0, + 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, + 655, 656, 657, 658, 957, 0, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 0, 669, 0, 670, + 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, + 681, 0, 0, 0, 682, 0, 683, 684, 685, 686, + 687, 688, 689, 690, 691, 692, 693, 694, 695, 0, + 696, 697, 698, 699, 700, 701, 702, 0, 703, 704, + 705, 706, 0, 0, 0, 707, 708, 709, 710, 711, + 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, + 722, 723, 724, 725, 726, 727, 894, 728, 729, 626, + 627, 628, 629, 630, 631, 632, 633, 0, 634, 635, + 636, 637, 638, 639, 640, 641, 642, 643, 644, 0, + 0, 0, 0, 0, 0, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 0, + 0, 659, 660, 661, 662, 663, 664, 665, 666, 667, + 668, 0, 669, 0, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 0, 0, 0, 682, + 0, 683, 684, 685, 686, 687, 688, 689, 690, 691, + 692, 693, 694, 695, 0, 696, 697, 698, 699, 700, + 701, 702, 0, 703, 704, 705, 706, 0, 0, 0, + 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, + 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, + 727, 0, 728, 729, 7, 8, 9, 10, 0, 11, + 118, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 134, 135, 136, 137, 138, 139, 140, 0, + 0, 0, 0, 0, 0, 0, 119, 141, 120, 121, + 42, 43, 0, 122, 17, 0, 0, 45, 0, 0, + 0, 0, 18, 123, 0, 0, 0, 0, 0, 124, + 125, 49, 0, 0, 0, 0, 22, 0, 0, 950, + 0, 0, 0, 126, 127, 25, 0, 26, 52, 0, + 0, 27, 0, 0, 53, 54, 128, 0, 0, 56, + 428, 429, 430, 10, 0, 431, 38, 0, 0, 432, 0, 0, 0, 29, 0, 0, 0, 30, 31, 0, - 0, 32, 0, 33, 0, 914, 0, 34, 0, 0, - 0, 0, 0, 0, 0, 13, 0, 14, 15, 0, - 0, 0, 16, 17, 0, 0, 0, 0, 0, 0, - 0, 18, 19, 0, 0, 0, 0, 0, 20, 21, + 0, 32, 0, 33, 0, 0, 0, 34, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 0, 153, + 154, 155, 39, 0, 40, 41, 42, 433, 0, 44, + 434, 0, 0, 45, 0, 0, 0, 0, 435, 46, + 0, 0, 0, 0, 0, 47, 48, 49, 0, 0, + 0, 0, 436, 0, 0, 0, 0, 0, 0, 50, + 51, 437, 0, 438, 52, 0, 0, 439, 0, 0, + 53, 54, 55, 0, 0, 56, 428, 429, 430, 10, + 0, 431, 38, 0, 0, 794, 0, 0, 0, 440, + 0, 0, 0, 441, 0, 0, 0, 442, 0, 443, + 0, 0, 0, 444, 854, 855, 856, 857, 858, 859, + 860, 0, 0, 0, 39, 0, 40, 41, 39, 861, + 40, 41, 42, 433, 0, 44, 434, 0, 0, 45, + 0, 0, 0, 0, 435, 46, 0, 47, 162, 49, + 0, 47, 48, 49, 0, 0, 0, 0, 436, 0, + 0, 50, 51, 0, 0, 50, 51, 437, 0, 438, + 52, 0, 0, 439, 55, 0, 53, 54, 55, 0, + 0, 56, 7, 8, 9, 10, 0, 11, 12, 0, + 139, 140, 0, 0, 0, 440, 0, 0, 0, 441, + 141, 109, 0, 442, 0, 443, 0, 0, 0, 444, + 863, 864, 865, 0, 0, 866, 867, 868, 869, 870, + 0, 871, 872, 873, 13, 0, 14, 15, 0, 0, + 0, 16, 17, 0, 0, 0, 0, 0, 0, 0, + 18, 19, 0, 0, 0, 0, 0, 20, 21, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 23, 24, 25, 0, 26, 0, 0, 0, 27, - 0, 0, 0, 0, 28, 0, 132, 133, 134, 135, - 136, 137, 138, 139, 0, 0, 0, 0, 0, 0, - 0, 29, 140, 0, 0, 30, 31, 0, 0, 32, - 0, 33, 0, 0, 0, 34, 132, 133, 134, 135, - 136, 137, 138, 139, 0, 0, 0, 0, 0, 0, - 0, 0, 140, 0, 0, 0, 478, 479, 480, 481, - 482, 483, 484, 485, 0, 0, 0, 0, 0, 0, - 0, 0, 486, 0, 487, 488, 489, 490, 491, 492, - 493, 494, 495, 496, 497, 498, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 499, 0, 0, 0, 0, - 0, 0, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 0, 152, 153, 154, 0, 500, 0, - 878, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 192, 193, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 0, 152, 153, 154, 0, 501, 0, - 936, 502, 0, 503, 504, 505, 506, 507, 508, 509, - 510, 511, 512, 513, 0, 514, 515, 194, 39, 516, - 40, 41, 42, 195, 0, 44, 0, 0, 0, 45, - 196, 197, 198, 0, 0, 46, 0, 0, 0, 0, - 199, 47, 48, 49, 0, 200, 192, 193, 201, 0, - 0, 0, 202, 0, 50, 51, 0, 203, 0, 52, - 0, 0, 0, 0, 0, 204, 54, 55, 0, 205, - 56, 206, 0, 0, 0, 0, 207, 0, 0, 0, - 0, 0, 0, 194, 39, 0, 40, 41, 42, 282, - 0, 44, 208, 0, 0, 45, 196, 197, 198, 0, - 0, 46, 192, 193, 0, 0, 199, 47, 48, 49, - 0, 200, 0, 0, 201, 0, 0, 0, 202, 0, - 50, 51, 0, 203, 0, 52, 0, 0, 0, 0, - 0, 204, 54, 55, 0, 205, 56, 206, 0, 194, - 39, 0, 40, 41, 42, 195, 0, 44, 0, 0, - 0, 45, 196, 197, 198, 0, 0, 46, 208, 0, - 0, 0, 199, 47, 48, 49, 0, 200, 0, 0, - 201, 0, 0, 0, 202, 0, 50, 51, 0, 203, - 0, 52, 0, 0, 0, 0, 0, 204, 54, 55, - 0, 205, 56, 206, 132, 133, 134, 135, 136, 137, - 138, 139, 0, 0, 0, 0, 0, 0, 0, 0, - 140, 0, 0, 0, 208, 132, 133, 134, 135, 136, - 137, 138, 139, 0, 0, 0, 0, 0, 0, 0, - 0, 140, 586, 587, 588, 589, 590, 591, 592, 593, - 0, 0, 0, 0, 0, 0, 0, 0, 594, 844, - 845, 846, 847, 848, 849, 850, 851, 0, 0, 0, - 0, 0, 0, 0, 0, 852, 844, 845, 846, 847, - 848, 849, 850, 851, 0, 0, 0, 0, 0, 0, - 0, 0, 852, 0, 0, 0, 0, 0, 876, 0, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 0, 152, 153, 154, 0, 0, 0, 0, 0, - 0, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 0, 152, 153, 154, 0, 0, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 0, - 606, 607, 608, 934, 0, 853, 854, 855, 856, 0, - 0, 857, 858, 859, 860, 861, 0, 862, 863, 864, - 0, 0, 853, 854, 855, 856, 0, 0, 857, 858, - 859, 860, 861, 0, 862, 863, 864, 133, 134, 135, - 136, 137, 138, 139, 0, 0, 0, 0, 0, 0, - 0, 0, 140, 845, 846, 847, 848, 849, 850, 851, - 0, 0, 0, 0, 0, 0, 0, 0, 852, 134, - 135, 136, 137, 138, 139, 0, 0, 0, 0, 0, - 0, 0, 0, 140, 134, 135, 136, 137, 138, 139, - 0, 0, 0, 0, 0, 0, 0, 0, 140, 134, - 135, 136, 137, 138, 139, 0, 0, 0, 0, 0, - 0, 0, 0, 140, 846, 847, 848, 849, 850, 851, - 0, 0, 0, 0, 0, 0, 0, 0, 852, 0, - 0, 0, 0, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 0, 152, 153, 154, 0, 0, 854, - 855, 856, 0, 0, 857, 858, 859, 860, 861, 0, - 862, 863, 864, 0, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 0, 152, 153, 154, 0, 0, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 0, - 152, 153, 154, 0, 0, 0, 144, 145, 146, 147, - 148, 149, 150, 151, 0, 152, 153, 154, 0, 854, - 855, 856, 0, 0, 857, 858, 859, 860, 861, 0, - 862, 863, 864, 134, 135, 136, 137, 138, 139, 0, - 0, 0, 0, 0, 0, 0, 0, 140, 846, 847, - 848, 849, 850, 851, 0, 0, 0, 0, 0, 0, - 0, 0, 852, 846, 847, 848, 849, 850, 851, 0, - 0, 0, 0, 70, 0, 0, 0, 852, 846, 847, - 848, 849, 850, 851, 0, 71, 0, 0, 0, 0, - 72, 0, 852, 73, 0, 0, 0, 0, 0, 0, - 0, 74, 0, 75, 0, 0, 76, 77, 78, 0, - 0, 0, 0, 0, 0, 0, 0, 79, 0, 0, - 0, 80, 0, 0, 0, 81, 0, 0, 0, 0, - 0, 145, 146, 147, 148, 149, 150, 151, 0, 152, - 153, 154, 0, 0, 855, 856, 0, 0, 857, 858, - 859, 860, 861, 0, 862, 863, 864, 342, 343, 0, - 856, 0, 0, 857, 858, 859, 860, 861, 0, 862, - 863, 864, 0, 0, 0, 0, 0, 0, 857, 858, - 859, 860, 861, 0, 862, 863, 864, 0, 342, 343, - 0, 0, 0, 0, 0, 39, 0, 40, 41, 344, - 345, 0, 44, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 46, 0, 0, 0, 0, 0, 47, 48, - 49, 0, 0, 0, 0, 0, 39, 0, 40, 41, - 0, 50, 51, 44, 0, 0, 0, 0, 0, 0, - 38, 0, 346, 46, 55, 0, 0, 56, 0, 47, + 7, 8, 9, 10, 28, 11, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 148, 149, 150, 151, + 152, 29, 153, 154, 155, 30, 31, 0, 0, 32, + 0, 33, 0, 264, 0, 34, 0, 0, 0, 0, + 0, 0, 13, 0, 14, 15, 0, 0, 0, 16, + 17, 0, 0, 0, 0, 0, 0, 0, 18, 19, + 0, 39, 0, 40, 41, 20, 21, 0, 158, 0, + 0, 0, 22, 0, 0, 0, 0, 0, 159, 23, + 24, 25, 0, 26, 47, 160, 49, 27, 7, 8, + 9, 10, 28, 11, 12, 0, 859, 860, 50, 51, + 0, 380, 0, 0, 0, 0, 861, 0, 0, 29, + 0, 55, 0, 30, 31, 0, 0, 32, 0, 33, + 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, + 13, 0, 14, 15, 0, 0, 0, 16, 17, 0, + 0, 0, 0, 0, 0, 0, 18, 19, 0, 0, + 0, 0, 0, 20, 21, 0, 0, 0, 0, 0, + 22, 0, 0, 0, 0, 0, 0, 23, 24, 25, + 0, 26, 0, 0, 0, 27, 7, 8, 9, 10, + 28, 11, 12, 0, 0, 0, 0, 0, 0, 473, + 0, 0, 866, 867, 868, 869, 870, 29, 871, 872, + 873, 30, 31, 0, 0, 32, 0, 33, 0, 0, + 0, 34, 0, 0, 0, 0, 0, 0, 13, 0, + 14, 15, 0, 0, 0, 16, 17, 0, 0, 0, + 0, 0, 0, 0, 18, 19, 0, 0, 0, 0, + 0, 20, 21, 0, 0, 0, 0, 0, 22, 0, + 39, 0, 40, 41, 0, 23, 24, 25, 0, 26, + 0, 0, 0, 27, 7, 8, 9, 10, 28, 11, + 12, 0, 0, 47, 162, 49, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 29, 0, 50, 51, 30, + 31, 0, 0, 32, 0, 33, 0, 818, 0, 34, + 55, 0, 0, 0, 0, 0, 13, 0, 14, 15, + 0, 0, 0, 16, 17, 0, 0, 0, 0, 0, + 0, 0, 18, 19, 0, 0, 0, 110, 0, 20, + 21, 0, 0, 0, 0, 0, 22, 0, 39, 0, + 40, 41, 0, 23, 24, 25, 0, 26, 0, 0, + 0, 27, 7, 8, 9, 10, 28, 11, 12, 0, + 0, 47, 162, 49, 0, 833, 0, 0, 0, 0, + 0, 0, 0, 29, 0, 50, 51, 30, 31, 0, + 0, 32, 0, 33, 0, 0, 0, 34, 55, 0, + 0, 0, 0, 0, 13, 0, 14, 15, 0, 0, + 0, 16, 17, 0, 0, 0, 0, 0, 0, 0, + 18, 19, 0, 0, 0, 113, 0, 20, 21, 0, + 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, + 0, 23, 24, 25, 0, 26, 0, 0, 0, 27, + 7, 8, 9, 10, 28, 11, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 29, 0, 0, 0, 30, 31, 0, 0, 32, + 0, 33, 0, 924, 0, 34, 0, 0, 0, 0, + 0, 0, 13, 0, 14, 15, 0, 0, 0, 16, + 17, 0, 0, 0, 0, 0, 0, 0, 18, 19, + 0, 0, 0, 0, 0, 20, 21, 0, 0, 0, + 0, 0, 22, 137, 138, 139, 140, 0, 0, 23, + 24, 25, 0, 26, 0, 141, 0, 27, 0, 0, + 0, 0, 28, 0, 133, 134, 135, 136, 137, 138, + 139, 140, 0, 0, 0, 0, 0, 0, 0, 29, + 141, 0, 0, 30, 31, 0, 0, 32, 0, 33, + 0, 0, 0, 34, 133, 134, 135, 136, 137, 138, + 139, 140, 0, 0, 0, 0, 0, 0, 0, 0, + 141, 0, 0, 133, 134, 135, 136, 137, 138, 139, + 140, 0, 0, 0, 0, 0, 0, 0, 0, 141, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 146, + 147, 148, 149, 150, 151, 152, 0, 153, 154, 155, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 0, 153, 154, 155, 0, 0, 0, 326, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 0, 153, 154, 155, 0, 0, 0, 887, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 0, 153, 154, 155, 345, 346, 0, 946, 481, 482, + 483, 484, 485, 486, 487, 488, 0, 0, 0, 0, + 0, 0, 0, 0, 489, 0, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 0, 0, + 0, 39, 0, 40, 41, 0, 502, 0, 44, 0, + 0, 0, 39, 0, 40, 41, 0, 0, 46, 158, + 0, 0, 0, 0, 47, 48, 49, 0, 0, 159, + 503, 0, 0, 0, 0, 47, 160, 49, 50, 51, + 0, 0, 0, 194, 195, 0, 0, 0, 0, 50, + 51, 55, 0, 0, 56, 0, 0, 0, 0, 0, + 504, 0, 55, 505, 0, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 0, 517, 518, 196, + 39, 519, 40, 41, 42, 197, 0, 44, 0, 102, + 0, 45, 198, 199, 200, 0, 0, 46, 0, 0, + 0, 0, 201, 47, 48, 49, 0, 0, 202, 194, + 195, 203, 0, 0, 0, 204, 0, 50, 51, 0, + 205, 0, 52, 0, 0, 0, 0, 0, 206, 54, + 55, 0, 207, 56, 208, 0, 0, 0, 0, 209, + 0, 0, 0, 0, 0, 196, 39, 0, 40, 41, + 42, 285, 0, 44, 0, 210, 0, 45, 198, 199, + 200, 0, 0, 46, 0, 194, 195, 0, 201, 47, + 48, 49, 0, 0, 202, 0, 0, 203, 0, 0, + 0, 204, 0, 50, 51, 0, 205, 0, 52, 0, + 0, 0, 0, 0, 206, 54, 55, 0, 207, 56, + 208, 196, 39, 0, 40, 41, 42, 197, 0, 44, + 0, 0, 0, 45, 198, 199, 200, 0, 0, 46, + 0, 210, 0, 0, 201, 47, 48, 49, 0, 0, + 202, 0, 0, 203, 0, 0, 0, 204, 0, 50, + 51, 0, 205, 0, 52, 0, 0, 0, 0, 0, + 206, 54, 55, 0, 207, 56, 208, 133, 134, 135, + 136, 137, 138, 139, 140, 0, 0, 0, 0, 0, + 0, 0, 0, 141, 0, 0, 0, 210, 133, 134, + 135, 136, 137, 138, 139, 140, 0, 0, 0, 0, + 0, 0, 0, 0, 141, 133, 134, 135, 136, 137, + 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, + 0, 141, 133, 134, 135, 136, 137, 138, 139, 140, + 0, 0, 0, 0, 0, 0, 0, 0, 141, 592, + 593, 594, 595, 596, 597, 598, 599, 0, 0, 0, + 0, 0, 0, 0, 0, 600, 0, 0, 0, 0, + 478, 0, 0, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 0, 153, 154, 155, 0, 0, + 839, 0, 0, 0, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 0, 153, 154, 155, 885, + 0, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 0, 153, 154, 155, 0, 0, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 0, + 153, 154, 155, 0, 0, 601, 602, 603, 604, 605, + 606, 607, 608, 609, 610, 611, 0, 612, 613, 614, + 853, 854, 855, 856, 857, 858, 859, 860, 0, 0, + 0, 0, 0, 0, 0, 0, 861, 853, 854, 855, + 856, 857, 858, 859, 860, 0, 0, 0, 0, 0, + 0, 0, 0, 861, 135, 136, 137, 138, 139, 140, + 0, 0, 0, 0, 0, 0, 0, 0, 141, 135, + 136, 137, 138, 139, 140, 0, 0, 0, 0, 0, + 0, 0, 0, 141, 855, 856, 857, 858, 859, 860, + 0, 0, 0, 0, 0, 0, 0, 0, 861, 135, + 136, 137, 138, 139, 140, 0, 0, 0, 0, 0, + 0, 0, 0, 141, 944, 0, 862, 863, 864, 865, + 0, 0, 866, 867, 868, 869, 870, 0, 871, 872, + 873, 0, 0, 862, 863, 864, 865, 0, 0, 866, + 867, 868, 869, 870, 0, 871, 872, 873, 0, 0, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 0, + 153, 154, 155, 0, 0, 0, 145, 146, 147, 148, + 149, 150, 151, 152, 0, 153, 154, 155, 0, 863, + 864, 865, 0, 0, 866, 867, 868, 869, 870, 0, + 871, 872, 873, 0, 0, 0, 0, 146, 147, 148, + 149, 150, 151, 152, 0, 153, 154, 155, 855, 856, + 857, 858, 859, 860, 0, 0, 0, 0, 0, 0, + 0, 0, 861, 855, 856, 857, 858, 859, 860, 0, + 0, 0, 345, 346, 0, 0, 0, 861, 855, 856, + 857, 858, 859, 860, 0, 0, 0, 0, 0, 0, + 0, 0, 861, 857, 858, 859, 860, 0, 0, 0, + 0, 0, 0, 0, 0, 861, 0, 0, 0, 39, + 0, 40, 41, 347, 348, 0, 44, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, + 0, 0, 47, 48, 49, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 864, 865, 50, 51, 866, 867, + 868, 869, 870, 0, 871, 872, 873, 349, 0, 55, + 865, 0, 56, 866, 867, 868, 869, 870, 38, 871, + 872, 873, 0, 0, 0, 0, 0, 0, 866, 867, + 868, 869, 870, 0, 871, 872, 873, 0, 0, 0, + 0, 866, 867, 868, 869, 870, 0, 871, 872, 873, + 39, 0, 40, 41, 39, 0, 40, 41, 42, 43, + 0, 44, 0, 0, 0, 45, 0, 268, 0, 0, + 38, 46, 0, 47, 162, 49, 0, 47, 48, 49, + 0, 0, 0, 0, 0, 0, 0, 50, 51, 0, + 0, 50, 51, 0, 0, 0, 52, 0, 0, 0, + 55, 0, 53, 54, 55, 0, 39, 56, 40, 41, + 42, 293, 0, 44, 0, 0, 0, 45, 0, 0, + 0, 0, 103, 46, 0, 0, 0, 0, 0, 47, 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 50, 51, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 346, 0, 55, 0, 39, 56, 40, - 41, 42, 43, 0, 44, 0, 0, 0, 45, 0, - 0, 38, 0, 0, 46, 0, 0, 0, 0, 0, - 47, 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 51, 0, 0, 0, 52, 0, 0, 0, 0, 0, 53, 54, 55, 0, 39, 56, - 40, 41, 42, 290, 0, 44, 0, 0, 0, 45, - 0, 0, 102, 0, 0, 46, 0, 0, 0, 0, + 40, 41, 42, 0, 0, 44, 0, 0, 0, 45, + 0, 0, 0, 0, 38, 46, 0, 0, 0, 0, 0, 47, 48, 49, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 50, 51, 0, 0, 0, 52, - 0, 0, 0, 0, 0, 53, 54, 55, 0, 39, - 56, 40, 41, 42, 0, 0, 44, 0, 0, 0, - 45, 0, 0, 38, 0, 0, 46, 0, 0, 0, - 0, 0, 47, 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 51, 0, 0, 0, - 52, 0, 0, 0, 0, 0, 103, 54, 55, 0, + 52, 0, 0, 0, 0, 0, 104, 54, 55, 0, 39, 56, 40, 41, 42, 0, 0, 44, 0, 0, - 70, 45, 0, 0, 0, 0, 0, 46, 0, 0, - 0, 0, 71, 47, 48, 49, 0, 72, 0, 0, - 73, 0, 0, 0, 0, 0, 50, 51, 74, 0, - 75, 52, 0, 76, 77, 78, 0, 53, 54, 55, - 0, 70, 56, 0, 79, 0, 0, 0, 80, 0, - 0, 0, 81, 71, 0, 0, 0, 0, 72, 0, - 0, 73, 82, 0, 0, 0, 70, 0, 0, 74, - 0, 75, 0, 0, 76, 77, 78, 0, 71, 0, - 0, 340, 0, 72, 0, 79, 73, 0, 0, 80, - 0, 0, 0, 81, 74, 0, 75, 0, 0, 76, - 77, 78, 0, 82, 70, 0, 0, 0, 0, 0, - 79, 0, 0, 0, 80, 0, 71, 0, 81, 0, - 0, 72, 398, 0, 73, 0, 0, 0, 82, 70, - 0, 0, 74, 0, 75, 0, 0, 76, 77, 78, - 0, 71, 0, 0, 0, 0, 72, 462, 79, 73, - 0, 0, 80, 0, 0, 0, 81, 74, 0, 75, - 0, 0, 76, 77, 78, 0, 82, 0, 0, 0, - 0, 0, 0, 79, 0, 0, 0, 80, 0, 0, - 0, 81, 0, 0, 0, 549, 0, 0, 0, 0, - 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 753 + 0, 45, 0, 0, 0, 0, 0, 46, 0, 0, + 0, 0, 0, 47, 48, 49, 0, 70, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, 51, 71, + 0, 0, 52, 0, 72, 0, 0, 73, 53, 54, + 55, 0, 0, 56, 0, 74, 75, 70, 76, 0, + 0, 77, 78, 79, 0, 0, 0, 0, 0, 71, + 0, 0, 80, 0, 72, 0, 81, 73, 0, 0, + 82, 0, 0, 70, 0, 74, 75, 0, 76, 0, + 83, 77, 78, 79, 0, 71, 0, 0, 0, 0, + 72, 0, 80, 73, 0, 0, 81, 0, 0, 343, + 82, 74, 75, 70, 76, 0, 0, 77, 78, 79, + 83, 0, 0, 0, 0, 71, 0, 0, 80, 0, + 72, 0, 81, 73, 0, 0, 82, 0, 0, 400, + 0, 74, 75, 70, 76, 0, 83, 77, 78, 79, + 0, 0, 0, 0, 0, 71, 0, 0, 80, 0, + 72, 0, 81, 73, 0, 465, 82, 0, 0, 70, + 0, 74, 75, 0, 76, 0, 83, 77, 78, 79, + 0, 71, 0, 0, 0, 0, 72, 0, 80, 73, + 0, 0, 81, 0, 0, 554, 82, 74, 75, 0, + 76, 0, 0, 77, 78, 79, 83, 0, 0, 0, + 0, 0, 0, 0, 80, 0, 0, 0, 81, 0, + 0, 0, 82, 0, 0, 758 }; +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-508))) + +#define yytable_value_is_error(Yytable_value) \ + YYID (0) + static const yytype_int16 yycheck[] = { - 1, 22, 86, 80, 5, 43, 33, 94, 95, 96, - 97, 86, 99, 100, 101, 86, 86, 182, 470, 22, - 10, 108, 109, 461, 22, 112, 359, 10, 8, 9, - 0, 424, 122, 8, 9, 10, 122, 8, 9, 10, - 122, 8, 9, 10, 33, 361, 8, 9, 105, 365, - 366, 367, 113, 283, 400, 401, 57, 8, 9, 392, - 108, 454, 105, 197, 122, 86, 12, 124, 51, 8, - 9, 2, 101, 102, 103, 123, 51, 156, 122, 80, - 51, 124, 104, 86, 51, 107, 524, 409, 86, 105, - 169, 170, 171, 172, 416, 417, 418, 419, 29, 30, - 31, 32, 122, 34, 188, 76, 428, 122, 124, 98, - 275, 4, 74, 188, 122, 8, 9, 188, 188, 113, - 108, 110, 111, 445, 6, 563, 153, 117, 293, 112, - 463, 8, 9, 355, 117, 123, 358, 112, 360, 122, - 456, 112, 117, 230, 124, 112, 117, 122, 29, 122, - 117, 122, 107, 104, 29, 156, 386, 195, 380, 105, - 382, 383, 384, 201, 105, 104, 122, 188, 169, 170, - 171, 172, 8, 9, 567, 29, 341, 570, 122, 180, - 122, 182, 122, 124, 48, 188, 50, 51, 267, 535, - 188, 55, 585, 539, 424, 541, 612, 543, 544, 545, - 422, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 356, 154, 454, 359, 105, 104, 450, 123, - 124, 105, 0, 122, 105, 557, 117, 118, 119, 404, - 121, 122, 123, 123, 282, 124, 121, 122, 123, 571, - 124, 107, 290, 124, 476, 77, 78, 79, 392, 107, - 124, 125, 126, 127, 122, 123, 267, 121, 122, 123, - 105, 272, 273, 107, 275, 276, 44, 124, 279, 117, - 281, 104, 105, 281, 617, 77, 78, 79, 56, 124, - 291, 104, 293, 61, 105, 159, 64, 161, 104, 104, - 106, 107, 108, 105, 72, 97, 74, 238, 239, 77, - 78, 79, 105, 124, 8, 9, 122, 123, 356, 113, - 88, 359, 124, 105, 92, 122, 123, 743, 96, 463, - 6, 124, 333, 334, 411, 107, 122, 567, 106, 122, - 341, 272, 124, 106, 29, 122, 123, 345, 124, 350, - 122, 123, 124, 105, 392, 356, 50, 124, 359, 124, - 361, 388, 107, 390, 365, 366, 367, 298, 124, 370, - 123, 124, 373, 825, 124, 114, 377, 122, 123, 124, - 124, 124, 469, 776, 124, 386, 124, 8, 9, 124, - 321, 392, 430, 87, 124, 114, 399, 400, 401, 93, - 94, 29, 124, 404, 820, 738, 407, 107, 409, 105, - 411, 122, 433, 440, 412, 416, 417, 418, 419, 420, - 122, 124, 127, 424, 107, 463, 125, 428, 29, 50, - 433, 122, 117, 118, 119, 433, 121, 122, 123, 122, - 123, 124, 122, 105, 445, 104, 377, 106, 107, 108, - 584, 440, 108, 454, 104, 456, 105, 114, 105, 117, - 461, 125, 463, 117, 117, 396, 87, 883, 552, 470, - 122, 887, 93, 94, 125, 53, 97, 552, 105, 108, - 88, 552, 552, 617, 817, 63, 64, 115, 116, 117, - 118, 119, 117, 121, 122, 123, 113, 75, 122, 113, - 833, 124, 124, 81, 123, 125, 437, 438, 439, 925, - 441, 105, 124, 929, 115, 116, 117, 118, 119, 105, - 121, 122, 123, 524, 127, 103, 942, 105, 106, 124, - 461, 552, 535, 108, 123, 951, 539, 105, 541, 470, - 543, 544, 545, 122, 124, 546, 584, 880, 51, 552, - 551, 773, 4, 122, 552, 105, 557, 127, 124, 122, - 125, 550, 563, 8, 9, 124, 567, 125, 113, 570, - 571, 127, 124, 122, 113, 105, 127, 114, 124, 617, - 607, 582, 114, 572, 585, 574, 575, 89, 122, 124, - 923, 522, 106, 524, 816, 3, 4, 5, 6, 124, - 8, 124, 122, 181, 738, 50, 124, 122, 124, 122, - 114, 612, 190, 125, 124, 124, 617, 114, 124, 124, - 180, 122, 122, 468, 411, 124, 204, 740, 816, 773, - 208, 866, 563, 188, 412, 345, 411, 215, 216, 551, - 188, 584, 87, 433, 866, 405, 54, 333, 93, 94, - 467, 702, 97, -1, 62, 586, 587, 588, 589, 590, - 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, - 601, 602, 603, 604, 605, 606, 84, 608, 86, -1, - -1, -1, 90, 817, 3, 4, 5, 6, -1, 8, - 9, 778, -1, -1, -1, 273, 562, -1, -1, 833, - 738, 702, -1, -1, 112, 8, 9, -1, 116, 117, - -1, -1, 120, -1, 122, -1, -1, -1, 126, 297, - -1, -1, -1, -1, -1, -1, -1, 46, -1, 48, - 49, 19, 20, -1, 53, 54, -1, 738, -1, 766, - -1, 29, 743, 62, 63, -1, 880, 50, -1, -1, - 69, 70, -1, -1, -1, 333, 75, 17, 18, 19, - 20, 339, -1, 82, 83, 84, 344, 86, 346, 29, - -1, 90, 19, 20, -1, 776, 95, 766, -1, 817, - -1, -1, 29, -1, 87, -1, -1, -1, -1, 923, - 93, 94, -1, 112, 97, 833, -1, 116, 117, -1, - 731, 120, -1, 122, -1, 124, -1, 126, -1, -1, - -1, -1, -1, 744, -1, -1, 817, 395, -1, 820, - -1, 399, 400, 401, 825, -1, -1, 115, 116, 117, - 118, 119, 833, 121, 122, 123, 863, -1, -1, -1, - -1, -1, 880, 774, -1, 834, 835, 836, -1, -1, - 781, -1, -1, 113, 114, 115, 116, 117, 118, 119, - -1, 121, 122, 123, -1, -1, -1, -1, 115, 116, - 117, 118, 119, -1, 121, 122, 123, -1, -1, 880, - -1, -1, 883, -1, -1, 923, 887, -1, -1, -1, - 468, 918, -1, 920, 825, -1, 762, 763, 764, 765, - -1, 767, -1, -1, 13, 14, 15, 16, 17, 18, - 19, 20, -1, -1, -1, -1, -1, -1, 945, 946, - 29, -1, 923, -1, 925, -1, -1, -1, 929, -1, - -1, -1, -1, 864, -1, -1, -1, -1, -1, -1, - -1, 942, -1, 521, -1, 876, 762, 763, 764, 765, - 951, 767, 17, 18, 19, 20, 534, 535, 536, -1, - -1, 539, -1, 541, 29, 543, 544, 545, -1, -1, - 548, -1, -1, -1, -1, -1, -1, -1, 844, 845, - 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, - 856, 857, 858, 859, 860, 861, 862, -1, -1, -1, + 1, 105, 473, 87, 5, 33, 362, 81, 0, 87, + 286, 22, 87, 33, 43, 184, 95, 96, 97, 98, + 124, 100, 101, 102, 22, 464, 87, 427, 8, 9, + 109, 110, 10, 10, 113, 105, 412, 157, 12, 395, + 8, 9, 122, 419, 420, 421, 422, 8, 9, 122, + 170, 171, 172, 173, 124, 431, 57, 457, 402, 403, + 8, 9, 77, 78, 79, 358, 8, 9, 361, 199, + 363, 99, 448, 50, 104, 2, 87, 107, 105, 105, + 81, 4, 97, 111, 112, 8, 9, 122, 527, 87, + 383, 122, 385, 386, 387, 364, 113, 124, 124, 368, + 369, 370, 29, 30, 31, 32, 190, 34, 277, 108, + 466, 618, 190, 389, 105, 190, 122, 105, 105, 105, + 108, 8, 9, 105, 123, 122, 74, 296, 22, 190, + 569, 105, 425, 124, 154, 112, 104, 124, 124, 117, + 117, 29, 124, 104, 124, 122, 8, 9, 10, 269, + 122, 427, 108, 232, 123, 124, 157, 8, 9, 10, + 453, 113, 104, 122, 123, 29, 105, 123, 197, 170, + 171, 172, 173, 573, 203, 344, 576, 105, 122, 190, + 181, 457, 122, 184, 122, 124, 479, 563, 50, 122, + 459, 591, 190, 87, 538, 6, 124, 122, 542, 50, + 544, 577, 546, 547, 548, 107, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 105, 155, 359, + 8, 9, 362, 121, 122, 123, 104, 406, 106, 107, + 108, 748, 8, 9, 10, 48, 124, 50, 51, 122, + 112, 105, 55, 8, 9, 117, 285, 121, 122, 123, + 122, 112, 122, 105, 293, 395, 117, 623, 269, 107, + 124, 49, 107, 274, 275, 107, 277, 278, 101, 102, + 103, 282, 124, 284, 50, 107, 284, 104, 29, 106, + 107, 108, 122, 294, 49, 296, 190, 573, 104, 105, + 122, 123, 124, 122, 123, 122, 123, 122, 123, 87, + 76, 107, 124, 240, 241, 93, 94, 117, 123, 97, + 104, 828, 125, 126, 127, 128, 122, 123, 124, 8, + 359, 104, 87, 362, 335, 336, 466, 113, 93, 94, + 414, 122, 97, 344, 123, 124, 112, 274, 122, 6, + 348, 117, 353, 106, 8, 9, 122, 160, 359, 162, + 124, 362, 833, 364, 124, 105, 395, 368, 369, 370, + 124, 391, 373, 393, 301, 376, 117, 118, 119, 380, + 121, 122, 123, 107, 784, 892, 124, 743, 389, 896, + 77, 78, 79, 472, 395, 49, 124, 324, 122, 123, + 124, 114, 124, 124, 433, 406, 124, 124, 124, 410, + 124, 412, 114, 414, 124, 443, 107, 415, 419, 420, + 421, 422, 423, 443, 0, 436, 427, 105, 935, 105, + 431, 124, 939, 87, 122, 127, 122, 466, 436, 93, + 94, 122, 122, 97, 104, 952, 105, 448, 125, 8, + 114, 29, 105, 380, 961, 117, 457, 125, 459, 117, + 590, 122, 117, 464, 105, 466, 108, 43, 108, 825, + 88, 117, 473, 125, 558, 113, 113, 29, 122, 55, + 558, 53, 125, 558, 60, 124, 842, 63, 781, 124, + 123, 63, 64, 623, 105, 71, 72, 558, 74, 124, + 127, 77, 78, 79, 76, 105, 8, 401, 402, 403, + 82, 124, 88, 440, 441, 442, 92, 444, 8, 9, + 96, 106, 123, 105, 122, 124, 527, 555, 50, 557, + 106, 824, 104, 889, 106, 107, 4, 464, 122, 117, + 118, 119, 436, 121, 122, 123, 473, 558, 549, 105, + 578, 125, 580, 581, 127, 556, 124, 124, 127, 49, + 558, 590, 563, 115, 116, 117, 118, 119, 569, 121, + 122, 123, 573, 122, 125, 576, 577, 933, 124, 124, + 113, 122, 875, 568, 113, 127, 105, 588, 114, 124, + 591, 114, 89, 613, 623, 122, 124, 87, 525, 124, + 527, 106, 106, 93, 94, 122, 124, 114, 535, 124, + 122, 183, 122, 743, 125, 124, 124, 618, 124, 114, + 192, 124, 623, 15, 16, 17, 18, 19, 20, 122, + 122, 471, 414, 124, 206, 124, 745, 29, 210, 824, + 781, 181, 569, 875, 538, 217, 218, 190, 542, 414, + 544, 348, 546, 547, 548, 556, 415, 407, 590, 190, + 335, 436, 470, 707, 558, 592, 593, 594, 595, 596, + 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, + 607, 608, 609, 610, 611, 612, -1, 614, -1, -1, + -1, 3, 4, 5, 6, 825, 8, -1, -1, -1, + -1, -1, -1, -1, -1, 29, 707, 786, -1, -1, + -1, -1, 842, 45, 743, 47, 48, -1, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 300, 121, + 122, 123, -1, -1, -1, -1, 68, 69, 70, -1, + -1, 53, 743, -1, -1, -1, 774, 748, -1, 61, + 82, 83, -1, -1, 774, -1, -1, -1, -1, 889, + 332, -1, -1, 95, -1, -1, -1, -1, -1, -1, + 342, -1, 84, -1, 86, 347, -1, 349, 90, -1, + -1, -1, -1, 784, -1, 770, 771, 772, 773, -1, + 775, 115, 116, 117, 118, 119, 825, 121, 122, 123, + 112, -1, -1, 933, 116, 117, -1, -1, 120, 736, + 122, -1, -1, 842, 126, 843, 844, 845, -1, -1, + -1, -1, -1, -1, 825, -1, -1, 828, -1, 401, + 402, 403, 833, -1, -1, -1, -1, -1, -1, -1, + -1, 842, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 872, -1, -1, 782, -1, -1, -1, -1, + 889, -1, 789, -1, -1, -1, -1, -1, 853, 854, + 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, + 865, 866, 867, 868, 869, 870, 871, -1, 889, -1, + -1, 892, -1, -1, -1, 896, -1, -1, -1, 471, + 770, 771, 772, 773, 933, 775, 833, -1, 928, -1, + 930, -1, -1, -1, -1, -1, -1, -1, 903, -1, + -1, 13, 14, 15, 16, 17, 18, 19, 20, -1, + -1, -1, 933, -1, 935, 955, 956, 29, 939, -1, + -1, -1, -1, -1, -1, -1, 873, -1, -1, -1, + -1, 952, 524, -1, -1, -1, -1, -1, 885, 944, + 961, -1, -1, -1, -1, 537, 538, 539, -1, -1, + 542, -1, 544, -1, 546, 547, 548, -1, -1, -1, + -1, 553, -1, 853, 854, 855, 856, 857, 858, 859, + 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, + 870, 871, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 107, -1, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, + 122, 123, -1, 903, 3, 4, 5, 6, 7, 8, + 9, 10, -1, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, -1, -1, -1, -1, -1, -1, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 944, -1, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, -1, 56, -1, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, -1, -1, -1, 73, -1, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, + 89, 90, 91, 92, 93, 94, 95, -1, 97, 98, + 99, 100, -1, -1, -1, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, -1, 121, 122, 123, -1, -1, -1, 127, -1, - -1, -1, -1, -1, -1, -1, -1, 893, 844, 845, - 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, - 856, 857, 858, 859, 860, 861, 862, -1, -1, -1, - 115, 116, 117, 118, 119, -1, 121, 122, 123, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 934, -1, - -1, -1, -1, -1, -1, -1, -1, 893, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 3, 4, 5, 6, 7, 8, 9, - 10, -1, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, -1, -1, -1, -1, -1, 934, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, -1, -1, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, -1, 57, -1, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, - 90, 91, 92, 93, 94, 95, -1, 97, 98, 99, - 100, -1, -1, -1, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 3, 4, - 5, 6, 7, 8, 9, 10, -1, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, - -1, -1, -1, -1, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, -1, - -1, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, -1, 57, -1, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, -1, -1, 73, -1, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, - 95, -1, 97, 98, 99, 100, -1, -1, -1, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - -1, 126, 127, 921, 3, 4, 5, 6, -1, 8, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 3, + 4, 5, 6, 7, 8, 9, 10, -1, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, + -1, -1, -1, -1, -1, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, -1, + -1, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, -1, 56, -1, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, -1, -1, -1, 73, + -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, + 94, 95, -1, 97, 98, 99, 100, -1, -1, -1, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, -1, 126, 127, 3, 4, 5, 6, -1, 8, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 13, 14, 15, 16, 17, 18, 19, 20, - -1, -1, -1, 46, -1, 48, 49, 46, 29, 48, - 49, 50, 51, -1, 53, 54, -1, -1, 57, -1, - -1, -1, -1, 62, 63, -1, 69, 70, 71, -1, - 69, 70, 71, -1, -1, -1, 75, -1, -1, 82, - 83, -1, -1, 82, 83, 84, -1, 86, 87, -1, - -1, 90, 95, -1, 93, 94, 95, -1, -1, 98, + -1, -1, 14, 15, 16, 17, 18, 19, 20, -1, + -1, -1, -1, -1, -1, -1, 45, 29, 47, 48, + 49, 50, -1, 52, 53, -1, -1, 56, -1, -1, + -1, -1, 61, 62, -1, -1, -1, -1, -1, 68, + 69, 70, -1, -1, -1, -1, 75, -1, -1, 931, + -1, -1, -1, 82, 83, 84, -1, 86, 87, -1, + -1, 90, -1, -1, 93, 94, 95, -1, -1, 98, 3, 4, 5, 6, -1, 8, 9, -1, -1, 12, - -1, -1, -1, 112, -1, -1, -1, 116, 117, 122, - -1, 120, -1, 122, -1, -1, 107, 126, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, - 121, 122, 123, 46, -1, 48, 49, 50, 51, -1, - 53, 54, -1, -1, 57, -1, -1, -1, -1, 62, - 63, -1, -1, -1, -1, -1, 69, 70, 71, -1, + -1, -1, -1, 112, -1, -1, -1, 116, 117, -1, + -1, 120, -1, 122, -1, -1, -1, 126, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, + 122, 123, 45, -1, 47, 48, 49, 50, -1, 52, + 53, -1, -1, 56, -1, -1, -1, -1, 61, 62, + -1, -1, -1, -1, -1, 68, 69, 70, -1, -1, -1, -1, 75, -1, -1, -1, -1, -1, -1, 82, 83, 84, -1, 86, 87, -1, -1, 90, -1, -1, 93, 94, 95, -1, -1, 98, 3, 4, 5, 6, -1, 8, 9, -1, -1, 12, -1, -1, -1, 112, -1, -1, -1, 116, -1, -1, -1, 120, -1, 122, - -1, -1, -1, 126, 13, 14, 15, 16, 17, 18, - 19, 20, -1, -1, -1, 46, -1, 48, 49, 46, - 29, 48, 49, 50, 51, -1, 53, 54, -1, -1, - 57, -1, -1, -1, -1, 62, 63, -1, 69, 70, - 71, -1, 69, 70, 71, -1, -1, -1, 75, -1, + -1, -1, -1, 126, 14, 15, 16, 17, 18, 19, + 20, -1, -1, -1, 45, -1, 47, 48, 45, 29, + 47, 48, 49, 50, -1, 52, 53, -1, -1, 56, + -1, -1, -1, -1, 61, 62, -1, 68, 69, 70, + -1, 68, 69, 70, -1, -1, -1, -1, 75, -1, -1, 82, 83, -1, -1, 82, 83, 84, -1, 86, 87, -1, -1, 90, 95, -1, 93, 94, 95, -1, -1, 98, 3, 4, 5, 6, -1, 8, 9, -1, - -1, -1, -1, -1, -1, 112, -1, -1, -1, 116, - -1, 122, -1, 120, -1, 122, -1, 106, -1, 126, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, -1, 121, 122, 123, 46, -1, 48, 49, -1, - -1, -1, 53, 54, -1, -1, -1, -1, -1, -1, - -1, 62, 63, 46, -1, 48, 49, -1, 69, 70, - 53, -1, -1, -1, 75, -1, -1, -1, -1, -1, - 63, 82, 83, 84, -1, 86, 69, 70, 71, 90, - 3, 4, 5, 6, 95, 8, 9, -1, -1, 82, - 83, -1, -1, 104, -1, -1, 46, -1, 48, 49, - -1, 112, 95, 53, -1, 116, 117, -1, -1, 120, - -1, 122, -1, 63, -1, 126, -1, -1, -1, 69, - 70, 71, -1, 46, -1, 48, 49, -1, -1, 122, - 53, 54, 82, 83, -1, -1, -1, -1, -1, 62, - 63, 46, -1, 48, 49, 95, 69, 70, -1, -1, - -1, -1, 75, -1, -1, -1, -1, -1, -1, 82, - 83, 84, -1, 86, 69, 70, 71, 90, 3, 4, - 5, 6, 95, 8, 9, -1, -1, 82, 83, -1, - -1, 104, -1, -1, 46, -1, 48, 49, -1, 112, - 95, -1, -1, 116, 117, -1, -1, 120, -1, 122, - -1, 63, -1, 126, -1, -1, -1, 69, 70, 71, - -1, 46, -1, 48, 49, -1, -1, 122, 53, 54, - 82, 83, -1, -1, -1, -1, -1, 62, 63, 46, - -1, 48, 49, 95, 69, 70, -1, -1, -1, -1, - 75, -1, -1, -1, -1, -1, -1, 82, 83, 84, - -1, 86, 69, 70, 71, 90, 3, 4, 5, 6, - 95, 8, 9, -1, -1, 82, 83, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 112, 95, -1, - -1, 116, 117, -1, -1, 120, -1, 122, -1, 124, - -1, 126, -1, -1, -1, -1, -1, -1, -1, 46, - -1, 48, 49, -1, -1, -1, 53, 54, -1, -1, - -1, -1, -1, -1, -1, 62, 63, -1, -1, -1, - -1, -1, 69, 70, -1, -1, -1, -1, 75, -1, - -1, -1, -1, -1, -1, 82, 83, 84, -1, 86, - -1, -1, -1, 90, 3, 4, 5, 6, 95, 8, - 9, -1, -1, -1, -1, -1, -1, 104, -1, -1, - -1, -1, -1, -1, -1, 112, -1, -1, -1, 116, - 117, -1, -1, 120, -1, 122, -1, -1, -1, 126, - -1, -1, -1, -1, -1, -1, -1, 46, -1, 48, - 49, -1, -1, -1, 53, 54, -1, -1, -1, -1, - -1, -1, -1, 62, 63, -1, -1, -1, -1, -1, - 69, 70, -1, -1, -1, -1, 75, -1, -1, -1, - -1, -1, -1, 82, 83, 84, -1, 86, -1, -1, - -1, 90, 3, 4, 5, 6, 95, 8, 9, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 112, -1, -1, -1, 116, 117, -1, - -1, 120, -1, 122, -1, 124, -1, 126, -1, -1, - -1, -1, -1, -1, -1, 46, -1, 48, 49, -1, - -1, -1, 53, 54, -1, -1, -1, -1, -1, -1, - -1, 62, 63, -1, -1, -1, -1, -1, 69, 70, + 19, 20, -1, -1, -1, 112, -1, -1, -1, 116, + 29, 122, -1, 120, -1, 122, -1, -1, -1, 126, + 110, 111, 112, -1, -1, 115, 116, 117, 118, 119, + -1, 121, 122, 123, 45, -1, 47, 48, -1, -1, + -1, 52, 53, -1, -1, -1, -1, -1, -1, -1, + 61, 62, -1, -1, -1, -1, -1, 68, 69, -1, -1, -1, -1, -1, 75, -1, -1, -1, -1, -1, -1, 82, 83, 84, -1, 86, -1, -1, -1, 90, - -1, -1, -1, -1, 95, -1, 13, 14, 15, 16, - 17, 18, 19, 20, -1, -1, -1, -1, -1, -1, - -1, 112, 29, -1, -1, 116, 117, -1, -1, 120, - -1, 122, -1, -1, -1, 126, 13, 14, 15, 16, - 17, 18, 19, 20, -1, -1, -1, -1, -1, -1, - -1, -1, 29, -1, -1, -1, 13, 14, 15, 16, - 17, 18, 19, 20, -1, -1, -1, -1, -1, -1, - -1, -1, 29, -1, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, - -1, -1, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, -1, 121, 122, 123, -1, 75, -1, - 127, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 8, 9, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, -1, 121, 122, 123, -1, 105, -1, - 127, 108, -1, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, -1, 122, 123, 45, 46, 126, - 48, 49, 50, 51, -1, 53, -1, -1, -1, 57, - 58, 59, 60, -1, -1, 63, -1, -1, -1, -1, - 68, 69, 70, 71, -1, 73, 8, 9, 76, -1, - -1, -1, 80, -1, 82, 83, -1, 85, -1, 87, - -1, -1, -1, -1, -1, 93, 94, 95, -1, 97, - 98, 99, -1, -1, -1, -1, 104, -1, -1, -1, - -1, -1, -1, 45, 46, -1, 48, 49, 50, 51, - -1, 53, 120, -1, -1, 57, 58, 59, 60, -1, - -1, 63, 8, 9, -1, -1, 68, 69, 70, 71, - -1, 73, -1, -1, 76, -1, -1, -1, 80, -1, - 82, 83, -1, 85, -1, 87, -1, -1, -1, -1, - -1, 93, 94, 95, -1, 97, 98, 99, -1, 45, - 46, -1, 48, 49, 50, 51, -1, 53, -1, -1, - -1, 57, 58, 59, 60, -1, -1, 63, 120, -1, - -1, -1, 68, 69, 70, 71, -1, 73, -1, -1, - 76, -1, -1, -1, 80, -1, 82, 83, -1, 85, - -1, 87, -1, -1, -1, -1, -1, 93, 94, 95, - -1, 97, 98, 99, 13, 14, 15, 16, 17, 18, + 3, 4, 5, 6, 95, 8, 9, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 115, 116, 117, 118, + 119, 112, 121, 122, 123, 116, 117, -1, -1, 120, + -1, 122, -1, 124, -1, 126, -1, -1, -1, -1, + -1, -1, 45, -1, 47, 48, -1, -1, -1, 52, + 53, -1, -1, -1, -1, -1, -1, -1, 61, 62, + -1, 45, -1, 47, 48, 68, 69, -1, 52, -1, + -1, -1, 75, -1, -1, -1, -1, -1, 62, 82, + 83, 84, -1, 86, 68, 69, 70, 90, 3, 4, + 5, 6, 95, 8, 9, -1, 19, 20, 82, 83, + -1, 104, -1, -1, -1, -1, 29, -1, -1, 112, + -1, 95, -1, 116, 117, -1, -1, 120, -1, 122, + -1, -1, -1, 126, -1, -1, -1, -1, -1, -1, + 45, -1, 47, 48, -1, -1, -1, 52, 53, -1, + -1, -1, -1, -1, -1, -1, 61, 62, -1, -1, + -1, -1, -1, 68, 69, -1, -1, -1, -1, -1, + 75, -1, -1, -1, -1, -1, -1, 82, 83, 84, + -1, 86, -1, -1, -1, 90, 3, 4, 5, 6, + 95, 8, 9, -1, -1, -1, -1, -1, -1, 104, + -1, -1, 115, 116, 117, 118, 119, 112, 121, 122, + 123, 116, 117, -1, -1, 120, -1, 122, -1, -1, + -1, 126, -1, -1, -1, -1, -1, -1, 45, -1, + 47, 48, -1, -1, -1, 52, 53, -1, -1, -1, + -1, -1, -1, -1, 61, 62, -1, -1, -1, -1, + -1, 68, 69, -1, -1, -1, -1, -1, 75, -1, + 45, -1, 47, 48, -1, 82, 83, 84, -1, 86, + -1, -1, -1, 90, 3, 4, 5, 6, 95, 8, + 9, -1, -1, 68, 69, 70, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 112, -1, 82, 83, 116, + 117, -1, -1, 120, -1, 122, -1, 124, -1, 126, + 95, -1, -1, -1, -1, -1, 45, -1, 47, 48, + -1, -1, -1, 52, 53, -1, -1, -1, -1, -1, + -1, -1, 61, 62, -1, -1, -1, 122, -1, 68, + 69, -1, -1, -1, -1, -1, 75, -1, 45, -1, + 47, 48, -1, 82, 83, 84, -1, 86, -1, -1, + -1, 90, 3, 4, 5, 6, 95, 8, 9, -1, + -1, 68, 69, 70, -1, 104, -1, -1, -1, -1, + -1, -1, -1, 112, -1, 82, 83, 116, 117, -1, + -1, 120, -1, 122, -1, -1, -1, 126, 95, -1, + -1, -1, -1, -1, 45, -1, 47, 48, -1, -1, + -1, 52, 53, -1, -1, -1, -1, -1, -1, -1, + 61, 62, -1, -1, -1, 122, -1, 68, 69, -1, + -1, -1, -1, -1, 75, -1, -1, -1, -1, -1, + -1, 82, 83, 84, -1, 86, -1, -1, -1, 90, + 3, 4, 5, 6, 95, 8, 9, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 112, -1, -1, -1, 116, 117, -1, -1, 120, + -1, 122, -1, 124, -1, 126, -1, -1, -1, -1, + -1, -1, 45, -1, 47, 48, -1, -1, -1, 52, + 53, -1, -1, -1, -1, -1, -1, -1, 61, 62, + -1, -1, -1, -1, -1, 68, 69, -1, -1, -1, + -1, -1, 75, 17, 18, 19, 20, -1, -1, 82, + 83, 84, -1, 86, -1, 29, -1, 90, -1, -1, + -1, -1, 95, -1, 13, 14, 15, 16, 17, 18, + 19, 20, -1, -1, -1, -1, -1, -1, -1, 112, + 29, -1, -1, 116, 117, -1, -1, 120, -1, 122, + -1, -1, -1, 126, 13, 14, 15, 16, 17, 18, 19, 20, -1, -1, -1, -1, -1, -1, -1, -1, - 29, -1, -1, -1, 120, 13, 14, 15, 16, 17, + 29, -1, -1, 13, 14, 15, 16, 17, 18, 19, + 20, -1, -1, -1, -1, -1, -1, -1, -1, 29, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 113, + 114, 115, 116, 117, 118, 119, -1, 121, 122, 123, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, -1, 121, 122, 123, -1, -1, -1, 127, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, -1, 121, 122, 123, -1, -1, -1, 127, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + -1, 121, 122, 123, 8, 9, -1, 127, 13, 14, + 15, 16, 17, 18, 19, 20, -1, -1, -1, -1, + -1, -1, -1, -1, 29, -1, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, -1, -1, + -1, 45, -1, 47, 48, -1, 51, -1, 52, -1, + -1, -1, 45, -1, 47, 48, -1, -1, 62, 52, + -1, -1, -1, -1, 68, 69, 70, -1, -1, 62, + 75, -1, -1, -1, -1, 68, 69, 70, 82, 83, + -1, -1, -1, 8, 9, -1, -1, -1, -1, 82, + 83, 95, -1, -1, 98, -1, -1, -1, -1, -1, + 105, -1, 95, 108, -1, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, -1, 122, 123, 44, + 45, 126, 47, 48, 49, 50, -1, 52, -1, 122, + -1, 56, 57, 58, 59, -1, -1, 62, -1, -1, + -1, -1, 67, 68, 69, 70, -1, -1, 73, 8, + 9, 76, -1, -1, -1, 80, -1, 82, 83, -1, + 85, -1, 87, -1, -1, -1, -1, -1, 93, 94, + 95, -1, 97, 98, 99, -1, -1, -1, -1, 104, + -1, -1, -1, -1, -1, 44, 45, -1, 47, 48, + 49, 50, -1, 52, -1, 120, -1, 56, 57, 58, + 59, -1, -1, 62, -1, 8, 9, -1, 67, 68, + 69, 70, -1, -1, 73, -1, -1, 76, -1, -1, + -1, 80, -1, 82, 83, -1, 85, -1, 87, -1, + -1, -1, -1, -1, 93, 94, 95, -1, 97, 98, + 99, 44, 45, -1, 47, 48, 49, 50, -1, 52, + -1, -1, -1, 56, 57, 58, 59, -1, -1, 62, + -1, 120, -1, -1, 67, 68, 69, 70, -1, -1, + 73, -1, -1, 76, -1, -1, -1, 80, -1, 82, + 83, -1, 85, -1, 87, -1, -1, -1, -1, -1, + 93, 94, 95, -1, 97, 98, 99, 13, 14, 15, + 16, 17, 18, 19, 20, -1, -1, -1, -1, -1, + -1, -1, -1, 29, -1, -1, -1, 120, 13, 14, + 15, 16, 17, 18, 19, 20, -1, -1, -1, -1, + -1, -1, -1, -1, 29, 13, 14, 15, 16, 17, 18, 19, 20, -1, -1, -1, -1, -1, -1, -1, -1, 29, 13, 14, 15, 16, 17, 18, 19, 20, -1, -1, -1, -1, -1, -1, -1, -1, 29, 13, 14, 15, 16, 17, 18, 19, 20, -1, -1, -1, - -1, -1, -1, -1, -1, 29, 13, 14, 15, 16, - 17, 18, 19, 20, -1, -1, -1, -1, -1, -1, - -1, -1, 29, -1, -1, -1, -1, -1, 107, -1, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, -1, 121, 122, 123, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 29, -1, -1, -1, -1, + 106, -1, -1, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, -1, 121, 122, 123, -1, -1, + 105, -1, -1, -1, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, -1, 121, 122, 123, 107, -1, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, 122, 123, -1, -1, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, - 121, 122, 123, 107, -1, 109, 110, 111, 112, -1, - -1, 115, 116, 117, 118, 119, -1, 121, 122, 123, - -1, -1, 109, 110, 111, 112, -1, -1, 115, 116, - 117, 118, 119, -1, 121, 122, 123, 14, 15, 16, - 17, 18, 19, 20, -1, -1, -1, -1, -1, -1, - -1, -1, 29, 14, 15, 16, 17, 18, 19, 20, - -1, -1, -1, -1, -1, -1, -1, -1, 29, 15, + 121, 122, 123, -1, -1, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, -1, 121, 122, 123, + 13, 14, 15, 16, 17, 18, 19, 20, -1, -1, + -1, -1, -1, -1, -1, -1, 29, 13, 14, 15, 16, 17, 18, 19, 20, -1, -1, -1, -1, -1, -1, -1, -1, 29, 15, 16, 17, 18, 19, 20, -1, -1, -1, -1, -1, -1, -1, -1, 29, 15, 16, 17, 18, 19, 20, -1, -1, -1, -1, -1, -1, -1, -1, 29, 15, 16, 17, 18, 19, 20, - -1, -1, -1, -1, -1, -1, -1, -1, 29, -1, - -1, -1, -1, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, -1, 121, 122, 123, -1, -1, 110, - 111, 112, -1, -1, 115, 116, 117, 118, 119, -1, - 121, 122, 123, -1, 110, 111, 112, 113, 114, 115, + -1, -1, -1, -1, -1, -1, -1, -1, 29, 15, + 16, 17, 18, 19, 20, -1, -1, -1, -1, -1, + -1, -1, -1, 29, 107, -1, 109, 110, 111, 112, + -1, -1, 115, 116, 117, 118, 119, -1, 121, 122, + 123, -1, -1, 109, 110, 111, 112, -1, -1, 115, 116, 117, 118, 119, -1, 121, 122, 123, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, 122, 123, -1, -1, -1, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, 122, 123, -1, 110, 111, 112, -1, -1, 115, 116, 117, 118, 119, -1, - 121, 122, 123, 15, 16, 17, 18, 19, 20, -1, - -1, -1, -1, -1, -1, -1, -1, 29, 15, 16, + 121, 122, 123, -1, -1, -1, -1, 113, 114, 115, + 116, 117, 118, 119, -1, 121, 122, 123, 15, 16, 17, 18, 19, 20, -1, -1, -1, -1, -1, -1, -1, -1, 29, 15, 16, 17, 18, 19, 20, -1, - -1, -1, -1, 44, -1, -1, -1, 29, 15, 16, - 17, 18, 19, 20, -1, 56, -1, -1, -1, -1, - 61, -1, 29, 64, -1, -1, -1, -1, -1, -1, - -1, 72, -1, 74, -1, -1, 77, 78, 79, -1, - -1, -1, -1, -1, -1, -1, -1, 88, -1, -1, - -1, 92, -1, -1, -1, 96, -1, -1, -1, -1, - -1, 113, 114, 115, 116, 117, 118, 119, -1, 121, - 122, 123, -1, -1, 111, 112, -1, -1, 115, 116, - 117, 118, 119, -1, 121, 122, 123, 8, 9, -1, - 112, -1, -1, 115, 116, 117, 118, 119, -1, 121, + -1, -1, 8, 9, -1, -1, -1, 29, 15, 16, + 17, 18, 19, 20, -1, -1, -1, -1, -1, -1, + -1, -1, 29, 17, 18, 19, 20, -1, -1, -1, + -1, -1, -1, -1, -1, 29, -1, -1, -1, 45, + -1, 47, 48, 49, 50, -1, 52, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, + -1, -1, 68, 69, 70, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 111, 112, 82, 83, 115, 116, + 117, 118, 119, -1, 121, 122, 123, 93, -1, 95, + 112, -1, 98, 115, 116, 117, 118, 119, 9, 121, 122, 123, -1, -1, -1, -1, -1, -1, 115, 116, - 117, 118, 119, -1, 121, 122, 123, -1, 8, 9, - -1, -1, -1, -1, -1, 46, -1, 48, 49, 50, - 51, -1, 53, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 63, -1, -1, -1, -1, -1, 69, 70, - 71, -1, -1, -1, -1, -1, 46, -1, 48, 49, - -1, 82, 83, 53, -1, -1, -1, -1, -1, -1, - 9, -1, 93, 63, 95, -1, -1, 98, -1, 69, - 70, 71, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 82, 83, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 93, -1, 95, -1, 46, 98, 48, - 49, 50, 51, -1, 53, -1, -1, -1, 57, -1, - -1, 9, -1, -1, 63, -1, -1, -1, -1, -1, - 69, 70, 71, -1, -1, -1, -1, -1, -1, -1, + 117, 118, 119, -1, 121, 122, 123, -1, -1, -1, + -1, 115, 116, 117, 118, 119, -1, 121, 122, 123, + 45, -1, 47, 48, 45, -1, 47, 48, 49, 50, + -1, 52, -1, -1, -1, 56, -1, 62, -1, -1, + 9, 62, -1, 68, 69, 70, -1, 68, 69, 70, + -1, -1, -1, -1, -1, -1, -1, 82, 83, -1, + -1, 82, 83, -1, -1, -1, 87, -1, -1, -1, + 95, -1, 93, 94, 95, -1, 45, 98, 47, 48, + 49, 50, -1, 52, -1, -1, -1, 56, -1, -1, + -1, -1, 9, 62, -1, -1, -1, -1, -1, 68, + 69, 70, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, 83, -1, -1, -1, 87, -1, - -1, -1, -1, -1, 93, 94, 95, -1, 46, 98, - 48, 49, 50, 51, -1, 53, -1, -1, -1, 57, - -1, -1, 9, -1, -1, 63, -1, -1, -1, -1, - -1, 69, 70, 71, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 82, 83, -1, -1, -1, 87, - -1, -1, -1, -1, -1, 93, 94, 95, -1, 46, - 98, 48, 49, 50, -1, -1, 53, -1, -1, -1, - 57, -1, -1, 9, -1, -1, 63, -1, -1, -1, - -1, -1, 69, 70, 71, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 93, 94, 95, -1, 45, 98, + 47, 48, 49, -1, -1, 52, -1, -1, -1, 56, + -1, -1, -1, -1, 9, 62, -1, -1, -1, -1, + -1, 68, 69, 70, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, 83, -1, -1, -1, 87, -1, -1, -1, -1, -1, 93, 94, 95, -1, - 46, 98, 48, 49, 50, -1, -1, 53, -1, -1, - 44, 57, -1, -1, -1, -1, -1, 63, -1, -1, - -1, -1, 56, 69, 70, 71, -1, 61, -1, -1, - 64, -1, -1, -1, -1, -1, 82, 83, 72, -1, - 74, 87, -1, 77, 78, 79, -1, 93, 94, 95, - -1, 44, 98, -1, 88, -1, -1, -1, 92, -1, - -1, -1, 96, 56, -1, -1, -1, -1, 61, -1, - -1, 64, 106, -1, -1, -1, 44, -1, -1, 72, - -1, 74, -1, -1, 77, 78, 79, -1, 56, -1, - -1, 125, -1, 61, -1, 88, 64, -1, -1, 92, - -1, -1, -1, 96, 72, -1, 74, -1, -1, 77, - 78, 79, -1, 106, 44, -1, -1, -1, -1, -1, - 88, -1, -1, -1, 92, -1, 56, -1, 96, -1, - -1, 61, 125, -1, 64, -1, -1, -1, 106, 44, - -1, -1, 72, -1, 74, -1, -1, 77, 78, 79, - -1, 56, -1, -1, -1, -1, 61, 125, 88, 64, - -1, -1, 92, -1, -1, -1, 96, 72, -1, 74, - -1, -1, 77, 78, 79, -1, 106, -1, -1, -1, - -1, -1, -1, 88, -1, -1, -1, 92, -1, -1, - -1, 96, -1, -1, -1, 125, -1, -1, -1, -1, - -1, 106, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 125 + 45, 98, 47, 48, 49, -1, -1, 52, -1, -1, + -1, 56, -1, -1, -1, -1, -1, 62, -1, -1, + -1, -1, -1, 68, 69, 70, -1, 43, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 82, 83, 55, + -1, -1, 87, -1, 60, -1, -1, 63, 93, 94, + 95, -1, -1, 98, -1, 71, 72, 43, 74, -1, + -1, 77, 78, 79, -1, -1, -1, -1, -1, 55, + -1, -1, 88, -1, 60, -1, 92, 63, -1, -1, + 96, -1, -1, 43, -1, 71, 72, -1, 74, -1, + 106, 77, 78, 79, -1, 55, -1, -1, -1, -1, + 60, -1, 88, 63, -1, -1, 92, -1, -1, 125, + 96, 71, 72, 43, 74, -1, -1, 77, 78, 79, + 106, -1, -1, -1, -1, 55, -1, -1, 88, -1, + 60, -1, 92, 63, -1, -1, 96, -1, -1, 125, + -1, 71, 72, 43, 74, -1, 106, 77, 78, 79, + -1, -1, -1, -1, -1, 55, -1, -1, 88, -1, + 60, -1, 92, 63, -1, 125, 96, -1, -1, 43, + -1, 71, 72, -1, 74, -1, 106, 77, 78, 79, + -1, 55, -1, -1, -1, -1, 60, -1, 88, 63, + -1, -1, 92, -1, -1, 125, 96, 71, 72, -1, + 74, -1, -1, 77, 78, 79, 106, -1, -1, -1, + -1, -1, -1, -1, 88, -1, -1, -1, 92, -1, + -1, -1, 96, -1, -1, 125 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -2245,94 +2289,95 @@ static const yytype_int16 yycheck[] = static const yytype_uint8 yystos[] = { 0, 101, 102, 103, 129, 130, 221, 3, 4, 5, - 6, 8, 9, 46, 48, 49, 53, 54, 62, 63, - 69, 70, 75, 82, 83, 84, 86, 90, 95, 112, - 116, 117, 120, 122, 126, 214, 215, 220, 9, 46, - 48, 49, 50, 51, 53, 57, 63, 69, 70, 71, + 6, 8, 9, 45, 47, 48, 52, 53, 61, 62, + 68, 69, 75, 82, 83, 84, 86, 90, 95, 112, + 116, 117, 120, 122, 126, 214, 215, 220, 9, 45, + 47, 48, 49, 50, 52, 56, 62, 68, 69, 70, 82, 83, 87, 93, 94, 95, 98, 180, 183, 184, 186, 191, 193, 197, 198, 202, 203, 204, 205, 0, - 44, 56, 61, 64, 72, 74, 77, 78, 79, 88, - 92, 96, 106, 133, 135, 136, 138, 139, 140, 161, - 199, 201, 221, 122, 122, 122, 122, 122, 113, 122, - 122, 122, 9, 93, 182, 197, 198, 202, 122, 122, - 122, 113, 122, 214, 214, 214, 214, 9, 46, 48, - 49, 53, 63, 69, 70, 82, 83, 95, 183, 212, - 214, 214, 13, 14, 15, 16, 17, 18, 19, 20, + 43, 55, 60, 63, 71, 72, 74, 77, 78, 79, + 88, 92, 96, 106, 133, 135, 136, 138, 139, 140, + 161, 199, 201, 221, 122, 122, 122, 122, 122, 113, + 122, 122, 122, 9, 93, 182, 197, 198, 202, 122, + 122, 122, 113, 122, 214, 214, 214, 214, 9, 45, + 47, 48, 52, 62, 68, 69, 82, 83, 95, 183, + 212, 214, 214, 13, 14, 15, 16, 17, 18, 19, + 20, 29, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 121, 122, 123, 6, 180, 52, 62, + 69, 203, 69, 203, 203, 8, 9, 219, 203, 10, + 50, 112, 117, 122, 179, 221, 104, 219, 104, 219, + 107, 137, 122, 122, 104, 219, 107, 107, 107, 162, + 138, 145, 74, 219, 8, 9, 44, 50, 57, 58, + 59, 67, 73, 76, 80, 85, 93, 97, 99, 104, + 120, 150, 181, 184, 186, 191, 193, 197, 198, 202, + 211, 212, 221, 211, 211, 211, 211, 183, 211, 211, + 211, 219, 122, 219, 219, 211, 211, 183, 183, 211, + 124, 105, 124, 214, 214, 214, 214, 214, 214, 214, + 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, + 214, 214, 214, 214, 124, 212, 214, 179, 62, 117, + 179, 179, 179, 179, 123, 192, 104, 185, 187, 135, + 8, 219, 130, 104, 113, 50, 150, 181, 219, 122, + 122, 180, 220, 50, 180, 219, 134, 219, 104, 106, + 107, 108, 173, 106, 141, 219, 219, 124, 124, 124, + 124, 124, 114, 124, 124, 124, 211, 124, 124, 124, + 114, 124, 214, 214, 107, 124, 127, 179, 124, 210, + 214, 221, 195, 196, 221, 194, 130, 107, 188, 189, + 221, 105, 105, 125, 200, 8, 9, 49, 50, 93, + 163, 164, 165, 166, 202, 221, 180, 173, 146, 151, + 10, 117, 152, 142, 180, 8, 9, 10, 50, 112, + 117, 177, 221, 130, 122, 206, 207, 131, 132, 219, + 104, 214, 10, 50, 76, 112, 117, 122, 143, 167, + 219, 122, 124, 122, 214, 122, 127, 219, 125, 196, + 125, 77, 78, 79, 97, 190, 104, 105, 8, 219, + 130, 219, 166, 219, 114, 105, 8, 9, 10, 50, + 112, 117, 122, 178, 221, 147, 148, 167, 3, 4, + 5, 8, 12, 50, 53, 61, 75, 84, 86, 90, + 112, 116, 120, 122, 126, 169, 170, 176, 180, 216, + 217, 220, 221, 117, 167, 169, 144, 167, 177, 117, + 177, 177, 177, 122, 123, 125, 153, 125, 208, 221, + 104, 105, 122, 104, 174, 175, 214, 221, 106, 117, + 167, 13, 14, 15, 16, 17, 18, 19, 20, 29, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 51, 75, 105, 108, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 122, 123, 126, + 159, 167, 167, 167, 107, 108, 122, 123, 172, 173, + 221, 212, 212, 169, 105, 108, 125, 93, 97, 198, + 218, 219, 97, 218, 97, 218, 77, 78, 79, 130, + 190, 105, 124, 105, 125, 108, 178, 108, 138, 139, + 160, 161, 165, 117, 178, 178, 178, 178, 108, 123, + 171, 221, 149, 167, 172, 173, 178, 180, 113, 182, + 122, 113, 214, 214, 214, 183, 212, 214, 124, 12, + 105, 178, 13, 14, 15, 16, 17, 18, 19, 20, 29, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 121, 122, 123, 6, 180, 53, 63, 70, - 203, 70, 203, 203, 8, 9, 219, 203, 10, 51, - 112, 117, 122, 179, 221, 104, 219, 104, 219, 107, - 137, 122, 104, 219, 107, 107, 107, 162, 138, 145, - 74, 219, 8, 9, 45, 51, 58, 59, 60, 68, - 73, 76, 80, 85, 93, 97, 99, 104, 120, 150, - 181, 184, 186, 191, 193, 197, 198, 202, 211, 212, - 221, 211, 211, 211, 211, 183, 211, 211, 211, 219, - 122, 219, 219, 211, 211, 183, 183, 211, 124, 105, - 124, 214, 214, 214, 214, 214, 214, 214, 214, 214, + 118, 119, 121, 122, 123, 167, 107, 124, 124, 172, + 173, 122, 177, 156, 210, 169, 3, 4, 5, 6, + 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 56, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 73, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 89, 90, 91, 92, + 93, 94, 95, 97, 98, 99, 100, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 126, 127, + 209, 206, 132, 211, 174, 125, 105, 167, 124, 127, + 124, 4, 214, 168, 210, 105, 124, 124, 124, 214, + 219, 218, 219, 218, 218, 218, 218, 218, 125, 8, + 106, 219, 183, 171, 183, 178, 124, 53, 84, 86, + 112, 116, 117, 120, 122, 126, 213, 215, 210, 172, + 173, 105, 108, 172, 178, 183, 122, 183, 183, 124, + 124, 50, 158, 221, 12, 176, 172, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, - 214, 214, 124, 212, 214, 179, 63, 117, 179, 179, - 179, 179, 123, 192, 104, 185, 187, 135, 219, 130, - 104, 113, 51, 150, 181, 219, 122, 122, 180, 220, - 51, 180, 219, 134, 219, 104, 106, 107, 108, 173, - 106, 141, 219, 219, 124, 124, 124, 124, 124, 114, - 124, 124, 124, 211, 124, 124, 124, 114, 124, 214, - 214, 107, 124, 127, 179, 124, 210, 214, 221, 195, - 196, 219, 221, 194, 130, 107, 188, 189, 221, 105, - 125, 200, 8, 9, 50, 51, 93, 163, 164, 165, - 166, 202, 221, 180, 173, 146, 151, 10, 117, 152, - 142, 180, 8, 9, 10, 51, 112, 117, 177, 221, - 130, 122, 206, 207, 131, 132, 219, 104, 214, 10, - 51, 76, 112, 117, 122, 143, 167, 219, 122, 124, - 122, 214, 122, 127, 125, 105, 108, 195, 125, 77, - 78, 79, 97, 190, 104, 105, 219, 130, 219, 166, - 219, 114, 105, 8, 9, 10, 51, 112, 117, 122, - 178, 221, 147, 148, 167, 3, 4, 5, 8, 12, - 51, 54, 62, 75, 84, 86, 90, 112, 116, 120, - 122, 126, 169, 170, 176, 180, 216, 217, 220, 221, - 117, 167, 169, 144, 167, 177, 117, 177, 177, 177, - 122, 123, 125, 153, 125, 208, 221, 104, 105, 122, - 104, 174, 175, 214, 221, 106, 117, 167, 13, 14, - 15, 16, 17, 18, 19, 20, 29, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 52, - 75, 105, 108, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 122, 123, 126, 159, 167, 167, - 167, 107, 108, 122, 123, 172, 173, 221, 212, 212, - 169, 219, 214, 125, 93, 97, 198, 218, 219, 97, - 218, 97, 218, 77, 78, 79, 130, 190, 105, 125, - 108, 178, 138, 139, 160, 161, 165, 117, 178, 178, - 178, 178, 108, 123, 171, 221, 149, 167, 172, 173, - 178, 180, 113, 182, 122, 113, 214, 214, 214, 183, - 212, 214, 124, 12, 105, 178, 13, 14, 15, 16, - 17, 18, 19, 20, 29, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 121, 122, 123, 167, - 107, 124, 124, 172, 173, 122, 177, 156, 210, 169, - 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 57, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 73, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 89, 90, 91, 92, 93, 94, 95, 97, 98, - 99, 100, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 126, 127, 209, 206, 132, 211, 174, - 125, 105, 167, 124, 127, 124, 4, 214, 168, 210, - 105, 124, 124, 124, 108, 219, 218, 219, 218, 218, - 218, 218, 218, 125, 219, 183, 171, 178, 124, 54, - 84, 86, 112, 116, 117, 120, 122, 126, 213, 215, - 210, 172, 173, 105, 108, 172, 178, 183, 122, 183, - 183, 124, 124, 51, 158, 221, 12, 176, 172, 214, - 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, - 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, - 124, 212, 214, 124, 122, 158, 105, 157, 169, 127, - 124, 208, 125, 124, 125, 104, 214, 169, 127, 143, - 158, 214, 124, 122, 113, 122, 113, 213, 213, 213, - 213, 183, 212, 213, 13, 14, 15, 16, 17, 18, - 19, 20, 29, 109, 110, 111, 112, 115, 116, 117, - 118, 119, 121, 122, 123, 127, 105, 148, 214, 172, - 114, 211, 124, 114, 214, 89, 107, 124, 127, 122, - 154, 144, 169, 124, 158, 125, 174, 124, 106, 169, + 214, 214, 214, 214, 214, 214, 214, 214, 124, 212, + 214, 124, 122, 158, 105, 157, 169, 127, 124, 208, + 125, 124, 125, 104, 214, 169, 127, 143, 158, 105, + 124, 124, 122, 113, 122, 113, 213, 213, 213, 213, + 183, 212, 213, 13, 14, 15, 16, 17, 18, 19, + 20, 29, 109, 110, 111, 112, 115, 116, 117, 118, + 119, 121, 122, 123, 127, 105, 148, 214, 172, 114, + 211, 124, 114, 214, 89, 107, 124, 127, 122, 154, + 144, 169, 124, 158, 125, 174, 124, 106, 106, 169, 183, 183, 183, 124, 124, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 124, 212, 214, 149, 122, 124, @@ -2354,30 +2399,39 @@ static const yytype_uint8 yystos[] = /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ + Once GCC version 2 has supplanted version 1, this can go. However, + YYFAIL appears to be in use. Nevertheless, it is formally deprecated + in Bison 2.4.2's NEWS entry, where a plan to phase it out is + discussed. */ #define YYFAIL goto yyerrlab +#if defined YYFAIL + /* This is here to suppress warnings from the GCC cpp's + -Wunused-macros. Normally we don't worry about that warning, but + some users do, and we want to make it easy for users to remove + YYFAIL uses, which will produce warnings from Bison 2.5. */ +#endif #define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK (1); \ - goto yybackup; \ - } \ - else \ - { \ +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) - +/* Error token number */ #define YYTERROR 1 #define YYERRCODE 256 @@ -2386,38 +2440,75 @@ while (YYID (0)) If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ while (YYID (0)) #endif +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) + /* YY_LOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL + +/* Print *YYLOCP on YYO. Private, do not rely on its existence. */ + +__attribute__((__unused__)) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static unsigned +yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp) +#else +static unsigned +yy_location_print_ (yyo, yylocp) + FILE *yyo; + YYLTYPE const * const yylocp; +#endif +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; + } + +# define YY_LOCATION_PRINT(File, Loc) \ + yy_location_print_ (File, &(Loc)) + # else # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif @@ -2425,7 +2516,6 @@ while (YYID (0)) /* YYLEX -- calling `yylex' with the right arguments. */ - #ifdef YYLEX_PARAM # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) #else @@ -2476,6 +2566,8 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp) YYLTYPE const * const yylocationp; #endif { + FILE *yyo = yyoutput; + YYUSE (yyo); if (!yyvaluep) return; YYUSE (yylocationp); @@ -2488,7 +2580,7 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp) switch (yytype) { default: - break; + break; } } @@ -2618,7 +2710,6 @@ int yydebug; # define YYMAXDEPTH 10000 #endif - #if YYERROR_VERBOSE @@ -2721,115 +2812,145 @@ yytnamerr (char *yyres, const char *yystr) } # endif -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP. + + Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return 2 if the + required number of bytes is too large to store. */ +static int +yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, + yytype_int16 *yyssp, int yytoken) { - int yyn = yypact[yystate]; + YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); + YYSIZE_T yysize = yysize0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULL; + /* Arguments of yyformat. */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Number of reported tokens (one for the "unexpected", one per + "expected"). */ + int yycount = 0; - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else + /* There are many possibilities here to consider: + - Assume YYFAIL is not used. It's too flawed to consider. See + + for details. YYERROR is fine as it does not invoke this + function. + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yytoken != YYEMPTY) { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; + int yyn = yypact[*yyssp]; + yyarg[yycount++] = yytname[yytoken]; + if (!yypact_value_is_default (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - - if (yysize_overflow) - return YYSIZE_MAXIMUM; - - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + break; + } + yyarg[yycount++] = yytname[yyx]; + { + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + } + } } + + switch (yycount) + { +# define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +# undef YYCASE_ + } + + { + YYSIZE_T yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + + if (*yymsg_alloc < yysize) + { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return 1; + } + + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyformat += 2; + } + else + { + yyp++; + yyformat++; + } + } + return 0; } #endif /* YYERROR_VERBOSE */ - /*-----------------------------------------------. | Release the memory associated to this symbol. | @@ -2860,32 +2981,16 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp) { default: - break; + break; } } -/* Prevent warnings from -Wmissing-prototypes. */ -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - -/*-------------------------. -| yyparse or yypush_parse. | -`-------------------------*/ +/*----------. +| yyparse. | +`----------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ @@ -2912,11 +3017,40 @@ yyparse () /* The lookahead symbol. */ int yychar; + +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +/* Default value used for initialization, for pacifying older GCCs + or non-GCC compilers. */ +static YYSTYPE yyval_default; +# define YY_INITIAL_VALUE(Value) = Value +#endif +static YYLTYPE yyloc_default +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL + = { 1, 1, 1, 1 } +# endif +; +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + /* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; +YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); /* Location data for the lookahead symbol. */ -YYLTYPE yylloc; +YYLTYPE yylloc = yyloc_default; + /* Number of syntax errors so far. */ int yynerrs; @@ -2930,7 +3064,7 @@ YYLTYPE yylloc; `yyvs': related to semantic values. `yyls': related to locations. - Refer to the stacks thru separate pointers, to allow yyoverflow + Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ @@ -2949,14 +3083,14 @@ YYLTYPE yylloc; YYLTYPE *yylsp; /* The locations where the error started and ended. */ - YYLTYPE yyerror_range[2]; + YYLTYPE yyerror_range[3]; YYSIZE_T yystacksize; int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ - int yytoken; + int yytoken = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; @@ -2975,10 +3109,9 @@ YYLTYPE yylloc; Keep to zero when no symbol should be popped. */ int yylen = 0; - yytoken = 0; - yyss = yyssa; - yyvs = yyvsa; - yyls = yylsa; + yyssp = yyss = yyssa; + yyvsp = yyvs = yyvsa; + yylsp = yyls = yylsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); @@ -2987,21 +3120,7 @@ YYLTYPE yylloc; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - yyssp = yyss; - yyvsp = yyvs; - yylsp = yyls; - -#if YYLTYPE_IS_TRIVIAL - /* Initialize the default location before parsing starts. */ - yylloc.first_line = yylloc.last_line = 1; - yylloc.first_column = yylloc.last_column = 1; -#endif - + yylsp[0] = yylloc; goto yysetstate; /*------------------------------------------------------------. @@ -3098,7 +3217,7 @@ yybackup: /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) + if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ @@ -3129,8 +3248,8 @@ yybackup: yyn = yytable[yyn]; if (yyn <= 0) { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; + if (yytable_value_is_error (yyn)) + goto yyerrlab; yyn = -yyn; goto yyreduce; } @@ -3147,7 +3266,9 @@ yybackup: yychar = YYEMPTY; yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END *++yylsp = yylloc; goto yynewstate; @@ -3185,36 +3306,32 @@ yyreduce: switch (yyn) { case 3: - -/* Line 1455 of yacc.c */ -#line 384 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 385 "dtool/src/cppparser/cppBison.yxx" { current_expr = (yyvsp[(2) - (2)].u.expr); } break; case 4: - -/* Line 1455 of yacc.c */ -#line 388 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 389 "dtool/src/cppparser/cppBison.yxx" { current_type = (yyvsp[(2) - (2)].u.type); } break; case 10: - -/* Line 1455 of yacc.c */ -#line 406 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 407 "dtool/src/cppparser/cppBison.yxx" { delete (yyvsp[(3) - (4)].u.expr); } break; case 11: - -/* Line 1455 of yacc.c */ -#line 418 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 419 "dtool/src/cppparser/cppBison.yxx" { push_storage_class((current_storage_class & ~CPPInstance::SC_c_binding) | ((yyvsp[(1) - (2)].u.integer) & CPPInstance::SC_c_binding)); @@ -3222,18 +3339,16 @@ yyreduce: break; case 12: - -/* Line 1455 of yacc.c */ -#line 423 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 424 "dtool/src/cppparser/cppBison.yxx" { pop_storage_class(); } break; case 20: - -/* Line 1455 of yacc.c */ -#line 437 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 438 "dtool/src/cppparser/cppBison.yxx" { if (publish_nest_level != 0) { yyerror("Unclosed __begin_publish", publish_loc); @@ -3249,9 +3364,8 @@ yyreduce: break; case 21: - -/* Line 1455 of yacc.c */ -#line 450 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 451 "dtool/src/cppparser/cppBison.yxx" { if (publish_nest_level != 1) { yyerror("Unmatched __end_publish", (yylsp[(1) - (1)])); @@ -3263,18 +3377,16 @@ yyreduce: break; case 22: - -/* Line 1455 of yacc.c */ -#line 459 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 460 "dtool/src/cppparser/cppBison.yxx" { current_scope->set_current_vis(V_published); } break; case 23: - -/* Line 1455 of yacc.c */ -#line 463 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 464 "dtool/src/cppparser/cppBison.yxx" { if (publish_nest_level > 0) { current_scope->set_current_vis(V_published); @@ -3285,37 +3397,69 @@ yyreduce: break; case 24: - -/* Line 1455 of yacc.c */ -#line 471 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 472 "dtool/src/cppparser/cppBison.yxx" { current_scope->set_current_vis(V_protected); } break; case 25: - -/* Line 1455 of yacc.c */ -#line 475 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 476 "dtool/src/cppparser/cppBison.yxx" { current_scope->set_current_vis(V_private); } break; case 26: +/* Line 1792 of yacc.c */ +#line 480 "dtool/src/cppparser/cppBison.yxx" + { -/* Line 1455 of yacc.c */ -#line 479 "cppBison.yxx" + CPPDeclaration *getter = (yyvsp[(5) - (7)].u.identifier)->find_symbol(current_scope, global_scope, current_lexer); + if (getter == (CPPDeclaration *)NULL || getter->get_subtype() != CPPDeclaration::ST_function_group) { + yyerror("Reference to non-existent or invalid getter: " + (yyvsp[(5) - (7)].u.identifier)->get_fully_scoped_name(), (yylsp[(1) - (7)])); + } + + CPPMakeProperty *make_property = new CPPMakeProperty((yyvsp[(3) - (7)].u.identifier), getter->as_function_group(), NULL, current_scope, (yylsp[(1) - (7)]).file); + current_scope->add_declaration(make_property, global_scope, current_lexer, (yylsp[(1) - (7)])); +} + break; + + case 27: +/* Line 1792 of yacc.c */ +#line 491 "dtool/src/cppparser/cppBison.yxx" + { + CPPDeclaration *getter = (yyvsp[(5) - (9)].u.identifier)->find_symbol(current_scope, global_scope, current_lexer); + if (getter == (CPPDeclaration *)NULL || getter->get_subtype() != CPPDeclaration::ST_function_group) { + yyerror("Reference to non-existent or invalid getter: " + (yyvsp[(5) - (9)].u.identifier)->get_fully_scoped_name(), (yylsp[(1) - (9)])); + } + + CPPDeclaration *setter = (yyvsp[(7) - (9)].u.identifier)->find_symbol(current_scope, global_scope, current_lexer); + if (setter == (CPPDeclaration *)NULL || setter->get_subtype() != CPPDeclaration::ST_function_group) { + yyerror("Reference to non-existent or invalid setter: " + (yyvsp[(7) - (9)].u.identifier)->get_fully_scoped_name(), (yylsp[(1) - (9)])); + } + + CPPMakeProperty *make_property = new CPPMakeProperty((yyvsp[(3) - (9)].u.identifier), getter->as_function_group(), + setter->as_function_group(), + current_scope, (yylsp[(1) - (9)]).file); + current_scope->add_declaration(make_property, global_scope, current_lexer, (yylsp[(1) - (9)])); +} + break; + + case 28: +/* Line 1792 of yacc.c */ +#line 508 "dtool/src/cppparser/cppBison.yxx" { CPPMakeSeq *make_seq = new CPPMakeSeq((yyvsp[(3) - (9)].u.identifier)->get_simple_name(), (yyvsp[(5) - (9)].u.identifier)->get_simple_name(), (yyvsp[(7) - (9)].u.identifier)->get_simple_name(), (yylsp[(1) - (9)]).file); current_scope->add_declaration(make_seq, global_scope, current_lexer, (yylsp[(1) - (9)])); } break; - case 27: - -/* Line 1455 of yacc.c */ -#line 487 "cppBison.yxx" + case 29: +/* Line 1792 of yacc.c */ +#line 516 "dtool/src/cppparser/cppBison.yxx" { CPPScope *new_scope = new CPPScope(current_scope, CPPNameComponent("temp"), V_public); @@ -3323,38 +3467,34 @@ yyreduce: } break; - case 28: - -/* Line 1455 of yacc.c */ -#line 493 "cppBison.yxx" + case 30: +/* Line 1792 of yacc.c */ +#line 522 "dtool/src/cppparser/cppBison.yxx" { delete current_scope; pop_scope(); } break; - case 29: - -/* Line 1455 of yacc.c */ -#line 502 "cppBison.yxx" + case 31: +/* Line 1792 of yacc.c */ +#line 531 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.integer) = 0; } break; - case 30: - -/* Line 1455 of yacc.c */ -#line 506 "cppBison.yxx" + case 32: +/* Line 1792 of yacc.c */ +#line 535 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.integer) = (yyvsp[(1) - (2)].u.integer) | (int)CPPInstance::SC_extern; } break; - case 31: - -/* Line 1455 of yacc.c */ -#line 510 "cppBison.yxx" + case 33: +/* Line 1792 of yacc.c */ +#line 539 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.integer) = (yyvsp[(1) - (3)].u.integer) | (int)CPPInstance::SC_extern; if ((yyvsp[(3) - (3)].str) == "C") { @@ -3367,100 +3507,89 @@ yyreduce: } break; - case 32: - -/* Line 1455 of yacc.c */ -#line 521 "cppBison.yxx" + case 34: +/* Line 1792 of yacc.c */ +#line 550 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.integer) = (yyvsp[(1) - (2)].u.integer) | (int)CPPInstance::SC_static; } break; - case 33: - -/* Line 1455 of yacc.c */ -#line 525 "cppBison.yxx" + case 35: +/* Line 1792 of yacc.c */ +#line 554 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.integer) = (yyvsp[(1) - (2)].u.integer) | (int)CPPInstance::SC_inline; } break; - case 34: - -/* Line 1455 of yacc.c */ -#line 529 "cppBison.yxx" + case 36: +/* Line 1792 of yacc.c */ +#line 558 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.integer) = (yyvsp[(1) - (2)].u.integer) | (int)CPPInstance::SC_virtual; } break; - case 35: - -/* Line 1455 of yacc.c */ -#line 533 "cppBison.yxx" + case 37: +/* Line 1792 of yacc.c */ +#line 562 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.integer) = (yyvsp[(1) - (2)].u.integer) | (int)CPPInstance::SC_explicit; } break; - case 36: - -/* Line 1455 of yacc.c */ -#line 537 "cppBison.yxx" + case 38: +/* Line 1792 of yacc.c */ +#line 566 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.integer) = (yyvsp[(1) - (2)].u.integer) | (int)CPPInstance::SC_volatile; } break; - case 37: - -/* Line 1455 of yacc.c */ -#line 541 "cppBison.yxx" + case 39: +/* Line 1792 of yacc.c */ +#line 570 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.integer) = (yyvsp[(1) - (2)].u.integer) | (int)CPPInstance::SC_mutable; } break; - case 38: - -/* Line 1455 of yacc.c */ -#line 545 "cppBison.yxx" + case 40: +/* Line 1792 of yacc.c */ +#line 574 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.integer) = (yyvsp[(1) - (2)].u.integer) | (int)CPPInstance::SC_register; } break; - case 39: - -/* Line 1455 of yacc.c */ -#line 549 "cppBison.yxx" + case 41: +/* Line 1792 of yacc.c */ +#line 578 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.integer) = (yyvsp[(1) - (2)].u.integer) | (int)CPPInstance::SC_blocking; } break; - case 40: - -/* Line 1455 of yacc.c */ -#line 553 "cppBison.yxx" + case 42: +/* Line 1792 of yacc.c */ +#line 582 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.integer) = (yyvsp[(1) - (2)].u.integer) | (int)CPPInstance::SC_extension; } break; - case 41: - -/* Line 1455 of yacc.c */ -#line 560 "cppBison.yxx" + case 43: +/* Line 1792 of yacc.c */ +#line 589 "dtool/src/cppparser/cppBison.yxx" { /* multiple_var_declaration adds itself to the scope. */ } break; - case 42: - -/* Line 1455 of yacc.c */ -#line 564 "cppBison.yxx" + case 44: +/* Line 1792 of yacc.c */ +#line 593 "dtool/src/cppparser/cppBison.yxx" { // 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 @@ -3471,10 +3600,9 @@ yyreduce: } break; - case 43: - -/* Line 1455 of yacc.c */ -#line 573 "cppBison.yxx" + case 45: +/* Line 1792 of yacc.c */ +#line 602 "dtool/src/cppparser/cppBison.yxx" { if ((yyvsp[(2) - (3)].u.instance) != (CPPInstance *)NULL) { (yyvsp[(2) - (3)].u.instance)->_storage_class |= (current_storage_class | (yyvsp[(1) - (3)].u.integer)); @@ -3484,10 +3612,9 @@ yyreduce: } break; - case 44: - -/* Line 1455 of yacc.c */ -#line 584 "cppBison.yxx" + case 46: +/* Line 1792 of yacc.c */ +#line 613 "dtool/src/cppparser/cppBison.yxx" { // We don't need to push/pop type, because we can't nest // multiple_var_declarations. @@ -3500,19 +3627,17 @@ yyreduce: } break; - case 45: - -/* Line 1455 of yacc.c */ -#line 595 "cppBison.yxx" + case 47: +/* Line 1792 of yacc.c */ +#line 624 "dtool/src/cppparser/cppBison.yxx" { pop_storage_class(); } break; - case 46: - -/* Line 1455 of yacc.c */ -#line 599 "cppBison.yxx" + case 48: +/* Line 1792 of yacc.c */ +#line 628 "dtool/src/cppparser/cppBison.yxx" { // We don't need to push/pop type, because we can't nest // multiple_var_declarations. @@ -3521,19 +3646,17 @@ yyreduce: } break; - case 47: - -/* Line 1455 of yacc.c */ -#line 606 "cppBison.yxx" + case 49: +/* Line 1792 of yacc.c */ +#line 635 "dtool/src/cppparser/cppBison.yxx" { pop_storage_class(); } break; - case 48: - -/* Line 1455 of yacc.c */ -#line 617 "cppBison.yxx" + case 50: +/* Line 1792 of yacc.c */ +#line 646 "dtool/src/cppparser/cppBison.yxx" { CPPInstance *inst = new CPPInstance(current_type, (yyvsp[(1) - (2)].u.inst_ident), current_storage_class, @@ -3543,10 +3666,9 @@ yyreduce: } break; - case 49: - -/* Line 1455 of yacc.c */ -#line 625 "cppBison.yxx" + case 51: +/* Line 1792 of yacc.c */ +#line 654 "dtool/src/cppparser/cppBison.yxx" { CPPInstance *inst = new CPPInstance(current_type, (yyvsp[(1) - (4)].u.inst_ident), current_storage_class, @@ -3556,10 +3678,9 @@ yyreduce: } break; - case 50: - -/* Line 1455 of yacc.c */ -#line 636 "cppBison.yxx" + case 52: +/* Line 1792 of yacc.c */ +#line 665 "dtool/src/cppparser/cppBison.yxx" { (yyvsp[(1) - (2)].u.inst_ident)->add_modifier(IIT_const); CPPInstance *inst = new CPPInstance(current_type, (yyvsp[(1) - (2)].u.inst_ident), @@ -3570,10 +3691,9 @@ yyreduce: } break; - case 51: - -/* Line 1455 of yacc.c */ -#line 645 "cppBison.yxx" + case 53: +/* Line 1792 of yacc.c */ +#line 674 "dtool/src/cppparser/cppBison.yxx" { (yyvsp[(1) - (4)].u.inst_ident)->add_modifier(IIT_const); CPPInstance *inst = new CPPInstance(current_type, (yyvsp[(1) - (4)].u.inst_ident), @@ -3584,10 +3704,9 @@ yyreduce: } break; - case 52: - -/* Line 1455 of yacc.c */ -#line 658 "cppBison.yxx" + case 54: +/* Line 1792 of yacc.c */ +#line 687 "dtool/src/cppparser/cppBison.yxx" { // We don't need to push/pop type, because we can't nest // multiple_var_declarations. @@ -3600,19 +3719,17 @@ yyreduce: } break; - case 53: - -/* Line 1455 of yacc.c */ -#line 669 "cppBison.yxx" + case 55: +/* Line 1792 of yacc.c */ +#line 698 "dtool/src/cppparser/cppBison.yxx" { pop_storage_class(); } break; - case 54: - -/* Line 1455 of yacc.c */ -#line 673 "cppBison.yxx" + case 56: +/* Line 1792 of yacc.c */ +#line 702 "dtool/src/cppparser/cppBison.yxx" { // We don't need to push/pop type, because we can't nest // multiple_var_declarations. @@ -3621,19 +3738,17 @@ yyreduce: } break; - case 55: - -/* Line 1455 of yacc.c */ -#line 680 "cppBison.yxx" + case 57: +/* Line 1792 of yacc.c */ +#line 709 "dtool/src/cppparser/cppBison.yxx" { pop_storage_class(); } break; - case 56: - -/* Line 1455 of yacc.c */ -#line 684 "cppBison.yxx" + case 58: +/* Line 1792 of yacc.c */ +#line 713 "dtool/src/cppparser/cppBison.yxx" { if ((yyvsp[(2) - (3)].u.instance) != (CPPDeclaration *)NULL) { CPPInstance *inst = (yyvsp[(2) - (3)].u.instance)->as_instance(); @@ -3646,10 +3761,9 @@ yyreduce: } break; - case 57: - -/* Line 1455 of yacc.c */ -#line 698 "cppBison.yxx" + case 59: +/* Line 1792 of yacc.c */ +#line 727 "dtool/src/cppparser/cppBison.yxx" { CPPInstance *inst = new CPPInstance(current_type, (yyvsp[(1) - (2)].u.inst_ident), current_storage_class, @@ -3659,10 +3773,9 @@ yyreduce: } break; - case 58: - -/* Line 1455 of yacc.c */ -#line 706 "cppBison.yxx" + case 60: +/* Line 1792 of yacc.c */ +#line 735 "dtool/src/cppparser/cppBison.yxx" { CPPInstance *inst = new CPPInstance(current_type, (yyvsp[(1) - (4)].u.inst_ident), current_storage_class, @@ -3672,10 +3785,9 @@ yyreduce: } break; - case 59: - -/* Line 1455 of yacc.c */ -#line 717 "cppBison.yxx" + case 61: +/* Line 1792 of yacc.c */ +#line 746 "dtool/src/cppparser/cppBison.yxx" { (yyvsp[(1) - (2)].u.inst_ident)->add_modifier(IIT_const); CPPInstance *inst = new CPPInstance(current_type, (yyvsp[(1) - (2)].u.inst_ident), @@ -3686,10 +3798,9 @@ yyreduce: } break; - case 60: - -/* Line 1455 of yacc.c */ -#line 726 "cppBison.yxx" + case 62: +/* Line 1792 of yacc.c */ +#line 755 "dtool/src/cppparser/cppBison.yxx" { (yyvsp[(1) - (4)].u.inst_ident)->add_modifier(IIT_const); CPPInstance *inst = new CPPInstance(current_type, (yyvsp[(1) - (4)].u.inst_ident), @@ -3700,51 +3811,17 @@ yyreduce: } break; - case 61: - -/* Line 1455 of yacc.c */ -#line 740 "cppBison.yxx" - { - push_scope((yyvsp[(1) - (2)].u.identifier)->get_scope(current_scope, global_scope)); -} - break; - - case 62: - -/* Line 1455 of yacc.c */ -#line 744 "cppBison.yxx" - { - pop_scope(); - CPPType *type; - if ((yyvsp[(1) - (6)].u.identifier)->get_simple_name() == current_scope->get_simple_name()) { - // This is a constructor, and has no return. - type = new CPPSimpleType(CPPSimpleType::T_void); - } else { - // This isn't a constructor, so it has an implicit return type of - // int. - type = new CPPSimpleType(CPPSimpleType::T_int); - } - - CPPInstanceIdentifier *ii = new CPPInstanceIdentifier((yyvsp[(1) - (6)].u.identifier)); - ii->add_func_modifier((yyvsp[(4) - (6)].u.param_list), (yyvsp[(6) - (6)].u.integer)); - - (yyval.u.instance) = new CPPInstance(type, ii, 0, (yylsp[(1) - (6)]).file); -} - break; - case 63: - -/* Line 1455 of yacc.c */ -#line 762 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 769 "dtool/src/cppparser/cppBison.yxx" { push_scope((yyvsp[(1) - (2)].u.identifier)->get_scope(current_scope, global_scope)); } break; case 64: - -/* Line 1455 of yacc.c */ -#line 766 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 773 "dtool/src/cppparser/cppBison.yxx" { pop_scope(); CPPType *type; @@ -3765,18 +3842,46 @@ yyreduce: break; case 65: +/* Line 1792 of yacc.c */ +#line 791 "dtool/src/cppparser/cppBison.yxx" + { + push_scope((yyvsp[(1) - (2)].u.identifier)->get_scope(current_scope, global_scope)); +} + break; -/* Line 1455 of yacc.c */ -#line 786 "cppBison.yxx" + case 66: +/* Line 1792 of yacc.c */ +#line 795 "dtool/src/cppparser/cppBison.yxx" + { + pop_scope(); + CPPType *type; + if ((yyvsp[(1) - (6)].u.identifier)->get_simple_name() == current_scope->get_simple_name()) { + // This is a constructor, and has no return. + type = new CPPSimpleType(CPPSimpleType::T_void); + } else { + // This isn't a constructor, so it has an implicit return type of + // int. + type = new CPPSimpleType(CPPSimpleType::T_int); + } + + CPPInstanceIdentifier *ii = new CPPInstanceIdentifier((yyvsp[(1) - (6)].u.identifier)); + ii->add_func_modifier((yyvsp[(4) - (6)].u.param_list), (yyvsp[(6) - (6)].u.integer)); + + (yyval.u.instance) = new CPPInstance(type, ii, 0, (yylsp[(1) - (6)]).file); +} + break; + + case 67: +/* Line 1792 of yacc.c */ +#line 815 "dtool/src/cppparser/cppBison.yxx" { push_scope((yyvsp[(2) - (3)].u.identifier)->get_scope(current_scope, global_scope)); } break; - case 66: - -/* Line 1455 of yacc.c */ -#line 790 "cppBison.yxx" + case 68: +/* Line 1792 of yacc.c */ +#line 819 "dtool/src/cppparser/cppBison.yxx" { pop_scope(); if ((yyvsp[(2) - (7)].u.identifier)->is_scoped()) { @@ -3797,19 +3902,17 @@ yyreduce: } break; - case 67: - -/* Line 1455 of yacc.c */ -#line 816 "cppBison.yxx" + case 69: +/* Line 1792 of yacc.c */ +#line 845 "dtool/src/cppparser/cppBison.yxx" { push_scope((yyvsp[(4) - (6)].u.inst_ident)->get_scope(current_scope, global_scope)); } break; - case 68: - -/* Line 1455 of yacc.c */ -#line 820 "cppBison.yxx" + case 70: +/* Line 1792 of yacc.c */ +#line 849 "dtool/src/cppparser/cppBison.yxx" { pop_scope(); CPPType *type = (yyvsp[(1) - (10)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); @@ -3822,19 +3925,17 @@ yyreduce: } break; - case 69: - -/* Line 1455 of yacc.c */ -#line 831 "cppBison.yxx" + case 71: +/* Line 1792 of yacc.c */ +#line 860 "dtool/src/cppparser/cppBison.yxx" { push_scope((yyvsp[(5) - (7)].u.inst_ident)->get_scope(current_scope, global_scope)); } break; - case 70: - -/* Line 1455 of yacc.c */ -#line 835 "cppBison.yxx" + case 72: +/* Line 1792 of yacc.c */ +#line 864 "dtool/src/cppparser/cppBison.yxx" { pop_scope(); CPPType *type = (yyvsp[(1) - (11)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); @@ -3847,10 +3948,9 @@ yyreduce: } break; - case 71: - -/* Line 1455 of yacc.c */ -#line 848 "cppBison.yxx" + case 73: +/* Line 1792 of yacc.c */ +#line 877 "dtool/src/cppparser/cppBison.yxx" { if ((yyvsp[(1) - (4)].u.identifier) != NULL) { push_scope((yyvsp[(1) - (4)].u.identifier)->get_scope(current_scope, global_scope)); @@ -3858,10 +3958,9 @@ yyreduce: } break; - case 72: - -/* Line 1455 of yacc.c */ -#line 854 "cppBison.yxx" + case 74: +/* Line 1792 of yacc.c */ +#line 883 "dtool/src/cppparser/cppBison.yxx" { if ((yyvsp[(1) - (8)].u.identifier) != NULL) { pop_scope(); @@ -3888,10 +3987,9 @@ yyreduce: } break; - case 73: - -/* Line 1455 of yacc.c */ -#line 879 "cppBison.yxx" + case 75: +/* Line 1792 of yacc.c */ +#line 908 "dtool/src/cppparser/cppBison.yxx" { if ((yyvsp[(1) - (5)].u.identifier) != NULL) { push_scope((yyvsp[(1) - (5)].u.identifier)->get_scope(current_scope, global_scope)); @@ -3899,10 +3997,9 @@ yyreduce: } break; - case 74: - -/* Line 1455 of yacc.c */ -#line 885 "cppBison.yxx" + case 76: +/* Line 1792 of yacc.c */ +#line 914 "dtool/src/cppparser/cppBison.yxx" { if ((yyvsp[(1) - (9)].u.identifier) != NULL) { pop_scope(); @@ -3920,10 +4017,9 @@ yyreduce: } break; - case 75: - -/* Line 1455 of yacc.c */ -#line 905 "cppBison.yxx" + case 77: +/* Line 1792 of yacc.c */ +#line 934 "dtool/src/cppparser/cppBison.yxx" { CPPDeclaration *decl = (yyvsp[(1) - (1)].u.identifier)->find_symbol(current_scope, global_scope, current_lexer); @@ -3935,415 +4031,369 @@ yyreduce: } break; - case 76: - -/* Line 1455 of yacc.c */ -#line 918 "cppBison.yxx" + case 78: +/* Line 1792 of yacc.c */ +#line 947 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.integer) = 0; } break; - case 77: - -/* Line 1455 of yacc.c */ -#line 922 "cppBison.yxx" + case 79: +/* Line 1792 of yacc.c */ +#line 951 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.integer) = (int)CPPFunctionType::F_const_method; } break; - case 78: - -/* Line 1455 of yacc.c */ -#line 926 "cppBison.yxx" + case 80: +/* Line 1792 of yacc.c */ +#line 955 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.integer) = (yyvsp[(1) - (4)].u.integer); } break; - case 79: - -/* Line 1455 of yacc.c */ -#line 930 "cppBison.yxx" + case 81: +/* Line 1792 of yacc.c */ +#line 959 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.integer) = (yyvsp[(1) - (5)].u.integer); } break; - case 80: - -/* Line 1455 of yacc.c */ -#line 937 "cppBison.yxx" + case 82: +/* Line 1792 of yacc.c */ +#line 966 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "!"; } break; - case 81: - -/* Line 1455 of yacc.c */ -#line 941 "cppBison.yxx" + case 83: +/* Line 1792 of yacc.c */ +#line 970 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "~"; } break; - case 82: - -/* Line 1455 of yacc.c */ -#line 945 "cppBison.yxx" + case 84: +/* Line 1792 of yacc.c */ +#line 974 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "*"; } break; - case 83: - -/* Line 1455 of yacc.c */ -#line 949 "cppBison.yxx" + case 85: +/* Line 1792 of yacc.c */ +#line 978 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "/"; } break; - case 84: - -/* Line 1455 of yacc.c */ -#line 953 "cppBison.yxx" + case 86: +/* Line 1792 of yacc.c */ +#line 982 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "%"; } break; - case 85: - -/* Line 1455 of yacc.c */ -#line 957 "cppBison.yxx" + case 87: +/* Line 1792 of yacc.c */ +#line 986 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "+"; } break; - case 86: - -/* Line 1455 of yacc.c */ -#line 961 "cppBison.yxx" + case 88: +/* Line 1792 of yacc.c */ +#line 990 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "-"; } break; - case 87: - -/* Line 1455 of yacc.c */ -#line 965 "cppBison.yxx" + case 89: +/* Line 1792 of yacc.c */ +#line 994 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "|"; } break; - case 88: - -/* Line 1455 of yacc.c */ -#line 969 "cppBison.yxx" + case 90: +/* Line 1792 of yacc.c */ +#line 998 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "&"; } break; - case 89: - -/* Line 1455 of yacc.c */ -#line 973 "cppBison.yxx" + case 91: +/* Line 1792 of yacc.c */ +#line 1002 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "^"; } break; - case 90: - -/* Line 1455 of yacc.c */ -#line 977 "cppBison.yxx" + case 92: +/* Line 1792 of yacc.c */ +#line 1006 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "||"; } break; - case 91: - -/* Line 1455 of yacc.c */ -#line 981 "cppBison.yxx" + case 93: +/* Line 1792 of yacc.c */ +#line 1010 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "&&"; } break; - case 92: - -/* Line 1455 of yacc.c */ -#line 985 "cppBison.yxx" + case 94: +/* Line 1792 of yacc.c */ +#line 1014 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "=="; } break; - case 93: - -/* Line 1455 of yacc.c */ -#line 989 "cppBison.yxx" + case 95: +/* Line 1792 of yacc.c */ +#line 1018 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "!="; } break; - case 94: - -/* Line 1455 of yacc.c */ -#line 993 "cppBison.yxx" + case 96: +/* Line 1792 of yacc.c */ +#line 1022 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "<="; } break; - case 95: - -/* Line 1455 of yacc.c */ -#line 997 "cppBison.yxx" + case 97: +/* Line 1792 of yacc.c */ +#line 1026 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = ">="; } break; - case 96: - -/* Line 1455 of yacc.c */ -#line 1001 "cppBison.yxx" + case 98: +/* Line 1792 of yacc.c */ +#line 1030 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "<"; } break; - case 97: - -/* Line 1455 of yacc.c */ -#line 1005 "cppBison.yxx" + case 99: +/* Line 1792 of yacc.c */ +#line 1034 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = ">"; } break; - case 98: - -/* Line 1455 of yacc.c */ -#line 1009 "cppBison.yxx" + case 100: +/* Line 1792 of yacc.c */ +#line 1038 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "<<"; } break; - case 99: - -/* Line 1455 of yacc.c */ -#line 1013 "cppBison.yxx" + case 101: +/* Line 1792 of yacc.c */ +#line 1042 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = ">>"; } break; - case 100: - -/* Line 1455 of yacc.c */ -#line 1017 "cppBison.yxx" + case 102: +/* Line 1792 of yacc.c */ +#line 1046 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "="; } break; - case 101: - -/* Line 1455 of yacc.c */ -#line 1021 "cppBison.yxx" + case 103: +/* Line 1792 of yacc.c */ +#line 1050 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = ","; } break; - case 102: - -/* Line 1455 of yacc.c */ -#line 1025 "cppBison.yxx" + case 104: +/* Line 1792 of yacc.c */ +#line 1054 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "++"; } break; - case 103: - -/* Line 1455 of yacc.c */ -#line 1029 "cppBison.yxx" + case 105: +/* Line 1792 of yacc.c */ +#line 1058 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "--"; } break; - case 104: - -/* Line 1455 of yacc.c */ -#line 1033 "cppBison.yxx" + case 106: +/* Line 1792 of yacc.c */ +#line 1062 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "*="; } break; - case 105: - -/* Line 1455 of yacc.c */ -#line 1037 "cppBison.yxx" + case 107: +/* Line 1792 of yacc.c */ +#line 1066 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "/="; } break; - case 106: - -/* Line 1455 of yacc.c */ -#line 1041 "cppBison.yxx" + case 108: +/* Line 1792 of yacc.c */ +#line 1070 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "%="; } break; - case 107: - -/* Line 1455 of yacc.c */ -#line 1045 "cppBison.yxx" + case 109: +/* Line 1792 of yacc.c */ +#line 1074 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "+="; } break; - case 108: - -/* Line 1455 of yacc.c */ -#line 1049 "cppBison.yxx" + case 110: +/* Line 1792 of yacc.c */ +#line 1078 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "-="; } break; - case 109: - -/* Line 1455 of yacc.c */ -#line 1053 "cppBison.yxx" + case 111: +/* Line 1792 of yacc.c */ +#line 1082 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "|="; } break; - case 110: - -/* Line 1455 of yacc.c */ -#line 1057 "cppBison.yxx" + case 112: +/* Line 1792 of yacc.c */ +#line 1086 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "&="; } break; - case 111: - -/* Line 1455 of yacc.c */ -#line 1061 "cppBison.yxx" + case 113: +/* Line 1792 of yacc.c */ +#line 1090 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "^="; } break; - case 112: - -/* Line 1455 of yacc.c */ -#line 1065 "cppBison.yxx" + case 114: +/* Line 1792 of yacc.c */ +#line 1094 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "<<="; } break; - case 113: - -/* Line 1455 of yacc.c */ -#line 1069 "cppBison.yxx" + case 115: +/* Line 1792 of yacc.c */ +#line 1098 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = ">>="; } break; - case 114: - -/* Line 1455 of yacc.c */ -#line 1073 "cppBison.yxx" + case 116: +/* Line 1792 of yacc.c */ +#line 1102 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "->"; } break; - case 115: - -/* Line 1455 of yacc.c */ -#line 1077 "cppBison.yxx" + case 117: +/* Line 1792 of yacc.c */ +#line 1106 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "[]"; } break; - case 116: - -/* Line 1455 of yacc.c */ -#line 1081 "cppBison.yxx" + case 118: +/* Line 1792 of yacc.c */ +#line 1110 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "()"; } break; - case 117: - -/* Line 1455 of yacc.c */ -#line 1085 "cppBison.yxx" + case 119: +/* Line 1792 of yacc.c */ +#line 1114 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "new"; } break; - case 118: - -/* Line 1455 of yacc.c */ -#line 1089 "cppBison.yxx" + case 120: +/* Line 1792 of yacc.c */ +#line 1118 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = "delete"; } break; - case 121: - -/* Line 1455 of yacc.c */ -#line 1101 "cppBison.yxx" + case 123: +/* Line 1792 of yacc.c */ +#line 1130 "dtool/src/cppparser/cppBison.yxx" { push_scope(new CPPTemplateScope(current_scope)); } break; - case 122: - -/* Line 1455 of yacc.c */ -#line 1105 "cppBison.yxx" + case 124: +/* Line 1792 of yacc.c */ +#line 1134 "dtool/src/cppparser/cppBison.yxx" { pop_scope(); } break; - case 125: - -/* Line 1455 of yacc.c */ -#line 1117 "cppBison.yxx" + case 127: +/* Line 1792 of yacc.c */ +#line 1146 "dtool/src/cppparser/cppBison.yxx" { CPPTemplateScope *ts = current_scope->as_template_scope(); assert(ts != NULL); @@ -4351,10 +4401,9 @@ yyreduce: } break; - case 126: - -/* Line 1455 of yacc.c */ -#line 1123 "cppBison.yxx" + case 128: +/* Line 1792 of yacc.c */ +#line 1152 "dtool/src/cppparser/cppBison.yxx" { CPPTemplateScope *ts = current_scope->as_template_scope(); assert(ts != NULL); @@ -4362,28 +4411,41 @@ yyreduce: } break; - case 127: - -/* Line 1455 of yacc.c */ -#line 1132 "cppBison.yxx" + case 129: +/* Line 1792 of yacc.c */ +#line 1161 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.decl) = CPPType::new_type(new CPPClassTemplateParameter((yyvsp[(2) - (2)].u.identifier))); } break; - case 128: - -/* Line 1455 of yacc.c */ -#line 1136 "cppBison.yxx" + case 130: +/* Line 1792 of yacc.c */ +#line 1165 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.decl) = CPPType::new_type(new CPPClassTemplateParameter((yyvsp[(2) - (4)].u.identifier), (yyvsp[(4) - (4)].u.type))); } break; - case 129: + case 131: +/* Line 1792 of yacc.c */ +#line 1169 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.decl) = CPPType::new_type(new CPPClassTemplateParameter((yyvsp[(2) - (2)].u.identifier))); +} + break; -/* Line 1455 of yacc.c */ -#line 1140 "cppBison.yxx" + case 132: +/* Line 1792 of yacc.c */ +#line 1173 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.decl) = CPPType::new_type(new CPPClassTemplateParameter((yyvsp[(2) - (4)].u.identifier), (yyvsp[(4) - (4)].u.type))); +} + break; + + case 133: +/* Line 1792 of yacc.c */ +#line 1177 "dtool/src/cppparser/cppBison.yxx" { CPPInstance *inst = new CPPInstance((yyvsp[(1) - (3)].u.type), (yyvsp[(2) - (3)].u.inst_ident), 0, (yylsp[(2) - (3)]).file); inst->set_initializer((yyvsp[(3) - (3)].u.expr)); @@ -4391,10 +4453,9 @@ yyreduce: } break; - case 130: - -/* Line 1455 of yacc.c */ -#line 1146 "cppBison.yxx" + case 134: +/* Line 1792 of yacc.c */ +#line 1183 "dtool/src/cppparser/cppBison.yxx" { (yyvsp[(3) - (4)].u.inst_ident)->add_modifier(IIT_const); CPPInstance *inst = new CPPInstance((yyvsp[(2) - (4)].u.type), (yyvsp[(3) - (4)].u.inst_ident), 0, (yylsp[(3) - (4)]).file); @@ -4403,57 +4464,43 @@ yyreduce: } break; - case 131: - -/* Line 1455 of yacc.c */ -#line 1156 "cppBison.yxx" + case 135: +/* Line 1792 of yacc.c */ +#line 1193 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.type) = CPPType::new_type((yyvsp[(1) - (1)].u.simple_type)); } break; - case 132: - -/* Line 1455 of yacc.c */ -#line 1160 "cppBison.yxx" + case 136: +/* Line 1792 of yacc.c */ +#line 1197 "dtool/src/cppparser/cppBison.yxx" { yywarning("Not a type: " + (yyvsp[(1) - (1)].u.identifier)->get_fully_scoped_name(), (yylsp[(1) - (1)])); (yyval.u.type) = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_unknown)); } break; - case 133: - -/* Line 1455 of yacc.c */ -#line 1165 "cppBison.yxx" + case 137: +/* Line 1792 of yacc.c */ +#line 1202 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.type) = (yyvsp[(1) - (1)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); assert((yyval.u.type) != NULL); } break; - case 134: - -/* Line 1455 of yacc.c */ -#line 1170 "cppBison.yxx" - { - (yyval.u.type) = CPPType::new_type(new CPPTBDType((yyvsp[(2) - (2)].u.identifier))); -} - break; - - case 135: - -/* Line 1455 of yacc.c */ -#line 1178 "cppBison.yxx" + case 138: +/* Line 1792 of yacc.c */ +#line 1211 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[(1) - (1)].u.identifier)); } break; - case 136: - -/* Line 1455 of yacc.c */ -#line 1182 "cppBison.yxx" + case 139: +/* Line 1792 of yacc.c */ +#line 1215 "dtool/src/cppparser/cppBison.yxx" { // For an operator function. We implement this simply by building a // ficticious name for the function; in other respects it's just @@ -4469,89 +4516,80 @@ yyreduce: } break; - case 137: - -/* Line 1455 of yacc.c */ -#line 1196 "cppBison.yxx" + case 140: +/* Line 1792 of yacc.c */ +#line 1229 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_const); } break; - case 138: - -/* Line 1455 of yacc.c */ -#line 1201 "cppBison.yxx" + case 141: +/* Line 1792 of yacc.c */ +#line 1234 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_pointer); } break; - case 139: - -/* Line 1455 of yacc.c */ -#line 1206 "cppBison.yxx" + case 142: +/* Line 1792 of yacc.c */ +#line 1239 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_reference); } break; - case 140: - -/* Line 1455 of yacc.c */ -#line 1211 "cppBison.yxx" + case 143: +/* Line 1792 of yacc.c */ +#line 1244 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(3) - (3)].u.inst_ident); (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[(1) - (3)].u.identifier)); } break; - case 141: - -/* Line 1455 of yacc.c */ -#line 1216 "cppBison.yxx" + case 144: +/* Line 1792 of yacc.c */ +#line 1249 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(1) - (4)].u.inst_ident); (yyval.u.inst_ident)->add_array_modifier((yyvsp[(3) - (4)].u.expr)); } break; - case 142: - -/* Line 1455 of yacc.c */ -#line 1221 "cppBison.yxx" + case 145: +/* Line 1792 of yacc.c */ +#line 1254 "dtool/src/cppparser/cppBison.yxx" { // bitfield definition. We ignore the bitfield for now. (yyval.u.inst_ident) = (yyvsp[(1) - (3)].u.inst_ident); } break; - case 143: - -/* Line 1455 of yacc.c */ -#line 1226 "cppBison.yxx" + case 146: +/* Line 1792 of yacc.c */ +#line 1259 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(2) - (3)].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_paren); } break; - case 144: - -/* Line 1455 of yacc.c */ -#line 1231 "cppBison.yxx" + case 147: +/* Line 1792 of yacc.c */ +#line 1264 "dtool/src/cppparser/cppBison.yxx" { push_scope((yyvsp[(1) - (2)].u.inst_ident)->get_scope(current_scope, global_scope)); } break; - case 145: - -/* Line 1455 of yacc.c */ -#line 1235 "cppBison.yxx" + case 148: +/* Line 1792 of yacc.c */ +#line 1268 "dtool/src/cppparser/cppBison.yxx" { pop_scope(); (yyval.u.inst_ident) = (yyvsp[(1) - (6)].u.inst_ident); @@ -4567,177 +4605,158 @@ yyreduce: } break; - case 146: - -/* Line 1455 of yacc.c */ -#line 1253 "cppBison.yxx" + case 149: +/* Line 1792 of yacc.c */ +#line 1286 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.param_list) = new CPPParameterList; } break; - case 147: - -/* Line 1455 of yacc.c */ -#line 1257 "cppBison.yxx" + case 150: +/* Line 1792 of yacc.c */ +#line 1290 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.param_list) = new CPPParameterList; (yyval.u.param_list)->_includes_ellipsis = true; } break; - case 148: - -/* Line 1455 of yacc.c */ -#line 1262 "cppBison.yxx" + case 151: +/* Line 1792 of yacc.c */ +#line 1295 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.param_list) = (yyvsp[(1) - (1)].u.param_list); } break; - case 149: - -/* Line 1455 of yacc.c */ -#line 1266 "cppBison.yxx" + case 152: +/* Line 1792 of yacc.c */ +#line 1299 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.param_list) = (yyvsp[(1) - (3)].u.param_list); (yyval.u.param_list)->_includes_ellipsis = true; } break; - case 150: - -/* Line 1455 of yacc.c */ -#line 1271 "cppBison.yxx" + case 153: +/* Line 1792 of yacc.c */ +#line 1304 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.param_list) = (yyvsp[(1) - (2)].u.param_list); (yyval.u.param_list)->_includes_ellipsis = true; } break; - case 151: - -/* Line 1455 of yacc.c */ -#line 1279 "cppBison.yxx" + case 154: +/* Line 1792 of yacc.c */ +#line 1312 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.param_list) = new CPPParameterList; (yyval.u.param_list)->_parameters.push_back((yyvsp[(1) - (1)].u.instance)); } break; - case 152: - -/* Line 1455 of yacc.c */ -#line 1284 "cppBison.yxx" + case 155: +/* Line 1792 of yacc.c */ +#line 1317 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.param_list) = (yyvsp[(1) - (3)].u.param_list); (yyval.u.param_list)->_parameters.push_back((yyvsp[(3) - (3)].u.instance)); } break; - case 153: - -/* Line 1455 of yacc.c */ -#line 1292 "cppBison.yxx" - { - (yyval.u.expr) = (CPPExpression *)NULL; -} - break; - - case 154: - -/* Line 1455 of yacc.c */ -#line 1296 "cppBison.yxx" - { - (yyval.u.expr) = (yyvsp[(2) - (2)].u.expr); -} - break; - - case 155: - -/* Line 1455 of yacc.c */ -#line 1303 "cppBison.yxx" - { - (yyval.u.expr) = (CPPExpression *)NULL; -} - break; - case 156: - -/* Line 1455 of yacc.c */ -#line 1307 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 1325 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = (yyvsp[(2) - (2)].u.expr); + (yyval.u.expr) = (CPPExpression *)NULL; } break; case 157: - -/* Line 1455 of yacc.c */ -#line 1314 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 1329 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = (CPPExpression *)NULL; + (yyval.u.expr) = (yyvsp[(2) - (2)].u.expr); } break; case 158: - -/* Line 1455 of yacc.c */ -#line 1318 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 1336 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = (CPPExpression *)NULL; } break; case 159: +/* Line 1792 of yacc.c */ +#line 1340 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.expr) = (yyvsp[(2) - (2)].u.expr); +} + break; -/* Line 1455 of yacc.c */ -#line 1322 "cppBison.yxx" + case 160: +/* Line 1792 of yacc.c */ +#line 1347 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = (CPPExpression *)NULL; } break; - case 160: + case 161: +/* Line 1792 of yacc.c */ +#line 1351 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.expr) = (CPPExpression *)NULL; +} + break; -/* Line 1455 of yacc.c */ -#line 1326 "cppBison.yxx" + case 162: +/* Line 1792 of yacc.c */ +#line 1355 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.expr) = (CPPExpression *)NULL; +} + break; + + case 163: +/* Line 1792 of yacc.c */ +#line 1359 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = (yyvsp[(2) - (3)].u.expr); } break; - case 161: - -/* Line 1455 of yacc.c */ -#line 1330 "cppBison.yxx" + case 164: +/* Line 1792 of yacc.c */ +#line 1363 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = (CPPExpression *)NULL; } break; - case 165: - -/* Line 1455 of yacc.c */ -#line 1343 "cppBison.yxx" + case 168: +/* Line 1792 of yacc.c */ +#line 1376 "dtool/src/cppparser/cppBison.yxx" { } break; - case 169: - -/* Line 1455 of yacc.c */ -#line 1352 "cppBison.yxx" + case 172: +/* Line 1792 of yacc.c */ +#line 1385 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.instance) = new CPPInstance((yyvsp[(1) - (3)].u.type), (yyvsp[(2) - (3)].u.inst_ident), 0, (yylsp[(2) - (3)]).file); (yyval.u.instance)->set_initializer((yyvsp[(3) - (3)].u.expr)); } break; - case 170: - -/* Line 1455 of yacc.c */ -#line 1357 "cppBison.yxx" + case 173: +/* Line 1792 of yacc.c */ +#line 1390 "dtool/src/cppparser/cppBison.yxx" { yywarning("Not a type: " + (yyvsp[(1) - (3)].u.identifier)->get_fully_scoped_name(), (yylsp[(1) - (3)])); CPPType *type = @@ -4747,10 +4766,9 @@ yyreduce: } break; - case 171: - -/* Line 1455 of yacc.c */ -#line 1365 "cppBison.yxx" + case 174: +/* Line 1792 of yacc.c */ +#line 1398 "dtool/src/cppparser/cppBison.yxx" { (yyvsp[(3) - (4)].u.inst_ident)->add_modifier(IIT_const); (yyval.u.instance) = new CPPInstance((yyvsp[(2) - (4)].u.type), (yyvsp[(3) - (4)].u.inst_ident), 0, (yylsp[(3) - (4)]).file); @@ -4758,10 +4776,9 @@ yyreduce: } break; - case 172: - -/* Line 1455 of yacc.c */ -#line 1371 "cppBison.yxx" + case 175: +/* Line 1792 of yacc.c */ +#line 1404 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_parameter)); @@ -4770,164 +4787,147 @@ yyreduce: } break; - case 173: - -/* Line 1455 of yacc.c */ -#line 1381 "cppBison.yxx" + case 176: +/* Line 1792 of yacc.c */ +#line 1414 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); } break; - case 174: - -/* Line 1455 of yacc.c */ -#line 1385 "cppBison.yxx" - { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[(1) - (1)].u.identifier)); -} - break; - - case 175: - -/* Line 1455 of yacc.c */ -#line 1389 "cppBison.yxx" - { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[(1) - (1)].u.identifier)); -} - break; - - case 176: - -/* Line 1455 of yacc.c */ -#line 1393 "cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_const); -} - break; - case 177: - -/* Line 1455 of yacc.c */ -#line 1398 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 1418 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_pointer); + (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[(1) - (1)].u.identifier)); } break; case 178: - -/* Line 1455 of yacc.c */ -#line 1403 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 1422 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_reference); + (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[(1) - (1)].u.identifier)); } break; case 179: - -/* Line 1455 of yacc.c */ -#line 1408 "cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[(3) - (3)].u.inst_ident); - (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[(1) - (3)].u.identifier)); -} - break; - - case 180: - -/* Line 1455 of yacc.c */ -#line 1413 "cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[(1) - (4)].u.inst_ident); - (yyval.u.inst_ident)->add_array_modifier((yyvsp[(3) - (4)].u.expr)); -} - break; - - case 181: - -/* Line 1455 of yacc.c */ -#line 1421 "cppBison.yxx" - { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); -} - break; - - case 182: - -/* Line 1455 of yacc.c */ -#line 1425 "cppBison.yxx" - { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[(1) - (1)].u.identifier)); -} - break; - - case 183: - -/* Line 1455 of yacc.c */ -#line 1429 "cppBison.yxx" - { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[(1) - (1)].u.identifier)); -} - break; - - case 184: - -/* Line 1455 of yacc.c */ -#line 1433 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 1426 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_const); } break; - case 185: - -/* Line 1455 of yacc.c */ -#line 1438 "cppBison.yxx" + case 180: +/* Line 1792 of yacc.c */ +#line 1431 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_pointer); } break; - case 186: - -/* Line 1455 of yacc.c */ -#line 1443 "cppBison.yxx" + case 181: +/* Line 1792 of yacc.c */ +#line 1436 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_reference); } break; - case 187: - -/* Line 1455 of yacc.c */ -#line 1448 "cppBison.yxx" + case 182: +/* Line 1792 of yacc.c */ +#line 1441 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(3) - (3)].u.inst_ident); (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[(1) - (3)].u.identifier)); } break; - case 188: - -/* Line 1455 of yacc.c */ -#line 1453 "cppBison.yxx" + case 183: +/* Line 1792 of yacc.c */ +#line 1446 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(1) - (4)].u.inst_ident); (yyval.u.inst_ident)->add_array_modifier((yyvsp[(3) - (4)].u.expr)); } break; - case 189: + case 184: +/* Line 1792 of yacc.c */ +#line 1454 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); +} + break; -/* Line 1455 of yacc.c */ -#line 1458 "cppBison.yxx" + case 185: +/* Line 1792 of yacc.c */ +#line 1458 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[(1) - (1)].u.identifier)); +} + break; + + case 186: +/* Line 1792 of yacc.c */ +#line 1462 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[(1) - (1)].u.identifier)); +} + break; + + case 187: +/* Line 1792 of yacc.c */ +#line 1466 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_const); +} + break; + + case 188: +/* Line 1792 of yacc.c */ +#line 1471 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_pointer); +} + break; + + case 189: +/* Line 1792 of yacc.c */ +#line 1476 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_reference); +} + break; + + case 190: +/* Line 1792 of yacc.c */ +#line 1481 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.inst_ident) = (yyvsp[(3) - (3)].u.inst_ident); + (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[(1) - (3)].u.identifier)); +} + break; + + case 191: +/* Line 1792 of yacc.c */ +#line 1486 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.inst_ident) = (yyvsp[(1) - (4)].u.inst_ident); + (yyval.u.inst_ident)->add_array_modifier((yyvsp[(3) - (4)].u.expr)); +} + break; + + case 192: +/* Line 1792 of yacc.c */ +#line 1491 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(2) - (7)].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_paren); @@ -4935,79 +4935,71 @@ yyreduce: } break; - case 190: - -/* Line 1455 of yacc.c */ -#line 1464 "cppBison.yxx" + case 193: +/* Line 1792 of yacc.c */ +#line 1497 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(2) - (3)].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_paren); } break; - case 191: - -/* Line 1455 of yacc.c */ -#line 1472 "cppBison.yxx" + case 194: +/* Line 1792 of yacc.c */ +#line 1505 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); } break; - case 192: - -/* Line 1455 of yacc.c */ -#line 1476 "cppBison.yxx" + case 195: +/* Line 1792 of yacc.c */ +#line 1509 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_const); } break; - case 193: - -/* Line 1455 of yacc.c */ -#line 1481 "cppBison.yxx" + case 196: +/* Line 1792 of yacc.c */ +#line 1514 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_pointer); } break; - case 194: - -/* Line 1455 of yacc.c */ -#line 1486 "cppBison.yxx" + case 197: +/* Line 1792 of yacc.c */ +#line 1519 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_reference); } break; - case 195: - -/* Line 1455 of yacc.c */ -#line 1491 "cppBison.yxx" + case 198: +/* Line 1792 of yacc.c */ +#line 1524 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(3) - (3)].u.inst_ident); (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[(1) - (3)].u.identifier)); } break; - case 196: - -/* Line 1455 of yacc.c */ -#line 1496 "cppBison.yxx" + case 199: +/* Line 1792 of yacc.c */ +#line 1529 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(1) - (4)].u.inst_ident); (yyval.u.inst_ident)->add_array_modifier((yyvsp[(3) - (4)].u.expr)); } break; - case 197: - -/* Line 1455 of yacc.c */ -#line 1501 "cppBison.yxx" + case 200: +/* Line 1792 of yacc.c */ +#line 1534 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(2) - (7)].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_paren); @@ -5015,95 +5007,66 @@ yyreduce: } break; - case 198: - -/* Line 1455 of yacc.c */ -#line 1510 "cppBison.yxx" + case 201: +/* Line 1792 of yacc.c */ +#line 1543 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.type) = CPPType::new_type((yyvsp[(1) - (1)].u.simple_type)); } break; - case 199: - -/* Line 1455 of yacc.c */ -#line 1514 "cppBison.yxx" + case 202: +/* Line 1792 of yacc.c */ +#line 1547 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.type) = (yyvsp[(1) - (1)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); assert((yyval.u.type) != NULL); } break; - case 200: - -/* Line 1455 of yacc.c */ -#line 1519 "cppBison.yxx" + case 203: +/* Line 1792 of yacc.c */ +#line 1552 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.type) = CPPType::new_type(new CPPTBDType((yyvsp[(2) - (2)].u.identifier))); } break; - case 201: - -/* Line 1455 of yacc.c */ -#line 1523 "cppBison.yxx" - { - (yyval.u.type) = CPPType::new_type((yyvsp[(1) - (1)].u.struct_type)); -} - break; - - case 202: - -/* Line 1455 of yacc.c */ -#line 1527 "cppBison.yxx" - { - (yyval.u.type) = CPPType::new_type((yyvsp[(1) - (1)].u.struct_type)); -} - break; - - case 203: - -/* Line 1455 of yacc.c */ -#line 1531 "cppBison.yxx" - { - (yyval.u.type) = CPPType::new_type((yyvsp[(1) - (1)].u.enum_type)); -} - break; - case 204: - -/* Line 1455 of yacc.c */ -#line 1535 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 1556 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.type) = CPPType::new_type((yyvsp[(1) - (1)].u.enum_type)); + (yyval.u.type) = CPPType::new_type((yyvsp[(1) - (1)].u.struct_type)); } break; case 205: - -/* Line 1455 of yacc.c */ -#line 1539 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 1560 "dtool/src/cppparser/cppBison.yxx" { - CPPType *type = (yyvsp[(2) - (2)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); - if (type != NULL) { - (yyval.u.type) = type; - } else { - CPPExtensionType *et = - CPPType::new_type(new CPPExtensionType((yyvsp[(1) - (2)].u.extension_enum), (yyvsp[(2) - (2)].u.identifier), current_scope, (yylsp[(1) - (2)]).file)) - ->as_extension_type(); - CPPScope *scope = (yyvsp[(2) - (2)].u.identifier)->get_scope(current_scope, global_scope); - if (scope != NULL) { - scope->define_extension_type(et); - } - (yyval.u.type) = et; - } + (yyval.u.type) = CPPType::new_type((yyvsp[(1) - (1)].u.struct_type)); } break; case 206: +/* Line 1792 of yacc.c */ +#line 1564 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.type) = CPPType::new_type((yyvsp[(1) - (1)].u.enum_type)); +} + break; -/* Line 1455 of yacc.c */ -#line 1555 "cppBison.yxx" + case 207: +/* Line 1792 of yacc.c */ +#line 1568 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.type) = CPPType::new_type((yyvsp[(1) - (1)].u.enum_type)); +} + break; + + case 208: +/* Line 1792 of yacc.c */ +#line 1572 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = (yyvsp[(2) - (2)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if (type != NULL) { @@ -5121,74 +5084,86 @@ yyreduce: } break; - case 207: + case 209: +/* Line 1792 of yacc.c */ +#line 1588 "dtool/src/cppparser/cppBison.yxx" + { + CPPType *type = (yyvsp[(2) - (2)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); + if (type != NULL) { + (yyval.u.type) = type; + } else { + CPPExtensionType *et = + CPPType::new_type(new CPPExtensionType((yyvsp[(1) - (2)].u.extension_enum), (yyvsp[(2) - (2)].u.identifier), current_scope, (yylsp[(1) - (2)]).file)) + ->as_extension_type(); + CPPScope *scope = (yyvsp[(2) - (2)].u.identifier)->get_scope(current_scope, global_scope); + if (scope != NULL) { + scope->define_extension_type(et); + } + (yyval.u.type) = et; + } +} + break; -/* Line 1455 of yacc.c */ -#line 1574 "cppBison.yxx" + case 210: +/* Line 1792 of yacc.c */ +#line 1607 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.decl) = CPPType::new_type((yyvsp[(1) - (1)].u.simple_type)); } break; - case 208: - -/* Line 1455 of yacc.c */ -#line 1578 "cppBison.yxx" + case 211: +/* Line 1792 of yacc.c */ +#line 1611 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.decl) = (yyvsp[(1) - (1)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); assert((yyval.u.decl) != NULL); } break; - case 209: - -/* Line 1455 of yacc.c */ -#line 1583 "cppBison.yxx" + case 212: +/* Line 1792 of yacc.c */ +#line 1616 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.decl) = CPPType::new_type(new CPPTBDType((yyvsp[(2) - (2)].u.identifier))); } break; - case 210: - -/* Line 1455 of yacc.c */ -#line 1587 "cppBison.yxx" + case 213: +/* Line 1792 of yacc.c */ +#line 1620 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.decl) = CPPType::new_type((yyvsp[(1) - (1)].u.struct_type)); } break; - case 211: - -/* Line 1455 of yacc.c */ -#line 1591 "cppBison.yxx" + case 214: +/* Line 1792 of yacc.c */ +#line 1624 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.decl) = new CPPTypeDeclaration(CPPType::new_type((yyvsp[(1) - (1)].u.struct_type))); } break; - case 212: - -/* Line 1455 of yacc.c */ -#line 1595 "cppBison.yxx" + case 215: +/* Line 1792 of yacc.c */ +#line 1628 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.decl) = CPPType::new_type((yyvsp[(1) - (1)].u.enum_type)); } break; - case 213: - -/* Line 1455 of yacc.c */ -#line 1599 "cppBison.yxx" + case 216: +/* Line 1792 of yacc.c */ +#line 1632 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.decl) = new CPPTypeDeclaration(CPPType::new_type((yyvsp[(1) - (1)].u.enum_type))); } break; - case 214: - -/* Line 1455 of yacc.c */ -#line 1603 "cppBison.yxx" + case 217: +/* Line 1792 of yacc.c */ +#line 1636 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = (yyvsp[(2) - (2)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if (type != NULL) { @@ -5206,10 +5181,9 @@ yyreduce: } break; - case 215: - -/* Line 1455 of yacc.c */ -#line 1619 "cppBison.yxx" + case 218: +/* Line 1792 of yacc.c */ +#line 1652 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = (yyvsp[(2) - (2)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if (type != NULL) { @@ -5227,38 +5201,34 @@ yyreduce: } break; - case 216: - -/* Line 1455 of yacc.c */ -#line 1638 "cppBison.yxx" + case 219: +/* Line 1792 of yacc.c */ +#line 1671 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.type) = CPPType::new_type((yyvsp[(1) - (1)].u.simple_type)); } break; - case 217: - -/* Line 1455 of yacc.c */ -#line 1642 "cppBison.yxx" + case 220: +/* Line 1792 of yacc.c */ +#line 1675 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.type) = (yyvsp[(1) - (1)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); assert((yyval.u.type) != NULL); } break; - case 218: - -/* Line 1455 of yacc.c */ -#line 1647 "cppBison.yxx" + case 221: +/* Line 1792 of yacc.c */ +#line 1680 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.type) = CPPType::new_type(new CPPTBDType((yyvsp[(2) - (2)].u.identifier))); } break; - case 219: - -/* Line 1455 of yacc.c */ -#line 1651 "cppBison.yxx" + case 222: +/* Line 1792 of yacc.c */ +#line 1684 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = (yyvsp[(2) - (2)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if (type != NULL) { @@ -5276,10 +5246,9 @@ yyreduce: } break; - case 220: - -/* Line 1455 of yacc.c */ -#line 1667 "cppBison.yxx" + case 223: +/* Line 1792 of yacc.c */ +#line 1700 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = (yyvsp[(2) - (2)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if (type != NULL) { @@ -5297,10 +5266,9 @@ yyreduce: } break; - case 221: - -/* Line 1455 of yacc.c */ -#line 1686 "cppBison.yxx" + case 224: +/* Line 1792 of yacc.c */ +#line 1719 "dtool/src/cppparser/cppBison.yxx" { CPPInstance *inst = new CPPInstance((yyvsp[(1) - (2)].u.type), (yyvsp[(2) - (2)].u.inst_ident), 0, (yylsp[(1) - (2)]).file); (yyval.u.type) = inst->_type; @@ -5308,10 +5276,9 @@ yyreduce: } break; - case 222: - -/* Line 1455 of yacc.c */ -#line 1692 "cppBison.yxx" + case 225: +/* Line 1792 of yacc.c */ +#line 1725 "dtool/src/cppparser/cppBison.yxx" { (yyvsp[(3) - (3)].u.inst_ident)->add_modifier(IIT_const); CPPInstance *inst = new CPPInstance((yyvsp[(2) - (3)].u.type), (yyvsp[(3) - (3)].u.inst_ident), 0, (yylsp[(1) - (3)]).file); @@ -5320,10 +5287,9 @@ yyreduce: } break; - case 223: - -/* Line 1455 of yacc.c */ -#line 1702 "cppBison.yxx" + case 226: +/* Line 1792 of yacc.c */ +#line 1735 "dtool/src/cppparser/cppBison.yxx" { CPPVisibility starting_vis = ((yyvsp[(1) - (2)].u.extension_enum) == CPPExtensionType::T_class) ? V_private : V_public; @@ -5339,10 +5305,9 @@ yyreduce: } break; - case 224: - -/* Line 1455 of yacc.c */ -#line 1716 "cppBison.yxx" + case 227: +/* Line 1792 of yacc.c */ +#line 1749 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.struct_type) = current_struct; current_struct->_incomplete = false; @@ -5351,10 +5316,9 @@ yyreduce: } break; - case 225: - -/* Line 1455 of yacc.c */ -#line 1726 "cppBison.yxx" + case 228: +/* Line 1792 of yacc.c */ +#line 1759 "dtool/src/cppparser/cppBison.yxx" { CPPVisibility starting_vis = ((yyvsp[(1) - (2)].u.extension_enum) == CPPExtensionType::T_class) ? V_private : V_public; @@ -5376,10 +5340,9 @@ yyreduce: } break; - case 226: - -/* Line 1455 of yacc.c */ -#line 1746 "cppBison.yxx" + case 229: +/* Line 1792 of yacc.c */ +#line 1779 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.struct_type) = current_struct; current_struct->_incomplete = false; @@ -5388,205 +5351,187 @@ yyreduce: } break; - case 231: - -/* Line 1455 of yacc.c */ -#line 1766 "cppBison.yxx" + case 234: +/* Line 1792 of yacc.c */ +#line 1799 "dtool/src/cppparser/cppBison.yxx" { current_struct->append_derivation((yyvsp[(2) - (2)].u.type), V_public, false); } break; - case 232: - -/* Line 1455 of yacc.c */ -#line 1770 "cppBison.yxx" + case 235: +/* Line 1792 of yacc.c */ +#line 1803 "dtool/src/cppparser/cppBison.yxx" { current_struct->append_derivation((yyvsp[(2) - (2)].u.type), V_protected, false); } break; - case 233: - -/* Line 1455 of yacc.c */ -#line 1774 "cppBison.yxx" + case 236: +/* Line 1792 of yacc.c */ +#line 1807 "dtool/src/cppparser/cppBison.yxx" { current_struct->append_derivation((yyvsp[(2) - (2)].u.type), V_private, false); } break; - case 234: - -/* Line 1455 of yacc.c */ -#line 1778 "cppBison.yxx" - { - current_struct->append_derivation((yyvsp[(3) - (3)].u.type), V_public, true); -} - break; - - case 235: - -/* Line 1455 of yacc.c */ -#line 1782 "cppBison.yxx" - { - current_struct->append_derivation((yyvsp[(3) - (3)].u.type), V_protected, true); -} - break; - - case 236: - -/* Line 1455 of yacc.c */ -#line 1786 "cppBison.yxx" - { - current_struct->append_derivation((yyvsp[(3) - (3)].u.type), V_private, true); -} - break; - case 237: - -/* Line 1455 of yacc.c */ -#line 1790 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 1811 "dtool/src/cppparser/cppBison.yxx" { current_struct->append_derivation((yyvsp[(3) - (3)].u.type), V_public, true); } break; case 238: - -/* Line 1455 of yacc.c */ -#line 1794 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 1815 "dtool/src/cppparser/cppBison.yxx" { current_struct->append_derivation((yyvsp[(3) - (3)].u.type), V_protected, true); } break; case 239: - -/* Line 1455 of yacc.c */ -#line 1798 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 1819 "dtool/src/cppparser/cppBison.yxx" { current_struct->append_derivation((yyvsp[(3) - (3)].u.type), V_private, true); } break; case 240: +/* Line 1792 of yacc.c */ +#line 1823 "dtool/src/cppparser/cppBison.yxx" + { + current_struct->append_derivation((yyvsp[(3) - (3)].u.type), V_public, true); +} + break; -/* Line 1455 of yacc.c */ -#line 1805 "cppBison.yxx" + case 241: +/* Line 1792 of yacc.c */ +#line 1827 "dtool/src/cppparser/cppBison.yxx" + { + current_struct->append_derivation((yyvsp[(3) - (3)].u.type), V_protected, true); +} + break; + + case 242: +/* Line 1792 of yacc.c */ +#line 1831 "dtool/src/cppparser/cppBison.yxx" + { + current_struct->append_derivation((yyvsp[(3) - (3)].u.type), V_private, true); +} + break; + + case 243: +/* Line 1792 of yacc.c */ +#line 1838 "dtool/src/cppparser/cppBison.yxx" { current_enum = new CPPEnumType(NULL, current_scope, (yylsp[(1) - (2)]).file); } break; - case 241: - -/* Line 1455 of yacc.c */ -#line 1809 "cppBison.yxx" + case 244: +/* Line 1792 of yacc.c */ +#line 1842 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.enum_type) = current_enum; current_enum = NULL; } break; - case 242: - -/* Line 1455 of yacc.c */ -#line 1817 "cppBison.yxx" + case 245: +/* Line 1792 of yacc.c */ +#line 1850 "dtool/src/cppparser/cppBison.yxx" { current_enum = new CPPEnumType((yyvsp[(2) - (3)].u.identifier), current_scope, (yylsp[(1) - (3)]).file); } break; - case 243: - -/* Line 1455 of yacc.c */ -#line 1821 "cppBison.yxx" + case 246: +/* Line 1792 of yacc.c */ +#line 1854 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.enum_type) = current_enum; current_enum = NULL; } break; - case 247: - -/* Line 1455 of yacc.c */ -#line 1835 "cppBison.yxx" - { - assert(current_enum != NULL); - current_enum->add_element((yyvsp[(1) - (1)].u.identifier)->get_simple_name(), current_scope); -} - break; - case 248: - -/* Line 1455 of yacc.c */ -#line 1840 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 1863 "dtool/src/cppparser/cppBison.yxx" { assert(current_enum != NULL); - current_enum->add_element((yyvsp[(1) - (3)].u.identifier)->get_simple_name(), current_scope, (yyvsp[(3) - (3)].u.expr)); + CPPInstance *inst = current_enum->add_element((yyvsp[(2) - (3)].u.identifier)->get_simple_name()); + current_scope->add_enum_value(inst, current_lexer, (yylsp[(2) - (3)])); } break; case 249: - -/* Line 1455 of yacc.c */ -#line 1845 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 1869 "dtool/src/cppparser/cppBison.yxx" { assert(current_enum != NULL); - current_enum->add_element((yyvsp[(3) - (3)].u.identifier)->get_simple_name(), current_scope); -} - break; - - case 250: - -/* Line 1455 of yacc.c */ -#line 1850 "cppBison.yxx" - { - assert(current_enum != NULL); - current_enum->add_element((yyvsp[(3) - (5)].u.identifier)->get_simple_name(), current_scope, (yyvsp[(5) - (5)].u.expr)); + CPPInstance *inst = current_enum->add_element((yyvsp[(2) - (5)].u.identifier)->get_simple_name(), (yyvsp[(4) - (5)].u.expr)); + current_scope->add_enum_value(inst, current_lexer, (yylsp[(2) - (5)])); } break; case 251: +/* Line 1792 of yacc.c */ +#line 1878 "dtool/src/cppparser/cppBison.yxx" + { + assert(current_enum != NULL); + CPPInstance *inst = current_enum->add_element((yyvsp[(2) - (2)].u.identifier)->get_simple_name()); + current_scope->add_enum_value(inst, current_lexer, (yylsp[(2) - (2)])); +} + break; -/* Line 1455 of yacc.c */ -#line 1858 "cppBison.yxx" + case 252: +/* Line 1792 of yacc.c */ +#line 1884 "dtool/src/cppparser/cppBison.yxx" + { + assert(current_enum != NULL); + CPPInstance *inst = current_enum->add_element((yyvsp[(2) - (4)].u.identifier)->get_simple_name(), (yyvsp[(4) - (4)].u.expr)); + current_scope->add_enum_value(inst, current_lexer, (yylsp[(2) - (4)])); +} + break; + + case 253: +/* Line 1792 of yacc.c */ +#line 1893 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.extension_enum) = CPPExtensionType::T_enum; } break; - case 252: - -/* Line 1455 of yacc.c */ -#line 1865 "cppBison.yxx" + case 254: +/* Line 1792 of yacc.c */ +#line 1900 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.extension_enum) = CPPExtensionType::T_class; } break; - case 253: - -/* Line 1455 of yacc.c */ -#line 1869 "cppBison.yxx" + case 255: +/* Line 1792 of yacc.c */ +#line 1904 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.extension_enum) = CPPExtensionType::T_struct; } break; - case 254: - -/* Line 1455 of yacc.c */ -#line 1873 "cppBison.yxx" + case 256: +/* Line 1792 of yacc.c */ +#line 1908 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.extension_enum) = CPPExtensionType::T_union; } break; - case 255: - -/* Line 1455 of yacc.c */ -#line 1880 "cppBison.yxx" + case 257: +/* Line 1792 of yacc.c */ +#line 1915 "dtool/src/cppparser/cppBison.yxx" { CPPScope *scope = (yyvsp[(2) - (3)].u.identifier)->find_scope(current_scope, global_scope, current_lexer); if (scope == NULL) { @@ -5606,19 +5551,17 @@ yyreduce: } break; - case 256: - -/* Line 1455 of yacc.c */ -#line 1898 "cppBison.yxx" + case 258: +/* Line 1792 of yacc.c */ +#line 1933 "dtool/src/cppparser/cppBison.yxx" { pop_scope(); } break; - case 258: - -/* Line 1455 of yacc.c */ -#line 1906 "cppBison.yxx" + case 260: +/* Line 1792 of yacc.c */ +#line 1941 "dtool/src/cppparser/cppBison.yxx" { CPPUsing *using_decl = new CPPUsing((yyvsp[(2) - (2)].u.identifier), false, (yylsp[(1) - (2)]).file); current_scope->add_declaration(using_decl, global_scope, current_lexer, (yylsp[(1) - (2)])); @@ -5626,10 +5569,9 @@ yyreduce: } break; - case 259: - -/* Line 1455 of yacc.c */ -#line 1912 "cppBison.yxx" + case 261: +/* Line 1792 of yacc.c */ +#line 1947 "dtool/src/cppparser/cppBison.yxx" { CPPUsing *using_decl = new CPPUsing((yyvsp[(3) - (3)].u.identifier), true, (yylsp[(1) - (3)]).file); current_scope->add_declaration(using_decl, global_scope, current_lexer, (yylsp[(1) - (3)])); @@ -5637,106 +5579,95 @@ yyreduce: } break; - case 263: - -/* Line 1455 of yacc.c */ -#line 1927 "cppBison.yxx" + case 265: +/* Line 1792 of yacc.c */ +#line 1962 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_bool); } break; - case 264: - -/* Line 1455 of yacc.c */ -#line 1931 "cppBison.yxx" + case 266: +/* Line 1792 of yacc.c */ +#line 1966 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_char); } break; - case 265: - -/* Line 1455 of yacc.c */ -#line 1935 "cppBison.yxx" + case 267: +/* Line 1792 of yacc.c */ +#line 1970 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_wchar_t); } break; - case 266: - -/* Line 1455 of yacc.c */ -#line 1939 "cppBison.yxx" + case 268: +/* Line 1792 of yacc.c */ +#line 1974 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_short); } break; - case 267: - -/* Line 1455 of yacc.c */ -#line 1944 "cppBison.yxx" + case 269: +/* Line 1792 of yacc.c */ +#line 1979 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_long); } break; - case 268: - -/* Line 1455 of yacc.c */ -#line 1949 "cppBison.yxx" + case 270: +/* Line 1792 of yacc.c */ +#line 1984 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_longlong); } break; - case 269: - -/* Line 1455 of yacc.c */ -#line 1954 "cppBison.yxx" + case 271: +/* Line 1792 of yacc.c */ +#line 1989 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_unsigned); } break; - case 270: - -/* Line 1455 of yacc.c */ -#line 1959 "cppBison.yxx" + case 272: +/* Line 1792 of yacc.c */ +#line 1994 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_signed); } break; - case 271: - -/* Line 1455 of yacc.c */ -#line 1964 "cppBison.yxx" + case 273: +/* Line 1792 of yacc.c */ +#line 1999 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int); } break; - case 272: - -/* Line 1455 of yacc.c */ -#line 1968 "cppBison.yxx" + case 274: +/* Line 1792 of yacc.c */ +#line 2003 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = (yyvsp[(2) - (2)].u.simple_type); (yyval.u.simple_type)->_flags |= CPPSimpleType::F_short; } break; - case 273: - -/* Line 1455 of yacc.c */ -#line 1973 "cppBison.yxx" + case 275: +/* Line 1792 of yacc.c */ +#line 2008 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = (yyvsp[(2) - (2)].u.simple_type); if ((yyval.u.simple_type)->_flags & CPPSimpleType::F_long) { @@ -5747,294 +5678,261 @@ yyreduce: } break; - case 274: - -/* Line 1455 of yacc.c */ -#line 1982 "cppBison.yxx" + case 276: +/* Line 1792 of yacc.c */ +#line 2017 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = (yyvsp[(2) - (2)].u.simple_type); (yyval.u.simple_type)->_flags |= CPPSimpleType::F_unsigned; } break; - case 275: - -/* Line 1455 of yacc.c */ -#line 1987 "cppBison.yxx" + case 277: +/* Line 1792 of yacc.c */ +#line 2022 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = (yyvsp[(2) - (2)].u.simple_type); (yyval.u.simple_type)->_flags |= CPPSimpleType::F_signed; } break; - case 276: - -/* Line 1455 of yacc.c */ -#line 1995 "cppBison.yxx" + case 278: +/* Line 1792 of yacc.c */ +#line 2030 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_float); } break; - case 277: - -/* Line 1455 of yacc.c */ -#line 1999 "cppBison.yxx" + case 279: +/* Line 1792 of yacc.c */ +#line 2034 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_float, CPPSimpleType::F_long); } break; - case 278: - -/* Line 1455 of yacc.c */ -#line 2004 "cppBison.yxx" + case 280: +/* Line 1792 of yacc.c */ +#line 2039 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_double); } break; - case 279: - -/* Line 1455 of yacc.c */ -#line 2008 "cppBison.yxx" + case 281: +/* Line 1792 of yacc.c */ +#line 2043 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_float, CPPSimpleType::F_longlong); } break; - case 280: - -/* Line 1455 of yacc.c */ -#line 2013 "cppBison.yxx" + case 282: +/* Line 1792 of yacc.c */ +#line 2048 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_double, CPPSimpleType::F_long); } break; - case 281: - -/* Line 1455 of yacc.c */ -#line 2021 "cppBison.yxx" + case 283: +/* Line 1792 of yacc.c */ +#line 2056 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_void); } break; - case 282: - -/* Line 1455 of yacc.c */ -#line 2030 "cppBison.yxx" + case 284: +/* Line 1792 of yacc.c */ +#line 2065 "dtool/src/cppparser/cppBison.yxx" { current_lexer->_resolve_identifiers = false; } break; - case 283: - -/* Line 1455 of yacc.c */ -#line 2034 "cppBison.yxx" + case 285: +/* Line 1792 of yacc.c */ +#line 2069 "dtool/src/cppparser/cppBison.yxx" { current_lexer->_resolve_identifiers = true; } break; - case 286: - -/* Line 1455 of yacc.c */ -#line 2046 "cppBison.yxx" - { -} - break; - - case 287: - -/* Line 1455 of yacc.c */ -#line 2049 "cppBison.yxx" - { -} - break; - case 288: - -/* Line 1455 of yacc.c */ -#line 2052 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 2081 "dtool/src/cppparser/cppBison.yxx" { } break; case 289: - -/* Line 1455 of yacc.c */ -#line 2055 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 2084 "dtool/src/cppparser/cppBison.yxx" { } break; case 290: - -/* Line 1455 of yacc.c */ -#line 2058 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 2087 "dtool/src/cppparser/cppBison.yxx" { } break; case 291: - -/* Line 1455 of yacc.c */ -#line 2061 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 2090 "dtool/src/cppparser/cppBison.yxx" { } break; case 292: - -/* Line 1455 of yacc.c */ -#line 2064 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 2093 "dtool/src/cppparser/cppBison.yxx" { } break; case 293: - -/* Line 1455 of yacc.c */ -#line 2067 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 2096 "dtool/src/cppparser/cppBison.yxx" { } break; - case 367: - -/* Line 1455 of yacc.c */ -#line 2087 "cppBison.yxx" + case 294: +/* Line 1792 of yacc.c */ +#line 2099 "dtool/src/cppparser/cppBison.yxx" { } break; - case 391: - -/* Line 1455 of yacc.c */ -#line 2096 "cppBison.yxx" + case 295: +/* Line 1792 of yacc.c */ +#line 2102 "dtool/src/cppparser/cppBison.yxx" + { +} + break; + + case 368: +/* Line 1792 of yacc.c */ +#line 2122 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = (CPPExpression *)NULL; } break; case 392: - -/* Line 1455 of yacc.c */ -#line 2100 "cppBison.yxx" - { - (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); -} - break; - - case 393: - -/* Line 1455 of yacc.c */ -#line 2107 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 2131 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = (CPPExpression *)NULL; } break; - case 394: - -/* Line 1455 of yacc.c */ -#line 2111 "cppBison.yxx" + case 393: +/* Line 1792 of yacc.c */ +#line 2135 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); } break; - case 395: + case 394: +/* Line 1792 of yacc.c */ +#line 2142 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.expr) = (CPPExpression *)NULL; +} + break; -/* Line 1455 of yacc.c */ -#line 2118 "cppBison.yxx" + case 395: +/* Line 1792 of yacc.c */ +#line 2146 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); } break; case 396: - -/* Line 1455 of yacc.c */ -#line 2122 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(',', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); -} - break; - - case 397: - -/* Line 1455 of yacc.c */ -#line 2129 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 2153 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); } break; - case 398: + case 397: +/* Line 1792 of yacc.c */ +#line 2157 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.expr) = new CPPExpression(',', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); +} + break; -/* Line 1455 of yacc.c */ -#line 2133 "cppBison.yxx" + case 398: +/* Line 1792 of yacc.c */ +#line 2164 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); +} + break; + + case 399: +/* Line 1792 of yacc.c */ +#line 2168 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(2) - (4)].u.type), (yyvsp[(4) - (4)].u.expr))); } break; - case 399: - -/* Line 1455 of yacc.c */ -#line 2137 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(3) - (7)].u.type), (yyvsp[(6) - (7)].u.expr))); -} - break; - case 400: - -/* Line 1455 of yacc.c */ -#line 2141 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 2172 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(3) - (7)].u.type), (yyvsp[(6) - (7)].u.expr))); } break; case 401: +/* Line 1792 of yacc.c */ +#line 2176 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(3) - (7)].u.type), (yyvsp[(6) - (7)].u.expr))); +} + break; -/* Line 1455 of yacc.c */ -#line 2145 "cppBison.yxx" + case 402: +/* Line 1792 of yacc.c */ +#line 2180 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_func((yyvsp[(3) - (4)].u.type))); } break; - case 402: - -/* Line 1455 of yacc.c */ -#line 2149 "cppBison.yxx" + case 403: +/* Line 1792 of yacc.c */ +#line 2184 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(UNARY_NOT, (yyvsp[(2) - (2)].u.expr)); } break; - case 403: - -/* Line 1455 of yacc.c */ -#line 2153 "cppBison.yxx" + case 404: +/* Line 1792 of yacc.c */ +#line 2188 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(UNARY_NEGATE, (yyvsp[(2) - (2)].u.expr)); } break; - case 404: - -/* Line 1455 of yacc.c */ -#line 2157 "cppBison.yxx" + case 405: +/* Line 1792 of yacc.c */ +#line 2192 "dtool/src/cppparser/cppBison.yxx" { if ((yyvsp[(2) - (2)].u.expr)->_type == CPPExpression::T_integer) { (yyval.u.expr) = (yyvsp[(2) - (2)].u.expr); @@ -6048,271 +5946,241 @@ yyreduce: } break; - case 405: - -/* Line 1455 of yacc.c */ -#line 2169 "cppBison.yxx" + case 406: +/* Line 1792 of yacc.c */ +#line 2204 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(UNARY_STAR, (yyvsp[(2) - (2)].u.expr)); } break; - case 406: - -/* Line 1455 of yacc.c */ -#line 2173 "cppBison.yxx" + case 407: +/* Line 1792 of yacc.c */ +#line 2208 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(UNARY_REF, (yyvsp[(2) - (2)].u.expr)); } break; - case 407: - -/* Line 1455 of yacc.c */ -#line 2177 "cppBison.yxx" + case 408: +/* Line 1792 of yacc.c */ +#line 2212 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('*', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 408: - -/* Line 1455 of yacc.c */ -#line 2181 "cppBison.yxx" + case 409: +/* Line 1792 of yacc.c */ +#line 2216 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('/', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 409: - -/* Line 1455 of yacc.c */ -#line 2185 "cppBison.yxx" + case 410: +/* Line 1792 of yacc.c */ +#line 2220 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('%', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 410: - -/* Line 1455 of yacc.c */ -#line 2189 "cppBison.yxx" + case 411: +/* Line 1792 of yacc.c */ +#line 2224 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('+', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 411: - -/* Line 1455 of yacc.c */ -#line 2193 "cppBison.yxx" + case 412: +/* Line 1792 of yacc.c */ +#line 2228 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('-', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 412: - -/* Line 1455 of yacc.c */ -#line 2197 "cppBison.yxx" + case 413: +/* Line 1792 of yacc.c */ +#line 2232 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('|', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 413: - -/* Line 1455 of yacc.c */ -#line 2201 "cppBison.yxx" + case 414: +/* Line 1792 of yacc.c */ +#line 2236 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('^', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 414: - -/* Line 1455 of yacc.c */ -#line 2205 "cppBison.yxx" + case 415: +/* Line 1792 of yacc.c */ +#line 2240 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('&', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 415: - -/* Line 1455 of yacc.c */ -#line 2209 "cppBison.yxx" + case 416: +/* Line 1792 of yacc.c */ +#line 2244 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(OROR, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 416: - -/* Line 1455 of yacc.c */ -#line 2213 "cppBison.yxx" + case 417: +/* Line 1792 of yacc.c */ +#line 2248 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(ANDAND, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 417: - -/* Line 1455 of yacc.c */ -#line 2217 "cppBison.yxx" + case 418: +/* Line 1792 of yacc.c */ +#line 2252 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(EQCOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 418: - -/* Line 1455 of yacc.c */ -#line 2221 "cppBison.yxx" + case 419: +/* Line 1792 of yacc.c */ +#line 2256 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(NECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 419: - -/* Line 1455 of yacc.c */ -#line 2225 "cppBison.yxx" + case 420: +/* Line 1792 of yacc.c */ +#line 2260 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(LECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 420: - -/* Line 1455 of yacc.c */ -#line 2229 "cppBison.yxx" + case 421: +/* Line 1792 of yacc.c */ +#line 2264 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(GECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 421: - -/* Line 1455 of yacc.c */ -#line 2233 "cppBison.yxx" + case 422: +/* Line 1792 of yacc.c */ +#line 2268 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(LSHIFT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 422: - -/* Line 1455 of yacc.c */ -#line 2237 "cppBison.yxx" + case 423: +/* Line 1792 of yacc.c */ +#line 2272 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(RSHIFT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 423: - -/* Line 1455 of yacc.c */ -#line 2241 "cppBison.yxx" + case 424: +/* Line 1792 of yacc.c */ +#line 2276 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('?', (yyvsp[(1) - (5)].u.expr), (yyvsp[(3) - (5)].u.expr), (yyvsp[(5) - (5)].u.expr)); } break; - case 424: - -/* Line 1455 of yacc.c */ -#line 2245 "cppBison.yxx" + case 425: +/* Line 1792 of yacc.c */ +#line 2280 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('[', (yyvsp[(1) - (4)].u.expr), (yyvsp[(3) - (4)].u.expr)); } break; - case 425: - -/* Line 1455 of yacc.c */ -#line 2249 "cppBison.yxx" + case 426: +/* Line 1792 of yacc.c */ +#line 2284 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('f', (yyvsp[(1) - (4)].u.expr), (yyvsp[(3) - (4)].u.expr)); } break; - case 426: - -/* Line 1455 of yacc.c */ -#line 2253 "cppBison.yxx" + case 427: +/* Line 1792 of yacc.c */ +#line 2288 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('f', (yyvsp[(1) - (3)].u.expr)); } break; - case 427: - -/* Line 1455 of yacc.c */ -#line 2257 "cppBison.yxx" + case 428: +/* Line 1792 of yacc.c */ +#line 2292 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('.', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 428: - -/* Line 1455 of yacc.c */ -#line 2261 "cppBison.yxx" + case 429: +/* Line 1792 of yacc.c */ +#line 2296 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 429: - -/* Line 1455 of yacc.c */ -#line 2265 "cppBison.yxx" + case 430: +/* Line 1792 of yacc.c */ +#line 2300 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = (yyvsp[(2) - (3)].u.expr); } break; - case 430: - -/* Line 1455 of yacc.c */ -#line 2273 "cppBison.yxx" + case 431: +/* Line 1792 of yacc.c */ +#line 2308 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); } break; - case 431: - -/* Line 1455 of yacc.c */ -#line 2277 "cppBison.yxx" + case 432: +/* Line 1792 of yacc.c */ +#line 2312 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(2) - (4)].u.type), (yyvsp[(4) - (4)].u.expr))); } break; - case 432: - -/* Line 1455 of yacc.c */ -#line 2281 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(3) - (7)].u.type), (yyvsp[(6) - (7)].u.expr))); -} - break; - case 433: - -/* Line 1455 of yacc.c */ -#line 2285 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 2316 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(3) - (7)].u.type), (yyvsp[(6) - (7)].u.expr))); } break; case 434: +/* Line 1792 of yacc.c */ +#line 2320 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(3) - (7)].u.type), (yyvsp[(6) - (7)].u.expr))); +} + break; -/* Line 1455 of yacc.c */ -#line 2289 "cppBison.yxx" + case 435: +/* Line 1792 of yacc.c */ +#line 2324 "dtool/src/cppparser/cppBison.yxx" { // A constructor call. CPPType *type = (yyvsp[(1) - (4)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); @@ -6321,10 +6189,9 @@ yyreduce: } break; - case 435: - -/* Line 1455 of yacc.c */ -#line 2296 "cppBison.yxx" + case 436: +/* Line 1792 of yacc.c */ +#line 2331 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int)); @@ -6332,10 +6199,9 @@ yyreduce: } break; - case 436: - -/* Line 1455 of yacc.c */ -#line 2302 "cppBison.yxx" + case 437: +/* Line 1792 of yacc.c */ +#line 2337 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_char)); @@ -6343,10 +6209,9 @@ yyreduce: } break; - case 437: - -/* Line 1455 of yacc.c */ -#line 2308 "cppBison.yxx" + case 438: +/* Line 1792 of yacc.c */ +#line 2343 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_wchar_t)); @@ -6354,10 +6219,9 @@ yyreduce: } break; - case 438: - -/* Line 1455 of yacc.c */ -#line 2314 "cppBison.yxx" + case 439: +/* Line 1792 of yacc.c */ +#line 2349 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_bool)); @@ -6365,10 +6229,9 @@ yyreduce: } break; - case 439: - -/* Line 1455 of yacc.c */ -#line 2320 "cppBison.yxx" + case 440: +/* Line 1792 of yacc.c */ +#line 2355 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int, @@ -6377,10 +6240,9 @@ yyreduce: } break; - case 440: - -/* Line 1455 of yacc.c */ -#line 2327 "cppBison.yxx" + case 441: +/* Line 1792 of yacc.c */ +#line 2362 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int, @@ -6389,10 +6251,9 @@ yyreduce: } break; - case 441: - -/* Line 1455 of yacc.c */ -#line 2334 "cppBison.yxx" + case 442: +/* Line 1792 of yacc.c */ +#line 2369 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int, @@ -6401,10 +6262,9 @@ yyreduce: } break; - case 442: - -/* Line 1455 of yacc.c */ -#line 2341 "cppBison.yxx" + case 443: +/* Line 1792 of yacc.c */ +#line 2376 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int, @@ -6413,10 +6273,9 @@ yyreduce: } break; - case 443: - -/* Line 1455 of yacc.c */ -#line 2348 "cppBison.yxx" + case 444: +/* Line 1792 of yacc.c */ +#line 2383 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_float)); @@ -6424,10 +6283,9 @@ yyreduce: } break; - case 444: - -/* Line 1455 of yacc.c */ -#line 2354 "cppBison.yxx" + case 445: +/* Line 1792 of yacc.c */ +#line 2389 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_double)); @@ -6435,55 +6293,49 @@ yyreduce: } break; - case 445: - -/* Line 1455 of yacc.c */ -#line 2360 "cppBison.yxx" + case 446: +/* Line 1792 of yacc.c */ +#line 2395 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_func((yyvsp[(3) - (4)].u.type))); } break; - case 446: - -/* Line 1455 of yacc.c */ -#line 2364 "cppBison.yxx" + case 447: +/* Line 1792 of yacc.c */ +#line 2399 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[(2) - (2)].u.type))); } break; - case 447: - -/* Line 1455 of yacc.c */ -#line 2368 "cppBison.yxx" + case 448: +/* Line 1792 of yacc.c */ +#line 2403 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[(2) - (5)].u.type), (yyvsp[(4) - (5)].u.expr))); } break; - case 448: - -/* Line 1455 of yacc.c */ -#line 2372 "cppBison.yxx" + case 449: +/* Line 1792 of yacc.c */ +#line 2407 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(UNARY_NOT, (yyvsp[(2) - (2)].u.expr)); } break; - case 449: - -/* Line 1455 of yacc.c */ -#line 2376 "cppBison.yxx" + case 450: +/* Line 1792 of yacc.c */ +#line 2411 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(UNARY_NEGATE, (yyvsp[(2) - (2)].u.expr)); } break; - case 450: - -/* Line 1455 of yacc.c */ -#line 2380 "cppBison.yxx" + case 451: +/* Line 1792 of yacc.c */ +#line 2415 "dtool/src/cppparser/cppBison.yxx" { if ((yyvsp[(2) - (2)].u.expr)->_type == CPPExpression::T_integer) { (yyval.u.expr) = (yyvsp[(2) - (2)].u.expr); @@ -6497,397 +6349,353 @@ yyreduce: } break; - case 451: - -/* Line 1455 of yacc.c */ -#line 2392 "cppBison.yxx" + case 452: +/* Line 1792 of yacc.c */ +#line 2427 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(UNARY_STAR, (yyvsp[(2) - (2)].u.expr)); } break; - case 452: - -/* Line 1455 of yacc.c */ -#line 2396 "cppBison.yxx" + case 453: +/* Line 1792 of yacc.c */ +#line 2431 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(UNARY_REF, (yyvsp[(2) - (2)].u.expr)); } break; - case 453: - -/* Line 1455 of yacc.c */ -#line 2400 "cppBison.yxx" + case 454: +/* Line 1792 of yacc.c */ +#line 2435 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('*', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 454: - -/* Line 1455 of yacc.c */ -#line 2404 "cppBison.yxx" + case 455: +/* Line 1792 of yacc.c */ +#line 2439 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('/', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 455: - -/* Line 1455 of yacc.c */ -#line 2408 "cppBison.yxx" + case 456: +/* Line 1792 of yacc.c */ +#line 2443 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('%', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 456: - -/* Line 1455 of yacc.c */ -#line 2412 "cppBison.yxx" + case 457: +/* Line 1792 of yacc.c */ +#line 2447 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('+', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 457: - -/* Line 1455 of yacc.c */ -#line 2416 "cppBison.yxx" + case 458: +/* Line 1792 of yacc.c */ +#line 2451 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('-', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 458: - -/* Line 1455 of yacc.c */ -#line 2420 "cppBison.yxx" + case 459: +/* Line 1792 of yacc.c */ +#line 2455 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('|', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 459: - -/* Line 1455 of yacc.c */ -#line 2424 "cppBison.yxx" + case 460: +/* Line 1792 of yacc.c */ +#line 2459 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('^', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 460: - -/* Line 1455 of yacc.c */ -#line 2428 "cppBison.yxx" + case 461: +/* Line 1792 of yacc.c */ +#line 2463 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('&', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 461: - -/* Line 1455 of yacc.c */ -#line 2432 "cppBison.yxx" + case 462: +/* Line 1792 of yacc.c */ +#line 2467 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(OROR, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 462: - -/* Line 1455 of yacc.c */ -#line 2436 "cppBison.yxx" + case 463: +/* Line 1792 of yacc.c */ +#line 2471 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(ANDAND, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 463: - -/* Line 1455 of yacc.c */ -#line 2440 "cppBison.yxx" + case 464: +/* Line 1792 of yacc.c */ +#line 2475 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(EQCOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 464: - -/* Line 1455 of yacc.c */ -#line 2444 "cppBison.yxx" + case 465: +/* Line 1792 of yacc.c */ +#line 2479 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(NECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 465: - -/* Line 1455 of yacc.c */ -#line 2448 "cppBison.yxx" + case 466: +/* Line 1792 of yacc.c */ +#line 2483 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(LECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 466: - -/* Line 1455 of yacc.c */ -#line 2452 "cppBison.yxx" + case 467: +/* Line 1792 of yacc.c */ +#line 2487 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(GECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 467: - -/* Line 1455 of yacc.c */ -#line 2456 "cppBison.yxx" + case 468: +/* Line 1792 of yacc.c */ +#line 2491 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('<', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 468: - -/* Line 1455 of yacc.c */ -#line 2460 "cppBison.yxx" + case 469: +/* Line 1792 of yacc.c */ +#line 2495 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('>', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 469: - -/* Line 1455 of yacc.c */ -#line 2464 "cppBison.yxx" + case 470: +/* Line 1792 of yacc.c */ +#line 2499 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(LSHIFT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 470: - -/* Line 1455 of yacc.c */ -#line 2468 "cppBison.yxx" + case 471: +/* Line 1792 of yacc.c */ +#line 2503 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(RSHIFT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 471: - -/* Line 1455 of yacc.c */ -#line 2472 "cppBison.yxx" + case 472: +/* Line 1792 of yacc.c */ +#line 2507 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('?', (yyvsp[(1) - (5)].u.expr), (yyvsp[(3) - (5)].u.expr), (yyvsp[(5) - (5)].u.expr)); } break; - case 472: - -/* Line 1455 of yacc.c */ -#line 2476 "cppBison.yxx" + case 473: +/* Line 1792 of yacc.c */ +#line 2511 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('[', (yyvsp[(1) - (4)].u.expr), (yyvsp[(3) - (4)].u.expr)); } break; - case 473: - -/* Line 1455 of yacc.c */ -#line 2480 "cppBison.yxx" + case 474: +/* Line 1792 of yacc.c */ +#line 2515 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('f', (yyvsp[(1) - (4)].u.expr), (yyvsp[(3) - (4)].u.expr)); } break; - case 474: - -/* Line 1455 of yacc.c */ -#line 2484 "cppBison.yxx" + case 475: +/* Line 1792 of yacc.c */ +#line 2519 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('f', (yyvsp[(1) - (3)].u.expr)); } break; - case 475: - -/* Line 1455 of yacc.c */ -#line 2488 "cppBison.yxx" + case 476: +/* Line 1792 of yacc.c */ +#line 2523 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('.', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 476: - -/* Line 1455 of yacc.c */ -#line 2492 "cppBison.yxx" + case 477: +/* Line 1792 of yacc.c */ +#line 2527 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 477: - -/* Line 1455 of yacc.c */ -#line 2496 "cppBison.yxx" + case 478: +/* Line 1792 of yacc.c */ +#line 2531 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = (yyvsp[(2) - (3)].u.expr); } break; - case 478: - -/* Line 1455 of yacc.c */ -#line 2503 "cppBison.yxx" + case 479: +/* Line 1792 of yacc.c */ +#line 2538 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.integer)); } break; - case 479: - -/* Line 1455 of yacc.c */ -#line 2507 "cppBison.yxx" + case 480: +/* Line 1792 of yacc.c */ +#line 2542 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(true); } break; - case 480: - -/* Line 1455 of yacc.c */ -#line 2511 "cppBison.yxx" + case 481: +/* Line 1792 of yacc.c */ +#line 2546 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(false); } break; - case 481: - -/* Line 1455 of yacc.c */ -#line 2515 "cppBison.yxx" + case 482: +/* Line 1792 of yacc.c */ +#line 2550 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.integer)); } break; - case 482: - -/* Line 1455 of yacc.c */ -#line 2519 "cppBison.yxx" + case 483: +/* Line 1792 of yacc.c */ +#line 2554 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.real)); } break; - case 483: - -/* Line 1455 of yacc.c */ -#line 2523 "cppBison.yxx" + case 484: +/* Line 1792 of yacc.c */ +#line 2558 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].str)); } break; - case 484: - -/* Line 1455 of yacc.c */ -#line 2527 "cppBison.yxx" + case 485: +/* Line 1792 of yacc.c */ +#line 2562 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.identifier), current_scope, global_scope, current_lexer); } break; - case 485: - -/* Line 1455 of yacc.c */ -#line 2541 "cppBison.yxx" + case 486: +/* Line 1792 of yacc.c */ +#line 2576 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); } break; - case 486: - -/* Line 1455 of yacc.c */ -#line 2545 "cppBison.yxx" + case 487: +/* Line 1792 of yacc.c */ +#line 2580 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(2) - (4)].u.type), (yyvsp[(4) - (4)].u.expr))); } break; - case 487: - -/* Line 1455 of yacc.c */ -#line 2549 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(3) - (7)].u.type), (yyvsp[(6) - (7)].u.expr))); -} - break; - case 488: - -/* Line 1455 of yacc.c */ -#line 2553 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 2584 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(3) - (7)].u.type), (yyvsp[(6) - (7)].u.expr))); } break; case 489: +/* Line 1792 of yacc.c */ +#line 2588 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(3) - (7)].u.type), (yyvsp[(6) - (7)].u.expr))); +} + break; -/* Line 1455 of yacc.c */ -#line 2557 "cppBison.yxx" + case 490: +/* Line 1792 of yacc.c */ +#line 2592 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_func((yyvsp[(3) - (4)].u.type))); } break; - case 490: - -/* Line 1455 of yacc.c */ -#line 2561 "cppBison.yxx" + case 491: +/* Line 1792 of yacc.c */ +#line 2596 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[(2) - (2)].u.type))); } break; - case 491: - -/* Line 1455 of yacc.c */ -#line 2565 "cppBison.yxx" + case 492: +/* Line 1792 of yacc.c */ +#line 2600 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[(2) - (5)].u.type), (yyvsp[(4) - (5)].u.expr))); } break; - case 492: - -/* Line 1455 of yacc.c */ -#line 2569 "cppBison.yxx" + case 493: +/* Line 1792 of yacc.c */ +#line 2604 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(UNARY_NOT, (yyvsp[(2) - (2)].u.expr)); } break; - case 493: - -/* Line 1455 of yacc.c */ -#line 2573 "cppBison.yxx" + case 494: +/* Line 1792 of yacc.c */ +#line 2608 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(UNARY_NEGATE, (yyvsp[(2) - (2)].u.expr)); } break; - case 494: - -/* Line 1455 of yacc.c */ -#line 2577 "cppBison.yxx" + case 495: +/* Line 1792 of yacc.c */ +#line 2612 "dtool/src/cppparser/cppBison.yxx" { if ((yyvsp[(2) - (2)].u.expr)->_type == CPPExpression::T_integer) { (yyval.u.expr) = (yyvsp[(2) - (2)].u.expr); @@ -6901,298 +6709,265 @@ yyreduce: } break; - case 495: - -/* Line 1455 of yacc.c */ -#line 2589 "cppBison.yxx" + case 496: +/* Line 1792 of yacc.c */ +#line 2624 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(UNARY_REF, (yyvsp[(2) - (2)].u.expr)); } break; - case 496: - -/* Line 1455 of yacc.c */ -#line 2593 "cppBison.yxx" + case 497: +/* Line 1792 of yacc.c */ +#line 2628 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('*', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 497: - -/* Line 1455 of yacc.c */ -#line 2597 "cppBison.yxx" + case 498: +/* Line 1792 of yacc.c */ +#line 2632 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('/', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 498: - -/* Line 1455 of yacc.c */ -#line 2601 "cppBison.yxx" + case 499: +/* Line 1792 of yacc.c */ +#line 2636 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('%', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 499: - -/* Line 1455 of yacc.c */ -#line 2605 "cppBison.yxx" + case 500: +/* Line 1792 of yacc.c */ +#line 2640 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('+', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 500: - -/* Line 1455 of yacc.c */ -#line 2609 "cppBison.yxx" + case 501: +/* Line 1792 of yacc.c */ +#line 2644 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('-', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 501: - -/* Line 1455 of yacc.c */ -#line 2613 "cppBison.yxx" + case 502: +/* Line 1792 of yacc.c */ +#line 2648 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('|', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 502: - -/* Line 1455 of yacc.c */ -#line 2617 "cppBison.yxx" + case 503: +/* Line 1792 of yacc.c */ +#line 2652 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('^', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 503: - -/* Line 1455 of yacc.c */ -#line 2621 "cppBison.yxx" + case 504: +/* Line 1792 of yacc.c */ +#line 2656 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('&', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 504: - -/* Line 1455 of yacc.c */ -#line 2625 "cppBison.yxx" + case 505: +/* Line 1792 of yacc.c */ +#line 2660 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(OROR, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 505: - -/* Line 1455 of yacc.c */ -#line 2629 "cppBison.yxx" + case 506: +/* Line 1792 of yacc.c */ +#line 2664 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(ANDAND, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 506: - -/* Line 1455 of yacc.c */ -#line 2633 "cppBison.yxx" + case 507: +/* Line 1792 of yacc.c */ +#line 2668 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(EQCOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 507: - -/* Line 1455 of yacc.c */ -#line 2637 "cppBison.yxx" + case 508: +/* Line 1792 of yacc.c */ +#line 2672 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(NECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 508: - -/* Line 1455 of yacc.c */ -#line 2641 "cppBison.yxx" + case 509: +/* Line 1792 of yacc.c */ +#line 2676 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(LECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 509: - -/* Line 1455 of yacc.c */ -#line 2645 "cppBison.yxx" + case 510: +/* Line 1792 of yacc.c */ +#line 2680 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(GECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 510: - -/* Line 1455 of yacc.c */ -#line 2649 "cppBison.yxx" + case 511: +/* Line 1792 of yacc.c */ +#line 2684 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('<', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 511: - -/* Line 1455 of yacc.c */ -#line 2653 "cppBison.yxx" + case 512: +/* Line 1792 of yacc.c */ +#line 2688 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('>', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 512: - -/* Line 1455 of yacc.c */ -#line 2657 "cppBison.yxx" + case 513: +/* Line 1792 of yacc.c */ +#line 2692 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(LSHIFT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 513: - -/* Line 1455 of yacc.c */ -#line 2661 "cppBison.yxx" + case 514: +/* Line 1792 of yacc.c */ +#line 2696 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(RSHIFT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 514: - -/* Line 1455 of yacc.c */ -#line 2665 "cppBison.yxx" + case 515: +/* Line 1792 of yacc.c */ +#line 2700 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('?', (yyvsp[(1) - (5)].u.expr), (yyvsp[(3) - (5)].u.expr), (yyvsp[(5) - (5)].u.expr)); } break; - case 515: - -/* Line 1455 of yacc.c */ -#line 2669 "cppBison.yxx" + case 516: +/* Line 1792 of yacc.c */ +#line 2704 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('[', (yyvsp[(1) - (4)].u.expr), (yyvsp[(3) - (4)].u.expr)); } break; - case 516: - -/* Line 1455 of yacc.c */ -#line 2673 "cppBison.yxx" + case 517: +/* Line 1792 of yacc.c */ +#line 2708 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('f', (yyvsp[(1) - (4)].u.expr), (yyvsp[(3) - (4)].u.expr)); } break; - case 517: - -/* Line 1455 of yacc.c */ -#line 2677 "cppBison.yxx" + case 518: +/* Line 1792 of yacc.c */ +#line 2712 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('f', (yyvsp[(1) - (3)].u.expr)); } break; - case 518: - -/* Line 1455 of yacc.c */ -#line 2681 "cppBison.yxx" + case 519: +/* Line 1792 of yacc.c */ +#line 2716 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression('.', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 519: - -/* Line 1455 of yacc.c */ -#line 2685 "cppBison.yxx" + case 520: +/* Line 1792 of yacc.c */ +#line 2720 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; - case 520: - -/* Line 1455 of yacc.c */ -#line 2689 "cppBison.yxx" + case 521: +/* Line 1792 of yacc.c */ +#line 2724 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = (yyvsp[(2) - (3)].u.expr); } break; - case 521: - -/* Line 1455 of yacc.c */ -#line 2696 "cppBison.yxx" + case 522: +/* Line 1792 of yacc.c */ +#line 2731 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.integer)); } break; - case 522: - -/* Line 1455 of yacc.c */ -#line 2700 "cppBison.yxx" + case 523: +/* Line 1792 of yacc.c */ +#line 2735 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(true); } break; - case 523: - -/* Line 1455 of yacc.c */ -#line 2704 "cppBison.yxx" + case 524: +/* Line 1792 of yacc.c */ +#line 2739 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression(false); } break; - case 524: - -/* Line 1455 of yacc.c */ -#line 2708 "cppBison.yxx" + case 525: +/* Line 1792 of yacc.c */ +#line 2743 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.integer)); } break; - case 525: - -/* Line 1455 of yacc.c */ -#line 2712 "cppBison.yxx" + case 526: +/* Line 1792 of yacc.c */ +#line 2747 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.real)); } break; - case 526: - -/* Line 1455 of yacc.c */ -#line 2716 "cppBison.yxx" + case 527: +/* Line 1792 of yacc.c */ +#line 2751 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].str)); } break; - case 527: - -/* Line 1455 of yacc.c */ -#line 2723 "cppBison.yxx" + case 528: +/* Line 1792 of yacc.c */ +#line 2758 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = (yyvsp[(1) - (1)].u.identifier)->find_type(current_scope, global_scope, true); if (type == NULL) { @@ -7202,10 +6977,9 @@ yyreduce: } break; - case 528: - -/* Line 1455 of yacc.c */ -#line 2731 "cppBison.yxx" + case 529: +/* Line 1792 of yacc.c */ +#line 2766 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = (yyvsp[(2) - (2)].u.identifier)->find_type(current_scope, global_scope, true, current_lexer); if (type == NULL) { @@ -7215,57 +6989,62 @@ yyreduce: } break; - case 529: - -/* Line 1455 of yacc.c */ -#line 2739 "cppBison.yxx" + case 530: +/* Line 1792 of yacc.c */ +#line 2774 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.type) = CPPType::new_type(new CPPTBDType((yyvsp[(2) - (2)].u.identifier))); } break; - case 530: - -/* Line 1455 of yacc.c */ -#line 2762 "cppBison.yxx" - { - (yyval.u.identifier) = (yyvsp[(1) - (1)].u.identifier); -} - break; - case 531: - -/* Line 1455 of yacc.c */ -#line 2766 "cppBison.yxx" +/* Line 1792 of yacc.c */ +#line 2797 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.identifier) = (yyvsp[(1) - (1)].u.identifier); } break; case 532: +/* Line 1792 of yacc.c */ +#line 2801 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.identifier) = (yyvsp[(1) - (1)].u.identifier); +} + break; -/* Line 1455 of yacc.c */ -#line 2773 "cppBison.yxx" + case 533: +/* Line 1792 of yacc.c */ +#line 2808 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = (yyvsp[(1) - (1)].str); } break; - case 533: - -/* Line 1455 of yacc.c */ -#line 2777 "cppBison.yxx" + case 534: +/* Line 1792 of yacc.c */ +#line 2812 "dtool/src/cppparser/cppBison.yxx" { (yyval.str) = (yyvsp[(1) - (2)].str) + (yyvsp[(2) - (2)].str); } break; - -/* Line 1455 of yacc.c */ -#line 7267 "y.tab.c" +/* Line 1792 of yacc.c */ +#line 7035 "built/tmp/cppBison.yxx.c" default: break; } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); @@ -7294,6 +7073,10 @@ yyreduce: | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); + /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { @@ -7301,41 +7084,40 @@ yyerrlab: #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else +# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ + yyssp, yytoken) { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); - } - else - { - yyerror (YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = YYSYNTAX_ERROR; + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == 1) + { + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); + if (!yymsg) + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = 2; + } + else + { + yysyntax_error_status = YYSYNTAX_ERROR; + yymsgp = yymsg; + } + } + yyerror (yymsgp); + if (yysyntax_error_status == 2) + goto yyexhaustedlab; } +# undef YYSYNTAX_ERROR #endif } - yyerror_range[0] = yylloc; + yyerror_range[1] = yylloc; if (yyerrstatus == 3) { @@ -7372,7 +7154,7 @@ yyerrorlab: if (/*CONSTCOND*/ 0) goto yyerrorlab; - yyerror_range[0] = yylsp[1-yylen]; + yyerror_range[1] = yylsp[1-yylen]; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ YYPOPSTACK (yylen); @@ -7391,7 +7173,7 @@ yyerrlab1: for (;;) { yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) + if (!yypact_value_is_default (yyn)) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) @@ -7406,7 +7188,7 @@ yyerrlab1: if (yyssp == yyss) YYABORT; - yyerror_range[0] = *yylsp; + yyerror_range[1] = *yylsp; yydestruct ("Error: popping", yystos[yystate], yyvsp, yylsp); YYPOPSTACK (1); @@ -7414,12 +7196,14 @@ yyerrlab1: YY_STACK_PRINT (yyss, yyssp); } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END - yyerror_range[1] = yylloc; + yyerror_range[2] = yylloc; /* Using YYLLOC is tempting, but would change the location of the lookahead. YYLOC is available though. */ - YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); + YYLLOC_DEFAULT (yyloc, yyerror_range, 2); *++yylsp = yyloc; /* Shift the error token. */ @@ -7443,7 +7227,7 @@ yyabortlab: yyresult = 1; goto yyreturn; -#if !defined(yyoverflow) || YYERROR_VERBOSE +#if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ @@ -7455,8 +7239,13 @@ yyexhaustedlab: yyreturn: if (yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, &yylloc); + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval, &yylloc); + } /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); @@ -7480,4 +7269,3 @@ yyreturn: } - diff --git a/dtool/src/cppparser/cppBison.h.prebuilt b/dtool/src/cppparser/cppBison.h.prebuilt index 1012cdf2c8..98ec997d2e 100644 --- a/dtool/src/cppparser/cppBison.h.prebuilt +++ b/dtool/src/cppparser/cppBison.h.prebuilt @@ -1,10 +1,8 @@ +/* A Bison parser, made by GNU Bison 2.7. */ -/* A Bison parser, made by GNU Bison 2.4.1. */ - -/* Skeleton interface for Bison's Yacc-like parsers in C +/* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,6 +30,15 @@ This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ +#ifndef YY_CPPYY_BUILT_TMP_CPPBISON_YXX_H_INCLUDED +# define YY_CPPYY_BUILT_TMP_CPPBISON_YXX_H_INCLUDED +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int cppyydebug; +#endif /* Tokens. */ #ifndef YYTOKENTYPE @@ -79,35 +86,35 @@ XOREQUAL = 295, LSHIFTEQUAL = 296, RSHIFTEQUAL = 297, - TOKENPASTE = 298, - KW_BEGIN_PUBLISH = 299, - KW_BLOCKING = 300, - KW_BOOL = 301, - KW_CATCH = 302, - KW_CHAR = 303, - KW_WCHAR_T = 304, - KW_CLASS = 305, - KW_CONST = 306, - KW_DELETE = 307, - KW_DOUBLE = 308, - KW_DYNAMIC_CAST = 309, - KW_ELSE = 310, - KW_END_PUBLISH = 311, - KW_ENUM = 312, - KW_EXTENSION = 313, - KW_EXTERN = 314, - KW_EXPLICIT = 315, - KW_PUBLISHED = 316, - KW_FALSE = 317, - KW_FLOAT = 318, - KW_FRIEND = 319, - KW_FOR = 320, - KW_GOTO = 321, - KW_IF = 322, - KW_INLINE = 323, - KW_INT = 324, - KW_LONG = 325, - KW_LONGLONG = 326, + KW_BEGIN_PUBLISH = 298, + KW_BLOCKING = 299, + KW_BOOL = 300, + KW_CATCH = 301, + KW_CHAR = 302, + KW_WCHAR_T = 303, + KW_CLASS = 304, + KW_CONST = 305, + KW_DELETE = 306, + KW_DOUBLE = 307, + KW_DYNAMIC_CAST = 308, + KW_ELSE = 309, + KW_END_PUBLISH = 310, + KW_ENUM = 311, + KW_EXTENSION = 312, + KW_EXTERN = 313, + KW_EXPLICIT = 314, + KW_PUBLISHED = 315, + KW_FALSE = 316, + KW_FLOAT = 317, + KW_FRIEND = 318, + KW_FOR = 319, + KW_GOTO = 320, + KW_IF = 321, + KW_INLINE = 322, + KW_INT = 323, + KW_LONG = 324, + KW_LONGLONG = 325, + KW_MAKE_PROPERTY = 326, KW_MAKE_SEQ = 327, KW_MUTABLE = 328, KW_NAMESPACE = 329, @@ -183,35 +190,35 @@ #define XOREQUAL 295 #define LSHIFTEQUAL 296 #define RSHIFTEQUAL 297 -#define TOKENPASTE 298 -#define KW_BEGIN_PUBLISH 299 -#define KW_BLOCKING 300 -#define KW_BOOL 301 -#define KW_CATCH 302 -#define KW_CHAR 303 -#define KW_WCHAR_T 304 -#define KW_CLASS 305 -#define KW_CONST 306 -#define KW_DELETE 307 -#define KW_DOUBLE 308 -#define KW_DYNAMIC_CAST 309 -#define KW_ELSE 310 -#define KW_END_PUBLISH 311 -#define KW_ENUM 312 -#define KW_EXTENSION 313 -#define KW_EXTERN 314 -#define KW_EXPLICIT 315 -#define KW_PUBLISHED 316 -#define KW_FALSE 317 -#define KW_FLOAT 318 -#define KW_FRIEND 319 -#define KW_FOR 320 -#define KW_GOTO 321 -#define KW_IF 322 -#define KW_INLINE 323 -#define KW_INT 324 -#define KW_LONG 325 -#define KW_LONGLONG 326 +#define KW_BEGIN_PUBLISH 298 +#define KW_BLOCKING 299 +#define KW_BOOL 300 +#define KW_CATCH 301 +#define KW_CHAR 302 +#define KW_WCHAR_T 303 +#define KW_CLASS 304 +#define KW_CONST 305 +#define KW_DELETE 306 +#define KW_DOUBLE 307 +#define KW_DYNAMIC_CAST 308 +#define KW_ELSE 309 +#define KW_END_PUBLISH 310 +#define KW_ENUM 311 +#define KW_EXTENSION 312 +#define KW_EXTERN 313 +#define KW_EXPLICIT 314 +#define KW_PUBLISHED 315 +#define KW_FALSE 316 +#define KW_FLOAT 317 +#define KW_FRIEND 318 +#define KW_FOR 319 +#define KW_GOTO 320 +#define KW_IF 321 +#define KW_INLINE 322 +#define KW_INT 323 +#define KW_LONG 324 +#define KW_LONGLONG 325 +#define KW_MAKE_PROPERTY 326 #define KW_MAKE_SEQ 327 #define KW_MUTABLE 328 #define KW_NAMESPACE 329 @@ -247,15 +254,12 @@ - #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif - - #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED typedef struct YYLTYPE { @@ -270,4 +274,18 @@ typedef struct YYLTYPE #endif +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int cppyyparse (void *YYPARSE_PARAM); +#else +int cppyyparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int cppyyparse (void); +#else +int cppyyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ +#endif /* !YY_CPPYY_BUILT_TMP_CPPBISON_YXX_H_INCLUDED */ From 0e785de0ff180736d09c0cb0799357dd99ca825a Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 20 Sep 2014 20:51:40 +0000 Subject: [PATCH 49/52] Fix crash in do_issue_scissor --- panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 11 ++++++++--- panda/src/glstuff/glGraphicsStateGuardian_src.h | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 3dea898c7b..0050471808 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -310,6 +310,8 @@ CLP(GraphicsStateGuardian)(GraphicsEngine *engine, GraphicsPipe *pipe) : _check_errors = gl_check_errors; _force_flush = gl_force_flush; + _scissor_enabled = false; + #ifdef DO_PSTATS if (gl_finish) { GLCAT.warning() @@ -2371,8 +2373,10 @@ prepare_display_region(DisplayRegionPipelineReader *dr) { if (dr->get_scissor_enabled()) { glEnable(GL_SCISSOR_TEST); + _scissor_enabled = true; } else { glDisable(GL_SCISSOR_TEST); + _scissor_enabled = false; } if (_supports_viewport_arrays) { @@ -11378,12 +11382,14 @@ do_issue_scissor() { const ScissorAttrib *target_scissor = DCAST(ScissorAttrib, _target_rs->get_attrib_def(ScissorAttrib::get_class_slot())); if (target_scissor->is_off()) { - if (_current_display_region->get_scissor_enabled()) { + if (_scissor_enabled) { glDisable(GL_SCISSOR_TEST); + _scissor_enabled = false; } } else { - if (!_current_display_region->get_scissor_enabled()) { + if (!_scissor_enabled) { glEnable(GL_SCISSOR_TEST); + _scissor_enabled = true; } const LVecBase4 &frame = target_scissor->get_frame(); @@ -11393,7 +11399,6 @@ do_issue_scissor() { int width = (int)(_viewport_width * (frame[1] - frame[0]) + 0.5f); int height = (int)(_viewport_height * (frame[3] - frame[2]) + 0.5f); - glEnable(GL_SCISSOR_TEST); glScissor(x, y, width, height); } } diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.h b/panda/src/glstuff/glGraphicsStateGuardian_src.h index 6eba1a7632..e7cfa3001c 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.h +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.h @@ -529,6 +529,7 @@ protected: PN_stdfloat _point_size; bool _point_perspective; bool _vertex_blending_enabled; + bool _scissor_enabled; #ifndef OPENGLES_1 PT(Shader) _current_shader; From db7a6561f283b5fb400a0c7ab82a8117db179ae8 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 21 Sep 2014 13:22:52 +0000 Subject: [PATCH 50/52] When finding comment for an enum, don't accidentally pick up a same-line comment of an enum value on the preceding line --- dtool/src/cppparser/cppScope.cxx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/dtool/src/cppparser/cppScope.cxx b/dtool/src/cppparser/cppScope.cxx index eb8008583b..8ca9babad4 100644 --- a/dtool/src/cppparser/cppScope.cxx +++ b/dtool/src/cppparser/cppScope.cxx @@ -151,12 +151,25 @@ add_enum_value(CPPInstance *inst, CPPPreprocessor *preprocessor, if (inst->_leading_comment == (CPPCommentBlock *)NULL) { // Same-line comment? - inst->_leading_comment = + CPPCommentBlock *comment = preprocessor->get_comment_on(pos.first_line, pos.file); - if (inst->_leading_comment == (CPPCommentBlock *)NULL) { - inst->_leading_comment = + if (comment == (CPPCommentBlock *)NULL) { + // Nope. Check for a comment before this line. + comment = preprocessor->get_comment_before(pos.first_line, pos.file); + + if (comment != NULL) { + // This is a bit of a hack, but it prevents us from picking + // up a same-line comment from the previous line. + if (comment->_line_number != pos.first_line - 1 || + comment->_col_number <= pos.first_column) { + + inst->_leading_comment = comment; + } + } + } else { + inst->_leading_comment = comment; } } From 162786ae3b4772a03c8bb5f08732029877c71239 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 21 Sep 2014 13:27:08 +0000 Subject: [PATCH 51/52] Forgot to change these cases of _x_size and _y_size --- panda/src/dxgsg8/wdxGraphicsBuffer8.cxx | 9 ++++----- panda/src/dxgsg9/wdxGraphicsBuffer9.cxx | 25 ++++++++++++------------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/panda/src/dxgsg8/wdxGraphicsBuffer8.cxx b/panda/src/dxgsg8/wdxGraphicsBuffer8.cxx index 8d5c8bb77e..9b0c28b7b1 100644 --- a/panda/src/dxgsg8/wdxGraphicsBuffer8.cxx +++ b/panda/src/dxgsg8/wdxGraphicsBuffer8.cxx @@ -229,14 +229,13 @@ rebuild_bitplanes() { // Decide how big the bitplanes should be. if ((_host != 0)&&(_creation_flags & GraphicsPipe::BF_size_track_host)) { - if ((_host->get_x_size() != _x_size)|| - (_host->get_y_size() != _y_size)) { + if (_host->get_size() != _size) { set_size_and_recalc(_host->get_x_size(), _host->get_y_size()); } } - int bitplane_x = _x_size; - int bitplane_y = _y_size; + int bitplane_x = get_x_size(); + int bitplane_y = get_y_size(); if (Texture::get_textures_power_2() != ATS_none) { bitplane_x = Texture::up_to_power_2(bitplane_x); bitplane_y = Texture::up_to_power_2(bitplane_y); @@ -350,7 +349,7 @@ rebuild_bitplanes() { << "Unable to re-create texture " << *depth_ctx->get_texture() << endl; return false; } - + if (depth_tex->get_texture_type() == Texture::TT_2d_texture) { depth_d3d_tex = depth_ctx->_d3d_2d_texture; nassertr(depth_d3d_tex != 0, false); diff --git a/panda/src/dxgsg9/wdxGraphicsBuffer9.cxx b/panda/src/dxgsg9/wdxGraphicsBuffer9.cxx index 646a016185..f393987726 100644 --- a/panda/src/dxgsg9/wdxGraphicsBuffer9.cxx +++ b/panda/src/dxgsg9/wdxGraphicsBuffer9.cxx @@ -276,25 +276,24 @@ rebuild_bitplanes() { IDirect3DSurface9 *color_surf = 0; IDirect3DSurface9 *depth_surf = 0; DWORD render_target_index; - + render_target_index = 0; - + // Decide how big the bitplanes should be. if ((_host != 0)&&(_creation_flags & GraphicsPipe::BF_size_track_host)) { - if ((_host->get_x_size() != _x_size)|| - (_host->get_y_size() != _y_size)) { + if (_host->get_size() != _size) { set_size_and_recalc(_host->get_x_size(), _host->get_y_size()); } } - int bitplane_x = _x_size; - int bitplane_y = _y_size; + int bitplane_x = get_x_size(); + int bitplane_y = get_y_size(); if (Texture::get_textures_power_2() != ATS_none) { bitplane_x = Texture::up_to_power_2(bitplane_x); bitplane_y = Texture::up_to_power_2(bitplane_y); } - + // Find the color and depth textures. Either may be present, // or neither. // @@ -342,7 +341,7 @@ rebuild_bitplanes() { } break; } - } + } } } @@ -373,7 +372,7 @@ rebuild_bitplanes() { _color_backing_store = NULL; } color_tex = get_texture(color_tex_index); - color_tex->set_size_padded(_x_size, _y_size); + color_tex->set_size_padded(get_x_size(), get_y_size()); // color_tex->set_format(Texture::F_rgba); color_ctx = DCAST(DXTextureContext9, @@ -445,14 +444,14 @@ rebuild_bitplanes() { _depth_backing_store = NULL; } - if (_shared_depth_buffer) { + if (_shared_depth_buffer) { depth_tex = _shared_depth_buffer -> get_texture(depth_tex_index); } - if (depth_tex == 0) { + if (depth_tex == 0) { depth_tex = get_texture(depth_tex_index); } - depth_tex->set_size_padded(_x_size, _y_size); + depth_tex->set_size_padded(get_x_size(), get_y_size()); depth_tex->set_format(Texture::F_depth_stencil); depth_ctx = DCAST(DXTextureContext9, @@ -855,7 +854,7 @@ share_depth_buffer(GraphicsOutput *graphics_output) { if (_debug) { printf ("share_depth_buffer\n"); } - + // check buffer sizes if (this -> get_x_size() != input_graphics_output -> get_x_size()) { if (_debug) { From 778b4390f46c9f7cf0fda7db70173067e99c53b3 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 21 Sep 2014 13:37:32 +0000 Subject: [PATCH 52/52] Temporary fix for Python 3 compilation error --- dtool/src/interrogate/interfaceMakerPythonNative.cxx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index eb25546d83..931eb6cc47 100755 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -3234,14 +3234,9 @@ write_function_instance(ostream &out, InterfaceMaker::Object *obj, ++num_params; } else if (TypeManager::is_integer(type)) { - if (args_type == AT_single_arg) { - pexpr_string = "(" + type->get_local_name(&parser) + ")PyInt_AS_LONG(arg)"; - extra_param_check += " && PyInt_Check(arg)"; - } else { - indent(out, indent_level) << "int " << param_name << ";\n"; - format_specifiers += "i"; - parameter_list += ", &" + param_name; - } + indent(out, indent_level) << "int " << param_name << ";\n"; + format_specifiers += "i"; + parameter_list += ", &" + param_name; expected_params += "int"; only_pyobjects = false; ++num_params;