From 5dcaac9c750ff841bc7c63f44887e1e5201c46bc Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 3 Jul 2016 09:17:43 +0200 Subject: [PATCH 001/112] Map size_t to int if possible. Fixes regression with __len__(). --- dtool/src/interrogatedb/py_panda.I | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dtool/src/interrogatedb/py_panda.I b/dtool/src/interrogatedb/py_panda.I index 3b171f14c7..0a06358beb 100644 --- a/dtool/src/interrogatedb/py_panda.I +++ b/dtool/src/interrogatedb/py_panda.I @@ -107,7 +107,15 @@ ALWAYS_INLINE PyObject *Dtool_WrapValue(long long value) { } ALWAYS_INLINE PyObject *Dtool_WrapValue(unsigned long long value) { + // size_t is sometimes defined as unsigned long long, and we want to map + // that to int in Python 2 so it can be returned from a __len__. +#if PY_MAJOR_VERSION >= 3 return PyLong_FromUnsignedLongLong(value); +#else + return (value > LONG_MAX) + ? PyLong_FromUnsignedLongLong(value) + : PyInt_FromLong((long)value); +#endif } ALWAYS_INLINE PyObject *Dtool_WrapValue(bool value) { From f35a7612e5bd5f02e9202088cfe8e1d218053e02 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 3 Jul 2016 09:20:55 +0200 Subject: [PATCH 002/112] Fix interrogate error with PhysX --- panda/src/physx/physxFileStream.h | 1 + 1 file changed, 1 insertion(+) diff --git a/panda/src/physx/physxFileStream.h b/panda/src/physx/physxFileStream.h index a8cc858b1b..5b7682c9e0 100644 --- a/panda/src/physx/physxFileStream.h +++ b/panda/src/physx/physxFileStream.h @@ -17,6 +17,7 @@ #include "pandabase.h" #include "virtualFile.h" #include "filename.h" +#include #include "physx_includes.h" From fd8dd360b2c8600a29c7146c28befe7856288193 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 9 Jul 2016 09:59:51 +0200 Subject: [PATCH 003/112] Fix compile error statically linking build with DX9 --- panda/src/framework/pandaFramework.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/framework/pandaFramework.cxx b/panda/src/framework/pandaFramework.cxx index 2f886bae29..ba5e023d40 100644 --- a/panda/src/framework/pandaFramework.cxx +++ b/panda/src/framework/pandaFramework.cxx @@ -96,7 +96,7 @@ open_framework(int &argc, char **&argv) { extern EXPCL_PANDAGL void init_libpandagl(); init_libpandagl(); #elif defined(HAVE_DX9) - extern EXPCL_PANDADX9 void init_libpandadx9(); + extern EXPCL_PANDADX void init_libpandadx9(); init_libpandadx9(); #elif defined(HAVE_TINYDISPLAY) extern EXPCL_TINYDISPLAY void init_libtinydisplay(); From 47d1b4e220e4e3e78748dafe12830a936b055139 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 9 Jul 2016 10:02:55 +0200 Subject: [PATCH 004/112] PythonTask: don't crash if repr(owner) errors, deal better with bad owners --- panda/src/event/pythonTask.cxx | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/panda/src/event/pythonTask.cxx b/panda/src/event/pythonTask.cxx index 88070bdb28..3408f98e2c 100644 --- a/panda/src/event/pythonTask.cxx +++ b/panda/src/event/pythonTask.cxx @@ -214,6 +214,19 @@ get_upon_death() { //////////////////////////////////////////////////////////////////// void PythonTask:: set_owner(PyObject *owner) { +#ifndef NDEBUG + if (owner != Py_None) { + PyObject *add = PyObject_GetAttrString(owner, "_addTask"); + PyObject *clear = PyObject_GetAttrString(owner, "_clearTask"); + + if (add == NULL || !PyCallable_Check(add) || + clear == NULL || !PyCallable_Check(clear)) { + Dtool_Raise_TypeError("owner object should have _addTask and _clearTask methods"); + return; + } + } +#endif + if (_owner != NULL && _owner != Py_None && _state != S_inactive) { unregister_from_owner(); } @@ -546,10 +559,16 @@ do_python_task() { ostringstream strm; #if PY_MAJOR_VERSION >= 3 PyObject *str = PyObject_ASCII(result); + if (str == NULL) { + str = PyUnicode_FromString(""); + } strm << *this << " returned " << PyUnicode_AsUTF8(str); #else PyObject *str = PyObject_Repr(result); + if (str == NULL) { + str = PyString_FromString(""); + } strm << *this << " returned " << PyString_AsString(str); #endif @@ -672,18 +691,9 @@ call_owner_method(const char *method_name) { if (_owner != Py_None) { PyObject *func = PyObject_GetAttrString(_owner, (char *)method_name); if (func == (PyObject *)NULL) { -#if PY_MAJOR_VERSION >= 3 - PyObject *str = PyObject_ASCII(_owner); task_cat.error() - << "Owner object " << PyUnicode_AsUTF8(str) << " added to " - << *this << " has no method " << method_name << "().\n"; -#else - PyObject *str = PyObject_Repr(_owner); - task_cat.error() - << "Owner object " << PyString_AsString(str) << " added to " - << *this << " has no method " << method_name << "().\n"; -#endif - Py_DECREF(str); + << "Owner object added to " << *this << " has no method " + << method_name << "().\n"; } else { call_function(func); From 11861cb73d7d52a9e831a1654d8769c89ac85e9f Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 9 Jul 2016 14:27:33 +0200 Subject: [PATCH 005/112] Backport shadow-depth-bits config var to 1.9 --- doc/ReleaseNotes | 1 + panda/src/display/config_display.cxx | 6 ++++++ panda/src/display/config_display.h | 1 + panda/src/display/graphicsStateGuardian.cxx | 14 +++++++++----- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index 3a02861ab3..19191e3e06 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -17,6 +17,7 @@ This issue fixes several bugs that were still found in 1.9.2. * Improve performance of texture load and store operations * Fix crashes with pbuffers on Intel cards on Windows * Support for Autodesk Maya 2016.5 +* Add shadow-depth-bits config var to control shadow map depth ------------------------ RELEASE 1.9.2 ------------------------ diff --git a/panda/src/display/config_display.cxx b/panda/src/display/config_display.cxx index 0d219273e5..255a2cd482 100644 --- a/panda/src/display/config_display.cxx +++ b/panda/src/display/config_display.cxx @@ -445,6 +445,12 @@ ConfigVariableDouble pixel_zoom ("pixel-zoom", 1.0, PRC_DESC("The default pixel_zoom factor for new windows.")); +ConfigVariableInt shadow_depth_bits +("shadow-depth-bits", 1, + PRC_DESC("The minimum number of depth buffer bits requested when rendering " + "shadow maps. Set this to 32 for more depth resolution in shadow " + "maps.")); + ConfigVariableColor background_color ("background-color", "0.41 0.41 0.41 0.0", PRC_DESC("Specifies the rgb(a) value of the default background color for a " diff --git a/panda/src/display/config_display.h b/panda/src/display/config_display.h index be71d0b63d..23afbf578f 100644 --- a/panda/src/display/config_display.h +++ b/panda/src/display/config_display.h @@ -102,6 +102,7 @@ extern EXPCL_PANDA_DISPLAY ConfigVariableInt stencil_bits; extern EXPCL_PANDA_DISPLAY ConfigVariableInt accum_bits; extern EXPCL_PANDA_DISPLAY ConfigVariableInt multisamples; extern EXPCL_PANDA_DISPLAY ConfigVariableInt back_buffers; +extern EXPCL_PANDA_DISPLAY ConfigVariableInt shadow_depth_bits; extern EXPCL_PANDA_DISPLAY ConfigVariableDouble pixel_zoom; diff --git a/panda/src/display/graphicsStateGuardian.cxx b/panda/src/display/graphicsStateGuardian.cxx index 5faf282e53..22a2caf498 100644 --- a/panda/src/display/graphicsStateGuardian.cxx +++ b/panda/src/display/graphicsStateGuardian.cxx @@ -3176,13 +3176,17 @@ make_shadow_buffer(const NodePath &light_np, GraphicsOutputBase *host) { nassertr(light->_sbuffers.count(this) == 0, NULL); - display_cat.debug() << "Constructing shadow buffer for light '" << light->get_name() - << "', size=" << light->_sb_xsize << "x" << light->_sb_ysize - << ", sort=" << light->_sb_sort << "\n"; + if (display_cat.is_debug()) { + display_cat.debug() + << "Constructing shadow buffer for light '" << light->get_name() + << "', size=" << light->_sb_xsize << "x" << light->_sb_ysize + << ", sort=" << light->_sb_sort << "\n"; + } - // Setup some flags and properties + // Determine the properties for creating the depth buffer. FrameBufferProperties fbp; - fbp.set_depth_bits(1); // We only need depth + fbp.set_depth_bits(shadow_depth_bits); + WindowProperties props = WindowProperties::size(light->_sb_xsize, light->_sb_ysize); int flags = GraphicsPipe::BF_refuse_window; if (is_point) { From 44d59edc30168fb663b3f20b3fc28701ebe7f326 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 9 Jul 2016 14:42:25 +0200 Subject: [PATCH 006/112] Fix cube map render and rendering the same camera with two GSGs The problem was that the cull result was being reused across different lens indices and GSGs --- doc/ReleaseNotes | 1 + panda/src/display/graphicsEngine.cxx | 28 +++++++++++++++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index 19191e3e06..242ce2db87 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -18,6 +18,7 @@ This issue fixes several bugs that were still found in 1.9.2. * Fix crashes with pbuffers on Intel cards on Windows * Support for Autodesk Maya 2016.5 * Add shadow-depth-bits config var to control shadow map depth +* No longer reuses cull result for different GSG or lens index ------------------------ RELEASE 1.9.2 ------------------------ diff --git a/panda/src/display/graphicsEngine.cxx b/panda/src/display/graphicsEngine.cxx index da90172088..2fcc98b47a 100644 --- a/panda/src/display/graphicsEngine.cxx +++ b/panda/src/display/graphicsEngine.cxx @@ -120,6 +120,23 @@ PStatCollector GraphicsEngine::_occlusion_passed_pcollector("Occlusion results:V PStatCollector GraphicsEngine::_occlusion_failed_pcollector("Occlusion results:Occluded"); PStatCollector GraphicsEngine::_occlusion_tests_pcollector("Occlusion tests"); +// This is used to keep track of which scenes we have already culled. +struct CullKey { + GraphicsStateGuardian *_gsg; + NodePath _camera; + int _lens_index; +}; + +INLINE static bool operator < (const CullKey &a, const CullKey &b) { + if (a._gsg != b._gsg) { + return a._gsg < b._gsg; + } + if (a._camera != b._camera) { + return a._camera < b._camera; + } + return a._lens_index < b._lens_index; +} + //////////////////////////////////////////////////////////////////// // Function: GraphicsEngine::Constructor // Access: Published @@ -1487,7 +1504,7 @@ cull_to_bins(const GraphicsEngine::Windows &wlist, Thread *current_thread) { // Keep track of the cameras we have already used in this thread to // render DisplayRegions. - typedef pmap AlreadyCulled; + typedef pmap AlreadyCulled; AlreadyCulled already_culled; size_t wlist_size = wlist.size(); @@ -1501,8 +1518,13 @@ cull_to_bins(const GraphicsEngine::Windows &wlist, Thread *current_thread) { if (dr != (DisplayRegion *)NULL) { DisplayRegionPipelineReader *dr_reader = new DisplayRegionPipelineReader(dr, current_thread); - NodePath camera = dr_reader->get_camera(); - AlreadyCulled::iterator aci = already_culled.insert(AlreadyCulled::value_type(camera, (DisplayRegion *)NULL)).first; + + CullKey key; + key._gsg = win->get_gsg(); + key._camera = dr_reader->get_camera(); + key._lens_index = dr_reader->get_lens_index(); + + AlreadyCulled::iterator aci = already_culled.insert(AlreadyCulled::value_type(key, (DisplayRegion *)NULL)).first; if ((*aci).second == NULL) { // We have not used this camera already in this thread. // Perform the cull operation. From 9c8c5434789e21e08dc8917ce3b4e54146a15296 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 9 Jul 2016 14:47:09 +0200 Subject: [PATCH 007/112] Clarify release notes a bit --- doc/ReleaseNotes | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index 242ce2db87..26ab1d8813 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -18,7 +18,9 @@ This issue fixes several bugs that were still found in 1.9.2. * Fix crashes with pbuffers on Intel cards on Windows * Support for Autodesk Maya 2016.5 * Add shadow-depth-bits config var to control shadow map depth -* No longer reuses cull result for different GSG or lens index +* Fix cull issue when rendering cube map (or any multi-lens setup) +* Fix crash rendering with the same camera to different contexts +* Fix compile error when making static build with DX9 renderer ------------------------ RELEASE 1.9.2 ------------------------ From f7fde882b8a27a7319690910fb514ed65710b6d7 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 10 Jul 2016 12:25:35 +0200 Subject: [PATCH 008/112] Fix uninitialised variable --- panda/src/display/graphicsStateGuardian.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/panda/src/display/graphicsStateGuardian.cxx b/panda/src/display/graphicsStateGuardian.cxx index 22a2caf498..0a2ae03c1e 100644 --- a/panda/src/display/graphicsStateGuardian.cxx +++ b/panda/src/display/graphicsStateGuardian.cxx @@ -235,6 +235,7 @@ GraphicsStateGuardian(CoordinateSystem internal_coordinate_system, _supports_basic_shaders = false; _supports_geometry_shaders = false; _supports_tessellation_shaders = false; + _supports_compute_shaders = false; _supports_glsl = false; _supports_stencil = false; From fa7730819f3c57a1696a094fc6a6a87e842ed503 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 10 Jul 2016 12:28:11 +0200 Subject: [PATCH 009/112] Fix assertion when using aux render targets in DX9 --- doc/ReleaseNotes | 2 + panda/src/dxgsg9/wdxGraphicsBuffer9.cxx | 6 ++- panda/src/gobj/shader.cxx | 63 +++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 2 deletions(-) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index 26ab1d8813..83d77d4aef 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -21,6 +21,8 @@ This issue fixes several bugs that were still found in 1.9.2. * Fix cull issue when rendering cube map (or any multi-lens setup) * Fix crash rendering with the same camera to different contexts * Fix compile error when making static build with DX9 renderer +* Fix assertion when using aux render targets in DX9 +* Work around Cg bug generating invalid ASM for saturated tex loads ------------------------ RELEASE 1.9.2 ------------------------ diff --git a/panda/src/dxgsg9/wdxGraphicsBuffer9.cxx b/panda/src/dxgsg9/wdxGraphicsBuffer9.cxx index f393987726..9f04ea7a25 100644 --- a/panda/src/dxgsg9/wdxGraphicsBuffer9.cxx +++ b/panda/src/dxgsg9/wdxGraphicsBuffer9.cxx @@ -329,16 +329,18 @@ rebuild_bitplanes() { case RTP_aux_float_3: { CDWriter cdataw(_cycler, cdata, false); - nassertr(cdata->_textures.size() == cdataw->_textures.size(), false); cdataw->_textures[i]._rtm_mode = RTM_none; } + // Creating the CDWriter invalidated the CDLockedReader. + cdata = CDLockedReader(_cycler); break; default: { CDWriter cdataw(_cycler, cdata, false); - nassertr(cdata->_textures.size() == cdataw->_textures.size(), false); cdataw->_textures[i]._rtm_mode = RTM_copy_texture; } + // Creating the CDWriter invalidated the CDLockedReader. + cdata = CDLockedReader(_cycler); break; } } diff --git a/panda/src/gobj/shader.cxx b/panda/src/gobj/shader.cxx index b4b628744a..448fc3c25a 100644 --- a/panda/src/gobj/shader.cxx +++ b/panda/src/gobj/shader.cxx @@ -1620,6 +1620,69 @@ cg_compile_shader(const ShaderCaps &caps, CGcontext context) { return false; } + // This is present to work around a bug in the Cg compiler for Direct3D 9. + // It generates "texld_sat" instructions that the result in an + // D3DXERR_INVALIDDATA error when trying to load the shader, since the _sat + // modifier may not be used on tex* instructions. + if (_cg_fprofile == CG_PROFILE_PS_2_0 || + _cg_fprofile == CG_PROFILE_PS_2_X || + _cg_fprofile == CG_PROFILE_PS_3_0) { + vector_string lines; + tokenize(cgGetProgramString(_cg_fprogram, CG_COMPILED_PROGRAM), lines, "\n"); + + ostringstream out; + int num_modified = 0; + + for (size_t i = 0; i < lines.size(); ++i) { + const string &line = lines[i]; + + size_t space = line.find(' '); + if (space == string::npos) { + out << line << '\n'; + continue; + } + + string instr = line.substr(0, space); + + // Look for a texld instruction with _sat modifier. + if (instr.compare(0, 5, "texld") == 0 && + instr.compare(instr.size() - 4, 4, "_sat") == 0) { + // Which destination register are we operating on? + string reg = line.substr(space + 1, line.find(',', space) - space - 1); + + // Move the saturation operation to a separate instruction. + instr.resize(instr.size() - 4); + out << instr << ' ' << line.substr(space + 1) << '\n'; + out << "mov_sat " << reg << ", " << reg << '\n'; + ++num_modified; + } else { + out << line << '\n'; + } + } + + if (num_modified > 0) { + string result = out.str(); + CGprogram new_program; + new_program = cgCreateProgram(context, CG_OBJECT, result.c_str(), + (CGprofile)_cg_fprofile, "fshader", + (const char**)NULL); + if (new_program) { + cgDestroyProgram(_cg_fprogram); + _cg_fprogram = new_program; + + if (shader_cat.is_debug()) { + shader_cat.debug() + << "Replaced " << num_modified << " invalid texld_sat instruction" + << ((num_modified == 1) ? "" : "s") << " in compiled shader\n"; + } + } else { + shader_cat.warning() + << "Failed to load shader with fixed texld_sat instructions: " + << cgGetErrorString(cgGetError()) << "\n"; + } + } + } + // DEBUG: output the generated program if (shader_cat.is_debug()) { const char *vertex_program; From c34758ea5c9835a78c65e25fcd9551e29f8e7cb2 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 10 Jul 2016 14:06:01 +0200 Subject: [PATCH 010/112] Cg fixes for DX9 --- doc/ReleaseNotes | 1 + panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx | 29 ++++- panda/src/dxgsg9/dxShaderContext9.cxx | 101 ++++++++++-------- panda/src/pgraph/shaderInput.I | 12 ++- 4 files changed, 92 insertions(+), 51 deletions(-) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index 83d77d4aef..7ffdb5ecc7 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -23,6 +23,7 @@ This issue fixes several bugs that were still found in 1.9.2. * Fix compile error when making static build with DX9 renderer * Fix assertion when using aux render targets in DX9 * Work around Cg bug generating invalid ASM for saturated tex loads +* Fix issues with certain Cg shader inputs in DX9 ------------------------ RELEASE 1.9.2 ------------------------ diff --git a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx index cafc199a95..c5d71e152d 100644 --- a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx +++ b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx @@ -431,10 +431,35 @@ extract_texture_data(Texture *tex) { //////////////////////////////////////////////////////////////////// ShaderContext *DXGraphicsStateGuardian9:: prepare_shader(Shader *se) { + PStatTimer timer(_prepare_shader_pcollector); + + switch (se->get_language()) { + case Shader::SL_GLSL: + dxgsg9_cat.error() + << "Tried to load GLSL shader, but GLSL shaders not supported by Direct3D 9.\n"; + return NULL; + + case Shader::SL_Cg: #ifdef HAVE_CG - CLP(ShaderContext) *result = new CLP(ShaderContext)(se, this); - return result; + if (_supports_basic_shaders) { + return new CLP(ShaderContext)(se, this); + } else { + dxgsg9_cat.error() + << "Tried to load Cg shader, but basic shaders not supported.\n"; + return NULL; + } +#else + dxgsg9_cat.error() + << "Tried to load Cg shader, but Cg support not compiled in.\n"; + return NULL; #endif + + default: + dxgsg9_cat.error() + << "Tried to load shader with unsupported shader language!\n"; + return NULL; + } + return NULL; } diff --git a/panda/src/dxgsg9/dxShaderContext9.cxx b/panda/src/dxgsg9/dxShaderContext9.cxx index 0e86d46c16..c41f686526 100644 --- a/panda/src/dxgsg9/dxShaderContext9.cxx +++ b/panda/src/dxgsg9/dxShaderContext9.cxx @@ -49,7 +49,6 @@ CLP(ShaderContext)(Shader *s, GSG *gsg) : ShaderContext(s) { CGcontext context = DCAST(DXGraphicsStateGuardian9, gsg)->_cg_context; if (s->get_language() == Shader::SL_Cg) { - // Ask the shader to compile itself for us and // to give us the resulting Cg program objects. if (!s->cg_compile_for(gsg->_shader_caps, context, @@ -259,43 +258,54 @@ issue_parameters(GSG *gsg, int altered) { #ifdef HAVE_CG if (_cg_program) { - // Iterate through _ptr parameters - for (int i=0; i<(int)_shader->_ptr_spec.size(); i++) { - if(altered & (_shader->_ptr_spec[i]._dep[0] | _shader->_ptr_spec[i]._dep[1])){ -#ifdef HAVE_CG - const Shader::ShaderPtrSpec& _ptr = _shader->_ptr_spec[i]; - Shader::ShaderPtrData* _ptr_data = - const_cast< Shader::ShaderPtrData*>(gsg->fetch_ptr_parameter(_ptr)); + // Iterate through _ptr parameters + for (size_t i = 0; i < _shader->_ptr_spec.size(); ++i) { + const Shader::ShaderPtrSpec &spec = _shader->_ptr_spec[i]; - if (_ptr_data == NULL){ //the input is not contained in ShaderPtrData + if (altered & (spec._dep[0] | spec._dep[1])) { + const Shader::ShaderPtrData *ptr_data = gsg->fetch_ptr_parameter(spec); + + if (ptr_data == NULL) { //the input is not contained in ShaderPtrData release_resources(); return; } - CGparameter p = _cg_parameter_map[_ptr._id._seqno]; + // Calculate how many elements to transfer; no more than it expects, + // but certainly no more than we have. + int input_size = min(abs(spec._dim[0] * spec._dim[1] * spec._dim[2]), ptr_data->_size); + + CGparameter p = _cg_parameter_map[spec._id._seqno]; + switch (ptr_data->_type) { + case Shader::SPT_int: + cgSetParameterValueic(p, input_size, (int *)ptr_data->_ptr); + break; + + case Shader::SPT_double: + cgSetParameterValuedc(p, input_size, (double *)ptr_data->_ptr); + break; - switch(_ptr_data->_type) { case Shader::SPT_float: - cgD3D9SetUniform(p, (PN_stdfloat*)_ptr_data->_ptr); + cgSetParameterValuefc(p, input_size, (float *)ptr_data->_ptr); break; default: dxgsg9_cat.error() - << _ptr._id._name << ":" << "unrecognized parameter type\n"; + << spec._id._name << ": unrecognized parameter type\n"; release_resources(); return; } } -#endif } - for (int i=0; i<(int)_shader->_mat_spec.size(); i++) { - if (altered & (_shader->_mat_spec[i]._dep[0] | _shader->_mat_spec[i]._dep[1])) { - CGparameter p = _cg_parameter_map[_shader->_mat_spec[i]._id._seqno]; + for (size_t i = 0; i < _shader->_mat_spec.size(); ++i) { + Shader::ShaderMatSpec &spec = _shader->_mat_spec[i]; + + if (altered & (spec._dep[0] | spec._dep[1])) { + CGparameter p = _cg_parameter_map[spec._id._seqno]; if (p == NULL) { continue; } - const LMatrix4 *val = gsg->fetch_specified_value(_shader->_mat_spec[i], altered); + const LMatrix4 *val = gsg->fetch_specified_value(spec, altered); if (val) { HRESULT hr; PN_stdfloat v [4]; @@ -309,12 +319,12 @@ issue_parameters(GSG *gsg, int altered) { #if DEBUG_SHADER // DEBUG global_data = (PN_stdfloat *) data; - global_shader_mat_spec = &_shader->_mat_spec[i]; + global_shader_mat_spec = &spec; global_internal_name_0 = global_shader_mat_spec -> _arg [0]; global_internal_name_1 = global_shader_mat_spec -> _arg [1]; #endif - switch (_shader->_mat_spec[i]._piece) { + switch (spec._piece) { case Shader::SMP_whole: // TRANSPOSE REQUIRED temp_matrix.transpose_in_place(); @@ -363,26 +373,22 @@ issue_parameters(GSG *gsg, int altered) { default: dxgsg9_cat.error() - << "issue_parameters ( ) SMP parameter type not implemented " << _shader->_mat_spec[i]._piece << "\n"; + << "issue_parameters ( ) SMP parameter type not implemented " << spec._piece << "\n"; break; } if (FAILED (hr)) { - string name = "unnamed"; - if (_shader->_mat_spec[i]._arg [0]) { - name = _shader->_mat_spec[i]._arg [0] -> get_basename ( ); + if (spec._arg[0]) { + name = spec._arg[0]->get_basename(); } dxgsg9_cat.error() - << "NAME " << name << "\n" - << "MAT TYPE " - << _shader->_mat_spec[i]._piece - << " cgD3D9SetUniform failed " - << D3DERRORSTRING(hr); + << "NAME " << name << "\n" << "MAT TYPE " << spec._piece + << " cgD3D9SetUniform failed " << D3DERRORSTRING(hr); - CGerror error = cgGetError (); + CGerror error = cgGetError(); if (error != CG_NO_ERROR) { dxgsg9_cat.error() << " CG ERROR: " << cgGetErrorString(error) << "\n"; } @@ -713,25 +719,26 @@ disable_shader_texture_bindings(GSG *gsg) // reenable them. We may optimize this someday. //////////////////////////////////////////////////////////////////// void CLP(ShaderContext):: -update_shader_texture_bindings(CLP(ShaderContext) *prev, GSG *gsg) -{ - if (prev) prev->disable_shader_texture_bindings(gsg); +update_shader_texture_bindings(CLP(ShaderContext) *prev, GSG *gsg) { + if (prev) { + prev->disable_shader_texture_bindings(gsg); + } #ifdef HAVE_CG if (_cg_program) { - - for (int i=0; i<(int)_shader->_tex_spec.size(); i++) { - CGparameter p = _cg_parameter_map[_shader->_tex_spec[i]._id._seqno]; + for (size_t i = 0; i < _shader->_tex_spec.size(); ++i) { + const Shader::ShaderTexSpec &spec = _shader->_tex_spec[i]; + CGparameter p = _cg_parameter_map[spec._id._seqno]; if (p == NULL) { continue; } + Texture *tex = NULL; int view = gsg->get_current_tex_view_offset(); - InternalName *id = _shader->_tex_spec[i]._name; SamplerState sampler; - if (id != NULL) { - const ShaderInput *input = gsg->_target_shader->get_shader_input(id); + if (spec._name != NULL) { + const ShaderInput *input = gsg->_target_shader->get_shader_input(spec._name); tex = input->get_texture(); sampler = input->get_sampler(); @@ -741,31 +748,33 @@ update_shader_texture_bindings(CLP(ShaderContext) *prev, GSG *gsg) const TextureAttrib *texattrib = DCAST(TextureAttrib, gsg->_target_rs->get_attrib_def(TextureAttrib::get_class_slot())); nassertv(texattrib != (TextureAttrib *)NULL); - if (_shader->_tex_spec[i]._stage >= texattrib->get_num_on_stages()) { + if (spec._stage >= texattrib->get_num_on_stages()) { continue; } - TextureStage *stage = texattrib->get_on_stage(_shader->_tex_spec[i]._stage); + TextureStage *stage = texattrib->get_on_stage(spec._stage); tex = texattrib->get_on_texture(stage); sampler = texattrib->get_on_sampler(stage); view += stage->get_tex_view_offset(); } - if (_shader->_tex_spec[i]._suffix != 0) { - // The suffix feature is inefficient. It is a temporary hack. + + if (spec._suffix != 0) { + // The suffix feature is inefficient. It is a temporary hack. if (tex == 0) { continue; } - tex = tex->load_related(_shader->_tex_spec[i]._suffix); + tex = tex->load_related(spec._suffix); } - if ((tex == 0) || (tex->get_texture_type() != _shader->_tex_spec[i]._desired_type)) { + + if ((tex == 0) || (tex->get_texture_type() != spec._desired_type)) { continue; } + TextureContext *tc = tex->prepare_now(view, gsg->_prepared_objects, gsg); if (tc == (TextureContext*)NULL) { continue; } int texunit = cgGetParameterResourceIndex(p); - gsg->apply_texture(texunit, tc, sampler); } } diff --git a/panda/src/pgraph/shaderInput.I b/panda/src/pgraph/shaderInput.I index c7aed1de80..7761ec8a2f 100644 --- a/panda/src/pgraph/shaderInput.I +++ b/panda/src/pgraph/shaderInput.I @@ -688,9 +688,15 @@ get_ptr() const { //////////////////////////////////////////////////////////////////// INLINE const SamplerState &ShaderInput:: get_sampler() const { - return (_type == M_texture) - ? get_texture()->get_default_sampler() - : _sampler; + if (_type != M_texture) { + return _sampler; + + } else if (!_value.is_null()) { + return get_texture()->get_default_sampler(); + + } else { + return SamplerState::get_default(); + } } //////////////////////////////////////////////////////////////////// From e098da90302ba54e2a4dfeebd55fd5a67f456a02 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 10 Jul 2016 15:48:17 +0200 Subject: [PATCH 011/112] Support uint8 indices in DX9 renderer --- doc/ReleaseNotes | 1 + panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx | 2 + panda/src/dxgsg9/dxIndexBufferContext9.cxx | 53 +++++++++++-------- 3 files changed, 33 insertions(+), 23 deletions(-) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index 7ffdb5ecc7..3796b840c0 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -24,6 +24,7 @@ This issue fixes several bugs that were still found in 1.9.2. * Fix assertion when using aux render targets in DX9 * Work around Cg bug generating invalid ASM for saturated tex loads * Fix issues with certain Cg shader inputs in DX9 +* Support uint8 index buffers in DX9 ------------------------ RELEASE 1.9.2 ------------------------ diff --git a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx index c5d71e152d..cd4eb466e8 100644 --- a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx +++ b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx @@ -3584,6 +3584,8 @@ bind_light(Spotlight *light_obj, const NodePath &light, int light_id) { D3DFORMAT DXGraphicsStateGuardian9:: get_index_type(Geom::NumericType numeric_type) { switch (numeric_type) { + // NT_uint8 is automatically promoted to uint16. + case Geom::NT_uint8: case Geom::NT_uint16: return D3DFMT_INDEX16; diff --git a/panda/src/dxgsg9/dxIndexBufferContext9.cxx b/panda/src/dxgsg9/dxIndexBufferContext9.cxx index deaf5740bc..844a54cb42 100644 --- a/panda/src/dxgsg9/dxIndexBufferContext9.cxx +++ b/panda/src/dxgsg9/dxIndexBufferContext9.cxx @@ -30,9 +30,8 @@ TypeHandle DXIndexBufferContext9::_type_handle; DXIndexBufferContext9:: DXIndexBufferContext9(PreparedGraphicsObjects *pgo, GeomPrimitive *data) : IndexBufferContext(pgo, data), - _ibuffer(NULL) -{ - _managed = -1; + _ibuffer(NULL), + _managed(-1) { } //////////////////////////////////////////////////////////////////// @@ -42,8 +41,7 @@ DXIndexBufferContext9(PreparedGraphicsObjects *pgo, GeomPrimitive *data) : //////////////////////////////////////////////////////////////////// DXIndexBufferContext9:: ~DXIndexBufferContext9() { - - this -> free_ibuffer ( ); + free_ibuffer(); } //////////////////////////////////////////////////////////////////// @@ -82,13 +80,10 @@ free_ibuffer(void) { << "deleting index buffer " << _ibuffer << "\n"; } - if (DEBUG_INDEX_BUFFER) - { + if (DEBUG_INDEX_BUFFER) { RELEASE(_ibuffer, dxgsg9, "index buffer", RELEASE_ONCE); - } - else - { - _ibuffer -> Release ( ); + } else { + _ibuffer->Release(); } _ibuffer = NULL; @@ -113,6 +108,11 @@ allocate_ibuffer(DXScreenData &scrn, data_size = reader->get_data_size_bytes(); + if (reader->get_index_type() == GeomEnums::NT_uint8) { + // We widen 8-bits indices to 16-bits. + data_size *= 2; + } + _managed = scrn._managed_index_buffers; if (_managed) { @@ -164,16 +164,12 @@ create_ibuffer(DXScreenData &scrn, nassertv(reader->get_object() == get_data()); Thread *current_thread = reader->get_current_thread(); - this -> free_ibuffer ( ); + free_ibuffer(); PStatTimer timer(GraphicsStateGuardian::_create_index_buffer_pcollector, current_thread); - int data_size; - - data_size = reader->get_data_size_bytes(); - - this -> allocate_ibuffer(scrn, reader); + allocate_ibuffer(scrn, reader); } //////////////////////////////////////////////////////////////////// @@ -195,6 +191,11 @@ upload_data(const GeomPrimitivePipelineReader *reader, bool force) { } int data_size = reader->get_data_size_bytes(); + if (reader->get_index_type() == GeomEnums::NT_uint8) { + // We widen 8-bits indices to 16-bits. + data_size *= 2; + } + if (dxgsg9_cat.is_spam()) { dxgsg9_cat.spam() << "copying " << data_size @@ -206,12 +207,9 @@ upload_data(const GeomPrimitivePipelineReader *reader, bool force) { HRESULT hr; BYTE *local_pointer; - if (_managed) - { + if (_managed) { hr = _ibuffer->Lock(0, data_size, (void **) &local_pointer, 0); - } - else - { + } else { hr = _ibuffer->Lock(0, data_size, (void **) &local_pointer, D3DLOCK_DISCARD); } if (FAILED(hr)) { @@ -221,7 +219,16 @@ upload_data(const GeomPrimitivePipelineReader *reader, bool force) { } GraphicsStateGuardian::_data_transferred_pcollector.add_level(data_size); - memcpy(local_pointer, data_pointer, data_size); + + if (reader->get_index_type() == GeomEnums::NT_uint8) { + // Widen to 16-bits, as DirectX doesn't support 8-bits indices. + PN_uint16 *ptr = (PN_uint16 *)local_pointer; + for (size_t i = 0; i < data_size; i += 2) { + *ptr++ = (PN_uint16)*data_pointer++; + } + } else { + memcpy(local_pointer, data_pointer, data_size); + } _ibuffer->Unlock(); return true; From 8b67ab31f511cb209d0ba3828c02ce3941ef36d8 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 10 Jul 2016 16:49:00 +0200 Subject: [PATCH 012/112] Fix obscure compile error --- panda/src/glstuff/glGraphicsBuffer_src.cxx | 3 ++- panda/src/glstuff/glShaderContext_src.cxx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/panda/src/glstuff/glGraphicsBuffer_src.cxx b/panda/src/glstuff/glGraphicsBuffer_src.cxx index 7e055364e4..d9df1d0be8 100644 --- a/panda/src/glstuff/glGraphicsBuffer_src.cxx +++ b/panda/src/glstuff/glGraphicsBuffer_src.cxx @@ -514,7 +514,8 @@ rebuild_bitplanes() { if (num_fbos > _fbo.size()) { // Generate more FBO handles. int start = _fbo.size(); - _fbo.resize(num_fbos, 0); + GLuint zero = 0; + _fbo.resize(num_fbos, zero); glgsg->_glGenFramebuffers(num_fbos - start, &_fbo[start]); } diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index 0324fbb4a1..4cdf3749a8 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -2145,7 +2145,8 @@ update_shader_vertex_arrays(ShaderContext *prev, bool force) { // Bind the vertex buffer to the binding index. if (ai >= _glgsg->_current_vertex_buffers.size()) { - _glgsg->_current_vertex_buffers.resize(ai + 1, 0); + GLuint zero = 0; + _glgsg->_current_vertex_buffers.resize(ai + 1, zero); } if (_glgsg->_current_vertex_buffers[ai] != gvbc->_index) { _glgsg->_glBindVertexBuffer(ai, gvbc->_index, 0, stride); From f94db0661e076998d7cb3b0e827b31d1aae02d02 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 10 Jul 2016 17:22:34 +0200 Subject: [PATCH 013/112] Add move semantics to CDLockedReader/CDWriter --- panda/src/pipeline/cycleDataLockedReader.I | 30 +++++++++++++++++ panda/src/pipeline/cycleDataLockedReader.h | 5 +++ .../src/pipeline/cycleDataLockedStageReader.I | 32 +++++++++++++++++++ .../src/pipeline/cycleDataLockedStageReader.h | 5 +++ panda/src/pipeline/cycleDataStageWriter.I | 32 +++++++++++++++++++ panda/src/pipeline/cycleDataStageWriter.h | 5 +++ panda/src/pipeline/cycleDataWriter.I | 32 ++++++++++++++++++- panda/src/pipeline/cycleDataWriter.h | 5 +++ 8 files changed, 145 insertions(+), 1 deletion(-) diff --git a/panda/src/pipeline/cycleDataLockedReader.I b/panda/src/pipeline/cycleDataLockedReader.I index 05a66c6213..0ac88ebb67 100644 --- a/panda/src/pipeline/cycleDataLockedReader.I +++ b/panda/src/pipeline/cycleDataLockedReader.I @@ -61,6 +61,36 @@ operator = (const CycleDataLockedReader ©) { _cycler->increment_read(_pointer); } +#ifdef USE_MOVE_SEMANTICS +/** + * + */ +template +INLINE CycleDataLockedReader:: +CycleDataLockedReader(CycleDataLockedReader &&from) NOEXCEPT : + _cycler(from._cycler), + _current_thread(from._current_thread), + _pointer(from._pointer) +{ + from._pointer = NULL; +} + +/** + * + */ +template +INLINE void CycleDataLockedReader:: +operator = (CycleDataLockedReader &&from) NOEXCEPT { + nassertv(_pointer == (CycleDataType *)NULL); + nassertv(_current_thread == from._current_thread); + + _cycler = from._cycler; + _pointer = from._pointer; + + from._pointer = NULL; +} +#endif // USE_MOVE_SEMANTICS + /** * */ diff --git a/panda/src/pipeline/cycleDataLockedReader.h b/panda/src/pipeline/cycleDataLockedReader.h index 80deaf3dce..f66143fab4 100644 --- a/panda/src/pipeline/cycleDataLockedReader.h +++ b/panda/src/pipeline/cycleDataLockedReader.h @@ -47,6 +47,11 @@ public: INLINE CycleDataLockedReader(const CycleDataLockedReader ©); INLINE void operator = (const CycleDataLockedReader ©); +#if defined(USE_MOVE_SEMANTICS) && defined(DO_PIPELINING) + INLINE CycleDataLockedReader(CycleDataLockedReader &&from) NOEXCEPT; + INLINE void operator = (CycleDataLockedReader &&from) NOEXCEPT; +#endif + INLINE ~CycleDataLockedReader(); INLINE const CycleDataType *operator -> () const; diff --git a/panda/src/pipeline/cycleDataLockedStageReader.I b/panda/src/pipeline/cycleDataLockedStageReader.I index 521df13494..9f2c74d23a 100644 --- a/panda/src/pipeline/cycleDataLockedStageReader.I +++ b/panda/src/pipeline/cycleDataLockedStageReader.I @@ -64,6 +64,38 @@ operator = (const CycleDataLockedStageReader ©) { _cycler->increment_read(_pointer); } +#ifdef USE_MOVE_SEMANTICS +/** + * + */ +template +INLINE CycleDataLockedStageReader:: +CycleDataLockedStageReader(CycleDataLockedStageReader &&from) NOEXCEPT : + _cycler(from._cycler), + _current_thread(from._current_thread), + _pointer(from._pointer), + _stage(from._stage) +{ + from._pointer = NULL; +} + +/** + * + */ +template +INLINE void CycleDataLockedStageReader:: +operator = (CycleDataLockedStageReader &&from) NOEXCEPT { + nassertv(_pointer == (CycleDataType *)NULL); + nassertv(_current_thread == from._current_thread); + + _cycler = from._cycler; + _pointer = from._pointer; + _stage = from._stage; + + from._pointer = NULL; +} +#endif // USE_MOVE_SEMANTICS + /** * */ diff --git a/panda/src/pipeline/cycleDataLockedStageReader.h b/panda/src/pipeline/cycleDataLockedStageReader.h index 5b7e84cc19..6837a6edf4 100644 --- a/panda/src/pipeline/cycleDataLockedStageReader.h +++ b/panda/src/pipeline/cycleDataLockedStageReader.h @@ -34,6 +34,11 @@ public: INLINE CycleDataLockedStageReader(const CycleDataLockedStageReader ©); INLINE void operator = (const CycleDataLockedStageReader ©); +#if defined(USE_MOVE_SEMANTICS) && defined(DO_PIPELINING) + INLINE CycleDataLockedStageReader(CycleDataLockedStageReader &&from) NOEXCEPT; + INLINE void operator = (CycleDataLockedStageReader &&from) NOEXCEPT; +#endif + INLINE ~CycleDataLockedStageReader(); INLINE const CycleDataType *operator -> () const; diff --git a/panda/src/pipeline/cycleDataStageWriter.I b/panda/src/pipeline/cycleDataStageWriter.I index ab6c53544d..3e6d464768 100644 --- a/panda/src/pipeline/cycleDataStageWriter.I +++ b/panda/src/pipeline/cycleDataStageWriter.I @@ -114,6 +114,38 @@ CycleDataStageWriter(PipelineCycler &cycler, int stage, force_to_0, _current_thread); } +#ifdef USE_MOVE_SEMANTICS +/** + * + */ +template +INLINE CycleDataStageWriter:: +CycleDataStageWriter(CycleDataStageWriter &&from) NOEXCEPT : + _cycler(from._cycler), + _current_thread(from._current_thread), + _pointer(from._pointer), + _stage(from._stage) +{ + from._pointer = NULL; +} + +/** + * + */ +template +INLINE void CycleDataStageWriter:: +operator = (CycleDataStageWriter &&from) NOEXCEPT { + nassertv(_pointer == (CycleDataType *)NULL); + nassertv(_current_thread == from._current_thread); + + _cycler = from._cycler; + _pointer = from._pointer; + _stage = from._stage; + + from._pointer = NULL; +} +#endif // USE_MOVE_SEMANTICS + /** * */ diff --git a/panda/src/pipeline/cycleDataStageWriter.h b/panda/src/pipeline/cycleDataStageWriter.h index 967a367284..d154adb6d8 100644 --- a/panda/src/pipeline/cycleDataStageWriter.h +++ b/panda/src/pipeline/cycleDataStageWriter.h @@ -47,6 +47,11 @@ public: CycleDataLockedStageReader &take_from, bool force_to_0); +#if defined(USE_MOVE_SEMANTICS) && defined(DO_PIPELINING) + INLINE CycleDataStageWriter(CycleDataStageWriter &&from) NOEXCEPT; + INLINE void operator = (CycleDataStageWriter &&from) NOEXCEPT; +#endif + INLINE ~CycleDataStageWriter(); INLINE CycleDataType *operator -> (); diff --git a/panda/src/pipeline/cycleDataWriter.I b/panda/src/pipeline/cycleDataWriter.I index 0f0bc481eb..3706468612 100644 --- a/panda/src/pipeline/cycleDataWriter.I +++ b/panda/src/pipeline/cycleDataWriter.I @@ -122,7 +122,7 @@ template INLINE CycleDataWriter:: CycleDataWriter(PipelineCycler &cycler, CycleDataLockedReader &take_from, - bool force_to_0) : + bool force_to_0) : _cycler(&cycler), _current_thread(take_from.get_current_thread()) { @@ -130,6 +130,36 @@ CycleDataWriter(PipelineCycler &cycler, force_to_0, _current_thread); } +#ifdef USE_MOVE_SEMANTICS +/** + * + */ +template +INLINE CycleDataWriter:: +CycleDataWriter(CycleDataWriter &&from) NOEXCEPT : + _cycler(from._cycler), + _current_thread(from._current_thread), + _pointer(from._pointer) +{ + from._pointer = NULL; +} + +/** + * + */ +template +INLINE void CycleDataWriter:: +operator = (CycleDataWriter &&from) NOEXCEPT { + nassertv(_pointer == (CycleDataType *)NULL); + nassertv(_current_thread == from._current_thread); + + _cycler = from._cycler; + _pointer = from._pointer; + + from._pointer = NULL; +} +#endif // USE_MOVE_SEMANTICS + /** * */ diff --git a/panda/src/pipeline/cycleDataWriter.h b/panda/src/pipeline/cycleDataWriter.h index c62f034ca3..e2a4da7831 100644 --- a/panda/src/pipeline/cycleDataWriter.h +++ b/panda/src/pipeline/cycleDataWriter.h @@ -49,6 +49,11 @@ public: INLINE CycleDataWriter(PipelineCycler &cycler, CycleDataLockedReader &take_from); INLINE CycleDataWriter(PipelineCycler &cycler, CycleDataLockedReader &take_from, bool force_to_0); +#if defined(USE_MOVE_SEMANTICS) && defined(DO_PIPELINING) + INLINE CycleDataWriter(CycleDataWriter &&from) NOEXCEPT; + INLINE void operator = (CycleDataWriter &&from) NOEXCEPT; +#endif + INLINE ~CycleDataWriter(); INLINE CycleDataType *operator -> (); From 7b7bf9311842564375b4872c8b91da3a0d361c1c Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 12 Jul 2016 11:24:09 +0200 Subject: [PATCH 014/112] Fix frame chug when loading big model asynchronously (LP #1019599) --- doc/ReleaseNotes | 1 + panda/src/putil/bamCache.cxx | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index 3796b840c0..a4ca29a6cf 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -25,6 +25,7 @@ This issue fixes several bugs that were still found in 1.9.2. * Work around Cg bug generating invalid ASM for saturated tex loads * Fix issues with certain Cg shader inputs in DX9 * Support uint8 index buffers in DX9 +* Fix occasional frame lag when loading a big model asynchronously ------------------------ RELEASE 1.9.2 ------------------------ diff --git a/panda/src/putil/bamCache.cxx b/panda/src/putil/bamCache.cxx index 7616350e07..f0d04d08c8 100644 --- a/panda/src/putil/bamCache.cxx +++ b/panda/src/putil/bamCache.cxx @@ -321,13 +321,24 @@ emergency_read_only() { //////////////////////////////////////////////////////////////////// void BamCache:: consider_flush_index() { - ReMutexHolder holder(_lock); +#if defined(HAVE_THREADS) || defined(DEBUG_THREADS) + if (!_lock.try_acquire()) { + // If we can't grab the lock, no big deal. We don't want to hold up + // the frame waiting for a cache operation. We can try again later. + return; + } +#endif + if (_index_stale_since != 0) { int elapsed = (int)time(NULL) - (int)_index_stale_since; if (elapsed > _flush_time) { flush_index(); } } + +#if defined(HAVE_THREADS) || defined(DEBUG_THREADS) + _lock.release(); +#endif } //////////////////////////////////////////////////////////////////// From 69f15258e4394f8df680f4a6a71de2cbca7bf770 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 12 Jul 2016 14:47:20 +0200 Subject: [PATCH 015/112] Fix race condition reading filename/string from config var --- doc/ReleaseNotes | 1 + dtool/src/prc/configVariableFilename.cxx | 30 +++++++++++++++++------- dtool/src/prc/configVariableString.I | 3 +-- dtool/src/prc/configVariableString.cxx | 23 ++++++++++++++++++ dtool/src/prc/configVariableString.h | 3 +++ 5 files changed, 49 insertions(+), 11 deletions(-) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index a4ca29a6cf..94ebbe4e9e 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -26,6 +26,7 @@ This issue fixes several bugs that were still found in 1.9.2. * Fix issues with certain Cg shader inputs in DX9 * Support uint8 index buffers in DX9 * Fix occasional frame lag when loading a big model asynchronously +* Fix race condition reading string config var ------------------------ RELEASE 1.9.2 ------------------------ diff --git a/dtool/src/prc/configVariableFilename.cxx b/dtool/src/prc/configVariableFilename.cxx index dd9a4ab3ef..2b898f5b11 100644 --- a/dtool/src/prc/configVariableFilename.cxx +++ b/dtool/src/prc/configVariableFilename.cxx @@ -23,16 +23,28 @@ //////////////////////////////////////////////////////////////////// void ConfigVariableFilename:: reload_cache() { - nassertv(_core != (ConfigVariableCore *)NULL); - mark_cache_valid(_local_modified); + // NB. MSVC doesn't guarantee that this mutex is initialized in a + // thread-safe manner. But chances are that the first time this is called + // is at static init time, when there is no risk of data races. + static MutexImpl lock; + lock.acquire(); - const ConfigDeclaration *decl = _core->get_declaration(0); - const ConfigPage *page = decl->get_page(); + // We check again for cache validity since another thread may have beaten + // us to the punch while we were waiting for the lock. + if (!is_cache_valid(_local_modified)) { + nassertv(_core != (ConfigVariableCore *)NULL); - Filename page_filename(page->get_name()); - Filename page_dirname = page_filename.get_dirname(); - ExecutionEnvironment::shadow_environment_variable("THIS_PRC_DIR", page_dirname.to_os_specific()); + const ConfigDeclaration *decl = _core->get_declaration(0); + const ConfigPage *page = decl->get_page(); - _cache = Filename::expand_from(decl->get_string_value()); - ExecutionEnvironment::clear_shadow("THIS_PRC_DIR"); + Filename page_filename(page->get_name()); + Filename page_dirname = page_filename.get_dirname(); + ExecutionEnvironment::shadow_environment_variable("THIS_PRC_DIR", page_dirname.to_os_specific()); + + _cache = Filename::expand_from(decl->get_string_value()); + ExecutionEnvironment::clear_shadow("THIS_PRC_DIR"); + + mark_cache_valid(_local_modified); + } + lock.release(); } diff --git a/dtool/src/prc/configVariableString.I b/dtool/src/prc/configVariableString.I index 580ad91fd3..2982b2ca24 100644 --- a/dtool/src/prc/configVariableString.I +++ b/dtool/src/prc/configVariableString.I @@ -155,8 +155,7 @@ INLINE const string &ConfigVariableString:: get_value() const { TAU_PROFILE("const string &ConfigVariableString::get_value() const", " ", TAU_USER); if (!is_cache_valid(_local_modified)) { - mark_cache_valid(((ConfigVariableString *)this)->_local_modified); - ((ConfigVariableString *)this)->_cache = get_string_value(); + ((ConfigVariableString *)this)->reload_cache(); } return _cache; } diff --git a/dtool/src/prc/configVariableString.cxx b/dtool/src/prc/configVariableString.cxx index e1b7796f3f..7f4c3048bf 100644 --- a/dtool/src/prc/configVariableString.cxx +++ b/dtool/src/prc/configVariableString.cxx @@ -13,3 +13,26 @@ //////////////////////////////////////////////////////////////////// #include "configVariableString.h" + +//////////////////////////////////////////////////////////////////// +// Function: ConfigVariableString::reload_cache +// Access: Published +// Description: Refreshes the variable's cached value. +//////////////////////////////////////////////////////////////////// +void ConfigVariableString:: +reload_cache() { + // NB. MSVC doesn't guarantee that this mutex is initialized in a + // thread-safe manner. But chances are that the first time this is called + // is at static init time, when there is no risk of data races. + static MutexImpl lock; + lock.acquire(); + + // We check again for cache validity since another thread may have beaten + // us to the punch while we were waiting for the lock. + if (!is_cache_valid(_local_modified)) { + _cache = get_string_value(); + mark_cache_valid(_local_modified); + } + + lock.release(); +} diff --git a/dtool/src/prc/configVariableString.h b/dtool/src/prc/configVariableString.h index 0685af8a67..f8b4e51c9d 100644 --- a/dtool/src/prc/configVariableString.h +++ b/dtool/src/prc/configVariableString.h @@ -51,6 +51,9 @@ PUBLISHED: INLINE string get_word(int n) const; INLINE void set_word(int n, const string &value); +private: + void reload_cache(); + private: AtomicAdjust::Integer _local_modified; string _cache; From 106cf2cad09ab90a876a61549054fe64987a75d5 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 12 Jul 2016 19:26:07 +0200 Subject: [PATCH 016/112] Fix randomly slanted/crashing TextGraphics --- panda/src/text/textAssembler.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/panda/src/text/textAssembler.cxx b/panda/src/text/textAssembler.cxx index 933712c531..1f8b9dc74e 100644 --- a/panda/src/text/textAssembler.cxx +++ b/panda/src/text/textAssembler.cxx @@ -1489,6 +1489,7 @@ assemble_row(TextAssembler::TextRow &row, placement._scale = properties->get_glyph_scale(); placement._xpos = (xpos - frame[0]); placement._ypos = (properties->get_glyph_shift() - frame[2]); + placement._slant = properties->get_slant(); placement._properties = properties; placed_glyphs.push_back(placement); From 8381118a976184836cfccdd828ea315f44edf783 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 14 Jul 2016 12:54:39 +0200 Subject: [PATCH 017/112] Assorted tweaks and compile warning fixes --- contrib/src/ai/aiBehaviors.h | 4 ---- contrib/src/ai/aiCharacter.h | 5 ----- contrib/src/ai/aiGlobals.h | 4 ---- contrib/src/ai/aiWorld.h | 5 ----- contrib/src/ai/obstacleAvoidance.cxx | 6 +++--- dtool/src/cppparser/cppManifest.cxx | 2 -- dtool/src/cppparser/cppPreprocessor.cxx | 7 +++---- dtool/src/cppparser/cppToken.cxx | 2 +- dtool/src/dtoolbase/dtoolbase.h | 16 +++++++--------- dtool/src/dtoolbase/typeRegistry.cxx | 6 ++++++ dtool/src/dtoolutil/pandaFileStreamBuf.cxx | 2 +- .../interrogate/interfaceMakerPythonNative.cxx | 2 +- dtool/src/interrogate/interrogateBuilder.cxx | 8 ++++---- dtool/src/interrogate/typeManager.cxx | 2 +- dtool/src/interrogatedb/py_panda.cxx | 2 ++ dtool/src/interrogatedb/py_panda.h | 7 ++++--- panda/src/char/character.cxx | 2 +- panda/src/display/displayRegion.cxx | 3 --- panda/src/display/graphicsEngine.cxx | 8 ++++---- panda/src/display/graphicsPipeSelection.cxx | 2 ++ panda/src/display/graphicsStateGuardian.cxx | 2 -- panda/src/egg/eggVertex.cxx | 6 +----- panda/src/express/memoryInfo.cxx | 2 +- panda/src/express/nodeReferenceCount.I | 4 ++-- panda/src/express/nodeReferenceCount.h | 5 ++--- panda/src/express/ordered_vector.T | 1 - panda/src/glstuff/glGraphicsBuffer_src.cxx | 4 ++-- .../src/glstuff/glGraphicsStateGuardian_src.cxx | 7 ------- panda/src/glxdisplay/glxGraphicsWindow.cxx | 1 - panda/src/gobj/texture.cxx | 10 +++++----- panda/src/gobj/texturePeeker.I | 4 ++-- panda/src/gobj/texturePeeker.cxx | 2 +- panda/src/gobj/texturePeeker.h | 4 ++-- panda/src/grutil/multitexReducer.cxx | 4 ---- panda/src/grutil/pipeOcclusionCullTraverser.cxx | 2 -- panda/src/grutil/shaderTerrainMesh.cxx | 2 +- panda/src/parametrics/curveFitter.cxx | 4 +--- panda/src/pgraph/clipPlaneAttrib.cxx | 4 ++-- panda/src/pgraph/lightAttrib.cxx | 12 ++++++------ panda/src/pgraph/loader.cxx | 7 +------ panda/src/pgraph/occluderEffect.cxx | 6 +----- panda/src/pgraph/pandaNode.cxx | 10 +++++----- panda/src/pipeline/pipelineCyclerTrueImpl.I | 16 ++++++++++++++-- panda/src/pipeline/pipelineCyclerTrueImpl.cxx | 7 ++++++- panda/src/pnmimage/pfmFile.cxx | 6 +++--- panda/src/pnmimage/pnm-image-filter-core.cxx | 1 - .../pnmimage/pnm-image-filter-sparse-core.cxx | 1 - panda/src/pnmimagetypes/pnmFileTypeStbImage.cxx | 8 ++++---- panda/src/pnmtext/freetypeFont.cxx | 13 ++++++------- panda/src/putil/doubleBitMask.I | 4 ++-- panda/src/putil/simpleHashMap.I | 1 - panda/src/putil/weakKeyHashMap.I | 1 - panda/src/rocket/rocketInputHandler.cxx | 1 - panda/src/text/dynamicTextFont.cxx | 11 +++++------ panda/src/text/textAssembler.cxx | 4 +--- panda/src/text/textNode.cxx | 2 +- panda/src/tform/mouseWatcher.cxx | 12 ++++++------ panda/src/tinydisplay/ztriangle_two.h | 4 ++-- panda/src/vision/config_vision.cxx | 2 +- panda/src/vision/webcamVideoCursorV4L.cxx | 6 +++--- panda/src/vision/webcamVideoOpenCV.cxx | 2 +- pandatool/src/daeegg/daeCharacter.cxx | 2 +- pandatool/src/egg-optchar/eggOptchar.cxx | 2 +- 63 files changed, 132 insertions(+), 172 deletions(-) diff --git a/contrib/src/ai/aiBehaviors.h b/contrib/src/ai/aiBehaviors.h index 3c11b5e7a8..6a20876db8 100644 --- a/contrib/src/ai/aiBehaviors.h +++ b/contrib/src/ai/aiBehaviors.h @@ -11,10 +11,6 @@ * @date 2009-09-08 */ -#pragma warning (disable:4996) -#pragma warning (disable:4005) -#pragma warning(disable:4275) - #ifndef _AIBEHAVIORS_H #define _AIBEHAVIORS_H diff --git a/contrib/src/ai/aiCharacter.h b/contrib/src/ai/aiCharacter.h index 5d2b2c1d51..9fd0833a99 100644 --- a/contrib/src/ai/aiCharacter.h +++ b/contrib/src/ai/aiCharacter.h @@ -11,11 +11,6 @@ * @date 2009-09-08 */ -#pragma warning (disable:4996) -#pragma warning (disable:4005) -#pragma warning(disable:4275) - - #ifndef _AICHARACTER_H #define _AICHARACTER_H diff --git a/contrib/src/ai/aiGlobals.h b/contrib/src/ai/aiGlobals.h index 749cb9ec21..1d8e8a9c41 100644 --- a/contrib/src/ai/aiGlobals.h +++ b/contrib/src/ai/aiGlobals.h @@ -11,10 +11,6 @@ * @date 2009-09-08 */ -#pragma warning (disable:4996) -#pragma warning (disable:4005) -#pragma warning(disable:4275) - #ifndef _AI_GLOBALS_H #define _AI_GLOBALS_H diff --git a/contrib/src/ai/aiWorld.h b/contrib/src/ai/aiWorld.h index 95115355ba..f85e1dc584 100644 --- a/contrib/src/ai/aiWorld.h +++ b/contrib/src/ai/aiWorld.h @@ -11,11 +11,6 @@ * @date 2009-09-08 */ -#pragma warning (disable:4996) -#pragma warning (disable:4005) -#pragma warning(disable:4275) - - #ifndef _AIWORLD_H #define _AIWORLD_H diff --git a/contrib/src/ai/obstacleAvoidance.cxx b/contrib/src/ai/obstacleAvoidance.cxx index 7160baa096..faf8a1ff05 100644 --- a/contrib/src/ai/obstacleAvoidance.cxx +++ b/contrib/src/ai/obstacleAvoidance.cxx @@ -34,7 +34,7 @@ obstacle_detection() { CPT(BoundingSphere) np_sphere = np_bounds->as_bounding_sphere(); LVecBase3 avoidance(0.0, 0.0, 0.0); double distance = 0x7fff ; - double expanded_radius; + double expanded_radius = 0; LVecBase3 to_obstacle; LVecBase3 prev_avoidance; for(unsigned int i = 0; i < _ai_char->_world->_obstacles.size(); ++i) { @@ -89,8 +89,8 @@ do_obstacle_avoidance() { CPT(BoundingSphere) bsphere = bounds->as_bounding_sphere(); PT(BoundingVolume) np_bounds = _ai_char->get_node_path().get_bounds(); CPT(BoundingSphere) np_sphere = np_bounds->as_bounding_sphere(); - double distance_needed = offset.length() - bsphere->get_radius() - np_sphere->get_radius(); - if((obstacle_detection())) { + + if (obstacle_detection()) { LVecBase3 direction = _ai_char->get_char_render().get_relative_vector(_ai_char->get_node_path(), LVector3::forward()); direction.normalize(); float forward_component = offset.dot(direction); diff --git a/dtool/src/cppparser/cppManifest.cxx b/dtool/src/cppparser/cppManifest.cxx index 18a747d241..bb8f315c39 100644 --- a/dtool/src/cppparser/cppManifest.cxx +++ b/dtool/src/cppparser/cppManifest.cxx @@ -370,10 +370,8 @@ save_expansion(const string &exp, const vector_string ¶meter_names) { // Is this identifier one of our parameters? int pnum = -1; - bool va_args = false; if (ident == "__VA_ARGS__") { - va_args = true; // C99-style variadics, ie. #define macro(...) __VA_ARGS__ pnum = _variadic_param; diff --git a/dtool/src/cppparser/cppPreprocessor.cxx b/dtool/src/cppparser/cppPreprocessor.cxx index 24116a240a..f0fe1c9819 100644 --- a/dtool/src/cppparser/cppPreprocessor.cxx +++ b/dtool/src/cppparser/cppPreprocessor.cxx @@ -806,7 +806,7 @@ expand_manifests(const string &input_expr, bool expand_undefined, Manifests::const_iterator mi = _manifests.find(ident); if (mi != _manifests.end()) { const CPPManifest *manifest = (*mi).second; - expand_manifest_inline(expr, q, p, (*mi).second); + expand_manifest_inline(expr, q, p, manifest); manifest_found = true; } else if (expand_undefined && ident != "true" && ident != "false") { @@ -1192,8 +1192,6 @@ skip_c_comment(int c) { } else { CPPFile first_file = get_file(); - int first_line_number = get_line_number(); - int first_col_number = get_col_number() - 2; while (c != EOF) { if (c == '*') { @@ -1816,8 +1814,9 @@ get_identifier(int c) { type = CPPExpression::T_u16string; } else if (name == "U") { type = CPPExpression::T_u32string; + } else { + type = CPPExpression::T_string; } - get(); string str = scan_quoted(c); diff --git a/dtool/src/cppparser/cppToken.cxx b/dtool/src/cppparser/cppToken.cxx index b6f03d8d49..025590113a 100644 --- a/dtool/src/cppparser/cppToken.cxx +++ b/dtool/src/cppparser/cppToken.cxx @@ -40,7 +40,7 @@ CPPToken(int token, int line_number, int col_number, */ CPPToken:: CPPToken(int token, const YYLTYPE &loc, const string &str, const YYSTYPE &val) : - _token(token), _lloc(loc), _lval(val) + _token(token), _lval(val), _lloc(loc) { _lval.str = str; } diff --git a/dtool/src/dtoolbase/dtoolbase.h b/dtool/src/dtoolbase/dtoolbase.h index 7ec1cb6f04..eff05d5022 100644 --- a/dtool/src/dtoolbase/dtoolbase.h +++ b/dtool/src/dtoolbase/dtoolbase.h @@ -70,23 +70,21 @@ #else // #pragma message("VC 6.0") #endif +#endif /* WIN32_VC */ // Use NODEFAULT to optimize a switch() stmt to tell MSVC to automatically go // to the final untested case after it has failed all the other cases (i.e. // 'assume at least one of the cases is always true') #ifdef _DEBUG -# define NODEFAULT default: assert(0); +#define NODEFAULT default: assert(0); break; +#elif defined(_MSC_VER) +#define NODEFAULT default: __assume(0); // special VC keyword +#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) || (defined(__has_builtin) && __has_builtin(__builtin_unreachable)) +#define NODEFAULT default: __builtin_unreachable(); #else -# define NODEFAULT default: __assume(0); // special VC keyword +#define NODEFAULT #endif -#else /* if !WIN32_VC */ -#ifdef _DEBUG -# define NODEFAULT default: assert(0); -#else -# define NODEFAULT -#endif -#endif /* WIN32_VC */ /* include win32 defns for everything up to WinServer2003, and assume diff --git a/dtool/src/dtoolbase/typeRegistry.cxx b/dtool/src/dtoolbase/typeRegistry.cxx index 99ac09be10..7349d20dd4 100644 --- a/dtool/src/dtoolbase/typeRegistry.cxx +++ b/dtool/src/dtoolbase/typeRegistry.cxx @@ -341,6 +341,8 @@ get_root_class(int n) { TypeHandle handle; if (n >= 0 && n < (int)_root_classes.size()) { handle = _root_classes[n]->_handle; + } else { + handle = TypeHandle::none(); } _lock->release(); @@ -380,6 +382,8 @@ get_parent_class(TypeHandle child, int index) const { assert(rnode != (TypeRegistryNode *)NULL); if (index >= 0 && index < (int)rnode->_parent_classes.size()) { handle = rnode->_parent_classes[index]->_handle; + } else { + handle = TypeHandle::none(); } _lock->release(); return handle; @@ -415,6 +419,8 @@ get_child_class(TypeHandle child, int index) const { assert(rnode != (TypeRegistryNode *)NULL); if (index >= 0 && index < (int)rnode->_child_classes.size()) { handle = rnode->_child_classes[index]->_handle; + } else { + handle = TypeHandle::none(); } _lock->release(); return handle; diff --git a/dtool/src/dtoolutil/pandaFileStreamBuf.cxx b/dtool/src/dtoolutil/pandaFileStreamBuf.cxx index ca78c0a551..037d421469 100644 --- a/dtool/src/dtoolutil/pandaFileStreamBuf.cxx +++ b/dtool/src/dtoolutil/pandaFileStreamBuf.cxx @@ -323,7 +323,7 @@ seekoff(streamoff off, ios_seekdir dir, ios_openmode which) { // Posix case. { off_t li = lseek(_fd, off, SEEK_END); - if (li == (size_t)-1) { + if (li == (off_t)-1) { return -1; } new_pos = (size_t)li; diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index 5d18fca7be..c9ffd6dcb7 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -4196,7 +4196,7 @@ write_function_forset(ostream &out, return; } - FunctionRemap *remap; + FunctionRemap *remap = NULL; std::set::iterator sii; bool all_nonconst = false; diff --git a/dtool/src/interrogate/interrogateBuilder.cxx b/dtool/src/interrogate/interrogateBuilder.cxx index 342ffdd4b9..11ac166440 100644 --- a/dtool/src/interrogate/interrogateBuilder.cxx +++ b/dtool/src/interrogate/interrogateBuilder.cxx @@ -1851,9 +1851,9 @@ get_make_property(CPPMakeProperty *make_property, CPPStructType *struct_type, CP } // The getter must either take no arguments, or all defaults. - if (ftype->_parameters->_parameters.size() == (int)is_seq || - (ftype->_parameters->_parameters.size() > (int)is_seq && - ftype->_parameters->_parameters[(int)is_seq]->_initializer != NULL)) { + if (ftype->_parameters->_parameters.size() == (size_t)is_seq || + (ftype->_parameters->_parameters.size() > (size_t)is_seq && + ftype->_parameters->_parameters[(size_t)is_seq]->_initializer != NULL)) { // If this is a sequence getter, it must take an index argument. if (is_seq && !TypeManager::is_integer(ftype->_parameters->_parameters[0]->_type)) { continue; @@ -1909,7 +1909,7 @@ get_make_property(CPPMakeProperty *make_property, CPPStructType *struct_type, CP for (fi = fgroup->_instances.begin(); fi != fgroup->_instances.end(); ++fi) { CPPInstance *function = (*fi); CPPFunctionType *ftype = function->_type->as_function_type(); - if (ftype != NULL && ftype->_parameters->_parameters.size() == (int)is_seq) { + if (ftype != NULL && ftype->_parameters->_parameters.size() == (size_t)is_seq) { deleter = function; break; } diff --git a/dtool/src/interrogate/typeManager.cxx b/dtool/src/interrogate/typeManager.cxx index 7c9b6582a3..ae931742c1 100644 --- a/dtool/src/interrogate/typeManager.cxx +++ b/dtool/src/interrogate/typeManager.cxx @@ -41,7 +41,7 @@ resolve_type(CPPType *type, CPPScope *scope) { scope = &parser; } - CPPType *orig_type = type; + //CPPType *orig_type = type; type = type->resolve_type(scope, &parser); string name = type->get_local_name(&parser); if (name.empty()) { diff --git a/dtool/src/interrogatedb/py_panda.cxx b/dtool/src/interrogatedb/py_panda.cxx index 953b4700d1..9fe9916573 100644 --- a/dtool/src/interrogatedb/py_panda.cxx +++ b/dtool/src/interrogatedb/py_panda.cxx @@ -816,6 +816,7 @@ PyObject *DTOOL_PyObject_RichCompare(PyObject *v1, PyObject *v2, int op) { int cmpval = DTOOL_PyObject_Compare(v1, v2); bool result; switch (op) { + NODEFAULT case Py_LT: result = (cmpval < 0); break; @@ -833,6 +834,7 @@ PyObject *DTOOL_PyObject_RichCompare(PyObject *v1, PyObject *v2, int op) { break; case Py_GE: result = (cmpval >= 0); + break; } return PyBool_FromLong(result); } diff --git a/dtool/src/interrogatedb/py_panda.h b/dtool/src/interrogatedb/py_panda.h index 8491c7529f..f5e77e0dbb 100644 --- a/dtool/src/interrogatedb/py_panda.h +++ b/dtool/src/interrogatedb/py_panda.h @@ -219,9 +219,10 @@ static PyObject *Dtool_new_##CLASS_NAME(PyTypeObject *type, PyObject *args, PyOb } // The following used to be in the above macro, but it doesn't seem to be -// necessary as tp_alloc memsets the object to 0. ((Dtool_PyInstDef -// *)self)->_ptr_to_object = NULL;\ ((Dtool_PyInstDef *)self)->_memory_rules = -// false;\ ((Dtool_PyInstDef *)self)->_is_const = false;\ +// necessary as tp_alloc memsets the object to 0. +// ((Dtool_PyInstDef *)self)->_ptr_to_object = NULL; +// ((Dtool_PyInstDef *)self)->_memory_rules = false; +// ((Dtool_PyInstDef *)self)->_is_const = false; // Delete functions.. #ifdef NDEBUG diff --git a/panda/src/char/character.cxx b/panda/src/char/character.cxx index a57ec2eda6..ed28ac491e 100644 --- a/panda/src/char/character.cxx +++ b/panda/src/char/character.cxx @@ -228,7 +228,7 @@ calc_tight_bounds(LPoint3 &min_point, LPoint3 &max_point, bool &found_any, // around this, we will force-recompute all of the bounding volumes of our // parent nodes immediately. Parents parents = get_parents(); - for (int i = 0; i < parents.get_num_parents(); ++i) { + for (size_t i = 0; i < parents.get_num_parents(); ++i) { PandaNode *parent = parents.get_parent(i); parent->get_bounds(); } diff --git a/panda/src/display/displayRegion.cxx b/panda/src/display/displayRegion.cxx index d0eb6362b2..c8f7626468 100644 --- a/panda/src/display/displayRegion.cxx +++ b/panda/src/display/displayRegion.cxx @@ -638,9 +638,6 @@ do_compute_pixels(int i, int x_size, int y_size, CData *cdata) { Region ®ion = cdata->_regions[i]; - int old_w = region._pixels[1] - region._pixels[0]; - int old_h = region._pixels[3] - region._pixels[2]; - region._pixels[0] = int((region._dimensions[0] * x_size) + 0.5); region._pixels[1] = int((region._dimensions[1] * x_size) + 0.5); region._pixels_i[0] = region._pixels[0]; diff --git a/panda/src/display/graphicsEngine.cxx b/panda/src/display/graphicsEngine.cxx index 7e56778f2c..ad3aa3caa6 100644 --- a/panda/src/display/graphicsEngine.cxx +++ b/panda/src/display/graphicsEngine.cxx @@ -1527,7 +1527,7 @@ draw_bins(const GraphicsEngine::Windows &wlist, Thread *current_thread) { // We have to place this collector inside begin_frame, because we need // a current context for PStatGPUTimer to work. { - PStatGPUTimer timer(win->get_gsg(), win->get_draw_window_pcollector(), current_thread); + PStatGPUTimer timer(gsg, win->get_draw_window_pcollector(), current_thread); win->clear(current_thread); if (display_cat.is_spam()) { @@ -1547,8 +1547,8 @@ draw_bins(const GraphicsEngine::Windows &wlist, Thread *current_thread) { if (_auto_flip) { #ifdef DO_PSTATS // This is a good time to perform a latency query. - if (win->get_gsg()->get_timer_queries_active()) { - win->get_gsg()->issue_timer_query(GraphicsStateGuardian::_command_latency_pcollector.get_index()); + if (gsg->get_timer_queries_active()) { + gsg->issue_timer_query(GraphicsStateGuardian::_command_latency_pcollector.get_index()); } #endif @@ -1560,7 +1560,7 @@ draw_bins(const GraphicsEngine::Windows &wlist, Thread *current_thread) { win->begin_flip(); } { - PStatGPUTimer timer(win->get_gsg(), GraphicsEngine::_flip_end_pcollector, current_thread); + PStatGPUTimer timer(gsg, GraphicsEngine::_flip_end_pcollector, current_thread); win->end_flip(); } } diff --git a/panda/src/display/graphicsPipeSelection.cxx b/panda/src/display/graphicsPipeSelection.cxx index 9ac0e8aa1f..cef68b22c2 100644 --- a/panda/src/display/graphicsPipeSelection.cxx +++ b/panda/src/display/graphicsPipeSelection.cxx @@ -105,6 +105,8 @@ get_pipe_type(int n) const { LightMutexHolder holder(_lock); if (n >= 0 && n < (int)_pipe_types.size()) { result = _pipe_types[n]._type; + } else { + result = TypeHandle::none(); } } return result; diff --git a/panda/src/display/graphicsStateGuardian.cxx b/panda/src/display/graphicsStateGuardian.cxx index d068a1c4bc..ad532c5643 100644 --- a/panda/src/display/graphicsStateGuardian.cxx +++ b/panda/src/display/graphicsStateGuardian.cxx @@ -2061,8 +2061,6 @@ flush_timer_queries() { _last_num_queried = first; - int frame_index = ClockObject::get_global_clock()->get_frame_count(); - for (int i = 0; i < first; ++i) { CPT(TimerQueryContext) query = _pending_timer_queries[i]; diff --git a/panda/src/egg/eggVertex.cxx b/panda/src/egg/eggVertex.cxx index 973f583b7b..7663fd4eb3 100644 --- a/panda/src/egg/eggVertex.cxx +++ b/panda/src/egg/eggVertex.cxx @@ -138,11 +138,7 @@ has_uvw(const string &name) const { bool EggVertex:: has_aux(const string &name) const { AuxMap::const_iterator xi = _aux_map.find(name); - if (xi != _aux_map.end()) { - EggVertexAux *aux_obj = (*xi).second; - return true; - } - return false; + return (xi != _aux_map.end()); } /** diff --git a/panda/src/express/memoryInfo.cxx b/panda/src/express/memoryInfo.cxx index 815e57448d..d12b7313a0 100644 --- a/panda/src/express/memoryInfo.cxx +++ b/panda/src/express/memoryInfo.cxx @@ -108,7 +108,7 @@ determine_dynamic_type() { return; } - TypeHandle orig_type = _dynamic_type; + //TypeHandle orig_type = _dynamic_type; update_type_handle(_dynamic_type, got_type); } } diff --git a/panda/src/express/nodeReferenceCount.I b/panda/src/express/nodeReferenceCount.I index d27fa0a43a..4273f0b78c 100644 --- a/panda/src/express/nodeReferenceCount.I +++ b/panda/src/express/nodeReferenceCount.I @@ -129,7 +129,7 @@ node_ref() const { #endif ref(); - AtomicAdjust::inc(((NodeReferenceCount *)this)->_node_ref_count); + AtomicAdjust::inc(_node_ref_count); } /** @@ -174,7 +174,7 @@ node_unref_only() const { // you can't use PointerTo's? nassertv(_node_ref_count > 0); - AtomicAdjust::dec(((NodeReferenceCount *)this)->_node_ref_count); + AtomicAdjust::dec(_node_ref_count); } /** diff --git a/panda/src/express/nodeReferenceCount.h b/panda/src/express/nodeReferenceCount.h index 349d66660b..2312508f1b 100644 --- a/panda/src/express/nodeReferenceCount.h +++ b/panda/src/express/nodeReferenceCount.h @@ -42,14 +42,13 @@ PUBLISHED: INLINE void node_ref() const; INLINE bool node_unref() const; INLINE bool test_ref_count_integrity() const; - -protected: INLINE void node_unref_only() const; +protected: bool do_test_ref_count_integrity() const; private: - AtomicAdjust::Integer _node_ref_count; + mutable AtomicAdjust::Integer _node_ref_count; public: static TypeHandle get_class_type() { diff --git a/panda/src/express/ordered_vector.T b/panda/src/express/ordered_vector.T index 6a7100f90f..7ea866e52f 100644 --- a/panda/src/express/ordered_vector.T +++ b/panda/src/express/ordered_vector.T @@ -280,7 +280,6 @@ TYPENAME ordered_vector::SIZE_TYPE ordered_vector::CONST_ITERATOR first, TYPENAME ordered_vector::CONST_ITERATOR last, const TYPENAME ordered_vector::KEY_TYPE &key) const { - typedef pair::CONST_ITERATOR, TYPENAME ordered_vector::CONST_ITERATOR> pair_type; if (first == last) { // The list is empty; the key is not on the list. diff --git a/panda/src/glstuff/glGraphicsBuffer_src.cxx b/panda/src/glstuff/glGraphicsBuffer_src.cxx index d9df1d0be8..ad09596f9c 100644 --- a/panda/src/glstuff/glGraphicsBuffer_src.cxx +++ b/panda/src/glstuff/glGraphicsBuffer_src.cxx @@ -1753,7 +1753,7 @@ resolve_multisamples() { if (_rbm[RTP_depth_stencil] != 0 || _rbm[RTP_depth] != 0) { if (_shared_depth_buffer) { CLP(GraphicsBuffer) *graphics_buffer = NULL; - CLP(GraphicsBuffer) *highest_sort_graphics_buffer = NULL; + //CLP(GraphicsBuffer) *highest_sort_graphics_buffer = NULL; list ::iterator graphics_buffer_iterator; int max_sort_order = 0; @@ -1765,7 +1765,7 @@ resolve_multisamples() { // this call removes the entry from the list if (graphics_buffer->get_sort() >= max_sort_order) { max_sort_order = graphics_buffer->get_sort(); - highest_sort_graphics_buffer = graphics_buffer; + //highest_sort_graphics_buffer = graphics_buffer; } } } diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index bba123ea92..d21c4df57b 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -10804,8 +10804,6 @@ do_issue_tex_matrix() { */ void CLP(GraphicsStateGuardian):: do_issue_tex_gen() { - bool force_normal = false; - nassertv(_num_active_texture_stages <= _max_texture_stages); // These are passed in for the four OBJECT_PLANE or EYE_PLANE values; they @@ -10849,7 +10847,6 @@ do_issue_tex_gen() { glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); - force_normal = true; break; case TexGenAttrib::M_eye_cube_map: @@ -10872,7 +10869,6 @@ do_issue_tex_gen() { glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); glEnable(GL_TEXTURE_GEN_R); - force_normal = true; } break; @@ -10900,7 +10896,6 @@ do_issue_tex_gen() { glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); glEnable(GL_TEXTURE_GEN_R); - force_normal = true; } break; @@ -10924,7 +10919,6 @@ do_issue_tex_gen() { glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); glEnable(GL_TEXTURE_GEN_R); - force_normal = true; } break; @@ -10952,7 +10946,6 @@ do_issue_tex_gen() { glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); glEnable(GL_TEXTURE_GEN_R); - force_normal = true; } break; diff --git a/panda/src/glxdisplay/glxGraphicsWindow.cxx b/panda/src/glxdisplay/glxGraphicsWindow.cxx index 2a8a44e819..7dd43c8675 100644 --- a/panda/src/glxdisplay/glxGraphicsWindow.cxx +++ b/panda/src/glxdisplay/glxGraphicsWindow.cxx @@ -174,7 +174,6 @@ open_window() { << "No X visual: cannot open window.\n"; return false; } - Visual *visual = _visual_info->visual; if (glxgsg->_fbconfig != None) { setup_colormap(glxgsg->_fbconfig); diff --git a/panda/src/gobj/texture.cxx b/panda/src/gobj/texture.cxx index 8368dcf926..1802a36133 100644 --- a/panda/src/gobj/texture.cxx +++ b/panda/src/gobj/texture.cxx @@ -3374,7 +3374,7 @@ do_read_dds(CData *cdata, istream &in, const string &filename, bool header_only) unsigned int dimension = dds.get_uint32(); unsigned int misc_flag = dds.get_uint32(); unsigned int array_size = dds.get_uint32(); - unsigned int alpha_mode = dds.get_uint32(); + /*unsigned int alpha_mode = */dds.get_uint32(); switch (format) { case 2: // DXGI_FORMAT_R32G32B32A32_FLOAT @@ -4947,8 +4947,8 @@ do_compress_ram_image_bc4(const RamImage &uncompressed_image, // of the secondary interpolation mode supported by BC4. This is not // important for most textures, but it may be added in the future. - nassertv(x_blocks * y_blocks * 4 * 4 <= uncompressed_image._page_size); - nassertv(x_size * y_size == uncompressed_image._page_size); + nassertv((size_t)x_blocks * (size_t)y_blocks * 4 * 4 <= uncompressed_image._page_size); + nassertv((size_t)x_size * (size_t)y_size == uncompressed_image._page_size); static const int remap[] = {1, 7, 6, 5, 4, 3, 2, 0}; @@ -5046,8 +5046,8 @@ do_compress_ram_image_bc5(const RamImage &uncompressed_image, // BC5 uses the same compression algorithm as BC4, except repeated for two // channels. - nassertv(x_blocks * y_blocks * 4 * 4 * 2 <= uncompressed_image._page_size); - nassertv(stride * y_size == uncompressed_image._page_size); + nassertv((size_t)x_blocks * (size_t)y_blocks * 4 * 4 * 2 <= uncompressed_image._page_size); + nassertv((size_t)stride * (size_t)y_size == uncompressed_image._page_size); static const int remap[] = {1, 7, 6, 5, 4, 3, 2, 0}; diff --git a/panda/src/gobj/texturePeeker.I b/panda/src/gobj/texturePeeker.I index d41ee14db9..ccf6bdcc45 100644 --- a/panda/src/gobj/texturePeeker.I +++ b/panda/src/gobj/texturePeeker.I @@ -53,6 +53,6 @@ get_z_size() const { * Returns whether a given coordinate is inside of the texture dimensions. */ INLINE bool TexturePeeker:: -has_pixel(size_t x, size_t y) const { - return x < _x_size && y < _y_size; +has_pixel(int x, int y) const { + return x >= 0 && y >= 0 && x < _x_size && y < _y_size; } diff --git a/panda/src/gobj/texturePeeker.cxx b/panda/src/gobj/texturePeeker.cxx index cbe9003def..42e619e501 100644 --- a/panda/src/gobj/texturePeeker.cxx +++ b/panda/src/gobj/texturePeeker.cxx @@ -176,7 +176,7 @@ lookup(LColor &color, PN_stdfloat u, PN_stdfloat v) const { * coordinates are used. */ void TexturePeeker:: -fetch_pixel(LColor& color, size_t x, size_t y) const { +fetch_pixel(LColor& color, int x, int y) const { nassertv(x >= 0 && x < _x_size && y >= 0 && y < _y_size); const unsigned char *p = _image.p() + (y * _x_size + x) * _pixel_width; (*_get_texel)(color, p, _get_component); diff --git a/panda/src/gobj/texturePeeker.h b/panda/src/gobj/texturePeeker.h index e9af394dec..cb503bf041 100644 --- a/panda/src/gobj/texturePeeker.h +++ b/panda/src/gobj/texturePeeker.h @@ -36,10 +36,10 @@ PUBLISHED: INLINE int get_y_size() const; INLINE int get_z_size() const; - INLINE bool has_pixel(size_t x, size_t y) const; + INLINE bool has_pixel(int x, int y) const; void lookup(LColor &color, PN_stdfloat u, PN_stdfloat v) const; void lookup(LColor &color, PN_stdfloat u, PN_stdfloat v, PN_stdfloat w) const; - void fetch_pixel(LColor &color, size_t x, size_t y) const; + void fetch_pixel(LColor &color, int x, int y) const; bool lookup_bilinear(LColor &color, PN_stdfloat u, PN_stdfloat v) const; void filter_rect(LColor &color, PN_stdfloat min_u, PN_stdfloat min_v, diff --git a/panda/src/grutil/multitexReducer.cxx b/panda/src/grutil/multitexReducer.cxx index ea300e7902..8481444a2d 100644 --- a/panda/src/grutil/multitexReducer.cxx +++ b/panda/src/grutil/multitexReducer.cxx @@ -756,17 +756,13 @@ make_texture_layer(const NodePath &render, case TextureStage::CM_modulate: { TextureStage::CombineSource source0 = stage_info._stage->get_combine_rgb_source0(); - TextureStage::CombineOperand operand0 = stage_info._stage->get_combine_rgb_operand0(); TextureStage::CombineSource source1 = stage_info._stage->get_combine_rgb_source1(); - TextureStage::CombineOperand operand1 = stage_info._stage->get_combine_rgb_operand1(); // Since modulate doesn't care about order, let's establish the // convention that the lowest-numbered source operand is in slot 0 // (just for purposes of comparison). if (source1 < source0) { source0 = stage_info._stage->get_combine_rgb_source1(); - operand0 = stage_info._stage->get_combine_rgb_operand1(); source1 = stage_info._stage->get_combine_rgb_source0(); - operand1 = stage_info._stage->get_combine_rgb_operand0(); } if (source0 == TextureStage::CS_primary_color && diff --git a/panda/src/grutil/pipeOcclusionCullTraverser.cxx b/panda/src/grutil/pipeOcclusionCullTraverser.cxx index ca4316c5cc..91ebeb6559 100644 --- a/panda/src/grutil/pipeOcclusionCullTraverser.cxx +++ b/panda/src/grutil/pipeOcclusionCullTraverser.cxx @@ -673,8 +673,6 @@ show_results(int num_fragments, const Geom *geom, TransparencyAttrib::make(TransparencyAttrib::M_alpha), ColorAttrib::make_flat(color)); - GraphicsStateGuardian *gsg = _buffer->get_gsg(); - CullableObject *internal_viz = new CullableObject(geom, state, internal_transform); _internal_cull_handler->record_object(internal_viz, _internal_trav); diff --git a/panda/src/grutil/shaderTerrainMesh.cxx b/panda/src/grutil/shaderTerrainMesh.cxx index 8e655de000..8c2d03cdd4 100644 --- a/panda/src/grutil/shaderTerrainMesh.cxx +++ b/panda/src/grutil/shaderTerrainMesh.cxx @@ -534,7 +534,7 @@ void ShaderTerrainMesh::add_for_draw(CullTraverser *trav, CullTraverserData &dat // After rendering, increment the view index ++_current_view_index; - if (_current_view_index > stm_max_views) { + if (_current_view_index > (size_t)stm_max_views) { shader_terrain_cat.error() << "More views than supported! Increase the stm-max-views config variable!" << endl; } diff --git a/panda/src/parametrics/curveFitter.cxx b/panda/src/parametrics/curveFitter.cxx index 0cc20c20fa..6592d7aff2 100644 --- a/panda/src/parametrics/curveFitter.cxx +++ b/panda/src/parametrics/curveFitter.cxx @@ -154,11 +154,9 @@ void CurveFitter:: sample(ParametricCurveCollection *curves, int count) { nassertv(curves != (ParametricCurveCollection *)NULL); PN_stdfloat max_t = curves->get_max_t(); - PN_stdfloat t, last_t, d; + PN_stdfloat t; DataPoint dp; - last_t = 0.0f; - d = 0.0f; int i; for (i = 0; i < count; i++) { t = max_t * (PN_stdfloat)i / (PN_stdfloat)(count-1); diff --git a/panda/src/pgraph/clipPlaneAttrib.cxx b/panda/src/pgraph/clipPlaneAttrib.cxx index 7fd2da2d83..e62a3d6e24 100644 --- a/panda/src/pgraph/clipPlaneAttrib.cxx +++ b/panda/src/pgraph/clipPlaneAttrib.cxx @@ -911,7 +911,7 @@ complete_pointers(TypedWritable **p_list, BamReader *manager) { AttribNodeRegistry *areg = AttribNodeRegistry::get_global_ptr(); if (manager->get_file_minor_ver() >= 40) { - for (int i = 0; i < _off_planes.size(); ++i) { + for (size_t i = 0; i < _off_planes.size(); ++i) { pi += _off_planes[i].complete_pointers(p_list + pi, manager); int n = areg->find_node(_off_planes[i]); @@ -921,7 +921,7 @@ complete_pointers(TypedWritable **p_list, BamReader *manager) { } } - for (int i = 0; i < _on_planes.size(); ++i) { + for (size_t i = 0; i < _on_planes.size(); ++i) { pi += _on_planes[i].complete_pointers(p_list + pi, manager); int n = areg->find_node(_on_planes[i]); diff --git a/panda/src/pgraph/lightAttrib.cxx b/panda/src/pgraph/lightAttrib.cxx index a677345b8a..b80eb3b428 100644 --- a/panda/src/pgraph/lightAttrib.cxx +++ b/panda/src/pgraph/lightAttrib.cxx @@ -935,11 +935,11 @@ complete_pointers(TypedWritable **p_list, BamReader *manager) { int pi = RenderAttrib::complete_pointers(p_list, manager); if (manager->get_file_minor_ver() >= 40) { - for (int i = 0; i < _off_lights.size(); ++i) { + for (size_t i = 0; i < _off_lights.size(); ++i) { pi += _off_lights[i].complete_pointers(p_list + pi, manager); } - for (int i = 0; i < _on_lights.size(); ++i) { + for (size_t i = 0; i < _on_lights.size(); ++i) { pi += _on_lights[i].complete_pointers(p_list + pi, manager); } @@ -978,7 +978,7 @@ finalize(BamReader *manager) { // Check if any of the nodes we loaded are mentioned in the // AttribNodeRegistry. If so, replace them. - for (int i = 0; i < _off_lights.size(); ++i) { + for (size_t i = 0; i < _off_lights.size(); ++i) { int n = areg->find_node(_off_lights[i]); if (n != -1) { // If it's in the registry, replace it. @@ -986,7 +986,7 @@ finalize(BamReader *manager) { } } - for (int i = 0; i < _on_lights.size(); ++i) { + for (size_t i = 0; i < _on_lights.size(); ++i) { int n = areg->find_node(_on_lights[i]); if (n != -1) { // If it's in the registry, replace it. @@ -1067,12 +1067,12 @@ fillin(DatagramIterator &scan, BamReader *manager) { if (manager->get_file_minor_ver() >= 40) { _off_lights.resize(scan.get_uint16()); - for (int i = 0; i < _off_lights.size(); ++i) { + for (size_t i = 0; i < _off_lights.size(); ++i) { _off_lights[i].fillin(scan, manager); } _on_lights.resize(scan.get_uint16()); - for (int i = 0; i < _on_lights.size(); ++i) { + for (size_t i = 0; i < _on_lights.size(); ++i) { _on_lights[i].fillin(scan, manager); } } else { diff --git a/panda/src/pgraph/loader.cxx b/panda/src/pgraph/loader.cxx index 671a40c638..32187508e0 100644 --- a/panda/src/pgraph/loader.cxx +++ b/panda/src/pgraph/loader.cxx @@ -431,8 +431,6 @@ save_file(const Filename &filename, const LoaderOptions &options, return false; } - VirtualFileSystem *vfs = VirtualFileSystem::get_global_ptr(); - bool result = try_save_file(this_filename, this_options, node, requested_type); if (!result) { if (report_errors) { @@ -451,10 +449,7 @@ save_file(const Filename &filename, const LoaderOptions &options, bool Loader:: try_save_file(const Filename &pathname, const LoaderOptions &options, PandaNode *node, LoaderFileType *requested_type) const { - bool report_errors = ((options.get_flags() & LoaderOptions::LF_report_errors) != 0 || loader_cat.is_debug()); - - bool result = requested_type->save_file(pathname, options, node); - return result; + return requested_type->save_file(pathname, options, node); } /** diff --git a/panda/src/pgraph/occluderEffect.cxx b/panda/src/pgraph/occluderEffect.cxx index 36c874a1f2..f27c486d88 100644 --- a/panda/src/pgraph/occluderEffect.cxx +++ b/panda/src/pgraph/occluderEffect.cxx @@ -47,10 +47,6 @@ add_on_occluder(const NodePath &occluder) const { nassertr(!occluder.is_empty() && occluder.node()->is_of_type(OccluderNode::get_class_type()), this); OccluderEffect *effect = new OccluderEffect(*this); effect->_on_occluders.insert(occluder); - - pair insert_result = - effect->_on_occluders.insert(Occluders::value_type(occluder)); - return return_new(effect); } @@ -170,7 +166,7 @@ complete_pointers(TypedWritable **p_list, BamReader *manager) { AttribNodeRegistry *areg = AttribNodeRegistry::get_global_ptr(); if (manager->get_file_minor_ver() >= 40) { - for (int i = 0; i < _on_occluders.size(); ++i) { + for (size_t i = 0; i < _on_occluders.size(); ++i) { pi += _on_occluders[i].complete_pointers(p_list + pi, manager); int n = areg->find_node(_on_occluders[i]); diff --git a/panda/src/pgraph/pandaNode.cxx b/panda/src/pgraph/pandaNode.cxx index 38a1c5f096..69e2dcabf7 100644 --- a/panda/src/pgraph/pandaNode.cxx +++ b/panda/src/pgraph/pandaNode.cxx @@ -1597,7 +1597,7 @@ replace_node(PandaNode *other) { // Switch the parents. Thread *current_thread = Thread::get_current_thread(); Parents other_parents = other->get_parents(); - for (int i = 0; i < other_parents.get_num_parents(); ++i) { + for (size_t i = 0; i < other_parents.get_num_parents(); ++i) { PandaNode *parent = other_parents.get_parent(i); if (find_parent(parent) != -1) { // This node was already a child of this parent; don't change it. @@ -1902,7 +1902,7 @@ is_under_scene_root() const { } Parents parents = get_parents(); - for (int i = 0; i < parents.get_num_parents(); ++i) { + for (size_t i = 0; i < parents.get_num_parents(); ++i) { PandaNode *parent = parents.get_parent(i); if (parent->find_stashed((PandaNode *)this) == -1) { if (parent->is_under_scene_root()) { @@ -2401,7 +2401,7 @@ void PandaNode:: r_mark_geom_bounds_stale(Thread *current_thread) { Children children = get_children(current_thread); - int i; + size_t i; for (i = 0; i < children.get_num_children(); i++) { PandaNode *child = children.get_child(i); child->r_mark_geom_bounds_stale(current_thread); @@ -2550,7 +2550,7 @@ r_prepare_scene(GraphicsStateGuardianBase *gsg, const RenderState *node_state, Children children = get_children(current_thread); // We must call get_num_children() each time through the loop, in case we're // running SIMPLE_THREADS and we get interrupted. - int i; + size_t i; for (i = 0; i < children.get_num_children(); i++) { PandaNode *child = children.get_child(i); CPT(RenderState) child_state = node_state->compose(child->get_state()); @@ -2760,7 +2760,7 @@ find_node_above(PandaNode *node) { } Parents parents = get_parents(); - for (int i = 0; i < parents.get_num_parents(); ++i) { + for (size_t i = 0; i < parents.get_num_parents(); ++i) { PandaNode *parent = parents.get_parent(i); if (parent->find_node_above(node)) { return true; diff --git a/panda/src/pipeline/pipelineCyclerTrueImpl.I b/panda/src/pipeline/pipelineCyclerTrueImpl.I index d2e78fca2d..2c393d0546 100644 --- a/panda/src/pipeline/pipelineCyclerTrueImpl.I +++ b/panda/src/pipeline/pipelineCyclerTrueImpl.I @@ -368,7 +368,13 @@ get_write_count() const { INLINE PT(CycleData) PipelineCyclerTrueImpl:: cycle_2() { TAU_PROFILE("PT(CycleData) PipelineCyclerTrueImpl::cycle_2()", " ", TAU_USER); - PT(CycleData) last_val = _data[1]._cdata.p(); + + // This trick moves an NPT into a PT without unnecessarily incrementing and + // subsequently decrementing the regular reference count. + PT(CycleData) last_val; + last_val.swap(_data[1]._cdata); + last_val->node_unref_only(); + nassertr(_lock.debug_is_locked(), last_val); nassertr(_dirty, last_val); nassertr(_num_stages == 2, last_val); @@ -389,7 +395,13 @@ cycle_2() { INLINE PT(CycleData) PipelineCyclerTrueImpl:: cycle_3() { TAU_PROFILE("PT(CycleData) PipelineCyclerTrueImpl::cycle_3()", " ", TAU_USER); - PT(CycleData) last_val = _data[2]._cdata.p(); + + // This trick moves an NPT into a PT without unnecessarily incrementing and + // subsequently decrementing the regular reference count. + PT(CycleData) last_val; + last_val.swap(_data[2]._cdata); + last_val->node_unref_only(); + nassertr(_lock.debug_is_locked(), last_val); nassertr(_dirty, last_val); nassertr(_num_stages == 3, last_val); diff --git a/panda/src/pipeline/pipelineCyclerTrueImpl.cxx b/panda/src/pipeline/pipelineCyclerTrueImpl.cxx index 9610a98bb9..b1466ce155 100644 --- a/panda/src/pipeline/pipelineCyclerTrueImpl.cxx +++ b/panda/src/pipeline/pipelineCyclerTrueImpl.cxx @@ -255,7 +255,12 @@ write_stage_upstream(int pipeline_stage, bool force_to_0, Thread *current_thread */ PT(CycleData) PipelineCyclerTrueImpl:: cycle() { - PT(CycleData) last_val = _data[_num_stages - 1]._cdata.p(); + // This trick moves an NPT into a PT without unnecessarily incrementing and + // subsequently decrementing the regular reference count. + PT(CycleData) last_val; + last_val.swap(_data[_num_stages - 1]._cdata); + last_val->node_unref_only(); + nassertr(_lock.debug_is_locked(), last_val); nassertr(_dirty, last_val); diff --git a/panda/src/pnmimage/pfmFile.cxx b/panda/src/pnmimage/pfmFile.cxx index 75bb06682f..a6d08b5038 100644 --- a/panda/src/pnmimage/pfmFile.cxx +++ b/panda/src/pnmimage/pfmFile.cxx @@ -86,7 +86,8 @@ clear() { void PfmFile:: clear(int x_size, int y_size, int num_channels) { nassertv(x_size >= 0 && y_size >= 0); - nassertv(num_channels > 0 && num_channels <= 4 || (x_size == 0 && y_size == 0 && num_channels == 0)); + nassertv((num_channels > 0 && num_channels <= 4) || + (x_size == 0 && y_size == 0 && num_channels == 0)); _x_size = x_size; _y_size = y_size; @@ -632,7 +633,6 @@ calc_average_point(LPoint3f &result, PN_float32 x, PN_float32 y, PN_float32 radi continue; } - const LPoint3f &p = get_point(xi, yi); int gi = (yi - min_y) * y_size + (xi - min_x); nassertr(gi >= 0 && gi < size, false); mini_grid[gi]._sxi = xi; @@ -1541,7 +1541,7 @@ apply_crop(int x_begin, int x_end, int y_begin, int y_end) { int new_x_size = x_end - x_begin; int new_y_size = y_end - y_begin; Table new_table; - int new_size = new_x_size * new_y_size * _num_channels; + size_t new_size = (size_t)new_x_size * (size_t)new_y_size * (size_t)_num_channels; // We allocate a little bit bigger to allow safe overflow: you can call // get_point3() or get_point4() on the last point of a 1- or 3-channel diff --git a/panda/src/pnmimage/pnm-image-filter-core.cxx b/panda/src/pnmimage/pnm-image-filter-core.cxx index 8907068b50..273a4b0713 100644 --- a/panda/src/pnmimage/pnm-image-filter-core.cxx +++ b/panda/src/pnmimage/pnm-image-filter-core.cxx @@ -25,7 +25,6 @@ FUNCTION_NAME(IMAGETYPE &dest, const IMAGETYPE &source, // the image xelvals scaled in the A direction only. This will hold the // adjusted xel data from our first pass. - typedef StoreType *StoreTypeP; StoreType **matrix = (StoreType **)PANDA_MALLOC_ARRAY(dest.ASIZE() * sizeof(StoreType *)); int a, b; diff --git a/panda/src/pnmimage/pnm-image-filter-sparse-core.cxx b/panda/src/pnmimage/pnm-image-filter-sparse-core.cxx index 0709c25cd3..4edf632ee4 100644 --- a/panda/src/pnmimage/pnm-image-filter-sparse-core.cxx +++ b/panda/src/pnmimage/pnm-image-filter-sparse-core.cxx @@ -27,7 +27,6 @@ FUNCTION_NAME(IMAGETYPE &dest, const IMAGETYPE &source, // the image xelvals scaled in the A direction only. This will hold the // adjusted xel data from our first pass. - typedef StoreType *StoreTypeP; StoreType **matrix = (StoreType **)PANDA_MALLOC_ARRAY(dest.ASIZE() * sizeof(StoreType *)); StoreType **matrix_weight = (StoreType **)PANDA_MALLOC_ARRAY(dest.ASIZE() * sizeof(StoreType *)); diff --git a/panda/src/pnmimagetypes/pnmFileTypeStbImage.cxx b/panda/src/pnmimagetypes/pnmFileTypeStbImage.cxx index 2c8932f7c9..2807ee1b18 100644 --- a/panda/src/pnmimagetypes/pnmFileTypeStbImage.cxx +++ b/panda/src/pnmimagetypes/pnmFileTypeStbImage.cxx @@ -114,10 +114,10 @@ static void cb_skip(void *user, int n) { // Implement skip by just reading and discarding the result. static const int size = 4096; - char data[4096]; - while (n > 4096) { - in->read(data, 4096); - n -= 4096; + char data[size]; + while (n > size) { + in->read(data, size); + n -= size; } if (n > 0) { in->read(data, n); diff --git a/panda/src/pnmtext/freetypeFont.cxx b/panda/src/pnmtext/freetypeFont.cxx index d66bcee868..f42b5b72bc 100644 --- a/panda/src/pnmtext/freetypeFont.cxx +++ b/panda/src/pnmtext/freetypeFont.cxx @@ -241,8 +241,8 @@ copy_bitmap_to_pnmimage(const FT_Bitmap &bitmap, PNMImage &image) { // This is the easy case: we can copy the rendered glyph directly into our // image, one pixel at a time. unsigned char *buffer_row = bitmap.buffer; - for (int yi = 0; yi < bitmap.rows; yi++) { - for (int xi = 0; xi < bitmap.width; xi++) { + for (int yi = 0; yi < (int)bitmap.rows; yi++) { + for (int xi = 0; xi < (int)bitmap.width; xi++) { image.set_gray_val(xi, yi, buffer_row[xi]); } buffer_row += bitmap.pitch; @@ -252,11 +252,11 @@ copy_bitmap_to_pnmimage(const FT_Bitmap &bitmap, PNMImage &image) { // This is a little bit more work: we have to expand the one-bit-per-pixel // bitmap into a one-byte-per-pixel image. unsigned char *buffer_row = bitmap.buffer; - for (int yi = 0; yi < bitmap.rows; yi++) { + for (int yi = 0; yi < (int)bitmap.rows; yi++) { xelval maxval = image.get_maxval(); int bit = 0x80; unsigned char *b = buffer_row; - for (int xi = 0; xi < bitmap.width; xi++) { + for (int xi = 0; xi < (int)bitmap.width; xi++) { if (*b & bit) { image.set_gray_val(xi, yi, maxval); } else { @@ -277,8 +277,8 @@ copy_bitmap_to_pnmimage(const FT_Bitmap &bitmap, PNMImage &image) { // Here we must expand a grayscale pixmap with n levels of gray into our // 256-level texture. unsigned char *buffer_row = bitmap.buffer; - for (int yi = 0; yi < bitmap.rows; yi++) { - for (int xi = 0; xi < bitmap.width; xi++) { + for (int yi = 0; yi < (int)bitmap.rows; yi++) { + for (int xi = 0; xi < (int)bitmap.width; xi++) { image.set_gray(xi, yi, (PN_stdfloat)buffer_row[xi] / (bitmap.num_grays - 1)); } buffer_row += bitmap.pitch; @@ -691,7 +691,6 @@ outline_nurbs(NurbsCurveResult *ncr) { PN_stdfloat st0 = st, st1 = st; if (i > 0) { - PN_stdfloat last_t = ncr->get_sample_t(i - 1); st0 = ncr->get_sample_t(i - 1) * 0.1f + st * 0.9f; } if (i < num_samples - 1) { diff --git a/panda/src/putil/doubleBitMask.I b/panda/src/putil/doubleBitMask.I index 6d21ad2ffb..a6997af549 100644 --- a/panda/src/putil/doubleBitMask.I +++ b/panda/src/putil/doubleBitMask.I @@ -700,7 +700,7 @@ operator ^= (const DoubleBitMask &other) { template INLINE void DoubleBitMask:: operator <<= (int shift) { - _hi = (_hi << shift) | ((_lo >> half_bits - shift) & BitMaskType::lower_on(shift)); + _hi = (_hi << shift) | ((_lo >> (half_bits - shift)) & BitMaskType::lower_on(shift)); _lo <<= shift; } @@ -710,7 +710,7 @@ operator <<= (int shift) { template INLINE void DoubleBitMask:: operator >>= (int shift) { - _lo = (_lo >> shift) | ((_hi & BitMaskType::lower_on(shift)) << half_bits - shift); + _lo = (_lo >> shift) | ((_hi & BitMaskType::lower_on(shift)) << (half_bits - shift)); _hi >>= shift; } diff --git a/panda/src/putil/simpleHashMap.I b/panda/src/putil/simpleHashMap.I index 67db8830b9..d68fae9542 100644 --- a/panda/src/putil/simpleHashMap.I +++ b/panda/src/putil/simpleHashMap.I @@ -553,7 +553,6 @@ expand_table() { nassertv(_num_entries == 0); // Now copy the entries from the old table into the new table. - int num_added = 0; for (size_t i = 0; i < old_table_size; ++i) { if (old_map.has_element(i)) { size_t new_index = get_hash(old_map._table[i]._key); diff --git a/panda/src/putil/weakKeyHashMap.I b/panda/src/putil/weakKeyHashMap.I index ea5aa43e9a..c80e47723d 100644 --- a/panda/src/putil/weakKeyHashMap.I +++ b/panda/src/putil/weakKeyHashMap.I @@ -600,7 +600,6 @@ expand_table() { nassertv(_num_entries == 0); // Now copy the entries from the old table into the new table. - int num_added = 0; for (size_t i = 0; i < old_table_size; ++i) { if (old_map.has_element(i)) { size_t new_index = get_hash(old_map._table[i]._key.get_orig()); diff --git a/panda/src/rocket/rocketInputHandler.cxx b/panda/src/rocket/rocketInputHandler.cxx index 5451beda9e..fcfa6dc2cf 100644 --- a/panda/src/rocket/rocketInputHandler.cxx +++ b/panda/src/rocket/rocketInputHandler.cxx @@ -152,7 +152,6 @@ get_rocket_key(const ButtonHandle handle) { void RocketInputHandler:: do_transmit_data(DataGraphTraverser *trav, const DataNodeTransmit &input, DataNodeTransmit &output) { - Thread *current_thread = trav->get_current_thread(); MutexHolder holder(_lock); if (input.has_data(_pixel_xy_input)) { diff --git a/panda/src/text/dynamicTextFont.cxx b/panda/src/text/dynamicTextFont.cxx index 705bd1a943..09369a12b9 100644 --- a/panda/src/text/dynamicTextFont.cxx +++ b/panda/src/text/dynamicTextFont.cxx @@ -220,7 +220,6 @@ write(ostream &out, int indent_level) const { Cache::const_iterator ci; for (ci = _cache.begin(); ci != _cache.end(); ++ci) { int glyph_index = (*ci).first; - const TextGlyph *glyph = (*ci).second; indent(out, indent_level + 2) << glyph_index; @@ -630,7 +629,7 @@ copy_bitmap_to_texture(const FT_Bitmap &bitmap, DynamicTextGlyph *glyph) { // This is the easy case: we can memcpy the rendered glyph directly into // our texture image, one row at a time. unsigned char *buffer_row = bitmap.buffer; - for (int yi = 0; yi < bitmap.rows; yi++) { + for (int yi = 0; yi < (int)bitmap.rows; yi++) { unsigned char *texture_row = glyph->get_row(yi); nassertv(texture_row != (unsigned char *)NULL); @@ -642,13 +641,13 @@ copy_bitmap_to_texture(const FT_Bitmap &bitmap, DynamicTextGlyph *glyph) { // This is a little bit more work: we have to expand the one-bit-per-pixel // bitmap into a one-byte-per-pixel texture. unsigned char *buffer_row = bitmap.buffer; - for (int yi = 0; yi < bitmap.rows; yi++) { + for (int yi = 0; yi < (int)bitmap.rows; yi++) { unsigned char *texture_row = glyph->get_row(yi); nassertv(texture_row != (unsigned char *)NULL); int bit = 0x80; unsigned char *b = buffer_row; - for (int xi = 0; xi < bitmap.width; xi++) { + for (int xi = 0; xi < (int)bitmap.width; xi++) { if (*b & bit) { texture_row[xi] = 0xff; } else { @@ -669,10 +668,10 @@ copy_bitmap_to_texture(const FT_Bitmap &bitmap, DynamicTextGlyph *glyph) { // Here we must expand a grayscale pixmap with n levels of gray into our // 256-level texture. unsigned char *buffer_row = bitmap.buffer; - for (int yi = 0; yi < bitmap.rows; yi++) { + for (int yi = 0; yi < (int)bitmap.rows; yi++) { unsigned char *texture_row = glyph->get_row(yi); nassertv(texture_row != (unsigned char *)NULL); - for (int xi = 0; xi < bitmap.width; xi++) { + for (int xi = 0; xi < (int)bitmap.width; xi++) { texture_row[xi] = (int)(buffer_row[xi] * 255) / (bitmap.num_grays - 1); } buffer_row += bitmap.pitch; diff --git a/panda/src/text/textAssembler.cxx b/panda/src/text/textAssembler.cxx index 1f8b9dc74e..4829576407 100644 --- a/panda/src/text/textAssembler.cxx +++ b/panda/src/text/textAssembler.cxx @@ -1329,10 +1329,9 @@ assemble_paragraph(TextAssembler::PlacedGlyphs &placed_glyphs) { // width is defined by the wordwrap size with the upper left corner // starting from 0,0,0 if the wordwrap size is unspecified the alignment // could eventually result wrong. - PN_stdfloat xpos; + PN_stdfloat xpos = 0; switch (align) { case TextProperties::A_left: - xpos = 0.0f; _lr[0] = max(_lr[0], row_width); break; @@ -1348,7 +1347,6 @@ assemble_paragraph(TextAssembler::PlacedGlyphs &placed_glyphs) { break; case TextProperties::A_boxed_left: - xpos = 0.0f; _lr[0] = max(_lr[0], max(row_width, wordwrap)); break; diff --git a/panda/src/text/textNode.cxx b/panda/src/text/textNode.cxx index b9bfd22125..454c7dd7f3 100644 --- a/panda/src/text/textNode.cxx +++ b/panda/src/text/textNode.cxx @@ -911,7 +911,7 @@ count_geoms(PandaNode *node) { } Children children = node->get_children(); - for (int i = 0; i < children.get_num_children(); ++i) { + for (size_t i = 0; i < children.get_num_children(); ++i) { num_geoms += count_geoms(children.get_child(i)); } diff --git a/panda/src/tform/mouseWatcher.cxx b/panda/src/tform/mouseWatcher.cxx index 7f6355c135..30f2c4762e 100644 --- a/panda/src/tform/mouseWatcher.cxx +++ b/panda/src/tform/mouseWatcher.cxx @@ -1474,10 +1474,10 @@ do_transmit_data(DataGraphTraverser *trav, const DataNodeTransmit &input, << " seconds of inactivity; releasing held buttons.\n"; } { - for (int i = 0; i < _current_buttons_down.get_num_bits(); ++i) { + for (size_t i = 0; i < _current_buttons_down.get_num_bits(); ++i) { if (_current_buttons_down.get_bit(i)) { - release(ButtonHandle(i)); - new_button_events.add_event(ButtonEvent(ButtonHandle(i), ButtonEvent::T_up)); + release(ButtonHandle((int)i)); + new_button_events.add_event(ButtonEvent(ButtonHandle((int)i), ButtonEvent::T_up)); } } } @@ -1488,10 +1488,10 @@ do_transmit_data(DataGraphTraverser *trav, const DataNodeTransmit &input, case IS_inactive_to_active: // "Press" all of the buttons we "released" before. { - for (int i = 0; i < _current_buttons_down.get_num_bits(); ++i) { + for (size_t i = 0; i < _current_buttons_down.get_num_bits(); ++i) { if (_current_buttons_down.get_bit(i)) { - press(ButtonHandle(i), false); - new_button_events.add_event(ButtonEvent(ButtonHandle(i), ButtonEvent::T_down)); + press(ButtonHandle((int)i), false); + new_button_events.add_event(ButtonEvent(ButtonHandle((int)i), ButtonEvent::T_down)); } } } diff --git a/panda/src/tinydisplay/ztriangle_two.h b/panda/src/tinydisplay/ztriangle_two.h index d1c5a56916..6bb255ce01 100644 --- a/panda/src/tinydisplay/ztriangle_two.h +++ b/panda/src/tinydisplay/ztriangle_two.h @@ -81,7 +81,7 @@ FNAME(smooth_untextured) (ZBuffer *zb, #define EARLY_OUT() \ { \ - int c0, c1, c2; \ + unsigned int c0, c1, c2; \ c0 = RGBA_TO_PIXEL(p0->r, p0->g, p0->b, p0->a); \ c1 = RGBA_TO_PIXEL(p1->r, p1->g, p1->b, p1->a); \ c2 = RGBA_TO_PIXEL(p2->r, p2->g, p2->b, p2->a); \ @@ -223,7 +223,7 @@ FNAME(smooth_textured) (ZBuffer *zb, #define EARLY_OUT() \ { \ - int c0, c1, c2; \ + unsigned int c0, c1, c2; \ c0 = RGBA_TO_PIXEL(p0->r, p0->g, p0->b, p0->a); \ c1 = RGBA_TO_PIXEL(p1->r, p1->g, p1->b, p1->a); \ c2 = RGBA_TO_PIXEL(p2->r, p2->g, p2->b, p2->a); \ diff --git a/panda/src/vision/config_vision.cxx b/panda/src/vision/config_vision.cxx index 91c6acac86..3b53c0ed02 100644 --- a/panda/src/vision/config_vision.cxx +++ b/panda/src/vision/config_vision.cxx @@ -60,8 +60,8 @@ init_libvision() { PandaSystem *ps = PandaSystem::get_global_ptr(); ps->add_system("OpenCV"); - TexturePool *ts = TexturePool::get_global_ptr(); #ifndef HAVE_FFMPEG + TexturePool *ts = TexturePool::get_global_ptr(); ts->register_texture_type(OpenCVTexture::make_texture, "avi"); #endif #endif diff --git a/panda/src/vision/webcamVideoCursorV4L.cxx b/panda/src/vision/webcamVideoCursorV4L.cxx index c12568882d..64090c53aa 100644 --- a/panda/src/vision/webcamVideoCursorV4L.cxx +++ b/panda/src/vision/webcamVideoCursorV4L.cxx @@ -305,7 +305,7 @@ WebcamVideoCursorV4L(WebcamVideoV4L *src) : MovieVideoCursor(src) { // Set up the mmap buffers struct v4l2_buffer buf; - for (int i = 0; i < _bufcount; ++i) { + for (unsigned int i = 0; i < (unsigned int)_bufcount; ++i) { memset(&buf, 0, sizeof buf); buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; buf.memory = V4L2_MEMORY_MMAP; @@ -367,7 +367,7 @@ WebcamVideoCursorV4L:: close(_fd); } if (_buffers) { - for (int i = 0; i < _bufcount; ++i) { + for (unsigned int i = 0; i < (unsigned int)_bufcount; ++i) { munmap(_buffers[i], _buflens[i]); } free(_buffers); @@ -455,7 +455,7 @@ fetch_buffer() { } // Flip the image vertically - for (size_t row = 0; row < _size_y; ++row) { + for (int row = 0; row < _size_y; ++row) { memcpy(block + (_size_y - row - 1) * new_bpl, newbuf + row * new_bpl, new_bpl); } free(newbuf); diff --git a/panda/src/vision/webcamVideoOpenCV.cxx b/panda/src/vision/webcamVideoOpenCV.cxx index 92a22dc4a5..d4c68070fa 100644 --- a/panda/src/vision/webcamVideoOpenCV.cxx +++ b/panda/src/vision/webcamVideoOpenCV.cxx @@ -33,7 +33,7 @@ find_all_webcams_opencv() { "numbers that are assumed to be available via OpenCV to the " "WebcamVideo interface. The default camera index is 0. " "Specify empty string if there are no available cameras.")); - for (int i = 0; i < wemcam_opencv_camera_index.get_num_words(); ++i) { + for (size_t i = 0; i < wemcam_opencv_camera_index.get_num_words(); ++i) { PT(WebcamVideo) wc = new WebcamVideoOpenCV(wemcam_opencv_camera_index[i]); WebcamVideoOpenCV::_all_webcams.push_back(wc); } diff --git a/pandatool/src/daeegg/daeCharacter.cxx b/pandatool/src/daeegg/daeCharacter.cxx index 0d6e0d1e39..31d8db02cb 100644 --- a/pandatool/src/daeegg/daeCharacter.cxx +++ b/pandatool/src/daeegg/daeCharacter.cxx @@ -177,7 +177,7 @@ influence_vertex(int index, EggVertex *vertex) { for (size_t pa = 0; pa < influence->GetPairCount(); ++pa) { const FCDJointWeightPair* jwpair = influence->GetPair(pa); - if (jwpair->jointIndex >= 0 && jwpair->jointIndex < _joints.size()) { + if (jwpair->jointIndex >= 0 && jwpair->jointIndex < (int)_joints.size()) { EggGroup *joint = _joints[jwpair->jointIndex]._group.p(); if (joint != NULL) { joint->ref_vertex(vertex, jwpair->weight); diff --git a/pandatool/src/egg-optchar/eggOptchar.cxx b/pandatool/src/egg-optchar/eggOptchar.cxx index d6f541045e..4198a3b84c 100644 --- a/pandatool/src/egg-optchar/eggOptchar.cxx +++ b/pandatool/src/egg-optchar/eggOptchar.cxx @@ -1508,7 +1508,7 @@ do_defpose() { nassertv(anim_index != -1); // Now we can recursively apply the default pose to the hierarchy. - ch->get_root_joint()->apply_default_pose(anim_index, frame); + root_joint->apply_default_pose(anim_index, frame); } int main(int argc, char *argv[]) { From a4554a7dfeafea635f65fcf33f03e46ce8563f57 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 14 Jul 2016 13:21:39 +0200 Subject: [PATCH 018/112] gcc build fix --- dtool/src/dtoolbase/dtoolbase.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dtool/src/dtoolbase/dtoolbase.h b/dtool/src/dtoolbase/dtoolbase.h index eff05d5022..712e7172e4 100644 --- a/dtool/src/dtoolbase/dtoolbase.h +++ b/dtool/src/dtoolbase/dtoolbase.h @@ -72,6 +72,10 @@ #endif #endif /* WIN32_VC */ +#ifndef __has_builtin +#define __has_builtin(x) 0 +#endif + // Use NODEFAULT to optimize a switch() stmt to tell MSVC to automatically go // to the final untested case after it has failed all the other cases (i.e. // 'assume at least one of the cases is always true') @@ -79,7 +83,7 @@ #define NODEFAULT default: assert(0); break; #elif defined(_MSC_VER) #define NODEFAULT default: __assume(0); // special VC keyword -#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) || (defined(__has_builtin) && __has_builtin(__builtin_unreachable)) +#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) || __has_builtin(__builtin_unreachable) #define NODEFAULT default: __builtin_unreachable(); #else #define NODEFAULT From 400bc2cc267a6e5a3dd75da152c455af21226772 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 15 Jul 2016 11:47:49 +0200 Subject: [PATCH 019/112] Support .ktx textures, ETC1/ETC2/EAC compression --- panda/src/framework/windowFramework.cxx | 12 +- panda/src/gles2gsg/gles2gsg.h | 10 + panda/src/glesgsg/glesgsg.h | 11 + .../glstuff/glGraphicsStateGuardian_src.cxx | 160 ++- panda/src/glstuff/glShaderContext_src.cxx | 9 + panda/src/gobj/texture.I | 23 +- panda/src/gobj/texture.cxx | 1086 ++++++++++++++++- panda/src/gobj/texture.h | 9 + panda/src/gobj/texturePool.cxx | 7 +- 9 files changed, 1293 insertions(+), 34 deletions(-) diff --git a/panda/src/framework/windowFramework.cxx b/panda/src/framework/windowFramework.cxx index 7ac9e89fa2..898aae50a1 100644 --- a/panda/src/framework/windowFramework.cxx +++ b/panda/src/framework/windowFramework.cxx @@ -602,16 +602,10 @@ load_model(const NodePath &parent, Filename filename) { if (model_type == (LoaderFileType *)NULL) { // The extension isn't a known model file type; is it a known image file // extension? - if (extension == "txo" || downcase(extension) == "dds") { - // A texture object. Not exactly an image, but certainly a texture. + TexturePool *texture_pool = TexturePool::get_global_ptr(); + if (texture_pool->get_texture_type(extension) != NULL) { + // It is a known image file extension. is_image = true; - - } else { - TexturePool *texture_pool = TexturePool::get_global_ptr(); - if (texture_pool->get_texture_type(extension) != NULL) { - // It is a known image file extension. - is_image = true; - } } } } diff --git a/panda/src/gles2gsg/gles2gsg.h b/panda/src/gles2gsg/gles2gsg.h index f88d40c3fc..8d80e690eb 100644 --- a/panda/src/gles2gsg/gles2gsg.h +++ b/panda/src/gles2gsg/gles2gsg.h @@ -231,6 +231,16 @@ typedef char GLchar; #define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311 #define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313 #define GL_ALL_BARRIER_BITS 0xFFFFFFFF +#define GL_COMPRESSED_R11_EAC 0x9270 +#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 +#define GL_COMPRESSED_RG11_EAC 0x9272 +#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 +#define GL_COMPRESSED_RGB8_ETC2 0x9274 +#define GL_COMPRESSED_SRGB8_ETC2 0x9275 +#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 +#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 +#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 +#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 #undef SUPPORT_IMMEDIATE_MODE #define APIENTRY diff --git a/panda/src/glesgsg/glesgsg.h b/panda/src/glesgsg/glesgsg.h index 416e5737cb..c0afb58b56 100644 --- a/panda/src/glesgsg/glesgsg.h +++ b/panda/src/glesgsg/glesgsg.h @@ -132,6 +132,17 @@ #define GL_DEBUG_SEVERITY_LOW 0x9148 #define GL_DEBUG_OUTPUT 0x92E0 +#define GL_COMPRESSED_R11_EAC 0x9270 +#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 +#define GL_COMPRESSED_RG11_EAC 0x9272 +#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 +#define GL_COMPRESSED_RGB8_ETC2 0x9274 +#define GL_COMPRESSED_SRGB8_ETC2 0x9275 +#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 +#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 +#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 +#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 + #undef SUPPORT_IMMEDIATE_MODE #define APIENTRY #define APIENTRYP * diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index d21c4df57b..ee24b407d4 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -1053,6 +1053,24 @@ reset() { break; #endif + case GL_COMPRESSED_R11_EAC: + case GL_COMPRESSED_RG11_EAC: + _compressed_texture_formats.set_bit(Texture::CM_eac); + break; + + case GL_COMPRESSED_RGB8_ETC2: + case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: + case GL_COMPRESSED_RGBA8_ETC2_EAC: + _compressed_texture_formats.set_bit(Texture::CM_etc1); + _compressed_texture_formats.set_bit(Texture::CM_etc2); + break; + +#ifdef OPENGLES + case GL_ETC1_RGB8_OES: + _compressed_texture_formats.set_bit(Texture::CM_etc1); + break; +#endif + default: break; } @@ -8066,6 +8084,12 @@ get_texture_target(Texture::TextureType texture_type) const { return GL_TEXTURE_1D; #endif + case Texture::TT_1d_texture_array: + // There are no 1D array textures in OpenGL ES. Fall back to 2D textures. +#ifndef OPENGLES + return GL_TEXTURE_1D_ARRAY; +#endif + case Texture::TT_2d_texture: return GL_TEXTURE_2D; @@ -8282,6 +8306,11 @@ get_component_type(Texture::ComponentType component_type) { return GL_HALF_FLOAT; #endif +#ifndef OPENGLES_1 + case Texture::T_unsigned_int: + return GL_UNSIGNED_INT; +#endif + default: GLCAT.error() << "Invalid Texture::Type value!\n"; return GL_UNSIGNED_BYTE; @@ -8444,9 +8473,9 @@ get_external_image_format(Texture *tex) const { case Texture::CM_rgtc: #ifndef OPENGLES - if (tex->get_format() == Texture::F_luminance) { + if (format == Texture::F_luminance) { return GL_COMPRESSED_LUMINANCE_LATC1_EXT; - } else if (tex->get_format() == Texture::F_luminance_alpha) { + } else if (format == Texture::F_luminance_alpha) { return GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT; } else if (tex->get_num_components() == 1) { return GL_COMPRESSED_RED_RGTC1; @@ -8456,6 +8485,41 @@ get_external_image_format(Texture *tex) const { #endif break; + case Texture::CM_etc1: +#ifdef OPENGLES + return GL_ETC1_RGB8_OES; +#endif + // Fall through - ETC2 is backward compatible + case Texture::CM_etc2: + if (format == Texture::F_rgbm) { + return GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2; + } else if (format == Texture::F_srgb_alpha) { + return GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC; + } else if (format == Texture::F_srgb) { + return GL_COMPRESSED_SRGB8_ETC2; + } else if (Texture::has_alpha(format)) { + return GL_COMPRESSED_RGBA8_ETC2_EAC; + } else { + return GL_COMPRESSED_RGB8_ETC2; + } + break; + + case Texture::CM_eac: + if (Texture::is_unsigned(tex->get_component_type())) { + if (tex->get_num_components() == 1) { + return GL_COMPRESSED_R11_EAC; + } else { + return GL_COMPRESSED_RG11_EAC; + } + } else { + if (tex->get_num_components() == 1) { + return GL_COMPRESSED_SIGNED_R11_EAC; + } else { + return GL_COMPRESSED_SIGNED_RG11_EAC; + } + } + break; + case Texture::CM_default: case Texture::CM_off: case Texture::CM_dxt2: @@ -8565,7 +8629,7 @@ get_external_image_format(Texture *tex) const { } GLCAT.error() << "Invalid Texture::Format value in get_external_image_format(): " - << tex->get_format() << "\n"; + << format << "\n"; return GL_RGB; } @@ -8615,10 +8679,14 @@ get_internal_image_format(Texture *tex, bool force_sized) const { break; case Texture::F_rgbm: + case Texture::F_rgba5: case Texture::F_rgb10_a2: if (get_supports_compressed_texture_format(Texture::CM_dxt1) && !is_3d) { return GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; } + if (get_supports_compressed_texture_format(Texture::CM_etc2) && !is_3d) { + return GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2; + } #ifndef OPENGLES if (get_supports_compressed_texture_format(Texture::CM_fxt1) && !is_3d) { return GL_COMPRESSED_RGBA_FXT1_3DFX; @@ -8633,6 +8701,9 @@ get_internal_image_format(Texture *tex, bool force_sized) const { return GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; } #endif + if (get_supports_compressed_texture_format(Texture::CM_etc2) && !is_3d) { + return GL_COMPRESSED_RGBA8_ETC2_EAC; + } #ifndef OPENGLES if (get_supports_compressed_texture_format(Texture::CM_fxt1) && !is_3d) { return GL_COMPRESSED_RGBA_FXT1_3DFX; @@ -8651,6 +8722,9 @@ get_internal_image_format(Texture *tex, bool force_sized) const { return GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; } #endif + if (get_supports_compressed_texture_format(Texture::CM_etc2) && !is_3d) { + return GL_COMPRESSED_RGBA8_ETC2_EAC; + } #ifndef OPENGLES if (get_supports_compressed_texture_format(Texture::CM_fxt1) && !is_3d) { return GL_COMPRESSED_RGBA_FXT1_3DFX; @@ -8661,7 +8735,6 @@ get_internal_image_format(Texture *tex, bool force_sized) const { case Texture::F_rgb: case Texture::F_rgb5: - case Texture::F_rgba5: case Texture::F_rgb8: case Texture::F_rgb12: case Texture::F_rgb332: @@ -8670,7 +8743,14 @@ get_internal_image_format(Texture *tex, bool force_sized) const { if (get_supports_compressed_texture_format(Texture::CM_dxt1) && !is_3d) { return GL_COMPRESSED_RGB_S3TC_DXT1_EXT; } -#ifndef OPENGLES + if (get_supports_compressed_texture_format(Texture::CM_etc2) && !is_3d) { + return GL_COMPRESSED_RGB8_ETC2; + } +#ifdef OPENGLES + if (get_supports_compressed_texture_format(Texture::CM_etc1) && !is_3d) { + return GL_ETC1_RGB8_OES; + } +#else if (get_supports_compressed_texture_format(Texture::CM_fxt1) && !is_3d) { return GL_COMPRESSED_RGB_FXT1_3DFX; } @@ -8702,6 +8782,13 @@ get_internal_image_format(Texture *tex, bool force_sized) const { return GL_COMPRESSED_RED_RGTC1; } #endif + if (get_supports_compressed_texture_format(Texture::CM_eac) && !is_3d) { + if (Texture::is_unsigned(tex->get_component_type())) { + return GL_COMPRESSED_R11_EAC; + } else { + return GL_COMPRESSED_SIGNED_R11_EAC; + } + } if (get_supports_compressed_texture_format(Texture::CM_dxt1) && !is_3d) { return GL_COMPRESSED_RGB_S3TC_DXT1_EXT; } @@ -8721,6 +8808,13 @@ get_internal_image_format(Texture *tex, bool force_sized) const { return GL_COMPRESSED_RG_RGTC2; } #endif + if (get_supports_compressed_texture_format(Texture::CM_eac) && !is_3d) { + if (Texture::is_unsigned(tex->get_component_type())) { + return GL_COMPRESSED_RG11_EAC; + } else { + return GL_COMPRESSED_SIGNED_RG11_EAC; + } + } if (get_supports_compressed_texture_format(Texture::CM_dxt1) && !is_3d) { return GL_COMPRESSED_RGB_S3TC_DXT1_EXT; } @@ -8764,12 +8858,18 @@ get_internal_image_format(Texture *tex, bool force_sized) const { if (get_supports_compressed_texture_format(Texture::CM_dxt1) && !is_3d) { return GL_COMPRESSED_SRGB_S3TC_DXT1_EXT; } + if (get_supports_compressed_texture_format(Texture::CM_etc2) && !is_3d) { + return GL_COMPRESSED_SRGB8_ETC2; + } return GL_COMPRESSED_SRGB; case Texture::F_srgb_alpha: if (get_supports_compressed_texture_format(Texture::CM_dxt5) && !is_3d) { return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT; } + if (get_supports_compressed_texture_format(Texture::CM_etc2) && !is_3d) { + return GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC; + } return GL_COMPRESSED_SRGB_ALPHA; case Texture::F_sluminance: @@ -8855,9 +8955,9 @@ get_internal_image_format(Texture *tex, bool force_sized) const { case Texture::CM_rgtc: #ifndef OPENGLES - if (tex->get_format() == Texture::F_luminance) { + if (format == Texture::F_luminance) { return GL_COMPRESSED_LUMINANCE_LATC1_EXT; - } else if (tex->get_format() == Texture::F_luminance_alpha) { + } else if (format == Texture::F_luminance_alpha) { return GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT; } else if (tex->get_num_components() == 1) { return GL_COMPRESSED_RED_RGTC1; @@ -8867,6 +8967,41 @@ get_internal_image_format(Texture *tex, bool force_sized) const { #endif break; + case Texture::CM_etc1: +#ifdef OPENGLES + return GL_ETC1_RGB8_OES; +#endif + // Fall through - ETC2 is backward compatible + case Texture::CM_etc2: + if (format == Texture::F_rgbm) { + return GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2; + } else if (format == Texture::F_srgb_alpha) { + return GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC; + } else if (format == Texture::F_srgb) { + return GL_COMPRESSED_SRGB8_ETC2; + } else if (Texture::has_alpha(format)) { + return GL_COMPRESSED_RGBA8_ETC2_EAC; + } else { + return GL_COMPRESSED_RGB8_ETC2; + } + break; + + case Texture::CM_eac: + if (Texture::is_unsigned(tex->get_component_type())) { + if (tex->get_num_components() == 1) { + return GL_COMPRESSED_R11_EAC; + } else { + return GL_COMPRESSED_RG11_EAC; + } + } else { + if (tex->get_num_components() == 1) { + return GL_COMPRESSED_SIGNED_R11_EAC; + } else { + return GL_COMPRESSED_SIGNED_RG11_EAC; + } + } + break; + case Texture::CM_default: case Texture::CM_off: case Texture::CM_dxt2: @@ -9197,7 +9332,7 @@ get_internal_image_format(Texture *tex, bool force_sized) const { default: GLCAT.error() << "Invalid image format in get_internal_image_format(): " - << (int)tex->get_format() << "\n"; + << (int)format << "\n"; return force_sized ? GL_RGB8 : GL_RGB; } } @@ -11661,6 +11796,7 @@ upload_texture(CLP(TextureContext) *gtc, bool force, bool uses_mipmaps) { break; case Texture::TT_2d_texture: case Texture::TT_cube_map: + case Texture::TT_1d_texture_array: _glTexStorage2D(target, num_levels, internal_format, width, height); break; case Texture::TT_3d_texture: @@ -12119,6 +12255,14 @@ upload_texture_image(CLP(TextureContext) *gtc, bool needs_reload, // fill it in with the correct clear color, which we can then // upload. ptimage = tex->make_ram_mipmap_image(n); + + } else if (image_compression != Texture::CM_off) { + // We can't upload a NULL compressed texture. + if (_supports_texture_max_level) { + // Tell the GL we have no more mipmaps for it to use. + glTexParameteri(texture_target, GL_TEXTURE_MAX_LEVEL, n - mipmap_bias); + } + break; } } image_ptr = ptimage; diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index 4cdf3749a8..60563af5db 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -1296,12 +1296,15 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { case GL_SAMPLER_2D_ARRAY_SHADOW: #ifndef OPENGLES case GL_INT_SAMPLER_1D: + case GL_INT_SAMPLER_1D_ARRAY: case GL_INT_SAMPLER_BUFFER: case GL_INT_SAMPLER_CUBE_MAP_ARRAY: case GL_UNSIGNED_INT_SAMPLER_1D: + case GL_UNSIGNED_INT_SAMPLER_1D_ARRAY: case GL_UNSIGNED_INT_SAMPLER_BUFFER: case GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY: case GL_SAMPLER_1D: + case GL_SAMPLER_1D_ARRAY: case GL_SAMPLER_1D_SHADOW: case GL_SAMPLER_BUFFER: case GL_SAMPLER_CUBE_MAP_ARRAY: @@ -1597,6 +1600,12 @@ get_sampler_texture_type(int &out, GLenum param_type) { case GL_SAMPLER_1D: out = Texture::TT_1d_texture; return true; + + case GL_INT_SAMPLER_1D_ARRAY: + case GL_UNSIGNED_INT_SAMPLER_1D_ARRAY: + case GL_SAMPLER_1D_ARRAY: + out = Texture::TT_1d_texture_array; + return true; #endif case GL_INT_SAMPLER_2D: diff --git a/panda/src/gobj/texture.I b/panda/src/gobj/texture.I index b608a39c00..47ce9e233f 100644 --- a/panda/src/gobj/texture.I +++ b/panda/src/gobj/texture.I @@ -2318,8 +2318,8 @@ get_unsigned_short(const unsigned char *&p) { } /** - * Returns true if the indicated filename ends in .txo or .txo.pz, false - * otherwise. + * Returns true if the indicated filename ends in .txo or .txo.pz or .txo.gz, + * false otherwise. */ INLINE bool Texture:: is_txo_filename(const Filename &fullpath) { @@ -2333,8 +2333,8 @@ is_txo_filename(const Filename &fullpath) { } /** - * Returns true if the indicated filename ends in .dds or .dds.pz, false - * otherwise. + * Returns true if the indicated filename ends in .dds or .dds.pz or .dds.gz, + * false otherwise. */ INLINE bool Texture:: is_dds_filename(const Filename &fullpath) { @@ -2347,6 +2347,21 @@ is_dds_filename(const Filename &fullpath) { return (downcase(extension) == "dds"); } +/** + * Returns true if the indicated filename ends in .ktx or .ktx.pz or .ktx.gz, + * false otherwise. + */ +INLINE bool Texture:: +is_ktx_filename(const Filename &fullpath) { + string extension = fullpath.get_extension(); +#ifdef HAVE_ZLIB + if (extension == "pz" || extension == "gz") { + extension = Filename(fullpath.get_basename_wo_extension()).get_extension(); + } +#endif // HAVE_ZLIB + return (downcase(extension) == "ktx"); +} + /** * */ diff --git a/panda/src/gobj/texture.cxx b/panda/src/gobj/texture.cxx index 1802a36133..8b3285337e 100644 --- a/panda/src/gobj/texture.cxx +++ b/panda/src/gobj/texture.cxx @@ -132,6 +132,231 @@ struct DDSHeader { DDSCaps2 caps; }; +// Stuff to read KTX files. +enum KTXType { + KTX_BYTE = 0x1400, + KTX_UNSIGNED_BYTE = 0x1401, + KTX_SHORT = 0x1402, + KTX_UNSIGNED_SHORT = 0x1403, + KTX_INT = 0x1404, + KTX_UNSIGNED_INT = 0x1405, + KTX_FLOAT = 0x1406, + KTX_HALF_FLOAT = 0x140B, + KTX_UNSIGNED_BYTE_3_3_2 = 0x8032, + KTX_UNSIGNED_SHORT_4_4_4_4 = 0x8033, + KTX_UNSIGNED_SHORT_5_5_5_1 = 0x8034, + KTX_UNSIGNED_INT_8_8_8_8 = 0x8035, + KTX_UNSIGNED_INT_10_10_10_2 = 0x8036, + KTX_UNSIGNED_BYTE_2_3_3_REV = 0x8362, + KTX_UNSIGNED_SHORT_5_6_5 = 0x8363, + KTX_UNSIGNED_SHORT_5_6_5_REV = 0x8364, + KTX_UNSIGNED_SHORT_4_4_4_4_REV = 0x8365, + KTX_UNSIGNED_SHORT_1_5_5_5_REV = 0x8366, + KTX_UNSIGNED_INT_8_8_8_8_REV = 0x8367, + KTX_UNSIGNED_INT_2_10_10_10_REV = 0x8368, + KTX_UNSIGNED_INT_24_8 = 0x84FA, + KTX_UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B, + KTX_UNSIGNED_INT_5_9_9_9_REV = 0x8C3E, + KTX_FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD, +}; + +enum KTXFormat { + KTX_ALPHA = 0x1906, + KTX_ALPHA12 = 0x803D, + KTX_ALPHA16 = 0x803E, + KTX_ALPHA16_SNORM = 0x9018, + KTX_ALPHA4 = 0x803B, + KTX_ALPHA8 = 0x803C, + KTX_ALPHA8_SNORM = 0x9014, + KTX_ALPHA_SNORM = 0x9010, + KTX_BGR = 0x80E0, + KTX_BGR_INTEGER = 0x8D9A, + KTX_BGRA = 0x80E1, + KTX_BGRA_INTEGER = 0x8D9B, + KTX_BLUE = 0x1905, + KTX_BLUE_INTEGER = 0x8D96, + KTX_COLOR_INDEX = 0x1900, + KTX_DEPTH24_STENCIL8 = 0x88F0, + KTX_DEPTH32F_STENCIL8 = 0x8CAD, + KTX_DEPTH_COMPONENT = 0x1902, + KTX_DEPTH_COMPONENT16 = 0x81A5, + KTX_DEPTH_COMPONENT24 = 0x81A6, + KTX_DEPTH_COMPONENT32 = 0x81A7, + KTX_DEPTH_COMPONENT32F = 0x8CAC, + KTX_DEPTH_STENCIL = 0x84F9, + KTX_GREEN = 0x1904, + KTX_GREEN_INTEGER = 0x8D95, + KTX_INTENSITY = 0x8049, + KTX_INTENSITY12 = 0x804C, + KTX_INTENSITY16 = 0x804D, + KTX_INTENSITY16_SNORM = 0x901B, + KTX_INTENSITY4 = 0x804A, + KTX_INTENSITY8 = 0x804B, + KTX_INTENSITY8_SNORM = 0x9017, + KTX_INTENSITY_SNORM = 0x9013, + KTX_LUMINANCE = 0x1909, + KTX_LUMINANCE12 = 0x8041, + KTX_LUMINANCE12_ALPHA12 = 0x8047, + KTX_LUMINANCE12_ALPHA4 = 0x8046, + KTX_LUMINANCE16 = 0x8042, + KTX_LUMINANCE16_ALPHA16 = 0x8048, + KTX_LUMINANCE16_ALPHA16_SNORM = 0x901A, + KTX_LUMINANCE16_SNORM = 0x9019, + KTX_LUMINANCE4 = 0x803F, + KTX_LUMINANCE4_ALPHA4 = 0x8043, + KTX_LUMINANCE6_ALPHA2 = 0x8044, + KTX_LUMINANCE8 = 0x8040, + KTX_LUMINANCE8_ALPHA8 = 0x8045, + KTX_LUMINANCE8_ALPHA8_SNORM = 0x9016, + KTX_LUMINANCE8_SNORM = 0x9015, + KTX_LUMINANCE_ALPHA = 0x190A, + KTX_LUMINANCE_ALPHA_SNORM = 0x9012, + KTX_LUMINANCE_SNORM = 0x9011, + KTX_R11F_G11F_B10F = 0x8C3A, + KTX_R16 = 0x822A, + KTX_R16_SNORM = 0x8F98, + KTX_R16F = 0x822D, + KTX_R16I = 0x8233, + KTX_R16UI = 0x8234, + KTX_R32F = 0x822E, + KTX_R32I = 0x8235, + KTX_R32UI = 0x8236, + KTX_R3_G3_B2 = 0x2A10, + KTX_R8 = 0x8229, + KTX_R8_SNORM = 0x8F94, + KTX_R8I = 0x8231, + KTX_R8UI = 0x8232, + KTX_RED = 0x1903, + KTX_RED_INTEGER = 0x8D94, + KTX_RED_SNORM = 0x8F90, + KTX_RG = 0x8227, + KTX_RG16 = 0x822C, + KTX_RG16_SNORM = 0x8F99, + KTX_RG16F = 0x822F, + KTX_RG16I = 0x8239, + KTX_RG16UI = 0x823A, + KTX_RG32F = 0x8230, + KTX_RG32I = 0x823B, + KTX_RG32UI = 0x823C, + KTX_RG8 = 0x822B, + KTX_RG8_SNORM = 0x8F95, + KTX_RG8I = 0x8237, + KTX_RG8UI = 0x8238, + KTX_RG_INTEGER = 0x8228, + KTX_RG_SNORM = 0x8F91, + KTX_RGB = 0x1907, + KTX_RGB10 = 0x8052, + KTX_RGB10_A2 = 0x8059, + KTX_RGB12 = 0x8053, + KTX_RGB16 = 0x8054, + KTX_RGB16_SNORM = 0x8F9A, + KTX_RGB16F = 0x881B, + KTX_RGB16I = 0x8D89, + KTX_RGB16UI = 0x8D77, + KTX_RGB2 = 0x804E, + KTX_RGB32F = 0x8815, + KTX_RGB32I = 0x8D83, + KTX_RGB32UI = 0x8D71, + KTX_RGB4 = 0x804F, + KTX_RGB5 = 0x8050, + KTX_RGB5_A1 = 0x8057, + KTX_RGB8 = 0x8051, + KTX_RGB8_SNORM = 0x8F96, + KTX_RGB8I = 0x8D8F, + KTX_RGB8UI = 0x8D7D, + KTX_RGB9_E5 = 0x8C3D, + KTX_RGB_INTEGER = 0x8D98, + KTX_RGB_SNORM = 0x8F92, + KTX_RGBA = 0x1908, + KTX_RGBA12 = 0x805A, + KTX_RGBA16 = 0x805B, + KTX_RGBA16_SNORM = 0x8F9B, + KTX_RGBA16F = 0x881A, + KTX_RGBA16I = 0x8D88, + KTX_RGBA16UI = 0x8D76, + KTX_RGBA2 = 0x8055, + KTX_RGBA32F = 0x8814, + KTX_RGBA32I = 0x8D82, + KTX_RGBA32UI = 0x8D70, + KTX_RGBA4 = 0x8056, + KTX_RGBA8 = 0x8058, + KTX_RGBA8_SNORM = 0x8F97, + KTX_RGBA8I = 0x8D8E, + KTX_RGBA8UI = 0x8D7C, + KTX_RGBA_INTEGER = 0x8D99, + KTX_RGBA_SNORM = 0x8F93, + KTX_SLUMINANCE = 0x8C46, + KTX_SLUMINANCE8 = 0x8C47, + KTX_SLUMINANCE8_ALPHA8 = 0x8C45, + KTX_SLUMINANCE_ALPHA = 0x8C44, + KTX_SRGB = 0x8C40, + KTX_SRGB8 = 0x8C41, + KTX_SRGB8_ALPHA8 = 0x8C43, + KTX_SRGB_ALPHA = 0x8C42, + KTX_STENCIL_INDEX = 0x1901, + KTX_STENCIL_INDEX1 = 0x8D46, + KTX_STENCIL_INDEX16 = 0x8D49, + KTX_STENCIL_INDEX4 = 0x8D47, + KTX_STENCIL_INDEX8 = 0x8D48, +}; + +enum KTXCompressedFormat { + KTX_COMPRESSED_LUMINANCE_ALPHA_LATC2 = 0x8C72, + KTX_COMPRESSED_LUMINANCE_LATC1 = 0x8C70, + KTX_COMPRESSED_R11_EAC = 0x9270, + KTX_COMPRESSED_RED = 0x8225, + KTX_COMPRESSED_RED_RGTC1 = 0x8DBB, + KTX_COMPRESSED_RG = 0x8226, + KTX_COMPRESSED_RG11_EAC = 0x9272, + KTX_COMPRESSED_RG_RGTC2 = 0x8DBD, + KTX_COMPRESSED_RGB = 0x84ED, + KTX_COMPRESSED_RGB8_ETC2 = 0x9274, + KTX_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276, + KTX_COMPRESSED_RGB_BPTC_SIGNED_FLOAT = 0x8E8E, + KTX_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT = 0x8E8F, + KTX_COMPRESSED_RGB_FXT1_3DFX = 0x86B0, + KTX_COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 0x8C01, + KTX_COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00, + KTX_COMPRESSED_RGB_S3TC_DXT1 = 0x83F0, + KTX_COMPRESSED_RGBA = 0x84EE, + KTX_COMPRESSED_RGBA8_ETC2_EAC = 0x9278, + KTX_COMPRESSED_RGBA_BPTC_UNORM = 0x8E8C, + KTX_COMPRESSED_RGBA_FXT1_3DFX = 0x86B1, + KTX_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8C03, + KTX_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG = 0x9137, + KTX_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8C02, + KTX_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG = 0x9138, + KTX_COMPRESSED_RGBA_S3TC_DXT1 = 0x83F1, + KTX_COMPRESSED_RGBA_S3TC_DXT3 = 0x83F2, + KTX_COMPRESSED_RGBA_S3TC_DXT5 = 0x83F3, + KTX_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2 = 0x8C73, + KTX_COMPRESSED_SIGNED_LUMINANCE_LATC1 = 0x8C71, + KTX_COMPRESSED_SIGNED_R11_EAC = 0x9271, + KTX_COMPRESSED_SIGNED_RED_RGTC1 = 0x8DBC, + KTX_COMPRESSED_SIGNED_RG11_EAC = 0x9273, + KTX_COMPRESSED_SIGNED_RG_RGTC2 = 0x8DBE, + KTX_COMPRESSED_SLUMINANCE = 0x8C4A, + KTX_COMPRESSED_SLUMINANCE_ALPHA = 0x8C4B, + KTX_COMPRESSED_SRGB = 0x8C48, + KTX_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279, + KTX_COMPRESSED_SRGB8_ETC2 = 0x9275, + KTX_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277, + KTX_COMPRESSED_SRGB_ALPHA = 0x8C49, + KTX_COMPRESSED_SRGB_ALPHA_BPTC_UNORM = 0x8E8D, + KTX_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1 = 0x8A56, + KTX_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV2 = 0x93F0, + KTX_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1 = 0x8A57, + KTX_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV2 = 0x93F1, + KTX_COMPRESSED_SRGB_ALPHA_S3TC_DXT1 = 0x8C4D, + KTX_COMPRESSED_SRGB_ALPHA_S3TC_DXT3 = 0x8C4E, + KTX_COMPRESSED_SRGB_ALPHA_S3TC_DXT5 = 0x8C4F, + KTX_COMPRESSED_SRGB_PVRTC_2BPPV1 = 0x8A54, + KTX_COMPRESSED_SRGB_PVRTC_4BPPV1 = 0x8A55, + KTX_COMPRESSED_SRGB_S3TC_DXT1 = 0x8C4C, + KTX_ETC1_RGB8 = 0x8D64, + KTX_ETC1_SRGB8 = 0x88EE, +}; + /** * Constructs an empty texture. The default is to set up the texture as an * empty 2-d texture; follow up with one of the variants of setup_texture() if @@ -709,6 +934,23 @@ read_dds(istream &in, const string &filename, bool header_only) { return do_read_dds(cdata, in, filename, header_only); } +/** + * Reads the texture from a KTX file object. This is a Khronos-defined file + * format; it is similar in principle to a dds object, in that it is designed + * to contain the texture image in a form as similar as possible to its + * runtime image, and it can contain mipmaps, pre-compressed textures, and so + * on. + * + * As with read_dds, the filename is just for reference. + */ +bool Texture:: +read_ktx(istream &in, const string &filename, bool header_only) { + CDWriter cdata(_cycler, true); + cdata->inc_properties_modified(); + cdata->inc_image_modified(); + return do_read_ktx(cdata, in, filename, header_only); +} + /** * Loads a texture whose filename is derived by concatenating a suffix to the * filename of this texture. May return NULL, for example, if this texture @@ -1439,6 +1681,7 @@ write(ostream &out, int indent_level) const { case T_unsigned_int_24_8: case T_int: + case T_unsigned_int: out << " ints"; break; @@ -1862,6 +2105,8 @@ format_component_type(ComponentType ct) { return "short"; case T_half_float: return "half_float"; + case T_unsigned_int: + return "unsigned_int"; } return "**invalid**"; @@ -1888,6 +2133,8 @@ string_component_type(const string &str) { return T_short; } else if (cmp_nocase(str, "half_float") == 0) { return T_half_float; + } else if (cmp_nocase(str, "unsigned_int") == 0) { + return T_unsigned_int; } gobj_cat->error() @@ -1956,7 +2203,7 @@ format_format(Format format) { case F_r16: return "r16"; case F_r16i: - return "r16i"; + return "r16i"; case F_rg16: return "rg16"; case F_rgb16: @@ -2123,6 +2370,12 @@ format_compression_mode(CompressionMode cm) { return "pvr1_4bpp"; case CM_rgtc: return "rgtc"; + case CM_etc1: + return "etc1"; + case CM_etc2: + return "etc2"; + case CM_eac: + return "eac"; } return "**invalid**"; @@ -2158,6 +2411,12 @@ string_compression_mode(const string &str) { return CM_pvr1_4bpp; } else if (cmp_nocase_uh(str, "rgtc") == 0) { return CM_rgtc; + } else if (cmp_nocase_uh(str, "etc1") == 0) { + return CM_etc1; + } else if (cmp_nocase_uh(str, "etc2") == 0) { + return CM_etc2; + } else if (cmp_nocase_uh(str, "eac") == 0) { + return CM_eac; } gobj_cat->error() @@ -2272,7 +2531,8 @@ bool Texture:: is_unsigned(Texture::ComponentType ctype) { return (ctype == T_unsigned_byte || ctype == T_unsigned_short || - ctype == T_unsigned_int_24_8); + ctype == T_unsigned_int_24_8 || + ctype == T_unsigned_int); } /** @@ -2535,6 +2795,13 @@ do_read(CData *cdata, const Filename &fullpath, const Filename &alpha_fullpath, return do_read_dds_file(cdata, fullpath, header_only); } + if (is_ktx_filename(fullpath)) { + if (record != (BamCacheRecord *)NULL) { + record->add_dependent_file(fullpath); + } + return do_read_ktx_file(cdata, fullpath, header_only); + } + // If read_pages or read_mipmaps is specified, then z and n actually // indicate z_size and n_size, respectively--the numerical limits on which // to search for filenames. @@ -3820,6 +4087,770 @@ do_read_dds(CData *cdata, istream &in, const string &filename, bool header_only) return true; } +/** + * Called internally when read() detects a KTX file. Assumes the lock is + * already held. + */ +bool Texture:: +do_read_ktx_file(CData *cdata, const Filename &fullpath, bool header_only) { + VirtualFileSystem *vfs = VirtualFileSystem::get_global_ptr(); + + Filename filename = Filename::binary_filename(fullpath); + PT(VirtualFile) file = vfs->get_file(filename); + if (file == (VirtualFile *)NULL) { + // No such file. + gobj_cat.error() + << "Could not find " << fullpath << "\n"; + return false; + } + + if (gobj_cat.is_debug()) { + gobj_cat.debug() + << "Reading KTX file " << filename << "\n"; + } + + istream *in = file->open_read_file(true); + bool success = do_read_ktx(cdata, *in, fullpath, header_only); + vfs->close_read_file(in); + + if (!has_name()) { + set_name(fullpath.get_basename_wo_extension()); + } + + cdata->_fullpath = fullpath; + cdata->_alpha_fullpath = Filename(); + cdata->_keep_ram_image = false; + + return success; +} + +/** + * + */ +bool Texture:: +do_read_ktx(CData *cdata, istream &in, const string &filename, bool header_only) { + StreamReader ktx(in); + + if (ktx.extract_bytes(12) != "\xABKTX 11\xBB\r\n\x1A\n") { + gobj_cat.error() + << filename << " is not a KTX file.\n"; + return false; + } + + // See: https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/ + uint32_t gl_type, type_size, gl_format, internal_format, gl_base_format, + width, height, depth, num_array_elements, num_faces, num_mipmap_levels, + kvdata_size; + + bool big_endian; + if (ktx.get_uint32() == 0x04030201) { + big_endian = false; + gl_type = ktx.get_uint32(); + type_size = ktx.get_uint32(); + gl_format = ktx.get_uint32(); + internal_format = ktx.get_uint32(); + gl_base_format = ktx.get_uint32(); + width = ktx.get_uint32(); + height = ktx.get_uint32(); + depth = ktx.get_uint32(); + num_array_elements = ktx.get_uint32(); + num_faces = ktx.get_uint32(); + num_mipmap_levels = ktx.get_uint32(); + kvdata_size = ktx.get_uint32(); + } else { + big_endian = true; + gl_type = ktx.get_be_uint32(); + type_size = ktx.get_be_uint32(); + gl_format = ktx.get_be_uint32(); + internal_format = ktx.get_be_uint32(); + gl_base_format = ktx.get_be_uint32(); + width = ktx.get_be_uint32(); + height = ktx.get_be_uint32(); + depth = ktx.get_be_uint32(); + num_array_elements = ktx.get_be_uint32(); + num_faces = ktx.get_be_uint32(); + num_mipmap_levels = ktx.get_be_uint32(); + kvdata_size = ktx.get_be_uint32(); + } + + // Skip metadata section. + ktx.skip_bytes(kvdata_size); + + ComponentType type; + CompressionMode compression; + Format format; + bool swap_bgr = false; + + if (gl_type == 0 || gl_format == 0) { + // Compressed texture. + if (gl_type > 0 || gl_format > 0) { + gobj_cat.error() + << "Compressed textures must have both type and format set to 0.\n"; + return false; + } + type = T_unsigned_byte; + compression = CM_on; + + KTXFormat base_format; + switch ((KTXCompressedFormat)internal_format) { + case KTX_COMPRESSED_RED: + format = F_red; + base_format = KTX_RED; + break; + case KTX_COMPRESSED_RG: + format = F_rg; + base_format = KTX_RG; + break; + case KTX_COMPRESSED_RGB: + format = F_rgb; + base_format = KTX_RGB; + break; + case KTX_COMPRESSED_RGBA: + format = F_rgba; + base_format = KTX_RGBA; + break; + case KTX_COMPRESSED_SRGB: + format = F_srgb; + base_format = KTX_SRGB; + break; + case KTX_COMPRESSED_SRGB_ALPHA: + format = F_srgb_alpha; + base_format = KTX_SRGB_ALPHA; + break; + case KTX_COMPRESSED_RGB_FXT1_3DFX: + format = F_rgb; + base_format = KTX_RGB; + compression = CM_fxt1; + break; + case KTX_COMPRESSED_RGBA_FXT1_3DFX: + format = F_rgba; + base_format = KTX_RGBA; + compression = CM_fxt1; + break; + case KTX_COMPRESSED_RGB_S3TC_DXT1: + format = F_rgb; + base_format = KTX_RGB; + compression = CM_dxt1; + break; + case KTX_COMPRESSED_RGBA_S3TC_DXT1: + format = F_rgbm; + base_format = KTX_RGB; + compression = CM_dxt1; + break; + case KTX_COMPRESSED_RGBA_S3TC_DXT3: + format = F_rgba; + base_format = KTX_RGBA; + compression = CM_dxt3; + break; + case KTX_COMPRESSED_RGBA_S3TC_DXT5: + format = F_rgba; + base_format = KTX_RGBA; + compression = CM_dxt5; + break; + case KTX_COMPRESSED_SRGB_ALPHA_S3TC_DXT1: + format = F_srgb_alpha; + base_format = KTX_SRGB_ALPHA; + compression = CM_dxt1; + break; + case KTX_COMPRESSED_SRGB_ALPHA_S3TC_DXT3: + format = F_srgb_alpha; + base_format = KTX_SRGB_ALPHA; + compression = CM_dxt3; + break; + case KTX_COMPRESSED_SRGB_ALPHA_S3TC_DXT5: + format = F_srgb_alpha; + base_format = KTX_SRGB_ALPHA; + compression = CM_dxt5; + break; + case KTX_COMPRESSED_SRGB_S3TC_DXT1: + format = F_srgb; + base_format = KTX_SRGB; + compression = CM_dxt1; + break; + case KTX_COMPRESSED_RED_RGTC1: + case KTX_COMPRESSED_SIGNED_RED_RGTC1: + format = F_red; + base_format = KTX_RED; + compression = CM_rgtc; + break; + case KTX_COMPRESSED_RG_RGTC2: + case KTX_COMPRESSED_SIGNED_RG_RGTC2: + format = F_rg; + base_format = KTX_RG; + compression = CM_rgtc; + break; + case KTX_ETC1_RGB8: + format = F_rgb; + base_format = KTX_RGB; + compression = CM_etc1; + break; + case KTX_ETC1_SRGB8: + format = F_srgb; + base_format = KTX_SRGB; + compression = CM_etc1; + break; + case KTX_COMPRESSED_RGB8_ETC2: + format = F_rgb; + base_format = KTX_RGB; + compression = CM_etc2; + break; + case KTX_COMPRESSED_SRGB8_ETC2: + format = F_srgb; + base_format = KTX_SRGB; + compression = CM_etc2; + break; + case KTX_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: + format = F_rgbm; + base_format = KTX_RGBA; + compression = CM_etc2; + break; + case KTX_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: + format = F_rgbm; + base_format = KTX_SRGB8_ALPHA8; + compression = CM_etc2; + break; + case KTX_COMPRESSED_RGBA8_ETC2_EAC: + format = F_rgba; + base_format = KTX_RGBA; + compression = CM_etc2; + break; + case KTX_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: + format = F_srgb_alpha; + base_format = KTX_SRGB8_ALPHA8; + compression = CM_etc2; + break; + case KTX_COMPRESSED_R11_EAC: + case KTX_COMPRESSED_SIGNED_R11_EAC: + format = F_red; + base_format = KTX_RED; + compression = CM_eac; + break; + case KTX_COMPRESSED_RG11_EAC: + case KTX_COMPRESSED_SIGNED_RG11_EAC: + format = F_rg; + base_format = KTX_RG; + compression = CM_eac; + break; + case KTX_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1: + format = F_srgb_alpha; + base_format = KTX_SRGB_ALPHA; + compression = CM_pvr1_2bpp; + break; + case KTX_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1: + format = F_srgb_alpha; + base_format = KTX_SRGB_ALPHA; + compression = CM_pvr1_4bpp; + break; + case KTX_COMPRESSED_RGBA_BPTC_UNORM: + case KTX_COMPRESSED_SRGB_ALPHA_BPTC_UNORM: + case KTX_COMPRESSED_RGB_BPTC_SIGNED_FLOAT: + case KTX_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT: + default: + gobj_cat.error() + << filename << " has unsupported compressed internal format " << internal_format << "\n"; + return false; + } + + if (base_format != gl_base_format) { + gobj_cat.error() + << filename << " has internal format that is incompatible with base " + "format (0x" << hex << gl_base_format << ", expected 0x" + << base_format << dec << ")\n"; + return false; + } + + } else { + // Uncompressed texture. + compression = CM_off; + switch ((KTXType)gl_type) { + case KTX_BYTE: + type = T_byte; + break; + case KTX_UNSIGNED_BYTE: + type = T_unsigned_byte; + break; + case KTX_SHORT: + type = T_short; + break; + case KTX_UNSIGNED_SHORT: + type = T_unsigned_short; + break; + case KTX_INT: + type = T_int; + break; + case KTX_UNSIGNED_INT: + type = T_unsigned_int; + break; + case KTX_FLOAT: + type = T_float; + break; + case KTX_HALF_FLOAT: + type = T_half_float; + break; + case KTX_UNSIGNED_INT_24_8: + type = T_unsigned_int_24_8; + break; + default: + gobj_cat.error() + << filename << " has unsupported component type " << gl_type << "\n"; + return false; + } + + if (gl_format != gl_base_format) { + gobj_cat.error() + << filename << " has mismatched formats: " << gl_format << " != " + << gl_base_format << "\n"; + } + + switch (gl_format) { + case KTX_DEPTH_COMPONENT: + switch (internal_format) { + case KTX_DEPTH_COMPONENT: + format = F_depth_component; + break; + case KTX_DEPTH_COMPONENT16: + format = F_depth_component16; + break; + case KTX_DEPTH_COMPONENT24: + format = F_depth_component24; + break; + case KTX_DEPTH_COMPONENT32: + case KTX_DEPTH_COMPONENT32F: + format = F_depth_component32; + break; + default: + format = F_depth_component; + gobj_cat.warning() + << filename << " has unsupported depth component format " << internal_format << "\n"; + } + break; + + case KTX_DEPTH_STENCIL: + format = F_depth_stencil; + if (internal_format != KTX_DEPTH_STENCIL && + internal_format != KTX_DEPTH24_STENCIL8) { + gobj_cat.warning() + << filename << " has unsupported depth stencil format " << internal_format << "\n"; + } + break; + + case KTX_RED: + switch (internal_format) { + case KTX_RED: + case KTX_RED_SNORM: + case KTX_R8: + case KTX_R8_SNORM: + format = F_red; + break; + case KTX_R16: + case KTX_R16_SNORM: + case KTX_R16F: + format = F_r16; + break; + case KTX_R32F: + format = F_r32; + break; + default: + format = F_red; + gobj_cat.warning() + << filename << " has unsupported red format " << internal_format << "\n"; + } + break; + + case KTX_RED_INTEGER: + switch (internal_format) { + case KTX_R8I: + case KTX_R8UI: + format = F_r8i; + break; + case KTX_R16I: + case KTX_R16UI: + format = F_r16i; + break; + case KTX_R32I: + case KTX_R32UI: + format = F_r32i; + break; + default: + gobj_cat.error() + << filename << " has unsupported red integer format " << internal_format << "\n"; + return false; + } + break; + + case KTX_GREEN: + format = F_green; + if (internal_format != KTX_GREEN) { + gobj_cat.warning() + << filename << " has unsupported green format " << internal_format << "\n"; + } + break; + + case KTX_BLUE: + format = F_blue; + if (internal_format != KTX_BLUE) { + gobj_cat.warning() + << filename << " has unsupported blue format " << internal_format << "\n"; + } + break; + + case KTX_RG: + switch (internal_format) { + case KTX_RG: + case KTX_RG_SNORM: + case KTX_RG8: + case KTX_RG8_SNORM: + format = F_rg; + break; + case KTX_RG16: + case KTX_RG16_SNORM: + case KTX_RG16F: + format = F_rg16; + break; + case KTX_RG32F: + format = F_rg32; + break; + default: + format = F_rg; + gobj_cat.warning() + << filename << " has unsupported RG format " << internal_format << "\n"; + } + break; + + case KTX_RG_INTEGER: + switch (internal_format) { + case KTX_RG8I: + case KTX_RG8UI: + format = F_rg8i; + break; + case KTX_RG16I: + case KTX_RG16UI: + case KTX_RG32I: + case KTX_RG32UI: + default: + gobj_cat.error() + << filename << " has unsupported RG integer format " << internal_format << "\n"; + return false; + } + break; + + case KTX_RGB: + swap_bgr = true; + case KTX_BGR: + switch (internal_format) { + case KTX_RGB: + case KTX_RGB_SNORM: + format = F_rgb; + break; + case KTX_RGB5: + format = F_rgb5; + break; + case KTX_RGB12: + format = F_rgb12; + break; + case KTX_R3_G3_B2: + format = F_rgb332; + break; + case KTX_RGB9_E5: + format = F_rgb9_e5; + break; + case KTX_R11F_G11F_B10F: + format = F_r11_g11_b10; + break; + case KTX_RGB8: + case KTX_RGB8_SNORM: + format = F_rgb8; + break; + case KTX_RGB16: + case KTX_RGB16_SNORM: + case KTX_RGB16F: + format = F_rgb16; + break; + case KTX_RGB32F: + format = F_rgb32; + break; + case KTX_SRGB: + case KTX_SRGB8: + format = F_srgb; + break; + default: + format = F_rgb; + gobj_cat.warning() + << filename << " has unsupported RGB format " << internal_format << "\n"; + } + break; + + case KTX_RGB_INTEGER: + swap_bgr = true; + case KTX_BGR_INTEGER: + switch (internal_format) { + case KTX_RGB8I: + case KTX_RGB8UI: + format = F_rgb8i; + break; + case KTX_RGB16I: + case KTX_RGB16UI: + case KTX_RGB32I: + case KTX_RGB32UI: + default: + gobj_cat.error() + << filename << " has unsupported RGB integer format " << internal_format << "\n"; + return false; + } + break; + + case KTX_RGBA: + swap_bgr = true; + case KTX_BGRA: + switch (internal_format) { + case KTX_RGBA: + case KTX_RGBA_SNORM: + format = F_rgba; + break; + case KTX_RGBA4: + format = F_rgba4; + break; + case KTX_RGB5_A1: + format = F_rgba5; + break; + case KTX_RGBA12: + format = F_rgba12; + break; + case KTX_RGB10_A2: + format = F_rgb10_a2; + break; + case KTX_RGBA8: + case KTX_RGBA8_SNORM: + format = F_rgba8; + break; + case KTX_RGBA16: + case KTX_RGBA16_SNORM: + case KTX_RGBA16F: + format = F_rgba16; + break; + case KTX_RGBA32F: + format = F_rgba32; + break; + case KTX_SRGB_ALPHA: + case KTX_SRGB8_ALPHA8: + format = F_srgb_alpha; + break; + default: + format = F_rgba; + gobj_cat.warning() + << filename << " has unsupported RGBA format " << internal_format << "\n"; + } + break; + break; + + case KTX_RGBA_INTEGER: + swap_bgr = true; + case KTX_BGRA_INTEGER: + switch (internal_format) { + case KTX_RGBA8I: + case KTX_RGBA8UI: + format = F_rgba8i; + break; + case KTX_RGBA16I: + case KTX_RGBA16UI: + case KTX_RGBA32I: + case KTX_RGBA32UI: + default: + gobj_cat.error() + << filename << " has unsupported RGBA integer format " << internal_format << "\n"; + return false; + } + break; + + case KTX_LUMINANCE: + format = F_luminance; + break; + + case KTX_LUMINANCE_ALPHA: + format = F_luminance_alpha; + break; + + case KTX_ALPHA: + format = F_alpha; + break; + + case KTX_STENCIL_INDEX: + default: + gobj_cat.error() + << filename << " has unsupported format " << gl_format << "\n"; + return false; + } + } + + TextureType texture_type; + if (depth > 0) { + texture_type = TT_3d_texture; + + } else if (num_faces > 1) { + if (num_faces != 6) { + gobj_cat.error() + << filename << " has " << num_faces << " cube map faces, expected 6\n"; + return false; + } + if (width != height) { + gobj_cat.error() + << filename << " is cube map, but does not have square dimensions\n"; + return false; + } + if (num_array_elements > 0) { + depth = num_array_elements * 6; + texture_type = TT_cube_map_array; + } else { + depth = 6; + texture_type = TT_cube_map; + } + + } else if (height > 0) { + if (num_array_elements > 0) { + depth = num_array_elements; + texture_type = TT_2d_texture_array; + } else { + depth = 1; + texture_type = TT_2d_texture; + } + + } else if (width > 0) { + depth = 1; + if (num_array_elements > 0) { + height = num_array_elements; + texture_type = TT_1d_texture_array; + } else { + height = 1; + texture_type = TT_1d_texture; + } + + } else { + gobj_cat.error() + << filename << " has zero size\n"; + return false; + } + + do_setup_texture(cdata, texture_type, width, height, depth, type, format); + + cdata->_orig_file_x_size = cdata->_x_size; + cdata->_orig_file_y_size = cdata->_y_size; + cdata->_compression = compression; + cdata->_ram_image_compression = compression; + + if (!header_only) { + bool generate_mipmaps = false; + if (num_mipmap_levels == 0) { + generate_mipmaps = true; + num_mipmap_levels = 1; + } + + for (uint32_t n = 0; n < num_mipmap_levels; ++n) { + uint32_t image_size; + if (big_endian) { + image_size = ktx.get_be_uint32(); + } else { + image_size = ktx.get_uint32(); + } + PTA_uchar image; + + if (compression == CM_off) { + uint32_t row_size = do_get_expected_mipmap_x_size(cdata, (int)n) * cdata->_num_components * cdata->_component_width; + uint32_t num_rows = do_get_expected_mipmap_y_size(cdata, (int)n) * do_get_expected_mipmap_z_size(cdata, (int)n); + uint32_t row_padded = (row_size + 3) & ~3; + + if (image_size == row_size * num_rows) { + if (row_padded != row_size) { + // Someone tightly packed the image. This is invalid, but because + // we like it tightly packed too, we'll read it anyway. + gobj_cat.warning() + << filename << " does not have proper row padding for mipmap " + "level " << n << "\n"; + } + image = PTA_uchar::empty_array(image_size); + ktx.extract_bytes(image.p(), image_size); + + } else if (image_size != row_padded * num_rows) { + gobj_cat.error() + << filename << " has invalid image size " << image_size + << " for mipmap level " << n << " (expected " + << row_padded * num_rows << ")\n"; + return false; + + } else { + // Read it row by row. + image = PTA_uchar::empty_array(row_size * num_rows); + uint32_t skip = row_padded - row_size; + unsigned char *p = image.p(); + for (uint32_t row = 0; row < num_rows; ++row) { + ktx.extract_bytes(p, row_size); + ktx.skip_bytes(skip); + p += row_size; + } + } + + // Swap red and blue channels if necessary to match Panda conventions. + if (swap_bgr) { + unsigned char *begin = image.p(); + const unsigned char *end = image.p() + image.size(); + size_t skip = cdata->_num_components; + nassertr(skip == 3 || skip == 4, false); + + switch (cdata->_component_width) { + case 1: + for (unsigned char *p = begin; p < end; p += skip) { + swap(p[0], p[2]); + } + break; + case 2: + for (short *p = (short *)begin; p < (short *)end; p += skip) { + swap(p[0], p[2]); + } + break; + case 4: + for (int *p = (int *)begin; p < (int *)end; p += skip) { + swap(p[0], p[2]); + } + break; + default: + nassertr(false, false); + break; + } + } + + do_set_ram_mipmap_image(cdata, (int)n, MOVE(image), + row_size * do_get_expected_mipmap_y_size(cdata, (int)n)); + + } else { + // Compressed image. We'll trust that the file has the right size. + image = PTA_uchar::empty_array(image_size); + ktx.extract_bytes(image.p(), image_size); + do_set_ram_mipmap_image(cdata, (int)n, MOVE(image), image_size / depth); + } + + ktx.skip_bytes(3 - ((image_size + 3) & 3)); + } + + cdata->_has_read_pages = true; + cdata->_has_read_mipmaps = true; + cdata->_num_mipmap_levels_read = cdata->_ram_images.size(); + + if (generate_mipmaps) { + do_generate_ram_mipmap_images(cdata, false); + } + } + + if (in.fail() || in.eof()) { + gobj_cat.error() + << filename << ": truncated KTX file.\n"; + return false; + } + + cdata->_loaded_from_image = true; + cdata->_loaded_from_txo = true; + + return true; +} + /** * Internal method to write a series of pages and/or mipmap levels to disk * files. @@ -4607,6 +5638,27 @@ do_get_clear_data(const CData *cdata, unsigned char *into) const { } break; } + + case T_unsigned_int: + { + // Note: there are no 32-bit UNORM textures. Therefore, we don't do any + // normalization here, either. + switch (cdata->_num_components) { + case 2: + ((unsigned int *)into)[1] = (unsigned int)cdata->_clear_color[1]; + case 1: + ((unsigned int *)into)[0] = (unsigned int)cdata->_clear_color[0]; + break; + case 4: + ((unsigned int *)into)[3] = (unsigned int)cdata->_clear_color[3]; + case 3: // BGR <-> RGB + ((unsigned int *)into)[0] = (unsigned int)cdata->_clear_color[2]; + ((unsigned int *)into)[1] = (unsigned int)cdata->_clear_color[1]; + ((unsigned int *)into)[2] = (unsigned int)cdata->_clear_color[0]; + break; + } + break; + } } return cdata->_num_components * cdata->_component_width; @@ -4692,18 +5744,24 @@ do_compress_ram_image(CData *cdata, Texture::CompressionMode compression, case Texture::F_rgb10_a2: if (gsg == NULL || gsg->get_supports_compressed_texture_format(CM_dxt1)) { compression = CM_dxt1; - } else if (gsg == NULL || gsg->get_supports_compressed_texture_format(CM_dxt3)) { + } else if (gsg->get_supports_compressed_texture_format(CM_dxt3)) { compression = CM_dxt3; - } else if (gsg == NULL || gsg->get_supports_compressed_texture_format(CM_dxt5)) { + } else if (gsg->get_supports_compressed_texture_format(CM_dxt5)) { compression = CM_dxt5; + } else if (gsg->get_supports_compressed_texture_format(CM_etc2)) { + compression = CM_etc2; + } else if (gsg->get_supports_compressed_texture_format(CM_etc1)) { + compression = CM_etc1; } break; case Texture::F_rgba4: if (gsg == NULL || gsg->get_supports_compressed_texture_format(CM_dxt3)) { compression = CM_dxt3; - } else if (gsg == NULL || gsg->get_supports_compressed_texture_format(CM_dxt5)) { + } else if (gsg->get_supports_compressed_texture_format(CM_dxt5)) { compression = CM_dxt5; + } else if (gsg->get_supports_compressed_texture_format(CM_etc2)) { + compression = CM_etc2; } break; @@ -4714,6 +5772,8 @@ do_compress_ram_image(CData *cdata, Texture::CompressionMode compression, case Texture::F_rgba32: if (gsg == NULL || gsg->get_supports_compressed_texture_format(CM_dxt5)) { compression = CM_dxt5; + } else if (gsg->get_supports_compressed_texture_format(CM_etc2)) { + compression = CM_etc2; } break; @@ -4721,6 +5781,8 @@ do_compress_ram_image(CData *cdata, Texture::CompressionMode compression, case Texture::F_rg: if (gsg == NULL || gsg->get_supports_compressed_texture_format(CM_rgtc)) { compression = CM_rgtc; + } else if (gsg->get_supports_compressed_texture_format(CM_eac)) { + compression = CM_eac; } break; @@ -5822,14 +6884,9 @@ do_set_component_type(CData *cdata, Texture::ComponentType component_type) { break; case T_float: - cdata->_component_width = 4; - break; - case T_unsigned_int_24_8: - cdata->_component_width = 4; - break; - case T_int: + case T_unsigned_int: cdata->_component_width = 4; break; } @@ -6472,7 +7529,12 @@ do_generate_ram_mipmap_images(CData *cdata, bool allow_recompress) { // Now try to get the uncompressed source image. do_get_uncompressed_ram_image(cdata); - nassertv(cdata->_ram_image_compression == CM_off); + if (cdata->_ram_image_compression != CM_off) { + gobj_cat.error() + << "Cannot generate mipmap levels for image with compression " + << cdata->_ram_image_compression << "\n"; + return; + } } do_clear_ram_mipmap_images(cdata); diff --git a/panda/src/gobj/texture.h b/panda/src/gobj/texture.h index 010f847b6a..1f125fd7ce 100644 --- a/panda/src/gobj/texture.h +++ b/panda/src/gobj/texture.h @@ -79,6 +79,7 @@ PUBLISHED: TT_cube_map, TT_buffer_texture, TT_cube_map_array, + TT_1d_texture_array, }; enum ComponentType { @@ -90,6 +91,7 @@ PUBLISHED: T_byte, T_short, T_half_float, + T_unsigned_int, }; enum Format { @@ -206,6 +208,9 @@ PUBLISHED: CM_pvr1_2bpp, CM_pvr1_4bpp, CM_rgtc, // BC4/BC5: 1 or 2 channels, individually compressed. + CM_etc1, + CM_etc2, + CM_eac, // EAC: 1 or 2 channels. }; enum QualityLevel { @@ -284,6 +289,7 @@ PUBLISHED: BLOCKING static PT(Texture) make_from_txo(istream &in, const string &filename = ""); BLOCKING bool write_txo(ostream &out, const string &filename = "") const; BLOCKING bool read_dds(istream &in, const string &filename = "", bool header_only = false); + BLOCKING bool read_ktx(istream &in, const string &filename = "", bool header_only = false); BLOCKING INLINE bool load(const PNMImage &pnmimage, const LoaderOptions &options = LoaderOptions()); BLOCKING INLINE bool load(const PNMImage &pnmimage, int z, int n, const LoaderOptions &options = LoaderOptions()); @@ -657,6 +663,8 @@ protected: bool do_read_txo(CData *cdata, istream &in, const string &filename); bool do_read_dds_file(CData *cdata, const Filename &fullpath, bool header_only); bool do_read_dds(CData *cdata, istream &in, const string &filename, bool header_only); + bool do_read_ktx_file(CData *cdata, const Filename &fullpath, bool header_only); + bool do_read_ktx(CData *cdata, istream &in, const string &filename, bool header_only); bool do_write(CData *cdata, const Filename &fullpath, int z, int n, bool write_pages, bool write_mipmaps); @@ -840,6 +848,7 @@ private: INLINE static bool is_txo_filename(const Filename &fullpath); INLINE static bool is_dds_filename(const Filename &fullpath); + INLINE static bool is_ktx_filename(const Filename &fullpath); void do_filter_2d_mipmap_pages(const CData *cdata, RamImage &to, const RamImage &from, diff --git a/panda/src/gobj/texturePool.cxx b/panda/src/gobj/texturePool.cxx index cf73364cde..5c05040d83 100644 --- a/panda/src/gobj/texturePool.cxx +++ b/panda/src/gobj/texturePool.cxx @@ -90,7 +90,7 @@ get_texture_type(const string &extension) const { // Check the PNM type registry. PNMFileTypeRegistry *pnm_reg = PNMFileTypeRegistry::get_global_ptr(); PNMFileType *type = pnm_reg->get_type_from_extension(c); - if (type != (PNMFileType *)NULL) { + if (type != (PNMFileType *)NULL || c == "txo" || c == "dds" || c == "ktx") { // This is a known image type; create an ordinary Texture. ((TexturePool *)this)->_type_registry[c] = Texture::make_texture; return Texture::make_texture; @@ -109,6 +109,11 @@ void TexturePool:: write_texture_types(ostream &out, int indent_level) const { MutexHolder holder(_lock); + // These are supported out of the box. + indent(out, indent_level) << "Texture Object .txo\n"; + indent(out, indent_level) << "DirectDraw Surface .dds\n"; + indent(out, indent_level) << "Khronos Texture .ktx\n"; + PNMFileTypeRegistry *pnm_reg = PNMFileTypeRegistry::get_global_ptr(); pnm_reg->write(out, indent_level); From e691a679d4e9d1009d0c41b406a5c56e3d483a80 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 20 Jul 2016 11:44:39 +0200 Subject: [PATCH 020/112] Fix timestamp verification in FileSpec on some file systems --- direct/src/p3d/FileSpec.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/direct/src/p3d/FileSpec.py b/direct/src/p3d/FileSpec.py index 291149ad77..20dab235c3 100644 --- a/direct/src/p3d/FileSpec.py +++ b/direct/src/p3d/FileSpec.py @@ -31,7 +31,7 @@ class FileSpec: if st is None: st = os.stat(pathname.toOsSpecific()) self.size = st.st_size - self.timestamp = st.st_mtime + self.timestamp = int(st.st_mtime) self.readHash(pathname) @@ -122,7 +122,7 @@ class FileSpec: self.__correctHash(packageDir, pathname, st, notify) return False - if st.st_mtime == self.timestamp: + if int(st.st_mtime) == self.timestamp: # If the size is right and the timestamp is right, the # file passes. if notify: @@ -196,7 +196,7 @@ class FileSpec: # The hash is OK. If the timestamp is wrong, change it back # to what we expect it to be, so we can quick-verify it # successfully next time. - if st.st_mtime != self.timestamp: + if int(st.st_mtime) != self.timestamp: self.__updateTimestamp(pathname, st) return True @@ -217,7 +217,7 @@ class FileSpec: if notify: notify.info("Correcting timestamp of %s to %d (%s)" % ( self.filename, st.st_mtime, time.asctime(time.localtime(st.st_mtime)))) - self.timestamp = st.st_mtime + self.timestamp = int(st.st_mtime) def checkHash(self, packageDir, pathname, st): """ Returns true if the file has the expected md5 hash, false From 339eb5800769b4b324cc6b1a684cc79e84a10e5d Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 20 Jul 2016 11:45:14 +0200 Subject: [PATCH 021/112] Fix compile error on some Mac versions --- panda/src/glstuff/panda_glext.h | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/panda/src/glstuff/panda_glext.h b/panda/src/glstuff/panda_glext.h index 1fb1c55a0e..156f772b6e 100644 --- a/panda/src/glstuff/panda_glext.h +++ b/panda/src/glstuff/panda_glext.h @@ -5562,12 +5562,6 @@ typedef ptrdiff_t GLintptr; typedef ptrdiff_t GLsizeiptr; #endif -#ifndef GL_ARB_vertex_buffer_object -/* GL types for handling large vertex buffer objects */ -typedef ptrdiff_t GLintptrARB; -typedef ptrdiff_t GLsizeiptrARB; -#endif - #ifndef GL_ARB_shader_objects /* GL types for program/shader text and shader object handles */ typedef char GLcharARB; @@ -6827,9 +6821,9 @@ GLAPI void APIENTRY glBindBufferARB (GLenum target, GLuint buffer); GLAPI void APIENTRY glDeleteBuffersARB (GLsizei n, const GLuint *buffers); GLAPI void APIENTRY glGenBuffersARB (GLsizei n, GLuint *buffers); GLAPI GLboolean APIENTRY glIsBufferARB (GLuint buffer); -GLAPI void APIENTRY glBufferDataARB (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); -GLAPI void APIENTRY glBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); -GLAPI void APIENTRY glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); +GLAPI void APIENTRY glBufferDataARB (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); +GLAPI void APIENTRY glBufferSubDataARB (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); +GLAPI void APIENTRY glGetBufferSubDataARB (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum target, GLenum access); GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum target); GLAPI void APIENTRY glGetBufferParameterivARB (GLenum target, GLenum pname, GLint *params); @@ -6839,9 +6833,9 @@ typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers); typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers); typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); -typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); +typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target); typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params); @@ -11332,7 +11326,7 @@ typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, #define GL_NV_video_capture 1 #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glBeginVideoCaptureNV (GLuint video_capture_slot); -GLAPI void APIENTRY glBindVideoCaptureStreamBufferNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); +GLAPI void APIENTRY glBindVideoCaptureStreamBufferNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptr offset); GLAPI void APIENTRY glBindVideoCaptureStreamTextureNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); GLAPI void APIENTRY glEndVideoCaptureNV (GLuint video_capture_slot); GLAPI void APIENTRY glGetVideoCaptureivNV (GLuint video_capture_slot, GLenum pname, GLint *params); @@ -11345,7 +11339,7 @@ GLAPI void APIENTRY glVideoCaptureStreamParameterfvNV (GLuint video_capture_slot GLAPI void APIENTRY glVideoCaptureStreamParameterdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot); -typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); +typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptr offset); typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); typedef void (APIENTRYP PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot); typedef void (APIENTRYP PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint *params); From 47388b0dbc9f74960772f39adb46849336357f78 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 20 Jul 2016 10:34:52 +0200 Subject: [PATCH 022/112] Separate out CPython calls from core libs; eliminate need for pystub --- direct/src/dcparser/dcArrayParameter.h | 2 +- direct/src/dcparser/dcAtomicField.h | 2 +- direct/src/dcparser/dcClass.h | 2 +- direct/src/dcparser/dcClassParameter.h | 2 +- direct/src/dcparser/dcDeclaration.h | 2 +- direct/src/dcparser/dcField.h | 2 +- direct/src/dcparser/dcFile.h | 2 +- direct/src/dcparser/dcKeyword.h | 2 +- direct/src/dcparser/dcKeywordList.h | 2 +- direct/src/dcparser/dcMolecularField.h | 2 +- direct/src/dcparser/dcPackData.h | 2 +- direct/src/dcparser/dcPacker.h | 4 +- direct/src/dcparser/dcPackerCatalog.h | 2 +- direct/src/dcparser/dcPackerInterface.h | 2 +- direct/src/dcparser/dcParameter.h | 2 +- direct/src/dcparser/dcSimpleParameter.h | 2 +- direct/src/dcparser/dcSwitch.h | 2 +- direct/src/dcparser/dcSwitchParameter.h | 2 +- direct/src/dcparser/dcTypedef.h | 2 +- .../src/distributed/cConnectionRepository.cxx | 24 +- direct/src/plugin/p3dCInstance.h | 2 - direct/src/showbase/Loader.py | 90 ++--- direct/src/showutil/FreezeTool.py | 5 +- direct/src/stdpy/thread.py | 20 +- .../interfaceMakerPythonNative.cxx | 52 ++- .../interrogate/interfaceMakerPythonNative.h | 3 +- dtool/src/interrogate/interrogate.cxx | 4 - dtool/src/interrogate/interrogate_module.cxx | 4 - dtool/src/parser-inc/Python.h | 2 +- .../src/test_interrogate/test_interrogate.cxx | 1 - makepanda/makepanda.py | 339 +++++++++--------- panda/src/android/pview.cxx | 4 - panda/src/chan/animChannelFixed.cxx | 17 + panda/src/chan/animChannelFixed.h | 2 + panda/src/chan/p3chan_composite1.cxx | 1 + panda/src/downloadertools/apply_patch.cxx | 4 - panda/src/downloadertools/build_patch.cxx | 4 - panda/src/downloadertools/check_adler.cxx | 4 - panda/src/downloadertools/check_crc.cxx | 4 - panda/src/downloadertools/check_md5.cxx | 4 - panda/src/downloadertools/multify.cxx | 4 - panda/src/downloadertools/pdecrypt.cxx | 4 - panda/src/downloadertools/pencrypt.cxx | 1 - panda/src/downloadertools/punzip.cxx | 4 - panda/src/downloadertools/pzip.cxx | 4 - panda/src/downloadertools/show_ddb.cxx | 4 - panda/src/event/asyncTask.cxx | 39 -- panda/src/event/asyncTask.h | 10 - panda/src/event/pythonTask.I | 34 -- panda/src/event/pythonTask.cxx | 10 +- panda/src/event/pythonTask.h | 7 +- panda/src/express/pointerToArray.h | 4 - panda/src/express/pointerToArray_ext.I | 18 +- panda/src/express/pointerToArray_ext.h | 4 - panda/src/gobj/geomVertexArrayData.h | 2 +- panda/src/gobj/geomVertexArrayData_ext.cxx | 16 +- panda/src/gobj/geomVertexArrayData_ext.h | 2 - .../nativenet/buffered_datagramconnection.cxx | 20 -- panda/src/pgraph/modelFlattenRequest.h | 4 + panda/src/pgraph/modelLoadRequest.h | 6 + panda/src/pgraph/modelSaveRequest.h | 7 + panda/src/pgraph/nodePath.h | 20 +- panda/src/pgraph/nodePath_ext.I | 43 ++- panda/src/pgraph/nodePath_ext.cxx | 2 +- panda/src/pgraph/nodePath_ext.h | 20 +- panda/src/pgraph/pandaNode.I | 5 +- panda/src/pgraph/pandaNode.cxx | 198 +--------- panda/src/pgraph/pandaNode.h | 29 +- panda/src/pgraph/pandaNode_ext.cxx | 243 +++++++------ panda/src/pgraph/pandaNode_ext.h | 24 +- panda/src/pipeline/config_pipeline.cxx | 4 - panda/src/pipeline/p3pipeline_composite2.cxx | 1 - panda/src/pipeline/pythonThread.cxx | 200 ++++++++++- panda/src/pipeline/pythonThread.h | 11 +- panda/src/pipeline/thread.I | 19 + panda/src/pipeline/thread.cxx | 262 +------------- panda/src/pipeline/thread.h | 27 +- panda/src/pnmimage/pfmFile.h | 2 +- panda/src/pnmimage/pfmFile_ext.cxx | 8 +- panda/src/pnmimage/pfmFile_ext.h | 2 - panda/src/putil/bamReader_ext.cxx | 4 +- panda/src/putil/pythonCallbackObject.cxx | 5 +- panda/src/testbed/pgrid.cxx | 4 - panda/src/testbed/pview.cxx | 4 - pandatool/src/bam/bamInfo.cxx | 4 - pandatool/src/bam/bamToEgg.cxx | 4 - pandatool/src/bam/eggToBam.cxx | 4 - pandatool/src/bam/ptsToBam.cxx | 4 - pandatool/src/cvscopy/testCopy.cxx | 4 - pandatool/src/daeprogs/daeToEgg.cxx | 4 - pandatool/src/daeprogs/eggToDAE.cxx | 4 - pandatool/src/dxfprogs/dxfPoints.cxx | 4 - pandatool/src/dxfprogs/dxfToEgg.cxx | 4 - pandatool/src/dxfprogs/eggToDXF.cxx | 4 - pandatool/src/egg-mkfont/eggMakeFont.cxx | 4 - pandatool/src/egg-optchar/eggOptchar.cxx | 4 - pandatool/src/egg-palettize/eggPalettize.cxx | 4 - pandatool/src/egg-qtess/eggQtess.cxx | 4 - pandatool/src/eggprogs/eggCrop.cxx | 4 - pandatool/src/eggprogs/eggListTextures.cxx | 4 - pandatool/src/eggprogs/eggMakeTube.cxx | 4 - pandatool/src/eggprogs/eggRename.cxx | 4 - pandatool/src/eggprogs/eggRetargetAnim.cxx | 4 - pandatool/src/eggprogs/eggTextureCards.cxx | 4 - pandatool/src/eggprogs/eggToC.cxx | 4 - pandatool/src/eggprogs/eggTopstrip.cxx | 4 - pandatool/src/eggprogs/eggTrans.cxx | 4 - pandatool/src/fltprogs/eggToFlt.cxx | 4 - pandatool/src/fltprogs/fltCopy.cxx | 4 - pandatool/src/fltprogs/fltInfo.cxx | 4 - pandatool/src/fltprogs/fltToEgg.cxx | 4 - pandatool/src/fltprogs/fltTrans.cxx | 4 - pandatool/src/gtk-stats/gtkStats.cxx | 4 - .../src/imageprogs/imageFixHiddenColor.cxx | 4 - pandatool/src/imageprogs/imageInfo.cxx | 4 - pandatool/src/imageprogs/imageResize.cxx | 4 - pandatool/src/imageprogs/imageTrans.cxx | 4 - .../src/imageprogs/imageTransformColors.cxx | 4 - pandatool/src/lwo/test_lwo.cxx | 4 - pandatool/src/lwoprogs/lwoScan.cxx | 4 - pandatool/src/lwoprogs/lwoToEgg.cxx | 4 - pandatool/src/mayaprogs/eggToMaya.cxx | 10 - pandatool/src/mayaprogs/mayaCopy.cxx | 10 - pandatool/src/mayaprogs/mayaToEgg.cxx | 10 - pandatool/src/mayaprogs/mayaToEgg_client.cxx | 10 - pandatool/src/mayaprogs/mayaToEgg_server.cxx | 10 - pandatool/src/mayaprogs/mayapath.cxx | 9 - pandatool/src/miscprogs/binToC.cxx | 4 - pandatool/src/objprogs/eggToObj.cxx | 4 - pandatool/src/objprogs/objToEgg.cxx | 4 - pandatool/src/pfmprogs/pfmBba.cxx | 4 - pandatool/src/pfmprogs/pfmTrans.cxx | 4 - pandatool/src/progbase/test_prog.cxx | 4 - pandatool/src/softprogs/softCVS.cxx | 4 - pandatool/src/text-stats/textStats.cxx | 4 - pandatool/src/vrmlprogs/vrmlToEgg.cxx | 4 - pandatool/src/vrmlprogs/vrmlTrans.cxx | 4 - pandatool/src/win-stats/winStats.cxx | 1 - pandatool/src/xfileprogs/eggToX.cxx | 4 - pandatool/src/xfileprogs/xFileToEgg.cxx | 4 - pandatool/src/xfileprogs/xFileTrans.cxx | 4 - 141 files changed, 869 insertions(+), 1362 deletions(-) create mode 100644 panda/src/chan/animChannelFixed.cxx diff --git a/direct/src/dcparser/dcArrayParameter.h b/direct/src/dcparser/dcArrayParameter.h index fa9e6e925a..10a8f022c2 100644 --- a/direct/src/dcparser/dcArrayParameter.h +++ b/direct/src/dcparser/dcArrayParameter.h @@ -23,7 +23,7 @@ * parameter type accepts an arbitrary (or possibly fixed) number of nested * fields, all of which are of the same type. */ -class EXPCL_DIRECT DCArrayParameter : public DCParameter { +class DCArrayParameter : public DCParameter { public: DCArrayParameter(DCParameter *element_type, const DCUnsignedIntRange &size = DCUnsignedIntRange()); diff --git a/direct/src/dcparser/dcAtomicField.h b/direct/src/dcparser/dcAtomicField.h index b03d8ed290..c002ecf15a 100644 --- a/direct/src/dcparser/dcAtomicField.h +++ b/direct/src/dcparser/dcAtomicField.h @@ -27,7 +27,7 @@ * This defines an interface to the Distributed Class, and is always * implemented as a remote procedure method. */ -class EXPCL_DIRECT DCAtomicField : public DCField { +class DCAtomicField : public DCField { public: DCAtomicField(const string &name, DCClass *dclass, bool bogus_field); virtual ~DCAtomicField(); diff --git a/direct/src/dcparser/dcClass.h b/direct/src/dcparser/dcClass.h index 94d077b540..9e981a0097 100644 --- a/direct/src/dcparser/dcClass.h +++ b/direct/src/dcparser/dcClass.h @@ -41,7 +41,7 @@ class DCParameter; /** * Defines a particular DistributedClass as read from an input .dc file. */ -class EXPCL_DIRECT DCClass : public DCDeclaration { +class DCClass : public DCDeclaration { public: DCClass(DCFile *dc_file, const string &name, bool is_struct, bool bogus_class); diff --git a/direct/src/dcparser/dcClassParameter.h b/direct/src/dcparser/dcClassParameter.h index 913ed20a6e..e846d48f88 100644 --- a/direct/src/dcparser/dcClassParameter.h +++ b/direct/src/dcparser/dcClassParameter.h @@ -23,7 +23,7 @@ class DCClass; * This represents a class (or struct) object used as a parameter itself. * This means that all the fields of the class get packed into the message. */ -class EXPCL_DIRECT DCClassParameter : public DCParameter { +class DCClassParameter : public DCParameter { public: DCClassParameter(const DCClass *dclass); DCClassParameter(const DCClassParameter ©); diff --git a/direct/src/dcparser/dcDeclaration.h b/direct/src/dcparser/dcDeclaration.h index ced47b3737..218473aef4 100644 --- a/direct/src/dcparser/dcDeclaration.h +++ b/direct/src/dcparser/dcDeclaration.h @@ -26,7 +26,7 @@ class DCSwitch; * only purpose is so that classes and typedefs can be stored in one list * together so they can be ordered correctly on output. */ -class EXPCL_DIRECT DCDeclaration { +class DCDeclaration { public: virtual ~DCDeclaration(); diff --git a/direct/src/dcparser/dcField.h b/direct/src/dcparser/dcField.h index 2bf2b5e840..e7f2dbcd3c 100644 --- a/direct/src/dcparser/dcField.h +++ b/direct/src/dcparser/dcField.h @@ -34,7 +34,7 @@ class HashGenerator; /** * A single field of a Distributed Class, either atomic or molecular. */ -class EXPCL_DIRECT DCField : public DCPackerInterface, public DCKeywordList { +class DCField : public DCPackerInterface, public DCKeywordList { public: DCField(); DCField(const string &name, DCClass *dclass); diff --git a/direct/src/dcparser/dcFile.h b/direct/src/dcparser/dcFile.h index ec3f431aa7..8ad67e1ace 100644 --- a/direct/src/dcparser/dcFile.h +++ b/direct/src/dcparser/dcFile.h @@ -29,7 +29,7 @@ class DCDeclaration; * Represents the complete list of Distributed Class descriptions as read from * a .dc file. */ -class EXPCL_DIRECT DCFile { +class DCFile { PUBLISHED: DCFile(); ~DCFile(); diff --git a/direct/src/dcparser/dcKeyword.h b/direct/src/dcparser/dcKeyword.h index aa074c6f37..76c212c093 100644 --- a/direct/src/dcparser/dcKeyword.h +++ b/direct/src/dcparser/dcKeyword.h @@ -25,7 +25,7 @@ class HashGenerator; * define a communication property associated with a field, for instance * "broadcast" or "airecv". */ -class EXPCL_DIRECT DCKeyword : public DCDeclaration { +class DCKeyword : public DCDeclaration { public: DCKeyword(const string &name, int historical_flag = ~0); virtual ~DCKeyword(); diff --git a/direct/src/dcparser/dcKeywordList.h b/direct/src/dcparser/dcKeywordList.h index b5e35b3247..ada61ffaa0 100644 --- a/direct/src/dcparser/dcKeywordList.h +++ b/direct/src/dcparser/dcKeywordList.h @@ -23,7 +23,7 @@ class HashGenerator; * This is a list of keywords (see DCKeyword) that may be set on a particular * field. */ -class EXPCL_DIRECT DCKeywordList { +class DCKeywordList { public: DCKeywordList(); DCKeywordList(const DCKeywordList ©); diff --git a/direct/src/dcparser/dcMolecularField.h b/direct/src/dcparser/dcMolecularField.h index 8b2d056bdd..6d532a1b23 100644 --- a/direct/src/dcparser/dcMolecularField.h +++ b/direct/src/dcparser/dcMolecularField.h @@ -25,7 +25,7 @@ class DCParameter; * This represents a combination of two or more related atomic fields, that * will often be treated as a unit. */ -class EXPCL_DIRECT DCMolecularField : public DCField { +class DCMolecularField : public DCField { public: DCMolecularField(const string &name, DCClass *dclass); diff --git a/direct/src/dcparser/dcPackData.h b/direct/src/dcparser/dcPackData.h index 9d19548591..99cd0abbd5 100644 --- a/direct/src/dcparser/dcPackData.h +++ b/direct/src/dcparser/dcPackData.h @@ -19,7 +19,7 @@ /** * This is a block of data that receives the results of DCPacker. */ -class EXPCL_DIRECT DCPackData { +class DCPackData { PUBLISHED: INLINE DCPackData(); INLINE ~DCPackData(); diff --git a/direct/src/dcparser/dcPacker.h b/direct/src/dcparser/dcPacker.h index 049429e0ec..380d40600c 100644 --- a/direct/src/dcparser/dcPacker.h +++ b/direct/src/dcparser/dcPacker.h @@ -31,7 +31,7 @@ class DCSwitchParameter; * See also direct/src/doc/dcPacker.txt for a more complete description and * examples of using this class. */ -class EXPCL_DIRECT DCPacker { +class DCPacker { PUBLISHED: DCPacker(); ~DCPacker(); @@ -216,7 +216,7 @@ private: const DCPackerCatalog *_catalog; const DCPackerCatalog::LiveCatalog *_live_catalog; - class EXPCL_DIRECT StackElement { + class StackElement { public: // As an optimization, we implement operator new and delete here to // minimize allocation overhead during push() and pop(). diff --git a/direct/src/dcparser/dcPackerCatalog.h b/direct/src/dcparser/dcPackerCatalog.h index 70c75e2d1a..71469d6744 100644 --- a/direct/src/dcparser/dcPackerCatalog.h +++ b/direct/src/dcparser/dcPackerCatalog.h @@ -26,7 +26,7 @@ class DCSwitchParameter; * requested from a particular field; its ownership is retained by the field * so it must not be deleted. */ -class EXPCL_DIRECT DCPackerCatalog { +class DCPackerCatalog { private: DCPackerCatalog(const DCPackerInterface *root); DCPackerCatalog(const DCPackerCatalog ©); diff --git a/direct/src/dcparser/dcPackerInterface.h b/direct/src/dcparser/dcPackerInterface.h index eca03d3257..42284ac54f 100644 --- a/direct/src/dcparser/dcPackerInterface.h +++ b/direct/src/dcparser/dcPackerInterface.h @@ -64,7 +64,7 @@ END_PUBLISH * Normally these methods are called only by the DCPacker object; the user * wouldn't normally call these directly. */ -class EXPCL_DIRECT DCPackerInterface { +class DCPackerInterface { public: DCPackerInterface(const string &name = string()); DCPackerInterface(const DCPackerInterface ©); diff --git a/direct/src/dcparser/dcParameter.h b/direct/src/dcparser/dcParameter.h index d8765f4d54..6c8ae910a6 100644 --- a/direct/src/dcparser/dcParameter.h +++ b/direct/src/dcparser/dcParameter.h @@ -32,7 +32,7 @@ class HashGenerator; * This may also be a typedef reference to another type, which has the same * properties as the referenced type, but a different name. */ -class EXPCL_DIRECT DCParameter : public DCField { +class DCParameter : public DCField { protected: DCParameter(); DCParameter(const DCParameter ©); diff --git a/direct/src/dcparser/dcSimpleParameter.h b/direct/src/dcparser/dcSimpleParameter.h index 747950939a..5e2e39c498 100644 --- a/direct/src/dcparser/dcSimpleParameter.h +++ b/direct/src/dcparser/dcSimpleParameter.h @@ -25,7 +25,7 @@ * divisor, which is meaningful only for the numeric type elements (and * represents a fixed-point numeric convention). */ -class EXPCL_DIRECT DCSimpleParameter : public DCParameter { +class DCSimpleParameter : public DCParameter { public: DCSimpleParameter(DCSubatomicType type, unsigned int divisor = 1); DCSimpleParameter(const DCSimpleParameter ©); diff --git a/direct/src/dcparser/dcSwitch.h b/direct/src/dcparser/dcSwitch.h index 355edd2403..77eefdbb6f 100644 --- a/direct/src/dcparser/dcSwitch.h +++ b/direct/src/dcparser/dcSwitch.h @@ -27,7 +27,7 @@ class DCField; * and represents two or more alternative unpacking schemes based on the first * field read. */ -class EXPCL_DIRECT DCSwitch : public DCDeclaration { +class DCSwitch : public DCDeclaration { public: DCSwitch(const string &name, DCField *key_parameter); virtual ~DCSwitch(); diff --git a/direct/src/dcparser/dcSwitchParameter.h b/direct/src/dcparser/dcSwitchParameter.h index 4456cfd6a5..0303af620f 100644 --- a/direct/src/dcparser/dcSwitchParameter.h +++ b/direct/src/dcparser/dcSwitchParameter.h @@ -23,7 +23,7 @@ class DCSwitch; * This represents a switch object used as a parameter itself, which packs the * appropriate fields of the switch into the message. */ -class EXPCL_DIRECT DCSwitchParameter : public DCParameter { +class DCSwitchParameter : public DCParameter { public: DCSwitchParameter(const DCSwitch *dswitch); DCSwitchParameter(const DCSwitchParameter ©); diff --git a/direct/src/dcparser/dcTypedef.h b/direct/src/dcparser/dcTypedef.h index 515df985af..62797fc8ff 100644 --- a/direct/src/dcparser/dcTypedef.h +++ b/direct/src/dcparser/dcTypedef.h @@ -23,7 +23,7 @@ class DCParameter; * This represents a single typedef declaration in the dc file. It assigns a * particular type to a new name, just like a C typedef. */ -class EXPCL_DIRECT DCTypedef : public DCDeclaration { +class DCTypedef : public DCDeclaration { public: DCTypedef(DCParameter *parameter, bool implicit = false); DCTypedef(const string &name); diff --git a/direct/src/distributed/cConnectionRepository.cxx b/direct/src/distributed/cConnectionRepository.cxx index 4d615b2179..41fb3d6286 100644 --- a/direct/src/distributed/cConnectionRepository.cxx +++ b/direct/src/distributed/cConnectionRepository.cxx @@ -402,8 +402,28 @@ send_datagram(const Datagram &dg) { } #ifdef WANT_NATIVE_NET - if(_native) - return _bdc.SendMessage(dg); + if (_native) { + bool result = _bdc.SendMessage(); + if (!result && _bdc.IsConnected()) { +#ifdef HAVE_PYTHON + ostringstream s; + +#if PY_VERSION_HEX >= 0x03030000 + PyObject *exc_type = PyExc_ConnectionError; +#else + PyObject *exc_type = PyExc_OSError; +#endif + + s << endl << "Error sending message: " << endl; + msg.dump_hex(s); + s << "Message data: " << msg.get_data() << endl; + + string message = s.str(); + PyErr_SetString(exc_type, message.c_str()); +#endif + } + return result; + } #endif #ifdef HAVE_NET diff --git a/direct/src/plugin/p3dCInstance.h b/direct/src/plugin/p3dCInstance.h index 40708f7d0c..8d0ebc29c2 100644 --- a/direct/src/plugin/p3dCInstance.h +++ b/direct/src/plugin/p3dCInstance.h @@ -21,8 +21,6 @@ #include "get_tinyxml.h" #include "windowHandle.h" -#include - class P3DSession; /** diff --git a/direct/src/showbase/Loader.py b/direct/src/showbase/Loader.py index 5aca6c4042..bd94f51cf2 100644 --- a/direct/src/showbase/Loader.py +++ b/direct/src/showbase/Loader.py @@ -28,7 +28,7 @@ class Loader(DirectObject): self.extraArgs = extraArgs self.numRemaining = numObjects self.cancelled = False - self.requests = {} + self.requests = set() def gotObject(self, index, object): self.objects[index] = object @@ -45,6 +45,8 @@ class Loader(DirectObject): self.base = base self.loader = PandaLoader.getGlobalPtr() + self.__requests = {} + self.hook = "async_loader_%s" % (Loader.loaderIndex) Loader.loaderIndex += 1 self.accept(self.hook, self.__gotAsyncObject) @@ -116,7 +118,7 @@ class Loader(DirectObject): """ assert Loader.notify.debug("Loading model: %s" % (modelPath)) - if loaderOptions == None: + if loaderOptions is None: loaderOptions = LoaderOptions() else: loaderOptions = LoaderOptions(loaderOptions) @@ -156,7 +158,7 @@ class Loader(DirectObject): result = [] for modelPath in modelList: node = self.loader.loadSync(Filename(modelPath), loaderOptions) - if (node != None): + if node is not None: nodePath = NodePath(node) else: nodePath = None @@ -179,16 +181,16 @@ class Loader(DirectObject): # callback (passing it the models on the parameter list). cb = Loader.Callback(len(modelList), gotList, callback, extraArgs) - i=0 + i = 0 for modelPath in modelList: request = self.loader.makeAsyncRequest(Filename(modelPath), loaderOptions) if priority is not None: request.setPriority(priority) request.setDoneEvent(self.hook) - request.setPythonObject((cb, i)) - i+=1 self.loader.loadAsync(request) - cb.requests[request] = True + cb.requests.add(request) + self.__requests[request] = (cb, i) + i += 1 return cb def cancelRequest(self, cb): @@ -200,6 +202,7 @@ class Loader(DirectObject): cb.cancelled = True for request in cb.requests: self.loader.remove(request) + del self.__requests[request] cb.requests = None def isRequestPending(self, cb): @@ -273,7 +276,7 @@ class Loader(DirectObject): # to resolve it for us. options = LoaderOptions(LoaderOptions.LFSearch | LoaderOptions.LFNoDiskCache | LoaderOptions.LFCacheOnly) modelNode = self.loader.loadSync(Filename(model), options) - if modelNode == None: + if modelNode is None: # Model not found. assert Loader.notify.debug("Unloading model not loaded: %s" % (model)) return @@ -293,7 +296,7 @@ class Loader(DirectObject): a callback is used, the model is saved asynchronously, and the true/false status is passed to the callback function. """ - if loaderOptions == None: + if loaderOptions is None: loaderOptions = LoaderOptions() else: loaderOptions = LoaderOptions(loaderOptions) @@ -342,16 +345,16 @@ class Loader(DirectObject): # callback (passing it the models on the parameter list). cb = Loader.Callback(len(modelList), gotList, callback, extraArgs) - i=0 + i = 0 for modelPath, node in modelList: request = self.loader.makeAsyncSaveRequest(Filename(modelPath), loaderOptions, node) if priority is not None: request.setPriority(priority) request.setDoneEvent(self.hook) - request.setPythonObject((cb, i)) - i+=1 self.loader.saveAsync(request) - cb.requests[request] = True + cb.requests.add(request) + self.__requests[request] = (cb, i) + i += 1 return cb @@ -496,7 +499,7 @@ class Loader(DirectObject): phaseChecker(modelPath, loaderOptions) font = FontPool.loadFont(modelPath) - if font == None: + if font is None: if not okMissing: message = 'Could not load font file: %s' % (modelPath) raise IOError(message) @@ -506,21 +509,21 @@ class Loader(DirectObject): # The following properties may only be set for dynamic fonts. if hasattr(font, "setPointSize"): - if pointSize != None: + if pointSize is not None: font.setPointSize(pointSize) - if pixelsPerUnit != None: + if pixelsPerUnit is not None: font.setPixelsPerUnit(pixelsPerUnit) - if scaleFactor != None: + if scaleFactor is not None: font.setScaleFactor(scaleFactor) - if textureMargin != None: + if textureMargin is not None: font.setTextureMargin(textureMargin) - if polyMargin != None: + if polyMargin is not None: font.setPolyMargin(polyMargin) - if minFilter != None: + if minFilter is not None: font.setMinfilter(minFilter) - if magFilter != None: + if magFilter is not None: font.setMagfilter(magFilter) - if anisotropicDegree != None: + if anisotropicDegree is not None: font.setAnisotropicDegree(anisotropicDegree) if color: font.setFg(color) @@ -577,10 +580,10 @@ class Loader(DirectObject): the texture and the number of expected mipmap images. If minfilter or magfilter is not None, they should be a symbol - like Texture.FTLinear or Texture.FTNearest. (minfilter may be - further one of the Mipmap filter type symbols.) These specify - the filter mode that will automatically be applied to the - texture when it is loaded. Note that this setting may + like SamplerState.FTLinear or SamplerState.FTNearest. (minfilter + may be further one of the Mipmap filter type symbols.) These + specify the filter mode that will automatically be applied to + the texture when it is loaded. Note that this setting may override the texture's existing settings, even if it has already been loaded. See egg-texture-cards for a more robust way to apply per-texture filter types and settings. @@ -596,7 +599,7 @@ class Loader(DirectObject): left image and '1' for the right image. Larger numbers are also allowed if you need more than two views. """ - if loaderOptions == None: + if loaderOptions is None: loaderOptions = LoaderOptions() else: loaderOptions = LoaderOptions(loaderOptions) @@ -657,7 +660,7 @@ class Loader(DirectObject): numbered 8 - 15 will be part of the right eye view. """ assert Loader.notify.debug("Loading 3-D texture: %s" % (texturePattern)) - if loaderOptions == None: + if loaderOptions is None: loaderOptions = LoaderOptions() else: loaderOptions = LoaderOptions(loaderOptions) @@ -711,7 +714,7 @@ class Loader(DirectObject): and each six images will define a new view. """ assert Loader.notify.debug("Loading cube map: %s" % (texturePattern)) - if loaderOptions == None: + if loaderOptions is None: loaderOptions = LoaderOptions() else: loaderOptions = LoaderOptions(loaderOptions) @@ -821,13 +824,12 @@ class Loader(DirectObject): # callback (passing it the sounds on the parameter list). cb = Loader.Callback(len(soundList), gotList, callback, extraArgs) - for i in range(len(soundList)): - soundPath = soundList[i] + for i, soundPath in enumerate(soundList): request = AudioLoadRequest(manager, soundPath, positional) request.setDoneEvent(self.hook) - request.setPythonObject((cb, i)) self.loader.loadAsync(request) - cb.requests[request] = True + cb.requests.add(request) + self.__requests[request] = (cb, i) return cb def unloadSfx(self, sfx): @@ -852,7 +854,7 @@ class Loader(DirectObject): return shader def unloadShader(self, shaderPath): - if (shaderPath != None): + if shaderPath is not None: ShaderPool.releaseShader(shaderPath) def asyncFlattenStrong(self, model, inPlace = True, @@ -886,14 +888,15 @@ class Loader(DirectObject): gotList = True cb = Loader.Callback(len(modelList), gotList, callback, extraArgs) - i=0 + i = 0 for model in modelList: request = ModelFlattenRequest(model.node()) request.setDoneEvent(self.hook) request.setPythonObject((cb, i)) - i+=1 self.loader.loadAsync(request) cb.requests[request] = True + self.__requests[request] = (cb, i) + i += 1 return cb def __asyncFlattenDone(self, models, @@ -921,16 +924,23 @@ class Loader(DirectObject): of loaded objects, and call the appropriate callback when it's time.""" - cb, i = request.getPythonObject() - if cb.cancelled: + if request not in self.__requests: return - del cb.requests[request] + cb, i = self.__requests[request] + if cb.cancelled: + # Shouldn't be here. + del self.__requests[request] + return + + cb.requests.discard(request) + if not cb.requests: + del self.__requests[request] object = None if hasattr(request, "getModel"): node = request.getModel() - if (node != None): + if node is not None: object = NodePath(node) elif hasattr(request, "getSound"): diff --git a/direct/src/showutil/FreezeTool.py b/direct/src/showutil/FreezeTool.py index d75a79b56b..c734c56101 100644 --- a/direct/src/showutil/FreezeTool.py +++ b/direct/src/showutil/FreezeTool.py @@ -984,7 +984,10 @@ class Freezer: try: self.__loadModule(mdef) except ImportError as ex: - print("Unknown module: %s (%s)" % (mdef.moduleName, str(ex))) + message = "Unknown module: %s" % (mdef.moduleName) + if str(ex) != "No module named " + str(mdef.moduleName): + message += " (%s)" % (ex) + print(message) # Also attempt to import any implicit modules. If any of # these fail to import, we don't really care. diff --git a/direct/src/stdpy/thread.py b/direct/src/stdpy/thread.py index d10a47fb54..05090e65d8 100644 --- a/direct/src/stdpy/thread.py +++ b/direct/src/stdpy/thread.py @@ -102,7 +102,7 @@ def start_new_thread(function, args, kwargs = {}, name = None): name = 'PythonThread-%s' % (threadId) thread = core.PythonThread(threadFunc, [threadId], name, name) - thread.setPythonData(threadId) + thread.setPythonIndex(threadId) _threads[threadId] = (thread, {}, None) thread.start(core.TPNormal, False) @@ -121,7 +121,7 @@ def _add_thread(thread, wrapper): threadId = _nextThreadId _nextThreadId += 1 - thread.setPythonData(threadId) + thread.setPythonIndex(threadId) _threads[threadId] = (thread, {}, wrapper) return threadId @@ -133,8 +133,8 @@ def _get_thread_wrapper(thread, wrapperClass): is not one, creates an instance of the indicated wrapperClass instead. """ - threadId = thread.getPythonData() - if threadId is None: + threadId = thread.getPythonIndex() + if threadId == -1: # The thread has never been assigned a threadId. Go assign one. global _nextThreadId @@ -143,7 +143,7 @@ def _get_thread_wrapper(thread, wrapperClass): threadId = _nextThreadId _nextThreadId += 1 - thread.setPythonData(threadId) + thread.setPythonIndex(threadId) wrapper = wrapperClass(thread, threadId) _threads[threadId] = (thread, {}, wrapper) return wrapper @@ -169,8 +169,8 @@ def _get_thread_locals(thread, i): """ Returns the locals dictionary for the indicated thread. If there is not one, creates an empty dictionary. """ - threadId = thread.getPythonData() - if threadId is None: + threadId = thread.getPythonIndex() + if threadId == -1: # The thread has never been assigned a threadId. Go assign one. global _nextThreadId @@ -179,7 +179,7 @@ def _get_thread_locals(thread, i): threadId = _nextThreadId _nextThreadId += 1 - thread.setPythonData(threadId) + thread.setPythonIndex(threadId) locals = {} _threads[threadId] = (thread, locals, None) return locals.setdefault(i, {}) @@ -205,9 +205,9 @@ def _remove_thread_id(threadId): _threadsLock.acquire() try: thread, locals, wrapper = _threads[threadId] - assert thread.getPythonData() == threadId + assert thread.getPythonIndex() == threadId del _threads[threadId] - thread.setPythonData(None) + thread.setPythonIndex(-1) finally: _threadsLock.release() diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index c9ffd6dcb7..46073abee3 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -1259,9 +1259,16 @@ write_module_support(ostream &out, ostream *out_h, InterrogateModuleDef *def) { if (is_cpp_type_legal(object->_itype._cpptype) && isExportThisRun(object->_itype._cpptype)) { string class_name = make_safe_name(object->_itype.get_scoped_name()); - bool is_typed = HasAGetClassTypeFunction(object->_itype._cpptype); + bool is_typed = has_get_class_type_function(object->_itype._cpptype); if (is_typed) { + if (has_init_type_function(object->_itype._cpptype)) { + // Call the init_type function. This isn't necessary for all + // types as many of them are automatically initialized at static + // init type, but for some extension classes it's useful. + out << " " << object->_itype._cpptype->get_local_name(&parser) + << "::init_type();\n"; + } out << " Dtool_" << class_name << "._type = " << object->_itype._cpptype->get_local_name(&parser) << "::get_class_type();\n" @@ -1291,7 +1298,7 @@ write_module_support(ostream &out, ostream *out_h, InterrogateModuleDef *def) { string class_name = (*ii)->get_local_name(&parser); string safe_name = make_safe_name(class_name); - if (HasAGetClassTypeFunction(*ii)) { + if (has_get_class_type_function(*ii)) { out << " Dtool_Ptr_" << safe_name << " = LookupRuntimeTypedClass(" << class_name << "::get_class_type());\n"; } else { out << " Dtool_Ptr_" << safe_name << " = LookupNamedClass(\"" << class_name << "\");\n"; @@ -1541,7 +1548,7 @@ write_module_class(ostream &out, Object *obj) { std::string export_class_name = classNameFromCppName(obj->_itype.get_name(), false); bool is_runtime_typed = IsPandaTypedObject(obj->_itype._cpptype->as_struct_type()); - if (!is_runtime_typed && HasAGetClassTypeFunction(obj->_itype._cpptype)) { + if (!is_runtime_typed && has_get_class_type_function(obj->_itype._cpptype)) { is_runtime_typed = true; } @@ -7010,7 +7017,7 @@ DoesInheritFromIsClass(const CPPStructType *inclass, const std::string &name) { */ bool InterfaceMakerPythonNative:: -HasAGetClassTypeFunction(CPPType *type) { +has_get_class_type_function(CPPType *type) { while (type->get_subtype() == CPPDeclaration::ST_typedef) { type = type->as_typedef_type()->_type; } @@ -7025,6 +7032,43 @@ HasAGetClassTypeFunction(CPPType *type) { return scope->_functions.find("get_class_type") != scope->_functions.end(); } +/** + * + */ +bool InterfaceMakerPythonNative:: +has_init_type_function(CPPType *type) { + while (type->get_subtype() == CPPDeclaration::ST_typedef) { + type = type->as_typedef_type()->_type; + } + + CPPStructType *struct_type = type->as_struct_type(); + if (struct_type == NULL) { + return false; + } + + CPPScope *scope = struct_type->get_scope(); + CPPScope::Functions::const_iterator it = scope->_functions.find("init_type"); + if (it == scope->_functions.end()) { + return false; + } + const CPPFunctionGroup *group = it->second; + + CPPFunctionGroup::Instances::const_iterator ii; + for (ii = group->_instances.begin(); ii != group->_instances.end(); ++ii) { + const CPPInstance *cppinst = *ii; + const CPPFunctionType *cppfunc = cppinst->_type->as_function_type(); + + if (cppfunc != NULL && + cppfunc->_parameters != NULL && + cppfunc->_parameters->_parameters.size() == 0 && + (cppinst->_storage_class & CPPInstance::SC_static) != 0) { + return true; + } + } + + return false; +} + /** * Returns -1 if the class does not define write() (and therefore cannot * support a __str__ function). diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.h b/dtool/src/interrogate/interfaceMakerPythonNative.h index a571e3323f..8f66fcf3b0 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.h +++ b/dtool/src/interrogate/interfaceMakerPythonNative.h @@ -201,7 +201,8 @@ public: bool DoesInheritFromIsClass(const CPPStructType * inclass, const std::string &name); bool IsPandaTypedObject(CPPStructType * inclass) { return DoesInheritFromIsClass(inclass,"TypedObject"); }; void write_python_instance(ostream &out, int indent_level, const std::string &return_expr, bool owns_memory, const InterrogateType &itype, bool is_const); - bool HasAGetClassTypeFunction(CPPType *type); + bool has_get_class_type_function(CPPType *type); + bool has_init_type_function(CPPType *type); int NeedsAStrFunction(const InterrogateType &itype_class); int NeedsAReprFunction(const InterrogateType &itype_class); bool NeedsARichCompareFunction(const InterrogateType &itype_class); diff --git a/dtool/src/interrogate/interrogate.cxx b/dtool/src/interrogate/interrogate.cxx index 86d2ae9a6e..206132bb31 100644 --- a/dtool/src/interrogate/interrogate.cxx +++ b/dtool/src/interrogate/interrogate.cxx @@ -19,7 +19,6 @@ #include "pnotify.h" #include "panda_getopt_long.h" #include "preprocess_argv.h" -#include "pystub.h" #include CPPParser parser; @@ -306,9 +305,6 @@ predefine_macro(CPPParser& parser, const string& inoption) { int main(int argc, char **argv) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - preprocess_argv(argc, argv); string command_line; int i; diff --git a/dtool/src/interrogate/interrogate_module.cxx b/dtool/src/interrogate/interrogate_module.cxx index 9a8cff85bf..8e397d8b9e 100644 --- a/dtool/src/interrogate/interrogate_module.cxx +++ b/dtool/src/interrogate/interrogate_module.cxx @@ -19,7 +19,6 @@ #include "interrogate_interface.h" #include "interrogate_request.h" #include "load_dso.h" -#include "pystub.h" #include "pnotify.h" #include "panda_getopt_long.h" #include "preprocess_argv.h" @@ -380,9 +379,6 @@ int main(int argc, char *argv[]) { extern int optind; int flag; - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - preprocess_argv(argc, argv); flag = getopt_long_only(argc, argv, short_options, long_options, NULL); while (flag != EOF) { diff --git a/dtool/src/parser-inc/Python.h b/dtool/src/parser-inc/Python.h index b687f1b5cb..ddd660072d 100644 --- a/dtool/src/parser-inc/Python.h +++ b/dtool/src/parser-inc/Python.h @@ -30,7 +30,7 @@ typedef struct {} PyUnicodeObject; class PyThreadState; typedef int Py_ssize_t; -struct Py_buffer; +typedef struct bufferinfo Py_buffer; // We need to define these accurately since interrogate may want to // write these out to default value assignments. diff --git a/dtool/src/test_interrogate/test_interrogate.cxx b/dtool/src/test_interrogate/test_interrogate.cxx index f715a6f366..f9aa7c1ab4 100644 --- a/dtool/src/test_interrogate/test_interrogate.cxx +++ b/dtool/src/test_interrogate/test_interrogate.cxx @@ -17,7 +17,6 @@ #include "interrogate_request.h" #include "load_dso.h" #include "filename.h" -#include "pystub.h" #include "panda_getopt.h" #include "preprocess_argv.h" diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 6e4c06b7d2..2aecf0dd0a 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -758,8 +758,8 @@ if (COMPILER=="GCC"): # 64-bits OS X doesn't have Carbon. PkgDisable("CARBON") - if (PkgSkip("PYTHON")==0): - IncDirectory("ALWAYS", SDK["PYTHON"]) + #if (PkgSkip("PYTHON")==0): + # IncDirectory("PYTHON", SDK["PYTHON"]) if (GetHost() == "darwin"): if (PkgSkip("FREETYPE")==0 and not os.path.isdir(GetThirdpartyDir() + 'freetype')): IncDirectory("FREETYPE", "/usr/X11/include") @@ -1241,7 +1241,7 @@ def CompileCxx(obj,src,opts): cmd += ' -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__' cmd += ' -fstack-protector -march=armv5te -mtune=xscale -msoft-float' elif arch == 'mips': - cmd += ' -fno-strict-aliasing -finline-functions -fmessage-length=0' + cmd += ' -finline-functions -fmessage-length=0' cmd += ' -fno-inline-functions-called-once -fgcse-after-reload' cmd += ' -frerun-cse-after-loop -frename-registers' @@ -1251,17 +1251,13 @@ def CompileCxx(obj,src,opts): if optlevel >= 3: cmd += " -fomit-frame-pointer" if arch.startswith('arm'): - cmd += ' -fno-strict-aliasing -finline-limit=64 -mthumb' - elif arch == 'x86': - cmd += ' -fstrict-aliasing' + cmd += ' -finline-limit=64 -mthumb' elif arch == 'mips': cmd += ' -funswitch-loops -finline-limit=300' else: cmd += ' -fno-omit-frame-pointer' if arch.startswith('arm'): cmd += ' -marm' - elif arch == 'x86': - cmd += ' -fno-strict-aliasing' # Enable SIMD instructions if requested if arch.startswith('arm') and PkgSkip("NEON") == 0: @@ -1289,6 +1285,9 @@ def CompileCxx(obj,src,opts): if ('SSE2' in opts or not PkgSkip("SSE2")) and not arch.startswith("arm"): cmd += " -msse2" + # Needed by both Python, Panda, Eigen, all of which break aliasing rules. + cmd += " -fno-strict-aliasing" + if optlevel >= 3: cmd += " -ffast-math" if optlevel == 3: @@ -3152,10 +3151,6 @@ COMMON_EGG2X_LIBS=[ 'libpandaegg.dll', ] + COMMON_PANDA_LIBS -COMMON_DTOOL_LIBS_PYSTUB = COMMON_DTOOL_LIBS + ['libp3pystub.lib'] -COMMON_PANDA_LIBS_PYSTUB = COMMON_PANDA_LIBS + ['libp3pystub.lib'] -COMMON_EGG2X_LIBS_PYSTUB = COMMON_EGG2X_LIBS + ['libp3pystub.lib'] - ######################################################################## # # This section contains a list of all the files that need to be compiled. @@ -3259,7 +3254,7 @@ TargetAdd('libp3dtoolconfig.dll', opts=['ADVAPI', 'OPENSSL', 'WINGDI', 'WINUSER' # DIRECTORY: dtool/src/interrogatedb/ # -OPTS=['DIR:dtool/src/interrogatedb', 'BUILDING:INTERROGATEDB'] +OPTS=['DIR:dtool/src/interrogatedb', 'BUILDING:INTERROGATEDB', 'PYTHON'] TargetAdd('p3interrogatedb_composite1.obj', opts=OPTS, input='p3interrogatedb_composite1.cxx') TargetAdd('p3interrogatedb_composite2.obj', opts=OPTS, input='p3interrogatedb_composite2.cxx') TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite1.obj') @@ -3271,7 +3266,7 @@ TargetAdd('libp3interrogatedb.dll', opts=['PYTHON']) if not PkgSkip("PYTHON"): # This used to be called dtoolconfig.pyd, but it just contains the interrogatedb # stuff, so it has been renamed appropriately. - OPTS=['DIR:dtool/metalibs/dtoolconfig'] + OPTS=['DIR:dtool/metalibs/dtoolconfig', 'PYTHON'] TargetAdd('interrogatedb_pydtool.obj', opts=OPTS, input="pydtool.cxx") TargetAdd('interrogatedb.pyd', input='interrogatedb_pydtool.obj') TargetAdd('interrogatedb.pyd', input='libp3dtool.dll') @@ -3283,11 +3278,12 @@ if not PkgSkip("PYTHON"): # DIRECTORY: dtool/src/pystub/ # -OPTS=['DIR:dtool/src/pystub'] -TargetAdd('p3pystub_pystub.obj', opts=OPTS, input='pystub.cxx') -TargetAdd('libp3pystub.lib', input='p3pystub_pystub.obj') -#TargetAdd('libp3pystub.lib', input='libp3dtool.dll') -TargetAdd('libp3pystub.lib', opts=['ADVAPI']) +if not RUNTIME and not RTDIST: + OPTS=['DIR:dtool/src/pystub'] + TargetAdd('p3pystub_pystub.obj', opts=OPTS, input='pystub.cxx') + TargetAdd('libp3pystub.lib', input='p3pystub_pystub.obj') + #TargetAdd('libp3pystub.lib', input='libp3dtool.dll') + TargetAdd('libp3pystub.lib', opts=['ADVAPI']) # # DIRECTORY: dtool/src/interrogate/ @@ -3300,14 +3296,14 @@ if (not RUNTIME): TargetAdd('interrogate.exe', input='interrogate_composite1.obj') TargetAdd('interrogate.exe', input='interrogate_composite2.obj') TargetAdd('interrogate.exe', input='libp3cppParser.ilb') - TargetAdd('interrogate.exe', input=COMMON_DTOOL_LIBS_PYSTUB) + TargetAdd('interrogate.exe', input=COMMON_DTOOL_LIBS) TargetAdd('interrogate.exe', input='libp3interrogatedb.dll') TargetAdd('interrogate.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER']) TargetAdd('interrogate_module_interrogate_module.obj', opts=OPTS, input='interrogate_module.cxx') TargetAdd('interrogate_module.exe', input='interrogate_module_interrogate_module.obj') TargetAdd('interrogate_module.exe', input='libp3cppParser.ilb') - TargetAdd('interrogate_module.exe', input=COMMON_DTOOL_LIBS_PYSTUB) + TargetAdd('interrogate_module.exe', input=COMMON_DTOOL_LIBS) TargetAdd('interrogate_module.exe', input='libp3interrogatedb.dll') TargetAdd('interrogate_module.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER']) @@ -3315,7 +3311,7 @@ if (not RUNTIME): TargetAdd('parse_file_parse_file.obj', opts=OPTS, input='parse_file.cxx') TargetAdd('parse_file.exe', input='parse_file_parse_file.obj') TargetAdd('parse_file.exe', input='libp3cppParser.ilb') - TargetAdd('parse_file.exe', input=COMMON_DTOOL_LIBS_PYSTUB) + TargetAdd('parse_file.exe', input=COMMON_DTOOL_LIBS) TargetAdd('parse_file.exe', input='libp3interrogatedb.dll') TargetAdd('parse_file.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER']) @@ -3327,7 +3323,7 @@ if (PkgSkip("OPENSSL")==0 and not RUNTIME and not RTDIST): OPTS=['DIR:dtool/src/prckeys', 'OPENSSL'] TargetAdd('make-prc-key_makePrcKey.obj', opts=OPTS, input='makePrcKey.cxx') TargetAdd('make-prc-key.exe', input='make-prc-key_makePrcKey.obj') - TargetAdd('make-prc-key.exe', input=COMMON_DTOOL_LIBS_PYSTUB) + TargetAdd('make-prc-key.exe', input=COMMON_DTOOL_LIBS) TargetAdd('make-prc-key.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER']) # @@ -3339,7 +3335,7 @@ if (not RTDIST and not RUNTIME): TargetAdd('test_interrogate_test_interrogate.obj', opts=OPTS, input='test_interrogate.cxx') TargetAdd('test_interrogate.exe', input='test_interrogate_test_interrogate.obj') TargetAdd('test_interrogate.exe', input='libp3interrogatedb.dll') - TargetAdd('test_interrogate.exe', input=COMMON_DTOOL_LIBS_PYSTUB) + TargetAdd('test_interrogate.exe', input=COMMON_DTOOL_LIBS) TargetAdd('test_interrogate.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER']) # @@ -3357,7 +3353,7 @@ OPTS=['DIR:panda/src/express', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB'] TargetAdd('p3express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx') TargetAdd('p3express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx') -OPTS=['DIR:panda/src/express', 'OPENSSL', 'ZLIB'] +OPTS=['DIR:panda/src/express', 'OPENSSL', 'ZLIB', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/express', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3express.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3express.in', opts=['IMOD:panda3d.core', 'ILIB:libp3express', 'SRCDIR:panda/src/express']) @@ -3372,7 +3368,7 @@ OPTS=['DIR:panda/src/downloader', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB'] TargetAdd('p3downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx') TargetAdd('p3downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx') -OPTS=['DIR:panda/src/downloader', 'OPENSSL', 'ZLIB'] +OPTS=['DIR:panda/src/downloader', 'OPENSSL', 'ZLIB', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/downloader', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3downloader.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3downloader.in', opts=['IMOD:panda3d.core', 'ILIB:libp3downloader', 'SRCDIR:panda/src/downloader']) @@ -3404,11 +3400,12 @@ if (not RUNTIME): TargetAdd('p3pipeline_composite2.obj', opts=OPTS, input='p3pipeline_composite2.cxx') TargetAdd('p3pipeline_contextSwitch.obj', opts=OPTS, input='contextSwitch.c') - OPTS=['DIR:panda/src/pipeline'] + OPTS=['DIR:panda/src/pipeline', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/pipeline', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3pipeline.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3pipeline.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pipeline', 'SRCDIR:panda/src/pipeline']) TargetAdd('libp3pipeline_igate.obj', input='libp3pipeline.in', opts=["DEPENDENCYONLY"]) + TargetAdd('p3pipeline_pythonThread.obj', opts=OPTS, input='pythonThread.cxx') # # DIRECTORY: panda/src/linmath/ @@ -3419,7 +3416,7 @@ if (not RUNTIME): TargetAdd('p3linmath_composite1.obj', opts=OPTS, input='p3linmath_composite1.cxx') TargetAdd('p3linmath_composite2.obj', opts=OPTS, input='p3linmath_composite2.cxx') - OPTS=['DIR:panda/src/linmath'] + OPTS=['DIR:panda/src/linmath', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/linmath', ["*.h", "*_composite*.cxx"]) for ifile in IGATEFILES[:]: if "_src." in ifile: @@ -3440,7 +3437,7 @@ if (not RUNTIME): TargetAdd('p3putil_composite1.obj', opts=OPTS, input='p3putil_composite1.cxx') TargetAdd('p3putil_composite2.obj', opts=OPTS, input='p3putil_composite2.cxx') - OPTS=['DIR:panda/src/putil', 'ZLIB'] + OPTS=['DIR:panda/src/putil', 'ZLIB', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/putil', ["*.h", "*_composite*.cxx"]) IGATEFILES.remove("test_bam.h") TargetAdd('libp3putil.in', opts=OPTS, input=IGATEFILES) @@ -3456,7 +3453,7 @@ if (not RUNTIME): OPTS=['DIR:panda/src/audio', 'BUILDING:PANDA'] TargetAdd('p3audio_composite1.obj', opts=OPTS, input='p3audio_composite1.cxx') - OPTS=['DIR:panda/src/audio'] + OPTS=['DIR:panda/src/audio', 'PYTHON'] IGATEFILES=["audio.h"] TargetAdd('libp3audio.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3audio.in', opts=['IMOD:panda3d.core', 'ILIB:libp3audio', 'SRCDIR:panda/src/audio']) @@ -3471,7 +3468,7 @@ if (not RUNTIME): TargetAdd('p3event_composite1.obj', opts=OPTS, input='p3event_composite1.cxx') TargetAdd('p3event_composite2.obj', opts=OPTS, input='p3event_composite2.cxx') - OPTS=['DIR:panda/src/event'] + OPTS=['DIR:panda/src/event', 'PYTHON'] TargetAdd('p3event_pythonTask.obj', opts=OPTS, input='pythonTask.cxx') IGATEFILES=GetDirectoryContents('panda/src/event', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3event.in', opts=OPTS, input=IGATEFILES) @@ -3487,7 +3484,7 @@ if (not RUNTIME): TargetAdd('p3mathutil_composite1.obj', opts=OPTS, input='p3mathutil_composite1.cxx') TargetAdd('p3mathutil_composite2.obj', opts=OPTS, input='p3mathutil_composite2.cxx') - OPTS=['DIR:panda/src/mathutil', 'FFTW'] + OPTS=['DIR:panda/src/mathutil', 'FFTW', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/mathutil', ["*.h", "*_composite*.cxx"]) for ifile in IGATEFILES[:]: if "_src." in ifile: @@ -3504,7 +3501,7 @@ if (not RUNTIME): OPTS=['DIR:panda/src/gsgbase', 'BUILDING:PANDA'] TargetAdd('p3gsgbase_composite1.obj', opts=OPTS, input='p3gsgbase_composite1.cxx') - OPTS=['DIR:panda/src/gsgbase'] + OPTS=['DIR:panda/src/gsgbase', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/gsgbase', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3gsgbase.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3gsgbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gsgbase', 'SRCDIR:panda/src/gsgbase']) @@ -3520,7 +3517,7 @@ if (not RUNTIME): TargetAdd('p3pnmimage_composite2.obj', opts=OPTS, input='p3pnmimage_composite2.cxx') TargetAdd('p3pnmimage_convert_srgb_sse2.obj', opts=OPTS+['SSE2'], input='convert_srgb_sse2.cxx') - OPTS=['DIR:panda/src/pnmimage', 'ZLIB'] + OPTS=['DIR:panda/src/pnmimage', 'ZLIB', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/pnmimage', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3pnmimage.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3pnmimage.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmimage', 'SRCDIR:panda/src/pnmimage']) @@ -3535,7 +3532,7 @@ if (not RUNTIME): OPTS=['DIR:panda/src/nativenet', 'OPENSSL', 'BUILDING:PANDA'] TargetAdd('p3nativenet_composite1.obj', opts=OPTS, input='p3nativenet_composite1.cxx') - OPTS=['DIR:panda/src/nativenet', 'OPENSSL'] + OPTS=['DIR:panda/src/nativenet', 'OPENSSL', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/nativenet', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3nativenet.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3nativenet.in', opts=['IMOD:panda3d.core', 'ILIB:libp3nativenet', 'SRCDIR:panda/src/nativenet']) @@ -3550,7 +3547,7 @@ if (not RUNTIME): TargetAdd('p3net_composite1.obj', opts=OPTS, input='p3net_composite1.cxx') TargetAdd('p3net_composite2.obj', opts=OPTS, input='p3net_composite2.cxx') - OPTS=['DIR:panda/src/net'] + OPTS=['DIR:panda/src/net', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/net', ["*.h", "*_composite*.cxx"]) IGATEFILES.remove("datagram_ui.h") TargetAdd('libp3net.in', opts=OPTS, input=IGATEFILES) @@ -3566,7 +3563,7 @@ if (not RUNTIME): TargetAdd('p3pstatclient_composite1.obj', opts=OPTS, input='p3pstatclient_composite1.cxx') TargetAdd('p3pstatclient_composite2.obj', opts=OPTS, input='p3pstatclient_composite2.cxx') - OPTS=['DIR:panda/src/pstatclient'] + OPTS=['DIR:panda/src/pstatclient', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/pstatclient', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3pstatclient.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3pstatclient.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pstatclient', 'SRCDIR:panda/src/pstatclient']) @@ -3581,7 +3578,7 @@ if (not RUNTIME): TargetAdd('p3gobj_composite1.obj', opts=OPTS, input='p3gobj_composite1.cxx') TargetAdd('p3gobj_composite2.obj', opts=OPTS, input='p3gobj_composite2.cxx') - OPTS=['DIR:panda/src/gobj', 'NVIDIACG', 'ZLIB', 'SQUISH'] + OPTS=['DIR:panda/src/gobj', 'NVIDIACG', 'ZLIB', 'SQUISH', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/gobj', ["*.h", "*_composite*.cxx"]) if ("cgfx_states.h" in IGATEFILES): IGATEFILES.remove("cgfx_states.h") TargetAdd('libp3gobj.in', opts=OPTS, input=IGATEFILES) @@ -3598,7 +3595,7 @@ if (not RUNTIME): TargetAdd('p3pgraphnodes_composite1.obj', opts=OPTS, input='p3pgraphnodes_composite1.cxx') TargetAdd('p3pgraphnodes_composite2.obj', opts=OPTS, input='p3pgraphnodes_composite2.cxx') - OPTS=['DIR:panda/src/pgraphnodes'] + OPTS=['DIR:panda/src/pgraphnodes', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/pgraphnodes', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3pgraphnodes.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3pgraphnodes.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraphnodes', 'SRCDIR:panda/src/pgraphnodes']) @@ -3616,7 +3613,7 @@ if (not RUNTIME): TargetAdd('p3pgraph_composite3.obj', opts=OPTS, input='p3pgraph_composite3.cxx') TargetAdd('p3pgraph_composite4.obj', opts=OPTS, input='p3pgraph_composite4.cxx') - OPTS=['DIR:panda/src/pgraph'] + OPTS=['DIR:panda/src/pgraph', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/pgraph', ["*.h", "nodePath.cxx", "*_composite*.cxx"]) TargetAdd('libp3pgraph.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3pgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraph', 'SRCDIR:panda/src/pgraph']) @@ -3632,7 +3629,7 @@ if (not RUNTIME): TargetAdd('p3cull_composite1.obj', opts=OPTS, input='p3cull_composite1.cxx') TargetAdd('p3cull_composite2.obj', opts=OPTS, input='p3cull_composite2.cxx') - OPTS=['DIR:panda/src/cull'] + OPTS=['DIR:panda/src/cull', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/cull', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3cull.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3cull.in', opts=['IMOD:panda3d.core', 'ILIB:libp3cull', 'SRCDIR:panda/src/cull']) @@ -3647,7 +3644,7 @@ if (not RUNTIME): TargetAdd('p3chan_composite1.obj', opts=OPTS, input='p3chan_composite1.cxx') TargetAdd('p3chan_composite2.obj', opts=OPTS, input='p3chan_composite2.cxx') - OPTS=['DIR:panda/src/chan'] + OPTS=['DIR:panda/src/chan', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/chan', ["*.h", "*_composite*.cxx"]) IGATEFILES.remove('movingPart.h') IGATEFILES.remove('animChannelFixed.h') @@ -3664,7 +3661,7 @@ if (not RUNTIME): TargetAdd('p3char_composite1.obj', opts=OPTS, input='p3char_composite1.cxx') TargetAdd('p3char_composite2.obj', opts=OPTS, input='p3char_composite2.cxx') - OPTS=['DIR:panda/src/char'] + OPTS=['DIR:panda/src/char', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/char', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3char.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3char.in', opts=['IMOD:panda3d.core', 'ILIB:libp3char', 'SRCDIR:panda/src/char']) @@ -3679,7 +3676,7 @@ if (not RUNTIME): TargetAdd('p3dgraph_composite1.obj', opts=OPTS, input='p3dgraph_composite1.cxx') TargetAdd('p3dgraph_composite2.obj', opts=OPTS, input='p3dgraph_composite2.cxx') - OPTS=['DIR:panda/src/dgraph'] + OPTS=['DIR:panda/src/dgraph', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/dgraph', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3dgraph.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3dgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dgraph', 'SRCDIR:panda/src/dgraph']) @@ -3694,7 +3691,7 @@ if (not RUNTIME): TargetAdd('p3display_composite1.obj', opts=OPTS, input='p3display_composite1.cxx') TargetAdd('p3display_composite2.obj', opts=OPTS, input='p3display_composite2.cxx') - OPTS=['DIR:panda/src/display'] + OPTS=['DIR:panda/src/display', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/display', ["*.h", "*_composite*.cxx"]) IGATEFILES.remove("renderBuffer.h") TargetAdd('libp3display.in', opts=OPTS, input=IGATEFILES) @@ -3718,7 +3715,7 @@ if (not RUNTIME): TargetAdd('p3device_composite1.obj', opts=OPTS, input='p3device_composite1.cxx') TargetAdd('p3device_composite2.obj', opts=OPTS, input='p3device_composite2.cxx') - OPTS=['DIR:panda/src/device'] + OPTS=['DIR:panda/src/device', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/device', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3device.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3device.in', opts=['IMOD:panda3d.core', 'ILIB:libp3device', 'SRCDIR:panda/src/device']) @@ -3732,7 +3729,7 @@ if (PkgSkip("FREETYPE")==0 and not RUNTIME): OPTS=['DIR:panda/src/pnmtext', 'BUILDING:PANDA', 'FREETYPE'] TargetAdd('p3pnmtext_composite1.obj', opts=OPTS, input='p3pnmtext_composite1.cxx') - OPTS=['DIR:panda/src/pnmtext', 'FREETYPE'] + OPTS=['DIR:panda/src/pnmtext', 'FREETYPE', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/pnmtext', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3pnmtext.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3pnmtext.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmtext', 'SRCDIR:panda/src/pnmtext']) @@ -3747,7 +3744,7 @@ if (not RUNTIME): TargetAdd('p3text_composite1.obj', opts=OPTS, input='p3text_composite1.cxx') TargetAdd('p3text_composite2.obj', opts=OPTS, input='p3text_composite2.cxx') - OPTS=['DIR:panda/src/text', 'ZLIB', 'FREETYPE'] + OPTS=['DIR:panda/src/text', 'ZLIB', 'FREETYPE', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/text', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3text.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3text.in', opts=['IMOD:panda3d.core', 'ILIB:libp3text', 'SRCDIR:panda/src/text']) @@ -3761,7 +3758,7 @@ if (not RUNTIME): OPTS=['DIR:panda/src/movies', 'BUILDING:PANDA', 'VORBIS'] TargetAdd('p3movies_composite1.obj', opts=OPTS, input='p3movies_composite1.cxx') - OPTS=['DIR:panda/src/movies', 'VORBIS'] + OPTS=['DIR:panda/src/movies', 'VORBIS', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/movies', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3movies.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3movies.in', opts=['IMOD:panda3d.core', 'ILIB:libp3movies', 'SRCDIR:panda/src/movies']) @@ -3777,7 +3774,7 @@ if (not RUNTIME): TargetAdd('p3grutil_composite1.obj', opts=OPTS, input='p3grutil_composite1.cxx') TargetAdd('p3grutil_composite2.obj', opts=OPTS, input='p3grutil_composite2.cxx') - OPTS=['DIR:panda/src/grutil'] + OPTS=['DIR:panda/src/grutil', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/grutil', ["*.h", "*_composite*.cxx"]) if 'convexHull.h' in IGATEFILES: IGATEFILES.remove('convexHull.h') TargetAdd('libp3grutil.in', opts=OPTS, input=IGATEFILES) @@ -3793,7 +3790,7 @@ if (not RUNTIME): TargetAdd('p3tform_composite1.obj', opts=OPTS, input='p3tform_composite1.cxx') TargetAdd('p3tform_composite2.obj', opts=OPTS, input='p3tform_composite2.cxx') - OPTS=['DIR:panda/src/tform'] + OPTS=['DIR:panda/src/tform', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/tform', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3tform.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3tform.in', opts=['IMOD:panda3d.core', 'ILIB:libp3tform', 'SRCDIR:panda/src/tform']) @@ -3808,7 +3805,7 @@ if (not RUNTIME): TargetAdd('p3collide_composite1.obj', opts=OPTS, input='p3collide_composite1.cxx') TargetAdd('p3collide_composite2.obj', opts=OPTS, input='p3collide_composite2.cxx') - OPTS=['DIR:panda/src/collide'] + OPTS=['DIR:panda/src/collide', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/collide', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3collide.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3collide.in', opts=['IMOD:panda3d.core', 'ILIB:libp3collide', 'SRCDIR:panda/src/collide']) @@ -3823,7 +3820,7 @@ if (not RUNTIME): TargetAdd('p3parametrics_composite1.obj', opts=OPTS, input='p3parametrics_composite1.cxx') TargetAdd('p3parametrics_composite2.obj', opts=OPTS, input='p3parametrics_composite2.cxx') - OPTS=['DIR:panda/src/parametrics'] + OPTS=['DIR:panda/src/parametrics', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/parametrics', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3parametrics.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3parametrics.in', opts=['IMOD:panda3d.core', 'ILIB:libp3parametrics', 'SRCDIR:panda/src/parametrics']) @@ -3838,7 +3835,7 @@ if (not RUNTIME): TargetAdd('p3pgui_composite1.obj', opts=OPTS, input='p3pgui_composite1.cxx') TargetAdd('p3pgui_composite2.obj', opts=OPTS, input='p3pgui_composite2.cxx') - OPTS=['DIR:panda/src/pgui'] + OPTS=['DIR:panda/src/pgui', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/pgui', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3pgui.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3pgui.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgui', 'SRCDIR:panda/src/pgui']) @@ -3862,7 +3859,7 @@ if (not RUNTIME): TargetAdd('p3recorder_composite1.obj', opts=OPTS, input='p3recorder_composite1.cxx') TargetAdd('p3recorder_composite2.obj', opts=OPTS, input='p3recorder_composite2.cxx') - OPTS=['DIR:panda/src/recorder'] + OPTS=['DIR:panda/src/recorder', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/recorder', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3recorder.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3recorder.in', opts=['IMOD:panda3d.core', 'ILIB:libp3recorder', 'SRCDIR:panda/src/recorder']) @@ -3882,7 +3879,7 @@ if (not RUNTIME): OPTS=['DIR:panda/src/dxml', 'BUILDING:PANDA', 'TINYXML'] TargetAdd('p3dxml_composite1.obj', opts=OPTS, input='p3dxml_composite1.cxx') - OPTS=['DIR:panda/src/dxml', 'TINYXML'] + OPTS=['DIR:panda/src/dxml', 'TINYXML', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/dxml', ["*.h", "p3dxml_composite1.cxx"]) TargetAdd('libp3dxml.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3dxml.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dxml', 'SRCDIR:panda/src/dxml']) @@ -4008,6 +4005,7 @@ if (not RUNTIME): if PkgSkip("FREETYPE")==0: TargetAdd('core_module.obj', input='libp3pnmtext.in') + TargetAdd('core_module.obj', opts=['PYTHON']) TargetAdd('core_module.obj', opts=['IMOD:panda3d.core', 'ILIB:core']) TargetAdd('core.pyd', input='libp3downloader_igate.obj') @@ -4047,6 +4045,7 @@ if (not RUNTIME): if PkgSkip("FREETYPE")==0: TargetAdd('core.pyd', input="libp3pnmtext_igate.obj") + TargetAdd('core.pyd', input='p3pipeline_pythonThread.obj') TargetAdd('core.pyd', input='p3putil_ext_composite.obj') TargetAdd('core.pyd', input='p3pnmimage_pfmFile_ext.obj') TargetAdd('core.pyd', input='p3event_pythonTask.obj') @@ -4075,7 +4074,7 @@ if (PkgSkip("VISION") == 0) and (not RUNTIME): TargetAdd('libp3vision.dll', input=COMMON_PANDA_LIBS) TargetAdd('libp3vision.dll', opts=OPTS) - OPTS=['DIR:panda/src/vision', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS'] + OPTS=['DIR:panda/src/vision', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/vision', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3vision.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3vision.in', opts=['IMOD:panda3d.vision', 'ILIB:libp3vision', 'SRCDIR:panda/src/vision']) @@ -4104,7 +4103,7 @@ if (PkgSkip("ROCKET") == 0) and (not RUNTIME): TargetAdd('libp3rocket.dll', input=COMMON_PANDA_LIBS) TargetAdd('libp3rocket.dll', opts=OPTS) - OPTS=['DIR:panda/src/rocket', 'ROCKET', 'RTTI', 'EXCEPTIONS'] + OPTS=['DIR:panda/src/rocket', 'ROCKET', 'RTTI', 'EXCEPTIONS', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/rocket', ["rocketInputHandler.h", "rocketInputHandler.cxx", "rocketRegion.h", "rocketRegion.cxx", "rocketRegion_ext.h"]) TargetAdd('libp3rocket.in', opts=OPTS, input=IGATEFILES) @@ -4134,7 +4133,7 @@ if PkgSkip("AWESOMIUM") == 0 and not RUNTIME: TargetAdd('libp3awesomium.dll', input=COMMON_PANDA_LIBS) TargetAdd('libp3awesomium.dll', opts=OPTS) - OPTS=['DIR:panda/src/awesomium', 'AWESOMIUM'] + OPTS=['DIR:panda/src/awesomium', 'AWESOMIUM', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/awesomium', ["*.h", "*_composite1.cxx"]) TargetAdd('libp3awesomium.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3awesomium.in', opts=['IMOD:panda3d.awesomium', 'ILIB:libp3awesomium', 'SRCDIR:panda/src/awesomium']) @@ -4159,7 +4158,7 @@ if (PkgSkip('SKEL')==0) and (not RUNTIME): OPTS=['DIR:panda/src/skel', 'BUILDING:PANDASKEL', 'ADVAPI'] TargetAdd('p3skel_composite1.obj', opts=OPTS, input='p3skel_composite1.cxx') - OPTS=['DIR:panda/src/skel', 'ADVAPI'] + OPTS=['DIR:panda/src/skel', 'ADVAPI', 'PYTHON'] IGATEFILES=GetDirectoryContents("panda/src/skel", ["*.h", "*_composite*.cxx"]) TargetAdd('libp3skel.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3skel.in', opts=['IMOD:panda3d.skel', 'ILIB:libp3skel', 'SRCDIR:panda/src/skel']) @@ -4175,7 +4174,9 @@ if (PkgSkip('SKEL')==0) and (not RUNTIME): TargetAdd('libpandaskel.dll', input=COMMON_PANDA_LIBS) TargetAdd('libpandaskel.dll', opts=OPTS) + OPTS=['PYTHON'] TargetAdd('skel_module.obj', input='libp3skel.in') + TargetAdd('skel_module.obj', opts=OPTS) TargetAdd('skel_module.obj', opts=['IMOD:panda3d.skel', 'ILIB:skel', 'IMPORT:panda3d.core']) TargetAdd('skel.pyd', input='skel_module.obj') @@ -4193,7 +4194,7 @@ if (PkgSkip('PANDAFX')==0) and (not RUNTIME): OPTS=['DIR:panda/src/distort', 'BUILDING:PANDAFX'] TargetAdd('p3distort_composite1.obj', opts=OPTS, input='p3distort_composite1.cxx') - OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG'] + OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/distort', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3distort.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3distort.in', opts=['IMOD:panda3d.fx', 'ILIB:libp3distort', 'SRCDIR:panda/src/distort']) @@ -4212,7 +4213,7 @@ if (PkgSkip('PANDAFX')==0) and (not RUNTIME): TargetAdd('libpandafx.dll', input=COMMON_PANDA_LIBS) TargetAdd('libpandafx.dll', opts=['ADVAPI', 'NVIDIACG']) - OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG'] + OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG', 'PYTHON'] TargetAdd('fx_module.obj', input='libp3distort.in') TargetAdd('fx_module.obj', opts=OPTS) TargetAdd('fx_module.obj', opts=['IMOD:panda3d.fx', 'ILIB:fx', 'IMPORT:panda3d.core']) @@ -4235,7 +4236,7 @@ if (PkgSkip("VRPN")==0 and not RUNTIME): TargetAdd('libp3vrpn.dll', input=COMMON_PANDA_LIBS) TargetAdd('libp3vrpn.dll', opts=['VRPN']) - OPTS=['DIR:panda/src/vrpn', 'VRPN'] + OPTS=['DIR:panda/src/vrpn', 'VRPN', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/vrpn', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3vrpn.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3vrpn.in', opts=['IMOD:panda3d.vrpn', 'ILIB:libp3vrpn', 'SRCDIR:panda/src/vrpn']) @@ -4289,43 +4290,43 @@ if (PkgSkip("OPENSSL")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOL TargetAdd('apply_patch_apply_patch.obj', opts=OPTS, input='apply_patch.cxx') TargetAdd('apply_patch.exe', input=['apply_patch_apply_patch.obj']) - TargetAdd('apply_patch.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('apply_patch.exe', input=COMMON_PANDA_LIBS) TargetAdd('apply_patch.exe', opts=OPTS) TargetAdd('build_patch_build_patch.obj', opts=OPTS, input='build_patch.cxx') TargetAdd('build_patch.exe', input=['build_patch_build_patch.obj']) - TargetAdd('build_patch.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('build_patch.exe', input=COMMON_PANDA_LIBS) TargetAdd('build_patch.exe', opts=OPTS) if not PkgSkip("ZLIB"): TargetAdd('check_adler_check_adler.obj', opts=OPTS, input='check_adler.cxx') TargetAdd('check_adler.exe', input=['check_adler_check_adler.obj']) - TargetAdd('check_adler.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('check_adler.exe', input=COMMON_PANDA_LIBS) TargetAdd('check_adler.exe', opts=OPTS) TargetAdd('check_crc_check_crc.obj', opts=OPTS, input='check_crc.cxx') TargetAdd('check_crc.exe', input=['check_crc_check_crc.obj']) - TargetAdd('check_crc.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('check_crc.exe', input=COMMON_PANDA_LIBS) TargetAdd('check_crc.exe', opts=OPTS) TargetAdd('check_md5_check_md5.obj', opts=OPTS, input='check_md5.cxx') TargetAdd('check_md5.exe', input=['check_md5_check_md5.obj']) - TargetAdd('check_md5.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('check_md5.exe', input=COMMON_PANDA_LIBS) TargetAdd('check_md5.exe', opts=OPTS) TargetAdd('pdecrypt_pdecrypt.obj', opts=OPTS, input='pdecrypt.cxx') TargetAdd('pdecrypt.exe', input=['pdecrypt_pdecrypt.obj']) - TargetAdd('pdecrypt.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('pdecrypt.exe', input=COMMON_PANDA_LIBS) TargetAdd('pdecrypt.exe', opts=OPTS) TargetAdd('pencrypt_pencrypt.obj', opts=OPTS, input='pencrypt.cxx') TargetAdd('pencrypt.exe', input=['pencrypt_pencrypt.obj']) - TargetAdd('pencrypt.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('pencrypt.exe', input=COMMON_PANDA_LIBS) TargetAdd('pencrypt.exe', opts=OPTS) TargetAdd('show_ddb_show_ddb.obj', opts=OPTS, input='show_ddb.cxx') TargetAdd('show_ddb.exe', input=['show_ddb_show_ddb.obj']) - TargetAdd('show_ddb.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('show_ddb.exe', input=COMMON_PANDA_LIBS) TargetAdd('show_ddb.exe', opts=OPTS) # @@ -4337,17 +4338,17 @@ if (PkgSkip("ZLIB")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS") TargetAdd('multify_multify.obj', opts=OPTS, input='multify.cxx') TargetAdd('multify.exe', input=['multify_multify.obj']) - TargetAdd('multify.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('multify.exe', input=COMMON_PANDA_LIBS) TargetAdd('multify.exe', opts=OPTS) TargetAdd('pzip_pzip.obj', opts=OPTS, input='pzip.cxx') TargetAdd('pzip.exe', input=['pzip_pzip.obj']) - TargetAdd('pzip.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('pzip.exe', input=COMMON_PANDA_LIBS) TargetAdd('pzip.exe', opts=OPTS) TargetAdd('punzip_punzip.obj', opts=OPTS, input='punzip.cxx') TargetAdd('punzip.exe', input=['punzip_punzip.obj']) - TargetAdd('punzip.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('punzip.exe', input=COMMON_PANDA_LIBS) TargetAdd('punzip.exe', opts=OPTS) # @@ -4393,7 +4394,7 @@ if (not RUNTIME): TargetAdd('p3egg_composite1.obj', opts=OPTS, input='p3egg_composite1.cxx') TargetAdd('p3egg_composite2.obj', opts=OPTS, input='p3egg_composite2.cxx') - OPTS=['DIR:panda/src/egg', 'ZLIB'] + OPTS=['DIR:panda/src/egg', 'ZLIB', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/egg', ["*.h", "*_composite*.cxx"]) if "parser.h" in IGATEFILES: IGATEFILES.remove("parser.h") TargetAdd('libp3egg.in', opts=OPTS, input=IGATEFILES) @@ -4410,7 +4411,7 @@ if (not RUNTIME): TargetAdd('p3egg2pg_composite1.obj', opts=OPTS, input='p3egg2pg_composite1.cxx') TargetAdd('p3egg2pg_composite2.obj', opts=OPTS, input='p3egg2pg_composite2.cxx') - OPTS=['DIR:panda/src/egg2pg'] + OPTS=['DIR:panda/src/egg2pg', 'PYTHON'] IGATEFILES=['load_egg_file.h'] TargetAdd('libp3egg2pg.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3egg2pg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg2pg', 'SRCDIR:panda/src/egg2pg']) @@ -4472,7 +4473,7 @@ if (not RUNTIME): TargetAdd('libpandaegg.dll', input=COMMON_PANDA_LIBS) TargetAdd('libpandaegg.dll', opts=['ADVAPI']) - OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg'] + OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg', 'PYTHON'] TargetAdd('egg_module.obj', input='libp3egg2pg.in') TargetAdd('egg_module.obj', input='libp3egg.in') TargetAdd('egg_module.obj', opts=OPTS) @@ -4609,12 +4610,12 @@ if (PkgSkip("EGL")==0 and PkgSkip("GLES2")==0 and PkgSkip("X11")==0 and not RUNT # DIRECTORY: panda/src/ode/ # if (PkgSkip("ODE")==0 and not RUNTIME): - OPTS=['DIR:panda/src/ode', 'BUILDING:PANDAODE', 'ODE'] + OPTS=['DIR:panda/src/ode', 'BUILDING:PANDAODE', 'ODE', 'PYTHON'] TargetAdd('p3ode_composite1.obj', opts=OPTS, input='p3ode_composite1.cxx') TargetAdd('p3ode_composite2.obj', opts=OPTS, input='p3ode_composite2.cxx') TargetAdd('p3ode_composite3.obj', opts=OPTS, input='p3ode_composite3.cxx') - OPTS=['DIR:panda/src/ode', 'ODE'] + OPTS=['DIR:panda/src/ode', 'ODE', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/ode', ["*.h", "*_composite*.cxx"]) IGATEFILES.remove("odeConvexGeom.h") IGATEFILES.remove("odeHeightFieldGeom.h") @@ -4638,7 +4639,7 @@ if (PkgSkip("ODE")==0 and not RUNTIME): TargetAdd('libpandaode.dll', input=COMMON_PANDA_LIBS) TargetAdd('libpandaode.dll', opts=['WINUSER', 'ODE']) - OPTS=['DIR:panda/metalibs/pandaode', 'ODE'] + OPTS=['DIR:panda/metalibs/pandaode', 'ODE', 'PYTHON'] TargetAdd('ode_module.obj', input='libpandaode.in') TargetAdd('ode_module.obj', opts=OPTS) TargetAdd('ode_module.obj', opts=['IMOD:panda3d.ode', 'ILIB:ode', 'IMPORT:panda3d.core']) @@ -4658,7 +4659,7 @@ if (PkgSkip("BULLET")==0 and not RUNTIME): OPTS=['DIR:panda/src/bullet', 'BUILDING:PANDABULLET', 'BULLET'] TargetAdd('p3bullet_composite.obj', opts=OPTS, input='p3bullet_composite.cxx') - OPTS=['DIR:panda/src/bullet', 'BULLET'] + OPTS=['DIR:panda/src/bullet', 'BULLET', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/bullet', ["*.h", "*_composite*.cxx"]) TargetAdd('libpandabullet.in', opts=OPTS, input=IGATEFILES) TargetAdd('libpandabullet.in', opts=['IMOD:panda3d.bullet', 'ILIB:libpandabullet', 'SRCDIR:panda/src/bullet']) @@ -4676,7 +4677,7 @@ if (PkgSkip("BULLET")==0 and not RUNTIME): TargetAdd('libpandabullet.dll', input=COMMON_PANDA_LIBS) TargetAdd('libpandabullet.dll', opts=['WINUSER', 'BULLET']) - OPTS=['DIR:panda/metalibs/pandabullet', 'BULLET'] + OPTS=['DIR:panda/metalibs/pandabullet', 'BULLET', 'PYTHON'] TargetAdd('bullet_module.obj', input='libpandabullet.in') TargetAdd('bullet_module.obj', opts=OPTS) TargetAdd('bullet_module.obj', opts=['IMOD:panda3d.bullet', 'ILIB:bullet', 'IMPORT:panda3d.core']) @@ -4696,7 +4697,7 @@ if (PkgSkip("PHYSX")==0): OPTS=['DIR:panda/src/physx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC'] TargetAdd('p3physx_composite.obj', opts=OPTS, input='p3physx_composite.cxx') - OPTS=['DIR:panda/src/physx', 'PHYSX', 'NOARCH:PPC'] + OPTS=['DIR:panda/src/physx', 'PHYSX', 'NOARCH:PPC', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/physx', ["*.h", "*_composite*.cxx"]) TargetAdd('libpandaphysx.in', opts=OPTS, input=IGATEFILES) TargetAdd('libpandaphysx.in', opts=['IMOD:panda3d.physx', 'ILIB:libpandaphysx', 'SRCDIR:panda/src/physx']) @@ -4715,7 +4716,7 @@ if (PkgSkip("PHYSX")==0): TargetAdd('libpandaphysx.dll', input=COMMON_PANDA_LIBS) TargetAdd('libpandaphysx.dll', opts=['WINUSER', 'PHYSX', 'NOARCH:PPC']) - OPTS=['DIR:panda/metalibs/pandaphysx', 'PHYSX', 'NOARCH:PPC'] + OPTS=['DIR:panda/metalibs/pandaphysx', 'PHYSX', 'NOARCH:PPC', 'PYTHON'] TargetAdd('physx_module.obj', input='libpandaphysx.in') TargetAdd('physx_module.obj', opts=OPTS) TargetAdd('physx_module.obj', opts=['IMOD:panda3d.physx', 'ILIB:physx', 'IMPORT:panda3d.core']) @@ -4736,7 +4737,7 @@ if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME): TargetAdd('p3physics_composite1.obj', opts=OPTS, input='p3physics_composite1.cxx') TargetAdd('p3physics_composite2.obj', opts=OPTS, input='p3physics_composite2.cxx') - OPTS=['DIR:panda/src/physics'] + OPTS=['DIR:panda/src/physics', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/physics', ["*.h", "*_composite*.cxx"]) IGATEFILES.remove("forces.h") TargetAdd('libp3physics.in', opts=OPTS, input=IGATEFILES) @@ -4752,7 +4753,7 @@ if (PkgSkip("PANDAPHYSICS")==0) and (PkgSkip("PANDAPARTICLESYSTEM")==0) and (not TargetAdd('p3particlesystem_composite1.obj', opts=OPTS, input='p3particlesystem_composite1.cxx') TargetAdd('p3particlesystem_composite2.obj', opts=OPTS, input='p3particlesystem_composite2.cxx') - OPTS=['DIR:panda/src/particlesystem'] + OPTS=['DIR:panda/src/particlesystem', 'PYTHON'] IGATEFILES=GetDirectoryContents('panda/src/particlesystem', ["*.h", "*_composite*.cxx"]) IGATEFILES.remove('orientedParticle.h') IGATEFILES.remove('orientedParticleFactory.h') @@ -4779,7 +4780,7 @@ if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME): TargetAdd('libpandaphysics.dll', input=COMMON_PANDA_LIBS) TargetAdd('libpandaphysics.dll', opts=['ADVAPI']) - OPTS=['DIR:panda/metalibs/pandaphysics'] + OPTS=['DIR:panda/metalibs/pandaphysics', 'PYTHON'] TargetAdd('physics_module.obj', input='libp3physics.in') if (PkgSkip("PANDAPARTICLESYSTEM")==0): TargetAdd('physics_module.obj', input='libp3particlesystem.in') @@ -4800,7 +4801,7 @@ if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME): # if (PkgSkip("SPEEDTREE")==0): - OPTS=['DIR:panda/src/speedtree', 'BUILDING:PANDASPEEDTREE', 'SPEEDTREE'] + OPTS=['DIR:panda/src/speedtree', 'BUILDING:PANDASPEEDTREE', 'SPEEDTREE', 'PYTHON'] TargetAdd('pandaspeedtree_composite1.obj', opts=OPTS, input='pandaspeedtree_composite1.cxx') IGATEFILES=GetDirectoryContents('panda/src/speedtree', ["*.h", "*_composite*.cxx"]) TargetAdd('libpandaspeedtree.in', opts=OPTS, input=IGATEFILES) @@ -4829,7 +4830,7 @@ if (not RTDIST and not RUNTIME and PkgSkip("PVIEW")==0 and GetTarget() != 'andro TargetAdd('pview.exe', input='pview_pview.obj') TargetAdd('pview.exe', input='libp3framework.dll') TargetAdd('pview.exe', input='libpandaegg.dll') - TargetAdd('pview.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('pview.exe', input=COMMON_PANDA_LIBS) TargetAdd('pview.exe', opts=['ADVAPI', 'WINSOCK2', 'WINSHELL']) # @@ -4856,7 +4857,7 @@ if (not RUNTIME and GetTarget() == 'android'): TargetAdd('pview.exe', input='libp3framework.dll') TargetAdd('pview.exe', input='libpandaegg.dll') TargetAdd('pview.exe', input='libp3android.dll') - TargetAdd('pview.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('pview.exe', input=COMMON_PANDA_LIBS) TargetAdd('AndroidManifest.xml', opts=OPTS, input='pview_manifest.xml') # @@ -4933,7 +4934,7 @@ if (PkgSkip("DIRECT")==0): # if (PkgSkip("DIRECT")==0): - OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA', 'BUILDING:DIRECT', 'BISONPREFIX_dcyy'] + OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA', 'BISONPREFIX_dcyy', 'PYTHON'] CreateFile(GetOutputDir()+"/include/dcParser.h") TargetAdd('p3dcparser_dcParser.obj', opts=OPTS, input='dcParser.yxx') TargetAdd('dcParser.h', input='p3dcparser_dcParser.obj', opts=['DEPENDENCYONLY']) @@ -4941,7 +4942,7 @@ if (PkgSkip("DIRECT")==0): TargetAdd('p3dcparser_composite1.obj', opts=OPTS, input='p3dcparser_composite1.cxx') TargetAdd('p3dcparser_composite2.obj', opts=OPTS, input='p3dcparser_composite2.cxx') - OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA'] + OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA', 'PYTHON'] IGATEFILES=GetDirectoryContents('direct/src/dcparser', ["*.h", "*_composite*.cxx"]) if "dcParser.h" in IGATEFILES: IGATEFILES.remove("dcParser.h") if "dcmsgtypes.h" in IGATEFILES: IGATEFILES.remove('dcmsgtypes.h') @@ -4957,7 +4958,7 @@ if (PkgSkip("DIRECT")==0): OPTS=['DIR:direct/src/deadrec', 'BUILDING:DIRECT'] TargetAdd('p3deadrec_composite1.obj', opts=OPTS, input='p3deadrec_composite1.cxx') - OPTS=['DIR:direct/src/deadrec'] + OPTS=['DIR:direct/src/deadrec', 'PYTHON'] IGATEFILES=GetDirectoryContents('direct/src/deadrec', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3deadrec.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3deadrec.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3deadrec', 'SRCDIR:direct/src/deadrec']) @@ -4968,12 +4969,12 @@ if (PkgSkip("DIRECT")==0): # if (PkgSkip("DIRECT")==0): - OPTS=['DIR:direct/src/distributed', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'BUILDING:DIRECT', 'OPENSSL'] + OPTS=['DIR:direct/src/distributed', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'BUILDING:DIRECT', 'OPENSSL', 'PYTHON'] TargetAdd('p3distributed_config_distributed.obj', opts=OPTS, input='config_distributed.cxx') TargetAdd('p3distributed_cConnectionRepository.obj', opts=OPTS, input='cConnectionRepository.cxx') TargetAdd('p3distributed_cDistributedSmoothNodeBase.obj', opts=OPTS, input='cDistributedSmoothNodeBase.cxx') - OPTS=['DIR:direct/src/distributed', 'WITHINPANDA', 'OPENSSL'] + OPTS=['DIR:direct/src/distributed', 'WITHINPANDA', 'OPENSSL', 'PYTHON'] IGATEFILES=GetDirectoryContents('direct/src/distributed', ["*.h", "*.cxx"]) TargetAdd('libp3distributed.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3distributed.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3distributed', 'SRCDIR:direct/src/distributed']) @@ -4987,7 +4988,7 @@ if (PkgSkip("DIRECT")==0): OPTS=['DIR:direct/src/interval', 'BUILDING:DIRECT'] TargetAdd('p3interval_composite1.obj', opts=OPTS, input='p3interval_composite1.cxx') - OPTS=['DIR:direct/src/interval'] + OPTS=['DIR:direct/src/interval', 'PYTHON'] IGATEFILES=GetDirectoryContents('direct/src/interval', ["*.h", "*_composite*.cxx"]) TargetAdd('libp3interval.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3interval.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3interval', 'SRCDIR:direct/src/interval']) @@ -5003,7 +5004,7 @@ if (PkgSkip("DIRECT")==0): if GetTarget() == 'darwin': TargetAdd('p3showbase_showBase_assist.obj', opts=OPTS, input='showBase_assist.mm') - OPTS=['DIR:direct/src/showbase'] + OPTS=['DIR:direct/src/showbase', 'PYTHON'] IGATEFILES=GetDirectoryContents('direct/src/showbase', ["*.h", "showBase.cxx"]) TargetAdd('libp3showbase.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3showbase.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3showbase', 'SRCDIR:direct/src/showbase']) @@ -5018,7 +5019,7 @@ if (PkgSkip("DIRECT")==0): TargetAdd('p3motiontrail_cMotionTrail.obj', opts=OPTS, input='cMotionTrail.cxx') TargetAdd('p3motiontrail_config_motiontrail.obj', opts=OPTS, input='config_motiontrail.cxx') - OPTS=['DIR:direct/src/motiontrail'] + OPTS=['DIR:direct/src/motiontrail', 'PYTHON'] IGATEFILES=GetDirectoryContents('direct/src/motiontrail', ["*.h", "cMotionTrail.cxx"]) TargetAdd('libp3motiontrail.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3motiontrail.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3motiontrail', 'SRCDIR:direct/src/motiontrail']) @@ -5034,24 +5035,17 @@ if (PkgSkip("DIRECT")==0): TargetAdd('libp3direct.dll', input='p3direct_direct.obj') TargetAdd('libp3direct.dll', input='p3directbase_directbase.obj') - TargetAdd('libp3direct.dll', input='p3dcparser_composite1.obj') - TargetAdd('libp3direct.dll', input='p3dcparser_composite2.obj') - TargetAdd('libp3direct.dll', input='p3dcparser_dcParser.obj') - TargetAdd('libp3direct.dll', input='p3dcparser_dcLexer.obj') TargetAdd('libp3direct.dll', input='p3showbase_showBase.obj') if GetTarget() == 'darwin': TargetAdd('libp3direct.dll', input='p3showbase_showBase_assist.obj') TargetAdd('libp3direct.dll', input='p3deadrec_composite1.obj') TargetAdd('libp3direct.dll', input='p3interval_composite1.obj') - TargetAdd('libp3direct.dll', input='p3distributed_config_distributed.obj') - TargetAdd('libp3direct.dll', input='p3distributed_cConnectionRepository.obj') - TargetAdd('libp3direct.dll', input='p3distributed_cDistributedSmoothNodeBase.obj') TargetAdd('libp3direct.dll', input='p3motiontrail_config_motiontrail.obj') TargetAdd('libp3direct.dll', input='p3motiontrail_cMotionTrail.obj') TargetAdd('libp3direct.dll', input=COMMON_PANDA_LIBS) TargetAdd('libp3direct.dll', opts=['ADVAPI', 'OPENSSL', 'WINUSER', 'WINGDI']) - OPTS=['DIR:direct/metalibs/direct'] + OPTS=['DIR:direct/metalibs/direct', 'PYTHON'] TargetAdd('direct_module.obj', input='libp3dcparser.in') TargetAdd('direct_module.obj', input='libp3showbase.in') TargetAdd('direct_module.obj', input='libp3deadrec.in') @@ -5068,6 +5062,17 @@ if (PkgSkip("DIRECT")==0): TargetAdd('direct.pyd', input='libp3distributed_igate.obj') TargetAdd('direct.pyd', input='libp3motiontrail_igate.obj') + # These are part of direct.pyd, not libp3direct.dll, because they rely on + # the Python libraries. If a C++ user needs these modules, we can move them + # back and filter out the Python-specific code. + TargetAdd('direct.pyd', input='p3dcparser_composite1.obj') + TargetAdd('direct.pyd', input='p3dcparser_composite2.obj') + TargetAdd('direct.pyd', input='p3dcparser_dcParser.obj') + TargetAdd('direct.pyd', input='p3dcparser_dcLexer.obj') + TargetAdd('direct.pyd', input='p3distributed_config_distributed.obj') + TargetAdd('direct.pyd', input='p3distributed_cConnectionRepository.obj') + TargetAdd('direct.pyd', input='p3distributed_cDistributedSmoothNodeBase.obj') + TargetAdd('direct.pyd', input='direct_module.obj') TargetAdd('direct.pyd', input='libp3direct.dll') TargetAdd('direct.pyd', input='libp3interrogatedb.dll') @@ -5079,12 +5084,16 @@ if (PkgSkip("DIRECT")==0): # if (PkgSkip("PYTHON")==0 and PkgSkip("DIRECT")==0 and not RTDIST and not RUNTIME): - OPTS=['DIR:direct/src/dcparse', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'ADVAPI'] + OPTS=['DIR:direct/src/dcparse', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'ADVAPI', 'PYTHON'] TargetAdd('dcparse_dcparse.obj', opts=OPTS, input='dcparse.cxx') + TargetAdd('p3dcparse.exe', input='p3dcparser_composite1.obj') + TargetAdd('p3dcparse.exe', input='p3dcparser_composite2.obj') + TargetAdd('p3dcparse.exe', input='p3dcparser_dcParser.obj') + TargetAdd('p3dcparse.exe', input='p3dcparser_dcLexer.obj') TargetAdd('p3dcparse.exe', input='dcparse_dcparse.obj') TargetAdd('p3dcparse.exe', input='libp3direct.dll') - TargetAdd('p3dcparse.exe', input=COMMON_PANDA_LIBS_PYSTUB) - TargetAdd('p3dcparse.exe', opts=['ADVAPI']) + TargetAdd('p3dcparse.exe', input=COMMON_PANDA_LIBS) + TargetAdd('p3dcparse.exe', opts=['ADVAPI', 'PYTHON']) # # DIRECTORY: direct/src/plugin/ @@ -5133,9 +5142,10 @@ if (RTDIST or RUNTIME): if (PkgSkip("PYTHON")==0 and RTDIST): # Freeze VFSImporter and its dependency modules into p3dpython. # Mark panda3d.core as a dependency to make sure to build that first. - TargetAdd('p3dpython_frozen.obj', input='VFSImporter.py', opts=['DIR:direct/src/showbase', 'FREEZE_STARTUP']) + TargetAdd('p3dpython_frozen.obj', input='VFSImporter.py', opts=['DIR:direct/src/showbase', 'FREEZE_STARTUP', 'PYTHON']) TargetAdd('p3dpython_frozen.obj', dep='core.pyd') + OPTS += ['PYTHON'] TargetAdd('p3dpython_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx') TargetAdd('p3dpython_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx') TargetAdd('p3dpython.exe', input='p3dpython_p3dpython_composite1.obj') @@ -5166,7 +5176,7 @@ if (RTDIST or RUNTIME): TargetAdd('p3dpythonw.exe', input='libp3interrogatedb.dll') TargetAdd('p3dpythonw.exe', opts=['SUBSYSTEM:WINDOWS', 'PYTHON', 'WINUSER']) - if (PkgSkip("OPENSSL")==0 and RTDIST): + if (PkgSkip("OPENSSL")==0 and RTDIST and False): OPTS=['DIR:direct/src/plugin', 'DIR:panda/src/express', 'OPENSSL'] if GetTarget() == 'darwin': OPTS += ['OPT:2'] @@ -5287,7 +5297,7 @@ if (RUNTIME): TargetAdd('panda3d.exe', input='libpandaexpress.dll') TargetAdd('panda3d.exe', input='libp3dtoolconfig.dll') TargetAdd('panda3d.exe', input='libp3dtool.dll') - TargetAdd('panda3d.exe', input='libp3pystub.lib') + #TargetAdd('panda3d.exe', input='libp3pystub.lib') TargetAdd('panda3d.exe', input='libp3tinyxml.ilb') TargetAdd('panda3d.exe', opts=['NOICON', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON']) @@ -5301,7 +5311,7 @@ if (RUNTIME): TargetAdd('Panda3D.app', input='libpandaexpress.dll') TargetAdd('Panda3D.app', input='libp3dtoolconfig.dll') TargetAdd('Panda3D.app', input='libp3dtool.dll') - TargetAdd('Panda3D.app', input='libp3pystub.lib') + #TargetAdd('Panda3D.app', input='libp3pystub.lib') TargetAdd('Panda3D.app', input='libp3tinyxml.ilb') TargetAdd('Panda3D.app', input='panda3d_mac.plist', ipath=OPTS) TargetAdd('Panda3D.app', input='models/plugin_images/panda3d.icns') @@ -5316,7 +5326,7 @@ if (RUNTIME): TargetAdd('panda3dw.exe', input='libpandaexpress.dll') TargetAdd('panda3dw.exe', input='libp3dtoolconfig.dll') TargetAdd('panda3dw.exe', input='libp3dtool.dll') - TargetAdd('panda3dw.exe', input='libp3pystub.lib') + #TargetAdd('panda3dw.exe', input='libp3pystub.lib') TargetAdd('panda3dw.exe', input='libp3tinyxml.ilb') TargetAdd('panda3dw.exe', opts=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON']) @@ -5327,7 +5337,7 @@ if (RTDIST): TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx') TargetAdd('plugin_standalone_p3dEmbedMain.obj', opts=OPTS, input='p3dEmbedMain.cxx') TargetAdd('plugin_standalone_p3dEmbed.obj', opts=OPTS, input='p3dEmbed.cxx') - TargetAdd('plugin_standalone_pystub.obj', opts=OPTS, input='pystub.cxx') + #TargetAdd('plugin_standalone_pystub.obj', opts=OPTS, input='pystub.cxx') TargetAdd('plugin_standalone_dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx') TargetAdd('plugin_standalone_dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx') TargetAdd('plugin_standalone_lookup3.obj', opts=OPTS, input='lookup3.c') @@ -5346,7 +5356,7 @@ if (RTDIST): TargetAdd('p3dembed.exe', input='plugin_standalone_panda3dBase.obj') TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbedMain.obj') TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbed.obj') - TargetAdd('p3dembed.exe', input='plugin_standalone_pystub.obj') + #TargetAdd('p3dembed.exe', input='plugin_standalone_pystub.obj') TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite1.obj') TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite2.obj') TargetAdd('p3dembed.exe', input='plugin_standalone_lookup3.obj') @@ -5377,7 +5387,7 @@ if (RTDIST): TargetAdd('p3dembedw.exe', input='plugin_standalone_panda3dBase.obj') TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbedWinMain.obj') TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbed.obj') - TargetAdd('p3dembedw.exe', input='plugin_standalone_pystub.obj') + #TargetAdd('p3dembedw.exe', input='plugin_standalone_pystub.obj') TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite1.obj') TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite2.obj') TargetAdd('p3dembedw.exe', input='plugin_standalone_lookup3.obj') @@ -5445,17 +5455,17 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('bam-info.exe', input='libp3progbase.lib') TargetAdd('bam-info.exe', input='libp3pandatoolbase.lib') TargetAdd('bam-info.exe', input='libpandaegg.dll') - TargetAdd('bam-info.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('bam-info.exe', input=COMMON_PANDA_LIBS) TargetAdd('bam-info.exe', opts=['ADVAPI', 'FFTW']) TargetAdd('bam2egg_bamToEgg.obj', opts=OPTS, input='bamToEgg.cxx') TargetAdd('bam2egg.exe', input='bam2egg_bamToEgg.obj') - TargetAdd('bam2egg.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('bam2egg.exe', input=COMMON_EGG2X_LIBS) TargetAdd('bam2egg.exe', opts=['ADVAPI', 'FFTW']) TargetAdd('egg2bam_eggToBam.obj', opts=OPTS, input='eggToBam.cxx') TargetAdd('egg2bam.exe', input='egg2bam_eggToBam.obj') - TargetAdd('egg2bam.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg2bam.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg2bam.exe', opts=['ADVAPI', 'FFTW']) # @@ -5494,7 +5504,7 @@ if (PkgSkip("PANDATOOL")==0 and PkgSkip("FCOLLADA")==0): TargetAdd('dae2egg_daeToEgg.obj', opts=OPTS, input='daeToEgg.cxx') TargetAdd('dae2egg.exe', input='dae2egg_daeToEgg.obj') TargetAdd('dae2egg.exe', input='libp3daeegg.lib') - TargetAdd('dae2egg.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('dae2egg.exe', input=COMMON_EGG2X_LIBS) TargetAdd('dae2egg.exe', opts=['WINUSER', 'FCOLLADA', 'CARBON']) # @@ -5528,14 +5538,14 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('dxf-points.exe', input='libp3progbase.lib') TargetAdd('dxf-points.exe', input='libp3dxf.lib') TargetAdd('dxf-points.exe', input='libp3pandatoolbase.lib') - TargetAdd('dxf-points.exe', input=COMMON_PANDA_LIBS_PYSTUB) + TargetAdd('dxf-points.exe', input=COMMON_PANDA_LIBS) TargetAdd('dxf-points.exe', opts=['ADVAPI', 'FFTW']) TargetAdd('dxf2egg_dxfToEgg.obj', opts=OPTS, input='dxfToEgg.cxx') TargetAdd('dxf2egg.exe', input='dxf2egg_dxfToEgg.obj') TargetAdd('dxf2egg.exe', input='libp3dxfegg.lib') TargetAdd('dxf2egg.exe', input='libp3dxf.lib') - TargetAdd('dxf2egg.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('dxf2egg.exe', input=COMMON_EGG2X_LIBS) TargetAdd('dxf2egg.exe', opts=['ADVAPI', 'FFTW']) TargetAdd('egg2dxf_eggToDXF.obj', opts=OPTS, input='eggToDXF.cxx') @@ -5543,7 +5553,7 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXF.obj') TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXFLayer.obj') TargetAdd('egg2dxf.exe', input='libp3dxf.lib') - TargetAdd('egg2dxf.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg2dxf.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg2dxf.exe', opts=['ADVAPI', 'FFTW']) # @@ -5568,12 +5578,12 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('obj2egg_objToEgg.obj', opts=OPTS, input='objToEgg.cxx') TargetAdd('obj2egg.exe', input='obj2egg_objToEgg.obj') TargetAdd('obj2egg.exe', input='libp3objegg.lib') - TargetAdd('obj2egg.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('obj2egg.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg2obj_eggToObj.obj', opts=OPTS, input='eggToObj.cxx') TargetAdd('egg2obj.exe', input='egg2obj_eggToObj.obj') TargetAdd('egg2obj.exe', input='libp3objegg.lib') - TargetAdd('egg2obj.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg2obj.exe', input=COMMON_EGG2X_LIBS) # # DIRECTORY: pandatool/src/palettizer/ @@ -5597,7 +5607,7 @@ if (PkgSkip("FREETYPE")==0) and (PkgSkip("PANDATOOL")==0): TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeDescription.obj') TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeIterator.obj') TargetAdd('egg-mkfont.exe', input='libp3palettizer.lib') - TargetAdd('egg-mkfont.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg-mkfont.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg-mkfont.exe', opts=['ADVAPI', 'FREETYPE']) # @@ -5624,7 +5634,7 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptcharUserData.obj') TargetAdd('egg-optchar.exe', input='egg-optchar_vertexMembership.obj') TargetAdd('egg-optchar.exe', input='libp3eggcharbase.lib') - TargetAdd('egg-optchar.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg-optchar.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg-optchar.exe', opts=['ADVAPI', 'FREETYPE']) # @@ -5636,7 +5646,7 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('egg-palettize_eggPalettize.obj', opts=OPTS, input='eggPalettize.cxx') TargetAdd('egg-palettize.exe', input='egg-palettize_eggPalettize.obj') TargetAdd('egg-palettize.exe', input='libp3palettizer.lib') - TargetAdd('egg-palettize.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg-palettize.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg-palettize.exe', opts=['ADVAPI']) # @@ -5650,7 +5660,7 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('egg-qtess.exe', input='libp3eggbase.lib') TargetAdd('egg-qtess.exe', input='libp3progbase.lib') TargetAdd('egg-qtess.exe', input='libp3converter.lib') - TargetAdd('egg-qtess.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg-qtess.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg-qtess.exe', opts=['ADVAPI']) # @@ -5661,49 +5671,49 @@ if (PkgSkip("PANDATOOL")==0): OPTS=['DIR:pandatool/src/eggprogs'] TargetAdd('egg-crop_eggCrop.obj', opts=OPTS, input='eggCrop.cxx') TargetAdd('egg-crop.exe', input='egg-crop_eggCrop.obj') - TargetAdd('egg-crop.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg-crop.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg-crop.exe', opts=['ADVAPI']) TargetAdd('egg-make-tube_eggMakeTube.obj', opts=OPTS, input='eggMakeTube.cxx') TargetAdd('egg-make-tube.exe', input='egg-make-tube_eggMakeTube.obj') - TargetAdd('egg-make-tube.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg-make-tube.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg-make-tube.exe', opts=['ADVAPI']) TargetAdd('egg-texture-cards_eggTextureCards.obj', opts=OPTS, input='eggTextureCards.cxx') TargetAdd('egg-texture-cards.exe', input='egg-texture-cards_eggTextureCards.obj') - TargetAdd('egg-texture-cards.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg-texture-cards.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg-texture-cards.exe', opts=['ADVAPI']) TargetAdd('egg-topstrip_eggTopstrip.obj', opts=OPTS, input='eggTopstrip.cxx') TargetAdd('egg-topstrip.exe', input='egg-topstrip_eggTopstrip.obj') TargetAdd('egg-topstrip.exe', input='libp3eggcharbase.lib') - TargetAdd('egg-topstrip.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg-topstrip.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg-topstrip.exe', opts=['ADVAPI']) TargetAdd('egg-trans_eggTrans.obj', opts=OPTS, input='eggTrans.cxx') TargetAdd('egg-trans.exe', input='egg-trans_eggTrans.obj') - TargetAdd('egg-trans.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg-trans.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg-trans.exe', opts=['ADVAPI']) TargetAdd('egg2c_eggToC.obj', opts=OPTS, input='eggToC.cxx') TargetAdd('egg2c.exe', input='egg2c_eggToC.obj') - TargetAdd('egg2c.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg2c.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg2c.exe', opts=['ADVAPI']) TargetAdd('egg-rename_eggRename.obj', opts=OPTS, input='eggRename.cxx') TargetAdd('egg-rename.exe', input='egg-rename_eggRename.obj') - TargetAdd('egg-rename.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg-rename.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg-rename.exe', opts=['ADVAPI']) TargetAdd('egg-retarget-anim_eggRetargetAnim.obj', opts=OPTS, input='eggRetargetAnim.cxx') TargetAdd('egg-retarget-anim.exe', input='egg-retarget-anim_eggRetargetAnim.obj') TargetAdd('egg-retarget-anim.exe', input='libp3eggcharbase.lib') - TargetAdd('egg-retarget-anim.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg-retarget-anim.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg-retarget-anim.exe', opts=['ADVAPI']) TargetAdd('egg-list-textures_eggListTextures.obj', opts=OPTS, input='eggListTextures.cxx') TargetAdd('egg-list-textures.exe', input='egg-list-textures_eggListTextures.obj') - TargetAdd('egg-list-textures.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg-list-textures.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg-list-textures.exe', opts=['ADVAPI']) # @@ -5734,33 +5744,33 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('egg2flt_eggToFlt.obj', opts=OPTS, input='eggToFlt.cxx') TargetAdd('egg2flt.exe', input='egg2flt_eggToFlt.obj') TargetAdd('egg2flt.exe', input='libp3flt.lib') - TargetAdd('egg2flt.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg2flt.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg2flt.exe', opts=['ADVAPI']) TargetAdd('flt-info_fltInfo.obj', opts=OPTS, input='fltInfo.cxx') TargetAdd('flt-info.exe', input='flt-info_fltInfo.obj') TargetAdd('flt-info.exe', input='libp3flt.lib') - TargetAdd('flt-info.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('flt-info.exe', input=COMMON_EGG2X_LIBS) TargetAdd('flt-info.exe', opts=['ADVAPI']) TargetAdd('flt-trans_fltTrans.obj', opts=OPTS, input='fltTrans.cxx') TargetAdd('flt-trans.exe', input='flt-trans_fltTrans.obj') TargetAdd('flt-trans.exe', input='libp3flt.lib') - TargetAdd('flt-trans.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('flt-trans.exe', input=COMMON_EGG2X_LIBS) TargetAdd('flt-trans.exe', opts=['ADVAPI']) TargetAdd('flt2egg_fltToEgg.obj', opts=OPTS, input='fltToEgg.cxx') TargetAdd('flt2egg.exe', input='flt2egg_fltToEgg.obj') TargetAdd('flt2egg.exe', input='libp3flt.lib') TargetAdd('flt2egg.exe', input='libp3fltegg.lib') - TargetAdd('flt2egg.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('flt2egg.exe', input=COMMON_EGG2X_LIBS) TargetAdd('flt2egg.exe', opts=['ADVAPI']) TargetAdd('fltcopy_fltCopy.obj', opts=OPTS, input='fltCopy.cxx') TargetAdd('fltcopy.exe', input='fltcopy_fltCopy.obj') TargetAdd('fltcopy.exe', input='libp3cvscopy.lib') TargetAdd('fltcopy.exe', input='libp3flt.lib') - TargetAdd('fltcopy.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('fltcopy.exe', input=COMMON_EGG2X_LIBS) TargetAdd('fltcopy.exe', opts=['ADVAPI']) @@ -5786,7 +5796,6 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('image-info.exe', input='libp3pandatoolbase.lib') TargetAdd('image-info.exe', input='libpandaegg.dll') TargetAdd('image-info.exe', input=COMMON_PANDA_LIBS) - TargetAdd('image-info.exe', input='libp3pystub.lib') TargetAdd('image-info.exe', opts=['ADVAPI']) TargetAdd('image-resize_imageResize.obj', opts=OPTS, input='imageResize.cxx') @@ -5796,7 +5805,6 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('image-resize.exe', input='libp3pandatoolbase.lib') TargetAdd('image-resize.exe', input='libpandaegg.dll') TargetAdd('image-resize.exe', input=COMMON_PANDA_LIBS) - TargetAdd('image-resize.exe', input='libp3pystub.lib') TargetAdd('image-resize.exe', opts=['ADVAPI']) TargetAdd('image-trans_imageTrans.obj', opts=OPTS, input='imageTrans.cxx') @@ -5806,7 +5814,6 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('image-trans.exe', input='libp3pandatoolbase.lib') TargetAdd('image-trans.exe', input='libpandaegg.dll') TargetAdd('image-trans.exe', input=COMMON_PANDA_LIBS) - TargetAdd('image-trans.exe', input='libp3pystub.lib') TargetAdd('image-trans.exe', opts=['ADVAPI']) # @@ -5820,7 +5827,6 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('pfm-trans.exe', input='libp3progbase.lib') TargetAdd('pfm-trans.exe', input='libp3pandatoolbase.lib') TargetAdd('pfm-trans.exe', input=COMMON_PANDA_LIBS) - TargetAdd('pfm-trans.exe', input='libp3pystub.lib') TargetAdd('pfm-trans.exe', opts=['ADVAPI']) TargetAdd('pfm-bba_pfmBba.obj', opts=OPTS, input='pfmBba.cxx') @@ -5830,7 +5836,6 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('pfm-bba.exe', input='libp3progbase.lib') TargetAdd('pfm-bba.exe', input='libp3pandatoolbase.lib') TargetAdd('pfm-bba.exe', input=COMMON_PANDA_LIBS) - TargetAdd('pfm-bba.exe', input='libp3pystub.lib') TargetAdd('pfm-bba.exe', opts=['ADVAPI']) # @@ -5864,14 +5869,13 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('lwo-scan.exe', input='libp3pandatoolbase.lib') TargetAdd('lwo-scan.exe', input='libpandaegg.dll') TargetAdd('lwo-scan.exe', input=COMMON_PANDA_LIBS) - TargetAdd('lwo-scan.exe', input='libp3pystub.lib') TargetAdd('lwo-scan.exe', opts=['ADVAPI']) TargetAdd('lwo2egg_lwoToEgg.obj', opts=OPTS, input='lwoToEgg.cxx') TargetAdd('lwo2egg.exe', input='lwo2egg_lwoToEgg.obj') TargetAdd('lwo2egg.exe', input='libp3lwo.lib') TargetAdd('lwo2egg.exe', input='libp3lwoegg.lib') - TargetAdd('lwo2egg.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('lwo2egg.exe', input=COMMON_EGG2X_LIBS) TargetAdd('lwo2egg.exe', opts=['ADVAPI']) # @@ -5912,7 +5916,7 @@ for VER in MAXVERSIONS: TargetAdd('maxegg'+VNUM+'.dlo', input='maxegg'+VNUM+'_composite1.obj') TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg'+VNUM+'.res') TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg.def', ipath=OPTS) - TargetAdd('maxegg'+VNUM+'.dlo', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('maxegg'+VNUM+'.dlo', input=COMMON_EGG2X_LIBS) TargetAdd('maxegg'+VNUM+'.dlo', opts=OPTS) # @@ -6062,7 +6066,6 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('softcvs.exe', input='libp3pandatoolbase.lib') TargetAdd('softcvs.exe', input='libpandaegg.dll') TargetAdd('softcvs.exe', input=COMMON_PANDA_LIBS) - TargetAdd('softcvs.exe', input='libp3pystub.lib') TargetAdd('softcvs.exe', opts=['ADVAPI']) # @@ -6080,7 +6083,6 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('text-stats.exe', input='libp3pandatoolbase.lib') TargetAdd('text-stats.exe', input='libpandaegg.dll') TargetAdd('text-stats.exe', input=COMMON_PANDA_LIBS) - TargetAdd('text-stats.exe', input='libp3pystub.lib') TargetAdd('text-stats.exe', opts=['ADVAPI']) # @@ -6095,14 +6097,13 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('vrml-trans.exe', input='libp3progbase.lib') TargetAdd('vrml-trans.exe', input='libp3pandatoolbase.lib') TargetAdd('vrml-trans.exe', input=COMMON_PANDA_LIBS) - TargetAdd('vrml-trans.exe', input='libp3pystub.lib') TargetAdd('vrml-trans.exe', opts=['ADVAPI']) TargetAdd('vrml2egg_vrmlToEgg.obj', opts=OPTS, input='vrmlToEgg.cxx') TargetAdd('vrml2egg.exe', input='vrml2egg_vrmlToEgg.obj') TargetAdd('vrml2egg.exe', input='libp3vrmlegg.lib') TargetAdd('vrml2egg.exe', input='libp3vrml.lib') - TargetAdd('vrml2egg.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('vrml2egg.exe', input=COMMON_EGG2X_LIBS) TargetAdd('vrml2egg.exe', opts=['ADVAPI']) # @@ -6122,7 +6123,6 @@ if (PkgSkip("PANDATOOL")==0 and (GetTarget() == 'windows' or PkgSkip("GTK2")==0) TargetAdd('pstats.exe', input='libp3progbase.lib') TargetAdd('pstats.exe', input='libp3pandatoolbase.lib') TargetAdd('pstats.exe', input=COMMON_PANDA_LIBS) - TargetAdd('pstats.exe', input='libp3pystub.lib') TargetAdd('pstats.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSOCK', 'WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'GTK2']) # @@ -6135,7 +6135,7 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('egg2x.exe', input='egg2x_eggToX.obj') TargetAdd('egg2x.exe', input='libp3xfileegg.lib') TargetAdd('egg2x.exe', input='libp3xfile.lib') - TargetAdd('egg2x.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg2x.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg2x.exe', opts=['ADVAPI']) TargetAdd('x-trans_xFileTrans.obj', opts=OPTS, input='xFileTrans.cxx') @@ -6144,14 +6144,13 @@ if (PkgSkip("PANDATOOL")==0): TargetAdd('x-trans.exe', input='libp3xfile.lib') TargetAdd('x-trans.exe', input='libp3pandatoolbase.lib') TargetAdd('x-trans.exe', input=COMMON_PANDA_LIBS) - TargetAdd('x-trans.exe', input='libp3pystub.lib') TargetAdd('x-trans.exe', opts=['ADVAPI']) TargetAdd('x2egg_xFileToEgg.obj', opts=OPTS, input='xFileToEgg.cxx') TargetAdd('x2egg.exe', input='x2egg_xFileToEgg.obj') TargetAdd('x2egg.exe', input='libp3xfileegg.lib') TargetAdd('x2egg.exe', input='libp3xfile.lib') - TargetAdd('x2egg.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('x2egg.exe', input=COMMON_EGG2X_LIBS) TargetAdd('x2egg.exe', opts=['ADVAPI']) # @@ -6176,8 +6175,8 @@ for VER in MAYAVERSIONS: TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaeggimport'+VNUM+'_mayaeggimport.obj') TargetAdd('mayaeggimport'+VNUM+'.mll', input='libpandaegg.dll') TargetAdd('mayaeggimport'+VNUM+'.mll', input=COMMON_PANDA_LIBS) - if GetTarget() == 'windows': - TargetAdd('mayaeggimport'+VNUM+'.mll', input='libp3pystub.lib') + #if GetTarget() == 'windows': + # TargetAdd('mayaeggimport'+VNUM+'.mll', input='libp3pystub.lib') TargetAdd('mayaeggimport'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS) TargetAdd('mayaloader'+VNUM+'_config_mayaloader.obj', opts=OPTS, input='config_mayaloader.cxx') @@ -6210,7 +6209,7 @@ for VER in MAYAVERSIONS: TargetAdd('libmayapview'+VNUM+'.mll', input='libmaya'+VNUM+'.lib') TargetAdd('libmayapview'+VNUM+'.mll', input='libp3framework.dll') if GetTarget() == 'windows': - TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS) else: TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS) TargetAdd('libmayapview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS) @@ -6220,7 +6219,7 @@ for VER in MAYAVERSIONS: TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib') TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib') if GetTarget() == 'windows': - TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS) else: TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS) TargetAdd('maya2egg'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS) @@ -6230,7 +6229,7 @@ for VER in MAYAVERSIONS: TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib') TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib') if GetTarget() == 'windows': - TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS) else: TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS) TargetAdd('egg2maya'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS) @@ -6240,7 +6239,7 @@ for VER in MAYAVERSIONS: TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libp3cvscopy.lib') TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib') if GetTarget() == 'windows': - TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS) else: TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS) TargetAdd('mayacopy'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS) @@ -6253,17 +6252,17 @@ for VER in MAYAVERSIONS: TargetAdd('maya2egg'+VNUM+'.exe', input='mayapath'+VNUM+'.obj') TargetAdd('maya2egg'+VNUM+'.exe', input='libpandaexpress.dll') - TargetAdd('maya2egg'+VNUM+'.exe', input=COMMON_DTOOL_LIBS_PYSTUB) + TargetAdd('maya2egg'+VNUM+'.exe', input=COMMON_DTOOL_LIBS) TargetAdd('maya2egg'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS) TargetAdd('egg2maya'+VNUM+'.exe', input='mayapath'+VNUM+'.obj') TargetAdd('egg2maya'+VNUM+'.exe', input='libpandaexpress.dll') - TargetAdd('egg2maya'+VNUM+'.exe', input=COMMON_DTOOL_LIBS_PYSTUB) + TargetAdd('egg2maya'+VNUM+'.exe', input=COMMON_DTOOL_LIBS) TargetAdd('egg2maya'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS) TargetAdd('mayacopy'+VNUM+'.exe', input='mayapath'+VNUM+'.obj') TargetAdd('mayacopy'+VNUM+'.exe', input='libpandaexpress.dll') - TargetAdd('mayacopy'+VNUM+'.exe', input=COMMON_DTOOL_LIBS_PYSTUB) + TargetAdd('mayacopy'+VNUM+'.exe', input=COMMON_DTOOL_LIBS) TargetAdd('mayacopy'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS) # @@ -6275,7 +6274,7 @@ if (PkgSkip("CONTRIB")==0 and not RUNTIME): TargetAdd('libpandaai.dll', input='p3ai_composite1.obj') TargetAdd('libpandaai.dll', input=COMMON_PANDA_LIBS) - OPTS=['DIR:contrib/src/ai'] + OPTS=['DIR:contrib/src/ai', 'PYTHON'] IGATEFILES=GetDirectoryContents('contrib/src/ai', ["*.h", "*_composite*.cxx"]) TargetAdd('libpandaai.in', opts=OPTS, input=IGATEFILES) TargetAdd('libpandaai.in', opts=['IMOD:panda3d.ai', 'ILIB:libpandaai', 'SRCDIR:contrib/src/ai']) diff --git a/panda/src/android/pview.cxx b/panda/src/android/pview.cxx index 60ee5eada6..9a29b94574 100644 --- a/panda/src/android/pview.cxx +++ b/panda/src/android/pview.cxx @@ -13,7 +13,6 @@ #include "pandaFramework.h" #include "pandaSystem.h" -#include "pystub.h" #include "texturePool.h" #include "multitexReducer.h" #include "sceneGraphReducer.h" @@ -29,9 +28,6 @@ #include "checkPandaVersion.h" int main(int argc, char **argv) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - PandaFramework framework; framework.open_framework(argc, argv); framework.set_window_title("Panda Viewer"); diff --git a/panda/src/chan/animChannelFixed.cxx b/panda/src/chan/animChannelFixed.cxx new file mode 100644 index 0000000000..375e107f62 --- /dev/null +++ b/panda/src/chan/animChannelFixed.cxx @@ -0,0 +1,17 @@ +/** + * 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." + * + * @file animChannelFixed.cxx + * @author rdb + * @date 2016-05-29 + */ + +#include "animChannelFixed.h" + +template class AnimChannelFixed; +template class AnimChannelFixed; diff --git a/panda/src/chan/animChannelFixed.h b/panda/src/chan/animChannelFixed.h index 8835cc6db2..9940f5bdcf 100644 --- a/panda/src/chan/animChannelFixed.h +++ b/panda/src/chan/animChannelFixed.h @@ -62,6 +62,8 @@ private: static TypeHandle _type_handle; }; +EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_CHAN, EXPTP_PANDA_CHAN, AnimChannelFixed); +EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_CHAN, EXPTP_PANDA_CHAN, AnimChannelFixed); #include "animChannelFixed.I" diff --git a/panda/src/chan/p3chan_composite1.cxx b/panda/src/chan/p3chan_composite1.cxx index 411d6c0a9f..99bac712c7 100644 --- a/panda/src/chan/p3chan_composite1.cxx +++ b/panda/src/chan/p3chan_composite1.cxx @@ -3,6 +3,7 @@ #include "animBundleNode.cxx" #include "animChannel.cxx" #include "animChannelBase.cxx" +#include "animChannelFixed.cxx" #include "animChannelMatrixDynamic.cxx" #include "animChannelMatrixFixed.cxx" #include "animChannelMatrixXfmTable.cxx" diff --git a/panda/src/downloadertools/apply_patch.cxx b/panda/src/downloadertools/apply_patch.cxx index 105064f3c9..908f3c8189 100644 --- a/panda/src/downloadertools/apply_patch.cxx +++ b/panda/src/downloadertools/apply_patch.cxx @@ -10,7 +10,6 @@ */ #include "pandabase.h" -#include "pystub.h" #include "panda_getopt.h" #include "preprocess_argv.h" #include "patchfile.h" @@ -18,9 +17,6 @@ int main(int argc, char **argv) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - preprocess_argv(argc, argv); if (argc < 3) { diff --git a/panda/src/downloadertools/build_patch.cxx b/panda/src/downloadertools/build_patch.cxx index a107c45ad6..d14e27db9f 100644 --- a/panda/src/downloadertools/build_patch.cxx +++ b/panda/src/downloadertools/build_patch.cxx @@ -10,7 +10,6 @@ */ #include "pandabase.h" -#include "pystub.h" #include "panda_getopt.h" #include "preprocess_argv.h" #include "patchfile.h" @@ -51,9 +50,6 @@ help() { int main(int argc, char **argv) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - Filename patch_file; bool complete_file = false; int footprint_length = 0; diff --git a/panda/src/downloadertools/check_adler.cxx b/panda/src/downloadertools/check_adler.cxx index 8c98b4c3d6..b53eb2839f 100644 --- a/panda/src/downloadertools/check_adler.cxx +++ b/panda/src/downloadertools/check_adler.cxx @@ -10,13 +10,9 @@ */ #include "download_utils.h" -#include "pystub.h" int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - if (argc < 2) { cerr << "Usage: check_adler " << endl; return 1; diff --git a/panda/src/downloadertools/check_crc.cxx b/panda/src/downloadertools/check_crc.cxx index 49313f818b..9afadd4fb2 100644 --- a/panda/src/downloadertools/check_crc.cxx +++ b/panda/src/downloadertools/check_crc.cxx @@ -10,13 +10,9 @@ */ #include "download_utils.h" -#include "pystub.h" int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - if (argc < 2) { cerr << "Usage: check_crc " << endl; return 1; diff --git a/panda/src/downloadertools/check_md5.cxx b/panda/src/downloadertools/check_md5.cxx index c706d4fb2a..5b386c7c1e 100644 --- a/panda/src/downloadertools/check_md5.cxx +++ b/panda/src/downloadertools/check_md5.cxx @@ -10,7 +10,6 @@ */ #include "pandabase.h" -#include "pystub.h" #include "hashVal.h" #include "filename.h" #include "panda_getopt.h" @@ -65,9 +64,6 @@ output_hash(const string &filename, const HashVal &hash) { int main(int argc, char **argv) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - extern char *optarg; extern int optind; const char *optstr = "i:db:qh"; diff --git a/panda/src/downloadertools/multify.cxx b/panda/src/downloadertools/multify.cxx index 72506f4095..8f3df9ce14 100644 --- a/panda/src/downloadertools/multify.cxx +++ b/panda/src/downloadertools/multify.cxx @@ -10,7 +10,6 @@ */ #include "pandabase.h" -#include "pystub.h" #include "panda_getopt.h" #include "preprocess_argv.h" #include "multifile.h" @@ -758,9 +757,6 @@ tokenize_extensions(const string &str, pset &extensions) { int main(int argc, char **argv) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - preprocess_argv(argc, argv); if (argc < 2) { usage(); diff --git a/panda/src/downloadertools/pdecrypt.cxx b/panda/src/downloadertools/pdecrypt.cxx index 55791f14c3..73a242fda1 100644 --- a/panda/src/downloadertools/pdecrypt.cxx +++ b/panda/src/downloadertools/pdecrypt.cxx @@ -11,7 +11,6 @@ * @date 2004-09-01 */ -#include "pystub.h" #include "filename.h" #include "encrypt_string.h" #include "pnotify.h" @@ -46,9 +45,6 @@ usage() { int main(int argc, char **argv) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - extern char *optarg; extern int optind; const char *optstr = "o:p:h"; diff --git a/panda/src/downloadertools/pencrypt.cxx b/panda/src/downloadertools/pencrypt.cxx index d37cd64a48..5f8774c4d9 100644 --- a/panda/src/downloadertools/pencrypt.cxx +++ b/panda/src/downloadertools/pencrypt.cxx @@ -11,7 +11,6 @@ * @date 2004-09-01 */ -#include "pystub.h" #include "filename.h" #include "encrypt_string.h" #include "pnotify.h" diff --git a/panda/src/downloadertools/punzip.cxx b/panda/src/downloadertools/punzip.cxx index 82d3693522..5753f7b6ec 100644 --- a/panda/src/downloadertools/punzip.cxx +++ b/panda/src/downloadertools/punzip.cxx @@ -9,7 +9,6 @@ * @file punzip.cxx */ -#include "pystub.h" #include "filename.h" #include "compress_string.h" #include "pnotify.h" @@ -31,9 +30,6 @@ usage() { int main(int argc, char **argv) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - extern char *optarg; extern int optind; const char *optstr = "o:ch"; diff --git a/panda/src/downloadertools/pzip.cxx b/panda/src/downloadertools/pzip.cxx index 25eb02ac7c..6364be0130 100644 --- a/panda/src/downloadertools/pzip.cxx +++ b/panda/src/downloadertools/pzip.cxx @@ -9,7 +9,6 @@ * @file pzip.cxx */ -#include "pystub.h" #include "filename.h" #include "compress_string.h" #include "pnotify.h" @@ -55,9 +54,6 @@ usage() { int main(int argc, char **argv) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - extern char *optarg; extern int optind; const char *optstr = "o:c123456789h"; diff --git a/panda/src/downloadertools/show_ddb.cxx b/panda/src/downloadertools/show_ddb.cxx index 6d82df7f02..d19c3be9cd 100644 --- a/panda/src/downloadertools/show_ddb.cxx +++ b/panda/src/downloadertools/show_ddb.cxx @@ -12,15 +12,11 @@ */ #include "pandabase.h" -#include "pystub.h" #include "downloadDb.h" #include "filename.h" int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - if (argc != 3) { cerr << "Usage: show_ddb server.ddb client.ddb\n"; return 1; diff --git a/panda/src/event/asyncTask.cxx b/panda/src/event/asyncTask.cxx index 2a83740b52..fb251aebd6 100644 --- a/panda/src/event/asyncTask.cxx +++ b/panda/src/event/asyncTask.cxx @@ -18,10 +18,6 @@ #include "throw_event.h" #include "eventParameter.h" -#ifdef HAVE_PYTHON -#include "py_panda.h" -#endif - AtomicAdjust::Integer AsyncTask::_next_task_id; PStatCollector AsyncTask::_show_code_pcollector("App:Show code"); TypeHandle AsyncTask::_type_handle; @@ -48,9 +44,6 @@ AsyncTask(const string &name) : _total_dt(0.0), _num_frames(0) { -#ifdef HAVE_PYTHON - _python_object = NULL; -#endif // HAVE_PYTHON set_name(name); // Carefully copy _next_task_id and increment it so that we get a unique ID. @@ -68,9 +61,6 @@ AsyncTask(const string &name) : AsyncTask:: ~AsyncTask() { nassertv(_state == S_inactive && _manager == NULL && _chain == NULL); -#ifdef HAVE_PYTHON - set_python_object(NULL); -#endif } /** @@ -355,35 +345,6 @@ set_priority(int priority) { } } -#ifdef HAVE_PYTHON -/** - * Specifies an arbitrary Python object that will be piggybacked on the task - * object. - */ -void AsyncTask:: -set_python_object(PyObject *python_object) { - Py_XINCREF(python_object); - Py_XDECREF(_python_object); - _python_object = python_object; -} -#endif // HAVE_PYTHON - -#ifdef HAVE_PYTHON -/** - * Returns the Python object that was specified to set_python_object(), if - * any, or None if no object was specified. - */ -PyObject *AsyncTask:: -get_python_object() const { - if (_python_object != (PyObject *)NULL) { - Py_XINCREF(_python_object); - return _python_object; - } - Py_INCREF(Py_None); - return Py_None; -} -#endif // HAVE_PYTHON - /** * */ diff --git a/panda/src/event/asyncTask.h b/panda/src/event/asyncTask.h index 48633a9d91..97176df0a3 100644 --- a/panda/src/event/asyncTask.h +++ b/panda/src/event/asyncTask.h @@ -92,11 +92,6 @@ PUBLISHED: INLINE void set_done_event(const string &done_event); INLINE const string &get_done_event() const; -#ifdef HAVE_PYTHON - void set_python_object(PyObject *python_object); - PyObject *get_python_object() const; -#endif // HAVE_PYTHON - INLINE double get_dt() const; INLINE double get_max_dt() const; INLINE double get_average_dt() const; @@ -140,11 +135,6 @@ protected: static PStatCollector _show_code_pcollector; PStatCollector _task_pcollector; -private: -#ifdef HAVE_PYTHON - PyObject *_python_object; -#endif // HAVE_PYTHON - public: static TypeHandle get_class_type() { return _type_handle; diff --git a/panda/src/event/pythonTask.I b/panda/src/event/pythonTask.I index 7b2e5d5082..b2f9a0ef07 100644 --- a/panda/src/event/pythonTask.I +++ b/panda/src/event/pythonTask.I @@ -10,37 +10,3 @@ * @author drose * @date 2008-09-16 */ - -/** - * If None is passed, calls clear_delay, otherwise sets the delay time. See - * AsyncTask::set_delay() and AsyncTask::clear_delay(). - */ -INLINE void PythonTask:: -set_delay(PyObject *delay) { - if (delay == Py_None) { - AsyncTask::clear_delay(); - return; - } - - PyObject *value = PyNumber_Float(delay); - if (value == NULL) { - return; - } - - AsyncTask::set_delay(PyFloat_AS_DOUBLE(value)); - Py_DECREF(value); -} - -/** - * Returns the delay time if set, None otherwise. See AsyncTask::has_delay() - * and AsyncTask::get_delay(). - */ -INLINE PyObject *PythonTask:: -get_delay() const { - if (AsyncTask::has_delay()) { - return PyFloat_FromDouble(AsyncTask::get_delay()); - } else { - Py_INCREF(Py_None); - return Py_None; - } -} diff --git a/panda/src/event/pythonTask.cxx b/panda/src/event/pythonTask.cxx index fb508307df..3ca6178803 100644 --- a/panda/src/event/pythonTask.cxx +++ b/panda/src/event/pythonTask.cxx @@ -18,12 +18,9 @@ #ifdef HAVE_PYTHON #include "py_panda.h" -TypeHandle PythonTask::_type_handle; +#include "pythonThread.h" -Configure(config_pythonTask); -ConfigureFn(config_pythonTask) { - PythonTask::init_type(); -} +TypeHandle PythonTask::_type_handle; #ifndef CPPPARSER extern struct Dtool_PyTypedObject Dtool_TypedReferenceCount; @@ -404,8 +401,7 @@ do_python_task() { if (_generator == (PyObject *)NULL) { // We are calling the function directly. PyObject *args = get_args(); - result = - Thread::get_current_thread()->call_python_func(_function, args); + result = PythonThread::call_python_func(_function, args); Py_DECREF(args); #ifdef PyGen_Check diff --git a/panda/src/event/pythonTask.h b/panda/src/event/pythonTask.h index 558fb7c5a8..d97be5795e 100644 --- a/panda/src/event/pythonTask.h +++ b/panda/src/event/pythonTask.h @@ -50,9 +50,6 @@ PUBLISHED: int __traverse__(visitproc visit, void *arg); int __clear__(); - INLINE void set_delay(PyObject *delay); - INLINE PyObject *get_delay() const; - PUBLISHED: // The name of this task. MAKE_PROPERTY(name, get_name, set_name); @@ -72,10 +69,10 @@ PUBLISHED: MAKE_PROPERTY(wakeTime, get_wake_time); // The delay value that has been set on this task, if any, or None. - MAKE_PROPERTY(delay_time, get_delay, set_delay); + MAKE_PROPERTY2(delay_time, has_delay, get_delay, set_delay, clear_delay); // Alias of delay_time. - MAKE_PROPERTY(delayTime, get_delay, set_delay); + MAKE_PROPERTY2(delayTime, has_delay, get_delay, set_delay, clear_delay); // The number of frames that have elapsed since the task was started, // according to the task manager's clock. diff --git a/panda/src/express/pointerToArray.h b/panda/src/express/pointerToArray.h index 5632a8246f..2485f28759 100644 --- a/panda/src/express/pointerToArray.h +++ b/panda/src/express/pointerToArray.h @@ -102,11 +102,9 @@ PUBLISHED: INLINE int get_node_ref_count() const; #ifdef HAVE_PYTHON -#if PY_VERSION_HEX >= 0x02060000 EXTENSION(int __getbuffer__(PyObject *self, Py_buffer *view, int flags)); EXTENSION(void __releasebuffer__(PyObject *self, Py_buffer *view) const); #endif -#endif #else // CPPPARSER // This is the actual, complete interface. @@ -257,11 +255,9 @@ PUBLISHED: INLINE int get_node_ref_count() const; #ifdef HAVE_PYTHON -#if PY_VERSION_HEX >= 0x02060000 EXTENSION(int __getbuffer__(PyObject *self, Py_buffer *view, int flags) const); EXTENSION(void __releasebuffer__(PyObject *self, Py_buffer *view) const); #endif -#endif #else // CPPPARSER // This is the actual, complete interface. diff --git a/panda/src/express/pointerToArray_ext.I b/panda/src/express/pointerToArray_ext.I index 82ba097d24..7502334e6e 100644 --- a/panda/src/express/pointerToArray_ext.I +++ b/panda/src/express/pointerToArray_ext.I @@ -175,7 +175,6 @@ __getitem__(size_t n) const { return (*this->_this)[n]; } -#if PY_VERSION_HEX >= 0x02060000 /** * This is used to implement the buffer protocol, in order to allow efficient * access to the array data through a Python multiview object. @@ -183,7 +182,7 @@ __getitem__(size_t n) const { template INLINE int Extension >:: __getbuffer__(PyObject *self, Py_buffer *view, int flags) { - +#if PY_VERSION_HEX >= 0x02060000 const char *format = get_format_code(Element); if (format == NULL) { // Not supported. @@ -222,6 +221,9 @@ __getbuffer__(PyObject *self, Py_buffer *view, int flags) { view->internal = (void*) this->_this; return 0; +#else + return -1; +#endif } /** @@ -230,13 +232,14 @@ __getbuffer__(PyObject *self, Py_buffer *view, int flags) { template INLINE void Extension >:: __releasebuffer__(PyObject *self, Py_buffer *view) const { +#if PY_VERSION_HEX >= 0x02060000 // Note: PyBuffer_Release automatically decrements view->obj. - if (view->internal != NULL) { // Oh, right, let's not forget to unref this. unref_delete((const PointerToArray *)view->internal); view->internal = NULL; } +#endif } /** @@ -246,7 +249,7 @@ __releasebuffer__(PyObject *self, Py_buffer *view) const { template INLINE int Extension >:: __getbuffer__(PyObject *self, Py_buffer *view, int flags) const { - +#if PY_VERSION_HEX >= 0x02060000 if ((flags & PyBUF_WRITABLE) == PyBUF_WRITABLE) { PyErr_SetString(PyExc_BufferError, "Object is not writable."); @@ -291,6 +294,9 @@ __getbuffer__(PyObject *self, Py_buffer *view, int flags) const { view->internal = (void*) this->_this; return 0; +#else + return -1; +#endif } /** @@ -299,12 +305,12 @@ __getbuffer__(PyObject *self, Py_buffer *view, int flags) const { template INLINE void Extension >:: __releasebuffer__(PyObject *self, Py_buffer *view) const { +#if PY_VERSION_HEX >= 0x02060000 // Note: PyBuffer_Release automatically decrements obj->view. - if (view->internal != NULL) { // Oh, right, let's not forget to unref this. unref_delete((const PointerToArray *)view->internal); view->internal = NULL; } +#endif } -#endif // PY_VERSION_HEX diff --git a/panda/src/express/pointerToArray_ext.h b/panda/src/express/pointerToArray_ext.h index d5c3fd5824..73ec780675 100644 --- a/panda/src/express/pointerToArray_ext.h +++ b/panda/src/express/pointerToArray_ext.h @@ -35,10 +35,8 @@ public: INLINE const Element &__getitem__(size_t n) const; INLINE void __setitem__(size_t n, const Element &value); -#if PY_VERSION_HEX >= 0x02060000 INLINE int __getbuffer__(PyObject *self, Py_buffer *view, int flags); INLINE void __releasebuffer__(PyObject *self, Py_buffer *view) const; -#endif }; /** @@ -55,10 +53,8 @@ public: INLINE const Element &__getitem__(size_t n) const; -#if PY_VERSION_HEX >= 0x02060000 INLINE int __getbuffer__(PyObject *self, Py_buffer *view, int flags) const; INLINE void __releasebuffer__(PyObject *self, Py_buffer *view) const; -#endif }; #ifdef _MSC_VER diff --git a/panda/src/gobj/geomVertexArrayData.h b/panda/src/gobj/geomVertexArrayData.h index 8058409cea..e52876d376 100644 --- a/panda/src/gobj/geomVertexArrayData.h +++ b/panda/src/gobj/geomVertexArrayData.h @@ -113,7 +113,7 @@ PUBLISHED: static void lru_epoch(); INLINE static VertexDataBook &get_book(); -#if PY_VERSION_HEX >= 0x02060000 +#ifdef HAVE_PYTHON EXTENSION(int __getbuffer__(PyObject *self, Py_buffer *view, int flags)); EXTENSION(int __getbuffer__(PyObject *self, Py_buffer *view, int flags) const); EXTENSION(void __releasebuffer__(PyObject *self, Py_buffer *view) const); diff --git a/panda/src/gobj/geomVertexArrayData_ext.cxx b/panda/src/gobj/geomVertexArrayData_ext.cxx index 1ddf599dfd..72b206c469 100644 --- a/panda/src/gobj/geomVertexArrayData_ext.cxx +++ b/panda/src/gobj/geomVertexArrayData_ext.cxx @@ -22,14 +22,13 @@ struct InternalBufferData { string _format; }; -#if PY_VERSION_HEX >= 0x02060000 /** * This is used to implement the buffer protocol, in order to allow efficient * access to the array data through a Python multiview object. */ int Extension:: __getbuffer__(PyObject *self, Py_buffer *view, int flags) { - +#if PY_VERSION_HEX >= 0x02060000 PT(GeomVertexArrayDataHandle) handle = _this->modify_handle(); CPT(GeomVertexArrayFormat) format = handle->get_array_format(); @@ -79,6 +78,9 @@ __getbuffer__(PyObject *self, Py_buffer *view, int flags) { view->suboffsets = NULL; return 0; +#else + return -1; +#endif } /** @@ -86,7 +88,7 @@ __getbuffer__(PyObject *self, Py_buffer *view, int flags) { */ int Extension:: __getbuffer__(PyObject *self, Py_buffer *view, int flags) const { - +#if PY_VERSION_HEX >= 0x02060000 if ((flags & PyBUF_WRITABLE) == PyBUF_WRITABLE) { PyErr_SetString(PyExc_BufferError, "Object is not writable."); @@ -142,6 +144,9 @@ __getbuffer__(PyObject *self, Py_buffer *view, int flags) const { view->suboffsets = NULL; return 0; +#else + return -1; +#endif } /** @@ -149,8 +154,8 @@ __getbuffer__(PyObject *self, Py_buffer *view, int flags) const { */ void Extension:: __releasebuffer__(PyObject *self, Py_buffer *view) const { +#if PY_VERSION_HEX >= 0x02060000 // Note: PyBuffer_Release automatically decrements view->obj. - InternalBufferData *data; data = (InternalBufferData *) view->internal; if (data == NULL) { @@ -158,10 +163,9 @@ __releasebuffer__(PyObject *self, Py_buffer *view) const { } delete data; view->internal = NULL; +#endif } -#endif // PY_VERSION_HEX >= 0x02060000 - /** * Copies all data from the given buffer object. The array is rescaled as * necessary. diff --git a/panda/src/gobj/geomVertexArrayData_ext.h b/panda/src/gobj/geomVertexArrayData_ext.h index d892ef5a2d..51649d5976 100644 --- a/panda/src/gobj/geomVertexArrayData_ext.h +++ b/panda/src/gobj/geomVertexArrayData_ext.h @@ -29,11 +29,9 @@ template<> class Extension : public ExtensionBase { public: -#if PY_VERSION_HEX >= 0x02060000 int __getbuffer__(PyObject *self, Py_buffer *view, int flags); int __getbuffer__(PyObject *self, Py_buffer *view, int flags) const; void __releasebuffer__(PyObject *self, Py_buffer *view) const; -#endif }; /** diff --git a/panda/src/nativenet/buffered_datagramconnection.cxx b/panda/src/nativenet/buffered_datagramconnection.cxx index 22bfab5215..b9abc6a406 100644 --- a/panda/src/nativenet/buffered_datagramconnection.cxx +++ b/panda/src/nativenet/buffered_datagramconnection.cxx @@ -13,10 +13,6 @@ #include "buffered_datagramconnection.h" -#ifdef HAVE_PYTHON -#include "py_panda.h" -#endif - TypeHandle Buffered_DatagramConnection::_type_handle; /** @@ -34,22 +30,6 @@ SendMessage(const Datagram &msg) { // Raise an exception to give us more information at the python level nativenet_cat.warning() << "Buffered_DatagramConnection::SendMessage->Error On Write--Out Buffer = " << _Writer.AmountBuffered() << "\n"; -#ifdef HAVE_PYTHON - ostringstream s; - -#if PY_VERSION_HEX >= 0x03030000 - PyObject *exc_type = PyExc_ConnectionError; -#else - PyObject *exc_type = PyExc_OSError; -#endif - - s << endl << "Error sending message: " << endl; - msg.dump_hex(s); - s << "Message data: " << msg.get_data() << endl; - - string message = s.str(); - PyErr_SetString(exc_type, message.c_str()); -#endif ClearAll(); } diff --git a/panda/src/pgraph/modelFlattenRequest.h b/panda/src/pgraph/modelFlattenRequest.h index 0cea9d87d2..5716635f82 100644 --- a/panda/src/pgraph/modelFlattenRequest.h +++ b/panda/src/pgraph/modelFlattenRequest.h @@ -38,6 +38,10 @@ PUBLISHED: INLINE bool is_ready() const; INLINE PandaNode *get_model() const; + MAKE_PROPERTY(orig, get_orig); + MAKE_PROPERTY(ready, is_ready); + MAKE_PROPERTY(model, get_model); + protected: virtual DoneStatus do_task(); diff --git a/panda/src/pgraph/modelLoadRequest.h b/panda/src/pgraph/modelLoadRequest.h index 06d4307236..00f55e8052 100644 --- a/panda/src/pgraph/modelLoadRequest.h +++ b/panda/src/pgraph/modelLoadRequest.h @@ -45,6 +45,12 @@ PUBLISHED: INLINE bool is_ready() const; INLINE PandaNode *get_model() const; + MAKE_PROPERTY(filename, get_filename); + MAKE_PROPERTY(options, get_options); + MAKE_PROPERTY(loader, get_loader); + MAKE_PROPERTY(ready, is_ready); + MAKE_PROPERTY(model, get_model); + protected: virtual DoneStatus do_task(); diff --git a/panda/src/pgraph/modelSaveRequest.h b/panda/src/pgraph/modelSaveRequest.h index 2180813f76..878e28edee 100644 --- a/panda/src/pgraph/modelSaveRequest.h +++ b/panda/src/pgraph/modelSaveRequest.h @@ -46,6 +46,13 @@ PUBLISHED: INLINE bool is_ready() const; INLINE bool get_success() const; + MAKE_PROPERTY(filename, get_filename); + MAKE_PROPERTY(options, get_options); + MAKE_PROPERTY(node, get_node); + MAKE_PROPERTY(loader, get_loader); + MAKE_PROPERTY(ready, is_ready); + MAKE_PROPERTY(success, get_success); + protected: virtual DoneStatus do_task(); diff --git a/panda/src/pgraph/nodePath.h b/panda/src/pgraph/nodePath.h index 78c2520faa..a30fc1d40d 100644 --- a/panda/src/pgraph/nodePath.h +++ b/panda/src/pgraph/nodePath.h @@ -905,15 +905,19 @@ PUBLISHED: NodePath find_net_tag(const string &key) const; EXTENSION(INLINE PyObject *get_tag_keys() const); - EXTENSION(INLINE void set_python_tag(const string &key, PyObject *value)); - EXTENSION(INLINE PyObject *get_python_tag(const string &key) const); - EXTENSION(INLINE void get_python_tag_keys(vector_string &keys) const); + + EXTENSION(PyObject *get_python_tags()); + EXTENSION(INLINE void set_python_tag(PyObject *keys, PyObject *value)); + EXTENSION(INLINE PyObject *get_python_tag(PyObject *keys) const); EXTENSION(INLINE PyObject *get_python_tag_keys() const); - EXTENSION(INLINE bool has_python_tag(const string &key) const); - EXTENSION(INLINE void clear_python_tag(const string &key)); - EXTENSION(INLINE PyObject *get_net_python_tag(const string &key) const); - EXTENSION(INLINE bool has_net_python_tag(const string &key) const); - EXTENSION(NodePath find_net_python_tag(const string &key) const); + EXTENSION(INLINE bool has_python_tag(PyObject *keys) const); + EXTENSION(INLINE void clear_python_tag(PyObject *keys)); + EXTENSION(INLINE PyObject *get_net_python_tag(PyObject *keys) const); + EXTENSION(INLINE bool has_net_python_tag(PyObject *keys) const); + EXTENSION(NodePath find_net_python_tag(PyObject *keys) const); + MAKE_PROPERTY(python_tags, get_python_tags); + + EXTENSION(int __traverse__(visitproc visit, void *arg)); INLINE void list_tags() const; diff --git a/panda/src/pgraph/nodePath_ext.I b/panda/src/pgraph/nodePath_ext.I index 0931d2d794..5bc6c78c5a 100644 --- a/panda/src/pgraph/nodePath_ext.I +++ b/panda/src/pgraph/nodePath_ext.I @@ -14,15 +14,19 @@ #include "pandaNode_ext.h" /** - * Fills the given vector up with the list of Python tags on this PandaNode. - * - * It is the user's responsibility to ensure that the keys vector is empty - * before making this call; otherwise, the new files will be appended to it. + * Returns a dictionary of Python tags that is associated with the current + * node. This is similar to the regular tags, except this can store any + * Python object instead of just a string. However, the Python object is not + * recorded to a bam file. */ -INLINE void Extension:: -get_python_tag_keys(vector_string &keys) const { - nassertv_always(!_this->is_empty()); - invoke_extension(_this->node()).get_python_tag_keys(keys); +INLINE PyObject *Extension:: +get_python_tags() { + // An empty NodePath returns None + if (_this->is_empty()) { + Py_INCREF(Py_None); + return Py_None; + } + return invoke_extension(_this->node()).get_python_tags(); } /** @@ -63,7 +67,7 @@ get_python_tag_keys() const { * of any one key's object. */ INLINE void Extension:: -set_python_tag(const string &key, PyObject *value) { +set_python_tag(PyObject *key, PyObject *value) { nassertv_always(!_this->is_empty()); invoke_extension(_this->node()).set_python_tag(key, value); } @@ -74,7 +78,7 @@ set_python_tag(const string &key, PyObject *value) { * None. See also get_net_python_tag(). */ INLINE PyObject *Extension:: -get_python_tag(const string &key) const { +get_python_tag(PyObject *key) const { // An empty NodePath quietly returns no tags. This makes // get_net_python_tag() easier to implement. if (_this->is_empty()) { @@ -90,7 +94,7 @@ get_python_tag(const string &key) const { * value has been set. See also has_net_python_tag(). */ INLINE bool Extension:: -has_python_tag(const string &key) const { +has_python_tag(PyObject *key) const { // An empty NodePath quietly has no tags. This makes has_net_python_tag() // easier to implement. if (_this->is_empty()) { @@ -105,7 +109,7 @@ has_python_tag(const string &key) const { * the indicated key. */ INLINE void Extension:: -clear_python_tag(const string &key) { +clear_python_tag(PyObject *key) { nassertv_always(!_this->is_empty()); invoke_extension(_this->node()).clear_python_tag(key); } @@ -117,7 +121,7 @@ clear_python_tag(const string &key) { * get_python_tag(). */ INLINE PyObject *Extension:: -get_net_python_tag(const string &key) const { +get_net_python_tag(PyObject *key) const { NodePath tag_np = find_net_python_tag(key); return invoke_extension(&tag_np).get_python_tag(key); } @@ -127,6 +131,17 @@ get_net_python_tag(const string &key) const { * or on any ancestor node, or false otherwise. See also has_python_tag(). */ INLINE bool Extension:: -has_net_python_tag(const string &key) const { +has_net_python_tag(PyObject *key) const { return !find_net_python_tag(key).is_empty(); } + +/** + * Called by Python to implement cycle detection. + */ +INLINE int Extension:: +__traverse__(visitproc visit, void *arg) { + if (_this->is_empty()) { + return 0; + } + return invoke_extension(_this->node()).__traverse__(visit, arg); +} diff --git a/panda/src/pgraph/nodePath_ext.cxx b/panda/src/pgraph/nodePath_ext.cxx index 656802b8f0..081a69a814 100644 --- a/panda/src/pgraph/nodePath_ext.cxx +++ b/panda/src/pgraph/nodePath_ext.cxx @@ -172,7 +172,7 @@ __reduce_persist__(PyObject *self, PyObject *pickler) const { * node contains this tag definition. See set_python_tag(). */ NodePath Extension:: -find_net_python_tag(const string &key) const { +find_net_python_tag(PyObject *key) const { if (_this->is_empty()) { return NodePath::not_found(); } diff --git a/panda/src/pgraph/nodePath_ext.h b/panda/src/pgraph/nodePath_ext.h index 93573ed6ad..3b0b8db42a 100644 --- a/panda/src/pgraph/nodePath_ext.h +++ b/panda/src/pgraph/nodePath_ext.h @@ -35,15 +35,19 @@ public: PyObject *__reduce_persist__(PyObject *self, PyObject *pickler) const; INLINE PyObject *get_tag_keys() const; - INLINE void set_python_tag(const string &key, PyObject *value); - INLINE PyObject *get_python_tag(const string &key) const; - INLINE void get_python_tag_keys(vector_string &keys) const; + + INLINE PyObject *get_python_tags(); + INLINE void set_python_tag(PyObject *key, PyObject *value); + INLINE PyObject *get_python_tag(PyObject *key) const; INLINE PyObject *get_python_tag_keys() const; - INLINE bool has_python_tag(const string &key) const; - INLINE void clear_python_tag(const string &key); - INLINE PyObject *get_net_python_tag(const string &key) const; - INLINE bool has_net_python_tag(const string &key) const; - NodePath find_net_python_tag(const string &key) const; + INLINE bool has_python_tag(PyObject *key) const; + INLINE void clear_python_tag(PyObject *key); + INLINE PyObject *get_net_python_tag(PyObject *key) const; + INLINE bool has_net_python_tag(PyObject *key) const; + NodePath find_net_python_tag(PyObject *key) const; + + // This is defined to implement cycle detection in Python tags. + INLINE int __traverse__(visitproc visit, void *arg); PyObject *get_tight_bounds(const NodePath &other = NodePath()) const; }; diff --git a/panda/src/pgraph/pandaNode.I b/panda/src/pgraph/pandaNode.I index fa60e11b41..747f322a36 100644 --- a/panda/src/pgraph/pandaNode.I +++ b/panda/src/pgraph/pandaNode.I @@ -380,7 +380,10 @@ has_tags() const { return true; } #ifdef HAVE_PYTHON - if (!cdata->_python_tag_data.empty()) { + // This is a bit awkward, since it doesn't catch cases where the Python tags + // are cleared. Maybe we should make this behavior deprecated, so that + // has_tags will not consider the Python tags. + if (!_python_tag_data.is_null()) { return true; } #endif // HAVE_PYTHON diff --git a/panda/src/pgraph/pandaNode.cxx b/panda/src/pgraph/pandaNode.cxx index 69e2dcabf7..f74f7fc24d 100644 --- a/panda/src/pgraph/pandaNode.cxx +++ b/panda/src/pgraph/pandaNode.cxx @@ -27,7 +27,6 @@ #include "config_mathutil.h" #include "lightReMutexHolder.h" #include "graphicsStateGuardianBase.h" -#include "py_panda.h" // This category is just temporary for debugging convenience. NotifyCategoryDecl(drawmask, EXPCL_PANDA_PGRAPH, EXPTP_PANDA_PGRAPH); @@ -131,7 +130,8 @@ PandaNode(const PandaNode ©) : TypedWritableReferenceCount(copy), Namable(copy), _paths_lock("PandaNode::_paths_lock"), - _dirty_prev_transform(false) + _dirty_prev_transform(false), + _python_tag_data(copy._python_tag_data) { if (pgraph_cat.is_debug()) { pgraph_cat.debug() @@ -172,12 +172,6 @@ PandaNode(const PandaNode ©) : ++cdata->_internal_bounds_mark; cdata->_final_bounds = copy_cdata->_final_bounds; cdata->_fancy_bits = copy_cdata->_fancy_bits; - -#ifdef HAVE_PYTHON - // Copy and increment all of the Python objects held by the other node. - cdata->_python_tag_data = copy_cdata->_python_tag_data; - cdata->inc_py_refs(); -#endif // HAVE_PYTHON } } @@ -1270,32 +1264,13 @@ copy_tags(PandaNode *other) { cdataw->_tag_data[(*ti).first] = (*ti).second; } cdataw->set_fancy_bit(FB_tag, !cdataw->_tag_data.empty()); - -#ifdef HAVE_PYTHON - PythonTagData::const_iterator pti; - for (pti = cdatar->_python_tag_data.begin(); - pti != cdatar->_python_tag_data.end(); - ++pti) { - const string &key = (*pti).first; - PyObject *value = (*pti).second; - Py_XINCREF(value); - - pair result; - result = cdataw->_python_tag_data.insert(PythonTagData::value_type(key, value)); - - if (!result.second) { - // The insert was unsuccessful; that means the key was already present - // in the map. In this case, we should decrement the original value's - // reference count and replace it with the new object. - PythonTagData::iterator wpti = result.first; - PyObject *old_value = (*wpti).second; - Py_XDECREF(old_value); - (*wpti).second = value; - } - } -#endif // HAVE_PYTHON } CLOSE_ITERATE_CURRENT_AND_UPSTREAM(_cycler); + + // It's okay to copy the tags by pointer, because get_python_tags does a + // copy-on-write. + _python_tag_data = other->_python_tag_data; + mark_bam_modified(); } @@ -1321,20 +1296,9 @@ list_tags(ostream &out, const string &separator) const { } } -#ifdef HAVE_PYTHON - if (!cdata->_python_tag_data.empty()) { - if (!cdata->_tag_data.empty()) { - out << separator; - } - PythonTagData::const_iterator ti = cdata->_python_tag_data.begin(); - out << (*ti).first; - ++ti; - while (ti != cdata->_python_tag_data.end()) { - out << separator << (*ti).first; - ++ti; - } - } -#endif // HAVE_PYTHON + // We used to list the Python tags here. That's a bit awkward, though, + // since that means calling up into Python code to print the keys. If + // someone finds it useful, we can implement it in an extension method. } /** @@ -1393,50 +1357,11 @@ compare_tags(const PandaNode *other) const { return -1; } -#ifdef HAVE_PYTHON - PythonTagData::const_iterator api = cdata->_python_tag_data.begin(); - PythonTagData::const_iterator bpi = cdata_other->_python_tag_data.begin(); - while (api != cdata->_python_tag_data.end() && - bpi != cdata_other->_python_tag_data.end()) { - int cmp = strcmp((*api).first.c_str(), (*bpi).first.c_str()); - if (cmp != 0) { - return cmp; - } - -#if PY_MAJOR_VERSION >= 3 - if (PyObject_RichCompareBool((*api).second, (*bpi).second, Py_LT) == 1) { - return -1; - } else if (PyObject_RichCompareBool((*api).second, (*bpi).second, Py_GT) == 1) { - return 1; - } else if (PyObject_RichCompareBool((*api).second, (*bpi).second, Py_EQ) == 1) { - cmp = 0; - } else { -#else - if (PyObject_Cmp((*api).second, (*bpi).second, &cmp) == -1) { -#endif - // Unable to compare objects; just compare pointers. - if ((*api).second != (*bpi).second) { - cmp = (*api).second < (*bpi).second ? -1 : 1; - } else { - cmp = 0; - } - } - if (cmp != 0) { - return cmp; - } - - ++api; - ++bpi; + // We compare these by pointer, since it's problematic to call up into + // Python from arbitrary C++ code. + if (_python_tag_data != other->_python_tag_data) { + return (_python_tag_data < other->_python_tag_data) ? -1 : 1; } - if (api != cdata->_python_tag_data.end()) { - // list A is longer. - return 1; - } - if (bpi != cdata_other->_python_tag_data.end()) { - // list B is longer. - return -1; - } -#endif // HAVE_PYTHON return 0; } @@ -1494,30 +1419,6 @@ copy_all_properties(PandaNode *other) { cdataw->_tag_data[(*ti).first] = (*ti).second; } -#ifdef HAVE_PYTHON - PythonTagData::const_iterator pti; - for (pti = cdatar->_python_tag_data.begin(); - pti != cdatar->_python_tag_data.end(); - ++pti) { - const string &key = (*pti).first; - PyObject *value = (*pti).second; - Py_XINCREF(value); - - pair result; - result = cdataw->_python_tag_data.insert(PythonTagData::value_type(key, value)); - - if (!result.second) { - // The insert was unsuccessful; that means the key was already present - // in the map. In this case, we should decrement the original value's - // reference count and replace it with the new object. - PythonTagData::iterator wpti = result.first; - PyObject *old_value = (*wpti).second; - Py_XDECREF(old_value); - (*wpti).second = value; - } - } -#endif // HAVE_PYTHON - static const int change_bits = (FB_transform | FB_state | FB_effects | FB_tag | FB_draw_mask); cdataw->_fancy_bits = @@ -1532,6 +1433,10 @@ copy_all_properties(PandaNode *other) { } CLOSE_ITERATE_CURRENT_AND_UPSTREAM(_cycler); + // It's okay to copy the tags by pointer, because get_python_tags does a + // copy-on-write. + _python_tag_data = other->_python_tag_data; + if (any_transform_changed || any_state_changed || any_draw_mask_changed) { mark_bounds_stale(current_thread); @@ -3810,7 +3715,6 @@ CData(const PandaNode::CData ©) : _effects(copy._effects), _tag_data(copy._tag_data), - // _python_tag_data appears below. _draw_control_mask(copy._draw_control_mask), _draw_show_mask(copy._draw_show_mask), _into_collide_mask(copy._into_collide_mask), @@ -3836,12 +3740,6 @@ CData(const PandaNode::CData ©) : // Note that this copy constructor is not used by the PandaNode copy // constructor! Any elements that must be copied between nodes should also // be explicitly copied there. - -#ifdef HAVE_PYTHON - // Copy and increment all of the Python objects held by the other node. - _python_tag_data = copy._python_tag_data; - inc_py_refs(); -#endif // HAVE_PYTHON } /** @@ -3849,10 +3747,6 @@ CData(const PandaNode::CData ©) : */ PandaNode::CData:: ~CData() { -#ifdef HAVE_PYTHON - // Free all of the Python objects held by this node. - dec_py_refs(); -#endif // HAVE_PYTHON } /** @@ -4029,62 +3923,6 @@ fillin(DatagramIterator &scan, BamReader *manager) { fillin_down_list(*modify_stashed(), "stashed", scan, manager); } -#ifdef HAVE_PYTHON -/** - * Increments the reference counts on all held Python objects. - */ -void PandaNode::CData:: -inc_py_refs() { - if (!_python_tag_data.empty()) { -#if defined(HAVE_THREADS) && !defined(SIMPLE_THREADS) - // This might happen at any time, so be sure the Python state is ready for - // it. - PyGILState_STATE gstate; - gstate = PyGILState_Ensure(); -#endif - PythonTagData::const_iterator ti; - for (ti = _python_tag_data.begin(); - ti != _python_tag_data.end(); - ++ti) { - PyObject *value = (*ti).second; - Py_XINCREF(value); - } -#if defined(HAVE_THREADS) && !defined(SIMPLE_THREADS) - PyGILState_Release(gstate); -#endif - } -} -#endif // HAVE_PYTHON - -#ifdef HAVE_PYTHON -/** - * Decrements the reference counts on all held Python objects. - */ -void PandaNode::CData:: -dec_py_refs() { - if (!_python_tag_data.empty()) { -#if defined(HAVE_THREADS) && !defined(SIMPLE_THREADS) - // This might happen at any time, so be sure the Python state is ready for - // it. - PyGILState_STATE gstate; - gstate = PyGILState_Ensure(); -#endif - - PythonTagData::const_iterator ti; - for (ti = _python_tag_data.begin(); - ti != _python_tag_data.end(); - ++ti) { - PyObject *value = (*ti).second; - Py_XDECREF(value); - } - -#if defined(HAVE_THREADS) && !defined(SIMPLE_THREADS) - PyGILState_Release(gstate); -#endif - } -} -#endif // HAVE_PYTHON - /** * Writes the indicated list of parent node pointers to the datagram. */ diff --git a/panda/src/pgraph/pandaNode.h b/panda/src/pgraph/pandaNode.h index 05bbcaadba..0bbc984117 100644 --- a/panda/src/pgraph/pandaNode.h +++ b/panda/src/pgraph/pandaNode.h @@ -200,12 +200,15 @@ PUBLISHED: EXTENSION(PyObject *get_tag_keys() const); - EXTENSION(void set_python_tag(const string &key, PyObject *value)); - EXTENSION(PyObject *get_python_tag(const string &key) const); - EXTENSION(bool has_python_tag(const string &key) const); - EXTENSION(void clear_python_tag(const string &key)); - EXTENSION(void get_python_tag_keys(vector_string &keys) const); + EXTENSION(PyObject *get_python_tags()); + EXTENSION(void set_python_tag(PyObject *key, PyObject *value)); + EXTENSION(PyObject *get_python_tag(PyObject *key) const); + EXTENSION(bool has_python_tag(PyObject *key) const); + EXTENSION(void clear_python_tag(PyObject *key)); EXTENSION(PyObject *get_python_tag_keys() const); + MAKE_PROPERTY(python_tags, get_python_tags); + + EXTENSION(int __traverse__(visitproc visit, void *arg)); INLINE bool has_tags() const; void copy_tags(PandaNode *other); @@ -507,9 +510,16 @@ private: // This is used to maintain a table of keyed data on each node, for the // user's purposes. typedef phash_map TagData; -#ifdef HAVE_PYTHON - typedef phash_map PythonTagData; -#endif // HAVE_PYTHON + + // This is actually implemented in pandaNode_ext.h, but defined here so + // that we can destruct it from the C++ side. Note that it isn't cycled, + // because I imagine it's rare to see a Python thread on a stage other than + // stage 0, and let's not make things unnecessarily complicated. + class PythonTagData : public ReferenceCount { + public: + virtual ~PythonTagData() {}; + }; + PT(PythonTagData) _python_tag_data; #ifndef NDEBUG unsigned int _unexpected_change_flags; @@ -555,9 +565,6 @@ private: CPT(RenderEffects) _effects; TagData _tag_data; -#ifdef HAVE_PYTHON - PythonTagData _python_tag_data; -#endif // HAVE_PYTHON // These two together determine the per-camera visibility of this node. // See adjust_draw_mask() for details. diff --git a/panda/src/pgraph/pandaNode_ext.cxx b/panda/src/pgraph/pandaNode_ext.cxx index 9395a56e3b..aa24e623ee 100644 --- a/panda/src/pgraph/pandaNode_ext.cxx +++ b/panda/src/pgraph/pandaNode_ext.cxx @@ -71,116 +71,7 @@ __deepcopy__(PyObject *self, PyObject *memo) const { } /** - * Associates an arbitrary Python object with a user-defined key which is - * stored on the node. This is similar to set_tag(), except it can store any - * Python object instead of just a string. However, the Python object is not - * recorded to a bam file. - * - * Each unique key stores a different string value. There is no effective - * limit on the number of different keys that may be stored or on the length - * of any one key's value. - */ -void Extension:: -set_python_tag(const string &key, PyObject *value) { - Thread *current_thread = Thread::get_current_thread(); - int pipeline_stage = current_thread->get_pipeline_stage(); - nassertv(pipeline_stage == 0); - - PandaNode::CDWriter cdata(_this->_cycler); - Py_XINCREF(value); - - pair result; - result = cdata->_python_tag_data.insert(PandaNode::PythonTagData::value_type(key, value)); - - if (!result.second) { - // The insert was unsuccessful; that means the key was already present in - // the map. In this case, we should decrement the original value's - // reference count and replace it with the new object. - PandaNode::PythonTagData::iterator ti = result.first; - PyObject *old_value = (*ti).second; - Py_XDECREF(old_value); - (*ti).second = value; - } - - // Even though the python tag isn't recorded in the bam stream? - _this->mark_bam_modified(); -} - -/** - * Retrieves the Python object that was previously set on this node for the - * particular key, if any. If no value has been previously set, returns None. - */ -PyObject *Extension:: -get_python_tag(const string &key) const { - PandaNode::CDReader cdata(_this->_cycler); - PandaNode::PythonTagData::const_iterator ti; - ti = cdata->_python_tag_data.find(key); - if (ti != cdata->_python_tag_data.end()) { - PyObject *result = (*ti).second; - Py_XINCREF(result); - return result; - } - Py_INCREF(Py_None); - return Py_None; -} - -/** - * Returns true if a Python object has been defined on this node for the - * particular key (even if that object is None), or false if no object has - * been set. - */ -bool Extension:: -has_python_tag(const string &key) const { - PandaNode::CDReader cdata(_this->_cycler); - PandaNode::PythonTagData::const_iterator ti; - ti = cdata->_python_tag_data.find(key); - return (ti != cdata->_python_tag_data.end()); -} - -/** - * Removes the Python object defined for this key on this particular node. - * After a call to clear_python_tag(), has_python_tag() will return false for - * the indicated key. - */ -void Extension:: -clear_python_tag(const string &key) { - Thread *current_thread = Thread::get_current_thread(); - int pipeline_stage = current_thread->get_pipeline_stage(); - nassertv(pipeline_stage == 0); - - PandaNode::CDWriter cdata(_this->_cycler, current_thread); - PandaNode::PythonTagData::iterator ti; - ti = cdata->_python_tag_data.find(key); - if (ti != cdata->_python_tag_data.end()) { - PyObject *value = (*ti).second; - Py_XDECREF(value); - cdata->_python_tag_data.erase(ti); - } - - // Even though the python tag isn't recorded in the bam stream? - _this->mark_bam_modified(); -} - -/** - * Fills the given vector up with the list of Python tags on this PandaNode. - * - * It is the user's responsibility to ensure that the keys vector is empty - * before making this call; otherwise, the new files will be appended to it. - */ -void Extension:: -get_python_tag_keys(vector_string &keys) const { - PandaNode::CDReader cdata(_this->_cycler); - if (!cdata->_python_tag_data.empty()) { - PandaNode::PythonTagData::const_iterator ti = cdata->_python_tag_data.begin(); - while (ti != cdata->_python_tag_data.end()) { - keys.push_back((*ti).first); - ++ti; - } - } -} - -/** - * This variant on get_tag_keys returns a Python list of strings. + * This variant on get_tag_keys returns a Python tuple of strings keys. */ PyObject *Extension:: get_tag_keys() const { @@ -195,20 +86,138 @@ get_tag_keys() const { return result; } +/** + * Returns a dictionary of Python tags that is associated with the current + * node. This is similar to the regular tags, except this can store any + * Python object instead of just a string. However, the Python object is not + * recorded to a bam file. + */ +PyObject *Extension:: +get_python_tags() { + if (_this->_python_tag_data == NULL) { + _this->_python_tag_data = new PythonTagDataImpl; + + } else if (_this->_python_tag_data->get_ref_count() > 1) { + // Copy-on-write. + _this->_python_tag_data = new PythonTagDataImpl(*(PythonTagDataImpl *)_this->_python_tag_data.p()); + } + return ((PythonTagDataImpl *)_this->_python_tag_data.p())->_dict; +} + +/** + * Associates an arbitrary Python object with a user-defined key which is + * stored on the node. This is similar to set_tag(), except it can store any + * Python object instead of just a string. However, the Python object is not + * recorded to a bam file. + * + * Each unique key stores a different string value. There is no effective + * limit on the number of different keys that may be stored or on the length + * of any one key's value. + */ +int Extension:: +set_python_tag(PyObject *key, PyObject *value) { + return PyDict_SetItem(get_python_tags(), key, value); +} + +/** + * Retrieves the Python object that was previously set on this node for the + * particular key, if any. If no value has been previously set, returns None. + */ +PyObject *Extension:: +get_python_tag(PyObject *key) const { + if (_this->_python_tag_data == NULL) { + Py_INCREF(Py_None); + return Py_None; + } + + PyObject *dict = ((PythonTagDataImpl *)_this->_python_tag_data.p())->_dict; + PyObject *value = PyDict_GetItem(dict, key); + if (value == NULL) { + value = Py_None; + } + // PyDict_GetItem returns a borrowed reference. + Py_INCREF(value); + return value; +} + +/** + * Returns true if a Python object has been defined on this node for the + * particular key (even if that object is None), or false if no object has + * been set. + */ +bool Extension:: +has_python_tag(PyObject *key) const { + if (_this->_python_tag_data == NULL) { + return false; + } + + PyObject *dict = ((PythonTagDataImpl *)_this->_python_tag_data.p())->_dict; + return (PyDict_GetItem(dict, key) != NULL); +} + +/** + * Removes the Python object defined for this key on this particular node. + * After a call to clear_python_tag(), has_python_tag() will return false for + * the indicated key. + */ +void Extension:: +clear_python_tag(PyObject *key) { + if (_this->_python_tag_data == NULL) { + return; + } + + PyObject *dict = get_python_tags(); + if (PyDict_GetItem(dict, key) != NULL) { + PyDict_DelItem(dict, key); + } +} + /** * This variant on get_python_tag_keys returns a Python list of strings. */ PyObject *Extension:: get_python_tag_keys() const { - vector_string keys; - get_python_tag_keys(keys); - - PyObject *result = PyTuple_New(keys.size()); - for (size_t i = 0; i < keys.size(); ++i) { - PyTuple_SET_ITEM(result, i, Dtool_WrapValue(keys[i])); + if (_this->_python_tag_data == NULL) { + return PyTuple_New(0); } - return result; + PyObject *dict = ((PythonTagDataImpl *)_this->_python_tag_data.p())->_dict; + return PyDict_Keys(dict); +} + +/** + * Called by Python to implement cycle detection. + */ +int Extension:: +__traverse__(visitproc visit, void *arg) { + // To fully implement cycle breaking, we also have to recurse into all of + // the node's children. However, this seems like it would be potentially + // quite expensive, so I'd rather not do it unless we had some optimization + // that would allow us to quickly find out whether there are children with + // Python tags. + if (_this->_python_tag_data != NULL) { + Py_VISIT(((PythonTagDataImpl *)_this->_python_tag_data.p())->_dict); + } + return 0; +} + +/** + * Destroys the tags associated with the node. + */ +Extension::PythonTagDataImpl:: +~PythonTagDataImpl() { +#if defined(HAVE_THREADS) && !defined(SIMPLE_THREADS) + // This might happen at any time, so be sure the Python state is ready for + // it. + PyGILState_STATE gstate; + gstate = PyGILState_Ensure(); +#endif + + Py_CLEAR(_dict); + +#if defined(HAVE_THREADS) && !defined(SIMPLE_THREADS) + PyGILState_Release(gstate); +#endif } #endif // HAVE_PYTHON diff --git a/panda/src/pgraph/pandaNode_ext.h b/panda/src/pgraph/pandaNode_ext.h index f4be38279e..86527d42d4 100644 --- a/panda/src/pgraph/pandaNode_ext.h +++ b/panda/src/pgraph/pandaNode_ext.h @@ -34,12 +34,26 @@ public: PyObject *get_tag_keys() const; - void set_python_tag(const string &key, PyObject *value); - PyObject *get_python_tag(const string &key) const; - bool has_python_tag(const string &key) const; - void clear_python_tag(const string &key); - void get_python_tag_keys(vector_string &keys) const; + PyObject *get_python_tags(); + int set_python_tag(PyObject *keys, PyObject *value); + PyObject *get_python_tag(PyObject *keys) const; + bool has_python_tag(PyObject *keys) const; + void clear_python_tag(PyObject *keys); PyObject *get_python_tag_keys() const; + + // This is defined to implement cycle detection in Python tags. + int __traverse__(visitproc visit, void *arg); + +private: + // This is what actually stores the Python tags. + class PythonTagDataImpl : public PandaNode::PythonTagData { + public: + PythonTagDataImpl() : _dict(PyDict_New()) {}; + PythonTagDataImpl(const PythonTagDataImpl ©) : _dict(PyDict_Copy(copy._dict)) {}; + virtual ~PythonTagDataImpl(); + + PyObject *_dict; + }; }; #endif // HAVE_PYTHON diff --git a/panda/src/pipeline/config_pipeline.cxx b/panda/src/pipeline/config_pipeline.cxx index 2dd7106dee..24b23da485 100644 --- a/panda/src/pipeline/config_pipeline.cxx +++ b/panda/src/pipeline/config_pipeline.cxx @@ -17,7 +17,6 @@ #include "externalThread.h" #include "genericThread.h" #include "thread.h" -#include "pythonThread.h" #include "pandaSystem.h" #include "dconfig.h" @@ -73,9 +72,6 @@ init_libpipeline() { ExternalThread::init_type(); GenericThread::init_type(); Thread::init_type(); -#ifdef HAVE_PYTHON - PythonThread::init_type(); -#endif // HAVE_PYTHON #ifdef HAVE_THREADS { diff --git a/panda/src/pipeline/p3pipeline_composite2.cxx b/panda/src/pipeline/p3pipeline_composite2.cxx index e5ee007a77..e6607a6ebf 100644 --- a/panda/src/pipeline/p3pipeline_composite2.cxx +++ b/panda/src/pipeline/p3pipeline_composite2.cxx @@ -10,7 +10,6 @@ #include "pipelineCyclerTrueImpl.cxx" #include "pmutex.cxx" #include "psemaphore.cxx" -#include "pythonThread.cxx" #include "reMutex.cxx" #include "reMutexDirect.cxx" #include "reMutexHolder.cxx" diff --git a/panda/src/pipeline/pythonThread.cxx b/panda/src/pipeline/pythonThread.cxx index 5800368b77..976e13aa57 100644 --- a/panda/src/pipeline/pythonThread.cxx +++ b/panda/src/pipeline/pythonThread.cxx @@ -36,18 +36,7 @@ PythonThread(PyObject *function, PyObject *args, nassert_raise("Invalid function passed to PythonThread constructor"); } - if (args == Py_None) { - // None means no arguments; create an empty tuple. - _args = PyTuple_New(0); - } else { - _args = NULL; - if (PySequence_Check(args)) { - _args = PySequence_Tuple(args); - } - if (_args == NULL) { - nassert_raise("Invalid args passed to PythonThread constructor"); - } - } + set_args(args); } /** @@ -73,13 +62,198 @@ join() { if (_result == NULL) { // No result; return None. - return Py_BuildValue(""); + Py_INCREF(Py_None); + return Py_None; } Py_INCREF(_result); return _result; } +/** + * + */ +PyObject *PythonThread:: +get_args() const { + return _args; +} + +/** + * + */ +void PythonThread:: +set_args(PyObject *args) { + Py_XDECREF(_args); + + if (args == Py_None) { + // None means no arguments; create an empty tuple. + _args = PyTuple_New(0); + } else { + _args = NULL; + if (PySequence_Check(args)) { + _args = PySequence_Tuple(args); + } + if (_args == NULL) { + Dtool_Raise_TypeError("PythonThread args must be a tuple"); + } + } +} + +#ifdef HAVE_PYTHON +/** + * Internal function to safely call a Python function within a sub-thread, + * that might execute in parallel with existing Python code. The return value + * is the return value of the Python function, or NULL if there was an + * exception. + */ +PyObject *PythonThread:: +call_python_func(PyObject *function, PyObject *args) { + Thread *current_thread = get_current_thread(); + + // Create a new Python thread state data structure, so Python can properly + // lock itself. + PyObject *result = NULL; + + if (current_thread == get_main_thread()) { + // In the main thread, just call the function. + result = PyObject_Call(function, args, NULL); + + if (result == (PyObject *)NULL) { + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_SystemExit)) { + // If we caught SystemExit, let it pass by without bothering to print + // a callback. + + } else { + // Temporarily save and restore the exception state so we can print a + // callback on-the-spot. + PyObject *exc, *val, *tb; + PyErr_Fetch(&exc, &val, &tb); + + Py_XINCREF(exc); + Py_XINCREF(val); + Py_XINCREF(tb); + PyErr_Restore(exc, val, tb); + PyErr_Print(); + + PyErr_Restore(exc, val, tb); + } + } + + } else { +#ifndef HAVE_THREADS + // Shouldn't be possible to come here without having some kind of + // threading support enabled. + nassertr(false, NULL); +#else + +#ifdef SIMPLE_THREADS + // We can't use the PyGILState interface, which assumes we are using true + // OS-level threading. PyGILState enforces policies like only one thread + // state per OS-level thread, which is not true in the case of + // SIMPLE_THREADS. + + // For some reason I don't fully understand, I'm getting a crash when I + // clean up old PyThreadState objects with PyThreadState_Delete(). It + // appears that the thread state is still referenced somewhere at the time + // I call delete, and the crash occurs because I've deleted an active + // pointer. + + // Storing these pointers in a vector for permanent recycling seems to + // avoid this problem. I wish I understood better what's going wrong, but + // I guess this workaround will do. + static pvector thread_states; + + PyThreadState *orig_thread_state = PyThreadState_Get(); + PyInterpreterState *istate = orig_thread_state->interp; + PyThreadState *new_thread_state; + if (thread_states.empty()) { + new_thread_state = PyThreadState_New(istate); + } else { + new_thread_state = thread_states.back(); + thread_states.pop_back(); + } + PyThreadState_Swap(new_thread_state); + + // Call the user's function. + result = PyObject_Call(function, args, NULL); + if (result == (PyObject *)NULL && PyErr_Occurred()) { + // We got an exception. Move the exception from the current thread into + // the main thread, so it can be handled there. + PyObject *exc, *val, *tb; + PyErr_Fetch(&exc, &val, &tb); + + thread_cat.error() + << "Exception occurred within " << *current_thread << "\n"; + + // Temporarily restore the exception state so we can print a callback + // on-the-spot. + Py_XINCREF(exc); + Py_XINCREF(val); + Py_XINCREF(tb); + PyErr_Restore(exc, val, tb); + PyErr_Print(); + + PyThreadState_Swap(orig_thread_state); + thread_states.push_back(new_thread_state); + // PyThreadState_Clear(new_thread_state); + // PyThreadState_Delete(new_thread_state); + + PyErr_Restore(exc, val, tb); + + // Now attempt to force the main thread to the head of the ready queue, + // so it can respond to the exception immediately. This only works if + // the main thread is not blocked, of course. + Thread::get_main_thread()->preempt(); + + } else { + // No exception. Restore the thread state normally. + PyThreadState *state = PyThreadState_Swap(orig_thread_state); + thread_states.push_back(new_thread_state); + // PyThreadState_Clear(new_thread_state); + // PyThreadState_Delete(new_thread_state); + } + +#else // SIMPLE_THREADS + // With true threading enabled, we're better off using PyGILState. + PyGILState_STATE gstate; + gstate = PyGILState_Ensure(); + + // Call the user's function. + result = PyObject_Call(function, args, NULL); + if (result == (PyObject *)NULL && PyErr_Occurred()) { + // We got an exception. Move the exception from the current thread into + // the main thread, so it can be handled there. + PyObject *exc, *val, *tb; + PyErr_Fetch(&exc, &val, &tb); + + thread_cat.error() + << "Exception occurred within " << *current_thread << "\n"; + + // Temporarily restore the exception state so we can print a callback + // on-the-spot. + Py_XINCREF(exc); + Py_XINCREF(val); + Py_XINCREF(tb); + PyErr_Restore(exc, val, tb); + PyErr_Print(); + + PyGILState_Release(gstate); + + PyErr_Restore(exc, val, tb); + } else { + // No exception. Restore the thread state normally. + PyGILState_Release(gstate); + } + + +#endif // SIMPLE_THREADS +#endif // HAVE_THREADS + } + + return result; +} +#endif // HAVE_PYTHON + /** * */ diff --git a/panda/src/pipeline/pythonThread.h b/panda/src/pipeline/pythonThread.h index f5b015deae..ea3adc2ac2 100644 --- a/panda/src/pipeline/pythonThread.h +++ b/panda/src/pipeline/pythonThread.h @@ -24,7 +24,7 @@ * the Python level. It will spawn a thread that executes an arbitrary Python * functor. */ -class EXPCL_PANDA_PIPELINE PythonThread : public Thread { +class PythonThread : public Thread { PUBLISHED: PythonThread(PyObject *function, PyObject *args, const string &name, const string &sync_name); @@ -32,6 +32,15 @@ PUBLISHED: BLOCKING PyObject *join(); +public: + PyObject *get_args() const; + void set_args(PyObject *); + + static PyObject *call_python_func(PyObject *function, PyObject *args); + +PUBLISHED: + MAKE_PROPERTY(args, get_args, set_args); + protected: virtual void thread_main(); diff --git a/panda/src/pipeline/thread.I b/panda/src/pipeline/thread.I index 159f764d6d..b721486c72 100644 --- a/panda/src/pipeline/thread.I +++ b/panda/src/pipeline/thread.I @@ -48,6 +48,16 @@ get_pstats_index() const { return _pstats_index; } +/** + * Returns the Python index associated with this thread, or -1 if no index has + * yet been associated with this thread. This is used internally by the + * direct.stdpy.thread module; you should not need to call this directly. + */ +INLINE int Thread:: +get_python_index() const { + return _python_index; +} + /** * Returns a string that is guaranteed to be unique to this thread, across all * processes on the machine, during at least the lifetime of this process. @@ -263,6 +273,15 @@ get_current_task() const { return _current_task; } +/** + * Stores a Python index to be associated with this thread. This is used + * internally by the thread module; you should not need to call this directly. + */ +INLINE void Thread:: +set_python_index(int python_index) { + _python_index = python_index; +} + /** * Should be called by the main thread just before exiting the program, this * blocks until any remaining thread cleanup has finished. diff --git a/panda/src/pipeline/thread.cxx b/panda/src/pipeline/thread.cxx index db22ee5803..6a0f0278fc 100644 --- a/panda/src/pipeline/thread.cxx +++ b/panda/src/pipeline/thread.cxx @@ -19,10 +19,6 @@ #include "conditionVarDebug.h" #include "conditionVarFullDebug.h" -#ifdef HAVE_PYTHON -#include "py_panda.h" -#endif - Thread *Thread::_main_thread; Thread *Thread::_external_thread; TypeHandle Thread::_type_handle; @@ -47,33 +43,17 @@ Thread(const string &name, const string &sync_name) : { _started = false; _pstats_index = -1; + _python_index = -1; _pstats_callback = NULL; _pipeline_stage = 0; _joinable = false; _current_task = NULL; -#ifdef HAVE_PYTHON - _python_data = Py_None; - Py_INCREF(_python_data); -#endif - #ifdef DEBUG_THREADS _blocked_on_mutex = NULL; _waiting_on_cvar = NULL; _waiting_on_cvar_full = NULL; #endif - -#if defined(HAVE_PYTHON) && !defined(SIMPLE_THREADS) - // Ensure that the Python threading system is initialized and ready to go. -#ifdef WITH_THREAD // This symbol defined within Python.h - -#if PY_VERSION_HEX >= 0x03020000 - Py_Initialize(); -#endif - - PyEval_InitThreads(); -#endif -#endif } /** @@ -81,10 +61,6 @@ Thread(const string &name, const string &sync_name) : */ Thread:: ~Thread() { -#ifdef HAVE_PYTHON - Py_DECREF(_python_data); -#endif - #ifdef DEBUG_THREADS nassertv(_blocked_on_mutex == NULL && _waiting_on_cvar == NULL && @@ -225,242 +201,6 @@ start(ThreadPriority priority, bool joinable) { return _started; } -#ifdef HAVE_PYTHON -/** - * Sets an arbitrary Python object that may be associated with this thread - * object. This is just for the purposes of associated arbitrary Python data - * with the C++ object; other than managing the reference count, the C++ code - * does nothing with this object. - */ -void Thread:: -set_python_data(PyObject *python_data) { - Py_DECREF(_python_data); - _python_data = python_data; - Py_INCREF(_python_data); -} -#endif // HAVE_PYTHON - -#ifdef HAVE_PYTHON -/** - * Returns the Python object that was set with set_python_data(). - */ -PyObject *Thread:: -get_python_data() const { - Py_INCREF(_python_data); - return _python_data; -} -#endif // HAVE_PYTHON - -#ifdef HAVE_PYTHON -/** - * Internal function to safely call a Python function within a sub-thread, - * that might execute in parallel with existing Python code. The return value - * is the return value of the Python function, or NULL if there was an - * exception. - */ -PyObject *Thread:: -call_python_func(PyObject *function, PyObject *args) { - nassertr(this == get_current_thread(), NULL); - - // Create a new Python thread state data structure, so Python can properly - // lock itself. - PyObject *result = NULL; - - if (this == get_main_thread()) { - // In the main thread, just call the function. - result = PyObject_Call(function, args, NULL); - - if (result == (PyObject *)NULL) { - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_SystemExit)) { - // If we caught SystemExit, let it pass by without bothering to print - // a callback. - - } else { - // Temporarily save and restore the exception state so we can print a - // callback on-the-spot. - PyObject *exc, *val, *tb; - PyErr_Fetch(&exc, &val, &tb); - - Py_XINCREF(exc); - Py_XINCREF(val); - Py_XINCREF(tb); - PyErr_Restore(exc, val, tb); - PyErr_Print(); - - PyErr_Restore(exc, val, tb); - } - } - - } else { -#ifndef HAVE_THREADS - // Shouldn't be possible to come here without having some kind of - // threading support enabled. - nassertr(false, NULL); -#else - -#ifdef SIMPLE_THREADS - // We can't use the PyGILState interface, which assumes we are using true - // OS-level threading. PyGILState enforces policies like only one thread - // state per OS-level thread, which is not true in the case of - // SIMPLE_THREADS. - - // For some reason I don't fully understand, I'm getting a crash when I - // clean up old PyThreadState objects with PyThreadState_Delete(). It - // appears that the thread state is still referenced somewhere at the time - // I call delete, and the crash occurs because I've deleted an active - // pointer. - - // Storing these pointers in a vector for permanent recycling seems to - // avoid this problem. I wish I understood better what's going wrong, but - // I guess this workaround will do. - static pvector thread_states; - - PyThreadState *orig_thread_state = PyThreadState_Get(); - PyInterpreterState *istate = orig_thread_state->interp; - PyThreadState *new_thread_state; - if (thread_states.empty()) { - new_thread_state = PyThreadState_New(istate); - } else { - new_thread_state = thread_states.back(); - thread_states.pop_back(); - } - PyThreadState_Swap(new_thread_state); - - // Call the user's function. - result = PyObject_Call(function, args, NULL); - if (result == (PyObject *)NULL && PyErr_Occurred()) { - // We got an exception. Move the exception from the current thread into - // the main thread, so it can be handled there. - PyObject *exc, *val, *tb; - PyErr_Fetch(&exc, &val, &tb); - - thread_cat.error() - << "Exception occurred within " << *this << "\n"; - - // Temporarily restore the exception state so we can print a callback - // on-the-spot. - Py_XINCREF(exc); - Py_XINCREF(val); - Py_XINCREF(tb); - PyErr_Restore(exc, val, tb); - PyErr_Print(); - - PyThreadState_Swap(orig_thread_state); - thread_states.push_back(new_thread_state); - // PyThreadState_Clear(new_thread_state); - // PyThreadState_Delete(new_thread_state); - - PyErr_Restore(exc, val, tb); - - // Now attempt to force the main thread to the head of the ready queue, - // so it can respond to the exception immediately. This only works if - // the main thread is not blocked, of course. - Thread::get_main_thread()->preempt(); - - } else { - // No exception. Restore the thread state normally. - PyThreadState *state = PyThreadState_Swap(orig_thread_state); - thread_states.push_back(new_thread_state); - // PyThreadState_Clear(new_thread_state); - // PyThreadState_Delete(new_thread_state); - } - -#else // SIMPLE_THREADS - // With true threading enabled, we're better off using PyGILState. - PyGILState_STATE gstate; - gstate = PyGILState_Ensure(); - - // Call the user's function. - result = PyObject_Call(function, args, NULL); - if (result == (PyObject *)NULL && PyErr_Occurred()) { - // We got an exception. Move the exception from the current thread into - // the main thread, so it can be handled there. - PyObject *exc, *val, *tb; - PyErr_Fetch(&exc, &val, &tb); - - thread_cat.error() - << "Exception occurred within " << *this << "\n"; - - // Temporarily restore the exception state so we can print a callback - // on-the-spot. - Py_XINCREF(exc); - Py_XINCREF(val); - Py_XINCREF(tb); - PyErr_Restore(exc, val, tb); - PyErr_Print(); - - PyGILState_Release(gstate); - - PyErr_Restore(exc, val, tb); - } else { - // No exception. Restore the thread state normally. - PyGILState_Release(gstate); - } - - -#endif // SIMPLE_THREADS -#endif // HAVE_THREADS - } - - return result; -} -#endif // HAVE_PYTHON - -#ifdef HAVE_PYTHON -/** - * Called when a Python exception is raised during processing of a thread. - * Gets the error string and passes it back to the calling Python process in a - * sensible way. - */ -void Thread:: -handle_python_exception() { - /* - PyObject *exc, *val, *tb; - PyErr_Fetch(&exc, &val, &tb); - - ostringstream strm; - strm << "\n"; - - if (PyObject_HasAttrString(exc, "__name__")) { - PyObject *exc_name = PyObject_GetAttrString(exc, "__name__"); - PyObject *exc_str = PyObject_Str(exc_name); - strm << PyString_AsString(exc_str); - Py_DECREF(exc_str); - Py_DECREF(exc_name); - } else { - PyObject *exc_str = PyObject_Str(exc); - strm << PyString_AsString(exc_str); - Py_DECREF(exc_str); - } - Py_DECREF(exc); - - if (val != (PyObject *)NULL) { - PyObject *val_str = PyObject_Str(val); - strm << ": " << PyString_AsString(val_str); - Py_DECREF(val_str); - Py_DECREF(val); - } - if (tb != (PyObject *)NULL) { - Py_DECREF(tb); - } - - strm << "\nException occurred within thread " << get_name(); - string message = strm.str(); - nout << message << "\n"; - - nassert_raise(message); - */ - - thread_cat.error() - << "Exception occurred within " << *this << "\n"; - - // Now attempt to force the main thread to the head of the ready queue, so - // it will be the one to receive the above assertion. This mainly only has - // an effect if SIMPLE_THREADS is in use. - Thread::get_main_thread()->preempt(); -} -#endif // HAVE_PYTHON - /** * Creates the Thread object that represents the main thread. */ diff --git a/panda/src/pipeline/thread.h b/panda/src/pipeline/thread.h index 71cbe8bcce..2240174f02 100644 --- a/panda/src/pipeline/thread.h +++ b/panda/src/pipeline/thread.h @@ -59,6 +59,7 @@ PUBLISHED: INLINE const string &get_sync_name() const; INLINE int get_pstats_index() const; + INLINE int get_python_index() const; INLINE string get_unique_id() const; INLINE int get_pipeline_stage() const; @@ -88,15 +89,21 @@ PUBLISHED: BLOCKING INLINE void join(); INLINE void preempt(); -#ifdef HAVE_PYTHON - void set_python_data(PyObject *python_data); - PyObject *get_python_data() const; -#endif - INLINE AsyncTaskBase *get_current_task() const; + INLINE void set_python_index(int index); + INLINE static void prepare_for_exit(); + MAKE_PROPERTY(sync_name, get_sync_name); + MAKE_PROPERTY(pstats_index, get_pstats_index); + MAKE_PROPERTY(python_index, get_python_index); + MAKE_PROPERTY(unique_id, get_unique_id); + MAKE_PROPERTY(pipeline_stage, get_pipeline_stage, set_pipeline_stage); + MAKE_PROPERTY(started, is_started); + MAKE_PROPERTY(joinable, is_joinable); + MAKE_PROPERTY(current_task, get_current_task); + public: // This class allows integration with PStats, particularly in the // SIMPLE_THREADS case. @@ -111,12 +118,6 @@ public: INLINE void set_pstats_callback(PStatsCallback *pstats_callback); INLINE PStatsCallback *get_pstats_callback() const; -#ifdef HAVE_PYTHON - // Integration with Python. - PyObject *call_python_func(PyObject *function, PyObject *args); - void handle_python_exception(); -#endif // HAVE_PYTHON - private: static void init_main_thread(); static void init_external_thread(); @@ -133,9 +134,7 @@ private: bool _joinable; AsyncTaskBase *_current_task; -#ifdef HAVE_PYTHON - PyObject *_python_data; -#endif + int _python_index; #ifdef DEBUG_THREADS MutexDebug *_blocked_on_mutex; diff --git a/panda/src/pnmimage/pfmFile.h b/panda/src/pnmimage/pfmFile.h index d1bb93bcc4..74eda76bce 100644 --- a/panda/src/pnmimage/pfmFile.h +++ b/panda/src/pnmimage/pfmFile.h @@ -170,9 +170,9 @@ PUBLISHED: void output(ostream &out) const; +#ifdef HAVE_PYTHON EXTENSION(PyObject *get_points() const); -#if PY_VERSION_HEX >= 0x02060000 EXTENSION(int __getbuffer__(PyObject *self, Py_buffer *view, int flags) const); #endif diff --git a/panda/src/pnmimage/pfmFile_ext.cxx b/panda/src/pnmimage/pfmFile_ext.cxx index a6306cbbf4..4e041e986f 100644 --- a/panda/src/pnmimage/pfmFile_ext.cxx +++ b/panda/src/pnmimage/pfmFile_ext.cxx @@ -70,7 +70,6 @@ get_points() const { return list; } -#if PY_VERSION_HEX >= 0x02060000 /** * This is a very low-level function that returns a read-only multiview into * the internal table of floating-point numbers. Use this method at your own @@ -78,7 +77,7 @@ get_points() const { */ int Extension:: __getbuffer__(PyObject *self, Py_buffer *view, int flags) const { - +#if PY_VERSION_HEX >= 0x02060000 if ((flags & PyBUF_WRITABLE) == PyBUF_WRITABLE) { PyErr_SetString(PyExc_BufferError, "Object is not writable."); @@ -118,8 +117,9 @@ __getbuffer__(PyObject *self, Py_buffer *view, int flags) const { view->suboffsets = NULL; return 0; +#else + return -1; +#endif } -#endif // PY_VERSION_HEX >= 0x02060000 - #endif // HAVE_PYTHON diff --git a/panda/src/pnmimage/pfmFile_ext.h b/panda/src/pnmimage/pfmFile_ext.h index cf8d4b20aa..0476e7d3e8 100644 --- a/panda/src/pnmimage/pfmFile_ext.h +++ b/panda/src/pnmimage/pfmFile_ext.h @@ -31,9 +31,7 @@ class Extension : public ExtensionBase { public: PyObject *get_points() const; -#if PY_VERSION_HEX >= 0x02060000 int __getbuffer__(PyObject *self, Py_buffer *view, int flags) const; -#endif }; #endif // HAVE_PYTHON diff --git a/panda/src/putil/bamReader_ext.cxx b/panda/src/putil/bamReader_ext.cxx index 4a490f90d9..1648d7e24c 100644 --- a/panda/src/putil/bamReader_ext.cxx +++ b/panda/src/putil/bamReader_ext.cxx @@ -13,6 +13,7 @@ #include "bamReader_ext.h" #include "config_util.h" +#include "pythonThread.h" #ifdef HAVE_PYTHON @@ -45,8 +46,7 @@ static TypedWritable *factory_callback(const FactoryParams ¶ms){ PyObject *args = PyTuple_Pack(2, py_scan, py_manager); // Now call the Python function. - Thread *current_thread = Thread::get_current_thread(); - PyObject *result = current_thread->call_python_func(func, args); + PyObject *result = PythonThread::call_python_func(func, args); Py_DECREF(args); Py_DECREF(py_scan); Py_DECREF(py_manager); diff --git a/panda/src/putil/pythonCallbackObject.cxx b/panda/src/putil/pythonCallbackObject.cxx index 0679a4c473..fd1c9aa64f 100644 --- a/panda/src/putil/pythonCallbackObject.cxx +++ b/panda/src/putil/pythonCallbackObject.cxx @@ -16,7 +16,7 @@ #ifdef HAVE_PYTHON #include "py_panda.h" -#include "thread.h" +#include "pythonThread.h" #include "callbackData.h" #include "config_util.h" @@ -121,8 +121,7 @@ do_python_callback(CallbackData *cbdata) { PyObject *args = Py_BuildValue("(O)", pycbdata); Py_DECREF(pycbdata); - PyObject *result = - Thread::get_current_thread()->call_python_func(_function, args); + PyObject *result = PythonThread::call_python_func(_function, args); Py_DECREF(args); if (result == (PyObject *)NULL) { diff --git a/panda/src/testbed/pgrid.cxx b/panda/src/testbed/pgrid.cxx index 76f56a58d9..e028e6c03c 100644 --- a/panda/src/testbed/pgrid.cxx +++ b/panda/src/testbed/pgrid.cxx @@ -12,7 +12,6 @@ */ #include "pandaFramework.h" -#include "pystub.h" #include "pandaNode.h" #include "transformState.h" #include "clockObject.h" @@ -385,9 +384,6 @@ load_gridded_models(WindowFramework *window, int main(int argc, char **argv) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - preprocess_argv(argc, argv); PandaFramework framework; framework.open_framework(argc, argv); diff --git a/panda/src/testbed/pview.cxx b/panda/src/testbed/pview.cxx index f656a5de3d..c31537e2c5 100644 --- a/panda/src/testbed/pview.cxx +++ b/panda/src/testbed/pview.cxx @@ -13,7 +13,6 @@ #include "pandaFramework.h" #include "pandaSystem.h" -#include "pystub.h" #include "textNode.h" #include "configVariableBool.h" #include "texturePool.h" @@ -234,9 +233,6 @@ report_version() { int main(int argc, char **argv) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - preprocess_argv(argc, argv); framework.open_framework(argc, argv); framework.set_window_title("Panda Viewer"); diff --git a/pandatool/src/bam/bamInfo.cxx b/pandatool/src/bam/bamInfo.cxx index 9c3403dc00..44d015c2fe 100644 --- a/pandatool/src/bam/bamInfo.cxx +++ b/pandatool/src/bam/bamInfo.cxx @@ -24,7 +24,6 @@ #include "pvector.h" #include "bamCacheRecord.h" #include "bamCacheIndex.h" -#include "pystub.h" /** * @@ -322,9 +321,6 @@ list_hierarchy(PandaNode *node, int indent_level) { } int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - BamInfo prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/bam/bamToEgg.cxx b/pandatool/src/bam/bamToEgg.cxx index b3a2c48535..7f70255ce9 100644 --- a/pandatool/src/bam/bamToEgg.cxx +++ b/pandatool/src/bam/bamToEgg.cxx @@ -13,7 +13,6 @@ #include "bamToEgg.h" #include "save_egg_file.h" -#include "pystub.h" #include "string_utils.h" #include "bamFile.h" #include "bamCacheRecord.h" @@ -98,9 +97,6 @@ run() { } int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - BamToEgg prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/bam/eggToBam.cxx b/pandatool/src/bam/eggToBam.cxx index ce9f2884a6..238eba17cf 100644 --- a/pandatool/src/bam/eggToBam.cxx +++ b/pandatool/src/bam/eggToBam.cxx @@ -31,7 +31,6 @@ #include "load_prc_file.h" #include "windowProperties.h" #include "frameBufferProperties.h" -#include "pystub.h" /** * @@ -485,9 +484,6 @@ make_buffer() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggToBam prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/bam/ptsToBam.cxx b/pandatool/src/bam/ptsToBam.cxx index d1d55056e4..5f570d309b 100644 --- a/pandatool/src/bam/ptsToBam.cxx +++ b/pandatool/src/bam/ptsToBam.cxx @@ -19,7 +19,6 @@ #include "pandaNode.h" #include "geomNode.h" #include "dcast.h" -#include "pystub.h" #include "string_utils.h" #include "config_egg2pg.h" @@ -230,9 +229,6 @@ close_vertex_data() { } int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - PtsToBam prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/cvscopy/testCopy.cxx b/pandatool/src/cvscopy/testCopy.cxx index 8f9fbce3a4..4947bc8d5c 100644 --- a/pandatool/src/cvscopy/testCopy.cxx +++ b/pandatool/src/cvscopy/testCopy.cxx @@ -13,7 +13,6 @@ #include "testCopy.h" #include "cvsSourceDirectory.h" -#include "pystub.h" /** * @@ -59,9 +58,6 @@ copy_file(const Filename &source, const Filename &dest, int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - TestCopy prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/daeprogs/daeToEgg.cxx b/pandatool/src/daeprogs/daeToEgg.cxx index c96f656100..c3ba781361 100644 --- a/pandatool/src/daeprogs/daeToEgg.cxx +++ b/pandatool/src/daeprogs/daeToEgg.cxx @@ -14,7 +14,6 @@ #include "daeToEgg.h" #include "daeToEggConverter.h" -#include "pystub.h" /** * @@ -76,9 +75,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - DAEToEgg prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/daeprogs/eggToDAE.cxx b/pandatool/src/daeprogs/eggToDAE.cxx index 31b8f24d5d..dff2286b88 100644 --- a/pandatool/src/daeprogs/eggToDAE.cxx +++ b/pandatool/src/daeprogs/eggToDAE.cxx @@ -13,7 +13,6 @@ #include "eggToDAE.h" #include "dcast.h" -#include "pystub.h" #include "pandaVersion.h" #include "FCDocument/FCDocument.h" @@ -165,9 +164,6 @@ void EggToDAE::apply_transform(FCDSceneNode* to, const PT(EggGroup) from) { } int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggToDAE prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/dxfprogs/dxfPoints.cxx b/pandatool/src/dxfprogs/dxfPoints.cxx index 2dba8ae801..c0002b2826 100644 --- a/pandatool/src/dxfprogs/dxfPoints.cxx +++ b/pandatool/src/dxfprogs/dxfPoints.cxx @@ -12,7 +12,6 @@ */ #include "dxfPoints.h" -#include "pystub.h" /** * @@ -83,9 +82,6 @@ handle_args(ProgramBase::Args &args) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - DXFPoints prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/dxfprogs/dxfToEgg.cxx b/pandatool/src/dxfprogs/dxfToEgg.cxx index 512c790b96..4ca66f0a94 100644 --- a/pandatool/src/dxfprogs/dxfToEgg.cxx +++ b/pandatool/src/dxfprogs/dxfToEgg.cxx @@ -14,7 +14,6 @@ #include "dxfToEgg.h" #include "dxfToEggConverter.h" -#include "pystub.h" /** * @@ -68,9 +67,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - DXFToEgg prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/dxfprogs/eggToDXF.cxx b/pandatool/src/dxfprogs/eggToDXF.cxx index 3a3b24d564..e3fb8a85d5 100644 --- a/pandatool/src/dxfprogs/eggToDXF.cxx +++ b/pandatool/src/dxfprogs/eggToDXF.cxx @@ -14,7 +14,6 @@ #include "eggToDXF.h" #include "eggPolygon.h" #include "dcast.h" -#include "pystub.h" /** * @@ -143,9 +142,6 @@ write_entities(ostream &out) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggToDXF prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/egg-mkfont/eggMakeFont.cxx b/pandatool/src/egg-mkfont/eggMakeFont.cxx index f51fbebc7a..024f302199 100644 --- a/pandatool/src/egg-mkfont/eggMakeFont.cxx +++ b/pandatool/src/egg-mkfont/eggMakeFont.cxx @@ -29,7 +29,6 @@ #include "eggVertex.h" #include "string_utils.h" #include "dcast.h" -#include "pystub.h" #include @@ -737,9 +736,6 @@ is_numeric(const string &str) { } int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggMakeFont prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/egg-optchar/eggOptchar.cxx b/pandatool/src/egg-optchar/eggOptchar.cxx index 4198a3b84c..bc1d3058b3 100644 --- a/pandatool/src/egg-optchar/eggOptchar.cxx +++ b/pandatool/src/egg-optchar/eggOptchar.cxx @@ -31,7 +31,6 @@ #include "pset.h" #include "compose_matrix.h" #include "fftCompressor.h" -#include "pystub.h" #include @@ -1512,9 +1511,6 @@ do_defpose() { } int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggOptchar prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/egg-palettize/eggPalettize.cxx b/pandatool/src/egg-palettize/eggPalettize.cxx index cefec3d589..200b62e798 100644 --- a/pandatool/src/egg-palettize/eggPalettize.cxx +++ b/pandatool/src/egg-palettize/eggPalettize.cxx @@ -23,7 +23,6 @@ #include "pnotify.h" #include "notifyCategory.h" #include "notifySeverity.h" -#include "pystub.h" #include @@ -866,9 +865,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggPalettize prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/egg-qtess/eggQtess.cxx b/pandatool/src/egg-qtess/eggQtess.cxx index df0e63e830..21bc6317fb 100644 --- a/pandatool/src/egg-qtess/eggQtess.cxx +++ b/pandatool/src/egg-qtess/eggQtess.cxx @@ -14,7 +14,6 @@ #include "eggQtess.h" #include "qtessGlobals.h" #include "dcast.h" -#include "pystub.h" /** * @@ -331,9 +330,6 @@ find_surfaces(EggNode *egg_node) { } int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggQtess prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/eggprogs/eggCrop.cxx b/pandatool/src/eggprogs/eggCrop.cxx index 64f2e017b4..38edb93284 100644 --- a/pandatool/src/eggprogs/eggCrop.cxx +++ b/pandatool/src/eggprogs/eggCrop.cxx @@ -17,7 +17,6 @@ #include "eggPrimitive.h" #include "eggVertex.h" #include "dcast.h" -#include "pystub.h" /** * @@ -118,9 +117,6 @@ strip_prims(EggGroupNode *group) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggCrop prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/eggprogs/eggListTextures.cxx b/pandatool/src/eggprogs/eggListTextures.cxx index 3174e5ad87..c804a8110b 100644 --- a/pandatool/src/eggprogs/eggListTextures.cxx +++ b/pandatool/src/eggprogs/eggListTextures.cxx @@ -14,7 +14,6 @@ #include "eggListTextures.h" #include "eggTextureCollection.h" #include "pnmImageHeader.h" -#include "pystub.h" /** * @@ -59,9 +58,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggListTextures prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/eggprogs/eggMakeTube.cxx b/pandatool/src/eggprogs/eggMakeTube.cxx index efda24d353..37adfd8d59 100644 --- a/pandatool/src/eggprogs/eggMakeTube.cxx +++ b/pandatool/src/eggprogs/eggMakeTube.cxx @@ -18,7 +18,6 @@ #include "eggPolygon.h" #include "pointerTo.h" #include "look_at.h" -#include "pystub.h" /** * @@ -264,9 +263,6 @@ add_polygon(EggVertex *a, EggVertex *b, EggVertex *c, EggVertex *d) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggMakeTube prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/eggprogs/eggRename.cxx b/pandatool/src/eggprogs/eggRename.cxx index ac28ae39b6..abde299e2d 100644 --- a/pandatool/src/eggprogs/eggRename.cxx +++ b/pandatool/src/eggprogs/eggRename.cxx @@ -12,7 +12,6 @@ */ #include "eggRename.h" -#include "pystub.h" /** * @@ -52,9 +51,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggRename prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/eggprogs/eggRetargetAnim.cxx b/pandatool/src/eggprogs/eggRetargetAnim.cxx index 82a825a8cc..f354eb57b9 100644 --- a/pandatool/src/eggprogs/eggRetargetAnim.cxx +++ b/pandatool/src/eggprogs/eggRetargetAnim.cxx @@ -21,7 +21,6 @@ #include "eggJointPointer.h" #include "eggTable.h" #include "compose_matrix.h" -#include "pystub.h" /** * @@ -186,9 +185,6 @@ retarget_anim(EggCharacterData *char_data, EggJointData *joint_data, int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggRetargetAnim prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/eggprogs/eggTextureCards.cxx b/pandatool/src/eggprogs/eggTextureCards.cxx index e0363af75a..03cb811809 100644 --- a/pandatool/src/eggprogs/eggTextureCards.cxx +++ b/pandatool/src/eggprogs/eggTextureCards.cxx @@ -19,7 +19,6 @@ #include "eggTexture.h" #include "eggPolygon.h" #include "pnmImageHeader.h" -#include "pystub.h" #include @@ -483,9 +482,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggTextureCards prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/eggprogs/eggToC.cxx b/pandatool/src/eggprogs/eggToC.cxx index 9a25e1615d..28fcb2f36e 100644 --- a/pandatool/src/eggprogs/eggToC.cxx +++ b/pandatool/src/eggprogs/eggToC.cxx @@ -21,7 +21,6 @@ #include "eggPolysetMaker.h" #include "eggBin.h" #include "string_utils.h" -#include "pystub.h" /** * @@ -364,9 +363,6 @@ write_bin(EggBin *bin) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggToC prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/eggprogs/eggTopstrip.cxx b/pandatool/src/eggprogs/eggTopstrip.cxx index 16c7b3371a..e0bbcf4e7e 100644 --- a/pandatool/src/eggprogs/eggTopstrip.cxx +++ b/pandatool/src/eggprogs/eggTopstrip.cxx @@ -21,7 +21,6 @@ #include "eggJointPointer.h" #include "eggTable.h" #include "compose_matrix.h" -#include "pystub.h" /** * @@ -343,9 +342,6 @@ adjust_transform(LMatrix4d &mat) const { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggTopstrip prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/eggprogs/eggTrans.cxx b/pandatool/src/eggprogs/eggTrans.cxx index 3f86d54903..28d439e617 100644 --- a/pandatool/src/eggprogs/eggTrans.cxx +++ b/pandatool/src/eggprogs/eggTrans.cxx @@ -13,7 +13,6 @@ #include "eggTrans.h" #include "eggGroupUniquifier.h" -#include "pystub.h" /** * @@ -131,9 +130,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggTrans prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/fltprogs/eggToFlt.cxx b/pandatool/src/fltprogs/eggToFlt.cxx index 36351af679..90e9d123a3 100644 --- a/pandatool/src/fltprogs/eggToFlt.cxx +++ b/pandatool/src/fltprogs/eggToFlt.cxx @@ -34,7 +34,6 @@ #include "dcast.h" #include "string_utils.h" #include "vector_string.h" -#include "pystub.h" /** * @@ -666,9 +665,6 @@ get_flt_texture(EggTexture *egg_texture) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggToFlt prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/fltprogs/fltCopy.cxx b/pandatool/src/fltprogs/fltCopy.cxx index ea5dfbde07..6ecb3b7833 100644 --- a/pandatool/src/fltprogs/fltCopy.cxx +++ b/pandatool/src/fltprogs/fltCopy.cxx @@ -19,7 +19,6 @@ #include "fltExternalReference.h" #include "fltError.h" #include "dcast.h" -#include "pystub.h" /** * @@ -231,9 +230,6 @@ scan_flt(FltRecord *record, FltCopy::Refs &refs, FltCopy::Textures &textures) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - FltCopy prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/fltprogs/fltInfo.cxx b/pandatool/src/fltprogs/fltInfo.cxx index 8f35093c73..a6d4649bff 100644 --- a/pandatool/src/fltprogs/fltInfo.cxx +++ b/pandatool/src/fltprogs/fltInfo.cxx @@ -15,7 +15,6 @@ #include "fltHeader.h" #include "indent.h" -#include "pystub.h" /** * @@ -91,9 +90,6 @@ handle_args(ProgramBase::Args &args) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - FltInfo prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/fltprogs/fltToEgg.cxx b/pandatool/src/fltprogs/fltToEgg.cxx index 6935e29c68..c08a8381d9 100644 --- a/pandatool/src/fltprogs/fltToEgg.cxx +++ b/pandatool/src/fltprogs/fltToEgg.cxx @@ -15,7 +15,6 @@ #include "fltToEggConverter.h" #include "config_flt.h" -#include "pystub.h" /** * @@ -99,9 +98,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - init_libflt(); FltToEgg prog; prog.parse_command_line(argc, argv); diff --git a/pandatool/src/fltprogs/fltTrans.cxx b/pandatool/src/fltprogs/fltTrans.cxx index 3fd6ae9656..692f8e374b 100644 --- a/pandatool/src/fltprogs/fltTrans.cxx +++ b/pandatool/src/fltprogs/fltTrans.cxx @@ -14,7 +14,6 @@ #include "fltTrans.h" #include "fltHeader.h" -#include "pystub.h" /** * @@ -127,9 +126,6 @@ handle_args(ProgramBase::Args &args) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - FltTrans prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/gtk-stats/gtkStats.cxx b/pandatool/src/gtk-stats/gtkStats.cxx index 9ad165fa29..b76bc292f3 100644 --- a/pandatool/src/gtk-stats/gtkStats.cxx +++ b/pandatool/src/gtk-stats/gtkStats.cxx @@ -15,7 +15,6 @@ #include "gtkStats.h" #include "gtkStatsServer.h" #include "config_pstats.h" -#include "pystub.h" GtkWidget *main_window; static GtkStatsServer *server = NULL; @@ -53,9 +52,6 @@ timer(gpointer data) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - gtk_init(&argc, &argv); main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); diff --git a/pandatool/src/imageprogs/imageFixHiddenColor.cxx b/pandatool/src/imageprogs/imageFixHiddenColor.cxx index 46ff3e5636..bb56bcc659 100644 --- a/pandatool/src/imageprogs/imageFixHiddenColor.cxx +++ b/pandatool/src/imageprogs/imageFixHiddenColor.cxx @@ -13,7 +13,6 @@ #include "imageFixHiddenColor.h" #include "string_utils.h" -#include "pystub.h" /** * @@ -143,9 +142,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - ImageFixHiddenColor prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/imageprogs/imageInfo.cxx b/pandatool/src/imageprogs/imageInfo.cxx index d445e028ee..175a5dba1d 100644 --- a/pandatool/src/imageprogs/imageInfo.cxx +++ b/pandatool/src/imageprogs/imageInfo.cxx @@ -13,7 +13,6 @@ #include "imageInfo.h" #include "pnmImageHeader.h" -#include "pystub.h" /** * @@ -88,9 +87,6 @@ is_power_2(int value) const { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - ImageInfo prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/imageprogs/imageResize.cxx b/pandatool/src/imageprogs/imageResize.cxx index 6b6a877490..ae5a746c1a 100644 --- a/pandatool/src/imageprogs/imageResize.cxx +++ b/pandatool/src/imageprogs/imageResize.cxx @@ -13,7 +13,6 @@ #include "imageResize.h" #include "string_utils.h" -#include "pystub.h" /** * @@ -117,9 +116,6 @@ dispatch_size_request(const string &opt, const string &arg, void *var) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - ImageResize prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/imageprogs/imageTrans.cxx b/pandatool/src/imageprogs/imageTrans.cxx index 68187459a7..da33516eeb 100644 --- a/pandatool/src/imageprogs/imageTrans.cxx +++ b/pandatool/src/imageprogs/imageTrans.cxx @@ -13,7 +13,6 @@ #include "imageTrans.h" #include "string_utils.h" -#include "pystub.h" /** * @@ -203,9 +202,6 @@ extract_alpha() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - ImageTrans prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/imageprogs/imageTransformColors.cxx b/pandatool/src/imageprogs/imageTransformColors.cxx index 2dfec7eab2..a18629f798 100644 --- a/pandatool/src/imageprogs/imageTransformColors.cxx +++ b/pandatool/src/imageprogs/imageTransformColors.cxx @@ -13,7 +13,6 @@ #include "imageTransformColors.h" #include "string_utils.h" -#include "pystub.h" #include "pnmImage.h" #include @@ -471,9 +470,6 @@ process_image(PNMImage &image) { } int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - ImageTransformColors prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/lwo/test_lwo.cxx b/pandatool/src/lwo/test_lwo.cxx index 3d06358ef5..b541fb8360 100644 --- a/pandatool/src/lwo/test_lwo.cxx +++ b/pandatool/src/lwo/test_lwo.cxx @@ -14,13 +14,9 @@ #include "lwoInputFile.h" #include "lwoChunk.h" #include "config_lwo.h" -#include "pystub.h" int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - init_liblwo(); if (argc != 2) { nout << "test_lwo file.lwo\n"; diff --git a/pandatool/src/lwoprogs/lwoScan.cxx b/pandatool/src/lwoprogs/lwoScan.cxx index 5b72a5be2d..a7fbf46933 100644 --- a/pandatool/src/lwoprogs/lwoScan.cxx +++ b/pandatool/src/lwoprogs/lwoScan.cxx @@ -16,7 +16,6 @@ #include "lwoInputFile.h" #include "lwoChunk.h" #include "config_lwo.h" -#include "pystub.h" /** * @@ -77,9 +76,6 @@ handle_args(ProgramBase::Args &args) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - init_liblwo(); LwoScan prog; prog.parse_command_line(argc, argv); diff --git a/pandatool/src/lwoprogs/lwoToEgg.cxx b/pandatool/src/lwoprogs/lwoToEgg.cxx index bfdc45cd33..a2e54b48ea 100644 --- a/pandatool/src/lwoprogs/lwoToEgg.cxx +++ b/pandatool/src/lwoprogs/lwoToEgg.cxx @@ -17,7 +17,6 @@ #include "lwoHeader.h" #include "lwoInputFile.h" #include "config_lwo.h" -#include "pystub.h" /** * @@ -80,9 +79,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - init_liblwo(); LwoToEgg prog; prog.parse_command_line(argc, argv); diff --git a/pandatool/src/mayaprogs/eggToMaya.cxx b/pandatool/src/mayaprogs/eggToMaya.cxx index 48ac972aea..da944e58e6 100644 --- a/pandatool/src/mayaprogs/eggToMaya.cxx +++ b/pandatool/src/mayaprogs/eggToMaya.cxx @@ -14,9 +14,6 @@ #include "eggToMaya.h" #include "mayaEggLoader.h" #include "mayaApi.h" -#ifdef _WIN32 - #include "pystub.h" -#endif // We must define this to prevent Maya from doubly-declaring its MApiVersion // string in this file as well as in libmayaegg. @@ -128,13 +125,6 @@ run() { } int main(int argc, char *argv[]) { - // We don't want pystub on linux, since it gives problems with Maya's - // python. -#ifdef _WIN32 - // A call to pystub() to force libpystub.so to be linked in. - pystub(); -#endif - EggToMaya prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/mayaprogs/mayaCopy.cxx b/pandatool/src/mayaprogs/mayaCopy.cxx index eeb11eda4e..70cb614a2d 100644 --- a/pandatool/src/mayaprogs/mayaCopy.cxx +++ b/pandatool/src/mayaprogs/mayaCopy.cxx @@ -18,9 +18,6 @@ #include "cvsSourceDirectory.h" #include "mayaShader.h" #include "dcast.h" -#ifdef _WIN32 - #include "pystub.h" -#endif #include "pre_maya_include.h" #include @@ -449,13 +446,6 @@ collect_shader_for_node(const MDagPath &dag_path) { int main(int argc, char *argv[]) { - // We don't want pystub on linux, since it gives problems with Maya's - // python. -#ifdef _WIN32 - // A call to pystub() to force libpystub.so to be linked in. - pystub(); -#endif - MayaCopy prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/mayaprogs/mayaToEgg.cxx b/pandatool/src/mayaprogs/mayaToEgg.cxx index a7a4cfe7c6..5ceb4cf1ee 100644 --- a/pandatool/src/mayaprogs/mayaToEgg.cxx +++ b/pandatool/src/mayaprogs/mayaToEgg.cxx @@ -43,9 +43,6 @@ #include "config_mayaegg.h" #include "config_maya.h" // for maya_cat #include "globPattern.h" -#ifdef _WIN32 - #include "pystub.h" -#endif /** * @@ -336,13 +333,6 @@ dispatch_transform_type(const string &opt, const string &arg, void *var) { } int main(int argc, char *argv[]) { - // We don't want pystub on linux, since it gives problems with Maya's - // python. -#ifdef _WIN32 - // A call to pystub() to force libpystub.so to be linked in. - pystub(); -#endif - MayaToEgg prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/mayaprogs/mayaToEgg_client.cxx b/pandatool/src/mayaprogs/mayaToEgg_client.cxx index d5d3f40c9f..dfde2661c1 100644 --- a/pandatool/src/mayaprogs/mayaToEgg_client.cxx +++ b/pandatool/src/mayaprogs/mayaToEgg_client.cxx @@ -12,9 +12,6 @@ */ #include "mayaToEgg_client.h" -#ifdef _WIN32 - #include "pystub.h" -#endif /** * @@ -31,13 +28,6 @@ MayaToEggClient() : } int main(int argc, char *argv[]) { - // We don't want pystub on linux, since it gives problems with Maya's - // python. -#ifdef _WIN32 - // A call to pystub() to force libpystub.so to be linked in. - pystub(); -#endif - MayaToEggClient prog; // Open a connection to the server process PT(Connection) con = prog.qManager->open_TCP_client_connection(prog.server,0); diff --git a/pandatool/src/mayaprogs/mayaToEgg_server.cxx b/pandatool/src/mayaprogs/mayaToEgg_server.cxx index 19fd9ac22f..30f88f99d0 100644 --- a/pandatool/src/mayaprogs/mayaToEgg_server.cxx +++ b/pandatool/src/mayaprogs/mayaToEgg_server.cxx @@ -19,9 +19,6 @@ #include "config_mayaegg.h" #include "config_maya.h" // for maya_cat #include "globPattern.h" -#ifdef _WIN32 - #include "pystub.h" -#endif /** * @@ -458,13 +455,6 @@ poll() { } // poll int main(int argc, char *argv[]) { - // We don't want pystub on linux, since it gives problems with Maya's - // python. -#ifdef _WIN32 - // A call to pystub() to force libpystub.so to be linked in. - pystub(); -#endif - MayaToEggServer prog; // Open a rendezvous port for receiving new connections from the client PT(Connection) rend = prog.qManager->open_TCP_server_rendezvous(4242, 50); diff --git a/pandatool/src/mayaprogs/mayapath.cxx b/pandatool/src/mayaprogs/mayapath.cxx index b0576147f0..aac472759d 100644 --- a/pandatool/src/mayaprogs/mayapath.cxx +++ b/pandatool/src/mayaprogs/mayapath.cxx @@ -49,10 +49,6 @@ #include #endif -#ifdef HAVE_PYTHON -#include "pystub.h" -#endif - #define QUOTESTR(x) #x #define TOSTRING(x) QUOTESTR(x) @@ -187,11 +183,6 @@ get_maya_location(const char *ver, string &loc) { int main(int argc, char *argv[]) { -#ifdef HAVE_PYTHON - // Force pystub to be linked in. - pystub(); -#endif - // First, get the command line and append _bin, so we will actually run // maya2egg_bin.exe, egg2maya_bin.exe, etc. Filename command = Filename::from_os_specific(argv[0]); diff --git a/pandatool/src/miscprogs/binToC.cxx b/pandatool/src/miscprogs/binToC.cxx index 3f1b188441..8d1ee2dec8 100644 --- a/pandatool/src/miscprogs/binToC.cxx +++ b/pandatool/src/miscprogs/binToC.cxx @@ -12,7 +12,6 @@ */ #include "binToC.h" -#include "pystub.h" // The number of bytes across the page to write. static const int col_width = 11; @@ -144,9 +143,6 @@ handle_args(ProgramBase::Args &args) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - BinToC prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/objprogs/eggToObj.cxx b/pandatool/src/objprogs/eggToObj.cxx index a3f7a79171..aac15220e9 100644 --- a/pandatool/src/objprogs/eggToObj.cxx +++ b/pandatool/src/objprogs/eggToObj.cxx @@ -12,7 +12,6 @@ */ #include "eggToObj.h" -#include "pystub.h" #include "eggPolygon.h" #include "eggGroupNode.h" #include "dcast.h" @@ -76,9 +75,6 @@ handle_args(ProgramBase::Args &args) { } int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - EggToObj prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/objprogs/objToEgg.cxx b/pandatool/src/objprogs/objToEgg.cxx index db551440ae..9a46aa7166 100644 --- a/pandatool/src/objprogs/objToEgg.cxx +++ b/pandatool/src/objprogs/objToEgg.cxx @@ -14,7 +14,6 @@ #include "objToEgg.h" #include "objToEggConverter.h" -#include "pystub.h" /** * @@ -68,9 +67,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - ObjToEgg prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/pfmprogs/pfmBba.cxx b/pandatool/src/pfmprogs/pfmBba.cxx index cf9d47d2ab..5517e45a63 100644 --- a/pandatool/src/pfmprogs/pfmBba.cxx +++ b/pandatool/src/pfmprogs/pfmBba.cxx @@ -14,7 +14,6 @@ #include "pfmBba.h" #include "config_pfm.h" #include "pfmFile.h" -#include "pystub.h" /** * @@ -136,9 +135,6 @@ handle_args(ProgramBase::Args &args) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - PfmBba prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/pfmprogs/pfmTrans.cxx b/pandatool/src/pfmprogs/pfmTrans.cxx index 02608c60f0..270d6a03af 100644 --- a/pandatool/src/pfmprogs/pfmTrans.cxx +++ b/pandatool/src/pfmprogs/pfmTrans.cxx @@ -15,7 +15,6 @@ #include "config_pfm.h" #include "pfmFile.h" #include "pfmVizzer.h" -#include "pystub.h" #include "texture.h" #include "texturePool.h" #include "pointerTo.h" @@ -504,9 +503,6 @@ dispatch_translate(const string &opt, const string &arg, void *var) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - PfmTrans prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/progbase/test_prog.cxx b/pandatool/src/progbase/test_prog.cxx index 7a4cd02529..5123385cc5 100644 --- a/pandatool/src/progbase/test_prog.cxx +++ b/pandatool/src/progbase/test_prog.cxx @@ -14,7 +14,6 @@ #include "programBase.h" #include "pnotify.h" -#include "pystub.h" class TestProgram : public ProgramBase { public: @@ -59,9 +58,6 @@ TestProgram() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - TestProgram t; t.parse_command_line(argc, argv); diff --git a/pandatool/src/softprogs/softCVS.cxx b/pandatool/src/softprogs/softCVS.cxx index bbc932659a..22329eb8c5 100644 --- a/pandatool/src/softprogs/softCVS.cxx +++ b/pandatool/src/softprogs/softCVS.cxx @@ -15,7 +15,6 @@ #include "pnotify.h" #include "multifile.h" -#include "pystub.h" #include @@ -580,9 +579,6 @@ cvs_add_or_remove(const string &cvs_command, const vector_string &paths) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - SoftCVS prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/text-stats/textStats.cxx b/pandatool/src/text-stats/textStats.cxx index 5b975cb798..2cbf69b4d9 100644 --- a/pandatool/src/text-stats/textStats.cxx +++ b/pandatool/src/text-stats/textStats.cxx @@ -16,7 +16,6 @@ #include "pStatServer.h" #include "config_pstats.h" -#include "pystub.h" #include @@ -99,9 +98,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - TextStats prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/vrmlprogs/vrmlToEgg.cxx b/pandatool/src/vrmlprogs/vrmlToEgg.cxx index 613f55c84b..dee6b5eb39 100644 --- a/pandatool/src/vrmlprogs/vrmlToEgg.cxx +++ b/pandatool/src/vrmlprogs/vrmlToEgg.cxx @@ -14,7 +14,6 @@ #include "vrmlToEgg.h" #include "vrmlToEggConverter.h" -#include "pystub.h" /** * @@ -66,9 +65,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - VRMLToEgg prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/vrmlprogs/vrmlTrans.cxx b/pandatool/src/vrmlprogs/vrmlTrans.cxx index fd485eada0..e03075b0e5 100644 --- a/pandatool/src/vrmlprogs/vrmlTrans.cxx +++ b/pandatool/src/vrmlprogs/vrmlTrans.cxx @@ -13,7 +13,6 @@ #include "vrmlTrans.h" #include "parse_vrml.h" -#include "pystub.h" /** * @@ -88,9 +87,6 @@ handle_args(ProgramBase::Args &args) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - VRMLTrans prog; prog.parse_command_line(argc, argv); prog.run(); diff --git a/pandatool/src/win-stats/winStats.cxx b/pandatool/src/win-stats/winStats.cxx index 2ec39a7e83..e8995edaba 100644 --- a/pandatool/src/win-stats/winStats.cxx +++ b/pandatool/src/win-stats/winStats.cxx @@ -15,7 +15,6 @@ #include "winStatsServer.h" #include "config_pstats.h" -#include "pystub.h" #include diff --git a/pandatool/src/xfileprogs/eggToX.cxx b/pandatool/src/xfileprogs/eggToX.cxx index 37c0fc8658..a677a38176 100644 --- a/pandatool/src/xfileprogs/eggToX.cxx +++ b/pandatool/src/xfileprogs/eggToX.cxx @@ -13,7 +13,6 @@ #include "eggToX.h" #include "config_xfile.h" -#include "pystub.h" /** * @@ -70,9 +69,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - init_libxfile(); EggToX prog; prog.parse_command_line(argc, argv); diff --git a/pandatool/src/xfileprogs/xFileToEgg.cxx b/pandatool/src/xfileprogs/xFileToEgg.cxx index e7026b6642..fd0c90e77a 100644 --- a/pandatool/src/xfileprogs/xFileToEgg.cxx +++ b/pandatool/src/xfileprogs/xFileToEgg.cxx @@ -14,7 +14,6 @@ #include "xFileToEgg.h" #include "xFileToEggConverter.h" #include "config_xfile.h" -#include "pystub.h" /** * @@ -114,9 +113,6 @@ run() { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - init_libxfile(); XFileToEgg prog; prog.parse_command_line(argc, argv); diff --git a/pandatool/src/xfileprogs/xFileTrans.cxx b/pandatool/src/xfileprogs/xFileTrans.cxx index 0c5335055b..afe58b2538 100644 --- a/pandatool/src/xfileprogs/xFileTrans.cxx +++ b/pandatool/src/xfileprogs/xFileTrans.cxx @@ -13,7 +13,6 @@ #include "xFileTrans.h" #include "xFile.h" -#include "pystub.h" /** * @@ -90,9 +89,6 @@ handle_args(ProgramBase::Args &args) { int main(int argc, char *argv[]) { - // A call to pystub() to force libpystub.so to be linked in. - pystub(); - XFileTrans prog; prog.parse_command_line(argc, argv); prog.run(); From 2eba4dea9b170b94bf920eaabb2dc3eb6af1c61e Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 20 Jul 2016 15:59:42 +0200 Subject: [PATCH 023/112] Change handling of unsupported render mode so that behaviour can be shared among renderers --- panda/src/display/standardMunger.I | 10 ----- panda/src/display/standardMunger.cxx | 39 ++++++++---------- panda/src/display/standardMunger.h | 3 -- panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx | 6 ++- panda/src/glstuff/glGeomMunger_src.cxx | 40 ------------------- panda/src/glstuff/glGeomMunger_src.h | 6 --- .../glstuff/glGraphicsStateGuardian_src.cxx | 3 ++ panda/src/gobj/geomEnums.h | 4 ++ panda/src/pgraph/cullableObject.cxx | 36 ++++++++++------- panda/src/pgraph/renderModeAttrib.I | 6 ++- .../tinydisplay/tinyGraphicsStateGuardian.cxx | 3 +- 11 files changed, 55 insertions(+), 101 deletions(-) diff --git a/panda/src/display/standardMunger.I b/panda/src/display/standardMunger.I index 4ebd308de2..e9dd4b43f8 100644 --- a/panda/src/display/standardMunger.I +++ b/panda/src/display/standardMunger.I @@ -18,13 +18,3 @@ INLINE GraphicsStateGuardian *StandardMunger:: get_gsg() const { return (GraphicsStateGuardian *)GeomMunger::get_gsg(); } - -/** - * Returns the render mode active on this munger. Intended for derived - * classes that may have to munge differently depending on render mode. - */ -INLINE RenderModeAttrib::Mode StandardMunger:: -get_render_mode() const { - return (_render_mode != NULL) ? _render_mode->get_mode() - : RenderModeAttrib::M_filled; -} diff --git a/panda/src/display/standardMunger.cxx b/panda/src/display/standardMunger.cxx index 1f88f23c46..b6bc1ada2a 100644 --- a/panda/src/display/standardMunger.cxx +++ b/panda/src/display/standardMunger.cxx @@ -38,9 +38,6 @@ StandardMunger(GraphicsStateGuardianBase *gsg, const RenderState *state, _auto_shader(false), _shader_skinning(false) { - _render_mode = (const RenderModeAttrib *) - state->get_attrib(RenderModeAttrib::get_class_slot()); - if (!get_gsg()->get_runtime_color_scale()) { // We might need to munge the colors. const ColorAttrib *color_attrib; @@ -183,14 +180,14 @@ munge_geom_impl(CPT(Geom) &geom, CPT(GeomVertexData) &vertex_data, // it rather than draw them one by one. if ((unsupported_bits & Geom::GR_composite_bits) != 0 || (unsupported_bits & Geom::GR_strip_cut_index) != 0) { -/* - * This decomposes everything in the primitive, so that if (for instance) the - * primitive contained both strips and fans, but the GSG didn't support fans, - * it would decompose the strips too. To handle this correctly, we'd need a - * separate decompose_fans() and decompose_strips() call; but for now, we'll - * just say it's good enough. In practice, we don't have any GSG's that can - * support strips without also supporting fans. - */ + + // This decomposes everything in the primitive, so that if (for + // instance) the primitive contained both strips and fans, but the GSG + // didn't support fans, it would decompose the strips too. To handle + // this correctly, we'd need a separate decompose_fans() and + // decompose_strips() call; but for now, we'll just say it's good + // enough. In practice, we don't have any GSG's that can support strips + // without also supporting fans. geom = geom->decompose(); // Decomposing might produce an indexed Geom, so re-check the @@ -228,14 +225,14 @@ premunge_geom_impl(CPT(Geom) &geom, CPT(GeomVertexData) &vertex_data) { // it rather than draw them one by one. if ((unsupported_bits & Geom::GR_composite_bits) != 0 || (unsupported_bits & Geom::GR_strip_cut_index) != 0) { -/* - * This decomposes everything in the primitive, so that if (for instance) the - * primitive contained both strips and fans, but the GSG didn't support fans, - * it would decompose the strips too. To handle this correctly, we'd need a - * separate decompose_fans() and decompose_strips() call; but for now, we'll - * just say it's good enough. In practice, we don't have any GSG's that can - * support strips without also supporting fans. - */ + + // This decomposes everything in the primitive, so that if (for + // instance) the primitive contained both strips and fans, but the GSG + // didn't support fans, it would decompose the strips too. To handle + // this correctly, we'd need a separate decompose_fans() and + // decompose_strips() call; but for now, we'll just say it's good + // enough. In practice, we don't have any GSG's that can support strips + // without also supporting fans. geom = geom->decompose(); // Decomposing might produce an indexed Geom, so re-check the @@ -267,10 +264,6 @@ int StandardMunger:: compare_to_impl(const GeomMunger *other) const { const StandardMunger *om = (const StandardMunger *)other; - if (_render_mode != om->_render_mode) { - return _render_mode < om->_render_mode ? -1 : 1; - } - if (_munge_color != om->_munge_color) { return (int)_munge_color - (int)om->_munge_color; } diff --git a/panda/src/display/standardMunger.h b/panda/src/display/standardMunger.h index 6a6dd9e675..05e8ee0344 100644 --- a/panda/src/display/standardMunger.h +++ b/panda/src/display/standardMunger.h @@ -46,13 +46,10 @@ protected: virtual int geom_compare_to_impl(const GeomMunger *other) const; virtual CPT(RenderState) munge_state_impl(const RenderState *state); - INLINE RenderModeAttrib::Mode get_render_mode() const; - private: int _num_components; NumericType _numeric_type; Contents _contents; - CPT(RenderModeAttrib) _render_mode; bool _munge_color; bool _munge_color_scale; diff --git a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx index 6e37ee6849..4b5efc2b8c 100644 --- a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx +++ b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx @@ -2209,7 +2209,8 @@ reset() { Geom::GR_point_perspective | Geom::GR_point_sprite | Geom::GR_indexed_other | Geom::GR_triangle_strip | Geom::GR_triangle_fan | - Geom::GR_flat_first_vertex; + Geom::GR_flat_first_vertex | + Geom::GR_render_mode_wireframe | Geom::GR_render_mode_point; // overwrite gsg defaults with these values @@ -2844,7 +2845,8 @@ do_issue_shader() { */ void DXGraphicsStateGuardian9:: do_issue_render_mode() { - const RenderModeAttrib *target_render_mode = DCAST(RenderModeAttrib, _target_rs->get_attrib_def(RenderModeAttrib::get_class_slot())); + const RenderModeAttrib *target_render_mode; + _target_rs->get_attrib_def(target_render_mode); RenderModeAttrib::Mode mode = target_render_mode->get_mode(); switch (mode) { diff --git a/panda/src/glstuff/glGeomMunger_src.cxx b/panda/src/glstuff/glGeomMunger_src.cxx index e9a98e82fc..b26f2bbb10 100644 --- a/panda/src/glstuff/glGeomMunger_src.cxx +++ b/panda/src/glstuff/glGeomMunger_src.cxx @@ -409,41 +409,6 @@ premunge_format_impl(const GeomVertexFormat *orig) { return format; } -#ifdef OPENGLES -/** - * Converts a Geom and/or its data as necessary. - */ -void CLP(GeomMunger):: -munge_geom_impl(CPT(Geom) &geom, CPT(GeomVertexData) &vertex_data, - Thread *current_thread) { - StandardMunger::munge_geom_impl(geom, vertex_data, current_thread); - - // OpenGL ES has no polygon mode, so we have to emulate it. - RenderModeAttrib::Mode render_mode = get_render_mode(); - if (render_mode == RenderModeAttrib::M_point) { - geom = geom->make_points(); - } else if (render_mode == RenderModeAttrib::M_wireframe) { - geom = geom->make_lines(); - } -} - -/** - * Converts a Geom and/or its data as necessary. - */ -void CLP(GeomMunger):: -premunge_geom_impl(CPT(Geom) &geom, CPT(GeomVertexData) &vertex_data) { - StandardMunger::premunge_geom_impl(geom, vertex_data); - - // OpenGL ES has no polygon mode, so we have to emulate it. - RenderModeAttrib::Mode render_mode = get_render_mode(); - if (render_mode == RenderModeAttrib::M_point) { - geom = geom->make_points(); - } else if (render_mode == RenderModeAttrib::M_wireframe) { - geom = geom->make_lines(); - } -} -#endif // OPENGLES - /** * Called to compare two GeomMungers who are known to be of the same type, for * an apples-to-apples comparison. This will never be called on two pointers @@ -473,11 +438,6 @@ compare_to_impl(const GeomMunger *other) const { int CLP(GeomMunger):: geom_compare_to_impl(const GeomMunger *other) const { const CLP(GeomMunger) *om = (CLP(GeomMunger) *)other; -#ifdef OPENGLES - if (get_render_mode() != om->get_render_mode()) { - return get_render_mode() < om->get_render_mode() ? -1 : 1; - } -#endif if (_texture != om->_texture) { return _texture < om->_texture ? -1 : 1; } diff --git a/panda/src/glstuff/glGeomMunger_src.h b/panda/src/glstuff/glGeomMunger_src.h index 5122dda25f..a3eae7c8b4 100644 --- a/panda/src/glstuff/glGeomMunger_src.h +++ b/panda/src/glstuff/glGeomMunger_src.h @@ -40,12 +40,6 @@ protected: const GeomVertexAnimationSpec &animation); virtual CPT(GeomVertexFormat) premunge_format_impl(const GeomVertexFormat *orig); -#ifdef OPENGLES - virtual void munge_geom_impl(CPT(Geom) &geom, CPT(GeomVertexData) &data, - Thread *current_thread); - virtual void premunge_geom_impl(CPT(Geom) &geom, CPT(GeomVertexData) &data); -#endif - virtual int compare_to_impl(const GeomMunger *other) const; virtual int geom_compare_to_impl(const GeomMunger *other) const; diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index ee24b407d4..0b36265eb6 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -628,6 +628,9 @@ reset() { } _supported_geom_rendering = +#ifndef OPENGLES + Geom::GR_render_mode_wireframe | Geom::GR_render_mode_point | +#endif Geom::GR_indexed_point | Geom::GR_point | Geom::GR_point_uniform_size | Geom::GR_indexed_other | diff --git a/panda/src/gobj/geomEnums.h b/panda/src/gobj/geomEnums.h index 42af6bb0f1..7d55a797a1 100644 --- a/panda/src/gobj/geomEnums.h +++ b/panda/src/gobj/geomEnums.h @@ -128,6 +128,10 @@ PUBLISHED: // The union of the above shade model types. GR_shade_model_bits = 0x06000, + + // If a particular non-fill polygon mode is used. + GR_render_mode_wireframe= 0x40000, + GR_render_mode_point = 0x80000, }; // The shade model specifies whether the per-vertex colors and normals diff --git a/panda/src/pgraph/cullableObject.cxx b/panda/src/pgraph/cullableObject.cxx index 33503de0eb..0bd7a0fe5f 100644 --- a/panda/src/pgraph/cullableObject.cxx +++ b/panda/src/pgraph/cullableObject.cxx @@ -59,7 +59,20 @@ munge_geom(GraphicsStateGuardianBase *gsg, if (_geom != (Geom *)NULL) { _munger = munger; + GraphicsStateGuardianBase *gsg = traverser->get_gsg(); + int gsg_bits = gsg->get_supported_geom_rendering(); + if (!hardware_point_sprites) { + // If support for hardware point sprites or perspective-scaled points is + // disabled, we don't allow the GSG to tell us it supports them. + gsg_bits &= ~(Geom::GR_point_perspective | Geom::GR_point_sprite); + } + if (!hardware_points) { + // If hardware-points is off, we don't allow any kind of point + // rendering, except plain old one-pixel points; + gsg_bits &= ~(Geom::GR_point_bits & ~Geom::GR_point); + } int geom_rendering; + int unsupported_bits; { GeomPipelineReader geom_reader(_geom, current_thread); @@ -76,31 +89,24 @@ munge_geom(GraphicsStateGuardianBase *gsg, geom_rendering = geom_reader.get_geom_rendering(); geom_rendering = _state->get_geom_rendering(geom_rendering); geom_rendering = _internal_transform->get_geom_rendering(geom_rendering); + unsupported_bits = geom_rendering & ~gsg_bits; if (geom_rendering & Geom::GR_point_bits) { if (geom_reader.get_primitive_type() != Geom::PT_points) { - if (singular_points) { + if (singular_points || + (unsupported_bits & Geom::GR_render_mode_point) != 0) { // Isolate the points so there's no unneeded overlap. _geom = _geom->make_points(); } } } + if (unsupported_bits & Geom::GR_render_mode_wireframe) { + if (geom_reader.get_primitive_type() != Geom::PT_lines) { + _geom = _geom->make_lines(); + } + } } - GraphicsStateGuardianBase *gsg = traverser->get_gsg(); - int gsg_bits = gsg->get_supported_geom_rendering(); - if (!hardware_point_sprites) { - // If support for hardware point sprites or perspective-scaled points is - // disabled, we don't allow the GSG to tell us it supports them. - gsg_bits &= ~(Geom::GR_point_perspective | Geom::GR_point_sprite); - } - if (!hardware_points) { - // If hardware-points is off, we don't allow any kind of point - // rendering, except plain old one-pixel points; - gsg_bits &= ~(Geom::GR_point_bits & ~Geom::GR_point); - } - int unsupported_bits = geom_rendering & ~gsg_bits; - if ((unsupported_bits & Geom::GR_point_bits) != 0) { // The GSG doesn't support rendering these fancy points directly; we // have to render them in software instead. Munge them into quads. diff --git a/panda/src/pgraph/renderModeAttrib.I b/panda/src/pgraph/renderModeAttrib.I index 5c42e42f53..8034b5cbc3 100644 --- a/panda/src/pgraph/renderModeAttrib.I +++ b/panda/src/pgraph/renderModeAttrib.I @@ -71,8 +71,12 @@ get_wireframe_color() const { INLINE int RenderModeAttrib:: get_geom_rendering(int geom_rendering) const { if (_mode == M_point) { - geom_rendering |= Geom::GR_point; + geom_rendering |= Geom::GR_point | Geom::GR_render_mode_point; + + } else if (_mode == M_wireframe) { + geom_rendering |= Geom::GR_render_mode_wireframe; } + if ((geom_rendering & Geom::GR_point) != 0) { if (_perspective) { geom_rendering |= (Geom::GR_point_perspective | Geom::GR_point_uniform_size); diff --git a/panda/src/tinydisplay/tinyGraphicsStateGuardian.cxx b/panda/src/tinydisplay/tinyGraphicsStateGuardian.cxx index 9e37c67037..7f8296a7a2 100644 --- a/panda/src/tinydisplay/tinyGraphicsStateGuardian.cxx +++ b/panda/src/tinydisplay/tinyGraphicsStateGuardian.cxx @@ -114,7 +114,8 @@ reset() { Geom::GR_point | Geom::GR_indexed_other | Geom::GR_triangle_strip | - Geom::GR_flat_last_vertex; + Geom::GR_flat_last_vertex | + Geom::GR_render_mode_wireframe | Geom::GR_render_mode_point; _max_texture_dimension = (1 << ZB_POINT_ST_FRAC_BITS); _max_texture_stages = MAX_TEXTURE_STAGES; From 47f999fdec677f3f88247e4cba32492708497774 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 20 Jul 2016 16:00:34 +0200 Subject: [PATCH 024/112] Improve GLSL preprocessor; support GL_GOOGLE_include_directive --- panda/src/gobj/shader.cxx | 287 +++++++++++++++++++++++++++++++------- 1 file changed, 233 insertions(+), 54 deletions(-) diff --git a/panda/src/gobj/shader.cxx b/panda/src/gobj/shader.cxx index 85c0e32658..6152b5ebdc 100644 --- a/panda/src/gobj/shader.cxx +++ b/panda/src/gobj/shader.cxx @@ -2385,7 +2385,7 @@ do_read_source(string &into, const Filename &fn, BamCacheRecord *record) { /** * Loads a given GLSL file line by line, and processes any #pragma include and - * once statements. + * once statements, as well as removes any comments. * * The set keeps track of which files we have already included, for checking * recursive includes. @@ -2398,7 +2398,8 @@ r_preprocess_source(ostream &out, const Filename &fn, if (depth > glsl_include_recursion_limit) { shader_cat.error() - << "#pragma include nested too deeply\n"; + << "GLSL includes nested too deeply, raise glsl-include-recursion-limit" + " if necessary\n"; return false; } @@ -2459,56 +2460,226 @@ r_preprocess_source(ostream &out, const Filename &fn, // Iterate over the lines for things we may need to preprocess. string line; + int ext_google_include = 0; // 1 = warn, 2 = enable + int ext_google_line = 0; bool had_include = false; int lineno = 0; while (getline(*source, line)) { ++lineno; - // Check if this line contains a #pragma. - char pragma[64]; - if (line.size() < 8 || - sscanf(line.c_str(), " # pragma %63s", pragma) != 1) { - // Just pass the line through unmodified. - out << line << "\n"; - - // One exception: check for an #endif after an include. We have to - // restore the line number in case the include happened under an #if - // block. - int nread = 0; - if (had_include && sscanf(line.c_str(), " # endif %n", &nread) == 0 && nread >= 6) { - out << "#line " << (lineno + 1) << " " << fileno << "\n"; - } + if (line.empty()) { + out.put('\n'); continue; } - int nread = 0; - if (strcmp(pragma, "include") == 0) { - // Allow both double quotes and angle brackets. - Filename incfn, source_dir; - { - char incfile[2048]; - if (sscanf(line.c_str(), " # pragma%*[ \t]include \"%2047[^\"]\" %n", incfile, &nread) == 1 - && nread == line.size()) { - // A regular include, with double quotes. Probably a local file. - source_dir = full_fn.get_dirname(); - incfn = incfile; + // If the line ends with a backslash, concatenate the following line. + // Preprocessor definitions may be broken up into multiple lines. + while (line[line.size() - 1] == '\\') { + line.resize(line.size() - 1); + string line2; - } else if (sscanf(line.c_str(), " # pragma%*[ \t]include <%2047[^\"]> %n", incfile, &nread) == 1 - && nread == line.size()) { - // Angled includes are also OK, but we don't search in the directory - // of the source file. - incfn = incfile; + if (getline(*source, line2)) { + line += line2; + out.put('\n'); + ++lineno; + } else { + break; + } + } + // Look for comments to strip. This is necessary because comments may + // appear in the middle of or around a preprocessor definition. + size_t line_comment = line.find("//"); + size_t block_comment = line.find("/*"); + if (line_comment < block_comment) { + // A line comment - strip off the rest of the line. + line.resize(line_comment); + + } else if (block_comment < line_comment) { + // A block comment. Search for closing block. + string line2 = line.substr(block_comment + 2); + + // According to the GLSL specification, a block comment is replaced with + // a single whitespace character. + line.resize(block_comment); + line += ' '; + + size_t block_end = line2.find("*/"); + while (block_end == string::npos) { + // Didn't find it - look in the next line. + if (getline(*source, line2)) { + out.put('\n'); + ++lineno; + block_end = line2.find("*/"); } else { - // Couldn't parse it. shader_cat.error() - << "Malformed #pragma include at line " << lineno - << " of file " << fn << ":\n " << line << "\n"; + << "Expected */ before end of file " << fn << "\n"; return false; } } + line += line2.substr(block_end + 2); + } + + // Check if this line contains a #directive. + char directive[64]; + if (line.size() < 8 || sscanf(line.c_str(), " # %63s", directive) != 1) { + // Nope. Just pass the line through unmodified. + out << line << "\n"; + continue; + } + + char pragma[64]; + int nread = 0; + // What kind of directive is it? + if (strcmp(directive, "pragma") == 0 && + sscanf(line.c_str(), " # pragma %63s", pragma) == 1) { + if (strcmp(pragma, "include") == 0) { + // Allow both double quotes and angle brackets. + Filename incfn, source_dir; + { + char incfile[2048]; + if (sscanf(line.c_str(), " # pragma%*[ \t]include \"%2047[^\"]\" %n", incfile, &nread) == 1 + && nread == line.size()) { + // A regular include, with double quotes. Probably a local file. + source_dir = full_fn.get_dirname(); + incfn = incfile; + + } else if (sscanf(line.c_str(), " # pragma%*[ \t]include <%2047[^\"]> %n", incfile, &nread) == 1 + && nread == line.size()) { + // Angled includes are also OK, but we don't search in the directory + // of the source file. + incfn = incfile; + + } else { + // Couldn't parse it. + shader_cat.error() + << "Malformed #pragma include at line " << lineno + << " of file " << fn << ":\n " << line << "\n"; + return false; + } + } + + // OK, great. Process the include. + if (!r_preprocess_source(out, incfn, source_dir, once_files, record, depth + 1)) { + // An error occurred. Pass on the failure. + shader_cat.error(false) << "included at line " + << lineno << " of file " << fn << ":\n " << line << "\n"; + return false; + } + + // Restore the line counter. + out << "#line " << (lineno + 1) << " " << fileno << " // " << fn << "\n"; + had_include = true; + + } else if (strcmp(pragma, "once") == 0) { + // Do a stricter syntax check, just to be extra safe. + if (sscanf(line.c_str(), " # pragma%*[ \t]once %n", &nread) != 0 || + nread != line.size()) { + shader_cat.error() + << "Malformed #pragma once at line " << lineno + << " of file " << fn << ":\n " << line << "\n"; + return false; + } + + once_files.insert(full_fn); + + } else { + // Forward it, the driver will ignore it if it doesn't know it. + out << line << "\n"; + } + + } else if (strcmp(directive, "endif") == 0) { + // Check for an #endif after an include. We have to restore the line + // number in case the include happened under an #if block. + out << line << "\n"; + int nread = 0; + if (had_include) { + out << "#line " << (lineno + 1) << " " << fileno << "\n"; + } + + } else if (strcmp(directive, "extension") == 0) { + // Check for special preprocessing extensions. + char extension[256]; + char behavior[9]; + if (sscanf(line.c_str(), " # extension%*[ \t]%255s : %8s", extension, behavior) == 2) { + // Parse the behavior string. + int mode; + if (strcmp(behavior, "require") == 0 || strcmp(behavior, "enable") == 0) { + mode = 2; + } else if (strcmp(behavior, "warn") == 0) { + mode = 1; + } else if (strcmp(behavior, "disable") == 0) { + mode = 0; + } else { + shader_cat.error() + << "Extension directive specifies invalid behavior at line " + << lineno << " of file " << fn << ":\n " << line << "\n"; + return false; + } + + if (strcmp(extension, "all") == 0) { + if (mode == 2) { + shader_cat.error() + << "Extension directive for 'all' may only specify 'warn' or " + "'disable' at line " << lineno << " of file " << fn + << ":\n " << line << "\n"; + return false; + } + ext_google_include = mode; + ext_google_line = mode; + out << line << "\n"; + + } else if (strcmp(extension, "GL_GOOGLE_include_directive") == 0) { + // Enable the Google extension support for #include statements. + // This also implicitly enables GL_GOOGLE_cpp_style_line_directive. + // This matches the behavior of Khronos' glslang reference compiler. + ext_google_include = mode; + ext_google_line = mode; + + } else if (strcmp(extension, "GL_GOOGLE_cpp_style_line_directive") == 0) { + // Enables strings in #line statements. + ext_google_line = mode; + + } else { + // It's an extension the driver should worry about. + out << line << "\n"; + } + } else { + shader_cat.error() + << "Failed to parse extension directive at line " + << lineno << " of file " << fn << ":\n " << line << "\n"; + return false; + } + } else if (ext_google_include > 0 && strcmp(directive, "include") == 0) { + // Warn about extension use if requested. + if (ext_google_include == 1) { + shader_cat.warning() + << "Extension GL_GOOGLE_include_directive is being used at line " + << lineno << " of file " << fn +#ifndef NDEBUG + << ":\n " << line +#endif + << "\n"; + } + + // This syntax allows only double quotes, not angle brackets. + Filename incfn; + { + char incfile[2048]; + if (sscanf(line.c_str(), " # include%*[ \t]\"%2047[^\"]\" %n", incfile, &nread) != 1 + || nread != line.size()) { + // Couldn't parse it. + shader_cat.error() + << "Malformed #include at line " << lineno + << " of file " << fn << ":\n " << line << "\n"; + return false; + } + incfn = incfile; + } + // OK, great. Process the include. + Filename source_dir = full_fn.get_dirname(); if (!r_preprocess_source(out, incfn, source_dir, once_files, record, depth + 1)) { // An error occurred. Pass on the failure. shader_cat.error(false) << "included at line " @@ -2520,28 +2691,36 @@ r_preprocess_source(ostream &out, const Filename &fn, out << "#line " << (lineno + 1) << " " << fileno << " // " << fn << "\n"; had_include = true; - } else if (strcmp(pragma, "once") == 0) { - // Do a stricter syntax check, just to be extra safe. - if (sscanf(line.c_str(), " # pragma%*[ \t]once %n", &nread) != 0 || - nread != line.size()) { - shader_cat.error() - << "Malformed #pragma once at line " << lineno - << " of file " << fn << ":\n " << line << "\n"; - return false; + } else if (ext_google_line > 0 && strcmp(directive, "line") == 0) { + // It's a #line directive. See if it uses a string instead of number. + char filestr[2048]; + if (sscanf(line.c_str(), " # line%*[ \t]%d%*[ \t]\"%2047[^\"]\" %n", &lineno, filestr, &nread) == 2 + && nread == line.size()) { + // Warn about extension use if requested. + if (ext_google_line == 1) { + shader_cat.warning() + << "Extension GL_GOOGLE_cpp_style_line_directive is being used at line " + << lineno << " of file " << fn +#ifndef NDEBUG + << ":\n " << line +#endif + << "\n"; + } + + // Replace the string line number with an integer. This is something + // we can substitute later when parsing the GLSL log from the driver. + fileno = 2048 + _included_files.size(); + _included_files.push_back(Filename(filestr)); + + out << "#line " << lineno << " " << fileno << " // " << filestr << "\n"; + + } else { + // We couldn't parse the #line directive. Pass it through unmodified. + out << line << "\n"; } - - once_files.insert(full_fn); - - } else if (strcmp(pragma, "optionNV") == 0) { - // This is processed by NVIDIA drivers. Don't touch it. - out << line << "\n"; - } else { - // Forward it, the driver will ignore it if it doesn't know it. + // Different directive (eg. #version). Leave it untouched. out << line << "\n"; - shader_cat.warning() - << "Ignoring unknown pragma directive \"" << pragma << "\" at line " - << lineno << " of file " << fn << ":\n " << line << "\n"; } } From 800d3cd9c97e628020880703e493d232b7f10efc Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 20 Jul 2016 18:46:30 -0400 Subject: [PATCH 025/112] Fix Python compile issues on Mac; don't use framework --- makepanda/makepanda.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 2aecf0dd0a..28a38dfc66 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -827,10 +827,7 @@ if (COMPILER=="GCC"): SmartPkgEnable("ROCKET", "", rocket_libs, "Rocket/Core.h") if not PkgSkip("PYTHON"): - if GetTarget() == "darwin" and not RTDIST and not PkgHasCustomLocation("PYTHON"): - LibName("PYTHON", "-framework Python") - else: - SmartPkgEnable("PYTHON", "", SDK["PYTHONVERSION"], (SDK["PYTHONVERSION"], SDK["PYTHONVERSION"] + "/Python.h"), tool = SDK["PYTHONVERSION"] + "-config") + SmartPkgEnable("PYTHON", "", SDK["PYTHONVERSION"], (SDK["PYTHONVERSION"], SDK["PYTHONVERSION"] + "/Python.h"), tool = SDK["PYTHONVERSION"] + "-config") SmartPkgEnable("OPENSSL", "openssl", ("ssl", "crypto"), ("openssl/ssl.h", "openssl/crypto.h")) SmartPkgEnable("ZLIB", "zlib", ("z"), "zlib.h") @@ -4096,7 +4093,7 @@ if (PkgSkip("VISION") == 0) and (not RUNTIME): # if (PkgSkip("ROCKET") == 0) and (not RUNTIME): - OPTS=['DIR:panda/src/rocket', 'BUILDING:ROCKET', 'ROCKET'] + OPTS=['DIR:panda/src/rocket', 'BUILDING:ROCKET', 'ROCKET', 'PYTHON'] TargetAdd('p3rocket_composite1.obj', opts=OPTS, input='p3rocket_composite1.cxx') TargetAdd('libp3rocket.dll', input='p3rocket_composite1.obj') From fbb3bac5a2d03ac9a6a98c881909b2f2d8daf800 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 28 Jul 2016 12:54:53 +0200 Subject: [PATCH 026/112] Update .gitignore --- .gitignore | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/.gitignore b/.gitignore index e198328787..8f3af151c7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,47 @@ +# makepanda directories /built*/ /thirdparty/ /targetroot/ /dstroot/ + +# Core dumps core core.* vgcore.* + +# Editor files/directories *.save *.save.1 +*.sublime-workspace +.vscode/ + +# Temporary build files +/_vfsimporter.* +*.pdb +*.obj +*.o +*.gch +*.pch + +# Produced installer/executables +/*.exe +/*.deb +/*.rpm +/*.app +/*.pkg +/*.dmg +/*.whl + +# CMake +/build/ +CMakeCache.txt +CMakeFiles/ +CMakeScripts/ +Makefile +cmake_install.cmake +install_manifest.txt +CTestTestfile.cmake + +# Windows +Thumbs.db +ehthumbs.db From 1d2e17932c7b72f1da774ff6fdd83763d7433866 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 30 Jul 2016 12:59:42 +0200 Subject: [PATCH 027/112] Don't require spaces around : in #extension directive --- panda/src/gobj/shader.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/gobj/shader.cxx b/panda/src/gobj/shader.cxx index 6152b5ebdc..d9cf151e83 100644 --- a/panda/src/gobj/shader.cxx +++ b/panda/src/gobj/shader.cxx @@ -2602,7 +2602,7 @@ r_preprocess_source(ostream &out, const Filename &fn, // Check for special preprocessing extensions. char extension[256]; char behavior[9]; - if (sscanf(line.c_str(), " # extension%*[ \t]%255s : %8s", extension, behavior) == 2) { + if (sscanf(line.c_str(), " # extension%*[ \t]%255s%*[ \t]:%*[ \t]%8s", extension, behavior) == 2) { // Parse the behavior string. int mode; if (strcmp(behavior, "require") == 0 || strcmp(behavior, "enable") == 0) { From db977479813d0e524f36613f44cf49038dbf4bcc Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 9 Aug 2016 01:19:35 +0200 Subject: [PATCH 028/112] cppparser: Parse nonstandard specifier order like "const static" --- doc/ReleaseNotes | 1 + dtool/src/cppparser/cppBison.cxx.prebuilt | 7567 ++++++++++----------- dtool/src/cppparser/cppBison.h.prebuilt | 261 +- dtool/src/cppparser/cppBison.yxx | 112 +- dtool/src/cppparser/cppInstance.h | 4 + 5 files changed, 3703 insertions(+), 4242 deletions(-) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index 94ebbe4e9e..ad90def34b 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -27,6 +27,7 @@ This issue fixes several bugs that were still found in 1.9.2. * Support uint8 index buffers in DX9 * Fix occasional frame lag when loading a big model asynchronously * Fix race condition reading string config var +* Fix interrogate parsing issue with "const static" ------------------------ RELEASE 1.9.2 ------------------------ diff --git a/dtool/src/cppparser/cppBison.cxx.prebuilt b/dtool/src/cppparser/cppBison.cxx.prebuilt index 3eb1fb147d..8a02d61218 100644 --- a/dtool/src/cppparser/cppBison.cxx.prebuilt +++ b/dtool/src/cppparser/cppBison.cxx.prebuilt @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 2.7. */ +/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2015 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 the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,7 +26,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.7" +#define YYBISON_VERSION "3.0.4" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -63,15 +63,12 @@ #define yyparse cppyyparse #define yylex cppyylex #define yyerror cppyyerror -#define yylval cppyylval -#define yychar cppyychar #define yydebug cppyydebug #define yynerrs cppyynerrs -#define yylloc cppyylloc + /* Copy the first part of user declarations. */ -/* Line 371 of yacc.c */ -#line 6 "dtool/src/cppparser/cppBison.yxx" +#line 6 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:339 */ #include "cppBisonDefs.h" @@ -260,14 +257,13 @@ pop_struct() { } -/* Line 371 of yacc.c */ -#line 265 "built/tmp/cppBison.yxx.c" +#line 261 "built/tmp/cppBison.yxx.c" /* yacc.c:339 */ -# ifndef YY_NULL +# ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr +# define YY_NULLPTR nullptr # else -# define YY_NULL 0 +# define YY_NULLPTR 0 # endif # endif @@ -283,7 +279,7 @@ pop_struct() { 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. */ +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif @@ -291,117 +287,116 @@ pop_struct() { extern int cppyydebug; #endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - REAL = 258, - INTEGER = 259, - CHAR_TOK = 260, - STRING = 261, - SIMPLE_IDENTIFIER = 262, - IDENTIFIER = 263, - TYPENAME_IDENTIFIER = 264, - SCOPING = 265, - TYPEDEFNAME = 266, - ELLIPSIS = 267, - OROR = 268, - ANDAND = 269, - EQCOMPARE = 270, - NECOMPARE = 271, - LECOMPARE = 272, - GECOMPARE = 273, - LSHIFT = 274, - RSHIFT = 275, - POINTSAT_STAR = 276, - DOT_STAR = 277, - UNARY = 278, - UNARY_NOT = 279, - UNARY_NEGATE = 280, - UNARY_MINUS = 281, - UNARY_STAR = 282, - UNARY_REF = 283, - POINTSAT = 284, - SCOPE = 285, - PLUSPLUS = 286, - MINUSMINUS = 287, - TIMESEQUAL = 288, - DIVIDEEQUAL = 289, - MODEQUAL = 290, - PLUSEQUAL = 291, - MINUSEQUAL = 292, - OREQUAL = 293, - ANDEQUAL = 294, - XOREQUAL = 295, - LSHIFTEQUAL = 296, - RSHIFTEQUAL = 297, - KW_BEGIN_PUBLISH = 298, - KW_BLOCKING = 299, - KW_BOOL = 300, - KW_CATCH = 301, - KW_CHAR = 302, - KW_CHAR16_T = 303, - KW_CHAR32_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_MAKE_PROPERTY = 327, - KW_MAKE_SEQ = 328, - KW_MUTABLE = 329, - KW_NAMESPACE = 330, - KW_NEW = 331, - KW_NOEXCEPT = 332, - KW_OPERATOR = 333, - KW_PRIVATE = 334, - KW_PROTECTED = 335, - KW_PUBLIC = 336, - KW_REGISTER = 337, - KW_RETURN = 338, - KW_SHORT = 339, - KW_SIGNED = 340, - KW_SIZEOF = 341, - KW_STATIC = 342, - KW_STATIC_CAST = 343, - KW_STRUCT = 344, - KW_TEMPLATE = 345, - KW_THROW = 346, - KW_TRUE = 347, - KW_TRY = 348, - KW_TYPEDEF = 349, - KW_TYPENAME = 350, - KW_UNION = 351, - KW_UNSIGNED = 352, - KW_USING = 353, - KW_VIRTUAL = 354, - KW_VOID = 355, - KW_VOLATILE = 356, - KW_WCHAR_T = 357, - KW_WHILE = 358, - START_CPP = 359, - START_CONST_EXPR = 360, - START_TYPE = 361 - }; + enum yytokentype + { + REAL = 258, + INTEGER = 259, + CHAR_TOK = 260, + STRING = 261, + SIMPLE_IDENTIFIER = 262, + IDENTIFIER = 263, + TYPENAME_IDENTIFIER = 264, + SCOPING = 265, + TYPEDEFNAME = 266, + ELLIPSIS = 267, + OROR = 268, + ANDAND = 269, + EQCOMPARE = 270, + NECOMPARE = 271, + LECOMPARE = 272, + GECOMPARE = 273, + LSHIFT = 274, + RSHIFT = 275, + POINTSAT_STAR = 276, + DOT_STAR = 277, + UNARY = 278, + UNARY_NOT = 279, + UNARY_NEGATE = 280, + UNARY_MINUS = 281, + UNARY_STAR = 282, + UNARY_REF = 283, + POINTSAT = 284, + SCOPE = 285, + PLUSPLUS = 286, + MINUSMINUS = 287, + TIMESEQUAL = 288, + DIVIDEEQUAL = 289, + MODEQUAL = 290, + PLUSEQUAL = 291, + MINUSEQUAL = 292, + OREQUAL = 293, + ANDEQUAL = 294, + XOREQUAL = 295, + LSHIFTEQUAL = 296, + RSHIFTEQUAL = 297, + KW_BEGIN_PUBLISH = 298, + KW_BLOCKING = 299, + KW_BOOL = 300, + KW_CATCH = 301, + KW_CHAR = 302, + KW_CHAR16_T = 303, + KW_CHAR32_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_MAKE_PROPERTY = 327, + KW_MAKE_SEQ = 328, + KW_MUTABLE = 329, + KW_NAMESPACE = 330, + KW_NEW = 331, + KW_NOEXCEPT = 332, + KW_OPERATOR = 333, + KW_PRIVATE = 334, + KW_PROTECTED = 335, + KW_PUBLIC = 336, + KW_REGISTER = 337, + KW_RETURN = 338, + KW_SHORT = 339, + KW_SIGNED = 340, + KW_SIZEOF = 341, + KW_STATIC = 342, + KW_STATIC_CAST = 343, + KW_STRUCT = 344, + KW_TEMPLATE = 345, + KW_THROW = 346, + KW_TRUE = 347, + KW_TRY = 348, + KW_TYPEDEF = 349, + KW_TYPENAME = 350, + KW_UNION = 351, + KW_UNSIGNED = 352, + KW_USING = 353, + KW_VIRTUAL = 354, + KW_VOID = 355, + KW_VOLATILE = 356, + KW_WCHAR_T = 357, + KW_WHILE = 358, + START_CPP = 359, + START_CONST_EXPR = 360, + START_TYPE = 361 + }; #endif /* Tokens. */ #define REAL 258 @@ -509,48 +504,31 @@ extern int cppyydebug; #define START_CONST_EXPR 360 #define START_TYPE 361 +/* Value type. */ - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED - -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -#endif - +/* Location type. */ #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED -typedef struct YYLTYPE +typedef struct YYLTYPE YYLTYPE; +struct YYLTYPE { int first_line; int first_column; int last_line; int last_column; -} YYLTYPE; -# define yyltype YYLTYPE /* obsolescent; will be withdrawn */ +}; # define YYLTYPE_IS_DECLARED 1 # define YYLTYPE_IS_TRIVIAL 1 #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 390 of yacc.c */ -#line 554 "built/tmp/cppBison.yxx.c" +#line 532 "built/tmp/cppBison.yxx.c" /* yacc.c:358 */ #ifdef short # undef short @@ -564,11 +542,8 @@ typedef unsigned char yytype_uint8; #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; #else -typedef short int yytype_int8; +typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 @@ -588,8 +563,7 @@ typedef short int yytype_int16; # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else @@ -611,6 +585,33 @@ typedef short int yytype_int16; # endif #endif +#ifndef YY_ATTRIBUTE +# if (defined __GNUC__ \ + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +# else +# define YY_ATTRIBUTE(Spec) /* empty */ +# endif +#endif + +#ifndef YY_ATTRIBUTE_PURE +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +#endif + +#if !defined _Noreturn \ + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +# if defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) +# endif +#endif + /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) @@ -618,23 +619,25 @@ typedef short int yytype_int16; # define YYUSE(E) /* empty */ #endif -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(N) (N) +#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 -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) -#else -static int -YYID (yyi) - int yyi; +# define YY_INITIAL_VALUE(Value) Value #endif -{ - return yyi; -} +#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 + #if ! defined yyoverflow || YYERROR_VERBOSE @@ -653,8 +656,7 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS @@ -666,8 +668,8 @@ YYID (yyi) # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely @@ -683,7 +685,7 @@ YYID (yyi) # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 @@ -691,15 +693,13 @@ YYID (yyi) # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif @@ -709,8 +709,8 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ - || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ - && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ + && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc @@ -736,16 +736,16 @@ union yyalloc elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) #endif @@ -764,7 +764,7 @@ union yyalloc for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ - while (YYID (0)) + while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ @@ -772,25 +772,27 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 73 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 3646 +#define YYLAST 3624 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 131 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 93 +#define YYNNTS 88 /* YYNRULES -- Number of rules. */ -#define YYNRULES 550 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 995 +#define YYNRULES 542 +/* YYNSTATES -- Number of states. */ +#define YYNSTATES 977 -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 361 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, without out-of-bounds checking. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -833,304 +835,64 @@ static const yytype_uint8 yytranslate[] = }; #if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -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, 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, 290, 295, 301, 303, 305, 307, 309, 311, 313, - 315, 317, 319, 321, 323, 325, 327, 329, 331, 333, - 335, 337, 339, 341, 343, 345, 347, 349, 351, 353, - 355, 357, 359, 361, 363, 365, 367, 369, 371, 374, - 377, 379, 381, 383, 385, 386, 393, 395, 397, 399, - 403, 406, 411, 414, 419, 423, 428, 430, 432, 434, - 436, 439, 442, 445, 448, 451, 455, 460, 464, 468, - 469, 476, 478, 480, 482, 486, 489, 491, 495, 497, - 500, 502, 505, 507, 511, 517, 521, 526, 528, 530, - 533, 535, 539, 543, 549, 553, 557, 562, 564, 566, - 568, 570, 573, 576, 579, 582, 586, 591, 593, 595, - 597, 600, 603, 606, 609, 613, 618, 626, 630, 632, - 635, 638, 641, 644, 648, 653, 661, 663, 665, 668, - 670, 672, 674, 677, 682, 684, 686, 689, 691, 693, - 695, 698, 703, 706, 708, 710, 713, 716, 719, 722, - 726, 727, 733, 734, 742, 744, 746, 749, 753, 756, - 759, 762, 766, 770, 774, 778, 782, 786, 791, 796, - 799, 803, 805, 807, 809, 811, 815, 821, 823, 826, - 831, 833, 835, 837, 839, 840, 847, 852, 855, 859, - 861, 863, 865, 867, 869, 871, 873, 875, 877, 879, - 881, 883, 885, 887, 890, 893, 896, 899, 901, 904, - 906, 910, 913, 915, 916, 919, 921, 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, 1102, 1104, 1106, 1108, - 1110, 1112, 1114, 1116, 1118, 1120, 1122, 1124, 1126, 1128, - 1130, 1132, 1134, 1136, 1138, 1142, 1144, 1146, 1148, 1150, - 1152, 1156, 1158, 1163, 1171, 1179, 1184, 1187, 1190, 1193, - 1196, 1199, 1203, 1207, 1211, 1215, 1219, 1223, 1227, 1231, - 1235, 1239, 1243, 1247, 1251, 1255, 1259, 1263, 1269, 1274, - 1279, 1283, 1287, 1291, 1295, 1297, 1302, 1310, 1318, 1323, - 1328, 1333, 1338, 1343, 1348, 1353, 1358, 1363, 1368, 1373, - 1378, 1383, 1388, 1391, 1397, 1400, 1403, 1406, 1409, 1412, - 1416, 1420, 1424, 1428, 1432, 1436, 1440, 1444, 1448, 1452, - 1456, 1460, 1464, 1468, 1472, 1476, 1480, 1484, 1490, 1495, - 1500, 1504, 1508, 1512, 1516, 1518, 1520, 1522, 1524, 1526, - 1528, 1530, 1532, 1537, 1545, 1553, 1558, 1561, 1567, 1570, - 1573, 1576, 1579, 1583, 1587, 1591, 1595, 1599, 1603, 1607, - 1611, 1615, 1619, 1623, 1627, 1631, 1635, 1639, 1643, 1647, - 1651, 1657, 1662, 1667, 1671, 1675, 1679, 1683, 1685, 1687, - 1689, 1691, 1693, 1695, 1697, 1700, 1703, 1705, 1707, 1709, - 1712 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int16 yyrhs[] = -{ - 132, 0, -1, 104, 133, -1, 105, 216, -1, 106, - 186, -1, 223, -1, 133, 109, -1, 133, 138, -1, - 135, -1, 134, 108, 135, -1, 221, 125, 213, 127, - -1, -1, 141, 107, 137, 133, 128, -1, 142, -1, - 164, -1, 136, -1, 201, -1, 203, -1, 139, -1, - 94, 148, -1, 43, -1, 56, -1, 61, 110, -1, - 81, 110, -1, 80, 110, -1, 79, 110, -1, 72, - 125, 8, 108, 8, 127, 109, -1, 72, 125, 8, - 108, 8, 108, 8, 127, 109, -1, 73, 125, 221, - 108, 221, 108, 221, 127, 109, -1, -1, 64, 140, - 138, -1, 223, -1, 141, 59, -1, 141, 59, 222, - -1, 141, 87, -1, 141, 68, -1, 141, 99, -1, - 141, 60, -1, 141, 101, -1, 141, 74, -1, 141, - 82, -1, 141, 44, -1, 141, 58, -1, 143, -1, - 141, 184, 109, -1, 141, 153, 176, -1, -1, 141, - 184, 144, 146, -1, -1, 141, 51, 183, 145, 147, - -1, 170, 176, -1, 170, 175, 108, 146, -1, 170, - 176, -1, 170, 175, 108, 147, -1, -1, 141, 184, - 149, 151, -1, -1, 141, 51, 183, 150, 152, -1, - 141, 153, 176, -1, 170, 176, -1, 170, 175, 108, - 151, -1, 170, 176, -1, 170, 175, 108, 152, -1, - -1, 8, 125, 154, 172, 127, 161, -1, -1, 9, - 125, 155, 172, 127, 161, -1, -1, 123, 221, 125, - 156, 172, 127, 161, -1, -1, 9, 125, 120, 170, - 127, 125, 157, 172, 127, 161, -1, -1, 9, 125, - 10, 120, 170, 127, 125, 158, 172, 127, 161, -1, - -1, 78, 183, 180, 125, 159, 172, 127, 161, -1, - -1, 78, 51, 183, 180, 125, 160, 172, 127, 161, - -1, 8, -1, 223, -1, 51, -1, 161, 77, -1, - 161, 91, 125, 127, -1, 161, 91, 125, 221, 127, - -1, 129, -1, 123, -1, 120, -1, 121, -1, 122, - -1, 118, -1, 119, -1, 113, -1, 115, -1, 114, - -1, 13, -1, 14, -1, 15, -1, 16, -1, 17, - -1, 18, -1, 116, -1, 117, -1, 19, -1, 20, - -1, 111, -1, 108, -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, 126, 130, -1, 125, 127, -1, 76, -1, 52, - -1, 142, -1, 164, -1, -1, 90, 165, 116, 166, - 117, 163, -1, 223, -1, 167, -1, 168, -1, 167, - 108, 168, -1, 50, 221, -1, 50, 221, 111, 186, - -1, 95, 221, -1, 95, 221, 111, 186, -1, 169, - 181, 174, -1, 51, 169, 181, 174, -1, 204, -1, - 8, -1, 9, -1, 221, -1, 78, 162, -1, 51, - 170, -1, 120, 170, -1, 115, 170, -1, 14, 170, - -1, 10, 120, 170, -1, 170, 126, 212, 130, -1, - 170, 110, 4, -1, 125, 170, 127, -1, -1, 170, - 125, 171, 172, 127, 161, -1, 223, -1, 12, -1, - 173, -1, 173, 108, 12, -1, 173, 12, -1, 179, - -1, 173, 108, 179, -1, 223, -1, 111, 215, -1, - 223, -1, 111, 216, -1, 109, -1, 107, 208, 128, - -1, 110, 134, 107, 208, 128, -1, 111, 216, 109, - -1, 111, 107, 177, 128, -1, 223, -1, 178, -1, - 178, 108, -1, 216, -1, 107, 177, 128, -1, 178, - 108, 216, -1, 178, 108, 107, 177, 128, -1, 183, - 181, 175, -1, 8, 181, 175, -1, 51, 183, 181, - 175, -1, 218, -1, 223, -1, 8, -1, 9, -1, - 51, 180, -1, 120, 180, -1, 115, 180, -1, 14, - 180, -1, 10, 120, 180, -1, 180, 126, 212, 130, - -1, 223, -1, 8, -1, 9, -1, 51, 181, -1, - 120, 181, -1, 115, 181, -1, 14, 181, -1, 10, - 120, 181, -1, 181, 126, 212, 130, -1, 125, 181, - 127, 125, 172, 127, 161, -1, 125, 181, 127, -1, - 223, -1, 51, 182, -1, 120, 182, -1, 115, 182, - -1, 14, 182, -1, 10, 120, 182, -1, 182, 126, - 212, 130, -1, 125, 182, 127, 125, 172, 127, 161, - -1, 204, -1, 9, -1, 95, 221, -1, 187, -1, - 189, -1, 194, -1, 200, 221, -1, 199, 221, 110, - 196, -1, 204, -1, 9, -1, 95, 221, -1, 187, - -1, 189, -1, 194, -1, 200, 221, -1, 199, 221, - 110, 196, -1, 199, 221, -1, 204, -1, 9, -1, - 95, 221, -1, 200, 221, -1, 199, 221, -1, 183, - 182, -1, 51, 183, 182, -1, -1, 200, 107, 188, - 133, 128, -1, -1, 200, 221, 190, 191, 107, 133, - 128, -1, 223, -1, 192, -1, 110, 193, -1, 192, - 108, 193, -1, 81, 220, -1, 80, 220, -1, 79, - 220, -1, 99, 81, 220, -1, 99, 80, 220, -1, - 99, 79, 220, -1, 81, 99, 220, -1, 80, 99, - 220, -1, 79, 99, 220, -1, 195, 107, 198, 128, - -1, 199, 221, 110, 196, -1, 199, 221, -1, 199, - 110, 196, -1, 199, -1, 205, -1, 9, -1, 223, - -1, 197, 221, 108, -1, 197, 221, 111, 216, 108, - -1, 197, -1, 197, 221, -1, 197, 221, 111, 216, - -1, 57, -1, 50, -1, 89, -1, 96, -1, -1, - 75, 221, 107, 202, 133, 128, -1, 75, 107, 133, - 128, -1, 98, 221, -1, 98, 75, 221, -1, 205, - -1, 206, -1, 207, -1, 45, -1, 47, -1, 102, - -1, 48, -1, 49, -1, 84, -1, 70, -1, 71, - -1, 97, -1, 85, -1, 69, -1, 84, 205, -1, - 70, 205, -1, 97, 205, -1, 85, 205, -1, 63, - -1, 70, 63, -1, 53, -1, 70, 70, 63, -1, - 70, 53, -1, 100, -1, -1, 209, 210, -1, 223, - -1, 210, 211, -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, - 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, 74, -1, 75, -1, - 76, -1, 78, -1, 79, -1, 80, -1, 81, -1, - 61, -1, 82, -1, 83, -1, 84, -1, 85, -1, - 86, -1, 87, -1, 88, -1, 89, -1, 91, -1, - 92, -1, 93, -1, 94, -1, 95, -1, 96, -1, - 97, -1, 98, -1, 99, -1, 100, -1, 101, -1, - 102, -1, 103, -1, 118, -1, 119, -1, 120, -1, - 121, -1, 115, -1, 113, -1, 114, -1, 129, -1, - 123, -1, 111, -1, 122, -1, 116, -1, 117, -1, - 125, -1, 127, -1, 124, -1, 108, -1, 109, -1, - 110, -1, 126, -1, 130, -1, 112, -1, 107, 210, - 128, -1, 223, -1, 216, -1, 223, -1, 214, -1, - 216, -1, 214, 108, 216, -1, 217, -1, 125, 186, - 127, 215, -1, 88, 116, 186, 117, 125, 214, 127, - -1, 54, 116, 186, 117, 125, 214, 127, -1, 86, - 125, 186, 127, -1, 129, 215, -1, 123, 215, -1, - 119, 215, -1, 120, 215, -1, 115, 215, -1, 215, - 120, 215, -1, 215, 121, 215, -1, 215, 122, 215, - -1, 215, 118, 215, -1, 215, 119, 215, -1, 215, - 113, 215, -1, 215, 114, 215, -1, 215, 115, 215, - -1, 215, 13, 215, -1, 215, 14, 215, -1, 215, - 15, 215, -1, 215, 16, 215, -1, 215, 17, 215, - -1, 215, 18, 215, -1, 215, 19, 215, -1, 215, - 20, 215, -1, 215, 112, 215, 110, 215, -1, 215, - 126, 216, 130, -1, 215, 125, 214, 127, -1, 215, - 125, 127, -1, 215, 124, 215, -1, 215, 29, 215, - -1, 125, 214, 127, -1, 217, -1, 125, 186, 127, - 216, -1, 88, 116, 186, 117, 125, 214, 127, -1, - 54, 116, 186, 117, 125, 214, 127, -1, 9, 125, - 213, 127, -1, 69, 125, 213, 127, -1, 47, 125, - 213, 127, -1, 102, 125, 213, 127, -1, 48, 125, - 213, 127, -1, 49, 125, 213, 127, -1, 45, 125, - 213, 127, -1, 84, 125, 213, 127, -1, 70, 125, - 213, 127, -1, 97, 125, 213, 127, -1, 85, 125, - 213, 127, -1, 63, 125, 213, 127, -1, 53, 125, - 213, 127, -1, 86, 125, 186, 127, -1, 76, 185, - -1, 76, 185, 125, 213, 127, -1, 129, 216, -1, - 123, 216, -1, 119, 216, -1, 120, 216, -1, 115, - 216, -1, 216, 120, 216, -1, 216, 121, 216, -1, - 216, 122, 216, -1, 216, 118, 216, -1, 216, 119, - 216, -1, 216, 113, 216, -1, 216, 114, 216, -1, - 216, 115, 216, -1, 216, 13, 216, -1, 216, 14, - 216, -1, 216, 15, 216, -1, 216, 16, 216, -1, - 216, 17, 216, -1, 216, 18, 216, -1, 216, 116, - 216, -1, 216, 117, 216, -1, 216, 19, 216, -1, - 216, 20, 216, -1, 216, 112, 216, 110, 216, -1, - 216, 126, 216, 130, -1, 216, 125, 214, 127, -1, - 216, 125, 127, -1, 216, 124, 216, -1, 216, 29, - 216, -1, 125, 214, 127, -1, 4, -1, 92, -1, - 62, -1, 5, -1, 3, -1, 222, -1, 8, -1, - 219, -1, 125, 186, 127, 216, -1, 88, 116, 186, - 117, 125, 214, 127, -1, 54, 116, 186, 117, 125, - 214, 127, -1, 86, 125, 186, 127, -1, 76, 185, - -1, 76, 185, 125, 213, 127, -1, 129, 216, -1, - 123, 216, -1, 119, 216, -1, 115, 216, -1, 218, - 120, 216, -1, 218, 121, 216, -1, 218, 122, 216, - -1, 218, 118, 216, -1, 218, 119, 216, -1, 218, - 113, 216, -1, 218, 114, 216, -1, 218, 115, 216, - -1, 218, 13, 216, -1, 218, 14, 216, -1, 218, - 15, 216, -1, 218, 16, 216, -1, 218, 17, 216, - -1, 218, 18, 216, -1, 218, 116, 216, -1, 218, - 117, 216, -1, 218, 19, 216, -1, 218, 20, 216, - -1, 218, 112, 216, 110, 216, -1, 218, 126, 216, - 130, -1, 218, 125, 214, 127, -1, 218, 125, 127, - -1, 218, 124, 216, -1, 218, 29, 216, -1, 125, - 214, 127, -1, 4, -1, 92, -1, 62, -1, 5, - -1, 3, -1, 222, -1, 221, -1, 200, 221, -1, - 95, 221, -1, 8, -1, 9, -1, 6, -1, 222, - 6, -1, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 386, 386, 387, 391, 398, 399, 400, 404, 405, 409, 422, 421, 433, 434, 435, 436, 437, 438, 439, 440, 453, 462, 466, 474, 478, 482, 493, 514, 523, - 522, 537, 541, 545, 556, 560, 564, 568, 572, 576, - 580, 584, 588, 595, 599, 608, 620, 619, 635, 634, - 652, 660, 671, 680, 694, 693, 709, 708, 719, 734, - 740, 749, 756, 769, 768, 791, 790, 815, 814, 845, - 844, 860, 859, 877, 876, 908, 907, 933, 946, 950, - 954, 958, 962, 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, 1121, 1128, 1129, 1134, 1133, 1144, 1145, 1149, 1155, - 1164, 1168, 1172, 1176, 1180, 1186, 1196, 1200, 1205, 1214, - 1218, 1232, 1237, 1242, 1247, 1252, 1257, 1262, 1267, 1273, - 1272, 1294, 1298, 1303, 1307, 1312, 1320, 1325, 1333, 1337, - 1344, 1348, 1355, 1359, 1363, 1367, 1371, 1378, 1379, 1380, - 1384, 1387, 1388, 1389, 1393, 1398, 1406, 1412, 1422, 1426, - 1430, 1434, 1439, 1444, 1449, 1454, 1459, 1467, 1471, 1475, - 1479, 1484, 1489, 1494, 1499, 1504, 1509, 1515, 1523, 1527, - 1532, 1537, 1542, 1547, 1552, 1557, 1566, 1570, 1575, 1579, - 1583, 1587, 1591, 1607, 1626, 1630, 1635, 1639, 1643, 1647, - 1651, 1667, 1683, 1704, 1708, 1713, 1717, 1733, 1752, 1758, - 1769, 1768, 1793, 1792, 1822, 1823, 1827, 1828, 1832, 1836, - 1840, 1844, 1848, 1852, 1856, 1860, 1864, 1871, 1879, 1883, - 1887, 1891, 1898, 1902, 1909, 1910, 1916, 1924, 1925, 1931, - 1940, 1947, 1951, 1955, 1963, 1962, 1984, 1988, 1994, 2003, - 2004, 2005, 2009, 2013, 2017, 2021, 2025, 2029, 2034, 2039, - 2044, 2049, 2054, 2058, 2063, 2072, 2077, 2085, 2089, 2094, - 2098, 2103, 2111, 2121, 2121, 2131, 2132, 2136, 2137, 2138, - 2139, 2140, 2141, 2142, 2143, 2144, 2144, 2144, 2145, 2145, - 2145, 2145, 2146, 2146, 2146, 2146, 2146, 2147, 2147, 2147, - 2148, 2148, 2148, 2148, 2148, 2149, 2149, 2149, 2149, 2149, - 2150, 2150, 2151, 2151, 2151, 2152, 2152, 2153, 2153, 2153, - 2153, 2153, 2154, 2154, 2154, 2155, 2155, 2155, 2155, 2155, - 2155, 2156, 2156, 2156, 2156, 2157, 2157, 2157, 2157, 2158, - 2158, 2158, 2158, 2159, 2159, 2159, 2159, 2160, 2160, 2160, - 2160, 2160, 2161, 2161, 2161, 2161, 2161, 2162, 2162, 2162, - 2162, 2162, 2165, 2165, 2165, 2165, 2165, 2165, 2165, 2165, - 2165, 2165, 2165, 2166, 2166, 2166, 2166, 2166, 2166, 2166, - 2166, 2166, 2166, 2167, 2167, 2171, 2175, 2182, 2186, 2193, - 2197, 2204, 2208, 2212, 2216, 2220, 2224, 2228, 2232, 2244, - 2248, 2252, 2256, 2260, 2264, 2268, 2272, 2276, 2280, 2284, - 2288, 2292, 2296, 2300, 2304, 2308, 2312, 2316, 2320, 2324, - 2328, 2332, 2336, 2340, 2348, 2352, 2356, 2360, 2364, 2371, - 2377, 2383, 2389, 2395, 2401, 2407, 2414, 2421, 2428, 2435, - 2441, 2447, 2451, 2455, 2459, 2463, 2467, 2479, 2483, 2487, - 2491, 2495, 2499, 2503, 2507, 2511, 2515, 2519, 2523, 2527, - 2531, 2535, 2539, 2543, 2547, 2551, 2555, 2559, 2563, 2567, - 2571, 2575, 2579, 2583, 2590, 2594, 2598, 2602, 2606, 2610, - 2614, 2628, 2632, 2636, 2640, 2644, 2648, 2652, 2656, 2660, - 2664, 2676, 2680, 2684, 2688, 2692, 2696, 2700, 2704, 2708, - 2712, 2716, 2720, 2724, 2728, 2732, 2736, 2740, 2744, 2748, - 2752, 2756, 2760, 2764, 2768, 2772, 2776, 2783, 2787, 2791, - 2795, 2799, 2803, 2810, 2818, 2826, 2849, 2853, 2860, 2864, - 2870 + 522, 537, 541, 546, 550, 561, 565, 569, 573, 577, + 581, 585, 589, 593, 601, 600, 615, 624, 638, 649, + 664, 663, 678, 693, 702, 717, 716, 739, 738, 763, + 762, 793, 792, 808, 807, 825, 824, 856, 855, 881, + 894, 898, 902, 906, 910, 917, 921, 925, 929, 933, + 937, 941, 945, 949, 953, 957, 961, 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, 1076, 1077, 1082, 1081, 1092, 1093, + 1097, 1103, 1112, 1116, 1120, 1124, 1128, 1134, 1144, 1148, + 1153, 1162, 1166, 1180, 1185, 1190, 1195, 1200, 1205, 1210, + 1215, 1221, 1220, 1242, 1246, 1251, 1255, 1260, 1268, 1273, + 1281, 1285, 1292, 1296, 1303, 1307, 1311, 1315, 1319, 1326, + 1327, 1328, 1332, 1335, 1336, 1337, 1341, 1346, 1354, 1360, + 1370, 1374, 1378, 1382, 1387, 1392, 1397, 1402, 1407, 1415, + 1419, 1423, 1427, 1432, 1437, 1442, 1447, 1452, 1457, 1463, + 1471, 1475, 1480, 1485, 1490, 1495, 1500, 1505, 1514, 1518, + 1523, 1527, 1531, 1535, 1539, 1555, 1574, 1578, 1583, 1587, + 1591, 1595, 1599, 1615, 1631, 1652, 1656, 1661, 1665, 1681, + 1700, 1706, 1717, 1716, 1741, 1740, 1770, 1771, 1775, 1776, + 1780, 1784, 1788, 1792, 1796, 1800, 1804, 1808, 1812, 1819, + 1827, 1831, 1835, 1839, 1846, 1850, 1857, 1858, 1864, 1872, + 1873, 1879, 1888, 1895, 1899, 1903, 1911, 1910, 1932, 1936, + 1942, 1951, 1952, 1953, 1957, 1961, 1965, 1969, 1973, 1977, + 1982, 1987, 1992, 1997, 2002, 2006, 2011, 2020, 2025, 2033, + 2037, 2042, 2046, 2051, 2059, 2069, 2069, 2079, 2080, 2084, + 2085, 2086, 2087, 2088, 2089, 2090, 2091, 2092, 2092, 2092, + 2093, 2093, 2093, 2093, 2094, 2094, 2094, 2094, 2094, 2095, + 2095, 2095, 2096, 2096, 2096, 2096, 2096, 2097, 2097, 2097, + 2097, 2097, 2098, 2098, 2099, 2099, 2099, 2100, 2100, 2101, + 2101, 2101, 2101, 2101, 2102, 2102, 2102, 2103, 2103, 2103, + 2103, 2103, 2103, 2104, 2104, 2104, 2104, 2105, 2105, 2105, + 2105, 2106, 2106, 2106, 2106, 2107, 2107, 2107, 2107, 2108, + 2108, 2108, 2108, 2108, 2109, 2109, 2109, 2109, 2109, 2110, + 2110, 2110, 2110, 2110, 2113, 2113, 2113, 2113, 2113, 2113, + 2113, 2113, 2113, 2113, 2113, 2114, 2114, 2114, 2114, 2114, + 2114, 2114, 2114, 2114, 2114, 2115, 2115, 2119, 2123, 2130, + 2134, 2141, 2145, 2152, 2156, 2160, 2164, 2168, 2172, 2176, + 2180, 2192, 2196, 2200, 2204, 2208, 2212, 2216, 2220, 2224, + 2228, 2232, 2236, 2240, 2244, 2248, 2252, 2256, 2260, 2264, + 2268, 2272, 2276, 2280, 2284, 2288, 2296, 2300, 2304, 2308, + 2312, 2319, 2325, 2331, 2337, 2343, 2349, 2355, 2362, 2369, + 2376, 2383, 2389, 2395, 2399, 2403, 2407, 2411, 2415, 2427, + 2431, 2435, 2439, 2443, 2447, 2451, 2455, 2459, 2463, 2467, + 2471, 2475, 2479, 2483, 2487, 2491, 2495, 2499, 2503, 2507, + 2511, 2515, 2519, 2523, 2527, 2531, 2538, 2542, 2546, 2550, + 2554, 2558, 2562, 2576, 2580, 2584, 2588, 2592, 2596, 2600, + 2604, 2608, 2612, 2624, 2628, 2632, 2636, 2640, 2644, 2648, + 2652, 2656, 2660, 2664, 2668, 2672, 2676, 2680, 2684, 2688, + 2692, 2696, 2700, 2704, 2708, 2712, 2716, 2720, 2724, 2731, + 2735, 2739, 2743, 2747, 2751, 2758, 2766, 2774, 2797, 2801, + 2808, 2812, 2818 }; #endif @@ -1165,37 +927,35 @@ static const char *const yytname[] = "']'", "$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", - "$@9", "$@10", "$@11", "$@12", "$@13", "function_post", + "$@3", "multiple_instance_identifiers", "typedef_declaration", "$@4", + "typedef_instance_identifiers", "function_prototype", "$@5", "$@6", + "$@7", "$@8", "$@9", "$@10", "$@11", "function_post", "function_operator", "more_template_declaration", "template_declaration", - "$@14", "template_formal_parameters", + "$@12", "template_formal_parameters", "template_nonempty_formal_parameters", "template_formal_parameter", - "template_formal_parameter_type", "instance_identifier", "$@15", + "template_formal_parameter_type", "instance_identifier", "$@13", "formal_parameter_list", "formal_parameters", "template_parameter_maybe_initialize", "maybe_initialize", "maybe_initialize_or_function_body", "structure_init", "structure_init_body", "formal_parameter", "not_paren_formal_parameter_identifier", "formal_parameter_identifier", "empty_instance_identifier", "type", "type_decl", "predefined_type", - "full_type", "anonymous_struct", "$@16", "named_struct", "$@17", + "full_type", "anonymous_struct", "$@14", "named_struct", "$@15", "maybe_class_derivation", "class_derivation", "base_specification", "enum", "enum_decl", "enum_element_type", "enum_body_trailing_comma", "enum_body", "enum_keyword", "struct_keyword", "namespace_declaration", - "$@18", "using_declaration", "simple_type", "simple_int_type", - "simple_float_type", "simple_void_type", "code", "$@19", "code_block", + "$@16", "using_declaration", "simple_type", "simple_int_type", + "simple_float_type", "simple_void_type", "code", "$@17", "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", YY_NULL + "class_derivation_name", "name", "string", "empty", YY_NULLPTR }; #endif # ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, @@ -1215,856 +975,736 @@ static const yytype_uint16 yytoknum[] = }; # endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 131, 132, 132, 132, 133, 133, 133, 134, 134, - 135, 137, 136, 138, 138, 138, 138, 138, 138, 138, - 138, 138, 138, 138, 138, 138, 138, 138, 138, 140, - 139, 141, 141, 141, 141, 141, 141, 141, 141, 141, - 141, 141, 141, 142, 142, 142, 144, 143, 145, 143, - 146, 146, 147, 147, 149, 148, 150, 148, 148, 151, - 151, 152, 152, 154, 153, 155, 153, 156, 153, 157, - 153, 158, 153, 159, 153, 160, 153, 153, 161, 161, - 161, 161, 161, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 163, 163, 165, 164, 166, 166, 167, 167, - 168, 168, 168, 168, 168, 168, 169, 169, 169, 170, - 170, 170, 170, 170, 170, 170, 170, 170, 170, 171, - 170, 172, 172, 172, 172, 172, 173, 173, 174, 174, - 175, 175, 176, 176, 176, 176, 176, 177, 177, 177, - 178, 178, 178, 178, 179, 179, 179, 179, 180, 180, - 180, 180, 180, 180, 180, 180, 180, 181, 181, 181, - 181, 181, 181, 181, 181, 181, 181, 181, 182, 182, - 182, 182, 182, 182, 182, 182, 183, 183, 183, 183, - 183, 183, 183, 183, 184, 184, 184, 184, 184, 184, - 184, 184, 184, 185, 185, 185, 185, 185, 186, 186, - 188, 187, 190, 189, 191, 191, 192, 192, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 194, 195, 195, - 195, 195, 196, 196, 197, 197, 197, 198, 198, 198, - 199, 200, 200, 200, 202, 201, 201, 203, 203, 204, - 204, 204, 205, 205, 205, 205, 205, 205, 205, 205, - 205, 205, 205, 205, 205, 205, 205, 206, 206, 206, - 206, 206, 207, 209, 208, 210, 210, 211, 211, 211, - 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, - 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, - 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, - 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, - 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, - 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, - 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, - 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, - 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, - 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, - 211, 211, 211, 211, 211, 212, 212, 213, 213, 214, - 214, 215, 215, 215, 215, 215, 215, 215, 215, 215, - 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, - 215, 215, 215, 215, 215, 215, 215, 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, 216, - 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, - 216, 216, 216, 216, 217, 217, 217, 217, 217, 217, - 217, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 219, 219, 219, - 219, 219, 219, 220, 220, 220, 221, 221, 222, 222, - 223 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -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, 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, - 2, 4, 5, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 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, 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, 2, 3, 4, 1, 1, 1, - 2, 2, 2, 2, 3, 4, 7, 3, 1, 2, - 2, 2, 2, 3, 4, 7, 1, 1, 2, 1, - 1, 1, 2, 4, 1, 1, 2, 1, 1, 1, - 2, 4, 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, 4, 4, 2, - 3, 1, 1, 1, 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, 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, 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, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, - 3, 1, 4, 7, 7, 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, - 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 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, 550, 0, 0, 0, 550, 5, 498, 494, 497, - 548, 500, 0, 0, 0, 0, 0, 0, 0, 496, - 0, 0, 0, 0, 0, 0, 0, 0, 495, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 444, 499, - 207, 272, 273, 275, 276, 261, 0, 289, 260, 287, - 282, 278, 279, 277, 281, 262, 0, 263, 280, 292, - 274, 550, 4, 209, 210, 211, 0, 251, 0, 206, - 269, 270, 271, 1, 20, 21, 0, 29, 0, 0, - 0, 0, 0, 0, 124, 550, 0, 6, 15, 7, - 18, 0, 13, 43, 14, 16, 17, 31, 550, 550, - 550, 550, 550, 550, 0, 550, 550, 550, 224, 0, - 462, 0, 0, 223, 550, 550, 0, 0, 550, 550, - 468, 466, 467, 465, 207, 272, 273, 275, 276, 289, - 287, 282, 278, 277, 281, 280, 274, 0, 0, 409, - 464, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 549, 550, 291, 288, 278, 284, - 278, 283, 286, 546, 547, 208, 285, 0, 550, 550, - 550, 550, 550, 228, 198, 550, 0, 249, 230, 212, - 22, 550, 0, 0, 550, 0, 25, 24, 23, 0, - 0, 19, 0, 267, 77, 215, 41, 0, 42, 32, - 37, 35, 39, 0, 40, 34, 0, 36, 38, 11, - 0, 0, 46, 217, 218, 219, 251, 0, 214, 0, - 408, 407, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 225, 550, 227, 226, 0, 0, 0, 0, 0, - 0, 0, 0, 493, 477, 478, 479, 480, 481, 482, - 485, 486, 492, 0, 474, 475, 476, 483, 484, 472, - 473, 469, 470, 471, 491, 490, 0, 0, 229, 290, - 550, 202, 199, 201, 200, 0, 550, 257, 0, 254, - 253, 250, 252, 0, 550, 550, 30, 0, 0, 550, - 264, 550, 0, 0, 54, 268, 63, 65, 48, 33, - 0, 550, 216, 550, 0, 293, 162, 0, 0, 45, - 44, 0, 222, 220, 448, 454, 450, 452, 453, 460, - 0, 459, 449, 456, 0, 455, 458, 461, 0, 457, - 451, 445, 410, 0, 489, 488, 203, 0, 0, 406, - 405, 258, 247, 213, 550, 0, 0, 235, 234, 0, - 0, 266, 550, 137, 138, 0, 0, 0, 0, 127, - 128, 550, 136, 126, 56, 58, 0, 550, 0, 0, - 550, 0, 550, 179, 180, 0, 550, 550, 550, 550, - 0, 178, 550, 67, 0, 550, 0, 8, 0, 550, - 0, 0, 0, 0, 0, 0, 0, 0, 47, 550, - 139, 0, 0, 463, 0, 487, 550, 204, 255, 0, - 231, 0, 0, 0, 0, 236, 550, 0, 0, 0, - 550, 130, 550, 132, 550, 0, 188, 189, 0, 550, - 550, 550, 550, 550, 550, 187, 0, 55, 550, 541, - 537, 540, 550, 152, 0, 0, 539, 0, 0, 0, - 538, 0, 0, 0, 0, 0, 0, 153, 156, 550, - 177, 501, 542, 151, 0, 0, 0, 49, 550, 0, - 550, 184, 181, 183, 182, 73, 550, 12, 550, 163, - 294, 295, 293, 0, 550, 550, 0, 168, 170, 167, - 165, 0, 144, 141, 93, 94, 95, 96, 97, 98, - 101, 102, 117, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 121, 120, 104, 103, 90, - 92, 91, 99, 100, 88, 89, 85, 86, 87, 84, - 0, 0, 83, 140, 143, 142, 0, 0, 0, 149, - 550, 0, 50, 160, 221, 0, 0, 0, 259, 0, - 0, 0, 240, 543, 0, 239, 0, 238, 0, 0, - 0, 550, 237, 0, 0, 0, 265, 0, 550, 0, - 0, 122, 125, 123, 129, 550, 193, 190, 192, 191, - 0, 0, 550, 134, 158, 57, 550, 0, 59, 550, - 550, 0, 506, 0, 0, 511, 510, 509, 0, 0, - 508, 550, 155, 0, 550, 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, 550, 0, 52, 75, 185, 550, 0, 0, 297, - 298, 300, 299, 304, 301, 302, 303, 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, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 360, 344, 345, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, - 378, 379, 380, 381, 550, 398, 399, 400, 391, 403, - 387, 388, 386, 393, 394, 382, 383, 384, 385, 392, - 390, 397, 395, 401, 396, 389, 402, 296, 0, 9, - 0, 0, 166, 169, 145, 119, 118, 148, 147, 161, - 550, 0, 0, 447, 446, 550, 256, 545, 246, 544, - 245, 244, 243, 242, 241, 233, 0, 26, 0, 131, - 135, 133, 194, 197, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 159, 411, 0, 0, 61, 0, 0, - 175, 550, 0, 550, 0, 0, 0, 536, 79, 64, - 78, 154, 157, 174, 520, 521, 522, 523, 524, 525, - 528, 529, 535, 0, 517, 518, 519, 526, 527, 515, - 516, 512, 513, 514, 534, 533, 0, 0, 0, 69, - 66, 0, 550, 0, 186, 550, 0, 164, 10, 171, - 550, 172, 0, 146, 51, 205, 0, 0, 550, 0, - 0, 0, 420, 418, 419, 417, 0, 0, 416, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 195, 0, 60, 161, 176, 0, 0, 505, 0, 502, - 80, 0, 0, 532, 531, 71, 550, 53, 0, 550, - 68, 404, 0, 550, 27, 28, 0, 0, 0, 0, - 0, 443, 429, 430, 431, 432, 433, 434, 435, 436, - 442, 0, 426, 427, 428, 424, 425, 421, 422, 423, - 441, 440, 0, 0, 62, 0, 507, 0, 0, 530, - 550, 0, 550, 74, 173, 150, 550, 0, 415, 0, - 412, 0, 439, 438, 0, 0, 81, 0, 0, 550, - 76, 196, 0, 0, 437, 504, 503, 82, 550, 70, - 0, 0, 72, 414, 413 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 4, 5, 396, 397, 88, 313, 89, 90, 191, - 91, 92, 93, 321, 381, 408, 477, 201, 376, 446, - 447, 595, 221, 377, 380, 488, 916, 960, 646, 852, - 819, 543, 582, 94, 199, 368, 369, 370, 371, 409, - 770, 466, 467, 593, 551, 319, 496, 497, 468, 390, - 444, 183, 61, 222, 110, 62, 63, 294, 64, 295, - 356, 357, 425, 65, 66, 291, 287, 288, 67, 68, - 95, 362, 96, 69, 70, 71, 72, 394, 395, 490, - 757, 348, 229, 230, 803, 139, 38, 470, 471, 562, - 410, 39, 231 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -490 -static const yytype_int16 yypact[] = -{ - 202, -490, 2072, 3155, 52, 3007, -490, -490, -490, -490, - -490, -490, -60, -44, -28, -16, 10, 37, -3, -490, - 43, 46, 51, 3267, 57, 67, 75, 22, -490, 93, - 113, 2072, 2072, 2072, 2072, 1232, 2072, 2714, -490, 114, - -490, -490, -490, -490, -490, -490, 3323, -490, -490, -490, - -490, 1593, -490, 1773, 1773, -490, 84, -490, 1773, -490, - -490, 119, -490, -490, -490, -490, 139, 102, 15, -490, - -490, -490, -490, -490, -490, -490, 143, -490, 124, 142, - 29, 178, 182, 185, -490, -490, 62, -490, -490, -490, - -490, 2409, -490, -490, -490, -490, -490, -490, 2072, 2072, - 2072, 2072, 2072, 2072, 3155, 2072, 2072, 2072, -490, 84, - 146, 84, 84, -490, 2072, 2072, 3155, 3155, 2072, 2072, - 49, 49, 49, 49, -60, -44, -28, -16, 10, 37, - 43, 46, 2043, 2336, 3256, 3516, 113, 174, -92, 2714, - 49, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, - 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, - 2072, 2072, 1532, 2072, -490, 119, -490, -490, 1683, -490, - 1773, -490, -490, -490, -490, -490, -490, 191, 119, 119, - 119, 119, 119, 196, -490, -490, 3200, 207, -490, -21, - -490, 3548, 316, 84, -490, 225, -490, -490, -490, 217, - 2476, -490, 84, -490, 213, 223, -490, 3323, -490, 345, - -490, -490, -490, 3211, -490, -490, 84, -490, -490, -490, - 84, 218, 246, -490, -490, -490, 102, 15, -490, 229, - 249, -490, 233, 247, 262, 263, 265, 245, 266, 268, - 269, -490, 2072, -490, -490, 270, 276, 282, 293, 289, - 295, 2072, 2072, -490, 1249, 821, 3055, 3055, 627, 627, - 388, 388, -490, 2566, 2134, 2876, 664, 627, 627, 280, - 280, 49, 49, 49, -490, -490, -68, 2164, 196, -490, - 119, 196, 196, 196, 196, 4, 2072, 84, 292, -490, - -490, -490, -490, 3200, -490, 314, -490, 318, 324, 3360, - -490, 3061, 3323, 218, -490, -490, -490, 12, -490, 114, - 3323, 222, -490, -490, 309, -490, -490, 84, 1622, -490, - -490, 206, 17, -21, -490, -490, -490, -490, -490, -490, - 311, -490, -490, -490, 325, -490, -490, -490, 328, -490, - -490, 49, 2714, 2072, -490, -490, 196, 329, 326, 2714, - -490, 58, -490, 351, 3387, 161, 352, 356, -490, 452, - 84, -490, -490, -490, -490, 84, 2327, 84, 349, 359, - -490, 219, -490, -490, -490, -490, 206, 1332, 350, 206, - 1332, 206, 222, -490, -490, 353, 222, 222, 222, 222, - 71, -490, 3414, -490, 341, -490, 148, -490, 346, 1712, - 2633, 355, 206, 206, 2326, 206, 206, 206, -490, 165, - -490, 3200, 2072, -490, 2072, 2714, 1332, -490, -490, 2072, - -490, 665, 867, 1201, 235, -490, -490, 161, -61, 364, - 3441, 365, 219, 367, 390, 3061, -490, -490, 361, 219, - 219, 219, 219, 219, -101, -490, 206, -490, 165, -490, - -490, -490, 219, -490, 3323, 366, -490, 3267, 368, 374, - -490, 2072, 2072, 2072, 1232, 2072, 357, 6, -490, 219, - 2747, -490, 114, -490, 206, 177, 371, -490, 165, 156, - 222, 373, 373, 373, 373, -490, 2072, -490, 1332, -490, - 1104, -490, -490, 84, 2072, 1712, 363, 392, 2714, -490, - -490, 206, 194, 194, -490, -490, -490, -490, -490, -490, - -490, -490, -490, -490, -490, -490, -490, -490, -490, -490, - -490, -490, -490, -490, -490, -490, -490, -490, -490, -490, - -490, -490, -490, -490, -490, -490, -490, -490, -490, -490, - 375, 381, -490, -490, 194, 194, 239, 79, 1622, -490, - 2072, 395, -490, -490, 351, -54, -33, 377, 2680, 84, - 332, 84, -490, -490, 332, -490, 332, -490, 332, 332, - 332, 3468, -490, 507, 407, 84, -490, 3155, -101, 3155, - 2543, -490, -490, -490, -490, 219, 393, 393, 393, 393, - 209, 1468, 2072, -490, -490, -490, 165, 410, -490, -35, - 219, 3155, 396, 3155, 3155, 49, 49, 49, 398, 13, - 49, 469, -490, 1432, -35, 2072, 2072, 2072, 2072, 2072, - 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, - 2072, 2072, 2072, 2072, 2072, 2072, 1802, 2072, 242, 519, - 408, 469, 426, -490, -490, 373, 1332, 405, 409, -490, - -490, -490, -490, -490, -490, -490, -490, -490, -490, -490, - -490, -490, -490, -490, -490, -490, -490, -490, -490, -490, - -490, -490, -490, -490, -490, -490, -490, -490, -490, -490, - -490, -490, -490, -490, -490, -490, -490, -490, -490, -490, - -490, -490, -490, -490, -490, -490, -490, -490, -490, -490, - -490, -490, -490, -490, -490, -490, -490, -490, -490, -490, - -490, -490, -490, -490, -490, -490, -490, -490, -490, -490, - -490, -490, -490, -490, -490, -490, -490, -490, -490, -490, - -490, -490, -490, -490, -490, -490, -490, -490, -490, -490, - -490, -490, -490, -490, -490, -490, -490, -490, -490, -490, - -490, -490, -490, -490, -490, -490, -490, -490, 411, -490, - 413, 414, -490, 1892, 194, -490, -490, -490, -490, 2633, - 1332, 415, 206, -490, -490, 469, -490, -490, -490, -490, - -490, -490, -490, -490, -490, -490, 416, -490, 419, -490, - -490, -490, 393, 422, 425, 427, 438, 1468, 1468, 1468, - 1468, 1232, 1468, 2861, -490, 428, 430, -490, 206, 2072, - -490, -35, 439, 2072, 437, 449, 2072, -490, -490, 27, - -490, -490, -490, -490, 1249, 821, 3055, 3055, 627, 627, - 388, 388, -490, 2697, 2134, 2876, 664, 627, 627, 280, - 280, 49, 49, 49, -490, -490, 90, 2189, 442, -490, - 27, 206, 1332, 445, -490, 469, 976, -490, -490, -490, - 1712, 2714, 446, -490, -490, 27, 465, 466, 1332, 3155, - 3155, 3155, 221, 221, 221, 221, 454, 96, 221, 1468, - 1468, 1468, 1468, 1468, 1468, 1468, 1468, 1468, 1468, 1468, - 1468, 1468, 1468, 1468, 1468, 1468, 1468, 1468, 1982, 2072, - -490, 206, -490, 2714, -490, 451, 455, -490, 458, 49, - -490, 460, 2072, -490, -490, -490, 1332, -490, 459, 469, - 27, -490, 468, 469, -490, -490, 461, 476, 473, 486, - 1468, -490, 1449, 2891, 3073, 3073, 1485, 1485, 533, 533, - -490, 2828, 2906, 2940, 3018, 406, 406, 221, 221, 221, - -490, -490, 118, 2208, -490, 2072, -490, 2072, 59, 2714, - 1332, 477, 469, 27, -490, 27, 469, 481, -490, 482, - 221, 1468, -490, -490, 127, 151, -490, 484, 487, 469, - 27, 27, 2072, 2072, 2861, -490, -490, -490, 469, 27, - 169, 172, 27, -490, -490 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = -{ - -490, -490, -179, -490, 116, -490, -490, 447, -490, -490, - -76, 205, -490, -490, -490, -136, -209, -490, -490, -490, - -165, -252, 464, -490, -490, -490, -490, -490, -490, -490, - -318, -490, -490, 231, -490, -490, -490, 234, 300, -307, - -490, -363, -490, 94, -393, -283, -489, -490, 55, -281, - -413, 83, -5, 471, 220, -14, -88, -490, -84, -490, - -490, -490, 248, -83, -490, -288, -490, -490, -11, -9, - -490, -490, -490, -12, 609, -490, -490, 184, -490, -56, - -490, -473, -57, -34, 1, 0, -62, -490, -490, -359, - 157, -158, -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 YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -250 -static const yytype_int16 yytable[] = -{ - 6, 138, 37, 223, 97, 353, 761, 224, 225, 200, - 591, 113, 111, 647, 112, 299, 252, 476, 612, 578, - 375, 137, 378, 173, 174, 592, 586, 587, 588, 589, - 590, 120, 121, 122, 123, 253, 140, 173, 174, 599, - 252, 165, 232, 233, 234, 235, 236, 573, 238, 239, - 240, 309, 73, 557, 252, 597, 614, 245, 246, 344, - 184, 249, 250, 565, 567, 98, 574, 173, 174, 448, - 173, 174, 475, 773, 478, 252, 809, 771, 149, 228, - 226, 99, 227, 768, 97, 642, -232, 173, 174, -232, - 237, 592, 173, 174, 774, 502, 503, 100, 544, 545, - 546, 479, 247, 248, 910, 481, 482, 483, 484, 101, - 173, 174, 223, 104, 613, 354, 224, 225, 911, 805, - 164, 252, 188, 554, -249, 648, 552, 411, 276, 177, - 286, 347, 379, 178, 392, 102, 194, 202, 117, 596, - 817, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 103, 277, 184, 598, 418, 638, 105, 419, - 179, 106, 792, 161, 162, 163, 107, 184, 184, 184, - 184, 184, 114, 430, 289, 334, 976, 811, 228, 226, - 97, 227, 115, 6, 764, 643, 485, 486, 252, 645, - 116, 778, 308, 806, 252, 780, 810, 781, 311, 782, - 783, 784, 186, 175, 173, 174, 401, 913, 118, 472, - 402, 823, 472, 931, 187, 189, 252, 436, 437, 438, - 383, 384, 385, 439, 180, 252, 386, 195, 119, 181, - 421, 422, 423, 203, 182, 972, 185, 571, 278, 192, - 887, 341, 342, 190, 985, 492, 493, 403, 472, 252, - 424, 281, 282, 283, 284, 285, 241, 193, 243, 244, - 440, 242, 315, 387, 316, 547, 548, 252, 986, 184, - 252, 644, 486, 853, 404, 350, 349, 639, 196, 372, - 549, 550, 197, 6, 358, 198, 993, 374, 97, 994, - 373, 251, 549, 550, 640, 382, 1, 2, 3, 149, - 391, 280, 6, 807, 568, 569, 570, 293, 400, 549, - 550, 405, 286, 850, 297, 315, 406, 316, 317, 318, - 472, 407, 300, 301, 441, 592, 793, 388, 306, 442, - 173, 174, 389, 415, 443, 897, 898, 899, 307, 639, - 298, 10, 639, 97, 372, 320, 324, 252, 580, 305, - 325, 6, 330, 346, 549, 550, 767, 549, 550, 848, - 445, 922, 469, 312, 326, 469, 473, 314, 555, 473, - 556, 391, 45, 322, 323, 391, 391, 391, 391, 327, - 328, 97, 329, 331, 491, 332, 333, 335, 499, 498, - 158, 159, 160, 336, 161, 162, 163, 862, 553, 337, - 338, 469, 561, 561, 561, 473, 339, 149, 904, 558, - 352, 55, 340, 372, 355, 6, 359, 559, 57, 97, - 609, 445, 360, 97, 393, 887, 412, 760, 445, 445, - 445, 445, 445, 594, 351, 113, 111, 553, 112, 600, - 608, 445, 413, 414, 416, 472, 417, 865, -248, 426, - 428, 605, 606, 607, 427, 610, 434, 435, 445, 489, - 474, 494, 575, 480, 398, 501, 577, 553, 579, 391, - 84, 585, 601, 469, 611, 350, 349, 473, 472, 918, - 604, 762, 223, 603, 499, 498, 224, 225, 641, 486, - 763, 448, 765, 772, 775, 926, 156, 157, 158, 159, - 160, 766, 161, 162, 163, 786, 787, 429, 808, 592, - 818, 813, 431, 768, 433, 816, 894, 895, 896, 804, - 897, 898, 899, 849, 851, 854, 855, 920, 901, 857, - 858, 869, 859, 866, 478, 863, 867, 868, 769, 350, - 349, 561, 870, 961, 871, 561, 905, 561, 900, 561, - 561, 561, 887, 789, 907, 791, 908, 915, 228, 226, - 97, 227, 919, 923, 924, 925, 955, 594, 563, 563, - 563, 930, 956, 957, 445, 958, 962, 812, 966, 814, - 815, 350, 349, 967, 596, 553, 964, 978, 553, 445, - 968, 963, 846, 969, 979, 965, 982, 983, 469, 759, - 820, 987, 472, 553, 988, 824, 825, 826, 827, 828, - 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, - 839, 840, 841, 842, 843, 844, 864, 847, 296, 581, - 820, 469, 917, 902, 980, 473, 147, 148, 981, 954, - 398, 892, 893, 894, 895, 896, 149, 897, 898, 899, - 169, 989, 171, 172, 303, 583, 432, 176, 822, 584, - 992, 304, 790, 173, 174, 572, 758, 602, 856, 143, - 144, 145, 146, 147, 148, 0, 0, 0, 0, 0, - 0, 0, 0, 149, 472, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 398, 0, 0, 0, 0, 0, - 472, 0, 0, 0, 0, 45, 777, 563, 779, 0, - 0, 563, 0, 563, 0, 563, 563, 563, 0, 0, - 0, 0, 788, 491, 0, 804, 804, 804, 804, 0, - 804, 169, 171, 172, 176, 156, 157, 158, 159, 160, - 0, 161, 162, 163, 55, 0, 906, 0, 472, 0, - 559, 57, 0, 861, 560, 469, 0, 877, 0, 473, - 0, 0, 0, 0, 820, 0, 0, 169, 0, 169, - 154, 155, 156, 157, 158, 159, 160, 876, 161, 162, - 163, 0, 0, 0, 0, 292, 0, 0, 872, 873, - 874, 875, 472, 878, 0, 0, 0, 0, 0, 903, - 553, 0, 0, 0, 0, 0, 909, 804, 804, 804, - 804, 804, 804, 804, 804, 804, 804, 804, 804, 804, - 804, 804, 804, 804, 804, 804, 143, 144, 145, 146, - 147, 148, 0, 0, 0, 0, 0, 469, 0, 0, - 149, 473, 0, 0, 820, 927, 928, 929, 0, 499, - 498, 0, 0, 469, 952, 0, 0, 473, 804, 0, - 0, 0, 0, 0, 0, 173, 174, 0, 0, 0, - 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, - 942, 943, 944, 945, 946, 947, 948, 949, 950, 953, - 0, 0, 292, 0, 0, 0, 0, 0, 0, 804, - 0, 469, 959, 0, 0, 473, 0, 45, 820, 0, - 0, 974, 820, 975, 0, 0, 0, 0, 0, 0, - 0, 970, 0, 0, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 0, 161, 162, 163, 990, 991, - 0, 0, 0, 0, 0, 469, 55, 0, 0, 473, - 0, 820, 559, 57, 0, 820, 564, 0, 0, 0, - 0, 0, 984, 0, 0, 0, 0, 0, 820, 649, - 650, 651, 652, 653, 654, 655, 656, 820, 657, 658, - 659, 660, 661, 662, 663, 664, 665, 666, 667, 0, - 0, 0, 0, 0, 0, 668, 669, 670, 671, 672, - 673, 674, 675, 676, 677, 678, 679, 680, 681, 0, - 292, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 0, 693, 0, 694, 695, 696, 697, 698, - 699, 700, 701, 702, 703, 704, 705, 0, 0, 0, - 706, 707, 708, 0, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 0, 721, 722, 723, - 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, - 0, 0, 0, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 921, 755, 756, 649, 650, 651, - 652, 653, 654, 655, 656, 977, 657, 658, 659, 660, - 661, 662, 663, 664, 665, 666, 667, 0, 0, 0, - 0, 0, 0, 668, 669, 670, 671, 672, 673, 674, - 675, 676, 677, 678, 679, 680, 681, 0, 0, 682, - 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 0, 693, 0, 694, 695, 696, 697, 698, 699, 700, - 701, 702, 703, 704, 705, 0, 0, 0, 706, 707, - 708, 0, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 0, 721, 722, 723, 724, 725, - 726, 727, 728, 729, 730, 731, 732, 733, 0, 173, - 174, 734, 735, 736, 737, 738, 739, 740, 741, 742, - 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 0, 755, 756, 7, 8, 9, 10, 0, - 11, 124, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 142, 143, 144, 145, 146, 147, 148, - 0, 0, 0, 0, 0, 0, 0, 125, 149, 126, - 127, 128, 45, 46, 0, 129, 18, 0, 0, 48, - 55, 0, 0, 0, 19, 130, 559, 57, 0, 0, - 566, 131, 132, 52, 0, 0, 0, 0, 23, 0, - 0, 0, 0, 0, 0, 0, 133, 134, 26, 0, - 27, 55, 0, 0, 28, 0, 0, 56, 57, 135, - 0, 0, 59, 0, 136, 449, 450, 451, 10, 0, - 452, 40, 0, 0, 453, 0, 0, 31, 0, 0, - 0, 32, 33, 0, 0, 34, 0, 35, 0, 0, - 0, 36, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 0, 161, 162, 163, 0, 41, 0, 42, - 43, 44, 45, 454, 0, 47, 455, 0, 0, 48, - 0, 0, 0, 0, 456, 49, 0, 0, 0, 0, - 0, 50, 51, 52, 0, 0, 0, 0, 457, 0, - 0, 0, 0, 0, 0, 0, 53, 54, 458, 0, - 459, 55, 0, 0, 460, 0, 0, 56, 57, 58, - 0, 0, 59, 0, 60, 449, 450, 451, 10, 0, - 452, 40, 0, 0, 821, 0, 0, 461, 0, 0, - 0, 462, 0, 0, 0, 463, 0, 464, 0, 0, - 0, 465, 0, 880, 881, 882, 883, 884, 885, 886, - 0, 7, 8, 9, 10, 0, 11, 41, 887, 42, - 43, 44, 45, 454, 0, 47, 455, 0, 0, 48, - 0, 0, 0, 0, 456, 49, 0, 0, 0, 0, - 0, 50, 51, 52, 885, 886, 0, 0, 457, 0, - 0, 0, 0, 0, 887, 0, 53, 54, 458, 0, - 459, 55, 794, 0, 460, 0, 0, 56, 57, 58, - 19, 0, 59, 0, 60, 7, 8, 9, 10, 0, - 11, 12, 0, 0, 0, 0, 0, 461, 0, 0, - 0, 462, 0, 0, 795, 463, 796, 464, 0, 0, - 28, 465, 889, 890, 891, 0, 0, 892, 893, 894, - 895, 896, 0, 897, 898, 899, 0, 13, 0, 14, - 15, 16, 0, 797, 0, 17, 18, 798, 799, 0, - 0, 800, 0, 801, 19, 20, 0, 802, 0, 0, - 0, 21, 22, 892, 893, 894, 895, 896, 23, 897, - 898, 899, 0, 0, 0, 0, 24, 25, 26, 0, - 27, 0, 0, 0, 28, 7, 8, 9, 10, 29, - 11, 12, 0, 0, 30, 0, 0, 0, 41, 0, - 42, 43, 44, 0, 0, 0, 166, 31, 0, 0, - 0, 32, 33, 0, 0, 34, 167, 35, 0, 275, - 0, 36, 50, 168, 52, 0, 0, 13, 0, 14, - 15, 16, 0, 0, 0, 17, 18, 53, 54, 0, - 0, 0, 0, 0, 19, 20, 0, 0, 0, 0, - 58, 21, 22, 0, 0, 60, 0, 0, 23, 0, - 0, 0, 0, 0, 0, 0, 24, 25, 26, 0, - 27, 0, 0, 0, 28, 7, 8, 9, 10, 29, - 11, 12, 0, 0, 30, 0, 0, 0, 41, 399, - 42, 43, 44, 0, 0, 0, 0, 31, 0, 0, - 0, 32, 33, 0, 0, 34, 279, 35, 0, 0, - 0, 36, 50, 170, 52, 0, 0, 13, 0, 14, - 15, 16, 0, 0, 0, 17, 18, 53, 54, 0, - 0, 0, 0, 0, 19, 20, 0, 0, 0, 0, - 58, 21, 22, 0, 0, 60, 0, 0, 23, 0, - 0, 0, 0, 0, 0, 0, 24, 25, 26, 0, - 27, 0, 0, 0, 28, 7, 8, 9, 10, 29, - 11, 12, 0, 0, 30, 0, 0, 0, 41, 495, - 42, 43, 44, 0, 0, 0, 0, 31, 0, 0, - 0, 32, 33, 0, 0, 34, 0, 35, 0, 0, - 0, 36, 50, 170, 52, 0, 0, 13, 0, 14, - 15, 16, 0, 0, 0, 17, 18, 53, 54, 0, - 0, 0, 0, 0, 19, 20, 0, 0, 0, 0, - 58, 21, 22, 0, 0, 60, 0, 0, 23, 0, - 0, 0, 0, 0, 0, 0, 24, 25, 26, 0, - 27, 0, 0, 0, 28, 7, 8, 9, 10, 29, - 11, 12, 0, 0, 30, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, - 0, 32, 33, 0, 0, 34, 0, 35, 0, 845, - 0, 36, 0, 0, 0, 0, 0, 13, 0, 14, - 15, 16, 0, 0, 0, 17, 18, 0, 0, 0, - 0, 0, 0, 0, 19, 20, 0, 0, 0, 0, - 0, 21, 22, 0, 0, 0, 0, 0, 23, 0, - 0, 0, 0, 0, 0, 0, 24, 25, 26, 0, - 27, 0, 0, 0, 28, 7, 8, 9, 10, 29, - 11, 12, 0, 0, 30, 0, 0, 0, 0, 860, - 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, - 0, 32, 33, 0, 0, 34, 0, 35, 0, 0, - 0, 36, 0, 0, 0, 0, 0, 13, 0, 14, - 15, 16, 0, 0, 0, 17, 18, 0, 0, 0, - 0, 0, 0, 0, 19, 20, 0, 0, 0, 0, - 0, 21, 22, 0, 0, 0, 0, 0, 23, 0, - 0, 0, 0, 0, 0, 0, 24, 25, 26, 0, - 27, 0, 0, 0, 28, 7, 8, 9, 10, 29, - 11, 12, 0, 0, 30, 0, 0, 0, 41, 0, - 42, 43, 44, 0, 0, 0, 166, 31, 0, 0, - 0, 32, 33, 0, 0, 34, 167, 35, 0, 951, - 0, 36, 50, 168, 52, 0, 0, 13, 0, 14, - 15, 16, 0, 0, 0, 17, 18, 53, 54, 0, - 0, 0, 0, 0, 19, 20, 0, 0, 0, 0, - 58, 21, 22, 0, 0, 60, 0, 0, 23, 143, - 144, 145, 146, 147, 148, 0, 24, 25, 26, 0, - 27, 0, 0, 149, 28, 0, 0, 0, 107, 29, - 0, 0, 0, 0, 30, 0, 0, 141, 142, 143, - 144, 145, 146, 147, 148, 0, 0, 31, 0, 0, - 0, 32, 33, 149, 0, 34, 0, 35, 0, 0, - 0, 36, 141, 142, 143, 144, 145, 146, 147, 148, - 0, 0, 0, 0, 0, 0, 0, 0, 149, 0, - 0, 141, 142, 143, 144, 145, 146, 147, 148, 0, - 0, 0, 0, 0, 0, 0, 0, 149, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 0, 161, 162, - 163, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 0, 161, 162, - 163, 0, 0, 0, 345, 0, 0, 0, 0, 0, - 0, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 0, 161, 162, 163, 0, 0, 0, 914, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 0, 161, 162, 163, 363, 364, 0, 973, 504, - 505, 506, 507, 508, 509, 510, 511, 0, 0, 0, - 0, 0, 0, 0, 0, 512, 0, 513, 514, 515, - 516, 517, 518, 519, 520, 521, 522, 523, 524, 0, - 0, 0, 41, 0, 42, 43, 44, 0, 525, 0, - 47, 41, 0, 42, 43, 44, 0, 0, 0, 0, - 49, 0, 0, 0, 0, 0, 50, 51, 52, 0, - 0, 0, 526, 0, 0, 50, 170, 52, 0, 0, - 0, 53, 54, 0, 0, 0, 0, 204, 205, 0, - 53, 54, 0, 0, 58, 0, 0, 59, 0, 60, - 0, 0, 0, 58, 527, 0, 0, 528, 60, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, - 0, 540, 541, 206, 41, 542, 42, 43, 44, 45, - 207, 114, 47, 0, 0, 0, 48, 208, 209, 210, - 0, 0, 49, 0, 0, 0, 0, 211, 50, 51, - 52, 0, 0, 212, 204, 205, 0, 213, 0, 0, - 0, 214, 0, 53, 54, 0, 215, 0, 55, 0, - 0, 0, 0, 0, 216, 57, 58, 0, 217, 59, - 218, 60, 0, 0, 0, 0, 219, 0, 0, 0, - 206, 41, 0, 42, 43, 44, 45, 302, 0, 47, - 0, 0, 220, 48, 208, 209, 210, 0, 0, 49, - 0, 0, 0, 0, 211, 50, 51, 52, 0, 0, - 212, 204, 205, 0, 213, 0, 0, 0, 214, 0, - 53, 54, 0, 215, 0, 55, 0, 0, 0, 0, - 0, 216, 57, 58, 0, 217, 59, 218, 60, 141, - 142, 143, 144, 145, 146, 147, 148, 206, 41, 0, - 42, 43, 44, 45, 207, 149, 47, 0, 0, 220, - 48, 208, 209, 210, 0, 0, 49, 0, 0, 0, - 0, 211, 50, 51, 52, 0, 0, 212, 0, 0, - 0, 213, 0, 0, 0, 214, 0, 53, 54, 0, - 215, 0, 55, 0, 0, 0, 0, 0, 216, 57, - 58, 0, 217, 59, 218, 60, 141, 142, 143, 144, - 145, 146, 147, 148, 0, 0, 0, 0, 0, 0, - 0, 0, 149, 0, 0, 0, 220, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 343, 0, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 0, - 161, 162, 163, 141, 142, 143, 144, 145, 146, 147, - 148, 0, 0, 0, 0, 0, 0, 0, 0, 149, - 141, 142, 143, 144, 145, 146, 147, 148, 0, 0, - 0, 0, 0, 0, 0, 0, 149, 141, 142, 143, - 144, 145, 146, 147, 148, 0, 0, 0, 0, 0, - 0, 0, 500, 149, 0, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 0, 161, 162, 163, - 615, 616, 617, 618, 619, 620, 621, 622, 0, 0, - 0, 0, 0, 0, 0, 0, 623, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 776, 0, - 0, 0, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 0, 161, 162, 163, 912, 0, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 0, 161, 162, 163, 0, 0, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 0, 161, 162, - 163, 879, 880, 881, 882, 883, 884, 885, 886, 0, - 0, 0, 0, 0, 0, 0, 0, 887, 0, 624, - 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, - 0, 635, 636, 637, 879, 880, 881, 882, 883, 884, - 885, 886, 0, 0, 0, 0, 0, 0, 0, 0, - 887, 143, 144, 145, 146, 147, 148, 0, 0, 0, - 0, 0, 0, 0, 0, 149, 881, 882, 883, 884, - 885, 886, 0, 0, 0, 0, 0, 0, 0, 0, - 887, 881, 882, 883, 884, 885, 886, 0, 0, 0, - 0, 0, 0, 0, 0, 887, 0, 0, 971, 0, - 888, 889, 890, 891, 0, 0, 892, 893, 894, 895, - 896, 0, 897, 898, 899, 881, 882, 883, 884, 885, - 886, 0, 0, 0, 0, 0, 0, 0, 0, 887, - 0, 0, 0, 888, 889, 890, 891, 0, 0, 892, - 893, 894, 895, 896, 0, 897, 898, 899, 0, 0, - 0, 153, 154, 155, 156, 157, 158, 159, 160, 0, - 161, 162, 163, 0, 889, 890, 891, -2, 0, 892, - 893, 894, 895, 896, 0, 897, 898, 899, 0, 0, - 890, 891, 0, 0, 892, 893, 894, 895, 896, 0, - 897, 898, 899, 881, 882, 883, 884, 885, 886, 0, - 0, 0, 0, 0, 0, 0, 0, 887, 0, 0, - 74, 0, 0, 0, 0, 891, 0, 0, 892, 893, - 894, 895, 896, 75, 897, 898, 899, 0, 76, 363, - 364, 77, 145, 146, 147, 148, 0, 0, 0, 78, - 79, 0, 80, 0, 149, 0, 81, 82, 83, 0, - 883, 884, 885, 886, 0, 0, 0, 84, 0, 0, - 0, 85, 887, 0, 0, 86, 41, 0, 42, 43, - 44, 365, 366, 0, 47, 0, 87, 0, 0, 0, - 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, - 50, 51, 52, 0, 0, 0, 892, 893, 894, 895, - 896, 0, 897, 898, 899, 53, 54, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 367, 0, 58, 0, - 0, 59, 0, 60, 40, 0, 0, 0, 0, 0, - 0, 154, 155, 156, 157, 158, 159, 160, 0, 161, - 162, 163, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 892, 893, 894, 895, 896, 0, 897, 898, 899, - 41, 0, 42, 43, 44, 45, 46, 0, 47, 290, - 0, 0, 48, 0, 0, 0, 0, 0, 49, 0, - 40, 0, 0, 0, 50, 51, 52, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, - 54, 0, 0, 0, 55, 41, 0, 42, 43, 44, - 56, 57, 58, 0, 0, 59, 41, 60, 42, 43, - 44, 45, 310, 0, 47, 0, 0, 0, 48, 50, - 170, 52, 0, 0, 49, 0, 108, 0, 0, 0, - 50, 51, 52, 0, 53, 54, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 53, 54, 58, 0, 0, - 55, 41, 60, 42, 43, 44, 56, 57, 58, 0, - 0, 59, 41, 60, 42, 43, 44, 45, 0, 0, - 47, 0, 0, 0, 48, 50, 170, 52, 0, 0, - 49, 0, 40, 0, 0, 0, 50, 51, 52, 0, - 53, 54, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 53, 54, 58, 0, 0, 55, 0, 60, 0, - 0, 0, 109, 57, 58, 0, 0, 59, 41, 60, - 42, 43, 44, 45, 0, 0, 47, 0, 0, 0, - 48, 115, 0, 0, 0, 0, 49, 0, 0, 0, - 0, 0, 50, 51, 52, 0, 0, 0, 0, 0, - 0, 0, 0, 74, 0, 0, 0, 53, 54, 0, - 0, 0, 55, 0, 0, 0, 75, 0, 56, 57, - 58, 76, 0, 59, 77, 60, 0, 0, 0, 0, - 74, 0, 78, 79, 0, 80, 0, 0, 0, 81, - 82, 83, 0, 75, 0, 0, 0, 0, 76, 0, - 84, 77, 0, 0, 85, 0, 0, 74, 86, 78, - 79, 0, 80, 0, 0, 0, 81, 82, 83, 87, - 75, 0, 0, 0, 0, 76, 0, 84, 77, 0, - 0, 85, 0, 0, 74, 86, 78, 79, 361, 80, - 0, 0, 0, 81, 82, 83, 87, 75, 0, 0, - 0, 0, 76, 0, 84, 77, 0, 0, 85, 0, - 0, 74, 86, 78, 79, 420, 80, 0, 0, 0, - 81, 82, 83, 87, 75, 0, 0, 0, 0, 76, - 0, 84, 77, 0, 0, 85, 0, 0, 0, 86, - 78, 79, 487, 80, 0, 0, 0, 81, 82, 83, - 87, 0, 0, 0, 0, 0, 0, 0, 84, 0, - 0, 41, 85, 42, 43, 44, 86, 0, 0, 576, - 0, 0, 0, 0, 0, 0, 0, 87, 0, 0, - 0, 0, 0, 0, 0, 50, 170, 52, 0, 0, - 0, 74, 0, 0, 0, 0, 785, 0, 0, 0, - 53, 54, 0, 0, 75, 0, 0, 0, 0, 76, - 0, 0, 77, 58, 0, 0, 0, 0, 60, 0, - 78, 79, 0, 80, 0, 0, 0, 81, 82, 83, - 0, 0, 0, 0, 0, 0, 0, 0, 84, 0, - 0, 118, 85, 0, 0, 0, 86 -}; +#define YYPACT_NINF -603 #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-490))) + (!!((Yystate) == (-603))) + +#define YYTABLE_NINF -242 #define yytable_value_is_error(Yytable_value) \ - YYID (0) + 0 + + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +static const yytype_int16 yypact[] = +{ + 225, -603, 2053, 3183, 23, 3073, -603, -603, -603, -603, + -603, -603, -97, -74, -61, -33, -22, -20, -2, -603, + 7, 14, 48, 3295, 56, 63, 66, 78, -603, 91, + 94, 2053, 2053, 2053, 2053, 908, 2053, 2621, -603, 219, + -603, -603, -603, -603, -603, -603, 3351, -603, -603, -603, + -603, 1574, -603, 1284, 1284, -603, 326, -603, 1284, -603, + -603, 124, -603, -603, -603, -603, 123, 60, 1, -603, + -603, -603, -603, -603, -603, -603, 122, -603, 125, 127, + 64, 160, 162, 167, -603, -603, 27, -603, -603, -603, + -603, 2390, -603, -603, -603, -603, -603, 2053, 2053, 2053, + 2053, 2053, 2053, 3183, 2053, 2053, 2053, -603, 326, 149, + 326, 326, -603, 2053, 2053, 3183, 3183, 2053, 2053, 164, + 164, 164, 164, -97, -74, -61, -33, -22, -20, 7, + 14, 2024, 2317, 3054, 3228, 94, 153, -83, 2621, 164, + 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, + 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, + 2053, 1513, 2053, -603, 124, -603, -603, 1664, -603, 1284, + -603, -603, -603, -603, -603, -603, 165, 124, 124, 124, + 124, 124, 170, -603, -603, 3117, 181, -603, -14, -603, + 3523, 286, 326, -603, 191, -603, -603, -603, 192, 2457, + -603, 326, -603, 198, 207, -603, -603, -603, 310, -603, + -603, -603, 3239, -603, -603, 326, -603, -603, -603, 326, + 312, 228, -603, -603, -603, 60, 1, -603, 214, 240, + -603, 224, 226, 242, 260, 269, 249, 273, 275, 282, + -603, 2053, -603, -603, 291, 298, 300, 313, 302, 304, + 2053, 2053, -603, 1330, 2115, 812, 812, 378, 378, 193, + 193, -603, 2547, 2800, 2815, 2942, 378, 378, 139, 139, + 164, 164, 164, -603, -603, -37, 2145, 170, -603, 124, + 170, 170, 170, 170, 235, 2053, 326, 315, -603, -603, + -603, -603, 3117, -603, 322, -603, 336, 338, 3388, -603, + 3127, 312, -603, -603, -603, 24, 219, 3351, 44, -603, + -603, 323, -603, -603, 326, 1603, -603, -603, 232, 80, + -14, -603, -603, -603, -603, -603, -603, 327, -603, -603, + -603, 320, -603, -603, -603, 328, -603, -603, 164, 2621, + 2053, -603, -603, 170, 330, 321, 2621, -603, 37, -603, + 349, 3415, 2, 350, 352, -603, 450, 326, -603, -603, + -603, -603, 326, 2308, 326, 344, 355, -603, 403, -603, + -603, -603, 232, 1313, 345, 232, 1313, 44, -603, -603, + 346, 44, 44, 44, 44, 248, -603, 3442, -603, 339, + -603, 271, -603, 353, 1693, 2568, 360, 232, 232, 2307, + 232, 232, 232, -603, 365, -603, 3117, 2053, -603, 2053, + 2621, 1313, -603, -603, 2053, -603, 132, 530, 767, 335, + -603, -603, 2, -30, 356, 3469, 372, 403, 376, 405, + 3127, -603, -603, 385, 403, 403, 403, 403, 403, -70, + -603, -603, 365, -603, -603, -603, 403, -603, 3351, 390, + -603, 3295, 382, 393, -603, 2053, 2053, 2053, 908, 2053, + 386, 9, -603, 403, 2735, -603, 219, -603, 232, 176, + 392, 259, 44, 391, 391, 391, 391, -603, 2053, -603, + 1313, -603, 1184, -603, -603, 326, 2053, 1693, 394, 412, + 2621, -603, -603, 232, 266, 266, -603, -603, -603, -603, + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + -603, -603, 397, 396, -603, -603, 266, 266, 218, 142, + 1603, -603, 2053, 413, -603, -603, 349, -29, -23, 402, + 2587, 326, 546, 326, -603, -603, 546, -603, 546, -603, + 546, 546, 546, 3496, -603, 522, 422, 326, -603, 3183, + -70, 3183, 2457, -603, -603, -603, -603, 403, 406, 406, + 406, 406, 278, 699, 2053, -603, -603, 426, -603, -5, + 403, 3183, 410, 3183, 3183, 164, 164, 164, 409, -8, + 164, 486, -603, 1413, -5, 2053, 2053, 2053, 2053, 2053, + 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, + 2053, 2053, 2053, 2053, 2053, 2053, 1783, 2053, 229, 536, + 418, 486, -603, 391, 1313, 414, 419, -603, -603, -603, + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + -603, -603, -603, -603, -603, -603, 417, -603, 429, 425, + -603, 1873, 266, -603, -603, -603, -603, 2568, 1313, 427, + 232, -603, -603, 486, -603, -603, -603, -603, -603, -603, + -603, -603, -603, -603, 433, -603, 437, -603, -603, -603, + 406, 440, 451, 441, 452, 699, 699, 699, 699, 908, + 699, 2769, -603, 442, 232, 2053, -603, -5, 453, 2053, + 446, 457, 2053, -603, -603, 3, -603, -603, -603, -603, + 1330, 2115, 812, 812, 378, 378, 193, 193, -603, 2604, + 2800, 2815, 2942, 378, 378, 139, 139, 164, 164, 164, + -603, -603, 35, 2170, 454, -603, 3, 1313, 448, -603, + 486, 1056, -603, -603, -603, 1693, 2621, 455, -603, -603, + 3, 469, 472, 1313, 3183, 3183, 3183, 239, 239, 239, + 239, 458, 58, 239, 699, 699, 699, 699, 699, 699, + 699, 699, 699, 699, 699, 699, 699, 699, 699, 699, + 699, 699, 699, 1963, 2053, -603, -603, 2621, -603, 462, + 465, -603, 468, 164, -603, 479, 2053, -603, -603, -603, + 1313, 484, 486, 3, -603, 485, 486, -603, -603, 497, + 495, 500, 506, 699, -603, 2785, 2927, 532, 532, 496, + 496, 569, 569, -603, 2752, 2957, 2972, 2987, 200, 200, + 239, 239, 239, -603, -603, 116, 2189, 2053, -603, 2053, + 30, 2621, 1313, 504, 486, 3, -603, 3, 486, 515, + -603, 518, 239, 699, -603, -603, 118, 146, -603, 528, + 554, 486, 3, 3, 2053, 2053, 2769, -603, -603, -603, + 486, 3, 154, 168, 3, -603, -603 +}; + + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_uint16 yydefact[] = +{ + 0, 542, 0, 0, 0, 542, 5, 490, 486, 489, + 540, 492, 0, 0, 0, 0, 0, 0, 0, 488, + 0, 0, 0, 0, 0, 0, 0, 0, 487, 0, + 0, 0, 0, 0, 0, 0, 0, 3, 436, 491, + 199, 264, 265, 267, 268, 253, 0, 281, 252, 279, + 274, 270, 271, 269, 273, 254, 0, 255, 272, 284, + 266, 542, 4, 201, 202, 203, 0, 243, 0, 198, + 261, 262, 263, 1, 20, 21, 0, 29, 0, 0, + 0, 0, 0, 0, 116, 542, 0, 6, 15, 7, + 18, 0, 13, 14, 16, 17, 31, 542, 542, 542, + 542, 542, 542, 0, 542, 542, 542, 216, 0, 454, + 0, 0, 215, 542, 542, 0, 0, 542, 542, 460, + 458, 459, 457, 199, 264, 265, 267, 268, 281, 279, + 274, 270, 269, 273, 272, 266, 0, 0, 401, 456, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 541, 542, 283, 280, 270, 276, 270, + 275, 278, 538, 539, 200, 277, 0, 542, 542, 542, + 542, 542, 220, 190, 542, 0, 241, 222, 204, 22, + 542, 0, 0, 542, 0, 25, 24, 23, 0, 0, + 19, 0, 259, 69, 207, 42, 32, 43, 33, 38, + 36, 40, 0, 41, 35, 0, 37, 39, 11, 0, + 0, 44, 209, 210, 211, 243, 0, 206, 0, 400, + 399, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 217, 542, 219, 218, 0, 0, 0, 0, 0, 0, + 0, 0, 485, 469, 470, 471, 472, 473, 474, 477, + 478, 484, 0, 466, 467, 468, 475, 476, 464, 465, + 461, 462, 463, 483, 482, 0, 0, 221, 282, 542, + 194, 191, 193, 192, 0, 542, 249, 0, 246, 245, + 242, 244, 0, 542, 542, 30, 0, 0, 542, 256, + 542, 0, 50, 260, 55, 57, 34, 0, 542, 208, + 542, 0, 285, 154, 0, 0, 47, 46, 0, 214, + 212, 440, 446, 442, 444, 445, 452, 0, 451, 441, + 448, 0, 447, 450, 453, 0, 449, 443, 437, 402, + 0, 481, 480, 195, 0, 0, 398, 397, 250, 239, + 205, 542, 0, 0, 227, 226, 0, 0, 258, 542, + 129, 130, 0, 0, 0, 0, 119, 120, 542, 128, + 118, 52, 0, 542, 0, 0, 542, 542, 171, 172, + 0, 542, 542, 542, 542, 0, 170, 542, 59, 0, + 542, 0, 8, 0, 542, 0, 0, 0, 0, 0, + 0, 0, 0, 45, 542, 131, 0, 0, 455, 0, + 479, 542, 196, 247, 0, 223, 0, 0, 0, 0, + 228, 542, 0, 0, 0, 542, 122, 542, 124, 542, + 0, 180, 181, 0, 542, 542, 542, 542, 542, 542, + 179, 51, 542, 533, 529, 532, 542, 144, 0, 0, + 531, 0, 0, 0, 530, 0, 0, 0, 0, 0, + 0, 145, 148, 542, 169, 493, 534, 143, 0, 0, + 0, 0, 542, 176, 173, 175, 174, 65, 542, 12, + 542, 155, 286, 287, 285, 0, 542, 542, 0, 160, + 162, 159, 157, 0, 136, 133, 85, 86, 87, 88, + 89, 90, 93, 94, 109, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 113, 112, 96, + 95, 82, 84, 83, 91, 92, 80, 81, 77, 78, + 79, 76, 0, 0, 75, 132, 135, 134, 0, 0, + 0, 141, 542, 0, 48, 152, 213, 0, 0, 0, + 251, 0, 0, 0, 232, 535, 0, 231, 0, 230, + 0, 0, 0, 542, 229, 0, 0, 0, 257, 0, + 542, 0, 0, 114, 117, 115, 121, 542, 185, 182, + 184, 183, 0, 0, 542, 126, 150, 0, 53, 542, + 542, 0, 498, 0, 0, 503, 502, 501, 0, 0, + 500, 542, 147, 0, 542, 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, 542, 67, 177, 542, 0, 0, 289, 290, 292, + 291, 296, 293, 294, 295, 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, 334, 335, 352, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, + 372, 373, 542, 390, 391, 392, 383, 395, 379, 380, + 378, 385, 386, 374, 375, 376, 377, 384, 382, 389, + 387, 393, 388, 381, 394, 288, 0, 9, 0, 0, + 158, 161, 137, 111, 110, 140, 139, 153, 542, 0, + 0, 439, 438, 542, 248, 537, 238, 536, 237, 236, + 235, 234, 233, 225, 0, 26, 0, 123, 127, 125, + 186, 189, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 151, 403, 0, 0, 0, 167, 542, 0, 542, + 0, 0, 0, 528, 71, 56, 70, 146, 149, 166, + 512, 513, 514, 515, 516, 517, 520, 521, 527, 0, + 509, 510, 511, 518, 519, 507, 508, 504, 505, 506, + 526, 525, 0, 0, 0, 61, 58, 542, 0, 178, + 542, 0, 156, 10, 163, 542, 164, 0, 138, 49, + 197, 0, 0, 542, 0, 0, 0, 412, 410, 411, + 409, 0, 0, 408, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 187, 54, 153, 168, 0, + 0, 497, 0, 494, 72, 0, 0, 524, 523, 63, + 542, 0, 542, 60, 396, 0, 542, 27, 28, 0, + 0, 0, 0, 0, 435, 421, 422, 423, 424, 425, + 426, 427, 428, 434, 0, 418, 419, 420, 416, 417, + 413, 414, 415, 433, 432, 0, 0, 0, 499, 0, + 0, 522, 542, 0, 542, 66, 165, 142, 542, 0, + 407, 0, 404, 0, 431, 430, 0, 0, 73, 0, + 0, 542, 68, 188, 0, 0, 429, 496, 495, 74, + 542, 62, 0, 0, 64, 406, 405 +}; + + /* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -603, -603, -173, -603, 174, -603, -603, 507, -603, -603, + -80, 256, -603, -64, -603, -603, -108, 499, -603, -603, + -603, -603, -603, -603, -603, -602, -603, -603, 270, -603, + -603, -603, 279, 348, -335, -603, -352, -603, 131, -420, + -268, -485, -603, 105, -307, -311, -132, -40, 514, 263, + 15, -90, -603, -88, -603, -603, -603, 293, -84, -603, + -284, -603, -603, 19, 76, -603, -603, -603, 38, 102, + -603, -603, 236, -603, -3, -603, -435, -87, -19, 13, + 55, -141, -603, -603, -305, 491, -153, -1 +}; + + /* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 4, 5, 391, 392, 88, 310, 89, 90, 190, + 91, 92, 318, 403, 200, 372, 441, 220, 373, 376, + 480, 900, 942, 634, 837, 805, 535, 574, 93, 198, + 365, 366, 367, 368, 404, 758, 460, 461, 585, 543, + 316, 488, 489, 462, 385, 439, 182, 61, 221, 109, + 62, 63, 293, 64, 294, 353, 354, 420, 65, 66, + 290, 286, 287, 67, 68, 94, 359, 95, 69, 70, + 71, 72, 389, 390, 482, 745, 345, 228, 229, 791, + 138, 38, 464, 465, 554, 405, 39, 230 +}; + + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ +static const yytype_int16 yytable[] = +{ + 6, 222, 749, 223, 96, 199, 164, 224, 350, 172, + 173, 231, 232, 233, 234, 235, 137, 237, 238, 239, + 298, 602, 587, 73, 470, 251, 244, 245, 97, 836, + 248, 249, 277, 371, 374, 172, 173, 442, 172, 173, + 469, 583, 110, 635, 252, 280, 281, 282, 283, 284, + 136, 98, 378, 379, 380, 306, 584, 37, 381, 549, + 183, 112, 494, 495, 99, 536, 537, 538, 172, 173, + 471, 251, 172, 173, 473, 474, 475, 476, 565, 251, + 894, 416, 417, 418, 96, 251, 119, 120, 121, 122, + 341, 139, 100, -224, 895, 382, -224, 566, 761, 111, + 251, 419, 201, 101, 762, 102, 795, 759, 187, 222, + 225, 223, 557, 559, 103, 224, 570, 603, 236, 803, + 351, 584, 546, 578, 579, 580, 581, 582, 636, 227, + 246, 247, 104, 628, 176, 589, 544, 387, 177, 105, + 172, 173, 275, 251, 375, 413, 756, 343, 414, 793, + 172, 173, 604, 168, 331, 170, 171, 958, 752, 383, + 175, 850, 897, 183, 384, 633, 251, 226, 148, 796, + 185, 193, 308, 106, 588, 178, 183, 183, 183, 183, + 183, 113, 45, 288, 809, 914, 425, -241, 114, 96, + 406, 115, 6, 148, 116, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 117, 276, 225, 118, + 466, 55, 148, 466, 251, 163, 251, 551, 57, 872, + 184, 552, 189, 168, 170, 171, 175, 227, 903, 179, + 172, 173, 396, 954, 180, 967, 397, 766, 563, 181, + 191, 768, 192, 769, 251, 770, 771, 772, 466, 157, + 158, 159, 251, 160, 161, 162, 780, 377, 872, 168, + 195, 168, 196, 968, 241, 226, 251, 197, 183, 797, + 250, 975, 838, 398, 347, 279, 629, 291, 160, 161, + 162, 292, 6, 355, 296, 976, 285, 96, 299, 370, + 945, 541, 542, 630, 947, 338, 339, 386, 300, 6, + 399, 155, 156, 157, 158, 159, 10, 160, 161, 162, + 879, 880, 881, 304, 882, 883, 884, 466, 629, 1, + 2, 3, 305, 463, 172, 173, 463, 317, 369, 629, + 346, 321, 962, 541, 542, 755, 963, 400, 251, 572, + 96, 322, 401, 323, 541, 542, 834, 402, 6, 971, + 905, 285, 344, 882, 883, 884, 327, 440, 974, 324, + 395, 463, 467, 477, 478, 467, 386, 888, 484, 485, + 386, 386, 386, 386, 632, 478, 96, 325, 547, 483, + 548, 541, 542, 491, 291, 410, 326, 146, 147, 748, + 328, 369, 329, 545, 584, 781, 847, 148, 590, 330, + 467, 431, 432, 433, 560, 561, 562, 434, 332, 312, + 6, 313, 314, 315, 96, 333, 440, 334, 96, 336, + 335, 337, 352, 440, 440, 440, 440, 440, 586, 599, + 463, 545, 792, 349, 356, 440, 357, 408, 388, 490, + 466, 412, 407, 409, 435, 411, -240, 421, 423, 442, + 422, 429, 440, 430, 567, 468, 472, 481, 369, 550, + 110, 386, 312, 598, 313, 539, 540, 347, 486, 467, + 493, 466, 222, 569, 223, 901, 491, 571, 224, 112, + 541, 542, 553, 553, 553, 84, 155, 156, 157, 158, + 159, 909, 160, 161, 162, 577, 591, 593, 291, 594, + 595, 596, 597, 601, 600, 870, 871, 478, 436, 631, + 751, 760, 750, 437, 753, 872, 754, 111, 438, 763, + 774, 775, 584, 346, 794, 799, 802, 804, 172, 173, + 756, 347, 490, 835, 839, 842, 840, 174, 943, 868, + 869, 870, 871, 844, 172, 173, 843, 848, 186, 188, + 851, 872, 96, 463, 852, 853, 855, 854, 856, 586, + 889, 194, 885, 891, 892, 902, 440, 202, 907, 899, + 45, 908, 906, 347, 777, 913, 779, 937, 545, 440, + 960, 225, 938, 939, 463, 757, 45, 346, 872, 240, + 806, 242, 243, 545, 940, 466, 798, 832, 800, 801, + 227, 944, 949, 946, 877, 878, 879, 880, 881, 55, + 882, 883, 884, 951, 948, 551, 57, 950, 553, 556, + 806, 961, 553, 467, 553, 55, 553, 553, 553, 346, + 964, 551, 57, 965, 792, 792, 792, 792, 226, 792, + 877, 878, 879, 880, 881, 969, 882, 883, 884, 747, + 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, + 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, + 830, 970, 833, 297, 466, 573, 886, 877, 878, 879, + 880, 881, 303, 882, 883, 884, 849, 295, 301, 575, + 466, 778, 7, 8, 9, 10, 309, 11, 808, 576, + 311, 427, 890, 302, 592, 564, 319, 320, 463, 841, + 746, 483, 0, 792, 792, 792, 792, 792, 792, 792, + 792, 792, 792, 792, 792, 792, 792, 792, 792, 792, + 792, 792, 0, 0, 0, 0, 0, 466, 0, 0, + 0, 0, 0, 782, 0, 0, 0, 467, 0, 0, + 0, 19, 806, 0, 0, 0, 0, 0, 0, 0, + 862, 0, 792, 0, 0, 172, 173, 348, 0, 0, + 0, 0, 0, 0, 0, 783, 0, 784, 0, 466, + 0, 28, 0, 0, 0, 0, 545, 463, 857, 858, + 859, 860, 0, 863, 861, 393, 846, 0, 0, 0, + 0, 0, 792, 463, 785, 0, 0, 45, 786, 787, + 0, 0, 788, 0, 789, 0, 0, 0, 790, 144, + 145, 146, 147, 0, 0, 0, 467, 0, 0, 806, + 0, 148, 0, 0, 491, 0, 0, 0, 424, 0, + 887, 0, 467, 426, 0, 428, 55, 893, 0, 0, + 463, 0, 551, 57, 935, 0, 558, 0, 0, 910, + 911, 912, 0, 0, 0, 0, 0, 915, 916, 917, + 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, + 928, 929, 930, 931, 932, 933, 0, 0, 0, 467, + 490, 806, 463, 0, 0, 806, 0, 555, 555, 555, + 0, 7, 8, 9, 10, 0, 11, 123, 956, 0, + 957, 0, 0, 0, 0, 0, 952, 0, 153, 154, + 155, 156, 157, 158, 159, 0, 160, 161, 162, 936, + 0, 467, 0, 806, 0, 972, 973, 806, 0, 0, + 0, 941, 0, 124, 0, 125, 126, 127, 45, 46, + 806, 128, 18, 0, 0, 48, 966, 0, 0, 806, + 19, 129, 0, 0, 0, 0, 393, 130, 131, 52, + 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, + 0, 0, 132, 133, 26, 0, 27, 55, 0, 0, + 28, 0, 0, 56, 57, 134, 0, 0, 59, 0, + 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 31, 0, 0, 0, 32, 33, 0, + 393, 34, 0, 35, 0, 0, 0, 36, 0, 0, + 0, 0, 765, 555, 767, 0, 0, 555, 0, 555, + 0, 555, 555, 555, 0, 0, 0, 0, 776, 637, + 638, 639, 640, 641, 642, 643, 644, 0, 645, 646, + 647, 648, 649, 650, 651, 652, 653, 654, 655, 0, + 0, 0, 0, 0, 0, 656, 657, 658, 659, 660, + 661, 662, 663, 664, 665, 666, 667, 668, 669, 0, + 0, 670, 671, 672, 673, 674, 675, 676, 677, 678, + 679, 680, 0, 681, 0, 682, 683, 684, 685, 686, + 687, 688, 689, 690, 691, 692, 693, 0, 0, 0, + 694, 695, 696, 0, 697, 698, 699, 700, 701, 702, + 703, 704, 705, 706, 707, 708, 0, 709, 710, 711, + 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, + 0, 0, 0, 722, 723, 724, 725, 726, 727, 728, + 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, + 739, 740, 741, 742, 904, 743, 744, 637, 638, 639, + 640, 641, 642, 643, 644, 0, 645, 646, 647, 648, + 649, 650, 651, 652, 653, 654, 655, 0, 0, 0, + 0, 0, 0, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 0, 0, 670, + 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, + 0, 681, 0, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 0, 0, 0, 694, 695, + 696, 0, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 0, 709, 710, 711, 712, 713, + 714, 715, 716, 717, 718, 719, 720, 721, 0, 0, + 0, 722, 723, 724, 725, 726, 727, 728, 729, 730, + 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 0, 743, 744, 0, 443, 444, 445, 10, + 0, 446, 40, 0, 0, 447, 0, 0, 0, 41, + 0, 42, 43, 44, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 141, 142, 143, 144, 145, 146, + 147, 0, 0, 50, 169, 52, 0, 0, 41, 148, + 42, 43, 44, 45, 448, 0, 47, 449, 53, 54, + 48, 0, 0, 0, 0, 450, 49, 0, 0, 0, + 0, 58, 50, 51, 52, 0, 60, 0, 0, 451, + 0, 0, 0, 0, 0, 0, 0, 53, 54, 452, + 0, 453, 55, 0, 0, 454, 0, 0, 56, 57, + 58, 0, 0, 59, 0, 60, 443, 444, 445, 10, + 0, 446, 40, 0, 0, 807, 0, 0, 455, 0, + 0, 959, 456, 0, 0, 0, 457, 0, 458, 0, + 0, 0, 459, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 0, 160, 161, 162, 0, 41, 0, + 42, 43, 44, 45, 448, 0, 47, 449, 0, 0, + 48, 0, 0, 0, 0, 450, 49, 0, 0, 0, + 0, 0, 50, 51, 52, 0, 0, 0, 0, 451, + 0, 0, 0, 0, 0, 0, 0, 53, 54, 452, + 0, 453, 55, 0, 0, 454, 0, 0, 56, 57, + 58, 0, 0, 59, 0, 60, 7, 8, 9, 10, + 0, 11, 12, 0, 0, 0, 0, 0, 455, 0, + 0, 0, 456, 0, 0, 0, 457, 0, 458, 0, + 0, 0, 459, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, + 14, 15, 16, 0, 0, 0, 17, 18, 0, 0, + 0, 0, 0, 0, 0, 19, 20, 0, 0, 0, + 0, 0, 21, 22, 0, 0, 0, 0, 0, 23, + 0, 0, 0, 0, 0, 0, 0, 24, 25, 26, + 0, 27, 0, 0, 0, 28, 7, 8, 9, 10, + 29, 11, 12, 0, 0, 30, 0, 0, 0, 41, + 0, 42, 43, 44, 0, 0, 0, 165, 31, 0, + 0, 0, 32, 33, 0, 0, 34, 166, 35, 0, + 274, 0, 36, 50, 167, 52, 0, 0, 13, 0, + 14, 15, 16, 0, 0, 0, 17, 18, 53, 54, + 0, 0, 0, 0, 0, 19, 20, 0, 0, 0, + 0, 58, 21, 22, 0, 0, 60, 0, 0, 23, + 0, 0, 0, 0, 0, 0, 0, 24, 25, 26, + 0, 27, 0, 0, 0, 28, 7, 8, 9, 10, + 29, 11, 12, 0, 0, 30, 0, 0, 0, 41, + 394, 42, 43, 44, 0, 0, 0, 0, 31, 0, + 0, 0, 32, 33, 0, 0, 34, 278, 35, 0, + 0, 0, 36, 50, 169, 52, 0, 0, 13, 0, + 14, 15, 16, 0, 0, 0, 17, 18, 53, 54, + 0, 0, 0, 0, 0, 19, 20, 0, 0, 0, + 0, 58, 21, 22, 0, 0, 60, 0, 0, 23, + 0, 0, 0, 0, 0, 0, 0, 24, 25, 26, + 0, 27, 0, 0, 0, 28, 7, 8, 9, 10, + 29, 11, 12, 0, 0, 30, 0, 0, 0, 0, + 487, 0, 0, 0, 0, 0, 0, 0, 31, 0, + 0, 0, 32, 33, 0, 0, 34, 0, 35, 0, + 0, 0, 36, 0, 0, 0, 0, 0, 13, 0, + 14, 15, 16, 0, 0, 0, 17, 18, 0, 0, + 0, 0, 0, 0, 0, 19, 20, 0, 0, 0, + 0, 0, 21, 22, 0, 0, 0, 0, 0, 23, + 0, 0, 0, 0, 0, 0, 0, 24, 25, 26, + 0, 27, 0, 0, 0, 28, 7, 8, 9, 10, + 29, 11, 12, 0, 0, 30, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, + 0, 0, 32, 33, 0, 0, 34, 0, 35, 0, + 831, 0, 36, 0, 0, 0, 0, 0, 13, 0, + 14, 15, 16, 0, 0, 0, 17, 18, 0, 0, + 0, 0, 0, 0, 0, 19, 20, 0, 0, 0, + 0, 0, 21, 22, 0, 0, 0, 0, 0, 23, + 0, 0, 0, 0, 0, 0, 0, 24, 25, 26, + 0, 27, 0, 0, 0, 28, 7, 8, 9, 10, + 29, 11, 12, 0, 0, 30, 0, 0, 0, 0, + 845, 0, 0, 0, 0, 0, 0, 0, 31, 0, + 0, 0, 32, 33, 0, 0, 34, 0, 35, 0, + 0, 0, 36, 0, 0, 0, 0, 0, 13, 0, + 14, 15, 16, 0, 0, 0, 17, 18, 0, 0, + 0, 0, 0, 0, 0, 19, 20, 0, 0, 0, + 0, 0, 21, 22, 0, 0, 0, 0, 0, 23, + 0, 0, 0, 0, 0, 0, 0, 24, 25, 26, + 0, 27, 0, 0, 0, 28, 7, 8, 9, 10, + 29, 11, 12, 0, 0, 30, 0, 0, 0, 41, + 0, 42, 43, 44, 0, 0, 0, 165, 31, 0, + 0, 0, 32, 33, 0, 0, 34, 166, 35, 0, + 934, 0, 36, 50, 167, 52, 0, 0, 13, 0, + 14, 15, 16, 0, 0, 0, 17, 18, 53, 54, + 0, 0, 0, 0, 0, 19, 20, 0, 0, 0, + 0, 58, 21, 22, 0, 0, 60, 0, 0, 23, + 142, 143, 144, 145, 146, 147, 0, 24, 25, 26, + 0, 27, 0, 0, 148, 28, 0, 0, 0, 106, + 29, 0, 0, 0, 0, 30, 0, 0, 140, 141, + 142, 143, 144, 145, 146, 147, 0, 0, 31, 0, + 0, 0, 32, 33, 148, 0, 34, 0, 35, 0, + 0, 0, 36, 140, 141, 142, 143, 144, 145, 146, + 147, 0, 0, 0, 0, 0, 0, 0, 0, 148, + 0, 0, 140, 141, 142, 143, 144, 145, 146, 147, + 0, 0, 0, 0, 0, 0, 0, 0, 148, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 0, 160, + 161, 162, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 0, 160, + 161, 162, 0, 0, 0, 342, 0, 0, 0, 0, + 0, 0, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 0, 160, 161, 162, 0, 0, 0, + 898, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 0, 160, 161, 162, 360, 361, 0, 955, + 496, 497, 498, 499, 500, 501, 502, 503, 0, 0, + 0, 0, 0, 0, 0, 0, 504, 0, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, + 0, 0, 0, 41, 0, 42, 43, 44, 0, 517, + 0, 47, 41, 0, 42, 43, 44, 0, 0, 0, + 0, 49, 0, 0, 0, 0, 0, 50, 51, 52, + 0, 0, 0, 518, 0, 0, 50, 169, 52, 0, + 0, 0, 53, 54, 0, 0, 0, 0, 203, 204, + 0, 53, 54, 0, 0, 58, 0, 0, 59, 0, + 60, 0, 0, 0, 58, 519, 0, 0, 520, 60, + 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, + 531, 0, 532, 533, 205, 41, 534, 42, 43, 44, + 45, 206, 113, 47, 0, 0, 0, 48, 207, 208, + 209, 0, 0, 49, 0, 0, 0, 0, 210, 50, + 51, 52, 0, 0, 211, 203, 204, 0, 212, 0, + 0, 0, 213, 0, 53, 54, 0, 214, 0, 55, + 0, 0, 0, 0, 0, 215, 57, 58, 0, 216, + 59, 217, 60, 0, 0, 0, 0, 218, 0, 0, + 0, 205, 41, 0, 42, 43, 44, 45, 206, 0, + 47, 0, 0, 219, 48, 207, 208, 209, 0, 0, + 49, 0, 0, 0, 0, 210, 50, 51, 52, 0, + 0, 211, 0, 0, 0, 212, 0, 0, 0, 213, + 0, 53, 54, 0, 214, 0, 55, 0, 0, 0, + 0, 0, 215, 57, 58, 0, 216, 59, 217, 60, + 140, 141, 142, 143, 144, 145, 146, 147, 0, 0, + 0, 0, 0, 0, 0, 0, 148, 0, 0, 0, + 219, 140, 141, 142, 143, 144, 145, 146, 147, 0, + 0, 0, 0, 0, 0, 0, 0, 148, 0, 0, + 140, 141, 142, 143, 144, 145, 146, 147, 0, 0, + 0, 0, 0, 0, 0, 0, 148, 140, 141, 142, + 143, 144, 145, 146, 147, 0, 0, 0, 0, 0, + 0, 0, 0, 148, 140, 141, 142, 143, 144, 145, + 146, 147, 0, 0, 0, 0, 0, 0, 0, 0, + 148, 0, 0, 0, 0, 0, 0, 340, 0, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 0, 160, 161, 162, 0, 0, 0, 492, 0, 0, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 0, 160, 161, 162, 764, 0, 0, 0, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 0, 160, 161, 162, 896, 0, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 0, 160, 161, + 162, 0, 0, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 0, 160, 161, 162, 605, 606, + 607, 608, 609, 610, 611, 612, 0, 0, 0, 0, + 0, 0, 0, 0, 613, 864, 865, 866, 867, 868, + 869, 870, 871, 0, 0, 0, 0, 0, 0, 0, + 0, 872, 864, 865, 866, 867, 868, 869, 870, 871, + 0, 0, 0, 0, 0, 0, 0, 0, 872, 865, + 866, 867, 868, 869, 870, 871, 0, 0, 0, 0, + 0, 0, 0, 0, 872, 142, 143, 144, 145, 146, + 147, 0, 0, 0, 0, 0, 0, 0, 0, 148, + 142, 143, 144, 145, 146, 147, 0, 0, 0, 0, + 0, 0, 0, 0, 148, 0, 0, 614, 615, 616, + 617, 618, 619, 620, 621, 622, 623, 624, 0, 625, + 626, 627, 953, 0, 873, 874, 875, 876, 0, 0, + 877, 878, 879, 880, 881, 0, 882, 883, 884, 0, + 0, 873, 874, 875, 876, 0, 0, 877, 878, 879, + 880, 881, 0, 882, 883, 884, 0, 0, 874, 875, + 876, 0, 0, 877, 878, 879, 880, 881, 0, 882, + 883, 884, 0, 0, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 0, 160, 161, 162, 0, 0, 0, + 152, 153, 154, 155, 156, 157, 158, 159, 0, 160, + 161, 162, 866, 867, 868, 869, 870, 871, 0, 0, + 0, 0, 0, 0, 0, 0, 872, 142, 143, 144, + 145, 146, 147, 0, 0, 0, 0, 0, 0, 0, + 0, 148, 866, 867, 868, 869, 870, 871, 0, 0, + 0, 0, 0, 0, 0, 0, 872, 866, 867, 868, + 869, 870, 871, 0, 0, 0, 0, 0, 0, 0, + 0, 872, 866, 867, 868, 869, 870, 871, 0, 0, + 0, 0, 0, 0, 0, 0, 872, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 874, 875, 876, 0, 0, 877, 878, 879, 880, 881, + 0, 882, 883, 884, 0, 0, 0, 0, 153, 154, + 155, 156, 157, 158, 159, 0, 160, 161, 162, 0, + 0, 875, 876, -2, 0, 877, 878, 879, 880, 881, + 0, 882, 883, 884, 0, 0, 0, 876, 0, 0, + 877, 878, 879, 880, 881, 0, 882, 883, 884, 41, + 0, 42, 43, 44, 0, 877, 878, 879, 880, 881, + 0, 882, 883, 884, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 50, 169, 52, 289, 0, 0, 75, + 0, 0, 0, 0, 76, 360, 361, 77, 53, 54, + 0, 0, 0, 0, 0, 78, 79, 0, 80, 0, + 0, 58, 81, 82, 83, 0, 60, 0, 0, 0, + 0, 0, 41, 84, 42, 43, 44, 85, 0, 0, + 0, 86, 41, 0, 42, 43, 44, 362, 363, 114, + 47, 0, 87, 0, 0, 0, 50, 169, 52, 0, + 49, 0, 40, 0, 0, 0, 50, 51, 52, 0, + 0, 53, 54, 0, 0, 0, 0, 0, 0, 0, + 0, 53, 54, 0, 58, 0, 0, 0, 0, 60, + 0, 0, 364, 0, 58, 0, 0, 59, 41, 60, + 42, 43, 44, 45, 46, 0, 47, 0, 0, 0, + 48, 0, 0, 0, 0, 0, 49, 0, 40, 0, + 0, 0, 50, 51, 52, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 53, 54, 0, + 0, 0, 55, 41, 0, 42, 43, 44, 56, 57, + 58, 0, 0, 59, 41, 60, 42, 43, 44, 45, + 307, 0, 47, 0, 0, 0, 48, 50, 169, 52, + 0, 0, 49, 0, 107, 0, 0, 0, 50, 51, + 52, 0, 53, 54, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 53, 54, 58, 0, 0, 55, 0, + 60, 0, 0, 0, 56, 57, 58, 0, 0, 59, + 41, 60, 42, 43, 44, 45, 0, 0, 47, 0, + 0, 0, 48, 117, 0, 0, 0, 0, 49, 0, + 40, 0, 0, 0, 50, 51, 52, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, + 54, 0, 0, 0, 55, 0, 0, 0, 0, 0, + 108, 57, 58, 0, 0, 59, 41, 60, 42, 43, + 44, 45, 0, 0, 47, 0, 0, 0, 48, 0, + 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, + 50, 51, 52, 0, 0, 0, 0, 0, 0, 0, + 0, 74, 0, 0, 0, 53, 54, 0, 0, 0, + 55, 0, 0, 0, 75, 0, 56, 57, 58, 76, + 0, 59, 77, 60, 0, 0, 0, 0, 74, 0, + 78, 79, 0, 80, 0, 0, 0, 81, 82, 83, + 0, 75, 0, 0, 0, 0, 76, 0, 84, 77, + 0, 0, 85, 0, 0, 74, 86, 78, 79, 0, + 80, 0, 0, 0, 81, 82, 83, 87, 75, 0, + 0, 0, 0, 76, 0, 84, 77, 0, 0, 85, + 0, 0, 74, 86, 78, 79, 358, 80, 0, 0, + 0, 81, 82, 83, 87, 75, 0, 0, 0, 0, + 76, 0, 84, 77, 0, 0, 85, 0, 0, 74, + 86, 78, 79, 415, 80, 0, 0, 0, 81, 82, + 83, 87, 75, 0, 0, 0, 0, 76, 0, 84, + 77, 0, 0, 85, 0, 0, 74, 86, 78, 79, + 479, 80, 0, 0, 0, 81, 82, 83, 87, 75, + 0, 0, 0, 0, 76, 0, 84, 77, 0, 0, + 85, 0, 0, 0, 86, 78, 79, 568, 80, 0, + 0, 0, 81, 82, 83, 87, 0, 0, 0, 0, + 0, 0, 0, 84, 0, 0, 0, 85, 0, 0, + 0, 86, 0, 0, 773 +}; static const yytype_int16 yycheck[] = { - 1, 35, 2, 91, 5, 293, 495, 91, 91, 85, - 111, 23, 23, 486, 23, 194, 108, 380, 12, 432, - 303, 35, 10, 8, 9, 126, 439, 440, 441, 442, - 443, 31, 32, 33, 34, 127, 36, 8, 9, 452, - 108, 46, 99, 100, 101, 102, 103, 108, 105, 106, - 107, 209, 0, 416, 108, 448, 469, 114, 115, 127, - 61, 118, 119, 422, 423, 125, 127, 8, 9, 376, - 8, 9, 379, 127, 381, 108, 111, 550, 29, 91, - 91, 125, 91, 4, 85, 478, 107, 8, 9, 110, - 104, 126, 8, 9, 127, 402, 403, 125, 405, 406, - 407, 382, 116, 117, 77, 386, 387, 388, 389, 125, - 8, 9, 200, 116, 108, 294, 200, 200, 91, 592, - 6, 108, 107, 411, 107, 488, 409, 110, 162, 10, - 126, 127, 120, 14, 313, 125, 107, 75, 116, 446, - 127, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 125, 163, 165, 448, 108, 474, 125, 111, - 51, 125, 585, 124, 125, 126, 125, 178, 179, 180, - 181, 182, 125, 362, 185, 242, 127, 600, 200, 200, - 191, 200, 125, 194, 501, 478, 125, 126, 108, 480, - 125, 560, 207, 596, 108, 564, 599, 566, 213, 568, - 569, 570, 110, 56, 8, 9, 10, 127, 125, 377, - 14, 614, 380, 127, 67, 68, 108, 8, 9, 10, - 8, 9, 10, 14, 115, 108, 14, 80, 125, 120, - 79, 80, 81, 86, 125, 127, 107, 426, 165, 125, - 29, 251, 252, 110, 127, 107, 108, 51, 416, 108, - 99, 178, 179, 180, 181, 182, 109, 125, 111, 112, - 51, 125, 107, 51, 109, 110, 111, 108, 127, 280, - 108, 125, 126, 646, 78, 286, 286, 110, 110, 301, - 125, 126, 110, 294, 295, 110, 127, 302, 299, 127, - 301, 127, 125, 126, 127, 310, 104, 105, 106, 29, - 311, 120, 313, 596, 79, 80, 81, 110, 318, 125, - 126, 115, 126, 641, 8, 107, 120, 109, 110, 111, - 488, 125, 107, 116, 115, 126, 127, 115, 125, 120, - 8, 9, 120, 343, 125, 124, 125, 126, 125, 110, - 193, 6, 110, 354, 366, 109, 127, 108, 434, 202, - 127, 362, 117, 280, 125, 126, 127, 125, 126, 127, - 371, 860, 377, 216, 127, 380, 377, 220, 412, 380, - 414, 382, 50, 226, 227, 386, 387, 388, 389, 127, - 127, 392, 127, 127, 395, 127, 127, 127, 399, 399, - 120, 121, 122, 127, 124, 125, 126, 770, 409, 127, - 117, 416, 421, 422, 423, 416, 127, 29, 811, 419, - 128, 89, 127, 435, 110, 426, 108, 95, 96, 430, - 464, 432, 108, 434, 125, 29, 125, 494, 439, 440, - 441, 442, 443, 444, 287, 457, 457, 448, 457, 454, - 464, 452, 127, 125, 125, 613, 130, 775, 107, 107, - 8, 461, 462, 463, 108, 465, 117, 108, 469, 128, - 120, 125, 108, 120, 317, 120, 111, 478, 111, 480, - 90, 120, 116, 488, 127, 486, 486, 488, 646, 852, - 116, 128, 580, 125, 495, 495, 580, 580, 127, 126, - 108, 808, 127, 108, 127, 868, 118, 119, 120, 121, - 122, 130, 124, 125, 126, 8, 109, 360, 108, 126, - 51, 125, 365, 4, 367, 127, 120, 121, 122, 591, - 124, 125, 126, 125, 108, 130, 127, 855, 108, 128, - 127, 116, 128, 127, 851, 130, 127, 125, 548, 550, - 550, 560, 125, 916, 116, 564, 117, 566, 130, 568, - 569, 570, 29, 577, 127, 579, 117, 125, 580, 580, - 571, 580, 127, 127, 109, 109, 125, 578, 421, 422, - 423, 127, 127, 125, 585, 125, 127, 601, 127, 603, - 604, 592, 592, 117, 901, 596, 128, 960, 599, 600, - 127, 919, 636, 117, 127, 923, 125, 125, 613, 493, - 611, 127, 770, 614, 127, 615, 616, 617, 618, 619, - 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, - 630, 631, 632, 633, 634, 635, 772, 637, 191, 434, - 641, 646, 851, 808, 962, 646, 19, 20, 966, 901, - 493, 118, 119, 120, 121, 122, 29, 124, 125, 126, - 51, 979, 53, 54, 200, 434, 366, 58, 613, 435, - 988, 200, 578, 8, 9, 427, 492, 457, 734, 15, - 16, 17, 18, 19, 20, -1, -1, -1, -1, -1, - -1, -1, -1, 29, 852, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 547, -1, -1, -1, -1, -1, - 868, -1, -1, -1, -1, 50, 559, 560, 561, -1, - -1, 564, -1, 566, -1, 568, 569, 570, -1, -1, - -1, -1, 575, 734, -1, 797, 798, 799, 800, -1, - 802, 132, 133, 134, 135, 118, 119, 120, 121, 122, - -1, 124, 125, 126, 89, -1, 813, -1, 916, -1, - 95, 96, -1, 763, 99, 770, -1, 801, -1, 770, - -1, -1, -1, -1, 775, -1, -1, 168, -1, 170, - 116, 117, 118, 119, 120, 121, 122, 801, 124, 125, - 126, -1, -1, -1, -1, 186, -1, -1, 797, 798, - 799, 800, 960, 802, -1, -1, -1, -1, -1, 809, - 811, -1, -1, -1, -1, -1, 816, 879, 880, 881, - 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, - 892, 893, 894, 895, 896, 897, 15, 16, 17, 18, - 19, 20, -1, -1, -1, -1, -1, 852, -1, -1, - 29, 852, -1, -1, 855, 869, 870, 871, -1, 860, - 860, -1, -1, 868, 898, -1, -1, 868, 930, -1, - -1, -1, -1, -1, -1, 8, 9, -1, -1, -1, - 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, - 889, 890, 891, 892, 893, 894, 895, 896, 897, 899, - -1, -1, 293, -1, -1, -1, -1, -1, -1, 971, - -1, 916, 912, -1, -1, 916, -1, 50, 919, -1, - -1, 955, 923, 957, -1, -1, -1, -1, -1, -1, - -1, 930, -1, -1, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, -1, 124, 125, 126, 982, 983, - -1, -1, -1, -1, -1, 960, 89, -1, -1, 960, - -1, 962, 95, 96, -1, 966, 99, -1, -1, -1, - -1, -1, 971, -1, -1, -1, -1, -1, 979, 3, - 4, 5, 6, 7, 8, 9, 10, 988, 12, 13, + 1, 91, 487, 91, 5, 85, 46, 91, 292, 8, + 9, 98, 99, 100, 101, 102, 35, 104, 105, 106, + 193, 12, 442, 0, 376, 108, 113, 114, 125, 631, + 117, 118, 164, 301, 10, 8, 9, 372, 8, 9, + 375, 111, 23, 478, 127, 177, 178, 179, 180, 181, + 35, 125, 8, 9, 10, 208, 126, 2, 14, 411, + 61, 23, 397, 398, 125, 400, 401, 402, 8, 9, + 377, 108, 8, 9, 381, 382, 383, 384, 108, 108, + 77, 79, 80, 81, 85, 108, 31, 32, 33, 34, + 127, 36, 125, 107, 91, 51, 110, 127, 127, 23, + 108, 99, 75, 125, 127, 125, 111, 542, 107, 199, + 91, 199, 417, 418, 116, 199, 427, 108, 103, 127, + 293, 126, 406, 434, 435, 436, 437, 438, 480, 91, + 115, 116, 125, 468, 10, 446, 404, 310, 14, 125, + 8, 9, 161, 108, 120, 108, 4, 279, 111, 584, + 8, 9, 463, 51, 241, 53, 54, 127, 493, 115, + 58, 763, 127, 164, 120, 472, 108, 91, 29, 589, + 110, 107, 212, 125, 442, 51, 177, 178, 179, 180, + 181, 125, 50, 184, 604, 127, 359, 107, 125, 190, + 110, 125, 193, 29, 116, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 125, 162, 199, 125, + 373, 89, 29, 376, 108, 6, 108, 95, 96, 29, + 107, 99, 110, 131, 132, 133, 134, 199, 840, 115, + 8, 9, 10, 127, 120, 127, 14, 552, 421, 125, + 125, 556, 125, 558, 108, 560, 561, 562, 411, 120, + 121, 122, 108, 124, 125, 126, 577, 307, 29, 167, + 110, 169, 110, 127, 125, 199, 108, 110, 279, 590, + 127, 127, 634, 51, 285, 120, 110, 185, 124, 125, + 126, 110, 293, 294, 8, 127, 126, 298, 107, 300, + 902, 125, 126, 127, 906, 250, 251, 308, 116, 310, + 78, 118, 119, 120, 121, 122, 6, 124, 125, 126, + 120, 121, 122, 125, 124, 125, 126, 480, 110, 104, + 105, 106, 125, 373, 8, 9, 376, 109, 300, 110, + 285, 127, 944, 125, 126, 127, 948, 115, 108, 429, + 351, 127, 120, 127, 125, 126, 127, 125, 359, 961, + 845, 126, 127, 124, 125, 126, 117, 368, 970, 127, + 315, 411, 373, 125, 126, 376, 377, 797, 107, 108, + 381, 382, 383, 384, 125, 126, 387, 127, 407, 390, + 409, 125, 126, 394, 292, 340, 127, 19, 20, 486, + 127, 363, 127, 404, 126, 127, 758, 29, 448, 127, + 411, 8, 9, 10, 79, 80, 81, 14, 127, 107, + 421, 109, 110, 111, 425, 127, 427, 127, 429, 127, + 117, 127, 110, 434, 435, 436, 437, 438, 439, 458, + 480, 442, 583, 128, 108, 446, 108, 127, 125, 394, + 603, 130, 125, 125, 51, 125, 107, 107, 8, 794, + 108, 117, 463, 108, 108, 120, 120, 128, 430, 414, + 451, 472, 107, 458, 109, 110, 111, 478, 125, 480, + 120, 634, 572, 111, 572, 837, 487, 111, 572, 451, + 125, 126, 416, 417, 418, 90, 118, 119, 120, 121, + 122, 853, 124, 125, 126, 120, 116, 125, 406, 116, + 455, 456, 457, 127, 459, 19, 20, 126, 115, 127, + 108, 108, 128, 120, 127, 29, 130, 451, 125, 127, + 8, 109, 126, 478, 108, 125, 127, 51, 8, 9, + 4, 542, 487, 125, 130, 128, 127, 56, 900, 17, + 18, 19, 20, 128, 8, 9, 127, 130, 67, 68, + 127, 29, 563, 603, 127, 125, 125, 116, 116, 570, + 117, 80, 130, 127, 117, 127, 577, 86, 109, 125, + 50, 109, 127, 584, 569, 127, 571, 125, 589, 590, + 942, 572, 127, 125, 634, 540, 50, 542, 29, 108, + 601, 110, 111, 604, 125, 758, 591, 626, 593, 594, + 572, 127, 117, 128, 118, 119, 120, 121, 122, 89, + 124, 125, 126, 117, 127, 95, 96, 127, 552, 99, + 631, 127, 556, 634, 558, 89, 560, 561, 562, 584, + 125, 95, 96, 125, 785, 786, 787, 788, 572, 790, + 118, 119, 120, 121, 122, 127, 124, 125, 126, 485, + 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, + 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, + 625, 127, 627, 192, 837, 429, 794, 118, 119, 120, + 121, 122, 201, 124, 125, 126, 760, 190, 199, 429, + 853, 570, 3, 4, 5, 6, 215, 8, 603, 430, + 219, 363, 799, 199, 451, 422, 225, 226, 758, 722, + 484, 722, -1, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, + 881, 882, -1, -1, -1, -1, -1, 900, -1, -1, + -1, -1, -1, 54, -1, -1, -1, 758, -1, -1, + -1, 62, 763, -1, -1, -1, -1, -1, -1, -1, + 789, -1, 913, -1, -1, 8, 9, 286, -1, -1, + -1, -1, -1, -1, -1, 86, -1, 88, -1, 942, + -1, 92, -1, -1, -1, -1, 797, 837, 785, 786, + 787, 788, -1, 790, 789, 314, 751, -1, -1, -1, + -1, -1, 953, 853, 115, -1, -1, 50, 119, 120, + -1, -1, 123, -1, 125, -1, -1, -1, 129, 17, + 18, 19, 20, -1, -1, -1, 837, -1, -1, 840, + -1, 29, -1, -1, 845, -1, -1, -1, 357, -1, + 795, -1, 853, 362, -1, 364, 89, 802, -1, -1, + 900, -1, 95, 96, 883, -1, 99, -1, -1, 854, + 855, 856, -1, -1, -1, -1, -1, 864, 865, 866, + 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, + 877, 878, 879, 880, 881, 882, -1, -1, -1, 900, + 845, 902, 942, -1, -1, 906, -1, 416, 417, 418, + -1, 3, 4, 5, 6, -1, 8, 9, 937, -1, + 939, -1, -1, -1, -1, -1, 913, -1, 116, 117, + 118, 119, 120, 121, 122, -1, 124, 125, 126, 884, + -1, 942, -1, 944, -1, 964, 965, 948, -1, -1, + -1, 896, -1, 45, -1, 47, 48, 49, 50, 51, + 961, 53, 54, -1, -1, 57, 953, -1, -1, 970, + 62, 63, -1, -1, -1, -1, 485, 69, 70, 71, + -1, -1, -1, -1, 76, -1, -1, -1, -1, -1, + -1, -1, 84, 85, 86, -1, 88, 89, -1, -1, + 92, -1, -1, 95, 96, 97, -1, -1, 100, -1, + 102, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 115, -1, -1, -1, 119, 120, -1, + 539, 123, -1, 125, -1, -1, -1, 129, -1, -1, + -1, -1, 551, 552, 553, -1, -1, 556, -1, 558, + -1, 560, 561, 562, -1, -1, -1, -1, 567, 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, - 411, 45, 46, 47, 48, 49, 50, 51, 52, 53, + -1, 45, 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, -1, 74, 75, 76, -1, 78, 79, 80, 81, 82, 83, @@ -2073,7 +1713,7 @@ static const yytype_int16 yycheck[] = -1, -1, -1, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 3, 4, 5, - 6, 7, 8, 9, 10, 958, 12, 13, 14, 15, + 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, @@ -2082,383 +1722,477 @@ static const yytype_int16 yycheck[] = 66, 67, 68, 69, 70, -1, -1, -1, 74, 75, 76, -1, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, -1, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, -1, 8, - 9, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 96, 97, 98, 99, 100, 101, 102, 103, -1, -1, + -1, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, -1, 129, 130, 3, 4, 5, 6, -1, - 8, 9, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 50, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, - -1, -1, -1, -1, -1, -1, -1, 45, 29, 47, - 48, 49, 50, 51, -1, 53, 54, -1, -1, 57, - 89, -1, -1, -1, 62, 63, 95, 96, -1, -1, - 99, 69, 70, 71, -1, -1, -1, -1, 76, -1, - -1, -1, -1, -1, -1, -1, 84, 85, 86, -1, - 88, 89, -1, -1, 92, -1, -1, 95, 96, 97, - -1, -1, 100, -1, 102, 3, 4, 5, 6, -1, - 8, 9, -1, -1, 12, -1, -1, 115, -1, -1, - -1, 119, 120, -1, -1, 123, -1, 125, -1, -1, - -1, 129, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, -1, 124, 125, 126, -1, 45, -1, 47, - 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, 76, -1, - -1, -1, -1, -1, -1, -1, 84, 85, 86, -1, - 88, 89, -1, -1, 92, -1, -1, 95, 96, 97, - -1, -1, 100, -1, 102, 3, 4, 5, 6, -1, - 8, 9, -1, -1, 12, -1, -1, 115, -1, -1, - -1, 119, -1, -1, -1, 123, -1, 125, -1, -1, - -1, 129, -1, 14, 15, 16, 17, 18, 19, 20, - -1, 3, 4, 5, 6, -1, 8, 45, 29, 47, - 48, 49, 50, 51, -1, 53, 54, -1, -1, 57, - -1, -1, -1, -1, 62, 63, -1, -1, -1, -1, - -1, 69, 70, 71, 19, 20, -1, -1, 76, -1, - -1, -1, -1, -1, 29, -1, 84, 85, 86, -1, - 88, 89, 54, -1, 92, -1, -1, 95, 96, 97, - 62, -1, 100, -1, 102, 3, 4, 5, 6, -1, - 8, 9, -1, -1, -1, -1, -1, 115, -1, -1, - -1, 119, -1, -1, 86, 123, 88, 125, -1, -1, - 92, 129, 113, 114, 115, -1, -1, 118, 119, 120, - 121, 122, -1, 124, 125, 126, -1, 45, -1, 47, - 48, 49, -1, 115, -1, 53, 54, 119, 120, -1, - -1, 123, -1, 125, 62, 63, -1, 129, -1, -1, - -1, 69, 70, 118, 119, 120, 121, 122, 76, 124, - 125, 126, -1, -1, -1, -1, 84, 85, 86, -1, - 88, -1, -1, -1, 92, 3, 4, 5, 6, 97, - 8, 9, -1, -1, 102, -1, -1, -1, 45, -1, - 47, 48, 49, -1, -1, -1, 53, 115, -1, -1, - -1, 119, 120, -1, -1, 123, 63, 125, -1, 127, - -1, 129, 69, 70, 71, -1, -1, 45, -1, 47, - 48, 49, -1, -1, -1, 53, 54, 84, 85, -1, - -1, -1, -1, -1, 62, 63, -1, -1, -1, -1, - 97, 69, 70, -1, -1, 102, -1, -1, 76, -1, - -1, -1, -1, -1, -1, -1, 84, 85, 86, -1, - 88, -1, -1, -1, 92, 3, 4, 5, 6, 97, - 8, 9, -1, -1, 102, -1, -1, -1, 45, 107, - 47, 48, 49, -1, -1, -1, -1, 115, -1, -1, - -1, 119, 120, -1, -1, 123, 63, 125, -1, -1, - -1, 129, 69, 70, 71, -1, -1, 45, -1, 47, - 48, 49, -1, -1, -1, 53, 54, 84, 85, -1, - -1, -1, -1, -1, 62, 63, -1, -1, -1, -1, - 97, 69, 70, -1, -1, 102, -1, -1, 76, -1, - -1, -1, -1, -1, -1, -1, 84, 85, 86, -1, - 88, -1, -1, -1, 92, 3, 4, 5, 6, 97, - 8, 9, -1, -1, 102, -1, -1, -1, 45, 107, - 47, 48, 49, -1, -1, -1, -1, 115, -1, -1, - -1, 119, 120, -1, -1, 123, -1, 125, -1, -1, - -1, 129, 69, 70, 71, -1, -1, 45, -1, 47, - 48, 49, -1, -1, -1, 53, 54, 84, 85, -1, - -1, -1, -1, -1, 62, 63, -1, -1, -1, -1, - 97, 69, 70, -1, -1, 102, -1, -1, 76, -1, - -1, -1, -1, -1, -1, -1, 84, 85, 86, -1, - 88, -1, -1, -1, 92, 3, 4, 5, 6, 97, - 8, 9, -1, -1, 102, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 115, -1, -1, - -1, 119, 120, -1, -1, 123, -1, 125, -1, 127, - -1, 129, -1, -1, -1, -1, -1, 45, -1, 47, - 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, -1, 76, -1, - -1, -1, -1, -1, -1, -1, 84, 85, 86, -1, - 88, -1, -1, -1, 92, 3, 4, 5, 6, 97, - 8, 9, -1, -1, 102, -1, -1, -1, -1, 107, - -1, -1, -1, -1, -1, -1, -1, 115, -1, -1, - -1, 119, 120, -1, -1, 123, -1, 125, -1, -1, - -1, 129, -1, -1, -1, -1, -1, 45, -1, 47, - 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, -1, 76, -1, - -1, -1, -1, -1, -1, -1, 84, 85, 86, -1, - 88, -1, -1, -1, 92, 3, 4, 5, 6, 97, - 8, 9, -1, -1, 102, -1, -1, -1, 45, -1, - 47, 48, 49, -1, -1, -1, 53, 115, -1, -1, - -1, 119, 120, -1, -1, 123, 63, 125, -1, 127, - -1, 129, 69, 70, 71, -1, -1, 45, -1, 47, - 48, 49, -1, -1, -1, 53, 54, 84, 85, -1, - -1, -1, -1, -1, 62, 63, -1, -1, -1, -1, - 97, 69, 70, -1, -1, 102, -1, -1, 76, 15, - 16, 17, 18, 19, 20, -1, 84, 85, 86, -1, - 88, -1, -1, 29, 92, -1, -1, -1, 125, 97, - -1, -1, -1, -1, 102, -1, -1, 13, 14, 15, - 16, 17, 18, 19, 20, -1, -1, 115, -1, -1, - -1, 119, 120, 29, -1, 123, -1, 125, -1, -1, - -1, 129, 13, 14, 15, 16, 17, 18, 19, 20, - -1, -1, -1, -1, -1, -1, -1, -1, 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, -1, 114, 115, - 116, 117, 118, 119, 120, 121, 122, -1, 124, 125, - 126, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, -1, 124, 125, - 126, -1, -1, -1, 130, -1, -1, -1, -1, -1, - -1, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, -1, 124, 125, 126, -1, -1, -1, 130, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, -1, 124, 125, 126, 8, 9, -1, 130, 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, 49, -1, 52, -1, - 53, 45, -1, 47, 48, 49, -1, -1, -1, -1, - 63, -1, -1, -1, -1, -1, 69, 70, 71, -1, - -1, -1, 76, -1, -1, 69, 70, 71, -1, -1, - -1, 84, 85, -1, -1, -1, -1, 8, 9, -1, - 84, 85, -1, -1, 97, -1, -1, 100, -1, 102, - -1, -1, -1, 97, 108, -1, -1, 111, 102, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - -1, 125, 126, 44, 45, 129, 47, 48, 49, 50, - 51, 125, 53, -1, -1, -1, 57, 58, 59, 60, - -1, -1, 63, -1, -1, -1, -1, 68, 69, 70, - 71, -1, -1, 74, 8, 9, -1, 78, -1, -1, - -1, 82, -1, 84, 85, -1, 87, -1, 89, -1, - -1, -1, -1, -1, 95, 96, 97, -1, 99, 100, - 101, 102, -1, -1, -1, -1, 107, -1, -1, -1, - 44, 45, -1, 47, 48, 49, 50, 51, -1, 53, - -1, -1, 123, 57, 58, 59, 60, -1, -1, 63, - -1, -1, -1, -1, 68, 69, 70, 71, -1, -1, - 74, 8, 9, -1, 78, -1, -1, -1, 82, -1, - 84, 85, -1, 87, -1, 89, -1, -1, -1, -1, - -1, 95, 96, 97, -1, 99, 100, 101, 102, 13, - 14, 15, 16, 17, 18, 19, 20, 44, 45, -1, - 47, 48, 49, 50, 51, 29, 53, -1, -1, 123, - 57, 58, 59, 60, -1, -1, 63, -1, -1, -1, - -1, 68, 69, 70, 71, -1, -1, 74, -1, -1, - -1, 78, -1, -1, -1, 82, -1, 84, 85, -1, - 87, -1, 89, -1, -1, -1, -1, -1, 95, 96, - 97, -1, 99, 100, 101, 102, 13, 14, 15, 16, - 17, 18, 19, 20, -1, -1, -1, -1, -1, -1, - -1, -1, 29, -1, -1, -1, 123, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 110, -1, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, -1, - 124, 125, 126, 13, 14, 15, 16, 17, 18, 19, + 126, 127, -1, 129, 130, -1, 3, 4, 5, 6, + -1, 8, 9, -1, -1, 12, -1, -1, -1, 45, + -1, 47, 48, 49, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, + 20, -1, -1, 69, 70, 71, -1, -1, 45, 29, + 47, 48, 49, 50, 51, -1, 53, 54, 84, 85, + 57, -1, -1, -1, -1, 62, 63, -1, -1, -1, + -1, 97, 69, 70, 71, -1, 102, -1, -1, 76, + -1, -1, -1, -1, -1, -1, -1, 84, 85, 86, + -1, 88, 89, -1, -1, 92, -1, -1, 95, 96, + 97, -1, -1, 100, -1, 102, 3, 4, 5, 6, + -1, 8, 9, -1, -1, 12, -1, -1, 115, -1, + -1, 940, 119, -1, -1, -1, 123, -1, 125, -1, + -1, -1, 129, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, -1, 124, 125, 126, -1, 45, -1, + 47, 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, 76, + -1, -1, -1, -1, -1, -1, -1, 84, 85, 86, + -1, 88, 89, -1, -1, 92, -1, -1, 95, 96, + 97, -1, -1, 100, -1, 102, 3, 4, 5, 6, + -1, 8, 9, -1, -1, -1, -1, -1, 115, -1, + -1, -1, 119, -1, -1, -1, 123, -1, 125, -1, + -1, -1, 129, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, + 47, 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, -1, 76, + -1, -1, -1, -1, -1, -1, -1, 84, 85, 86, + -1, 88, -1, -1, -1, 92, 3, 4, 5, 6, + 97, 8, 9, -1, -1, 102, -1, -1, -1, 45, + -1, 47, 48, 49, -1, -1, -1, 53, 115, -1, + -1, -1, 119, 120, -1, -1, 123, 63, 125, -1, + 127, -1, 129, 69, 70, 71, -1, -1, 45, -1, + 47, 48, 49, -1, -1, -1, 53, 54, 84, 85, + -1, -1, -1, -1, -1, 62, 63, -1, -1, -1, + -1, 97, 69, 70, -1, -1, 102, -1, -1, 76, + -1, -1, -1, -1, -1, -1, -1, 84, 85, 86, + -1, 88, -1, -1, -1, 92, 3, 4, 5, 6, + 97, 8, 9, -1, -1, 102, -1, -1, -1, 45, + 107, 47, 48, 49, -1, -1, -1, -1, 115, -1, + -1, -1, 119, 120, -1, -1, 123, 63, 125, -1, + -1, -1, 129, 69, 70, 71, -1, -1, 45, -1, + 47, 48, 49, -1, -1, -1, 53, 54, 84, 85, + -1, -1, -1, -1, -1, 62, 63, -1, -1, -1, + -1, 97, 69, 70, -1, -1, 102, -1, -1, 76, + -1, -1, -1, -1, -1, -1, -1, 84, 85, 86, + -1, 88, -1, -1, -1, 92, 3, 4, 5, 6, + 97, 8, 9, -1, -1, 102, -1, -1, -1, -1, + 107, -1, -1, -1, -1, -1, -1, -1, 115, -1, + -1, -1, 119, 120, -1, -1, 123, -1, 125, -1, + -1, -1, 129, -1, -1, -1, -1, -1, 45, -1, + 47, 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, -1, 76, + -1, -1, -1, -1, -1, -1, -1, 84, 85, 86, + -1, 88, -1, -1, -1, 92, 3, 4, 5, 6, + 97, 8, 9, -1, -1, 102, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 115, -1, + -1, -1, 119, 120, -1, -1, 123, -1, 125, -1, + 127, -1, 129, -1, -1, -1, -1, -1, 45, -1, + 47, 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, -1, 76, + -1, -1, -1, -1, -1, -1, -1, 84, 85, 86, + -1, 88, -1, -1, -1, 92, 3, 4, 5, 6, + 97, 8, 9, -1, -1, 102, -1, -1, -1, -1, + 107, -1, -1, -1, -1, -1, -1, -1, 115, -1, + -1, -1, 119, 120, -1, -1, 123, -1, 125, -1, + -1, -1, 129, -1, -1, -1, -1, -1, 45, -1, + 47, 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, -1, 76, + -1, -1, -1, -1, -1, -1, -1, 84, 85, 86, + -1, 88, -1, -1, -1, 92, 3, 4, 5, 6, + 97, 8, 9, -1, -1, 102, -1, -1, -1, 45, + -1, 47, 48, 49, -1, -1, -1, 53, 115, -1, + -1, -1, 119, 120, -1, -1, 123, 63, 125, -1, + 127, -1, 129, 69, 70, 71, -1, -1, 45, -1, + 47, 48, 49, -1, -1, -1, 53, 54, 84, 85, + -1, -1, -1, -1, -1, 62, 63, -1, -1, -1, + -1, 97, 69, 70, -1, -1, 102, -1, -1, 76, + 15, 16, 17, 18, 19, 20, -1, 84, 85, 86, + -1, 88, -1, -1, 29, 92, -1, -1, -1, 125, + 97, -1, -1, -1, -1, 102, -1, -1, 13, 14, + 15, 16, 17, 18, 19, 20, -1, -1, 115, -1, + -1, -1, 119, 120, 29, -1, 123, -1, 125, -1, + -1, -1, 129, 13, 14, 15, 16, 17, 18, 19, 20, -1, -1, -1, -1, -1, -1, -1, -1, 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, 120, 121, 122, -1, 124, + 125, 126, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, -1, 124, + 125, 126, -1, -1, -1, 130, -1, -1, -1, -1, + -1, -1, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, -1, 124, 125, 126, -1, -1, -1, + 130, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, -1, 124, 125, 126, 8, 9, -1, 130, + 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, 49, -1, 52, + -1, 53, 45, -1, 47, 48, 49, -1, -1, -1, + -1, 63, -1, -1, -1, -1, -1, 69, 70, 71, + -1, -1, -1, 76, -1, -1, 69, 70, 71, -1, + -1, -1, 84, 85, -1, -1, -1, -1, 8, 9, + -1, 84, 85, -1, -1, 97, -1, -1, 100, -1, + 102, -1, -1, -1, 97, 108, -1, -1, 111, 102, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, -1, 125, 126, 44, 45, 129, 47, 48, 49, + 50, 51, 125, 53, -1, -1, -1, 57, 58, 59, + 60, -1, -1, 63, -1, -1, -1, -1, 68, 69, + 70, 71, -1, -1, 74, 8, 9, -1, 78, -1, + -1, -1, 82, -1, 84, 85, -1, 87, -1, 89, + -1, -1, -1, -1, -1, 95, 96, 97, -1, 99, + 100, 101, 102, -1, -1, -1, -1, 107, -1, -1, + -1, 44, 45, -1, 47, 48, 49, 50, 51, -1, + 53, -1, -1, 123, 57, 58, 59, 60, -1, -1, + 63, -1, -1, -1, -1, 68, 69, 70, 71, -1, + -1, 74, -1, -1, -1, 78, -1, -1, -1, 82, + -1, 84, 85, -1, 87, -1, 89, -1, -1, -1, + -1, -1, 95, 96, 97, -1, 99, 100, 101, 102, + 13, 14, 15, 16, 17, 18, 19, 20, -1, -1, + -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, + 123, 13, 14, 15, 16, 17, 18, 19, 20, -1, + -1, -1, -1, -1, -1, -1, -1, 29, -1, -1, 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, 109, 29, -1, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, -1, 124, 125, 126, - 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, -1, -1, 108, -1, - -1, -1, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, -1, 124, 125, 126, 110, -1, 112, + -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, -1, 110, -1, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - -1, 124, 125, 126, -1, -1, 112, 113, 114, 115, + -1, 124, 125, 126, -1, -1, -1, 109, -1, -1, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, -1, 124, 125, 126, 108, -1, -1, -1, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + -1, 124, 125, 126, 110, -1, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, -1, 124, 125, - 126, 13, 14, 15, 16, 17, 18, 19, 20, -1, - -1, -1, -1, -1, -1, -1, -1, 29, -1, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - -1, 124, 125, 126, 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, 110, -1, - 112, 113, 114, 115, -1, -1, 118, 119, 120, 121, - 122, -1, 124, 125, 126, 15, 16, 17, 18, 19, + 126, -1, -1, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, -1, 124, 125, 126, 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, 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, - -1, -1, -1, 112, 113, 114, 115, -1, -1, 118, - 119, 120, 121, 122, -1, 124, 125, 126, -1, -1, - -1, 115, 116, 117, 118, 119, 120, 121, 122, -1, - 124, 125, 126, -1, 113, 114, 115, 0, -1, 118, - 119, 120, 121, 122, -1, 124, 125, 126, -1, -1, - 114, 115, -1, -1, 118, 119, 120, 121, 122, -1, - 124, 125, 126, 15, 16, 17, 18, 19, 20, -1, - -1, -1, -1, -1, -1, -1, -1, 29, -1, -1, - 43, -1, -1, -1, -1, 115, -1, -1, 118, 119, - 120, 121, 122, 56, 124, 125, 126, -1, 61, 8, - 9, 64, 17, 18, 19, 20, -1, -1, -1, 72, - 73, -1, 75, -1, 29, -1, 79, 80, 81, -1, - 17, 18, 19, 20, -1, -1, -1, 90, -1, -1, - -1, 94, 29, -1, -1, 98, 45, -1, 47, 48, - 49, 50, 51, -1, 53, -1, 109, -1, -1, -1, - -1, -1, -1, -1, 63, -1, -1, -1, -1, -1, - 69, 70, 71, -1, -1, -1, 118, 119, 120, 121, - 122, -1, 124, 125, 126, 84, 85, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 95, -1, 97, -1, - -1, 100, -1, 102, 9, -1, -1, -1, -1, -1, - -1, 116, 117, 118, 119, 120, 121, 122, -1, 124, - 125, 126, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 118, 119, 120, 121, 122, -1, 124, 125, 126, - 45, -1, 47, 48, 49, 50, 51, -1, 53, 9, - -1, -1, 57, -1, -1, -1, -1, -1, 63, -1, + 15, 16, 17, 18, 19, 20, -1, -1, -1, -1, + -1, -1, -1, -1, 29, -1, -1, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, -1, 124, + 125, 126, 110, -1, 112, 113, 114, 115, -1, -1, + 118, 119, 120, 121, 122, -1, 124, 125, 126, -1, + -1, 112, 113, 114, 115, -1, -1, 118, 119, 120, + 121, 122, -1, 124, 125, 126, -1, -1, 113, 114, + 115, -1, -1, 118, 119, 120, 121, 122, -1, 124, + 125, 126, -1, -1, 114, 115, 116, 117, 118, 119, + 120, 121, 122, -1, 124, 125, 126, -1, -1, -1, + 115, 116, 117, 118, 119, 120, 121, 122, -1, 124, + 125, 126, 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, 15, 16, 17, 18, 19, 20, -1, -1, + -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 113, 114, 115, -1, -1, 118, 119, 120, 121, 122, + -1, 124, 125, 126, -1, -1, -1, -1, 116, 117, + 118, 119, 120, 121, 122, -1, 124, 125, 126, -1, + -1, 114, 115, 0, -1, 118, 119, 120, 121, 122, + -1, 124, 125, 126, -1, -1, -1, 115, -1, -1, + 118, 119, 120, 121, 122, -1, 124, 125, 126, 45, + -1, 47, 48, 49, -1, 118, 119, 120, 121, 122, + -1, 124, 125, 126, -1, -1, 43, -1, -1, -1, + -1, -1, -1, 69, 70, 71, 9, -1, -1, 56, + -1, -1, -1, -1, 61, 8, 9, 64, 84, 85, + -1, -1, -1, -1, -1, 72, 73, -1, 75, -1, + -1, 97, 79, 80, 81, -1, 102, -1, -1, -1, + -1, -1, 45, 90, 47, 48, 49, 94, -1, -1, + -1, 98, 45, -1, 47, 48, 49, 50, 51, 125, + 53, -1, 109, -1, -1, -1, 69, 70, 71, -1, + 63, -1, 9, -1, -1, -1, 69, 70, 71, -1, + -1, 84, 85, -1, -1, -1, -1, -1, -1, -1, + -1, 84, 85, -1, 97, -1, -1, -1, -1, 102, + -1, -1, 95, -1, 97, -1, -1, 100, 45, 102, + 47, 48, 49, 50, 51, -1, 53, -1, -1, -1, + 57, -1, -1, -1, -1, -1, 63, -1, 9, -1, + -1, -1, 69, 70, 71, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 84, 85, -1, + -1, -1, 89, 45, -1, 47, 48, 49, 95, 96, + 97, -1, -1, 100, 45, 102, 47, 48, 49, 50, + 51, -1, 53, -1, -1, -1, 57, 69, 70, 71, + -1, -1, 63, -1, 9, -1, -1, -1, 69, 70, + 71, -1, 84, 85, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 84, 85, 97, -1, -1, 89, -1, + 102, -1, -1, -1, 95, 96, 97, -1, -1, 100, + 45, 102, 47, 48, 49, 50, -1, -1, 53, -1, + -1, -1, 57, 125, -1, -1, -1, -1, 63, -1, 9, -1, -1, -1, 69, 70, 71, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 84, - 85, -1, -1, -1, 89, 45, -1, 47, 48, 49, + 85, -1, -1, -1, 89, -1, -1, -1, -1, -1, 95, 96, 97, -1, -1, 100, 45, 102, 47, 48, - 49, 50, 51, -1, 53, -1, -1, -1, 57, 69, - 70, 71, -1, -1, 63, -1, 9, -1, -1, -1, - 69, 70, 71, -1, 84, 85, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 84, 85, 97, -1, -1, - 89, 45, 102, 47, 48, 49, 95, 96, 97, -1, - -1, 100, 45, 102, 47, 48, 49, 50, -1, -1, - 53, -1, -1, -1, 57, 69, 70, 71, -1, -1, - 63, -1, 9, -1, -1, -1, 69, 70, 71, -1, - 84, 85, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 84, 85, 97, -1, -1, 89, -1, 102, -1, - -1, -1, 95, 96, 97, -1, -1, 100, 45, 102, - 47, 48, 49, 50, -1, -1, 53, -1, -1, -1, - 57, 125, -1, -1, -1, -1, 63, -1, -1, -1, - -1, -1, 69, 70, 71, -1, -1, -1, -1, -1, - -1, -1, -1, 43, -1, -1, -1, 84, 85, -1, - -1, -1, 89, -1, -1, -1, 56, -1, 95, 96, - 97, 61, -1, 100, 64, 102, -1, -1, -1, -1, - 43, -1, 72, 73, -1, 75, -1, -1, -1, 79, - 80, 81, -1, 56, -1, -1, -1, -1, 61, -1, - 90, 64, -1, -1, 94, -1, -1, 43, 98, 72, - 73, -1, 75, -1, -1, -1, 79, 80, 81, 109, - 56, -1, -1, -1, -1, 61, -1, 90, 64, -1, - -1, 94, -1, -1, 43, 98, 72, 73, 128, 75, - -1, -1, -1, 79, 80, 81, 109, 56, -1, -1, - -1, -1, 61, -1, 90, 64, -1, -1, 94, -1, - -1, 43, 98, 72, 73, 128, 75, -1, -1, -1, - 79, 80, 81, 109, 56, -1, -1, -1, -1, 61, - -1, 90, 64, -1, -1, 94, -1, -1, -1, 98, - 72, 73, 128, 75, -1, -1, -1, 79, 80, 81, - 109, -1, -1, -1, -1, -1, -1, -1, 90, -1, - -1, 45, 94, 47, 48, 49, 98, -1, -1, 128, - -1, -1, -1, -1, -1, -1, -1, 109, -1, -1, - -1, -1, -1, -1, -1, 69, 70, 71, -1, -1, - -1, 43, -1, -1, -1, -1, 128, -1, -1, -1, - 84, 85, -1, -1, 56, -1, -1, -1, -1, 61, - -1, -1, 64, 97, -1, -1, -1, -1, 102, -1, + 49, 50, -1, -1, 53, -1, -1, -1, 57, -1, + -1, -1, -1, -1, 63, -1, -1, -1, -1, -1, + 69, 70, 71, -1, -1, -1, -1, -1, -1, -1, + -1, 43, -1, -1, -1, 84, 85, -1, -1, -1, + 89, -1, -1, -1, 56, -1, 95, 96, 97, 61, + -1, 100, 64, 102, -1, -1, -1, -1, 43, -1, 72, 73, -1, 75, -1, -1, -1, 79, 80, 81, - -1, -1, -1, -1, -1, -1, -1, -1, 90, -1, - -1, 125, 94, -1, -1, -1, 98 + -1, 56, -1, -1, -1, -1, 61, -1, 90, 64, + -1, -1, 94, -1, -1, 43, 98, 72, 73, -1, + 75, -1, -1, -1, 79, 80, 81, 109, 56, -1, + -1, -1, -1, 61, -1, 90, 64, -1, -1, 94, + -1, -1, 43, 98, 72, 73, 128, 75, -1, -1, + -1, 79, 80, 81, 109, 56, -1, -1, -1, -1, + 61, -1, 90, 64, -1, -1, 94, -1, -1, 43, + 98, 72, 73, 128, 75, -1, -1, -1, 79, 80, + 81, 109, 56, -1, -1, -1, -1, 61, -1, 90, + 64, -1, -1, 94, -1, -1, 43, 98, 72, 73, + 128, 75, -1, -1, -1, 79, 80, 81, 109, 56, + -1, -1, -1, -1, 61, -1, 90, 64, -1, -1, + 94, -1, -1, -1, 98, 72, 73, 128, 75, -1, + -1, -1, 79, 80, 81, 109, -1, -1, -1, -1, + -1, -1, -1, 90, -1, -1, -1, 94, -1, -1, + -1, 98, -1, -1, 128 }; -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 104, 105, 106, 132, 133, 223, 3, 4, 5, + 0, 104, 105, 106, 132, 133, 218, 3, 4, 5, 6, 8, 9, 45, 47, 48, 49, 53, 54, 62, 63, 69, 70, 76, 84, 85, 86, 88, 92, 97, - 102, 115, 119, 120, 123, 125, 129, 216, 217, 222, + 102, 115, 119, 120, 123, 125, 129, 211, 212, 217, 9, 45, 47, 48, 49, 50, 51, 53, 57, 63, 69, 70, 71, 84, 85, 89, 95, 96, 97, 100, - 102, 183, 186, 187, 189, 194, 195, 199, 200, 204, - 205, 206, 207, 0, 43, 56, 61, 64, 72, 73, + 102, 178, 181, 182, 184, 189, 190, 194, 195, 199, + 200, 201, 202, 0, 43, 56, 61, 64, 72, 73, 75, 79, 80, 81, 90, 94, 98, 109, 136, 138, - 139, 141, 142, 143, 164, 201, 203, 223, 125, 125, - 125, 125, 125, 125, 116, 125, 125, 125, 9, 95, - 185, 199, 200, 204, 125, 125, 125, 116, 125, 125, - 216, 216, 216, 216, 9, 45, 47, 48, 49, 53, - 63, 69, 70, 84, 85, 97, 102, 186, 214, 216, - 216, 13, 14, 15, 16, 17, 18, 19, 20, 29, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 124, 125, 126, 6, 183, 53, 63, 70, 205, - 70, 205, 205, 8, 9, 221, 205, 10, 14, 51, - 115, 120, 125, 182, 223, 107, 110, 221, 107, 221, - 110, 140, 125, 125, 107, 221, 110, 110, 110, 165, - 141, 148, 75, 221, 8, 9, 44, 51, 58, 59, - 60, 68, 74, 78, 82, 87, 95, 99, 101, 107, - 123, 153, 184, 187, 189, 194, 199, 200, 204, 213, - 214, 223, 213, 213, 213, 213, 213, 186, 213, 213, - 213, 221, 125, 221, 221, 213, 213, 186, 186, 213, - 213, 127, 108, 127, 216, 216, 216, 216, 216, 216, - 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, - 216, 216, 216, 216, 216, 127, 214, 216, 182, 63, - 120, 182, 182, 182, 182, 182, 126, 197, 198, 223, - 9, 196, 205, 110, 188, 190, 138, 8, 221, 133, - 107, 116, 51, 153, 184, 221, 125, 125, 183, 222, - 51, 183, 221, 137, 221, 107, 109, 110, 111, 176, - 109, 144, 221, 221, 127, 127, 127, 127, 127, 127, - 117, 127, 127, 127, 213, 127, 127, 127, 117, 127, - 127, 216, 216, 110, 127, 130, 182, 127, 212, 216, - 223, 221, 128, 196, 133, 110, 191, 192, 223, 108, - 108, 128, 202, 8, 9, 50, 51, 95, 166, 167, - 168, 169, 204, 223, 183, 176, 149, 154, 10, 120, - 155, 145, 183, 8, 9, 10, 14, 51, 115, 120, - 180, 223, 133, 125, 208, 209, 134, 135, 221, 107, - 216, 10, 14, 51, 78, 115, 120, 125, 146, 170, - 221, 110, 125, 127, 125, 216, 125, 130, 108, 111, - 128, 79, 80, 81, 99, 193, 107, 108, 8, 221, - 133, 221, 169, 221, 117, 108, 8, 9, 10, 14, - 51, 115, 120, 125, 181, 223, 150, 151, 170, 3, - 4, 5, 8, 12, 51, 54, 62, 76, 86, 88, - 92, 115, 119, 123, 125, 129, 172, 173, 179, 183, - 218, 219, 222, 223, 120, 170, 172, 147, 170, 180, - 120, 180, 180, 180, 180, 125, 126, 128, 156, 128, - 210, 223, 107, 108, 125, 107, 177, 178, 216, 223, - 109, 120, 170, 170, 13, 14, 15, 16, 17, 18, - 19, 20, 29, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 52, 76, 108, 111, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 125, 126, 129, 162, 170, 170, 170, 110, 111, 125, - 126, 175, 176, 223, 196, 214, 214, 172, 216, 95, - 99, 200, 220, 221, 99, 220, 99, 220, 79, 80, - 81, 133, 193, 108, 127, 108, 128, 111, 181, 111, - 141, 142, 163, 164, 168, 120, 181, 181, 181, 181, - 181, 111, 126, 174, 223, 152, 170, 175, 176, 181, - 183, 116, 185, 125, 116, 216, 216, 216, 186, 214, - 216, 127, 12, 108, 181, 13, 14, 15, 16, 17, - 18, 19, 20, 29, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 124, 125, 126, 170, 110, - 127, 127, 175, 176, 125, 180, 159, 212, 172, 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, 55, 57, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 74, 75, 76, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 107, 108, 109, 110, 111, 112, + 139, 141, 142, 159, 196, 198, 218, 125, 125, 125, + 125, 125, 125, 116, 125, 125, 125, 9, 95, 180, + 194, 195, 199, 125, 125, 125, 116, 125, 125, 211, + 211, 211, 211, 9, 45, 47, 48, 49, 53, 63, + 69, 70, 84, 85, 97, 102, 181, 209, 211, 211, + 13, 14, 15, 16, 17, 18, 19, 20, 29, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 129, 130, 211, 208, 135, - 213, 177, 128, 108, 170, 127, 130, 127, 4, 216, - 171, 212, 108, 127, 127, 127, 108, 221, 220, 221, - 220, 220, 220, 220, 220, 128, 8, 109, 221, 186, - 174, 186, 181, 127, 54, 86, 88, 115, 119, 120, - 123, 125, 129, 215, 217, 212, 175, 176, 108, 111, - 175, 181, 186, 125, 186, 186, 127, 127, 51, 161, - 223, 12, 179, 175, 216, 216, 216, 216, 216, 216, - 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, - 216, 216, 216, 216, 216, 127, 214, 216, 127, 125, - 161, 108, 160, 172, 130, 127, 210, 128, 127, 128, - 107, 216, 172, 130, 146, 161, 127, 127, 125, 116, - 125, 116, 215, 215, 215, 215, 186, 214, 215, 13, - 14, 15, 16, 17, 18, 19, 20, 29, 112, 113, - 114, 115, 118, 119, 120, 121, 122, 124, 125, 126, - 130, 108, 151, 216, 175, 117, 213, 127, 117, 216, - 77, 91, 110, 127, 130, 125, 157, 147, 172, 127, - 161, 128, 177, 127, 109, 109, 172, 186, 186, 186, - 127, 127, 215, 215, 215, 215, 215, 215, 215, 215, - 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, - 215, 127, 214, 216, 152, 125, 127, 125, 125, 216, - 158, 172, 127, 161, 128, 161, 127, 117, 127, 117, - 215, 110, 127, 130, 214, 214, 127, 221, 172, 127, - 161, 161, 125, 125, 215, 127, 127, 127, 127, 161, - 214, 214, 161, 127, 127 + 124, 125, 126, 6, 178, 53, 63, 70, 200, 70, + 200, 200, 8, 9, 216, 200, 10, 14, 51, 115, + 120, 125, 177, 218, 107, 110, 216, 107, 216, 110, + 140, 125, 125, 107, 216, 110, 110, 110, 160, 141, + 145, 75, 216, 8, 9, 44, 51, 58, 59, 60, + 68, 74, 78, 82, 87, 95, 99, 101, 107, 123, + 148, 179, 182, 184, 189, 194, 195, 199, 208, 209, + 218, 208, 208, 208, 208, 208, 181, 208, 208, 208, + 216, 125, 216, 216, 208, 208, 181, 181, 208, 208, + 127, 108, 127, 211, 211, 211, 211, 211, 211, 211, + 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, + 211, 211, 211, 211, 127, 209, 211, 177, 63, 120, + 177, 177, 177, 177, 177, 126, 192, 193, 218, 9, + 191, 200, 110, 183, 185, 138, 8, 216, 133, 107, + 116, 148, 179, 216, 125, 125, 217, 51, 178, 216, + 137, 216, 107, 109, 110, 111, 171, 109, 143, 216, + 216, 127, 127, 127, 127, 127, 127, 117, 127, 127, + 127, 208, 127, 127, 127, 117, 127, 127, 211, 211, + 110, 127, 130, 177, 127, 207, 211, 218, 216, 128, + 191, 133, 110, 186, 187, 218, 108, 108, 128, 197, + 8, 9, 50, 51, 95, 161, 162, 163, 164, 199, + 218, 171, 146, 149, 10, 120, 150, 178, 8, 9, + 10, 14, 51, 115, 120, 175, 218, 133, 125, 203, + 204, 134, 135, 216, 107, 211, 10, 14, 51, 78, + 115, 120, 125, 144, 165, 216, 110, 125, 127, 125, + 211, 125, 130, 108, 111, 128, 79, 80, 81, 99, + 188, 107, 108, 8, 216, 133, 216, 164, 216, 117, + 108, 8, 9, 10, 14, 51, 115, 120, 125, 176, + 218, 147, 165, 3, 4, 5, 8, 12, 51, 54, + 62, 76, 86, 88, 92, 115, 119, 123, 125, 129, + 167, 168, 174, 178, 213, 214, 217, 218, 120, 165, + 167, 175, 120, 175, 175, 175, 175, 125, 126, 128, + 151, 128, 205, 218, 107, 108, 125, 107, 172, 173, + 211, 218, 109, 120, 165, 165, 13, 14, 15, 16, + 17, 18, 19, 20, 29, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 52, 76, 108, + 111, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 125, 126, 129, 157, 165, 165, 165, 110, + 111, 125, 126, 170, 171, 218, 191, 209, 209, 167, + 211, 95, 99, 195, 215, 216, 99, 215, 99, 215, + 79, 80, 81, 133, 188, 108, 127, 108, 128, 111, + 176, 111, 141, 142, 158, 159, 163, 120, 176, 176, + 176, 176, 176, 111, 126, 169, 218, 170, 171, 176, + 178, 116, 180, 125, 116, 211, 211, 211, 181, 209, + 211, 127, 12, 108, 176, 13, 14, 15, 16, 17, + 18, 19, 20, 29, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 124, 125, 126, 165, 110, + 127, 127, 125, 175, 154, 207, 167, 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, + 55, 57, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 74, 75, 76, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 129, 130, 206, 203, 135, 208, 172, + 128, 108, 165, 127, 130, 127, 4, 211, 166, 207, + 108, 127, 127, 127, 108, 216, 215, 216, 215, 215, + 215, 215, 215, 128, 8, 109, 216, 181, 169, 181, + 176, 127, 54, 86, 88, 115, 119, 120, 123, 125, + 129, 210, 212, 207, 108, 111, 170, 176, 181, 125, + 181, 181, 127, 127, 51, 156, 218, 12, 174, 170, + 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, + 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, + 211, 127, 209, 211, 127, 125, 156, 155, 167, 130, + 127, 205, 128, 127, 128, 107, 211, 167, 130, 144, + 156, 127, 127, 125, 116, 125, 116, 210, 210, 210, + 210, 181, 209, 210, 13, 14, 15, 16, 17, 18, + 19, 20, 29, 112, 113, 114, 115, 118, 119, 120, + 121, 122, 124, 125, 126, 130, 147, 211, 170, 117, + 208, 127, 117, 211, 77, 91, 110, 127, 130, 125, + 152, 167, 127, 156, 128, 172, 127, 109, 109, 167, + 181, 181, 181, 127, 127, 210, 210, 210, 210, 210, + 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, + 210, 210, 210, 210, 127, 209, 211, 125, 127, 125, + 125, 211, 153, 167, 127, 156, 128, 156, 127, 117, + 127, 117, 210, 110, 127, 130, 209, 209, 127, 216, + 167, 127, 156, 156, 125, 125, 210, 127, 127, 127, + 127, 156, 209, 209, 156, 127, 127 }; -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 131, 132, 132, 132, 133, 133, 133, 134, 134, + 135, 137, 136, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 140, + 139, 141, 141, 141, 141, 141, 141, 141, 141, 141, + 141, 141, 141, 141, 143, 142, 142, 142, 144, 144, + 146, 145, 145, 147, 147, 149, 148, 150, 148, 151, + 148, 152, 148, 153, 148, 154, 148, 155, 148, 148, + 156, 156, 156, 156, 156, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 158, 158, 160, 159, 161, 161, + 162, 162, 163, 163, 163, 163, 163, 163, 164, 164, + 164, 165, 165, 165, 165, 165, 165, 165, 165, 165, + 165, 166, 165, 167, 167, 167, 167, 167, 168, 168, + 169, 169, 170, 170, 171, 171, 171, 171, 171, 172, + 172, 172, 173, 173, 173, 173, 174, 174, 174, 174, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 176, + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 177, 177, 177, 177, 177, 177, 177, 177, 178, 178, + 178, 178, 178, 178, 178, 178, 179, 179, 179, 179, + 179, 179, 179, 179, 179, 180, 180, 180, 180, 180, + 181, 181, 183, 182, 185, 184, 186, 186, 187, 187, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 189, + 190, 190, 190, 190, 191, 191, 192, 192, 192, 193, + 193, 193, 194, 195, 195, 195, 197, 196, 196, 198, + 198, 199, 199, 199, 200, 200, 200, 200, 200, 200, + 200, 200, 200, 200, 200, 200, 200, 200, 200, 201, + 201, 201, 201, 201, 202, 204, 203, 205, 205, 206, + 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, + 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, + 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, + 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, + 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, + 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, + 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, + 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, + 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, + 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, + 206, 206, 206, 206, 206, 206, 206, 207, 207, 208, + 208, 209, 209, 210, 210, 210, 210, 210, 210, 210, + 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, + 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, + 210, 210, 210, 210, 210, 210, 211, 211, 211, 211, + 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, + 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, + 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, + 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, + 211, 211, 211, 211, 211, 211, 212, 212, 212, 212, + 212, 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, 213, 213, 213, 214, + 214, 214, 214, 214, 214, 215, 215, 215, 216, 216, + 217, 217, 218 +}; -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +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, 7, 9, 9, 0, + 3, 1, 2, 2, 3, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 0, 4, 3, 3, 2, 4, + 0, 4, 3, 2, 4, 0, 6, 0, 6, 0, + 7, 0, 10, 0, 11, 0, 8, 0, 9, 1, + 1, 1, 2, 4, 5, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 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, 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, 2, 3, 4, 1, + 1, 1, 2, 2, 2, 2, 3, 4, 7, 3, + 1, 2, 2, 2, 2, 3, 4, 7, 1, 1, + 2, 1, 1, 1, 2, 4, 1, 1, 2, 1, + 1, 1, 2, 4, 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, 4, + 4, 2, 3, 1, 1, 1, 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, 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, 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, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, + 1, 1, 3, 1, 4, 7, 7, 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, 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 +}; -/* 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. 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 yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab -#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) @@ -2475,13 +2209,13 @@ do \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) + YYERROR; \ + } \ +while (0) /* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 +#define YYTERROR 1 +#define YYERRCODE 256 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. @@ -2491,7 +2225,7 @@ while (YYID (0)) #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ - if (YYID (N)) \ + if (N) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ @@ -2505,12 +2239,27 @@ while (YYID (0)) (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ - while (YYID (0)) + while (0) #endif #define YYRHSLOC(Rhs, K) ((Rhs)[K]) +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + + /* 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. */ @@ -2520,36 +2269,28 @@ while (YYID (0)) /* Print *YYLOCP on YYO. Private, do not rely on its existence. */ -__attribute__((__unused__)) -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +YY_ATTRIBUTE_UNUSED 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); + res += YYFPRINTF (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) - res += fprintf (yyo, ".%d", yylocp->first_column); + res += YYFPRINTF (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { - res += fprintf (yyo, "-%d", yylocp->last_line); + res += YYFPRINTF (yyo, "-%d", yylocp->last_line); if (0 <= end_col) - res += fprintf (yyo, ".%d", end_col); + res += YYFPRINTF (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) - res += fprintf (yyo, "-%d", end_col); + res += YYFPRINTF (yyo, "-%d", end_col); } return res; } @@ -2563,73 +2304,35 @@ yy_location_print_ (yyo, yylocp) #endif -/* YYLEX -- calling `yylex' with the right arguments. */ -#ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) -#else -# define YYLEX yylex (&yylval, &yylloc) -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, Location); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value, Location); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - YYLTYPE const * const yylocationp; -#endif { FILE *yyo = yyoutput; YYUSE (yyo); + YYUSE (yylocationp); if (!yyvaluep) return; - YYUSE (yylocationp); # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); # endif - switch (yytype) - { - default: - break; - } + YYUSE (yytype); } @@ -2637,23 +2340,11 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp) | Print this symbol on YYOUTPUT. | `--------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - YYLTYPE const * const yylocationp; -#endif { - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); YY_LOCATION_PRINT (yyoutput, *yylocationp); YYFPRINTF (yyoutput, ": "); @@ -2666,16 +2357,8 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp) | TOP (included). | `------------------------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) @@ -2686,50 +2369,42 @@ yy_stack_print (yybottom, yytop) YYFPRINTF (stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule) -#else -static void -yy_reduce_print (yyvsp, yylsp, yyrule) - YYSTYPE *yyvsp; - YYLTYPE *yylsp; - int yyrule; -#endif +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule) { + unsigned long int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; - unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); + yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - , &(yylsp[(yyi + 1) - (yynrhs)]) ); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &(yyvsp[(yyi + 1) - (yynrhs)]) + , &(yylsp[(yyi + 1) - (yynrhs)]) ); YYFPRINTF (stderr, "\n"); } } -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, yylsp, Rule); \ -} while (YYID (0)) +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -2743,7 +2418,7 @@ int yydebug; /* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif @@ -2766,15 +2441,8 @@ int yydebug; # define yystrlen strlen # else /* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) @@ -2790,16 +2458,8 @@ yystrlen (yystr) # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif { char *yyd = yydest; const char *yys = yysrc; @@ -2829,27 +2489,27 @@ yytnamerr (char *yyres, const char *yystr) char const *yyp = yystr; for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } do_not_strip_quotes: ; } @@ -2872,11 +2532,11 @@ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { - YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); + YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ - const char *yyformat = YY_NULL; + const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per @@ -2884,10 +2544,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, int yycount = 0; /* 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 @@ -2937,7 +2593,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, } yyarg[yycount++] = yytname[yyx]; { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; @@ -3004,33 +2660,18 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | Release the memory associated to this symbol. | `-----------------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp) -#else -static void -yydestruct (yymsg, yytype, yyvaluep, yylocationp) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; - YYLTYPE *yylocationp; -#endif { YYUSE (yyvaluep); YYUSE (yylocationp); - if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - switch (yytype) - { - - default: - break; - } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -3040,66 +2681,27 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp) | yyparse. | `----------*/ -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) int yyparse (void) -#else -int -yyparse () - -#endif -#endif { /* 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 +/* The semantic value of the lookahead symbol. */ /* Default value used for initialization, for pacifying older GCCs or non-GCC compilers. */ -static YYSTYPE yyval_default; -# define YY_INITIAL_VALUE(Value) = Value -#endif +YY_INITIAL_VALUE (static YYSTYPE yyval_default;) +YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); + +/* Location data for the lookahead symbol. */ 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 YY_INITIAL_VALUE(yyval_default); - -/* Location data for the lookahead symbol. */ YYLTYPE yylloc = yyloc_default; - /* Number of syntax errors so far. */ int yynerrs; @@ -3108,9 +2710,9 @@ YYLTYPE yylloc = yyloc_default; int yyerrstatus; /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. - `yyls': related to locations. + 'yyss': related to states. + 'yyvs': related to semantic values. + 'yyls': related to locations. Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ @@ -3189,26 +2791,26 @@ YYLTYPE yylloc = yyloc_default; #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - YYLTYPE *yyls1 = yyls; + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + YYLTYPE *yyls1 = yyls; - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yyls1, yysize * sizeof (*yylsp), - &yystacksize); + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yyls1, yysize * sizeof (*yylsp), + &yystacksize); - yyls = yyls1; - yyss = yyss1; - yyvs = yyvs1; + yyls = yyls1; + yyss = yyss1; + yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE @@ -3216,23 +2818,23 @@ YYLTYPE yylloc = yyloc_default; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; + yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); - YYSTACK_RELOCATE (yyls_alloc, yyls); + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); + YYSTACK_RELOCATE (yyls_alloc, yyls); # undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ @@ -3242,10 +2844,10 @@ YYLTYPE yylloc = yyloc_default; yylsp = yyls + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); @@ -3274,7 +2876,7 @@ yybackup: if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; + yychar = yylex (&yylval, &yylloc); } if (yychar <= YYEOF) @@ -3339,7 +2941,7 @@ yyreduce: yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison @@ -3354,49 +2956,48 @@ yyreduce: switch (yyn) { case 3: -/* Line 1792 of yacc.c */ -#line 388 "dtool/src/cppparser/cppBison.yxx" +#line 388 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - current_expr = (yyvsp[(2) - (2)].u.expr); + current_expr = (yyvsp[0].u.expr); } +#line 2964 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 4: -/* Line 1792 of yacc.c */ -#line 392 "dtool/src/cppparser/cppBison.yxx" +#line 392 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - current_type = (yyvsp[(2) - (2)].u.type); + current_type = (yyvsp[0].u.type); } +#line 2972 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 10: -/* Line 1792 of yacc.c */ -#line 410 "dtool/src/cppparser/cppBison.yxx" +#line 410 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - delete (yyvsp[(3) - (4)].u.expr); + delete (yyvsp[-1].u.expr); } +#line 2980 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 11: -/* Line 1792 of yacc.c */ -#line 422 "dtool/src/cppparser/cppBison.yxx" +#line 422 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { push_storage_class((current_storage_class & ~CPPInstance::SC_c_binding) | - ((yyvsp[(1) - (2)].u.integer) & CPPInstance::SC_c_binding)); + ((yyvsp[-1].u.integer) & CPPInstance::SC_c_binding)); } +#line 2989 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 12: -/* Line 1792 of yacc.c */ -#line 427 "dtool/src/cppparser/cppBison.yxx" +#line 427 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { pop_storage_class(); } +#line 2997 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 20: -/* Line 1792 of yacc.c */ -#line 441 "dtool/src/cppparser/cppBison.yxx" +#line 441 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { if (publish_nest_level != 0) { yyerror("Unclosed __begin_publish", publish_loc); @@ -3405,36 +3006,36 @@ yyreduce: } publish_previous = current_scope->get_current_vis(); - publish_loc = (yylsp[(1) - (1)]); + publish_loc = (yylsp[0]); publish_nest_level++; current_scope->set_current_vis(V_published); } +#line 3014 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 21: -/* Line 1792 of yacc.c */ -#line 454 "dtool/src/cppparser/cppBison.yxx" +#line 454 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { if (publish_nest_level != 1) { - yyerror("Unmatched __end_publish", (yylsp[(1) - (1)])); + yyerror("Unmatched __end_publish", (yylsp[0])); } else { current_scope->set_current_vis(publish_previous); } publish_nest_level = 0; } +#line 3027 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 22: -/* Line 1792 of yacc.c */ -#line 463 "dtool/src/cppparser/cppBison.yxx" +#line 463 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_scope->set_current_vis(V_published); } +#line 3035 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 23: -/* Line 1792 of yacc.c */ -#line 467 "dtool/src/cppparser/cppBison.yxx" +#line 467 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { if (publish_nest_level > 0) { current_scope->set_current_vis(V_published); @@ -3442,572 +3043,499 @@ yyreduce: current_scope->set_current_vis(V_public); } } +#line 3047 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 24: -/* Line 1792 of yacc.c */ -#line 475 "dtool/src/cppparser/cppBison.yxx" +#line 475 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_scope->set_current_vis(V_protected); } +#line 3055 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 25: -/* Line 1792 of yacc.c */ -#line 479 "dtool/src/cppparser/cppBison.yxx" +#line 479 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_scope->set_current_vis(V_private); } +#line 3063 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 26: -/* Line 1792 of yacc.c */ -#line 483 "dtool/src/cppparser/cppBison.yxx" +#line 483 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - CPPDeclaration *getter = (yyvsp[(5) - (7)].u.identifier)->find_symbol(current_scope, global_scope, current_lexer); + CPPDeclaration *getter = (yyvsp[-2].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)])); + yyerror("Reference to non-existent or invalid getter: " + (yyvsp[-2].u.identifier)->get_fully_scoped_name(), (yylsp[-6])); } - 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)])); + CPPMakeProperty *make_property = new CPPMakeProperty((yyvsp[-4].u.identifier), getter->as_function_group(), NULL, current_scope, (yylsp[-6]).file); + current_scope->add_declaration(make_property, global_scope, current_lexer, (yylsp[-6])); } +#line 3078 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 27: -/* Line 1792 of yacc.c */ -#line 494 "dtool/src/cppparser/cppBison.yxx" +#line 494 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - CPPDeclaration *getter = (yyvsp[(5) - (9)].u.identifier)->find_symbol(current_scope, global_scope, current_lexer); + CPPDeclaration *getter = (yyvsp[-4].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)])); + yyerror("Reference to non-existent or invalid getter: " + (yyvsp[-4].u.identifier)->get_fully_scoped_name(), (yylsp[-8])); } else { - CPPDeclaration *setter = (yyvsp[(7) - (9)].u.identifier)->find_symbol(current_scope, global_scope, current_lexer); + CPPDeclaration *setter = (yyvsp[-2].u.identifier)->find_symbol(current_scope, global_scope, current_lexer); CPPFunctionGroup *setter_func = NULL; 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)])); + yyerror("Reference to non-existent or invalid setter: " + (yyvsp[-2].u.identifier)->get_fully_scoped_name(), (yylsp[-8])); } else { setter_func = setter->as_function_group(); } - CPPMakeProperty *make_property = new CPPMakeProperty((yyvsp[(3) - (9)].u.identifier), getter->as_function_group(), - setter_func, current_scope, (yylsp[(1) - (9)]).file); - current_scope->add_declaration(make_property, global_scope, current_lexer, (yylsp[(1) - (9)])); + CPPMakeProperty *make_property = new CPPMakeProperty((yyvsp[-6].u.identifier), getter->as_function_group(), + setter_func, current_scope, (yylsp[-8]).file); + current_scope->add_declaration(make_property, global_scope, current_lexer, (yylsp[-8])); } } +#line 3103 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 28: -/* Line 1792 of yacc.c */ -#line 515 "dtool/src/cppparser/cppBison.yxx" +#line 515 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - 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)])); + CPPMakeSeq *make_seq = new CPPMakeSeq((yyvsp[-6].u.identifier)->get_simple_name(), (yyvsp[-4].u.identifier)->get_simple_name(), (yyvsp[-2].u.identifier)->get_simple_name(), (yylsp[-8]).file); + current_scope->add_declaration(make_seq, global_scope, current_lexer, (yylsp[-8])); } +#line 3112 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 29: -/* Line 1792 of yacc.c */ -#line 523 "dtool/src/cppparser/cppBison.yxx" +#line 523 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPScope *new_scope = new CPPScope(current_scope, CPPNameComponent("temp"), V_public); push_scope(new_scope); } +#line 3122 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 30: -/* Line 1792 of yacc.c */ -#line 529 "dtool/src/cppparser/cppBison.yxx" +#line 529 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { delete current_scope; pop_scope(); } +#line 3131 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 31: -/* Line 1792 of yacc.c */ -#line 538 "dtool/src/cppparser/cppBison.yxx" +#line 538 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.integer) = 0; } +#line 3139 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 32: -/* Line 1792 of yacc.c */ -#line 542 "dtool/src/cppparser/cppBison.yxx" +#line 542 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[(1) - (2)].u.integer) | (int)CPPInstance::SC_extern; + // This isn't really a storage class, but it helps with parsing. + (yyval.u.integer) = (yyvsp[-1].u.integer) | (int)CPPInstance::SC_const; } +#line 3148 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 33: -/* Line 1792 of yacc.c */ -#line 546 "dtool/src/cppparser/cppBison.yxx" +#line 547 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[(1) - (3)].u.integer) | (int)CPPInstance::SC_extern; - if ((yyvsp[(3) - (3)].str) == "C") { - (yyval.u.integer) |= (int)CPPInstance::SC_c_binding; - } else if ((yyvsp[(3) - (3)].str) == "C++") { - (yyval.u.integer) &= ~(int)CPPInstance::SC_c_binding; - } else { - yywarning("Ignoring unknown linkage type \"" + (yyvsp[(3) - (3)].str) + "\"", (yylsp[(3) - (3)])); - } + (yyval.u.integer) = (yyvsp[-1].u.integer) | (int)CPPInstance::SC_extern; } +#line 3156 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 34: -/* Line 1792 of yacc.c */ -#line 557 "dtool/src/cppparser/cppBison.yxx" +#line 551 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[(1) - (2)].u.integer) | (int)CPPInstance::SC_static; + (yyval.u.integer) = (yyvsp[-2].u.integer) | (int)CPPInstance::SC_extern; + if ((yyvsp[0].str) == "C") { + (yyval.u.integer) |= (int)CPPInstance::SC_c_binding; + } else if ((yyvsp[0].str) == "C++") { + (yyval.u.integer) &= ~(int)CPPInstance::SC_c_binding; + } else { + yywarning("Ignoring unknown linkage type \"" + (yyvsp[0].str) + "\"", (yylsp[0])); + } } +#line 3171 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 35: -/* Line 1792 of yacc.c */ -#line 561 "dtool/src/cppparser/cppBison.yxx" +#line 562 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[(1) - (2)].u.integer) | (int)CPPInstance::SC_inline; + (yyval.u.integer) = (yyvsp[-1].u.integer) | (int)CPPInstance::SC_static; } +#line 3179 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 36: -/* Line 1792 of yacc.c */ -#line 565 "dtool/src/cppparser/cppBison.yxx" +#line 566 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[(1) - (2)].u.integer) | (int)CPPInstance::SC_virtual; + (yyval.u.integer) = (yyvsp[-1].u.integer) | (int)CPPInstance::SC_inline; } +#line 3187 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 37: -/* Line 1792 of yacc.c */ -#line 569 "dtool/src/cppparser/cppBison.yxx" +#line 570 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[(1) - (2)].u.integer) | (int)CPPInstance::SC_explicit; + (yyval.u.integer) = (yyvsp[-1].u.integer) | (int)CPPInstance::SC_virtual; } +#line 3195 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 38: -/* Line 1792 of yacc.c */ -#line 573 "dtool/src/cppparser/cppBison.yxx" +#line 574 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[(1) - (2)].u.integer) | (int)CPPInstance::SC_volatile; + (yyval.u.integer) = (yyvsp[-1].u.integer) | (int)CPPInstance::SC_explicit; } +#line 3203 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 39: -/* Line 1792 of yacc.c */ -#line 577 "dtool/src/cppparser/cppBison.yxx" +#line 578 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[(1) - (2)].u.integer) | (int)CPPInstance::SC_mutable; + (yyval.u.integer) = (yyvsp[-1].u.integer) | (int)CPPInstance::SC_volatile; } +#line 3211 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 40: -/* Line 1792 of yacc.c */ -#line 581 "dtool/src/cppparser/cppBison.yxx" +#line 582 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[(1) - (2)].u.integer) | (int)CPPInstance::SC_register; + (yyval.u.integer) = (yyvsp[-1].u.integer) | (int)CPPInstance::SC_mutable; } +#line 3219 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 41: -/* Line 1792 of yacc.c */ -#line 585 "dtool/src/cppparser/cppBison.yxx" +#line 586 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[(1) - (2)].u.integer) | (int)CPPInstance::SC_blocking; + (yyval.u.integer) = (yyvsp[-1].u.integer) | (int)CPPInstance::SC_register; } +#line 3227 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 42: -/* Line 1792 of yacc.c */ -#line 589 "dtool/src/cppparser/cppBison.yxx" +#line 590 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[(1) - (2)].u.integer) | (int)CPPInstance::SC_extension; + (yyval.u.integer) = (yyvsp[-1].u.integer) | (int)CPPInstance::SC_blocking; } +#line 3235 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 43: -/* Line 1792 of yacc.c */ -#line 596 "dtool/src/cppparser/cppBison.yxx" +#line 594 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - /* multiple_var_declaration adds itself to the scope. */ + (yyval.u.integer) = (yyvsp[-1].u.integer) | (int)CPPInstance::SC_extension; } +#line 3243 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 44: -/* Line 1792 of yacc.c */ -#line 600 "dtool/src/cppparser/cppBison.yxx" +#line 601 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + // We don't need to push/pop type, because we can't nest + // multiple_var_declarations. + if ((yyvsp[0].u.decl)->as_type_declaration()) { + current_type = (yyvsp[0].u.decl)->as_type_declaration()->_type; + } else { + current_type = (yyvsp[0].u.decl)->as_type(); + } + push_storage_class((yyvsp[-1].u.integer)); +} +#line 3258 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 45: +#line 612 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + pop_storage_class(); +} +#line 3266 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 46: +#line 616 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // We don't really care about the storage class here. In fact, it's // not actually legal to define a class or struct using a particular // storage class, but we require it just to help yacc out in its // parsing. - current_scope->add_declaration((yyvsp[(2) - (3)].u.decl), global_scope, current_lexer, (yylsp[(2) - (3)])); -} - break; - - case 45: -/* Line 1792 of yacc.c */ -#line 609 "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)); - current_scope->add_declaration((yyvsp[(2) - (3)].u.instance), global_scope, current_lexer, (yylsp[(2) - (3)])); - (yyvsp[(2) - (3)].u.instance)->set_initializer((yyvsp[(3) - (3)].u.expr)); - } -} - break; - - case 46: -/* Line 1792 of yacc.c */ -#line 620 "dtool/src/cppparser/cppBison.yxx" - { - // We don't need to push/pop type, because we can't nest - // multiple_var_declarations. - if ((yyvsp[(2) - (2)].u.decl)->as_type_declaration()) { - current_type = (yyvsp[(2) - (2)].u.decl)->as_type_declaration()->_type; - } else { - current_type = (yyvsp[(2) - (2)].u.decl)->as_type(); - } - push_storage_class((yyvsp[(1) - (2)].u.integer)); + current_scope->add_declaration((yyvsp[-1].u.decl), global_scope, current_lexer, (yylsp[-1])); } +#line 3279 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 47: -/* Line 1792 of yacc.c */ -#line 631 "dtool/src/cppparser/cppBison.yxx" +#line 625 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - pop_storage_class(); + if ((yyvsp[-1].u.instance) != (CPPInstance *)NULL) { + (yyvsp[-1].u.instance)->_storage_class |= (current_storage_class | (yyvsp[-2].u.integer)); + current_scope->add_declaration((yyvsp[-1].u.instance), global_scope, current_lexer, (yylsp[-1])); + (yyvsp[-1].u.instance)->set_initializer((yyvsp[0].u.expr)); + } } +#line 3291 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 48: -/* Line 1792 of yacc.c */ -#line 635 "dtool/src/cppparser/cppBison.yxx" +#line 639 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - // We don't need to push/pop type, because we can't nest - // multiple_var_declarations. - current_type = (yyvsp[(3) - (3)].u.type); - push_storage_class((yyvsp[(1) - (3)].u.integer)); + if (current_storage_class & CPPInstance::SC_const) { + (yyvsp[-1].u.inst_ident)->add_modifier(IIT_const); + } + CPPInstance *inst = new CPPInstance(current_type, (yyvsp[-1].u.inst_ident), + current_storage_class, + (yylsp[-1]).file); + inst->set_initializer((yyvsp[0].u.expr)); + current_scope->add_declaration(inst, global_scope, current_lexer, (yylsp[-1])); } +#line 3306 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 49: -/* Line 1792 of yacc.c */ -#line 642 "dtool/src/cppparser/cppBison.yxx" +#line 650 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - pop_storage_class(); + if (current_storage_class & CPPInstance::SC_const) { + (yyvsp[-3].u.inst_ident)->add_modifier(IIT_const); + } + CPPInstance *inst = new CPPInstance(current_type, (yyvsp[-3].u.inst_ident), + current_storage_class, + (yylsp[-3]).file); + inst->set_initializer((yyvsp[-2].u.expr)); + current_scope->add_declaration(inst, global_scope, current_lexer, (yylsp[-3])); } +#line 3321 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 50: -/* Line 1792 of yacc.c */ -#line 653 "dtool/src/cppparser/cppBison.yxx" +#line 664 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - CPPInstance *inst = new CPPInstance(current_type, (yyvsp[(1) - (2)].u.inst_ident), - current_storage_class, - (yylsp[(1) - (2)]).file); - inst->set_initializer((yyvsp[(2) - (2)].u.expr)); - current_scope->add_declaration(inst, global_scope, current_lexer, (yylsp[(1) - (2)])); + // We don't need to push/pop type, because we can't nest + // multiple_var_declarations. + if ((yyvsp[0].u.decl)->as_type_declaration()) { + current_type = (yyvsp[0].u.decl)->as_type_declaration()->_type; + } else { + current_type = (yyvsp[0].u.decl)->as_type(); + } + push_storage_class((yyvsp[-1].u.integer)); } +#line 3336 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 51: -/* Line 1792 of yacc.c */ -#line 661 "dtool/src/cppparser/cppBison.yxx" +#line 675 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - CPPInstance *inst = new CPPInstance(current_type, (yyvsp[(1) - (4)].u.inst_ident), - current_storage_class, - (yylsp[(1) - (4)]).file); - inst->set_initializer((yyvsp[(2) - (4)].u.expr)); - current_scope->add_declaration(inst, global_scope, current_lexer, (yylsp[(1) - (4)])); + pop_storage_class(); } +#line 3344 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 52: -/* Line 1792 of yacc.c */ -#line 672 "dtool/src/cppparser/cppBison.yxx" +#line 679 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyvsp[(1) - (2)].u.inst_ident)->add_modifier(IIT_const); - CPPInstance *inst = new CPPInstance(current_type, (yyvsp[(1) - (2)].u.inst_ident), - current_storage_class, - (yylsp[(1) - (2)]).file); - inst->set_initializer((yyvsp[(2) - (2)].u.expr)); - current_scope->add_declaration(inst, global_scope, current_lexer, (yylsp[(1) - (2)])); -} - break; - - case 53: -/* Line 1792 of yacc.c */ -#line 681 "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), - current_storage_class, - (yylsp[(1) - (4)]).file); - inst->set_initializer((yyvsp[(2) - (4)].u.expr)); - current_scope->add_declaration(inst, global_scope, current_lexer, (yylsp[(1) - (4)])); -} - break; - - case 54: -/* Line 1792 of yacc.c */ -#line 694 "dtool/src/cppparser/cppBison.yxx" - { - // We don't need to push/pop type, because we can't nest - // multiple_var_declarations. - if ((yyvsp[(2) - (2)].u.decl)->as_type_declaration()) { - current_type = (yyvsp[(2) - (2)].u.decl)->as_type_declaration()->_type; - } else { - current_type = (yyvsp[(2) - (2)].u.decl)->as_type(); - } - push_storage_class((yyvsp[(1) - (2)].u.integer)); -} - break; - - case 55: -/* Line 1792 of yacc.c */ -#line 705 "dtool/src/cppparser/cppBison.yxx" - { - pop_storage_class(); -} - break; - - case 56: -/* Line 1792 of yacc.c */ -#line 709 "dtool/src/cppparser/cppBison.yxx" - { - // We don't need to push/pop type, because we can't nest - // multiple_var_declarations. - current_type = (yyvsp[(3) - (3)].u.type); - push_storage_class((yyvsp[(1) - (3)].u.integer)); -} - break; - - case 57: -/* Line 1792 of yacc.c */ -#line 716 "dtool/src/cppparser/cppBison.yxx" - { - pop_storage_class(); -} - break; - - case 58: -/* Line 1792 of yacc.c */ -#line 720 "dtool/src/cppparser/cppBison.yxx" - { - if ((yyvsp[(2) - (3)].u.instance) != (CPPDeclaration *)NULL) { - CPPInstance *inst = (yyvsp[(2) - (3)].u.instance)->as_instance(); + if ((yyvsp[-1].u.instance) != (CPPDeclaration *)NULL) { + CPPInstance *inst = (yyvsp[-1].u.instance)->as_instance(); if (inst != (CPPInstance *)NULL) { - inst->_storage_class |= (current_storage_class | (yyvsp[(1) - (3)].u.integer)); - current_scope->add_declaration(inst, global_scope, current_lexer, (yylsp[(2) - (3)])); + inst->_storage_class |= (current_storage_class | (yyvsp[-2].u.integer)); + current_scope->add_declaration(inst, global_scope, current_lexer, (yylsp[-1])); CPPTypedefType *typedef_type = new CPPTypedefType(inst->_type, inst->_ident, current_scope); - current_scope->add_declaration(typedef_type, global_scope, current_lexer, (yylsp[(2) - (3)])); + current_scope->add_declaration(typedef_type, global_scope, current_lexer, (yylsp[-1])); } } } +#line 3360 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 53: +#line 694 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + if (current_storage_class & CPPInstance::SC_const) { + (yyvsp[-1].u.inst_ident)->add_modifier(IIT_const); + } + CPPType *target_type = current_type; + CPPTypedefType *typedef_type = new CPPTypedefType(target_type, (yyvsp[-1].u.inst_ident), current_scope, (yylsp[-1]).file); + current_scope->add_declaration(typedef_type, global_scope, current_lexer, (yylsp[-1])); +} +#line 3373 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 54: +#line 703 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + if (current_storage_class & CPPInstance::SC_const) { + (yyvsp[-3].u.inst_ident)->add_modifier(IIT_const); + } + CPPType *target_type = current_type; + CPPTypedefType *typedef_type = new CPPTypedefType(target_type, (yyvsp[-3].u.inst_ident), current_scope, (yylsp[-3]).file); + current_scope->add_declaration(typedef_type, global_scope, current_lexer, (yylsp[-3])); +} +#line 3386 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 55: +#line 717 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + push_scope((yyvsp[-1].u.identifier)->get_scope(current_scope, global_scope)); +} +#line 3394 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 56: +#line 721 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + pop_scope(); + CPPType *type; + if ((yyvsp[-5].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[-5].u.identifier)); + ii->add_func_modifier((yyvsp[-2].u.param_list), (yyvsp[0].u.integer)); + + (yyval.u.instance) = new CPPInstance(type, ii, 0, (yylsp[-5]).file); +} +#line 3416 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 57: +#line 739 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + push_scope((yyvsp[-1].u.identifier)->get_scope(current_scope, global_scope)); +} +#line 3424 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 58: +#line 743 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + pop_scope(); + CPPType *type; + if ((yyvsp[-5].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[-5].u.identifier)); + ii->add_func_modifier((yyvsp[-2].u.param_list), (yyvsp[0].u.integer)); + + (yyval.u.instance) = new CPPInstance(type, ii, 0, (yylsp[-5]).file); +} +#line 3446 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 59: -/* Line 1792 of yacc.c */ -#line 735 "dtool/src/cppparser/cppBison.yxx" +#line 763 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - CPPType *target_type = current_type; - CPPTypedefType *typedef_type = new CPPTypedefType(target_type, (yyvsp[(1) - (2)].u.inst_ident), current_scope, (yylsp[(1) - (2)]).file); - current_scope->add_declaration(typedef_type, global_scope, current_lexer, (yylsp[(1) - (2)])); + push_scope((yyvsp[-1].u.identifier)->get_scope(current_scope, global_scope)); } +#line 3454 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 60: -/* Line 1792 of yacc.c */ -#line 741 "dtool/src/cppparser/cppBison.yxx" - { - CPPType *target_type = current_type; - CPPTypedefType *typedef_type = new CPPTypedefType(target_type, (yyvsp[(1) - (4)].u.inst_ident), current_scope, (yylsp[(1) - (4)]).file); - current_scope->add_declaration(typedef_type, global_scope, current_lexer, (yylsp[(1) - (4)])); -} - break; - - case 61: -/* Line 1792 of yacc.c */ -#line 750 "dtool/src/cppparser/cppBison.yxx" - { - (yyvsp[(1) - (2)].u.inst_ident)->add_modifier(IIT_const); - CPPType *target_type = current_type; - CPPTypedefType *typedef_type = new CPPTypedefType(target_type, (yyvsp[(1) - (2)].u.inst_ident), current_scope, (yylsp[(1) - (2)]).file); - current_scope->add_declaration(typedef_type, global_scope, current_lexer, (yylsp[(1) - (2)])); -} - break; - - case 62: -/* Line 1792 of yacc.c */ -#line 757 "dtool/src/cppparser/cppBison.yxx" - { - (yyvsp[(1) - (4)].u.inst_ident)->add_modifier(IIT_const); - CPPType *target_type = current_type; - CPPTypedefType *typedef_type = new CPPTypedefType(target_type, (yyvsp[(1) - (4)].u.inst_ident), current_scope, (yylsp[(1) - (4)]).file); - current_scope->add_declaration(typedef_type, global_scope, current_lexer, (yylsp[(1) - (4)])); -} - break; - - case 63: -/* 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 1792 of yacc.c */ -#line 773 "dtool/src/cppparser/cppBison.yxx" +#line 767 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { 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 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; - - 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 68: -/* Line 1792 of yacc.c */ -#line 819 "dtool/src/cppparser/cppBison.yxx" - { - pop_scope(); - if ((yyvsp[(2) - (7)].u.identifier)->is_scoped()) { - yyerror("Invalid destructor name: ~" + (yyvsp[(2) - (7)].u.identifier)->get_fully_scoped_name(), (yylsp[(2) - (7)])); + if ((yyvsp[-5].u.identifier)->is_scoped()) { + yyerror("Invalid destructor name: ~" + (yyvsp[-5].u.identifier)->get_fully_scoped_name(), (yylsp[-5])); } else { CPPIdentifier *ident = - new CPPIdentifier("~" + (yyvsp[(2) - (7)].u.identifier)->get_simple_name(), (yylsp[(2) - (7)]).file); - delete (yyvsp[(2) - (7)].u.identifier); + new CPPIdentifier("~" + (yyvsp[-5].u.identifier)->get_simple_name(), (yylsp[-5]).file); + delete (yyvsp[-5].u.identifier); CPPType *type; type = new CPPSimpleType(CPPSimpleType::T_void); CPPInstanceIdentifier *ii = new CPPInstanceIdentifier(ident); - ii->add_func_modifier((yyvsp[(5) - (7)].u.param_list), (yyvsp[(7) - (7)].u.integer)); + ii->add_func_modifier((yyvsp[-2].u.param_list), (yyvsp[0].u.integer)); - (yyval.u.instance) = new CPPInstance(type, ii, 0, (yylsp[(2) - (7)]).file); + (yyval.u.instance) = new CPPInstance(type, ii, 0, (yylsp[-5]).file); } } +#line 3477 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 69: -/* Line 1792 of yacc.c */ -#line 845 "dtool/src/cppparser/cppBison.yxx" + case 61: +#line 793 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - push_scope((yyvsp[(4) - (6)].u.inst_ident)->get_scope(current_scope, global_scope)); + push_scope((yyvsp[-2].u.inst_ident)->get_scope(current_scope, global_scope)); } +#line 3485 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 70: -/* Line 1792 of yacc.c */ -#line 849 "dtool/src/cppparser/cppBison.yxx" + case 62: +#line 797 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { pop_scope(); - CPPType *type = (yyvsp[(1) - (10)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); + CPPType *type = (yyvsp[-9].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); assert(type != NULL); - CPPInstanceIdentifier *ii = (yyvsp[(4) - (10)].u.inst_ident); + CPPInstanceIdentifier *ii = (yyvsp[-6].u.inst_ident); ii->add_modifier(IIT_pointer); - ii->add_func_modifier((yyvsp[(8) - (10)].u.param_list), (yyvsp[(10) - (10)].u.integer)); - (yyval.u.instance) = new CPPInstance(type, ii, 0, (yylsp[(1) - (10)]).file); + ii->add_func_modifier((yyvsp[-2].u.param_list), (yyvsp[0].u.integer)); + (yyval.u.instance) = new CPPInstance(type, ii, 0, (yylsp[-9]).file); } +#line 3500 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 71: -/* Line 1792 of yacc.c */ -#line 860 "dtool/src/cppparser/cppBison.yxx" + case 63: +#line 808 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - push_scope((yyvsp[(5) - (7)].u.inst_ident)->get_scope(current_scope, global_scope)); + push_scope((yyvsp[-2].u.inst_ident)->get_scope(current_scope, global_scope)); } +#line 3508 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 72: -/* Line 1792 of yacc.c */ -#line 864 "dtool/src/cppparser/cppBison.yxx" + case 64: +#line 812 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { pop_scope(); - CPPType *type = (yyvsp[(1) - (11)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); + CPPType *type = (yyvsp[-10].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); assert(type != NULL); - CPPInstanceIdentifier *ii = (yyvsp[(5) - (11)].u.inst_ident); - ii->add_scoped_pointer_modifier((yyvsp[(3) - (11)].u.identifier)); - ii->add_func_modifier((yyvsp[(9) - (11)].u.param_list), (yyvsp[(11) - (11)].u.integer)); - (yyval.u.instance) = new CPPInstance(type, ii, 0, (yylsp[(1) - (11)]).file); + CPPInstanceIdentifier *ii = (yyvsp[-6].u.inst_ident); + ii->add_scoped_pointer_modifier((yyvsp[-8].u.identifier)); + ii->add_func_modifier((yyvsp[-2].u.param_list), (yyvsp[0].u.integer)); + (yyval.u.instance) = new CPPInstance(type, ii, 0, (yylsp[-10]).file); } +#line 3523 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 73: -/* Line 1792 of yacc.c */ -#line 877 "dtool/src/cppparser/cppBison.yxx" + case 65: +#line 825 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - if ((yyvsp[(1) - (4)].u.identifier) != NULL) { - push_scope((yyvsp[(1) - (4)].u.identifier)->get_scope(current_scope, global_scope)); + if ((yyvsp[-3].u.identifier) != NULL) { + push_scope((yyvsp[-3].u.identifier)->get_scope(current_scope, global_scope)); } } +#line 3533 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 74: -/* Line 1792 of yacc.c */ -#line 883 "dtool/src/cppparser/cppBison.yxx" + case 66: +#line 831 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - if ((yyvsp[(1) - (8)].u.identifier) != NULL) { + if ((yyvsp[-7].u.identifier) != NULL) { pop_scope(); } @@ -4020,3116 +3548,3116 @@ yyreduce: // We give typecast operators the name "operator typecast ", // where is a simple name of the type to be typecast. Use // the method's return type to determine the full type description. - string name = "operator typecast " + (yyvsp[(2) - (8)].u.type)->get_simple_name(); - CPPIdentifier *ident = (yyvsp[(1) - (8)].u.identifier); + string name = "operator typecast " + (yyvsp[-6].u.type)->get_simple_name(); + CPPIdentifier *ident = (yyvsp[-7].u.identifier); if (ident == NULL) { - ident = new CPPIdentifier(name, (yylsp[(1) - (8)]).file); + ident = new CPPIdentifier(name, (yylsp[-7]).file); } else { ident->add_name(name); } (yyval.u.instance) = CPPInstance::make_typecast_function - (new CPPInstance((yyvsp[(2) - (8)].u.type), (yyvsp[(3) - (8)].u.inst_ident), 0, (yylsp[(3) - (8)]).file), ident, (yyvsp[(6) - (8)].u.param_list), (yyvsp[(8) - (8)].u.integer)); + (new CPPInstance((yyvsp[-6].u.type), (yyvsp[-5].u.inst_ident), 0, (yylsp[-5]).file), ident, (yyvsp[-2].u.param_list), (yyvsp[0].u.integer)); } +#line 3562 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 75: -/* Line 1792 of yacc.c */ -#line 908 "dtool/src/cppparser/cppBison.yxx" + case 67: +#line 856 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - if ((yyvsp[(1) - (5)].u.identifier) != NULL) { - push_scope((yyvsp[(1) - (5)].u.identifier)->get_scope(current_scope, global_scope)); + if ((yyvsp[-4].u.identifier) != NULL) { + push_scope((yyvsp[-4].u.identifier)->get_scope(current_scope, global_scope)); } } +#line 3572 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 76: -/* Line 1792 of yacc.c */ -#line 914 "dtool/src/cppparser/cppBison.yxx" + case 68: +#line 862 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - if ((yyvsp[(1) - (9)].u.identifier) != NULL) { + if ((yyvsp[-8].u.identifier) != NULL) { pop_scope(); } - CPPIdentifier *ident = (yyvsp[(1) - (9)].u.identifier); + CPPIdentifier *ident = (yyvsp[-8].u.identifier); if (ident == NULL) { - ident = new CPPIdentifier("operator typecast", (yylsp[(1) - (9)]).file); + ident = new CPPIdentifier("operator typecast", (yylsp[-8]).file); } else { ident->add_name("operator typecast"); } - (yyvsp[(4) - (9)].u.inst_ident)->add_modifier(IIT_const); + (yyvsp[-5].u.inst_ident)->add_modifier(IIT_const); (yyval.u.instance) = CPPInstance::make_typecast_function - (new CPPInstance((yyvsp[(3) - (9)].u.type), (yyvsp[(4) - (9)].u.inst_ident), 0, (yylsp[(4) - (9)]).file), ident, (yyvsp[(7) - (9)].u.param_list), (yyvsp[(9) - (9)].u.integer)); + (new CPPInstance((yyvsp[-6].u.type), (yyvsp[-5].u.inst_ident), 0, (yylsp[-5]).file), ident, (yyvsp[-2].u.param_list), (yyvsp[0].u.integer)); } +#line 3592 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 77: -/* Line 1792 of yacc.c */ -#line 934 "dtool/src/cppparser/cppBison.yxx" + case 69: +#line 882 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPDeclaration *decl = - (yyvsp[(1) - (1)].u.identifier)->find_symbol(current_scope, global_scope, current_lexer); + (yyvsp[0].u.identifier)->find_symbol(current_scope, global_scope, current_lexer); if (decl != (CPPDeclaration *)NULL) { (yyval.u.instance) = decl->as_instance(); } else { (yyval.u.instance) = (CPPInstance *)NULL; } } +#line 3606 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 78: -/* Line 1792 of yacc.c */ -#line 947 "dtool/src/cppparser/cppBison.yxx" + case 70: +#line 895 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.integer) = 0; } +#line 3614 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 79: -/* Line 1792 of yacc.c */ -#line 951 "dtool/src/cppparser/cppBison.yxx" + case 71: +#line 899 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.integer) = (int)CPPFunctionType::F_const_method; } +#line 3622 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 80: -/* Line 1792 of yacc.c */ -#line 955 "dtool/src/cppparser/cppBison.yxx" + case 72: +#line 903 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.integer) = (int)CPPFunctionType::F_noexcept; } +#line 3630 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 81: -/* Line 1792 of yacc.c */ -#line 959 "dtool/src/cppparser/cppBison.yxx" + case 73: +#line 907 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[(1) - (4)].u.integer); + (yyval.u.integer) = (yyvsp[-3].u.integer); } +#line 3638 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 82: -/* Line 1792 of yacc.c */ -#line 963 "dtool/src/cppparser/cppBison.yxx" + case 74: +#line 911 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[(1) - (5)].u.integer); + (yyval.u.integer) = (yyvsp[-4].u.integer); } +#line 3646 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 83: -/* Line 1792 of yacc.c */ -#line 970 "dtool/src/cppparser/cppBison.yxx" + case 75: +#line 918 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "!"; } +#line 3654 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 84: -/* Line 1792 of yacc.c */ -#line 974 "dtool/src/cppparser/cppBison.yxx" + case 76: +#line 922 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "~"; } +#line 3662 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 85: -/* Line 1792 of yacc.c */ -#line 978 "dtool/src/cppparser/cppBison.yxx" + case 77: +#line 926 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "*"; } +#line 3670 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 86: -/* Line 1792 of yacc.c */ -#line 982 "dtool/src/cppparser/cppBison.yxx" + case 78: +#line 930 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "/"; } +#line 3678 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 87: -/* Line 1792 of yacc.c */ -#line 986 "dtool/src/cppparser/cppBison.yxx" + case 79: +#line 934 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "%"; } +#line 3686 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 88: -/* Line 1792 of yacc.c */ -#line 990 "dtool/src/cppparser/cppBison.yxx" + case 80: +#line 938 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "+"; } +#line 3694 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 89: -/* Line 1792 of yacc.c */ -#line 994 "dtool/src/cppparser/cppBison.yxx" + case 81: +#line 942 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "-"; } +#line 3702 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 90: -/* Line 1792 of yacc.c */ -#line 998 "dtool/src/cppparser/cppBison.yxx" + case 82: +#line 946 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "|"; } +#line 3710 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 91: -/* Line 1792 of yacc.c */ -#line 1002 "dtool/src/cppparser/cppBison.yxx" + case 83: +#line 950 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "&"; } +#line 3718 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 92: -/* Line 1792 of yacc.c */ -#line 1006 "dtool/src/cppparser/cppBison.yxx" + case 84: +#line 954 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "^"; } +#line 3726 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 93: -/* Line 1792 of yacc.c */ -#line 1010 "dtool/src/cppparser/cppBison.yxx" + case 85: +#line 958 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "||"; } +#line 3734 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 94: -/* Line 1792 of yacc.c */ -#line 1014 "dtool/src/cppparser/cppBison.yxx" + case 86: +#line 962 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "&&"; } +#line 3742 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 95: -/* Line 1792 of yacc.c */ -#line 1018 "dtool/src/cppparser/cppBison.yxx" + case 87: +#line 966 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "=="; } +#line 3750 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 96: -/* Line 1792 of yacc.c */ -#line 1022 "dtool/src/cppparser/cppBison.yxx" + case 88: +#line 970 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "!="; } +#line 3758 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 97: -/* Line 1792 of yacc.c */ -#line 1026 "dtool/src/cppparser/cppBison.yxx" + case 89: +#line 974 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "<="; } +#line 3766 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 98: -/* Line 1792 of yacc.c */ -#line 1030 "dtool/src/cppparser/cppBison.yxx" + case 90: +#line 978 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = ">="; } +#line 3774 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 99: -/* Line 1792 of yacc.c */ -#line 1034 "dtool/src/cppparser/cppBison.yxx" + case 91: +#line 982 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "<"; } +#line 3782 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 100: -/* Line 1792 of yacc.c */ -#line 1038 "dtool/src/cppparser/cppBison.yxx" + case 92: +#line 986 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = ">"; } +#line 3790 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 101: -/* Line 1792 of yacc.c */ -#line 1042 "dtool/src/cppparser/cppBison.yxx" + case 93: +#line 990 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "<<"; } +#line 3798 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 102: -/* Line 1792 of yacc.c */ -#line 1046 "dtool/src/cppparser/cppBison.yxx" + case 94: +#line 994 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = ">>"; } +#line 3806 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 103: -/* Line 1792 of yacc.c */ -#line 1050 "dtool/src/cppparser/cppBison.yxx" + case 95: +#line 998 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "="; } +#line 3814 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 104: -/* Line 1792 of yacc.c */ -#line 1054 "dtool/src/cppparser/cppBison.yxx" + case 96: +#line 1002 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = ","; } +#line 3822 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 105: -/* Line 1792 of yacc.c */ -#line 1058 "dtool/src/cppparser/cppBison.yxx" + case 97: +#line 1006 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "++"; } +#line 3830 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 106: -/* Line 1792 of yacc.c */ -#line 1062 "dtool/src/cppparser/cppBison.yxx" + case 98: +#line 1010 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "--"; } +#line 3838 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 107: -/* Line 1792 of yacc.c */ -#line 1066 "dtool/src/cppparser/cppBison.yxx" + case 99: +#line 1014 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "*="; } +#line 3846 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 108: -/* Line 1792 of yacc.c */ -#line 1070 "dtool/src/cppparser/cppBison.yxx" + case 100: +#line 1018 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "/="; } +#line 3854 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 109: -/* Line 1792 of yacc.c */ -#line 1074 "dtool/src/cppparser/cppBison.yxx" + case 101: +#line 1022 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "%="; } +#line 3862 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 110: -/* Line 1792 of yacc.c */ -#line 1078 "dtool/src/cppparser/cppBison.yxx" + case 102: +#line 1026 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "+="; } +#line 3870 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 111: -/* Line 1792 of yacc.c */ -#line 1082 "dtool/src/cppparser/cppBison.yxx" + case 103: +#line 1030 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "-="; } +#line 3878 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 112: -/* Line 1792 of yacc.c */ -#line 1086 "dtool/src/cppparser/cppBison.yxx" + case 104: +#line 1034 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "|="; } +#line 3886 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 113: -/* Line 1792 of yacc.c */ -#line 1090 "dtool/src/cppparser/cppBison.yxx" + case 105: +#line 1038 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "&="; } +#line 3894 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 114: -/* Line 1792 of yacc.c */ -#line 1094 "dtool/src/cppparser/cppBison.yxx" + case 106: +#line 1042 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "^="; } +#line 3902 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 115: -/* Line 1792 of yacc.c */ -#line 1098 "dtool/src/cppparser/cppBison.yxx" + case 107: +#line 1046 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "<<="; } +#line 3910 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 116: -/* Line 1792 of yacc.c */ -#line 1102 "dtool/src/cppparser/cppBison.yxx" + case 108: +#line 1050 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = ">>="; } +#line 3918 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 117: -/* Line 1792 of yacc.c */ -#line 1106 "dtool/src/cppparser/cppBison.yxx" + case 109: +#line 1054 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "->"; } +#line 3926 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 118: -/* Line 1792 of yacc.c */ -#line 1110 "dtool/src/cppparser/cppBison.yxx" + case 110: +#line 1058 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "[]"; } +#line 3934 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 119: -/* Line 1792 of yacc.c */ -#line 1114 "dtool/src/cppparser/cppBison.yxx" + case 111: +#line 1062 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "()"; } +#line 3942 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 120: -/* Line 1792 of yacc.c */ -#line 1118 "dtool/src/cppparser/cppBison.yxx" + case 112: +#line 1066 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "new"; } +#line 3950 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 121: -/* Line 1792 of yacc.c */ -#line 1122 "dtool/src/cppparser/cppBison.yxx" + case 113: +#line 1070 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.str) = "delete"; } +#line 3958 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 124: -/* Line 1792 of yacc.c */ -#line 1134 "dtool/src/cppparser/cppBison.yxx" + case 116: +#line 1082 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { push_scope(new CPPTemplateScope(current_scope)); } +#line 3966 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 125: -/* Line 1792 of yacc.c */ -#line 1138 "dtool/src/cppparser/cppBison.yxx" + case 117: +#line 1086 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { pop_scope(); } +#line 3974 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 120: +#line 1098 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + CPPTemplateScope *ts = current_scope->as_template_scope(); + assert(ts != NULL); + ts->add_template_parameter((yyvsp[0].u.decl)); +} +#line 3984 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 121: +#line 1104 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + CPPTemplateScope *ts = current_scope->as_template_scope(); + assert(ts != NULL); + ts->add_template_parameter((yyvsp[0].u.decl)); +} +#line 3994 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 122: +#line 1113 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.decl) = CPPType::new_type(new CPPClassTemplateParameter((yyvsp[0].u.identifier))); +} +#line 4002 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 123: +#line 1117 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.decl) = CPPType::new_type(new CPPClassTemplateParameter((yyvsp[-2].u.identifier), (yyvsp[0].u.type))); +} +#line 4010 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 124: +#line 1121 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.decl) = CPPType::new_type(new CPPClassTemplateParameter((yyvsp[0].u.identifier))); +} +#line 4018 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 125: +#line 1125 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.decl) = CPPType::new_type(new CPPClassTemplateParameter((yyvsp[-2].u.identifier), (yyvsp[0].u.type))); +} +#line 4026 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 126: +#line 1129 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + CPPInstance *inst = new CPPInstance((yyvsp[-2].u.type), (yyvsp[-1].u.inst_ident), 0, (yylsp[-1]).file); + inst->set_initializer((yyvsp[0].u.expr)); + (yyval.u.decl) = inst; +} +#line 4036 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 127: +#line 1135 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyvsp[-1].u.inst_ident)->add_modifier(IIT_const); + CPPInstance *inst = new CPPInstance((yyvsp[-2].u.type), (yyvsp[-1].u.inst_ident), 0, (yylsp[-1]).file); + inst->set_initializer((yyvsp[0].u.expr)); + (yyval.u.decl) = inst; +} +#line 4047 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 128: -/* Line 1792 of yacc.c */ -#line 1150 "dtool/src/cppparser/cppBison.yxx" +#line 1145 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - CPPTemplateScope *ts = current_scope->as_template_scope(); - assert(ts != NULL); - ts->add_template_parameter((yyvsp[(1) - (1)].u.decl)); + (yyval.u.type) = CPPType::new_type((yyvsp[0].u.simple_type)); } +#line 4055 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 129: -/* Line 1792 of yacc.c */ -#line 1156 "dtool/src/cppparser/cppBison.yxx" +#line 1149 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - CPPTemplateScope *ts = current_scope->as_template_scope(); - assert(ts != NULL); - ts->add_template_parameter((yyvsp[(3) - (3)].u.decl)); + yywarning("Not a type: " + (yyvsp[0].u.identifier)->get_fully_scoped_name(), (yylsp[0])); + (yyval.u.type) = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_unknown)); } +#line 4064 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 130: -/* Line 1792 of yacc.c */ -#line 1165 "dtool/src/cppparser/cppBison.yxx" +#line 1154 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.decl) = CPPType::new_type(new CPPClassTemplateParameter((yyvsp[(2) - (2)].u.identifier))); + (yyval.u.type) = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); + assert((yyval.u.type) != NULL); } +#line 4073 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 131: -/* Line 1792 of yacc.c */ -#line 1169 "dtool/src/cppparser/cppBison.yxx" +#line 1163 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.decl) = CPPType::new_type(new CPPClassTemplateParameter((yyvsp[(2) - (4)].u.identifier), (yyvsp[(4) - (4)].u.type))); + (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[0].u.identifier)); } +#line 4081 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 132: -/* Line 1792 of yacc.c */ -#line 1173 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.decl) = CPPType::new_type(new CPPClassTemplateParameter((yyvsp[(2) - (2)].u.identifier))); -} - break; - - case 133: -/* Line 1792 of yacc.c */ -#line 1177 "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 134: -/* Line 1792 of yacc.c */ -#line 1181 "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)); - (yyval.u.decl) = inst; -} - break; - - case 135: -/* Line 1792 of yacc.c */ -#line 1187 "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); - inst->set_initializer((yyvsp[(4) - (4)].u.expr)); - (yyval.u.decl) = inst; -} - break; - - case 136: -/* Line 1792 of yacc.c */ -#line 1197 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.type) = CPPType::new_type((yyvsp[(1) - (1)].u.simple_type)); -} - break; - - case 137: -/* Line 1792 of yacc.c */ -#line 1201 "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 138: -/* Line 1792 of yacc.c */ -#line 1206 "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 139: -/* Line 1792 of yacc.c */ -#line 1215 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[(1) - (1)].u.identifier)); -} - break; - - case 140: -/* Line 1792 of yacc.c */ -#line 1219 "dtool/src/cppparser/cppBison.yxx" +#line 1167 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // For an operator function. We implement this simply by building a // ficticious name for the function; in other respects it's just // like a regular function. - CPPIdentifier *ident = (yyvsp[(1) - (2)].u.identifier); + CPPIdentifier *ident = (yyvsp[-1].u.identifier); if (ident == NULL) { - ident = new CPPIdentifier("operator "+(yyvsp[(2) - (2)].str), (yylsp[(2) - (2)]).file); + ident = new CPPIdentifier("operator "+(yyvsp[0].str), (yylsp[0]).file); } else { - ident->_names.push_back("operator "+(yyvsp[(2) - (2)].str)); + ident->_names.push_back("operator "+(yyvsp[0].str)); } (yyval.u.inst_ident) = new CPPInstanceIdentifier(ident); } +#line 4099 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 133: +#line 1181 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_const); +} +#line 4108 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 134: +#line 1186 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_pointer); +} +#line 4117 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 135: +#line 1191 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_reference); +} +#line 4126 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 136: +#line 1196 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); +} +#line 4135 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 137: +#line 1201 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[-2].u.identifier)); +} +#line 4144 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 138: +#line 1206 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[-3].u.inst_ident); + (yyval.u.inst_ident)->add_array_modifier((yyvsp[-1].u.expr)); +} +#line 4153 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 139: +#line 1211 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + // bitfield definition. We ignore the bitfield for now. + (yyval.u.inst_ident) = (yyvsp[-2].u.inst_ident); +} +#line 4162 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 140: +#line 1216 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[-1].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_paren); +} +#line 4171 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 141: -/* Line 1792 of yacc.c */ -#line 1233 "dtool/src/cppparser/cppBison.yxx" +#line 1221 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_const); + push_scope((yyvsp[-1].u.inst_ident)->get_scope(current_scope, global_scope)); } +#line 4179 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 142: -/* Line 1792 of yacc.c */ -#line 1238 "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 143: -/* Line 1792 of yacc.c */ -#line 1243 "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 144: -/* Line 1792 of yacc.c */ -#line 1248 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); -} - break; - - case 145: -/* Line 1792 of yacc.c */ -#line 1253 "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 146: -/* Line 1792 of yacc.c */ -#line 1258 "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 147: -/* Line 1792 of yacc.c */ -#line 1263 "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 148: -/* Line 1792 of yacc.c */ -#line 1268 "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 149: -/* Line 1792 of yacc.c */ -#line 1273 "dtool/src/cppparser/cppBison.yxx" - { - push_scope((yyvsp[(1) - (2)].u.inst_ident)->get_scope(current_scope, global_scope)); -} - break; - - case 150: -/* Line 1792 of yacc.c */ -#line 1277 "dtool/src/cppparser/cppBison.yxx" +#line 1225 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { pop_scope(); - (yyval.u.inst_ident) = (yyvsp[(1) - (6)].u.inst_ident); - if ((yyvsp[(4) - (6)].u.param_list)->is_parameter_expr() && (yyvsp[(6) - (6)].u.integer) == 0) { + (yyval.u.inst_ident) = (yyvsp[-5].u.inst_ident); + if ((yyvsp[-2].u.param_list)->is_parameter_expr() && (yyvsp[0].u.integer) == 0) { // Oops, this must have been an instance declaration with a // parameter list, not a function prototype. - (yyval.u.inst_ident)->add_initializer_modifier((yyvsp[(4) - (6)].u.param_list)); + (yyval.u.inst_ident)->add_initializer_modifier((yyvsp[-2].u.param_list)); } else { // This was (probably) a function prototype. - (yyval.u.inst_ident)->add_func_modifier((yyvsp[(4) - (6)].u.param_list), (yyvsp[(6) - (6)].u.integer)); + (yyval.u.inst_ident)->add_func_modifier((yyvsp[-2].u.param_list), (yyvsp[0].u.integer)); } } +#line 4197 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 143: +#line 1243 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.param_list) = new CPPParameterList; +} +#line 4205 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 144: +#line 1247 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.param_list) = new CPPParameterList; + (yyval.u.param_list)->_includes_ellipsis = true; +} +#line 4214 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 145: +#line 1252 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.param_list) = (yyvsp[0].u.param_list); +} +#line 4222 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 146: +#line 1256 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.param_list) = (yyvsp[-2].u.param_list); + (yyval.u.param_list)->_includes_ellipsis = true; +} +#line 4231 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 147: +#line 1261 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.param_list) = (yyvsp[-1].u.param_list); + (yyval.u.param_list)->_includes_ellipsis = true; +} +#line 4240 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 148: +#line 1269 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.param_list) = new CPPParameterList; + (yyval.u.param_list)->_parameters.push_back((yyvsp[0].u.instance)); +} +#line 4249 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 149: +#line 1274 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.param_list) = (yyvsp[-2].u.param_list); + (yyval.u.param_list)->_parameters.push_back((yyvsp[0].u.instance)); +} +#line 4258 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 150: +#line 1282 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (CPPExpression *)NULL; +} +#line 4266 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 151: -/* Line 1792 of yacc.c */ -#line 1295 "dtool/src/cppparser/cppBison.yxx" +#line 1286 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.param_list) = new CPPParameterList; + (yyval.u.expr) = (yyvsp[0].u.expr); } +#line 4274 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 152: -/* Line 1792 of yacc.c */ -#line 1299 "dtool/src/cppparser/cppBison.yxx" +#line 1293 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.param_list) = new CPPParameterList; - (yyval.u.param_list)->_includes_ellipsis = true; + (yyval.u.expr) = (CPPExpression *)NULL; } +#line 4282 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 153: -/* Line 1792 of yacc.c */ -#line 1304 "dtool/src/cppparser/cppBison.yxx" +#line 1297 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.param_list) = (yyvsp[(1) - (1)].u.param_list); + (yyval.u.expr) = (yyvsp[0].u.expr); } +#line 4290 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 154: -/* Line 1792 of yacc.c */ -#line 1308 "dtool/src/cppparser/cppBison.yxx" +#line 1304 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.param_list) = (yyvsp[(1) - (3)].u.param_list); - (yyval.u.param_list)->_includes_ellipsis = true; + (yyval.u.expr) = (CPPExpression *)NULL; } +#line 4298 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 155: -/* Line 1792 of yacc.c */ -#line 1313 "dtool/src/cppparser/cppBison.yxx" +#line 1308 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.param_list) = (yyvsp[(1) - (2)].u.param_list); - (yyval.u.param_list)->_includes_ellipsis = true; + (yyval.u.expr) = (CPPExpression *)NULL; } +#line 4306 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 156: -/* Line 1792 of yacc.c */ -#line 1321 "dtool/src/cppparser/cppBison.yxx" +#line 1312 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.param_list) = new CPPParameterList; - (yyval.u.param_list)->_parameters.push_back((yyvsp[(1) - (1)].u.instance)); + (yyval.u.expr) = (CPPExpression *)NULL; } +#line 4314 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 157: -/* Line 1792 of yacc.c */ -#line 1326 "dtool/src/cppparser/cppBison.yxx" +#line 1316 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.param_list) = (yyvsp[(1) - (3)].u.param_list); - (yyval.u.param_list)->_parameters.push_back((yyvsp[(3) - (3)].u.instance)); + (yyval.u.expr) = (yyvsp[-1].u.expr); } +#line 4322 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 158: -/* Line 1792 of yacc.c */ -#line 1334 "dtool/src/cppparser/cppBison.yxx" +#line 1320 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = (CPPExpression *)NULL; } - break; - - case 159: -/* Line 1792 of yacc.c */ -#line 1338 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.expr) = (yyvsp[(2) - (2)].u.expr); -} - break; - - case 160: -/* Line 1792 of yacc.c */ -#line 1345 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.expr) = (CPPExpression *)NULL; -} - break; - - case 161: -/* Line 1792 of yacc.c */ -#line 1349 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.expr) = (yyvsp[(2) - (2)].u.expr); -} +#line 4330 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 162: -/* Line 1792 of yacc.c */ -#line 1356 "dtool/src/cppparser/cppBison.yxx" +#line 1333 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = (CPPExpression *)NULL; -} - break; - - case 163: -/* Line 1792 of yacc.c */ -#line 1360 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.expr) = (CPPExpression *)NULL; -} - break; - - case 164: -/* Line 1792 of yacc.c */ -#line 1364 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.expr) = (CPPExpression *)NULL; -} - break; - - case 165: -/* Line 1792 of yacc.c */ -#line 1368 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.expr) = (yyvsp[(2) - (3)].u.expr); } +#line 4337 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 166: -/* Line 1792 of yacc.c */ -#line 1372 "dtool/src/cppparser/cppBison.yxx" +#line 1342 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = (CPPExpression *)NULL; + (yyval.u.instance) = new CPPInstance((yyvsp[-2].u.type), (yyvsp[-1].u.inst_ident), 0, (yylsp[-1]).file); + (yyval.u.instance)->set_initializer((yyvsp[0].u.expr)); } +#line 4346 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 170: -/* Line 1792 of yacc.c */ -#line 1385 "dtool/src/cppparser/cppBison.yxx" + case 167: +#line 1347 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { -} - break; - - case 174: -/* Line 1792 of yacc.c */ -#line 1394 "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 175: -/* Line 1792 of yacc.c */ -#line 1399 "dtool/src/cppparser/cppBison.yxx" - { - yywarning("Not a type: " + (yyvsp[(1) - (3)].u.identifier)->get_fully_scoped_name(), (yylsp[(1) - (3)])); + yywarning("Not a type: " + (yyvsp[-2].u.identifier)->get_fully_scoped_name(), (yylsp[-2])); CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_unknown)); - (yyval.u.instance) = new CPPInstance(type, (yyvsp[(2) - (3)].u.inst_ident), 0, (yylsp[(2) - (3)]).file); - (yyval.u.instance)->set_initializer((yyvsp[(3) - (3)].u.expr)); + (yyval.u.instance) = new CPPInstance(type, (yyvsp[-1].u.inst_ident), 0, (yylsp[-1]).file); + (yyval.u.instance)->set_initializer((yyvsp[0].u.expr)); } +#line 4358 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 176: -/* Line 1792 of yacc.c */ -#line 1407 "dtool/src/cppparser/cppBison.yxx" + case 168: +#line 1355 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (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); - (yyval.u.instance)->set_initializer((yyvsp[(4) - (4)].u.expr)); + (yyvsp[-1].u.inst_ident)->add_modifier(IIT_const); + (yyval.u.instance) = new CPPInstance((yyvsp[-2].u.type), (yyvsp[-1].u.inst_ident), 0, (yylsp[-1]).file); + (yyval.u.instance)->set_initializer((yyvsp[0].u.expr)); } +#line 4368 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 177: -/* Line 1792 of yacc.c */ -#line 1413 "dtool/src/cppparser/cppBison.yxx" + case 169: +#line 1361 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_parameter)); (yyval.u.instance) = new CPPInstance(type, "expr"); - (yyval.u.instance)->set_initializer((yyvsp[(1) - (1)].u.expr)); + (yyval.u.instance)->set_initializer((yyvsp[0].u.expr)); } +#line 4379 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 170: +#line 1371 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); +} +#line 4387 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 171: +#line 1375 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[0].u.identifier)); +} +#line 4395 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 172: +#line 1379 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[0].u.identifier)); +} +#line 4403 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 173: +#line 1383 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_const); +} +#line 4412 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 174: +#line 1388 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_pointer); +} +#line 4421 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 175: +#line 1393 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_reference); +} +#line 4430 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 176: +#line 1398 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); +} +#line 4439 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 177: +#line 1403 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[-2].u.identifier)); +} +#line 4448 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 178: -/* Line 1792 of yacc.c */ -#line 1423 "dtool/src/cppparser/cppBison.yxx" +#line 1408 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); + (yyval.u.inst_ident) = (yyvsp[-3].u.inst_ident); + (yyval.u.inst_ident)->add_array_modifier((yyvsp[-1].u.expr)); } +#line 4457 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 179: -/* Line 1792 of yacc.c */ -#line 1427 "dtool/src/cppparser/cppBison.yxx" +#line 1416 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[(1) - (1)].u.identifier)); + (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); } +#line 4465 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 180: -/* Line 1792 of yacc.c */ -#line 1431 "dtool/src/cppparser/cppBison.yxx" +#line 1420 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[(1) - (1)].u.identifier)); + (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[0].u.identifier)); } +#line 4473 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 181: -/* Line 1792 of yacc.c */ -#line 1435 "dtool/src/cppparser/cppBison.yxx" +#line 1424 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_const); + (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[0].u.identifier)); } +#line 4481 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 182: -/* Line 1792 of yacc.c */ -#line 1440 "dtool/src/cppparser/cppBison.yxx" +#line 1428 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_pointer); + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_const); } +#line 4490 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 183: -/* Line 1792 of yacc.c */ -#line 1445 "dtool/src/cppparser/cppBison.yxx" +#line 1433 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_reference); + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_pointer); } +#line 4499 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 184: -/* Line 1792 of yacc.c */ -#line 1450 "dtool/src/cppparser/cppBison.yxx" +#line 1438 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_reference); } +#line 4508 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 185: -/* Line 1792 of yacc.c */ -#line 1455 "dtool/src/cppparser/cppBison.yxx" +#line 1443 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.inst_ident) = (yyvsp[(3) - (3)].u.inst_ident); - (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[(1) - (3)].u.identifier)); + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); } +#line 4517 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 186: -/* Line 1792 of yacc.c */ -#line 1460 "dtool/src/cppparser/cppBison.yxx" +#line 1448 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.inst_ident) = (yyvsp[(1) - (4)].u.inst_ident); - (yyval.u.inst_ident)->add_array_modifier((yyvsp[(3) - (4)].u.expr)); + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[-2].u.identifier)); } +#line 4526 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 187: -/* Line 1792 of yacc.c */ -#line 1468 "dtool/src/cppparser/cppBison.yxx" +#line 1453 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); + (yyval.u.inst_ident) = (yyvsp[-3].u.inst_ident); + (yyval.u.inst_ident)->add_array_modifier((yyvsp[-1].u.expr)); } +#line 4535 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 188: -/* Line 1792 of yacc.c */ -#line 1472 "dtool/src/cppparser/cppBison.yxx" +#line 1458 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[(1) - (1)].u.identifier)); + (yyval.u.inst_ident) = (yyvsp[-5].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_paren); + (yyval.u.inst_ident)->add_func_modifier((yyvsp[-2].u.param_list), (yyvsp[0].u.integer)); } +#line 4545 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 189: -/* Line 1792 of yacc.c */ -#line 1476 "dtool/src/cppparser/cppBison.yxx" +#line 1464 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[(1) - (1)].u.identifier)); + (yyval.u.inst_ident) = (yyvsp[-1].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_paren); } +#line 4554 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 190: -/* Line 1792 of yacc.c */ -#line 1480 "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 191: -/* Line 1792 of yacc.c */ -#line 1485 "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 192: -/* Line 1792 of yacc.c */ -#line 1490 "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 193: -/* Line 1792 of yacc.c */ -#line 1495 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); -} - break; - - case 194: -/* Line 1792 of yacc.c */ -#line 1500 "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 195: -/* Line 1792 of yacc.c */ -#line 1505 "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 196: -/* Line 1792 of yacc.c */ -#line 1510 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[(2) - (7)].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_paren); - (yyval.u.inst_ident)->add_func_modifier((yyvsp[(5) - (7)].u.param_list), (yyvsp[(7) - (7)].u.integer)); -} - break; - - case 197: -/* Line 1792 of yacc.c */ -#line 1516 "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 198: -/* Line 1792 of yacc.c */ -#line 1524 "dtool/src/cppparser/cppBison.yxx" +#line 1472 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); } +#line 4562 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 191: +#line 1476 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_const); +} +#line 4571 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 192: +#line 1481 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_pointer); +} +#line 4580 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 193: +#line 1486 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_reference); +} +#line 4589 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 194: +#line 1491 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); +} +#line 4598 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 195: +#line 1496 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[-2].u.identifier)); +} +#line 4607 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 196: +#line 1501 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[-3].u.inst_ident); + (yyval.u.inst_ident)->add_array_modifier((yyvsp[-1].u.expr)); +} +#line 4616 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 197: +#line 1506 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[-5].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_paren); + (yyval.u.inst_ident)->add_func_modifier((yyvsp[-2].u.param_list), (yyvsp[0].u.integer)); +} +#line 4626 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 198: +#line 1515 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.type) = CPPType::new_type((yyvsp[0].u.simple_type)); +} +#line 4634 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 199: -/* Line 1792 of yacc.c */ -#line 1528 "dtool/src/cppparser/cppBison.yxx" +#line 1519 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_const); + (yyval.u.type) = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); + assert((yyval.u.type) != NULL); } +#line 4643 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 200: -/* Line 1792 of yacc.c */ -#line 1533 "dtool/src/cppparser/cppBison.yxx" +#line 1524 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_pointer); + (yyval.u.type) = CPPType::new_type(new CPPTBDType((yyvsp[0].u.identifier))); } +#line 4651 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 201: -/* Line 1792 of yacc.c */ -#line 1538 "dtool/src/cppparser/cppBison.yxx" +#line 1528 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_reference); + (yyval.u.type) = CPPType::new_type((yyvsp[0].u.struct_type)); } +#line 4659 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 202: -/* Line 1792 of yacc.c */ -#line 1543 "dtool/src/cppparser/cppBison.yxx" +#line 1532 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); + (yyval.u.type) = CPPType::new_type((yyvsp[0].u.struct_type)); } +#line 4667 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 203: -/* Line 1792 of yacc.c */ -#line 1548 "dtool/src/cppparser/cppBison.yxx" +#line 1536 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.inst_ident) = (yyvsp[(3) - (3)].u.inst_ident); - (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[(1) - (3)].u.identifier)); + (yyval.u.type) = CPPType::new_type((yyvsp[0].u.enum_type)); } +#line 4675 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 204: -/* Line 1792 of yacc.c */ -#line 1553 "dtool/src/cppparser/cppBison.yxx" +#line 1540 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.inst_ident) = (yyvsp[(1) - (4)].u.inst_ident); - (yyval.u.inst_ident)->add_array_modifier((yyvsp[(3) - (4)].u.expr)); + CPPType *type = (yyvsp[0].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].u.extension_enum), (yyvsp[0].u.identifier), current_scope, (yylsp[-1]).file)) + ->as_extension_type(); + CPPScope *scope = (yyvsp[0].u.identifier)->get_scope(current_scope, global_scope); + if (scope != NULL) { + scope->define_extension_type(et); + } + (yyval.u.type) = et; + } } +#line 4695 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 205: -/* Line 1792 of yacc.c */ -#line 1558 "dtool/src/cppparser/cppBison.yxx" +#line 1556 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.inst_ident) = (yyvsp[(2) - (7)].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_paren); - (yyval.u.inst_ident)->add_func_modifier((yyvsp[(5) - (7)].u.param_list), (yyvsp[(7) - (7)].u.integer)); + CPPType *type = (yyvsp[-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[-3].u.extension_enum), (yyvsp[-2].u.identifier), current_scope, (yylsp[-3]).file)) + ->as_extension_type(); + CPPScope *scope = (yyvsp[-2].u.identifier)->get_scope(current_scope, global_scope); + if (scope != NULL) { + scope->define_extension_type(et); + } + (yyval.u.type) = et; + } } +#line 4715 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 206: -/* Line 1792 of yacc.c */ -#line 1567 "dtool/src/cppparser/cppBison.yxx" +#line 1575 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.type) = CPPType::new_type((yyvsp[(1) - (1)].u.simple_type)); + (yyval.u.decl) = CPPType::new_type((yyvsp[0].u.simple_type)); } +#line 4723 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 207: -/* Line 1792 of yacc.c */ -#line 1571 "dtool/src/cppparser/cppBison.yxx" +#line 1579 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.type) = (yyvsp[(1) - (1)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); - assert((yyval.u.type) != NULL); + (yyval.u.decl) = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); + assert((yyval.u.decl) != NULL); } +#line 4732 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 208: -/* Line 1792 of yacc.c */ -#line 1576 "dtool/src/cppparser/cppBison.yxx" +#line 1584 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.type) = CPPType::new_type(new CPPTBDType((yyvsp[(2) - (2)].u.identifier))); + (yyval.u.decl) = CPPType::new_type(new CPPTBDType((yyvsp[0].u.identifier))); } +#line 4740 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 209: -/* Line 1792 of yacc.c */ -#line 1580 "dtool/src/cppparser/cppBison.yxx" +#line 1588 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.type) = CPPType::new_type((yyvsp[(1) - (1)].u.struct_type)); + (yyval.u.decl) = CPPType::new_type((yyvsp[0].u.struct_type)); } +#line 4748 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 210: -/* Line 1792 of yacc.c */ -#line 1584 "dtool/src/cppparser/cppBison.yxx" +#line 1592 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.type) = CPPType::new_type((yyvsp[(1) - (1)].u.struct_type)); + (yyval.u.decl) = new CPPTypeDeclaration(CPPType::new_type((yyvsp[0].u.struct_type))); } +#line 4756 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 211: -/* Line 1792 of yacc.c */ -#line 1588 "dtool/src/cppparser/cppBison.yxx" +#line 1596 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.type) = CPPType::new_type((yyvsp[(1) - (1)].u.enum_type)); + (yyval.u.decl) = new CPPTypeDeclaration(CPPType::new_type((yyvsp[0].u.enum_type))); } +#line 4764 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 212: -/* Line 1792 of yacc.c */ -#line 1592 "dtool/src/cppparser/cppBison.yxx" +#line 1600 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - CPPType *type = (yyvsp[(2) - (2)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); + CPPType *type = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if (type != NULL) { - (yyval.u.type) = type; + (yyval.u.decl) = 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)) + CPPType::new_type(new CPPExtensionType((yyvsp[-1].u.extension_enum), (yyvsp[0].u.identifier), current_scope, (yylsp[-1]).file)) ->as_extension_type(); - CPPScope *scope = (yyvsp[(2) - (2)].u.identifier)->get_scope(current_scope, global_scope); + CPPScope *scope = (yyvsp[0].u.identifier)->get_scope(current_scope, global_scope); if (scope != NULL) { scope->define_extension_type(et); } - (yyval.u.type) = et; + (yyval.u.decl) = et; } } +#line 4784 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 213: -/* Line 1792 of yacc.c */ -#line 1608 "dtool/src/cppparser/cppBison.yxx" +#line 1616 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - CPPType *type = (yyvsp[(2) - (4)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); + CPPType *type = (yyvsp[-2].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if (type != NULL) { - (yyval.u.type) = type; + (yyval.u.decl) = type; } else { CPPExtensionType *et = - CPPType::new_type(new CPPExtensionType((yyvsp[(1) - (4)].u.extension_enum), (yyvsp[(2) - (4)].u.identifier), current_scope, (yylsp[(1) - (4)]).file)) + CPPType::new_type(new CPPExtensionType((yyvsp[-3].u.extension_enum), (yyvsp[-2].u.identifier), current_scope, (yylsp[-3]).file)) ->as_extension_type(); - CPPScope *scope = (yyvsp[(2) - (4)].u.identifier)->get_scope(current_scope, global_scope); + CPPScope *scope = (yyvsp[-2].u.identifier)->get_scope(current_scope, global_scope); if (scope != NULL) { scope->define_extension_type(et); } - (yyval.u.type) = et; + (yyval.u.decl) = et; } } +#line 4804 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 214: -/* Line 1792 of yacc.c */ -#line 1627 "dtool/src/cppparser/cppBison.yxx" +#line 1632 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.decl) = CPPType::new_type((yyvsp[(1) - (1)].u.simple_type)); + yywarning(string("C++ does not permit forward declaration of untyped enum ") + (yyvsp[0].u.identifier)->get_fully_scoped_name(), (yylsp[-1])); + + CPPType *type = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); + if (type != NULL) { + (yyval.u.decl) = type; + } else { + CPPExtensionType *et = + CPPType::new_type(new CPPExtensionType((yyvsp[-1].u.extension_enum), (yyvsp[0].u.identifier), current_scope, (yylsp[-1]).file)) + ->as_extension_type(); + CPPScope *scope = (yyvsp[0].u.identifier)->get_scope(current_scope, global_scope); + if (scope != NULL) { + scope->define_extension_type(et); + } + (yyval.u.decl) = et; + } } +#line 4826 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 215: -/* Line 1792 of yacc.c */ -#line 1631 "dtool/src/cppparser/cppBison.yxx" +#line 1653 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.decl) = (yyvsp[(1) - (1)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); - assert((yyval.u.decl) != NULL); + (yyval.u.type) = CPPType::new_type((yyvsp[0].u.simple_type)); } +#line 4834 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 216: -/* Line 1792 of yacc.c */ -#line 1636 "dtool/src/cppparser/cppBison.yxx" +#line 1657 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.decl) = CPPType::new_type(new CPPTBDType((yyvsp[(2) - (2)].u.identifier))); + (yyval.u.type) = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); + assert((yyval.u.type) != NULL); } +#line 4843 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 217: -/* Line 1792 of yacc.c */ -#line 1640 "dtool/src/cppparser/cppBison.yxx" +#line 1662 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.decl) = CPPType::new_type((yyvsp[(1) - (1)].u.struct_type)); + (yyval.u.type) = CPPType::new_type(new CPPTBDType((yyvsp[0].u.identifier))); } +#line 4851 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 218: -/* Line 1792 of yacc.c */ -#line 1644 "dtool/src/cppparser/cppBison.yxx" +#line 1666 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.decl) = new CPPTypeDeclaration(CPPType::new_type((yyvsp[(1) - (1)].u.struct_type))); + CPPType *type = (yyvsp[0].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].u.extension_enum), (yyvsp[0].u.identifier), current_scope, (yylsp[-1]).file)) + ->as_extension_type(); + CPPScope *scope = (yyvsp[0].u.identifier)->get_scope(current_scope, global_scope); + if (scope != NULL) { + scope->define_extension_type(et); + } + (yyval.u.type) = et; + } } +#line 4871 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 219: -/* Line 1792 of yacc.c */ -#line 1648 "dtool/src/cppparser/cppBison.yxx" +#line 1682 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.decl) = new CPPTypeDeclaration(CPPType::new_type((yyvsp[(1) - (1)].u.enum_type))); + CPPType *type = (yyvsp[0].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].u.extension_enum), (yyvsp[0].u.identifier), current_scope, (yylsp[-1]).file)) + ->as_extension_type(); + CPPScope *scope = (yyvsp[0].u.identifier)->get_scope(current_scope, global_scope); + if (scope != NULL) { + scope->define_extension_type(et); + } + (yyval.u.type) = et; + } } +#line 4891 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 220: -/* Line 1792 of yacc.c */ -#line 1652 "dtool/src/cppparser/cppBison.yxx" +#line 1701 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - CPPType *type = (yyvsp[(2) - (2)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); - if (type != NULL) { - (yyval.u.decl) = 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.decl) = et; - } + CPPInstance *inst = new CPPInstance((yyvsp[-1].u.type), (yyvsp[0].u.inst_ident), 0, (yylsp[-1]).file); + (yyval.u.type) = inst->_type; + delete inst; } +#line 4901 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 221: -/* Line 1792 of yacc.c */ -#line 1668 "dtool/src/cppparser/cppBison.yxx" +#line 1707 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - CPPType *type = (yyvsp[(2) - (4)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); - if (type != NULL) { - (yyval.u.decl) = type; - } else { - CPPExtensionType *et = - CPPType::new_type(new CPPExtensionType((yyvsp[(1) - (4)].u.extension_enum), (yyvsp[(2) - (4)].u.identifier), current_scope, (yylsp[(1) - (4)]).file)) - ->as_extension_type(); - CPPScope *scope = (yyvsp[(2) - (4)].u.identifier)->get_scope(current_scope, global_scope); - if (scope != NULL) { - scope->define_extension_type(et); - } - (yyval.u.decl) = et; - } + (yyvsp[0].u.inst_ident)->add_modifier(IIT_const); + CPPInstance *inst = new CPPInstance((yyvsp[-1].u.type), (yyvsp[0].u.inst_ident), 0, (yylsp[-2]).file); + (yyval.u.type) = inst->_type; + delete inst; } +#line 4912 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 222: -/* Line 1792 of yacc.c */ -#line 1684 "dtool/src/cppparser/cppBison.yxx" - { - yywarning(string("C++ does not permit forward declaration of untyped enum ") + (yyvsp[(2) - (2)].u.identifier)->get_fully_scoped_name(), (yylsp[(1) - (2)])); - - CPPType *type = (yyvsp[(2) - (2)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); - if (type != NULL) { - (yyval.u.decl) = 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.decl) = et; - } -} - break; - - case 223: -/* Line 1792 of yacc.c */ -#line 1705 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.type) = CPPType::new_type((yyvsp[(1) - (1)].u.simple_type)); -} - break; - - case 224: -/* Line 1792 of yacc.c */ -#line 1709 "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 225: -/* Line 1792 of yacc.c */ -#line 1714 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.type) = CPPType::new_type(new CPPTBDType((yyvsp[(2) - (2)].u.identifier))); -} - break; - - case 226: -/* Line 1792 of yacc.c */ -#line 1718 "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; - - case 227: -/* Line 1792 of yacc.c */ -#line 1734 "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; - - case 228: -/* Line 1792 of yacc.c */ -#line 1753 "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; - delete inst; -} - break; - - case 229: -/* Line 1792 of yacc.c */ -#line 1759 "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); - (yyval.u.type) = inst->_type; - delete inst; -} - break; - - case 230: -/* Line 1792 of yacc.c */ -#line 1769 "dtool/src/cppparser/cppBison.yxx" +#line 1717 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPVisibility starting_vis = - ((yyvsp[(1) - (2)].u.extension_enum) == CPPExtensionType::T_class) ? V_private : V_public; + ((yyvsp[-1].u.extension_enum) == CPPExtensionType::T_class) ? V_private : V_public; CPPScope *new_scope = new CPPScope(current_scope, CPPNameComponent("anon"), starting_vis); - CPPStructType *st = new CPPStructType((yyvsp[(1) - (2)].u.extension_enum), NULL, current_scope, - new_scope, (yylsp[(1) - (2)]).file); + CPPStructType *st = new CPPStructType((yyvsp[-1].u.extension_enum), NULL, current_scope, + new_scope, (yylsp[-1]).file); new_scope->set_struct_type(st); push_scope(new_scope); push_struct(st); } +#line 4930 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 231: -/* Line 1792 of yacc.c */ -#line 1783 "dtool/src/cppparser/cppBison.yxx" + case 223: +#line 1731 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.struct_type) = current_struct; current_struct->_incomplete = false; pop_struct(); pop_scope(); } +#line 4941 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 232: -/* Line 1792 of yacc.c */ -#line 1793 "dtool/src/cppparser/cppBison.yxx" + case 224: +#line 1741 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPVisibility starting_vis = - ((yyvsp[(1) - (2)].u.extension_enum) == CPPExtensionType::T_class) ? V_private : V_public; + ((yyvsp[-1].u.extension_enum) == CPPExtensionType::T_class) ? V_private : V_public; - CPPScope *scope = (yyvsp[(2) - (2)].u.identifier)->get_scope(current_scope, global_scope, current_lexer); + CPPScope *scope = (yyvsp[0].u.identifier)->get_scope(current_scope, global_scope, current_lexer); if (scope == NULL) { scope = current_scope; } - CPPScope *new_scope = new CPPScope(scope, (yyvsp[(2) - (2)].u.identifier)->_names.back(), + CPPScope *new_scope = new CPPScope(scope, (yyvsp[0].u.identifier)->_names.back(), starting_vis); - CPPStructType *st = new CPPStructType((yyvsp[(1) - (2)].u.extension_enum), (yyvsp[(2) - (2)].u.identifier), current_scope, - new_scope, (yylsp[(1) - (2)]).file); + CPPStructType *st = new CPPStructType((yyvsp[-1].u.extension_enum), (yyvsp[0].u.identifier), current_scope, + new_scope, (yylsp[-1]).file); new_scope->set_struct_type(st); current_scope->define_extension_type(st); push_scope(new_scope); push_struct(st); } +#line 4965 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 233: -/* Line 1792 of yacc.c */ -#line 1813 "dtool/src/cppparser/cppBison.yxx" + case 225: +#line 1761 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.struct_type) = current_struct; current_struct->_incomplete = false; pop_struct(); pop_scope(); } +#line 4976 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 230: +#line 1781 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + current_struct->append_derivation((yyvsp[0].u.type), V_public, false); +} +#line 4984 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 231: +#line 1785 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + current_struct->append_derivation((yyvsp[0].u.type), V_protected, false); +} +#line 4992 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 232: +#line 1789 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + current_struct->append_derivation((yyvsp[0].u.type), V_private, false); +} +#line 5000 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 233: +#line 1793 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + current_struct->append_derivation((yyvsp[0].u.type), V_public, true); +} +#line 5008 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 234: +#line 1797 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + current_struct->append_derivation((yyvsp[0].u.type), V_protected, true); +} +#line 5016 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 235: +#line 1801 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + current_struct->append_derivation((yyvsp[0].u.type), V_private, true); +} +#line 5024 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 236: +#line 1805 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + current_struct->append_derivation((yyvsp[0].u.type), V_public, true); +} +#line 5032 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 237: +#line 1809 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + current_struct->append_derivation((yyvsp[0].u.type), V_protected, true); +} +#line 5040 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 238: -/* Line 1792 of yacc.c */ -#line 1833 "dtool/src/cppparser/cppBison.yxx" +#line 1813 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - current_struct->append_derivation((yyvsp[(2) - (2)].u.type), V_public, false); + current_struct->append_derivation((yyvsp[0].u.type), V_private, true); } +#line 5048 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 239: -/* Line 1792 of yacc.c */ -#line 1837 "dtool/src/cppparser/cppBison.yxx" - { - current_struct->append_derivation((yyvsp[(2) - (2)].u.type), V_protected, false); -} - break; - - case 240: -/* Line 1792 of yacc.c */ -#line 1841 "dtool/src/cppparser/cppBison.yxx" - { - current_struct->append_derivation((yyvsp[(2) - (2)].u.type), V_private, false); -} - break; - - case 241: -/* Line 1792 of yacc.c */ -#line 1845 "dtool/src/cppparser/cppBison.yxx" - { - current_struct->append_derivation((yyvsp[(3) - (3)].u.type), V_public, true); -} - break; - - case 242: -/* Line 1792 of yacc.c */ -#line 1849 "dtool/src/cppparser/cppBison.yxx" - { - current_struct->append_derivation((yyvsp[(3) - (3)].u.type), V_protected, true); -} - break; - - case 243: -/* Line 1792 of yacc.c */ -#line 1853 "dtool/src/cppparser/cppBison.yxx" - { - current_struct->append_derivation((yyvsp[(3) - (3)].u.type), V_private, true); -} - break; - - case 244: -/* Line 1792 of yacc.c */ -#line 1857 "dtool/src/cppparser/cppBison.yxx" - { - current_struct->append_derivation((yyvsp[(3) - (3)].u.type), V_public, true); -} - break; - - case 245: -/* Line 1792 of yacc.c */ -#line 1861 "dtool/src/cppparser/cppBison.yxx" - { - current_struct->append_derivation((yyvsp[(3) - (3)].u.type), V_protected, true); -} - break; - - case 246: -/* Line 1792 of yacc.c */ -#line 1865 "dtool/src/cppparser/cppBison.yxx" - { - current_struct->append_derivation((yyvsp[(3) - (3)].u.type), V_private, true); -} - break; - - case 247: -/* Line 1792 of yacc.c */ -#line 1872 "dtool/src/cppparser/cppBison.yxx" +#line 1820 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.enum_type) = current_enum; current_enum = NULL; } +#line 5057 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 240: +#line 1828 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + current_enum = new CPPEnumType((yyvsp[-2].u.identifier), (yyvsp[0].u.type), current_scope, (yylsp[-3]).file); +} +#line 5065 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 241: +#line 1832 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + current_enum = new CPPEnumType((yyvsp[0].u.identifier), current_scope, (yylsp[-1]).file); +} +#line 5073 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 242: +#line 1836 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + current_enum = new CPPEnumType(NULL, (yyvsp[0].u.type), current_scope, (yylsp[-2]).file); +} +#line 5081 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 243: +#line 1840 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + current_enum = new CPPEnumType(NULL, current_scope, (yylsp[0]).file); +} +#line 5089 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 244: +#line 1847 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.type) = CPPType::new_type((yyvsp[0].u.simple_type)); +} +#line 5097 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 245: +#line 1851 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.type) = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); +} +#line 5105 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 247: +#line 1859 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + assert(current_enum != NULL); + CPPInstance *inst = current_enum->add_element((yyvsp[-1].u.identifier)->get_simple_name()); + current_scope->add_enum_value(inst, current_lexer, (yylsp[-1])); +} +#line 5115 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 248: -/* Line 1792 of yacc.c */ -#line 1880 "dtool/src/cppparser/cppBison.yxx" +#line 1865 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - current_enum = new CPPEnumType((yyvsp[(2) - (4)].u.identifier), (yyvsp[(4) - (4)].u.type), current_scope, (yylsp[(1) - (4)]).file); -} - break; - - case 249: -/* Line 1792 of yacc.c */ -#line 1884 "dtool/src/cppparser/cppBison.yxx" - { - current_enum = new CPPEnumType((yyvsp[(2) - (2)].u.identifier), current_scope, (yylsp[(1) - (2)]).file); + assert(current_enum != NULL); + CPPInstance *inst = current_enum->add_element((yyvsp[-3].u.identifier)->get_simple_name(), (yyvsp[-1].u.expr)); + current_scope->add_enum_value(inst, current_lexer, (yylsp[-3])); } +#line 5125 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 250: -/* Line 1792 of yacc.c */ -#line 1888 "dtool/src/cppparser/cppBison.yxx" +#line 1874 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - current_enum = new CPPEnumType(NULL, (yyvsp[(3) - (3)].u.type), current_scope, (yylsp[(1) - (3)]).file); + assert(current_enum != NULL); + CPPInstance *inst = current_enum->add_element((yyvsp[0].u.identifier)->get_simple_name()); + current_scope->add_enum_value(inst, current_lexer, (yylsp[0])); } +#line 5135 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 251: -/* Line 1792 of yacc.c */ -#line 1892 "dtool/src/cppparser/cppBison.yxx" +#line 1880 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - current_enum = new CPPEnumType(NULL, current_scope, (yylsp[(1) - (1)]).file); + assert(current_enum != NULL); + CPPInstance *inst = current_enum->add_element((yyvsp[-2].u.identifier)->get_simple_name(), (yyvsp[0].u.expr)); + current_scope->add_enum_value(inst, current_lexer, (yylsp[-2])); } +#line 5145 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 252: -/* Line 1792 of yacc.c */ -#line 1899 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.type) = CPPType::new_type((yyvsp[(1) - (1)].u.simple_type)); -} - break; - - case 253: -/* Line 1792 of yacc.c */ -#line 1903 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.type) = (yyvsp[(1) - (1)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); -} - break; - - case 255: -/* Line 1792 of yacc.c */ -#line 1911 "dtool/src/cppparser/cppBison.yxx" - { - assert(current_enum != NULL); - 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 256: -/* Line 1792 of yacc.c */ -#line 1917 "dtool/src/cppparser/cppBison.yxx" - { - assert(current_enum != NULL); - 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 258: -/* Line 1792 of yacc.c */ -#line 1926 "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; - - case 259: -/* Line 1792 of yacc.c */ -#line 1932 "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 260: -/* Line 1792 of yacc.c */ -#line 1941 "dtool/src/cppparser/cppBison.yxx" +#line 1889 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.extension_enum) = CPPExtensionType::T_enum; } +#line 5153 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 261: -/* Line 1792 of yacc.c */ -#line 1948 "dtool/src/cppparser/cppBison.yxx" + case 253: +#line 1896 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.extension_enum) = CPPExtensionType::T_class; } +#line 5161 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 262: -/* Line 1792 of yacc.c */ -#line 1952 "dtool/src/cppparser/cppBison.yxx" + case 254: +#line 1900 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.extension_enum) = CPPExtensionType::T_struct; } +#line 5169 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 263: -/* Line 1792 of yacc.c */ -#line 1956 "dtool/src/cppparser/cppBison.yxx" + case 255: +#line 1904 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.extension_enum) = CPPExtensionType::T_union; } +#line 5177 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 264: -/* Line 1792 of yacc.c */ -#line 1963 "dtool/src/cppparser/cppBison.yxx" + case 256: +#line 1911 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - CPPScope *scope = (yyvsp[(2) - (3)].u.identifier)->find_scope(current_scope, global_scope, current_lexer); + CPPScope *scope = (yyvsp[-1].u.identifier)->find_scope(current_scope, global_scope, current_lexer); if (scope == NULL) { // This must be a new namespace declaration. CPPScope *parent_scope = - (yyvsp[(2) - (3)].u.identifier)->get_scope(current_scope, global_scope, current_lexer); + (yyvsp[-1].u.identifier)->get_scope(current_scope, global_scope, current_lexer); if (parent_scope == NULL) { parent_scope = current_scope; } - scope = new CPPScope(parent_scope, (yyvsp[(2) - (3)].u.identifier)->_names.back(), V_public); + scope = new CPPScope(parent_scope, (yyvsp[-1].u.identifier)->_names.back(), V_public); } - CPPNamespace *nspace = new CPPNamespace((yyvsp[(2) - (3)].u.identifier), scope, (yylsp[(1) - (3)]).file); - current_scope->add_declaration(nspace, global_scope, current_lexer, (yylsp[(1) - (3)])); + CPPNamespace *nspace = new CPPNamespace((yyvsp[-1].u.identifier), scope, (yylsp[-2]).file); + current_scope->add_declaration(nspace, global_scope, current_lexer, (yylsp[-2])); current_scope->define_namespace(nspace); push_scope(scope); } +#line 5199 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 265: -/* Line 1792 of yacc.c */ -#line 1981 "dtool/src/cppparser/cppBison.yxx" + case 257: +#line 1929 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { pop_scope(); } +#line 5207 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 267: -/* Line 1792 of yacc.c */ -#line 1989 "dtool/src/cppparser/cppBison.yxx" + case 259: +#line 1937 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - 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)])); + CPPUsing *using_decl = new CPPUsing((yyvsp[0].u.identifier), false, (yylsp[-1]).file); + current_scope->add_declaration(using_decl, global_scope, current_lexer, (yylsp[-1])); current_scope->add_using(using_decl, global_scope, current_lexer); } +#line 5217 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 268: -/* Line 1792 of yacc.c */ -#line 1995 "dtool/src/cppparser/cppBison.yxx" + case 260: +#line 1943 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - 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)])); + CPPUsing *using_decl = new CPPUsing((yyvsp[0].u.identifier), true, (yylsp[-2]).file); + current_scope->add_declaration(using_decl, global_scope, current_lexer, (yylsp[-2])); current_scope->add_using(using_decl, global_scope, current_lexer); } +#line 5227 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 272: -/* Line 1792 of yacc.c */ -#line 2010 "dtool/src/cppparser/cppBison.yxx" + case 264: +#line 1958 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_bool); } +#line 5235 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 273: -/* Line 1792 of yacc.c */ -#line 2014 "dtool/src/cppparser/cppBison.yxx" + case 265: +#line 1962 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_char); } +#line 5243 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 274: -/* Line 1792 of yacc.c */ -#line 2018 "dtool/src/cppparser/cppBison.yxx" + case 266: +#line 1966 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_wchar_t); } +#line 5251 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 275: -/* Line 1792 of yacc.c */ -#line 2022 "dtool/src/cppparser/cppBison.yxx" + case 267: +#line 1970 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_char16_t); } +#line 5259 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 276: -/* Line 1792 of yacc.c */ -#line 2026 "dtool/src/cppparser/cppBison.yxx" + case 268: +#line 1974 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_char32_t); } +#line 5267 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 277: -/* Line 1792 of yacc.c */ -#line 2030 "dtool/src/cppparser/cppBison.yxx" + case 269: +#line 1978 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_short); } +#line 5276 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 278: -/* Line 1792 of yacc.c */ -#line 2035 "dtool/src/cppparser/cppBison.yxx" + case 270: +#line 1983 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_long); } +#line 5285 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 279: -/* Line 1792 of yacc.c */ -#line 2040 "dtool/src/cppparser/cppBison.yxx" + case 271: +#line 1988 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_longlong); } +#line 5294 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 280: -/* Line 1792 of yacc.c */ -#line 2045 "dtool/src/cppparser/cppBison.yxx" + case 272: +#line 1993 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_unsigned); } +#line 5303 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 281: -/* Line 1792 of yacc.c */ -#line 2050 "dtool/src/cppparser/cppBison.yxx" + case 273: +#line 1998 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_signed); } +#line 5312 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 282: -/* Line 1792 of yacc.c */ -#line 2055 "dtool/src/cppparser/cppBison.yxx" + case 274: +#line 2003 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int); } +#line 5320 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 283: -/* Line 1792 of yacc.c */ -#line 2059 "dtool/src/cppparser/cppBison.yxx" + case 275: +#line 2007 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.simple_type) = (yyvsp[(2) - (2)].u.simple_type); + (yyval.u.simple_type) = (yyvsp[0].u.simple_type); (yyval.u.simple_type)->_flags |= CPPSimpleType::F_short; } +#line 5329 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 284: -/* Line 1792 of yacc.c */ -#line 2064 "dtool/src/cppparser/cppBison.yxx" + case 276: +#line 2012 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.simple_type) = (yyvsp[(2) - (2)].u.simple_type); + (yyval.u.simple_type) = (yyvsp[0].u.simple_type); if ((yyval.u.simple_type)->_flags & CPPSimpleType::F_long) { (yyval.u.simple_type)->_flags |= CPPSimpleType::F_longlong; } else { (yyval.u.simple_type)->_flags |= CPPSimpleType::F_long; } } +#line 5342 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 285: -/* Line 1792 of yacc.c */ -#line 2073 "dtool/src/cppparser/cppBison.yxx" + case 277: +#line 2021 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.simple_type) = (yyvsp[(2) - (2)].u.simple_type); + (yyval.u.simple_type) = (yyvsp[0].u.simple_type); (yyval.u.simple_type)->_flags |= CPPSimpleType::F_unsigned; } +#line 5351 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 286: -/* Line 1792 of yacc.c */ -#line 2078 "dtool/src/cppparser/cppBison.yxx" + case 278: +#line 2026 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.simple_type) = (yyvsp[(2) - (2)].u.simple_type); + (yyval.u.simple_type) = (yyvsp[0].u.simple_type); (yyval.u.simple_type)->_flags |= CPPSimpleType::F_signed; } +#line 5360 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 287: -/* Line 1792 of yacc.c */ -#line 2086 "dtool/src/cppparser/cppBison.yxx" + case 279: +#line 2034 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_float); } +#line 5368 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 288: -/* Line 1792 of yacc.c */ -#line 2090 "dtool/src/cppparser/cppBison.yxx" + case 280: +#line 2038 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_float, CPPSimpleType::F_long); } +#line 5377 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 289: -/* Line 1792 of yacc.c */ -#line 2095 "dtool/src/cppparser/cppBison.yxx" + case 281: +#line 2043 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_double); } +#line 5385 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 290: -/* Line 1792 of yacc.c */ -#line 2099 "dtool/src/cppparser/cppBison.yxx" + case 282: +#line 2047 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_float, CPPSimpleType::F_longlong); } +#line 5394 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 291: -/* Line 1792 of yacc.c */ -#line 2104 "dtool/src/cppparser/cppBison.yxx" + case 283: +#line 2052 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_double, CPPSimpleType::F_long); } +#line 5403 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 292: -/* Line 1792 of yacc.c */ -#line 2112 "dtool/src/cppparser/cppBison.yxx" + case 284: +#line 2060 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_void); } +#line 5411 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 293: -/* Line 1792 of yacc.c */ -#line 2121 "dtool/src/cppparser/cppBison.yxx" + case 285: +#line 2069 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_lexer->_resolve_identifiers = false; } +#line 5419 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 294: -/* Line 1792 of yacc.c */ -#line 2125 "dtool/src/cppparser/cppBison.yxx" + case 286: +#line 2073 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_lexer->_resolve_identifiers = true; } +#line 5427 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 381: -/* Line 1792 of yacc.c */ -#line 2163 "dtool/src/cppparser/cppBison.yxx" + case 373: +#line 2111 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { } +#line 5434 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 397: +#line 2120 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (CPPExpression *)NULL; +} +#line 5442 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 398: +#line 2124 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (yyvsp[0].u.expr); +} +#line 5450 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 399: +#line 2131 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (CPPExpression *)NULL; +} +#line 5458 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 400: +#line 2135 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (yyvsp[0].u.expr); +} +#line 5466 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 401: +#line 2142 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (yyvsp[0].u.expr); +} +#line 5474 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 402: +#line 2146 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(',', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 5482 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 403: +#line 2153 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (yyvsp[0].u.expr); +} +#line 5490 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 404: +#line 2157 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-2].u.type), (yyvsp[0].u.expr))); +} +#line 5498 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 405: -/* Line 1792 of yacc.c */ -#line 2172 "dtool/src/cppparser/cppBison.yxx" +#line 2161 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = (CPPExpression *)NULL; + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr))); } +#line 5506 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 406: -/* Line 1792 of yacc.c */ -#line 2176 "dtool/src/cppparser/cppBison.yxx" +#line 2165 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr))); } +#line 5514 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 407: -/* Line 1792 of yacc.c */ -#line 2183 "dtool/src/cppparser/cppBison.yxx" +#line 2169 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = (CPPExpression *)NULL; + (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_func((yyvsp[-1].u.type))); } +#line 5522 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 408: -/* Line 1792 of yacc.c */ -#line 2187 "dtool/src/cppparser/cppBison.yxx" +#line 2173 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); + (yyval.u.expr) = new CPPExpression(UNARY_NOT, (yyvsp[0].u.expr)); } +#line 5530 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 409: -/* Line 1792 of yacc.c */ -#line 2194 "dtool/src/cppparser/cppBison.yxx" +#line 2177 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); + (yyval.u.expr) = new CPPExpression(UNARY_NEGATE, (yyvsp[0].u.expr)); } +#line 5538 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 410: -/* Line 1792 of yacc.c */ -#line 2198 "dtool/src/cppparser/cppBison.yxx" +#line 2181 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(',', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + if ((yyvsp[0].u.expr)->_type == CPPExpression::T_integer) { + (yyval.u.expr) = (yyvsp[0].u.expr); + (yyval.u.expr)->_u._integer = -(yyval.u.expr)->_u._integer; + } else if ((yyvsp[0].u.expr)->_type == CPPExpression::T_real) { + (yyval.u.expr) = (yyvsp[0].u.expr); + (yyval.u.expr)->_u._real = -(yyval.u.expr)->_u._real; + } else { + (yyval.u.expr) = new CPPExpression(UNARY_MINUS, (yyvsp[0].u.expr)); + } } +#line 5554 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 411: -/* Line 1792 of yacc.c */ -#line 2205 "dtool/src/cppparser/cppBison.yxx" +#line 2193 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); + (yyval.u.expr) = new CPPExpression(UNARY_STAR, (yyvsp[0].u.expr)); } +#line 5562 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 412: -/* Line 1792 of yacc.c */ -#line 2209 "dtool/src/cppparser/cppBison.yxx" +#line 2197 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(2) - (4)].u.type), (yyvsp[(4) - (4)].u.expr))); + (yyval.u.expr) = new CPPExpression(UNARY_REF, (yyvsp[0].u.expr)); } +#line 5570 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 413: -/* Line 1792 of yacc.c */ -#line 2213 "dtool/src/cppparser/cppBison.yxx" +#line 2201 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(3) - (7)].u.type), (yyvsp[(6) - (7)].u.expr))); + (yyval.u.expr) = new CPPExpression('*', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 5578 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 414: -/* Line 1792 of yacc.c */ -#line 2217 "dtool/src/cppparser/cppBison.yxx" +#line 2205 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(3) - (7)].u.type), (yyvsp[(6) - (7)].u.expr))); + (yyval.u.expr) = new CPPExpression('/', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 5586 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 415: -/* Line 1792 of yacc.c */ -#line 2221 "dtool/src/cppparser/cppBison.yxx" +#line 2209 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_func((yyvsp[(3) - (4)].u.type))); + (yyval.u.expr) = new CPPExpression('%', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 5594 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 416: -/* Line 1792 of yacc.c */ -#line 2225 "dtool/src/cppparser/cppBison.yxx" +#line 2213 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(UNARY_NOT, (yyvsp[(2) - (2)].u.expr)); + (yyval.u.expr) = new CPPExpression('+', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 5602 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 417: -/* Line 1792 of yacc.c */ -#line 2229 "dtool/src/cppparser/cppBison.yxx" +#line 2217 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(UNARY_NEGATE, (yyvsp[(2) - (2)].u.expr)); + (yyval.u.expr) = new CPPExpression('-', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 5610 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 418: -/* Line 1792 of yacc.c */ -#line 2233 "dtool/src/cppparser/cppBison.yxx" +#line 2221 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - if ((yyvsp[(2) - (2)].u.expr)->_type == CPPExpression::T_integer) { - (yyval.u.expr) = (yyvsp[(2) - (2)].u.expr); - (yyval.u.expr)->_u._integer = -(yyval.u.expr)->_u._integer; - } else if ((yyvsp[(2) - (2)].u.expr)->_type == CPPExpression::T_real) { - (yyval.u.expr) = (yyvsp[(2) - (2)].u.expr); - (yyval.u.expr)->_u._real = -(yyval.u.expr)->_u._real; - } else { - (yyval.u.expr) = new CPPExpression(UNARY_MINUS, (yyvsp[(2) - (2)].u.expr)); - } + (yyval.u.expr) = new CPPExpression('|', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 5618 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 419: -/* Line 1792 of yacc.c */ -#line 2245 "dtool/src/cppparser/cppBison.yxx" +#line 2225 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(UNARY_STAR, (yyvsp[(2) - (2)].u.expr)); + (yyval.u.expr) = new CPPExpression('^', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 5626 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 420: -/* Line 1792 of yacc.c */ -#line 2249 "dtool/src/cppparser/cppBison.yxx" +#line 2229 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(UNARY_REF, (yyvsp[(2) - (2)].u.expr)); + (yyval.u.expr) = new CPPExpression('&', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 5634 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 421: -/* Line 1792 of yacc.c */ -#line 2253 "dtool/src/cppparser/cppBison.yxx" +#line 2233 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('*', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(OROR, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 5642 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 422: -/* Line 1792 of yacc.c */ -#line 2257 "dtool/src/cppparser/cppBison.yxx" +#line 2237 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('/', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(ANDAND, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 5650 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 423: -/* Line 1792 of yacc.c */ -#line 2261 "dtool/src/cppparser/cppBison.yxx" +#line 2241 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('%', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(EQCOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 5658 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 424: -/* Line 1792 of yacc.c */ -#line 2265 "dtool/src/cppparser/cppBison.yxx" +#line 2245 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('+', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(NECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 5666 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 425: -/* Line 1792 of yacc.c */ -#line 2269 "dtool/src/cppparser/cppBison.yxx" +#line 2249 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('-', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(LECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 5674 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 426: -/* Line 1792 of yacc.c */ -#line 2273 "dtool/src/cppparser/cppBison.yxx" +#line 2253 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('|', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(GECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 5682 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 427: -/* Line 1792 of yacc.c */ -#line 2277 "dtool/src/cppparser/cppBison.yxx" +#line 2257 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('^', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(LSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 5690 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 428: -/* Line 1792 of yacc.c */ -#line 2281 "dtool/src/cppparser/cppBison.yxx" +#line 2261 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('&', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(RSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 5698 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 429: -/* Line 1792 of yacc.c */ -#line 2285 "dtool/src/cppparser/cppBison.yxx" +#line 2265 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(OROR, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('?', (yyvsp[-4].u.expr), (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 5706 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 430: -/* Line 1792 of yacc.c */ -#line 2289 "dtool/src/cppparser/cppBison.yxx" +#line 2269 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(ANDAND, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('[', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); } +#line 5714 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 431: -/* Line 1792 of yacc.c */ -#line 2293 "dtool/src/cppparser/cppBison.yxx" +#line 2273 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(EQCOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('f', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); } +#line 5722 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 432: -/* Line 1792 of yacc.c */ -#line 2297 "dtool/src/cppparser/cppBison.yxx" +#line 2277 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(NECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('f', (yyvsp[-2].u.expr)); } +#line 5730 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 433: -/* Line 1792 of yacc.c */ -#line 2301 "dtool/src/cppparser/cppBison.yxx" +#line 2281 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(LECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('.', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 5738 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 434: -/* Line 1792 of yacc.c */ -#line 2305 "dtool/src/cppparser/cppBison.yxx" +#line 2285 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(GECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 5746 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 435: -/* Line 1792 of yacc.c */ -#line 2309 "dtool/src/cppparser/cppBison.yxx" +#line 2289 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(LSHIFT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = (yyvsp[-1].u.expr); } +#line 5754 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 436: -/* Line 1792 of yacc.c */ -#line 2313 "dtool/src/cppparser/cppBison.yxx" +#line 2297 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(RSHIFT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = (yyvsp[0].u.expr); } +#line 5762 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 437: -/* Line 1792 of yacc.c */ -#line 2317 "dtool/src/cppparser/cppBison.yxx" +#line 2301 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('?', (yyvsp[(1) - (5)].u.expr), (yyvsp[(3) - (5)].u.expr), (yyvsp[(5) - (5)].u.expr)); + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-2].u.type), (yyvsp[0].u.expr))); } +#line 5770 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 438: -/* Line 1792 of yacc.c */ -#line 2321 "dtool/src/cppparser/cppBison.yxx" +#line 2305 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('[', (yyvsp[(1) - (4)].u.expr), (yyvsp[(3) - (4)].u.expr)); + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr))); } +#line 5778 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 439: -/* Line 1792 of yacc.c */ -#line 2325 "dtool/src/cppparser/cppBison.yxx" +#line 2309 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[(1) - (4)].u.expr), (yyvsp[(3) - (4)].u.expr)); + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr))); } +#line 5786 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 440: -/* Line 1792 of yacc.c */ -#line 2329 "dtool/src/cppparser/cppBison.yxx" +#line 2313 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[(1) - (3)].u.expr)); + // A constructor call. + CPPType *type = (yyvsp[-3].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); + assert(type != NULL); + (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } +#line 5797 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 441: -/* Line 1792 of yacc.c */ -#line 2333 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('.', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); -} - break; - - case 442: -/* Line 1792 of yacc.c */ -#line 2337 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); -} - break; - - case 443: -/* Line 1792 of yacc.c */ -#line 2341 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.expr) = (yyvsp[(2) - (3)].u.expr); -} - break; - - case 444: -/* Line 1792 of yacc.c */ -#line 2349 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); -} - break; - - case 445: -/* Line 1792 of yacc.c */ -#line 2353 "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 446: -/* Line 1792 of yacc.c */ -#line 2357 "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 447: -/* Line 1792 of yacc.c */ -#line 2361 "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 448: -/* Line 1792 of yacc.c */ -#line 2365 "dtool/src/cppparser/cppBison.yxx" - { - // A constructor call. - CPPType *type = (yyvsp[(1) - (4)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); - assert(type != NULL); - (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[(3) - (4)].u.expr))); -} - break; - - case 449: -/* Line 1792 of yacc.c */ -#line 2372 "dtool/src/cppparser/cppBison.yxx" +#line 2320 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int)); - (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[(3) - (4)].u.expr))); + (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } +#line 5807 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 450: -/* Line 1792 of yacc.c */ -#line 2378 "dtool/src/cppparser/cppBison.yxx" + case 442: +#line 2326 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_char)); - (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[(3) - (4)].u.expr))); + (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } +#line 5817 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 451: -/* Line 1792 of yacc.c */ -#line 2384 "dtool/src/cppparser/cppBison.yxx" + case 443: +#line 2332 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_wchar_t)); - (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[(3) - (4)].u.expr))); + (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } +#line 5827 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 452: -/* Line 1792 of yacc.c */ -#line 2390 "dtool/src/cppparser/cppBison.yxx" + case 444: +#line 2338 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_char16_t)); - (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[(3) - (4)].u.expr))); + (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } +#line 5837 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 453: -/* Line 1792 of yacc.c */ -#line 2396 "dtool/src/cppparser/cppBison.yxx" + case 445: +#line 2344 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_char32_t)); - (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[(3) - (4)].u.expr))); + (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } +#line 5847 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 454: -/* Line 1792 of yacc.c */ -#line 2402 "dtool/src/cppparser/cppBison.yxx" + case 446: +#line 2350 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_bool)); - (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[(3) - (4)].u.expr))); + (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } +#line 5857 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 455: -/* Line 1792 of yacc.c */ -#line 2408 "dtool/src/cppparser/cppBison.yxx" + case 447: +#line 2356 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_short)); - (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[(3) - (4)].u.expr))); + (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } +#line 5868 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 456: -/* Line 1792 of yacc.c */ -#line 2415 "dtool/src/cppparser/cppBison.yxx" + case 448: +#line 2363 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_long)); - (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[(3) - (4)].u.expr))); + (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } +#line 5879 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 457: -/* Line 1792 of yacc.c */ -#line 2422 "dtool/src/cppparser/cppBison.yxx" + case 449: +#line 2370 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_unsigned)); - (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[(3) - (4)].u.expr))); + (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } +#line 5890 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 458: -/* Line 1792 of yacc.c */ -#line 2429 "dtool/src/cppparser/cppBison.yxx" + case 450: +#line 2377 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_signed)); - (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[(3) - (4)].u.expr))); + (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } +#line 5901 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 459: -/* Line 1792 of yacc.c */ -#line 2436 "dtool/src/cppparser/cppBison.yxx" + case 451: +#line 2384 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_float)); - (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[(3) - (4)].u.expr))); + (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } +#line 5911 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 460: -/* Line 1792 of yacc.c */ -#line 2442 "dtool/src/cppparser/cppBison.yxx" + case 452: +#line 2390 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_double)); - (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[(3) - (4)].u.expr))); + (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } +#line 5921 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 453: +#line 2396 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_func((yyvsp[-1].u.type))); +} +#line 5929 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 454: +#line 2400 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[0].u.type))); +} +#line 5937 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 455: +#line 2404 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[-3].u.type), (yyvsp[-1].u.expr))); +} +#line 5945 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 456: +#line 2408 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(UNARY_NOT, (yyvsp[0].u.expr)); +} +#line 5953 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 457: +#line 2412 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(UNARY_NEGATE, (yyvsp[0].u.expr)); +} +#line 5961 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 458: +#line 2416 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + if ((yyvsp[0].u.expr)->_type == CPPExpression::T_integer) { + (yyval.u.expr) = (yyvsp[0].u.expr); + (yyval.u.expr)->_u._integer = -(yyval.u.expr)->_u._integer; + } else if ((yyvsp[0].u.expr)->_type == CPPExpression::T_real) { + (yyval.u.expr) = (yyvsp[0].u.expr); + (yyval.u.expr)->_u._real = -(yyval.u.expr)->_u._real; + } else { + (yyval.u.expr) = new CPPExpression(UNARY_MINUS, (yyvsp[0].u.expr)); + } +} +#line 5977 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 459: +#line 2428 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(UNARY_STAR, (yyvsp[0].u.expr)); +} +#line 5985 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 460: +#line 2432 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(UNARY_REF, (yyvsp[0].u.expr)); +} +#line 5993 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 461: -/* Line 1792 of yacc.c */ -#line 2448 "dtool/src/cppparser/cppBison.yxx" +#line 2436 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_func((yyvsp[(3) - (4)].u.type))); + (yyval.u.expr) = new CPPExpression('*', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6001 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 462: -/* Line 1792 of yacc.c */ -#line 2452 "dtool/src/cppparser/cppBison.yxx" +#line 2440 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[(2) - (2)].u.type))); + (yyval.u.expr) = new CPPExpression('/', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6009 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 463: -/* Line 1792 of yacc.c */ -#line 2456 "dtool/src/cppparser/cppBison.yxx" +#line 2444 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[(2) - (5)].u.type), (yyvsp[(4) - (5)].u.expr))); + (yyval.u.expr) = new CPPExpression('%', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6017 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 464: -/* Line 1792 of yacc.c */ -#line 2460 "dtool/src/cppparser/cppBison.yxx" +#line 2448 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(UNARY_NOT, (yyvsp[(2) - (2)].u.expr)); + (yyval.u.expr) = new CPPExpression('+', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6025 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 465: -/* Line 1792 of yacc.c */ -#line 2464 "dtool/src/cppparser/cppBison.yxx" +#line 2452 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(UNARY_NEGATE, (yyvsp[(2) - (2)].u.expr)); + (yyval.u.expr) = new CPPExpression('-', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6033 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 466: -/* Line 1792 of yacc.c */ -#line 2468 "dtool/src/cppparser/cppBison.yxx" +#line 2456 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - if ((yyvsp[(2) - (2)].u.expr)->_type == CPPExpression::T_integer) { - (yyval.u.expr) = (yyvsp[(2) - (2)].u.expr); - (yyval.u.expr)->_u._integer = -(yyval.u.expr)->_u._integer; - } else if ((yyvsp[(2) - (2)].u.expr)->_type == CPPExpression::T_real) { - (yyval.u.expr) = (yyvsp[(2) - (2)].u.expr); - (yyval.u.expr)->_u._real = -(yyval.u.expr)->_u._real; - } else { - (yyval.u.expr) = new CPPExpression(UNARY_MINUS, (yyvsp[(2) - (2)].u.expr)); - } + (yyval.u.expr) = new CPPExpression('|', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6041 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 467: -/* Line 1792 of yacc.c */ -#line 2480 "dtool/src/cppparser/cppBison.yxx" +#line 2460 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(UNARY_STAR, (yyvsp[(2) - (2)].u.expr)); + (yyval.u.expr) = new CPPExpression('^', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6049 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 468: -/* Line 1792 of yacc.c */ -#line 2484 "dtool/src/cppparser/cppBison.yxx" +#line 2464 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(UNARY_REF, (yyvsp[(2) - (2)].u.expr)); + (yyval.u.expr) = new CPPExpression('&', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6057 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 469: -/* Line 1792 of yacc.c */ -#line 2488 "dtool/src/cppparser/cppBison.yxx" +#line 2468 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('*', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(OROR, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6065 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 470: -/* Line 1792 of yacc.c */ -#line 2492 "dtool/src/cppparser/cppBison.yxx" +#line 2472 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('/', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(ANDAND, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6073 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 471: -/* Line 1792 of yacc.c */ -#line 2496 "dtool/src/cppparser/cppBison.yxx" +#line 2476 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('%', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(EQCOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6081 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 472: -/* Line 1792 of yacc.c */ -#line 2500 "dtool/src/cppparser/cppBison.yxx" +#line 2480 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('+', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(NECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6089 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 473: -/* Line 1792 of yacc.c */ -#line 2504 "dtool/src/cppparser/cppBison.yxx" +#line 2484 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('-', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(LECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6097 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 474: -/* Line 1792 of yacc.c */ -#line 2508 "dtool/src/cppparser/cppBison.yxx" +#line 2488 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('|', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(GECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6105 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 475: -/* Line 1792 of yacc.c */ -#line 2512 "dtool/src/cppparser/cppBison.yxx" +#line 2492 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('^', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('<', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6113 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 476: -/* Line 1792 of yacc.c */ -#line 2516 "dtool/src/cppparser/cppBison.yxx" +#line 2496 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('&', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('>', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6121 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 477: -/* Line 1792 of yacc.c */ -#line 2520 "dtool/src/cppparser/cppBison.yxx" +#line 2500 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(OROR, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(LSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6129 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 478: -/* Line 1792 of yacc.c */ -#line 2524 "dtool/src/cppparser/cppBison.yxx" +#line 2504 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(ANDAND, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(RSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6137 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 479: -/* Line 1792 of yacc.c */ -#line 2528 "dtool/src/cppparser/cppBison.yxx" +#line 2508 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(EQCOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('?', (yyvsp[-4].u.expr), (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6145 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 480: -/* Line 1792 of yacc.c */ -#line 2532 "dtool/src/cppparser/cppBison.yxx" +#line 2512 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(NECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('[', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); } +#line 6153 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 481: -/* Line 1792 of yacc.c */ -#line 2536 "dtool/src/cppparser/cppBison.yxx" +#line 2516 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(LECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('f', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); } +#line 6161 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 482: -/* Line 1792 of yacc.c */ -#line 2540 "dtool/src/cppparser/cppBison.yxx" +#line 2520 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(GECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('f', (yyvsp[-2].u.expr)); } +#line 6169 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 483: -/* Line 1792 of yacc.c */ -#line 2544 "dtool/src/cppparser/cppBison.yxx" +#line 2524 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('<', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('.', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6177 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 484: -/* Line 1792 of yacc.c */ -#line 2548 "dtool/src/cppparser/cppBison.yxx" +#line 2528 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('>', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6185 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 485: -/* Line 1792 of yacc.c */ -#line 2552 "dtool/src/cppparser/cppBison.yxx" +#line 2532 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(LSHIFT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = (yyvsp[-1].u.expr); } +#line 6193 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 486: -/* Line 1792 of yacc.c */ -#line 2556 "dtool/src/cppparser/cppBison.yxx" +#line 2539 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(RSHIFT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression((yyvsp[0].u.integer)); } +#line 6201 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 487: -/* Line 1792 of yacc.c */ -#line 2560 "dtool/src/cppparser/cppBison.yxx" +#line 2543 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('?', (yyvsp[(1) - (5)].u.expr), (yyvsp[(3) - (5)].u.expr), (yyvsp[(5) - (5)].u.expr)); + (yyval.u.expr) = new CPPExpression(true); } +#line 6209 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 488: -/* Line 1792 of yacc.c */ -#line 2564 "dtool/src/cppparser/cppBison.yxx" +#line 2547 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('[', (yyvsp[(1) - (4)].u.expr), (yyvsp[(3) - (4)].u.expr)); + (yyval.u.expr) = new CPPExpression(false); } +#line 6217 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 489: -/* Line 1792 of yacc.c */ -#line 2568 "dtool/src/cppparser/cppBison.yxx" +#line 2551 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[(1) - (4)].u.expr), (yyvsp[(3) - (4)].u.expr)); + (yyval.u.expr) = new CPPExpression((yyvsp[0].u.integer)); } +#line 6225 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 490: -/* Line 1792 of yacc.c */ -#line 2572 "dtool/src/cppparser/cppBison.yxx" +#line 2555 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[(1) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression((yyvsp[0].u.real)); } +#line 6233 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 491: -/* Line 1792 of yacc.c */ -#line 2576 "dtool/src/cppparser/cppBison.yxx" +#line 2559 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('.', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression((yyvsp[0].str)); } +#line 6241 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 492: -/* Line 1792 of yacc.c */ -#line 2580 "dtool/src/cppparser/cppBison.yxx" +#line 2563 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression((yyvsp[0].u.identifier), current_scope, global_scope, current_lexer); } +#line 6249 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 493: -/* Line 1792 of yacc.c */ -#line 2584 "dtool/src/cppparser/cppBison.yxx" +#line 2577 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = (yyvsp[(2) - (3)].u.expr); + (yyval.u.expr) = (yyvsp[0].u.expr); } +#line 6257 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 494: -/* Line 1792 of yacc.c */ -#line 2591 "dtool/src/cppparser/cppBison.yxx" +#line 2581 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.integer)); + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-2].u.type), (yyvsp[0].u.expr))); } +#line 6265 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 495: -/* Line 1792 of yacc.c */ -#line 2595 "dtool/src/cppparser/cppBison.yxx" +#line 2585 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(true); + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr))); } +#line 6273 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 496: -/* Line 1792 of yacc.c */ -#line 2599 "dtool/src/cppparser/cppBison.yxx" +#line 2589 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(false); + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr))); } +#line 6281 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 497: -/* Line 1792 of yacc.c */ -#line 2603 "dtool/src/cppparser/cppBison.yxx" +#line 2593 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.integer)); + (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_func((yyvsp[-1].u.type))); } +#line 6289 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 498: -/* Line 1792 of yacc.c */ -#line 2607 "dtool/src/cppparser/cppBison.yxx" +#line 2597 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.real)); + (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[0].u.type))); } +#line 6297 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 499: -/* Line 1792 of yacc.c */ -#line 2611 "dtool/src/cppparser/cppBison.yxx" +#line 2601 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].str)); + (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[-3].u.type), (yyvsp[-1].u.expr))); } +#line 6305 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 500: -/* Line 1792 of yacc.c */ -#line 2615 "dtool/src/cppparser/cppBison.yxx" +#line 2605 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.identifier), current_scope, global_scope, current_lexer); + (yyval.u.expr) = new CPPExpression(UNARY_NOT, (yyvsp[0].u.expr)); } +#line 6313 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 501: -/* Line 1792 of yacc.c */ -#line 2629 "dtool/src/cppparser/cppBison.yxx" +#line 2609 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); + (yyval.u.expr) = new CPPExpression(UNARY_NEGATE, (yyvsp[0].u.expr)); } +#line 6321 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 502: -/* Line 1792 of yacc.c */ -#line 2633 "dtool/src/cppparser/cppBison.yxx" +#line 2613 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(2) - (4)].u.type), (yyvsp[(4) - (4)].u.expr))); + if ((yyvsp[0].u.expr)->_type == CPPExpression::T_integer) { + (yyval.u.expr) = (yyvsp[0].u.expr); + (yyval.u.expr)->_u._integer = -(yyval.u.expr)->_u._integer; + } else if ((yyvsp[0].u.expr)->_type == CPPExpression::T_real) { + (yyval.u.expr) = (yyvsp[0].u.expr); + (yyval.u.expr)->_u._real = -(yyval.u.expr)->_u._real; + } else { + (yyval.u.expr) = new CPPExpression(UNARY_MINUS, (yyvsp[0].u.expr)); + } } +#line 6337 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 503: -/* Line 1792 of yacc.c */ -#line 2637 "dtool/src/cppparser/cppBison.yxx" +#line 2625 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(3) - (7)].u.type), (yyvsp[(6) - (7)].u.expr))); + (yyval.u.expr) = new CPPExpression(UNARY_REF, (yyvsp[0].u.expr)); } +#line 6345 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 504: -/* Line 1792 of yacc.c */ -#line 2641 "dtool/src/cppparser/cppBison.yxx" +#line 2629 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(3) - (7)].u.type), (yyvsp[(6) - (7)].u.expr))); + (yyval.u.expr) = new CPPExpression('*', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6353 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 505: -/* Line 1792 of yacc.c */ -#line 2645 "dtool/src/cppparser/cppBison.yxx" +#line 2633 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_func((yyvsp[(3) - (4)].u.type))); + (yyval.u.expr) = new CPPExpression('/', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6361 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 506: -/* Line 1792 of yacc.c */ -#line 2649 "dtool/src/cppparser/cppBison.yxx" +#line 2637 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[(2) - (2)].u.type))); + (yyval.u.expr) = new CPPExpression('%', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6369 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 507: -/* Line 1792 of yacc.c */ -#line 2653 "dtool/src/cppparser/cppBison.yxx" +#line 2641 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[(2) - (5)].u.type), (yyvsp[(4) - (5)].u.expr))); + (yyval.u.expr) = new CPPExpression('+', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6377 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 508: -/* Line 1792 of yacc.c */ -#line 2657 "dtool/src/cppparser/cppBison.yxx" +#line 2645 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(UNARY_NOT, (yyvsp[(2) - (2)].u.expr)); + (yyval.u.expr) = new CPPExpression('-', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6385 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 509: -/* Line 1792 of yacc.c */ -#line 2661 "dtool/src/cppparser/cppBison.yxx" +#line 2649 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(UNARY_NEGATE, (yyvsp[(2) - (2)].u.expr)); + (yyval.u.expr) = new CPPExpression('|', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6393 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 510: -/* Line 1792 of yacc.c */ -#line 2665 "dtool/src/cppparser/cppBison.yxx" +#line 2653 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - if ((yyvsp[(2) - (2)].u.expr)->_type == CPPExpression::T_integer) { - (yyval.u.expr) = (yyvsp[(2) - (2)].u.expr); - (yyval.u.expr)->_u._integer = -(yyval.u.expr)->_u._integer; - } else if ((yyvsp[(2) - (2)].u.expr)->_type == CPPExpression::T_real) { - (yyval.u.expr) = (yyvsp[(2) - (2)].u.expr); - (yyval.u.expr)->_u._real = -(yyval.u.expr)->_u._real; - } else { - (yyval.u.expr) = new CPPExpression(UNARY_MINUS, (yyvsp[(2) - (2)].u.expr)); - } + (yyval.u.expr) = new CPPExpression('^', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6401 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 511: -/* Line 1792 of yacc.c */ -#line 2677 "dtool/src/cppparser/cppBison.yxx" +#line 2657 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(UNARY_REF, (yyvsp[(2) - (2)].u.expr)); + (yyval.u.expr) = new CPPExpression('&', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6409 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 512: -/* Line 1792 of yacc.c */ -#line 2681 "dtool/src/cppparser/cppBison.yxx" +#line 2661 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('*', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(OROR, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6417 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 513: -/* Line 1792 of yacc.c */ -#line 2685 "dtool/src/cppparser/cppBison.yxx" +#line 2665 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('/', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(ANDAND, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6425 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 514: -/* Line 1792 of yacc.c */ -#line 2689 "dtool/src/cppparser/cppBison.yxx" +#line 2669 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('%', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(EQCOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6433 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 515: -/* Line 1792 of yacc.c */ -#line 2693 "dtool/src/cppparser/cppBison.yxx" +#line 2673 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('+', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(NECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6441 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 516: -/* Line 1792 of yacc.c */ -#line 2697 "dtool/src/cppparser/cppBison.yxx" +#line 2677 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('-', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(LECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6449 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 517: -/* Line 1792 of yacc.c */ -#line 2701 "dtool/src/cppparser/cppBison.yxx" +#line 2681 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('|', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(GECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6457 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 518: -/* Line 1792 of yacc.c */ -#line 2705 "dtool/src/cppparser/cppBison.yxx" +#line 2685 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('^', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('<', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6465 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 519: -/* Line 1792 of yacc.c */ -#line 2709 "dtool/src/cppparser/cppBison.yxx" +#line 2689 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('&', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('>', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6473 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 520: -/* Line 1792 of yacc.c */ -#line 2713 "dtool/src/cppparser/cppBison.yxx" +#line 2693 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(OROR, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(LSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6481 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 521: -/* Line 1792 of yacc.c */ -#line 2717 "dtool/src/cppparser/cppBison.yxx" +#line 2697 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(ANDAND, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(RSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6489 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 522: -/* Line 1792 of yacc.c */ -#line 2721 "dtool/src/cppparser/cppBison.yxx" +#line 2701 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(EQCOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('?', (yyvsp[-4].u.expr), (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6497 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 523: -/* Line 1792 of yacc.c */ -#line 2725 "dtool/src/cppparser/cppBison.yxx" +#line 2705 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(NECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('[', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); } +#line 6505 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 524: -/* Line 1792 of yacc.c */ -#line 2729 "dtool/src/cppparser/cppBison.yxx" +#line 2709 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(LECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('f', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); } +#line 6513 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 525: -/* Line 1792 of yacc.c */ -#line 2733 "dtool/src/cppparser/cppBison.yxx" +#line 2713 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(GECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('f', (yyvsp[-2].u.expr)); } +#line 6521 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 526: -/* Line 1792 of yacc.c */ -#line 2737 "dtool/src/cppparser/cppBison.yxx" +#line 2717 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('<', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('.', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6529 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 527: -/* Line 1792 of yacc.c */ -#line 2741 "dtool/src/cppparser/cppBison.yxx" +#line 2721 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('>', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } +#line 6537 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 528: -/* Line 1792 of yacc.c */ -#line 2745 "dtool/src/cppparser/cppBison.yxx" +#line 2725 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(LSHIFT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = (yyvsp[-1].u.expr); } +#line 6545 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 529: -/* Line 1792 of yacc.c */ -#line 2749 "dtool/src/cppparser/cppBison.yxx" +#line 2732 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(RSHIFT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression((yyvsp[0].u.integer)); } +#line 6553 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 530: -/* Line 1792 of yacc.c */ -#line 2753 "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 531: -/* Line 1792 of yacc.c */ -#line 2757 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('[', (yyvsp[(1) - (4)].u.expr), (yyvsp[(3) - (4)].u.expr)); -} - break; - - case 532: -/* Line 1792 of yacc.c */ -#line 2761 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[(1) - (4)].u.expr), (yyvsp[(3) - (4)].u.expr)); -} - break; - - case 533: -/* Line 1792 of yacc.c */ -#line 2765 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[(1) - (3)].u.expr)); -} - break; - - case 534: -/* Line 1792 of yacc.c */ -#line 2769 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('.', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); -} - break; - - case 535: -/* Line 1792 of yacc.c */ -#line 2773 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); -} - break; - - case 536: -/* Line 1792 of yacc.c */ -#line 2777 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.expr) = (yyvsp[(2) - (3)].u.expr); -} - break; - - case 537: -/* Line 1792 of yacc.c */ -#line 2784 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.integer)); -} - break; - - case 538: -/* Line 1792 of yacc.c */ -#line 2788 "dtool/src/cppparser/cppBison.yxx" +#line 2736 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression(true); } +#line 6561 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 539: -/* Line 1792 of yacc.c */ -#line 2792 "dtool/src/cppparser/cppBison.yxx" + case 531: +#line 2740 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression(false); } +#line 6569 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 532: +#line 2744 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression((yyvsp[0].u.integer)); +} +#line 6577 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 533: +#line 2748 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression((yyvsp[0].u.real)); +} +#line 6585 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 534: +#line 2752 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression((yyvsp[0].str)); +} +#line 6593 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 535: +#line 2759 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + CPPType *type = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, true); + if (type == NULL) { + type = CPPType::new_type(new CPPTBDType((yyvsp[0].u.identifier))); + } + (yyval.u.type) = type; +} +#line 6605 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 536: +#line 2767 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + CPPType *type = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, true, current_lexer); + if (type == NULL) { + type = CPPType::new_type(new CPPTBDType((yyvsp[0].u.identifier))); + } + (yyval.u.type) = type; +} +#line 6617 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 537: +#line 2775 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.type) = CPPType::new_type(new CPPTBDType((yyvsp[0].u.identifier))); +} +#line 6625 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 538: +#line 2798 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.identifier) = (yyvsp[0].u.identifier); +} +#line 6633 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 539: +#line 2802 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.identifier) = (yyvsp[0].u.identifier); +} +#line 6641 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 540: -/* Line 1792 of yacc.c */ -#line 2796 "dtool/src/cppparser/cppBison.yxx" +#line 2809 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.integer)); + (yyval.str) = (yyvsp[0].str); } +#line 6649 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 541: -/* Line 1792 of yacc.c */ -#line 2800 "dtool/src/cppparser/cppBison.yxx" +#line 2813 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.real)); -} - break; - - case 542: -/* Line 1792 of yacc.c */ -#line 2804 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].str)); -} - break; - - case 543: -/* Line 1792 of yacc.c */ -#line 2811 "dtool/src/cppparser/cppBison.yxx" - { - CPPType *type = (yyvsp[(1) - (1)].u.identifier)->find_type(current_scope, global_scope, true); - if (type == NULL) { - type = CPPType::new_type(new CPPTBDType((yyvsp[(1) - (1)].u.identifier))); - } - (yyval.u.type) = type; -} - break; - - case 544: -/* Line 1792 of yacc.c */ -#line 2819 "dtool/src/cppparser/cppBison.yxx" - { - CPPType *type = (yyvsp[(2) - (2)].u.identifier)->find_type(current_scope, global_scope, true, current_lexer); - if (type == NULL) { - type = CPPType::new_type(new CPPTBDType((yyvsp[(2) - (2)].u.identifier))); - } - (yyval.u.type) = type; -} - break; - - case 545: -/* Line 1792 of yacc.c */ -#line 2827 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.type) = CPPType::new_type(new CPPTBDType((yyvsp[(2) - (2)].u.identifier))); -} - break; - - case 546: -/* Line 1792 of yacc.c */ -#line 2850 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.identifier) = (yyvsp[(1) - (1)].u.identifier); -} - break; - - case 547: -/* Line 1792 of yacc.c */ -#line 2854 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.identifier) = (yyvsp[(1) - (1)].u.identifier); -} - break; - - case 548: -/* Line 1792 of yacc.c */ -#line 2861 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.str) = (yyvsp[(1) - (1)].str); -} - break; - - case 549: -/* Line 1792 of yacc.c */ -#line 2865 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.str) = (yyvsp[(1) - (2)].str) + (yyvsp[(2) - (2)].str); + (yyval.str) = (yyvsp[-1].str) + (yyvsp[0].str); } +#line 6657 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; -/* Line 1792 of yacc.c */ -#line 7133 "built/tmp/cppBison.yxx.c" +#line 6661 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -7152,7 +6680,7 @@ yyreduce: *++yyvsp = yyval; *++yylsp = yyloc; - /* Now `shift' the result of the reduction. Determine what state + /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -7167,9 +6695,9 @@ yyreduce: goto yynewstate; -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ @@ -7220,20 +6748,20 @@ yyerrlab: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + error, discard it. */ if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } else - { - yydestruct ("Error: discarding", - yytoken, &yylval, &yylloc); - yychar = YYEMPTY; - } + { + yydestruct ("Error: discarding", + yytoken, &yylval, &yylloc); + yychar = YYEMPTY; + } } /* Else will try to reuse lookahead token after shifting the error @@ -7253,7 +6781,7 @@ yyerrorlab: goto yyerrorlab; yyerror_range[1] = yylsp[1-yylen]; - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; @@ -7266,29 +6794,29 @@ yyerrorlab: | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) - YYABORT; + YYABORT; yyerror_range[1] = *yylsp; yydestruct ("Error: popping", - yystos[yystate], yyvsp, yylsp); + yystos[yystate], yyvsp, yylsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); @@ -7344,14 +6872,14 @@ yyreturn: yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc); } - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, yylsp); + yystos[*yyssp], yyvsp, yylsp); YYPOPSTACK (1); } #ifndef yyoverflow @@ -7362,8 +6890,5 @@ yyreturn: if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif - /* Make sure YYID is used. */ - return YYID (yyresult); + return yyresult; } - - diff --git a/dtool/src/cppparser/cppBison.h.prebuilt b/dtool/src/cppparser/cppBison.h.prebuilt index 491ce5dc46..5232fee336 100644 --- a/dtool/src/cppparser/cppBison.h.prebuilt +++ b/dtool/src/cppparser/cppBison.h.prebuilt @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 2.7. */ +/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2015 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 the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,13 +26,13 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + 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. */ +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif @@ -40,117 +40,116 @@ extern int cppyydebug; #endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - REAL = 258, - INTEGER = 259, - CHAR_TOK = 260, - STRING = 261, - SIMPLE_IDENTIFIER = 262, - IDENTIFIER = 263, - TYPENAME_IDENTIFIER = 264, - SCOPING = 265, - TYPEDEFNAME = 266, - ELLIPSIS = 267, - OROR = 268, - ANDAND = 269, - EQCOMPARE = 270, - NECOMPARE = 271, - LECOMPARE = 272, - GECOMPARE = 273, - LSHIFT = 274, - RSHIFT = 275, - POINTSAT_STAR = 276, - DOT_STAR = 277, - UNARY = 278, - UNARY_NOT = 279, - UNARY_NEGATE = 280, - UNARY_MINUS = 281, - UNARY_STAR = 282, - UNARY_REF = 283, - POINTSAT = 284, - SCOPE = 285, - PLUSPLUS = 286, - MINUSMINUS = 287, - TIMESEQUAL = 288, - DIVIDEEQUAL = 289, - MODEQUAL = 290, - PLUSEQUAL = 291, - MINUSEQUAL = 292, - OREQUAL = 293, - ANDEQUAL = 294, - XOREQUAL = 295, - LSHIFTEQUAL = 296, - RSHIFTEQUAL = 297, - KW_BEGIN_PUBLISH = 298, - KW_BLOCKING = 299, - KW_BOOL = 300, - KW_CATCH = 301, - KW_CHAR = 302, - KW_CHAR16_T = 303, - KW_CHAR32_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_MAKE_PROPERTY = 327, - KW_MAKE_SEQ = 328, - KW_MUTABLE = 329, - KW_NAMESPACE = 330, - KW_NEW = 331, - KW_NOEXCEPT = 332, - KW_OPERATOR = 333, - KW_PRIVATE = 334, - KW_PROTECTED = 335, - KW_PUBLIC = 336, - KW_REGISTER = 337, - KW_RETURN = 338, - KW_SHORT = 339, - KW_SIGNED = 340, - KW_SIZEOF = 341, - KW_STATIC = 342, - KW_STATIC_CAST = 343, - KW_STRUCT = 344, - KW_TEMPLATE = 345, - KW_THROW = 346, - KW_TRUE = 347, - KW_TRY = 348, - KW_TYPEDEF = 349, - KW_TYPENAME = 350, - KW_UNION = 351, - KW_UNSIGNED = 352, - KW_USING = 353, - KW_VIRTUAL = 354, - KW_VOID = 355, - KW_VOLATILE = 356, - KW_WCHAR_T = 357, - KW_WHILE = 358, - START_CPP = 359, - START_CONST_EXPR = 360, - START_TYPE = 361 - }; + enum yytokentype + { + REAL = 258, + INTEGER = 259, + CHAR_TOK = 260, + STRING = 261, + SIMPLE_IDENTIFIER = 262, + IDENTIFIER = 263, + TYPENAME_IDENTIFIER = 264, + SCOPING = 265, + TYPEDEFNAME = 266, + ELLIPSIS = 267, + OROR = 268, + ANDAND = 269, + EQCOMPARE = 270, + NECOMPARE = 271, + LECOMPARE = 272, + GECOMPARE = 273, + LSHIFT = 274, + RSHIFT = 275, + POINTSAT_STAR = 276, + DOT_STAR = 277, + UNARY = 278, + UNARY_NOT = 279, + UNARY_NEGATE = 280, + UNARY_MINUS = 281, + UNARY_STAR = 282, + UNARY_REF = 283, + POINTSAT = 284, + SCOPE = 285, + PLUSPLUS = 286, + MINUSMINUS = 287, + TIMESEQUAL = 288, + DIVIDEEQUAL = 289, + MODEQUAL = 290, + PLUSEQUAL = 291, + MINUSEQUAL = 292, + OREQUAL = 293, + ANDEQUAL = 294, + XOREQUAL = 295, + LSHIFTEQUAL = 296, + RSHIFTEQUAL = 297, + KW_BEGIN_PUBLISH = 298, + KW_BLOCKING = 299, + KW_BOOL = 300, + KW_CATCH = 301, + KW_CHAR = 302, + KW_CHAR16_T = 303, + KW_CHAR32_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_MAKE_PROPERTY = 327, + KW_MAKE_SEQ = 328, + KW_MUTABLE = 329, + KW_NAMESPACE = 330, + KW_NEW = 331, + KW_NOEXCEPT = 332, + KW_OPERATOR = 333, + KW_PRIVATE = 334, + KW_PROTECTED = 335, + KW_PUBLIC = 336, + KW_REGISTER = 337, + KW_RETURN = 338, + KW_SHORT = 339, + KW_SIGNED = 340, + KW_SIZEOF = 341, + KW_STATIC = 342, + KW_STATIC_CAST = 343, + KW_STRUCT = 344, + KW_TEMPLATE = 345, + KW_THROW = 346, + KW_TRUE = 347, + KW_TRY = 348, + KW_TYPEDEF = 349, + KW_TYPENAME = 350, + KW_UNION = 351, + KW_UNSIGNED = 352, + KW_USING = 353, + KW_VIRTUAL = 354, + KW_VOID = 355, + KW_VOLATILE = 356, + KW_WCHAR_T = 357, + KW_WHILE = 358, + START_CPP = 359, + START_CONST_EXPR = 360, + START_TYPE = 361 + }; #endif /* Tokens. */ #define REAL 258 @@ -258,40 +257,24 @@ extern int cppyydebug; #define START_CONST_EXPR 360 #define START_TYPE 361 +/* Value type. */ - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED - -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -#endif - +/* Location type. */ #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED -typedef struct YYLTYPE +typedef struct YYLTYPE YYLTYPE; +struct YYLTYPE { int first_line; int first_column; int last_line; int last_column; -} YYLTYPE; -# define yyltype YYLTYPE /* obsolescent; will be withdrawn */ +}; # define YYLTYPE_IS_DECLARED 1 # define YYLTYPE_IS_TRIVIAL 1 #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 */ diff --git a/dtool/src/cppparser/cppBison.yxx b/dtool/src/cppparser/cppBison.yxx index a557a61a6d..518f2a6cbb 100644 --- a/dtool/src/cppparser/cppBison.yxx +++ b/dtool/src/cppparser/cppBison.yxx @@ -537,6 +537,11 @@ storage_class: empty { $$ = 0; +} + | storage_class KW_CONST +{ + // This isn't really a storage class, but it helps with parsing. + $$ = $1 | (int)CPPInstance::SC_const; } | storage_class KW_EXTERN { @@ -592,9 +597,20 @@ storage_class: ; type_like_declaration: - multiple_var_declaration + storage_class type_decl { - /* multiple_var_declaration adds itself to the scope. */ + // We don't need to push/pop type, because we can't nest + // multiple_var_declarations. + if ($2->as_type_declaration()) { + current_type = $2->as_type_declaration()->_type; + } else { + current_type = $2->as_type(); + } + push_storage_class($1); +} + multiple_instance_identifiers +{ + pop_storage_class(); } | storage_class type_decl ';' { @@ -613,36 +629,6 @@ type_like_declaration: $2->set_initializer($3); } } - ; - -multiple_var_declaration: - storage_class type_decl -{ - // We don't need to push/pop type, because we can't nest - // multiple_var_declarations. - if ($2->as_type_declaration()) { - current_type = $2->as_type_declaration()->_type; - } else { - current_type = $2->as_type(); - } - push_storage_class($1); -} - multiple_instance_identifiers -{ - pop_storage_class(); -} - | storage_class KW_CONST type -{ - // We don't need to push/pop type, because we can't nest - // multiple_var_declarations. - current_type = $3; - push_storage_class($1); -} - multiple_const_instance_identifiers -{ - pop_storage_class(); -} - /* We don't need to include a rule for variables that point to functions, because we get those from the function_prototype definition. */ @@ -651,6 +637,9 @@ multiple_var_declaration: multiple_instance_identifiers: instance_identifier maybe_initialize_or_function_body { + if (current_storage_class & CPPInstance::SC_const) { + $1->add_modifier(IIT_const); + } CPPInstance *inst = new CPPInstance(current_type, $1, current_storage_class, @1.file); @@ -659,6 +648,9 @@ multiple_instance_identifiers: } | instance_identifier maybe_initialize ',' multiple_instance_identifiers { + if (current_storage_class & CPPInstance::SC_const) { + $1->add_modifier(IIT_const); + } CPPInstance *inst = new CPPInstance(current_type, $1, current_storage_class, @1.file); @@ -667,28 +659,6 @@ multiple_instance_identifiers: } ; -multiple_const_instance_identifiers: - instance_identifier maybe_initialize_or_function_body -{ - $1->add_modifier(IIT_const); - CPPInstance *inst = new CPPInstance(current_type, $1, - current_storage_class, - @1.file); - inst->set_initializer($2); - current_scope->add_declaration(inst, global_scope, current_lexer, @1); -} - | instance_identifier maybe_initialize ',' multiple_const_instance_identifiers -{ - $1->add_modifier(IIT_const); - CPPInstance *inst = new CPPInstance(current_type, $1, - current_storage_class, - @1.file); - inst->set_initializer($2); - current_scope->add_declaration(inst, global_scope, current_lexer, @1); -} - ; - - typedef_declaration: storage_class type_decl { @@ -704,17 +674,6 @@ typedef_declaration: typedef_instance_identifiers { pop_storage_class(); -} - | storage_class KW_CONST type -{ - // We don't need to push/pop type, because we can't nest - // multiple_var_declarations. - current_type = $3; - push_storage_class($1); -} - typedef_const_instance_identifiers -{ - pop_storage_class(); } | storage_class function_prototype maybe_initialize_or_function_body { @@ -733,29 +692,18 @@ typedef_declaration: typedef_instance_identifiers: instance_identifier maybe_initialize_or_function_body { + if (current_storage_class & CPPInstance::SC_const) { + $1->add_modifier(IIT_const); + } CPPType *target_type = current_type; CPPTypedefType *typedef_type = new CPPTypedefType(target_type, $1, current_scope, @1.file); current_scope->add_declaration(typedef_type, global_scope, current_lexer, @1); } | instance_identifier maybe_initialize ',' typedef_instance_identifiers { - CPPType *target_type = current_type; - CPPTypedefType *typedef_type = new CPPTypedefType(target_type, $1, current_scope, @1.file); - current_scope->add_declaration(typedef_type, global_scope, current_lexer, @1); -} - ; - -typedef_const_instance_identifiers: - instance_identifier maybe_initialize_or_function_body -{ - $1->add_modifier(IIT_const); - CPPType *target_type = current_type; - CPPTypedefType *typedef_type = new CPPTypedefType(target_type, $1, current_scope, @1.file); - current_scope->add_declaration(typedef_type, global_scope, current_lexer, @1); -} - | instance_identifier maybe_initialize ',' typedef_const_instance_identifiers -{ - $1->add_modifier(IIT_const); + if (current_storage_class & CPPInstance::SC_const) { + $1->add_modifier(IIT_const); + } CPPType *target_type = current_type; CPPTypedefType *typedef_type = new CPPTypedefType(target_type, $1, current_scope, @1.file); current_scope->add_declaration(typedef_type, global_scope, current_lexer, @1); diff --git a/dtool/src/cppparser/cppInstance.h b/dtool/src/cppparser/cppInstance.h index e2ecbc0ced..b53c84c8c6 100644 --- a/dtool/src/cppparser/cppInstance.h +++ b/dtool/src/cppparser/cppInstance.h @@ -60,6 +60,10 @@ public: // And this is for methods tagged with __extension, which declares // extension methods defined separately from the source code. SC_extension = 0x1000, + + // This isn't really a storage class. It's only used temporarily by the + // parser, to make parsing specifier sequences a bit easier. + SC_const = 0x20000, }; CPPInstance(CPPType *type, const string &name, int storage_class = 0); From 645d1792278c4b13bc1769d893be51c7282994ed Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 9 Aug 2016 01:29:24 +0200 Subject: [PATCH 029/112] Add back missing libp3pystub.a to Mac OS X SDK --- doc/ReleaseNotes | 1 + makepanda/makepanda.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index ad90def34b..04fa87010d 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -28,6 +28,7 @@ This issue fixes several bugs that were still found in 1.9.2. * Fix occasional frame lag when loading a big model asynchronously * Fix race condition reading string config var * Fix interrogate parsing issue with "const static" +* Add back missing libp3pystub.a to Mac OS X SDK ------------------------ RELEASE 1.9.2 ------------------------ diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 14a2adbb73..17778946f2 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -6826,8 +6826,10 @@ def MakeInstallerOSX(): oscmd("cp -R %s/lib/libp3fmod_audio.* dstroot/fmodex/Developer/Panda3D/lib/" % GetOutputDir()) oscmd("cp -R %s/lib/libfmodex* dstroot/fmodex/Developer/Panda3D/lib/" % GetOutputDir()) - oscmd("mkdir -p dstroot/headers/Developer/Panda3D") + oscmd("mkdir -p dstroot/headers/Developer/Panda3D/lib") oscmd("cp -R %s/include dstroot/headers/Developer/Panda3D/include" % GetOutputDir()) + if os.path.isfile(GetOutputDir() + "/lib/libp3pystub.a"): + oscmd("cp -R -P %s/lib/libp3pystub.a dstroot/headers/Developer/Panda3D/lib/" % GetOutputDir()) if os.path.isdir("samples"): oscmd("mkdir -p dstroot/samples/Developer/Examples/Panda3D") From 33c6e21352ba384226a5e73a9ca95f8bb49d39b2 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 9 Aug 2016 01:45:26 +0200 Subject: [PATCH 030/112] Fix regression that stopped buffer protocol from working --- dtool/src/interrogate/typeManager.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dtool/src/interrogate/typeManager.cxx b/dtool/src/interrogate/typeManager.cxx index ae931742c1..db5b07f58a 100644 --- a/dtool/src/interrogate/typeManager.cxx +++ b/dtool/src/interrogate/typeManager.cxx @@ -1740,7 +1740,8 @@ is_Py_buffer(CPPType *type) { case CPPDeclaration::ST_extension: case CPPDeclaration::ST_struct: - return (type->get_local_name(&parser) == "Py_buffer"); + return (type->get_local_name(&parser) == "Py_buffer" || + type->get_local_name(&parser) == "bufferinfo"); case CPPDeclaration::ST_typedef: return is_Py_buffer(type->as_typedef_type()->_type); From 20353f33eb7fffa90135909565097bebc210a525 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 9 Aug 2016 01:47:44 +0200 Subject: [PATCH 031/112] Fix missed switch cases for 1d texture arrays --- panda/src/gobj/texture.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/panda/src/gobj/texture.cxx b/panda/src/gobj/texture.cxx index 8b3285337e..a3ce86c7dd 100644 --- a/panda/src/gobj/texture.cxx +++ b/panda/src/gobj/texture.cxx @@ -1654,6 +1654,10 @@ write(ostream &out, int indent_level) const { case TT_buffer_texture: out << "buffer, " << cdata->_x_size; break; + + case TT_1d_texture_array: + out << "1-d array, " << cdata->_x_size << " x " << cdata->_y_size; + break; } if (cdata->_num_views > 1) { @@ -2053,6 +2057,8 @@ format_texture_type(TextureType tt) { return "cube_map_array"; case TT_buffer_texture: return "buffer_texture"; + case TT_1d_texture_array: + return "1d_texture_array"; } return "**invalid**"; } @@ -6768,6 +6774,10 @@ do_setup_texture(CData *cdata, Texture::TextureType texture_type, case TT_buffer_texture: nassertv(y_size == 1 && z_size == 1); break; + + case TT_1d_texture_array: + nassertv(z_size == 1); + break; } if (texture_type != TT_2d_texture) { @@ -10032,6 +10042,7 @@ make_this_from_bam(const FactoryParams ¶ms) { case TT_buffer_texture: case TT_1d_texture: case TT_2d_texture: + case TT_1d_texture_array: if (alpha_filename.empty()) { me = TexturePool::load_texture(filename, primary_file_num_channels, has_read_mipmaps, options); From 40ff32c7a8e87029c814ce36b5e908cef39c52da Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 27 Aug 2016 19:15:03 +0200 Subject: [PATCH 032/112] Show how to disable shadow map updates in shadow samples --- samples/shadows/advanced.py | 19 +++++++++---------- samples/shadows/basic.py | 15 ++++++++------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/samples/shadows/advanced.py b/samples/shadows/advanced.py index 7211f9a087..988e78df32 100755 --- a/samples/shadows/advanced.py +++ b/samples/shadows/advanced.py @@ -50,6 +50,7 @@ class World(DirectObject): props, winprops, GraphicsPipe.BFRefuseWindow, base.win.getGsg(), base.win) + self.buffer = LBuffer if not LBuffer: self.t = addTitle( @@ -73,9 +74,10 @@ class World(DirectObject): self.inst_w = addInstructions(0.12, 'W : stop/start the Walk Cycle') self.inst_t = addInstructions(0.18, 'T : stop/start the Teapot') self.inst_l = addInstructions(0.24, 'L : move light source far or close') - self.inst_v = addInstructions(0.30, 'V: View the Depth-Texture results') - self.inst_x = addInstructions(0.36, 'Left/Right Arrow : switch camera angles') - self.inst_a = addInstructions(0.42, 'Something about A/Z and push bias') + self.inst_v = addInstructions(0.30, 'V : View the Depth-Texture results') + self.inst_u = addInstructions(0.36, 'U : toggle updating the shadow map') + self.inst_x = addInstructions(0.42, 'Left/Right Arrow : switch camera angles') + self.inst_a = addInstructions(0.48, 'Something about A/Z and push bias') base.setBackgroundColor(0, 0, 0.2, 1) @@ -120,20 +122,14 @@ class World(DirectObject): self.accept("arrow_left", self.incrementCameraPosition, [-1]) self.accept("arrow_right", self.incrementCameraPosition, [1]) self.accept("p", self.toggleInterval, [self.pandaMovement]) - self.accept("P", self.toggleInterval, [self.pandaMovement]) self.accept("t", self.toggleInterval, [self.teapotMovement]) - self.accept("T", self.toggleInterval, [self.teapotMovement]) self.accept("w", self.toggleInterval, [self.pandaWalk]) - self.accept("W", self.toggleInterval, [self.pandaWalk]) self.accept("v", base.bufferViewer.toggleEnable) - self.accept("V", base.bufferViewer.toggleEnable) + self.accept("u", self.toggleUpdateShadowMap) self.accept("l", self.incrementLightPosition, [1]) - self.accept("L", self.incrementLightPosition, [1]) self.accept("o", base.oobe) self.accept('a', self.adjustPushBias, [1.1]) - self.accept('A', self.adjustPushBias, [1.1]) self.accept('z', self.adjustPushBias, [0.9]) - self.accept('Z', self.adjustPushBias, [0.9]) self.LCam = base.makeCamera(LBuffer) self.LCam.node().setScene(render) @@ -180,6 +176,9 @@ class World(DirectObject): else: ival.resume() + def toggleUpdateShadowMap(self): + self.buffer.active = not self.buffer.active + def incrementCameraPosition(self, n): self.cameraSelection = (self.cameraSelection + n) % 6 if (self.cameraSelection == 0): diff --git a/samples/shadows/basic.py b/samples/shadows/basic.py index 95de1198a2..843b9b9b27 100755 --- a/samples/shadows/basic.py +++ b/samples/shadows/basic.py @@ -42,8 +42,9 @@ class World(DirectObject): self.inst_w = addInstructions(0.12, 'W : stop/start the Walk Cycle') self.inst_t = addInstructions(0.18, 'T : stop/start the Teapot') self.inst_l = addInstructions(0.24, 'L : move light source far or close') - self.inst_v = addInstructions(0.30, 'V: View the Depth-Texture results') - self.inst_x = addInstructions(0.36, 'Left/Right Arrow : switch camera angles') + self.inst_v = addInstructions(0.30, 'V : View the Depth-Texture results') + self.inst_u = addInstructions(0.36, 'U : toggle updating the shadow map') + self.inst_x = addInstructions(0.42, 'Left/Right Arrow : switch camera angles') base.setBackgroundColor(0, 0, 0.2, 1) @@ -88,15 +89,11 @@ class World(DirectObject): self.accept("arrow_left", self.incrementCameraPosition, [-1]) self.accept("arrow_right", self.incrementCameraPosition, [1]) self.accept("p", self.toggleInterval, [self.pandaMovement]) - self.accept("P", self.toggleInterval, [self.pandaMovement]) self.accept("t", self.toggleInterval, [self.teapotMovement]) - self.accept("T", self.toggleInterval, [self.teapotMovement]) self.accept("w", self.toggleInterval, [self.pandaWalk]) - self.accept("W", self.toggleInterval, [self.pandaWalk]) self.accept("v", base.bufferViewer.toggleEnable) - self.accept("V", base.bufferViewer.toggleEnable) + self.accept("u", self.toggleUpdateShadowMap) self.accept("l", self.incrementLightPosition, [1]) - self.accept("L", self.incrementLightPosition, [1]) self.accept("o", base.oobe) self.light = render.attachNewNode(Spotlight("Spot")) @@ -127,6 +124,10 @@ class World(DirectObject): else: ival.resume() + def toggleUpdateShadowMap(self): + buffer = self.light.node().getShadowBuffer(base.win.gsg) + buffer.active = not buffer.active + def incrementCameraPosition(self, n): self.cameraSelection = (self.cameraSelection + n) % 6 if (self.cameraSelection == 0): From 67998eaec2c2fd2e406201e625fc04ed70824c89 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 27 Aug 2016 19:23:18 +0200 Subject: [PATCH 033/112] Buffer viewer should override texture filter settings; fixes filtered shadow maps and edge bleeding --- direct/src/showbase/BufferViewer.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/direct/src/showbase/BufferViewer.py b/direct/src/showbase/BufferViewer.py index b1a2f39593..c2a7f86049 100644 --- a/direct/src/showbase/BufferViewer.py +++ b/direct/src/showbase/BufferViewer.py @@ -278,6 +278,15 @@ class BufferViewer(DirectObject): self.analyzeTextureSet(self.exclude, exclude) self.analyzeTextureSet(self.include, include) + # Use a custom sampler when applying the textures. This fixes + # wrap issues and prevents depth compare on shadow maps. + sampler = SamplerState() + sampler.setWrapU(SamplerState.WM_clamp) + sampler.setWrapV(SamplerState.WM_clamp) + sampler.setWrapW(SamplerState.WM_clamp) + sampler.setMinfilter(SamplerState.FT_linear) + sampler.setMagfilter(SamplerState.FT_nearest) + # Generate a list of cards and the corresponding windows. cards = [] wins = [] @@ -290,7 +299,7 @@ class BufferViewer(DirectObject): for face in range(6): self.cardmaker.setUvRangeCube(face) card = NodePath(self.cardmaker.generate()) - card.setTexture(tex) + card.setTexture(tex, sampler) cards.append(card) elif (tex.getTextureType() == Texture.TT2dTextureArray): for layer in range(tex.getZSize()): @@ -301,11 +310,11 @@ class BufferViewer(DirectObject): # the fixed-function pipeline, so we need to # enable the shader generator to view them. card.setShaderAuto() - card.setTexture(tex) + card.setTexture(tex, sampler) cards.append(card) else: card = win.getTextureCard() - card.setTexture(tex) + card.setTexture(tex, sampler) cards.append(card) wins.append(win) exclude[tex] = 1 From 4ec5b776786877581402d6d9bd5f441fca9be538 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 27 Aug 2016 20:11:18 +0200 Subject: [PATCH 034/112] Fix error with async flatten --- direct/src/showbase/Loader.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/direct/src/showbase/Loader.py b/direct/src/showbase/Loader.py index bd94f51cf2..b22de7400b 100644 --- a/direct/src/showbase/Loader.py +++ b/direct/src/showbase/Loader.py @@ -892,9 +892,8 @@ class Loader(DirectObject): for model in modelList: request = ModelFlattenRequest(model.node()) request.setDoneEvent(self.hook) - request.setPythonObject((cb, i)) self.loader.loadAsync(request) - cb.requests[request] = True + cb.requests.add(request) self.__requests[request] = (cb, i) i += 1 return cb From a9345ad6337780687c59e0b68ae4b28a4eb3735b Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 29 Aug 2016 02:08:08 +0200 Subject: [PATCH 035/112] Fix bug: bam2egg ignores non-GeomNodes directly under Character node This result in some animated models only properly exporting the skeleton without geometry if the geometry is under non-GeomNodes. Fixes LP https://bugs.launchpad.net/panda3d/+bug/1617834 --- panda/src/egg2pg/eggSaver.cxx | 90 ++++++++++++++++------------------- panda/src/egg2pg/eggSaver.h | 16 ++++--- 2 files changed, 52 insertions(+), 54 deletions(-) diff --git a/panda/src/egg2pg/eggSaver.cxx b/panda/src/egg2pg/eggSaver.cxx index 6767d5c287..652bb0ea97 100644 --- a/panda/src/egg2pg/eggSaver.cxx +++ b/panda/src/egg2pg/eggSaver.cxx @@ -92,7 +92,7 @@ add_node(PandaNode *node) { _data->add_child(_vpool); NodePath root(node); - convert_node(WorkingNodePath(root), _data, false); + convert_node(WorkingNodePath(root), _data, false, NULL); // Remove the vertex pool if it has no vertices. if (_vpool->empty()) { @@ -107,22 +107,22 @@ add_node(PandaNode *node) { */ void EggSaver:: convert_node(const WorkingNodePath &node_path, EggGroupNode *egg_parent, - bool has_decal) { + bool has_decal, CharacterJointMap *joint_map) { PandaNode *node = node_path.node(); if (node->is_geom_node()) { - convert_geom_node(DCAST(GeomNode, node), node_path, egg_parent, has_decal); + convert_geom_node(DCAST(GeomNode, node), node_path, egg_parent, has_decal, joint_map); } else if (node->is_of_type(LODNode::get_class_type())) { - convert_lod_node(DCAST(LODNode, node), node_path, egg_parent, has_decal); + convert_lod_node(DCAST(LODNode, node), node_path, egg_parent, has_decal, joint_map); } else if (node->is_of_type(SequenceNode::get_class_type())) { - convert_sequence_node(DCAST(SequenceNode, node), node_path, egg_parent, has_decal); + convert_sequence_node(DCAST(SequenceNode, node), node_path, egg_parent, has_decal, joint_map); } else if (node->is_of_type(SwitchNode::get_class_type())) { - convert_switch_node(DCAST(SwitchNode, node), node_path, egg_parent, has_decal); + convert_switch_node(DCAST(SwitchNode, node), node_path, egg_parent, has_decal, joint_map); } else if (node->is_of_type(CollisionNode::get_class_type())) { - convert_collision_node(DCAST(CollisionNode, node), node_path, egg_parent, has_decal); + convert_collision_node(DCAST(CollisionNode, node), node_path, egg_parent, has_decal, joint_map); } else if (node->is_of_type(AnimBundleNode::get_class_type())) { convert_anim_node(DCAST(AnimBundleNode, node), node_path, egg_parent, has_decal); @@ -136,7 +136,7 @@ convert_node(const WorkingNodePath &node_path, EggGroupNode *egg_parent, egg_parent->add_child(egg_group); apply_node_properties(egg_group, node); - recurse_nodes(node_path, egg_group, has_decal); + recurse_nodes(node_path, egg_group, has_decal, joint_map); } } @@ -145,7 +145,8 @@ convert_node(const WorkingNodePath &node_path, EggGroupNode *egg_parent, */ void EggSaver:: convert_lod_node(LODNode *node, const WorkingNodePath &node_path, - EggGroupNode *egg_parent, bool has_decal) { + EggGroupNode *egg_parent, bool has_decal, + CharacterJointMap *joint_map) { // An LOD node gets converted to an ordinary EggGroup, but we apply the // appropriate switch conditions to each of our children. EggGroup *egg_group = new EggGroup(node->get_name()); @@ -162,7 +163,7 @@ convert_lod_node(LODNode *node, const WorkingNodePath &node_path, // Convert just this one node to an EggGroup. PT(EggGroup) next_group = new EggGroup; - convert_node(WorkingNodePath(node_path, child), next_group, has_decal); + convert_node(WorkingNodePath(node_path, child), next_group, has_decal, joint_map); if (next_group->size() == 1) { // If we have exactly one child, and that child is an EggGroup, @@ -190,7 +191,8 @@ convert_lod_node(LODNode *node, const WorkingNodePath &node_path, */ void EggSaver:: convert_sequence_node(SequenceNode *node, const WorkingNodePath &node_path, - EggGroupNode *egg_parent, bool has_decal) { + EggGroupNode *egg_parent, bool has_decal, + CharacterJointMap *joint_map) { // A sequence node gets converted to an ordinary EggGroup, we only apply the // appropriate switch attributes to turn it into a sequence EggGroup *egg_group = new EggGroup(node->get_name()); @@ -208,7 +210,7 @@ convert_sequence_node(SequenceNode *node, const WorkingNodePath &node_path, // Convert just this one node to an EggGroup. PT(EggGroup) next_group = new EggGroup; - convert_node(WorkingNodePath(node_path, child), next_group, has_decal); + convert_node(WorkingNodePath(node_path, child), next_group, has_decal, joint_map); egg_group->add_child(next_group.p()); } @@ -220,7 +222,8 @@ convert_sequence_node(SequenceNode *node, const WorkingNodePath &node_path, */ void EggSaver:: convert_switch_node(SwitchNode *node, const WorkingNodePath &node_path, - EggGroupNode *egg_parent, bool has_decal) { + EggGroupNode *egg_parent, bool has_decal, + CharacterJointMap *joint_map) { // A sequence node gets converted to an ordinary EggGroup, we only apply the // appropriate switch attributes to turn it into a sequence EggGroup *egg_group = new EggGroup(node->get_name()); @@ -237,7 +240,7 @@ convert_switch_node(SwitchNode *node, const WorkingNodePath &node_path, // Convert just this one node to an EggGroup. PT(EggGroup) next_group = new EggGroup; - convert_node(WorkingNodePath(node_path, child), next_group, has_decal); + convert_node(WorkingNodePath(node_path, child), next_group, has_decal, joint_map); egg_group->add_child(next_group.p()); } @@ -314,7 +317,7 @@ convert_anim_node(AnimBundleNode *node, const WorkingNodePath &node_path, * structure. */ void EggSaver:: -convert_character_bundle(PartGroup *bundleNode, EggGroupNode *egg_parent, CharacterJointMap *jointMap) { +convert_character_bundle(PartGroup *bundleNode, EggGroupNode *egg_parent, CharacterJointMap *joint_map) { int num_children = bundleNode->get_num_children(); EggGroupNode *joint_group = egg_parent; @@ -329,9 +332,9 @@ convert_character_bundle(PartGroup *bundleNode, EggGroupNode *egg_parent, Charac joint->set_group_type(EggGroup::GT_joint); joint_group = joint; egg_parent->add_child(joint_group); - if (jointMap!=NULL) { - CharacterJointMap::iterator mi = jointMap->find(character_joint); - if (mi != jointMap->end()) { + if (joint_map != NULL) { + CharacterJointMap::iterator mi = joint_map->find(character_joint); + if (mi != joint_map->end()) { pvector > &joint_vertices = (*mi).second; pvector >::const_iterator vi; for (vi = joint_vertices.begin(); vi != joint_vertices.end(); ++vi) { @@ -343,7 +346,7 @@ convert_character_bundle(PartGroup *bundleNode, EggGroupNode *egg_parent, Charac for (int i = 0; i < num_children ; i++) { PartGroup *partGroup= bundleNode->get_child(i); - convert_character_bundle(partGroup, joint_group, jointMap); + convert_character_bundle(partGroup, joint_group, joint_map); } } @@ -353,7 +356,7 @@ convert_character_bundle(PartGroup *bundleNode, EggGroupNode *egg_parent, Charac */ void EggSaver:: convert_character_node(Character *node, const WorkingNodePath &node_path, - EggGroupNode *egg_parent, bool has_decal) { + EggGroupNode *egg_parent, bool has_decal) { // A sequence node gets converted to an ordinary EggGroup, we only apply the // appropriate switch attributes to turn it into a sequence @@ -362,26 +365,16 @@ convert_character_node(Character *node, const WorkingNodePath &node_path, egg_parent->add_child(egg_group); apply_node_properties(egg_group, node); - CharacterJointMap jointMap; + CharacterJointMap joint_map; + recurse_nodes(node_path, egg_group, has_decal, &joint_map); // turn it into a switch.. egg_group->set_switch_flag(true); - int num_children = node->get_num_children(); int num_bundles = node->get_num_bundles(); - - for (int i = 0; i < num_children; i++) { - PandaNode *child = node->get_child(i); - - if (child->is_geom_node()) { - convert_geom_node(DCAST(GeomNode, child), WorkingNodePath(node_path, child), egg_group, has_decal, &jointMap); - } + for (int i = 0; i < num_bundles; ++i) { + PartBundle *bundle = node->get_bundle(i); + convert_character_bundle(bundle, egg_group, &joint_map); } - - for (int i = 0; i < num_bundles ; i++) { - PartBundle *bundle= node->get_bundle(i); - convert_character_bundle(bundle, egg_group, &jointMap); - } - } @@ -390,7 +383,8 @@ convert_character_node(Character *node, const WorkingNodePath &node_path, */ void EggSaver:: convert_collision_node(CollisionNode *node, const WorkingNodePath &node_path, - EggGroupNode *egg_parent, bool has_decal) { + EggGroupNode *egg_parent, bool has_decal, + CharacterJointMap *joint_map) { // A sequence node gets converted to an ordinary EggGroup, we only apply the // appropriate switch attributes to turn it into a sequence EggGroup *egg_group = new EggGroup(node->get_name()); @@ -510,7 +504,7 @@ convert_collision_node(CollisionNode *node, const WorkingNodePath &node_path, } // recurse over children - hm. do I need to do this? - recurse_nodes(node_path, egg_group, has_decal); + recurse_nodes(node_path, egg_group, has_decal, joint_map); } /** @@ -518,7 +512,7 @@ convert_collision_node(CollisionNode *node, const WorkingNodePath &node_path, */ void EggSaver:: convert_geom_node(GeomNode *node, const WorkingNodePath &node_path, - EggGroupNode *egg_parent, bool has_decal, CharacterJointMap *jointMap) { + EggGroupNode *egg_parent, bool has_decal, CharacterJointMap *joint_map) { PT(EggGroup) egg_group = new EggGroup(node->get_name()); bool fancy_attributes = apply_node_properties(egg_group, node); @@ -558,11 +552,11 @@ convert_geom_node(GeomNode *node, const WorkingNodePath &node_path, CPT(GeomVertexData) vdata = geom->get_vertex_data(); // vdata = vdata->animate_vertices(true, Thread::get_current_thread()); convert_primitive(vdata, simple, geom_state, - net_mat, egg_parent, jointMap); + net_mat, egg_parent, joint_map); } } - recurse_nodes(node_path, egg_parent, has_decal); + recurse_nodes(node_path, egg_parent, has_decal, joint_map); } /** @@ -573,7 +567,7 @@ convert_primitive(const GeomVertexData *vertex_data, const GeomPrimitive *primitive, const RenderState *net_state, const LMatrix4 &net_mat, EggGroupNode *egg_parent, - CharacterJointMap *jointMap) { + CharacterJointMap *joint_map) { GeomVertexReader reader(vertex_data); // Check for a color scale. @@ -811,8 +805,8 @@ convert_primitive(const GeomVertexData *vertex_data, EggVertex *new_egg_vert = _vpool->create_unique_vertex(egg_vert); - if ((vertex_data->has_column(InternalName::get_transform_blend())) && - (jointMap!=NULL) && (transformBlendTable!=NULL)) { + if (vertex_data->has_column(InternalName::get_transform_blend()) && + joint_map != NULL && transformBlendTable != NULL) { reader.set_column(InternalName::get_transform_blend()); int idx = reader.get_data1i(); const TransformBlend &blend = transformBlendTable->get_blend(idx); @@ -824,9 +818,9 @@ convert_primitive(const GeomVertexData *vertex_data, if (vertex_transform->is_of_type(JointVertexTransform::get_class_type())) { const JointVertexTransform *joint_vertex_transform = DCAST(const JointVertexTransform, vertex_transform); - CharacterJointMap::iterator mi = jointMap->find(joint_vertex_transform->get_joint()); - if (mi == jointMap->end()) { - mi = jointMap->insert(CharacterJointMap::value_type(joint_vertex_transform->get_joint(), pvector >())).first; + CharacterJointMap::iterator mi = joint_map->find(joint_vertex_transform->get_joint()); + if (mi == joint_map->end()) { + mi = joint_map->insert(CharacterJointMap::value_type(joint_vertex_transform->get_joint(), pvector >())).first; } pvector > &joint_vertices = (*mi).second; joint_vertices.push_back(pair(new_egg_vert, weight)); @@ -845,13 +839,13 @@ convert_primitive(const GeomVertexData *vertex_data, */ void EggSaver:: recurse_nodes(const WorkingNodePath &node_path, EggGroupNode *egg_parent, - bool has_decal) { + bool has_decal, CharacterJointMap *joint_map) { PandaNode *node = node_path.node(); int num_children = node->get_num_children(); for (int i = 0; i < num_children; i++) { PandaNode *child = node->get_child(i); - convert_node(WorkingNodePath(node_path, child), egg_parent, has_decal); + convert_node(WorkingNodePath(node_path, child), egg_parent, has_decal, joint_map); } } diff --git a/panda/src/egg2pg/eggSaver.h b/panda/src/egg2pg/eggSaver.h index 0944f0a4eb..170e5fe46c 100644 --- a/panda/src/egg2pg/eggSaver.h +++ b/panda/src/egg2pg/eggSaver.h @@ -61,13 +61,16 @@ private: typedef pmap > > CharacterJointMap; void convert_node(const WorkingNodePath &node_path, EggGroupNode *egg_parent, - bool has_decal); + bool has_decal, CharacterJointMap *joint_map); void convert_lod_node(LODNode *node, const WorkingNodePath &node_path, - EggGroupNode *egg_parent, bool has_decal); + EggGroupNode *egg_parent, bool has_decal, + CharacterJointMap *joint_map); void convert_sequence_node(SequenceNode *node, const WorkingNodePath &node_path, - EggGroupNode *egg_parent, bool has_decal); + EggGroupNode *egg_parent, bool has_decal, + CharacterJointMap *joint_map); void convert_switch_node(SwitchNode *node, const WorkingNodePath &node_path, - EggGroupNode *egg_parent, bool has_decal); + EggGroupNode *egg_parent, bool has_decal, + CharacterJointMap *joint_map); EggGroupNode *convert_animGroup_node(AnimGroup *animGroup, double fps ); void convert_anim_node(AnimBundleNode *node, const WorkingNodePath &node_path, EggGroupNode *egg_parent, bool has_decal); @@ -75,7 +78,8 @@ private: EggGroupNode *egg_parent, bool has_decal); void convert_character_bundle(PartGroup *bundleNode, EggGroupNode *egg_parent, CharacterJointMap *jointMap); void convert_collision_node(CollisionNode *node, const WorkingNodePath &node_path, - EggGroupNode *egg_parent, bool has_decal); + EggGroupNode *egg_parent, bool has_decal, + CharacterJointMap *joint_map); void convert_geom_node(GeomNode *node, const WorkingNodePath &node_path, EggGroupNode *egg_parent, bool has_decal, CharacterJointMap *jointMap=NULL); void convert_primitive(const GeomVertexData *vertex_data, @@ -85,7 +89,7 @@ private: CharacterJointMap *jointMap); void recurse_nodes(const WorkingNodePath &node_path, EggGroupNode *egg_parent, - bool has_decal); + bool has_decal, CharacterJointMap *joint_map); bool apply_node_properties(EggGroup *egg_group, PandaNode *node, bool allow_backstage = true); bool apply_tags(EggGroup *egg_group, PandaNode *node); bool apply_tag(EggGroup *egg_group, PandaNode *node, const string &tag); From fb6637ddacfc102e890dd0c591662b0d155d6675 Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 29 Aug 2016 16:43:13 -0700 Subject: [PATCH 036/112] expand PfmFile::merge() to support other than 3 channels, and not to fuss about NaN's in the result --- panda/src/pnmimage/pfmFile.cxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/panda/src/pnmimage/pfmFile.cxx b/panda/src/pnmimage/pfmFile.cxx index 75bb06682f..214c028dd7 100644 --- a/panda/src/pnmimage/pfmFile.cxx +++ b/panda/src/pnmimage/pfmFile.cxx @@ -1449,17 +1449,20 @@ apply_1d_lut(int channel, const PfmFile &lut, PN_float32 x_scale) { void PfmFile:: merge(const PfmFile &other) { nassertv(is_valid() && other.is_valid()); - nassertv(other._x_size == _x_size && other._y_size == _y_size); + nassertv(other._x_size == _x_size && other._y_size == _y_size && other._num_channels == _num_channels); if (!_has_no_data_value) { // Trivial no-op. return; } - for (int yi = 0; yi < _y_size; ++yi) { - for (int xi = 0; xi < _x_size; ++xi) { - if (!has_point(xi, yi) && other.has_point(xi, yi)) { - set_point(xi, yi, other.get_point(xi, yi)); + size_t point_size = _num_channels * sizeof(PN_float32); + for (int y = 0; y < _y_size; ++y) { + for (int x = 0; x < _x_size; ++x) { + if (!has_point(x, y) && other.has_point(x, y)) { + memcpy(&_table[(y * _x_size + x) * _num_channels], + &other._table[(y * _x_size + x) * _num_channels], + point_size); } } } From a8d24ac28a4ff29710907e2ee90af97bc13c4211 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 2 Sep 2016 16:12:09 +0200 Subject: [PATCH 037/112] Better and more robust location checking for Windows 10 SDK Closes: #120 --- makepanda/makepandacore.py | 56 +++++++++++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 4 deletions(-) diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index 9321a79060..29ecf9f06d 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -2051,9 +2051,56 @@ def SdkLocateWindows(version = '7.1'): version = version.upper() if version == '10': + version = '10.0' + + if version.startswith('10.') and version.count('.') == 1: + # Choose the latest version of the Windows 10 SDK. platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", "KitsRoot10") + + if platsdk and os.path.isdir(platsdk): + incdirs = glob.glob(os.path.join(platsdk, 'Include', version + '.*.*')) + max_version = () + for dir in incdirs: + verstring = os.path.basename(dir) + + # Check that the important include directories exist. + if not os.path.isdir(os.path.join(dir, 'ucrt')): + continue + if not os.path.isdir(os.path.join(dir, 'shared')): + continue + if not os.path.isdir(os.path.join(dir, 'um')): + continue + if not os.path.isdir(os.path.join(platsdk, 'Lib', verstring, 'ucrt')): + continue + if not os.path.isdir(os.path.join(platsdk, 'Lib', verstring, 'um')): + continue + + print(verstring) + vertuple = tuple(map(int, verstring.split('.'))) + if vertuple > max_version: + version = verstring + max_version = vertuple + + if not max_version: + # No suitable version found. + platsdk = None + + elif version.startswith('10.'): + # We chose a specific version of the Windows 10 SDK. Verify it exists. + platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", "KitsRoot10") + + if version.count('.') == 2: + version += '.0' + + if platsdk and not os.path.isdir(os.path.join(platsdk, 'Include', version)): + platsdk = None + + elif version == '8.1': + platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", "KitsRoot81") + elif version == '8.0': platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", "KitsRoot") + else: platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v" + version, "InstallationFolder") @@ -2320,12 +2367,13 @@ def SetupVisualStudioEnviron(): AddToPathEnv("LIB", SDK["VISUALSTUDIO"] + "VC\\lib\\" + libdir) AddToPathEnv("LIB", SDK["VISUALSTUDIO"] + "VC\\atlmfc\\lib\\" + libdir) - if SDK["MSPLATFORM_VERSION"] == '10': + winsdk_ver = SDK["MSPLATFORM_VERSION"] + if winsdk_ver.startswith('10.'): AddToPathEnv("PATH", SDK["MSPLATFORM"] + "bin\\" + arch) # Windows Kit 10 introduces the "universal CRT". - inc_dir = SDK["MSPLATFORM"] + "Include\\10.0.10586.0\\" - lib_dir = SDK["MSPLATFORM"] + "Lib\\10.0.10586.0\\" + inc_dir = SDK["MSPLATFORM"] + "Include\\" + winsdk_ver + "\\" + lib_dir = SDK["MSPLATFORM"] + "Lib\\" + winsdk_ver + "\\" AddToPathEnv("INCLUDE", inc_dir + "shared") AddToPathEnv("INCLUDE", inc_dir + "ucrt") AddToPathEnv("INCLUDE", inc_dir + "um") @@ -2353,7 +2401,7 @@ def SetupVisualStudioEnviron(): # Targeting the 7.1 SDK (which is the only way to have Windows XP support) # with Visual Studio 2015 requires use of the Universal CRT. - if SDK["MSPLATFORM_VERSION"] == '7.1' and SDK["VISUALSTUDIO_VERSION"] == '14.0': + if winsdk_ver == '7.1' and SDK["VISUALSTUDIO_VERSION"] == '14.0': win_kit = GetRegistryKey("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", "KitsRoot10") AddToPathEnv("LIB", win_kit + "Lib\\10.0.10150.0\\ucrt\\" + arch) AddToPathEnv("INCLUDE", win_kit + "Include\\10.0.10150.0\\ucrt") From abb6ee0542b24da8dc9147e2bb55022873c4122d Mon Sep 17 00:00:00 2001 From: deflected Date: Thu, 8 Sep 2016 21:30:42 +0300 Subject: [PATCH 038/112] gobj: Fixed wrong texture pool key for 2D texture arrays - 2D texture arrays are added to internal storage with specific unique name, so keep it as texture pool key instead of filename. --- panda/src/gobj/texturePool.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/gobj/texturePool.cxx b/panda/src/gobj/texturePool.cxx index 4377767089..987e1947b5 100644 --- a/panda/src/gobj/texturePool.cxx +++ b/panda/src/gobj/texturePool.cxx @@ -772,7 +772,7 @@ ns_load_cube_map(const Filename &filename_pattern, bool read_mipmaps, nassertr(tex != (Texture *)NULL, NULL); tex->set_filename(filename_pattern); tex->set_fullpath(filename); - tex->_texture_pool_key = filename; + tex->_texture_pool_key = unique_filename; { MutexHolder holder(_lock); From 25cfec3760e1839eaff1877af4410e1e4b58df75 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 8 Sep 2016 22:09:45 +0200 Subject: [PATCH 039/112] Pass Ctrl+C on to child process when running panda3d from cmd-line --- direct/src/plugin/p3dInstanceManager.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/direct/src/plugin/p3dInstanceManager.cxx b/direct/src/plugin/p3dInstanceManager.cxx index fa8c70def2..7e67aeb945 100644 --- a/direct/src/plugin/p3dInstanceManager.cxx +++ b/direct/src/plugin/p3dInstanceManager.cxx @@ -1528,6 +1528,17 @@ create_runtime_environment() { } } +#ifndef _WIN32 + // If we're running from the console, make sure that terminating the parent + // process will cause the child process to terminate as well. + if (_console_environment) { + struct sigaction ignore; + memset(&ignore, 0, sizeof(ignore)); + ignore.sa_handler = SIG_IGN; + sigaction(SIGINT, &ignore, NULL); + } +#endif + _created_runtime_environment = true; } From 206d361f49d3d46dc6e35db73816a6b9184e2d6c Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 8 Sep 2016 22:14:44 +0200 Subject: [PATCH 040/112] Support for CollisionBox, InvSphere and Tube in bam2egg --- panda/src/egg2pg/eggSaver.cxx | 81 ++++++++++++++++++++++++++++++++--- 1 file changed, 75 insertions(+), 6 deletions(-) diff --git a/panda/src/egg2pg/eggSaver.cxx b/panda/src/egg2pg/eggSaver.cxx index ba4ee35d7f..99a36c50a7 100644 --- a/panda/src/egg2pg/eggSaver.cxx +++ b/panda/src/egg2pg/eggSaver.cxx @@ -479,7 +479,12 @@ convert_collision_node(CollisionNode *node, const WorkingNodePath &node_path, egg_sphere->set_collide_flags(EggGroup::CF_descend); egg_group->add_child(egg_sphere); } - egg_sphere->set_cs_type(EggGroup::CST_sphere); + + if (child->is_of_type(CollisionInvSphere::get_class_type())) { + egg_sphere->set_cs_type(EggGroup::CST_inv_sphere); + } else { + egg_sphere->set_cs_type(EggGroup::CST_sphere); + } EggVertex ev1, ev2; ev1.set_pos(LCAST(double, (center + offset) * net_mat)); @@ -531,13 +536,77 @@ convert_collision_node(CollisionNode *node, const WorkingNodePath &node_path, egg_poly->add_vertex(cvpool->create_unique_vertex(ev2)); } else if (child->is_of_type(CollisionBox::get_class_type())) { - nout << "Encountered unhandled collsion type: CollisionBox" << "\n"; - } else if (child->is_of_type(CollisionInvSphere::get_class_type())) { - nout << "Encountered unhandled collsion type: CollisionInvSphere" << "\n"; + CPT(CollisionBox) box = DCAST(CollisionBox, child); + LPoint3 min_point = box->get_min(); + LPoint3 max_point = box->get_max(); + + EggGroup *egg_box; + if (num_solids == 1) { + egg_box = egg_group; + } else { + egg_box = new EggGroup; + egg_box->set_collide_flags(EggGroup::CF_descend); + egg_group->add_child(egg_box); + } + egg_box->set_cs_type(EggGroup::CST_box); + + // Just add the min and max points. + EggVertex ev0, ev1; + ev0.set_pos(LCAST(double, min_point * net_mat)); + ev1.set_pos(LCAST(double, max_point * net_mat)); + + EggLine *egg_poly = new EggLine; + egg_box->add_child(egg_poly); + + egg_poly->add_vertex(cvpool->create_unique_vertex(ev0)); + egg_poly->add_vertex(cvpool->create_unique_vertex(ev1)); + } else if (child->is_of_type(CollisionTube::get_class_type())) { - nout << "Encountered unhandled collsion type: CollisionTube" << "\n"; + CPT(CollisionTube) tube = DCAST(CollisionTube, child); + LPoint3 point_a = tube->get_point_a(); + LPoint3 point_b = tube->get_point_b(); + LPoint3 centroid = (point_a + point_b) * 0.5f; + + // Also get an arbitrary vector perpendicular to the tube. + LVector3 axis = point_b - point_a; + LVector3 sideways; + if (abs(axis[2]) > abs(axis[1])) { + sideways = axis.cross(LVector3(0, 1, 0)); + } else { + sideways = axis.cross(LVector3(0, 0, 1)); + } + sideways.normalize(); + sideways *= tube->get_radius(); + LVector3 extend = axis.normalized() * tube->get_radius(); + + EggGroup *egg_tube; + if (num_solids == 1) { + egg_tube = egg_group; + } else { + egg_tube = new EggGroup; + egg_tube->set_collide_flags(EggGroup::CF_descend); + egg_group->add_child(egg_tube); + } + egg_tube->set_cs_type(EggGroup::CST_tube); + + // Add two points for the endcaps, and then two points around the + // centroid to indicate the radius. + EggVertex ev0, ev1, ev2, ev3; + ev0.set_pos(LCAST(double, (point_a - extend) * net_mat)); + ev1.set_pos(LCAST(double, (centroid + sideways) * net_mat)); + ev2.set_pos(LCAST(double, (point_b + extend) * net_mat)); + ev3.set_pos(LCAST(double, (centroid - sideways) * net_mat)); + + EggPolygon *egg_poly = new EggPolygon; + egg_tube->add_child(egg_poly); + + egg_poly->add_vertex(cvpool->create_unique_vertex(ev0)); + egg_poly->add_vertex(cvpool->create_unique_vertex(ev1)); + egg_poly->add_vertex(cvpool->create_unique_vertex(ev2)); + egg_poly->add_vertex(cvpool->create_unique_vertex(ev3)); + } else { - nout << "Encountered unknown CollisionSolid" << "\n"; + nout << "Encountered unknown collision solid type " << child->get_type() << "\n"; } } } From b74905ca9cfa5d7194aadca9e3d63adb90b7769d Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 8 Sep 2016 22:16:50 +0200 Subject: [PATCH 041/112] Add to ReleaseNotes --- doc/ReleaseNotes | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index 04fa87010d..f3bebcc191 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -29,6 +29,9 @@ This issue fixes several bugs that were still found in 1.9.2. * Fix race condition reading string config var * Fix interrogate parsing issue with "const static" * Add back missing libp3pystub.a to Mac OS X SDK +* Fix RAM caching of 2D texture arrays +* Fix Ctrl+C interrupt propagation to runtime applications +* Support for InvSphere, Box and Tube solids in bam2egg ------------------------ RELEASE 1.9.2 ------------------------ From 4d8a9aa3a149651303c2fe9354f0dec578d354a4 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 8 Sep 2016 22:27:25 +0200 Subject: [PATCH 042/112] Fix automerge failure --- panda/src/gobj/texturePool.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/panda/src/gobj/texturePool.cxx b/panda/src/gobj/texturePool.cxx index 987e1947b5..e1e5e47faa 100644 --- a/panda/src/gobj/texturePool.cxx +++ b/panda/src/gobj/texturePool.cxx @@ -671,7 +671,7 @@ ns_load_2d_texture_array(const Filename &filename_pattern, nassertr(tex != (Texture *)NULL, NULL); tex->set_filename(filename_pattern); tex->set_fullpath(filename); - tex->_texture_pool_key = filename; + tex->_texture_pool_key = unique_filename; { MutexHolder holder(_lock); @@ -772,7 +772,7 @@ ns_load_cube_map(const Filename &filename_pattern, bool read_mipmaps, nassertr(tex != (Texture *)NULL, NULL); tex->set_filename(filename_pattern); tex->set_fullpath(filename); - tex->_texture_pool_key = unique_filename; + tex->_texture_pool_key = filename; { MutexHolder holder(_lock); From 558f84a95f3baa8f2123fe2468dc7912cbedf04b Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 8 Sep 2016 22:52:57 +0200 Subject: [PATCH 043/112] Backport normalized() method to 1.9 branch --- doc/ReleaseNotes | 1 + panda/src/linmath/lpoint2_src.I | 12 ++++++++++++ panda/src/linmath/lpoint2_src.h | 1 + panda/src/linmath/lpoint3_src.I | 12 ++++++++++++ panda/src/linmath/lpoint3_src.h | 1 + panda/src/linmath/lpoint4_src.I | 13 +++++++++++++ panda/src/linmath/lpoint4_src.h | 1 + panda/src/linmath/lvecBase2_src.I | 16 ++++++++++++++++ panda/src/linmath/lvecBase2_src.h | 1 + panda/src/linmath/lvecBase3_src.I | 16 ++++++++++++++++ panda/src/linmath/lvecBase3_src.h | 1 + panda/src/linmath/lvecBase4_src.I | 16 ++++++++++++++++ panda/src/linmath/lvecBase4_src.h | 1 + panda/src/linmath/lvector2_src.I | 12 ++++++++++++ panda/src/linmath/lvector2_src.h | 1 + panda/src/linmath/lvector3_src.I | 13 +++++++++++++ panda/src/linmath/lvector3_src.h | 1 + panda/src/linmath/lvector4_src.I | 13 +++++++++++++ panda/src/linmath/lvector4_src.h | 1 + 19 files changed, 133 insertions(+) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index f3bebcc191..6320ff52a8 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -32,6 +32,7 @@ This issue fixes several bugs that were still found in 1.9.2. * Fix RAM caching of 2D texture arrays * Fix Ctrl+C interrupt propagation to runtime applications * Support for InvSphere, Box and Tube solids in bam2egg +* Add normalized() method to vectors ------------------------ RELEASE 1.9.2 ------------------------ diff --git a/panda/src/linmath/lpoint2_src.I b/panda/src/linmath/lpoint2_src.I index a3f27084f6..ef38d96a96 100644 --- a/panda/src/linmath/lpoint2_src.I +++ b/panda/src/linmath/lpoint2_src.I @@ -186,6 +186,18 @@ operator / (FLOATTYPE scalar) const { } #ifndef FLOATTYPE_IS_INT +//////////////////////////////////////////////////////////////////// +// Function: LPoint2::normalized +// Access: Published +// Description: Normalizes the vector and returns the normalized +// vector as a copy. If the vector was a zero-length +// vector, a zero length vector will be returned. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATNAME(LPoint2) FLOATNAME(LPoint2):: +normalized() const { + return FLOATNAME(LVecBase2)::normalized(); +} + //////////////////////////////////////////////////////////////////// // Function: LPoint2::project // Access: Published diff --git a/panda/src/linmath/lpoint2_src.h b/panda/src/linmath/lpoint2_src.h index 5347325800..f426f733ba 100644 --- a/panda/src/linmath/lpoint2_src.h +++ b/panda/src/linmath/lpoint2_src.h @@ -51,6 +51,7 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LPoint2) operator / (FLOATTYPE scalar) const; #ifndef FLOATTYPE_IS_INT + INLINE_LINMATH FLOATNAME(LPoint2) normalized() const; INLINE_LINMATH FLOATNAME(LPoint2) project(const FLOATNAME(LVecBase2) &onto) const; #endif diff --git a/panda/src/linmath/lpoint3_src.I b/panda/src/linmath/lpoint3_src.I index 9f8143c7d7..21ff1be9f2 100644 --- a/panda/src/linmath/lpoint3_src.I +++ b/panda/src/linmath/lpoint3_src.I @@ -230,6 +230,18 @@ cross(const FLOATNAME(LVecBase3) &other) const { } #ifndef FLOATTYPE_IS_INT +//////////////////////////////////////////////////////////////////// +// Function: LPoint3::normalized +// Access: Published +// Description: Normalizes the vector and returns the normalized +// vector as a copy. If the vector was a zero-length +// vector, a zero length vector will be returned. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATNAME(LPoint3) FLOATNAME(LPoint3):: +normalized() const { + return FLOATNAME(LVecBase3)::normalized(); +} + //////////////////////////////////////////////////////////////////// // Function: LPoint3::project // Access: Published diff --git a/panda/src/linmath/lpoint3_src.h b/panda/src/linmath/lpoint3_src.h index e8645529ff..7cb4c4978e 100644 --- a/panda/src/linmath/lpoint3_src.h +++ b/panda/src/linmath/lpoint3_src.h @@ -61,6 +61,7 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LPoint3) cross(const FLOATNAME(LVecBase3) &other) const; #ifndef FLOATTYPE_IS_INT + INLINE_LINMATH FLOATNAME(LPoint3) normalized() const; INLINE_LINMATH FLOATNAME(LPoint3) project(const FLOATNAME(LVecBase3) &onto) const; #endif diff --git a/panda/src/linmath/lpoint4_src.I b/panda/src/linmath/lpoint4_src.I index d1a7e7b3ab..5bbe378f58 100644 --- a/panda/src/linmath/lpoint4_src.I +++ b/panda/src/linmath/lpoint4_src.I @@ -217,6 +217,19 @@ operator / (FLOATTYPE scalar) const { } #ifndef FLOATTYPE_IS_INT + +//////////////////////////////////////////////////////////////////// +// Function: LPoint4::normalized +// Access: Published +// Description: Normalizes the vector and returns the normalized +// vector as a copy. If the vector was a zero-length +// vector, a zero length vector will be returned. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATNAME(LPoint4) FLOATNAME(LPoint4):: +normalized() const { + return FLOATNAME(LVecBase4)::normalized(); +} + //////////////////////////////////////////////////////////////////// // Function: LPoint4::project // Access: Published diff --git a/panda/src/linmath/lpoint4_src.h b/panda/src/linmath/lpoint4_src.h index 50eeb1ce5d..72c874035b 100644 --- a/panda/src/linmath/lpoint4_src.h +++ b/panda/src/linmath/lpoint4_src.h @@ -53,6 +53,7 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LPoint4) operator / (FLOATTYPE scalar) const; #ifndef FLOATTYPE_IS_INT + INLINE_LINMATH FLOATNAME(LPoint4) normalized() const; INLINE_LINMATH FLOATNAME(LPoint4) project(const FLOATNAME(LVecBase4) &onto) const; #endif diff --git a/panda/src/linmath/lvecBase2_src.I b/panda/src/linmath/lvecBase2_src.I index b561cb0b7a..45cdf2d661 100644 --- a/panda/src/linmath/lvecBase2_src.I +++ b/panda/src/linmath/lvecBase2_src.I @@ -418,6 +418,22 @@ normalize() { return true; } +//////////////////////////////////////////////////////////////////// +// Function: LVecBase2::normalized +// Access: Published +// Description: Normalizes the vector and returns the normalized +// vector as a copy. If the vector was a zero-length +// vector, a zero length vector will be returned. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATNAME(LVecBase2) FLOATNAME(LVecBase2):: +normalized() const { + FLOATTYPE l2 = length_squared(); + if (l2 == (FLOATTYPE)0.0f) { + return FLOATNAME(LVecBase2)(0.0f); + } + return (*this) / csqrt(l2); +} + //////////////////////////////////////////////////////////////////// // Function: LVecBase2::project // Access: Published diff --git a/panda/src/linmath/lvecBase2_src.h b/panda/src/linmath/lvecBase2_src.h index f1f6d125e0..4340a6a296 100644 --- a/panda/src/linmath/lvecBase2_src.h +++ b/panda/src/linmath/lvecBase2_src.h @@ -94,6 +94,7 @@ PUBLISHED: #ifndef FLOATTYPE_IS_INT INLINE_LINMATH FLOATTYPE length() const; INLINE_LINMATH bool normalize(); + INLINE_LINMATH FLOATNAME(LVecBase2) normalized() const; INLINE_LINMATH FLOATNAME(LVecBase2) project(const FLOATNAME(LVecBase2) &onto) const; #endif diff --git a/panda/src/linmath/lvecBase3_src.I b/panda/src/linmath/lvecBase3_src.I index 13310a8af1..ef3c6b8d04 100644 --- a/panda/src/linmath/lvecBase3_src.I +++ b/panda/src/linmath/lvecBase3_src.I @@ -509,6 +509,22 @@ normalize() { return true; } +//////////////////////////////////////////////////////////////////// +// Function: LVecBase3::normalized +// Access: Published +// Description: Normalizes the vector and returns the normalized +// vector as a copy. If the vector was a zero-length +// vector, a zero length vector will be returned. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATNAME(LVecBase3) FLOATNAME(LVecBase3):: +normalized() const { + FLOATTYPE l2 = length_squared(); + if (l2 == (FLOATTYPE)0.0f) { + return FLOATNAME(LVecBase3)(0.0f); + } + return (*this) / csqrt(l2); +} + //////////////////////////////////////////////////////////////////// // Function: LVecBase3::project // Access: Published diff --git a/panda/src/linmath/lvecBase3_src.h b/panda/src/linmath/lvecBase3_src.h index 1a4ec5ce97..b51e7c42e4 100644 --- a/panda/src/linmath/lvecBase3_src.h +++ b/panda/src/linmath/lvecBase3_src.h @@ -103,6 +103,7 @@ PUBLISHED: #ifndef FLOATTYPE_IS_INT INLINE_LINMATH FLOATTYPE length() const; INLINE_LINMATH bool normalize(); + INLINE_LINMATH FLOATNAME(LVecBase3) normalized() const; INLINE_LINMATH FLOATNAME(LVecBase3) project(const FLOATNAME(LVecBase3) &onto) const; #endif diff --git a/panda/src/linmath/lvecBase4_src.I b/panda/src/linmath/lvecBase4_src.I index 5b42095e93..e1b76ccf92 100644 --- a/panda/src/linmath/lvecBase4_src.I +++ b/panda/src/linmath/lvecBase4_src.I @@ -559,6 +559,22 @@ normalize() { return true; } +//////////////////////////////////////////////////////////////////// +// Function: LVecBase4::normalized +// Access: Published +// Description: Normalizes the vector and returns the normalized +// vector as a copy. If the vector was a zero-length +// vector, a zero length vector will be returned. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATNAME(LVecBase4) FLOATNAME(LVecBase4):: +normalized() const { + FLOATTYPE l2 = length_squared(); + if (l2 == (FLOATTYPE)0.0f) { + return FLOATNAME(LVecBase4)(0.0f); + } + return (*this) / csqrt(l2); +} + //////////////////////////////////////////////////////////////////// // Function: LVecBase4::project // Access: Published diff --git a/panda/src/linmath/lvecBase4_src.h b/panda/src/linmath/lvecBase4_src.h index 988d31b859..d9511fee0e 100644 --- a/panda/src/linmath/lvecBase4_src.h +++ b/panda/src/linmath/lvecBase4_src.h @@ -113,6 +113,7 @@ PUBLISHED: #ifndef FLOATTYPE_IS_INT INLINE_LINMATH FLOATTYPE length() const; INLINE_LINMATH bool normalize(); + INLINE_LINMATH FLOATNAME(LVecBase4) normalized() const; INLINE_LINMATH FLOATNAME(LVecBase4) project(const FLOATNAME(LVecBase4) &onto) const; #endif diff --git a/panda/src/linmath/lvector2_src.I b/panda/src/linmath/lvector2_src.I index 45c7975fea..def84b52a1 100644 --- a/panda/src/linmath/lvector2_src.I +++ b/panda/src/linmath/lvector2_src.I @@ -175,6 +175,18 @@ operator / (FLOATTYPE scalar) const { } #ifndef FLOATTYPE_IS_INT +//////////////////////////////////////////////////////////////////// +// Function: LVector2::normalized +// Access: Published +// Description: Normalizes the vector and returns the normalized +// vector as a copy. If the vector was a zero-length +// vector, a zero length vector will be returned. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATNAME(LVector2) FLOATNAME(LVector2):: +normalized() const { + return FLOATNAME(LVecBase2)::normalized(); +} + //////////////////////////////////////////////////////////////////// // Function: LVector2::project // Access: Published diff --git a/panda/src/linmath/lvector2_src.h b/panda/src/linmath/lvector2_src.h index 2ee50d34ab..c63e11b2aa 100644 --- a/panda/src/linmath/lvector2_src.h +++ b/panda/src/linmath/lvector2_src.h @@ -44,6 +44,7 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LVector2) operator / (FLOATTYPE scalar) const; #ifndef FLOATTYPE_IS_INT + INLINE_LINMATH FLOATNAME(LVector2) normalized() const; INLINE_LINMATH FLOATNAME(LVector2) project(const FLOATNAME(LVecBase2) &onto) const; INLINE_LINMATH FLOATTYPE signed_angle_rad(const FLOATNAME(LVector2) &other) const; INLINE_LINMATH FLOATTYPE signed_angle_deg(const FLOATNAME(LVector2) &other) const; diff --git a/panda/src/linmath/lvector3_src.I b/panda/src/linmath/lvector3_src.I index 318d32d2c9..e04e4531f0 100644 --- a/panda/src/linmath/lvector3_src.I +++ b/panda/src/linmath/lvector3_src.I @@ -220,6 +220,19 @@ cross(const FLOATNAME(LVecBase3) &other) const { } #ifndef FLOATTYPE_IS_INT + +//////////////////////////////////////////////////////////////////// +// Function: LVector3::normalized +// Access: Published +// Description: Normalizes the vector and returns the normalized +// vector as a copy. If the vector was a zero-length +// vector, a zero length vector will be returned. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATNAME(LVector3) FLOATNAME(LVector3):: +normalized() const { + return FLOATNAME(LVecBase3)::normalized(); +} + //////////////////////////////////////////////////////////////////// // Function: LVector3::project // Access: Published diff --git a/panda/src/linmath/lvector3_src.h b/panda/src/linmath/lvector3_src.h index 7e0dd196bb..4d0a6f69c8 100644 --- a/panda/src/linmath/lvector3_src.h +++ b/panda/src/linmath/lvector3_src.h @@ -55,6 +55,7 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LVector3) cross(const FLOATNAME(LVecBase3) &other) const; #ifndef FLOATTYPE_IS_INT + INLINE_LINMATH FLOATNAME(LVector3) normalized() const; INLINE_LINMATH FLOATNAME(LVector3) project(const FLOATNAME(LVecBase3) &onto) const; INLINE_LINMATH FLOATTYPE angle_rad(const FLOATNAME(LVector3) &other) const; INLINE_LINMATH FLOATTYPE angle_deg(const FLOATNAME(LVector3) &other) const; diff --git a/panda/src/linmath/lvector4_src.I b/panda/src/linmath/lvector4_src.I index 78333268f4..0423b63cf7 100644 --- a/panda/src/linmath/lvector4_src.I +++ b/panda/src/linmath/lvector4_src.I @@ -207,6 +207,19 @@ operator / (FLOATTYPE scalar) const { } #ifndef FLOATTYPE_IS_INT + +//////////////////////////////////////////////////////////////////// +// Function: LVector4::normalized +// Access: Published +// Description: Normalizes the vector and returns the normalized +// vector as a copy. If the vector was a zero-length +// vector, a zero length vector will be returned. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATNAME(LVector4) FLOATNAME(LVector4):: +normalized() const { + return FLOATNAME(LVecBase4)::normalized(); +} + //////////////////////////////////////////////////////////////////// // Function: LVector4::project // Access: Published diff --git a/panda/src/linmath/lvector4_src.h b/panda/src/linmath/lvector4_src.h index ebf87429f6..5f149d92fe 100644 --- a/panda/src/linmath/lvector4_src.h +++ b/panda/src/linmath/lvector4_src.h @@ -47,6 +47,7 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LVector4) operator / (FLOATTYPE scalar) const; #ifndef FLOATTYPE_IS_INT + INLINE_LINMATH FLOATNAME(LVector4) normalized() const; INLINE_LINMATH FLOATNAME(LVector4) project(const FLOATNAME(LVecBase4) &onto) const; #endif From a0b2a981783a63fb91e71fa9599a27d7d7b5b7cd Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 11 Sep 2016 12:23:28 +0200 Subject: [PATCH 044/112] Fix crash that happens when using OdeTriMeshData incorrectly --- panda/src/ode/odeTriMeshData.cxx | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/panda/src/ode/odeTriMeshData.cxx b/panda/src/ode/odeTriMeshData.cxx index cdaed29ae6..a58ed87d74 100644 --- a/panda/src/ode/odeTriMeshData.cxx +++ b/panda/src/ode/odeTriMeshData.cxx @@ -55,25 +55,30 @@ print_data(const string &marker) { void OdeTriMeshData:: remove_data(OdeTriMeshData *data) { - odetrimeshdata_cat.debug() << get_class_type() << "::remove_data(" << data->get_id() << ")" << "\n"; - nassertv(_tri_mesh_data_map != (TriMeshDataMap *)NULL); + if (odetrimeshdata_cat.is_debug()) { + odetrimeshdata_cat.debug() + << get_class_type() << "::remove_data(" << data->get_id() << ")" << "\n"; + } + if (_tri_mesh_data_map == (TriMeshDataMap *)NULL) { + return; + } + TriMeshDataMap::iterator iter; - for (iter = _tri_mesh_data_map->begin(); iter != _tri_mesh_data_map->end(); ++iter) { - if ( iter->second == data ) { + if (iter->second == data) { break; } } - + while (iter != _tri_mesh_data_map->end()) { _tri_mesh_data_map->erase(iter); - + for (iter = _tri_mesh_data_map->begin(); iter != _tri_mesh_data_map->end(); ++iter) { - if ( iter->second == data ) { + if (iter->second == data) { break; } } @@ -154,8 +159,13 @@ operator = (const OdeTriMeshData &other) { void OdeTriMeshData:: process_model(const NodePath& model, bool &use_normals) { // TODO: assert if _vertices is something other than 0. - ostream &out = odetrimeshdata_cat.debug(); - out << "process_model(" << model << ")" << "\n"; + if (odetrimeshdata_cat.is_debug()) { + odetrimeshdata_cat.debug() + << "process_model(" << model << ")" << "\n"; + } + if (model.is_empty()) { + return; + } NodePathCollection geomNodePaths = model.find_all_matches("**/+GeomNode"); if (model.node()->get_type() == GeomNode::get_class_type()) { From 977228c493d6c5b4541b871546ea203e6738dd0b Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 11 Sep 2016 19:44:46 +0200 Subject: [PATCH 045/112] Improve memory consumption of packp3d/ppackage by not caching models/textures in RAM Fixes https://bugs.launchpad.net/panda3d/+bug/1609882 --- direct/src/p3d/Packager.py | 12 +++++++++++- direct/src/p3d/panda3d.pdef | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/direct/src/p3d/Packager.py b/direct/src/p3d/Packager.py index 27ff972e63..e317e9a331 100644 --- a/direct/src/p3d/Packager.py +++ b/direct/src/p3d/Packager.py @@ -1853,7 +1853,7 @@ class Packager: def addEggFile(self, file): # Precompile egg files to bam's. - np = self.packager.loader.loadModel(file.filename) + np = self.packager.loader.loadModel(file.filename, self.packager.loaderOptions) if not np: raise StandardError, 'Could not read egg file %s' % (file.filename) @@ -1867,6 +1867,8 @@ class Packager: if not bamFile.openRead(file.filename): raise StandardError, 'Could not read bam file %s' % (file.filename) + bamFile.getReader().setLoaderOptions(self.packager.loaderOptions) + if not bamFile.resolve(): raise StandardError, 'Could not resolve bam file %s' % (file.filename) @@ -2497,6 +2499,14 @@ class Packager: self.sfxManagerList = None self.musicManager = None + # These options will be used when loading models and textures. By + # default we don't load textures beyond the header and don't store + # models in the RAM cache in order to conserve on memory usage. + opts = LoaderOptions() + opts.setFlags(opts.getFlags() | LoaderOptions.LFNoRamCache) + opts.setTextureFlags(opts.getTextureFlags() & ~LoaderOptions.TFPreload) + self.loaderOptions = opts + # This is filled in during readPackageDef(). self.packageList = [] diff --git a/direct/src/p3d/panda3d.pdef b/direct/src/p3d/panda3d.pdef index 6e19a54415..ea9b43e59e 100644 --- a/direct/src/p3d/panda3d.pdef +++ b/direct/src/p3d/panda3d.pdef @@ -433,6 +433,8 @@ class packp3d(p3d): mainModule('direct.p3d.packp3d') + file('packp3d.prc', extract = True, text = "preload-textures false") + class ppackage(p3d): # As above, a packaging utility. This is the fully-general ppackage @@ -446,6 +448,8 @@ class ppackage(p3d): mainModule('direct.p3d.ppackage') + file('ppackage.prc', extract = True, text = "preload-textures false") + class ppatcher(p3d): # A handy utility to go along with ppackage. This builds From 3ce808c705f5621a9eb32b8711347960e75e69c7 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 11 Sep 2016 20:28:33 +0200 Subject: [PATCH 046/112] Fix in-place asyncFlattenStrong --- direct/src/showbase/Loader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direct/src/showbase/Loader.py b/direct/src/showbase/Loader.py index adee7fbe2b..f1cf5b91e5 100644 --- a/direct/src/showbase/Loader.py +++ b/direct/src/showbase/Loader.py @@ -915,7 +915,7 @@ class Loader(DirectObject): orig = origModelList[i].node() flat = models[i].node() orig.copyAllProperties(flat) - orig.replaceNode(flat) + flat.replaceNode(orig) if callback: if gotList: From 632ad5e3eff9a00503d964231fa5be68f0ee92a9 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 11 Sep 2016 22:14:18 +0200 Subject: [PATCH 047/112] Acquire mutex in cache_unref() - fixes race cond in async flatten --- panda/src/putil/copyOnWriteObject.I | 11 +++++++++ panda/src/putil/copyOnWriteObject.h | 1 + panda/src/putil/copyOnWritePointer.cxx | 31 +++++++++++++++++++++----- 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/panda/src/putil/copyOnWriteObject.I b/panda/src/putil/copyOnWriteObject.I index 3ad239c47a..ee0d5a01b7 100644 --- a/panda/src/putil/copyOnWriteObject.I +++ b/panda/src/putil/copyOnWriteObject.I @@ -83,6 +83,17 @@ cache_ref() const { MutexHolder holder(_lock_mutex); CachedTypedWritableReferenceCount::cache_ref(); } + +//////////////////////////////////////////////////////////////////// +// Function: CopyOnWriteObject::cache_unref +// Access: Published +// Description: See CachedTypedWritableReferenceCount::cache_unref(). +//////////////////////////////////////////////////////////////////// +INLINE bool CopyOnWriteObject:: +cache_unref() const { + MutexHolder holder(_lock_mutex); + return CachedTypedWritableReferenceCount::cache_unref(); +} #endif // COW_THREADED //////////////////////////////////////////////////////////////////// diff --git a/panda/src/putil/copyOnWriteObject.h b/panda/src/putil/copyOnWriteObject.h index e7d1ca7be9..633bbfc08a 100644 --- a/panda/src/putil/copyOnWriteObject.h +++ b/panda/src/putil/copyOnWriteObject.h @@ -51,6 +51,7 @@ PUBLISHED: #ifdef COW_THREADED virtual bool unref() const; INLINE void cache_ref() const; + INLINE bool cache_unref() const; #endif // COW_THREADED protected: diff --git a/panda/src/putil/copyOnWritePointer.cxx b/panda/src/putil/copyOnWritePointer.cxx index 38ba2d63a5..c323cb76c0 100644 --- a/panda/src/putil/copyOnWritePointer.cxx +++ b/panda/src/putil/copyOnWritePointer.cxx @@ -13,7 +13,6 @@ //////////////////////////////////////////////////////////////////// #include "copyOnWritePointer.h" -#include "mutexHolder.h" #include "config_util.h" #include "config_pipeline.h" @@ -78,7 +77,7 @@ get_write_pointer() { Thread *current_thread = Thread::get_current_thread(); - MutexHolder holder(_cow_object->_lock_mutex); + _cow_object->_lock_mutex.acquire(); while (_cow_object->_lock_status == CopyOnWriteObject::LS_locked_write && _cow_object->_locking_thread != current_thread) { if (util_cat.is_debug()) { @@ -98,10 +97,20 @@ get_write_pointer() { << "Making copy of " << _cow_object->get_type() << " because it is locked in read mode.\n"; } + PT(CopyOnWriteObject) new_object = _cow_object->make_cow_copy(); - cache_unref_delete(_cow_object); + + // We can't call cache_unref_delete, because we hold the lock. + if (!_cow_object->CachedTypedWritableReferenceCount::cache_unref()) { + _cow_object->_lock_mutex.release(); + delete _cow_object; + } else { + _cow_object->_lock_mutex.release(); + } _cow_object = new_object; _cow_object->cache_ref(); + _cow_object->_lock_status = CopyOnWriteObject::LS_locked_write; + _cow_object->_locking_thread = current_thread; } else if (_cow_object->get_cache_ref_count() > 1) { // No one else has it specifically read-locked, but there are @@ -115,9 +124,18 @@ get_write_pointer() { } PT(CopyOnWriteObject) new_object = _cow_object->make_cow_copy(); - cache_unref_delete(_cow_object); + + // We can't call cache_unref_delete, because we hold the lock. + if (!_cow_object->CachedTypedWritableReferenceCount::cache_unref()) { + _cow_object->_lock_mutex.release(); + delete _cow_object; + } else { + _cow_object->_lock_mutex.release(); + } _cow_object = new_object; _cow_object->cache_ref(); + _cow_object->_lock_status = CopyOnWriteObject::LS_locked_write; + _cow_object->_locking_thread = current_thread; } else { // No other thread has the pointer locked, and we're the only @@ -127,9 +145,10 @@ get_write_pointer() { // We can't assert that there are no outstanding ordinary // references to it, though, since the creator of the object might // have saved himself a reference. + _cow_object->_lock_status = CopyOnWriteObject::LS_locked_write; + _cow_object->_locking_thread = current_thread; + _cow_object->_lock_mutex.release(); } - _cow_object->_lock_status = CopyOnWriteObject::LS_locked_write; - _cow_object->_locking_thread = current_thread; return _cow_object; } From 18085a7cb1abba76dbb4ffd0d5206b9dea40f7af Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 12 Sep 2016 00:38:18 +0200 Subject: [PATCH 048/112] Update ReleaseNotes --- doc/ReleaseNotes | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index 6320ff52a8..37f755d200 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -6,6 +6,7 @@ This issue fixes several bugs that were still found in 1.9.2. * Fix crash using wx/tkinter on Mac as long as want-wx/tk is set * Fix loading models from 'models' package with models/ prefix * Fix random crashes in task system +* Fix various race conditions causing threading issues * Fix memory leaks in BulletTriangleMesh * Fix loading old models with MovingPart * Improve performance of CPU vertex animation somewhat @@ -26,13 +27,13 @@ This issue fixes several bugs that were still found in 1.9.2. * Fix issues with certain Cg shader inputs in DX9 * Support uint8 index buffers in DX9 * Fix occasional frame lag when loading a big model asynchronously -* Fix race condition reading string config var * Fix interrogate parsing issue with "const static" * Add back missing libp3pystub.a to Mac OS X SDK * Fix RAM caching of 2D texture arrays * Fix Ctrl+C interrupt propagation to runtime applications * Support for InvSphere, Box and Tube solids in bam2egg * Add normalized() method to vectors +* asyncFlattenStrong with inPlace=True caused node to disappear ------------------------ RELEASE 1.9.2 ------------------------ From 234e7eefee4eddd3741a4c25c7661a8f733d85e1 Mon Sep 17 00:00:00 2001 From: deflected Date: Mon, 12 Sep 2016 13:19:44 +0300 Subject: [PATCH 049/112] loader: Added loading of 2D texture array Signed-off-by: deflected --- direct/src/showbase/Loader.py | 57 +++++++++++++++++++++++++++++++++ panda/src/putil/loaderOptions.I | 8 ++--- 2 files changed, 61 insertions(+), 4 deletions(-) diff --git a/direct/src/showbase/Loader.py b/direct/src/showbase/Loader.py index 24773b776b..9edde2a9b7 100644 --- a/direct/src/showbase/Loader.py +++ b/direct/src/showbase/Loader.py @@ -687,6 +687,63 @@ class Loader(DirectObject): return texture + def load2DTextureArray(self, texturePattern, readMipmaps = False, okMissing = False, + minfilter = None, magfilter = None, anisotropicDegree = None, + loaderOptions = None, multiview = None, numViews = 2): + """ + texturePattern is a string that contains a sequence of one or + more hash characters ('#'), which will be filled in with the + z-height number. Returns a 2-D Texture array object, suitable + for rendering array of textures. + + okMissing should be True to indicate the method should return + None if the texture file is not found. If it is False, the + method will raise an exception if the texture file is not + found or cannot be loaded. + + If readMipmaps is True, then the filename string must contain + two sequences of hash characters; the first group is filled in + with the z-height number, and the second group with the mipmap + index number. + + If multiview is true, it indicates to load a multiview or + stereo texture. In this case, numViews should also be + specified (the default is 2), and the sequence of texture + images will be divided into numViews views. The total + z-height will be (numImages / numViews). For instance, if you + read 16 images with numViews = 2, then you have created a + stereo multiview image, with z = 8. In this example, images + numbered 0 - 7 will be part of the left eye view, and images + numbered 8 - 15 will be part of the right eye view. + """ + assert Loader.notify.debug("Loading 2-D texture array: %s" % (texturePattern)) + if loaderOptions is None: + loaderOptions = LoaderOptions() + else: + loaderOptions = LoaderOptions(loaderOptions) + if multiview is not None: + flags = loaderOptions.getTextureFlags() + if multiview: + flags |= LoaderOptions.TFMultiview + else: + flags &= ~LoaderOptions.TFMultiview + loaderOptions.setTextureFlags(flags) + loaderOptions.setTextureNumViews(numViews) + + texture = TexturePool.load2dTextureArray(texturePattern, readMipmaps, loaderOptions) + if not texture and not okMissing: + message = 'Could not load 2-D texture array: %s' % (texturePattern) + raise IOError(message) + + if minfilter is not None: + texture.setMinfilter(minfilter) + if magfilter is not None: + texture.setMagfilter(magfilter) + if anisotropicDegree is not None: + texture.setAnisotropicDegree(anisotropicDegree) + + return texture + def loadCubeMap(self, texturePattern, readMipmaps = False, okMissing = False, minfilter = None, magfilter = None, anisotropicDegree = None, loaderOptions = None, multiview = None): diff --git a/panda/src/putil/loaderOptions.I b/panda/src/putil/loaderOptions.I index f28be10370..b15780c847 100644 --- a/panda/src/putil/loaderOptions.I +++ b/panda/src/putil/loaderOptions.I @@ -81,10 +81,10 @@ get_texture_flags() const { /** * Specifies the expected number of views to load for the texture. This is * ignored unless TF_multiview is included in texture_flags. This must be - * specified when loading a 3-d multiview texture, in which case it is used to - * differentiate z levels from separate views; it may be zero in the case of - * 2-d textures or cube maps, in which case the number of views can be - * inferred from the number of images found on disk. + * specified when loading a 3-d multiview texture or 2-d texture array, in + * which case it is used to differentiate z levels from separate views; it + * may be zero in the case of 2-d textures or cube maps, in which case the + * number of views can be inferred from the number of images found on disk. */ INLINE void LoaderOptions:: set_texture_num_views(int texture_num_views) { From 9904980ce4b03c87c25876c8a183efe8baaa7661 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 14 Sep 2016 17:29:02 +0200 Subject: [PATCH 050/112] Fix async flatten of node without parents --- doc/ReleaseNotes | 1 + panda/src/pgraph/modelFlattenRequest.cxx | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index 37f755d200..4cbfd69fb4 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -34,6 +34,7 @@ This issue fixes several bugs that were still found in 1.9.2. * Support for InvSphere, Box and Tube solids in bam2egg * Add normalized() method to vectors * asyncFlattenStrong with inPlace=True caused node to disappear +* Fix asyncFlattenStrong called on nodes without parent ------------------------ RELEASE 1.9.2 ------------------------ diff --git a/panda/src/pgraph/modelFlattenRequest.cxx b/panda/src/pgraph/modelFlattenRequest.cxx index 7d98406477..b6c5cca4c8 100644 --- a/panda/src/pgraph/modelFlattenRequest.cxx +++ b/panda/src/pgraph/modelFlattenRequest.cxx @@ -25,10 +25,19 @@ TypeHandle ModelFlattenRequest::_type_handle; //////////////////////////////////////////////////////////////////// AsyncTask::DoneStatus ModelFlattenRequest:: do_task() { - // We make another instance of the original node, so we can safely - // flatten that without affecting the original copy. + // We make another instance of the original node, so we can safely flatten + // that without affecting the original copy. NodePath np("flatten_root"); - np.attach_new_node(_orig); + + // Except if we try to attach a node without parents, this will cause the + // original NodePath to be affected, so we have to make a (shallow) copy. + if (_orig->get_num_parents() == 0) { + PT(PandaNode) copy = _orig->make_copy(); + copy->copy_children(_orig); + np.attach_new_node(copy); + } else { + np.attach_new_node(_orig); + } np.flatten_strong(); _model = np.get_child(0).node(); _is_ready = true; From 2c651dc96bcc4882e474caa0985ab0b720c9c812 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 14 Sep 2016 20:55:57 +0200 Subject: [PATCH 051/112] Fix is_playing() when playing an animation backwards --- doc/ReleaseNotes | 1 + panda/src/putil/animInterface.cxx | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index 4cbfd69fb4..49ed03cd78 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -35,6 +35,7 @@ This issue fixes several bugs that were still found in 1.9.2. * Add normalized() method to vectors * asyncFlattenStrong with inPlace=True caused node to disappear * Fix asyncFlattenStrong called on nodes without parent +* Fix is_playing() check when playing an animation backwards ------------------------ RELEASE 1.9.2 ------------------------ diff --git a/panda/src/putil/animInterface.cxx b/panda/src/putil/animInterface.cxx index 515c54027a..690afa89d8 100644 --- a/panda/src/putil/animInterface.cxx +++ b/panda/src/putil/animInterface.cxx @@ -415,7 +415,12 @@ is_playing() const { return false; case PM_play: - return get_f() < _play_frames; + if (_effective_frame_rate < 0.0) { + // If we're playing backwards, check if we're at the beginning. + return get_f() > 0; + } else { + return get_f() < _play_frames; + } case PM_loop: case PM_pingpong: From 0bdafe45ceeb6d6428753d1765355cc258ad23da Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 14 Sep 2016 21:54:35 +0200 Subject: [PATCH 052/112] Fix various issues in bam2egg: * No longer inserts an extra root group for the ModelRoot * Support depth test, offset and cull bin attributes * Preserve non-GeomNodes under Character * Render attributes are applied on group level if possible --- panda/src/egg/eggLine.cxx | 9 +- panda/src/egg/eggLine.h | 2 + panda/src/egg/eggNurbsCurve.cxx | 8 + panda/src/egg/eggNurbsCurve.h | 2 + panda/src/egg/eggNurbsSurface.cxx | 8 + panda/src/egg/eggNurbsSurface.h | 2 + panda/src/egg/eggPatch.cxx | 7 + panda/src/egg/eggPatch.h | 2 + panda/src/egg/eggPoint.cxx | 7 + panda/src/egg/eggPoint.h | 2 + panda/src/egg/eggPolygon.cxx | 7 + panda/src/egg/eggPolygon.h | 2 + panda/src/egg/eggPrimitive.h | 2 + panda/src/egg/eggTriangleFan.cxx | 9 +- panda/src/egg/eggTriangleFan.h | 2 + panda/src/egg/eggTriangleStrip.cxx | 9 +- panda/src/egg/eggTriangleStrip.h | 2 + panda/src/egg2pg/eggSaver.cxx | 313 +++++++++++++++-------------- panda/src/egg2pg/eggSaver.h | 8 +- panda/src/egg2pg/save_egg_file.cxx | 16 +- 20 files changed, 261 insertions(+), 158 deletions(-) diff --git a/panda/src/egg/eggLine.cxx b/panda/src/egg/eggLine.cxx index 4da9b87d7d..fca1efd7f1 100644 --- a/panda/src/egg/eggLine.cxx +++ b/panda/src/egg/eggLine.cxx @@ -17,7 +17,6 @@ TypeHandle EggLine::_type_handle; - /** * */ @@ -26,6 +25,14 @@ EggLine:: clear(); } +/** + * Makes a copy of this object. + */ +EggLine *EggLine:: +make_copy() const { + return new EggLine(*this); +} + /** * Writes the point to the indicated output stream in Egg format. */ diff --git a/panda/src/egg/eggLine.h b/panda/src/egg/eggLine.h index ce036c40f3..059dfa7648 100644 --- a/panda/src/egg/eggLine.h +++ b/panda/src/egg/eggLine.h @@ -29,6 +29,8 @@ PUBLISHED: INLINE EggLine &operator = (const EggLine ©); virtual ~EggLine(); + virtual EggLine *make_copy() const OVERRIDE; + virtual void write(ostream &out, int indent_level) const; INLINE bool has_thick() const; diff --git a/panda/src/egg/eggNurbsCurve.cxx b/panda/src/egg/eggNurbsCurve.cxx index f00528f0f0..79b1d5011b 100644 --- a/panda/src/egg/eggNurbsCurve.cxx +++ b/panda/src/egg/eggNurbsCurve.cxx @@ -17,6 +17,14 @@ TypeHandle EggNurbsCurve::_type_handle; +/** + * Makes a copy of this object. + */ +EggNurbsCurve *EggNurbsCurve:: +make_copy() const { + return new EggNurbsCurve(*this); +} + /** * Prepares a new curve definition with the indicated order and number of * knots. This also implies a particular number of vertices as well (the diff --git a/panda/src/egg/eggNurbsCurve.h b/panda/src/egg/eggNurbsCurve.h index 5eb8a054c8..9797a12ea8 100644 --- a/panda/src/egg/eggNurbsCurve.h +++ b/panda/src/egg/eggNurbsCurve.h @@ -29,6 +29,8 @@ PUBLISHED: INLINE EggNurbsCurve(const EggNurbsCurve ©); INLINE EggNurbsCurve &operator = (const EggNurbsCurve ©); + virtual EggNurbsCurve *make_copy() const OVERRIDE; + void setup(int order, int num_knots); INLINE void set_order(int order); diff --git a/panda/src/egg/eggNurbsSurface.cxx b/panda/src/egg/eggNurbsSurface.cxx index a5bd29cc78..c89ebfe157 100644 --- a/panda/src/egg/eggNurbsSurface.cxx +++ b/panda/src/egg/eggNurbsSurface.cxx @@ -17,6 +17,14 @@ TypeHandle EggNurbsSurface::_type_handle; +/** + * Makes a copy of this object. + */ +EggNurbsSurface *EggNurbsSurface:: +make_copy() const { + return new EggNurbsSurface(*this); +} + /** * Prepares a new surface definition with the indicated order and number of * knots in each dimension. This also implies a particular number of vertices diff --git a/panda/src/egg/eggNurbsSurface.h b/panda/src/egg/eggNurbsSurface.h index 35d5daba88..8e09d43fbd 100644 --- a/panda/src/egg/eggNurbsSurface.h +++ b/panda/src/egg/eggNurbsSurface.h @@ -36,6 +36,8 @@ PUBLISHED: INLINE EggNurbsSurface(const EggNurbsSurface ©); INLINE EggNurbsSurface &operator = (const EggNurbsSurface ©); + virtual EggNurbsSurface *make_copy() const OVERRIDE; + void setup(int u_order, int v_order, int num_u_knots, int num_v_knots); diff --git a/panda/src/egg/eggPatch.cxx b/panda/src/egg/eggPatch.cxx index 274217d0c2..0bed947622 100644 --- a/panda/src/egg/eggPatch.cxx +++ b/panda/src/egg/eggPatch.cxx @@ -21,6 +21,13 @@ TypeHandle EggPatch::_type_handle; +/** + * Makes a copy of this object. + */ +EggPatch *EggPatch:: +make_copy() const { + return new EggPatch(*this); +} /** * Writes the patch to the indicated output stream in Egg format. diff --git a/panda/src/egg/eggPatch.h b/panda/src/egg/eggPatch.h index d7a0989aef..63cfc61353 100644 --- a/panda/src/egg/eggPatch.h +++ b/panda/src/egg/eggPatch.h @@ -28,6 +28,8 @@ PUBLISHED: INLINE EggPatch(const EggPatch ©); INLINE EggPatch &operator = (const EggPatch ©); + virtual EggPatch *make_copy() const OVERRIDE; + virtual void write(ostream &out, int indent_level) const; public: diff --git a/panda/src/egg/eggPoint.cxx b/panda/src/egg/eggPoint.cxx index 95eef093ea..a344ee59cd 100644 --- a/panda/src/egg/eggPoint.cxx +++ b/panda/src/egg/eggPoint.cxx @@ -17,6 +17,13 @@ TypeHandle EggPoint::_type_handle; +/** + * Makes a copy of this object. + */ +EggPoint *EggPoint:: +make_copy() const { + return new EggPoint(*this); +} /** * Cleans up modeling errors in whatever context this makes sense. For diff --git a/panda/src/egg/eggPoint.h b/panda/src/egg/eggPoint.h index 74edd1b04d..ae7d7e1d34 100644 --- a/panda/src/egg/eggPoint.h +++ b/panda/src/egg/eggPoint.h @@ -28,6 +28,8 @@ PUBLISHED: INLINE EggPoint(const EggPoint ©); INLINE EggPoint &operator = (const EggPoint ©); + virtual EggPoint *make_copy() const OVERRIDE; + INLINE bool has_thick() const; INLINE double get_thick() const; INLINE void set_thick(double thick); diff --git a/panda/src/egg/eggPolygon.cxx b/panda/src/egg/eggPolygon.cxx index e10252c2ae..2d6a3378c7 100644 --- a/panda/src/egg/eggPolygon.cxx +++ b/panda/src/egg/eggPolygon.cxx @@ -21,6 +21,13 @@ TypeHandle EggPolygon::_type_handle; +/** + * Makes a copy of this object. + */ +EggPolygon *EggPolygon:: +make_copy() const { + return new EggPolygon(*this); +} /** * Cleans up modeling errors in whatever context this makes sense. For diff --git a/panda/src/egg/eggPolygon.h b/panda/src/egg/eggPolygon.h index 7c0298d9bd..a549af3bf7 100644 --- a/panda/src/egg/eggPolygon.h +++ b/panda/src/egg/eggPolygon.h @@ -27,6 +27,8 @@ PUBLISHED: INLINE EggPolygon(const EggPolygon ©); INLINE EggPolygon &operator = (const EggPolygon ©); + virtual EggPolygon *make_copy() const OVERRIDE; + virtual bool cleanup(); bool calculate_normal(LNormald &result, CoordinateSystem cs = CS_default) const; diff --git a/panda/src/egg/eggPrimitive.h b/panda/src/egg/eggPrimitive.h index 4e8672249e..905e049596 100644 --- a/panda/src/egg/eggPrimitive.h +++ b/panda/src/egg/eggPrimitive.h @@ -72,6 +72,8 @@ PUBLISHED: INLINE EggPrimitive &operator = (const EggPrimitive ©); INLINE ~EggPrimitive(); + virtual EggPrimitive *make_copy() const=0; + virtual EggRenderMode *determine_alpha_mode(); virtual EggRenderMode *determine_depth_write_mode(); virtual EggRenderMode *determine_depth_test_mode(); diff --git a/panda/src/egg/eggTriangleFan.cxx b/panda/src/egg/eggTriangleFan.cxx index d71ad75fed..30d441286a 100644 --- a/panda/src/egg/eggTriangleFan.cxx +++ b/panda/src/egg/eggTriangleFan.cxx @@ -18,7 +18,6 @@ TypeHandle EggTriangleFan::_type_handle; - /** * */ @@ -27,6 +26,14 @@ EggTriangleFan:: clear(); } +/** + * Makes a copy of this object. + */ +EggTriangleFan *EggTriangleFan:: +make_copy() const { + return new EggTriangleFan(*this); +} + /** * Writes the triangle fan to the indicated output stream in Egg format. */ diff --git a/panda/src/egg/eggTriangleFan.h b/panda/src/egg/eggTriangleFan.h index 1cf6e1edf9..0a5e3f1e35 100644 --- a/panda/src/egg/eggTriangleFan.h +++ b/panda/src/egg/eggTriangleFan.h @@ -29,6 +29,8 @@ PUBLISHED: INLINE EggTriangleFan &operator = (const EggTriangleFan ©); virtual ~EggTriangleFan(); + virtual EggTriangleFan *make_copy() const OVERRIDE; + virtual void write(ostream &out, int indent_level) const; virtual void apply_first_attribute(); diff --git a/panda/src/egg/eggTriangleStrip.cxx b/panda/src/egg/eggTriangleStrip.cxx index 41bd5c4668..5882471c9e 100644 --- a/panda/src/egg/eggTriangleStrip.cxx +++ b/panda/src/egg/eggTriangleStrip.cxx @@ -18,7 +18,6 @@ TypeHandle EggTriangleStrip::_type_handle; - /** * */ @@ -27,6 +26,14 @@ EggTriangleStrip:: clear(); } +/** + * Makes a copy of this object. + */ +EggTriangleStrip *EggTriangleStrip:: +make_copy() const { + return new EggTriangleStrip(*this); +} + /** * Writes the triangle strip to the indicated output stream in Egg format. */ diff --git a/panda/src/egg/eggTriangleStrip.h b/panda/src/egg/eggTriangleStrip.h index 1400aefbd9..202172d1cd 100644 --- a/panda/src/egg/eggTriangleStrip.h +++ b/panda/src/egg/eggTriangleStrip.h @@ -29,6 +29,8 @@ PUBLISHED: INLINE EggTriangleStrip &operator = (const EggTriangleStrip ©); virtual ~EggTriangleStrip(); + virtual EggTriangleStrip *make_copy() const OVERRIDE; + virtual void write(ostream &out, int indent_level) const; protected: diff --git a/panda/src/egg2pg/eggSaver.cxx b/panda/src/egg2pg/eggSaver.cxx index 3ddddffe3f..97f564ae9b 100644 --- a/panda/src/egg2pg/eggSaver.cxx +++ b/panda/src/egg2pg/eggSaver.cxx @@ -23,8 +23,11 @@ #include "colorAttrib.h" #include "materialAttrib.h" #include "textureAttrib.h" +#include "cullBinAttrib.h" #include "cullFaceAttrib.h" #include "transparencyAttrib.h" +#include "depthTestAttrib.h" +#include "depthOffsetAttrib.h" #include "depthWriteAttrib.h" #include "lodNode.h" #include "switchNode.h" @@ -101,6 +104,26 @@ add_node(PandaNode *node) { _vpool = NULL; } +/** + * Adds the scene graph rooted at the indicated node (but without the node + * itself) to the accumulated egg data within this object. Call + * get_egg_data() to retrieve the result. + */ +void EggSaver:: +add_subgraph(PandaNode *root) { + _vpool = new EggVertexPool(root->get_name()); + _data->add_child(_vpool); + + NodePath root_path(root); + recurse_nodes(root_path, _data, false, NULL); + + // Remove the vertex pool if it has no vertices. + if (_vpool->empty()) { + _data->remove_child(_vpool); + } + _vpool = NULL; +} + /** * Converts the indicated node to the corresponding Egg constructs, by first * determining what kind of node it is. @@ -359,9 +382,12 @@ convert_character_node(Character *node, const WorkingNodePath &node_path, EggGroupNode *egg_parent, bool has_decal) { // A sequence node gets converted to an ordinary EggGroup, we only apply the - // appropriate switch attributes to turn it into a sequence + // appropriate switch attributes to turn it into a sequence. + // We have to use DT_structured since it is the only mode that preserves the + // node hierarchy, including LODNodes and CollisionNodes that may be under + // this Character node. EggGroup *egg_group = new EggGroup(node->get_name()); - egg_group->set_dart_type(EggGroup::DT_default); + egg_group->set_dart_type(EggGroup::DT_structured); egg_parent->add_child(egg_group); apply_node_properties(egg_group, node); @@ -611,7 +637,8 @@ convert_geom_node(GeomNode *node, const WorkingNodePath &node_path, // Now get out all the various kinds of geometry. int num_geoms = node->get_num_geoms(); for (int i = 0; i < num_geoms; ++i) { - CPT(RenderState) geom_state = net_state->compose(node->get_geom_state(i)); + CPT(RenderState) geom_state = node->get_geom_state(i); + CPT(RenderState) geom_net_state = net_state->compose(geom_state); const Geom *geom = node->get_geom(i); int num_primitives = geom->get_num_primitives(); @@ -620,7 +647,7 @@ convert_geom_node(GeomNode *node, const WorkingNodePath &node_path, CPT(GeomPrimitive) simple = primitive->decompose(); CPT(GeomVertexData) vdata = geom->get_vertex_data(); // vdata = vdata->animate_vertices(true, Thread::get_current_thread()); - convert_primitive(vdata, simple, geom_state, + convert_primitive(vdata, simple, geom_state, geom_net_state, net_mat, egg_parent, joint_map); } } @@ -634,11 +661,29 @@ convert_geom_node(GeomNode *node, const WorkingNodePath &node_path, void EggSaver:: convert_primitive(const GeomVertexData *vertex_data, const GeomPrimitive *primitive, - const RenderState *net_state, + const RenderState *geom_state, const RenderState *net_state, const LMatrix4 &net_mat, EggGroupNode *egg_parent, CharacterJointMap *joint_map) { GeomVertexReader reader(vertex_data); + // Make a zygote that will be duplicated for each primitive. + PT(EggPrimitive) egg_prim; + if (primitive->is_of_type(GeomTriangles::get_class_type())) { + egg_prim = new EggPolygon(); + } else if (primitive->is_of_type(GeomPatches::get_class_type())) { + egg_prim = new EggPatch(); + } else if (primitive->is_of_type(GeomPoints::get_class_type())) { + egg_prim = new EggPoint(); + } else if (primitive->is_of_type(GeomLines::get_class_type())) { + egg_prim = new EggLine(); + } else { + // Huh, an unknown geometry type. + return; + } + + // Apply render attributes. + apply_state_properties(egg_prim, geom_state); + // Check for a color scale. LVecBase4 color_scale(1.0f, 1.0f, 1.0f, 1.0f); const ColorScaleAttrib *csa; @@ -670,20 +715,20 @@ convert_primitive(const GeomVertexData *vertex_data, const MaterialAttrib *ma; if (net_state->get_attrib(ma)) { egg_mat = get_egg_material(ma->get_material()); + if (egg_mat != (EggMaterial *)NULL) { + egg_prim->set_material(egg_mat); + } } // Check for a texture. - EggTexture *egg_tex = (EggTexture *)NULL; const TextureAttrib *ta; if (net_state->get_attrib(ta)) { - egg_tex = get_egg_texture(ta->get_texture()); - } + EggTexture *egg_tex = get_egg_texture(ta->get_texture()); - // Check the texture environment - if ((ta != (const TextureAttrib *)NULL) && (egg_tex != (const EggTexture *)NULL)) { - TextureStage* tex_stage = ta->get_on_stage(0); - if (tex_stage != (const TextureStage *)NULL) { - switch (tex_stage->get_mode()) { + if (egg_tex != (EggTexture *)NULL) { + TextureStage *tex_stage = ta->get_on_stage(0); + if (tex_stage != (TextureStage *)NULL) { + switch (tex_stage->get_mode()) { case TextureStage::M_modulate: if (has_color_off == true) { egg_tex->set_env_type(EggTexture::ET_replace); @@ -708,7 +753,10 @@ convert_primitive(const GeomVertexData *vertex_data, break; default: break; + } } + + egg_prim->set_texture(egg_tex); } } @@ -717,73 +765,22 @@ convert_primitive(const GeomVertexData *vertex_data, const CullFaceAttrib *cfa; if (net_state->get_attrib(cfa)) { if (cfa->get_effective_mode() == CullFaceAttrib::M_cull_none) { - bface = true; - } - } - - // Check the depth write flag - only needed for AM_blend_no_occlude - bool has_depthwrite = false; - DepthWriteAttrib::Mode depthwrite = DepthWriteAttrib::M_on; - const DepthWriteAttrib *dwa; - if (net_state->get_attrib(dwa)) { - depthwrite = dwa->get_mode(); - has_depthwrite = true; - } - - // Check the transparency flag. - bool has_transparency = false; - TransparencyAttrib::Mode transparency = TransparencyAttrib::M_none; - const TransparencyAttrib *tra; - if (net_state->get_attrib(tra)) { - transparency = tra->get_mode(); - has_transparency = true; - } - if (has_transparency && (egg_tex != (EggTexture *)NULL)) { - EggRenderMode::AlphaMode tex_trans = EggRenderMode::AM_unspecified; - switch (transparency) { - case TransparencyAttrib::M_none: - tex_trans = EggRenderMode::AM_off; - break; - case TransparencyAttrib::M_alpha: - if (has_depthwrite && (depthwrite == DepthWriteAttrib::M_off)) { - tex_trans = EggRenderMode::AM_blend_no_occlude; - has_depthwrite = false; - } else { - tex_trans = EggRenderMode::AM_blend; - } - break; - case TransparencyAttrib::M_premultiplied_alpha: - tex_trans = EggRenderMode::AM_premultiplied; - break; - case TransparencyAttrib::M_multisample: - tex_trans = EggRenderMode::AM_ms; - break; - case TransparencyAttrib::M_multisample_mask: - tex_trans = EggRenderMode::AM_ms_mask; - break; - case TransparencyAttrib::M_binary: - tex_trans = EggRenderMode::AM_binary; - break; - case TransparencyAttrib::M_dual: - tex_trans = EggRenderMode::AM_dual; - break; - default: // intentional fall-through - break; - } - if (tex_trans != EggRenderMode::AM_unspecified) { - egg_tex->set_alpha_mode(tex_trans); + egg_prim->set_bface_flag(true); } } // Check for line thickness and such. - bool has_render_mode = false; - bool perspective = false; - PN_stdfloat thickness = 1; const RenderModeAttrib *rma; if (net_state->get_attrib(rma)) { - has_render_mode = true; - thickness = rma->get_thickness(); - perspective = rma->get_perspective(); + if (egg_prim->is_of_type(EggPoint::get_class_type())) { + EggPoint *egg_point = (EggPoint *)egg_prim.p(); + egg_point->set_thick(rma->get_thickness()); + egg_point->set_perspective(rma->get_perspective()); + + } else if (egg_prim->is_of_type(EggLine::get_class_type())) { + EggLine *egg_line = (EggLine *)egg_prim.p(); + egg_line->set_thick(rma->get_thickness()); + } } LNormal normal; @@ -793,48 +790,9 @@ convert_primitive(const GeomVertexData *vertex_data, int num_primitives = primitive->get_num_primitives(); int num_vertices = primitive->get_num_vertices_per_primitive(); - EggPrimitive *(*make_func)(void); - - if (primitive->is_of_type(GeomTriangles::get_class_type())) { - make_func = make_egg_polygon; - } else if (primitive->is_of_type(GeomPatches::get_class_type())) { - make_func = make_egg_patch; - } else if (primitive->is_of_type(GeomPoints::get_class_type())) { - make_func = make_egg_point; - } else if (primitive->is_of_type(GeomLines::get_class_type())) { - make_func = make_egg_line; - } else { - // Huh, an unknown geometry type. - return; - } - for (int i = 0; i < num_primitives; ++i) { - PT(EggPrimitive) egg_prim = (*make_func)(); - - egg_parent->add_child(egg_prim); - - if (egg_mat != (EggMaterial *)NULL) { - egg_prim->set_material(egg_mat); - } - if (egg_tex != (EggTexture *)NULL) { - egg_prim->set_texture(egg_tex); - } - - if (bface) { - egg_prim->set_bface_flag(true); - } - - if (has_render_mode) { - if (egg_prim->is_of_type(EggPoint::get_class_type())) { - EggPoint *egg_point = (EggPoint *)egg_prim.p(); - egg_point->set_thick(thickness); - egg_point->set_perspective(perspective); - - } else if (egg_prim->is_of_type(EggLine::get_class_type())) { - EggLine *egg_line = (EggLine *)egg_prim.p(); - egg_line->set_thick(thickness); - } - } + PT(EggPrimitive) egg_child = egg_prim->make_copy(); + egg_parent->add_child(egg_child); for (int j = 0; j < num_vertices; j++) { EggVertex egg_vert; @@ -898,7 +856,7 @@ convert_primitive(const GeomVertexData *vertex_data, } } - egg_prim->add_vertex(new_egg_vert); + egg_child->add_vertex(new_egg_vert); } } } @@ -1004,6 +962,97 @@ apply_node_properties(EggGroup *egg_group, PandaNode *node, bool allow_backstage any_applied = true; } + const RenderState *state = node->get_state(); + if (apply_state_properties(egg_group, state)) { + return true; + } + + return any_applied; +} + +/** + * Applies any special render state settings on the primitive or group. + * Returns true if any were applied, false otherwise. + */ +bool EggSaver:: +apply_state_properties(EggRenderMode *egg_render_mode, const RenderState *state) { + if (state->is_empty()) { + return false; + } + + bool any_applied = false; + + // Check the transparency mode. + const TransparencyAttrib *tra; + if (state->get_attrib(tra)) { + EggRenderMode::AlphaMode tex_trans = EggRenderMode::AM_unspecified; + switch (tra->get_mode()) { + case TransparencyAttrib::M_none: + tex_trans = EggRenderMode::AM_off; + break; + case TransparencyAttrib::M_alpha: + tex_trans = EggRenderMode::AM_blend; + break; + case TransparencyAttrib::M_premultiplied_alpha: + tex_trans = EggRenderMode::AM_premultiplied; + break; + case TransparencyAttrib::M_multisample: + tex_trans = EggRenderMode::AM_ms; + break; + case TransparencyAttrib::M_multisample_mask: + tex_trans = EggRenderMode::AM_ms_mask; + break; + case TransparencyAttrib::M_binary: + tex_trans = EggRenderMode::AM_binary; + break; + case TransparencyAttrib::M_dual: + tex_trans = EggRenderMode::AM_dual; + break; + default: // intentional fall-through + break; + } + egg_render_mode->set_alpha_mode(tex_trans); + } + + const DepthWriteAttrib *dwa; + if (state->get_attrib(dwa)) { + if (dwa->get_mode() != DepthWriteAttrib::M_off) { + egg_render_mode->set_depth_write_mode(EggRenderMode::DWM_on); + + } else if (egg_render_mode->get_alpha_mode() == EggRenderMode::AM_blend) { + // AM_blend_no_occlude is like AM_blend but also implies DWM_off. + egg_render_mode->set_alpha_mode(EggRenderMode::AM_blend_no_occlude); + + } else { + egg_render_mode->set_depth_write_mode(EggRenderMode::DWM_off); + } + any_applied = true; + } + + const DepthTestAttrib *dta; + if (state->get_attrib(dta)) { + RenderAttrib::PandaCompareFunc mode = dta->get_mode(); + if (mode == DepthTestAttrib::M_none || mode == DepthTestAttrib::M_always) { + egg_render_mode->set_depth_test_mode(EggRenderMode::DTM_off); + } else { + egg_render_mode->set_depth_test_mode(EggRenderMode::DTM_on); + } + any_applied = true; + } + + const DepthOffsetAttrib *doa; + if (state->get_attrib(doa)) { + egg_render_mode->set_depth_offset(doa->get_offset()); + any_applied = true; + } + + const CullBinAttrib *cba; + if (state->get_attrib(cba)) { + egg_render_mode->set_bin(cba->get_bin_name()); + egg_render_mode->set_draw_order(cba->get_draw_order()); + any_applied = true; + } + return any_applied; } @@ -1250,35 +1299,3 @@ get_egg_texture(Texture *tex) { return NULL; } - -/** - * A factory function to make a new EggPolygon instance. - */ -EggPrimitive *EggSaver:: -make_egg_polygon() { - return new EggPolygon; -} - -/** - * A factory function to make a new EggPatch instance. - */ -EggPrimitive *EggSaver:: -make_egg_patch() { - return new EggPatch; -} - -/** - * A factory function to make a new EggPoint instance. - */ -EggPrimitive *EggSaver:: -make_egg_point() { - return new EggPoint; -} - -/** - * A factory function to make a new EggLine instance. - */ -EggPrimitive *EggSaver:: -make_egg_line() { - return new EggLine; -} diff --git a/panda/src/egg2pg/eggSaver.h b/panda/src/egg2pg/eggSaver.h index 170e5fe46c..a361591241 100644 --- a/panda/src/egg2pg/eggSaver.h +++ b/panda/src/egg2pg/eggSaver.h @@ -55,6 +55,7 @@ PUBLISHED: EggSaver(EggData *data = NULL); void add_node(PandaNode *node); + void add_subgraph(PandaNode *root); INLINE EggData *get_egg_data() const; private: @@ -84,6 +85,7 @@ private: EggGroupNode *egg_parent, bool has_decal, CharacterJointMap *jointMap=NULL); void convert_primitive(const GeomVertexData *vertex_data, const GeomPrimitive *primitive, + const RenderState *geom_state, const RenderState *net_state, const LMatrix4 &net_mat, EggGroupNode *egg_parent, CharacterJointMap *jointMap); @@ -91,17 +93,13 @@ private: void recurse_nodes(const WorkingNodePath &node_path, EggGroupNode *egg_parent, bool has_decal, CharacterJointMap *joint_map); bool apply_node_properties(EggGroup *egg_group, PandaNode *node, bool allow_backstage = true); + bool apply_state_properties(EggRenderMode *egg_render_mode, const RenderState *state); bool apply_tags(EggGroup *egg_group, PandaNode *node); bool apply_tag(EggGroup *egg_group, PandaNode *node, const string &tag); EggMaterial *get_egg_material(Material *tex); EggTexture *get_egg_texture(Texture *tex); - static EggPrimitive *make_egg_polygon(); - static EggPrimitive *make_egg_patch(); - static EggPrimitive *make_egg_point(); - static EggPrimitive *make_egg_line(); - PT(EggData) _data; PT(EggVertexPool) _vpool; diff --git a/panda/src/egg2pg/save_egg_file.cxx b/panda/src/egg2pg/save_egg_file.cxx index db129802ba..95afdf5be2 100644 --- a/panda/src/egg2pg/save_egg_file.cxx +++ b/panda/src/egg2pg/save_egg_file.cxx @@ -31,7 +31,13 @@ save_egg_file(const Filename &filename, PandaNode *node, CoordinateSystem cs) { data->set_coordinate_system(cs); EggSaver saver(data); - saver.add_node(node); + if (node->is_of_type(ModelRoot::get_class_type())) { + // If this is a ModelRoot, only write the nodes below it. Otherwise we + // end up inserting a node when we do a bam2egg. + saver.add_subgraph(node); + } else { + saver.add_node(node); + } return data->write_egg(filename); } @@ -43,6 +49,12 @@ save_egg_file(const Filename &filename, PandaNode *node, CoordinateSystem cs) { bool save_egg_data(EggData *data, PandaNode *node) { EggSaver saver(data); - saver.add_node(node); + if (node->is_of_type(ModelRoot::get_class_type())) { + // If this is a ModelRoot, only write the nodes below it. Otherwise we + // end up inserting a node when we do a bam2egg. + saver.add_subgraph(node); + } else { + saver.add_node(node); + } return true; } From 6962f56915bb8bac52a0809eecc1b5adeaa6b996 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 14 Sep 2016 22:45:19 +0200 Subject: [PATCH 053/112] Add back pandac.extension_native_helpers for compatibility --- direct/src/p3d/panda3d.pdef | 3 +++ makepanda/makepanda.py | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/direct/src/p3d/panda3d.pdef b/direct/src/p3d/panda3d.pdef index 3edf48f8d2..860c0b4671 100644 --- a/direct/src/p3d/panda3d.pdef +++ b/direct/src/p3d/panda3d.pdef @@ -56,6 +56,9 @@ class panda3d(package): 'direct.stdpy.*', 'direct.task.*') + # Keep these modules for backward compatibility. + module('pandac.PandaModules', 'pandac.extension_native_helpers') + module('panda3d.core', 'panda3d.direct', 'panda3d.fx', diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 1413aa379b..0781e1e1c0 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -2750,8 +2750,14 @@ except ImportError as err: if "No module named %s" not in str(err): raise""" % (module, module) +exthelpers_code = """ +"This module is deprecated. Import from direct.extensions_native.extension_native_helpers instead." +from direct.extensions_native.extension_native_helpers import * +""" + if not PkgSkip("PYTHON"): ConditionalWriteFile(GetOutputDir() + '/pandac/PandaModules.py', panda_modules_code) + ConditionalWriteFile(GetOutputDir() + '/pandac/extension_native_helpers.py', exthelpers_code) ConditionalWriteFile(GetOutputDir() + '/pandac/__init__.py', '') ########################################################################################## From 7b555b17b132c8f0f427bdb10352d4c87765064d Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 15 Sep 2016 02:27:39 +0200 Subject: [PATCH 054/112] Fix rare Windows install bug: clears PATH env var if longer than 1024 chars --- doc/ReleaseNotes | 1 + makepanda/installer.nsi | 18 +++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index 49ed03cd78..1da0320973 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -36,6 +36,7 @@ This issue fixes several bugs that were still found in 1.9.2. * asyncFlattenStrong with inPlace=True caused node to disappear * Fix asyncFlattenStrong called on nodes without parent * Fix is_playing() check when playing an animation backwards +* Windows installer no longer clears %PATH% if longer than 1024 chars ------------------------ RELEASE 1.9.2 ------------------------ diff --git a/makepanda/installer.nsi b/makepanda/installer.nsi index c5e0df0e5f..8203954cf6 100755 --- a/makepanda/installer.nsi +++ b/makepanda/installer.nsi @@ -610,11 +610,7 @@ Section -post Call RemoveFromPath Push "$INSTDIR\bin" Call RemoveFromPath - Push "$INSTDIR\python" - Call AddToPath - Push "$INSTDIR\python\Scripts" - Call AddToPath - Push "$INSTDIR\bin" + Push "$INSTDIR\python;$INSTDIR\python\Scripts;$INSTDIR\bin" Call AddToPath # This is needed for the environment variable changes to take effect. @@ -897,8 +893,10 @@ Function AddToPath StrCmp $3 1 0 +2 ReadRegStr $1 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" - ; If the PATH string is empty, jump over the mangling routines. - StrCmp $1 "" AddToPath_NTdoIt + ; If the PATH string is empty, WATCH OUT. This probably means + ; the PATH surpassed NSIS' string limit. Don't overwrite it! + ; The only thing we can do is display an error message. + StrCmp $1 "" AddToPath_EmptyError ; Pull off the last character of the PATH string. If it's a semicolon, ; we don't need to add another one, so jump to the section where we @@ -906,6 +904,12 @@ Function AddToPath StrCpy $2 $1 1 -1 StrCmp $2 ";" AddToPath_NTAddPath AddToPath_NTAddSemi + AddToPath_EmptyError: + MessageBox MB_ABORTRETRYIGNORE|MB_ICONEXCLAMATION "Your PATH environment variable is too long! Please remove extraneous entries before proceeding. Panda3D needs to add the following the PATH so that the Panda3D utilities and libraries can be located correctly.$\n$\n$0$\n$\nIf you wish to add Panda3D to the path yourself, choose Ignore." IDIGNORE AddToPath_done IDRETRY AddToPath_NT + SetDetailsPrint both + DetailPrint "Cannot append to PATH - variable is likely too long." + SetDetailsPrint listonly + Abort AddToPath_NTAddSemi: StrCpy $1 "$1;" Goto AddToPath_NTAddPath From 4fb5d19df9500269be7ec3c211547ce6e797d934 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 16 Sep 2016 00:36:07 +0200 Subject: [PATCH 055/112] Windows: add right-click file associations for .pz/.mf/.egg/.bam files, produce .zip files containing the .pdb files --- makepanda/installer.nsi | 82 ++++++++++++++++++++++++++++++++++++----- makepanda/makepanda.py | 39 ++++++++++++++------ 2 files changed, 101 insertions(+), 20 deletions(-) diff --git a/makepanda/installer.nsi b/makepanda/installer.nsi index 4a7fcd446c..fc30e69738 100755 --- a/makepanda/installer.nsi +++ b/makepanda/installer.nsi @@ -42,7 +42,7 @@ SetCompressor ${COMPRESSOR} !define MUI_FINISHPAGE_RUN_TEXT "Visit the Panda3D Manual" !insertmacro MUI_PAGE_WELCOME -!insertmacro MUI_PAGE_LICENSE "../doc/LICENSE" +!insertmacro MUI_PAGE_LICENSE "${SOURCE}/doc/LICENSE" !insertmacro MUI_PAGE_DIRECTORY !define MUI_PAGE_CUSTOMFUNCTION_LEAVE ConfirmPythonSelection @@ -61,7 +61,7 @@ SetCompressor ${COMPRESSOR} ShowInstDetails hide ShowUninstDetails hide -LicenseData "${LICENSE}" +LicenseData "${SOURCE}/doc/LICENSE" InstType "Full (Recommended)" InstType "Minimal" @@ -259,6 +259,26 @@ Section "Tools and utilities" SecTools File /nonfatal /r "${BUILT}\bin\*.p3d" SetOutPath "$INSTDIR\NSIS" File /r /x CVS "${NSISDIR}\*" + + WriteRegStr HKCU "Software\Classes\Panda3D.Model" "" "Panda3D model/animation" + WriteRegStr HKCU "Software\Classes\Panda3D.Model\DefaultIcon" "" "$INSTDIR\bin\pview.exe" + WriteRegStr HKCU "Software\Classes\Panda3D.Model\shell" "" "open" + WriteRegStr HKCU "Software\Classes\Panda3D.Model\shell\open\command" "" '"$INSTDIR\bin\pview.exe" -l "%1"' + WriteRegStr HKCU "Software\Classes\Panda3D.Model\shell\compress" "" "Compress to .pz" + WriteRegStr HKCU "Software\Classes\Panda3D.Model\shell\compress\command" "" '"$INSTDIR\bin\pzip.exe" "%1"' + + WriteRegStr HKCU "Software\Classes\Panda3D.Compressed" "" "Compressed file" + WriteRegStr HKCU "Software\Classes\Panda3D.Compressed\DefaultIcon" "" "$INSTDIR\bin\pzip.exe" + WriteRegStr HKCU "Software\Classes\Panda3D.Compressed\shell" "" "open" + WriteRegStr HKCU "Software\Classes\Panda3D.Compressed\shell\open\command" "" '"$INSTDIR\bin\pview.exe" -l "%1"' + WriteRegStr HKCU "Software\Classes\Panda3D.Compressed\shell\decompress" "" "Decompress" + WriteRegStr HKCU "Software\Classes\Panda3D.Compressed\shell\decompress\command" "" '"$INSTDIR\bin\punzip.exe" "%1"' + + WriteRegStr HKCU "Software\Classes\Panda3D.Multifile" "" "Panda3D Multifile" + WriteRegStr HKCU "Software\Classes\Panda3D.Multifile\DefaultIcon" "" "$INSTDIR\bin\multify.exe" + WriteRegStr HKCU "Software\Classes\Panda3D.Multifile\shell" "" "open" + WriteRegStr HKCU "Software\Classes\Panda3D.Multifile\shell\extract" "" "Extract here" + WriteRegStr HKCU "Software\Classes\Panda3D.Multifile\shell\extract\command" "" '"$INSTDIR\bin\multify.exe" -xf "%1"' SectionEnd SectionGroup "Python support" @@ -369,7 +389,7 @@ SectionGroup "Python support" File /nonfatal "${BUILT}\bin\python*.dll" SetOutPath "$INSTDIR\python" - File /r "${BUILT}\python\*" + File /r /x *.pdb "${BUILT}\python\*" SetDetailsPrint both DetailPrint "Adding registry keys for Python..." @@ -593,6 +613,33 @@ Section -post SetOutPath $INSTDIR CreateShortcut "$SMPROGRAMS\${TITLE}\Uninstall ${TITLE}.lnk" "$INSTDIR\uninst.exe" "" + SetDetailsPrint both + DetailPrint "Registering file type associations..." + SetDetailsPrint listonly + + ; Even though we need the runtime to run these, we might as well tell + ; Windows what this kind of file is. + WriteRegStr HKCU "Software\Classes\.p3d" "" "Panda3D applet" + WriteRegStr HKCU "Software\Classes\.p3d" "Content Type" "application/x-panda3d" + WriteRegStr HKCU "Software\Classes\.p3d" "PerceivedType" "application" + + ; Register various model files + WriteRegStr HKCU "Software\Classes\.egg" "" "Panda3D.Model" + WriteRegStr HKCU "Software\Classes\.egg" "Content Type" "application/x-egg" + WriteRegStr HKCU "Software\Classes\.egg" "PerceivedType" "gamemedia" + WriteRegStr HKCU "Software\Classes\.bam" "" "Panda3D.Model" + WriteRegStr HKCU "Software\Classes\.bam" "Content Type" "application/x-bam" + WriteRegStr HKCU "Software\Classes\.bam" "PerceivedType" "gamemedia" + WriteRegStr HKCU "Software\Classes\.pz" "" "Panda3D.Compressed" + WriteRegStr HKCU "Software\Classes\.pz" "PerceivedType" "compressed" + WriteRegStr HKCU "Software\Classes\.mf" "" "Panda3D.Multifile" + WriteRegStr HKCU "Software\Classes\.mf" "PerceivedType" "compressed" + + ; For convenience, if nobody registered .pyd, we will. + ReadRegStr $0 HKCR "Software\Classes\.pyd" "" + StrCmp $0 "" 0 +2 + WriteRegStr HKCU "Software\Classes\.pyd" "" "dllfile" + SetDetailsPrint both DetailPrint "Adding directories to system PATH..." SetDetailsPrint listonly @@ -628,15 +675,28 @@ Section Uninstall DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${TITLE}" DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${TITLE}" + ReadRegStr $0 HKCU "Software\Classes\Panda3D.Model\DefaultIcon" "" + StrCmp $0 "$INSTDIR\bin\pview.exe" 0 +3 + DeleteRegKey HKCU "Software\Classes\Panda3D.Model\DefaultIcon" + DeleteRegKey HKCU "Software\Classes\Panda3D.Model\shell" + + ReadRegStr $0 HKCU "Software\Classes\Panda3D.Compressed\DefaultIcon" "" + StrCmp $0 "$INSTDIR\bin\pzip.exe" 0 +3 + DeleteRegKey HKCU "Software\Classes\Panda3D.Compressed\DefaultIcon" + DeleteRegKey HKCU "Software\Classes\Panda3D.Compressed\shell" + + ReadRegStr $0 HKCU "Software\Classes\Panda3D.Multifile\DefaultIcon" "" + StrCmp $0 "$INSTDIR\bin\multify.exe" 0 +3 + DeleteRegKey HKCU "Software\Classes\Panda3D.Multifile\DefaultIcon" + DeleteRegKey HKCU "Software\Classes\Panda3D.Multifile\shell" + ReadRegStr $0 HKLM "Software\Python\PythonCore\${PYVER}\InstallPath" "" - StrCmp $0 "$INSTDIR\python" 0 SkipUnRegHKLM + StrCmp $0 "$INSTDIR\python" 0 +2 DeleteRegKey HKLM "Software\Python\PythonCore\${PYVER}" - SkipUnRegHKLM: ReadRegStr $0 HKCU "Software\Python\PythonCore\${PYVER}\InstallPath" "" - StrCmp $0 "$INSTDIR\python" 0 SkipUnRegHKCU + StrCmp $0 "$INSTDIR\python" 0 +2 DeleteRegKey HKCU "Software\Python\PythonCore\${PYVER}" - SkipUnRegHKCU: SetDetailsPrint both DetailPrint "Deleting files..." @@ -702,9 +762,13 @@ SectionEnd !endif !insertmacro MUI_DESCRIPTION_TEXT ${SecTools} $(DESC_SecTools) !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings} $(DESC_SecPyBindings) - !insertmacro MUI_DESCRIPTION_TEXT ${SecPython} $(DESC_SecPython) + !ifdef HAVE_PYTHON + !insertmacro MUI_DESCRIPTION_TEXT ${SecPython} $(DESC_SecPython) + !endif !insertmacro MUI_DESCRIPTION_TEXT ${SecHeadersLibs} $(DESC_SecHeadersLibs) - !insertmacro MUI_DESCRIPTION_TEXT ${SecSamples} $(DESC_SecSamples) + !ifdef HAVE_SAMPLES + !insertmacro MUI_DESCRIPTION_TEXT ${SecSamples} $(DESC_SecSamples) + !endif !ifdef HAVE_MAX_PLUGINS !insertmacro MUI_DESCRIPTION_TEXT ${SecMaxPlugins} $(DESC_SecMaxPlugins) !endif diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 0781e1e1c0..8cde77e0f7 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -6538,17 +6538,14 @@ def MakeInstallerNSIS(file, title, installdir): if (os.path.exists("nsis-output.exe")): os.remove("nsis-output.exe") WriteFile(GetOutputDir()+"/tmp/__init__.py", "") - psource = os.path.abspath(".") - panda = os.path.abspath(GetOutputDir()) nsis_defs = { 'COMPRESSOR' : COMPRESSOR, 'TITLE' : title, 'INSTALLDIR' : installdir, - 'OUTFILE' : os.path.join(psource, 'nsis-output.exe'), - 'LICENSE' : os.path.join(panda, 'LICENSE'), - 'BUILT' : panda, - 'SOURCE' : psource, + 'OUTFILE' : '..\\' + file, + 'BUILT' : '..\\' + GetOutputDir(), + 'SOURCE' : '..', 'PYVER' : SDK["PYTHONVERSION"][6:9], 'REGVIEW' : regview, } @@ -6562,10 +6559,29 @@ def MakeInstallerNSIS(file, title, installdir): for item in nsis_defs.items(): cmd += ' -D%s="%s"' % item - cmd += ' "%s"' % (os.path.join(psource, 'makepanda', 'installer.nsi')) + cmd += ' "makepanda\installer.nsi"' oscmd(cmd) - os.rename("nsis-output.exe", file) +def MakeDebugSymbolArchive(zipname, dirname): + import zipfile + zip = zipfile.ZipFile(zipname, 'w', zipfile.ZIP_DEFLATED) + + for fn in glob.glob(os.path.join(GetOutputDir(), 'bin', '*.pdb')): + zip.write(fn, dirname + '/bin/' + os.path.basename(fn)) + + for fn in glob.glob(os.path.join(GetOutputDir(), 'panda3d', '*.pdb')): + zip.write(fn, dirname + '/panda3d/' + os.path.basename(fn)) + + for fn in glob.glob(os.path.join(GetOutputDir(), 'plugins', '*.pdb')): + zip.write(fn, dirname + '/plugins/' + os.path.basename(fn)) + + for fn in glob.glob(os.path.join(GetOutputDir(), 'python', '*.pdb')): + zip.write(fn, dirname + '/python/' + os.path.basename(fn)) + + for fn in glob.glob(os.path.join(GetOutputDir(), 'python', 'DLLs', '*.pdb')): + zip.write(fn, dirname + '/python/DLLs/' + os.path.basename(fn)) + + zip.close() INSTALLER_DEB_FILE=""" Package: panda3dMAJOR @@ -7135,7 +7151,7 @@ try: target = GetTarget() if target == 'windows': fn = "Panda3D-" - dir = "C:\\Panda3D-" + VERSION + dir = "Panda3D-" + VERSION if RUNTIME: fn += "Runtime-" @@ -7154,8 +7170,9 @@ try: fn += '-x64' dir += '-x64' - fn += '.exe' - MakeInstallerNSIS(fn, title, dir) + MakeInstallerNSIS(fn + '.exe', title, 'C:\\' + dir) + if not RUNTIME: + MakeDebugSymbolArchive(fn + '-pdb.zip', dir) elif (target == 'linux'): MakeInstallerLinux() elif (target == 'darwin'): From 3eed7bc0427aa533db16fdcf0af402c1aaf11e35 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 16 Sep 2016 00:54:00 +0200 Subject: [PATCH 056/112] Fix compilation issue for gcc versions before 4.3 --- panda/src/movies/dr_flac.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/panda/src/movies/dr_flac.h b/panda/src/movies/dr_flac.h index c6da7b9004..26d133191d 100644 --- a/panda/src/movies/dr_flac.h +++ b/panda/src/movies/dr_flac.h @@ -503,7 +503,7 @@ static DRFLAC_INLINE uint32_t drflac__swap_endian_uint32(uint32_t n) { #ifdef _MSC_VER return _byteswap_ulong(n); -#elif defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC__ >= 3)) +#elif defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) return __builtin_bswap32(n); #else return ((n & 0xFF000000) >> 24) | @@ -517,7 +517,7 @@ static DRFLAC_INLINE uint64_t drflac__swap_endian_uint64(uint64_t n) { #ifdef _MSC_VER return _byteswap_uint64(n); -#elif defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC__ >= 3)) +#elif defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) return __builtin_bswap64(n); #else return ((n & 0xFF00000000000000ULL) >> 56) | From 7c79a999a55079f5df7890cd8455635ef347d39d Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 16 Sep 2016 12:58:27 +0200 Subject: [PATCH 057/112] Fix optimize=4 build on Windows; adjust Travis to make one opt4 build --- .travis.yml | 2 +- panda/src/downloader/multiplexStreamBuf.cxx | 17 ++++++++++------- panda/src/downloader/multiplexStreamBuf.h | 4 ++-- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6c6a399e23..c8176d293b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ sudo: false matrix: include: - compiler: gcc - env: PYTHONV=python2.7 FLAGS= + env: PYTHONV=python2.7 FLAGS=--optimize=4 - compiler: clang env: PYTHONV=python3 FLAGS=--installer - compiler: clang diff --git a/panda/src/downloader/multiplexStreamBuf.cxx b/panda/src/downloader/multiplexStreamBuf.cxx index daa2d78ed9..96d4a22755 100644 --- a/panda/src/downloader/multiplexStreamBuf.cxx +++ b/panda/src/downloader/multiplexStreamBuf.cxx @@ -12,7 +12,6 @@ */ #include "multiplexStreamBuf.h" -#include "lightMutexHolder.h" #if defined(WIN32_VC) || defined(WIN64_VC) #define WINDOWS_LEAN_AND_MEAN @@ -114,8 +113,6 @@ void MultiplexStreamBuf:: add_output(MultiplexStreamBuf::BufferType buffer_type, MultiplexStreamBuf::OutputType output_type, ostream *out, FILE *fout, bool owns_obj) { - // Ensure that we have the mutex while we fiddle with the list of outputs. - LightMutexHolder holder(_lock); Output o; o._buffer_type = buffer_type; @@ -123,7 +120,11 @@ add_output(MultiplexStreamBuf::BufferType buffer_type, o._out = out; o._fout = fout; o._owns_obj = owns_obj; + + // Ensure that we have the mutex while we fiddle with the list of outputs. + _lock.acquire(); _outputs.push_back(o); + _lock.release(); } @@ -132,9 +133,9 @@ add_output(MultiplexStreamBuf::BufferType buffer_type, */ void MultiplexStreamBuf:: flush() { - LightMutexHolder holder(_lock); - + _lock.acquire(); write_chars("", 0, true); + _lock.release(); } /** @@ -143,7 +144,7 @@ flush() { */ int MultiplexStreamBuf:: overflow(int ch) { - LightMutexHolder holder(_lock); + _lock.acquire(); streamsize n = pptr() - pbase(); @@ -158,6 +159,7 @@ overflow(int ch) { write_chars(&c, 1, false); } + _lock.release(); return 0; } @@ -167,7 +169,7 @@ overflow(int ch) { */ int MultiplexStreamBuf:: sync() { - LightMutexHolder holder(_lock); + _lock.acquire(); streamsize n = pptr() - pbase(); @@ -179,6 +181,7 @@ sync() { write_chars(pbase(), n, false); pbump(-n); + _lock.release(); return 0; // Return 0 for success, EOF to indicate write full. } diff --git a/panda/src/downloader/multiplexStreamBuf.h b/panda/src/downloader/multiplexStreamBuf.h index 52a75c5ff9..d869124116 100644 --- a/panda/src/downloader/multiplexStreamBuf.h +++ b/panda/src/downloader/multiplexStreamBuf.h @@ -17,7 +17,7 @@ #include "pandabase.h" #include "pvector.h" -#include "lightMutex.h" +#include "mutexImpl.h" #include /** @@ -70,7 +70,7 @@ private: typedef pvector Outputs; Outputs _outputs; - LightMutex _lock; + MutexImpl _lock; string _line_buffer; }; From c9ea02445edca2e91aec440ffde5967f03d06fe5 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 18 Sep 2016 11:31:04 +0200 Subject: [PATCH 058/112] Fix state attribs at primitive level in bam2egg; also prevent duplication of state attribs at primitive level if possible --- panda/src/egg/eggPrimitive.I | 2 ++ panda/src/egg2pg/eggSaver.cxx | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/panda/src/egg/eggPrimitive.I b/panda/src/egg/eggPrimitive.I index 68ba3de1e3..d849d23882 100644 --- a/panda/src/egg/eggPrimitive.I +++ b/panda/src/egg/eggPrimitive.I @@ -27,6 +27,7 @@ INLINE EggPrimitive:: EggPrimitive(const EggPrimitive ©) : EggNode(copy), EggAttributes(copy), + EggRenderMode(copy), _textures(copy._textures), _material(copy._material), _bface(copy._bface) @@ -42,6 +43,7 @@ INLINE EggPrimitive &EggPrimitive:: operator = (const EggPrimitive ©) { EggNode::operator = (copy); EggAttributes::operator = (copy); + EggRenderMode::operator = (copy); copy_vertices(copy); _textures = copy._textures; _material = copy._material; diff --git a/panda/src/egg2pg/eggSaver.cxx b/panda/src/egg2pg/eggSaver.cxx index 97f564ae9b..bce14af761 100644 --- a/panda/src/egg2pg/eggSaver.cxx +++ b/panda/src/egg2pg/eggSaver.cxx @@ -640,6 +640,15 @@ convert_geom_node(GeomNode *node, const WorkingNodePath &node_path, CPT(RenderState) geom_state = node->get_geom_state(i); CPT(RenderState) geom_net_state = net_state->compose(geom_state); + // If there is only one Geom, and the node has no state, apply the state + // attributes from the Geom to the group instead, so that we don't end up + // duplicating it for a lot of primitives. + if (num_geoms == 1 && node->get_num_children() == 0 && egg_parent == egg_group && + !geom_state->is_empty() && node->get_state()->is_empty()) { + apply_state_properties(egg_group, geom_state); + geom_state = RenderState::make_empty(); + } + const Geom *geom = node->get_geom(i); int num_primitives = geom->get_num_primitives(); for (int j = 0; j < num_primitives; ++j) { From 3ee033eeeb2d9a0e4977747188116c342b0f1dd0 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 27 Sep 2016 21:32:55 +0200 Subject: [PATCH 059/112] Write texture types when pview failed to recognise extension --- panda/src/framework/windowFramework.cxx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/panda/src/framework/windowFramework.cxx b/panda/src/framework/windowFramework.cxx index 9f4ea1eecb..9f808d5d78 100644 --- a/panda/src/framework/windowFramework.cxx +++ b/panda/src/framework/windowFramework.cxx @@ -639,10 +639,13 @@ load_model(const NodePath &parent, Filename filename) { extension = Filename(filename.get_basename_wo_extension()).get_extension(); } #endif // HAVE_ZLIB + TexturePool *texture_pool = TexturePool::get_global_ptr(); + LoaderFileType *model_type = NULL; + if (!extension.empty()) { LoaderFileTypeRegistry *reg = LoaderFileTypeRegistry::get_global_ptr(); - LoaderFileType *model_type = - reg->get_type_from_extension(extension); + model_type = reg->get_type_from_extension(extension); + if (model_type == (LoaderFileType *)NULL) { // The extension isn't a known model file type; is it a known // image file extension? @@ -652,7 +655,6 @@ load_model(const NodePath &parent, Filename filename) { is_image = true; } else { - TexturePool *texture_pool = TexturePool::get_global_ptr(); if (texture_pool->get_texture_type(extension) != NULL) { // It is a known image file extension. is_image = true; @@ -674,6 +676,13 @@ load_model(const NodePath &parent, Filename filename) { node = load_image_as_model(filename); } else { node = loader.load_sync(filename, options); + + // It failed to load. Is it because the extension isn't recognised? If + // so, then we just got done printing out the known scene types, and we + // should also print out the supported texture types. + if (node == (PandaNode *)NULL && !is_image && model_type == NULL) { + texture_pool->write_texture_types(nout, 2); + } } if (node == (PandaNode *)NULL) { From aa74caacbe92ff987691c99adeaaf18659673b90 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 27 Sep 2016 21:35:38 +0200 Subject: [PATCH 060/112] Fix inoperative -tbn/-tbnall/-tbnauto options in egg-optchar --- doc/ReleaseNotes | 1 + pandatool/src/eggbase/eggMultiBase.cxx | 27 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index 1da0320973..ce390136fc 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -37,6 +37,7 @@ This issue fixes several bugs that were still found in 1.9.2. * Fix asyncFlattenStrong called on nodes without parent * Fix is_playing() check when playing an animation backwards * Windows installer no longer clears %PATH% if longer than 1024 chars +* Fix inoperative -tbn/-tbnall/-tbnauto options in egg-optchar ------------------------ RELEASE 1.9.2 ------------------------ diff --git a/pandatool/src/eggbase/eggMultiBase.cxx b/pandatool/src/eggbase/eggMultiBase.cxx index 27513e6dfe..1f1a0e3bea 100644 --- a/pandatool/src/eggbase/eggMultiBase.cxx +++ b/pandatool/src/eggbase/eggMultiBase.cxx @@ -111,6 +111,33 @@ post_process_egg_files() { // Do nothing. break; } + + if (_got_tbnall) { + for (ei = _eggs.begin(); ei != _eggs.end(); ++ei) { + if ((*ei)->recompute_tangent_binormal(GlobPattern("*"))) { + (*ei)->remove_unused_vertices(true); + } + } + } else { + if (_got_tbnauto) { + for (ei = _eggs.begin(); ei != _eggs.end(); ++ei) { + if ((*ei)->recompute_tangent_binormal_auto()) { + (*ei)->remove_unused_vertices(true); + } + } + } + + for (vector_string::const_iterator si = _tbn_names.begin(); + si != _tbn_names.end(); + ++si) { + GlobPattern uv_name(*si); + nout << "Computing tangent and binormal for \"" << uv_name << "\"\n"; + for (ei = _eggs.begin(); ei != _eggs.end(); ++ei) { + (*ei)->recompute_tangent_binormal(uv_name); + (*ei)->remove_unused_vertices(true); + } + } + } } From 2e9394eba70f049d632684f78f7ef94b2d3ca00b Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 27 Sep 2016 22:37:13 +0200 Subject: [PATCH 061/112] Fix tinydisplay texture errors on shutdown --- doc/ReleaseNotes | 1 + .../tinydisplay/tinyGraphicsStateGuardian.cxx | 17 +--------------- panda/src/tinydisplay/tinyTextureContext.I | 10 ---------- panda/src/tinydisplay/tinyTextureContext.cxx | 20 +++++++++++++++++++ panda/src/tinydisplay/tinyTextureContext.h | 2 +- 5 files changed, 23 insertions(+), 27 deletions(-) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index ce390136fc..5b0b4c6478 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -38,6 +38,7 @@ This issue fixes several bugs that were still found in 1.9.2. * Fix is_playing() check when playing an animation backwards * Windows installer no longer clears %PATH% if longer than 1024 chars * Fix inoperative -tbn/-tbnall/-tbnauto options in egg-optchar +* Fix tinydisplay texture errors on shutdown ------------------------ RELEASE 1.9.2 ------------------------ diff --git a/panda/src/tinydisplay/tinyGraphicsStateGuardian.cxx b/panda/src/tinydisplay/tinyGraphicsStateGuardian.cxx index b9efe215c5..4e865ad855 100644 --- a/panda/src/tinydisplay/tinyGraphicsStateGuardian.cxx +++ b/panda/src/tinydisplay/tinyGraphicsStateGuardian.cxx @@ -1800,24 +1800,9 @@ update_texture(TextureContext *tc, bool force, int stage_index, bool uses_mipmap //////////////////////////////////////////////////////////////////// void TinyGraphicsStateGuardian:: release_texture(TextureContext *tc) { - TinyTextureContext *gtc = DCAST(TinyTextureContext, tc); - _texturing_state = 0; // just in case - GLTexture *gltex = >c->_gltex; - if (gltex->allocated_buffer != NULL) { - nassertv(gltex->num_levels != 0); - TinyTextureContext::get_class_type().dec_memory_usage(TypeHandle::MC_array, gltex->total_bytecount); - PANDA_FREE_ARRAY(gltex->allocated_buffer); - gltex->allocated_buffer = NULL; - gltex->total_bytecount = 0; - gltex->num_levels = 0; - } else { - nassertv(gltex->num_levels == 0); - } - - gtc->dequeue_lru(); - + TinyTextureContext *gtc = DCAST(TinyTextureContext, tc); delete gtc; } diff --git a/panda/src/tinydisplay/tinyTextureContext.I b/panda/src/tinydisplay/tinyTextureContext.I index ef223f668a..40545856a7 100644 --- a/panda/src/tinydisplay/tinyTextureContext.I +++ b/panda/src/tinydisplay/tinyTextureContext.I @@ -26,13 +26,3 @@ TinyTextureContext(PreparedGraphicsObjects *pgo, Texture *tex, int view) : _gltex.allocated_buffer = NULL; _gltex.total_bytecount = 0; } - -//////////////////////////////////////////////////////////////////// -// Function: TinyTextureContext::Destructor -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE TinyTextureContext:: -~TinyTextureContext() { - nassertv(_gltex.num_levels == 0 && _gltex.allocated_buffer == NULL && _gltex.total_bytecount == 0); -} diff --git a/panda/src/tinydisplay/tinyTextureContext.cxx b/panda/src/tinydisplay/tinyTextureContext.cxx index 3addd211ff..eba0a3ea63 100644 --- a/panda/src/tinydisplay/tinyTextureContext.cxx +++ b/panda/src/tinydisplay/tinyTextureContext.cxx @@ -17,6 +17,26 @@ TypeHandle TinyTextureContext::_type_handle; +//////////////////////////////////////////////////////////////////// +// Function: TinyTextureContext::Destructor +// Access: Public +// Description: Releases the memory associated with the texture. +//////////////////////////////////////////////////////////////////// +TinyTextureContext:: +~TinyTextureContext() { + GLTexture *gltex = &_gltex; + if (gltex->allocated_buffer != NULL) { + nassertv(gltex->num_levels != 0); + TinyTextureContext::get_class_type().dec_memory_usage(TypeHandle::MC_array, gltex->total_bytecount); + PANDA_FREE_ARRAY(gltex->allocated_buffer); + gltex->allocated_buffer = NULL; + gltex->total_bytecount = 0; + gltex->num_levels = 0; + } else { + nassertv(gltex->num_levels == 0); + } +} + //////////////////////////////////////////////////////////////////// // Function: TinyTextureContext::evict_lru // Access: Public, Virtual diff --git a/panda/src/tinydisplay/tinyTextureContext.h b/panda/src/tinydisplay/tinyTextureContext.h index e98547bc0e..13da745e14 100644 --- a/panda/src/tinydisplay/tinyTextureContext.h +++ b/panda/src/tinydisplay/tinyTextureContext.h @@ -29,7 +29,7 @@ public: INLINE TinyTextureContext(PreparedGraphicsObjects *pgo, Texture *tex, int view); ALLOC_DELETED_CHAIN(TinyTextureContext); - INLINE ~TinyTextureContext(); + ~TinyTextureContext(); virtual void evict_lru(); From 3f5399437221259bf0940e9bb2d3eb1d4e3ece42 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 28 Sep 2016 00:00:22 +0200 Subject: [PATCH 062/112] Fix mipmap filtering issues in tinydisplay renderer --- doc/ReleaseNotes | 1 + panda/src/tinydisplay/zbuffer.cxx | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index 5b0b4c6478..0728f34023 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -39,6 +39,7 @@ This issue fixes several bugs that were still found in 1.9.2. * Windows installer no longer clears %PATH% if longer than 1024 chars * Fix inoperative -tbn/-tbnall/-tbnauto options in egg-optchar * Fix tinydisplay texture errors on shutdown +* Fix mipmap filtering issues in tinydisplay renderer ------------------------ RELEASE 1.9.2 ------------------------ diff --git a/panda/src/tinydisplay/zbuffer.cxx b/panda/src/tinydisplay/zbuffer.cxx index 4623a85353..cc25320646 100644 --- a/panda/src/tinydisplay/zbuffer.cxx +++ b/panda/src/tinydisplay/zbuffer.cxx @@ -489,11 +489,11 @@ lookup_texture_mipmap_linear(ZTextureDef *texture_def, int s, int t, unsigned in level = max((int)level - 1, 0); p2 = ZB_LOOKUP_TEXTURE_MIPMAP_NEAREST(texture_def, s, t, level); - unsigned int bitsize = level + ZB_POINT_ST_FRAC_BITS; - r = LINEAR_FILTER_BITSIZE(PIXEL_R(p2), PIXEL_R(p1), level_dx, bitsize); - g = LINEAR_FILTER_BITSIZE(PIXEL_G(p2), PIXEL_G(p1), level_dx, bitsize); - b = LINEAR_FILTER_BITSIZE(PIXEL_B(p2), PIXEL_B(p1), level_dx, bitsize); - a = LINEAR_FILTER_BITSIZE(PIXEL_A(p2), PIXEL_A(p1), level_dx, bitsize); + unsigned int f = level_dx >> (level - 1); + r = LINEAR_FILTER(PIXEL_R(p1), PIXEL_R(p2), f); + g = LINEAR_FILTER(PIXEL_G(p1), PIXEL_G(p2), f); + b = LINEAR_FILTER(PIXEL_B(p1), PIXEL_B(p2), f); + a = LINEAR_FILTER(PIXEL_A(p1), PIXEL_A(p2), f); return RGBA_TO_PIXEL(r, g, b, a); } @@ -570,11 +570,11 @@ lookup_texture_mipmap_trilinear(ZTextureDef *texture_def, int s, int t, unsigned } int r, g, b, a; - unsigned int bitsize = level + ZB_POINT_ST_FRAC_BITS; - r = LINEAR_FILTER_BITSIZE(PIXEL_R(p2a), PIXEL_R(p1a), level_dx, bitsize); - g = LINEAR_FILTER_BITSIZE(PIXEL_G(p2a), PIXEL_G(p1a), level_dx, bitsize); - b = LINEAR_FILTER_BITSIZE(PIXEL_B(p2a), PIXEL_B(p1a), level_dx, bitsize); - a = LINEAR_FILTER_BITSIZE(PIXEL_A(p2a), PIXEL_A(p1a), level_dx, bitsize); + unsigned int f = level_dx >> (level - 1); + r = LINEAR_FILTER(PIXEL_R(p1a), PIXEL_R(p2a), f); + g = LINEAR_FILTER(PIXEL_G(p1a), PIXEL_G(p2a), f); + b = LINEAR_FILTER(PIXEL_B(p1a), PIXEL_B(p2a), f); + a = LINEAR_FILTER(PIXEL_A(p1a), PIXEL_A(p2a), f); return RGBA_TO_PIXEL(r, g, b, a); } From 231ca47edd20c8576df6cb94f656579160cd1fdf Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 28 Sep 2016 00:08:28 +0200 Subject: [PATCH 063/112] Windows installer: More robust and less error-prone PATH changing --- makepanda/installer.nsi | 317 +++++++++++----------------------------- 1 file changed, 87 insertions(+), 230 deletions(-) diff --git a/makepanda/installer.nsi b/makepanda/installer.nsi index 8203954cf6..fa504d99c8 100755 --- a/makepanda/installer.nsi +++ b/makepanda/installer.nsi @@ -886,17 +886,16 @@ Function AddToPath Goto AddToPath_done AddToPath_NT: + ClearErrors ReadRegStr $1 HKCU "Environment" "PATH" - Call IsUserAdmin - Pop $3 - ; If this is an Admin user, use the System env. variable instead of the user's env. variable - StrCmp $3 1 0 +2 - ReadRegStr $1 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" - ; If the PATH string is empty, WATCH OUT. This probably means - ; the PATH surpassed NSIS' string limit. Don't overwrite it! - ; The only thing we can do is display an error message. - StrCmp $1 "" AddToPath_EmptyError + ; If we reached an error, WATCH OUT. Either this means that + ; the registry key did not exist, or that it didn't fit in + ; NSIS' string limit. If the latter, we have to be very + ; careful not to overwrite the user's PATH. + IfErrors AddToPath_Error + DetailPrint "Current PATH value is set to $1" + StrCmp $1 "" AddToPath_NTAddPath ; Pull off the last character of the PATH string. If it's a semicolon, ; we don't need to add another one, so jump to the section where we @@ -904,7 +903,20 @@ Function AddToPath StrCpy $2 $1 1 -1 StrCmp $2 ";" AddToPath_NTAddPath AddToPath_NTAddSemi - AddToPath_EmptyError: + AddToPath_Error: + DetailPrint "Encountered error reading PATH variable." + ; Does the variable exist? If it doesn't, then the + ; error happened because we need to create the + ; variable. If it does, then we failed to read it + ; because we reached NSIS' string limit. + StrCpy $3 0 + AddToPath_loop: + EnumRegValue $4 HKCU "Environment" $3 + StrCmp $4 "PATH" AddToPath_ExceedLimit + StrCmp $4 "" AddToPath_NTAddPath + IntOp $3 $3 + 1 + Goto AddToPath_loop + AddToPath_ExceedLimit: MessageBox MB_ABORTRETRYIGNORE|MB_ICONEXCLAMATION "Your PATH environment variable is too long! Please remove extraneous entries before proceeding. Panda3D needs to add the following the PATH so that the Panda3D utilities and libraries can be located correctly.$\n$\n$0$\n$\nIf you wish to add Panda3D to the path yourself, choose Ignore." IDIGNORE AddToPath_done IDRETRY AddToPath_NT SetDetailsPrint both DetailPrint "Cannot append to PATH - variable is likely too long." @@ -915,16 +927,7 @@ Function AddToPath Goto AddToPath_NTAddPath AddToPath_NTAddPath: StrCpy $0 "$1$0" - Goto AddToPath_NTdoIt - AddToPath_NTdoIt: - Call IsUserAdmin - Pop $3 - StrCmp $3 1 0 NotAdmin - WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" $0 - Goto AddToPath_done - - NotAdmin: - WriteRegExpandStr HKCU "Environment" "PATH" $0 + WriteRegExpandStr HKCU "Environment" "PATH" $0 AddToPath_done: Pop $3 Pop $2 @@ -975,42 +978,40 @@ Function RemoveFromPath Goto unRemoveFromPath_done unRemoveFromPath_NT: + Push $0 StrLen $2 $0 - Call IsUserAdmin - Pop $5 - StrCmp $5 1 0 NotAdmin - ReadRegStr $1 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" - Push $1 - Push $0 - Call StrStr ; Find $0 in $1 - Pop $0 ; pos of our dir - IntCmp $0 -1 unRemoveFromPath_done - ; else, it is in path - StrCpy $3 $1 $0 ; $3 now has the part of the path before our dir - IntOp $2 $2 + $0 ; $2 now contains the pos after our dir in the path (';') - IntOp $2 $2 + 1 ; $2 now containts the pos after our dir and the semicolon. - StrLen $0 $1 - StrCpy $1 $1 $0 $2 - StrCpy $3 "$3$1" - WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" $3 - Goto unRemoveFromPath_done + ReadRegStr $1 HKCU "Environment" "PATH" + Push $1 + Push $0 + Call StrStr ; Find $0 in $1 + Pop $0 ; pos of our dir + IntCmp $0 -1 unRemoveFromPath_NT_System + ; else, it is in path + StrCpy $3 $1 $0 ; $3 now has the part of the path before our dir + IntOp $2 $2 + $0 ; $2 now contains the pos after our dir in the path (';') + IntOp $2 $2 + 1 ; $2 now containts the pos after our dir and the semicolon. + StrLen $0 $1 + StrCpy $1 $1 $0 $2 + StrCpy $3 "$3$1" + WriteRegExpandStr HKCU "Environment" "PATH" $3 - - NotAdmin: - ReadRegStr $1 HKCU "Environment" "PATH" - Push $1 - Push $0 - Call StrStr ; Find $0 in $1 - Pop $0 ; pos of our dir - IntCmp $0 -1 unRemoveFromPath_done - ; else, it is in path - StrCpy $3 $1 $0 ; $3 now has the part of the path before our dir - IntOp $2 $2 + $0 ; $2 now contains the pos after our dir in the path (';') - IntOp $2 $2 + 1 ; $2 now containts the pos after our dir and the semicolon. - StrLen $0 $1 - StrCpy $1 $1 $0 $2 - StrCpy $3 "$3$1" - WriteRegExpandStr HKCU "Environment" "PATH" $3 + unRemoveFromPath_NT_System: + Pop $0 + StrLen $2 $0 + ReadRegStr $1 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" + Push $1 + Push $0 + Call StrStr ; Find $0 in $1 + Pop $0 ; pos of our dir + IntCmp $0 -1 unRemoveFromPath_done + ; else, it is in path + StrCpy $3 $1 $0 ; $3 now has the part of the path before our dir + IntOp $2 $2 + $0 ; $2 now contains the pos after our dir in the path (';') + IntOp $2 $2 + 1 ; $2 now containts the pos after our dir and the semicolon. + StrLen $0 $1 + StrCpy $1 $1 $0 $2 + StrCpy $3 "$3$1" + WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" $3 unRemoveFromPath_done: Pop $5 @@ -1061,42 +1062,40 @@ Function un.RemoveFromPath Goto unRemoveFromPath_done unRemoveFromPath_NT: + Push $0 StrLen $2 $0 - Call un.IsUserAdmin - Pop $5 - StrCmp $5 1 0 NotAdmin - ReadRegStr $1 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" - Push $1 - Push $0 - Call un.StrStr ; Find $0 in $1 - Pop $0 ; pos of our dir - IntCmp $0 -1 unRemoveFromPath_done - ; else, it is in path - StrCpy $3 $1 $0 ; $3 now has the part of the path before our dir - IntOp $2 $2 + $0 ; $2 now contains the pos after our dir in the path (';') - IntOp $2 $2 + 1 ; $2 now containts the pos after our dir and the semicolon. - StrLen $0 $1 - StrCpy $1 $1 $0 $2 - StrCpy $3 "$3$1" - WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" $3 - Goto unRemoveFromPath_done + ReadRegStr $1 HKCU "Environment" "PATH" + Push $1 + Push $0 + Call un.StrStr ; Find $0 in $1 + Pop $0 ; pos of our dir + IntCmp $0 -1 unRemoveFromPath_NT_System + ; else, it is in path + StrCpy $3 $1 $0 ; $3 now has the part of the path before our dir + IntOp $2 $2 + $0 ; $2 now contains the pos after our dir in the path (';') + IntOp $2 $2 + 1 ; $2 now containts the pos after our dir and the semicolon. + StrLen $0 $1 + StrCpy $1 $1 $0 $2 + StrCpy $3 "$3$1" + WriteRegExpandStr HKCU "Environment" "PATH" $3 - - NotAdmin: - ReadRegStr $1 HKCU "Environment" "PATH" - Push $1 - Push $0 - Call un.StrStr ; Find $0 in $1 - Pop $0 ; pos of our dir - IntCmp $0 -1 unRemoveFromPath_done - ; else, it is in path - StrCpy $3 $1 $0 ; $3 now has the part of the path before our dir - IntOp $2 $2 + $0 ; $2 now contains the pos after our dir in the path (';') - IntOp $2 $2 + 1 ; $2 now containts the pos after our dir and the semicolon. - StrLen $0 $1 - StrCpy $1 $1 $0 $2 - StrCpy $3 "$3$1" - WriteRegExpandStr HKCU "Environment" "PATH" $3 + unRemoveFromPath_NT_System: + Pop $0 + StrLen $2 $0 + ReadRegStr $1 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" + Push $1 + Push $0 + Call un.StrStr ; Find $0 in $1 + Pop $0 ; pos of our dir + IntCmp $0 -1 unRemoveFromPath_done + ; else, it is in path + StrCpy $3 $1 $0 ; $3 now has the part of the path before our dir + IntOp $2 $2 + $0 ; $2 now contains the pos after our dir in the path (';') + IntOp $2 $2 + 1 ; $2 now containts the pos after our dir and the semicolon. + StrLen $0 $1 + StrCpy $1 $1 $0 $2 + StrCpy $3 "$3$1" + WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" $3 unRemoveFromPath_done: Pop $5 @@ -1107,148 +1106,6 @@ Function un.RemoveFromPath Pop $0 FunctionEnd -; From: http://nsis.sourceforge.net/archive/nsisweb.php?page=329&instances=0,11 -; Localized by Ben Johnson (bkj@andrew.cmu.edu) -Function IsUserAdmin - Push $0 - Push $1 - Push $2 - Push $3 - Call IsNT - Pop $1 - - ClearErrors - UserInfo::GetName - ;IfErrors Win9x - Pop $2 - UserInfo::GetAccountType - Pop $3 - - ; Compare results of IsNT with "1" - StrCmp $1 1 0 NotNT - ;This is NT - - - StrCmp $3 "Admin" 0 NotAdmin - ; Observation: I get here when running Win98SE. (Lilla) - ; The functions UserInfo.dll looks for are there on Win98 too, - ; but just don't work. So UserInfo.dll, knowing that admin isn't required - ; on Win98, returns admin anyway. (per kichik) - ; MessageBox MB_OK 'User "$R1" is in the Administrators group' - Pop $3 - Pop $2 - Pop $1 - Pop $0 - - Push 1 - Return - - NotAdmin: - ; You should still check for an empty string because the functions - ; UserInfo.dll looks for may not be present on Windows 95. (per kichik) - - #StrCmp $2 "" Win9x - #StrCpy $0 0 - ;MessageBox MB_OK 'User "$2" is in the "$3" group' - Pop $3 - Pop $2 - Pop $1 - Pop $0 - - Push 0 - Return - - ;Because we use IsNT, this is redundant. - #Win9x: - # ; comment/message below is by UserInfo.nsi author: - # ; This one means you don't need to care about admin or - # ; not admin because Windows 9x doesn't either - # ;MessageBox MB_OK "Error! This DLL can't run under Windows 9x!" - # StrCpy $0 0 - - NotNT: - ;We are not NT - ;Win9x doesn't have "admin" users. - ;Let the user do whatever. - Pop $3 - Pop $2 - Pop $1 - Pop $0 - - Push 1 - -FunctionEnd - -Function un.IsUserAdmin - Push $0 - Push $1 - Push $2 - Push $3 - Call un.IsNT - Pop $1 - - ClearErrors - UserInfo::GetName - ;IfErrors Win9x - Pop $2 - UserInfo::GetAccountType - Pop $3 - - ; Compare results of IsNT with "1" - StrCmp $1 1 0 NotNT - ;This is NT - - - StrCmp $3 "Admin" 0 NotAdmin - ; Observation: I get here when running Win98SE. (Lilla) - ; The functions UserInfo.dll looks for are there on Win98 too, - ; but just don't work. So UserInfo.dll, knowing that admin isn't required - ; on Win98, returns admin anyway. (per kichik) - ; MessageBox MB_OK 'User "$R1" is in the Administrators group' - Pop $3 - Pop $2 - Pop $1 - Pop $0 - - Push 1 - Return - - NotAdmin: - ; You should still check for an empty string because the functions - ; UserInfo.dll looks for may not be present on Windows 95. (per kichik) - - #StrCmp $2 "" Win9x - #StrCpy $0 0 - ;MessageBox MB_OK 'User "$2" is in the "$3" group' - Pop $3 - Pop $2 - Pop $1 - Pop $0 - - Push 0 - Return - - ;Because we use IsNT, this is redundant. - #Win9x: - # ; comment/message below is by UserInfo.nsi author: - # ; This one means you don't need to care about admin or - # ; not admin because Windows 9x doesn't either - # ;MessageBox MB_OK "Error! This DLL can't run under Windows 9x!" - # StrCpy $0 0 - - NotNT: - ;We are not NT - ;Win9x doesn't have "admin" users. - ;Let the user do whatever. - Pop $3 - Pop $2 - Pop $1 - Pop $0 - - Push 1 - -FunctionEnd - Function StrRep ;Written by dirtydingus 2003-02-20 04:30:09 From f363088cb2a1c4961bb7740f09e4d0fff51a38d6 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 30 Sep 2016 00:21:12 +0200 Subject: [PATCH 064/112] Fix exception when creating intervals before ShowBase is started --- direct/src/showbase/ShowBase.py | 4 ---- direct/src/task/Task.py | 5 ++++- doc/ReleaseNotes | 1 + 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/direct/src/showbase/ShowBase.py b/direct/src/showbase/ShowBase.py index e5a9e18bce..e06583423f 100644 --- a/direct/src/showbase/ShowBase.py +++ b/direct/src/showbase/ShowBase.py @@ -131,10 +131,6 @@ class ShowBase(DirectObject.DirectObject): ## just before Python is about to shut down. self.finalExitCallbacks = [] - Task.TaskManager.taskTimerVerbose = self.config.GetBool('task-timer-verbose', 0) - Task.TaskManager.extendedExceptions = self.config.GetBool('extended-exceptions', 0) - Task.TaskManager.pStatsTasks = self.config.GetBool('pstats-tasks', 0) - # Set up the TaskManager to reset the PStats clock back # whenever we resume from a pause. This callback function is # a little hacky, but we can't call it directly from within diff --git a/direct/src/task/Task.py b/direct/src/task/Task.py index 6d8f38acbd..ba3f50f0b0 100644 --- a/direct/src/task/Task.py +++ b/direct/src/task/Task.py @@ -102,7 +102,10 @@ Task.DtoolClassDict['loop'] = staticmethod(loop) class TaskManager: notify = directNotify.newCategory("TaskManager") - extendedExceptions = False + taskTimerVerbose = ConfigVariableBool('task-timer-verbose', False) + extendedExceptions = ConfigVariableBool('extended-exceptions', False) + pStatsTasks = ConfigVariableBool('pstats-tasks', False) + MaxEpochSpeed = 1.0/30.0 def __init__(self): diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index 0728f34023..cdaba3cc7a 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -40,6 +40,7 @@ This issue fixes several bugs that were still found in 1.9.2. * Fix inoperative -tbn/-tbnall/-tbnauto options in egg-optchar * Fix tinydisplay texture errors on shutdown * Fix mipmap filtering issues in tinydisplay renderer +* Fix exception when creating intervals before ShowBase is started ------------------------ RELEASE 1.9.2 ------------------------ From a973107bd9abba79d25a2494c79a46be2afe68ff Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 10 Oct 2016 10:04:41 +0200 Subject: [PATCH 065/112] Remove duplicate definition of USE_GENERIC_DXERR_LIBRARY in ppremake --- dtool/LocalSetup.pp | 3 --- 1 file changed, 3 deletions(-) diff --git a/dtool/LocalSetup.pp b/dtool/LocalSetup.pp index cdea47c29f..920e42b979 100644 --- a/dtool/LocalSetup.pp +++ b/dtool/LocalSetup.pp @@ -376,9 +376,6 @@ $[cdefine HAVE_CGDX9] /* Define if we have CGDX10 installed. */ $[cdefine HAVE_CGDX10] -/* Define for dxerr.h instead of dxerr9.h. */ -$[cdefine USE_GENERIC_DXERR_LIBRARY] - /* Define if we have zlib installed. */ $[cdefine HAVE_ZLIB] From 06cc1794fc173aad5134a90a9f93716594171141 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 10 Oct 2016 14:47:00 +0200 Subject: [PATCH 066/112] Drop support for OpenSSL versions before 0.9.7 --- dtool/src/prc/configPage.cxx | 8 -------- dtool/src/prckeys/signPrcFile_src.cxx | 12 +----------- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/dtool/src/prc/configPage.cxx b/dtool/src/prc/configPage.cxx index ab65fdcd73..981caadf87 100644 --- a/dtool/src/prc/configPage.cxx +++ b/dtool/src/prc/configPage.cxx @@ -129,11 +129,7 @@ read_prc(istream &in) { #ifdef HAVE_OPENSSL // Set up the evp context for verifying the signature, if we find one. -#ifdef SSL_097 _md_ctx = EVP_MD_CTX_create(); -#else - _md_ctx = new EVP_MD_CTX; -#endif EVP_VerifyInit((EVP_MD_CTX *)_md_ctx, EVP_sha1()); #endif // HAVE_OPENSSL @@ -208,11 +204,7 @@ read_prc(istream &in) { << "invalid signature found in " << get_name() << "\n"; } } -#ifdef SSL_097 EVP_MD_CTX_destroy((EVP_MD_CTX *)_md_ctx); -#else - delete (EVP_MD_CTX *)_md_ctx; -#endif #endif // HAVE_OPENSSL bool failed = (in.fail() && !in.eof()); diff --git a/dtool/src/prckeys/signPrcFile_src.cxx b/dtool/src/prckeys/signPrcFile_src.cxx index 6ff6b1d4c6..0d9f58cfa4 100644 --- a/dtool/src/prckeys/signPrcFile_src.cxx +++ b/dtool/src/prckeys/signPrcFile_src.cxx @@ -179,13 +179,7 @@ sign_prc(Filename filename, bool no_comments, EVP_PKEY *pkey) { } data += strm.str(); - EVP_MD_CTX *md_ctx; - -#ifdef SSL_097 - md_ctx = EVP_MD_CTX_create(); -#else - md_ctx = new EVP_MD_CTX; -#endif + EVP_MD_CTX *md_ctx = EVP_MD_CTX_create(); EVP_SignInit(md_ctx, EVP_sha1()); EVP_SignUpdate(md_ctx, data.data(), data.size()); @@ -199,11 +193,7 @@ sign_prc(Filename filename, bool no_comments, EVP_PKEY *pkey) { } assert(sig_size <= max_size); -#ifdef SSL_097 EVP_MD_CTX_destroy(md_ctx); -#else - delete md_ctx; -#endif // Now open the file in write mode and rewrite it with the new signature. pofstream out; From a56520d055ff812747ff16973a35c2ec1280bdd0 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 12 Oct 2016 23:50:28 +0200 Subject: [PATCH 067/112] Drop support for pre-5.0 Maya versions --- pandatool/src/maya/post_maya_include.h | 6 ------ pandatool/src/maya/pre_maya_include.h | 26 -------------------------- 2 files changed, 32 deletions(-) diff --git a/pandatool/src/maya/post_maya_include.h b/pandatool/src/maya/post_maya_include.h index 341266fe9a..34e7152b63 100644 --- a/pandatool/src/maya/post_maya_include.h +++ b/pandatool/src/maya/post_maya_include.h @@ -13,9 +13,3 @@ // This header file works in conjunction with pre_maya_include.h; it cleans up // some of the definitions that it left open. - -// Remove the symbols defined from pre_maya_include.h. -#ifdef MAYA_PRE_5_0 -#undef ostream -#undef istream -#endif // MAYA_PRE_5_0 diff --git a/pandatool/src/maya/pre_maya_include.h b/pandatool/src/maya/pre_maya_include.h index d1b18b21de..0244ec7ba4 100644 --- a/pandatool/src/maya/pre_maya_include.h +++ b/pandatool/src/maya/pre_maya_include.h @@ -27,30 +27,6 @@ #define _BOOL 1 #endif -#ifdef MAYA_PRE_5_0 -// Old versions of Maya, before version 5.0, used etc. instead of -// the new headers. This requires some workarounds to make this -// work compatibly with Panda, which uses the new headers. - -// In windows, the antiquated headers define completely unrelated (and -// incompatible) classes from those declared in the new headers. On the other -// hand, in gcc the antiquated headers seem to be references to the new -// template classes, so under gcc we also have to declare typedefs to make -// this work. -#ifdef __GNUC__ -#ifndef PRE_MAYA_INCLUDE_H -#define PRE_MAYA_INCLUDE_H -#include -typedef ostream maya_ostream; -typedef istream maya_istream; -#endif -#endif // __GNUC__ - -#define ostream maya_ostream -#define istream maya_istream - -#else // MAYA_PRE_5_0 - // In Maya 5.0, the headers seem to provide the manifest REQUIRE_IOSTREAM, // which forces it to use the new headers instead of the old // headers. It also says this is for Linux only, but it seems to @@ -68,5 +44,3 @@ typedef istream maya_istream; #include #endif #endif - -#endif // MAYA_PRE_5_0 From 7c45e891f5e6c668d6fa0d524e5545894e76f6d5 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 13 Oct 2016 00:16:40 +0200 Subject: [PATCH 068/112] X11: fix .ico cursor bug. Support PNG-compressed .ico files. --- doc/ReleaseNotes | 1 + panda/src/x11display/x11GraphicsWindow.cxx | 231 ++++++++++++--------- 2 files changed, 135 insertions(+), 97 deletions(-) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index cdaba3cc7a..35d25a5dea 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -41,6 +41,7 @@ This issue fixes several bugs that were still found in 1.9.2. * Fix tinydisplay texture errors on shutdown * Fix mipmap filtering issues in tinydisplay renderer * Fix exception when creating intervals before ShowBase is started +* Fix rare X11 .ico cursor bug; also now supports PNG-compressed icons ------------------------ RELEASE 1.9.2 ------------------------ diff --git a/panda/src/x11display/x11GraphicsWindow.cxx b/panda/src/x11display/x11GraphicsWindow.cxx index 82a1180cf3..3b18605ac2 100644 --- a/panda/src/x11display/x11GraphicsWindow.cxx +++ b/panda/src/x11display/x11GraphicsWindow.cxx @@ -28,6 +28,8 @@ #include "nativeWindowHandle.h" #include "virtualFileSystem.h" #include "get_x11.h" +#include "pnmImage.h" +#include "pnmFileTypeRegistry.h" #include #include @@ -2303,109 +2305,144 @@ read_ico(istream &ico) { // Seek to the image in the ICO. ico.seekg(entries[entry].offset); if (!ico.good()) goto cleanup; - ico.read(reinterpret_cast(&infoHeader), sizeof(IcoInfoHeader)); - if (!ico.good()) goto cleanup; - bitsPerPixel = infoHeader.bitsPerPixel; - // TODO: Support PNG compressed ICOs. - if (infoHeader.compression != 0) goto cleanup; + if (ico.peek() == 0x89) { + // Hang on, this is actually a PNG header. + PNMImage img; + PNMFileTypeRegistry *reg = PNMFileTypeRegistry::get_global_ptr(); + if (!img.read(ico, "", reg->get_type_from_extension("png"))) { + goto cleanup; + } + img.set_maxval(255); - // Load the color palette, if one exists. - if (bitsPerPixel != 24 && bitsPerPixel != 32) { - colorCount = 1 << bitsPerPixel; - palette = new IcoColor[colorCount]; - ico.read(reinterpret_cast(palette), colorCount * sizeof(IcoColor)); + image = XcursorImageCreate(img.get_x_size(), img.get_y_size()); + + xel *ptr = img.get_array(); + xelval *alpha = img.get_alpha_array(); + size_t num_pixels = (size_t)img.get_x_size() * (size_t)img.get_y_size(); + unsigned int *dest = image->pixels; + + if (alpha != NULL) { + for (size_t p = 0; p < num_pixels; ++p) { + *dest++ = (*alpha << 24U) | (ptr->r << 16U) | (ptr->g << 8U) | (ptr->b); + ++ptr; + ++alpha; + } + } else { + for (size_t p = 0; p < num_pixels; ++p) { + *dest++ = 0xff000000U | (ptr->r << 16U) | (ptr->g << 8U) | (ptr->b); + ++ptr; + } + } + + } else { + ico.read(reinterpret_cast(&infoHeader), sizeof(IcoInfoHeader)); if (!ico.good()) goto cleanup; + bitsPerPixel = infoHeader.bitsPerPixel; + + if (infoHeader.compression != 0) goto cleanup; + + // Load the color palette, if one exists. + if (bitsPerPixel != 24 && bitsPerPixel != 32) { + colorCount = 1 << bitsPerPixel; + palette = new IcoColor[colorCount]; + ico.read(reinterpret_cast(palette), colorCount * sizeof(IcoColor)); + if (!ico.good()) goto cleanup; + } + + // Read in the pixel data. + xorBmpSize = (infoHeader.width * (infoHeader.height / 2) * bitsPerPixel) / 8; + andBmpSize = (infoHeader.width * (infoHeader.height / 2)) / 8; + curXor = xorBmp = new char[xorBmpSize]; + curAnd = andBmp = new char[andBmpSize]; + ico.read(xorBmp, xorBmpSize); + if (!ico.good()) goto cleanup; + ico.read(andBmp, andBmpSize); + if (!ico.good()) goto cleanup; + + image = XcursorImageCreate(infoHeader.width, infoHeader.height / 2); + + // Support all the formats that GIMP supports. + switch (bitsPerPixel) { + case 1: + case 4: + case 8: + // For colors less that a byte wide, shift and mask the palette indices + // off each element of the xorBmp and append them to the image. + mask = ((1 << bitsPerPixel) - 1); + for (i = image->height - 1; i >= 0; i--) { + for (j = 0; j < image->width; j += 8 / bitsPerPixel) { + for (k = 0; k < 8 / bitsPerPixel; k++) { + shift = 8 - ((k + 1) * bitsPerPixel); + color = palette[(*curXor & (mask << shift)) >> shift]; + image->pixels[(i * image->width) + j + k] = (color.red << 16) + + (color.green << 8) + + (color.blue); + } + + curXor++; + } + + // Set the alpha byte properly according to the andBmp. + for (j = 0; j < image->width; j += 8) { + for (k = 0; k < 8; k++) { + shift = 7 - k; + image->pixels[(i * image->width) + j + k] |= + ((*curAnd & (1 << shift)) >> shift) ? 0x0 : (0xff << 24); + } + + curAnd++; + } + } + break; + + case 24: + // Pack each of the three bytes into a single color, BGR -> 0RGB + for (i = image->height - 1; i >= 0; i--) { + for (j = 0; j < image->width; j++) { + image->pixels[(i * image->width) + j] = (*(curXor + 2) << 16) + + (*(curXor + 1) << 8) + (*curXor); + curXor += 3; + } + + // Set the alpha byte properly according to the andBmp. + for (j = 0; j < image->width; j += 8) { + for (k = 0; k < 8; k++) { + shift = 7 - k; + image->pixels[(i * image->width) + j + k] |= + ((*curAnd & (1 << shift)) >> shift) ? 0x0 : (0xff << 24); + } + + curAnd++; + } + } + break; + + case 32: + // Pack each of the four bytes into a single color, BGRA -> ARGB + for (i = image->height - 1; i >= 0; i--) { + for (j = 0; j < image->width; j++) { + image->pixels[(i * image->width) + j] = (*(curXor + 3) << 24) + + (*(curXor + 2) << 16) + + (*(curXor + 1) << 8) + + (*curXor); + curXor += 4; + } + } + break; + + default: + goto cleanup; + } } - // Read in the pixel data. - xorBmpSize = (infoHeader.width * (infoHeader.height / 2) * bitsPerPixel) / 8; - andBmpSize = (infoHeader.width * (infoHeader.height / 2)) / 8; - curXor = xorBmp = new char[xorBmpSize]; - curAnd = andBmp = new char[andBmpSize]; - ico.read(xorBmp, xorBmpSize); - if (!ico.good()) goto cleanup; - ico.read(andBmp, andBmpSize); - if (!ico.good()) goto cleanup; - // If this is an actual CUR not an ICO set up the hotspot properly. - image = XcursorImageCreate(infoHeader.width, infoHeader.height / 2); - if (header.type == 2) { image->xhot = entries[entry].xhot; image->yhot = entries[entry].yhot; } - - // Support all the formats that GIMP supports, minus PNG compressed ICOs. - // Would need to use libpng to decode the compressed ones. - switch (bitsPerPixel) { - case 1: - case 4: - case 8: - // For colors less that a byte wide, shift and mask the palette indices - // off each element of the xorBmp and append them to the image. - mask = ((1 << bitsPerPixel) - 1); - for (i = image->height - 1; i >= 0; i--) { - for (j = 0; j < image->width; j += 8 / bitsPerPixel) { - for (k = 0; k < 8 / bitsPerPixel; k++) { - shift = 8 - ((k + 1) * bitsPerPixel); - color = palette[(*curXor & (mask << shift)) >> shift]; - image->pixels[(i * image->width) + j + k] = (color.red << 16) + - (color.green << 8) + - (color.blue); - } - - curXor++; - } - - // Set the alpha byte properly according to the andBmp. - for (j = 0; j < image->width; j += 8) { - for (k = 0; k < 8; k++) { - shift = 7 - k; - image->pixels[(i * image->width) + j + k] |= - ((*curAnd & (1 << shift)) >> shift) ? 0x0 : (0xff << 24); - } - - curAnd++; - } - } - - break; - case 24: - // Pack each of the three bytes into a single color, BGR -> 0RGB - for (i = image->height - 1; i >= 0; i--) { - for (j = 0; j < image->width; j++) { - image->pixels[(i * image->width) + j] = (*(curXor + 2) << 16) + - (*(curXor + 1) << 8) + (*curXor); - curXor += 3; - } - - // Set the alpha byte properly according to the andBmp. - for (j = 0; j < image->width; j += 8) { - for (k = 0; k < 8; k++) { - shift = 7 - k; - image->pixels[(i * image->width) + j + k] |= - ((*curAnd & (1 << shift)) >> shift) ? 0x0 : (0xff << 24); - } - - curAnd++; - } - - } - - break; - case 32: - // Pack each of the four bytes into a single color, BGRA -> ARGB - for (i = image->height - 1; i >= 0; i--) { - for (j = 0; j < image->width; j++) { - image->pixels[(i * image->width) + j] = (*(curXor + 3) << 24) + - (*(curXor + 2) << 16) + - (*(curXor + 1) << 8) + - (*curXor); - curXor += 4; - } - } - - break; - default: - goto cleanup; - break; + if (header.type == 2) { + image->xhot = entries[entry].xhot; + image->yhot = entries[entry].yhot; + } else { + image->xhot = 0; + image->yhot = 0; } ret = XcursorImageLoadCursor(_display, image); From 955ca0d3340b4786b2be1d2161984cf9813ad27a Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 13 Oct 2016 00:21:03 +0200 Subject: [PATCH 069/112] Fix support for passing keyword arguments to methods named make() such as *Attrib.make() and Shader.make() --- doc/ReleaseNotes | 1 + dtool/src/interrogate/functionRemap.cxx | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index 35d25a5dea..da8e24ae0f 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -42,6 +42,7 @@ This issue fixes several bugs that were still found in 1.9.2. * Fix mipmap filtering issues in tinydisplay renderer * Fix exception when creating intervals before ShowBase is started * Fix rare X11 .ico cursor bug; also now supports PNG-compressed icons +* Add keyword argument support to make() methods such as Shader.make() ------------------------ RELEASE 1.9.2 ------------------------ diff --git a/dtool/src/interrogate/functionRemap.cxx b/dtool/src/interrogate/functionRemap.cxx index b2f703c926..f975a57904 100644 --- a/dtool/src/interrogate/functionRemap.cxx +++ b/dtool/src/interrogate/functionRemap.cxx @@ -810,6 +810,11 @@ setup_properties(const InterrogateFunction &ifunc, InterfaceMaker *interface_mak _flags |= F_coerce_constructor; } + if (_args_type == InterfaceMaker::AT_varargs) { + // Of course methods named "make" can still take kwargs. + _args_type = InterfaceMaker::AT_keyword_args; + } + } else if (fname == "operator /") { if (_has_this && _parameters.size() == 2 && TypeManager::is_float(_parameters[1]._remap->get_new_type())) { From 33c309d78f262c3391f471e942d7950ce9fc1fd1 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 13 Oct 2016 00:27:17 +0200 Subject: [PATCH 070/112] Make stb_image loader not rely on seeking to read .jpg files --- .../src/pnmimagetypes/pnmFileTypeStbImage.cxx | 102 +++++++++++------- 1 file changed, 63 insertions(+), 39 deletions(-) diff --git a/panda/src/pnmimagetypes/pnmFileTypeStbImage.cxx b/panda/src/pnmimagetypes/pnmFileTypeStbImage.cxx index 2807ee1b18..9a96d64fc4 100644 --- a/panda/src/pnmimagetypes/pnmFileTypeStbImage.cxx +++ b/panda/src/pnmimagetypes/pnmFileTypeStbImage.cxx @@ -97,7 +97,7 @@ static int cb_read(void *user, char *data, int size) { if (in->eof()) { // Gracefully handle EOF. - in->clear(); + in->clear(ios::eofbit); } return (int)in->gcount(); @@ -109,19 +109,10 @@ static void cb_skip(void *user, int n) { in->seekg(n, ios::cur); - if (in->fail()) { + // If we can't seek, move forward by ignoring bytes instead. + if (in->fail() && n > 0) { in->clear(); - - // Implement skip by just reading and discarding the result. - static const int size = 4096; - char data[size]; - while (n > size) { - in->read(data, size); - n -= size; - } - if (n > 0) { - in->read(data, n); - } + in->ignore(n); } } @@ -148,6 +139,7 @@ public: private: bool _is_float; stbi__context _context; + unsigned char _buffer[1024]; }; TypeHandle PNMFileTypeStbImage::_type_handle; @@ -224,27 +216,39 @@ StbImageReader(PNMFileType *type, istream *file, bool owns_file, string magic_nu PNMReader(type, file, owns_file), _is_float(false) { - // Hope we can putback() more than one character. - for (string::reverse_iterator mi = magic_number.rbegin(); - mi != magic_number.rend(); - mi++) { - _file->putback(*mi); - } - if (_file->fail()) { - pnmimage_cat.error() - << "Unable to put back magic number.\n"; - _is_valid = false; - return; + // Prepare the stb_image context. See stbi__start_callbacks. + _context.io.read = cb_read; + _context.io.skip = cb_skip; + _context.io.eof = cb_eof; + _context.io_user_data = (void *)file; + _context.buflen = sizeof(_context.buffer_start); + _context.read_from_callbacks = 1; + _context.img_buffer = _buffer; + _context.img_buffer_original = _buffer; + + // Prepopulate it with the magic number we already read, then fill it up. + // We need a big enough buffer so that we can read the image header. + // If stb_image runs out, it will switch to its own 128-byte buffer. + memcpy(_buffer, magic_number.data(), magic_number.size()); + file->read((char *)_buffer + magic_number.size(), sizeof(_buffer) - magic_number.size()); + + if (file->eof()) { + file->clear(ios::eofbit); } - stbi__start_callbacks(&_context, &io_callbacks, (void *)file); + size_t length = file->gcount() + magic_number.size(); + _context.img_buffer_end = _buffer + length; + _context.img_buffer_original_end = _context.img_buffer_end; + // Invoke stbi_info to read the image size and channel count. if (strncmp(magic_number.c_str(), "#?", 2) == 0 && stbi__hdr_info(&_context, &_x_size, &_y_size, &_num_channels)) { _is_valid = true; _is_float = true; + } else if (stbi__info_main(&_context, &_x_size, &_y_size, &_num_channels)) { _is_valid = true; + } else { _is_valid = false; pnmimage_cat.error() @@ -275,14 +279,21 @@ read_pfm(PfmFile &pfm) { } // Reposition the file at the beginning. - _file->seekg(0, ios::beg); - if (_file->tellg() != (streampos)0) { - pnmimage_cat.error() - << "Could not reposition file pointer to the beginning.\n"; - return false; - } + if (_context.img_buffer_end == _context.img_buffer_original_end) { + // All we need to do is rewind the buffer. + stbi__rewind(&_context); - stbi__start_callbacks(&_context, &io_callbacks, (void *)_file); + } else { + // We need to reinitialize the context. + _file->seekg(0, ios::beg); + if (_file->tellg() != (streampos)0) { + pnmimage_cat.error() + << "Could not reposition file pointer to the beginning.\n"; + return false; + } + + stbi__start_callbacks(&_context, &io_callbacks, (void *)_file); + } nassertr(_num_channels == 3, false); @@ -425,19 +436,31 @@ main_decode_loop: */ int StbImageReader:: read_data(xel *array, xelval *alpha) { - // Reposition the file at the beginning. - _file->seekg(0, ios::beg); - if (_file->tellg() != (streampos)0) { - pnmimage_cat.error() - << "Could not reposition file pointer to the beginning.\n"; + if (!is_valid()) { return 0; } - stbi__start_callbacks(&_context, &io_callbacks, (void *)_file); + // Reposition the file at the beginning. + if (_context.img_buffer_end == _context.img_buffer_original_end) { + // All we need to do is rewind the buffer. + stbi__rewind(&_context); + + } else { + // We need to reinitialize the context. + _file->seekg(0, ios::beg); + if (_file->tellg() != (streampos)0) { + pnmimage_cat.error() + << "Could not reposition file pointer to the beginning.\n"; + return false; + } + + stbi__start_callbacks(&_context, &io_callbacks, (void *)_file); + } int cols = 0; int rows = 0; - stbi_uc *data = stbi__load_main(&_context, &cols, &rows, NULL, _num_channels); + int comp = _num_channels; + stbi_uc *data = stbi__load_main(&_context, &cols, &rows, &comp, _num_channels); if (data == NULL) { pnmimage_cat.error() @@ -446,6 +469,7 @@ read_data(xel *array, xelval *alpha) { } nassertr(cols == _x_size, 0); + nassertr(comp == _num_channels, 0); size_t pixels = (size_t)_x_size * (size_t)rows; stbi_uc *ptr = data; From e2fe9513220395e52f54f1c95eb0d71a29376232 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 16 Oct 2016 00:14:05 +0200 Subject: [PATCH 071/112] Fix compilation errors in Bullet 2.84/2.85 --- doc/ReleaseNotes | 1 + .../bullet/bulletCharacterControllerNode.cxx | 19 ++++++++++-- panda/src/bullet/bulletManifoldPoint.I | 30 +++++++++++++++---- 3 files changed, 42 insertions(+), 8 deletions(-) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index da8e24ae0f..88631b2244 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -43,6 +43,7 @@ This issue fixes several bugs that were still found in 1.9.2. * Fix exception when creating intervals before ShowBase is started * Fix rare X11 .ico cursor bug; also now supports PNG-compressed icons * Add keyword argument support to make() methods such as Shader.make() +* Fix compilation errors with Bullet 2.84 ------------------------ RELEASE 1.9.2 ------------------------ diff --git a/panda/src/bullet/bulletCharacterControllerNode.cxx b/panda/src/bullet/bulletCharacterControllerNode.cxx index f0cb471e40..648b8a76e6 100644 --- a/panda/src/bullet/bulletCharacterControllerNode.cxx +++ b/panda/src/bullet/bulletCharacterControllerNode.cxx @@ -14,6 +14,10 @@ #include "bulletCharacterControllerNode.h" +#if BT_BULLET_VERSION >= 285 +static const btVector3 up_vectors[3] = {btVector3(1.0f, 0.0f, 0.0f), btVector3(0.0f, 1.0f, 0.0f), btVector3(0.0f, 0.0f, 1.0f)}; +#endif + TypeHandle BulletCharacterControllerNode::_type_handle; //////////////////////////////////////////////////////////////////// @@ -57,8 +61,13 @@ BulletCharacterControllerNode(BulletShape *shape, PN_stdfloat step_height, const _angular_movement = 0.0f; // Character controller +#if BT_BULLET_VERSION >= 285 + _character = new btKinematicCharacterController(_ghost, convex, step_height, up_vectors[_up]); + _character->setGravity(up_vectors[_up] * -(btScalar)9.81f); +#else _character = new btKinematicCharacterController(_ghost, convex, step_height, _up); _character->setGravity((btScalar)9.81f); +#endif // Retain a pointer to the shape _shape = shape; @@ -301,8 +310,11 @@ get_max_slope() const { //////////////////////////////////////////////////////////////////// PN_stdfloat BulletCharacterControllerNode:: get_gravity() const { - +#if BT_BULLET_VERSION >= 285 + return -(PN_stdfloat)_character->getGravity()[_up]; +#else return (PN_stdfloat)_character->getGravity(); +#endif } //////////////////////////////////////////////////////////////////// @@ -311,8 +323,11 @@ get_gravity() const { //////////////////////////////////////////////////////////////////// void BulletCharacterControllerNode:: set_gravity(PN_stdfloat gravity) { - +#if BT_BULLET_VERSION >= 285 + _character->setGravity(up_vectors[_up] * -(btScalar)gravity); +#else _character->setGravity((btScalar)gravity); +#endif } diff --git a/panda/src/bullet/bulletManifoldPoint.I b/panda/src/bullet/bulletManifoldPoint.I index e99c2060ca..9ebfa6e1ec 100644 --- a/panda/src/bullet/bulletManifoldPoint.I +++ b/panda/src/bullet/bulletManifoldPoint.I @@ -29,8 +29,15 @@ INLINE BulletManifoldPoint:: //////////////////////////////////////////////////////////////////// INLINE void BulletManifoldPoint:: set_lateral_friction_initialized(bool value) { - +#if BT_BULLET_VERSION >= 285 + if (value) { + _pt.m_contactPointFlags |= BT_CONTACT_FLAG_LATERAL_FRICTION_INITIALIZED; + } else { + _pt.m_contactPointFlags &= ~BT_CONTACT_FLAG_LATERAL_FRICTION_INITIALIZED; + } +#else _pt.m_lateralFrictionInitialized = value; +#endif } //////////////////////////////////////////////////////////////////// @@ -40,8 +47,11 @@ set_lateral_friction_initialized(bool value) { //////////////////////////////////////////////////////////////////// INLINE bool BulletManifoldPoint:: get_lateral_friction_initialized() const { - +#if BT_BULLET_VERSION >= 285 + return (_pt.m_contactPointFlags & BT_CONTACT_FLAG_LATERAL_FRICTION_INITIALIZED) != 0; +#else return _pt.m_lateralFrictionInitialized; +#endif } //////////////////////////////////////////////////////////////////// @@ -238,8 +248,9 @@ get_applied_impulse_lateral2() const { //////////////////////////////////////////////////////////////////// INLINE void BulletManifoldPoint:: set_contact_cfm1(PN_stdfloat value) { - +#if BT_BULLET_VERSION < 285 _pt.m_contactCFM1 = (btScalar)value; +#endif } //////////////////////////////////////////////////////////////////// @@ -249,8 +260,11 @@ set_contact_cfm1(PN_stdfloat value) { //////////////////////////////////////////////////////////////////// INLINE PN_stdfloat BulletManifoldPoint:: get_contact_cfm1() const { - +#if BT_BULLET_VERSION < 285 return (PN_stdfloat)_pt.m_contactCFM1; +#else + return 0; +#endif } //////////////////////////////////////////////////////////////////// @@ -260,8 +274,9 @@ get_contact_cfm1() const { //////////////////////////////////////////////////////////////////// INLINE void BulletManifoldPoint:: set_contact_cfm2(PN_stdfloat value) { - +#if BT_BULLET_VERSION < 285 _pt.m_contactCFM2 = (btScalar)value; +#endif } //////////////////////////////////////////////////////////////////// @@ -271,7 +286,10 @@ set_contact_cfm2(PN_stdfloat value) { //////////////////////////////////////////////////////////////////// INLINE PN_stdfloat BulletManifoldPoint:: get_contact_cfm2() const { - +#if BT_BULLET_VERSION < 285 return (PN_stdfloat)_pt.m_contactCFM2; +#else + return 0; +#endif } From ea82d9d66426a489bed7c14fb117c7028dffe175 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 20 Oct 2016 11:02:19 +0200 Subject: [PATCH 072/112] Preserve "intangible" and "level" collide flags in bam2egg --- doc/ReleaseNotes | 1 + panda/src/egg2pg/eggSaver.cxx | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index 88631b2244..a05c4487e4 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -32,6 +32,7 @@ This issue fixes several bugs that were still found in 1.9.2. * Fix RAM caching of 2D texture arrays * Fix Ctrl+C interrupt propagation to runtime applications * Support for InvSphere, Box and Tube solids in bam2egg +* Preserve "intangible" and "level" collide flags in bam2egg * Add normalized() method to vectors * asyncFlattenStrong with inPlace=True caused node to disappear * Fix asyncFlattenStrong called on nodes without parent diff --git a/panda/src/egg2pg/eggSaver.cxx b/panda/src/egg2pg/eggSaver.cxx index 99a36c50a7..647337e6bf 100644 --- a/panda/src/egg2pg/eggSaver.cxx +++ b/panda/src/egg2pg/eggSaver.cxx @@ -449,8 +449,20 @@ convert_collision_node(CollisionNode *node, const WorkingNodePath &node_path, // traverse solids for (int i = 0; i < num_solids; i++) { CPT(CollisionSolid) child = node->get_solid(i); + int flags = EggGroup::CF_descend; + + if (!child->is_tangible()) { + flags |= EggGroup::CF_intangible; + } + + if (child->has_effective_normal() && + child->get_effective_normal() == LVector3::up()) { + flags |= EggGroup::CF_level; + } + if (child->is_of_type(CollisionPolygon::get_class_type())) { egg_group->set_cs_type(EggGroup::CST_polyset); + egg_group->set_collide_flags(flags); EggPolygon *egg_poly = new EggPolygon; egg_group->add_child(egg_poly); @@ -476,7 +488,6 @@ convert_collision_node(CollisionNode *node, const WorkingNodePath &node_path, egg_sphere = egg_group; } else { egg_sphere = new EggGroup; - egg_sphere->set_collide_flags(EggGroup::CF_descend); egg_group->add_child(egg_sphere); } @@ -485,6 +496,7 @@ convert_collision_node(CollisionNode *node, const WorkingNodePath &node_path, } else { egg_sphere->set_cs_type(EggGroup::CST_sphere); } + egg_sphere->set_collide_flags(flags); EggVertex ev1, ev2; ev1.set_pos(LCAST(double, (center + offset) * net_mat)); @@ -518,10 +530,10 @@ convert_collision_node(CollisionNode *node, const WorkingNodePath &node_path, egg_plane = egg_group; } else { egg_plane = new EggGroup; - egg_plane->set_collide_flags(EggGroup::CF_descend); egg_group->add_child(egg_plane); } egg_plane->set_cs_type(EggGroup::CST_plane); + egg_plane->set_collide_flags(flags); EggVertex ev0, ev1, ev2; ev0.set_pos(LCAST(double, origin * net_mat)); @@ -545,10 +557,10 @@ convert_collision_node(CollisionNode *node, const WorkingNodePath &node_path, egg_box = egg_group; } else { egg_box = new EggGroup; - egg_box->set_collide_flags(EggGroup::CF_descend); egg_group->add_child(egg_box); } egg_box->set_cs_type(EggGroup::CST_box); + egg_box->set_collide_flags(flags); // Just add the min and max points. EggVertex ev0, ev1; @@ -584,10 +596,10 @@ convert_collision_node(CollisionNode *node, const WorkingNodePath &node_path, egg_tube = egg_group; } else { egg_tube = new EggGroup; - egg_tube->set_collide_flags(EggGroup::CF_descend); egg_group->add_child(egg_tube); } egg_tube->set_cs_type(EggGroup::CST_tube); + egg_tube->set_collide_flags(flags); // Add two points for the endcaps, and then two points around the // centroid to indicate the radius. From 34b8e0844ee11988a57c5205074779f0f81ae8ce Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 20 Oct 2016 11:13:44 +0200 Subject: [PATCH 073/112] Fix compile errors in unicode conversion in max exporter --- pandatool/src/maxegg/maxEggLoader.cxx | 11 +++++++++-- pandatool/src/maxegg/maxToEggConverter.cxx | 15 +++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/pandatool/src/maxegg/maxEggLoader.cxx b/pandatool/src/maxegg/maxEggLoader.cxx index 5129045100..d6adf0ec41 100644 --- a/pandatool/src/maxegg/maxEggLoader.cxx +++ b/pandatool/src/maxegg/maxEggLoader.cxx @@ -291,7 +291,7 @@ void MaxEggJoint::CreateMaxBone(void) _node->SetRenderable(FALSE); #ifdef _UNICODE - TCHAR *wname [1024]; + TCHAR wname[1024]; wname[1023] = 0; mbstowcs(wname, _egg_joint->get_name().c_str(), 1023); _node->SetName(wname); @@ -468,7 +468,14 @@ MaxEggMesh *MaxEggLoader::GetMesh(EggVertexPool *pool) result->_tvert_count = 0; result->_cvert_count = 0; result->_face_count = 0; - result->_node->SetName(TSTR(name.c_str())); +#ifdef _UNICODE + TCHAR wname[1024]; + wname[1023] = 0; + mbstowcs(wname, name.c_str(), 1023); + result->_node->SetName(wname); +#else + result->_node->SetName((char*) name.c_str()); +#endif _mesh_tab[pool] = result; } return result; diff --git a/pandatool/src/maxegg/maxToEggConverter.cxx b/pandatool/src/maxegg/maxToEggConverter.cxx index bcc32aeff3..37f5011f00 100644 --- a/pandatool/src/maxegg/maxToEggConverter.cxx +++ b/pandatool/src/maxegg/maxToEggConverter.cxx @@ -589,7 +589,14 @@ make_nurbs_curve(INode *max_node, NURBSCVCurve *curve, return false; } +#ifdef _UNICODE + char mbname[1024]; + mbname[1023] = 0; + wcstombs(mbname, max_node->GetName(), 1023); + string name(mbname); +#else string name = max_node->GetName(); +#endif string vpool_name = name + ".cvs"; EggVertexPool *vpool = new EggVertexPool(vpool_name); @@ -652,7 +659,15 @@ make_polyset(INode *max_node, Mesh *mesh, // all the vertices up front, we'll start with an empty vpool, and // add vertices to it on the fly. +#ifdef _UNICODE + char mbname[1024]; + mbname[1023] = 0; + wcstombs(mbname, max_node->GetName(), 1023); + string node_name(mbname); +#else string node_name = max_node->GetName(); +#endif + string vpool_name = node_name + ".verts"; EggVertexPool *vpool = new EggVertexPool(vpool_name); egg_group->add_child(vpool); From 775c69b53d92affc3a572235522b4159630335a9 Mon Sep 17 00:00:00 2001 From: David Rose Date: Sun, 23 Oct 2016 19:14:39 -0700 Subject: [PATCH 074/112] PfmFile::set_point() should allow NaN's --- panda/src/pnmimage/pfmFile.I | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/panda/src/pnmimage/pfmFile.I b/panda/src/pnmimage/pfmFile.I index 42625aeb32..b8f63272f0 100644 --- a/panda/src/pnmimage/pfmFile.I +++ b/panda/src/pnmimage/pfmFile.I @@ -82,7 +82,7 @@ get_point1(int x, int y) const { */ INLINE void PfmFile:: set_point1(int x, int y, PN_float32 point) { - nassertv(!cnan(point)); + //nassertv(!cnan(point)); nassertv(x >= 0 && x < _x_size && y >= 0 && y < _y_size); _table[(y * _x_size + x) * _num_channels] = point; @@ -105,7 +105,7 @@ get_point2(int x, int y) const { */ INLINE void PfmFile:: set_point2(int x, int y, const LVecBase2f &point) { - nassertv(!point.is_nan()); + //nassertv(!point.is_nan()); nassertv(x >= 0 && x < _x_size && y >= 0 && y < _y_size); switch (_num_channels) { @@ -202,7 +202,7 @@ get_point3(int x, int y) const { */ INLINE void PfmFile:: set_point3(int x, int y, const LVecBase3f &point) { - nassertv(!point.is_nan()); + //nassertv(!point.is_nan()); nassertv(x >= 0 && x < _x_size && y >= 0 && y < _y_size); switch (_num_channels) { @@ -264,7 +264,7 @@ get_point4(int x, int y) const { */ INLINE void PfmFile:: set_point4(int x, int y, const LVecBase4f &point) { - nassertv(!point.is_nan()); + //nassertv(!point.is_nan()); nassertv(x >= 0 && x < _x_size && y >= 0 && y < _y_size); switch (_num_channels) { From 1bd96685bca63406bd4748a36fa4ccd348436999 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 24 Oct 2016 17:19:07 +0200 Subject: [PATCH 075/112] Allow passing - as filename to egg tools to read from stdin --- pandatool/src/eggbase/eggReader.cxx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pandatool/src/eggbase/eggReader.cxx b/pandatool/src/eggbase/eggReader.cxx index 2c2d2a0a0e..72d0007fb3 100644 --- a/pandatool/src/eggbase/eggReader.cxx +++ b/pandatool/src/eggbase/eggReader.cxx @@ -170,11 +170,17 @@ handle_args(ProgramBase::Args &args) { Filename filename = Filename::from_os_specific(*ai); EggData file_data; - if (!file_data.read(filename)) { - // Rather than returning false, we simply exit here, so the ProgramBase - // won't try to tell the user how to run the program just because we got - // a bad egg file. - exit(1); + if (filename != "-") { + if (!file_data.read(filename)) { + // Rather than returning false, we simply exit here, so the ProgramBase + // won't try to tell the user how to run the program just because we got + // a bad egg file. + exit(1); + } + } else { + if (!file_data.read(cin)) { + exit(1); + } } if (_noabs && file_data.original_had_absolute_pathnames()) { From df998fb24c2dd47807afb4f2c5d3487999cf2c6b Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 24 Oct 2016 17:20:21 +0200 Subject: [PATCH 076/112] bam2egg: support collision masks, UvScrollNode --- panda/src/egg2pg/eggSaver.cxx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/panda/src/egg2pg/eggSaver.cxx b/panda/src/egg2pg/eggSaver.cxx index fc41f15535..3976aa0714 100644 --- a/panda/src/egg2pg/eggSaver.cxx +++ b/panda/src/egg2pg/eggSaver.cxx @@ -32,6 +32,7 @@ #include "lodNode.h" #include "switchNode.h" #include "sequenceNode.h" +#include "uvScrollNode.h" #include "collisionNode.h" #include "collisionPolygon.h" #include "collisionPlane.h" @@ -417,6 +418,19 @@ convert_collision_node(CollisionNode *node, const WorkingNodePath &node_path, egg_parent->add_child(egg_group); apply_node_properties(egg_group, node, false); + // Set the collision masks, if present. + CollideMask from_mask = node->get_from_collide_mask(); + CollideMask into_mask = node->get_into_collide_mask(); + if (from_mask != CollisionNode::get_default_collide_mask() || + into_mask != CollisionNode::get_default_collide_mask()) { + if (from_mask == into_mask) { + egg_group->set_collide_mask(into_mask); + } else { + egg_group->set_from_collide_mask(from_mask); + egg_group->set_into_collide_mask(into_mask); + } + } + // turn it into a collision node egg_group->set_collide_flags(EggGroup::CF_descend); @@ -939,6 +953,14 @@ apply_node_properties(EggGroup *egg_group, PandaNode *node, bool allow_backstage } } + if (node->is_of_type(UvScrollNode::get_class_type())) { + const UvScrollNode *scroll_node = (const UvScrollNode *)node; + egg_group->set_scroll_u(scroll_node->get_u_speed()); + egg_group->set_scroll_v(scroll_node->get_v_speed()); + egg_group->set_scroll_w(scroll_node->get_w_speed()); + egg_group->set_scroll_r(scroll_node->get_r_speed()); + } + const RenderEffects *effects = node->get_effects(); const RenderEffect *effect = effects->get_effect(BillboardEffect::get_class_type()); if (effect != (RenderEffect *)NULL) { From a757cb47e8bf06a7cb6597459b7ee25442daa014 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 24 Oct 2016 17:34:55 +0200 Subject: [PATCH 077/112] Add tube-into-plane and tube-into-sphere tests --- panda/src/collide/collisionPlane.cxx | 71 +++++++++++++++++++++++++++ panda/src/collide/collisionPlane.h | 2 + panda/src/collide/collisionSolid.cxx | 12 +++++ panda/src/collide/collisionSolid.h | 3 ++ panda/src/collide/collisionSphere.cxx | 60 +++++++++++++++++++++- panda/src/collide/collisionSphere.h | 2 + panda/src/collide/collisionTube.cxx | 8 +++ panda/src/collide/collisionTube.h | 3 ++ 8 files changed, 160 insertions(+), 1 deletion(-) diff --git a/panda/src/collide/collisionPlane.cxx b/panda/src/collide/collisionPlane.cxx index 1d7b4ed758..c551464960 100644 --- a/panda/src/collide/collisionPlane.cxx +++ b/panda/src/collide/collisionPlane.cxx @@ -18,6 +18,7 @@ #include "collisionLine.h" #include "collisionRay.h" #include "collisionSegment.h" +#include "collisionTube.h" #include "collisionParabola.h" #include "config_collide.h" #include "pointerToArray.h" @@ -293,6 +294,76 @@ test_intersection_from_segment(const CollisionEntry &entry) const { return new_entry; } +/** + * + */ +PT(CollisionEntry) CollisionPlane:: +test_intersection_from_tube(const CollisionEntry &entry) const { + const CollisionTube *tube; + DCAST_INTO_R(tube, entry.get_from(), 0); + + const LMatrix4 &wrt_mat = entry.get_wrt_mat(); + + LPoint3 from_a = tube->get_point_a() * wrt_mat; + LPoint3 from_b = tube->get_point_b() * wrt_mat; + LVector3 from_radius_v = + LVector3(tube->get_radius(), 0.0f, 0.0f) * wrt_mat; + PN_stdfloat from_radius = length(from_radius_v); + + PN_stdfloat dist_a = _plane.dist_to_plane(from_a); + PN_stdfloat dist_b = _plane.dist_to_plane(from_b); + + if (dist_a >= from_radius && dist_b >= from_radius) { + // Entirely in front of the plane means no intersection. + return NULL; + } + + if (collide_cat.is_debug()) { + collide_cat.debug() + << "intersection detected from " << entry.get_from_node_path() + << " into " << entry.get_into_node_path() << "\n"; + } + PT(CollisionEntry) new_entry = new CollisionEntry(entry); + + LVector3 normal = (has_effective_normal() && tube->get_respect_effective_normal()) ? get_effective_normal() : get_normal(); + new_entry->set_surface_normal(normal); + + PN_stdfloat t; + LVector3 from_direction = from_b - from_a; + if (_plane.intersects_line(t, from_a, from_direction)) { + // It intersects the plane. + if (t >= 1.0f) { + new_entry->set_surface_point(from_b - get_normal() * dist_b); + + } else if (t <= 0.0f) { + new_entry->set_surface_point(from_a - get_normal() * dist_a); + + } else { + // Within the tube! Yay, that means we have a surface point. + new_entry->set_surface_point(from_a + t * from_direction); + } + } else { + // If it's completely parallel, pretend it's colliding in the center of + // the tube. + new_entry->set_surface_point(from_a + 0.5f * from_direction - get_normal() * dist_a); + } + + if (IS_NEARLY_EQUAL(dist_a, dist_b)) { + // Let's be fair and choose the center of the tube. + new_entry->set_interior_point(from_a + 0.5f * from_direction - get_normal() * from_radius); + + } else if (dist_a < dist_b) { + // Point A penetrates deeper. + new_entry->set_interior_point(from_a - get_normal() * from_radius); + + } else if (dist_b < dist_a) { + // No, point B does. + new_entry->set_interior_point(from_b - get_normal() * from_radius); + } + + return new_entry; +} + /** * This is part of the double-dispatch implementation of test_intersection(). * It is called when the "from" object is a parabola. diff --git a/panda/src/collide/collisionPlane.h b/panda/src/collide/collisionPlane.h index 232b52c650..4130cf2151 100644 --- a/panda/src/collide/collisionPlane.h +++ b/panda/src/collide/collisionPlane.h @@ -72,6 +72,8 @@ protected: virtual PT(CollisionEntry) test_intersection_from_segment(const CollisionEntry &entry) const; virtual PT(CollisionEntry) + test_intersection_from_tube(const CollisionEntry &entry) const; + virtual PT(CollisionEntry) test_intersection_from_parabola(const CollisionEntry &entry) const; virtual PT(CollisionEntry) test_intersection_from_box(const CollisionEntry &entry) const; diff --git a/panda/src/collide/collisionSolid.cxx b/panda/src/collide/collisionSolid.cxx index 54a4d36a3f..5f27903b45 100644 --- a/panda/src/collide/collisionSolid.cxx +++ b/panda/src/collide/collisionSolid.cxx @@ -17,6 +17,7 @@ #include "collisionLine.h" #include "collisionRay.h" #include "collisionSegment.h" +#include "collisionTube.h" #include "collisionParabola.h" #include "collisionBox.h" #include "collisionEntry.h" @@ -237,6 +238,17 @@ test_intersection_from_segment(const CollisionEntry &) const { return NULL; } +/** + * This is part of the double-dispatch implementation of test_intersection(). + * It is called when the "from" object is a tube. + */ +PT(CollisionEntry) CollisionSolid:: +test_intersection_from_tube(const CollisionEntry &) const { + report_undefined_intersection_test(CollisionTube::get_class_type(), + get_type()); + return NULL; +} + /** * This is part of the double-dispatch implementation of test_intersection(). * It is called when the "from" object is a parabola. diff --git a/panda/src/collide/collisionSolid.h b/panda/src/collide/collisionSolid.h index 2aa2c082d3..4f80cb922a 100644 --- a/panda/src/collide/collisionSolid.h +++ b/panda/src/collide/collisionSolid.h @@ -108,6 +108,8 @@ protected: virtual PT(CollisionEntry) test_intersection_from_segment(const CollisionEntry &entry) const; virtual PT(CollisionEntry) + test_intersection_from_tube(const CollisionEntry &entry) const; + virtual PT(CollisionEntry) test_intersection_from_parabola(const CollisionEntry &entry) const; virtual PT(CollisionEntry) test_intersection_from_box(const CollisionEntry &entry) const; @@ -175,6 +177,7 @@ private: friend class CollisionLine; friend class CollisionRay; friend class CollisionSegment; + friend class CollisionTube; friend class CollisionParabola; friend class CollisionHandlerFluidPusher; friend class CollisionBox; diff --git a/panda/src/collide/collisionSphere.cxx b/panda/src/collide/collisionSphere.cxx index 7c2a5f2c15..2e0802b350 100644 --- a/panda/src/collide/collisionSphere.cxx +++ b/panda/src/collide/collisionSphere.cxx @@ -14,10 +14,12 @@ #include "collisionSphere.h" #include "collisionLine.h" #include "collisionRay.h" -#include "collisionSegment.h" #include "collisionHandler.h" #include "collisionEntry.h" +#include "collisionSegment.h" +#include "collisionTube.h" #include "collisionParabola.h" +#include "collisionBox.h" #include "config_collide.h" #include "boundingSphere.h" #include "datagram.h" @@ -435,6 +437,62 @@ test_intersection_from_segment(const CollisionEntry &entry) const { return new_entry; } +/** + * + */ +PT(CollisionEntry) CollisionSphere:: +test_intersection_from_tube(const CollisionEntry &entry) const { + const CollisionTube *tube; + DCAST_INTO_R(tube, entry.get_from(), 0); + + const LMatrix4 &wrt_mat = entry.get_wrt_mat(); + + LPoint3 from_a = tube->get_point_a() * wrt_mat; + LPoint3 from_b = tube->get_point_b() * wrt_mat; + LVector3 from_direction = from_b - from_a; + + LVector3 from_radius_v = + LVector3(tube->get_radius(), 0.0f, 0.0f) * wrt_mat; + PN_stdfloat from_radius = length(from_radius_v); + + double t1, t2; + if (!intersects_line(t1, t2, from_a, from_direction, from_radius)) { + // No intersection. + return NULL; + } + + if (t2 < 0.0 || t1 > 1.0) { + // Both intersection points are before the start of the tube or after + // the end of the tube. + return NULL; + } + + PN_stdfloat t = (t1 + t2) * (PN_stdfloat)0.5; + t = max(t, (PN_stdfloat)0.0); + t = min(t, (PN_stdfloat)1.0); + LPoint3 inner_point = from_a + t * from_direction; + + if (collide_cat.is_debug()) { + collide_cat.debug() + << "intersection detected from " << entry.get_from_node_path() + << " into " << entry.get_into_node_path() << "\n"; + } + PT(CollisionEntry) new_entry = new CollisionEntry(entry); + + LVector3 normal = inner_point - get_center(); + normal.normalize(); + new_entry->set_surface_point(get_center() + normal * get_radius()); + new_entry->set_interior_point(inner_point - normal * from_radius); + + if (has_effective_normal() && tube->get_respect_effective_normal()) { + new_entry->set_surface_normal(get_effective_normal()); + } else { + new_entry->set_surface_normal(normal); + } + + return new_entry; +} + /** * */ diff --git a/panda/src/collide/collisionSphere.h b/panda/src/collide/collisionSphere.h index fe5d1d2d7b..f6cb45d804 100644 --- a/panda/src/collide/collisionSphere.h +++ b/panda/src/collide/collisionSphere.h @@ -72,6 +72,8 @@ protected: virtual PT(CollisionEntry) test_intersection_from_segment(const CollisionEntry &entry) const; virtual PT(CollisionEntry) + test_intersection_from_tube(const CollisionEntry &entry) const; + virtual PT(CollisionEntry) test_intersection_from_parabola(const CollisionEntry &entry) const; virtual PT(CollisionEntry) test_intersection_from_box(const CollisionEntry &entry) const; diff --git a/panda/src/collide/collisionTube.cxx b/panda/src/collide/collisionTube.cxx index 17e9cd5c3f..cb3f24f737 100644 --- a/panda/src/collide/collisionTube.cxx +++ b/panda/src/collide/collisionTube.cxx @@ -47,6 +47,14 @@ make_copy() { return new CollisionTube(*this); } +/** + * + */ +PT(CollisionEntry) CollisionTube:: +test_intersection(const CollisionEntry &entry) const { + return entry.get_into()->test_intersection_from_tube(entry); +} + /** * Transforms the solid by the indicated matrix. */ diff --git a/panda/src/collide/collisionTube.h b/panda/src/collide/collisionTube.h index afc14d71dc..fe6a57c981 100644 --- a/panda/src/collide/collisionTube.h +++ b/panda/src/collide/collisionTube.h @@ -40,6 +40,9 @@ public: INLINE CollisionTube(const CollisionTube ©); virtual CollisionSolid *make_copy(); + virtual PT(CollisionEntry) + test_intersection(const CollisionEntry &entry) const; + virtual void xform(const LMatrix4 &mat); virtual PStatCollector &get_volume_pcollector(); From ef986ccfc09dd831896e31198169b95f44f93819 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 24 Oct 2016 21:29:43 +0200 Subject: [PATCH 078/112] Texture.set_ram_image(_as) now directly accepts buffers with right component size --- panda/src/express/pointerToArray.h | 59 ++++++---- panda/src/gobj/p3gobj_ext_composite.cxx | 1 + panda/src/gobj/texture.h | 6 + panda/src/gobj/texture_ext.cxx | 147 ++++++++++++++++++++++++ panda/src/gobj/texture_ext.h | 37 ++++++ 5 files changed, 226 insertions(+), 24 deletions(-) create mode 100644 panda/src/gobj/texture_ext.cxx create mode 100644 panda/src/gobj/texture_ext.h diff --git a/panda/src/express/pointerToArray.h b/panda/src/express/pointerToArray.h index 2485f28759..004e15fdea 100644 --- a/panda/src/express/pointerToArray.h +++ b/panda/src/express/pointerToArray.h @@ -14,36 +14,47 @@ #ifndef POINTERTOARRAY_H #define POINTERTOARRAY_H - /* * This file defines the classes PointerToArray and ConstPointerToArray (and * their abbreviations, PTA and CPTA), which are extensions to the PointerTo - * class that support reference-counted arrays. You may think of a - * PointerToArray as the same thing as a traditional C-style array. However, - * it actually stores a pointer to an STL vector, which is then reference- - * counted. Thus, most vector operations may be applied directly to a - * PointerToArray object, including dynamic resizing via push_back() and - * pop_back(). Unlike the PointerTo class, the PointerToArray may store - * pointers to any kind of object, not just those derived from ReferenceCount. + * class that support reference-counted arrays. + * + * You may think of a PointerToArray as the same thing as a traditional + * C-style array. However, it actually stores a pointer to an STL vector, + * which is then reference-counted. Thus, most vector operations may be + * applied directly to a PointerToArray object, including dynamic resizing via + * push_back() and pop_back(). + * + * Unlike the PointerTo class, the PointerToArray may store pointers to any + * kind of object, not just those derived from ReferenceCount. + * * Like PointerTo and ConstPointerTo, the macro abbreviations PTA and CPTA are - * defined for convenience. Some examples of syntax: instead of: + * defined for convenience. + * + * Some examples of syntax: instead of: + * * PTA(int) array(10); int *array = new int[10]; * memset(array, 0, sizeof(int) * 10); memset(array, 0, sizeof(int) * 10); - * array[i] = array[i+1]; array[i] = array[i+1]; num_elements - * = array.size(); (no equivalent) PTA(int) copy = array; - * int *copy = array; Note that in the above example, unlike an STL vector - * (but like a C-style array), assigning a PointerToArray object from another - * simply copies the pointer, and does not copy individual elements. (Of - * course, reference counts are adjusted appropriately7.) If you actually - * wanted an element-by-element copy of the array, you would do this: PTA(int) - * copy(0); Create a pointer to an empty vector. copy.v() = - * array.v(); v() is the STL vector itself. The (0) parameter to - * the constructor in the above example is crucial. When a numeric length - * parameter, such as zero, is given to the constructor, it means to define a - * new STL vector with that number of elements initially in it. If no - * parameter is given, on the other hand, it means the PointerToArray should - * point to nothing--no STL vector is created. This is equivalent to a C - * array that points to NULL. + * array[i] = array[i+1]; array[i] = array[i+1]; + * num_elements = array.size(); (no equivalent) + * + * PTA(int) copy = array; int *copy = array; + * + * Note that in the above example, unlike an STL vector (but like a C-style + * array), assigning a PointerToArray object from another simply copies the + * pointer, and does not copy individual elements. (Of course, reference + * counts are adjusted appropriately.) If you actually wanted an + * element-by-element copy of the array, you would do this: + * + * PTA(int) copy(0); // Create a pointer to an empty vector. + * copy.v() = array.v(); // v() is the STL vector itself. + * + * The (0) parameter to the constructor in the above example is crucial. When + * a numeric length parameter, such as zero, is given to the constructor, it + * means to define a new STL vector with that number of elements initially in + * it. If no parameter is given, on the other hand, it means the + * PointerToArray should point to nothing--no STL vector is created. This is + * equivalent to a C array that points to NULL. */ #include "pandabase.h" diff --git a/panda/src/gobj/p3gobj_ext_composite.cxx b/panda/src/gobj/p3gobj_ext_composite.cxx index 33584e701b..5d71156d01 100644 --- a/panda/src/gobj/p3gobj_ext_composite.cxx +++ b/panda/src/gobj/p3gobj_ext_composite.cxx @@ -1,3 +1,4 @@ #include "internalName_ext.cxx" #include "geomVertexArrayData_ext.cxx" +#include "texture_ext.cxx" #include "textureCollection_ext.cxx" diff --git a/panda/src/gobj/texture.h b/panda/src/gobj/texture.h index 1f125fd7ce..cd05019416 100644 --- a/panda/src/gobj/texture.h +++ b/panda/src/gobj/texture.h @@ -445,9 +445,15 @@ PUBLISHED: CPTA_uchar get_ram_image_as(const string &requested_format); INLINE PTA_uchar modify_ram_image(); INLINE PTA_uchar make_ram_image(); +#ifndef CPPPARSER INLINE void set_ram_image(CPTA_uchar image, CompressionMode compression = CM_off, size_t page_size = 0); void set_ram_image_as(CPTA_uchar image, const string &provided_format); +#else + EXTEND void set_ram_image(PyObject *image, CompressionMode compression = CM_off, + size_t page_size = 0); + EXTEND void set_ram_image_as(PyObject *image, const string &provided_format); +#endif INLINE void clear_ram_image(); INLINE void set_keep_ram_image(bool keep_ram_image); virtual bool get_keep_ram_image() const; diff --git a/panda/src/gobj/texture_ext.cxx b/panda/src/gobj/texture_ext.cxx new file mode 100644 index 0000000000..2a462849c0 --- /dev/null +++ b/panda/src/gobj/texture_ext.cxx @@ -0,0 +1,147 @@ +/** + * 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." + * + * @file texture_ext.cxx + * @author rdb + * @date 2016-08-08 + */ + +#include "texture_ext.h" + +#ifndef CPPPARSER +extern Dtool_PyTypedObject Dtool_PointerToArray_unsigned_char; +extern Dtool_PyTypedObject Dtool_ConstPointerToArray_unsigned_char; +#endif + +/** + * Replaces the current system-RAM image with the new data. If compression is + * not CM_off, it indicates that the new data is already pre-compressed in the + * indicated format. + * + * This does *not* affect keep_ram_image. + */ +void Extension:: +set_ram_image(PyObject *image, Texture::CompressionMode compression, + size_t page_size) { + nassertv(compression != Texture::CM_default); + + // Check if perhaps a PointerToArray object was passed in. + if (DtoolCanThisBeAPandaInstance(image)) { + Dtool_PyInstDef *inst = (Dtool_PyInstDef *)image; + + if (inst->_My_Type == &Dtool_ConstPointerToArray_unsigned_char) { + _this->set_ram_image(*(const CPTA_uchar *)inst->_ptr_to_object, compression, page_size); + return; + + } else if (inst->_My_Type == &Dtool_PointerToArray_unsigned_char) { + _this->set_ram_image(*(const PTA_uchar *)inst->_ptr_to_object, compression, page_size); + return; + } + } + +#if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(image)) { + // User passed a buffer object. + Py_buffer view; + if (PyObject_GetBuffer(image, &view, PyBUF_CONTIG_RO) == -1) { + PyErr_SetString(PyExc_TypeError, + "Texture.set_ram_image() requires a contiguous buffer"); + return; + } + + int component_width = _this->get_component_width(); + if (compression == Texture::CM_off) { + if (view.itemsize != 1 && view.itemsize != component_width) { + PyErr_SetString(PyExc_TypeError, + "buffer.itemsize does not match Texture component size"); + return; + } + + if (view.len % component_width != 0) { + PyErr_Format(PyExc_ValueError, + "byte buffer is not a multiple of %zu bytes", + component_width); + return; + } + } else { + if (view.itemsize != 1) { + PyErr_SetString(PyExc_TypeError, + "buffer.itemsize should be 1 for compressed images"); + return; + } + } + + PTA_uchar data = PTA_uchar::empty_array(view.len, Texture::get_class_type()); + memcpy(data.p(), view.buf, view.len); + _this->set_ram_image(MOVE(data), compression, page_size); + + PyBuffer_Release(&view); + return; + } +#endif + + Dtool_Raise_ArgTypeError(image, 0, "Texture.set_ram_image", "CPTA_uchar or buffer"); +} + +/** + * Replaces the current system-RAM image with the new data, converting it + * first if necessary from the indicated component-order format. See + * get_ram_image_as() for specifications about the format. This method cannot + * support compressed image data or sub-pages; use set_ram_image() for that. + */ +void Extension:: +set_ram_image_as(PyObject *image, const string &provided_format) { + // Check if perhaps a PointerToArray object was passed in. + if (DtoolCanThisBeAPandaInstance(image)) { + Dtool_PyInstDef *inst = (Dtool_PyInstDef *)image; + + if (inst->_My_Type == &Dtool_ConstPointerToArray_unsigned_char) { + _this->set_ram_image_as(*(const CPTA_uchar *)inst->_ptr_to_object, provided_format); + return; + + } else if (inst->_My_Type == &Dtool_PointerToArray_unsigned_char) { + _this->set_ram_image_as(*(const PTA_uchar *)inst->_ptr_to_object, provided_format); + return; + } + } + +#if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(image)) { + // User passed a buffer object. + Py_buffer view; + if (PyObject_GetBuffer(image, &view, PyBUF_CONTIG_RO) == -1) { + PyErr_SetString(PyExc_TypeError, + "Texture.set_ram_image_as() requires a contiguous buffer"); + return; + } + + int component_width = _this->get_component_width(); + if (view.itemsize != 1 && view.itemsize != component_width) { + PyErr_SetString(PyExc_TypeError, + "buffer.itemsize does not match Texture component size"); + return; + } + + if (view.len % component_width != 0) { + PyErr_Format(PyExc_ValueError, + "byte buffer is not a multiple of %zu bytes", + component_width); + return; + } + + PTA_uchar data = PTA_uchar::empty_array(view.len, Texture::get_class_type()); + memcpy(data.p(), view.buf, view.len); + _this->set_ram_image_as(MOVE(data), provided_format); + + PyBuffer_Release(&view); + return; + } +#endif + + Dtool_Raise_ArgTypeError(image, 0, "Texture.set_ram_image_as", "CPTA_uchar or buffer"); +} diff --git a/panda/src/gobj/texture_ext.h b/panda/src/gobj/texture_ext.h new file mode 100644 index 0000000000..f5b4bb4ccd --- /dev/null +++ b/panda/src/gobj/texture_ext.h @@ -0,0 +1,37 @@ +/** + * 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." + * + * @file texture_ext.h + * @author rdb + * @date 2016-08-08 + */ + +#ifndef TEXTURE_EXT_H +#define TEXTURE_EXT_H + +#ifndef CPPPARSER + +#include "extension.h" +#include "py_panda.h" +#include "texture.h" + +/** + * This class defines the extension methods for Texture, which are + * called instead of any C++ methods with the same prototype. + */ +template<> +class Extension : public ExtensionBase { +public: + void set_ram_image(PyObject *image, Texture::CompressionMode compression = Texture::CM_off, + size_t page_size = 0); + void set_ram_image_as(PyObject *image, const string &provided_format); +}; + +#endif // CPPPARSER + +#endif // TEXTURE_EXT_H From 1049088f1174b4801b6e6d116b884c0a79a59aa3 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 24 Oct 2016 21:34:24 +0200 Subject: [PATCH 079/112] Clean up some of the dtool_config.h variables --- .../src/distributed/cConnectionRepository.cxx | 6 ++-- makepanda/makepanda.py | 33 ++++++++++--------- panda/src/audiotraits/openalAudioManager.h | 2 +- panda/src/audiotraits/openalAudioSound.h | 2 +- panda/src/downloader/httpClient.cxx | 6 ++-- panda/src/downloader/httpClient.h | 2 +- panda/src/express/multifile.cxx | 18 ++-------- 7 files changed, 29 insertions(+), 40 deletions(-) diff --git a/direct/src/distributed/cConnectionRepository.cxx b/direct/src/distributed/cConnectionRepository.cxx index 41fb3d6286..1781422930 100644 --- a/direct/src/distributed/cConnectionRepository.cxx +++ b/direct/src/distributed/cConnectionRepository.cxx @@ -403,7 +403,7 @@ send_datagram(const Datagram &dg) { #ifdef WANT_NATIVE_NET if (_native) { - bool result = _bdc.SendMessage(); + bool result = _bdc.SendMessage(dg); if (!result && _bdc.IsConnected()) { #ifdef HAVE_PYTHON ostringstream s; @@ -415,8 +415,8 @@ send_datagram(const Datagram &dg) { #endif s << endl << "Error sending message: " << endl; - msg.dump_hex(s); - s << "Message data: " << msg.get_data() << endl; + dg.dump_hex(s); + s << "Message data: " << dg.get_data() << endl; string message = s.str(); PyErr_SetString(exc_type, message.c_str()); diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 8cde77e0f7..d1def1ec8e 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -2122,9 +2122,7 @@ DTOOL_CONFIG=[ ("COMPILE_IN_DEFAULT_FONT", '1', '1'), ("STDFLOAT_DOUBLE", 'UNDEF', 'UNDEF'), ("HAVE_MAYA", '1', '1'), - ("MAYA_PRE_5_0", 'UNDEF', 'UNDEF'), ("HAVE_SOFTIMAGE", 'UNDEF', 'UNDEF'), - ("SSL_097", 'UNDEF', 'UNDEF'), ("REPORT_OPENSSL_ERRORS", '1', '1'), ("USE_PANDAFILESTREAM", '1', '1'), ("USE_DELETED_CHAIN", '1', '1'), @@ -2132,7 +2130,6 @@ DTOOL_CONFIG=[ ("HAVE_GLX", 'UNDEF', '1'), ("HAVE_WGL", '1', 'UNDEF'), ("HAVE_DX9", 'UNDEF', 'UNDEF'), - ("HAVE_CHROMIUM", 'UNDEF', 'UNDEF'), ("HAVE_THREADS", '1', '1'), ("SIMPLE_THREADS", 'UNDEF', 'UNDEF'), ("OS_SIMPLE_THREADS", '1', '1'), @@ -2145,12 +2142,9 @@ DTOOL_CONFIG=[ ("DO_COLLISION_RECORDING", 'UNDEF', 'UNDEF'), ("SUPPORT_IMMEDIATE_MODE", 'UNDEF', 'UNDEF'), ("SUPPORT_FIXED_FUNCTION", '1', '1'), - ("TRACK_IN_INTERPRETER", 'UNDEF', 'UNDEF'), ("DO_MEMORY_USAGE", 'UNDEF', 'UNDEF'), ("DO_PIPELINING", '1', '1'), ("EXPORT_TEMPLATES", 'yes', 'yes'), - ("LINK_IN_GL", 'UNDEF', 'UNDEF'), - ("LINK_IN_PHYSICS", 'UNDEF', 'UNDEF'), ("DEFAULT_PATHSEP", '";"', '":"'), ("WORDS_BIGENDIAN", 'UNDEF', 'UNDEF'), ("HAVE_NAMESPACE", '1', '1'), @@ -2212,7 +2206,6 @@ DTOOL_CONFIG=[ ("IS_LINUX", 'UNDEF', '1'), ("IS_OSX", 'UNDEF', 'UNDEF'), ("IS_FREEBSD", 'UNDEF', 'UNDEF'), - ("GLOBAL_OPERATOR_NEW_EXCEPTIONS", 'UNDEF', '1'), ("HAVE_EIGEN", 'UNDEF', 'UNDEF'), ("LINMATH_ALIGN", '1', '1'), ("HAVE_ZLIB", 'UNDEF', 'UNDEF'), @@ -2230,11 +2223,12 @@ DTOOL_CONFIG=[ ("HAVE_PNM", '1', '1'), ("HAVE_STB_IMAGE", '1', '1'), ("HAVE_VORBIS", 'UNDEF', 'UNDEF'), - ("HAVE_NVIDIACG", 'UNDEF', 'UNDEF'), ("HAVE_FREETYPE", 'UNDEF', 'UNDEF'), ("HAVE_FFTW", 'UNDEF', 'UNDEF'), ("HAVE_OPENSSL", 'UNDEF', 'UNDEF'), ("HAVE_NET", 'UNDEF', 'UNDEF'), + ("WANT_NATIVE_NET", '1', '1'), + ("SIMULATE_NETWORK_DELAY", 'UNDEF', 'UNDEF'), ("HAVE_EGG", '1', '1'), ("HAVE_CG", 'UNDEF', 'UNDEF'), ("HAVE_CGGL", 'UNDEF', 'UNDEF'), @@ -2246,12 +2240,12 @@ DTOOL_CONFIG=[ ("HAVE_OPENCV", 'UNDEF', 'UNDEF'), ("HAVE_DIRECTCAM", 'UNDEF', 'UNDEF'), ("HAVE_SQUISH", 'UNDEF', 'UNDEF'), - ("HAVE_FCOLLADA", 'UNDEF', 'UNDEF'), ("HAVE_CARBON", 'UNDEF', 'UNDEF'), ("HAVE_COCOA", 'UNDEF', 'UNDEF'), ("HAVE_OPENAL_FRAMEWORK", 'UNDEF', 'UNDEF'), ("HAVE_ROCKET_PYTHON", '1', '1'), ("HAVE_ROCKET_DEBUGGER", 'UNDEF', 'UNDEF'), + ("USE_TAU", 'UNDEF', 'UNDEF'), ("PRC_SAVE_DESCRIPTIONS", '1', '1'), # ("_SECURE_SCL", '0', 'UNDEF'), # ("_SECURE_SCL_THROWS", '0', 'UNDEF'), @@ -2373,9 +2367,6 @@ def WriteConfigSettings(): if (GetOptimize() <= 3): dtool_config["DO_COLLISION_RECORDING"] = '1' - #if (GetOptimize() <= 2): - # dtool_config["TRACK_IN_INTERPRETER"] = '1' - if (GetOptimize() <= 3): dtool_config["DO_MEMORY_USAGE"] = '1' @@ -4425,8 +4416,17 @@ if (not RUNTIME): # if (not RUNTIME): - OPTS=['DIR:panda/src/framework', 'BUILDING:FRAMEWORK'] - TargetAdd('p3framework_composite1.obj', opts=OPTS, input='p3framework_composite1.cxx') + deps = [] + # Framework wants to link in a renderer when building statically, so tell it what is available. + if GetLinkAllStatic(): + deps = ['dtool_have_gl.dat', 'dtool_have_tinydisplay.dat'] + if not PkgSkip("GL"): + DefSymbol("FRAMEWORK", "HAVE_GL") + if not PkgSkip("TINYDISPLAY"): + DefSymbol("FRAMEWORK", "HAVE_TINYDISPLAY") + + OPTS=['DIR:panda/src/framework', 'BUILDING:FRAMEWORK', 'FRAMEWORK'] + TargetAdd('p3framework_composite1.obj', opts=OPTS, input='p3framework_composite1.cxx', dep=deps) TargetAdd('libp3framework.dll', input='p3framework_composite1.obj') TargetAdd('libp3framework.dll', input=COMMON_PANDA_LIBS) TargetAdd('libp3framework.dll', opts=['ADVAPI']) @@ -6005,8 +6005,11 @@ if (PkgSkip("PANDATOOL")==0): # if (PkgSkip("PANDATOOL")==0): + if not PkgSkip("FCOLLADA"): + DefSymbol("FCOLLADA", "HAVE_FCOLLADA") + OPTS=['DIR:pandatool/src/ptloader', 'DIR:pandatool/src/flt', 'DIR:pandatool/src/lwo', 'DIR:pandatool/src/xfile', 'DIR:pandatool/src/xfileegg', 'DIR:pandatool/src/daeegg', 'BUILDING:PTLOADER', 'FCOLLADA'] - TargetAdd('p3ptloader_config_ptloader.obj', opts=OPTS, input='config_ptloader.cxx') + TargetAdd('p3ptloader_config_ptloader.obj', opts=OPTS, input='config_ptloader.cxx', dep='dtool_have_fcollada.dat') TargetAdd('p3ptloader_loaderFileTypePandatool.obj', opts=OPTS, input='loaderFileTypePandatool.cxx') TargetAdd('libp3ptloader.dll', input='p3ptloader_config_ptloader.obj') TargetAdd('libp3ptloader.dll', input='p3ptloader_loaderFileTypePandatool.obj') diff --git a/panda/src/audiotraits/openalAudioManager.h b/panda/src/audiotraits/openalAudioManager.h index f78e8a53ea..70089c138d 100644 --- a/panda/src/audiotraits/openalAudioManager.h +++ b/panda/src/audiotraits/openalAudioManager.h @@ -23,7 +23,7 @@ #include "reMutex.h" // OSX uses the OpenAL framework -#ifdef IS_OSX +#ifdef HAVE_OPENAL_FRAMEWORK #include #include #else diff --git a/panda/src/audiotraits/openalAudioSound.h b/panda/src/audiotraits/openalAudioSound.h index 95fd736190..3442acb4f2 100644 --- a/panda/src/audiotraits/openalAudioSound.h +++ b/panda/src/audiotraits/openalAudioSound.h @@ -21,7 +21,7 @@ #include "openalAudioManager.h" // OSX uses the OpenAL framework -#ifdef IS_OSX +#ifdef HAVE_OPENAL_FRAMEWORK #include #include #else diff --git a/panda/src/downloader/httpClient.cxx b/panda/src/downloader/httpClient.cxx index 0366107669..26baaff0c1 100644 --- a/panda/src/downloader/httpClient.cxx +++ b/panda/src/downloader/httpClient.cxx @@ -1110,7 +1110,7 @@ get_ssl_ctx() { _ssl_ctx = SSL_CTX_new(SSLv23_client_method()); -#if defined(SSL_097) && !defined(NDEBUG) +#ifndef NDEBUG // If we have debugging enabled, set a callback that allows us to report the // SSL messages as they are sent and received. if (downloader_cat.is_debug()) { @@ -1554,7 +1554,7 @@ split_whitespace(string &a, string &b, const string &c) { b = c.substr(p); } -#if defined(SSL_097) && !defined(NDEBUG) +#ifndef NDEBUG /** * This method is attached as a callback for SSL messages only when debug * output is enabled. @@ -1614,7 +1614,7 @@ ssl_msg_callback(int write_p, int version, int content_type, downloader_cat.debug() << describe.str(); } -#endif // defined(SSL_097) && !defined(NDEBUG) +#endif // !defined(NDEBUG) /** * diff --git a/panda/src/downloader/httpClient.h b/panda/src/downloader/httpClient.h index 32f9d38a7b..d901066357 100644 --- a/panda/src/downloader/httpClient.h +++ b/panda/src/downloader/httpClient.h @@ -155,7 +155,7 @@ private: static void split_whitespace(string &a, string &b, const string &c); -#if defined(SSL_097) && !defined(NDEBUG) +#ifndef NDEBUG static void ssl_msg_callback(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg); diff --git a/panda/src/express/multifile.cxx b/panda/src/express/multifile.cxx index c99c83bdb3..2f7cda439b 100644 --- a/panda/src/express/multifile.cxx +++ b/panda/src/express/multifile.cxx @@ -2478,12 +2478,7 @@ check_signatures() { } if (pkey != NULL) { - EVP_MD_CTX *md_ctx; -#ifdef SSL_097 - md_ctx = EVP_MD_CTX_create(); -#else - md_ctx = new EVP_MD_CTX; -#endif + EVP_MD_CTX *md_ctx = EVP_MD_CTX_create(); EVP_VerifyInit(md_ctx, EVP_sha1()); nassertv(_read != NULL); @@ -2764,12 +2759,7 @@ write_data(ostream &write, istream *read, streampos fpos, // And we also need to have a private key. nassertr(_pkey != NULL, fpos); - EVP_MD_CTX *md_ctx; -#ifdef SSL_097 - md_ctx = EVP_MD_CTX_create(); -#else - md_ctx = new EVP_MD_CTX; -#endif + EVP_MD_CTX *md_ctx = EVP_MD_CTX_create(); EVP_SignInit(md_ctx, EVP_sha1()); // Read and hash the multifile contents, but only up till @@ -2807,11 +2797,7 @@ write_data(ostream &write, istream *read, streampos fpos, delete[] sig_data; -#ifdef SSL_097 EVP_MD_CTX_destroy(md_ctx); -#else - delete md_ctx; -#endif } #endif // HAVE_OPENSSL From e1ea1e8fb098bb0d73f9eff4bede0386ee9deba1 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 24 Oct 2016 22:51:11 +0200 Subject: [PATCH 080/112] Fix link error on Windows with WANT_NATIVE_NET --- makepanda/makepanda.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index d1def1ec8e..18c73e5f26 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -5080,7 +5080,7 @@ if (PkgSkip("DIRECT")==0): TargetAdd('direct.pyd', input='libp3direct.dll') TargetAdd('direct.pyd', input='libp3interrogatedb.dll') TargetAdd('direct.pyd', input=COMMON_PANDA_LIBS) - TargetAdd('direct.pyd', opts=['PYTHON', 'OPENSSL', 'WINUSER', 'WINGDI']) + TargetAdd('direct.pyd', opts=['PYTHON', 'OPENSSL', 'WINUSER', 'WINGDI', 'WINSOCK2']) # # DIRECTORY: direct/src/dcparse/ From 758cd523e24a4bed60181647a462bef5427762c3 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 27 Oct 2016 12:37:00 +0200 Subject: [PATCH 081/112] Don't use assimp/ prefix when including assimp files --- pandatool/src/assimp/assimpLoader.cxx | 2 +- pandatool/src/assimp/assimpLoader.h | 4 ++-- pandatool/src/assimp/pandaIOStream.h | 2 +- pandatool/src/assimp/pandaIOSystem.h | 2 +- pandatool/src/assimp/pandaLogger.cxx | 2 +- pandatool/src/assimp/pandaLogger.h | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pandatool/src/assimp/assimpLoader.cxx b/pandatool/src/assimp/assimpLoader.cxx index 661286d454..fb383a1b7f 100644 --- a/pandatool/src/assimp/assimpLoader.cxx +++ b/pandatool/src/assimp/assimpLoader.cxx @@ -39,7 +39,7 @@ #include "pandaIOSystem.h" #include "pandaLogger.h" -#include "assimp/postprocess.h" +#include "postprocess.h" struct BoneWeight { CPT(JointVertexTransform) joint_vertex_xform; diff --git a/pandatool/src/assimp/assimpLoader.h b/pandatool/src/assimp/assimpLoader.h index 85dd7f59a0..41ac3e1dc6 100644 --- a/pandatool/src/assimp/assimpLoader.h +++ b/pandatool/src/assimp/assimpLoader.h @@ -20,8 +20,8 @@ #include "texture.h" #include "pmap.h" -#include "assimp/scene.h" -#include "assimp/Importer.hpp" +#include "scene.h" +#include "Importer.hpp" class Character; class CharacterJointBundle; diff --git a/pandatool/src/assimp/pandaIOStream.h b/pandatool/src/assimp/pandaIOStream.h index 913f96a740..cb4ddf251c 100644 --- a/pandatool/src/assimp/pandaIOStream.h +++ b/pandatool/src/assimp/pandaIOStream.h @@ -16,7 +16,7 @@ #include "config_assimp.h" -#include "assimp/IOStream.hpp" +#include "IOStream.hpp" class PandaIOSystem; diff --git a/pandatool/src/assimp/pandaIOSystem.h b/pandatool/src/assimp/pandaIOSystem.h index cbf3d9cf6d..f38223381c 100644 --- a/pandatool/src/assimp/pandaIOSystem.h +++ b/pandatool/src/assimp/pandaIOSystem.h @@ -17,7 +17,7 @@ #include "config_assimp.h" #include "virtualFileSystem.h" -#include "assimp/IOSystem.hpp" +#include "IOSystem.hpp" /** * Custom implementation of Assimp::IOSystem. diff --git a/pandatool/src/assimp/pandaLogger.cxx b/pandatool/src/assimp/pandaLogger.cxx index d503dc3fbe..cab31e1c06 100644 --- a/pandatool/src/assimp/pandaLogger.cxx +++ b/pandatool/src/assimp/pandaLogger.cxx @@ -13,7 +13,7 @@ #include "pandaLogger.h" -#include "assimp/DefaultLogger.hpp" +#include "DefaultLogger.hpp" PandaLogger *PandaLogger::_ptr = NULL; diff --git a/pandatool/src/assimp/pandaLogger.h b/pandatool/src/assimp/pandaLogger.h index 799784e7fc..a9bcbb40af 100644 --- a/pandatool/src/assimp/pandaLogger.h +++ b/pandatool/src/assimp/pandaLogger.h @@ -16,7 +16,7 @@ #include "config_assimp.h" -#include "assimp/Logger.hpp" +#include "Logger.hpp" /** * Custom implementation of Assimp::Logger. It simply wraps around the From 81dd4d97ad7dfc622e3a8e7e33f22a9bcaa2a182 Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Thu, 27 Oct 2016 13:56:02 +0200 Subject: [PATCH 082/112] Implement make_copy() for BulletRigidBodyNode This appears to be the last piece needed to load BulletRigidBodyNodes from BAM files. --- panda/src/bullet/bulletBodyNode.cxx | 19 ++++++++++++++++++ panda/src/bullet/bulletBodyNode.h | 1 + panda/src/bullet/bulletRigidBodyNode.cxx | 25 ++++++++++++++++++++++++ panda/src/bullet/bulletRigidBodyNode.h | 2 ++ 4 files changed, 47 insertions(+) diff --git a/panda/src/bullet/bulletBodyNode.cxx b/panda/src/bullet/bulletBodyNode.cxx index e8dbe968f2..6580c79722 100644 --- a/panda/src/bullet/bulletBodyNode.cxx +++ b/panda/src/bullet/bulletBodyNode.cxx @@ -36,6 +36,25 @@ BulletBodyNode(const char *name) : PandaNode(name) { set_into_collide_mask(CollideMask::all_on()); } +/** + * + */ +BulletBodyNode:: +BulletBodyNode(const BulletBodyNode ©) : + PandaNode(copy), + _shapes(copy._shapes) +{ + if (copy._shape && copy._shape->getShapeType() == COMPOUND_SHAPE_PROXYTYPE) { + _shape = new btCompoundShape(copy._shape); + } + else if (copy._shape && copy._shape->getShapeType() == EMPTY_SHAPE_PROXYTYPE) { + _shape = new btEmptyShape(); + } + else { + _shape = copy._shape; + } +} + /** * Returns the subset of CollideMask bits that may be set for this particular * type of PandaNode. For BodyNodes this returns all bits on. diff --git a/panda/src/bullet/bulletBodyNode.h b/panda/src/bullet/bulletBodyNode.h index 42f43cfd6a..53fe6c7136 100644 --- a/panda/src/bullet/bulletBodyNode.h +++ b/panda/src/bullet/bulletBodyNode.h @@ -33,6 +33,7 @@ class BulletShape; class EXPCL_PANDABULLET BulletBodyNode : public PandaNode { protected: BulletBodyNode(const char *name); + BulletBodyNode(const BulletBodyNode ©); PUBLISHED: INLINE ~BulletBodyNode(); diff --git a/panda/src/bullet/bulletRigidBodyNode.cxx b/panda/src/bullet/bulletRigidBodyNode.cxx index cc5f5945f5..23c6d17afd 100644 --- a/panda/src/bullet/bulletRigidBodyNode.cxx +++ b/panda/src/bullet/bulletRigidBodyNode.cxx @@ -46,6 +46,31 @@ BulletRigidBodyNode(const char *name) : BulletBodyNode(name) { _rigid->setUserPointer(this); } +/** + * Do not call the copy constructor directly; instead, use make_copy() or + * copy_subgraph() to make a copy of a node. + */ +BulletRigidBodyNode:: +BulletRigidBodyNode(const BulletRigidBodyNode ©) : + BulletBodyNode(copy) +{ + _motion = new MotionState(*copy._motion); + _rigid = new btRigidBody(*copy._rigid); + _rigid->setUserPointer(this); + _rigid->setCollisionShape(_shape); + _rigid->setMotionState(_motion); +} + +/** + * Returns a newly-allocated PandaNode that is a shallow copy of this one. It + * will be a different pointer, but its internal data may or may not be shared + * with that of the original PandaNode. No children will be copied. + */ +PandaNode *BulletRigidBodyNode:: +make_copy() const { + return new BulletRigidBodyNode(*this); +} + /** * */ diff --git a/panda/src/bullet/bulletRigidBodyNode.h b/panda/src/bullet/bulletRigidBodyNode.h index 2d6b54f2f3..42b2495aff 100644 --- a/panda/src/bullet/bulletRigidBodyNode.h +++ b/panda/src/bullet/bulletRigidBodyNode.h @@ -130,8 +130,10 @@ private: public: static void register_with_read_factory(); virtual void write_datagram(BamWriter *manager, Datagram &dg); + virtual PandaNode *make_copy() const; protected: + BulletRigidBodyNode(const BulletRigidBodyNode ©); static TypedWritable *make_from_bam(const FactoryParams ¶ms); void fillin(DatagramIterator &scan, BamReader *manager); From d43f0ef9099b0c8be4dea911e4834f8f97a043a2 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 28 Oct 2016 12:09:05 +0200 Subject: [PATCH 083/112] Fix DirectScrolledList regression --- direct/src/gui/DirectScrolledList.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/direct/src/gui/DirectScrolledList.py b/direct/src/gui/DirectScrolledList.py index 58d981950b..d17023d545 100644 --- a/direct/src/gui/DirectScrolledList.py +++ b/direct/src/gui/DirectScrolledList.py @@ -20,7 +20,7 @@ class DirectScrolledListItem(DirectButton): def __init__(self, parent=None, **kw): assert self.notify.debugStateCall(self) - self.parent = parent + self._parent = parent if "command" in kw: self.nextCommand = kw.get("command") del kw["command"] @@ -28,7 +28,7 @@ class DirectScrolledListItem(DirectButton): self.nextCommandExtraArgs = kw.get("extraArgs") del kw["extraArgs"] optiondefs = ( - ('parent', self.parent, None), + ('parent', self._parent, None), ('command', self.select, None), ) # Merge keyword options with default options @@ -39,7 +39,7 @@ class DirectScrolledListItem(DirectButton): def select(self): assert self.notify.debugStateCall(self) self.nextCommand(*self.nextCommandExtraArgs) - self.parent.selectListItem(self) + self._parent.selectListItem(self) class DirectScrolledList(DirectFrame): From 59b0913b0b25dfcd5912060c8d940d15d0663cc6 Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Sun, 30 Oct 2016 20:06:12 -0700 Subject: [PATCH 084/112] Cleanup .gitignore files Remove all .gitignore files in subdirectories and add a few new ignores to the top-level directory .gitignore file. --- .gitignore | 5 +++++ contrib/.gitignore | 9 --------- contrib/src/panda3dtoolsgui/.gitignore | 2 -- direct/.gitignore | 9 --------- direct/src/configfiles/.gitignore | 1 - direct/src/dcparser/.gitignore | 3 --- direct/src/extensions_native/.gitignore | 1 - direct/src/gui/.gitignore | 2 -- direct/src/p3d/.gitignore | 8 -------- direct/src/plugin/.gitignore | 1 - direct/src/plugin_activex/.gitignore | 1 - direct/src/plugin_npapi/.gitignore | 1 - direct/src/plugin_standalone/.gitignore | 2 -- direct/src/showutil/.gitignore | 1 - dmodels/.gitignore | 7 ------- dmodels/src/.gitignore | 6 ------ dtool/.gitignore | 7 ------- dtool/src/cppparser/.gitignore | 2 -- dtool/src/dtoolutil/.gitignore | 3 --- dtool/src/prc/.gitignore | 1 - makepanda/.gitignore | 2 -- panda/.gitignore | 8 -------- panda/src/configfiles/.gitignore | 1 - panda/src/egg/.gitignore | 3 --- panda/src/speedtree/.gitignore | 1 - pandatool/.gitignore | 6 ------ pandatool/src/configfiles/.gitignore | 1 - pandatool/src/vrml/.gitignore | 3 --- pandatool/src/xfile/.gitignore | 3 --- 29 files changed, 5 insertions(+), 95 deletions(-) delete mode 100644 contrib/.gitignore delete mode 100644 contrib/src/panda3dtoolsgui/.gitignore delete mode 100644 direct/.gitignore delete mode 100644 direct/src/configfiles/.gitignore delete mode 100644 direct/src/dcparser/.gitignore delete mode 100644 direct/src/extensions_native/.gitignore delete mode 100644 direct/src/gui/.gitignore delete mode 100644 direct/src/p3d/.gitignore delete mode 100644 direct/src/plugin/.gitignore delete mode 100644 direct/src/plugin_activex/.gitignore delete mode 100644 direct/src/plugin_npapi/.gitignore delete mode 100644 direct/src/plugin_standalone/.gitignore delete mode 100644 direct/src/showutil/.gitignore delete mode 100644 dmodels/.gitignore delete mode 100644 dmodels/src/.gitignore delete mode 100644 dtool/.gitignore delete mode 100644 dtool/src/cppparser/.gitignore delete mode 100644 dtool/src/dtoolutil/.gitignore delete mode 100644 dtool/src/prc/.gitignore delete mode 100644 makepanda/.gitignore delete mode 100644 panda/.gitignore delete mode 100644 panda/src/configfiles/.gitignore delete mode 100644 panda/src/egg/.gitignore delete mode 100644 panda/src/speedtree/.gitignore delete mode 100644 pandatool/.gitignore delete mode 100644 pandatool/src/configfiles/.gitignore delete mode 100644 pandatool/src/vrml/.gitignore delete mode 100644 pandatool/src/xfile/.gitignore diff --git a/.gitignore b/.gitignore index 8f3af151c7..44373e05fe 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,8 @@ CTestTestfile.cmake # Windows Thumbs.db ehthumbs.db + +# Python +__pycache__ +*.pyc +*.pyo diff --git a/contrib/.gitignore b/contrib/.gitignore deleted file mode 100644 index aa93cd250a..0000000000 --- a/contrib/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -*.pyc -*.pyo -/__init__.py -# These are files that are generated within the source tree by the -# ppremake system. -Makefile -pp.dep -/built/ -Opt?-* diff --git a/contrib/src/panda3dtoolsgui/.gitignore b/contrib/src/panda3dtoolsgui/.gitignore deleted file mode 100644 index 2247d5f95a..0000000000 --- a/contrib/src/panda3dtoolsgui/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/build -/dist diff --git a/direct/.gitignore b/direct/.gitignore deleted file mode 100644 index aa93cd250a..0000000000 --- a/direct/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -*.pyc -*.pyo -/__init__.py -# These are files that are generated within the source tree by the -# ppremake system. -Makefile -pp.dep -/built/ -Opt?-* diff --git a/direct/src/configfiles/.gitignore b/direct/src/configfiles/.gitignore deleted file mode 100644 index 4c7cd7cd38..0000000000 --- a/direct/src/configfiles/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/40_direct.prc diff --git a/direct/src/dcparser/.gitignore b/direct/src/dcparser/.gitignore deleted file mode 100644 index b33ad73fcd..0000000000 --- a/direct/src/dcparser/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/dcLexer.cxx -/dcParser.cxx -/dcParser.h diff --git a/direct/src/extensions_native/.gitignore b/direct/src/extensions_native/.gitignore deleted file mode 100644 index 7115252bdf..0000000000 --- a/direct/src/extensions_native/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/extensions_darwin.py diff --git a/direct/src/gui/.gitignore b/direct/src/gui/.gitignore deleted file mode 100644 index d894ce83ae..0000000000 --- a/direct/src/gui/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/NL* -/Nested* diff --git a/direct/src/p3d/.gitignore b/direct/src/p3d/.gitignore deleted file mode 100644 index 1beed8d581..0000000000 --- a/direct/src/p3d/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -/_vfsimporter.exp -/_vfsimporter.lib -/_vfsimporter.pyd -/_vfsimporter.pyd.manifest -/packp3d -/ppackage -/ppatcher -/vc90.pdb diff --git a/direct/src/plugin/.gitignore b/direct/src/plugin/.gitignore deleted file mode 100644 index 5378eb8cad..0000000000 --- a/direct/src/plugin/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/p3d_plugin_config.h diff --git a/direct/src/plugin_activex/.gitignore b/direct/src/plugin_activex/.gitignore deleted file mode 100644 index 3d1f71fddb..0000000000 --- a/direct/src/plugin_activex/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/P3DActiveX.rc diff --git a/direct/src/plugin_npapi/.gitignore b/direct/src/plugin_npapi/.gitignore deleted file mode 100644 index 71d90c1dd6..0000000000 --- a/direct/src/plugin_npapi/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/nppanda3d.rc diff --git a/direct/src/plugin_standalone/.gitignore b/direct/src/plugin_standalone/.gitignore deleted file mode 100644 index 47368b4867..0000000000 --- a/direct/src/plugin_standalone/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/p3d_plugin_config.h -/panda3d.rc diff --git a/direct/src/showutil/.gitignore b/direct/src/showutil/.gitignore deleted file mode 100644 index 88b7659778..0000000000 --- a/direct/src/showutil/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/runp3d diff --git a/dmodels/.gitignore b/dmodels/.gitignore deleted file mode 100644 index 33857b21a5..0000000000 --- a/dmodels/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -*.egg -*.pt -/built/ -Makefile -bams/ -optchar/ -pal_egg/ diff --git a/dmodels/src/.gitignore b/dmodels/src/.gitignore deleted file mode 100644 index 0bb7dfac95..0000000000 --- a/dmodels/src/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/*.buildings -/game_options.txt -/prefixstrip -/retarget/ -/textures.boo -/topstrip/ diff --git a/dtool/.gitignore b/dtool/.gitignore deleted file mode 100644 index d306650d5e..0000000000 --- a/dtool/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -/dtool_config.h -# These are files that are generated within the source tree by the -# ppremake system. -Makefile -pp.dep -/built/ -Opt?-* diff --git a/dtool/src/cppparser/.gitignore b/dtool/src/cppparser/.gitignore deleted file mode 100644 index 541962b7c1..0000000000 --- a/dtool/src/cppparser/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/cppBison.cxx -/cppBison.h diff --git a/dtool/src/dtoolutil/.gitignore b/dtool/src/dtoolutil/.gitignore deleted file mode 100644 index 3ffa6ad966..0000000000 --- a/dtool/src/dtoolutil/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/checkPandaVersion.cxx -/checkPandaVersion.h -/pandaVersion.h diff --git a/dtool/src/prc/.gitignore b/dtool/src/prc/.gitignore deleted file mode 100644 index dd7e0cdd0c..0000000000 --- a/dtool/src/prc/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/prc_parameters.h diff --git a/makepanda/.gitignore b/makepanda/.gitignore deleted file mode 100644 index c3667923e0..0000000000 --- a/makepanda/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.pyc -*.pyo diff --git a/panda/.gitignore b/panda/.gitignore deleted file mode 100644 index ec20cdb1ee..0000000000 --- a/panda/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -*.pyc -*.pyo -# These are files that are generated within the source tree by the -# ppremake system. -Makefile -pp.dep -/built/ -Opt?-* diff --git a/panda/src/configfiles/.gitignore b/panda/src/configfiles/.gitignore deleted file mode 100644 index 7bcbfafc88..0000000000 --- a/panda/src/configfiles/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/20_panda.prc diff --git a/panda/src/egg/.gitignore b/panda/src/egg/.gitignore deleted file mode 100644 index 63ad794cfb..0000000000 --- a/panda/src/egg/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/lexer.cxx -/parser.cxx -/parser.h diff --git a/panda/src/speedtree/.gitignore b/panda/src/speedtree/.gitignore deleted file mode 100644 index cc8bd6d1ad..0000000000 --- a/panda/src/speedtree/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/speedtree_parameters.h diff --git a/pandatool/.gitignore b/pandatool/.gitignore deleted file mode 100644 index 692e733aa2..0000000000 --- a/pandatool/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -# These are files that are generated within the source tree by the -# ppremake system. -Makefile -pp.dep -/built/ -Opt?-* diff --git a/pandatool/src/configfiles/.gitignore b/pandatool/src/configfiles/.gitignore deleted file mode 100644 index 04c04a48d7..0000000000 --- a/pandatool/src/configfiles/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/30_pandatool.prc diff --git a/pandatool/src/vrml/.gitignore b/pandatool/src/vrml/.gitignore deleted file mode 100644 index 1a69860d3a..0000000000 --- a/pandatool/src/vrml/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/vrmlLexer.cxx -/vrmlParser.cxx -/vrmlParser.h diff --git a/pandatool/src/xfile/.gitignore b/pandatool/src/xfile/.gitignore deleted file mode 100644 index 0023fd48ae..0000000000 --- a/pandatool/src/xfile/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/xLexer.cxx -/xParser.cxx -/xParser.h From ed761f29978fdea38e3cfafb5dd504db4c4c99a7 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 31 Oct 2016 20:14:48 +0100 Subject: [PATCH 085/112] Fix build without Python --- panda/src/gobj/texture_ext.cxx | 4 ++++ panda/src/gobj/texture_ext.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/panda/src/gobj/texture_ext.cxx b/panda/src/gobj/texture_ext.cxx index 2a462849c0..1e661e960a 100644 --- a/panda/src/gobj/texture_ext.cxx +++ b/panda/src/gobj/texture_ext.cxx @@ -13,6 +13,8 @@ #include "texture_ext.h" +#ifdef HAVE_PYTHON + #ifndef CPPPARSER extern Dtool_PyTypedObject Dtool_PointerToArray_unsigned_char; extern Dtool_PyTypedObject Dtool_ConstPointerToArray_unsigned_char; @@ -145,3 +147,5 @@ set_ram_image_as(PyObject *image, const string &provided_format) { Dtool_Raise_ArgTypeError(image, 0, "Texture.set_ram_image_as", "CPTA_uchar or buffer"); } + +#endif // HAVE_PYTHON diff --git a/panda/src/gobj/texture_ext.h b/panda/src/gobj/texture_ext.h index f5b4bb4ccd..d33fce24ef 100644 --- a/panda/src/gobj/texture_ext.h +++ b/panda/src/gobj/texture_ext.h @@ -20,6 +20,8 @@ #include "py_panda.h" #include "texture.h" +#ifdef HAVE_PYTHON + /** * This class defines the extension methods for Texture, which are * called instead of any C++ methods with the same prototype. @@ -32,6 +34,8 @@ public: void set_ram_image_as(PyObject *image, const string &provided_format); }; +#endif // HAVE_PYTHON + #endif // CPPPARSER #endif // TEXTURE_EXT_H From c822fb57af130d78392893d3117df51c79727525 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 31 Oct 2016 20:46:20 +0100 Subject: [PATCH 086/112] Changes suggested by liuzhengcai to fix 3dsmax 2014 build --- pandatool/src/maxprogs/maxEggImport.cxx | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/pandatool/src/maxprogs/maxEggImport.cxx b/pandatool/src/maxprogs/maxEggImport.cxx index f72092300f..5e8dd94f16 100644 --- a/pandatool/src/maxprogs/maxEggImport.cxx +++ b/pandatool/src/maxprogs/maxEggImport.cxx @@ -179,9 +179,10 @@ static INT_PTR CALLBACK ImportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM return FALSE; } return TRUE; -} +} -int MaxEggImporter::DoImport(const TCHAR *name,ImpInterface *ii,Interface *i, BOOL suppressPrompts) { +int MaxEggImporter:: +DoImport(const TCHAR *name, ImpInterface *ii, Interface *i, BOOL suppressPrompts) { // Prompt the user with our dialogbox. if (!DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_IMPORT_DLG), i->GetMAXHWnd(), ImportDlgProc, (LPARAM)this)) { @@ -190,13 +191,23 @@ int MaxEggImporter::DoImport(const TCHAR *name,ImpInterface *ii,Interface *i, BO std::ostringstream log; Notify::ptr()->set_ostream_ptr(&log, false); + +#ifdef _UNICODE + char sname[2048]; + sname[2047] = 0; + wcstombs(sname, name, 2047); + bool ok = MaxLoadEggFile(sname, _merge ? true:false, _importmodel ? true:false, _importanim ? true:false); +#else bool ok = MaxLoadEggFile(name, _merge ? true:false, _importmodel ? true:false, _importanim ? true:false); +#endif + string txt = log.str(); if (txt != "") { - MessageBox(NULL, txt.c_str(), "Panda3D Importer", MB_OK); - } else { - if (!ok) MessageBox(NULL, "Import Failed, unknown reason\n", "Panda3D Importer", MB_OK); + MessageBoxA(NULL, txt.c_str(), "Panda3D Importer", MB_OK); + } else if (!ok) { + MessageBoxA(NULL, "Import Failed, unknown reason\n", "Panda3D Importer", MB_OK); } + Notify::ptr()->set_ostream_ptr(NULL, false); return 1; } From 4526de8f7ad198b9e2ac4c7f8e0ca7e34d24c7cb Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 31 Oct 2016 22:07:01 +0100 Subject: [PATCH 087/112] Fix exception when trying to pickle NodePathCollection objects --- doc/ReleaseNotes | 1 + panda/src/pgraph/nodePathCollection_ext.cxx | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index a05c4487e4..76c7add700 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -45,6 +45,7 @@ This issue fixes several bugs that were still found in 1.9.2. * Fix rare X11 .ico cursor bug; also now supports PNG-compressed icons * Add keyword argument support to make() methods such as Shader.make() * Fix compilation errors with Bullet 2.84 +* Fix exception when trying to pickle NodePathCollection objects ------------------------ RELEASE 1.9.2 ------------------------ diff --git a/panda/src/pgraph/nodePathCollection_ext.cxx b/panda/src/pgraph/nodePathCollection_ext.cxx index 48898fb547..0f8c8cdc4a 100644 --- a/panda/src/pgraph/nodePathCollection_ext.cxx +++ b/panda/src/pgraph/nodePathCollection_ext.cxx @@ -84,16 +84,19 @@ __reduce__(PyObject *self) const { // (e.g. this), and the arguments necessary to reconstruct this // object. - PyObject *this_class = PyObject_Type(self); + PyObject *this_class = (PyObject *)self->ob_type; if (this_class == NULL) { return NULL; } + PyObject *self_iter = PyObject_GetIter(self); + if (self_iter == NULL) { + return NULL; + } + // Since a NodePathCollection is itself an iterator, we can simply // pass it as the fourth tuple component. - PyObject *result = Py_BuildValue("(O()OO)", this_class, Py_None, self); - Py_DECREF(this_class); - return result; + return Py_BuildValue("(O()ON)", this_class, Py_None, self_iter); } //////////////////////////////////////////////////////////////////// From 5832ab8099f8880e8b8ca6404d5233c9e6187179 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 31 Oct 2016 22:10:47 +0100 Subject: [PATCH 088/112] Fix errors when trying to raise vectors to a power --- doc/ReleaseNotes | 1 + dtool/src/interrogate/interfaceMakerPythonNative.cxx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index 76c7add700..157a20b2bf 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -46,6 +46,7 @@ This issue fixes several bugs that were still found in 1.9.2. * Add keyword argument support to make() methods such as Shader.make() * Fix compilation errors with Bullet 2.84 * Fix exception when trying to pickle NodePathCollection objects +* Fix error when trying to raise vectors to a power ------------------------ RELEASE 1.9.2 ------------------------ diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index db1825c079..014c98f438 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -2209,7 +2209,7 @@ write_module_class(ostream &out, Object *obj) { string expected_params; - out << " if (arg2 != (PyObject *)NULL) {\n"; + out << " if (arg2 != (PyObject *)NULL && arg2 != Py_None) {\n"; out << " PyObject *args = PyTuple_Pack(2, arg, arg2);\n"; write_function_forset(out, two_param_remaps, 2, 2, expected_params, 4, true, true, AT_varargs, RF_pyobject | RF_err_null | RF_decref_args, true); From 50e8d5d08d344e6ebca579f3f82348627bd87b1b Mon Sep 17 00:00:00 2001 From: tobspr Date: Mon, 31 Oct 2016 22:33:52 +0100 Subject: [PATCH 089/112] Update stdint.h This adds missing definitions from the standard library header ` stdint.h` to the interrogate header. I also changed the `typedef` to the C++11 style `using`. Closes: #125 --- dtool/src/parser-inc/stdint.h | 48 +++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/dtool/src/parser-inc/stdint.h b/dtool/src/parser-inc/stdint.h index 44729cbe17..6e67b9ed9d 100644 --- a/dtool/src/parser-inc/stdint.h +++ b/dtool/src/parser-inc/stdint.h @@ -20,25 +20,45 @@ #define __WORDSIZE 32 #endif -typedef signed char int8_t; -typedef short int int16_t; -typedef int int32_t; -typedef long long int int64_t; +using intmax_t = long long int; +using uintmax_t = unsigned long long int; -typedef unsigned char uint8_t; -typedef unsigned short int uint16_t; -typedef unsigned int uint32_t; -typedef unsigned long long int uint64_t; +using int8_t = signed char; +using int16_t = short int; +using int32_t = int; +using int64_t = long long int; -typedef long long int intmax_t; -typedef unsigned long long int uintmax_t; +using uint8_t = unsigned char; +using uint16_t = unsigned short int; +using uint32_t = unsigned int; +using uint64_t = unsigned long long int; + +using int_least8_t = int8_t; +using int_least16_t = int16_t; +using int_least32_t = int32_t; +using int_least64_t = int64_t; + +using uint_least8_t = uint8_t; +using uint_least16_t = uint16_t; +using uint_least32_t = uint32_t; +using uint_least64_t = uint64_t; + +using int_fast8_t = int8_t; +using int_fast16_t = int16_t; +using int_fast32_t = int32_t; +using int_fast64_t = int64_t; + +using uint_fast8_t = uint8_t; +using uint_fast16_t = uint16_t; +using uint_fast32_t = uint32_t; +using uint_fast64_t = uint64_t; #if __WORDSIZE == 64 -typedef int64_t intptr_t; -typedef uint64_t uintptr_t; +using intptr_t = int64_t; +using uintptr_t = uint64_t; #else -typedef int32_t intptr_t; -typedef uint32_t uintptr_t; +using intptr_t = int32_t; +using uintptr_t = uint32_t; #endif #endif From 1467541b8d1df4364ca2bebad0d45620dfdc9f60 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 1 Nov 2016 12:17:49 +0100 Subject: [PATCH 090/112] Interrogate issues: "fix #pragma once" for files specified on command-line, fix "unexpected $end" not having line numbers when parsing template parameter list --- dtool/src/cppparser/cppFile.h | 2 +- dtool/src/cppparser/cppParser.cxx | 15 ++++++++++++++- dtool/src/cppparser/cppPreprocessor.cxx | 6 +++--- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/dtool/src/cppparser/cppFile.h b/dtool/src/cppparser/cppFile.h index b284758615..f3644fce3c 100644 --- a/dtool/src/cppparser/cppFile.h +++ b/dtool/src/cppparser/cppFile.h @@ -55,7 +55,7 @@ public: Filename _filename; Filename _filename_as_referenced; - Source _source; + mutable Source _source; mutable bool _pragma_once; }; diff --git a/dtool/src/cppparser/cppParser.cxx b/dtool/src/cppparser/cppParser.cxx index 29874cb559..4b27a87d6d 100644 --- a/dtool/src/cppparser/cppParser.cxx +++ b/dtool/src/cppparser/cppParser.cxx @@ -45,7 +45,20 @@ is_fully_specified() const { */ bool CPPParser:: parse_file(const Filename &filename) { - if (!init_cpp(CPPFile(filename, filename, CPPFile::S_local))) { + Filename canonical(filename); + canonical.make_canonical(); + + CPPFile file(canonical, filename, CPPFile::S_local); + + // Don't read it if we included it before and it had #pragma once. + ParsedFiles::iterator it = _parsed_files.find(file); + if (it != _parsed_files.end() && it->_pragma_once) { + // But mark it as local. + it->_source = CPPFile::S_local; + return true; + } + + if (!init_cpp(file)) { cerr << "Unable to read " << filename << "\n"; return false; } diff --git a/dtool/src/cppparser/cppPreprocessor.cxx b/dtool/src/cppparser/cppPreprocessor.cxx index f0fe1c9819..a6ad3d1cad 100644 --- a/dtool/src/cppparser/cppPreprocessor.cxx +++ b/dtool/src/cppparser/cppPreprocessor.cxx @@ -951,7 +951,7 @@ internal_get_next_token() { case ',': if (_paren_nesting <= 0) { _state = S_end_nested; - return CPPToken::eof(); + return CPPToken(0, loc); } break; @@ -959,7 +959,7 @@ internal_get_next_token() { if (_paren_nesting <= 0) { _parsing_template_params = false; _state = S_end_nested; - return CPPToken::eof(); + return CPPToken(0, loc); } } } @@ -1639,7 +1639,7 @@ handle_include_directive(const string &args, const YYLTYPE &loc) { _last_c = '\0'; // If it was explicitly named on the command-line, mark it S_local. - filename.make_absolute(); + filename.make_canonical(); if (_explicit_files.count(filename)) { source = CPPFile::S_local; } From 7bef96e71d2910d3dc9513079c256db30959f41a Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 3 Nov 2016 11:11:02 +0100 Subject: [PATCH 091/112] Don't give misleading error when image shader input is missing --- panda/src/glstuff/glShaderContext_src.cxx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index 60563af5db..3e1fe026f9 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -2413,16 +2413,24 @@ update_shader_texture_bindings(ShaderContext *prev) { Texture *tex; const ShaderInput *sinp = _glgsg->_target_shader->get_shader_input(input._name); - if (sinp->get_value_type() == ShaderInput::M_texture_image) { + switch (sinp->get_value_type()) { + case ShaderInput::M_texture_image: param = (const ParamTextureImage *)sinp->get_param(); tex = param->get_texture(); + break; - } else if (sinp->get_value_type() == ShaderInput::M_texture) { + case ShaderInput::M_texture: // People find it convenient to be able to pass a texture without // further ado. tex = sinp->get_texture(); + break; - } else { + case ShaderInput::M_invalid: + GLCAT.error() + << "Missing texture image binding input " << *input._name << "\n"; + continue; + + default: GLCAT.error() << "Mismatching type for parameter " << *input._name << ", expected texture image binding\n"; continue; From 7259425b7c1324192bdd55a5814c6a0530abb02b Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 3 Nov 2016 11:34:10 +0100 Subject: [PATCH 092/112] Let's do away with Geom-wide usage hints, it's not very useful --- .../glstuff/glGraphicsStateGuardian_src.cxx | 2 +- panda/src/gobj/geom.I | 29 -------- panda/src/gobj/geom.cxx | 74 +++++-------------- panda/src/gobj/geom.h | 10 +-- 4 files changed, 21 insertions(+), 94 deletions(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 0b36265eb6..296b38df76 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -3956,7 +3956,7 @@ begin_draw_primitives(const GeomPipelineReader *geom_reader, #endif #if !defined(OPENGLES) && defined(SUPPORT_FIXED_FUNCTION) // Display lists not supported by OpenGL ES. - if (geom_reader->get_usage_hint() == Geom::UH_static && + if (/*geom_reader->get_usage_hint() == Geom::UH_static &&*/ _data_reader->get_usage_hint() == Geom::UH_static && display_lists) { // If the geom claims to be totally static, try to build it into a display diff --git a/panda/src/gobj/geom.I b/panda/src/gobj/geom.I index 05ddfd85ff..33132b3be5 100644 --- a/panda/src/gobj/geom.I +++ b/panda/src/gobj/geom.I @@ -44,21 +44,6 @@ get_geom_rendering() const { return cdata->_geom_rendering; } -/** - * Returns the minimum (i.e. most dynamic) usage_hint among all of the - * individual GeomPrimitives that have been added to the geom. - */ -INLINE Geom::UsageHint Geom:: -get_usage_hint() const { - CDLockedReader cdata(_cycler); - if (!cdata->_got_usage_hint) { - CDWriter cdataw(((Geom *)this)->_cycler, cdata, false); - ((Geom *)this)->reset_usage_hint(cdataw); - return cdataw->_usage_hint; - } - return cdata->_usage_hint; -} - /** * Returns a const pointer to the GeomVertexData, for application code to * directly examine (but not modify) the geom's underlying data. @@ -114,7 +99,6 @@ modify_primitive(int i) { Thread *current_thread = Thread::get_current_thread(); CDWriter cdata(_cycler, true, current_thread); nassertr(i >= 0 && i < (int)cdata->_primitives.size(), NULL); - cdata->_got_usage_hint = false; cdata->_modified = Geom::get_next_modified(); clear_cache_stage(current_thread); return cdata->_primitives[i].get_write_pointer(); @@ -505,8 +489,6 @@ CData() : _primitive_type(PT_none), _shade_model(SM_uniform), _geom_rendering(0), - _usage_hint(UH_unspecified), - _got_usage_hint(false), _nested_vertices(0), _internal_bounds_stale(true), _bounds_type(BoundingVolume::BT_default) @@ -523,8 +505,6 @@ CData(const Geom::CData ©) : _primitive_type(copy._primitive_type), _shade_model(copy._shade_model), _geom_rendering(copy._geom_rendering), - _usage_hint(copy._usage_hint), - _got_usage_hint(copy._got_usage_hint), _modified(copy._modified), _internal_bounds(copy._internal_bounds), _nested_vertices(copy._nested_vertices), @@ -627,15 +607,6 @@ get_geom_rendering() const { return _cdata->_geom_rendering; } -/** - * - */ -INLINE GeomPipelineReader::UsageHint GeomPipelineReader:: -get_usage_hint() const { - nassertr(_cdata->_got_usage_hint, UH_static); - return _cdata->_usage_hint; -} - /** * */ diff --git a/panda/src/gobj/geom.cxx b/panda/src/gobj/geom.cxx index 2b7e914d86..1d3e0a2a45 100644 --- a/panda/src/gobj/geom.cxx +++ b/panda/src/gobj/geom.cxx @@ -104,6 +104,24 @@ make_copy() const { return new Geom(*this); } +/** + * Returns the minimum (i.e. most dynamic) usage_hint among all of the + * individual GeomPrimitives that have been added to the geom. + * @deprecated This is no longer very useful. + */ +Geom::UsageHint Geom:: +get_usage_hint() const { + CDReader cdata(_cycler); + GeomEnums::UsageHint hint = UH_unspecified; + Primitives::const_iterator pi; + for (pi = cdata->_primitives.begin(); + pi != cdata->_primitives.end(); + ++pi) { + hint = min(hint, (*pi).get_read_pointer()->get_usage_hint()); + } + return hint; +} + /** * Changes the UsageHint hint for all of the primitives on this Geom to the * same value. See get_usage_hint(). @@ -115,7 +133,6 @@ void Geom:: set_usage_hint(Geom::UsageHint usage_hint) { Thread *current_thread = Thread::get_current_thread(); CDWriter cdata(_cycler, true, current_thread); - cdata->_usage_hint = usage_hint; Primitives::iterator pi; for (pi = cdata->_primitives.begin(); pi != cdata->_primitives.end(); ++pi) { @@ -304,7 +321,6 @@ set_primitive(int i, const GeomPrimitive *primitive) { } reset_geom_rendering(cdata); - cdata->_got_usage_hint = false; cdata->_modified = Geom::get_next_modified(); clear_cache_stage(current_thread); mark_internal_bounds_stale(cdata); @@ -346,7 +362,6 @@ add_primitive(const GeomPrimitive *primitive) { } reset_geom_rendering(cdata); - cdata->_got_usage_hint = false; cdata->_modified = Geom::get_next_modified(); clear_cache_stage(current_thread); mark_internal_bounds_stale(cdata); @@ -369,7 +384,6 @@ remove_primitive(int i) { cdata->_shade_model = SM_uniform; } reset_geom_rendering(cdata); - cdata->_got_usage_hint = false; cdata->_modified = Geom::get_next_modified(); clear_cache_stage(current_thread); mark_internal_bounds_stale(cdata); @@ -1154,8 +1168,6 @@ draw(GraphicsStateGuardianBase *gsg, const GeomMunger *munger, const GeomVertexData *vertex_data, bool force, Thread *current_thread) const { GeomPipelineReader geom_reader(this, current_thread); - geom_reader.check_usage_hint(); - GeomVertexDataPipelineReader data_reader(vertex_data, current_thread); data_reader.check_array_readers(); @@ -1380,22 +1392,6 @@ check_will_be_valid(const GeomVertexData *vertex_data) const { return true; } -/** - * Recomputes the minimum usage_hint. - */ -void Geom:: -reset_usage_hint(Geom::CData *cdata) { - cdata->_usage_hint = UH_unspecified; - Primitives::const_iterator pi; - for (pi = cdata->_primitives.begin(); - pi != cdata->_primitives.end(); - ++pi) { - cdata->_usage_hint = min(cdata->_usage_hint, - (*pi).get_read_pointer()->get_usage_hint()); - } - cdata->_got_usage_hint = true; -} - /** * Rederives the _geom_rendering member. */ @@ -1670,7 +1666,6 @@ fillin(DatagramIterator &scan, BamReader *manager) { // instead, we rederive it in finalize(). scan.get_uint16(); - _got_usage_hint = false; _modified = Geom::get_next_modified(); _bounds_type = BoundingVolume::BT_default; @@ -1679,39 +1674,6 @@ fillin(DatagramIterator &scan, BamReader *manager) { } } -/** - * Ensures that the Geom's usage_hint cache has been computed. - */ -void GeomPipelineReader:: -check_usage_hint() const { - if (!_cdata->_got_usage_hint) { - // We'll need to get a fresh pointer, since another thread might already - // have modified the pointer on the object since we queried it. - { -#ifdef DO_PIPELINING - unref_delete((CycleData *)_cdata); -#endif - Geom::CDWriter fresh_cdata(((Geom *)_object)->_cycler, - false, _current_thread); - ((GeomPipelineReader *)this)->_cdata = fresh_cdata; -#ifdef DO_PIPELINING - _cdata->ref(); -#endif - if (!fresh_cdata->_got_usage_hint) { - // The cache is still stale. We have to do the work of freshening it. - ((Geom *)_object)->reset_usage_hint(fresh_cdata); - nassertv(fresh_cdata->_got_usage_hint); - } - - // When fresh_cdata goes out of scope, its write lock is released, and - // _cdata reverts to our usual convention of an unlocked copy of the - // data. - } - } - - nassertv(_cdata->_got_usage_hint); -} - /** * */ diff --git a/panda/src/gobj/geom.h b/panda/src/gobj/geom.h index 6a12e8ee98..cd02493d79 100644 --- a/panda/src/gobj/geom.h +++ b/panda/src/gobj/geom.h @@ -75,9 +75,9 @@ PUBLISHED: MAKE_PROPERTY(shade_model, get_shade_model); MAKE_PROPERTY(geom_rendering, get_geom_rendering); - INLINE UsageHint get_usage_hint() const; + UsageHint get_usage_hint() const; void set_usage_hint(UsageHint usage_hint); - MAKE_PROPERTY(usage_hint, get_usage_hint, set_usage_hint); + //MAKE_PROPERTY(usage_hint, get_usage_hint, set_usage_hint); INLINE CPT(GeomVertexData) get_vertex_data(Thread *current_thread = Thread::get_current_thread()) const; PT(GeomVertexData) modify_vertex_data(); @@ -194,7 +194,6 @@ private: void clear_prepared(PreparedGraphicsObjects *prepared_objects); bool check_will_be_valid(const GeomVertexData *vertex_data) const; - void reset_usage_hint(CData *cdata); void reset_geom_rendering(CData *cdata); void combine_primitives(GeomPrimitive *a_prim, const GeomPrimitive *b_prim, @@ -318,8 +317,6 @@ private: PrimitiveType _primitive_type; ShadeModel _shade_model; int _geom_rendering; - UsageHint _usage_hint; - bool _got_usage_hint; UpdateSeq _modified; CPT(BoundingVolume) _internal_bounds; @@ -416,12 +413,9 @@ public: INLINE const Geom *get_object() const; INLINE Thread *get_current_thread() const; - void check_usage_hint() const; - INLINE PrimitiveType get_primitive_type() const; INLINE ShadeModel get_shade_model() const; INLINE int get_geom_rendering() const; - INLINE UsageHint get_usage_hint() const; INLINE CPT(GeomVertexData) get_vertex_data() const; INLINE int get_num_primitives() const; INLINE CPT(GeomPrimitive) get_primitive(int i) const; From 22f0b508510cf2daa9a5f7e555d463d1d45ecfe2 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 3 Nov 2016 12:13:06 +0100 Subject: [PATCH 093/112] More Interrogate C++11 support changes: * Parse variadic templates * Add (incomplete) type_traits support * Parse anonymous class template params * Parse volatile/lvalue/rvalue methods * Don't generate destructor for indestructible types * Add xmmintrin.h header * Allow invoking extensions with references --- dtool/src/cppparser/cppArrayType.cxx | 11 +- dtool/src/cppparser/cppArrayType.h | 1 + dtool/src/cppparser/cppBison.cxx.prebuilt | 9516 +++++++++-------- dtool/src/cppparser/cppBison.h.prebuilt | 492 +- dtool/src/cppparser/cppBison.yxx | 346 +- .../cppparser/cppClassTemplateParameter.cxx | 30 +- .../src/cppparser/cppClassTemplateParameter.h | 1 + dtool/src/cppparser/cppConstType.cxx | 43 +- dtool/src/cppparser/cppConstType.h | 5 + dtool/src/cppparser/cppDeclaration.cxx | 10 +- dtool/src/cppparser/cppDeclaration.h | 71 +- dtool/src/cppparser/cppExpression.cxx | 219 +- dtool/src/cppparser/cppExpression.h | 11 +- dtool/src/cppparser/cppExtensionType.cxx | 26 +- dtool/src/cppparser/cppExtensionType.h | 2 + dtool/src/cppparser/cppFunctionType.cxx | 11 +- dtool/src/cppparser/cppFunctionType.h | 3 + dtool/src/cppparser/cppInstance.cxx | 13 +- dtool/src/cppparser/cppInstance.h | 3 + dtool/src/cppparser/cppInstanceIdentifier.cxx | 14 +- dtool/src/cppparser/cppInstanceIdentifier.h | 4 + dtool/src/cppparser/cppPointerType.cxx | 65 + dtool/src/cppparser/cppPointerType.h | 2 + dtool/src/cppparser/cppPreprocessor.cxx | 58 +- dtool/src/cppparser/cppReferenceType.cxx | 79 + dtool/src/cppparser/cppReferenceType.h | 3 + dtool/src/cppparser/cppScope.cxx | 1 - dtool/src/cppparser/cppSimpleType.cxx | 53 + dtool/src/cppparser/cppSimpleType.h | 18 +- dtool/src/cppparser/cppStructType.cxx | 377 +- dtool/src/cppparser/cppStructType.h | 12 + dtool/src/cppparser/cppTemplateScope.cxx | 6 +- dtool/src/cppparser/cppType.cxx | 176 +- dtool/src/cppparser/cppType.h | 17 + dtool/src/cppparser/cppTypedefType.cxx | 41 + dtool/src/cppparser/cppTypedefType.h | 5 + dtool/src/interrogate/interrogateBuilder.cxx | 10 +- dtool/src/interrogatedb/extension.h | 16 + dtool/src/parser-inc/type_traits | 96 + dtool/src/parser-inc/xmmintrin.h | 1 + 40 files changed, 7175 insertions(+), 4693 deletions(-) create mode 100644 dtool/src/parser-inc/type_traits create mode 100644 dtool/src/parser-inc/xmmintrin.h diff --git a/dtool/src/cppparser/cppArrayType.cxx b/dtool/src/cppparser/cppArrayType.cxx index ac891e259f..ce861c1d69 100644 --- a/dtool/src/cppparser/cppArrayType.cxx +++ b/dtool/src/cppparser/cppArrayType.cxx @@ -13,6 +13,7 @@ #include "cppArrayType.h" #include "cppExpression.h" +#include "cppPointerType.h" /** * @@ -63,6 +64,14 @@ is_tbd() const { return _element_type->is_tbd(); } +/** + * Returns true if the type is considered a standard layout type. + */ +bool CPPArrayType:: +is_standard_layout() const { + return _element_type->is_standard_layout(); +} + /** * Returns true if the type is considered a Plain Old Data (POD) type. */ @@ -76,7 +85,7 @@ is_trivial() const { */ bool CPPArrayType:: is_default_constructible() const { - return _element_type->is_default_constructible(); + return _bounds != NULL && _element_type->is_default_constructible(); } /** diff --git a/dtool/src/cppparser/cppArrayType.h b/dtool/src/cppparser/cppArrayType.h index 4633e95aa4..9e2489be72 100644 --- a/dtool/src/cppparser/cppArrayType.h +++ b/dtool/src/cppparser/cppArrayType.h @@ -38,6 +38,7 @@ public: virtual CPPType *resolve_type(CPPScope *current_scope, CPPScope *global_scope); virtual bool is_tbd() const; + virtual bool is_standard_layout() const; virtual bool is_trivial() const; virtual bool is_default_constructible() const; virtual bool is_copy_constructible() const; diff --git a/dtool/src/cppparser/cppBison.cxx.prebuilt b/dtool/src/cppparser/cppBison.cxx.prebuilt index 427e91bf55..dcc103b178 100644 --- a/dtool/src/cppparser/cppBison.cxx.prebuilt +++ b/dtool/src/cppparser/cppBison.cxx.prebuilt @@ -306,120 +306,138 @@ extern int cppyydebug; CUSTOM_LITERAL = 264, IDENTIFIER = 265, TYPENAME_IDENTIFIER = 266, - SCOPING = 267, - TYPEDEFNAME = 268, - ELLIPSIS = 269, - OROR = 270, - ANDAND = 271, - EQCOMPARE = 272, - NECOMPARE = 273, - LECOMPARE = 274, - GECOMPARE = 275, - LSHIFT = 276, - RSHIFT = 277, - POINTSAT_STAR = 278, - DOT_STAR = 279, - UNARY = 280, - UNARY_NOT = 281, - UNARY_NEGATE = 282, - UNARY_MINUS = 283, - UNARY_PLUS = 284, - UNARY_STAR = 285, - UNARY_REF = 286, - POINTSAT = 287, - SCOPE = 288, - PLUSPLUS = 289, - MINUSMINUS = 290, - TIMESEQUAL = 291, - DIVIDEEQUAL = 292, - MODEQUAL = 293, - PLUSEQUAL = 294, - MINUSEQUAL = 295, - OREQUAL = 296, - ANDEQUAL = 297, - XOREQUAL = 298, - LSHIFTEQUAL = 299, - RSHIFTEQUAL = 300, - KW_ALIGNAS = 301, - KW_ALIGNOF = 302, - KW_AUTO = 303, - KW_BEGIN_PUBLISH = 304, - KW_BLOCKING = 305, - KW_BOOL = 306, - KW_CATCH = 307, - KW_CHAR = 308, - KW_CHAR16_T = 309, - KW_CHAR32_T = 310, - KW_CLASS = 311, - KW_CONST = 312, - KW_CONSTEXPR = 313, - KW_CONST_CAST = 314, - KW_DECLTYPE = 315, - KW_DEFAULT = 316, - KW_DELETE = 317, - KW_DOUBLE = 318, - KW_DYNAMIC_CAST = 319, - KW_ELSE = 320, - KW_END_PUBLISH = 321, - KW_ENUM = 322, - KW_EXTENSION = 323, - KW_EXTERN = 324, - KW_EXPLICIT = 325, - KW_PUBLISHED = 326, - KW_FALSE = 327, - KW_FINAL = 328, - KW_FLOAT = 329, - KW_FRIEND = 330, - KW_FOR = 331, - KW_GOTO = 332, - KW_IF = 333, - KW_INLINE = 334, - KW_INT = 335, - KW_LONG = 336, - KW_MAKE_MAP_PROPERTY = 337, - KW_MAKE_PROPERTY = 338, - KW_MAKE_PROPERTY2 = 339, - KW_MAKE_SEQ = 340, - KW_MAKE_SEQ_PROPERTY = 341, - KW_MUTABLE = 342, - KW_NAMESPACE = 343, - KW_NEW = 344, - KW_NOEXCEPT = 345, - KW_NULLPTR = 346, - KW_OPERATOR = 347, - KW_OVERRIDE = 348, - KW_PRIVATE = 349, - KW_PROTECTED = 350, - KW_PUBLIC = 351, - KW_REGISTER = 352, - KW_REINTERPRET_CAST = 353, - KW_RETURN = 354, - KW_SHORT = 355, - KW_SIGNED = 356, - KW_SIZEOF = 357, - KW_STATIC = 358, - KW_STATIC_ASSERT = 359, - KW_STATIC_CAST = 360, - KW_STRUCT = 361, - KW_TEMPLATE = 362, - KW_THREAD_LOCAL = 363, - KW_THROW = 364, - KW_TRUE = 365, - KW_TRY = 366, - KW_TYPEDEF = 367, - KW_TYPEID = 368, - KW_TYPENAME = 369, - KW_UNION = 370, - KW_UNSIGNED = 371, - KW_USING = 372, - KW_VIRTUAL = 373, - KW_VOID = 374, - KW_VOLATILE = 375, - KW_WCHAR_T = 376, - KW_WHILE = 377, - START_CPP = 378, - START_CONST_EXPR = 379, - START_TYPE = 380 + TYPEPACK_IDENTIFIER = 267, + SCOPING = 268, + TYPEDEFNAME = 269, + ELLIPSIS = 270, + OROR = 271, + ANDAND = 272, + EQCOMPARE = 273, + NECOMPARE = 274, + LECOMPARE = 275, + GECOMPARE = 276, + LSHIFT = 277, + RSHIFT = 278, + POINTSAT_STAR = 279, + DOT_STAR = 280, + UNARY = 281, + UNARY_NOT = 282, + UNARY_NEGATE = 283, + UNARY_MINUS = 284, + UNARY_PLUS = 285, + UNARY_STAR = 286, + UNARY_REF = 287, + POINTSAT = 288, + SCOPE = 289, + PLUSPLUS = 290, + MINUSMINUS = 291, + TIMESEQUAL = 292, + DIVIDEEQUAL = 293, + MODEQUAL = 294, + PLUSEQUAL = 295, + MINUSEQUAL = 296, + OREQUAL = 297, + ANDEQUAL = 298, + XOREQUAL = 299, + LSHIFTEQUAL = 300, + RSHIFTEQUAL = 301, + KW_ALIGNAS = 302, + KW_ALIGNOF = 303, + KW_AUTO = 304, + KW_BEGIN_PUBLISH = 305, + KW_BLOCKING = 306, + KW_BOOL = 307, + KW_CATCH = 308, + KW_CHAR = 309, + KW_CHAR16_T = 310, + KW_CHAR32_T = 311, + KW_CLASS = 312, + KW_CONST = 313, + KW_CONSTEXPR = 314, + KW_CONST_CAST = 315, + KW_DECLTYPE = 316, + KW_DEFAULT = 317, + KW_DELETE = 318, + KW_DOUBLE = 319, + KW_DYNAMIC_CAST = 320, + KW_ELSE = 321, + KW_END_PUBLISH = 322, + KW_ENUM = 323, + KW_EXTENSION = 324, + KW_EXTERN = 325, + KW_EXPLICIT = 326, + KW_PUBLISHED = 327, + KW_FALSE = 328, + KW_FINAL = 329, + KW_FLOAT = 330, + KW_FRIEND = 331, + KW_FOR = 332, + KW_GOTO = 333, + KW_HAS_VIRTUAL_DESTRUCTOR = 334, + KW_IF = 335, + KW_INLINE = 336, + KW_INT = 337, + KW_IS_ABSTRACT = 338, + KW_IS_BASE_OF = 339, + KW_IS_CLASS = 340, + KW_IS_CONSTRUCTIBLE = 341, + KW_IS_CONVERTIBLE_TO = 342, + KW_IS_DESTRUCTIBLE = 343, + KW_IS_EMPTY = 344, + KW_IS_ENUM = 345, + KW_IS_FINAL = 346, + KW_IS_FUNDAMENTAL = 347, + KW_IS_POD = 348, + KW_IS_POLYMORPHIC = 349, + KW_IS_STANDARD_LAYOUT = 350, + KW_IS_TRIVIAL = 351, + KW_IS_UNION = 352, + KW_LONG = 353, + KW_MAKE_MAP_PROPERTY = 354, + KW_MAKE_PROPERTY = 355, + KW_MAKE_PROPERTY2 = 356, + KW_MAKE_SEQ = 357, + KW_MAKE_SEQ_PROPERTY = 358, + KW_MUTABLE = 359, + KW_NAMESPACE = 360, + KW_NEW = 361, + KW_NOEXCEPT = 362, + KW_NULLPTR = 363, + KW_OPERATOR = 364, + KW_OVERRIDE = 365, + KW_PRIVATE = 366, + KW_PROTECTED = 367, + KW_PUBLIC = 368, + KW_REGISTER = 369, + KW_REINTERPRET_CAST = 370, + KW_RETURN = 371, + KW_SHORT = 372, + KW_SIGNED = 373, + KW_SIZEOF = 374, + KW_STATIC = 375, + KW_STATIC_ASSERT = 376, + KW_STATIC_CAST = 377, + KW_STRUCT = 378, + KW_TEMPLATE = 379, + KW_THREAD_LOCAL = 380, + KW_THROW = 381, + KW_TRUE = 382, + KW_TRY = 383, + KW_TYPEDEF = 384, + KW_TYPEID = 385, + KW_TYPENAME = 386, + KW_UNDERLYING_TYPE = 387, + KW_UNION = 388, + KW_UNSIGNED = 389, + KW_USING = 390, + KW_VIRTUAL = 391, + KW_VOID = 392, + KW_VOLATILE = 393, + KW_WCHAR_T = 394, + KW_WHILE = 395, + START_CPP = 396, + START_CONST_EXPR = 397, + START_TYPE = 398 }; #endif /* Tokens. */ @@ -432,120 +450,138 @@ extern int cppyydebug; #define CUSTOM_LITERAL 264 #define IDENTIFIER 265 #define TYPENAME_IDENTIFIER 266 -#define SCOPING 267 -#define TYPEDEFNAME 268 -#define ELLIPSIS 269 -#define OROR 270 -#define ANDAND 271 -#define EQCOMPARE 272 -#define NECOMPARE 273 -#define LECOMPARE 274 -#define GECOMPARE 275 -#define LSHIFT 276 -#define RSHIFT 277 -#define POINTSAT_STAR 278 -#define DOT_STAR 279 -#define UNARY 280 -#define UNARY_NOT 281 -#define UNARY_NEGATE 282 -#define UNARY_MINUS 283 -#define UNARY_PLUS 284 -#define UNARY_STAR 285 -#define UNARY_REF 286 -#define POINTSAT 287 -#define SCOPE 288 -#define PLUSPLUS 289 -#define MINUSMINUS 290 -#define TIMESEQUAL 291 -#define DIVIDEEQUAL 292 -#define MODEQUAL 293 -#define PLUSEQUAL 294 -#define MINUSEQUAL 295 -#define OREQUAL 296 -#define ANDEQUAL 297 -#define XOREQUAL 298 -#define LSHIFTEQUAL 299 -#define RSHIFTEQUAL 300 -#define KW_ALIGNAS 301 -#define KW_ALIGNOF 302 -#define KW_AUTO 303 -#define KW_BEGIN_PUBLISH 304 -#define KW_BLOCKING 305 -#define KW_BOOL 306 -#define KW_CATCH 307 -#define KW_CHAR 308 -#define KW_CHAR16_T 309 -#define KW_CHAR32_T 310 -#define KW_CLASS 311 -#define KW_CONST 312 -#define KW_CONSTEXPR 313 -#define KW_CONST_CAST 314 -#define KW_DECLTYPE 315 -#define KW_DEFAULT 316 -#define KW_DELETE 317 -#define KW_DOUBLE 318 -#define KW_DYNAMIC_CAST 319 -#define KW_ELSE 320 -#define KW_END_PUBLISH 321 -#define KW_ENUM 322 -#define KW_EXTENSION 323 -#define KW_EXTERN 324 -#define KW_EXPLICIT 325 -#define KW_PUBLISHED 326 -#define KW_FALSE 327 -#define KW_FINAL 328 -#define KW_FLOAT 329 -#define KW_FRIEND 330 -#define KW_FOR 331 -#define KW_GOTO 332 -#define KW_IF 333 -#define KW_INLINE 334 -#define KW_INT 335 -#define KW_LONG 336 -#define KW_MAKE_MAP_PROPERTY 337 -#define KW_MAKE_PROPERTY 338 -#define KW_MAKE_PROPERTY2 339 -#define KW_MAKE_SEQ 340 -#define KW_MAKE_SEQ_PROPERTY 341 -#define KW_MUTABLE 342 -#define KW_NAMESPACE 343 -#define KW_NEW 344 -#define KW_NOEXCEPT 345 -#define KW_NULLPTR 346 -#define KW_OPERATOR 347 -#define KW_OVERRIDE 348 -#define KW_PRIVATE 349 -#define KW_PROTECTED 350 -#define KW_PUBLIC 351 -#define KW_REGISTER 352 -#define KW_REINTERPRET_CAST 353 -#define KW_RETURN 354 -#define KW_SHORT 355 -#define KW_SIGNED 356 -#define KW_SIZEOF 357 -#define KW_STATIC 358 -#define KW_STATIC_ASSERT 359 -#define KW_STATIC_CAST 360 -#define KW_STRUCT 361 -#define KW_TEMPLATE 362 -#define KW_THREAD_LOCAL 363 -#define KW_THROW 364 -#define KW_TRUE 365 -#define KW_TRY 366 -#define KW_TYPEDEF 367 -#define KW_TYPEID 368 -#define KW_TYPENAME 369 -#define KW_UNION 370 -#define KW_UNSIGNED 371 -#define KW_USING 372 -#define KW_VIRTUAL 373 -#define KW_VOID 374 -#define KW_VOLATILE 375 -#define KW_WCHAR_T 376 -#define KW_WHILE 377 -#define START_CPP 378 -#define START_CONST_EXPR 379 -#define START_TYPE 380 +#define TYPEPACK_IDENTIFIER 267 +#define SCOPING 268 +#define TYPEDEFNAME 269 +#define ELLIPSIS 270 +#define OROR 271 +#define ANDAND 272 +#define EQCOMPARE 273 +#define NECOMPARE 274 +#define LECOMPARE 275 +#define GECOMPARE 276 +#define LSHIFT 277 +#define RSHIFT 278 +#define POINTSAT_STAR 279 +#define DOT_STAR 280 +#define UNARY 281 +#define UNARY_NOT 282 +#define UNARY_NEGATE 283 +#define UNARY_MINUS 284 +#define UNARY_PLUS 285 +#define UNARY_STAR 286 +#define UNARY_REF 287 +#define POINTSAT 288 +#define SCOPE 289 +#define PLUSPLUS 290 +#define MINUSMINUS 291 +#define TIMESEQUAL 292 +#define DIVIDEEQUAL 293 +#define MODEQUAL 294 +#define PLUSEQUAL 295 +#define MINUSEQUAL 296 +#define OREQUAL 297 +#define ANDEQUAL 298 +#define XOREQUAL 299 +#define LSHIFTEQUAL 300 +#define RSHIFTEQUAL 301 +#define KW_ALIGNAS 302 +#define KW_ALIGNOF 303 +#define KW_AUTO 304 +#define KW_BEGIN_PUBLISH 305 +#define KW_BLOCKING 306 +#define KW_BOOL 307 +#define KW_CATCH 308 +#define KW_CHAR 309 +#define KW_CHAR16_T 310 +#define KW_CHAR32_T 311 +#define KW_CLASS 312 +#define KW_CONST 313 +#define KW_CONSTEXPR 314 +#define KW_CONST_CAST 315 +#define KW_DECLTYPE 316 +#define KW_DEFAULT 317 +#define KW_DELETE 318 +#define KW_DOUBLE 319 +#define KW_DYNAMIC_CAST 320 +#define KW_ELSE 321 +#define KW_END_PUBLISH 322 +#define KW_ENUM 323 +#define KW_EXTENSION 324 +#define KW_EXTERN 325 +#define KW_EXPLICIT 326 +#define KW_PUBLISHED 327 +#define KW_FALSE 328 +#define KW_FINAL 329 +#define KW_FLOAT 330 +#define KW_FRIEND 331 +#define KW_FOR 332 +#define KW_GOTO 333 +#define KW_HAS_VIRTUAL_DESTRUCTOR 334 +#define KW_IF 335 +#define KW_INLINE 336 +#define KW_INT 337 +#define KW_IS_ABSTRACT 338 +#define KW_IS_BASE_OF 339 +#define KW_IS_CLASS 340 +#define KW_IS_CONSTRUCTIBLE 341 +#define KW_IS_CONVERTIBLE_TO 342 +#define KW_IS_DESTRUCTIBLE 343 +#define KW_IS_EMPTY 344 +#define KW_IS_ENUM 345 +#define KW_IS_FINAL 346 +#define KW_IS_FUNDAMENTAL 347 +#define KW_IS_POD 348 +#define KW_IS_POLYMORPHIC 349 +#define KW_IS_STANDARD_LAYOUT 350 +#define KW_IS_TRIVIAL 351 +#define KW_IS_UNION 352 +#define KW_LONG 353 +#define KW_MAKE_MAP_PROPERTY 354 +#define KW_MAKE_PROPERTY 355 +#define KW_MAKE_PROPERTY2 356 +#define KW_MAKE_SEQ 357 +#define KW_MAKE_SEQ_PROPERTY 358 +#define KW_MUTABLE 359 +#define KW_NAMESPACE 360 +#define KW_NEW 361 +#define KW_NOEXCEPT 362 +#define KW_NULLPTR 363 +#define KW_OPERATOR 364 +#define KW_OVERRIDE 365 +#define KW_PRIVATE 366 +#define KW_PROTECTED 367 +#define KW_PUBLIC 368 +#define KW_REGISTER 369 +#define KW_REINTERPRET_CAST 370 +#define KW_RETURN 371 +#define KW_SHORT 372 +#define KW_SIGNED 373 +#define KW_SIZEOF 374 +#define KW_STATIC 375 +#define KW_STATIC_ASSERT 376 +#define KW_STATIC_CAST 377 +#define KW_STRUCT 378 +#define KW_TEMPLATE 379 +#define KW_THREAD_LOCAL 380 +#define KW_THROW 381 +#define KW_TRUE 382 +#define KW_TRY 383 +#define KW_TYPEDEF 384 +#define KW_TYPEID 385 +#define KW_TYPENAME 386 +#define KW_UNDERLYING_TYPE 387 +#define KW_UNION 388 +#define KW_UNSIGNED 389 +#define KW_USING 390 +#define KW_VIRTUAL 391 +#define KW_VOID 392 +#define KW_VOLATILE 393 +#define KW_WCHAR_T 394 +#define KW_WHILE 395 +#define START_CPP 396 +#define START_CONST_EXPR 397 +#define START_TYPE 398 /* Value type. */ @@ -571,7 +607,7 @@ int cppyyparse (void); /* Copy the second part of user declarations. */ -#line 575 "built/tmp/cppBison.yxx.c" /* yacc.c:358 */ +#line 611 "built/tmp/cppBison.yxx.c" /* yacc.c:358 */ #ifdef short # undef short @@ -813,23 +849,23 @@ union yyalloc #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 85 +#define YYFINAL 104 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 5547 +#define YYLAST 6206 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 150 +#define YYNTOKENS 168 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 104 +#define YYNNTS 107 /* YYNRULES -- Number of rules. */ -#define YYNRULES 672 +#define YYNRULES 733 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 1320 +#define YYNSTATES 1482 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 380 +#define YYMAXUTOK 398 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -841,16 +877,16 @@ static const yytype_uint8 yytranslate[] = 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 149, 2, 2, 2, 141, 134, 2, - 144, 146, 139, 137, 127, 138, 143, 140, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 129, 128, - 135, 130, 136, 131, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 167, 2, 2, 2, 159, 152, 2, + 162, 164, 157, 155, 145, 156, 161, 158, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 147, 146, + 153, 148, 154, 149, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 145, 2, 148, 133, 2, 2, 2, 2, 2, + 2, 163, 2, 166, 151, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 126, 132, 147, 142, 2, 2, 2, + 2, 2, 2, 144, 150, 165, 160, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -876,81 +912,88 @@ static const yytype_uint8 yytranslate[] = 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125 + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 424, 424, 425, 429, 436, 437, 438, 442, 443, - 447, 451, 464, 463, 475, 476, 477, 478, 479, 480, - 481, 494, 503, 507, 515, 519, 523, 534, 555, 585, - 602, 630, 667, 689, 722, 744, 755, 769, 768, 783, - 787, 792, 796, 807, 811, 815, 819, 823, 827, 831, - 835, 839, 843, 847, 851, 859, 860, 864, 865, 870, - 869, 885, 894, 902, 910, 918, 929, 945, 944, 959, - 974, 983, 998, 997, 1022, 1021, 1049, 1048, 1079, 1078, - 1097, 1096, 1117, 1116, 1148, 1147, 1173, 1186, 1190, 1194, - 1198, 1202, 1206, 1211, 1215, 1226, 1230, 1234, 1238, 1242, - 1246, 1250, 1254, 1258, 1262, 1266, 1270, 1274, 1278, 1282, - 1286, 1290, 1294, 1298, 1302, 1306, 1310, 1314, 1318, 1322, - 1326, 1330, 1334, 1338, 1342, 1346, 1350, 1354, 1358, 1362, - 1366, 1370, 1374, 1378, 1385, 1386, 1391, 1390, 1398, 1402, - 1403, 1407, 1413, 1422, 1426, 1430, 1434, 1438, 1444, 1454, - 1458, 1463, 1475, 1479, 1493, 1508, 1513, 1518, 1523, 1528, - 1533, 1538, 1543, 1549, 1548, 1570, 1580, 1590, 1594, 1598, - 1607, 1611, 1616, 1620, 1625, 1633, 1638, 1646, 1650, 1655, - 1659, 1664, 1672, 1677, 1685, 1689, 1696, 1700, 1707, 1711, - 1715, 1719, 1723, 1730, 1734, 1738, 1742, 1746, 1750, 1757, - 1758, 1759, 1763, 1766, 1767, 1768, 1772, 1777, 1783, 1789, - 1800, 1804, 1814, 1818, 1822, 1827, 1832, 1837, 1842, 1847, - 1852, 1860, 1864, 1868, 1873, 1878, 1883, 1888, 1893, 1898, - 1903, 1909, 1917, 1921, 1926, 1931, 1936, 1941, 1946, 1951, - 1959, 1963, 1968, 1973, 1978, 1983, 1988, 1993, 1998, 2004, - 2011, 2018, 2028, 2032, 2040, 2044, 2048, 2052, 2056, 2072, - 2088, 2097, 2104, 2108, 2116, 2120, 2124, 2128, 2132, 2148, - 2164, 2182, 2191, 2198, 2202, 2210, 2214, 2230, 2246, 2255, - 2262, 2266, 2274, 2278, 2287, 2286, 2311, 2310, 2340, 2341, - 2348, 2349, 2353, 2354, 2358, 2362, 2366, 2370, 2374, 2378, - 2382, 2386, 2390, 2394, 2401, 2409, 2413, 2417, 2422, 2430, - 2434, 2441, 2442, 2447, 2454, 2455, 2460, 2468, 2472, 2476, - 2483, 2487, 2491, 2499, 2498, 2521, 2520, 2543, 2544, 2548, - 2554, 2561, 2570, 2571, 2572, 2576, 2580, 2584, 2588, 2592, - 2596, 2601, 2606, 2611, 2616, 2620, 2625, 2634, 2639, 2647, - 2651, 2655, 2663, 2673, 2673, 2683, 2684, 2688, 2689, 2690, - 2691, 2692, 2693, 2694, 2695, 2696, 2697, 2698, 2698, 2698, - 2699, 2699, 2699, 2699, 2700, 2700, 2700, 2700, 2700, 2701, - 2701, 2701, 2702, 2702, 2702, 2702, 2702, 2703, 2703, 2703, - 2703, 2703, 2704, 2704, 2704, 2704, 2704, 2705, 2705, 2705, - 2705, 2705, 2706, 2706, 2706, 2706, 2707, 2707, 2707, 2707, - 2707, 2708, 2708, 2708, 2708, 2708, 2709, 2709, 2709, 2709, - 2709, 2709, 2710, 2710, 2710, 2710, 2710, 2711, 2711, 2711, - 2711, 2712, 2712, 2712, 2712, 2713, 2713, 2713, 2713, 2713, - 2714, 2714, 2714, 2715, 2715, 2715, 2715, 2715, 2716, 2716, - 2716, 2716, 2716, 2717, 2717, 2717, 2717, 2717, 2720, 2720, - 2720, 2720, 2720, 2720, 2720, 2720, 2720, 2720, 2720, 2721, - 2721, 2721, 2721, 2721, 2721, 2721, 2721, 2721, 2721, 2722, - 2722, 2726, 2730, 2737, 2741, 2748, 2752, 2759, 2763, 2767, - 2771, 2775, 2779, 2783, 2787, 2791, 2795, 2799, 2803, 2807, - 2811, 2815, 2819, 2823, 2827, 2831, 2835, 2839, 2843, 2847, - 2851, 2855, 2859, 2863, 2867, 2871, 2875, 2879, 2883, 2887, - 2891, 2895, 2899, 2903, 2911, 2915, 2919, 2923, 2927, 2931, - 2935, 2945, 2951, 2957, 2963, 2969, 2975, 2981, 2988, 2995, - 3002, 3009, 3015, 3021, 3025, 3029, 3033, 3037, 3048, 3059, - 3063, 3067, 3071, 3075, 3079, 3083, 3087, 3091, 3095, 3099, - 3103, 3107, 3111, 3115, 3119, 3123, 3127, 3131, 3135, 3139, - 3143, 3147, 3151, 3155, 3159, 3163, 3167, 3171, 3175, 3179, - 3186, 3190, 3194, 3198, 3202, 3206, 3210, 3214, 3218, 3224, - 3230, 3234, 3238, 3252, 3256, 3260, 3264, 3268, 3272, 3276, - 3280, 3284, 3288, 3292, 3303, 3314, 3318, 3322, 3326, 3330, - 3334, 3338, 3342, 3346, 3350, 3354, 3358, 3362, 3366, 3370, - 3374, 3378, 3382, 3386, 3390, 3394, 3398, 3402, 3406, 3410, - 3414, 3418, 3422, 3426, 3430, 3437, 3441, 3445, 3449, 3453, - 3457, 3461, 3465, 3469, 3475, 3481, 3489, 3490, 3491, 3495, - 3496, 3497, 3498, 3502, 3510, 3518, 3546, 3550, 3554, 3558, - 3562, 3568, 3572, 3576, 3580, 3591, 3595, 3599, 3607, 3611, - 3615, 3621, 3632 + 0, 442, 442, 443, 447, 454, 455, 456, 460, 461, + 465, 469, 473, 486, 485, 497, 498, 499, 500, 501, + 502, 503, 516, 525, 529, 537, 541, 545, 556, 577, + 607, 624, 652, 689, 711, 744, 766, 777, 791, 790, + 805, 809, 814, 818, 829, 833, 837, 841, 845, 849, + 853, 857, 861, 865, 869, 873, 881, 882, 886, 887, + 892, 891, 907, 916, 924, 932, 940, 951, 967, 966, + 981, 996, 1005, 1020, 1019, 1044, 1043, 1071, 1070, 1101, + 1100, 1119, 1118, 1139, 1138, 1170, 1169, 1195, 1208, 1212, + 1216, 1220, 1224, 1228, 1232, 1236, 1240, 1245, 1249, 1253, + 1264, 1268, 1272, 1276, 1280, 1284, 1288, 1292, 1296, 1300, + 1304, 1308, 1312, 1316, 1320, 1324, 1328, 1332, 1336, 1340, + 1344, 1348, 1352, 1356, 1360, 1364, 1368, 1372, 1376, 1380, + 1384, 1388, 1392, 1396, 1400, 1404, 1408, 1412, 1416, 1423, + 1424, 1429, 1428, 1436, 1440, 1441, 1445, 1451, 1460, 1461, + 1465, 1469, 1473, 1477, 1483, 1489, 1495, 1502, 1507, 1516, + 1520, 1525, 1533, 1545, 1549, 1563, 1578, 1583, 1588, 1593, + 1598, 1603, 1608, 1613, 1619, 1618, 1640, 1650, 1660, 1664, + 1668, 1677, 1681, 1686, 1690, 1695, 1703, 1708, 1716, 1720, + 1725, 1729, 1734, 1742, 1747, 1755, 1759, 1766, 1770, 1777, + 1781, 1785, 1789, 1793, 1800, 1804, 1808, 1812, 1816, 1820, + 1827, 1828, 1829, 1833, 1836, 1837, 1838, 1842, 1847, 1853, + 1859, 1864, 1870, 1876, 1887, 1891, 1901, 1905, 1909, 1914, + 1919, 1924, 1929, 1934, 1939, 1947, 1951, 1955, 1960, 1965, + 1970, 1975, 1980, 1985, 1990, 1996, 2004, 2009, 2014, 2019, + 2024, 2029, 2034, 2039, 2044, 2049, 2055, 2063, 2067, 2072, + 2077, 2082, 2087, 2092, 2097, 2102, 2107, 2115, 2119, 2124, + 2129, 2134, 2139, 2144, 2149, 2154, 2159, 2164, 2170, 2177, + 2184, 2194, 2198, 2206, 2210, 2214, 2218, 2222, 2238, 2254, + 2263, 2273, 2280, 2291, 2295, 2303, 2307, 2311, 2315, 2319, + 2335, 2351, 2369, 2378, 2388, 2395, 2399, 2407, 2411, 2427, + 2443, 2452, 2462, 2469, 2473, 2481, 2485, 2490, 2494, 2503, + 2502, 2527, 2526, 2556, 2557, 2564, 2565, 2569, 2570, 2574, + 2578, 2582, 2586, 2590, 2594, 2598, 2602, 2606, 2610, 2617, + 2625, 2629, 2633, 2638, 2646, 2650, 2657, 2658, 2663, 2670, + 2671, 2676, 2684, 2688, 2692, 2699, 2703, 2707, 2715, 2714, + 2737, 2736, 2759, 2760, 2764, 2770, 2777, 2786, 2787, 2788, + 2792, 2796, 2800, 2804, 2808, 2812, 2817, 2822, 2827, 2832, + 2836, 2841, 2850, 2855, 2863, 2867, 2871, 2879, 2889, 2889, + 2899, 2900, 2904, 2905, 2906, 2907, 2908, 2909, 2910, 2911, + 2912, 2913, 2914, 2915, 2915, 2915, 2916, 2916, 2916, 2916, + 2917, 2917, 2917, 2917, 2917, 2918, 2918, 2918, 2919, 2919, + 2919, 2919, 2919, 2920, 2920, 2920, 2920, 2920, 2921, 2921, + 2921, 2921, 2921, 2922, 2922, 2922, 2922, 2922, 2923, 2923, + 2923, 2923, 2924, 2924, 2924, 2924, 2924, 2925, 2925, 2925, + 2925, 2925, 2926, 2926, 2926, 2926, 2926, 2926, 2927, 2927, + 2927, 2927, 2927, 2928, 2928, 2928, 2928, 2929, 2929, 2929, + 2929, 2930, 2930, 2930, 2930, 2930, 2931, 2931, 2931, 2931, + 2932, 2932, 2932, 2932, 2932, 2933, 2933, 2933, 2933, 2934, + 2934, 2934, 2934, 2934, 2935, 2935, 2938, 2938, 2938, 2938, + 2938, 2938, 2938, 2938, 2938, 2938, 2938, 2939, 2939, 2939, + 2939, 2939, 2939, 2939, 2939, 2939, 2939, 2940, 2940, 2944, + 2948, 2955, 2959, 2966, 2970, 2977, 2981, 2985, 2989, 2993, + 2997, 3001, 3005, 3009, 3013, 3017, 3021, 3025, 3029, 3033, + 3037, 3041, 3045, 3049, 3053, 3057, 3061, 3065, 3069, 3073, + 3077, 3081, 3085, 3089, 3093, 3097, 3101, 3105, 3109, 3113, + 3117, 3121, 3125, 3133, 3137, 3141, 3145, 3149, 3153, 3157, + 3167, 3173, 3179, 3185, 3191, 3197, 3203, 3210, 3217, 3224, + 3231, 3237, 3243, 3247, 3251, 3255, 3259, 3263, 3274, 3285, + 3289, 3293, 3297, 3301, 3305, 3309, 3313, 3317, 3321, 3325, + 3329, 3333, 3337, 3341, 3345, 3349, 3353, 3357, 3361, 3365, + 3369, 3373, 3377, 3381, 3385, 3389, 3393, 3397, 3401, 3405, + 3412, 3416, 3420, 3424, 3428, 3432, 3436, 3440, 3444, 3450, + 3456, 3460, 3464, 3468, 3472, 3476, 3480, 3484, 3488, 3492, + 3496, 3500, 3504, 3508, 3512, 3516, 3520, 3524, 3528, 3532, + 3546, 3550, 3554, 3558, 3562, 3566, 3570, 3574, 3578, 3582, + 3586, 3590, 3601, 3612, 3616, 3620, 3624, 3628, 3632, 3636, + 3640, 3644, 3648, 3652, 3656, 3660, 3664, 3668, 3672, 3676, + 3680, 3684, 3688, 3692, 3696, 3700, 3704, 3708, 3712, 3716, + 3720, 3724, 3728, 3735, 3739, 3743, 3747, 3751, 3755, 3759, + 3763, 3767, 3773, 3779, 3787, 3788, 3789, 3793, 3794, 3795, + 3796, 3800, 3808, 3816, 3820, 3850, 3854, 3858, 3862, 3866, + 3870, 3876, 3880, 3884, 3888, 3899, 3903, 3907, 3911, 3919, + 3923, 3927, 3933, 3944 }; #endif @@ -961,20 +1004,25 @@ static const char *const yytname[] = { "$end", "error", "$undefined", "REAL", "INTEGER", "CHAR_TOK", "SIMPLE_STRING", "SIMPLE_IDENTIFIER", "STRING_LITERAL", "CUSTOM_LITERAL", - "IDENTIFIER", "TYPENAME_IDENTIFIER", "SCOPING", "TYPEDEFNAME", - "ELLIPSIS", "OROR", "ANDAND", "EQCOMPARE", "NECOMPARE", "LECOMPARE", - "GECOMPARE", "LSHIFT", "RSHIFT", "POINTSAT_STAR", "DOT_STAR", "UNARY", - "UNARY_NOT", "UNARY_NEGATE", "UNARY_MINUS", "UNARY_PLUS", "UNARY_STAR", - "UNARY_REF", "POINTSAT", "SCOPE", "PLUSPLUS", "MINUSMINUS", "TIMESEQUAL", - "DIVIDEEQUAL", "MODEQUAL", "PLUSEQUAL", "MINUSEQUAL", "OREQUAL", - "ANDEQUAL", "XOREQUAL", "LSHIFTEQUAL", "RSHIFTEQUAL", "KW_ALIGNAS", - "KW_ALIGNOF", "KW_AUTO", "KW_BEGIN_PUBLISH", "KW_BLOCKING", "KW_BOOL", - "KW_CATCH", "KW_CHAR", "KW_CHAR16_T", "KW_CHAR32_T", "KW_CLASS", - "KW_CONST", "KW_CONSTEXPR", "KW_CONST_CAST", "KW_DECLTYPE", "KW_DEFAULT", - "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_FINAL", "KW_FLOAT", "KW_FRIEND", "KW_FOR", "KW_GOTO", - "KW_IF", "KW_INLINE", "KW_INT", "KW_LONG", "KW_MAKE_MAP_PROPERTY", + "IDENTIFIER", "TYPENAME_IDENTIFIER", "TYPEPACK_IDENTIFIER", "SCOPING", + "TYPEDEFNAME", "ELLIPSIS", "OROR", "ANDAND", "EQCOMPARE", "NECOMPARE", + "LECOMPARE", "GECOMPARE", "LSHIFT", "RSHIFT", "POINTSAT_STAR", + "DOT_STAR", "UNARY", "UNARY_NOT", "UNARY_NEGATE", "UNARY_MINUS", + "UNARY_PLUS", "UNARY_STAR", "UNARY_REF", "POINTSAT", "SCOPE", "PLUSPLUS", + "MINUSMINUS", "TIMESEQUAL", "DIVIDEEQUAL", "MODEQUAL", "PLUSEQUAL", + "MINUSEQUAL", "OREQUAL", "ANDEQUAL", "XOREQUAL", "LSHIFTEQUAL", + "RSHIFTEQUAL", "KW_ALIGNAS", "KW_ALIGNOF", "KW_AUTO", "KW_BEGIN_PUBLISH", + "KW_BLOCKING", "KW_BOOL", "KW_CATCH", "KW_CHAR", "KW_CHAR16_T", + "KW_CHAR32_T", "KW_CLASS", "KW_CONST", "KW_CONSTEXPR", "KW_CONST_CAST", + "KW_DECLTYPE", "KW_DEFAULT", "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_FINAL", "KW_FLOAT", + "KW_FRIEND", "KW_FOR", "KW_GOTO", "KW_HAS_VIRTUAL_DESTRUCTOR", "KW_IF", + "KW_INLINE", "KW_INT", "KW_IS_ABSTRACT", "KW_IS_BASE_OF", "KW_IS_CLASS", + "KW_IS_CONSTRUCTIBLE", "KW_IS_CONVERTIBLE_TO", "KW_IS_DESTRUCTIBLE", + "KW_IS_EMPTY", "KW_IS_ENUM", "KW_IS_FINAL", "KW_IS_FUNDAMENTAL", + "KW_IS_POD", "KW_IS_POLYMORPHIC", "KW_IS_STANDARD_LAYOUT", + "KW_IS_TRIVIAL", "KW_IS_UNION", "KW_LONG", "KW_MAKE_MAP_PROPERTY", "KW_MAKE_PROPERTY", "KW_MAKE_PROPERTY2", "KW_MAKE_SEQ", "KW_MAKE_SEQ_PROPERTY", "KW_MUTABLE", "KW_NAMESPACE", "KW_NEW", "KW_NOEXCEPT", "KW_NULLPTR", "KW_OPERATOR", "KW_OVERRIDE", "KW_PRIVATE", @@ -982,22 +1030,23 @@ static const char *const yytname[] = "KW_RETURN", "KW_SHORT", "KW_SIGNED", "KW_SIZEOF", "KW_STATIC", "KW_STATIC_ASSERT", "KW_STATIC_CAST", "KW_STRUCT", "KW_TEMPLATE", "KW_THREAD_LOCAL", "KW_THROW", "KW_TRUE", "KW_TRY", "KW_TYPEDEF", - "KW_TYPEID", "KW_TYPENAME", "KW_UNION", "KW_UNSIGNED", "KW_USING", - "KW_VIRTUAL", "KW_VOID", "KW_VOLATILE", "KW_WCHAR_T", "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", "attribute_specifiers", - "attribute_specifier", "type_like_declaration", "$@3", - "multiple_instance_identifiers", "typedef_declaration", "$@4", + "KW_TYPEID", "KW_TYPENAME", "KW_UNDERLYING_TYPE", "KW_UNION", + "KW_UNSIGNED", "KW_USING", "KW_VIRTUAL", "KW_VOID", "KW_VOLATILE", + "KW_WCHAR_T", "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", + "attribute_specifiers", "attribute_specifier", "type_like_declaration", + "$@3", "multiple_instance_identifiers", "typedef_declaration", "$@4", "typedef_instance_identifiers", "constructor_prototype", "$@5", "$@6", "function_prototype", "$@7", "$@8", "$@9", "$@10", "$@11", "function_post", "function_operator", "more_template_declaration", "template_declaration", "$@12", "template_formal_parameters", - "template_nonempty_formal_parameters", "template_formal_parameter", - "template_formal_parameter_type", "instance_identifier", "$@13", + "template_nonempty_formal_parameters", "typename_keyword", + "template_formal_parameter", "template_formal_parameter_type", + "instance_identifier", "$@13", "instance_identifier_and_maybe_trailing_return_type", "maybe_trailing_return_type", "function_parameter_list", "function_parameters", "formal_parameter_list", "formal_parameters", @@ -1006,13 +1055,14 @@ static const char *const yytname[] = "maybe_initialize_or_function_body", "structure_init", "structure_init_body", "function_parameter", "formal_parameter", "not_paren_formal_parameter_identifier", "formal_parameter_identifier", - "not_paren_empty_instance_identifier", "empty_instance_identifier", - "type", "type_decl", "predefined_type", "var_type_decl", "full_type", - "anonymous_struct", "$@14", "named_struct", "$@15", "maybe_final", - "maybe_class_derivation", "class_derivation", "base_specification", - "enum", "enum_decl", "enum_element_type", "enum_body_trailing_comma", - "enum_body", "enum_keyword", "struct_keyword", "namespace_declaration", - "$@16", "$@17", "using_declaration", "simple_type", "simple_int_type", + "parameter_pack_identifier", "not_paren_empty_instance_identifier", + "empty_instance_identifier", "type", "type_pack", "type_decl", + "predefined_type", "var_type_decl", "full_type", "anonymous_struct", + "$@14", "named_struct", "$@15", "maybe_final", "maybe_class_derivation", + "class_derivation", "base_specification", "enum", "enum_decl", + "enum_element_type", "enum_body_trailing_comma", "enum_body", + "enum_keyword", "struct_keyword", "namespace_declaration", "$@16", + "$@17", "using_declaration", "simple_type", "simple_int_type", "simple_float_type", "simple_void_type", "code", "$@18", "code_block", "element", "optional_const_expr", "optional_const_expr_comma", "const_expr_comma", "no_angle_bracket_const_expr", "const_expr", @@ -1039,18 +1089,20 @@ static const yytype_uint16 yytoknum[] = 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 380, 123, 44, 59, 58, - 61, 63, 124, 94, 38, 60, 62, 43, 45, 42, - 47, 37, 126, 46, 40, 91, 41, 125, 93, 33 + 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, + 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 123, 44, 59, 58, 61, 63, + 124, 94, 38, 60, 62, 43, 45, 42, 47, 37, + 126, 46, 40, 91, 41, 125, 93, 33 }; # endif -#define YYPACT_NINF -734 +#define YYPACT_NINF -868 #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-734))) + (!!((Yystate) == (-868))) -#define YYTABLE_NINF -668 +#define YYTABLE_NINF -729 #define yytable_value_is_error(Yytable_value) \ 0 @@ -1059,138 +1111,155 @@ static const yytype_uint16 yytoknum[] = STATE-NUM. */ static const yytype_int16 yypact[] = { - 234, -734, 2792, 4509, 43, 3003, -734, -734, -734, -734, - -734, -734, -734, -734, -90, -84, -79, -70, -48, -32, - -11, -24, 10, -734, -734, 15, 41, 65, 4717, -734, - -734, 77, 76, 99, 129, 147, -734, 142, 164, 178, - 2792, 2792, 2792, 2792, 2792, 1390, 310, 2792, 3797, -734, - 252, -734, -734, -734, -734, -734, -734, -734, 4739, 181, - -734, -23, -734, -734, 1575, 1958, 1958, -734, 2339, -734, - 1958, -734, -734, 144, -734, -734, -734, -734, -22, 82, - 1087, -734, -734, -734, -734, -734, -734, 5402, 5402, 5402, - -734, 5402, 895, 5402, 162, -734, 5366, 203, 216, 219, - 225, 5402, 1487, 244, 251, 258, 5402, 5402, 250, 5297, - 5402, 5402, 2433, 5402, 5402, -734, 253, -734, -734, -734, - 3265, -734, -734, -734, -734, -734, 2792, 4509, 2792, 2792, - 2792, 2792, 4509, 2792, 4509, 2792, 2792, 2792, -734, -734, - 264, 2339, 266, 2339, 2339, -734, 4509, 2792, 2792, 4509, - 4509, 1390, 2792, 2792, 74, 74, 74, 74, 74, -90, - -79, -70, -48, -32, -24, 15, 41, 1421, 2122, 2253, - 2350, 178, 278, -88, 3797, -734, -734, -734, -734, -734, - -734, -734, -734, -734, -734, 2339, 280, 304, -734, -734, - 74, 2792, 2792, 2792, 2792, 2792, 2792, 2792, 2792, 2792, - 2792, 2792, 2792, 2792, 2792, 2792, 2792, 2792, 2792, 2792, - 2792, 2792, 2222, 2792, -734, -734, 144, 2792, -734, -734, - -734, 1958, -734, -734, -734, -734, -734, 299, 256, 144, - 144, 256, 256, 4068, 305, -734, 315, -734, -734, -734, - -734, 1226, 342, -18, -3, 13, -734, -734, -734, 5402, - -734, -734, -734, -734, 5402, -734, -734, -734, 5241, 2111, - -734, 2339, 2339, 2339, 2339, -734, -734, 341, -734, -734, - -734, -734, -734, 2792, 3339, -734, 340, -734, 3411, -734, - 2339, 249, -734, -734, 2339, 291, 333, -734, 358, 4581, - 2339, -734, 2339, 323, 313, 390, -734, -734, -734, -734, - 412, 1087, -734, 368, 392, -734, 376, 377, 382, 387, - 388, 400, 389, 401, 403, 411, 425, 2792, -734, 2792, - -734, -734, 402, 428, 429, 431, 409, 433, 3518, 434, - 437, 2792, 2792, -734, -734, -42, 310, 969, 1108, 928, - 928, 744, 744, 318, 318, -734, 3707, 4017, 4074, 4158, - 744, 744, 386, 386, 74, 74, 74, -734, -734, -45, - 2009, -734, 3539, 256, 408, 256, 256, 256, 256, 256, - 439, -734, 305, -734, 305, -734, 439, 439, -734, 256, - 4638, 4487, 256, 256, 441, 30, -734, 106, -734, 2792, - 2339, 442, -734, -734, -734, -734, 1226, -734, 517, -734, - -734, -734, 465, 474, 475, 476, 479, 4849, -734, 3478, - 4271, 338, 448, 313, -734, -734, 481, -734, 4509, 459, - 483, 468, -734, 14, 2792, 4739, 236, -734, -734, 469, - -734, -734, 2339, 93, -734, -734, -734, 2108, -734, -734, - 817, -734, 485, -734, -734, -734, -734, -734, -734, -734, - 471, -734, 472, -734, -734, -734, 3557, 477, 473, -734, - -734, -734, 478, -734, -734, -734, -734, 74, 3797, -734, - 4343, 339, -734, -734, 2792, -734, -734, -734, 439, 256, - 439, 439, 439, 439, 439, 2792, 185, 4739, 106, -734, - 270, 300, 561, -734, 4415, 482, 106, 106, 106, 106, - 106, 106, 52, -734, -734, 480, 3797, -734, 49, -734, - 498, 4905, -734, 496, -734, 4961, -734, 616, 619, 622, - 623, -734, -734, 399, 506, -734, -734, 2339, 2209, 2339, - 499, 510, -734, 106, -734, -734, 14, -734, 817, -734, - 511, 490, 2339, 1544, 4343, 502, 817, 4343, 3575, 236, - 503, 236, 236, 236, 236, 236, 247, -734, -734, 5017, - -734, 501, -734, 275, -734, 5, 521, 523, 505, 525, - 529, 2336, 3742, 515, 817, 817, 3118, 817, 817, 817, - 817, -734, 78, 346, -734, 1226, 2792, 2792, -734, -734, - 2792, 2792, 504, 4660, -734, -734, -734, -734, 514, 542, - -734, 3797, 439, 524, 530, 106, 52, 534, 538, 339, - -734, -734, 106, 540, 540, 540, 540, 540, 337, 2792, - 2792, -734, -734, 541, -734, 2792, -734, 2866, 557, 560, - -734, -734, -734, -37, 564, 565, 566, 5073, 28, -734, - 558, 106, 567, 5323, 4271, 80, -734, 346, -734, 5402, - -734, -734, -734, -734, -734, -734, -734, 550, 568, 571, - -734, -734, 4717, -734, -734, 572, 551, 573, -734, 590, - 2792, 2792, 2792, 2792, 1390, 2792, 591, 42, -734, -734, - 3839, -734, 252, -734, 594, 817, 89, 595, -734, 365, - 236, 598, 598, 598, 598, 598, -734, 2792, -734, 4343, - -734, 1842, -734, -734, 2339, 2792, 2792, -734, -734, -734, - -734, -734, 2336, 563, 585, 3797, -734, -734, 817, 372, - 372, 726, -734, -734, -734, -734, -734, -734, -734, -734, - -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, - -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, - -734, -734, -734, -734, -734, -734, -734, -734, 599, 601, - -734, -734, 372, 372, 372, 335, 742, -734, 2792, -734, - 2108, 624, -734, 498, -13, -8, -6, 31, 561, 4717, - 144, 243, -734, -734, 4343, 52, -734, 4343, 4343, -734, - 540, 606, 3797, 604, 3761, 4160, 4778, 4794, 2339, 394, - -734, 2339, -734, -734, -734, 2866, 5129, 743, 627, 746, - 747, 748, -734, 631, 4509, 80, 4509, -734, -734, -734, - -734, 2906, -734, -734, 633, -734, -734, 4509, 4509, 4509, - 626, 4509, 4509, 4509, 1390, 74, 74, 74, 74, 617, - 34, 74, -734, -734, 1989, 2792, 2792, 2792, 2792, 2792, - 2792, 2792, 2792, 2792, 2792, 2792, 2792, 2792, 2792, 2792, - 2792, 2792, 2792, 2792, 2792, 2792, 2450, 2792, 561, 348, - 630, 561, -734, 598, 4343, 620, 625, -734, -734, -734, - -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, - -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, - -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, - -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, - -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, - -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, - -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, - -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, - -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, - -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, - -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, - -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, - -734, -734, 634, -734, 635, 639, 644, -734, 2564, 372, - -734, -734, -734, -734, -734, 1544, 632, 3742, 817, -734, - -734, -734, -734, 339, 144, -734, -734, 646, 647, 650, - -734, 653, 654, 4343, -734, -734, 2953, -734, 2953, -734, - 2953, -734, -734, 2953, 2953, 2953, -734, 5185, -734, -734, - 56, -734, 110, 655, 124, -734, -734, -734, -734, 649, - 667, 670, 671, 663, 673, 2906, 2906, 2906, 2906, 2906, - 1390, 2906, 3970, -734, 817, 664, 676, 677, 2792, 679, - 675, 687, 680, 3610, 2792, -734, -734, -734, 969, 1108, - 928, 928, 744, 744, 318, 318, -734, 3779, 4017, 4074, - 4158, 744, 744, 386, 386, 74, 74, 74, -734, -734, - 128, 3149, -2, 665, -734, -2, 4343, 690, -734, 561, - 1695, -734, -734, -734, -734, 2336, 3797, 692, -734, -734, - 699, -734, -734, -734, 561, 561, 561, 694, -734, -734, - -734, -734, -734, -734, -734, 832, 718, 841, 727, 728, - 847, 730, 4509, 4509, 4509, 4509, 4509, 4509, 209, 209, - 209, 209, 209, 713, 139, 209, 2906, 2906, 2906, 2906, - 2906, 2906, 2906, 2906, 2906, 2906, 2906, 2906, 2906, 2906, - 2906, 2906, 2906, 2906, 2906, 2678, 2792, -734, -734, 716, - 717, 719, 720, -734, 722, -734, -734, 74, 2792, -734, - -734, -734, 4343, 723, 561, -2, -734, 715, 561, -734, - 339, 339, 339, 561, 725, -734, 745, -734, -734, 160, - -734, 731, 740, 750, 754, 734, 755, 2906, -734, 3197, - 4000, 2848, 2848, 1434, 1434, 526, 526, -734, 3928, 4174, - 4203, 1131, 536, 536, 209, 209, 209, -734, -734, 163, - 3167, 2792, 2792, -734, 2792, 2792, 3797, 4343, 749, 561, - -2, -734, -2, 751, -734, -734, -734, -2, 764, 883, - 884, 768, -734, 756, 758, 759, -734, 760, 209, 2906, - -734, -734, 169, 177, 187, 192, 753, 561, -2, -734, - -734, 762, 766, -734, 2792, 2792, 2792, 2792, 3970, -734, - -734, -734, -734, 561, 339, 777, 778, 199, 205, 215, - 228, 339, -734, -734, -734, -734, -734, -734, -734, -734 + 347, -868, 2997, 4826, 28, 3474, -868, -868, -868, -868, + -868, -868, -868, -868, -138, -102, -81, -45, -31, -27, + 9, 23, 52, -868, -868, 66, 89, 100, 114, 117, + 123, 131, 134, 144, 172, 199, 210, 213, 239, 243, + 252, 254, 266, 274, 5078, -868, -868, 60, 292, 293, + 7, 164, -868, 304, 305, 308, 2997, 2997, 2997, 2997, + 2997, 2040, 1052, 2997, 2753, -868, 185, -868, -868, -868, + -868, -868, -868, -868, -868, 4939, 310, -868, 27, -868, + -868, 1717, 4467, 4467, -868, 2604, 311, -868, 4467, -868, + -868, 16, 16, -868, -868, -868, -868, 334, 276, 464, + -868, -868, -868, -868, -868, -868, 5981, 5981, 5981, -868, + 5981, 3092, 5981, 152, -868, 5972, 317, 321, 329, 332, + 5981, 2208, 357, 358, 360, 5981, 5981, 336, 5884, 5981, + 5981, 2823, 5981, 5981, -868, 345, -868, -868, -868, 3672, + -868, -868, -868, -868, -868, 2997, 4826, 2997, 2997, 2997, + 2997, 4826, 2997, 4826, 2997, 4826, 2997, 4826, 4826, 4826, + 4826, 4826, 4826, 4826, 4826, 4826, 4826, 4826, 4826, 4826, + 4826, 4826, 2997, -868, -868, 353, 2604, 355, 370, 2604, + 2604, -868, 4826, 2997, 2997, 372, 4826, 4826, 2040, 2997, + 2997, 73, 73, 73, 73, 73, -138, -81, -45, -31, + -27, 23, 66, 100, 6011, 4837, 5211, 6044, 308, 373, + -93, 2753, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, 2604, 356, 374, -868, -868, 73, 2997, + 2997, 2997, 2997, 2997, 2997, 2997, 2997, 2997, 2997, 2997, + 2997, 2997, 2997, 2997, 2997, 2997, 2997, 2997, 2997, 2997, + 2337, 2997, -868, -868, 16, 16, 2997, -868, -868, -868, + 4467, -868, -868, -868, -868, 4826, -868, 379, 560, 354, + 16, 16, 354, 354, 4375, 377, -868, 378, -868, -868, + -868, -868, -868, -868, 3578, 400, -26, -10, 33, 130, + -868, -868, -868, 5981, -868, -868, -868, -868, 5981, -868, + -868, -868, 5858, 2295, -868, 2604, 2604, 2604, 2604, -868, + -868, 406, -868, -868, -868, -868, -868, 2997, 3763, -868, + 396, -868, 3803, -868, 2604, 83, -868, -868, 2604, 338, + 389, -868, 390, 4968, 2604, 391, -868, 2604, -6, 314, + 409, -868, -868, -868, -868, 2065, 464, -868, 394, 414, + -868, 397, 398, 399, 401, 403, 425, 404, 426, 419, + 428, 429, 430, 415, 432, -82, 452, 434, 436, 437, + 441, 442, 445, 446, 453, 455, 458, 466, 2997, -868, + 4826, 2997, -868, -868, 477, 468, 473, 2604, 475, 487, + 478, 3948, 481, 482, 2997, 2997, -868, -868, 486, 1052, + 1325, 4243, 3013, 3013, 1096, 1096, 579, 579, -868, 4038, + 1056, 4259, 3516, 1096, 1096, 233, 233, 73, 73, 73, + -868, -868, -79, 1807, -868, -868, 3966, 492, 354, 498, + 493, 2604, 354, 354, 354, 354, 354, 502, -868, 377, + -868, 377, -868, 502, 502, -868, 354, 4850, 4737, 354, + 354, 503, 31, -868, 821, 85, -868, 2997, 2604, 501, + -868, -868, -868, -868, 3578, -868, 595, -868, -868, -868, + 530, 531, 532, 534, 537, 5354, -868, 1433, 4571, 315, + 513, 314, -868, -868, 539, -868, 4826, 520, 546, 533, + -868, 4, 2997, 5164, 247, -868, 4826, -868, 541, -868, + -868, 2604, -22, -868, -868, -868, 2205, -868, -868, 371, + -868, 557, -868, -868, -868, -868, -868, -868, -868, 544, + -868, 545, -868, -868, -868, -868, 4826, -868, 4826, -868, + 4826, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, 3984, 529, 548, 547, -868, -868, 549, -868, + 552, -868, -868, -868, -868, 73, 2753, 4619, 3321, -868, + -868, 2997, -868, -868, -868, -868, 502, 354, -868, 502, + 502, 502, 502, 502, 2997, -68, 4939, 821, 85, -868, + 34, 75, -868, -868, 4708, 551, 821, 821, 821, 821, + 821, 821, -44, -868, -868, 553, 2604, 85, 85, 85, + 85, 85, 85, -18, 554, 2753, -868, -40, -868, 578, + 5426, -868, 581, -868, 5498, -868, 715, 716, 719, 720, + -868, -868, 405, 593, -868, -868, -868, -868, 3877, -868, + 590, 601, 2472, -868, 647, -868, -868, 4, -868, 371, + -868, 602, 583, 2604, 3129, 4619, 603, 371, 4619, 4002, + 247, 604, 247, 247, 247, 247, 247, 93, -868, -868, + 599, 5570, -868, 582, -868, 179, -868, -61, 613, 618, + 610, 620, 621, 2469, 2225, 624, 371, 371, 3605, 371, + 371, 371, 371, -868, 151, 351, -868, 3578, 2997, 2997, + 614, 619, 623, -868, -868, -868, 2997, -868, 2997, 631, + -868, 5054, -868, -868, -868, -868, -868, 622, -868, -868, + 638, -868, 2753, 502, 636, 635, 821, 85, -44, -18, + 641, 644, 3321, -868, -868, 821, 645, 645, 645, 645, + 645, 262, 2997, 2997, -868, -868, 85, -868, 648, 648, + 648, 648, 648, 275, 2997, -868, 649, -868, 2997, -868, + 5194, 672, 673, -868, -868, -868, -67, 676, 677, 681, + 5642, 15, -868, 647, 5944, 4571, 2604, 669, 666, 647, + 647, 647, 647, 647, 647, 39, 648, -868, 351, -868, + 5981, -868, -868, -868, -868, -868, -868, -868, 667, 675, + 682, -868, -868, 5078, -868, -868, 688, 10, 691, -868, + 683, 2997, 2997, 2997, 2997, 2040, 2997, 685, 36, -868, + -868, 4204, -868, 185, -868, 686, 371, 202, 689, -868, + 284, 247, 684, 684, 684, 684, 684, -868, 2997, -868, + -868, 4619, -868, 1873, -868, -868, 2604, 2997, 2997, -868, + -868, -868, -868, -868, 2469, 687, 701, 2753, -868, -868, + 371, 288, 288, 844, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + 692, 693, -868, -868, 288, 288, 288, 350, 854, -868, + 2997, -868, 2205, 718, -868, 578, -42, -12, -868, -868, + -868, 51, 58, -868, 5078, 16, 678, -868, -868, 4619, + -44, -18, -868, -868, 4619, 4619, -868, 645, 698, 2753, + 700, 648, 702, 703, 2489, 5245, 5264, 5278, 2604, 413, + -868, 2604, -868, 852, -868, 5194, 5714, 858, 725, 862, + 863, 864, -868, 729, 39, 648, -868, -868, -868, -868, + -868, 4826, 647, 3404, -868, -868, 735, -868, -868, 4826, + 4826, 4826, 723, 4826, 724, 4826, 4826, 2040, 73, 73, + 73, 73, 717, 82, 73, -868, -868, 3267, 2997, 2997, + 2997, 2997, 2997, 2997, 2997, 2997, 2997, 2997, 2997, 2997, + 2997, 2997, 2997, 2997, 2997, 2997, 2997, 2997, 2997, 2601, + 2997, -868, 367, 726, -868, -868, 684, 4619, 721, 727, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, 728, -868, + 731, 733, 736, -868, 2733, 288, -868, -868, -868, -868, + -868, 3129, 732, 2225, 371, -868, -868, -868, -868, 3321, + 16, -868, -868, 11, 738, 740, -868, -868, 741, 742, + 4619, -868, 4619, -868, -868, 4456, -868, 4456, -868, 4456, + -868, -868, 4456, 4456, 4456, -868, -868, 5786, -868, -868, + 116, -868, 137, 751, 138, -868, -868, -868, 730, 737, + 763, 768, 24, 769, 3404, 3404, 3404, 3404, 3404, 2040, + 3404, 3685, -868, 371, 762, 773, 774, 2997, 775, 2604, + 766, 778, 770, 4020, 2997, -868, -868, -868, 1325, 4243, + 3013, 3013, 1096, 1096, 579, 579, -868, 4186, 1056, 4259, + 3516, 1096, 1096, 233, 233, 73, 73, 73, -868, -868, + 139, 3287, 2124, 771, -868, 2124, 4619, 772, -868, -868, + 1596, -868, -868, 867, -868, 2469, 2753, 780, -868, -868, + 794, -868, 783, -868, -868, -868, -868, -868, 784, 786, + -868, -868, -868, -868, -868, -868, -868, 942, 808, 946, + 814, 817, 954, 819, 4826, 4826, 4826, 4826, 804, 4826, + 4826, 87, 87, 87, 87, 87, 803, 146, 87, 3404, + 3404, 3404, 3404, 3404, 3404, 3404, 3404, 3404, 3404, 3404, + 3404, 3404, 3404, 3404, 3404, 3404, 3404, 3404, 2865, 2997, + -868, -868, 812, 813, 806, 815, 818, -868, 822, -868, + -868, 73, 2997, -868, -868, -868, 4619, 824, -868, 2124, + -868, -868, 816, -868, -868, -868, 3321, 3321, 3321, -868, + -868, 825, -868, 840, -868, -868, 155, -868, 829, 832, + 841, 842, 2604, 830, 845, 3404, -868, 3201, 4290, 1525, + 1525, 1338, 1338, 1374, 1374, -868, 4222, 4441, 4457, 4482, + 975, 975, 87, 87, 87, -868, -868, 171, 3927, 2997, + 2997, -868, 2997, -868, 2997, 2753, 4619, 837, -868, 2124, + -868, 2124, 838, -868, -868, -868, 2124, 2124, 856, 994, + 995, 860, -868, 849, 850, 853, 855, -868, 861, 87, + 3404, -868, -868, 214, 215, 223, 229, 868, -868, 2124, + -868, -868, 870, 872, -868, 2997, 2997, 2997, -868, 2997, + 3685, -868, -868, -868, -868, -868, 3321, 871, 874, 244, + 255, 257, 258, 3321, -868, -868, -868, -868, -868, -868, + -868, -868 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -1198,170 +1267,187 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_uint16 yydefact[] = { - 0, 672, 0, 0, 0, 672, 5, 584, 580, 583, - 668, 669, 586, 587, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 582, 588, 0, 0, 0, 0, 590, - 589, 0, 0, 0, 0, 0, 581, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 672, 0, 3, 524, - 585, 253, 261, 335, 336, 338, 339, 320, 0, 0, - 350, 317, 349, 344, 341, 340, 343, 321, 0, 322, - 342, 352, 337, 672, 4, 255, 256, 257, 0, 306, - 0, 252, 332, 333, 334, 1, 20, 672, 672, 672, - 21, 672, 672, 672, 0, 37, 672, 0, 0, 0, - 0, 672, 0, 0, 0, 0, 672, 672, 0, 672, - 672, 672, 0, 672, 672, 6, 0, 16, 7, 18, - 0, 14, 15, 17, 64, 39, 672, 0, 672, 672, - 672, 672, 0, 672, 0, 672, 672, 672, 274, 279, - 0, 0, 545, 0, 0, 273, 0, 672, 672, 0, - 0, 0, 672, 672, 554, 552, 551, 553, 550, 253, - 335, 336, 338, 339, 350, 349, 344, 341, 340, 343, - 342, 337, 0, 0, 485, 656, 657, 658, 661, 659, - 663, 662, 660, 664, 650, 649, 0, 647, 652, 646, - 549, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 733, 0, 0, 0, 733, 5, 624, 620, 623, + 729, 730, 626, 627, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 622, 628, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 670, 671, 672, 0, 318, 319, - 351, 341, 346, 345, 348, 254, 347, 0, 672, 672, - 672, 672, 672, 672, 0, 282, 240, 672, 665, 666, - 667, 0, 308, 656, 657, 659, 284, 258, 286, 672, - 51, 40, 50, 52, 672, 41, 46, 22, 672, 0, - 44, 0, 0, 0, 0, 49, 672, 0, 25, 24, - 23, 47, 43, 0, 0, 138, 0, 53, 0, 19, - 0, 0, 45, 48, 0, 281, 263, 272, 0, 0, - 0, 12, 0, 0, 0, 280, 59, 265, 266, 267, - 306, 0, 262, 0, 484, 483, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 275, 672, - 277, 276, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 579, 651, 672, 672, 563, 564, 565, - 566, 567, 568, 571, 572, 578, 0, 560, 561, 562, - 569, 570, 558, 559, 555, 556, 557, 577, 576, 0, - 0, 283, 0, 672, 0, 672, 672, 672, 672, 672, - 245, 232, 0, 241, 0, 242, 244, 243, 171, 672, - 0, 0, 672, 672, 0, 172, 175, 672, 170, 672, - 314, 0, 311, 310, 305, 309, 0, 672, 672, 42, - 38, 672, 0, 0, 0, 0, 0, 672, 323, 0, - 672, 281, 263, 0, 280, 67, 0, 329, 0, 0, - 55, 57, 72, 74, 0, 0, 672, 264, 672, 0, - 353, 188, 0, 0, 62, 353, 193, 0, 63, 61, - 0, 270, 308, 268, 530, 544, 536, 532, 534, 535, - 0, 542, 0, 541, 531, 538, 0, 0, 0, 537, - 540, 543, 0, 547, 548, 539, 533, 525, 486, 88, - 672, 672, 87, 648, 0, 575, 574, 260, 246, 672, - 237, 233, 234, 236, 235, 672, 0, 0, 672, 209, - 0, 0, 672, 174, 0, 0, 672, 672, 672, 672, - 672, 672, 672, 222, 221, 0, 482, 481, 315, 304, - 259, 672, 289, 672, 288, 672, 325, 0, 0, 0, - 0, 327, 672, 0, 0, 150, 151, 0, 0, 0, - 0, 140, 141, 672, 149, 139, 0, 69, 0, 331, - 0, 0, 0, 672, 672, 0, 0, 672, 0, 672, - 0, 672, 672, 672, 672, 672, 0, 213, 212, 672, - 76, 0, 672, 0, 8, 0, 0, 0, 0, 0, - 0, 672, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 60, 672, 672, 152, 0, 0, 0, 278, 546, - 0, 0, 0, 0, 90, 92, 89, 91, 0, 0, - 167, 573, 238, 0, 0, 672, 672, 0, 0, 672, - 173, 176, 672, 227, 223, 224, 226, 225, 0, 0, - 672, 206, 186, 247, 312, 0, 285, 0, 0, 291, - 290, 328, 672, 0, 0, 0, 0, 672, 0, 36, - 143, 672, 145, 672, 0, 672, 68, 672, 330, 672, - 56, 639, 635, 638, 641, 642, 178, 0, 0, 0, - 637, 643, 0, 645, 644, 0, 0, 0, 636, 0, - 0, 0, 0, 0, 0, 0, 0, 179, 210, 182, - 211, 593, 640, 177, 0, 0, 0, 0, 271, 0, - 672, 218, 214, 215, 217, 216, 82, 672, 13, 672, - 189, 354, 355, 353, 0, 672, 672, 191, 192, 194, - 196, 197, 672, 0, 200, 202, 199, 195, 0, 159, - 155, 0, 105, 106, 107, 108, 109, 110, 113, 114, - 129, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 133, 132, 116, 115, 102, 104, 103, - 111, 112, 100, 101, 97, 98, 99, 96, 0, 0, - 95, 153, 156, 158, 157, 0, 0, 163, 672, 165, - 0, 0, 65, 269, 0, 0, 0, 0, 672, 0, - 672, 0, 353, 239, 672, 672, 207, 672, 672, 248, - 228, 231, 187, 0, 316, 663, 0, 662, 0, 0, - 292, 0, 294, 653, 672, 0, 672, 0, 0, 0, - 0, 0, 324, 0, 0, 672, 0, 134, 137, 135, - 142, 0, 147, 184, 0, 70, 54, 0, 0, 0, - 601, 0, 0, 0, 0, 609, 608, 607, 606, 0, - 0, 605, 58, 181, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 630, 629, 0, 0, 0, + 0, 0, 621, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 733, 0, 3, 563, 625, 282, 292, 291, + 370, 371, 373, 374, 355, 0, 0, 385, 352, 384, + 379, 376, 375, 378, 356, 0, 0, 357, 377, 387, + 372, 733, 733, 4, 284, 285, 286, 0, 341, 0, + 281, 367, 368, 369, 1, 21, 733, 733, 733, 22, + 733, 733, 733, 0, 38, 733, 0, 0, 0, 0, + 733, 0, 0, 0, 0, 733, 733, 0, 733, 733, + 733, 0, 733, 733, 6, 0, 17, 7, 19, 0, + 15, 16, 18, 65, 40, 733, 0, 733, 733, 733, + 733, 0, 733, 0, 733, 0, 733, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 672, 0, - 0, 672, 84, 219, 672, 0, 0, 357, 358, 362, - 359, 366, 360, 361, 363, 364, 365, 367, 368, 369, - 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, - 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, - 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, - 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 432, 413, 414, 415, 416, 417, 418, - 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 433, 434, 435, 436, 437, 438, 439, - 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, - 450, 451, 452, 453, 454, 455, 456, 457, 672, 474, - 475, 476, 467, 479, 463, 464, 462, 469, 470, 458, - 459, 460, 461, 468, 466, 473, 471, 477, 472, 478, - 465, 356, 0, 9, 0, 0, 0, 198, 201, 160, - 154, 131, 130, 162, 166, 672, 0, 187, 0, 528, - 527, 529, 526, 672, 672, 168, 93, 0, 0, 0, - 208, 0, 0, 672, 229, 313, 0, 297, 0, 296, - 0, 295, 655, 0, 0, 0, 654, 672, 293, 326, - 0, 26, 0, 0, 0, 35, 144, 148, 146, 0, + 0, 0, 733, 306, 312, 0, 0, 0, 585, 0, + 0, 305, 0, 733, 733, 0, 0, 0, 0, 733, + 733, 594, 592, 591, 593, 590, 282, 370, 371, 373, + 374, 385, 384, 379, 376, 375, 378, 377, 372, 0, + 0, 523, 715, 716, 717, 718, 721, 719, 723, 722, + 720, 724, 708, 707, 0, 705, 710, 704, 589, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 185, 487, 0, 0, 0, 0, 672, 0, - 0, 0, 0, 0, 0, 634, 180, 183, 618, 619, - 620, 621, 622, 623, 626, 627, 633, 0, 615, 616, - 617, 624, 625, 613, 614, 610, 611, 612, 632, 631, - 0, 0, 73, 0, 78, 75, 672, 0, 220, 672, - 0, 190, 11, 10, 203, 672, 204, 0, 161, 66, - 0, 169, 94, 591, 672, 672, 672, 0, 303, 302, - 301, 300, 299, 298, 287, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 500, 498, - 497, 499, 496, 0, 0, 495, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 71, 600, 0, - 0, 0, 0, 599, 0, 603, 604, 594, 0, 630, - 629, 80, 672, 0, 672, 77, 480, 0, 672, 353, - 672, 672, 672, 672, 0, 27, 0, 32, 34, 0, - 29, 0, 0, 0, 0, 0, 0, 0, 523, 509, - 510, 511, 512, 513, 514, 515, 516, 522, 0, 506, - 507, 508, 504, 505, 501, 502, 503, 521, 520, 0, - 0, 0, 0, 602, 0, 0, 628, 672, 0, 672, - 83, 205, 164, 0, 251, 250, 249, 230, 0, 0, - 0, 0, 494, 0, 0, 0, 493, 0, 488, 0, - 519, 518, 0, 0, 0, 0, 0, 672, 85, 592, - 28, 0, 0, 30, 0, 0, 0, 0, 517, 597, - 596, 598, 595, 672, 672, 0, 0, 0, 0, 0, - 0, 672, 79, 33, 31, 491, 490, 492, 489, 81 + 0, 0, 731, 732, 733, 733, 0, 353, 354, 386, + 376, 381, 380, 383, 283, 0, 382, 0, 268, 733, + 733, 733, 733, 733, 733, 0, 315, 267, 317, 733, + 725, 726, 727, 728, 0, 343, 715, 716, 717, 719, + 319, 287, 321, 733, 52, 41, 51, 53, 733, 42, + 47, 23, 733, 0, 45, 0, 0, 0, 0, 50, + 733, 0, 26, 25, 24, 48, 44, 0, 0, 143, + 0, 54, 0, 20, 0, 0, 46, 49, 0, 314, + 294, 304, 0, 0, 0, 0, 13, 0, 0, 0, + 313, 60, 296, 297, 298, 341, 0, 293, 0, 522, + 521, 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, 0, 0, 307, + 0, 733, 309, 308, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 619, 709, 733, 733, + 603, 604, 605, 606, 607, 608, 611, 612, 618, 0, + 600, 601, 602, 609, 610, 598, 599, 595, 596, 597, + 617, 616, 0, 0, 316, 318, 0, 0, 733, 269, + 0, 258, 733, 733, 733, 733, 733, 274, 257, 0, + 270, 0, 271, 273, 272, 182, 733, 0, 0, 733, + 733, 0, 183, 186, 733, 0, 181, 733, 349, 0, + 346, 345, 340, 344, 0, 733, 733, 43, 39, 733, + 0, 0, 0, 0, 0, 733, 358, 0, 733, 314, + 294, 0, 313, 68, 0, 364, 0, 0, 56, 58, + 73, 75, 0, 0, 733, 295, 0, 733, 0, 388, + 199, 0, 0, 63, 388, 204, 0, 64, 62, 0, + 301, 343, 299, 569, 584, 575, 571, 573, 574, 0, + 581, 0, 580, 633, 570, 634, 0, 636, 0, 637, + 0, 640, 641, 642, 643, 644, 645, 646, 647, 648, + 649, 577, 0, 0, 0, 0, 576, 579, 0, 582, + 0, 587, 588, 578, 572, 564, 524, 733, 733, 88, + 706, 0, 615, 614, 289, 290, 275, 733, 259, 264, + 260, 261, 263, 262, 733, 0, 0, 733, 0, 223, + 0, 0, 733, 185, 0, 0, 733, 733, 733, 733, + 733, 733, 733, 236, 235, 0, 246, 0, 0, 0, + 0, 0, 0, 733, 0, 520, 519, 350, 339, 288, + 733, 324, 733, 323, 733, 360, 0, 0, 0, 0, + 362, 733, 0, 0, 160, 161, 162, 148, 0, 149, + 0, 145, 150, 146, 733, 159, 144, 0, 70, 0, + 366, 0, 0, 0, 733, 733, 0, 0, 733, 0, + 733, 0, 733, 733, 733, 733, 733, 0, 227, 226, + 0, 733, 77, 0, 733, 0, 8, 0, 0, 0, + 0, 0, 0, 733, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 61, 733, 733, 163, 0, 0, 0, + 0, 0, 0, 310, 311, 586, 0, 583, 0, 0, + 95, 0, 89, 92, 96, 91, 93, 0, 90, 94, + 0, 178, 613, 265, 0, 0, 733, 0, 733, 733, + 0, 0, 733, 184, 187, 733, 241, 237, 238, 240, + 239, 0, 0, 733, 217, 197, 0, 247, 252, 248, + 249, 251, 250, 0, 733, 220, 276, 347, 0, 320, + 0, 0, 326, 325, 363, 733, 0, 0, 0, 0, + 733, 0, 37, 733, 733, 0, 153, 151, 0, 733, + 733, 733, 733, 733, 733, 733, 157, 69, 733, 365, + 733, 57, 697, 693, 696, 699, 700, 189, 0, 0, + 0, 695, 701, 0, 703, 702, 0, 0, 0, 694, + 0, 0, 0, 0, 0, 0, 0, 0, 190, 224, + 193, 225, 650, 698, 188, 0, 0, 0, 0, 302, + 0, 733, 232, 228, 229, 231, 230, 83, 733, 303, + 14, 733, 200, 389, 390, 388, 0, 733, 733, 202, + 203, 205, 207, 208, 733, 0, 211, 213, 210, 206, + 0, 170, 166, 0, 110, 111, 112, 113, 114, 115, + 118, 119, 134, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 138, 137, 121, 120, 107, + 109, 108, 116, 117, 105, 106, 102, 103, 104, 101, + 0, 0, 100, 164, 167, 169, 168, 0, 0, 174, + 733, 176, 0, 0, 66, 300, 0, 0, 635, 638, + 639, 0, 0, 733, 0, 733, 0, 388, 266, 733, + 733, 733, 218, 221, 733, 733, 277, 242, 245, 198, + 0, 253, 256, 0, 351, 723, 0, 722, 0, 0, + 327, 0, 329, 711, 733, 0, 733, 0, 0, 0, + 0, 0, 359, 0, 733, 158, 139, 142, 140, 147, + 154, 0, 733, 0, 155, 195, 0, 71, 55, 0, + 0, 0, 659, 0, 0, 0, 0, 0, 667, 666, + 665, 664, 0, 0, 663, 59, 192, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 733, 0, 0, 733, 85, 233, 733, 0, 0, + 392, 393, 397, 394, 402, 395, 396, 398, 399, 400, + 401, 403, 404, 405, 406, 407, 408, 409, 410, 411, + 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, + 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 468, 449, 450, + 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 469, 470, 471, + 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, + 492, 493, 494, 495, 733, 512, 513, 514, 505, 517, + 501, 502, 500, 507, 508, 496, 497, 498, 499, 506, + 504, 511, 509, 515, 510, 516, 503, 391, 0, 9, + 0, 0, 0, 209, 212, 171, 165, 136, 135, 173, + 177, 733, 0, 198, 0, 567, 566, 568, 565, 733, + 733, 179, 97, 0, 0, 0, 219, 222, 0, 0, + 733, 243, 733, 254, 348, 0, 332, 0, 331, 0, + 330, 713, 0, 0, 0, 712, 714, 733, 328, 361, + 0, 27, 0, 0, 0, 36, 156, 152, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 196, 525, 0, 0, 0, 0, 733, 0, 0, + 0, 0, 0, 0, 0, 692, 191, 194, 676, 677, + 678, 679, 680, 681, 684, 685, 691, 0, 673, 674, + 675, 682, 683, 671, 672, 668, 669, 670, 690, 689, + 0, 0, 74, 0, 79, 76, 733, 0, 234, 733, + 0, 201, 12, 10, 214, 733, 215, 0, 172, 67, + 0, 180, 0, 98, 631, 733, 733, 733, 0, 0, + 338, 337, 336, 335, 334, 333, 322, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 539, 537, 536, 538, 535, 0, 0, 534, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 72, 658, 0, 0, 0, 0, 0, 656, 0, 661, + 662, 651, 0, 688, 687, 81, 733, 0, 733, 78, + 518, 11, 0, 733, 388, 99, 733, 733, 733, 733, + 733, 0, 28, 0, 33, 35, 0, 30, 0, 0, + 0, 0, 0, 0, 0, 0, 562, 548, 549, 550, + 551, 552, 553, 554, 555, 561, 0, 545, 546, 547, + 543, 544, 540, 541, 542, 560, 559, 0, 0, 0, + 0, 660, 0, 657, 0, 686, 733, 0, 733, 84, + 216, 175, 0, 280, 279, 278, 244, 255, 0, 0, + 0, 0, 533, 0, 0, 0, 0, 531, 0, 526, + 0, 558, 557, 0, 0, 0, 0, 0, 733, 86, + 632, 29, 0, 0, 31, 0, 0, 0, 532, 0, + 556, 654, 653, 655, 652, 733, 733, 0, 0, 0, + 0, 0, 0, 733, 80, 34, 32, 529, 528, 530, + 527, 82 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -734, -734, -260, -734, 210, -734, -734, 657, -734, -734, - 188, 371, -734, -104, -734, -102, -734, -734, -134, -734, - -734, -734, 666, -734, -734, -734, -734, -734, -435, -734, - -734, 298, -734, -734, -734, 311, 414, -480, -734, -534, - -550, -460, -734, -72, -734, 143, -571, -734, -405, -705, - -734, -379, 113, -474, 97, -179, -213, -40, 684, -573, - 688, 16, -83, -734, -82, -734, -734, -734, -734, 149, - -80, -734, -377, -734, -734, -15, -7, -734, -734, -734, - -734, -17, 3, -734, -734, -434, -734, -10, -734, -476, - -106, -31, 246, 522, -249, -734, -734, 637, -734, -733, - 795, 799, -495, -1 + -868, -868, -245, -868, 178, -868, -868, 722, -868, -868, + -53, 375, -868, -124, -868, -142, -868, -868, -192, -868, + -868, -868, 734, -868, -868, -868, -868, -868, -493, -868, + -868, 294, -868, -868, -868, -868, 273, 412, -553, -868, + -628, -666, -100, -868, -101, -868, 103, -511, -868, -466, + -838, -868, -445, 72, -540, -147, -442, 756, -54, -41, + -30, 739, -682, 746, 884, -104, -868, -97, -868, -868, + -868, -868, 124, -92, -868, -444, -868, -868, -14, 55, + -868, -868, -868, -868, -7, 5, -868, -868, -502, -868, + -51, -868, -538, -140, -60, 188, 107, 104, -868, -868, + 694, -868, -867, 634, 652, -617, -1 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 4, 5, 563, 564, 117, 428, 118, 119, 258, - 120, 419, 420, 121, 440, 581, 279, 538, 646, 293, - 544, 547, 294, 699, 1202, 1257, 874, 1116, 471, 761, - 818, 122, 276, 530, 531, 532, 533, 582, 1015, 583, - 599, 384, 385, 676, 677, 822, 621, 434, 438, 713, - 714, 386, 679, 556, 502, 234, 235, 73, 295, 142, - 296, 74, 75, 397, 76, 398, 513, 628, 629, 800, - 77, 78, 394, 390, 391, 79, 80, 123, 522, 632, - 124, 81, 82, 83, 84, 561, 562, 701, 1001, 505, - 303, 304, 1072, 174, 49, 680, 681, 186, 187, 802, - 803, 584, 50, 125 + -1, 4, 5, 665, 666, 136, 497, 137, 138, 302, + 139, 487, 488, 140, 509, 683, 323, 639, 777, 338, + 645, 648, 339, 831, 1356, 1416, 1017, 1266, 558, 893, + 957, 141, 320, 630, 631, 632, 633, 634, 684, 1161, + 685, 710, 451, 452, 807, 808, 964, 734, 503, 507, + 845, 846, 453, 810, 657, 726, 738, 275, 276, 91, + 92, 340, 178, 341, 93, 94, 465, 95, 466, 612, + 751, 752, 940, 96, 97, 462, 458, 459, 98, 99, + 142, 621, 755, 143, 100, 101, 102, 103, 663, 664, + 833, 1147, 604, 348, 349, 1221, 211, 65, 811, 812, + 224, 225, 942, 943, 593, 66, 144 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -1369,1372 +1455,1531 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 6, 568, 489, 361, 647, 275, 407, 1006, 537, 603, - 592, 145, 771, 143, 173, 469, 373, 375, 216, 510, - 780, 144, 307, 308, 309, 310, 545, 312, 638, 314, - 315, 316, 769, 218, 214, 786, 215, 297, 298, 332, - 299, 323, 324, 85, 493, 189, 329, 330, 682, 370, - 372, 374, 376, 377, 126, -665, 843, 609, 333, 789, - 127, 172, 1037, 1039, 1041, 128, 686, 222, 223, 224, - -666, 594, 236, 226, 129, 689, 824, 691, 692, 693, - 694, 695, 332, 219, 684, 595, -667, 687, 596, 830, - 807, 597, 238, 239, 719, 720, 130, 762, 763, 764, - 765, 475, 470, 302, 237, 300, 199, 598, -665, 808, - 593, -665, 131, 301, 332, 611, 238, 239, 495, 332, - 133, 332, 496, -666, 132, 305, -666, 305, 305, 305, - 305, 705, 305, 1019, 305, 305, 305, 511, 1020, -667, - 1021, 515, -667, 306, 793, 134, 305, 305, 311, 706, - 313, 305, 305, 546, 566, 567, 227, 494, 332, 135, - 228, 332, 322, 497, 678, 325, 326, 327, 559, 844, - 222, 223, 224, 226, 813, 240, 624, 1022, 772, 625, - 1085, 359, 619, 1145, 478, 136, 480, 481, 482, 483, - 484, 297, 298, 387, 299, 297, 298, 620, 299, 240, - 486, 229, 1146, 490, 491, 869, 1024, 766, 773, 137, - 821, 241, 146, 457, 1030, 236, 873, 211, 212, 213, - 147, 875, 767, 768, 222, 620, 498, 371, 236, 236, - 371, 371, 388, 767, 768, 870, 392, 1147, 1009, 876, - 499, 1174, 825, 148, 395, 500, 238, 239, 550, 426, - 501, 1150, 551, 175, 176, 332, 1148, 302, 214, 300, - 215, 302, 637, 300, 230, 6, 332, 301, 364, 1002, - 1151, 301, 365, 149, 1199, 250, 251, 252, 231, 253, - 255, 256, 150, 232, 260, 1228, 151, 1270, 233, 265, - 332, 257, 1016, 552, 271, 272, 332, 274, 277, 278, - 602, 282, 283, 1138, 332, 1139, 1271, 1140, 152, 1280, - 1141, 1142, 1143, 366, 332, 1299, 177, 178, 305, 332, - 175, 176, 153, 1300, 1029, 217, 332, 1031, 1032, 240, - 485, 604, 332, 1301, 472, 189, 179, 180, 1302, 181, - 488, 387, 332, 1023, 182, 1315, 183, 261, 1028, 682, - 199, 1316, 1184, 1185, 1186, 332, 553, 1, 2, 3, - 262, 1317, 371, 263, 371, 371, 371, 371, 371, 264, - 554, 593, 806, 268, 1318, 555, 367, 417, 371, 418, - 269, 371, 371, 177, 178, 549, 504, 270, 507, 1026, - 368, 696, 697, 534, 273, 369, 6, 514, 284, 395, - 6, 703, 704, 179, 180, 10, 181, 11, 317, 535, - 319, 182, 594, 183, 1117, 485, 607, -86, 199, -86, - 1207, -86, 243, 244, 331, 558, 595, 6, 335, 596, - 387, 336, 597, 1112, 540, 422, 1115, 260, 363, 435, - 184, 436, 399, 437, 185, 485, 608, 605, 598, 430, - 389, 431, 432, 433, 387, 206, 207, 208, 209, 210, - -232, 211, 212, 213, -86, 678, -86, 408, -86, 388, - 600, 396, 435, 1130, 436, 410, 770, 423, 371, 767, - 768, 1013, 620, 791, 507, 177, 178, 504, 1043, 1044, - 1045, 472, 767, 768, 1113, 504, 504, 504, 504, 504, - 504, 622, 424, 387, 387, 245, 180, 387, 181, 872, - 697, 534, 630, 182, 444, 183, 767, 768, 439, 332, - 682, 6, 445, 446, 48, 208, 209, 210, 447, 211, - 212, 213, 504, 448, 449, 451, 450, 452, 458, 817, - 647, 241, 683, 388, 1047, 462, 388, 479, 558, 453, - 558, 558, 558, 558, 558, 774, 775, 454, 1174, 776, - 777, 702, 154, 155, 156, 157, 158, 1025, 1174, 190, - 716, 455, 1073, 1137, 459, 460, 145, 461, 143, 463, - 465, 600, 622, 466, 485, 606, 144, 492, 395, 509, - 512, 516, 536, 613, 614, 615, 616, 617, 618, 1004, - 1005, 517, 518, 519, 504, 622, 520, 541, 600, 539, - 542, 504, 543, 560, 585, 586, 587, 590, 469, 507, - 801, 612, 591, 589, -307, 627, 633, 534, 623, 634, - 645, 6, 635, 636, 639, 643, 678, 644, 649, 648, - 504, 685, 690, 840, 823, 145, 622, 143, 700, 707, - 778, 708, 709, 710, 718, 144, 1203, 711, 781, 387, - 1264, 1265, 1266, 1179, 1180, 1181, 1182, 1183, 782, 1184, - 1185, 1186, 783, 328, 784, 1181, 1182, 1183, 787, 1184, - 1185, 1186, 788, 804, 1205, 620, -239, 805, 814, 558, - 839, 809, 810, 811, 827, 832, 507, 816, 388, 1210, - 1211, 1212, 785, 828, 305, 305, 829, 831, 833, 790, - 1007, 716, 1008, 337, 338, 339, 340, 341, 342, 343, - 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 834, 360, 1010, 842, 815, 362, - 868, 871, 1258, 697, 387, 1011, 1014, 387, 387, 1012, - 1033, 1018, 1034, 1050, 1312, 1051, 1052, 1053, 1054, 1055, - 1074, 1319, 145, 1084, 143, 197, 198, 507, 1118, 1260, - 1078, 1119, 144, 1262, 1114, 1263, 199, 472, 1267, 236, - 1128, 1121, 1122, 388, 622, 1123, 388, 388, 801, 801, - 801, 1124, 1132, 1152, 1133, 409, 1134, 1286, 801, 1135, - 1136, 1149, 1153, 6, 387, 1154, 1155, 1156, 1157, 1201, - 1188, 1131, 1189, 1190, 823, 1192, 1073, 1073, 1073, 1073, - 1073, 1193, 1073, 1194, 1288, 1209, 1195, 238, 239, 573, - 1056, 274, 1058, 574, 387, 1110, 1204, 826, 1208, 456, - 1213, 188, 1214, 1075, 1076, 1077, 1215, 1079, 1080, 1081, - 1082, 1216, 1304, 467, 468, 1217, 1218, 1219, 1220, 1227, - 1251, 1252, 1261, 225, 1254, 1253, 1255, 472, 1311, 1259, - 472, 1268, 1269, 388, 575, 247, 1273, 1272, 242, 248, - 1276, 206, 207, 208, 209, 210, 1274, 211, 212, 213, - 1275, 1277, 1290, 1291, 1292, 1287, 1293, 267, 1289, 1303, - 1294, 254, 1295, 1296, 1297, 1313, 1314, 281, 1305, 576, - 240, 506, 1306, 650, 1003, 400, 1129, 1073, 1073, 1073, - 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, - 1073, 1073, 1073, 1073, 1073, 1073, 318, 577, 320, 321, - 1187, 819, 641, 1127, 413, 87, 548, 195, 196, 197, - 198, 578, 88, 89, 1048, 820, 579, 1087, 1057, 572, - 199, 580, 414, 91, 92, 93, 415, 0, 1120, 0, - 0, 0, 1191, 473, 249, 387, 0, 702, 1073, 0, - 334, 0, 101, 0, 0, 192, 193, 194, 195, 196, - 197, 198, 106, 387, 0, 0, 601, 0, 107, 0, - 0, 199, 0, 110, 0, 0, 0, 506, 0, 0, - 0, 0, 0, 113, 683, 114, 0, 0, 0, 0, - 0, 0, 600, 236, 0, 0, 0, 0, 0, 801, - 1073, 801, 388, 801, 0, 0, 801, 801, 801, 1164, - 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 402, 0, 403, 404, 405, 406, - 0, 0, 0, 204, 205, 206, 207, 208, 209, 210, - 0, 211, 212, 213, 0, 416, 387, 305, 0, 421, - 0, 0, 0, 0, 0, 427, 1163, 429, 0, 0, - 0, 0, 0, 715, 0, 441, 443, 243, 244, 442, - 248, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 0, 211, 212, 213, 388, 0, 0, 472, 0, - 0, 0, 0, 0, 716, 193, 194, 195, 196, 197, - 198, 188, 0, 472, 472, 472, 0, 0, 0, 0, - 199, 792, 506, 0, 0, 0, 0, 794, 1168, 1169, - 1170, 1171, 1172, 1173, 1249, 0, 0, 0, 0, 0, - 177, 178, 387, 1174, 0, 0, 0, 0, 1221, 1222, - 1223, 1224, 1225, 1226, 0, 0, 0, 0, 0, 0, - 245, 180, 0, 181, 0, 508, 503, 0, 182, 0, - 183, 0, 835, 836, 837, 838, 0, 841, 0, 0, - 0, 388, 0, 472, 0, 0, 0, 472, 0, 600, - 600, 600, 472, 246, 0, 0, 0, 387, 0, 506, - 1282, 1283, 0, 1284, 1285, 557, 0, 565, 0, 0, - 0, 0, 0, 0, 715, 0, 0, 393, 0, 0, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 0, 211, 212, 213, 0, 0, 388, 0, 472, 0, - 0, 0, 0, 1307, 1308, 1309, 1310, 0, 1179, 1180, - 1181, 1182, 1183, 0, 1184, 1185, 1186, 53, 0, 54, - 55, 56, 0, 0, 0, 0, 472, 503, 0, 0, - 506, 0, 1017, 0, 0, 503, 503, 503, 503, 503, - 503, 0, 472, 600, 0, 0, 63, 221, 0, 0, - 600, 1158, 1159, 1160, 1161, 1162, 0, 1165, 0, 0, - 0, 0, 640, 0, 642, 0, 65, 66, 0, 0, - 0, 0, 503, 0, 0, 0, 0, 421, 0, 0, - 0, 0, 70, 0, 0, 0, 0, 72, 557, 0, - 557, 557, 557, 557, 557, 0, 1083, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1088, 1089, 1090, - 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, - 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 0, 1111, - 0, 0, 0, 7, 8, 9, 10, 0, 11, 12, - 13, 159, 0, 0, 503, 0, 0, 0, 0, 0, - 0, 503, 1229, 1230, 1231, 1232, 1233, 1234, 1235, 1236, - 1237, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 1245, 1246, - 1247, 0, 0, 0, 0, 0, 0, 15, 52, 0, - 503, 160, 0, 161, 162, 163, 57, 58, 0, 20, - 59, 0, 0, 164, 22, 1172, 1173, 61, 0, 0, - 0, 0, 23, 24, 165, 0, 1174, 0, 0, 0, - 166, 167, 53, 1278, 54, 55, 56, 0, 0, 28, - 0, 29, 0, 30, 220, 0, 0, 0, 31, 557, - 168, 169, 34, 0, 0, 35, 67, 175, 176, 565, - 36, 63, 221, 37, 68, 69, 170, 0, 0, 71, - 0, 171, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 65, 66, 0, 40, 1298, 0, 41, 42, 43, - 1126, 0, 44, 0, 45, 46, 0, 70, 0, 47, - 0, 0, 72, 0, 0, 0, 0, 651, 652, 653, - 10, 0, 11, 654, 655, 51, 0, 0, 656, 0, - 177, 178, 0, 0, 0, 137, 0, 0, 0, 0, - 0, 1179, 1180, 1181, 1182, 1183, 1027, 1184, 1185, 1186, - 179, 180, 0, 181, 0, 0, 0, 0, 182, 0, - 183, 657, 52, 1042, 0, 53, 1046, 54, 55, 56, - 57, 380, 0, 658, 59, 0, 1197, 60, 659, 0, - 0, 61, 0, 266, 0, 0, 660, 661, 62, 0, - 0, 0, 0, 0, 63, 64, 53, 0, 54, 55, - 56, 0, 0, 662, 0, 663, 0, 664, 220, 0, - 0, 381, 665, 0, 65, 66, 666, 715, 0, 667, - 67, 0, 0, 0, 668, 63, 221, 669, 68, 69, - 70, 0, 0, 71, 0, 72, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 65, 66, 0, 670, 0, - 0, 671, 672, 0, 0, 0, 673, 0, 674, 0, - 0, 70, 0, 675, 0, 0, 72, 0, 877, 878, - 879, 880, 881, 882, 883, 884, 885, 886, 1250, 887, - 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, - 1256, 0, 0, 0, 0, 0, 0, 898, 899, 900, - 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, - 911, 912, 913, 914, 0, 0, 915, 916, 917, 918, - 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, - 929, 0, 930, 0, 931, 932, 933, 934, 935, 936, - 937, 938, 939, 940, 941, 942, 943, 0, 0, 0, - 0, 0, 944, 945, 946, 0, 947, 948, 949, 950, - 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, - 961, 962, 0, 963, 964, 965, 966, 967, 968, 969, - 970, 971, 972, 973, 974, 975, 976, 977, 0, 0, - 0, 978, 979, 980, 981, 982, 983, 984, 985, 986, - 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, - 997, 998, 1206, 999, 1000, 877, 878, 879, 880, 881, - 882, 883, 884, 885, 886, 0, 887, 888, 889, 890, - 891, 892, 893, 894, 895, 896, 897, 0, 0, 0, - 0, 0, 0, 0, 898, 899, 900, 901, 902, 903, - 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, - 914, 0, 0, 915, 916, 917, 918, 919, 920, 921, - 922, 923, 924, 925, 926, 927, 928, 929, 0, 930, - 0, 931, 932, 933, 934, 935, 936, 937, 938, 939, - 940, 941, 942, 943, 0, 0, 0, 0, 0, 944, - 945, 946, 0, 947, 948, 949, 950, 951, 952, 953, - 954, 955, 956, 957, 958, 959, 960, 961, 962, 0, - 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, - 973, 974, 975, 976, 977, 0, 0, 0, 978, 979, - 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, - 990, 991, 992, 993, 994, 995, 996, 997, 998, 0, - 999, 1000, 651, 652, 653, 10, 0, 11, 654, 655, - 51, 0, 0, 1086, 0, 0, 0, 0, 0, 53, - 0, 54, 55, 56, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 191, 192, 193, 194, 195, 196, - 197, 198, 0, 0, 0, 0, 657, 52, 63, 221, - 53, 199, 54, 55, 56, 57, 380, 0, 658, 59, - 0, 0, 60, 659, 0, 0, 61, 0, 65, 66, - 0, 660, 661, 62, 0, 0, 0, 0, 0, 63, - 64, 0, 0, 0, 70, 0, 0, 0, 662, 72, - 663, 0, 664, 0, 0, 0, 381, 665, 0, 65, - 66, 666, 0, 0, 667, 67, 0, 0, 0, 668, - 0, 0, 669, 68, 69, 70, 0, 0, 71, 0, - 72, 7, 8, 9, 10, 0, 11, 12, 13, 14, - 0, 175, 176, 670, 0, 0, 671, 672, 0, 0, - 0, 673, 0, 674, 0, 0, 0, 0, 675, 0, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 0, 211, 212, 213, 15, 0, 476, 0, 16, - 0, 17, 18, 19, 0, 0, 0, 20, 0, 569, - 570, 21, 22, 53, 0, 54, 55, 56, 0, 0, - 23, 24, 25, 0, 177, 178, 0, 0, 26, 27, - 0, 0, 0, 0, 0, 0, 0, 28, 0, 29, - 0, 30, 63, 221, 179, 180, 31, 181, 32, 33, - 34, 0, 182, 35, 183, 0, 0, 0, 36, 525, - 526, 37, 65, 66, 38, 7, 8, 9, 10, 39, - 11, 12, 13, 14, 571, 0, 0, 401, 70, 0, - 0, 0, 40, 72, 0, 41, 42, 43, 0, 0, - 44, 0, 45, 46, 0, 0, 0, 47, 0, 0, - 53, 0, 54, 55, 56, 0, 147, 0, 0, 15, - 0, 0, 60, 16, 0, 17, 18, 19, 0, 0, - 0, 20, 0, 62, 0, 21, 22, 0, 0, 63, - 64, 0, 0, 0, 23, 24, 25, 0, 0, 0, - 0, 0, 26, 27, 53, 0, 54, 55, 56, 65, - 66, 28, 0, 29, 0, 30, 0, 0, 0, 0, - 31, 0, 32, 33, 34, 70, 0, 35, 71, 0, - 72, 0, 36, 63, 221, 37, 0, 0, 38, 7, - 8, 9, 10, 39, 11, 12, 13, 14, 0, 175, - 176, 0, 0, 65, 66, 0, 40, 0, 0, 41, - 42, 43, 0, 0, 44, 0, 45, 46, 358, 70, - 0, 47, 0, 0, 72, 0, 0, 0, 0, 0, - 0, 0, 0, 15, 0, 0, 0, 16, 0, 17, - 18, 19, 0, 0, 0, 20, 0, 148, 0, 21, - 22, 53, 0, 54, 55, 56, 0, 0, 23, 24, - 25, 0, 177, 178, 0, 0, 26, 27, 0, 0, - 0, 0, 0, 0, 0, 28, 0, 29, 0, 30, - 63, 221, 179, 180, 31, 181, 32, 33, 34, 0, - 182, 35, 183, 175, 176, 0, 36, 0, 0, 37, - 65, 66, 38, 7, 8, 9, 10, 39, 11, 12, - 13, 14, 712, 0, 0, 0, 70, 0, 0, 0, - 40, 72, 0, 41, 42, 43, 0, 0, 44, 0, - 45, 46, 0, 0, 0, 47, 0, 0, 0, 0, - 0, 0, 0, 0, 152, 0, 0, 15, 0, 0, - 0, 16, 0, 17, 18, 19, 177, 178, 0, 20, - 0, 0, 0, 21, 22, 0, 0, 0, 0, 0, - 0, 280, 23, 24, 25, 0, 179, 180, 0, 181, - 26, 27, 0, 0, 182, 0, 183, 0, 0, 28, - 0, 29, 0, 30, 0, 0, 0, 0, 31, 0, - 32, 33, 34, 0, 0, 35, 0, 0, 0, 0, - 36, 0, 0, 37, 0, 0, 38, 7, 8, 9, - 10, 39, 11, 12, 13, 14, 0, 0, 0, 0, - 0, 0, 0, 0, 40, 0, 0, 41, 42, 43, - 0, 0, 44, 0, 45, 46, 1109, 0, 0, 47, + 6, 210, 670, 579, 319, 761, 1152, 352, 353, 354, + 355, 778, 357, 603, 359, 638, 361, 646, 901, 915, + 609, 252, 185, 253, 145, 974, 1282, 813, 104, 267, + 179, 268, 377, 269, 254, 342, 714, 181, 278, 1308, + 668, 669, 343, 385, 386, 255, 583, 344, -725, 392, + 393, 986, 395, 294, 295, 296, 926, 297, 299, 300, + 146, 227, 304, 528, -726, 475, 395, 309, 1186, 1188, + 1190, 396, 315, 316, 270, 318, 321, 322, 947, 326, + 327, 147, 529, 837, 257, 562, 261, 262, 263, 722, + 277, 277, 745, 266, 817, 574, 715, 948, 595, 180, + 596, 838, 597, 395, 732, 747, 237, -727, 748, 64, + 820, 972, 822, 823, 824, 825, 826, 148, -725, 733, + 1327, -725, 1165, 851, 852, 345, 894, 895, 896, 897, + 732, 149, 347, 395, -726, 150, 719, -726, 499, 724, + 500, 501, 502, 598, 350, 744, 350, 350, 350, 350, + 258, 350, 1166, 350, 271, 350, 739, 740, 741, 742, + 743, 647, 151, 191, 192, 193, 194, 195, 272, 186, + 228, 350, 975, 273, 903, 1283, 584, -727, 274, 953, + -727, 987, 350, 350, 701, 152, 1309, 963, 350, 350, + 422, 252, 776, 253, 346, 930, 395, 574, 720, 809, + 424, 425, 733, 395, -728, 153, 933, 922, 923, 261, + 262, 263, 266, 182, 342, 1167, 440, 442, 342, 904, + 610, 343, 1168, 599, 614, 343, 344, 395, 154, 485, + 344, 486, 1170, 454, 249, 250, 251, 600, 574, 721, + 304, 544, 601, 905, 455, 467, 1235, 602, 1337, 1338, + 1339, 155, 661, 277, 277, 827, 828, 280, 281, 282, + 651, 1297, 156, 1012, 652, 261, 237, 966, 438, 277, + 277, 438, 438, 456, -728, 921, 157, -728, 460, 158, + 1298, 1016, 1299, 1302, 395, 159, 280, 281, 282, 463, + 1018, 395, 494, 160, 931, 391, 161, 1155, 898, 301, + 1430, 1300, 1303, 1353, 345, 653, 162, 592, 345, 6, + 1386, 347, 967, 899, 900, 347, 395, 187, 1290, 1431, + 1291, 955, 1292, 835, 836, 1293, 1294, 1295, 739, 740, + 741, 742, 743, 1148, 163, 1441, 400, 401, 402, 403, + 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 283, 423, 395, + 395, 164, 1162, 426, 899, 900, 1013, 430, 395, 431, + 813, 432, 165, 346, 395, 166, 760, 346, 1461, 1462, + 350, 280, 281, 282, 675, 654, 283, 1463, 676, 395, + 246, 247, 248, 1464, 249, 250, 251, 559, 227, 655, + 395, 167, 395, 395, 656, 168, 577, 454, 1477, 1176, + 1177, 10, 433, 11, 169, 1174, 170, 578, 455, 1478, + 1169, 1479, 1480, 284, 477, 733, 928, 438, 171, 677, + 718, 438, 438, 438, 438, 438, 172, 1362, 744, 932, + 727, 728, 729, 730, 731, 438, 1015, 828, 438, 438, + 899, 900, 650, 594, 183, 184, 606, 699, 504, -87, + 505, -87, 506, -87, 6, 613, 188, 189, 6, 463, + 190, 635, 256, 265, 286, 287, 288, 636, 279, 305, + 678, 283, -87, 306, -87, 542, -87, 775, 1, 2, + 3, 307, 434, 659, 308, 504, 6, 505, 317, 902, + 490, 555, 556, 1280, 312, 313, 435, 314, 328, 679, + 946, 436, 899, 900, 1159, 378, 454, 380, 1262, 399, + 931, 1265, 398, 680, 1192, 1193, 1194, 455, 681, 899, + 900, 1263, 381, 682, 387, 716, 428, 394, 215, 216, + 457, -257, 809, 454, 813, 815, 717, 464, 818, 478, + 476, 491, 492, 496, 455, 508, 456, 711, 513, 395, + 526, 514, 515, 516, 605, 517, 438, 518, 520, 920, + 212, 213, 214, 606, 289, 218, 594, 219, 927, 519, + 521, 559, 220, 522, 221, 594, 594, 594, 594, 594, + 594, 735, 523, 524, 525, 778, 527, 530, 531, 649, + 532, 533, 735, 454, 454, 534, 535, 454, 290, 536, + 537, 753, 237, 674, 455, 455, 954, 538, 455, 539, + 6, 635, 540, 727, 728, 729, 730, 731, 906, 907, + 541, 545, 546, 594, 215, 216, 911, 547, 912, 549, + 956, 550, 551, 814, 456, 553, 554, 456, 557, 659, + 567, 659, 659, 659, 659, 659, 565, 280, 281, 282, + 768, -259, 596, 834, 769, 574, 608, 582, 712, 611, + 217, 218, 848, 219, 615, 637, 616, 617, 220, 618, + 221, 605, 619, 711, 735, 640, 642, 179, 212, 213, + 214, 643, 463, 694, 181, 644, 226, 1150, 1151, 1197, + 1423, 1424, 1425, 662, 687, 770, 688, 689, 725, 696, + 736, 318, 695, 697, 698, 594, 809, 735, 735, 264, + 746, 711, -342, -258, 594, 756, 757, 968, 750, 758, + 759, 1019, 606, 291, 244, 245, 246, 247, 248, 762, + 249, 250, 251, 606, 764, 983, 765, 832, 779, 780, + 285, 292, 215, 216, 6, 311, 180, 283, 635, 839, + 816, 821, 594, 829, 840, 325, 842, 843, 594, 594, + 594, 594, 594, 594, 965, 841, 1359, 735, 908, 179, + 847, 850, 917, 909, 916, 771, 181, 910, 217, 218, + 454, 219, 1366, 1367, 1368, 913, 220, 919, 221, 772, + 1474, 455, 918, 924, 773, 941, 925, 1481, 733, 774, + 379, 744, -266, 382, 383, 927, 944, 961, 945, 1175, + 659, 949, 950, 962, 1178, 1179, 951, 606, 970, 969, + 456, 280, 281, 282, 585, 971, 350, 350, 586, 929, + 605, 973, 1172, 848, 976, 977, 1154, 828, 180, 985, + 1011, 605, 1153, 1014, 1156, 934, 1157, 397, 1160, 1158, + 1180, 1171, 1422, 1164, 1182, 1419, 1181, 1196, 1200, 1183, + 1421, 1201, 1202, 1203, 1204, 1205, 1426, 1427, 454, 587, + 1223, 1234, 1361, 454, 454, 1227, 1229, 1268, 1264, 455, + 1305, 1269, 1304, 1271, 455, 455, 1272, 1273, 1278, 606, + 179, 1274, 429, 1284, 1285, 1286, 1287, 181, 978, 979, + 980, 981, 559, 984, 277, 1301, 1306, 1267, 456, 735, + 735, 1307, 1310, 456, 456, 1449, 1341, 1342, 1343, 1345, + 1347, 283, 1348, 1355, 1349, 605, 1358, 470, 1364, 471, + 472, 473, 474, 6, 1363, 209, 454, 1365, 1369, 1260, + 1370, 847, 1371, 965, 1372, 1466, 1373, 455, 484, 588, + 1374, 594, 489, 1375, 1376, 1377, 1382, 1385, 495, 180, + 1411, 498, 1473, 589, 1409, 1410, 454, 1412, 590, 510, + 512, 1420, 1413, 591, 1414, 1429, 1433, 455, 1418, 1428, + 941, 941, 941, 1432, 1437, 1434, 1435, 511, 292, 1438, + 941, 1448, 1451, 1450, 1452, 1453, 1454, 605, 1327, 1163, + 559, 1455, 1456, 559, 1149, 1457, 456, 1475, 781, 1458, + 1476, 548, 1279, 1459, 468, 437, 439, 441, 443, 444, + 351, 1340, 1465, 226, 1467, 356, 1468, 358, 959, 360, + 763, 362, 363, 364, 365, 366, 367, 368, 369, 370, + 371, 372, 373, 374, 375, 376, 481, 1206, 958, 1237, + 1277, 482, 212, 213, 214, 568, 384, 1222, 483, 1198, + 388, 389, 390, 1270, 231, 232, 233, 234, 235, 236, + 1288, 0, 1289, 0, 1233, 0, 0, 1344, 0, 237, + 0, 0, 607, 560, 0, 1238, 1239, 1240, 1241, 1242, + 1243, 1244, 1245, 1246, 1247, 1248, 1249, 1250, 1251, 1252, + 1253, 1254, 1255, 1256, 1257, 1258, 1281, 1261, 235, 236, + 454, 0, 0, 834, 0, 0, 215, 216, 0, 237, + 0, 455, 1334, 1335, 1336, 667, 1337, 1338, 1339, 454, + 0, 454, 0, 0, 0, 0, 658, 0, 0, 427, + 455, 0, 455, 0, 0, 0, 0, 0, 0, 1317, + 814, 686, 217, 218, 0, 219, 1357, 0, 711, 277, + 220, 0, 221, 0, 0, 0, 0, 0, 0, 456, + 0, 456, 0, 0, 566, 0, 0, 0, 569, 570, + 571, 572, 573, 0, 0, 0, 0, 0, 0, 0, + 222, 0, 575, 0, 223, 580, 581, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 0, 249, 250, 251, + 0, 0, 0, 0, 0, 454, 350, 0, 0, 0, + 737, 0, 0, 0, 0, 0, 455, 0, 0, 0, + 941, 0, 941, 0, 941, 0, 0, 941, 941, 941, + 0, 244, 245, 246, 247, 248, 1417, 249, 250, 251, + 0, 1276, 0, 0, 543, 456, 767, 0, 559, 0, + 0, 0, 0, 0, 848, 0, 0, 489, 1407, 0, + 0, 0, 0, 0, 559, 559, 559, 0, 0, 0, + 0, 686, 0, 0, 0, 0, 0, 0, 0, 686, + 0, 0, 658, 0, 658, 658, 658, 658, 658, 0, + 0, 0, 0, 0, 0, 454, 1447, 0, 1222, 1222, + 1222, 1222, 1222, 713, 1222, 0, 455, 0, 686, 686, + 0, 686, 686, 686, 686, 0, 0, 0, 0, 0, + 0, 1351, 230, 231, 232, 233, 234, 235, 236, 1443, + 1444, 0, 1445, 0, 1446, 456, 0, 559, 237, 0, + 1325, 1326, 559, 0, 0, 711, 711, 711, 559, 559, + 641, 1327, 0, 0, 0, 454, 0, 0, 0, 0, + 660, 0, 847, 0, 0, 0, 455, 0, 0, 0, + 0, 0, 0, 0, 0, 1469, 1470, 1471, 0, 1472, + 960, 0, 1311, 1312, 1313, 1314, 1315, 1327, 1318, 0, + 690, 0, 691, 0, 692, 456, 0, 559, 0, 0, + 0, 0, 0, 1222, 1222, 1222, 1222, 1222, 1222, 1222, + 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, + 1222, 1222, 0, 0, 0, 0, 1408, 559, 0, 229, + 230, 231, 232, 233, 234, 235, 236, 0, 0, 1415, + 0, 0, 0, 0, 559, 711, 237, 0, 686, 0, + 667, 0, 711, 658, 0, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 0, 249, 250, 251, 1222, + 0, 0, 0, 1332, 1333, 1334, 1335, 1336, 0, 1337, + 1338, 1339, 686, 0, 0, 0, 0, 1387, 1388, 1389, + 1390, 1391, 1392, 1393, 1394, 1395, 1396, 1397, 1398, 1399, + 1400, 1401, 1402, 1403, 1404, 1405, 0, 0, 0, 1332, + 1333, 1334, 1335, 1336, 0, 1337, 1338, 1339, 0, 0, + 0, 0, 0, 0, 1222, 1323, 1324, 1325, 1326, 0, + 1173, 0, 0, 0, 0, 0, 0, 0, 1327, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 15, 0, 0, 0, 16, 0, 17, 18, 19, + 0, 0, 1191, 1439, 0, 1195, 0, 0, 622, 0, + 0, 0, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 0, 249, 250, 251, 623, 0, 1020, + 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, + 0, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 0, 0, 0, 0, 0, 0, 1460, 1042, + 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, + 1053, 1054, 1055, 1056, 1057, 1058, 0, 0, 1059, 1060, + 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, + 1071, 1072, 1073, 0, 1074, 0, 1075, 1076, 1077, 1078, + 1079, 1080, 1081, 1082, 1083, 0, 1084, 1085, 1086, 0, + 1332, 1333, 1334, 1335, 1336, 0, 1337, 1338, 1339, 982, + 0, 0, 0, 0, 1087, 0, 0, 0, 0, 0, + 1088, 1089, 1090, 0, 1091, 1092, 1093, 1094, 1095, 1096, + 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, + 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, + 1117, 1118, 1119, 1120, 1121, 1122, 1123, 0, 0, 0, + 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, + 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, + 1144, 1360, 1145, 1146, 0, 0, 0, 0, 0, 70, + 0, 71, 72, 73, 0, 0, 0, 0, 0, 0, + 0, 259, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 260, 686, 0, 0, 0, + 0, 0, 0, 229, 230, 231, 232, 233, 234, 235, + 236, 0, 0, 0, 82, 83, 0, 0, 0, 0, + 237, 0, 0, 0, 0, 1207, 0, 0, 0, 0, + 0, 88, 0, 1224, 1225, 1226, 90, 1228, 0, 1230, + 1231, 1232, 0, 1346, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 686, 1020, 1021, 1022, 1023, + 1024, 1025, 1026, 1027, 1028, 1029, 1030, 0, 1031, 1032, + 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 0, + 0, 0, 0, 0, 0, 0, 1042, 1043, 1044, 1045, + 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, + 1056, 1057, 1058, 0, 0, 1059, 1060, 1061, 1062, 1063, + 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, + 0, 1074, 0, 1075, 1076, 1077, 1078, 1079, 1080, 1081, + 1082, 1083, 0, 1084, 1085, 1086, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 0, 249, 250, + 251, 1087, 0, 563, 0, 0, 0, 1088, 1089, 1090, + 0, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 0, 0, 1436, 1124, 1125, 1126, + 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, + 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 0, 1145, + 1146, 0, 0, 7, 8, 9, 10, 0, 11, 12, + 13, 196, 68, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 286, 287, 288, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 15, 69, + 0, 0, 197, 0, 198, 199, 200, 74, 75, 0, + 20, 76, 0, 1316, 201, 22, 0, 0, 78, 0, + 0, 0, 0, 23, 24, 202, 0, 0, 0, 26, + 0, 0, 203, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 204, 215, + 216, 700, 0, 0, 0, 0, 44, 0, 45, 0, + 46, 0, 0, 0, 0, 47, 0, 205, 206, 50, + 0, 0, 51, 84, 0, 0, 0, 52, 0, 0, + 53, 85, 86, 87, 207, 289, 218, 89, 219, 208, + 0, 0, 702, 220, 0, 221, 0, 0, 1378, 1379, + 1380, 1381, 56, 1383, 1384, 57, 58, 59, 703, 0, + 60, 0, 61, 62, 0, 0, 0, 63, 7, 8, + 9, 10, 284, 11, 12, 13, 14, 0, 212, 213, + 214, 0, 0, 0, 0, 0, 0, 0, 704, 0, + 0, 705, 0, 0, 706, 0, 0, 0, 0, 0, + 0, 229, 230, 231, 232, 233, 234, 235, 236, 0, + 707, 0, 0, 15, 0, 0, 0, 16, 237, 17, + 18, 19, 708, 0, 0, 20, 0, 671, 672, 21, + 22, 0, 0, 0, 0, 0, 709, 0, 23, 24, + 25, 0, 215, 216, 26, 0, 0, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 0, 212, 213, 214, 0, 0, + 0, 44, 0, 45, 0, 46, 0, 0, 217, 218, + 47, 219, 48, 49, 50, 0, 220, 51, 221, 0, + 0, 0, 52, 0, 0, 53, 0, 0, 0, 54, + 7, 8, 9, 10, 55, 11, 12, 13, 14, 673, + 0, 0, 310, 0, 0, 0, 0, 56, 0, 0, + 57, 58, 59, 0, 0, 60, 0, 61, 62, 215, + 216, 849, 63, 0, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 15, 249, 250, 251, 16, + 0, 17, 18, 19, 0, 0, 0, 20, 0, 0, + 0, 21, 22, 0, 0, 217, 218, 0, 219, 0, + 23, 24, 25, 220, 0, 221, 26, 0, 0, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 0, 0, 0, 469, + 0, 0, 0, 44, 0, 45, 0, 46, 0, 0, + 0, 0, 47, 0, 48, 49, 50, 0, 0, 51, + 0, 0, 0, 0, 52, 0, 0, 53, 0, 0, + 0, 54, 7, 8, 9, 10, 55, 11, 12, 13, + 14, 0, 212, 213, 214, 0, 0, 766, 0, 56, + 0, 0, 57, 58, 59, 0, 0, 60, 0, 61, + 62, 421, 0, 0, 63, 229, 230, 231, 232, 233, + 234, 235, 236, 0, 0, 0, 0, 15, 0, 0, + 0, 16, 237, 17, 18, 19, 0, 0, 0, 20, + 0, 0, 0, 21, 22, 0, 0, 0, 0, 0, + 0, 0, 23, 24, 25, 0, 215, 216, 26, 0, + 0, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 0, 0, + 0, 0, 0, 0, 0, 44, 0, 45, 0, 46, + 0, 0, 217, 218, 47, 219, 48, 49, 50, 0, + 220, 51, 221, 0, 0, 0, 52, 0, 0, 53, + 0, 0, 0, 54, 7, 8, 9, 10, 55, 11, + 12, 13, 14, 844, 212, 213, 214, 0, 0, 0, + 0, 56, 0, 0, 57, 58, 59, 0, 0, 60, + 0, 61, 62, 0, 1184, 0, 63, 0, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 15, + 249, 250, 251, 16, 0, 17, 18, 19, 0, 0, + 0, 20, 0, 0, 0, 21, 22, 0, 0, 0, + 0, 0, 0, 0, 23, 24, 25, 0, 215, 216, + 26, 0, 0, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 0, 0, 0, 0, 0, 0, 0, 44, 0, 45, + 0, 46, 0, 0, 217, 218, 47, 219, 48, 49, + 50, 0, 220, 51, 221, 0, 0, 0, 52, 0, + 0, 53, 0, 0, 0, 54, 7, 8, 9, 10, + 55, 11, 12, 13, 14, 0, 0, 0, 0, 0, + 0, 0, 0, 56, 0, 0, 57, 58, 59, 0, + 0, 60, 0, 61, 62, 1259, 0, 0, 63, 229, + 230, 231, 232, 233, 234, 235, 236, 0, 0, 0, + 0, 15, 0, 0, 0, 16, 237, 17, 18, 19, 0, 0, 0, 20, 0, 0, 0, 21, 22, 0, 0, 0, 0, 0, 0, 0, 23, 24, 25, 0, - 0, 0, 0, 0, 26, 27, 0, 0, 0, 0, - 0, 0, 0, 28, 0, 29, 0, 30, 0, 0, - 0, 0, 31, 0, 32, 33, 34, 0, 0, 35, - 0, 0, 0, 0, 36, 0, 0, 37, 0, 0, - 38, 7, 8, 9, 10, 39, 11, 12, 13, 14, - 1125, 0, 0, 0, 0, 0, 0, 0, 40, 0, - 0, 41, 42, 43, 0, 0, 44, 0, 45, 46, - 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 15, 0, 0, 0, 16, + 0, 0, 26, 0, 0, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 0, 212, 213, 214, 0, 0, 0, 44, + 0, 45, 0, 46, 0, 0, 0, 0, 47, 0, + 48, 49, 50, 0, 0, 51, 0, 0, 0, 0, + 52, 0, 0, 53, 0, 0, 0, 54, 7, 8, + 9, 10, 55, 11, 12, 13, 14, 1275, 0, 0, + 0, 0, 0, 0, 0, 56, 0, 0, 57, 58, + 59, 0, 0, 60, 0, 61, 62, 215, 216, 0, + 63, 0, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 15, 249, 250, 251, 16, 0, 17, + 18, 19, 0, 0, 0, 20, 0, 0, 324, 21, + 22, 0, 0, 217, 218, 0, 219, 0, 23, 24, + 25, 220, 0, 221, 26, 0, 0, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 0, 0, 0, 0, 0, 0, + 0, 44, 0, 45, 0, 46, 0, 0, 0, 0, + 47, 0, 48, 49, 50, 0, 0, 51, 0, 0, + 0, 0, 52, 0, 0, 53, 0, 0, 0, 54, + 7, 8, 9, 10, 55, 11, 12, 13, 14, 0, + 0, 0, 0, 0, 0, 0, 0, 56, 0, 0, + 57, 58, 59, 0, 0, 60, 0, 61, 62, 1406, + 0, 0, 63, 233, 234, 235, 236, 0, 0, 0, + 0, 0, 0, 0, 0, 15, 237, 0, 0, 16, 0, 17, 18, 19, 0, 0, 0, 20, 0, 0, 0, 21, 22, 0, 0, 0, 0, 0, 0, 0, - 23, 24, 25, 0, 0, 0, 0, 0, 26, 27, - 0, 0, 0, 0, 0, 0, 0, 28, 0, 29, - 0, 30, 0, 0, 0, 0, 31, 0, 32, 33, - 34, 0, 0, 35, 0, 0, 0, 0, 36, 0, - 0, 37, 0, 0, 38, 7, 8, 9, 10, 39, - 11, 12, 13, 14, 0, 0, 0, 0, 0, 0, - 0, 0, 40, 0, 0, 41, 42, 43, 0, 0, - 44, 0, 45, 46, 1248, 0, 0, 47, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, - 0, 0, 0, 16, 0, 17, 18, 19, 0, 0, - 0, 20, 0, 0, 0, 21, 22, 0, 0, 0, - 0, 0, 0, 0, 23, 24, 25, 1170, 1171, 1172, - 1173, 0, 26, 27, 0, 0, 175, 176, 0, 0, - 1174, 28, 0, 29, 0, 30, 0, 0, 0, 0, - 31, 0, 32, 33, 34, 0, 0, 35, 0, 0, - 0, 0, 36, 0, 0, 37, 0, 0, 38, 7, - 8, 9, 10, 39, 11, 12, 13, 0, 0, 0, - 0, 0, 57, 0, 0, 0, 40, 0, 0, 41, - 42, 43, 0, 0, 44, 0, 45, 46, 0, 177, - 178, 47, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1059, 0, 0, 0, 0, 0, 179, - 795, 796, 797, 175, 176, 1060, 0, 182, 0, 183, - 1061, 0, 67, 0, 0, 0, 0, 0, 23, 24, - 798, 69, 0, 0, 799, 1179, 1180, 1181, 1182, 1183, - 0, 1184, 1185, 1186, 0, 0, 0, 29, 0, 30, - 0, 0, 0, -2, 1062, 0, 0, 0, 1063, 57, - 0, 1064, 0, 0, 0, 0, 36, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 177, 178, 0, 0, + 23, 24, 25, 0, 0, 0, 26, 0, 0, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 0, 0, 298, 0, + 0, 0, 0, 44, 0, 45, 0, 46, 0, 0, + 0, 0, 47, 0, 48, 49, 50, 0, 0, 51, + 0, 0, 0, 0, 52, 0, 0, 53, 0, 0, + 0, 54, 782, 783, 784, 10, 55, 11, 785, 786, + 67, 68, 0, 106, 787, 0, 0, 0, 0, 56, + 107, 108, 57, 58, 59, 0, 0, 60, 0, 61, + 62, 110, 111, 112, 63, 0, 242, 243, 244, 245, + 246, 247, 248, 293, 249, 250, 251, 788, 69, 0, + 0, 70, 0, 71, 72, 73, 74, 447, 0, 789, + 76, 0, 0, 77, 790, 0, 120, 78, 0, 0, + 0, 0, 791, 792, 79, 0, 125, 0, 0, 0, + 0, 80, 126, 0, 0, 0, 0, 129, 1320, 1321, + 1322, 1323, 1324, 1325, 1326, 0, 0, 81, 132, 0, + 133, 0, 0, 0, 1327, 793, 0, 794, 0, 795, + 0, 0, 0, 448, 796, 0, 82, 83, 797, 0, + 0, 798, 84, 0, 0, 135, 799, 0, 0, 800, + 85, 86, 87, 88, 0, 0, 89, 0, 90, 0, + 782, 783, 784, 10, 0, 11, 785, 786, 67, 68, + 0, 801, 1236, 0, 802, 803, 0, 0, 0, 804, + 0, 805, 0, 0, 0, 0, 806, 0, 0, 0, + 0, 0, 0, 229, 230, 231, 232, 233, 234, 235, + 236, 0, 0, 0, 0, 788, 69, 0, 0, 70, + 237, 71, 72, 73, 74, 447, 0, 789, 76, 0, + 0, 77, 790, 0, 0, 78, 0, 0, 700, 0, + 791, 792, 79, 0, 0, 0, 0, 0, 0, 80, + 0, 1329, 1330, 1331, 701, 0, 1332, 1333, 1334, 1335, + 1336, 0, 1337, 1338, 1339, 81, 0, 0, 0, 0, + 0, 0, 0, 793, 0, 794, 0, 795, 0, 702, + 0, 448, 796, 0, 82, 83, 797, 0, 0, 798, + 84, 0, 0, 0, 799, 703, 0, 800, 85, 86, + 87, 88, 0, 0, 89, 0, 90, 7, 8, 9, + 10, 0, 11, 12, 13, 0, 0, 0, 0, 801, + 0, 0, 802, 803, 0, 704, 0, 804, 705, 805, + 0, 706, 0, 0, 806, 0, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 707, 249, 250, + 251, 0, 1208, 1354, 0, 0, 0, 0, 0, 708, + 0, 0, 0, 0, 1209, 0, 0, 0, 0, 1210, + 0, 0, 0, 709, -2, 0, 0, 23, 24, 0, + 0, 0, 0, 26, 0, 0, 0, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 45, 0, 46, 0, 0, 0, 0, 1211, + 0, 0, 0, 1212, 105, 106, 1213, 0, 0, 0, + 0, 52, 107, 108, 231, 232, 233, 234, 235, 236, + 0, 109, 0, 110, 111, 112, 113, 0, 0, 237, + 114, 0, 0, 0, 0, 115, 1214, 0, 0, 1215, + 1216, 1217, 0, 0, 1218, 0, 1219, 62, 0, 0, + 0, 1220, 0, 0, 116, 117, 118, 119, 120, 121, + 0, 0, 0, 0, 0, 122, 123, 124, 125, 461, + 0, 0, 0, 0, 126, 127, 0, 0, 128, 129, + 0, 0, 0, 130, 0, 0, 0, 0, 0, 131, + 132, 853, 133, 0, 0, 0, 0, 0, 0, 0, + 134, 854, 855, 856, 857, 858, 859, 860, 861, 0, + 70, 0, 71, 72, 73, 0, 0, 135, 862, 0, + 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, + 873, 874, 0, 0, 0, 0, 0, 0, 0, 0, + 80, 0, 0, 0, 0, 0, 0, 0, 875, 242, + 243, 244, 245, 246, 247, 248, 260, 249, 250, 251, + 0, 0, 329, 330, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 82, 83, 0, 0, 0, + 0, 1319, 1320, 1321, 1322, 1323, 1324, 1325, 1326, 0, + 0, 876, 88, 0, 0, 0, 0, 90, 1327, 0, + 0, 331, 0, 0, 70, 0, 71, 72, 73, 74, + 0, 0, 0, 332, 0, 0, 77, 0, 0, 0, + 78, 0, 0, 0, 0, 0, 0, 79, 0, 0, + 877, 0, 0, 878, 80, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 0, 890, 891, 0, + 81, 0, 892, 329, 330, 0, 0, 0, 0, 0, + 0, 333, 0, 0, 0, 0, 0, 0, 0, 82, + 83, 0, 0, 0, 0, 84, 0, 0, 0, 0, + 0, 0, 0, 334, 335, 87, 88, 0, 0, 89, + 0, 90, 331, 479, 480, 70, 336, 71, 72, 73, + 74, 0, 0, 0, 332, 0, 0, 77, 0, 0, + 0, 78, 337, 0, 1328, 1329, 1330, 1331, 79, 0, + 1332, 1333, 1334, 1335, 1336, 80, 1337, 1338, 1339, 0, + 0, 0, 331, 0, 0, 70, 0, 71, 72, 73, + 74, 81, 0, 0, 332, 0, 0, 77, 0, 0, + 0, 78, 333, 0, 0, 0, 0, 0, 79, 0, + 82, 83, 0, 0, 0, 80, 84, 624, 625, 626, + 0, 0, 0, 0, 334, 335, 87, 88, 0, 0, + 89, 81, 90, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 333, 0, 0, 0, 0, 0, 0, 0, + 82, 83, 0, 337, 0, 0, 84, 0, 0, 70, + 0, 71, 72, 73, 334, 335, 87, 88, 0, 0, + 89, 77, 90, 229, 230, 231, 232, 233, 234, 235, + 236, 0, 79, 0, 0, 0, 0, 0, 0, 80, + 237, 0, 0, 337, 229, 230, 231, 232, 233, 234, + 235, 236, 0, 0, 0, 81, 0, 0, 0, 0, + 0, 237, 229, 230, 231, 232, 233, 234, 235, 236, + 0, 0, 0, 0, 82, 83, 0, 0, 0, 237, + 229, 230, 231, 232, 233, 234, 235, 236, 0, 0, + 0, 88, 0, 0, 89, 0, 90, 237, 229, 230, + 231, 232, 233, 234, 235, 236, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 237, 229, 230, 231, 232, + 233, 234, 235, 236, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 237, 229, 230, 231, 232, 233, 234, + 235, 236, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 237, 0, 0, 0, 0, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 0, 249, 250, + 251, 0, 0, 1442, 0, 0, 0, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 0, 249, + 250, 251, 552, 0, 0, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 0, 249, 250, 251, + 564, 0, 0, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 0, 249, 250, 251, 693, 0, + 0, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 0, 249, 250, 251, 819, 0, 0, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 0, 249, 250, 251, 1350, 561, 0, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 0, 249, + 250, 251, 229, 230, 231, 232, 233, 234, 235, 236, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 237, + 988, 989, 990, 991, 992, 993, 994, 995, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 996, 1319, 1320, + 1321, 1322, 1323, 1324, 1325, 1326, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1327, 0, 0, 0, 0, + 0, 231, 232, 233, 234, 235, 236, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 237, 231, 232, 233, + 234, 235, 236, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 237, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1321, 1322, + 1323, 1324, 1325, 1326, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1327, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1352, 0, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 0, 249, 250, 251, + 0, 0, 0, 997, 998, 999, 1000, 1001, 1002, 1003, + 1004, 1005, 1006, 1007, 0, 1008, 1009, 1010, 0, 1440, + 0, 1328, 1329, 1330, 1331, 0, 0, 1332, 1333, 1334, + 1335, 1336, 0, 1337, 1338, 1339, 67, 68, 0, 0, + 445, 0, 446, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 0, 249, 250, 251, 0, 0, 0, + 0, 241, 242, 243, 244, 245, 246, 247, 248, 0, + 249, 250, 251, 0, 69, 0, 0, 70, 0, 71, + 72, 73, 74, 447, 0, 0, 76, 0, 0, 77, + 1329, 1330, 1331, 78, 0, 1332, 1333, 1334, 1335, 1336, + 79, 1337, 1338, 1339, 0, 0, 0, 80, 0, 1321, + 1322, 1323, 1324, 1325, 1326, 0, 212, 213, 214, 0, + 0, 0, 0, 81, 1327, 1321, 1322, 1323, 1324, 1325, + 1326, 0, 0, 0, 0, 0, 0, 0, 0, 448, + 1327, 0, 82, 83, 0, 0, 0, 0, 84, 0, + 1321, 1322, 1323, 1324, 1325, 1326, 85, 86, 87, 88, + 0, 0, 89, 74, 90, 1327, 0, 0, 0, 70, + 0, 71, 72, 73, 0, 0, 0, 449, 0, 0, + 215, 216, 450, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1065, 0, 0, 1066, 1067, 1068, 179, 180, 1069, 181, - 1070, 46, 86, 87, 182, 1071, 183, 0, 0, 67, - 88, 89, 0, 0, 0, 0, 0, 798, 69, 90, - 0, 91, 92, 93, 94, 0, 0, 0, 95, 0, - 0, 0, 96, 0, 0, 0, 97, 98, 99, 100, - 101, 102, 0, 0, 0, 0, 0, 103, 104, 105, - 106, 0, 0, 0, 0, 0, 107, 108, 0, 0, - 109, 110, 0, 0, 0, 111, 0, 0, 0, 0, - 112, 113, 0, 114, 721, 0, 0, 0, 0, 0, - 0, 115, 0, 722, 723, 724, 725, 726, 727, 728, - 729, 0, 0, 0, 0, 0, 0, 0, 116, 0, - 730, 0, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 191, 192, 193, 194, 195, 196, - 197, 198, 0, 0, 0, 0, 0, 0, 0, 0, - 743, 199, 191, 192, 193, 194, 195, 196, 197, 198, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 199, - 0, 0, 0, 0, 0, 0, 0, 744, 0, 0, - 0, 0, 0, 1167, 1168, 1169, 1170, 1171, 1172, 1173, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1174, + 0, 0, 0, 0, 0, 260, 217, 218, 0, 219, + 0, 0, 0, 0, 220, 0, 221, 0, 0, 84, + 0, 624, 625, 626, 82, 83, 0, 938, 0, 87, + 0, 0, 1330, 1331, 0, 0, 1332, 1333, 1334, 1335, + 1336, 88, 1337, 1338, 1339, 0, 90, 0, 0, 1331, + 0, 0, 1332, 1333, 1334, 1335, 1336, 0, 1337, 1338, + 1339, 0, 0, 70, 0, 71, 72, 73, 627, 628, + 67, 68, 0, 0, 445, 77, 0, 1332, 1333, 1334, + 1335, 1336, 0, 1337, 1338, 1339, 79, 0, 0, 0, + 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 69, 81, + 0, 70, 0, 71, 72, 73, 74, 447, 0, 0, + 76, 0, 0, 77, 0, 0, 0, 78, 82, 83, + 0, 0, 0, 0, 79, 0, 0, 0, 0, 0, + 0, 80, 629, 0, 0, 88, 0, 0, 89, 0, + 90, 0, 0, 0, 0, 0, 0, 81, 0, 67, + 68, 0, 0, 723, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 448, 0, 0, 82, 83, 0, 0, + 0, 0, 84, 0, 0, 0, 0, 0, 67, 68, + 85, 86, 87, 88, 0, 0, 89, 69, 90, 0, + 70, 0, 71, 72, 73, 74, 447, 0, 0, 76, + 0, 0, 77, 0, 0, 0, 78, 0, 0, 0, + 0, 0, 0, 79, 0, 0, 69, 0, 0, 70, + 80, 71, 72, 73, 74, 447, 0, 0, 76, 0, + 0, 77, 0, 0, 0, 78, 81, 0, 0, 0, + 0, 0, 79, 0, 0, 0, 0, 0, 0, 80, + 0, 0, 448, 0, 0, 82, 83, 0, 0, 0, + 0, 84, 0, 0, 0, 81, 0, 67, 68, 85, + 86, 87, 88, 0, 0, 89, 0, 90, 0, 0, + 0, 448, 0, 0, 82, 83, 0, 0, 0, 0, + 84, 67, 68, 0, 0, 0, 0, 0, 85, 86, + 87, 88, 0, 0, 89, 69, 90, 0, 70, 0, + 71, 72, 73, 74, 75, 0, 0, 76, 0, 70, + 77, 71, 72, 73, 78, 0, 0, 0, 0, 69, + 0, 79, 70, 0, 71, 72, 73, 74, 80, 0, + 0, 76, 0, 0, 77, 0, 0, 0, 78, 80, + 0, 0, 0, 0, 81, 79, 0, 0, 0, 0, + 0, 0, 80, 0, 0, 260, 0, 0, 0, 0, + 0, 0, 0, 82, 83, 0, 0, 0, 81, 84, + 67, 68, 0, 0, 82, 83, 0, 85, 86, 87, + 88, 0, 0, 89, 576, 90, 0, 82, 83, 0, + 0, 88, 0, 84, 0, 0, 90, 0, 0, 67, + 0, 85, 86, 87, 88, 0, 0, 89, 69, 90, + 0, 70, 0, 71, 72, 73, 74, 0, 0, 183, + 76, 0, 0, 77, 0, 0, 0, 78, 0, 0, + 0, 0, 0, 0, 79, 0, 0, 69, 0, 0, + 70, 80, 71, 72, 73, 74, 493, 0, 0, 76, + 0, 0, 77, 0, 0, 0, 78, 81, 0, 0, + 0, 0, 0, 79, 0, 0, 0, 0, 0, 0, + 80, 0, 0, 0, 0, 0, 82, 83, 0, 0, + 0, 0, 84, 0, 0, 173, 81, 0, 0, 0, + 85, 86, 87, 88, 0, 0, 89, 0, 90, 0, + 0, 0, 0, 0, 0, 82, 83, 0, 0, 173, + 0, 84, 0, 0, 0, 0, 0, 0, 0, 85, + 86, 87, 88, 174, 0, 89, 70, 90, 71, 72, + 73, 74, 914, 0, 0, 175, 0, 0, 77, 0, + 0, 0, 78, 0, 0, 0, 0, 174, 0, 79, + 70, 0, 71, 72, 73, 74, 80, 0, 0, 175, + 0, 0, 77, 0, 0, 0, 78, 0, 0, 0, + 0, 0, 81, 79, 0, 0, 0, 0, 0, 0, + 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 82, 83, 0, 0, 67, 81, 84, 0, 0, + 0, 0, 0, 0, 0, 176, 177, 87, 88, 0, + 0, 89, 0, 90, 0, 82, 83, 0, 0, 0, + 0, 84, 0, 0, 212, 213, 214, 0, 0, 176, + 177, 87, 88, 69, 0, 89, 70, 90, 71, 72, + 73, 74, 0, 0, 0, 76, 0, 0, 77, 0, + 0, 0, 78, 0, 0, 0, 0, 0, 0, 79, + 0, 0, 0, 0, 0, 0, 80, 0, 0, 0, + 0, 74, 0, 0, 0, 212, 213, 214, 0, 0, + 0, 0, 81, 70, 0, 71, 72, 73, 215, 216, + 0, 0, 0, 0, 212, 213, 214, 0, 0, 0, + 0, 82, 83, 0, 0, 0, 0, 84, 212, 213, + 214, 0, 0, 80, 0, 85, 86, 87, 88, 0, + 0, 89, 74, 90, 217, 935, 936, 937, 0, 260, + 0, 0, 220, 0, 221, 0, 0, 84, 0, 215, + 216, 74, 0, 0, 0, 938, 0, 87, 82, 83, + 939, 0, 0, 0, 0, 74, 0, 0, 215, 216, + 0, 0, 0, 0, 0, 88, 0, 0, 0, 0, + 90, 0, 215, 216, 0, 217, 218, 0, 219, 0, + 0, 0, 0, 220, 0, 221, 0, 0, 84, 0, + 0, 0, 0, 184, 217, 218, 938, 219, 87, 0, + 0, 1185, 220, 0, 221, 0, 0, 84, 217, 218, + 0, 219, 0, 0, 0, 938, 220, 87, 221, 0, + 1187, 84, 0, 0, 105, 106, 0, 0, 0, 938, + 0, 87, 107, 108, 1189, 0, 0, 0, 0, 0, + 0, 109, 0, 110, 111, 112, 113, 0, 0, 0, + 114, 0, 0, 0, 0, 115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 745, 0, 0, 746, 0, - 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, - 757, 0, 758, 759, 0, 0, 0, 760, 0, 0, - 0, 0, 0, 0, 0, 285, 286, 0, 0, 0, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 0, 211, 212, 213, 0, 0, 1200, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 0, - 211, 212, 213, 287, 0, 1281, 53, 0, 54, 55, - 56, 57, 0, 0, 0, 288, 0, 0, 60, 1176, - 1177, 1178, 61, 0, 1179, 1180, 1181, 1182, 1183, 62, - 1184, 1185, 1186, 0, 0, 63, 64, 0, 0, 285, - 286, 0, 0, 0, 0, 0, 0, 289, 0, 0, - 0, 0, 0, 0, 0, 65, 66, 0, 0, 0, - 0, 67, 0, 0, 0, 0, 0, 0, 0, 290, - 69, 70, 0, 0, 71, 0, 72, 287, 0, 0, - 53, 291, 54, 55, 56, 57, 0, 0, 0, 288, - 0, 0, 60, 0, 0, 0, 61, 292, 0, 0, - 0, 0, 0, 62, 0, 0, 0, 0, 0, 63, - 64, 411, 412, 0, 0, 0, 0, 0, 0, 0, - 0, 289, 0, 0, 0, 0, 0, 0, 0, 65, - 66, 0, 0, 0, 0, 67, 0, 0, 0, 0, - 0, 0, 0, 290, 69, 70, 0, 0, 71, 287, - 72, 0, 53, 0, 54, 55, 56, 57, 0, 0, - 0, 288, 0, 0, 60, 0, 0, 0, 61, 0, - 0, 292, 0, 0, 0, 62, 0, 0, 0, 0, - 0, 63, 64, 191, 192, 193, 194, 195, 196, 197, - 198, 0, 0, 289, 0, 0, 0, 0, 0, 0, - 199, 65, 66, 0, 0, 0, 0, 67, 0, 0, - 0, 0, 0, 0, 0, 290, 69, 70, 0, 0, - 71, 0, 72, 191, 192, 193, 194, 195, 196, 197, - 198, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 199, 0, 0, 292, 191, 192, 193, 194, 195, 196, - 197, 198, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 199, 191, 192, 193, 194, 195, 196, 197, 198, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 199, - 191, 192, 193, 194, 195, 196, 197, 198, 0, 0, - 0, 0, 0, 0, 0, 523, 0, 199, 0, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 0, 211, 212, 213, 524, 191, 192, 193, 194, 195, - 196, 197, 198, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 199, 0, 0, 0, 0, 0, 0, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 0, 211, 212, 213, 464, 0, 0, 0, 0, 0, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 0, 211, 212, 213, 477, 0, 0, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 0, - 211, 212, 213, 588, 0, 0, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 0, 211, 212, - 213, 688, 191, 192, 193, 194, 195, 196, 197, 198, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 199, - 0, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 0, 211, 212, 213, 1196, 191, 192, 193, - 194, 195, 196, 197, 198, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 199, 0, 191, 192, 193, 194, - 195, 196, 197, 198, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 199, 191, 192, 193, 194, 195, 196, - 197, 198, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 199, 191, 192, 193, 194, 195, 196, 197, 198, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 199, - 0, 0, 0, 0, 0, 0, 474, 0, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 0, - 211, 212, 213, 0, 845, 846, 847, 848, 849, 850, - 851, 852, 0, 0, 0, 0, 0, 0, 0, 0, - 717, 853, 0, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 0, 211, 212, 213, 1035, 0, - 0, 0, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 0, 211, 212, 213, 0, 1198, 0, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 0, 211, 212, 213, 0, 0, 0, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 0, - 211, 212, 213, 1166, 1167, 1168, 1169, 1170, 1171, 1172, - 1173, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1174, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, - 864, 0, 865, 866, 867, 1166, 1167, 1168, 1169, 1170, - 1171, 1172, 1173, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1174, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1168, 1169, 1170, - 1171, 1172, 1173, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1174, 0, 193, 194, 195, 196, 197, 198, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 199, - 0, 0, 0, 0, 0, 0, 0, 1279, 0, 1175, - 1176, 1177, 1178, 0, 0, 1179, 1180, 1181, 1182, 1183, - 0, 1184, 1185, 1186, 0, 0, 0, 0, 0, 51, - 0, 0, 378, 0, 379, 0, 0, 0, 0, 0, - 0, 193, 194, 195, 196, 197, 198, 0, 0, 0, - 0, 1175, 1176, 1177, 1178, 0, 199, 1179, 1180, 1181, - 1182, 1183, 0, 1184, 1185, 1186, 52, 0, 0, 53, - 0, 54, 55, 56, 57, 380, 0, 0, 59, 0, - 0, 60, 1176, 1177, 1178, 61, 0, 1179, 1180, 1181, - 1182, 1183, 62, 1184, 1185, 1186, 0, 0, 63, 64, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 0, - 211, 212, 213, 0, 0, 381, 0, 0, 65, 66, - 175, 176, 0, 0, 67, 193, 194, 195, 196, 197, - 198, 0, 68, 69, 70, 0, 0, 71, 0, 72, - 199, 1168, 1169, 1170, 1171, 1172, 1173, 0, 0, 0, - 0, 0, 382, 0, 0, 0, 1174, 383, 203, 204, - 205, 206, 207, 208, 209, 210, 57, 211, 212, 213, - 1168, 1169, 1170, 1171, 1172, 1173, 0, 0, 0, 0, - 0, 0, 0, 177, 178, 1174, 0, 0, 0, 0, + 0, 0, 0, 0, 116, 117, 118, 119, 120, 121, + 0, 0, 0, 0, 0, 122, 123, 124, 125, 0, + 0, 0, 0, 0, 126, 127, 105, 106, 128, 129, + 0, 0, 0, 130, 107, 108, 0, 0, 0, 131, + 132, 0, 133, 109, 0, 110, 111, 112, 113, 0, + 134, 0, 114, 0, 0, 0, 0, 115, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 135, 0, 620, + 0, 0, 0, 0, 0, 0, 116, 117, 118, 119, + 120, 121, 0, 0, 0, 0, 0, 122, 123, 124, + 125, 0, 0, 0, 0, 0, 126, 127, 105, 106, + 128, 129, 0, 0, 0, 130, 107, 108, 0, 0, + 0, 131, 132, 0, 133, 109, 0, 110, 111, 112, + 113, 0, 134, 0, 114, 0, 0, 0, 0, 115, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 135, + 0, 749, 0, 0, 0, 0, 0, 0, 116, 117, + 118, 119, 120, 121, 0, 0, 0, 0, 0, 122, + 123, 124, 125, 0, 0, 0, 0, 0, 126, 127, + 105, 106, 128, 129, 0, 0, 0, 130, 107, 108, + 0, 0, 0, 131, 132, 0, 133, 109, 0, 110, + 111, 112, 113, 0, 134, 0, 114, 0, 0, 0, + 0, 115, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 135, 0, 754, 0, 0, 0, 0, 0, 0, + 116, 117, 118, 119, 120, 121, 0, 0, 0, 0, + 0, 122, 123, 124, 125, 0, 0, 0, 0, 0, + 126, 127, 105, 106, 128, 129, 0, 0, 0, 130, + 107, 108, 0, 0, 0, 131, 132, 0, 133, 109, + 0, 110, 111, 112, 113, 0, 134, 0, 114, 0, + 0, 0, 0, 115, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 135, 0, 830, 0, 0, 0, 0, + 0, 0, 116, 117, 118, 119, 120, 121, 0, 0, + 0, 0, 0, 122, 123, 124, 125, 0, 0, 0, + 0, 0, 126, 127, 105, 106, 128, 129, 0, 0, + 0, 130, 107, 108, 0, 0, 0, 131, 132, 0, + 133, 109, 0, 110, 111, 112, 113, 0, 134, 0, + 114, 0, 0, 0, 0, 115, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 135, 0, 952, 0, 0, + 0, 0, 0, 0, 116, 117, 118, 119, 120, 121, + 0, 0, 0, 0, 0, 122, 123, 124, 125, 0, + 0, 0, 0, 0, 126, 127, 105, 106, 128, 129, + 0, 0, 0, 130, 107, 108, 0, 0, 0, 131, + 132, 0, 133, 109, 0, 110, 111, 112, 113, 0, + 134, 0, 114, 0, 0, 0, 0, 115, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 135, 0, 1199, + 0, 0, 0, 0, 0, 0, 116, 117, 118, 119, + 120, 121, 0, 0, 0, 0, 0, 122, 123, 124, + 125, 0, 0, 0, 0, 0, 126, 127, 105, 106, + 128, 129, 0, 0, 0, 130, 107, 108, 0, 0, + 0, 131, 132, 0, 133, 109, 0, 110, 111, 112, + 113, 0, 134, 0, 114, 106, 0, 0, 0, 115, + 0, 0, 107, 108, 0, 0, 0, 0, 0, 135, + 0, 1296, 0, 110, 111, 112, 0, 0, 116, 117, + 118, 119, 120, 121, 0, 293, 0, 0, 0, 122, + 123, 124, 125, 0, 0, 0, 0, 0, 126, 127, + 0, 0, 128, 129, 0, 0, 0, 130, 120, 0, + 0, 0, 0, 131, 132, 106, 133, 0, 125, 0, + 0, 0, 107, 108, 126, 0, 0, 0, 0, 129, + 0, 0, 0, 110, 111, 112, 0, 0, 0, 131, + 132, 135, 133, 106, 0, 293, 0, 0, 0, 0, + 107, 108, 106, 0, 0, 0, 0, -141, 0, 107, + 108, 110, 111, 112, 0, 0, 0, 135, 120, 0, + 110, 111, 112, 293, 0, 0, 0, 0, 125, 0, + 0, 0, 293, 70, 126, 71, 72, 73, 128, 129, + 0, 0, 0, 0, 0, 259, 120, 303, 0, 131, + 132, 0, 133, 0, 0, 120, 125, 0, 0, 0, + 0, 0, 126, 80, 0, 125, 70, 129, 71, 72, + 73, 126, 0, 0, 0, 0, 129, 135, 132, 260, + 133, 0, 0, 0, 0, 0, 0, 132, 0, 133, + 0, 0, 0, 0, 0, 0, 80, 0, 82, 83, + 0, 0, 0, 0, 0, 135, 0, 0, 0, 0, + 0, 0, 260, 0, 135, 88, 0, 0, 0, 0, + 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 82, 83, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 172, 0, 0, 0, 0, 88, 0, + 0, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 179, 180, 0, 181, 0, 0, 0, - 0, 182, 0, 183, 0, 0, 67, 0, 0, 0, - 0, 0, 0, 0, 798, 69, 0, 0, 1036, 0, - 0, 525, 526, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 204, 205, 206, 207, 208, 209, 210, - 0, 211, 212, 213, 0, 0, 0, 1177, 1178, 0, - 0, 1179, 1180, 1181, 1182, 1183, 0, 1184, 1185, 1186, - 0, 0, 53, 0, 54, 55, 56, 527, 528, 0, - 0, 0, 0, 0, 60, 0, 0, 1178, 0, 0, - 1179, 1180, 1181, 1182, 1183, 62, 1184, 1185, 1186, 0, - 0, 63, 64, 0, 51, 0, 0, 378, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 65, 66, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 529, 0, 70, 0, 0, - 71, 52, 72, 0, 53, 0, 54, 55, 56, 57, - 380, 0, 0, 59, 0, 0, 60, 0, 0, 0, - 61, 0, 0, 0, 0, 0, 0, 62, 0, 0, - 0, 0, 0, 63, 64, 0, 51, 0, 0, 610, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 381, 0, 0, 65, 66, 0, 0, 0, 0, 67, - 0, 0, 0, 0, 0, 0, 0, 68, 69, 70, - 0, 0, 71, 52, 72, 0, 53, 0, 54, 55, - 56, 57, 380, 0, 0, 59, 0, 0, 60, 0, - 0, 0, 61, 0, 0, 0, 0, 0, 0, 62, - 0, 0, 0, 0, 0, 63, 64, 0, 51, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 381, 0, 0, 65, 66, 0, 0, 0, - 51, 67, 0, 0, 0, 0, 0, 0, 0, 68, - 69, 70, 0, 0, 71, 52, 72, 0, 53, 0, - 54, 55, 56, 57, 380, 0, 0, 59, 0, 0, - 60, 0, 0, 0, 61, 0, 0, 52, 0, 0, - 53, 62, 54, 55, 56, 57, 58, 63, 64, 59, - 0, 0, 60, 0, 0, 0, 61, 0, 0, 0, - 0, 0, 0, 62, 381, 0, 0, 65, 66, 63, - 64, 0, 51, 67, 0, 0, 0, 0, 0, 0, - 0, 68, 69, 70, 0, 0, 71, 0, 72, 65, - 66, 0, 0, 0, 0, 67, 0, 0, 0, 0, - 0, 0, 0, 68, 69, 70, 0, 0, 71, 52, - 72, 0, 53, 0, 54, 55, 56, 57, 425, 0, - 0, 59, 0, 0, 60, 0, 0, 0, 61, 51, - 0, 0, 0, 0, 0, 62, 0, 0, 0, 0, - 0, 63, 64, 0, 0, 0, 0, 0, 0, 0, - 0, 138, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 65, 66, 0, 0, 0, 52, 67, 0, 53, - 0, 54, 55, 56, 57, 68, 69, 70, 59, 0, - 71, 60, 72, 0, 0, 61, 0, 0, 139, 0, - 0, 53, 62, 54, 55, 56, 57, 779, 63, 64, - 140, 0, 0, 60, 0, 0, 0, 61, 138, 0, - 0, 0, 0, 0, 62, 487, 0, 0, 65, 66, - 63, 64, 0, 0, 67, 0, 0, 0, 0, 0, - 51, 0, 68, 69, 70, 0, 0, 71, 0, 72, - 65, 66, 0, 0, 0, 139, 67, 0, 53, 0, - 54, 55, 56, 57, 141, 69, 70, 140, 0, 71, - 60, 72, 0, 0, 61, 0, 0, 52, 175, 176, - 53, 62, 54, 55, 56, 57, 0, 63, 64, 59, - 0, 0, 60, 0, 175, 176, 61, 0, 0, 0, - 0, 0, 0, 62, 0, 0, 0, 65, 66, 63, - 64, 0, 0, 67, 0, 0, 0, 0, 0, 0, - 0, 141, 69, 70, 57, 0, 71, 0, 72, 65, - 66, 0, 0, 0, 0, 67, 0, 0, 0, 0, - 57, 177, 178, 68, 69, 70, 0, 0, 71, 0, - 72, 0, 0, 0, 0, 0, 0, 177, 178, 0, - 0, 179, 180, 0, 181, 0, 0, 0, 0, 182, - 0, 183, 0, 0, 67, 0, 0, 179, 180, 0, - 181, 0, 798, 69, 0, 182, 1038, 183, 86, 87, - 67, 0, 0, 0, 0, 0, 88, 89, 798, 69, - 0, 0, 1040, 0, 0, 90, 0, 91, 92, 93, - 94, 0, 0, 0, 95, 0, 0, 0, 96, 0, - 0, 0, 97, 98, 99, 100, 101, 102, 0, 0, - 0, 0, 0, 103, 104, 105, 106, 0, 0, 0, - 0, 0, 107, 108, 86, 87, 109, 110, 0, 0, - 0, 111, 88, 89, 0, 0, 112, 113, 0, 114, - 0, 90, 0, 91, 92, 93, 94, 115, 0, 0, - 95, 0, 0, 0, 96, 0, 0, 0, 97, 98, - 99, 100, 101, 102, 116, 0, 521, 0, 0, 103, - 104, 105, 106, 0, 0, 0, 0, 0, 107, 108, - 86, 87, 109, 110, 0, 0, 0, 111, 88, 89, - 0, 0, 112, 113, 0, 114, 0, 90, 0, 91, - 92, 93, 94, 115, 0, 0, 95, 0, 0, 0, - 96, 0, 0, 0, 97, 98, 99, 100, 101, 102, - 116, 0, 626, 0, 0, 103, 104, 105, 106, 0, - 0, 0, 0, 0, 107, 108, 86, 87, 109, 110, - 0, 0, 0, 111, 88, 89, 0, 0, 112, 113, - 0, 114, 0, 90, 0, 91, 92, 93, 94, 115, - 0, 0, 95, 0, 0, 0, 96, 0, 0, 0, - 97, 98, 99, 100, 101, 102, 116, 0, 631, 0, - 0, 103, 104, 105, 106, 0, 0, 0, 0, 0, - 107, 108, 86, 87, 109, 110, 0, 0, 0, 111, - 88, 89, 0, 0, 112, 113, 0, 114, 0, 90, - 0, 91, 92, 93, 94, 115, 0, 0, 95, 0, - 0, 0, 96, 0, 0, 0, 97, 98, 99, 100, - 101, 102, 116, 0, 698, 0, 0, 103, 104, 105, - 106, 0, 0, 0, 0, 0, 107, 108, 86, 87, - 109, 110, 0, 0, 0, 111, 88, 89, 0, 0, - 112, 113, 0, 114, 0, 90, 0, 91, 92, 93, - 94, 115, 0, 0, 95, 0, 0, 0, 96, 0, - 0, 0, 97, 98, 99, 100, 101, 102, 116, 0, - 812, 0, 0, 103, 104, 105, 106, 0, 0, 0, - 0, 0, 107, 108, 86, 87, 109, 110, 0, 0, - 0, 111, 88, 89, 0, 0, 112, 113, 0, 114, - 0, 90, 0, 91, 92, 93, 94, 115, 0, 0, - 95, 0, 0, 0, 96, 0, 0, 0, 97, 98, - 99, 100, 101, 102, 116, 0, 1049, 0, 0, 103, - 104, 105, 106, 0, 0, 0, 0, 0, 107, 108, - 86, 87, 109, 110, 0, 0, 0, 111, 88, 89, - 0, 0, 112, 113, 0, 114, 0, 90, 0, 91, - 92, 93, 94, 115, 0, 0, 95, 0, 0, 0, - 96, 0, 0, 0, 97, 98, 99, 100, 101, 102, - 116, 0, 1144, 0, 0, 103, 104, 105, 106, 0, - 0, 0, 0, 0, 107, 108, 0, 87, 109, 110, - 0, 0, 0, 111, 88, 89, 0, 0, 112, 113, - 0, 114, 0, 0, 0, 91, 92, 93, 0, 0, - 0, 0, 0, 87, 0, 0, 249, 0, 0, 0, - 88, 89, 0, 0, 101, 0, 116, 0, 0, 0, - 0, 91, 92, 93, 106, 0, 0, 0, 0, 0, - 107, 0, 249, 0, 0, 110, 0, 0, 0, 0, - 101, 0, 0, 0, 112, 113, 87, 114, 0, 0, - 106, 0, 0, 88, 89, 0, 107, 0, 0, 0, - 109, 110, -136, 0, 91, 92, 93, 0, 0, 0, - 112, 113, 116, 114, 0, 249, 0, 0, 0, 0, - 0, 0, 87, 101, 259, 0, 0, 0, 0, 88, - 89, 0, 0, 106, 0, 0, 0, 0, 116, 107, - 91, 92, 93, 0, 110, 0, 0, 0, 0, 0, - 0, 249, 0, 0, 113, 0, 114, 0, 0, 101, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 106, - 0, 0, 0, 0, 0, 107, 0, 0, 0, 0, - 110, 116, 0, 0, 0, 0, 0, 0, 0, 0, - 113, 0, 114, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 116 + 0, 0, 0, 0, 0, 0, 189 }; static const yytype_int16 yycheck[] = { - 1, 435, 381, 216, 538, 109, 266, 712, 413, 485, - 470, 28, 583, 28, 45, 57, 229, 230, 58, 396, - 593, 28, 128, 129, 130, 131, 12, 133, 523, 135, - 136, 137, 582, 56, 6, 606, 8, 120, 120, 127, - 120, 147, 148, 0, 14, 46, 152, 153, 543, 228, - 229, 230, 231, 232, 144, 73, 14, 492, 146, 609, - 144, 45, 795, 796, 797, 144, 546, 64, 65, 66, - 73, 73, 73, 70, 144, 549, 647, 551, 552, 553, - 554, 555, 127, 106, 544, 87, 73, 547, 90, 662, - 127, 93, 10, 11, 574, 575, 144, 577, 578, 579, - 580, 146, 144, 120, 126, 120, 32, 109, 126, 146, - 32, 129, 144, 120, 127, 494, 10, 11, 12, 127, - 144, 127, 16, 126, 135, 126, 129, 128, 129, 130, - 131, 126, 133, 146, 135, 136, 137, 397, 146, 126, - 146, 401, 129, 127, 620, 135, 147, 148, 132, 144, - 134, 152, 153, 139, 61, 62, 12, 127, 127, 144, - 16, 127, 146, 57, 543, 149, 150, 151, 428, 127, - 167, 168, 169, 170, 146, 93, 127, 146, 583, 130, - 146, 212, 130, 127, 363, 144, 365, 366, 367, 368, - 369, 274, 274, 233, 274, 278, 278, 145, 278, 93, - 379, 57, 146, 382, 383, 685, 779, 129, 585, 144, - 130, 129, 135, 319, 785, 216, 690, 143, 144, 145, - 144, 697, 144, 145, 221, 145, 120, 228, 229, 230, - 231, 232, 233, 144, 145, 146, 237, 127, 718, 699, - 134, 32, 647, 144, 241, 139, 10, 11, 12, 289, - 144, 127, 16, 10, 11, 127, 146, 274, 6, 274, - 8, 278, 522, 278, 120, 266, 127, 274, 12, 703, - 146, 278, 16, 144, 146, 87, 88, 89, 134, 91, - 92, 93, 135, 139, 96, 146, 144, 127, 144, 101, - 127, 129, 768, 57, 106, 107, 127, 109, 110, 111, - 479, 113, 114, 1036, 127, 1038, 146, 1040, 144, 146, - 1043, 1044, 1045, 57, 127, 146, 73, 74, 319, 127, - 10, 11, 144, 146, 784, 144, 127, 787, 788, 93, - 145, 146, 127, 146, 335, 336, 93, 94, 146, 96, - 380, 381, 127, 778, 101, 146, 103, 144, 782, 844, - 32, 146, 143, 144, 145, 127, 120, 123, 124, 125, - 144, 146, 363, 144, 365, 366, 367, 368, 369, 144, - 134, 32, 632, 129, 146, 139, 120, 128, 379, 130, - 129, 382, 383, 73, 74, 425, 387, 129, 389, 146, - 134, 144, 145, 410, 144, 139, 397, 398, 145, 396, - 401, 126, 127, 93, 94, 6, 96, 8, 144, 410, - 144, 101, 73, 103, 874, 145, 146, 126, 32, 128, - 1125, 130, 10, 11, 146, 426, 87, 428, 148, 90, - 470, 127, 93, 868, 418, 144, 871, 249, 139, 126, - 130, 128, 254, 130, 134, 145, 146, 487, 109, 126, - 145, 128, 129, 130, 494, 137, 138, 139, 140, 141, - 145, 143, 144, 145, 126, 844, 128, 126, 130, 470, - 471, 129, 126, 1023, 128, 135, 130, 144, 479, 144, - 145, 146, 145, 146, 485, 73, 74, 488, 94, 95, - 96, 492, 144, 145, 146, 496, 497, 498, 499, 500, - 501, 502, 144, 543, 544, 93, 94, 547, 96, 144, - 145, 528, 513, 101, 146, 103, 144, 145, 128, 127, - 1015, 522, 146, 146, 2, 139, 140, 141, 146, 143, - 144, 145, 533, 146, 146, 146, 136, 136, 136, 643, - 1074, 129, 543, 544, 804, 136, 547, 139, 549, 146, - 551, 552, 553, 554, 555, 586, 587, 146, 32, 590, - 591, 562, 40, 41, 42, 43, 44, 780, 32, 47, - 571, 146, 821, 1033, 146, 146, 593, 146, 593, 146, - 146, 582, 583, 146, 145, 488, 593, 146, 585, 147, - 73, 126, 144, 496, 497, 498, 499, 500, 501, 705, - 706, 127, 127, 127, 605, 606, 127, 148, 609, 128, - 127, 612, 144, 144, 129, 144, 144, 144, 57, 620, - 627, 139, 144, 146, 126, 129, 10, 644, 148, 10, - 533, 632, 10, 10, 128, 136, 1015, 127, 148, 128, - 641, 139, 139, 674, 645, 662, 647, 662, 147, 128, - 146, 128, 147, 128, 139, 662, 1116, 128, 144, 699, - 1210, 1211, 1212, 137, 138, 139, 140, 141, 126, 143, - 144, 145, 148, 151, 144, 139, 140, 141, 144, 143, - 144, 145, 144, 126, 1119, 145, 145, 127, 130, 690, - 674, 127, 127, 127, 144, 144, 697, 130, 699, 1134, - 1135, 1136, 605, 135, 705, 706, 135, 135, 135, 612, - 147, 712, 127, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 144, 213, 10, 146, 641, 217, - 146, 146, 1202, 145, 784, 146, 4, 787, 788, 148, - 144, 127, 148, 10, 1304, 128, 10, 10, 10, 128, - 127, 1311, 779, 146, 779, 21, 22, 768, 148, 1204, - 144, 146, 779, 1208, 144, 1209, 32, 778, 1213, 780, - 148, 147, 147, 784, 785, 146, 787, 788, 795, 796, - 797, 147, 146, 144, 147, 273, 146, 1257, 805, 146, - 146, 146, 135, 804, 844, 135, 135, 144, 135, 144, - 146, 1024, 136, 136, 815, 136, 1065, 1066, 1067, 1068, - 1069, 146, 1071, 136, 1259, 126, 146, 10, 11, 12, - 814, 643, 816, 16, 874, 866, 146, 649, 146, 317, - 146, 46, 10, 827, 828, 829, 128, 831, 832, 833, - 834, 10, 1287, 331, 332, 128, 128, 10, 128, 146, - 144, 144, 147, 68, 144, 146, 144, 868, 1303, 146, - 871, 146, 127, 874, 57, 80, 136, 146, 79, 80, - 146, 137, 138, 139, 140, 141, 136, 143, 144, 145, - 136, 136, 128, 10, 10, 146, 128, 102, 147, 146, - 144, 6, 144, 144, 144, 128, 128, 112, 146, 92, - 93, 389, 146, 542, 704, 258, 1018, 1166, 1167, 1168, - 1169, 1170, 1171, 1172, 1173, 1174, 1175, 1176, 1177, 1178, - 1179, 1180, 1181, 1182, 1183, 1184, 141, 120, 143, 144, - 1074, 643, 528, 1015, 278, 50, 424, 19, 20, 21, - 22, 134, 57, 58, 805, 644, 139, 844, 815, 437, - 32, 144, 278, 68, 69, 70, 278, -1, 978, -1, - -1, -1, 1078, 336, 79, 1015, -1, 978, 1227, -1, - 185, -1, 87, -1, -1, 16, 17, 18, 19, 20, - 21, 22, 97, 1033, -1, -1, 474, -1, 103, -1, - -1, 32, -1, 108, -1, -1, -1, 485, -1, -1, - -1, -1, -1, 118, 1015, 120, -1, -1, -1, -1, - -1, -1, 1023, 1024, -1, -1, -1, -1, -1, 1036, - 1279, 1038, 1033, 1040, -1, -1, 1043, 1044, 1045, 1070, - 145, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 259, -1, 261, 262, 263, 264, - -1, -1, -1, 135, 136, 137, 138, 139, 140, 141, - -1, 143, 144, 145, -1, 280, 1116, 1078, -1, 284, - -1, -1, -1, -1, -1, 290, 1070, 292, -1, -1, - -1, -1, -1, 571, -1, 300, 301, 10, 11, 300, - 301, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, -1, 143, 144, 145, 1116, -1, -1, 1119, -1, - -1, -1, -1, -1, 1125, 17, 18, 19, 20, 21, - 22, 336, -1, 1134, 1135, 1136, -1, -1, -1, -1, - 32, 619, 620, -1, -1, -1, -1, 625, 17, 18, - 19, 20, 21, 22, 1185, -1, -1, -1, -1, -1, - 73, 74, 1202, 32, -1, -1, -1, -1, 1152, 1153, - 1154, 1155, 1156, 1157, -1, -1, -1, -1, -1, -1, - 93, 94, -1, 96, -1, 390, 387, -1, 101, -1, - 103, -1, 670, 671, 672, 673, -1, 675, -1, -1, - -1, 1202, -1, 1204, -1, -1, -1, 1208, -1, 1210, - 1211, 1212, 1213, 126, -1, -1, -1, 1257, -1, 697, - 1251, 1252, -1, 1254, 1255, 426, -1, 432, -1, -1, - -1, -1, -1, -1, 712, -1, -1, 11, -1, -1, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - -1, 143, 144, 145, -1, -1, 1257, -1, 1259, -1, - -1, -1, -1, 1294, 1295, 1296, 1297, -1, 137, 138, - 139, 140, 141, -1, 143, 144, 145, 51, -1, 53, - 54, 55, -1, -1, -1, -1, 1287, 488, -1, -1, - 768, -1, 770, -1, -1, 496, 497, 498, 499, 500, - 501, -1, 1303, 1304, -1, -1, 80, 81, -1, -1, - 1311, 1065, 1066, 1067, 1068, 1069, -1, 1071, -1, -1, - -1, -1, 527, -1, 529, -1, 100, 101, -1, -1, - -1, -1, 533, -1, -1, -1, -1, 542, -1, -1, - -1, -1, 116, -1, -1, -1, -1, 121, 549, -1, - 551, 552, 553, 554, 555, -1, 834, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 845, 846, 847, - 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, - 858, 859, 860, 861, 862, 863, 864, 865, -1, 867, - -1, -1, -1, 3, 4, 5, 6, -1, 8, 9, - 10, 11, -1, -1, 605, -1, -1, -1, -1, -1, - -1, 612, 1166, 1167, 1168, 1169, 1170, 1171, 1172, 1173, - 1174, 1175, 1176, 1177, 1178, 1179, 1180, 1181, 1182, 1183, - 1184, -1, -1, -1, -1, -1, -1, 47, 48, -1, - 641, 51, -1, 53, 54, 55, 56, 57, -1, 59, - 60, -1, -1, 63, 64, 21, 22, 67, -1, -1, - -1, -1, 72, 73, 74, -1, 32, -1, -1, -1, - 80, 81, 51, 1227, 53, 54, 55, -1, -1, 89, - -1, 91, -1, 93, 63, -1, -1, -1, 98, 690, - 100, 101, 102, -1, -1, 105, 106, 10, 11, 704, - 110, 80, 81, 113, 114, 115, 116, -1, -1, 119, - -1, 121, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 100, 101, -1, 134, 1279, -1, 137, 138, 139, - 1008, -1, 142, -1, 144, 145, -1, 116, -1, 149, - -1, -1, 121, -1, -1, -1, -1, 3, 4, 5, - 6, -1, 8, 9, 10, 11, -1, -1, 14, -1, - 73, 74, -1, -1, -1, 144, -1, -1, -1, -1, - -1, 137, 138, 139, 140, 141, 781, 143, 144, 145, - 93, 94, -1, 96, -1, -1, -1, -1, 101, -1, - 103, 47, 48, 798, -1, 51, 801, 53, 54, 55, - 56, 57, -1, 59, 60, -1, 1084, 63, 64, -1, - -1, 67, -1, 126, -1, -1, 72, 73, 74, -1, - -1, -1, -1, -1, 80, 81, 51, -1, 53, 54, - 55, -1, -1, 89, -1, 91, -1, 93, 63, -1, - -1, 97, 98, -1, 100, 101, 102, 1125, -1, 105, - 106, -1, -1, -1, 110, 80, 81, 113, 114, 115, - 116, -1, -1, 119, -1, 121, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 100, 101, -1, 134, -1, - -1, 137, 138, -1, -1, -1, 142, -1, 144, -1, - -1, 116, -1, 149, -1, -1, 121, -1, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 1186, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 1198, -1, -1, -1, -1, -1, -1, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, -1, -1, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, -1, 67, -1, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, -1, -1, -1, - -1, -1, 87, 88, 89, -1, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, -1, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, -1, -1, - -1, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, -1, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, -1, -1, -1, - -1, -1, -1, -1, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, - -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, -1, -1, -1, -1, -1, 87, - 88, 89, -1, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, -1, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, -1, -1, -1, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, -1, - 148, 149, 3, 4, 5, 6, -1, 8, 9, 10, - 11, -1, -1, 14, -1, -1, -1, -1, -1, 51, - -1, 53, 54, 55, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 15, 16, 17, 18, 19, 20, - 21, 22, -1, -1, -1, -1, 47, 48, 80, 81, - 51, 32, 53, 54, 55, 56, 57, -1, 59, 60, - -1, -1, 63, 64, -1, -1, 67, -1, 100, 101, - -1, 72, 73, 74, -1, -1, -1, -1, -1, 80, - 81, -1, -1, -1, 116, -1, -1, -1, 89, 121, - 91, -1, 93, -1, -1, -1, 97, 98, -1, 100, - 101, 102, -1, -1, 105, 106, -1, -1, -1, 110, - -1, -1, 113, 114, 115, 116, -1, -1, 119, -1, - 121, 3, 4, 5, 6, -1, 8, 9, 10, 11, - -1, 10, 11, 134, -1, -1, 137, 138, -1, -1, - -1, 142, -1, 144, -1, -1, -1, -1, 149, -1, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, -1, 143, 144, 145, 47, -1, 148, -1, 51, - -1, 53, 54, 55, -1, -1, -1, 59, -1, 61, - 62, 63, 64, 51, -1, 53, 54, 55, -1, -1, - 72, 73, 74, -1, 73, 74, -1, -1, 80, 81, - -1, -1, -1, -1, -1, -1, -1, 89, -1, 91, - -1, 93, 80, 81, 93, 94, 98, 96, 100, 101, - 102, -1, 101, 105, 103, -1, -1, -1, 110, 10, - 11, 113, 100, 101, 116, 3, 4, 5, 6, 121, - 8, 9, 10, 11, 126, -1, -1, 126, 116, -1, - -1, -1, 134, 121, -1, 137, 138, 139, -1, -1, - 142, -1, 144, 145, -1, -1, -1, 149, -1, -1, - 51, -1, 53, 54, 55, -1, 144, -1, -1, 47, - -1, -1, 63, 51, -1, 53, 54, 55, -1, -1, - -1, 59, -1, 74, -1, 63, 64, -1, -1, 80, - 81, -1, -1, -1, 72, 73, 74, -1, -1, -1, - -1, -1, 80, 81, 51, -1, 53, 54, 55, 100, - 101, 89, -1, 91, -1, 93, -1, -1, -1, -1, - 98, -1, 100, 101, 102, 116, -1, 105, 119, -1, - 121, -1, 110, 80, 81, 113, -1, -1, 116, 3, - 4, 5, 6, 121, 8, 9, 10, 11, -1, 10, - 11, -1, -1, 100, 101, -1, 134, -1, -1, 137, - 138, 139, -1, -1, 142, -1, 144, 145, 146, 116, - -1, 149, -1, -1, 121, -1, -1, -1, -1, -1, - -1, -1, -1, 47, -1, -1, -1, 51, -1, 53, - 54, 55, -1, -1, -1, 59, -1, 144, -1, 63, - 64, 51, -1, 53, 54, 55, -1, -1, 72, 73, - 74, -1, 73, 74, -1, -1, 80, 81, -1, -1, - -1, -1, -1, -1, -1, 89, -1, 91, -1, 93, - 80, 81, 93, 94, 98, 96, 100, 101, 102, -1, - 101, 105, 103, 10, 11, -1, 110, -1, -1, 113, - 100, 101, 116, 3, 4, 5, 6, 121, 8, 9, - 10, 11, 126, -1, -1, -1, 116, -1, -1, -1, - 134, 121, -1, 137, 138, 139, -1, -1, 142, -1, - 144, 145, -1, -1, -1, 149, -1, -1, -1, -1, - -1, -1, -1, -1, 144, -1, -1, 47, -1, -1, - -1, 51, -1, 53, 54, 55, 73, 74, -1, 59, - -1, -1, -1, 63, 64, -1, -1, -1, -1, -1, - -1, 88, 72, 73, 74, -1, 93, 94, -1, 96, - 80, 81, -1, -1, 101, -1, 103, -1, -1, 89, - -1, 91, -1, 93, -1, -1, -1, -1, 98, -1, - 100, 101, 102, -1, -1, 105, -1, -1, -1, -1, - 110, -1, -1, 113, -1, -1, 116, 3, 4, 5, - 6, 121, 8, 9, 10, 11, -1, -1, -1, -1, - -1, -1, -1, -1, 134, -1, -1, 137, 138, 139, - -1, -1, 142, -1, 144, 145, 146, -1, -1, 149, + 1, 61, 504, 448, 128, 622, 844, 147, 148, 149, + 150, 639, 152, 455, 154, 481, 156, 13, 684, 701, + 464, 6, 15, 8, 162, 15, 15, 644, 0, 13, + 44, 15, 172, 17, 75, 139, 574, 44, 92, 15, + 62, 63, 139, 183, 184, 75, 15, 139, 74, 189, + 190, 15, 145, 106, 107, 108, 722, 110, 111, 112, + 162, 62, 115, 145, 74, 310, 145, 120, 935, 936, + 937, 164, 125, 126, 58, 128, 129, 130, 145, 132, + 133, 162, 164, 144, 57, 164, 81, 82, 83, 582, + 91, 92, 603, 88, 647, 163, 164, 164, 13, 44, + 15, 162, 17, 145, 148, 145, 33, 74, 148, 2, + 650, 793, 652, 653, 654, 655, 656, 162, 144, 163, + 33, 147, 164, 676, 677, 139, 679, 680, 681, 682, + 148, 162, 139, 145, 144, 162, 578, 147, 144, 584, + 146, 147, 148, 58, 145, 163, 147, 148, 149, 150, + 123, 152, 164, 154, 138, 156, 598, 599, 600, 601, + 602, 157, 153, 56, 57, 58, 59, 60, 152, 162, + 63, 172, 162, 157, 685, 164, 145, 144, 162, 164, + 147, 145, 183, 184, 33, 162, 162, 148, 189, 190, + 250, 6, 634, 8, 139, 733, 145, 163, 164, 644, + 254, 255, 163, 145, 74, 153, 744, 718, 719, 204, + 205, 206, 207, 153, 318, 164, 270, 271, 322, 685, + 465, 318, 164, 138, 469, 322, 318, 145, 162, 146, + 322, 148, 914, 274, 161, 162, 163, 152, 163, 164, + 293, 381, 157, 687, 274, 298, 164, 162, 161, 162, + 163, 162, 497, 254, 255, 162, 163, 10, 11, 12, + 13, 145, 162, 816, 17, 260, 33, 778, 269, 270, + 271, 272, 273, 274, 144, 717, 162, 147, 279, 162, + 164, 821, 145, 145, 145, 162, 10, 11, 12, 284, + 828, 145, 333, 162, 736, 188, 162, 850, 147, 147, + 145, 164, 164, 164, 318, 58, 162, 454, 322, 310, + 164, 318, 778, 162, 163, 322, 145, 153, 1185, 164, + 1187, 763, 1189, 144, 145, 1192, 1193, 1194, 770, 771, + 772, 773, 774, 835, 162, 164, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 110, 251, 145, + 145, 162, 900, 256, 162, 163, 164, 13, 145, 15, + 987, 17, 162, 318, 145, 162, 621, 322, 164, 164, + 381, 10, 11, 12, 13, 138, 110, 164, 17, 145, + 157, 158, 159, 164, 161, 162, 163, 398, 399, 152, + 145, 162, 145, 145, 157, 162, 447, 448, 164, 920, + 921, 6, 58, 8, 162, 917, 162, 447, 448, 164, + 913, 164, 164, 147, 317, 163, 164, 428, 162, 58, + 577, 432, 433, 434, 435, 436, 162, 1275, 163, 164, + 587, 588, 589, 590, 591, 446, 162, 163, 449, 450, + 162, 163, 493, 454, 162, 162, 457, 557, 144, 144, + 146, 146, 148, 148, 465, 466, 162, 162, 469, 464, + 162, 478, 162, 162, 10, 11, 12, 478, 144, 162, + 109, 110, 144, 162, 146, 378, 148, 634, 141, 142, + 143, 162, 138, 494, 162, 144, 497, 146, 162, 148, + 162, 394, 395, 1169, 147, 147, 152, 147, 163, 138, + 755, 157, 162, 163, 164, 162, 557, 162, 1011, 145, + 962, 1014, 166, 152, 111, 112, 113, 557, 157, 162, + 163, 164, 162, 162, 162, 576, 157, 164, 74, 75, + 163, 163, 987, 584, 1161, 645, 576, 147, 648, 153, + 144, 162, 162, 162, 584, 146, 557, 558, 164, 145, + 145, 164, 164, 164, 457, 164, 567, 164, 164, 716, + 10, 11, 12, 574, 110, 111, 577, 113, 725, 154, + 154, 582, 118, 164, 120, 586, 587, 588, 589, 590, + 591, 592, 164, 164, 164, 1223, 164, 145, 164, 492, + 164, 164, 603, 644, 645, 164, 164, 648, 144, 164, + 164, 612, 33, 506, 644, 645, 763, 164, 648, 164, + 621, 628, 164, 770, 771, 772, 773, 774, 688, 689, + 164, 154, 164, 634, 74, 75, 696, 164, 698, 164, + 764, 154, 164, 644, 645, 164, 164, 648, 162, 650, + 157, 652, 653, 654, 655, 656, 164, 10, 11, 12, + 13, 163, 15, 664, 17, 163, 165, 164, 561, 74, + 110, 111, 673, 113, 144, 162, 145, 145, 118, 145, + 120, 574, 145, 684, 685, 146, 166, 701, 10, 11, + 12, 145, 687, 164, 701, 162, 62, 837, 838, 944, + 1366, 1367, 1368, 162, 147, 58, 162, 162, 157, 162, + 157, 764, 164, 164, 162, 716, 1161, 718, 719, 85, + 166, 722, 144, 163, 725, 10, 10, 780, 147, 10, + 10, 831, 733, 99, 155, 156, 157, 158, 159, 146, + 161, 162, 163, 744, 154, 805, 145, 165, 146, 166, + 98, 99, 74, 75, 755, 121, 701, 110, 765, 146, + 157, 157, 763, 164, 146, 131, 146, 146, 769, 770, + 771, 772, 773, 774, 775, 165, 1269, 778, 164, 793, + 673, 157, 144, 164, 162, 138, 793, 164, 110, 111, + 831, 113, 1285, 1286, 1287, 164, 118, 162, 120, 152, + 1466, 831, 166, 162, 157, 750, 162, 1473, 163, 162, + 176, 163, 163, 179, 180, 962, 144, 148, 145, 919, + 821, 145, 145, 157, 924, 925, 145, 828, 153, 162, + 831, 10, 11, 12, 13, 153, 837, 838, 17, 732, + 733, 153, 164, 844, 153, 162, 145, 163, 793, 164, + 164, 744, 165, 164, 10, 748, 164, 223, 4, 166, + 162, 915, 1364, 145, 162, 1358, 166, 15, 10, 166, + 1363, 146, 10, 10, 10, 146, 1369, 1370, 919, 58, + 145, 164, 15, 924, 925, 162, 162, 166, 162, 919, + 153, 164, 162, 165, 924, 925, 165, 164, 166, 900, + 914, 165, 268, 165, 164, 164, 164, 914, 801, 802, + 803, 804, 913, 806, 915, 164, 153, 1017, 919, 920, + 921, 153, 153, 924, 925, 1418, 164, 154, 154, 154, + 164, 110, 154, 162, 164, 828, 164, 303, 144, 305, + 306, 307, 308, 944, 164, 61, 987, 164, 164, 1009, + 164, 844, 10, 954, 146, 1448, 10, 987, 324, 138, + 146, 962, 328, 146, 10, 146, 162, 164, 334, 914, + 164, 337, 1465, 152, 162, 162, 1017, 162, 157, 345, + 346, 165, 164, 162, 162, 145, 154, 1017, 164, 164, + 935, 936, 937, 164, 164, 154, 154, 345, 346, 154, + 945, 164, 146, 165, 10, 10, 146, 900, 33, 902, + 1011, 162, 162, 1014, 836, 162, 1017, 146, 643, 164, + 146, 387, 1164, 162, 302, 269, 270, 271, 272, 273, + 146, 1223, 164, 399, 164, 151, 164, 153, 765, 155, + 628, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 322, 954, 764, 987, + 1161, 322, 10, 11, 12, 431, 182, 963, 322, 945, + 186, 187, 188, 1124, 18, 19, 20, 21, 22, 23, + 1180, -1, 1182, -1, 977, -1, -1, 1227, -1, 33, + -1, -1, 458, 399, -1, 988, 989, 990, 991, 992, + 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, + 1003, 1004, 1005, 1006, 1007, 1008, 1170, 1010, 22, 23, + 1161, -1, -1, 1124, -1, -1, 74, 75, -1, 33, + -1, 1161, 157, 158, 159, 501, 161, 162, 163, 1180, + -1, 1182, -1, -1, -1, -1, 494, -1, -1, 265, + 1180, -1, 1182, -1, -1, -1, -1, -1, -1, 1219, + 1161, 509, 110, 111, -1, 113, 1266, -1, 1169, 1170, + 118, -1, 120, -1, -1, -1, -1, -1, -1, 1180, + -1, 1182, -1, -1, 428, -1, -1, -1, 432, 433, + 434, 435, 436, -1, -1, -1, -1, -1, -1, -1, + 148, -1, 446, -1, 152, 449, 450, 151, 152, 153, + 154, 155, 156, 157, 158, 159, -1, 161, 162, 163, + -1, -1, -1, -1, -1, 1266, 1227, -1, -1, -1, + 596, -1, -1, -1, -1, -1, 1266, -1, -1, -1, + 1185, -1, 1187, -1, 1189, -1, -1, 1192, 1193, 1194, + -1, 155, 156, 157, 158, 159, 1356, 161, 162, 163, + -1, 1154, -1, -1, 380, 1266, 632, -1, 1269, -1, + -1, -1, -1, -1, 1275, -1, -1, 643, 1338, -1, + -1, -1, -1, -1, 1285, 1286, 1287, -1, -1, -1, + -1, 639, -1, -1, -1, -1, -1, -1, -1, 647, + -1, -1, 650, -1, 652, 653, 654, 655, 656, -1, + -1, -1, -1, -1, -1, 1356, 1416, -1, 1214, 1215, + 1216, 1217, 1218, 567, 1220, -1, 1356, -1, 676, 677, + -1, 679, 680, 681, 682, -1, -1, -1, -1, -1, + -1, 1234, 17, 18, 19, 20, 21, 22, 23, 1409, + 1410, -1, 1412, -1, 1414, 1356, -1, 1358, 33, -1, + 22, 23, 1363, -1, -1, 1366, 1367, 1368, 1369, 1370, + 486, 33, -1, -1, -1, 1416, -1, -1, -1, -1, + 496, -1, 1275, -1, -1, -1, 1416, -1, -1, -1, + -1, -1, -1, -1, -1, 1455, 1456, 1457, -1, 1459, + 766, -1, 1214, 1215, 1216, 1217, 1218, 33, 1220, -1, + 526, -1, 528, -1, 530, 1416, -1, 1418, -1, -1, + -1, -1, -1, 1319, 1320, 1321, 1322, 1323, 1324, 1325, + 1326, 1327, 1328, 1329, 1330, 1331, 1332, 1333, 1334, 1335, + 1336, 1337, -1, -1, -1, -1, 1339, 1448, -1, 16, + 17, 18, 19, 20, 21, 22, 23, -1, -1, 1352, + -1, -1, -1, -1, 1465, 1466, 33, -1, 816, -1, + 836, -1, 1473, 821, -1, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, -1, 161, 162, 163, 1385, + -1, -1, -1, 155, 156, 157, 158, 159, -1, 161, + 162, 163, 850, -1, -1, -1, -1, 1319, 1320, 1321, + 1322, 1323, 1324, 1325, 1326, 1327, 1328, 1329, 1330, 1331, + 1332, 1333, 1334, 1335, 1336, 1337, -1, -1, -1, 155, + 156, 157, 158, 159, -1, 161, 162, 163, -1, -1, + -1, -1, -1, -1, 1440, 20, 21, 22, 23, -1, + 916, -1, -1, -1, -1, -1, -1, -1, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 47, -1, -1, -1, 51, -1, 53, 54, 55, - -1, -1, -1, 59, -1, -1, -1, 63, 64, -1, - -1, -1, -1, -1, -1, -1, 72, 73, 74, -1, - -1, -1, -1, -1, 80, 81, -1, -1, -1, -1, - -1, -1, -1, 89, -1, 91, -1, 93, -1, -1, - -1, -1, 98, -1, 100, 101, 102, -1, -1, 105, - -1, -1, -1, -1, 110, -1, -1, 113, -1, -1, - 116, 3, 4, 5, 6, 121, 8, 9, 10, 11, - 126, -1, -1, -1, -1, -1, -1, -1, 134, -1, - -1, 137, 138, 139, -1, -1, 142, -1, 144, 145, - -1, -1, -1, 149, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 47, -1, -1, -1, 51, - -1, 53, 54, 55, -1, -1, -1, 59, -1, -1, - -1, 63, 64, -1, -1, -1, -1, -1, -1, -1, - 72, 73, 74, -1, -1, -1, -1, -1, 80, 81, - -1, -1, -1, -1, -1, -1, -1, 89, -1, 91, - -1, 93, -1, -1, -1, -1, 98, -1, 100, 101, - 102, -1, -1, 105, -1, -1, -1, -1, 110, -1, - -1, 113, -1, -1, 116, 3, 4, 5, 6, 121, - 8, 9, 10, 11, -1, -1, -1, -1, -1, -1, - -1, -1, 134, -1, -1, 137, 138, 139, -1, -1, - 142, -1, 144, 145, 146, -1, -1, 149, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 47, - -1, -1, -1, 51, -1, 53, 54, 55, -1, -1, - -1, 59, -1, -1, -1, 63, 64, -1, -1, -1, - -1, -1, -1, -1, 72, 73, 74, 19, 20, 21, - 22, -1, 80, 81, -1, -1, 10, 11, -1, -1, - 32, 89, -1, 91, -1, 93, -1, -1, -1, -1, - 98, -1, 100, 101, 102, -1, -1, 105, -1, -1, - -1, -1, 110, -1, -1, 113, -1, -1, 116, 3, - 4, 5, 6, 121, 8, 9, 10, -1, -1, -1, - -1, -1, 56, -1, -1, -1, 134, -1, -1, 137, - 138, 139, -1, -1, 142, -1, 144, 145, -1, 73, - 74, 149, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 47, -1, -1, -1, -1, -1, 93, - 94, 95, 96, 10, 11, 59, -1, 101, -1, 103, - 64, -1, 106, -1, -1, -1, -1, -1, 72, 73, - 114, 115, -1, -1, 118, 137, 138, 139, 140, 141, - -1, 143, 144, 145, -1, -1, -1, 91, -1, 93, - -1, -1, -1, 0, 98, -1, -1, -1, 102, 56, - -1, 105, -1, -1, -1, -1, 110, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 73, 74, -1, -1, + -1, -1, 938, 1385, -1, 941, -1, -1, 145, -1, + -1, -1, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, -1, 161, 162, 163, 164, -1, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + -1, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, -1, -1, -1, -1, -1, -1, 1440, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, -1, -1, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, -1, 68, -1, 70, 71, 72, 73, + 74, 75, 76, 77, 78, -1, 80, 81, 82, -1, + 155, 156, 157, 158, 159, -1, 161, 162, 163, 805, + -1, -1, -1, -1, 98, -1, -1, -1, -1, -1, + 104, 105, 106, -1, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, -1, -1, -1, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, -1, -1, -1, -1, -1, 52, + -1, 54, 55, 56, -1, -1, -1, -1, -1, -1, + -1, 64, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 134, -1, -1, 137, 138, 139, 93, 94, 142, 96, - 144, 145, 49, 50, 101, 149, 103, -1, -1, 106, - 57, 58, -1, -1, -1, -1, -1, 114, 115, 66, - -1, 68, 69, 70, 71, -1, -1, -1, 75, -1, - -1, -1, 79, -1, -1, -1, 83, 84, 85, 86, - 87, 88, -1, -1, -1, -1, -1, 94, 95, 96, - 97, -1, -1, -1, -1, -1, 103, 104, -1, -1, - 107, 108, -1, -1, -1, 112, -1, -1, -1, -1, - 117, 118, -1, 120, 6, -1, -1, -1, -1, -1, - -1, 128, -1, 15, 16, 17, 18, 19, 20, 21, - 22, -1, -1, -1, -1, -1, -1, -1, 145, -1, - 32, -1, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 15, 16, 17, 18, 19, 20, - 21, 22, -1, -1, -1, -1, -1, -1, -1, -1, - 62, 32, 15, 16, 17, 18, 19, 20, 21, 22, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, - -1, -1, -1, -1, -1, -1, -1, 89, -1, -1, + -1, -1, -1, -1, -1, 98, 1164, -1, -1, -1, -1, -1, -1, 16, 17, 18, 19, 20, 21, 22, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, + 23, -1, -1, -1, 117, 118, -1, -1, -1, -1, + 33, -1, -1, -1, -1, 961, -1, -1, -1, -1, + -1, 134, -1, 969, 970, 971, 139, 973, -1, 975, + 976, 977, -1, 1229, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 1223, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, -1, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, + -1, -1, -1, -1, -1, -1, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, -1, -1, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + -1, 68, -1, 70, 71, 72, 73, 74, 75, 76, + 77, 78, -1, 80, 81, 82, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, -1, 161, 162, + 163, 98, -1, 166, -1, -1, -1, 104, 105, 106, + -1, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, -1, -1, 1382, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, + 167, -1, -1, 3, 4, 5, 6, -1, 8, 9, + 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 127, -1, -1, 130, -1, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, -1, 144, 145, -1, -1, -1, 149, -1, -1, - -1, -1, -1, -1, -1, 10, 11, -1, -1, -1, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, -1, 143, 144, 145, -1, -1, 148, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, - 143, 144, 145, 48, -1, 148, 51, -1, 53, 54, - 55, 56, -1, -1, -1, 60, -1, -1, 63, 132, - 133, 134, 67, -1, 137, 138, 139, 140, 141, 74, - 143, 144, 145, -1, -1, 80, 81, -1, -1, 10, - 11, -1, -1, -1, -1, -1, -1, 92, -1, -1, - -1, -1, -1, -1, -1, 100, 101, -1, -1, -1, - -1, 106, -1, -1, -1, -1, -1, -1, -1, 114, - 115, 116, -1, -1, 119, -1, 121, 48, -1, -1, - 51, 126, 53, 54, 55, 56, -1, -1, -1, 60, - -1, -1, 63, -1, -1, -1, 67, 142, -1, -1, - -1, -1, -1, 74, -1, -1, -1, -1, -1, 80, - 81, 10, 11, -1, -1, -1, -1, -1, -1, -1, - -1, 92, -1, -1, -1, -1, -1, -1, -1, 100, - 101, -1, -1, -1, -1, 106, -1, -1, -1, -1, - -1, -1, -1, 114, 115, 116, -1, -1, 119, 48, - 121, -1, 51, -1, 53, 54, 55, 56, -1, -1, - -1, 60, -1, -1, 63, -1, -1, -1, 67, -1, - -1, 142, -1, -1, -1, 74, -1, -1, -1, -1, - -1, 80, 81, 15, 16, 17, 18, 19, 20, 21, - 22, -1, -1, 92, -1, -1, -1, -1, -1, -1, - 32, 100, 101, -1, -1, -1, -1, 106, -1, -1, - -1, -1, -1, -1, -1, 114, 115, 116, -1, -1, - 119, -1, 121, 15, 16, 17, 18, 19, 20, 21, - 22, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 32, -1, -1, 142, 15, 16, 17, 18, 19, 20, - 21, 22, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 32, 15, 16, 17, 18, 19, 20, 21, 22, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, - 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, - -1, -1, -1, -1, -1, 127, -1, 32, -1, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - -1, 143, 144, 145, 146, 15, 16, 17, 18, 19, - 20, 21, 22, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 32, -1, -1, -1, -1, -1, -1, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - -1, 143, 144, 145, 146, -1, -1, -1, -1, -1, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, -1, 143, 144, 145, 146, -1, -1, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, - 143, 144, 145, 146, -1, -1, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, -1, 143, 144, - 145, 146, 15, 16, 17, 18, 19, 20, 21, 22, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, - -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, -1, 143, 144, 145, 146, 15, 16, 17, - 18, 19, 20, 21, 22, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 32, -1, 15, 16, 17, 18, - 19, 20, 21, 22, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 32, 15, 16, 17, 18, 19, 20, - 21, 22, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 32, 15, 16, 17, 18, 19, 20, 21, 22, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, - -1, -1, -1, -1, -1, -1, 129, -1, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, - 143, 144, 145, -1, 15, 16, 17, 18, 19, 20, - 21, 22, -1, -1, -1, -1, -1, -1, -1, -1, - 128, 32, -1, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, -1, 143, 144, 145, 127, -1, - -1, -1, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, -1, 143, 144, 145, -1, 129, -1, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, -1, 143, 144, 145, -1, -1, -1, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, - 143, 144, 145, 15, 16, 17, 18, 19, 20, 21, - 22, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, -1, 143, 144, 145, 15, 16, 17, 18, 19, - 20, 21, 22, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 32, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 17, 18, 19, - 20, 21, 22, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 32, -1, 17, 18, 19, 20, 21, 22, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, - -1, -1, -1, -1, -1, -1, -1, 129, -1, 131, - 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, - -1, 143, 144, 145, -1, -1, -1, -1, -1, 11, - -1, -1, 14, -1, 16, -1, -1, -1, -1, -1, - -1, 17, 18, 19, 20, 21, 22, -1, -1, -1, - -1, 131, 132, 133, 134, -1, 32, 137, 138, 139, - 140, 141, -1, 143, 144, 145, 48, -1, -1, 51, - -1, 53, 54, 55, 56, 57, -1, -1, 60, -1, - -1, 63, 132, 133, 134, 67, -1, 137, 138, 139, - 140, 141, 74, 143, 144, 145, -1, -1, 80, 81, - 133, 134, 135, 136, 137, 138, 139, 140, 141, -1, - 143, 144, 145, -1, -1, 97, -1, -1, 100, 101, - 10, 11, -1, -1, 106, 17, 18, 19, 20, 21, - 22, -1, 114, 115, 116, -1, -1, 119, -1, 121, - 32, 17, 18, 19, 20, 21, 22, -1, -1, -1, - -1, -1, 134, -1, -1, -1, 32, 139, 134, 135, - 136, 137, 138, 139, 140, 141, 56, 143, 144, 145, - 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, - -1, -1, -1, 73, 74, 32, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 10, 11, 12, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 48, 49, + -1, -1, 52, -1, 54, 55, 56, 57, 58, -1, + 60, 61, -1, 1219, 64, 65, -1, -1, 68, -1, + -1, -1, -1, 73, 74, 75, -1, -1, -1, 79, + -1, -1, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 74, + 75, 17, -1, -1, -1, -1, 106, -1, 108, -1, + 110, -1, -1, -1, -1, 115, -1, 117, 118, 119, + -1, -1, 122, 123, -1, -1, -1, 127, -1, -1, + 130, 131, 132, 133, 134, 110, 111, 137, 113, 139, + -1, -1, 58, 118, -1, 120, -1, -1, 1304, 1305, + 1306, 1307, 152, 1309, 1310, 155, 156, 157, 74, -1, + 160, -1, 162, 163, -1, -1, -1, 167, 3, 4, + 5, 6, 147, 8, 9, 10, 11, -1, 10, 11, + 12, -1, -1, -1, -1, -1, -1, -1, 104, -1, + -1, 107, -1, -1, 110, -1, -1, -1, -1, -1, + -1, 16, 17, 18, 19, 20, 21, 22, 23, -1, + 126, -1, -1, 48, -1, -1, -1, 52, 33, 54, + 55, 56, 138, -1, -1, 60, -1, 62, 63, 64, + 65, -1, -1, -1, -1, -1, 152, -1, 73, 74, + 75, -1, 74, 75, 79, -1, -1, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, -1, 10, 11, 12, -1, -1, + -1, 106, -1, 108, -1, 110, -1, -1, 110, 111, + 115, 113, 117, 118, 119, -1, 118, 122, 120, -1, + -1, -1, 127, -1, -1, 130, -1, -1, -1, 134, + 3, 4, 5, 6, 139, 8, 9, 10, 11, 144, + -1, -1, 144, -1, -1, -1, -1, 152, -1, -1, + 155, 156, 157, -1, -1, 160, -1, 162, 163, 74, + 75, 146, 167, -1, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 48, 161, 162, 163, 52, + -1, 54, 55, 56, -1, -1, -1, 60, -1, -1, + -1, 64, 65, -1, -1, 110, 111, -1, 113, -1, + 73, 74, 75, 118, -1, 120, 79, -1, -1, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, -1, -1, -1, 144, + -1, -1, -1, 106, -1, 108, -1, 110, -1, -1, + -1, -1, 115, -1, 117, 118, 119, -1, -1, 122, + -1, -1, -1, -1, 127, -1, -1, 130, -1, -1, + -1, 134, 3, 4, 5, 6, 139, 8, 9, 10, + 11, -1, 10, 11, 12, -1, -1, 15, -1, 152, + -1, -1, 155, 156, 157, -1, -1, 160, -1, 162, + 163, 164, -1, -1, 167, 16, 17, 18, 19, 20, + 21, 22, 23, -1, -1, -1, -1, 48, -1, -1, + -1, 52, 33, 54, 55, 56, -1, -1, -1, 60, + -1, -1, -1, 64, 65, -1, -1, -1, -1, -1, + -1, -1, 73, 74, 75, -1, 74, 75, 79, -1, + -1, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, -1, -1, + -1, -1, -1, -1, -1, 106, -1, 108, -1, 110, + -1, -1, 110, 111, 115, 113, 117, 118, 119, -1, + 118, 122, 120, -1, -1, -1, 127, -1, -1, 130, + -1, -1, -1, 134, 3, 4, 5, 6, 139, 8, + 9, 10, 11, 144, 10, 11, 12, -1, -1, -1, + -1, 152, -1, -1, 155, 156, 157, -1, -1, 160, + -1, 162, 163, -1, 145, -1, 167, -1, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 48, + 161, 162, 163, 52, -1, 54, 55, 56, -1, -1, + -1, 60, -1, -1, -1, 64, 65, -1, -1, -1, + -1, -1, -1, -1, 73, 74, 75, -1, 74, 75, + 79, -1, -1, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + -1, -1, -1, -1, -1, -1, -1, 106, -1, 108, + -1, 110, -1, -1, 110, 111, 115, 113, 117, 118, + 119, -1, 118, 122, 120, -1, -1, -1, 127, -1, + -1, 130, -1, -1, -1, 134, 3, 4, 5, 6, + 139, 8, 9, 10, 11, -1, -1, -1, -1, -1, + -1, -1, -1, 152, -1, -1, 155, 156, 157, -1, + -1, 160, -1, 162, 163, 164, -1, -1, 167, 16, + 17, 18, 19, 20, 21, 22, 23, -1, -1, -1, + -1, 48, -1, -1, -1, 52, 33, 54, 55, 56, + -1, -1, -1, 60, -1, -1, -1, 64, 65, -1, + -1, -1, -1, -1, -1, -1, 73, 74, 75, -1, + -1, -1, 79, -1, -1, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, -1, 10, 11, 12, -1, -1, -1, 106, + -1, 108, -1, 110, -1, -1, -1, -1, 115, -1, + 117, 118, 119, -1, -1, 122, -1, -1, -1, -1, + 127, -1, -1, 130, -1, -1, -1, 134, 3, 4, + 5, 6, 139, 8, 9, 10, 11, 144, -1, -1, + -1, -1, -1, -1, -1, 152, -1, -1, 155, 156, + 157, -1, -1, 160, -1, 162, 163, 74, 75, -1, + 167, -1, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 48, 161, 162, 163, 52, -1, 54, + 55, 56, -1, -1, -1, 60, -1, -1, 105, 64, + 65, -1, -1, 110, 111, -1, 113, -1, 73, 74, + 75, 118, -1, 120, 79, -1, -1, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, -1, -1, -1, -1, -1, -1, + -1, 106, -1, 108, -1, 110, -1, -1, -1, -1, + 115, -1, 117, 118, 119, -1, -1, 122, -1, -1, + -1, -1, 127, -1, -1, 130, -1, -1, -1, 134, + 3, 4, 5, 6, 139, 8, 9, 10, 11, -1, + -1, -1, -1, -1, -1, -1, -1, 152, -1, -1, + 155, 156, 157, -1, -1, 160, -1, 162, 163, 164, + -1, -1, 167, 20, 21, 22, 23, -1, -1, -1, + -1, -1, -1, -1, -1, 48, 33, -1, -1, 52, + -1, 54, 55, 56, -1, -1, -1, 60, -1, -1, + -1, 64, 65, -1, -1, -1, -1, -1, -1, -1, + 73, 74, 75, -1, -1, -1, 79, -1, -1, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, -1, -1, 6, -1, + -1, -1, -1, 106, -1, 108, -1, 110, -1, -1, + -1, -1, 115, -1, 117, 118, 119, -1, -1, 122, + -1, -1, -1, -1, 127, -1, -1, 130, -1, -1, + -1, 134, 3, 4, 5, 6, 139, 8, 9, 10, + 11, 12, -1, 51, 15, -1, -1, -1, -1, 152, + 58, 59, 155, 156, 157, -1, -1, 160, -1, 162, + 163, 69, 70, 71, 167, -1, 153, 154, 155, 156, + 157, 158, 159, 81, 161, 162, 163, 48, 49, -1, + -1, 52, -1, 54, 55, 56, 57, 58, -1, 60, + 61, -1, -1, 64, 65, -1, 104, 68, -1, -1, + -1, -1, 73, 74, 75, -1, 114, -1, -1, -1, + -1, 82, 120, -1, -1, -1, -1, 125, 17, 18, + 19, 20, 21, 22, 23, -1, -1, 98, 136, -1, + 138, -1, -1, -1, 33, 106, -1, 108, -1, 110, + -1, -1, -1, 114, 115, -1, 117, 118, 119, -1, + -1, 122, 123, -1, -1, 163, 127, -1, -1, 130, + 131, 132, 133, 134, -1, -1, 137, -1, 139, -1, + 3, 4, 5, 6, -1, 8, 9, 10, 11, 12, + -1, 152, 15, -1, 155, 156, -1, -1, -1, 160, + -1, 162, -1, -1, -1, -1, 167, -1, -1, -1, + -1, -1, -1, 16, 17, 18, 19, 20, 21, 22, + 23, -1, -1, -1, -1, 48, 49, -1, -1, 52, + 33, 54, 55, 56, 57, 58, -1, 60, 61, -1, + -1, 64, 65, -1, -1, 68, -1, -1, 17, -1, + 73, 74, 75, -1, -1, -1, -1, -1, -1, 82, + -1, 150, 151, 152, 33, -1, 155, 156, 157, 158, + 159, -1, 161, 162, 163, 98, -1, -1, -1, -1, + -1, -1, -1, 106, -1, 108, -1, 110, -1, 58, + -1, 114, 115, -1, 117, 118, 119, -1, -1, 122, + 123, -1, -1, -1, 127, 74, -1, 130, 131, 132, + 133, 134, -1, -1, 137, -1, 139, 3, 4, 5, + 6, -1, 8, 9, 10, -1, -1, -1, -1, 152, + -1, -1, 155, 156, -1, 104, -1, 160, 107, 162, + -1, 110, -1, -1, 167, -1, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 126, 161, 162, + 163, -1, 48, 166, -1, -1, -1, -1, -1, 138, + -1, -1, -1, -1, 60, -1, -1, -1, -1, 65, + -1, -1, -1, 152, 0, -1, -1, 73, 74, -1, + -1, -1, -1, 79, -1, -1, -1, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 108, -1, 110, -1, -1, -1, -1, 115, + -1, -1, -1, 119, 50, 51, 122, -1, -1, -1, + -1, 127, 58, 59, 18, 19, 20, 21, 22, 23, + -1, 67, -1, 69, 70, 71, 72, -1, -1, 33, + 76, -1, -1, -1, -1, 81, 152, -1, -1, 155, + 156, 157, -1, -1, 160, -1, 162, 163, -1, -1, + -1, 167, -1, -1, 100, 101, 102, 103, 104, 105, + -1, -1, -1, -1, -1, 111, 112, 113, 114, 11, + -1, -1, -1, -1, 120, 121, -1, -1, 124, 125, + -1, -1, -1, 129, -1, -1, -1, -1, -1, 135, + 136, 6, 138, -1, -1, -1, -1, -1, -1, -1, + 146, 16, 17, 18, 19, 20, 21, 22, 23, -1, + 52, -1, 54, 55, 56, -1, -1, 163, 33, -1, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, -1, -1, -1, -1, -1, -1, -1, -1, + 82, -1, -1, -1, -1, -1, -1, -1, 63, 153, + 154, 155, 156, 157, 158, 159, 98, 161, 162, 163, + -1, -1, 10, 11, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 117, 118, -1, -1, -1, + -1, 16, 17, 18, 19, 20, 21, 22, 23, -1, + -1, 106, 134, -1, -1, -1, -1, 139, 33, -1, + -1, 49, -1, -1, 52, -1, 54, 55, 56, 57, + -1, -1, -1, 61, -1, -1, 64, -1, -1, -1, + 68, -1, -1, -1, -1, -1, -1, 75, -1, -1, + 145, -1, -1, 148, 82, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, -1, 162, 163, -1, + 98, -1, 167, 10, 11, -1, -1, -1, -1, -1, + -1, 109, -1, -1, -1, -1, -1, -1, -1, 117, + 118, -1, -1, -1, -1, 123, -1, -1, -1, -1, + -1, -1, -1, 131, 132, 133, 134, -1, -1, 137, + -1, 139, 49, 10, 11, 52, 144, 54, 55, 56, + 57, -1, -1, -1, 61, -1, -1, 64, -1, -1, + -1, 68, 160, -1, 149, 150, 151, 152, 75, -1, + 155, 156, 157, 158, 159, 82, 161, 162, 163, -1, + -1, -1, 49, -1, -1, 52, -1, 54, 55, 56, + 57, 98, -1, -1, 61, -1, -1, 64, -1, -1, + -1, 68, 109, -1, -1, -1, -1, -1, 75, -1, + 117, 118, -1, -1, -1, 82, 123, 10, 11, 12, + -1, -1, -1, -1, 131, 132, 133, 134, -1, -1, + 137, 98, 139, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 109, -1, -1, -1, -1, -1, -1, -1, + 117, 118, -1, 160, -1, -1, 123, -1, -1, 52, + -1, 54, 55, 56, 131, 132, 133, 134, -1, -1, + 137, 64, 139, 16, 17, 18, 19, 20, 21, 22, + 23, -1, 75, -1, -1, -1, -1, -1, -1, 82, + 33, -1, -1, 160, 16, 17, 18, 19, 20, 21, + 22, 23, -1, -1, -1, 98, -1, -1, -1, -1, + -1, 33, 16, 17, 18, 19, 20, 21, 22, 23, + -1, -1, -1, -1, 117, 118, -1, -1, -1, 33, + 16, 17, 18, 19, 20, 21, 22, 23, -1, -1, + -1, 134, -1, -1, 137, -1, 139, 33, 16, 17, + 18, 19, 20, 21, 22, 23, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 33, 16, 17, 18, 19, + 20, 21, 22, 23, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 33, 16, 17, 18, 19, 20, 21, + 22, 23, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 33, -1, -1, -1, -1, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, -1, 161, 162, + 163, -1, -1, 166, -1, -1, -1, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, -1, 161, + 162, 163, 164, -1, -1, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, -1, 161, 162, 163, + 164, -1, -1, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, -1, 161, 162, 163, 164, -1, + -1, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, -1, 161, 162, 163, 164, -1, -1, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + -1, 161, 162, 163, 164, 147, -1, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, -1, 161, + 162, 163, 16, 17, 18, 19, 20, 21, 22, 23, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, + 16, 17, 18, 19, 20, 21, 22, 23, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 33, 16, 17, + 18, 19, 20, 21, 22, 23, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 33, -1, -1, -1, -1, + -1, 18, 19, 20, 21, 22, 23, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 33, 18, 19, 20, + 21, 22, 23, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 33, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, + 20, 21, 22, 23, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 33, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 147, -1, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, -1, 161, 162, 163, + -1, -1, -1, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, -1, 161, 162, 163, -1, 147, + -1, 149, 150, 151, 152, -1, -1, 155, 156, 157, + 158, 159, -1, 161, 162, 163, 11, 12, -1, -1, + 15, -1, 17, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, -1, 161, 162, 163, -1, -1, -1, + -1, 152, 153, 154, 155, 156, 157, 158, 159, -1, + 161, 162, 163, -1, 49, -1, -1, 52, -1, 54, + 55, 56, 57, 58, -1, -1, 61, -1, -1, 64, + 150, 151, 152, 68, -1, 155, 156, 157, 158, 159, + 75, 161, 162, 163, -1, -1, -1, 82, -1, 18, + 19, 20, 21, 22, 23, -1, 10, 11, 12, -1, + -1, -1, -1, 98, 33, 18, 19, 20, 21, 22, + 23, -1, -1, -1, -1, -1, -1, -1, -1, 114, + 33, -1, 117, 118, -1, -1, -1, -1, 123, -1, + 18, 19, 20, 21, 22, 23, 131, 132, 133, 134, + -1, -1, 137, 57, 139, 33, -1, -1, -1, 52, + -1, 54, 55, 56, -1, -1, -1, 152, -1, -1, + 74, 75, 157, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 93, 94, -1, 96, -1, -1, -1, - -1, 101, -1, 103, -1, -1, 106, -1, -1, -1, - -1, -1, -1, -1, 114, 115, -1, -1, 118, -1, - -1, 10, 11, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 135, 136, 137, 138, 139, 140, 141, - -1, 143, 144, 145, -1, -1, -1, 133, 134, -1, - -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, - -1, -1, 51, -1, 53, 54, 55, 56, 57, -1, - -1, -1, -1, -1, 63, -1, -1, 134, -1, -1, - 137, 138, 139, 140, 141, 74, 143, 144, 145, -1, - -1, 80, 81, -1, 11, -1, -1, 14, -1, -1, + -1, -1, -1, -1, -1, 98, 110, 111, -1, 113, + -1, -1, -1, -1, 118, -1, 120, -1, -1, 123, + -1, 10, 11, 12, 117, 118, -1, 131, -1, 133, + -1, -1, 151, 152, -1, -1, 155, 156, 157, 158, + 159, 134, 161, 162, 163, -1, 139, -1, -1, 152, + -1, -1, 155, 156, 157, 158, 159, -1, 161, 162, + 163, -1, -1, 52, -1, 54, 55, 56, 57, 58, + 11, 12, -1, -1, 15, 64, -1, 155, 156, 157, + 158, 159, -1, 161, 162, 163, 75, -1, -1, -1, + -1, -1, -1, 82, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 49, 98, + -1, 52, -1, 54, 55, 56, 57, 58, -1, -1, + 61, -1, -1, 64, -1, -1, -1, 68, 117, 118, + -1, -1, -1, -1, 75, -1, -1, -1, -1, -1, + -1, 82, 131, -1, -1, 134, -1, -1, 137, -1, + 139, -1, -1, -1, -1, -1, -1, 98, -1, 11, + 12, -1, -1, 15, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 114, -1, -1, 117, 118, -1, -1, + -1, -1, 123, -1, -1, -1, -1, -1, 11, 12, + 131, 132, 133, 134, -1, -1, 137, 49, 139, -1, + 52, -1, 54, 55, 56, 57, 58, -1, -1, 61, + -1, -1, 64, -1, -1, -1, 68, -1, -1, -1, + -1, -1, -1, 75, -1, -1, 49, -1, -1, 52, + 82, 54, 55, 56, 57, 58, -1, -1, 61, -1, + -1, 64, -1, -1, -1, 68, 98, -1, -1, -1, + -1, -1, 75, -1, -1, -1, -1, -1, -1, 82, + -1, -1, 114, -1, -1, 117, 118, -1, -1, -1, + -1, 123, -1, -1, -1, 98, -1, 11, 12, 131, + 132, 133, 134, -1, -1, 137, -1, 139, -1, -1, + -1, 114, -1, -1, 117, 118, -1, -1, -1, -1, + 123, 11, 12, -1, -1, -1, -1, -1, 131, 132, + 133, 134, -1, -1, 137, 49, 139, -1, 52, -1, + 54, 55, 56, 57, 58, -1, -1, 61, -1, 52, + 64, 54, 55, 56, 68, -1, -1, -1, -1, 49, + -1, 75, 52, -1, 54, 55, 56, 57, 82, -1, + -1, 61, -1, -1, 64, -1, -1, -1, 68, 82, + -1, -1, -1, -1, 98, 75, -1, -1, -1, -1, + -1, -1, 82, -1, -1, 98, -1, -1, -1, -1, + -1, -1, -1, 117, 118, -1, -1, -1, 98, 123, + 11, 12, -1, -1, 117, 118, -1, 131, 132, 133, + 134, -1, -1, 137, 114, 139, -1, 117, 118, -1, + -1, 134, -1, 123, -1, -1, 139, -1, -1, 11, + -1, 131, 132, 133, 134, -1, -1, 137, 49, 139, + -1, 52, -1, 54, 55, 56, 57, -1, -1, 162, + 61, -1, -1, 64, -1, -1, -1, 68, -1, -1, + -1, -1, -1, -1, 75, -1, -1, 49, -1, -1, + 52, 82, 54, 55, 56, 57, 58, -1, -1, 61, + -1, -1, 64, -1, -1, -1, 68, 98, -1, -1, + -1, -1, -1, 75, -1, -1, -1, -1, -1, -1, + 82, -1, -1, -1, -1, -1, 117, 118, -1, -1, + -1, -1, 123, -1, -1, 11, 98, -1, -1, -1, + 131, 132, 133, 134, -1, -1, 137, -1, 139, -1, + -1, -1, -1, -1, -1, 117, 118, -1, -1, 11, + -1, 123, -1, -1, -1, -1, -1, -1, -1, 131, + 132, 133, 134, 49, -1, 137, 52, 139, 54, 55, + 56, 57, 58, -1, -1, 61, -1, -1, 64, -1, + -1, -1, 68, -1, -1, -1, -1, 49, -1, 75, + 52, -1, 54, 55, 56, 57, 82, -1, -1, 61, + -1, -1, 64, -1, -1, -1, 68, -1, -1, -1, + -1, -1, 98, 75, -1, -1, -1, -1, -1, -1, + 82, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 117, 118, -1, -1, 11, 98, 123, -1, -1, + -1, -1, -1, -1, -1, 131, 132, 133, 134, -1, + -1, 137, -1, 139, -1, 117, 118, -1, -1, -1, + -1, 123, -1, -1, 10, 11, 12, -1, -1, 131, + 132, 133, 134, 49, -1, 137, 52, 139, 54, 55, + 56, 57, -1, -1, -1, 61, -1, -1, 64, -1, + -1, -1, 68, -1, -1, -1, -1, -1, -1, 75, + -1, -1, -1, -1, -1, -1, 82, -1, -1, -1, + -1, 57, -1, -1, -1, 10, 11, 12, -1, -1, + -1, -1, 98, 52, -1, 54, 55, 56, 74, 75, + -1, -1, -1, -1, 10, 11, 12, -1, -1, -1, + -1, 117, 118, -1, -1, -1, -1, 123, 10, 11, + 12, -1, -1, 82, -1, 131, 132, 133, 134, -1, + -1, 137, 57, 139, 110, 111, 112, 113, -1, 98, + -1, -1, 118, -1, 120, -1, -1, 123, -1, 74, + 75, 57, -1, -1, -1, 131, -1, 133, 117, 118, + 136, -1, -1, -1, -1, 57, -1, -1, 74, 75, + -1, -1, -1, -1, -1, 134, -1, -1, -1, -1, + 139, -1, 74, 75, -1, 110, 111, -1, 113, -1, + -1, -1, -1, 118, -1, 120, -1, -1, 123, -1, + -1, -1, -1, 162, 110, 111, 131, 113, 133, -1, + -1, 136, 118, -1, 120, -1, -1, 123, 110, 111, + -1, 113, -1, -1, -1, 131, 118, 133, 120, -1, + 136, 123, -1, -1, 50, 51, -1, -1, -1, 131, + -1, 133, 58, 59, 136, -1, -1, -1, -1, -1, + -1, 67, -1, 69, 70, 71, 72, -1, -1, -1, + 76, -1, -1, -1, -1, 81, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 100, 101, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 114, -1, 116, -1, -1, - 119, 48, 121, -1, 51, -1, 53, 54, 55, 56, - 57, -1, -1, 60, -1, -1, 63, -1, -1, -1, - 67, -1, -1, -1, -1, -1, -1, 74, -1, -1, - -1, -1, -1, 80, 81, -1, 11, -1, -1, 14, + -1, -1, -1, -1, 100, 101, 102, 103, 104, 105, + -1, -1, -1, -1, -1, 111, 112, 113, 114, -1, + -1, -1, -1, -1, 120, 121, 50, 51, 124, 125, + -1, -1, -1, 129, 58, 59, -1, -1, -1, 135, + 136, -1, 138, 67, -1, 69, 70, 71, 72, -1, + 146, -1, 76, -1, -1, -1, -1, 81, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 163, -1, 165, + -1, -1, -1, -1, -1, -1, 100, 101, 102, 103, + 104, 105, -1, -1, -1, -1, -1, 111, 112, 113, + 114, -1, -1, -1, -1, -1, 120, 121, 50, 51, + 124, 125, -1, -1, -1, 129, 58, 59, -1, -1, + -1, 135, 136, -1, 138, 67, -1, 69, 70, 71, + 72, -1, 146, -1, 76, -1, -1, -1, -1, 81, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 163, + -1, 165, -1, -1, -1, -1, -1, -1, 100, 101, + 102, 103, 104, 105, -1, -1, -1, -1, -1, 111, + 112, 113, 114, -1, -1, -1, -1, -1, 120, 121, + 50, 51, 124, 125, -1, -1, -1, 129, 58, 59, + -1, -1, -1, 135, 136, -1, 138, 67, -1, 69, + 70, 71, 72, -1, 146, -1, 76, -1, -1, -1, + -1, 81, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 163, -1, 165, -1, -1, -1, -1, -1, -1, + 100, 101, 102, 103, 104, 105, -1, -1, -1, -1, + -1, 111, 112, 113, 114, -1, -1, -1, -1, -1, + 120, 121, 50, 51, 124, 125, -1, -1, -1, 129, + 58, 59, -1, -1, -1, 135, 136, -1, 138, 67, + -1, 69, 70, 71, 72, -1, 146, -1, 76, -1, + -1, -1, -1, 81, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 163, -1, 165, -1, -1, -1, -1, + -1, -1, 100, 101, 102, 103, 104, 105, -1, -1, + -1, -1, -1, 111, 112, 113, 114, -1, -1, -1, + -1, -1, 120, 121, 50, 51, 124, 125, -1, -1, + -1, 129, 58, 59, -1, -1, -1, 135, 136, -1, + 138, 67, -1, 69, 70, 71, 72, -1, 146, -1, + 76, -1, -1, -1, -1, 81, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 163, -1, 165, -1, -1, + -1, -1, -1, -1, 100, 101, 102, 103, 104, 105, + -1, -1, -1, -1, -1, 111, 112, 113, 114, -1, + -1, -1, -1, -1, 120, 121, 50, 51, 124, 125, + -1, -1, -1, 129, 58, 59, -1, -1, -1, 135, + 136, -1, 138, 67, -1, 69, 70, 71, 72, -1, + 146, -1, 76, -1, -1, -1, -1, 81, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 163, -1, 165, + -1, -1, -1, -1, -1, -1, 100, 101, 102, 103, + 104, 105, -1, -1, -1, -1, -1, 111, 112, 113, + 114, -1, -1, -1, -1, -1, 120, 121, 50, 51, + 124, 125, -1, -1, -1, 129, 58, 59, -1, -1, + -1, 135, 136, -1, 138, 67, -1, 69, 70, 71, + 72, -1, 146, -1, 76, 51, -1, -1, -1, 81, + -1, -1, 58, 59, -1, -1, -1, -1, -1, 163, + -1, 165, -1, 69, 70, 71, -1, -1, 100, 101, + 102, 103, 104, 105, -1, 81, -1, -1, -1, 111, + 112, 113, 114, -1, -1, -1, -1, -1, 120, 121, + -1, -1, 124, 125, -1, -1, -1, 129, 104, -1, + -1, -1, -1, 135, 136, 51, 138, -1, 114, -1, + -1, -1, 58, 59, 120, -1, -1, -1, -1, 125, + -1, -1, -1, 69, 70, 71, -1, -1, -1, 135, + 136, 163, 138, 51, -1, 81, -1, -1, -1, -1, + 58, 59, 51, -1, -1, -1, -1, 153, -1, 58, + 59, 69, 70, 71, -1, -1, -1, 163, 104, -1, + 69, 70, 71, 81, -1, -1, -1, -1, 114, -1, + -1, -1, 81, 52, 120, 54, 55, 56, 124, 125, + -1, -1, -1, -1, -1, 64, 104, 105, -1, 135, + 136, -1, 138, -1, -1, 104, 114, -1, -1, -1, + -1, -1, 120, 82, -1, 114, 52, 125, 54, 55, + 56, 120, -1, -1, -1, -1, 125, 163, 136, 98, + 138, -1, -1, -1, -1, -1, -1, 136, -1, 138, + -1, -1, -1, -1, -1, -1, 82, -1, 117, 118, + -1, -1, -1, -1, -1, 163, -1, -1, -1, -1, + -1, -1, 98, -1, 163, 134, -1, -1, -1, -1, + 139, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 117, 118, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 162, -1, -1, -1, -1, 134, -1, + -1, -1, -1, 139, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 97, -1, -1, 100, 101, -1, -1, -1, -1, 106, - -1, -1, -1, -1, -1, -1, -1, 114, 115, 116, - -1, -1, 119, 48, 121, -1, 51, -1, 53, 54, - 55, 56, 57, -1, -1, 60, -1, -1, 63, -1, - -1, -1, 67, -1, -1, -1, -1, -1, -1, 74, - -1, -1, -1, -1, -1, 80, 81, -1, 11, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 97, -1, -1, 100, 101, -1, -1, -1, - 11, 106, -1, -1, -1, -1, -1, -1, -1, 114, - 115, 116, -1, -1, 119, 48, 121, -1, 51, -1, - 53, 54, 55, 56, 57, -1, -1, 60, -1, -1, - 63, -1, -1, -1, 67, -1, -1, 48, -1, -1, - 51, 74, 53, 54, 55, 56, 57, 80, 81, 60, - -1, -1, 63, -1, -1, -1, 67, -1, -1, -1, - -1, -1, -1, 74, 97, -1, -1, 100, 101, 80, - 81, -1, 11, 106, -1, -1, -1, -1, -1, -1, - -1, 114, 115, 116, -1, -1, 119, -1, 121, 100, - 101, -1, -1, -1, -1, 106, -1, -1, -1, -1, - -1, -1, -1, 114, 115, 116, -1, -1, 119, 48, - 121, -1, 51, -1, 53, 54, 55, 56, 57, -1, - -1, 60, -1, -1, 63, -1, -1, -1, 67, 11, - -1, -1, -1, -1, -1, 74, -1, -1, -1, -1, - -1, 80, 81, -1, -1, -1, -1, -1, -1, -1, - -1, 11, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 100, 101, -1, -1, -1, 48, 106, -1, 51, - -1, 53, 54, 55, 56, 114, 115, 116, 60, -1, - 119, 63, 121, -1, -1, 67, -1, -1, 48, -1, - -1, 51, 74, 53, 54, 55, 56, 57, 80, 81, - 60, -1, -1, 63, -1, -1, -1, 67, 11, -1, - -1, -1, -1, -1, 74, 97, -1, -1, 100, 101, - 80, 81, -1, -1, 106, -1, -1, -1, -1, -1, - 11, -1, 114, 115, 116, -1, -1, 119, -1, 121, - 100, 101, -1, -1, -1, 48, 106, -1, 51, -1, - 53, 54, 55, 56, 114, 115, 116, 60, -1, 119, - 63, 121, -1, -1, 67, -1, -1, 48, 10, 11, - 51, 74, 53, 54, 55, 56, -1, 80, 81, 60, - -1, -1, 63, -1, 10, 11, 67, -1, -1, -1, - -1, -1, -1, 74, -1, -1, -1, 100, 101, 80, - 81, -1, -1, 106, -1, -1, -1, -1, -1, -1, - -1, 114, 115, 116, 56, -1, 119, -1, 121, 100, - 101, -1, -1, -1, -1, 106, -1, -1, -1, -1, - 56, 73, 74, 114, 115, 116, -1, -1, 119, -1, - 121, -1, -1, -1, -1, -1, -1, 73, 74, -1, - -1, 93, 94, -1, 96, -1, -1, -1, -1, 101, - -1, 103, -1, -1, 106, -1, -1, 93, 94, -1, - 96, -1, 114, 115, -1, 101, 118, 103, 49, 50, - 106, -1, -1, -1, -1, -1, 57, 58, 114, 115, - -1, -1, 118, -1, -1, 66, -1, 68, 69, 70, - 71, -1, -1, -1, 75, -1, -1, -1, 79, -1, - -1, -1, 83, 84, 85, 86, 87, 88, -1, -1, - -1, -1, -1, 94, 95, 96, 97, -1, -1, -1, - -1, -1, 103, 104, 49, 50, 107, 108, -1, -1, - -1, 112, 57, 58, -1, -1, 117, 118, -1, 120, - -1, 66, -1, 68, 69, 70, 71, 128, -1, -1, - 75, -1, -1, -1, 79, -1, -1, -1, 83, 84, - 85, 86, 87, 88, 145, -1, 147, -1, -1, 94, - 95, 96, 97, -1, -1, -1, -1, -1, 103, 104, - 49, 50, 107, 108, -1, -1, -1, 112, 57, 58, - -1, -1, 117, 118, -1, 120, -1, 66, -1, 68, - 69, 70, 71, 128, -1, -1, 75, -1, -1, -1, - 79, -1, -1, -1, 83, 84, 85, 86, 87, 88, - 145, -1, 147, -1, -1, 94, 95, 96, 97, -1, - -1, -1, -1, -1, 103, 104, 49, 50, 107, 108, - -1, -1, -1, 112, 57, 58, -1, -1, 117, 118, - -1, 120, -1, 66, -1, 68, 69, 70, 71, 128, - -1, -1, 75, -1, -1, -1, 79, -1, -1, -1, - 83, 84, 85, 86, 87, 88, 145, -1, 147, -1, - -1, 94, 95, 96, 97, -1, -1, -1, -1, -1, - 103, 104, 49, 50, 107, 108, -1, -1, -1, 112, - 57, 58, -1, -1, 117, 118, -1, 120, -1, 66, - -1, 68, 69, 70, 71, 128, -1, -1, 75, -1, - -1, -1, 79, -1, -1, -1, 83, 84, 85, 86, - 87, 88, 145, -1, 147, -1, -1, 94, 95, 96, - 97, -1, -1, -1, -1, -1, 103, 104, 49, 50, - 107, 108, -1, -1, -1, 112, 57, 58, -1, -1, - 117, 118, -1, 120, -1, 66, -1, 68, 69, 70, - 71, 128, -1, -1, 75, -1, -1, -1, 79, -1, - -1, -1, 83, 84, 85, 86, 87, 88, 145, -1, - 147, -1, -1, 94, 95, 96, 97, -1, -1, -1, - -1, -1, 103, 104, 49, 50, 107, 108, -1, -1, - -1, 112, 57, 58, -1, -1, 117, 118, -1, 120, - -1, 66, -1, 68, 69, 70, 71, 128, -1, -1, - 75, -1, -1, -1, 79, -1, -1, -1, 83, 84, - 85, 86, 87, 88, 145, -1, 147, -1, -1, 94, - 95, 96, 97, -1, -1, -1, -1, -1, 103, 104, - 49, 50, 107, 108, -1, -1, -1, 112, 57, 58, - -1, -1, 117, 118, -1, 120, -1, 66, -1, 68, - 69, 70, 71, 128, -1, -1, 75, -1, -1, -1, - 79, -1, -1, -1, 83, 84, 85, 86, 87, 88, - 145, -1, 147, -1, -1, 94, 95, 96, 97, -1, - -1, -1, -1, -1, 103, 104, -1, 50, 107, 108, - -1, -1, -1, 112, 57, 58, -1, -1, 117, 118, - -1, 120, -1, -1, -1, 68, 69, 70, -1, -1, - -1, -1, -1, 50, -1, -1, 79, -1, -1, -1, - 57, 58, -1, -1, 87, -1, 145, -1, -1, -1, - -1, 68, 69, 70, 97, -1, -1, -1, -1, -1, - 103, -1, 79, -1, -1, 108, -1, -1, -1, -1, - 87, -1, -1, -1, 117, 118, 50, 120, -1, -1, - 97, -1, -1, 57, 58, -1, 103, -1, -1, -1, - 107, 108, 135, -1, 68, 69, 70, -1, -1, -1, - 117, 118, 145, 120, -1, 79, -1, -1, -1, -1, - -1, -1, 50, 87, 88, -1, -1, -1, -1, 57, - 58, -1, -1, 97, -1, -1, -1, -1, 145, 103, - 68, 69, 70, -1, 108, -1, -1, -1, -1, -1, - -1, 79, -1, -1, 118, -1, 120, -1, -1, 87, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 97, - -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, - 108, 145, -1, -1, -1, -1, -1, -1, -1, -1, - 118, -1, 120, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 145 + -1, -1, -1, -1, -1, -1, 162 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = +static const yytype_uint16 yystos[] = { - 0, 123, 124, 125, 151, 152, 253, 3, 4, 5, - 6, 8, 9, 10, 11, 47, 51, 53, 54, 55, - 59, 63, 64, 72, 73, 74, 80, 81, 89, 91, - 93, 98, 100, 101, 102, 105, 110, 113, 116, 121, - 134, 137, 138, 139, 142, 144, 145, 149, 243, 244, - 252, 11, 48, 51, 53, 54, 55, 56, 57, 60, - 63, 67, 74, 80, 81, 100, 101, 106, 114, 115, - 116, 119, 121, 207, 211, 212, 214, 220, 221, 225, - 226, 231, 232, 233, 234, 0, 49, 50, 57, 58, - 66, 68, 69, 70, 71, 75, 79, 83, 84, 85, - 86, 87, 88, 94, 95, 96, 97, 103, 104, 107, - 108, 112, 117, 118, 120, 128, 145, 155, 157, 158, - 160, 163, 181, 227, 230, 253, 144, 144, 144, 144, - 144, 144, 135, 144, 135, 144, 144, 144, 11, 48, - 60, 114, 209, 225, 226, 231, 135, 144, 144, 144, - 135, 144, 144, 144, 243, 243, 243, 243, 243, 11, - 51, 53, 54, 55, 63, 74, 80, 81, 100, 101, - 116, 121, 211, 241, 243, 10, 11, 73, 74, 93, - 94, 96, 101, 103, 130, 134, 247, 248, 250, 253, - 243, 15, 16, 17, 18, 19, 20, 21, 22, 32, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 143, 144, 145, 6, 8, 207, 144, 56, 106, - 63, 81, 232, 232, 232, 250, 232, 12, 16, 57, - 120, 134, 139, 144, 205, 206, 253, 126, 10, 11, - 93, 129, 251, 10, 11, 93, 126, 250, 251, 79, - 160, 160, 160, 160, 6, 160, 160, 129, 159, 88, - 160, 144, 144, 144, 144, 160, 126, 250, 129, 129, - 129, 160, 160, 144, 160, 163, 182, 160, 160, 166, - 88, 250, 160, 160, 145, 10, 11, 48, 60, 92, - 114, 126, 142, 169, 172, 208, 210, 212, 214, 220, - 225, 226, 231, 240, 241, 253, 211, 240, 240, 240, - 240, 211, 240, 211, 240, 240, 240, 144, 250, 144, - 250, 250, 211, 240, 240, 211, 211, 211, 243, 240, - 240, 146, 127, 146, 250, 148, 127, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 146, 241, - 243, 206, 243, 139, 12, 16, 57, 120, 134, 139, - 205, 253, 205, 206, 205, 206, 205, 205, 14, 16, - 57, 97, 134, 139, 191, 192, 201, 207, 253, 145, - 223, 224, 253, 11, 222, 232, 129, 213, 215, 160, - 157, 126, 250, 250, 250, 250, 250, 152, 126, 243, - 135, 10, 11, 172, 208, 210, 250, 128, 130, 161, - 162, 250, 144, 144, 144, 57, 207, 250, 156, 250, - 126, 128, 129, 130, 197, 126, 128, 130, 198, 128, - 164, 250, 251, 250, 146, 146, 146, 146, 146, 146, - 136, 146, 136, 146, 146, 146, 243, 240, 136, 146, - 146, 146, 136, 146, 146, 146, 146, 243, 243, 57, - 144, 178, 253, 247, 129, 146, 148, 146, 205, 139, - 205, 205, 205, 205, 205, 145, 205, 97, 207, 201, - 205, 205, 146, 14, 127, 12, 16, 57, 120, 134, - 139, 144, 204, 251, 253, 239, 243, 253, 250, 147, - 222, 152, 73, 216, 253, 152, 126, 127, 127, 127, - 127, 147, 228, 127, 146, 10, 11, 56, 57, 114, - 183, 184, 185, 186, 231, 253, 144, 198, 167, 128, - 211, 148, 127, 144, 170, 12, 139, 171, 243, 207, - 12, 16, 57, 120, 134, 139, 203, 251, 253, 152, - 144, 235, 236, 153, 154, 250, 61, 62, 235, 61, - 62, 126, 243, 12, 16, 57, 92, 120, 134, 139, - 144, 165, 187, 189, 251, 129, 144, 144, 146, 146, - 144, 144, 191, 32, 73, 87, 90, 93, 109, 190, - 253, 243, 205, 239, 146, 207, 204, 146, 146, 178, - 14, 201, 139, 204, 204, 204, 204, 204, 204, 130, - 145, 196, 253, 148, 127, 130, 147, 129, 217, 218, - 253, 147, 229, 10, 10, 10, 10, 152, 252, 128, - 250, 186, 250, 136, 127, 204, 168, 189, 128, 148, - 161, 3, 4, 5, 9, 10, 14, 47, 59, 64, - 72, 73, 89, 91, 93, 98, 102, 105, 110, 113, - 134, 137, 138, 142, 144, 149, 193, 194, 201, 202, - 245, 246, 252, 253, 191, 139, 187, 191, 146, 203, - 139, 203, 203, 203, 203, 203, 144, 145, 147, 173, - 147, 237, 253, 126, 127, 126, 144, 128, 128, 147, - 128, 128, 126, 199, 200, 243, 253, 128, 139, 187, - 187, 6, 15, 16, 17, 18, 19, 20, 21, 22, - 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 62, 89, 127, 130, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 144, 145, - 149, 179, 187, 187, 187, 187, 129, 144, 145, 190, - 130, 196, 198, 222, 241, 241, 241, 241, 146, 57, - 209, 144, 126, 148, 144, 204, 196, 144, 144, 190, - 204, 146, 243, 239, 243, 94, 95, 96, 114, 118, - 219, 226, 249, 250, 126, 127, 152, 127, 146, 127, - 127, 127, 147, 146, 130, 204, 130, 163, 180, 181, - 185, 130, 195, 253, 196, 198, 160, 144, 135, 135, - 209, 135, 144, 135, 144, 243, 243, 243, 243, 211, - 241, 243, 146, 14, 127, 15, 16, 17, 18, 19, - 20, 21, 22, 32, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 143, 144, 145, 146, 187, - 146, 146, 144, 203, 176, 239, 191, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 67, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 87, 88, 89, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, - 149, 238, 235, 154, 240, 240, 199, 147, 127, 187, - 10, 146, 148, 146, 4, 188, 239, 243, 127, 146, - 146, 146, 146, 178, 209, 206, 146, 250, 235, 191, - 196, 191, 191, 144, 148, 127, 118, 249, 118, 249, - 118, 249, 250, 94, 95, 96, 250, 152, 219, 147, - 10, 128, 10, 10, 10, 128, 211, 195, 211, 47, - 59, 64, 98, 102, 105, 134, 137, 138, 139, 142, - 144, 149, 242, 244, 127, 211, 211, 211, 144, 211, - 211, 211, 211, 243, 146, 146, 14, 202, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 146, - 241, 243, 178, 146, 144, 178, 177, 191, 148, 146, - 237, 147, 147, 146, 147, 126, 243, 193, 148, 165, - 190, 206, 146, 147, 146, 146, 146, 191, 249, 249, - 249, 249, 249, 249, 147, 127, 146, 127, 146, 146, - 127, 146, 144, 135, 135, 135, 144, 135, 242, 242, - 242, 242, 242, 211, 241, 242, 15, 16, 17, 18, - 19, 20, 21, 22, 32, 131, 132, 133, 134, 137, - 138, 139, 140, 141, 143, 144, 145, 168, 146, 136, - 136, 240, 136, 146, 136, 146, 146, 243, 129, 146, - 148, 144, 174, 191, 146, 178, 147, 199, 146, 126, - 178, 178, 178, 146, 10, 128, 10, 128, 128, 10, - 128, 211, 211, 211, 211, 211, 211, 146, 146, 242, - 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, - 242, 242, 242, 242, 242, 242, 242, 242, 146, 241, - 243, 144, 144, 146, 144, 144, 243, 175, 191, 146, - 178, 147, 178, 235, 190, 190, 190, 178, 146, 127, - 127, 146, 146, 136, 136, 136, 146, 136, 242, 129, - 146, 148, 241, 241, 241, 241, 191, 146, 178, 147, - 128, 10, 10, 128, 144, 144, 144, 144, 242, 146, - 146, 146, 146, 146, 178, 146, 146, 241, 241, 241, - 241, 178, 190, 128, 128, 146, 146, 146, 146, 190 + 0, 141, 142, 143, 169, 170, 274, 3, 4, 5, + 6, 8, 9, 10, 11, 48, 52, 54, 55, 56, + 60, 64, 65, 73, 74, 75, 79, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 106, 108, 110, 115, 117, 118, + 119, 122, 127, 130, 134, 139, 152, 155, 156, 157, + 160, 162, 163, 167, 264, 265, 273, 11, 12, 49, + 52, 54, 55, 56, 57, 58, 61, 64, 68, 75, + 82, 98, 117, 118, 123, 131, 132, 133, 134, 137, + 139, 227, 228, 232, 233, 235, 241, 242, 246, 247, + 252, 253, 254, 255, 0, 50, 51, 58, 59, 67, + 69, 70, 71, 72, 76, 81, 100, 101, 102, 103, + 104, 105, 111, 112, 113, 114, 120, 121, 124, 125, + 129, 135, 136, 138, 146, 163, 173, 175, 176, 178, + 181, 199, 248, 251, 274, 162, 162, 162, 162, 162, + 162, 153, 162, 153, 162, 162, 162, 162, 162, 162, + 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, + 162, 162, 162, 11, 49, 61, 131, 132, 230, 246, + 247, 252, 153, 162, 162, 15, 162, 153, 162, 162, + 162, 264, 264, 264, 264, 264, 11, 52, 54, 55, + 56, 64, 75, 82, 98, 117, 118, 134, 139, 232, + 262, 264, 10, 11, 12, 74, 75, 110, 111, 113, + 118, 120, 148, 152, 268, 269, 271, 274, 264, 16, + 17, 18, 19, 20, 21, 22, 23, 33, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 161, + 162, 163, 6, 8, 227, 228, 162, 57, 123, 64, + 98, 253, 253, 253, 271, 162, 253, 13, 15, 17, + 58, 138, 152, 157, 162, 225, 226, 274, 226, 144, + 10, 11, 12, 110, 147, 272, 10, 11, 12, 110, + 144, 271, 272, 81, 178, 178, 178, 178, 6, 178, + 178, 147, 177, 105, 178, 162, 162, 162, 162, 178, + 144, 271, 147, 147, 147, 178, 178, 162, 178, 181, + 200, 178, 178, 184, 105, 271, 178, 178, 163, 10, + 11, 49, 61, 109, 131, 132, 144, 160, 187, 190, + 229, 231, 233, 235, 241, 246, 247, 252, 261, 262, + 274, 232, 261, 261, 261, 261, 232, 261, 232, 261, + 232, 261, 232, 232, 232, 232, 232, 232, 232, 232, + 232, 232, 232, 232, 232, 232, 232, 261, 162, 271, + 162, 162, 271, 271, 232, 261, 261, 162, 232, 232, + 232, 264, 261, 261, 164, 145, 164, 271, 166, 145, + 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + 264, 164, 262, 264, 226, 226, 264, 232, 157, 271, + 13, 15, 17, 58, 138, 152, 157, 225, 274, 225, + 226, 225, 226, 225, 225, 15, 17, 58, 114, 152, + 157, 210, 211, 220, 227, 228, 274, 163, 244, 245, + 274, 11, 243, 253, 147, 234, 236, 178, 175, 144, + 271, 271, 271, 271, 271, 170, 144, 264, 153, 10, + 11, 190, 229, 231, 271, 146, 148, 179, 180, 271, + 162, 162, 162, 58, 227, 271, 162, 174, 271, 144, + 146, 147, 148, 216, 144, 146, 148, 217, 146, 182, + 271, 272, 271, 164, 164, 164, 164, 164, 164, 154, + 164, 154, 164, 164, 164, 164, 145, 164, 145, 164, + 145, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 264, 232, 261, 154, 164, 164, 271, 164, + 154, 164, 164, 164, 164, 264, 264, 162, 196, 274, + 268, 147, 164, 166, 164, 164, 225, 157, 271, 225, + 225, 225, 225, 225, 163, 225, 114, 227, 228, 220, + 225, 225, 164, 15, 145, 13, 17, 58, 138, 152, + 157, 162, 223, 272, 274, 13, 15, 17, 58, 138, + 152, 157, 162, 224, 260, 264, 274, 271, 165, 243, + 170, 74, 237, 274, 170, 144, 145, 145, 145, 145, + 165, 249, 145, 164, 10, 11, 12, 57, 58, 131, + 201, 202, 203, 204, 205, 252, 274, 162, 217, 185, + 146, 232, 166, 145, 162, 188, 13, 157, 189, 264, + 227, 13, 17, 58, 138, 152, 157, 222, 272, 274, + 232, 170, 162, 256, 257, 171, 172, 271, 62, 63, + 256, 62, 63, 144, 264, 13, 17, 58, 109, 138, + 152, 157, 162, 183, 206, 208, 272, 147, 162, 162, + 232, 232, 232, 164, 164, 164, 162, 164, 162, 210, + 17, 33, 58, 74, 104, 107, 110, 126, 138, 152, + 209, 274, 264, 225, 260, 164, 227, 228, 223, 224, + 164, 164, 196, 15, 220, 157, 223, 223, 223, 223, + 223, 223, 148, 163, 215, 274, 157, 271, 224, 224, + 224, 224, 224, 224, 163, 215, 166, 145, 148, 165, + 147, 238, 239, 274, 165, 250, 10, 10, 10, 10, + 170, 273, 146, 205, 154, 145, 15, 271, 13, 17, + 58, 138, 152, 157, 162, 223, 224, 186, 208, 146, + 166, 179, 3, 4, 5, 9, 10, 15, 48, 60, + 65, 73, 74, 106, 108, 110, 115, 119, 122, 127, + 130, 152, 155, 156, 160, 162, 167, 212, 213, 220, + 221, 266, 267, 273, 274, 210, 157, 206, 210, 164, + 222, 157, 222, 222, 222, 222, 222, 162, 163, 164, + 165, 191, 165, 258, 274, 144, 145, 144, 162, 146, + 146, 165, 146, 146, 144, 218, 219, 264, 274, 146, + 157, 206, 206, 6, 16, 17, 18, 19, 20, 21, + 22, 23, 33, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 63, 106, 145, 148, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 162, 163, 167, 197, 206, 206, 206, 206, 147, 162, + 163, 209, 148, 215, 217, 243, 262, 262, 164, 164, + 164, 262, 262, 164, 58, 230, 162, 144, 166, 162, + 223, 224, 215, 215, 162, 162, 209, 223, 164, 264, + 260, 224, 164, 260, 264, 111, 112, 113, 131, 136, + 240, 247, 270, 271, 144, 145, 170, 145, 164, 145, + 145, 145, 165, 164, 223, 224, 181, 198, 199, 204, + 271, 148, 157, 148, 214, 274, 215, 217, 178, 162, + 153, 153, 230, 153, 15, 162, 153, 162, 264, 264, + 264, 264, 232, 262, 264, 164, 15, 145, 16, 17, + 18, 19, 20, 21, 22, 23, 33, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 161, 162, + 163, 164, 206, 164, 164, 162, 222, 194, 260, 210, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 68, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 80, 81, 82, 98, 104, 105, + 106, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 166, 167, 259, 256, 172, + 261, 261, 218, 165, 145, 206, 10, 164, 166, 164, + 4, 207, 260, 264, 145, 164, 164, 164, 164, 196, + 230, 226, 164, 271, 256, 210, 215, 215, 210, 210, + 162, 166, 162, 166, 145, 136, 270, 136, 270, 136, + 270, 271, 111, 112, 113, 271, 15, 170, 240, 165, + 10, 146, 10, 10, 10, 146, 214, 232, 48, 60, + 65, 115, 119, 122, 152, 155, 156, 157, 160, 162, + 167, 263, 265, 145, 232, 232, 232, 162, 232, 162, + 232, 232, 232, 264, 164, 164, 15, 221, 264, 264, + 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + 264, 264, 264, 264, 264, 264, 264, 264, 264, 164, + 262, 264, 196, 164, 162, 196, 195, 210, 166, 164, + 258, 165, 165, 164, 165, 144, 264, 212, 166, 183, + 209, 226, 15, 164, 165, 164, 164, 164, 210, 210, + 270, 270, 270, 270, 270, 270, 165, 145, 164, 145, + 164, 164, 145, 164, 162, 153, 153, 153, 15, 162, + 153, 263, 263, 263, 263, 263, 232, 262, 263, 16, + 17, 18, 19, 20, 21, 22, 23, 33, 149, 150, + 151, 152, 155, 156, 157, 158, 159, 161, 162, 163, + 186, 164, 154, 154, 261, 154, 271, 164, 154, 164, + 164, 264, 147, 164, 166, 162, 192, 210, 164, 196, + 165, 15, 218, 164, 144, 164, 196, 196, 196, 164, + 164, 10, 146, 10, 146, 146, 10, 146, 232, 232, + 232, 232, 162, 232, 232, 164, 164, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 164, 262, 264, 162, + 162, 164, 162, 164, 162, 264, 193, 210, 164, 196, + 165, 196, 256, 209, 209, 209, 196, 196, 164, 145, + 145, 164, 164, 154, 154, 154, 271, 164, 154, 263, + 147, 164, 166, 262, 262, 262, 262, 210, 164, 196, + 165, 146, 10, 10, 146, 162, 162, 162, 164, 162, + 263, 164, 164, 164, 164, 164, 196, 164, 164, 262, + 262, 262, 262, 196, 209, 146, 146, 164, 164, 164, + 164, 209 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = +static const yytype_uint16 yyr1[] = { - 0, 150, 151, 151, 151, 152, 152, 152, 153, 153, - 154, 154, 156, 155, 157, 157, 157, 157, 157, 157, - 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, - 157, 157, 157, 157, 157, 157, 157, 159, 158, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 161, 161, 162, 162, 164, - 163, 163, 163, 163, 163, 165, 165, 167, 166, 166, - 168, 168, 170, 169, 171, 169, 173, 172, 174, 172, - 175, 172, 176, 172, 177, 172, 172, 178, 178, 178, - 178, 178, 178, 178, 178, 179, 179, 179, 179, 179, - 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, - 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, - 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, - 179, 179, 179, 179, 180, 180, 182, 181, 181, 183, - 183, 184, 184, 185, 185, 185, 185, 185, 185, 186, - 186, 186, 187, 187, 187, 187, 187, 187, 187, 187, - 187, 187, 187, 188, 187, 189, 189, 190, 190, 190, - 191, 191, 191, 191, 191, 192, 192, 193, 193, 193, - 193, 193, 194, 194, 195, 195, 196, 196, 197, 197, - 197, 197, 197, 198, 198, 198, 198, 198, 198, 199, - 199, 199, 200, 200, 200, 200, 201, 201, 201, 201, - 202, 202, 203, 203, 203, 203, 203, 203, 203, 203, - 203, 204, 204, 204, 204, 204, 204, 204, 204, 204, - 204, 204, 205, 205, 205, 205, 205, 205, 205, 205, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 208, 208, 208, 208, 208, 208, 208, 208, - 208, 208, 208, 209, 209, 209, 209, 209, 209, 209, - 210, 210, 211, 211, 213, 212, 215, 214, 216, 216, - 217, 217, 218, 218, 219, 219, 219, 219, 219, 219, - 219, 219, 219, 219, 220, 221, 221, 221, 221, 222, - 222, 223, 223, 223, 224, 224, 224, 225, 225, 225, - 226, 226, 226, 228, 227, 229, 227, 227, 227, 230, - 230, 230, 231, 231, 231, 232, 232, 232, 232, 232, - 232, 232, 232, 232, 232, 232, 232, 232, 232, 233, - 233, 233, 234, 236, 235, 237, 237, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 239, 239, 240, 240, 241, 241, 242, 242, 242, - 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, - 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, - 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, - 242, 242, 242, 242, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, - 244, 244, 244, 245, 245, 245, 245, 245, 245, 245, - 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, - 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, - 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, - 245, 245, 245, 245, 245, 246, 246, 246, 246, 246, - 246, 246, 246, 246, 246, 246, 247, 247, 247, 248, - 248, 248, 248, 249, 249, 249, 250, 250, 250, 250, - 250, 250, 250, 250, 250, 251, 251, 251, 252, 252, - 252, 252, 253 + 0, 168, 169, 169, 169, 170, 170, 170, 171, 171, + 172, 172, 172, 174, 173, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 177, 176, + 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, + 178, 178, 178, 178, 178, 178, 179, 179, 180, 180, + 182, 181, 181, 181, 181, 181, 183, 183, 185, 184, + 184, 186, 186, 188, 187, 189, 187, 191, 190, 192, + 190, 193, 190, 194, 190, 195, 190, 190, 196, 196, + 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, + 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, + 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, + 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, + 197, 197, 197, 197, 197, 197, 197, 197, 197, 198, + 198, 200, 199, 199, 201, 201, 202, 202, 203, 203, + 204, 204, 204, 204, 204, 204, 204, 204, 204, 205, + 205, 205, 205, 206, 206, 206, 206, 206, 206, 206, + 206, 206, 206, 206, 207, 206, 208, 208, 209, 209, + 209, 210, 210, 210, 210, 210, 211, 211, 212, 212, + 212, 212, 212, 213, 213, 214, 214, 215, 215, 216, + 216, 216, 216, 216, 217, 217, 217, 217, 217, 217, + 218, 218, 218, 219, 219, 219, 219, 220, 220, 220, + 220, 220, 220, 220, 221, 221, 222, 222, 222, 222, + 222, 222, 222, 222, 222, 223, 223, 223, 223, 223, + 223, 223, 223, 223, 223, 223, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 225, 225, 225, + 225, 225, 225, 225, 225, 225, 225, 226, 226, 226, + 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, + 226, 227, 227, 227, 227, 227, 227, 227, 227, 227, + 227, 227, 228, 229, 229, 229, 229, 229, 229, 229, + 229, 229, 229, 229, 229, 230, 230, 230, 230, 230, + 230, 230, 230, 231, 231, 232, 232, 232, 232, 234, + 233, 236, 235, 237, 237, 238, 238, 239, 239, 240, + 240, 240, 240, 240, 240, 240, 240, 240, 240, 241, + 242, 242, 242, 242, 243, 243, 244, 244, 244, 245, + 245, 245, 246, 246, 246, 247, 247, 247, 249, 248, + 250, 248, 248, 248, 251, 251, 251, 252, 252, 252, + 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, + 253, 253, 253, 253, 254, 254, 254, 255, 257, 256, + 258, 258, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 260, + 260, 261, 261, 262, 262, 263, 263, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 263, 263, 264, 264, 264, 264, 264, 264, 264, + 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, + 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, + 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, + 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, + 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, + 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, + 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, + 266, 266, 266, 267, 267, 267, 267, 267, 267, 267, + 267, 267, 267, 267, 268, 268, 268, 269, 269, 269, + 269, 270, 270, 270, 270, 271, 271, 271, 271, 271, + 271, 271, 271, 271, 271, 272, 272, 272, 272, 273, + 273, 273, 273, 274 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 2, 2, 2, 1, 2, 2, 1, 3, - 4, 4, 0, 5, 1, 1, 1, 1, 1, 2, - 1, 1, 2, 2, 2, 2, 7, 9, 11, 9, - 11, 13, 9, 13, 9, 7, 5, 0, 3, 1, - 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 6, 1, 3, 1, 4, 0, - 4, 3, 3, 3, 1, 2, 4, 0, 4, 3, - 2, 4, 0, 6, 0, 6, 0, 7, 0, 11, - 0, 12, 0, 8, 0, 9, 1, 1, 1, 2, - 2, 2, 2, 4, 5, 1, 1, 1, 1, 1, + 4, 5, 4, 0, 5, 1, 1, 1, 1, 1, + 2, 1, 1, 2, 2, 2, 2, 7, 9, 11, + 9, 11, 13, 9, 13, 9, 7, 5, 0, 3, + 1, 2, 2, 3, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 6, 1, 3, 1, 4, + 0, 4, 3, 3, 3, 1, 2, 4, 0, 4, + 3, 2, 4, 0, 6, 0, 6, 0, 7, 0, + 11, 0, 12, 0, 8, 0, 9, 1, 1, 2, + 2, 2, 2, 2, 2, 2, 2, 4, 5, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 1, 1, 1, 1, 0, 6, 2, 1, - 1, 1, 3, 2, 4, 2, 4, 3, 4, 1, - 1, 1, 1, 2, 3, 2, 2, 2, 2, 2, - 3, 4, 3, 0, 6, 2, 3, 1, 3, 4, - 1, 1, 1, 3, 2, 1, 3, 1, 1, 1, - 3, 2, 1, 3, 1, 2, 1, 2, 1, 3, - 5, 3, 3, 1, 3, 3, 3, 3, 4, 1, - 1, 2, 1, 3, 3, 5, 3, 4, 5, 2, - 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, - 4, 1, 1, 2, 2, 2, 2, 2, 3, 4, - 7, 3, 1, 2, 2, 2, 2, 2, 3, 4, - 1, 2, 2, 2, 2, 2, 3, 4, 5, 9, - 9, 9, 1, 1, 2, 1, 1, 1, 2, 4, - 4, 1, 1, 1, 2, 1, 1, 1, 2, 4, - 2, 4, 1, 1, 1, 2, 2, 2, 4, 1, - 1, 1, 2, 3, 0, 5, 0, 8, 1, 1, - 1, 1, 2, 3, 1, 2, 2, 2, 3, 3, - 3, 3, 3, 3, 4, 3, 1, 4, 2, 1, - 1, 1, 3, 5, 1, 2, 4, 1, 2, 2, - 1, 1, 1, 0, 6, 0, 7, 4, 5, 3, - 5, 4, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, - 1, 2, 1, 0, 2, 1, 2, 1, 1, 1, + 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, + 1, 0, 6, 2, 1, 1, 1, 3, 1, 1, + 1, 2, 4, 2, 3, 3, 4, 2, 3, 1, + 1, 1, 1, 1, 2, 3, 2, 2, 2, 2, + 2, 3, 4, 3, 0, 6, 2, 3, 1, 3, + 4, 1, 1, 1, 3, 2, 1, 3, 1, 1, + 1, 3, 2, 1, 3, 1, 2, 1, 2, 1, + 3, 5, 3, 3, 1, 3, 3, 3, 3, 4, + 1, 1, 2, 1, 3, 3, 5, 3, 4, 5, + 3, 4, 5, 2, 1, 1, 1, 1, 2, 2, + 2, 2, 2, 3, 4, 1, 1, 2, 2, 2, + 2, 2, 3, 4, 7, 3, 1, 2, 2, 2, + 2, 2, 2, 3, 4, 7, 3, 1, 1, 2, + 2, 2, 2, 2, 2, 3, 4, 1, 1, 2, + 2, 2, 2, 2, 2, 3, 4, 5, 9, 9, + 9, 1, 1, 2, 1, 1, 1, 2, 4, 4, + 4, 1, 1, 1, 1, 2, 1, 1, 1, 2, + 4, 2, 4, 4, 1, 1, 1, 2, 2, 2, + 4, 4, 1, 1, 1, 2, 3, 2, 3, 0, + 5, 0, 8, 1, 1, 1, 1, 2, 3, 1, + 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, + 3, 1, 4, 2, 1, 1, 1, 3, 5, 1, + 2, 4, 1, 2, 2, 1, 1, 1, 0, 6, + 0, 7, 4, 5, 3, 5, 4, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 2, 2, 2, 1, 1, 2, 1, 0, 2, + 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -2746,27 +2991,29 @@ static const yytype_uint8 yyr2[] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 3, 1, 1, 1, 1, 1, 3, 1, 4, 7, - 7, 7, 7, 4, 4, 2, 2, 2, 2, 2, - 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 5, 4, 4, - 3, 3, 3, 3, 1, 4, 7, 7, 7, 7, + 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, + 1, 1, 1, 1, 3, 1, 4, 7, 7, 7, + 7, 4, 5, 4, 2, 2, 2, 2, 2, 2, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 5, 4, 4, 3, + 3, 3, 3, 1, 4, 7, 7, 7, 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 2, 5, 4, 4, 2, + 4, 4, 4, 5, 4, 2, 5, 4, 4, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 4, 4, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 8, 11, 1, 4, 7, 7, 7, 7, 4, - 4, 2, 5, 4, 4, 2, 2, 2, 2, 2, + 1, 8, 11, 4, 4, 6, 4, 4, 6, 6, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 1, 4, 7, 7, 7, 7, 4, 5, 4, 2, + 5, 4, 4, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 5, 4, - 4, 3, 3, 3, 3, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, - 1, 2, 1, 1, 2, 2, 1, 1, 1, 1, + 3, 3, 3, 3, 3, 3, 5, 4, 4, 3, + 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 3, 1, 1, 2, + 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 0 + 1, 2, 2, 0 }; @@ -3542,56 +3789,64 @@ yyreduce: switch (yyn) { case 3: -#line 426 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 444 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_expr = (yyvsp[0].u.expr); } -#line 3550 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3797 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 4: -#line 430 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 448 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_type = (yyvsp[0].u.type); } -#line 3558 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3805 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 10: -#line 448 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 466 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { delete (yyvsp[-1].u.expr); } -#line 3566 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3813 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 11: -#line 452 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 470 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - delete (yyvsp[-1].u.expr); + delete (yyvsp[-2].u.expr); } -#line 3574 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3821 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 12: -#line 464 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 474 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + delete (yyvsp[-1].u.expr); +} +#line 3829 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 13: +#line 486 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { push_storage_class((current_storage_class & ~CPPInstance::SC_c_binding) | ((yyvsp[-1].u.integer) & CPPInstance::SC_c_binding)); } -#line 3583 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3838 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 13: -#line 469 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 14: +#line 491 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { pop_storage_class(); } -#line 3591 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3846 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 20: -#line 482 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 21: +#line 504 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { if (publish_nest_level != 0) { yyerror("Unclosed __begin_publish", publish_loc); @@ -3604,11 +3859,11 @@ yyreduce: publish_nest_level++; current_scope->set_current_vis(V_published); } -#line 3608 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3863 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 21: -#line 495 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 22: +#line 517 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { if (publish_nest_level != 1) { yyerror("Unmatched __end_publish", (yylsp[0])); @@ -3617,19 +3872,19 @@ yyreduce: } publish_nest_level = 0; } -#line 3621 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 22: -#line 504 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - current_scope->set_current_vis(V_published); -} -#line 3629 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3876 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 23: -#line 508 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 526 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + current_scope->set_current_vis(V_published); +} +#line 3884 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 24: +#line 530 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { if (publish_nest_level > 0) { current_scope->set_current_vis(V_published); @@ -3637,27 +3892,27 @@ yyreduce: current_scope->set_current_vis(V_public); } } -#line 3641 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 24: -#line 516 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - current_scope->set_current_vis(V_protected); -} -#line 3649 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3896 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 25: -#line 520 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 538 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - current_scope->set_current_vis(V_private); + current_scope->set_current_vis(V_protected); } -#line 3657 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3904 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 26: -#line 524 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 542 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + current_scope->set_current_vis(V_private); +} +#line 3912 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 27: +#line 546 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPDeclaration *getter = (yyvsp[-2].u.identifier)->find_symbol(current_scope, global_scope, current_lexer); @@ -3668,11 +3923,11 @@ yyreduce: CPPMakeProperty *make_property = new CPPMakeProperty((yyvsp[-4].u.identifier), getter->as_function_group(), NULL, current_scope, (yylsp[-6]).file); current_scope->add_declaration(make_property, global_scope, current_lexer, (yylsp[-6])); } -#line 3672 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3927 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 27: -#line 535 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 28: +#line 557 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPDeclaration *getter = (yyvsp[-4].u.identifier)->find_symbol(current_scope, global_scope, current_lexer); if (getter == (CPPDeclaration *)NULL || getter->get_subtype() != CPPDeclaration::ST_function_group) { @@ -3693,11 +3948,11 @@ yyreduce: current_scope->add_declaration(make_property, global_scope, current_lexer, (yylsp[-8])); } } -#line 3697 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3952 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 28: -#line 556 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 29: +#line 578 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPDeclaration *getter = (yyvsp[-6].u.identifier)->find_symbol(current_scope, global_scope, current_lexer); if (getter == (CPPDeclaration *)NULL || getter->get_subtype() != CPPDeclaration::ST_function_group) { @@ -3727,11 +3982,11 @@ yyreduce: current_scope->add_declaration(make_property, global_scope, current_lexer, (yylsp[-10])); } } -#line 3731 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 3986 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 29: -#line 586 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 30: +#line 608 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPDeclaration *length_getter = (yyvsp[-4].u.identifier)->find_symbol(current_scope, global_scope, current_lexer); if (length_getter == (CPPDeclaration *)NULL || length_getter->get_subtype() != CPPDeclaration::ST_function_group) { @@ -3748,11 +4003,11 @@ yyreduce: make_property->_length_function = length_getter->as_function_group(); current_scope->add_declaration(make_property, global_scope, current_lexer, (yylsp[-8])); } -#line 3752 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4007 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 30: -#line 603 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 31: +#line 625 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPDeclaration *length_getter = (yyvsp[-6].u.identifier)->find_symbol(current_scope, global_scope, current_lexer); if (length_getter == (CPPDeclaration *)NULL || length_getter->get_subtype() != CPPDeclaration::ST_function_group) { @@ -3780,11 +4035,11 @@ yyreduce: current_scope->add_declaration(make_property, global_scope, current_lexer, (yylsp[-10])); } } -#line 3784 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4039 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 31: -#line 631 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 32: +#line 653 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPDeclaration *length_getter = (yyvsp[-8].u.identifier)->find_symbol(current_scope, global_scope, current_lexer); if (length_getter == (CPPDeclaration *)NULL || length_getter->get_subtype() != CPPDeclaration::ST_function_group) { @@ -3821,11 +4076,11 @@ yyreduce: current_scope->add_declaration(make_property, global_scope, current_lexer, (yylsp[-12])); } } -#line 3825 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4080 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 32: -#line 668 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 33: +#line 690 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPDeclaration *hasser = (yyvsp[-4].u.identifier)->find_symbol(current_scope, global_scope, current_lexer); if (hasser == (CPPDeclaration *)NULL || hasser->get_subtype() != CPPDeclaration::ST_function_group) { @@ -3847,11 +4102,11 @@ yyreduce: current_scope->add_declaration(make_property, global_scope, current_lexer, (yylsp[-8])); } } -#line 3851 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4106 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 33: -#line 690 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 34: +#line 712 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPDeclaration *hasser = (yyvsp[-8].u.identifier)->find_symbol(current_scope, global_scope, current_lexer); if (hasser == (CPPDeclaration *)NULL || hasser->get_subtype() != CPPDeclaration::ST_function_group) { @@ -3884,11 +4139,11 @@ yyreduce: current_scope->add_declaration(make_property, global_scope, current_lexer, (yylsp[-12])); } } -#line 3888 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4143 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 34: -#line 723 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 35: +#line 745 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPDeclaration *length_getter = (yyvsp[-4].u.identifier)->find_symbol(current_scope, global_scope, current_lexer); if (length_getter == (CPPDeclaration *)NULL || length_getter->get_subtype() != CPPDeclaration::ST_function_group) { @@ -3910,11 +4165,11 @@ yyreduce: current_scope->add_declaration(make_seq, global_scope, current_lexer, (yylsp[-8])); } } -#line 3914 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4169 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 35: -#line 745 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 36: +#line 767 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPExpression::Result result = (yyvsp[-4].u.expr)->evaluate(); if (result._type == CPPExpression::RT_error) { @@ -3925,11 +4180,11 @@ yyreduce: yywarning("static_assert failed: " + str.str(), (yylsp[-4])); } } -#line 3929 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4184 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 36: -#line 756 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 37: +#line 778 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // This alternative version of static_assert was introduced in C++17. CPPExpression::Result result = (yyvsp[-2].u.expr)->evaluate(); @@ -3939,55 +4194,55 @@ yyreduce: yywarning("static_assert failed", (yylsp[-2])); } } -#line 3943 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4198 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 37: -#line 769 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 38: +#line 791 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPScope *new_scope = new CPPScope(current_scope, CPPNameComponent("temp"), V_public); push_scope(new_scope); } -#line 3953 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4208 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 38: -#line 775 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 39: +#line 797 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { delete current_scope; pop_scope(); } -#line 3962 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 39: -#line 784 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.integer) = 0; -} -#line 3970 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4217 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 40: -#line 788 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 806 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.integer) = 0; +} +#line 4225 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 41: +#line 810 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // This isn't really a storage class, but it helps with parsing. (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_const; } -#line 3979 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 41: -#line 793 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_extern; -} -#line 3987 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4234 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 42: -#line 797 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 815 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_extern; +} +#line 4242 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 43: +#line 819 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_extern; if ((yyvsp[-1].str) == "C") { @@ -3998,108 +4253,108 @@ yyreduce: yywarning("Ignoring unknown linkage type \"" + (yyvsp[-1].str) + "\"", (yylsp[-1])); } } -#line 4002 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 43: -#line 808 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_static; -} -#line 4010 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4257 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 44: -#line 812 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 830 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_inline; + (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_static; } -#line 4018 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4265 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 45: -#line 816 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 834 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_virtual; + (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_inline; } -#line 4026 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4273 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 46: -#line 820 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 838 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_explicit; + (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_virtual; } -#line 4034 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4281 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 47: -#line 824 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 842 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_register; + (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_explicit; } -#line 4042 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4289 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 48: -#line 828 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 846 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_volatile; + (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_register; } -#line 4050 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4297 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 49: -#line 832 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 850 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_mutable; + (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_volatile; } -#line 4058 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4305 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 50: -#line 836 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 854 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_constexpr; + (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_mutable; } -#line 4066 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4313 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 51: -#line 840 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 858 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_blocking; + (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_constexpr; } -#line 4074 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4321 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 52: -#line 844 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 862 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_extension; + (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_blocking; } -#line 4082 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4329 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 53: -#line 848 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 866 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_thread_local; + (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_extension; } -#line 4090 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4337 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 54: -#line 852 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 870 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.integer) = (yyvsp[0].u.integer) | (int)CPPInstance::SC_thread_local; +} +#line 4345 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 55: +#line 874 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // Ignore attribute specifiers for now. (yyval.u.integer) = (yyvsp[0].u.integer); } -#line 4099 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4354 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 59: -#line 870 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 60: +#line 892 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // We don't need to push/pop type, because we can't nest // type_like_declaration. @@ -4110,19 +4365,19 @@ yyreduce: } push_storage_class((yyvsp[-1].u.integer)); } -#line 4114 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 60: -#line 881 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - pop_storage_class(); -} -#line 4122 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4369 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 61: -#line 886 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 903 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + pop_storage_class(); +} +#line 4377 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 62: +#line 908 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // We don't really care about the storage class here. In fact, it's // not actually legal to define a class or struct using a particular @@ -4131,23 +4386,11 @@ yyreduce: current_scope->add_declaration((yyvsp[-1].u.decl), global_scope, current_lexer, (yylsp[-1])); } -#line 4135 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 62: -#line 895 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - if ((yyvsp[-1].u.instance) != (CPPInstance *)NULL) { - (yyvsp[-1].u.instance)->_storage_class |= (current_storage_class | (yyvsp[-2].u.integer)); - current_scope->add_declaration((yyvsp[-1].u.instance), global_scope, current_lexer, (yylsp[-1])); - (yyvsp[-1].u.instance)->set_initializer((yyvsp[0].u.expr)); - } -} -#line 4147 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4390 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 63: -#line 903 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 917 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { if ((yyvsp[-1].u.instance) != (CPPInstance *)NULL) { (yyvsp[-1].u.instance)->_storage_class |= (current_storage_class | (yyvsp[-2].u.integer)); @@ -4155,11 +4398,23 @@ yyreduce: (yyvsp[-1].u.instance)->set_initializer((yyvsp[0].u.expr)); } } -#line 4159 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4402 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 65: -#line 919 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 64: +#line 925 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + if ((yyvsp[-1].u.instance) != (CPPInstance *)NULL) { + (yyvsp[-1].u.instance)->_storage_class |= (current_storage_class | (yyvsp[-2].u.integer)); + current_scope->add_declaration((yyvsp[-1].u.instance), global_scope, current_lexer, (yylsp[-1])); + (yyvsp[-1].u.instance)->set_initializer((yyvsp[0].u.expr)); + } +} +#line 4414 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 66: +#line 941 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { if (current_storage_class & CPPInstance::SC_const) { (yyvsp[-1].u.inst_ident)->add_modifier(IIT_const); @@ -4170,11 +4425,11 @@ yyreduce: inst->set_initializer((yyvsp[0].u.expr)); current_scope->add_declaration(inst, global_scope, current_lexer, (yylsp[-1])); } -#line 4174 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4429 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 66: -#line 930 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 67: +#line 952 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { if (current_storage_class & CPPInstance::SC_const) { (yyvsp[-3].u.inst_ident)->add_modifier(IIT_const); @@ -4185,11 +4440,11 @@ yyreduce: inst->set_initializer((yyvsp[-2].u.expr)); current_scope->add_declaration(inst, global_scope, current_lexer, (yylsp[-3])); } -#line 4189 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4444 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 67: -#line 945 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 68: +#line 967 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // We don't need to push/pop type, because we can't nest // multiple_var_declarations. @@ -4200,19 +4455,19 @@ yyreduce: } push_storage_class((yyvsp[-1].u.integer)); } -#line 4204 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 68: -#line 956 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - pop_storage_class(); -} -#line 4212 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4459 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 69: -#line 960 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 978 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + pop_storage_class(); +} +#line 4467 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 70: +#line 982 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { if ((yyvsp[-1].u.instance) != (CPPDeclaration *)NULL) { CPPInstance *inst = (yyvsp[-1].u.instance)->as_instance(); @@ -4224,11 +4479,11 @@ yyreduce: } } } -#line 4228 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4483 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 70: -#line 975 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 71: +#line 997 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { if (current_storage_class & CPPInstance::SC_const) { (yyvsp[-1].u.inst_ident)->add_modifier(IIT_const); @@ -4237,11 +4492,11 @@ yyreduce: CPPTypedefType *typedef_type = new CPPTypedefType(target_type, (yyvsp[-1].u.inst_ident), current_scope, (yylsp[-1]).file); current_scope->add_declaration(CPPType::new_type(typedef_type), global_scope, current_lexer, (yylsp[-1])); } -#line 4241 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4496 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 71: -#line 984 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 72: +#line 1006 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { if (current_storage_class & CPPInstance::SC_const) { (yyvsp[-3].u.inst_ident)->add_modifier(IIT_const); @@ -4250,19 +4505,19 @@ yyreduce: CPPTypedefType *typedef_type = new CPPTypedefType(target_type, (yyvsp[-3].u.inst_ident), current_scope, (yylsp[-3]).file); current_scope->add_declaration(CPPType::new_type(typedef_type), global_scope, current_lexer, (yylsp[-3])); } -#line 4254 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 72: -#line 998 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - push_scope((yyvsp[-1].u.identifier)->get_scope(current_scope, global_scope)); -} -#line 4262 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4509 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 73: -#line 1002 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1020 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + push_scope((yyvsp[-1].u.identifier)->get_scope(current_scope, global_scope)); +} +#line 4517 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 74: +#line 1024 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type; if ((yyvsp[-5].u.identifier)->get_simple_name() == current_scope->get_simple_name() || @@ -4282,19 +4537,19 @@ yyreduce: (yyval.u.instance) = new CPPInstance(type, ii, 0, (yylsp[-5]).file); } -#line 4286 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 74: -#line 1022 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - push_scope((yyvsp[-1].u.identifier)->get_scope(current_scope, global_scope)); -} -#line 4294 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4541 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 75: -#line 1026 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1044 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + push_scope((yyvsp[-1].u.identifier)->get_scope(current_scope, global_scope)); +} +#line 4549 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 76: +#line 1048 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { pop_scope(); CPPType *type; @@ -4312,19 +4567,19 @@ yyreduce: (yyval.u.instance) = new CPPInstance(type, ii, 0, (yylsp[-5]).file); } -#line 4316 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 76: -#line 1049 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - push_scope((yyvsp[-1].u.identifier)->get_scope(current_scope, global_scope)); -} -#line 4324 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4571 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 77: -#line 1053 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1071 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + push_scope((yyvsp[-1].u.identifier)->get_scope(current_scope, global_scope)); +} +#line 4579 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 78: +#line 1075 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { pop_scope(); if ((yyvsp[-5].u.identifier)->is_scoped()) { @@ -4343,19 +4598,19 @@ yyreduce: (yyval.u.instance) = new CPPInstance(type, ii, 0, (yylsp[-5]).file); } } -#line 4347 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 78: -#line 1079 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - push_scope((yyvsp[-2].u.inst_ident)->get_scope(current_scope, global_scope)); -} -#line 4355 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4602 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 79: -#line 1083 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1101 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + push_scope((yyvsp[-2].u.inst_ident)->get_scope(current_scope, global_scope)); +} +#line 4610 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 80: +#line 1105 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { pop_scope(); CPPType *type = (yyvsp[-10].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); @@ -4369,19 +4624,19 @@ yyreduce: ii->add_func_modifier((yyvsp[-3].u.param_list), (yyvsp[-1].u.integer)); (yyval.u.instance) = new CPPInstance(type, ii, 0, (yylsp[-10]).file); } -#line 4373 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 80: -#line 1097 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - push_scope((yyvsp[-2].u.inst_ident)->get_scope(current_scope, global_scope)); -} -#line 4381 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4628 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 81: -#line 1101 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1119 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + push_scope((yyvsp[-2].u.inst_ident)->get_scope(current_scope, global_scope)); +} +#line 4636 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 82: +#line 1123 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { pop_scope(); CPPType *type = (yyvsp[-11].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); @@ -4395,21 +4650,21 @@ yyreduce: ii->add_func_modifier((yyvsp[-3].u.param_list), (yyvsp[-1].u.integer)); (yyval.u.instance) = new CPPInstance(type, ii, 0, (yylsp[-11]).file); } -#line 4399 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4654 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 82: -#line 1117 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 83: +#line 1139 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { if ((yyvsp[-3].u.identifier) != NULL) { push_scope((yyvsp[-3].u.identifier)->get_scope(current_scope, global_scope)); } } -#line 4409 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4664 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 83: -#line 1123 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 84: +#line 1145 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { if ((yyvsp[-7].u.identifier) != NULL) { pop_scope(); @@ -4434,21 +4689,21 @@ yyreduce: (yyval.u.instance) = CPPInstance::make_typecast_function (new CPPInstance((yyvsp[-6].u.type), (yyvsp[-5].u.inst_ident), 0, (yylsp[-5]).file), ident, (yyvsp[-2].u.param_list), (yyvsp[0].u.integer)); } -#line 4438 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4693 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 84: -#line 1148 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 85: +#line 1170 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { if ((yyvsp[-4].u.identifier) != NULL) { push_scope((yyvsp[-4].u.identifier)->get_scope(current_scope, global_scope)); } } -#line 4448 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4703 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 85: -#line 1154 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 86: +#line 1176 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { if ((yyvsp[-8].u.identifier) != NULL) { pop_scope(); @@ -4464,11 +4719,11 @@ yyreduce: (yyval.u.instance) = CPPInstance::make_typecast_function (new CPPInstance((yyvsp[-6].u.type), (yyvsp[-5].u.inst_ident), 0, (yylsp[-5]).file), ident, (yyvsp[-2].u.param_list), (yyvsp[0].u.integer)); } -#line 4468 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4723 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 86: -#line 1174 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 87: +#line 1196 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPDeclaration *decl = (yyvsp[0].u.identifier)->find_symbol(current_scope, global_scope, current_lexer); @@ -4478,494 +4733,557 @@ yyreduce: (yyval.u.instance) = (CPPInstance *)NULL; } } -#line 4482 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 87: -#line 1187 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.integer) = 0; -} -#line 4490 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4737 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 88: -#line 1191 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1209 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (int)CPPFunctionType::F_const_method; + (yyval.u.integer) = 0; } -#line 4498 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4745 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 89: -#line 1195 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1213 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (int)CPPFunctionType::F_noexcept; + (yyval.u.integer) = (yyvsp[-1].u.integer) | (int)CPPFunctionType::F_const_method; } -#line 4506 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4753 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 90: -#line 1199 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1217 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (int)CPPFunctionType::F_final; + (yyval.u.integer) = (yyvsp[-1].u.integer) | (int)CPPFunctionType::F_volatile_method; } -#line 4514 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4761 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 91: -#line 1203 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1221 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (int)CPPFunctionType::F_override; + (yyval.u.integer) = (yyvsp[-1].u.integer) | (int)CPPFunctionType::F_noexcept; } -#line 4522 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4769 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 92: -#line 1207 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1225 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - // Used for lambdas, currently ignored. - (yyval.u.integer) = 0; + (yyval.u.integer) = (yyvsp[-1].u.integer) | (int)CPPFunctionType::F_final; } -#line 4531 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4777 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 93: -#line 1212 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1229 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[-3].u.integer); + (yyval.u.integer) = (yyvsp[-1].u.integer) | (int)CPPFunctionType::F_override; } -#line 4539 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4785 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 94: -#line 1216 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1233 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.integer) = (yyvsp[-4].u.integer); + (yyval.u.integer) = (yyvsp[-1].u.integer) | (int)CPPFunctionType::F_lvalue_method; } -#line 4547 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4793 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 95: -#line 1227 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1237 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "!"; + (yyval.u.integer) = (yyvsp[-1].u.integer) | (int)CPPFunctionType::F_rvalue_method; } -#line 4555 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4801 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 96: -#line 1231 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1241 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "~"; + // Used for lambdas, currently ignored. + (yyval.u.integer) = (yyvsp[-1].u.integer); } -#line 4563 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4810 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 97: -#line 1235 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1246 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "*"; + (yyval.u.integer) = (yyvsp[-3].u.integer); } -#line 4571 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4818 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 98: -#line 1239 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1250 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "/"; + (yyval.u.integer) = (yyvsp[-4].u.integer); } -#line 4579 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4826 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 99: -#line 1243 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1254 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "%"; + (yyval.u.integer) = (yyvsp[-5].u.integer); } -#line 4587 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4834 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 100: -#line 1247 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1265 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "+"; + (yyval.str) = "!"; } -#line 4595 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4842 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 101: -#line 1251 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1269 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "-"; + (yyval.str) = "~"; } -#line 4603 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4850 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 102: -#line 1255 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1273 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "|"; + (yyval.str) = "*"; } -#line 4611 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4858 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 103: -#line 1259 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1277 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "&"; + (yyval.str) = "/"; } -#line 4619 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4866 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 104: -#line 1263 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1281 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "^"; + (yyval.str) = "%"; } -#line 4627 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4874 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 105: -#line 1267 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1285 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "||"; + (yyval.str) = "+"; } -#line 4635 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4882 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 106: -#line 1271 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1289 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "&&"; + (yyval.str) = "-"; } -#line 4643 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4890 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 107: -#line 1275 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1293 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "=="; + (yyval.str) = "|"; } -#line 4651 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4898 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 108: -#line 1279 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1297 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "!="; + (yyval.str) = "&"; } -#line 4659 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4906 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 109: -#line 1283 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1301 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "<="; + (yyval.str) = "^"; } -#line 4667 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4914 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 110: -#line 1287 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1305 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = ">="; + (yyval.str) = "||"; } -#line 4675 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4922 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 111: -#line 1291 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1309 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "<"; + (yyval.str) = "&&"; } -#line 4683 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4930 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 112: -#line 1295 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1313 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = ">"; + (yyval.str) = "=="; } -#line 4691 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4938 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 113: -#line 1299 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1317 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "<<"; + (yyval.str) = "!="; } -#line 4699 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4946 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 114: -#line 1303 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1321 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = ">>"; + (yyval.str) = "<="; } -#line 4707 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4954 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 115: -#line 1307 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1325 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "="; + (yyval.str) = ">="; } -#line 4715 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4962 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 116: -#line 1311 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1329 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = ","; + (yyval.str) = "<"; } -#line 4723 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4970 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 117: -#line 1315 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1333 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "++"; + (yyval.str) = ">"; } -#line 4731 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4978 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 118: -#line 1319 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1337 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "--"; + (yyval.str) = "<<"; } -#line 4739 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4986 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 119: -#line 1323 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1341 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "*="; + (yyval.str) = ">>"; } -#line 4747 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 4994 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 120: -#line 1327 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1345 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "/="; + (yyval.str) = "="; } -#line 4755 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5002 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 121: -#line 1331 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1349 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "%="; + (yyval.str) = ","; } -#line 4763 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5010 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 122: -#line 1335 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1353 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "+="; + (yyval.str) = "++"; } -#line 4771 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5018 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 123: -#line 1339 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1357 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "-="; + (yyval.str) = "--"; } -#line 4779 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5026 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 124: -#line 1343 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1361 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "|="; + (yyval.str) = "*="; } -#line 4787 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5034 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 125: -#line 1347 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1365 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "&="; + (yyval.str) = "/="; } -#line 4795 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5042 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 126: -#line 1351 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1369 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "^="; + (yyval.str) = "%="; } -#line 4803 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5050 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 127: -#line 1355 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1373 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "<<="; + (yyval.str) = "+="; } -#line 4811 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5058 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 128: -#line 1359 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1377 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = ">>="; + (yyval.str) = "-="; } -#line 4819 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5066 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 129: -#line 1363 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1381 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "->"; + (yyval.str) = "|="; } -#line 4827 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5074 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 130: -#line 1367 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1385 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "[]"; + (yyval.str) = "&="; } -#line 4835 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5082 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 131: -#line 1371 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1389 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "()"; + (yyval.str) = "^="; } -#line 4843 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5090 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 132: -#line 1375 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1393 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "new"; + (yyval.str) = "<<="; } -#line 4851 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5098 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 133: -#line 1379 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1397 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.str) = "delete"; + (yyval.str) = ">>="; } -#line 4859 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5106 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 134: +#line 1401 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.str) = "->"; +} +#line 5114 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 135: +#line 1405 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.str) = "[]"; +} +#line 5122 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 136: -#line 1391 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1409 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - push_scope(new CPPTemplateScope(current_scope)); + (yyval.str) = "()"; } -#line 4867 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5130 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 137: -#line 1395 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1413 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - pop_scope(); + (yyval.str) = "new"; } -#line 4875 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5138 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 138: +#line 1417 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.str) = "delete"; +} +#line 5146 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 141: -#line 1408 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1429 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - CPPTemplateScope *ts = current_scope->as_template_scope(); - assert(ts != NULL); - ts->add_template_parameter((yyvsp[0].u.decl)); + push_scope(new CPPTemplateScope(current_scope)); } -#line 4885 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5154 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 142: -#line 1414 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1433 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + pop_scope(); +} +#line 5162 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 146: +#line 1446 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPTemplateScope *ts = current_scope->as_template_scope(); assert(ts != NULL); ts->add_template_parameter((yyvsp[0].u.decl)); } -#line 4895 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 143: -#line 1423 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.decl) = CPPType::new_type(new CPPClassTemplateParameter((yyvsp[0].u.identifier))); -} -#line 4903 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 144: -#line 1427 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.decl) = CPPType::new_type(new CPPClassTemplateParameter((yyvsp[-2].u.identifier), (yyvsp[0].u.type))); -} -#line 4911 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 145: -#line 1431 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.decl) = CPPType::new_type(new CPPClassTemplateParameter((yyvsp[0].u.identifier))); -} -#line 4919 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 146: -#line 1435 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.decl) = CPPType::new_type(new CPPClassTemplateParameter((yyvsp[-2].u.identifier), (yyvsp[0].u.type))); -} -#line 4927 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5172 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 147: -#line 1439 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1452 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + CPPTemplateScope *ts = current_scope->as_template_scope(); + assert(ts != NULL); + ts->add_template_parameter((yyvsp[0].u.decl)); +} +#line 5182 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 150: +#line 1466 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.decl) = CPPType::new_type(new CPPClassTemplateParameter((CPPIdentifier *)NULL)); +} +#line 5190 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 151: +#line 1470 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.decl) = CPPType::new_type(new CPPClassTemplateParameter((yyvsp[0].u.identifier))); +} +#line 5198 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 152: +#line 1474 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.decl) = CPPType::new_type(new CPPClassTemplateParameter((yyvsp[-2].u.identifier), (yyvsp[0].u.type))); +} +#line 5206 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 153: +#line 1478 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + CPPClassTemplateParameter *ctp = new CPPClassTemplateParameter((CPPIdentifier *)NULL); + ctp->_packed = true; + (yyval.u.decl) = CPPType::new_type(ctp); +} +#line 5216 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 154: +#line 1484 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + CPPClassTemplateParameter *ctp = new CPPClassTemplateParameter((yyvsp[0].u.identifier)); + ctp->_packed = true; + (yyval.u.decl) = CPPType::new_type(ctp); +} +#line 5226 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 155: +#line 1490 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPInstance *inst = new CPPInstance((yyvsp[-2].u.type), (yyvsp[-1].u.inst_ident), 0, (yylsp[-1]).file); inst->set_initializer((yyvsp[0].u.expr)); (yyval.u.decl) = inst; } -#line 4937 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5236 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 148: -#line 1445 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 156: +#line 1496 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyvsp[-1].u.inst_ident)->add_modifier(IIT_const); CPPInstance *inst = new CPPInstance((yyvsp[-2].u.type), (yyvsp[-1].u.inst_ident), 0, (yylsp[-1]).file); inst->set_initializer((yyvsp[0].u.expr)); (yyval.u.decl) = inst; } -#line 4948 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5247 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 149: -#line 1455 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 157: +#line 1503 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + CPPInstance *inst = new CPPInstance((yyvsp[-1].u.type), (yyvsp[0].u.inst_ident), 0, (yylsp[0]).file); + (yyval.u.decl) = inst; +} +#line 5256 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 158: +#line 1508 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyvsp[0].u.inst_ident)->add_modifier(IIT_const); + CPPInstance *inst = new CPPInstance((yyvsp[-1].u.type), (yyvsp[0].u.inst_ident), 0, (yylsp[0]).file); + (yyval.u.decl) = inst; +} +#line 5266 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 159: +#line 1517 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = CPPType::new_type((yyvsp[0].u.simple_type)); } -#line 4956 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5274 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 150: -#line 1459 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 160: +#line 1521 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { yywarning("Not a type: " + (yyvsp[0].u.identifier)->get_fully_scoped_name(), (yylsp[0])); (yyval.u.type) = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_unknown)); } -#line 4965 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5283 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 151: -#line 1464 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 161: +#line 1526 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if ((yyval.u.type) == NULL) { @@ -4973,19 +5291,31 @@ yyreduce: } assert((yyval.u.type) != NULL); } -#line 4977 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5295 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 152: -#line 1476 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 162: +#line 1534 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.type) = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); + if ((yyval.u.type) == NULL) { + yyerror(string("internal error resolving type ") + (yyvsp[0].u.identifier)->get_fully_scoped_name(), (yylsp[0])); + } + assert((yyval.u.type) != NULL); +} +#line 5307 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 163: +#line 1546 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[0].u.identifier)); } -#line 4985 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5315 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 153: -#line 1480 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 164: +#line 1550 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // For an operator function. We implement this simply by building a // ficticious name for the function; in other respects it's just @@ -4999,11 +5329,11 @@ yyreduce: (yyval.u.inst_ident) = new CPPInstanceIdentifier(ident); } -#line 5003 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5333 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 154: -#line 1494 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 165: +#line 1564 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // A C++11 literal operator. if (!(yyvsp[-1].str).empty()) { @@ -5018,91 +5348,91 @@ yyreduce: (yyval.u.inst_ident) = new CPPInstanceIdentifier(ident); } -#line 5022 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5352 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 155: -#line 1509 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 166: +#line 1579 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_const); } -#line 5031 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5361 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 156: -#line 1514 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 167: +#line 1584 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_volatile); } -#line 5040 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5370 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 157: -#line 1519 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 168: +#line 1589 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_pointer); } -#line 5049 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5379 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 158: -#line 1524 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 169: +#line 1594 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_reference); } -#line 5058 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5388 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 159: -#line 1529 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 170: +#line 1599 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); } -#line 5067 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5397 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 160: -#line 1534 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 171: +#line 1604 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[-2].u.identifier)); } -#line 5076 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5406 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 161: -#line 1539 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 172: +#line 1609 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[-3].u.inst_ident); (yyval.u.inst_ident)->add_array_modifier((yyvsp[-1].u.expr)); } -#line 5085 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5415 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 162: -#line 1544 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 173: +#line 1614 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[-1].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_paren); } -#line 5094 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5424 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 163: -#line 1549 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 174: +#line 1619 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { push_scope((yyvsp[-1].u.inst_ident)->get_scope(current_scope, global_scope)); } -#line 5102 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5432 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 164: -#line 1553 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 175: +#line 1623 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { pop_scope(); (yyval.u.inst_ident) = (yyvsp[-5].u.inst_ident); @@ -5116,11 +5446,11 @@ yyreduce: (yyval.u.inst_ident)->add_func_modifier((yyvsp[-2].u.param_list), (yyvsp[0].u.integer)); } } -#line 5120 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5450 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 165: -#line 1571 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 176: +#line 1641 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // This is handled a bit awkwardly right now. Ideally it'd be wrapped // up in the instance_identifier rule, but then more needs to happen in @@ -5130,721 +5460,886 @@ yyreduce: } (yyval.u.inst_ident) = (yyvsp[-1].u.inst_ident); } -#line 5134 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5464 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 166: -#line 1581 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 177: +#line 1651 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // Bitfield definition. (yyvsp[-2].u.inst_ident)->_bit_width = (yyvsp[0].u.integer); (yyval.u.inst_ident) = (yyvsp[-2].u.inst_ident); } -#line 5144 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5474 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 167: -#line 1591 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 178: +#line 1661 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = NULL; } -#line 5152 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5482 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 168: -#line 1595 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 179: +#line 1665 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = (yyvsp[0].u.inst_ident)->unroll_type((yyvsp[-1].u.type)); } -#line 5160 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5490 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 169: -#line 1599 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 180: +#line 1669 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyvsp[0].u.inst_ident)->add_modifier(IIT_const); (yyval.u.type) = (yyvsp[0].u.inst_ident)->unroll_type((yyvsp[-1].u.type)); } -#line 5169 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 170: -#line 1608 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.param_list) = new CPPParameterList; -} -#line 5177 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 171: -#line 1612 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.param_list) = new CPPParameterList; - (yyval.u.param_list)->_includes_ellipsis = true; -} -#line 5186 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 172: -#line 1617 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.param_list) = (yyvsp[0].u.param_list); -} -#line 5194 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 173: -#line 1621 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.param_list) = (yyvsp[-2].u.param_list); - (yyval.u.param_list)->_includes_ellipsis = true; -} -#line 5203 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 174: -#line 1626 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.param_list) = (yyvsp[-1].u.param_list); - (yyval.u.param_list)->_includes_ellipsis = true; -} -#line 5212 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 175: -#line 1634 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.param_list) = new CPPParameterList; - (yyval.u.param_list)->_parameters.push_back((yyvsp[0].u.instance)); -} -#line 5221 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 176: -#line 1639 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.param_list) = (yyvsp[-2].u.param_list); - (yyval.u.param_list)->_parameters.push_back((yyvsp[0].u.instance)); -} -#line 5230 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 177: -#line 1647 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.param_list) = new CPPParameterList; -} -#line 5238 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 178: -#line 1651 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.param_list) = new CPPParameterList; - (yyval.u.param_list)->_includes_ellipsis = true; -} -#line 5247 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 179: -#line 1656 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.param_list) = (yyvsp[0].u.param_list); -} -#line 5255 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 180: -#line 1660 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.param_list) = (yyvsp[-2].u.param_list); - (yyval.u.param_list)->_includes_ellipsis = true; -} -#line 5264 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5499 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 181: -#line 1665 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1678 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.param_list) = new CPPParameterList; +} +#line 5507 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 182: +#line 1682 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.param_list) = new CPPParameterList; + (yyval.u.param_list)->_includes_ellipsis = true; +} +#line 5516 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 183: +#line 1687 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.param_list) = (yyvsp[0].u.param_list); +} +#line 5524 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 184: +#line 1691 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.param_list) = (yyvsp[-2].u.param_list); + (yyval.u.param_list)->_includes_ellipsis = true; +} +#line 5533 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 185: +#line 1696 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.param_list) = (yyvsp[-1].u.param_list); (yyval.u.param_list)->_includes_ellipsis = true; } -#line 5273 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5542 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 182: -#line 1673 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 186: +#line 1704 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.param_list) = new CPPParameterList; (yyval.u.param_list)->_parameters.push_back((yyvsp[0].u.instance)); } -#line 5282 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5551 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 183: -#line 1678 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 187: +#line 1709 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.param_list) = (yyvsp[-2].u.param_list); (yyval.u.param_list)->_parameters.push_back((yyvsp[0].u.instance)); } -#line 5291 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 184: -#line 1686 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (CPPExpression *)NULL; -} -#line 5299 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 185: -#line 1690 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (yyvsp[0].u.expr); -} -#line 5307 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 186: -#line 1697 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (CPPExpression *)NULL; -} -#line 5315 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 187: -#line 1701 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (yyvsp[0].u.expr); -} -#line 5323 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5560 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 188: -#line 1708 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1717 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = (CPPExpression *)NULL; + (yyval.u.param_list) = new CPPParameterList; } -#line 5331 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5568 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 189: -#line 1712 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1721 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = (CPPExpression *)NULL; + (yyval.u.param_list) = new CPPParameterList; + (yyval.u.param_list)->_includes_ellipsis = true; } -#line 5339 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5577 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 190: -#line 1716 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1726 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = (CPPExpression *)NULL; + (yyval.u.param_list) = (yyvsp[0].u.param_list); } -#line 5347 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5585 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 191: -#line 1720 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1730 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(CPPExpression::get_default()); + (yyval.u.param_list) = (yyvsp[-2].u.param_list); + (yyval.u.param_list)->_includes_ellipsis = true; } -#line 5355 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5594 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 192: -#line 1724 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1735 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(CPPExpression::get_delete()); + (yyval.u.param_list) = (yyvsp[-1].u.param_list); + (yyval.u.param_list)->_includes_ellipsis = true; } -#line 5363 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5603 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 193: -#line 1731 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1743 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = (CPPExpression *)NULL; + (yyval.u.param_list) = new CPPParameterList; + (yyval.u.param_list)->_parameters.push_back((yyvsp[0].u.instance)); } -#line 5371 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5612 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 194: -#line 1735 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1748 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = (CPPExpression *)NULL; + (yyval.u.param_list) = (yyvsp[-2].u.param_list); + (yyval.u.param_list)->_parameters.push_back((yyvsp[0].u.instance)); } -#line 5379 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5621 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 195: -#line 1739 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (yyvsp[-1].u.expr); -} -#line 5387 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 196: -#line 1743 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::get_default()); -} -#line 5395 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 197: -#line 1747 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::get_delete()); -} -#line 5403 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 198: -#line 1751 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1756 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = (CPPExpression *)NULL; } -#line 5411 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5629 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 196: +#line 1760 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (yyvsp[0].u.expr); +} +#line 5637 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 197: +#line 1767 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (CPPExpression *)NULL; +} +#line 5645 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 198: +#line 1771 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (yyvsp[0].u.expr); +} +#line 5653 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 199: +#line 1778 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (CPPExpression *)NULL; +} +#line 5661 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 200: +#line 1782 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (CPPExpression *)NULL; +} +#line 5669 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 201: +#line 1786 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (CPPExpression *)NULL; +} +#line 5677 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 202: -#line 1764 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1790 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { + (yyval.u.expr) = new CPPExpression(CPPExpression::get_default()); } -#line 5418 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5685 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 203: +#line 1794 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::get_delete()); +} +#line 5693 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 204: +#line 1801 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (CPPExpression *)NULL; +} +#line 5701 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 205: +#line 1805 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (CPPExpression *)NULL; +} +#line 5709 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 206: -#line 1773 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1809 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (yyvsp[-1].u.expr); +} +#line 5717 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 207: +#line 1813 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::get_default()); +} +#line 5725 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 208: +#line 1817 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::get_delete()); +} +#line 5733 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 209: +#line 1821 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (CPPExpression *)NULL; +} +#line 5741 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 213: +#line 1834 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { +} +#line 5748 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 217: +#line 1843 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.instance) = new CPPInstance((yyvsp[-2].u.type), (yyvsp[-1].u.inst_ident), 0, (yylsp[-1]).file); (yyval.u.instance)->set_initializer((yyvsp[0].u.expr)); } -#line 5427 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5757 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 207: -#line 1778 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 218: +#line 1848 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyvsp[-1].u.inst_ident)->add_modifier(IIT_const); (yyval.u.instance) = new CPPInstance((yyvsp[-2].u.type), (yyvsp[-1].u.inst_ident), 0, (yylsp[-1]).file); (yyval.u.instance)->set_initializer((yyvsp[0].u.expr)); } -#line 5437 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5767 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 208: -#line 1784 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 219: +#line 1854 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyvsp[-1].u.inst_ident)->add_modifier(IIT_const); (yyval.u.instance) = new CPPInstance((yyvsp[-2].u.type), (yyvsp[-1].u.inst_ident), 0, (yylsp[-2]).file); (yyval.u.instance)->set_initializer((yyvsp[0].u.expr)); } -#line 5447 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5777 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 209: -#line 1790 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 220: +#line 1860 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.instance) = new CPPInstance((yyvsp[-2].u.type), (yyvsp[-1].u.inst_ident), 0, (yylsp[-1]).file); + (yyval.u.instance)->set_initializer((yyvsp[0].u.expr)); +} +#line 5786 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 221: +#line 1865 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyvsp[-1].u.inst_ident)->add_modifier(IIT_const); + (yyval.u.instance) = new CPPInstance((yyvsp[-2].u.type), (yyvsp[-1].u.inst_ident), 0, (yylsp[-1]).file); + (yyval.u.instance)->set_initializer((yyvsp[0].u.expr)); +} +#line 5796 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 222: +#line 1871 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyvsp[-1].u.inst_ident)->add_modifier(IIT_const); + (yyval.u.instance) = new CPPInstance((yyvsp[-2].u.type), (yyvsp[-1].u.inst_ident), 0, (yylsp[-2]).file); + (yyval.u.instance)->set_initializer((yyvsp[0].u.expr)); +} +#line 5806 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 223: +#line 1877 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.instance) = (yyvsp[0].u.instance); } -#line 5455 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5814 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 210: -#line 1801 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 224: +#line 1888 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.instance) = (yyvsp[0].u.instance); } -#line 5463 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5822 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 211: -#line 1805 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 225: +#line 1892 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_parameter)); (yyval.u.instance) = new CPPInstance(type, "expr"); (yyval.u.instance)->set_initializer((yyvsp[0].u.expr)); } -#line 5474 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 212: -#line 1815 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); -} -#line 5482 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 213: -#line 1819 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[0].u.identifier)); -} -#line 5490 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 214: -#line 1823 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_const); -} -#line 5499 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 215: -#line 1828 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_volatile); -} -#line 5508 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 216: -#line 1833 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_pointer); -} -#line 5517 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 217: -#line 1838 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_reference); -} -#line 5526 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 218: -#line 1843 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); -} -#line 5535 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 219: -#line 1848 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[-2].u.identifier)); -} -#line 5544 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 220: -#line 1853 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[-3].u.inst_ident); - (yyval.u.inst_ident)->add_array_modifier((yyvsp[-1].u.expr)); -} -#line 5553 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 221: -#line 1861 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); -} -#line 5561 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 222: -#line 1865 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[0].u.identifier)); -} -#line 5569 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 223: -#line 1869 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_const); -} -#line 5578 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 224: -#line 1874 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_volatile); -} -#line 5587 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 225: -#line 1879 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_pointer); -} -#line 5596 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5833 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 226: -#line 1884 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 1902 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); +} +#line 5841 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 227: +#line 1906 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[0].u.identifier)); +} +#line 5849 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 228: +#line 1910 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_const); +} +#line 5858 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 229: +#line 1915 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_volatile); +} +#line 5867 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 230: +#line 1920 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_pointer); +} +#line 5876 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 231: +#line 1925 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_reference); } -#line 5605 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5885 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 227: -#line 1889 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 232: +#line 1930 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); } -#line 5614 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5894 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 228: -#line 1894 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 233: +#line 1935 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[-2].u.identifier)); } -#line 5623 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5903 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 229: -#line 1899 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 234: +#line 1940 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[-3].u.inst_ident); (yyval.u.inst_ident)->add_array_modifier((yyvsp[-1].u.expr)); } -#line 5632 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 5912 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 230: -#line 1904 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 235: +#line 1948 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); +} +#line 5920 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 236: +#line 1952 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[0].u.identifier)); +} +#line 5928 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 237: +#line 1956 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_const); +} +#line 5937 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 238: +#line 1961 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_volatile); +} +#line 5946 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 239: +#line 1966 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_pointer); +} +#line 5955 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 240: +#line 1971 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_reference); +} +#line 5964 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 241: +#line 1976 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); +} +#line 5973 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 242: +#line 1981 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[-2].u.identifier)); +} +#line 5982 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 243: +#line 1986 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[-3].u.inst_ident); + (yyval.u.inst_ident)->add_array_modifier((yyvsp[-1].u.expr)); +} +#line 5991 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 244: +#line 1991 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[-5].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_paren); (yyval.u.inst_ident)->add_func_modifier((yyvsp[-2].u.param_list), (yyvsp[0].u.integer)); } -#line 5642 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6001 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 231: -#line 1910 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 245: +#line 1997 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[-1].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_paren); } -#line 5651 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 232: -#line 1918 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); -} -#line 5659 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 233: -#line 1922 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_const); -} -#line 5668 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 234: -#line 1927 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_volatile); -} -#line 5677 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 235: -#line 1932 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_pointer); -} -#line 5686 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 236: -#line 1937 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_reference); -} -#line 5695 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 237: -#line 1942 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); -} -#line 5704 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 238: -#line 1947 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[-2].u.identifier)); -} -#line 5713 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 239: -#line 1952 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[-3].u.inst_ident); - (yyval.u.inst_ident)->add_array_modifier((yyvsp[-1].u.expr)); -} -#line 5722 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 240: -#line 1960 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); -} -#line 5730 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 241: -#line 1964 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_const); -} -#line 5739 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 242: -#line 1969 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_volatile); -} -#line 5748 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 243: -#line 1974 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_pointer); -} -#line 5757 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 244: -#line 1979 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_reference); -} -#line 5766 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 245: -#line 1984 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); -} -#line 5775 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6010 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 246: -#line 1989 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 2005 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); + (yyval.u.inst_ident)->_packed = true; +} +#line 6019 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 247: +#line 2010 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[0].u.identifier)); + (yyval.u.inst_ident)->_packed = true; +} +#line 6028 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 248: +#line 2015 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_const); +} +#line 6037 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 249: +#line 2020 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_volatile); +} +#line 6046 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 250: +#line 2025 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_pointer); +} +#line 6055 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 251: +#line 2030 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_reference); +} +#line 6064 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 252: +#line 2035 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); +} +#line 6073 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 253: +#line 2040 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[-2].u.identifier)); } -#line 5784 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6082 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 247: -#line 1994 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 254: +#line 2045 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[-3].u.inst_ident); (yyval.u.inst_ident)->add_array_modifier((yyvsp[-1].u.expr)); } -#line 5793 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6091 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 248: -#line 1999 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 255: +#line 2050 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[-5].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_paren); + (yyval.u.inst_ident)->add_func_modifier((yyvsp[-2].u.param_list), (yyvsp[0].u.integer)); +} +#line 6101 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 256: +#line 2056 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[-1].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_paren); +} +#line 6110 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 257: +#line 2064 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); +} +#line 6118 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 258: +#line 2068 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); + (yyval.u.inst_ident)->_packed = true; +} +#line 6127 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 259: +#line 2073 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[0].u.identifier)); + (yyval.u.inst_ident)->_packed = true; +} +#line 6136 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 260: +#line 2078 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_const); +} +#line 6145 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 261: +#line 2083 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_volatile); +} +#line 6154 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 262: +#line 2088 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_pointer); +} +#line 6163 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 263: +#line 2093 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_reference); +} +#line 6172 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 264: +#line 2098 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); +} +#line 6181 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 265: +#line 2103 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[-2].u.identifier)); +} +#line 6190 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 266: +#line 2108 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[-3].u.inst_ident); + (yyval.u.inst_ident)->add_array_modifier((yyvsp[-1].u.expr)); +} +#line 6199 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 267: +#line 2116 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); +} +#line 6207 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 268: +#line 2120 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); + (yyval.u.inst_ident)->_packed = true; +} +#line 6216 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 269: +#line 2125 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[0].u.identifier)); + (yyval.u.inst_ident)->_packed = true; +} +#line 6225 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 270: +#line 2130 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_const); +} +#line 6234 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 271: +#line 2135 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_volatile); +} +#line 6243 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 272: +#line 2140 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_pointer); +} +#line 6252 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 273: +#line 2145 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_reference); +} +#line 6261 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 274: +#line 2150 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); +} +#line 6270 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 275: +#line 2155 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); + (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[-2].u.identifier)); +} +#line 6279 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 276: +#line 2160 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.inst_ident) = (yyvsp[-3].u.inst_ident); + (yyval.u.inst_ident)->add_array_modifier((yyvsp[-1].u.expr)); +} +#line 6288 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 277: +#line 2165 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); (yyval.u.inst_ident)->add_modifier(IIT_paren); (yyval.u.inst_ident)->add_func_modifier((yyvsp[-3].u.param_list), (yyvsp[-1].u.integer), (yyvsp[0].u.type)); } -#line 5803 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6298 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 249: -#line 2005 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 278: +#line 2171 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[-6].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_pointer); (yyval.u.inst_ident)->add_modifier(IIT_paren); (yyval.u.inst_ident)->add_func_modifier((yyvsp[-3].u.param_list), (yyvsp[-1].u.integer), (yyvsp[0].u.type)); } -#line 5814 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6309 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 250: -#line 2012 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 279: +#line 2178 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[-6].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_reference); (yyval.u.inst_ident)->add_modifier(IIT_paren); (yyval.u.inst_ident)->add_func_modifier((yyvsp[-3].u.param_list), (yyvsp[-1].u.integer), (yyvsp[0].u.type)); } -#line 5825 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6320 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 251: -#line 2019 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 280: +#line 2185 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.inst_ident) = (yyvsp[-6].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); (yyval.u.inst_ident)->add_modifier(IIT_paren); (yyval.u.inst_ident)->add_func_modifier((yyvsp[-3].u.param_list), (yyvsp[-1].u.integer), (yyvsp[0].u.type)); } -#line 5836 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6331 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 252: -#line 2029 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 281: +#line 2195 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = CPPType::new_type((yyvsp[0].u.simple_type)); } -#line 5844 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6339 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 253: -#line 2033 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 282: +#line 2199 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if ((yyval.u.type) == NULL) { @@ -5852,43 +6347,43 @@ yyreduce: } assert((yyval.u.type) != NULL); } -#line 5856 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6351 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 254: -#line 2041 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 283: +#line 2207 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = CPPType::new_type(new CPPTBDType((yyvsp[0].u.identifier))); } -#line 5864 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6359 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 255: -#line 2045 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 284: +#line 2211 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = CPPType::new_type((yyvsp[0].u.struct_type)); } -#line 5872 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6367 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 256: -#line 2049 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 285: +#line 2215 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = CPPType::new_type((yyvsp[0].u.struct_type)); } -#line 5880 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6375 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 257: -#line 2053 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 286: +#line 2219 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = CPPType::new_type((yyvsp[0].u.enum_type)); } -#line 5888 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6383 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 258: -#line 2057 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 287: +#line 2223 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if (type != NULL) { @@ -5904,11 +6399,11 @@ yyreduce: (yyval.u.type) = et; } } -#line 5908 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6403 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 259: -#line 2073 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 288: +#line 2239 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = (yyvsp[-2].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if (type != NULL) { @@ -5924,11 +6419,11 @@ yyreduce: (yyval.u.type) = et; } } -#line 5928 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6423 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 260: -#line 2089 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 289: +#line 2255 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = (yyvsp[-1].u.expr)->determine_type(); if ((yyval.u.type) == (CPPType *)NULL) { @@ -5937,27 +6432,53 @@ yyreduce: yyerror("could not determine type of " + str.str(), (yylsp[-1])); } } -#line 5941 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6436 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 261: -#line 2098 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 290: +#line 2264 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + CPPEnumType *enum_type = (yyvsp[-1].u.type)->as_enum_type(); + if (enum_type == NULL) { + yyerror("an enumeration type is required", (yylsp[-1])); + (yyval.u.type) = (yyvsp[-1].u.type); + } else { + (yyval.u.type) = enum_type->get_underlying_type(); + } +} +#line 6450 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 291: +#line 2274 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_auto)); } -#line 5949 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6458 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 262: -#line 2105 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 292: +#line 2281 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.type) = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); + if ((yyval.u.type) == NULL) { + yyerror(string("internal error resolving type ") + (yyvsp[0].u.identifier)->get_fully_scoped_name(), (yylsp[0])); + } + assert((yyval.u.type) != NULL); +} +#line 6470 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 293: +#line 2292 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.decl) = CPPType::new_type((yyvsp[0].u.simple_type)); } -#line 5957 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6478 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 263: -#line 2109 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 294: +#line 2296 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.decl) = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if ((yyval.u.decl) == NULL) { @@ -5965,43 +6486,43 @@ yyreduce: } assert((yyval.u.decl) != NULL); } -#line 5969 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6490 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 264: -#line 2117 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 295: +#line 2304 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.decl) = CPPType::new_type(new CPPTBDType((yyvsp[0].u.identifier))); } -#line 5977 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6498 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 265: -#line 2121 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 296: +#line 2308 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.decl) = CPPType::new_type((yyvsp[0].u.struct_type)); } -#line 5985 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6506 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 266: -#line 2125 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 297: +#line 2312 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.decl) = new CPPTypeDeclaration(CPPType::new_type((yyvsp[0].u.struct_type))); } -#line 5993 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6514 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 267: -#line 2129 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 298: +#line 2316 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.decl) = new CPPTypeDeclaration(CPPType::new_type((yyvsp[0].u.enum_type))); } -#line 6001 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6522 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 268: -#line 2133 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 299: +#line 2320 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if (type != NULL) { @@ -6017,11 +6538,11 @@ yyreduce: (yyval.u.decl) = et; } } -#line 6021 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6542 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 269: -#line 2149 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 300: +#line 2336 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = (yyvsp[-2].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if (type != NULL) { @@ -6037,11 +6558,11 @@ yyreduce: (yyval.u.decl) = et; } } -#line 6041 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6562 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 270: -#line 2165 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 301: +#line 2352 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { yywarning(string("C++ does not permit forward declaration of untyped enum ") + (yyvsp[0].u.identifier)->get_fully_scoped_name(), (yylsp[-1])); @@ -6059,11 +6580,11 @@ yyreduce: (yyval.u.decl) = et; } } -#line 6063 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6584 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 271: -#line 2183 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 302: +#line 2370 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.decl) = (yyvsp[-1].u.expr)->determine_type(); if ((yyval.u.decl) == (CPPType *)NULL) { @@ -6072,27 +6593,41 @@ yyreduce: yyerror("could not determine type of " + str.str(), (yylsp[-1])); } } -#line 6076 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6597 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 272: -#line 2192 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 303: +#line 2379 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + CPPEnumType *enum_type = (yyvsp[-1].u.type)->as_enum_type(); + if (enum_type == NULL) { + yyerror("an enumeration type is required", (yylsp[-1])); + (yyval.u.decl) = (yyvsp[-1].u.type); + } else { + (yyval.u.decl) = enum_type->get_underlying_type(); + } +} +#line 6611 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 304: +#line 2389 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.decl) = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_auto)); } -#line 6084 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6619 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 273: -#line 2199 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 305: +#line 2396 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = CPPType::new_type((yyvsp[0].u.simple_type)); } -#line 6092 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6627 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 274: -#line 2203 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 306: +#line 2400 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if ((yyval.u.type) == NULL) { @@ -6100,19 +6635,19 @@ yyreduce: } assert((yyval.u.type) != NULL); } -#line 6104 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6639 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 275: -#line 2211 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 307: +#line 2408 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = CPPType::new_type(new CPPTBDType((yyvsp[0].u.identifier))); } -#line 6112 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6647 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 276: -#line 2215 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 308: +#line 2412 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if (type != NULL) { @@ -6128,11 +6663,11 @@ yyreduce: (yyval.u.type) = et; } } -#line 6132 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6667 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 277: -#line 2231 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 309: +#line 2428 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if (type != NULL) { @@ -6148,11 +6683,11 @@ yyreduce: (yyval.u.type) = et; } } -#line 6152 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6687 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 278: -#line 2247 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 310: +#line 2444 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = (yyvsp[-1].u.expr)->determine_type(); if ((yyval.u.type) == (CPPType *)NULL) { @@ -6161,54 +6696,85 @@ yyreduce: yyerror("could not determine type of " + str.str(), (yylsp[-1])); } } -#line 6165 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6700 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 279: -#line 2256 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 311: +#line 2453 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + CPPEnumType *enum_type = (yyvsp[-1].u.type)->as_enum_type(); + if (enum_type == NULL) { + yyerror("an enumeration type is required", (yylsp[-1])); + (yyval.u.type) = (yyvsp[-1].u.type); + } else { + (yyval.u.type) = enum_type->get_underlying_type(); + } +} +#line 6714 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 312: +#line 2463 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_auto)); } -#line 6173 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6722 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 280: -#line 2263 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 313: +#line 2470 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.decl) = (yyvsp[0].u.decl); } -#line 6181 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6730 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 281: -#line 2267 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 314: +#line 2474 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { yyerror(string("unknown type '") + (yyvsp[0].u.identifier)->get_fully_scoped_name() + "'", (yylsp[0])); (yyval.u.decl) = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_unknown)); } -#line 6191 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6740 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 282: -#line 2275 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 315: +#line 2482 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = (yyvsp[0].u.inst_ident)->unroll_type((yyvsp[-1].u.type)); } -#line 6199 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6748 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 283: -#line 2279 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 316: +#line 2486 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyvsp[0].u.inst_ident)->add_modifier(IIT_const); (yyval.u.type) = (yyvsp[0].u.inst_ident)->unroll_type((yyvsp[-1].u.type)); } -#line 6208 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6757 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 284: -#line 2287 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 317: +#line 2491 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.type) = (yyvsp[0].u.inst_ident)->unroll_type((yyvsp[-1].u.type)); +} +#line 6765 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 318: +#line 2495 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyvsp[0].u.inst_ident)->add_modifier(IIT_const); + (yyval.u.type) = (yyvsp[0].u.inst_ident)->unroll_type((yyvsp[-1].u.type)); +} +#line 6774 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 319: +#line 2503 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPVisibility starting_vis = ((yyvsp[-1].u.extension_enum) == CPPExtensionType::T_class) ? V_private : V_public; @@ -6222,22 +6788,22 @@ yyreduce: push_scope(new_scope); push_struct(st); } -#line 6226 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6792 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 285: -#line 2301 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 320: +#line 2517 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.struct_type) = current_struct; current_struct->_incomplete = false; pop_struct(); pop_scope(); } -#line 6237 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6803 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 286: -#line 2311 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 321: +#line 2527 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPVisibility starting_vis = ((yyvsp[-1].u.extension_enum) == CPPExtensionType::T_class) ? V_private : V_public; @@ -6257,253 +6823,253 @@ yyreduce: push_scope(new_scope); push_struct(st); } -#line 6261 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6827 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 287: -#line 2331 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 322: +#line 2547 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.struct_type) = current_struct; current_struct->_incomplete = false; pop_struct(); pop_scope(); } -#line 6272 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6838 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 289: -#line 2342 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 324: +#line 2558 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_struct->_final = true; } -#line 6280 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6846 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 294: -#line 2359 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 329: +#line 2575 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_struct->append_derivation((yyvsp[0].u.type), V_unknown, false); } -#line 6288 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6854 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 295: -#line 2363 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 330: +#line 2579 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_struct->append_derivation((yyvsp[0].u.type), V_public, false); } -#line 6296 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6862 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 296: -#line 2367 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 331: +#line 2583 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_struct->append_derivation((yyvsp[0].u.type), V_protected, false); } -#line 6304 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6870 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 297: -#line 2371 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 332: +#line 2587 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_struct->append_derivation((yyvsp[0].u.type), V_private, false); } -#line 6312 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6878 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 298: -#line 2375 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 333: +#line 2591 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_struct->append_derivation((yyvsp[0].u.type), V_public, true); } -#line 6320 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6886 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 299: -#line 2379 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 334: +#line 2595 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_struct->append_derivation((yyvsp[0].u.type), V_protected, true); } -#line 6328 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6894 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 300: -#line 2383 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 335: +#line 2599 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_struct->append_derivation((yyvsp[0].u.type), V_private, true); } -#line 6336 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6902 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 301: -#line 2387 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 336: +#line 2603 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_struct->append_derivation((yyvsp[0].u.type), V_public, true); } -#line 6344 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6910 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 302: -#line 2391 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 337: +#line 2607 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_struct->append_derivation((yyvsp[0].u.type), V_protected, true); } -#line 6352 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6918 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 303: -#line 2395 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 338: +#line 2611 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_struct->append_derivation((yyvsp[0].u.type), V_private, true); } -#line 6360 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6926 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 304: -#line 2402 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 339: +#line 2618 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.enum_type) = current_enum; current_enum = NULL; } -#line 6369 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6935 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 305: -#line 2410 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 340: +#line 2626 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_enum = new CPPEnumType((yyvsp[-2].u.extension_enum), NULL, (yyvsp[0].u.type), current_scope, NULL, (yylsp[-2]).file); } -#line 6377 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6943 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 306: -#line 2414 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 341: +#line 2630 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_enum = new CPPEnumType((yyvsp[0].u.extension_enum), NULL, current_scope, NULL, (yylsp[0]).file); } -#line 6385 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6951 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 307: -#line 2418 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 342: +#line 2634 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPScope *new_scope = new CPPScope(current_scope, (yyvsp[-2].u.identifier)->_names.back(), V_public); current_enum = new CPPEnumType((yyvsp[-3].u.extension_enum), (yyvsp[-2].u.identifier), (yyvsp[0].u.type), current_scope, new_scope, (yylsp[-3]).file); } -#line 6394 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6960 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 308: -#line 2423 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 343: +#line 2639 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPScope *new_scope = new CPPScope(current_scope, (yyvsp[0].u.identifier)->_names.back(), V_public); current_enum = new CPPEnumType((yyvsp[-1].u.extension_enum), (yyvsp[0].u.identifier), current_scope, new_scope, (yylsp[-1]).file); } -#line 6403 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6969 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 309: -#line 2431 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 344: +#line 2647 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = CPPType::new_type((yyvsp[0].u.simple_type)); } -#line 6411 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6977 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 310: -#line 2435 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 345: +#line 2651 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); } -#line 6419 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6985 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 312: -#line 2443 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 347: +#line 2659 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { assert(current_enum != NULL); current_enum->add_element((yyvsp[-1].u.identifier)->get_simple_name(), NULL, current_lexer, (yylsp[-1])); } -#line 6428 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 6994 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 313: -#line 2448 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 348: +#line 2664 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { assert(current_enum != NULL); current_enum->add_element((yyvsp[-3].u.identifier)->get_simple_name(), (yyvsp[-1].u.expr), current_lexer, (yylsp[-3])); } -#line 6437 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7003 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 315: -#line 2456 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 350: +#line 2672 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { assert(current_enum != NULL); current_enum->add_element((yyvsp[0].u.identifier)->get_simple_name(), NULL, current_lexer, (yylsp[0])); } -#line 6446 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7012 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 316: -#line 2461 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 351: +#line 2677 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { assert(current_enum != NULL); current_enum->add_element((yyvsp[-2].u.identifier)->get_simple_name(), (yyvsp[0].u.expr), current_lexer, (yylsp[-2])); } -#line 6455 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7021 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 317: -#line 2469 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 352: +#line 2685 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.extension_enum) = CPPExtensionType::T_enum; } -#line 6463 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7029 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 318: -#line 2473 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 353: +#line 2689 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.extension_enum) = CPPExtensionType::T_enum_class; } -#line 6471 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7037 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 319: -#line 2477 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 354: +#line 2693 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.extension_enum) = CPPExtensionType::T_enum_struct; } -#line 6479 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7045 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 320: -#line 2484 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 355: +#line 2700 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.extension_enum) = CPPExtensionType::T_class; } -#line 6487 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7053 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 321: -#line 2488 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 356: +#line 2704 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.extension_enum) = CPPExtensionType::T_struct; } -#line 6495 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7061 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 322: -#line 2492 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 357: +#line 2708 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.extension_enum) = CPPExtensionType::T_union; } -#line 6503 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7069 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 323: -#line 2499 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 358: +#line 2715 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPScope *scope = (yyvsp[-1].u.identifier)->find_scope(current_scope, global_scope, current_lexer); if (scope == NULL) { @@ -6521,19 +7087,19 @@ yyreduce: current_scope->define_namespace(nspace); push_scope(scope); } -#line 6525 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7091 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 324: -#line 2517 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 359: +#line 2733 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { pop_scope(); } -#line 6533 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7099 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 325: -#line 2521 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 360: +#line 2737 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPScope *scope = (yyvsp[-1].u.identifier)->find_scope(current_scope, global_scope, current_lexer); if (scope == NULL) { @@ -6552,143 +7118,143 @@ yyreduce: current_scope->define_namespace(nspace); push_scope(scope); } -#line 6556 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7122 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 326: -#line 2540 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 361: +#line 2756 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { pop_scope(); } -#line 6564 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7130 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 329: -#line 2549 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 364: +#line 2765 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPUsing *using_decl = new CPPUsing((yyvsp[-1].u.identifier), false, (yylsp[-2]).file); current_scope->add_declaration(using_decl, global_scope, current_lexer, (yylsp[-2])); current_scope->add_using(using_decl, global_scope, current_lexer); } -#line 6574 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7140 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 330: -#line 2555 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 365: +#line 2771 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // This is really just an alternative way to declare a typedef. CPPTypedefType *typedef_type = new CPPTypedefType((yyvsp[-1].u.type), (yyvsp[-3].u.identifier), current_scope); typedef_type->_using = true; current_scope->add_declaration(CPPType::new_type(typedef_type), global_scope, current_lexer, (yylsp[-4])); } -#line 6585 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7151 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 331: -#line 2562 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 366: +#line 2778 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPUsing *using_decl = new CPPUsing((yyvsp[-1].u.identifier), true, (yylsp[-3]).file); current_scope->add_declaration(using_decl, global_scope, current_lexer, (yylsp[-3])); current_scope->add_using(using_decl, global_scope, current_lexer); } -#line 6595 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7161 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 335: -#line 2577 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 370: +#line 2793 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_bool); } -#line 6603 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7169 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 336: -#line 2581 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 371: +#line 2797 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_char); } -#line 6611 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7177 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 337: -#line 2585 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 372: +#line 2801 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_wchar_t); } -#line 6619 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7185 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 338: -#line 2589 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 373: +#line 2805 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_char16_t); } -#line 6627 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7193 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 339: -#line 2593 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 374: +#line 2809 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_char32_t); } -#line 6635 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7201 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 340: -#line 2597 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 375: +#line 2813 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_short); } -#line 6644 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7210 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 341: -#line 2602 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 376: +#line 2818 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_long); } -#line 6653 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7219 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 342: -#line 2607 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 377: +#line 2823 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_unsigned); } -#line 6662 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7228 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 343: -#line 2612 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 378: +#line 2828 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_signed); } -#line 6671 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7237 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 344: -#line 2617 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 379: +#line 2833 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int); } -#line 6679 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7245 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 345: -#line 2621 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 380: +#line 2837 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = (yyvsp[0].u.simple_type); (yyval.u.simple_type)->_flags |= CPPSimpleType::F_short; } -#line 6688 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7254 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 346: -#line 2626 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 381: +#line 2842 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = (yyvsp[0].u.simple_type); if ((yyval.u.simple_type)->_flags & CPPSimpleType::F_long) { @@ -6697,477 +7263,485 @@ yyreduce: (yyval.u.simple_type)->_flags |= CPPSimpleType::F_long; } } -#line 6701 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7267 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 347: -#line 2635 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 382: +#line 2851 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = (yyvsp[0].u.simple_type); (yyval.u.simple_type)->_flags |= CPPSimpleType::F_unsigned; } -#line 6710 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7276 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 348: -#line 2640 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 383: +#line 2856 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = (yyvsp[0].u.simple_type); (yyval.u.simple_type)->_flags |= CPPSimpleType::F_signed; } -#line 6719 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7285 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 349: -#line 2648 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 384: +#line 2864 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_float); } -#line 6727 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7293 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 350: -#line 2652 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 385: +#line 2868 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_double); } -#line 6735 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7301 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 351: -#line 2656 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 386: +#line 2872 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_double, CPPSimpleType::F_long); } -#line 6744 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7310 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 352: -#line 2664 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 387: +#line 2880 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_void); } -#line 6752 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7318 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 353: -#line 2673 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 388: +#line 2889 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_lexer->_resolve_identifiers = false; } -#line 6760 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7326 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 354: -#line 2677 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 389: +#line 2893 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { current_lexer->_resolve_identifiers = true; } -#line 6768 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 457: -#line 2718 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { -} -#line 6775 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 481: -#line 2727 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (CPPExpression *)NULL; -} -#line 6783 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 482: -#line 2731 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (yyvsp[0].u.expr); -} -#line 6791 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 483: -#line 2738 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (CPPExpression *)NULL; -} -#line 6799 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 484: -#line 2742 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (yyvsp[0].u.expr); -} -#line 6807 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 485: -#line 2749 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (yyvsp[0].u.expr); -} -#line 6815 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 486: -#line 2753 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(',', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 6823 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 487: -#line 2760 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (yyvsp[0].u.expr); -} -#line 6831 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 488: -#line 2764 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-2].u.type), (yyvsp[0].u.expr))); -} -#line 6839 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 489: -#line 2768 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_static_cast)); -} -#line 6847 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 490: -#line 2772 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_dynamic_cast)); -} -#line 6855 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 491: -#line 2776 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_const_cast)); -} -#line 6863 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 492: -#line 2780 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_reinterpret_cast)); -} -#line 6871 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 493: -#line 2784 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_func((yyvsp[-1].u.type))); -} -#line 6879 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 494: -#line 2788 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::alignof_func((yyvsp[-1].u.type))); -} -#line 6887 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7334 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 495: -#line 2792 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 2936 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(UNARY_NOT, (yyvsp[0].u.expr)); } -#line 6895 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 496: -#line 2796 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(UNARY_NEGATE, (yyvsp[0].u.expr)); -} -#line 6903 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 497: -#line 2800 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(UNARY_MINUS, (yyvsp[0].u.expr)); -} -#line 6911 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 498: -#line 2804 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(UNARY_PLUS, (yyvsp[0].u.expr)); -} -#line 6919 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 499: -#line 2808 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(UNARY_STAR, (yyvsp[0].u.expr)); -} -#line 6927 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 500: -#line 2812 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(UNARY_REF, (yyvsp[0].u.expr)); -} -#line 6935 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 501: -#line 2816 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('*', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 6943 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 502: -#line 2820 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('/', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 6951 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 503: -#line 2824 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('%', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 6959 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 504: -#line 2828 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('+', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 6967 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 505: -#line 2832 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('-', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 6975 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 506: -#line 2836 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('|', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 6983 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 507: -#line 2840 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('^', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 6991 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 508: -#line 2844 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('&', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 6999 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 509: -#line 2848 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(OROR, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7007 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 510: -#line 2852 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(ANDAND, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7015 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 511: -#line 2856 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(EQCOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7023 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 512: -#line 2860 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(NECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7031 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 513: -#line 2864 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(LECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7039 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 514: -#line 2868 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(GECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7047 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 515: -#line 2872 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(LSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7055 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 516: -#line 2876 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(RSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7063 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 517: -#line 2880 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('?', (yyvsp[-4].u.expr), (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7071 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 518: -#line 2884 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('[', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); -} -#line 7079 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7341 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 519: -#line 2888 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 2945 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); + (yyval.u.expr) = (CPPExpression *)NULL; } -#line 7087 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7349 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 520: -#line 2892 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[-2].u.expr)); -} -#line 7095 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 521: -#line 2896 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('.', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7103 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 522: -#line 2900 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7111 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 523: -#line 2904 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (yyvsp[-1].u.expr); -} -#line 7119 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 524: -#line 2912 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 2949 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = (yyvsp[0].u.expr); } -#line 7127 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7357 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 521: +#line 2956 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (CPPExpression *)NULL; +} +#line 7365 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 522: +#line 2960 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (yyvsp[0].u.expr); +} +#line 7373 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 523: +#line 2967 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (yyvsp[0].u.expr); +} +#line 7381 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 524: +#line 2971 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(',', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7389 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 525: -#line 2916 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 2978 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-2].u.type), (yyvsp[0].u.expr))); + (yyval.u.expr) = (yyvsp[0].u.expr); } -#line 7135 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7397 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 526: -#line 2920 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 2982 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_static_cast)); + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-2].u.type), (yyvsp[0].u.expr))); } -#line 7143 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7405 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 527: -#line 2924 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 2986 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_dynamic_cast)); + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_static_cast)); } -#line 7151 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7413 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 528: -#line 2928 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 2990 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_const_cast)); + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_dynamic_cast)); } -#line 7159 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7421 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 529: -#line 2932 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 2994 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_reinterpret_cast)); + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_const_cast)); } -#line 7167 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7429 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 530: -#line 2936 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 2998 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_reinterpret_cast)); +} +#line 7437 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 531: +#line 3002 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_func((yyvsp[-1].u.type))); +} +#line 7445 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 532: +#line 3006 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_ellipsis_func((yyvsp[-1].u.identifier))); +} +#line 7453 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 533: +#line 3010 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::alignof_func((yyvsp[-1].u.type))); +} +#line 7461 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 534: +#line 3014 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(UNARY_NOT, (yyvsp[0].u.expr)); +} +#line 7469 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 535: +#line 3018 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(UNARY_NEGATE, (yyvsp[0].u.expr)); +} +#line 7477 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 536: +#line 3022 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(UNARY_MINUS, (yyvsp[0].u.expr)); +} +#line 7485 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 537: +#line 3026 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(UNARY_PLUS, (yyvsp[0].u.expr)); +} +#line 7493 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 538: +#line 3030 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(UNARY_STAR, (yyvsp[0].u.expr)); +} +#line 7501 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 539: +#line 3034 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(UNARY_REF, (yyvsp[0].u.expr)); +} +#line 7509 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 540: +#line 3038 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('*', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7517 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 541: +#line 3042 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('/', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7525 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 542: +#line 3046 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('%', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7533 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 543: +#line 3050 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('+', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7541 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 544: +#line 3054 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('-', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7549 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 545: +#line 3058 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('|', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7557 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 546: +#line 3062 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('^', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7565 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 547: +#line 3066 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('&', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7573 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 548: +#line 3070 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(OROR, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7581 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 549: +#line 3074 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(ANDAND, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7589 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 550: +#line 3078 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(EQCOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7597 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 551: +#line 3082 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(NECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7605 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 552: +#line 3086 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(LECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7613 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 553: +#line 3090 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(GECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7621 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 554: +#line 3094 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(LSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7629 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 555: +#line 3098 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(RSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7637 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 556: +#line 3102 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('?', (yyvsp[-4].u.expr), (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7645 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 557: +#line 3106 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('[', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); +} +#line 7653 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 558: +#line 3110 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('f', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); +} +#line 7661 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 559: +#line 3114 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('f', (yyvsp[-2].u.expr)); +} +#line 7669 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 560: +#line 3118 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('.', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7677 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 561: +#line 3122 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 7685 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 562: +#line 3126 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (yyvsp[-1].u.expr); +} +#line 7693 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 563: +#line 3134 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (yyvsp[0].u.expr); +} +#line 7701 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 564: +#line 3138 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-2].u.type), (yyvsp[0].u.expr))); +} +#line 7709 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 565: +#line 3142 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_static_cast)); +} +#line 7717 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 566: +#line 3146 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_dynamic_cast)); +} +#line 7725 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 567: +#line 3150 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_const_cast)); +} +#line 7733 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 568: +#line 3154 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_reinterpret_cast)); +} +#line 7741 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 569: +#line 3158 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // A constructor call. CPPType *type = (yyvsp[-3].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); @@ -7177,633 +7751,175 @@ yyreduce: assert(type != NULL); (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } -#line 7181 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7755 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 531: -#line 2946 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 570: +#line 3168 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int)); (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } -#line 7191 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7765 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 532: -#line 2952 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 571: +#line 3174 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_char)); (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } -#line 7201 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7775 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 533: -#line 2958 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 572: +#line 3180 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_wchar_t)); (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } -#line 7211 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7785 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 534: -#line 2964 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 573: +#line 3186 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_char16_t)); (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } -#line 7221 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7795 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 535: -#line 2970 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 574: +#line 3192 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_char32_t)); (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } -#line 7231 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7805 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 536: -#line 2976 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 575: +#line 3198 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_bool)); (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } -#line 7241 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7815 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 537: -#line 2982 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 576: +#line 3204 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_short)); (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } -#line 7252 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7826 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 538: -#line 2989 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 577: +#line 3211 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_long)); (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } -#line 7263 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7837 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 539: -#line 2996 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 578: +#line 3218 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_unsigned)); (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } -#line 7274 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7848 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 540: -#line 3003 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 579: +#line 3225 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_signed)); (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } -#line 7285 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7859 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 541: -#line 3010 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 580: +#line 3232 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_float)); (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } -#line 7295 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7869 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 542: -#line 3016 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 581: +#line 3238 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_double)); (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); } -#line 7305 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 543: -#line 3022 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_func((yyvsp[-1].u.type))); -} -#line 7313 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 544: -#line 3026 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::alignof_func((yyvsp[-1].u.type))); -} -#line 7321 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 545: -#line 3030 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[0].u.type))); -} -#line 7329 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 546: -#line 3034 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[-3].u.type), (yyvsp[-1].u.expr))); -} -#line 7337 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 547: -#line 3038 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - CPPIdentifier ident(""); - ident.add_name("std"); - ident.add_name("type_info"); - CPPType *std_type_info = ident.find_type(current_scope, global_scope, false, current_lexer); - if (!std_type_info) { - yywarning("cannot use typeid before including ", (yylsp[-3])); - } - (yyval.u.expr) = new CPPExpression(CPPExpression::typeid_op((yyvsp[-1].u.type), std_type_info)); -} -#line 7352 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 548: -#line 3049 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - CPPIdentifier ident(""); - ident.add_name("std"); - ident.add_name("type_info"); - CPPType *std_type_info = ident.find_type(current_scope, global_scope, false, current_lexer); - if (!std_type_info) { - yywarning("cannot use typeid before including ", (yylsp[-3])); - } - (yyval.u.expr) = new CPPExpression(CPPExpression::typeid_op((yyvsp[-1].u.expr), std_type_info)); -} -#line 7367 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 549: -#line 3060 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(UNARY_NOT, (yyvsp[0].u.expr)); -} -#line 7375 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 550: -#line 3064 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(UNARY_NEGATE, (yyvsp[0].u.expr)); -} -#line 7383 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 551: -#line 3068 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(UNARY_MINUS, (yyvsp[0].u.expr)); -} -#line 7391 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 552: -#line 3072 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(UNARY_PLUS, (yyvsp[0].u.expr)); -} -#line 7399 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 553: -#line 3076 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(UNARY_STAR, (yyvsp[0].u.expr)); -} -#line 7407 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 554: -#line 3080 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(UNARY_REF, (yyvsp[0].u.expr)); -} -#line 7415 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 555: -#line 3084 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('*', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7423 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 556: -#line 3088 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('/', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7431 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 557: -#line 3092 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('%', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7439 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 558: -#line 3096 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('+', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7447 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 559: -#line 3100 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('-', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7455 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 560: -#line 3104 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('|', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7463 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 561: -#line 3108 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('^', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7471 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 562: -#line 3112 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('&', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7479 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 563: -#line 3116 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(OROR, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7487 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 564: -#line 3120 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(ANDAND, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7495 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 565: -#line 3124 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(EQCOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7503 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 566: -#line 3128 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(NECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7511 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 567: -#line 3132 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(LECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7519 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 568: -#line 3136 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(GECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7527 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 569: -#line 3140 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('<', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7535 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 570: -#line 3144 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('>', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7543 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 571: -#line 3148 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(LSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7551 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 572: -#line 3152 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(RSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7559 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 573: -#line 3156 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('?', (yyvsp[-4].u.expr), (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7567 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 574: -#line 3160 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('[', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); -} -#line 7575 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 575: -#line 3164 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); -} -#line 7583 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 576: -#line 3168 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[-2].u.expr)); -} -#line 7591 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 577: -#line 3172 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('.', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7599 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 578: -#line 3176 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 7607 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 579: -#line 3180 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (yyvsp[-1].u.expr); -} -#line 7615 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 580: -#line 3187 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression((yyvsp[0].u.integer)); -} -#line 7623 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 581: -#line 3191 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(true); -} -#line 7631 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7879 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; case 582: -#line 3195 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(false); -} -#line 7639 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 583: -#line 3199 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression((yyvsp[0].u.integer)); -} -#line 7647 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 584: -#line 3203 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression((yyvsp[0].u.real)); -} -#line 7655 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 585: -#line 3207 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (yyvsp[0].u.expr); -} -#line 7663 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 586: -#line 3211 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (yyvsp[0].u.expr); -} -#line 7671 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 587: -#line 3215 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression((yyvsp[0].u.identifier), current_scope, global_scope, current_lexer); -} -#line 7679 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 588: -#line 3219 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - // A variable named "final". C++11 explicitly permits this. - CPPIdentifier *ident = new CPPIdentifier("final", (yylsp[0])); - (yyval.u.expr) = new CPPExpression(ident, current_scope, global_scope, current_lexer); -} -#line 7689 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 589: -#line 3225 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - // A variable named "override". C++11 explicitly permits this. - CPPIdentifier *ident = new CPPIdentifier("override", (yylsp[0])); - (yyval.u.expr) = new CPPExpression(ident, current_scope, global_scope, current_lexer); -} -#line 7699 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 590: -#line 3231 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::get_nullptr()); -} -#line 7707 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 591: -#line 3235 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = NULL; -} -#line 7715 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 592: -#line 3239 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = NULL; -} -#line 7723 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 593: -#line 3253 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (yyvsp[0].u.expr); -} -#line 7731 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 594: -#line 3257 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-2].u.type), (yyvsp[0].u.expr))); -} -#line 7739 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 595: -#line 3261 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_static_cast)); -} -#line 7747 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 596: -#line 3265 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_dynamic_cast)); -} -#line 7755 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 597: -#line 3269 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_const_cast)); -} -#line 7763 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 598: -#line 3273 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_reinterpret_cast)); -} -#line 7771 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 599: -#line 3277 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 3244 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_func((yyvsp[-1].u.type))); } -#line 7779 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7887 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 600: -#line 3281 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 583: +#line 3248 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_ellipsis_func((yyvsp[-1].u.identifier))); +} +#line 7895 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 584: +#line 3252 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression(CPPExpression::alignof_func((yyvsp[-1].u.type))); } -#line 7787 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7903 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 601: -#line 3285 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 585: +#line 3256 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[0].u.type))); } -#line 7795 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7911 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 602: -#line 3289 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 586: +#line 3260 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[-3].u.type), (yyvsp[-1].u.expr))); } -#line 7803 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7919 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 603: -#line 3293 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 587: +#line 3264 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPIdentifier ident(""); ident.add_name("std"); @@ -7814,11 +7930,11 @@ yyreduce: } (yyval.u.expr) = new CPPExpression(CPPExpression::typeid_op((yyvsp[-1].u.type), std_type_info)); } -#line 7818 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7934 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 604: -#line 3304 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 588: +#line 3275 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPIdentifier ident(""); ident.add_name("std"); @@ -7829,343 +7945,953 @@ yyreduce: } (yyval.u.expr) = new CPPExpression(CPPExpression::typeid_op((yyvsp[-1].u.expr), std_type_info)); } -#line 7833 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7949 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 605: -#line 3315 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 589: +#line 3286 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression(UNARY_NOT, (yyvsp[0].u.expr)); } -#line 7841 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7957 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 606: -#line 3319 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 590: +#line 3290 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression(UNARY_NEGATE, (yyvsp[0].u.expr)); } -#line 7849 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7965 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 607: -#line 3323 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 591: +#line 3294 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression(UNARY_MINUS, (yyvsp[0].u.expr)); } -#line 7857 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7973 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 608: -#line 3327 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 592: +#line 3298 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression(UNARY_PLUS, (yyvsp[0].u.expr)); } -#line 7865 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7981 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 609: -#line 3331 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 593: +#line 3302 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(UNARY_STAR, (yyvsp[0].u.expr)); +} +#line 7989 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 594: +#line 3306 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression(UNARY_REF, (yyvsp[0].u.expr)); } -#line 7873 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 7997 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 610: -#line 3335 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 595: +#line 3310 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression('*', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } -#line 7881 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8005 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 611: -#line 3339 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 596: +#line 3314 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression('/', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } -#line 7889 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8013 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 612: -#line 3343 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 597: +#line 3318 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression('%', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } -#line 7897 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8021 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 613: -#line 3347 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 598: +#line 3322 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression('+', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } -#line 7905 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8029 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 614: -#line 3351 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 599: +#line 3326 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression('-', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } -#line 7913 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8037 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 615: -#line 3355 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 600: +#line 3330 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression('|', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } -#line 7921 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8045 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 616: -#line 3359 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 601: +#line 3334 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression('^', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } -#line 7929 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8053 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 617: -#line 3363 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 602: +#line 3338 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression('&', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } -#line 7937 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8061 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 618: -#line 3367 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 603: +#line 3342 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression(OROR, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } -#line 7945 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8069 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 619: -#line 3371 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 604: +#line 3346 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression(ANDAND, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } -#line 7953 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8077 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 620: -#line 3375 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 605: +#line 3350 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression(EQCOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } -#line 7961 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8085 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 621: -#line 3379 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 606: +#line 3354 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression(NECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } -#line 7969 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8093 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 622: -#line 3383 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 607: +#line 3358 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression(LECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } -#line 7977 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8101 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 623: -#line 3387 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 608: +#line 3362 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression(GECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } -#line 7985 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8109 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 624: -#line 3391 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 609: +#line 3366 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression('<', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } -#line 7993 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8117 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 625: -#line 3395 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 610: +#line 3370 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression('>', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } -#line 8001 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8125 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 626: -#line 3399 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 611: +#line 3374 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression(LSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } -#line 8009 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8133 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 627: -#line 3403 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 612: +#line 3378 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression(RSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } -#line 8017 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8141 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 628: -#line 3407 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 613: +#line 3382 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression('?', (yyvsp[-4].u.expr), (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); } -#line 8025 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8149 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 629: -#line 3411 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 614: +#line 3386 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression('[', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); } -#line 8033 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 630: -#line 3415 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); -} -#line 8041 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 631: -#line 3419 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[-2].u.expr)); -} -#line 8049 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 632: -#line 3423 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression('.', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 8057 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 633: -#line 3427 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} -#line 8065 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 634: -#line 3431 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (yyvsp[-1].u.expr); -} -#line 8073 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 635: -#line 3438 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression((yyvsp[0].u.integer)); -} -#line 8081 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 636: -#line 3442 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(true); -} -#line 8089 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 637: -#line 3446 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression(false); -} -#line 8097 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 638: -#line 3450 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression((yyvsp[0].u.integer)); -} -#line 8105 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 639: -#line 3454 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression((yyvsp[0].u.real)); -} -#line 8113 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 640: -#line 3458 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (yyvsp[0].u.expr); -} -#line 8121 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 641: -#line 3462 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = (yyvsp[0].u.expr); -} -#line 8129 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 642: -#line 3466 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - (yyval.u.expr) = new CPPExpression((yyvsp[0].u.identifier), current_scope, global_scope, current_lexer); -} -#line 8137 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 643: -#line 3470 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - // A variable named "final". C++11 explicitly permits this. - CPPIdentifier *ident = new CPPIdentifier("final", (yylsp[0])); - (yyval.u.expr) = new CPPExpression(ident, current_scope, global_scope, current_lexer); -} -#line 8147 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ - break; - - case 644: -#line 3476 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ - { - // A variable named "override". C++11 explicitly permits this. - CPPIdentifier *ident = new CPPIdentifier("override", (yylsp[0])); - (yyval.u.expr) = new CPPExpression(ident, current_scope, global_scope, current_lexer); -} #line 8157 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 645: -#line 3482 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 615: +#line 3390 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - (yyval.u.expr) = new CPPExpression(CPPExpression::get_nullptr()); + (yyval.u.expr) = new CPPExpression('f', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); } #line 8165 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; + case 616: +#line 3394 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('f', (yyvsp[-2].u.expr)); +} +#line 8173 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 617: +#line 3398 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('.', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 8181 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 618: +#line 3402 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 8189 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 619: +#line 3406 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (yyvsp[-1].u.expr); +} +#line 8197 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 620: +#line 3413 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression((yyvsp[0].u.integer)); +} +#line 8205 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 621: +#line 3417 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(true); +} +#line 8213 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 622: +#line 3421 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(false); +} +#line 8221 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 623: +#line 3425 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression((yyvsp[0].u.integer)); +} +#line 8229 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 624: +#line 3429 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression((yyvsp[0].u.real)); +} +#line 8237 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 625: +#line 3433 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (yyvsp[0].u.expr); +} +#line 8245 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 626: +#line 3437 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (yyvsp[0].u.expr); +} +#line 8253 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 627: +#line 3441 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression((yyvsp[0].u.identifier), current_scope, global_scope, current_lexer); +} +#line 8261 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 628: +#line 3445 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + // A variable named "final". C++11 explicitly permits this. + CPPIdentifier *ident = new CPPIdentifier("final", (yylsp[0])); + (yyval.u.expr) = new CPPExpression(ident, current_scope, global_scope, current_lexer); +} +#line 8271 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 629: +#line 3451 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + // A variable named "override". C++11 explicitly permits this. + CPPIdentifier *ident = new CPPIdentifier("override", (yylsp[0])); + (yyval.u.expr) = new CPPExpression(ident, current_scope, global_scope, current_lexer); +} +#line 8281 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 630: +#line 3457 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::get_nullptr()); +} +#line 8289 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 631: +#line 3461 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = NULL; +} +#line 8297 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 632: +#line 3465 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = NULL; +} +#line 8305 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 633: +#line 3469 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::type_trait(KW_HAS_VIRTUAL_DESTRUCTOR, (yyvsp[-1].u.type))); +} +#line 8313 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 634: +#line 3473 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::type_trait(KW_IS_ABSTRACT, (yyvsp[-1].u.type))); +} +#line 8321 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 635: +#line 3477 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::type_trait(KW_IS_CLASS, (yyvsp[-3].u.type), (yyvsp[-1].u.type))); +} +#line 8329 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 636: +#line 3481 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::type_trait(KW_IS_CLASS, (yyvsp[-1].u.type))); +} +#line 8337 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 637: +#line 3485 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::type_trait(KW_IS_CONSTRUCTIBLE, (yyvsp[-1].u.type))); +} +#line 8345 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 638: +#line 3489 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::type_trait(KW_IS_CONSTRUCTIBLE, (yyvsp[-3].u.type), (yyvsp[-1].u.type))); +} +#line 8353 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 639: +#line 3493 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::type_trait(KW_IS_CONVERTIBLE_TO, (yyvsp[-3].u.type), (yyvsp[-1].u.type))); +} +#line 8361 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 640: +#line 3497 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::type_trait(KW_IS_DESTRUCTIBLE, (yyvsp[-1].u.type))); +} +#line 8369 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 641: +#line 3501 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::type_trait(KW_IS_EMPTY, (yyvsp[-1].u.type))); +} +#line 8377 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 642: +#line 3505 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::type_trait(KW_IS_ENUM, (yyvsp[-1].u.type))); +} +#line 8385 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 643: +#line 3509 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::type_trait(KW_IS_FINAL, (yyvsp[-1].u.type))); +} +#line 8393 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 644: +#line 3513 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::type_trait(KW_IS_FUNDAMENTAL, (yyvsp[-1].u.type))); +} +#line 8401 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 645: +#line 3517 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::type_trait(KW_IS_POD, (yyvsp[-1].u.type))); +} +#line 8409 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 646: +#line 3521 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::type_trait(KW_IS_POLYMORPHIC, (yyvsp[-1].u.type))); +} +#line 8417 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 647: +#line 3525 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::type_trait(KW_IS_STANDARD_LAYOUT, (yyvsp[-1].u.type))); +} +#line 8425 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 648: +#line 3529 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::type_trait(KW_IS_TRIVIAL, (yyvsp[-1].u.type))); +} +#line 8433 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 649: +#line 3533 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::type_trait(KW_IS_UNION, (yyvsp[-1].u.type))); +} +#line 8441 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 650: +#line 3547 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (yyvsp[0].u.expr); +} +#line 8449 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 651: +#line 3551 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-2].u.type), (yyvsp[0].u.expr))); +} +#line 8457 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 652: +#line 3555 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_static_cast)); +} +#line 8465 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + case 653: -#line 3503 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ +#line 3559 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_dynamic_cast)); +} +#line 8473 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 654: +#line 3563 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_const_cast)); +} +#line 8481 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 655: +#line 3567 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr), CPPExpression::T_reinterpret_cast)); +} +#line 8489 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 656: +#line 3571 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_func((yyvsp[-1].u.type))); +} +#line 8497 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 657: +#line 3575 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_ellipsis_func((yyvsp[-1].u.identifier))); +} +#line 8505 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 658: +#line 3579 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::alignof_func((yyvsp[-1].u.type))); +} +#line 8513 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 659: +#line 3583 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[0].u.type))); +} +#line 8521 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 660: +#line 3587 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[-3].u.type), (yyvsp[-1].u.expr))); +} +#line 8529 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 661: +#line 3591 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + CPPIdentifier ident(""); + ident.add_name("std"); + ident.add_name("type_info"); + CPPType *std_type_info = ident.find_type(current_scope, global_scope, false, current_lexer); + if (!std_type_info) { + yywarning("cannot use typeid before including ", (yylsp[-3])); + } + (yyval.u.expr) = new CPPExpression(CPPExpression::typeid_op((yyvsp[-1].u.type), std_type_info)); +} +#line 8544 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 662: +#line 3602 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + CPPIdentifier ident(""); + ident.add_name("std"); + ident.add_name("type_info"); + CPPType *std_type_info = ident.find_type(current_scope, global_scope, false, current_lexer); + if (!std_type_info) { + yywarning("cannot use typeid before including ", (yylsp[-3])); + } + (yyval.u.expr) = new CPPExpression(CPPExpression::typeid_op((yyvsp[-1].u.expr), std_type_info)); +} +#line 8559 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 663: +#line 3613 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(UNARY_NOT, (yyvsp[0].u.expr)); +} +#line 8567 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 664: +#line 3617 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(UNARY_NEGATE, (yyvsp[0].u.expr)); +} +#line 8575 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 665: +#line 3621 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(UNARY_MINUS, (yyvsp[0].u.expr)); +} +#line 8583 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 666: +#line 3625 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(UNARY_PLUS, (yyvsp[0].u.expr)); +} +#line 8591 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 667: +#line 3629 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(UNARY_REF, (yyvsp[0].u.expr)); +} +#line 8599 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 668: +#line 3633 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('*', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 8607 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 669: +#line 3637 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('/', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 8615 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 670: +#line 3641 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('%', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 8623 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 671: +#line 3645 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('+', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 8631 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 672: +#line 3649 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('-', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 8639 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 673: +#line 3653 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('|', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 8647 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 674: +#line 3657 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('^', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 8655 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 675: +#line 3661 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('&', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 8663 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 676: +#line 3665 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(OROR, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 8671 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 677: +#line 3669 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(ANDAND, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 8679 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 678: +#line 3673 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(EQCOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 8687 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 679: +#line 3677 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(NECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 8695 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 680: +#line 3681 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(LECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 8703 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 681: +#line 3685 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(GECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 8711 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 682: +#line 3689 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('<', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 8719 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 683: +#line 3693 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('>', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 8727 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 684: +#line 3697 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(LSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 8735 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 685: +#line 3701 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(RSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 8743 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 686: +#line 3705 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('?', (yyvsp[-4].u.expr), (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 8751 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 687: +#line 3709 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('[', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); +} +#line 8759 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 688: +#line 3713 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('f', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); +} +#line 8767 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 689: +#line 3717 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('f', (yyvsp[-2].u.expr)); +} +#line 8775 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 690: +#line 3721 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression('.', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 8783 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 691: +#line 3725 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); +} +#line 8791 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 692: +#line 3729 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (yyvsp[-1].u.expr); +} +#line 8799 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 693: +#line 3736 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression((yyvsp[0].u.integer)); +} +#line 8807 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 694: +#line 3740 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(true); +} +#line 8815 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 695: +#line 3744 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(false); +} +#line 8823 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 696: +#line 3748 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression((yyvsp[0].u.integer)); +} +#line 8831 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 697: +#line 3752 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression((yyvsp[0].u.real)); +} +#line 8839 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 698: +#line 3756 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (yyvsp[0].u.expr); +} +#line 8847 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 699: +#line 3760 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = (yyvsp[0].u.expr); +} +#line 8855 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 700: +#line 3764 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression((yyvsp[0].u.identifier), current_scope, global_scope, current_lexer); +} +#line 8863 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 701: +#line 3768 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + // A variable named "final". C++11 explicitly permits this. + CPPIdentifier *ident = new CPPIdentifier("final", (yylsp[0])); + (yyval.u.expr) = new CPPExpression(ident, current_scope, global_scope, current_lexer); +} +#line 8873 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 702: +#line 3774 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + // A variable named "override". C++11 explicitly permits this. + CPPIdentifier *ident = new CPPIdentifier("override", (yylsp[0])); + (yyval.u.expr) = new CPPExpression(ident, current_scope, global_scope, current_lexer); +} +#line 8883 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 703: +#line 3780 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.expr) = new CPPExpression(CPPExpression::get_nullptr()); +} +#line 8891 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 711: +#line 3801 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, true); if (type == NULL) { @@ -8173,11 +8899,11 @@ yyreduce: } (yyval.u.type) = type; } -#line 8177 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8903 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 654: -#line 3511 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 712: +#line 3809 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { CPPType *type = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, true, current_lexer); if (type == NULL) { @@ -8185,143 +8911,169 @@ yyreduce: } (yyval.u.type) = type; } -#line 8189 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8915 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 655: -#line 3519 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 713: +#line 3817 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.type) = CPPType::new_type(new CPPTBDType((yyvsp[0].u.identifier))); } -#line 8197 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8923 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 656: -#line 3547 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 714: +#line 3821 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + CPPClassTemplateParameter *ctp = new CPPClassTemplateParameter((yyvsp[-1].u.identifier)); + ctp->_packed = true; + (yyval.u.type) = CPPType::new_type(ctp); +} +#line 8933 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 715: +#line 3851 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.identifier) = (yyvsp[0].u.identifier); } -#line 8205 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8941 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 657: -#line 3551 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 716: +#line 3855 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.identifier) = (yyvsp[0].u.identifier); } -#line 8213 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8949 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 658: -#line 3555 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 717: +#line 3859 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.identifier) = (yyvsp[0].u.identifier); +} +#line 8957 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 718: +#line 3863 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.identifier) = new CPPIdentifier("final", (yylsp[0])); } -#line 8221 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8965 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 659: -#line 3559 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 719: +#line 3867 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.identifier) = new CPPIdentifier("override", (yylsp[0])); } -#line 8229 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8973 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 660: -#line 3563 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 720: +#line 3871 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // This is not a keyword in Python, so it is useful to be able to use this // in MAKE_PROPERTY definitions, etc. (yyval.u.identifier) = new CPPIdentifier("signed", (yylsp[0])); } -#line 8239 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8983 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 661: -#line 3569 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 721: +#line 3877 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.identifier) = new CPPIdentifier("float", (yylsp[0])); } -#line 8247 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8991 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 662: -#line 3573 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 722: +#line 3881 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.identifier) = new CPPIdentifier("public", (yylsp[0])); } -#line 8255 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 8999 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 663: -#line 3577 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 723: +#line 3885 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.identifier) = new CPPIdentifier("private", (yylsp[0])); } -#line 8263 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 9007 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 664: -#line 3581 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 724: +#line 3889 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.identifier) = new CPPIdentifier("static", (yylsp[0])); } -#line 8271 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 9015 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 665: -#line 3592 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 725: +#line 3900 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.identifier) = (yyvsp[0].u.identifier); } -#line 8279 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 9023 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 666: -#line 3596 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 726: +#line 3904 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.identifier) = (yyvsp[0].u.identifier); } -#line 8287 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 9031 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 667: -#line 3600 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 727: +#line 3908 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + { + (yyval.u.identifier) = (yyvsp[0].u.identifier); +} +#line 9039 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ + break; + + case 728: +#line 3912 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.identifier) = new CPPIdentifier("override", (yylsp[0])); } -#line 8295 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 9047 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 668: -#line 3608 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 729: +#line 3920 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = new CPPExpression((yyvsp[0].str)); } -#line 8303 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 9055 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 669: -#line 3612 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 730: +#line 3924 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { (yyval.u.expr) = (yyvsp[0].u.expr); } -#line 8311 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 9063 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 670: -#line 3616 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 731: +#line 3928 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // The right string takes on the literal type of the left. (yyval.u.expr) = (yyvsp[-1].u.expr); (yyval.u.expr)->_str += (yyvsp[0].str); } -#line 8321 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 9073 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; - case 671: -#line 3622 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ + case 732: +#line 3934 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { // We have to check that the two literal types match up. (yyval.u.expr) = (yyvsp[-1].u.expr); @@ -8330,11 +9082,11 @@ yyreduce: } (yyval.u.expr)->_str += (yyvsp[0].u.expr)->_str; } -#line 8334 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 9086 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; -#line 8338 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ +#line 9090 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires diff --git a/dtool/src/cppparser/cppBison.h.prebuilt b/dtool/src/cppparser/cppBison.h.prebuilt index 412b128300..223bfdf123 100644 --- a/dtool/src/cppparser/cppBison.h.prebuilt +++ b/dtool/src/cppparser/cppBison.h.prebuilt @@ -54,120 +54,138 @@ extern int cppyydebug; CUSTOM_LITERAL = 264, IDENTIFIER = 265, TYPENAME_IDENTIFIER = 266, - SCOPING = 267, - TYPEDEFNAME = 268, - ELLIPSIS = 269, - OROR = 270, - ANDAND = 271, - EQCOMPARE = 272, - NECOMPARE = 273, - LECOMPARE = 274, - GECOMPARE = 275, - LSHIFT = 276, - RSHIFT = 277, - POINTSAT_STAR = 278, - DOT_STAR = 279, - UNARY = 280, - UNARY_NOT = 281, - UNARY_NEGATE = 282, - UNARY_MINUS = 283, - UNARY_PLUS = 284, - UNARY_STAR = 285, - UNARY_REF = 286, - POINTSAT = 287, - SCOPE = 288, - PLUSPLUS = 289, - MINUSMINUS = 290, - TIMESEQUAL = 291, - DIVIDEEQUAL = 292, - MODEQUAL = 293, - PLUSEQUAL = 294, - MINUSEQUAL = 295, - OREQUAL = 296, - ANDEQUAL = 297, - XOREQUAL = 298, - LSHIFTEQUAL = 299, - RSHIFTEQUAL = 300, - KW_ALIGNAS = 301, - KW_ALIGNOF = 302, - KW_AUTO = 303, - KW_BEGIN_PUBLISH = 304, - KW_BLOCKING = 305, - KW_BOOL = 306, - KW_CATCH = 307, - KW_CHAR = 308, - KW_CHAR16_T = 309, - KW_CHAR32_T = 310, - KW_CLASS = 311, - KW_CONST = 312, - KW_CONSTEXPR = 313, - KW_CONST_CAST = 314, - KW_DECLTYPE = 315, - KW_DEFAULT = 316, - KW_DELETE = 317, - KW_DOUBLE = 318, - KW_DYNAMIC_CAST = 319, - KW_ELSE = 320, - KW_END_PUBLISH = 321, - KW_ENUM = 322, - KW_EXTENSION = 323, - KW_EXTERN = 324, - KW_EXPLICIT = 325, - KW_PUBLISHED = 326, - KW_FALSE = 327, - KW_FINAL = 328, - KW_FLOAT = 329, - KW_FRIEND = 330, - KW_FOR = 331, - KW_GOTO = 332, - KW_IF = 333, - KW_INLINE = 334, - KW_INT = 335, - KW_LONG = 336, - KW_MAKE_MAP_PROPERTY = 337, - KW_MAKE_PROPERTY = 338, - KW_MAKE_PROPERTY2 = 339, - KW_MAKE_SEQ = 340, - KW_MAKE_SEQ_PROPERTY = 341, - KW_MUTABLE = 342, - KW_NAMESPACE = 343, - KW_NEW = 344, - KW_NOEXCEPT = 345, - KW_NULLPTR = 346, - KW_OPERATOR = 347, - KW_OVERRIDE = 348, - KW_PRIVATE = 349, - KW_PROTECTED = 350, - KW_PUBLIC = 351, - KW_REGISTER = 352, - KW_REINTERPRET_CAST = 353, - KW_RETURN = 354, - KW_SHORT = 355, - KW_SIGNED = 356, - KW_SIZEOF = 357, - KW_STATIC = 358, - KW_STATIC_ASSERT = 359, - KW_STATIC_CAST = 360, - KW_STRUCT = 361, - KW_TEMPLATE = 362, - KW_THREAD_LOCAL = 363, - KW_THROW = 364, - KW_TRUE = 365, - KW_TRY = 366, - KW_TYPEDEF = 367, - KW_TYPEID = 368, - KW_TYPENAME = 369, - KW_UNION = 370, - KW_UNSIGNED = 371, - KW_USING = 372, - KW_VIRTUAL = 373, - KW_VOID = 374, - KW_VOLATILE = 375, - KW_WCHAR_T = 376, - KW_WHILE = 377, - START_CPP = 378, - START_CONST_EXPR = 379, - START_TYPE = 380 + TYPEPACK_IDENTIFIER = 267, + SCOPING = 268, + TYPEDEFNAME = 269, + ELLIPSIS = 270, + OROR = 271, + ANDAND = 272, + EQCOMPARE = 273, + NECOMPARE = 274, + LECOMPARE = 275, + GECOMPARE = 276, + LSHIFT = 277, + RSHIFT = 278, + POINTSAT_STAR = 279, + DOT_STAR = 280, + UNARY = 281, + UNARY_NOT = 282, + UNARY_NEGATE = 283, + UNARY_MINUS = 284, + UNARY_PLUS = 285, + UNARY_STAR = 286, + UNARY_REF = 287, + POINTSAT = 288, + SCOPE = 289, + PLUSPLUS = 290, + MINUSMINUS = 291, + TIMESEQUAL = 292, + DIVIDEEQUAL = 293, + MODEQUAL = 294, + PLUSEQUAL = 295, + MINUSEQUAL = 296, + OREQUAL = 297, + ANDEQUAL = 298, + XOREQUAL = 299, + LSHIFTEQUAL = 300, + RSHIFTEQUAL = 301, + KW_ALIGNAS = 302, + KW_ALIGNOF = 303, + KW_AUTO = 304, + KW_BEGIN_PUBLISH = 305, + KW_BLOCKING = 306, + KW_BOOL = 307, + KW_CATCH = 308, + KW_CHAR = 309, + KW_CHAR16_T = 310, + KW_CHAR32_T = 311, + KW_CLASS = 312, + KW_CONST = 313, + KW_CONSTEXPR = 314, + KW_CONST_CAST = 315, + KW_DECLTYPE = 316, + KW_DEFAULT = 317, + KW_DELETE = 318, + KW_DOUBLE = 319, + KW_DYNAMIC_CAST = 320, + KW_ELSE = 321, + KW_END_PUBLISH = 322, + KW_ENUM = 323, + KW_EXTENSION = 324, + KW_EXTERN = 325, + KW_EXPLICIT = 326, + KW_PUBLISHED = 327, + KW_FALSE = 328, + KW_FINAL = 329, + KW_FLOAT = 330, + KW_FRIEND = 331, + KW_FOR = 332, + KW_GOTO = 333, + KW_HAS_VIRTUAL_DESTRUCTOR = 334, + KW_IF = 335, + KW_INLINE = 336, + KW_INT = 337, + KW_IS_ABSTRACT = 338, + KW_IS_BASE_OF = 339, + KW_IS_CLASS = 340, + KW_IS_CONSTRUCTIBLE = 341, + KW_IS_CONVERTIBLE_TO = 342, + KW_IS_DESTRUCTIBLE = 343, + KW_IS_EMPTY = 344, + KW_IS_ENUM = 345, + KW_IS_FINAL = 346, + KW_IS_FUNDAMENTAL = 347, + KW_IS_POD = 348, + KW_IS_POLYMORPHIC = 349, + KW_IS_STANDARD_LAYOUT = 350, + KW_IS_TRIVIAL = 351, + KW_IS_UNION = 352, + KW_LONG = 353, + KW_MAKE_MAP_PROPERTY = 354, + KW_MAKE_PROPERTY = 355, + KW_MAKE_PROPERTY2 = 356, + KW_MAKE_SEQ = 357, + KW_MAKE_SEQ_PROPERTY = 358, + KW_MUTABLE = 359, + KW_NAMESPACE = 360, + KW_NEW = 361, + KW_NOEXCEPT = 362, + KW_NULLPTR = 363, + KW_OPERATOR = 364, + KW_OVERRIDE = 365, + KW_PRIVATE = 366, + KW_PROTECTED = 367, + KW_PUBLIC = 368, + KW_REGISTER = 369, + KW_REINTERPRET_CAST = 370, + KW_RETURN = 371, + KW_SHORT = 372, + KW_SIGNED = 373, + KW_SIZEOF = 374, + KW_STATIC = 375, + KW_STATIC_ASSERT = 376, + KW_STATIC_CAST = 377, + KW_STRUCT = 378, + KW_TEMPLATE = 379, + KW_THREAD_LOCAL = 380, + KW_THROW = 381, + KW_TRUE = 382, + KW_TRY = 383, + KW_TYPEDEF = 384, + KW_TYPEID = 385, + KW_TYPENAME = 386, + KW_UNDERLYING_TYPE = 387, + KW_UNION = 388, + KW_UNSIGNED = 389, + KW_USING = 390, + KW_VIRTUAL = 391, + KW_VOID = 392, + KW_VOLATILE = 393, + KW_WCHAR_T = 394, + KW_WHILE = 395, + START_CPP = 396, + START_CONST_EXPR = 397, + START_TYPE = 398 }; #endif /* Tokens. */ @@ -180,120 +198,138 @@ extern int cppyydebug; #define CUSTOM_LITERAL 264 #define IDENTIFIER 265 #define TYPENAME_IDENTIFIER 266 -#define SCOPING 267 -#define TYPEDEFNAME 268 -#define ELLIPSIS 269 -#define OROR 270 -#define ANDAND 271 -#define EQCOMPARE 272 -#define NECOMPARE 273 -#define LECOMPARE 274 -#define GECOMPARE 275 -#define LSHIFT 276 -#define RSHIFT 277 -#define POINTSAT_STAR 278 -#define DOT_STAR 279 -#define UNARY 280 -#define UNARY_NOT 281 -#define UNARY_NEGATE 282 -#define UNARY_MINUS 283 -#define UNARY_PLUS 284 -#define UNARY_STAR 285 -#define UNARY_REF 286 -#define POINTSAT 287 -#define SCOPE 288 -#define PLUSPLUS 289 -#define MINUSMINUS 290 -#define TIMESEQUAL 291 -#define DIVIDEEQUAL 292 -#define MODEQUAL 293 -#define PLUSEQUAL 294 -#define MINUSEQUAL 295 -#define OREQUAL 296 -#define ANDEQUAL 297 -#define XOREQUAL 298 -#define LSHIFTEQUAL 299 -#define RSHIFTEQUAL 300 -#define KW_ALIGNAS 301 -#define KW_ALIGNOF 302 -#define KW_AUTO 303 -#define KW_BEGIN_PUBLISH 304 -#define KW_BLOCKING 305 -#define KW_BOOL 306 -#define KW_CATCH 307 -#define KW_CHAR 308 -#define KW_CHAR16_T 309 -#define KW_CHAR32_T 310 -#define KW_CLASS 311 -#define KW_CONST 312 -#define KW_CONSTEXPR 313 -#define KW_CONST_CAST 314 -#define KW_DECLTYPE 315 -#define KW_DEFAULT 316 -#define KW_DELETE 317 -#define KW_DOUBLE 318 -#define KW_DYNAMIC_CAST 319 -#define KW_ELSE 320 -#define KW_END_PUBLISH 321 -#define KW_ENUM 322 -#define KW_EXTENSION 323 -#define KW_EXTERN 324 -#define KW_EXPLICIT 325 -#define KW_PUBLISHED 326 -#define KW_FALSE 327 -#define KW_FINAL 328 -#define KW_FLOAT 329 -#define KW_FRIEND 330 -#define KW_FOR 331 -#define KW_GOTO 332 -#define KW_IF 333 -#define KW_INLINE 334 -#define KW_INT 335 -#define KW_LONG 336 -#define KW_MAKE_MAP_PROPERTY 337 -#define KW_MAKE_PROPERTY 338 -#define KW_MAKE_PROPERTY2 339 -#define KW_MAKE_SEQ 340 -#define KW_MAKE_SEQ_PROPERTY 341 -#define KW_MUTABLE 342 -#define KW_NAMESPACE 343 -#define KW_NEW 344 -#define KW_NOEXCEPT 345 -#define KW_NULLPTR 346 -#define KW_OPERATOR 347 -#define KW_OVERRIDE 348 -#define KW_PRIVATE 349 -#define KW_PROTECTED 350 -#define KW_PUBLIC 351 -#define KW_REGISTER 352 -#define KW_REINTERPRET_CAST 353 -#define KW_RETURN 354 -#define KW_SHORT 355 -#define KW_SIGNED 356 -#define KW_SIZEOF 357 -#define KW_STATIC 358 -#define KW_STATIC_ASSERT 359 -#define KW_STATIC_CAST 360 -#define KW_STRUCT 361 -#define KW_TEMPLATE 362 -#define KW_THREAD_LOCAL 363 -#define KW_THROW 364 -#define KW_TRUE 365 -#define KW_TRY 366 -#define KW_TYPEDEF 367 -#define KW_TYPEID 368 -#define KW_TYPENAME 369 -#define KW_UNION 370 -#define KW_UNSIGNED 371 -#define KW_USING 372 -#define KW_VIRTUAL 373 -#define KW_VOID 374 -#define KW_VOLATILE 375 -#define KW_WCHAR_T 376 -#define KW_WHILE 377 -#define START_CPP 378 -#define START_CONST_EXPR 379 -#define START_TYPE 380 +#define TYPEPACK_IDENTIFIER 267 +#define SCOPING 268 +#define TYPEDEFNAME 269 +#define ELLIPSIS 270 +#define OROR 271 +#define ANDAND 272 +#define EQCOMPARE 273 +#define NECOMPARE 274 +#define LECOMPARE 275 +#define GECOMPARE 276 +#define LSHIFT 277 +#define RSHIFT 278 +#define POINTSAT_STAR 279 +#define DOT_STAR 280 +#define UNARY 281 +#define UNARY_NOT 282 +#define UNARY_NEGATE 283 +#define UNARY_MINUS 284 +#define UNARY_PLUS 285 +#define UNARY_STAR 286 +#define UNARY_REF 287 +#define POINTSAT 288 +#define SCOPE 289 +#define PLUSPLUS 290 +#define MINUSMINUS 291 +#define TIMESEQUAL 292 +#define DIVIDEEQUAL 293 +#define MODEQUAL 294 +#define PLUSEQUAL 295 +#define MINUSEQUAL 296 +#define OREQUAL 297 +#define ANDEQUAL 298 +#define XOREQUAL 299 +#define LSHIFTEQUAL 300 +#define RSHIFTEQUAL 301 +#define KW_ALIGNAS 302 +#define KW_ALIGNOF 303 +#define KW_AUTO 304 +#define KW_BEGIN_PUBLISH 305 +#define KW_BLOCKING 306 +#define KW_BOOL 307 +#define KW_CATCH 308 +#define KW_CHAR 309 +#define KW_CHAR16_T 310 +#define KW_CHAR32_T 311 +#define KW_CLASS 312 +#define KW_CONST 313 +#define KW_CONSTEXPR 314 +#define KW_CONST_CAST 315 +#define KW_DECLTYPE 316 +#define KW_DEFAULT 317 +#define KW_DELETE 318 +#define KW_DOUBLE 319 +#define KW_DYNAMIC_CAST 320 +#define KW_ELSE 321 +#define KW_END_PUBLISH 322 +#define KW_ENUM 323 +#define KW_EXTENSION 324 +#define KW_EXTERN 325 +#define KW_EXPLICIT 326 +#define KW_PUBLISHED 327 +#define KW_FALSE 328 +#define KW_FINAL 329 +#define KW_FLOAT 330 +#define KW_FRIEND 331 +#define KW_FOR 332 +#define KW_GOTO 333 +#define KW_HAS_VIRTUAL_DESTRUCTOR 334 +#define KW_IF 335 +#define KW_INLINE 336 +#define KW_INT 337 +#define KW_IS_ABSTRACT 338 +#define KW_IS_BASE_OF 339 +#define KW_IS_CLASS 340 +#define KW_IS_CONSTRUCTIBLE 341 +#define KW_IS_CONVERTIBLE_TO 342 +#define KW_IS_DESTRUCTIBLE 343 +#define KW_IS_EMPTY 344 +#define KW_IS_ENUM 345 +#define KW_IS_FINAL 346 +#define KW_IS_FUNDAMENTAL 347 +#define KW_IS_POD 348 +#define KW_IS_POLYMORPHIC 349 +#define KW_IS_STANDARD_LAYOUT 350 +#define KW_IS_TRIVIAL 351 +#define KW_IS_UNION 352 +#define KW_LONG 353 +#define KW_MAKE_MAP_PROPERTY 354 +#define KW_MAKE_PROPERTY 355 +#define KW_MAKE_PROPERTY2 356 +#define KW_MAKE_SEQ 357 +#define KW_MAKE_SEQ_PROPERTY 358 +#define KW_MUTABLE 359 +#define KW_NAMESPACE 360 +#define KW_NEW 361 +#define KW_NOEXCEPT 362 +#define KW_NULLPTR 363 +#define KW_OPERATOR 364 +#define KW_OVERRIDE 365 +#define KW_PRIVATE 366 +#define KW_PROTECTED 367 +#define KW_PUBLIC 368 +#define KW_REGISTER 369 +#define KW_REINTERPRET_CAST 370 +#define KW_RETURN 371 +#define KW_SHORT 372 +#define KW_SIGNED 373 +#define KW_SIZEOF 374 +#define KW_STATIC 375 +#define KW_STATIC_ASSERT 376 +#define KW_STATIC_CAST 377 +#define KW_STRUCT 378 +#define KW_TEMPLATE 379 +#define KW_THREAD_LOCAL 380 +#define KW_THROW 381 +#define KW_TRUE 382 +#define KW_TRY 383 +#define KW_TYPEDEF 384 +#define KW_TYPEID 385 +#define KW_TYPENAME 386 +#define KW_UNDERLYING_TYPE 387 +#define KW_UNION 388 +#define KW_UNSIGNED 389 +#define KW_USING 390 +#define KW_VIRTUAL 391 +#define KW_VOID 392 +#define KW_VOLATILE 393 +#define KW_WCHAR_T 394 +#define KW_WHILE 395 +#define START_CPP 396 +#define START_CONST_EXPR 397 +#define START_TYPE 398 /* Value type. */ diff --git a/dtool/src/cppparser/cppBison.yxx b/dtool/src/cppparser/cppBison.yxx index d2d9da8458..f5200316d0 100644 --- a/dtool/src/cppparser/cppBison.yxx +++ b/dtool/src/cppparser/cppBison.yxx @@ -212,7 +212,7 @@ pop_struct() { %token CHAR_TOK %token SIMPLE_STRING SIMPLE_IDENTIFIER %token STRING_LITERAL CUSTOM_LITERAL -%token IDENTIFIER TYPENAME_IDENTIFIER SCOPING +%token IDENTIFIER TYPENAME_IDENTIFIER TYPEPACK_IDENTIFIER SCOPING %token TYPEDEFNAME %token ELLIPSIS @@ -280,9 +280,25 @@ pop_struct() { %token KW_FRIEND %token KW_FOR %token KW_GOTO +%token KW_HAS_VIRTUAL_DESTRUCTOR %token KW_IF %token KW_INLINE %token KW_INT +%token KW_IS_ABSTRACT +%token KW_IS_BASE_OF +%token KW_IS_CLASS +%token KW_IS_CONSTRUCTIBLE +%token KW_IS_CONVERTIBLE_TO +%token KW_IS_DESTRUCTIBLE +%token KW_IS_EMPTY +%token KW_IS_ENUM +%token KW_IS_FINAL +%token KW_IS_FUNDAMENTAL +%token KW_IS_POD +%token KW_IS_POLYMORPHIC +%token KW_IS_STANDARD_LAYOUT +%token KW_IS_TRIVIAL +%token KW_IS_UNION %token KW_LONG %token KW_MAKE_MAP_PROPERTY %token KW_MAKE_PROPERTY @@ -317,6 +333,7 @@ pop_struct() { %token KW_TYPEDEF %token KW_TYPEID %token KW_TYPENAME +%token KW_UNDERLYING_TYPE %token KW_UNION %token KW_UNSIGNED %token KW_USING @@ -354,9 +371,10 @@ pop_struct() { %type formal_parameter %type not_paren_formal_parameter_identifier %type formal_parameter_identifier +%type parameter_pack_identifier %type not_paren_empty_instance_identifier %type empty_instance_identifier -%type type +%type type type_pack %type type_decl %type var_type_decl %type predefined_type @@ -447,6 +465,10 @@ constructor_init: name '(' optional_const_expr_comma ')' { delete $3; +} + | name '(' optional_const_expr_comma ')' ELLIPSIS +{ + delete $3; } | name '{' optional_const_expr_comma '}' { @@ -1187,26 +1209,38 @@ function_post: { $$ = 0; } - | KW_CONST + | function_post KW_CONST { - $$ = (int)CPPFunctionType::F_const_method; + $$ = $1 | (int)CPPFunctionType::F_const_method; +} + | function_post KW_VOLATILE +{ + $$ = $1 | (int)CPPFunctionType::F_volatile_method; } | function_post KW_NOEXCEPT { - $$ = (int)CPPFunctionType::F_noexcept; + $$ = $1 | (int)CPPFunctionType::F_noexcept; } | function_post KW_FINAL { - $$ = (int)CPPFunctionType::F_final; + $$ = $1 | (int)CPPFunctionType::F_final; } | function_post KW_OVERRIDE { - $$ = (int)CPPFunctionType::F_override; + $$ = $1 | (int)CPPFunctionType::F_override; +} + | function_post '&' +{ + $$ = $1 | (int)CPPFunctionType::F_lvalue_method; +} + | function_post ANDAND +{ + $$ = $1 | (int)CPPFunctionType::F_rvalue_method; } | function_post KW_MUTABLE { // Used for lambdas, currently ignored. - $$ = 0; + $$ = $1; } | function_post KW_THROW '(' ')' { @@ -1215,6 +1249,10 @@ function_post: | function_post KW_THROW '(' name ')' { $$ = $1; +} + | function_post KW_THROW '(' name ELLIPSIS ')' +{ + $$ = $1; } /* | function_post '[' '[' attribute_specifiers ']' ']' { @@ -1418,22 +1456,35 @@ template_nonempty_formal_parameters: } ; +typename_keyword: + KW_CLASS + | KW_TYPENAME + ; + template_formal_parameter: - KW_CLASS name + typename_keyword +{ + $$ = CPPType::new_type(new CPPClassTemplateParameter((CPPIdentifier *)NULL)); +} + | typename_keyword name { $$ = CPPType::new_type(new CPPClassTemplateParameter($2)); } - | KW_CLASS name '=' full_type + | typename_keyword name '=' full_type { $$ = CPPType::new_type(new CPPClassTemplateParameter($2, $4)); } - | KW_TYPENAME name + | typename_keyword ELLIPSIS { - $$ = CPPType::new_type(new CPPClassTemplateParameter($2)); + CPPClassTemplateParameter *ctp = new CPPClassTemplateParameter((CPPIdentifier *)NULL); + ctp->_packed = true; + $$ = CPPType::new_type(ctp); } - | KW_TYPENAME name '=' full_type + | typename_keyword ELLIPSIS name { - $$ = CPPType::new_type(new CPPClassTemplateParameter($2, $4)); + CPPClassTemplateParameter *ctp = new CPPClassTemplateParameter($3); + ctp->_packed = true; + $$ = CPPType::new_type(ctp); } | template_formal_parameter_type formal_parameter_identifier template_parameter_maybe_initialize { @@ -1447,6 +1498,17 @@ template_formal_parameter: CPPInstance *inst = new CPPInstance($2, $3, 0, @3.file); inst->set_initializer($4); $$ = inst; +} + | template_formal_parameter_type parameter_pack_identifier +{ + CPPInstance *inst = new CPPInstance($1, $2, 0, @2.file); + $$ = inst; +} + | KW_CONST template_formal_parameter_type parameter_pack_identifier +{ + $3->add_modifier(IIT_const); + CPPInstance *inst = new CPPInstance($2, $3, 0, @3.file); + $$ = inst; } ; @@ -1467,6 +1529,14 @@ template_formal_parameter_type: yyerror(string("internal error resolving type ") + $1->get_fully_scoped_name(), @1); } assert($$ != NULL); +} + | TYPEPACK_IDENTIFIER +{ + $$ = $1->find_type(current_scope, global_scope, false, current_lexer); + if ($$ == NULL) { + yyerror(string("internal error resolving type ") + $1->get_fully_scoped_name(), @1); + } + assert($$ != NULL); } ; @@ -1785,6 +1855,23 @@ function_parameter: $4->add_modifier(IIT_const); $$ = new CPPInstance($3, $4, 0, @3.file); $$->set_initializer($5); +} + | type_pack parameter_pack_identifier maybe_initialize +{ + $$ = new CPPInstance($1, $2, 0, @2.file); + $$->set_initializer($3); +} + | KW_CONST type_pack parameter_pack_identifier maybe_initialize +{ + $3->add_modifier(IIT_const); + $$ = new CPPInstance($2, $3, 0, @3.file); + $$->set_initializer($4); +} + | KW_CONST KW_REGISTER type_pack parameter_pack_identifier maybe_initialize +{ + $4->add_modifier(IIT_const); + $$ = new CPPInstance($3, $4, 0, @3.file); + $$->set_initializer($5); } | KW_REGISTER function_parameter { @@ -1913,10 +2000,79 @@ formal_parameter_identifier: } ; +parameter_pack_identifier: + ELLIPSIS +{ + $$ = new CPPInstanceIdentifier((CPPIdentifier *)NULL); + $$->_packed = true; +} + | ELLIPSIS name +{ + $$ = new CPPInstanceIdentifier($2); + $$->_packed = true; +} + | KW_CONST parameter_pack_identifier %prec UNARY +{ + $$ = $2; + $$->add_modifier(IIT_const); +} + | KW_VOLATILE parameter_pack_identifier %prec UNARY +{ + $$ = $2; + $$->add_modifier(IIT_volatile); +} + | '*' parameter_pack_identifier %prec UNARY +{ + $$ = $2; + $$->add_modifier(IIT_pointer); +} + | '&' parameter_pack_identifier %prec UNARY +{ + $$ = $2; + $$->add_modifier(IIT_reference); +} + | ANDAND parameter_pack_identifier %prec UNARY +{ + $$ = $2; + $$->add_modifier(IIT_rvalue_reference); +} + | SCOPING '*' parameter_pack_identifier %prec UNARY +{ + $$ = $3; + $$->add_scoped_pointer_modifier($1); +} + | parameter_pack_identifier '[' optional_const_expr ']' +{ + $$ = $1; + $$->add_array_modifier($3); +} + | '(' parameter_pack_identifier ')' '(' function_parameter_list ')' function_post +{ + $$ = $2; + $$->add_modifier(IIT_paren); + $$->add_func_modifier($5, $7); +} + | '(' parameter_pack_identifier ')' +{ + $$ = $2; + $$->add_modifier(IIT_paren); +} + ; + not_paren_empty_instance_identifier: empty { $$ = new CPPInstanceIdentifier((CPPIdentifier *)NULL); +} + | ELLIPSIS +{ + $$ = new CPPInstanceIdentifier((CPPIdentifier *)NULL); + $$->_packed = true; +} + | ELLIPSIS name +{ + $$ = new CPPInstanceIdentifier($2); + $$->_packed = true; } | KW_CONST not_paren_empty_instance_identifier %prec UNARY { @@ -1959,6 +2115,16 @@ empty_instance_identifier: empty { $$ = new CPPInstanceIdentifier((CPPIdentifier *)NULL); +} + | ELLIPSIS +{ + $$ = new CPPInstanceIdentifier((CPPIdentifier *)NULL); + $$->_packed = true; +} + | ELLIPSIS name +{ + $$ = new CPPInstanceIdentifier($2); + $$->_packed = true; } | KW_CONST empty_instance_identifier %prec UNARY { @@ -2093,6 +2259,16 @@ type: str << *$3; yyerror("could not determine type of " + str.str(), @3); } +} + | KW_UNDERLYING_TYPE '(' full_type ')' +{ + CPPEnumType *enum_type = $3->as_enum_type(); + if (enum_type == NULL) { + yyerror("an enumeration type is required", @3); + $$ = $3; + } else { + $$ = enum_type->get_underlying_type(); + } } | KW_AUTO { @@ -2100,6 +2276,17 @@ type: } ; +type_pack: + TYPEPACK_IDENTIFIER +{ + $$ = $1->find_type(current_scope, global_scope, false, current_lexer); + if ($$ == NULL) { + yyerror(string("internal error resolving type ") + $1->get_fully_scoped_name(), @1); + } + assert($$ != NULL); +} + ; + type_decl: simple_type { @@ -2187,6 +2374,16 @@ type_decl: str << *$3; yyerror("could not determine type of " + str.str(), @3); } +} + | KW_UNDERLYING_TYPE '(' full_type ')' +{ + CPPEnumType *enum_type = $3->as_enum_type(); + if (enum_type == NULL) { + yyerror("an enumeration type is required", @3); + $$ = $3; + } else { + $$ = enum_type->get_underlying_type(); + } } | KW_AUTO { @@ -2251,6 +2448,16 @@ predefined_type: str << *$3; yyerror("could not determine type of " + str.str(), @3); } +} + | KW_UNDERLYING_TYPE '(' full_type ')' +{ + CPPEnumType *enum_type = $3->as_enum_type(); + if (enum_type == NULL) { + yyerror("an enumeration type is required", @3); + $$ = $3; + } else { + $$ = enum_type->get_underlying_type(); + } } | KW_AUTO { @@ -2279,6 +2486,15 @@ full_type: { $3->add_modifier(IIT_const); $$ = $3->unroll_type($2); +} + | type_pack empty_instance_identifier +{ + $$ = $2->unroll_type($1); +} + | KW_CONST type_pack empty_instance_identifier +{ + $3->add_modifier(IIT_const); + $$ = $3->unroll_type($2); } ; @@ -2693,6 +2909,7 @@ element: | CHAR_TOK | IDENTIFIER | TYPENAME_IDENTIFIER + | TYPEPACK_IDENTIFIER | SCOPING | SIMPLE_IDENTIFIER | ELLIPSIS | OROR | ANDAND @@ -2711,10 +2928,11 @@ element: | KW_OPERATOR | KW_OVERRIDE | KW_PRIVATE | KW_PROTECTED | KW_PUBLIC | KW_PUBLISHED | KW_REGISTER | KW_REINTERPRET_CAST | KW_RETURN | KW_SHORT | KW_SIGNED | KW_SIZEOF | KW_STATIC - | KW_STATIC_ASSERT | KW_STATIC_CAST | KW_STRUCT + | KW_STATIC_ASSERT | KW_STATIC_CAST | KW_STRUCT | KW_TEMPLATE | KW_THREAD_LOCAL | KW_THROW | KW_TRUE | KW_TRY | KW_TYPEDEF - | KW_TYPEID | KW_TYPENAME | KW_UNION | KW_UNSIGNED | KW_USING - | KW_VIRTUAL | KW_VOID | KW_VOLATILE | KW_WCHAR_T | KW_WHILE + | KW_TYPEID | KW_TYPENAME | KW_UNDERLYING_TYPE | KW_UNION + | KW_UNSIGNED | KW_USING | KW_VIRTUAL | KW_VOID | KW_VOLATILE + | KW_WCHAR_T | KW_WHILE { } | '+' | '-' | '*' | '/' | '&' | '|' | '^' | '!' | '~' | '=' | '%' @@ -2783,6 +3001,10 @@ no_angle_bracket_const_expr: | KW_SIZEOF '(' full_type ')' %prec UNARY { $$ = new CPPExpression(CPPExpression::sizeof_func($3)); +} + | KW_SIZEOF ELLIPSIS '(' name ')' %prec UNARY +{ + $$ = new CPPExpression(CPPExpression::sizeof_ellipsis_func($4)); } | KW_ALIGNOF '(' full_type ')' %prec UNARY { @@ -3021,6 +3243,10 @@ const_expr: | KW_SIZEOF '(' full_type ')' %prec UNARY { $$ = new CPPExpression(CPPExpression::sizeof_func($3)); +} + | KW_SIZEOF ELLIPSIS '(' name ')' %prec UNARY +{ + $$ = new CPPExpression(CPPExpression::sizeof_ellipsis_func($4)); } | KW_ALIGNOF '(' full_type ')' %prec UNARY { @@ -3238,6 +3464,74 @@ const_operand: | '[' capture_list ']' '(' function_parameter_list ')' function_post maybe_trailing_return_type '{' code '}' { $$ = NULL; +} + | KW_HAS_VIRTUAL_DESTRUCTOR '(' full_type ')' +{ + $$ = new CPPExpression(CPPExpression::type_trait(KW_HAS_VIRTUAL_DESTRUCTOR, $3)); +} + | KW_IS_ABSTRACT '(' full_type ')' +{ + $$ = new CPPExpression(CPPExpression::type_trait(KW_IS_ABSTRACT, $3)); +} + | KW_IS_BASE_OF '(' full_type ',' full_type ')' +{ + $$ = new CPPExpression(CPPExpression::type_trait(KW_IS_CLASS, $3, $5)); +} + | KW_IS_CLASS '(' full_type ')' +{ + $$ = new CPPExpression(CPPExpression::type_trait(KW_IS_CLASS, $3)); +} + | KW_IS_CONSTRUCTIBLE '(' full_type ')' +{ + $$ = new CPPExpression(CPPExpression::type_trait(KW_IS_CONSTRUCTIBLE, $3)); +} + | KW_IS_CONSTRUCTIBLE '(' full_type ',' full_type ')' +{ + $$ = new CPPExpression(CPPExpression::type_trait(KW_IS_CONSTRUCTIBLE, $3, $5)); +} + | KW_IS_CONVERTIBLE_TO '(' full_type ',' full_type ')' +{ + $$ = new CPPExpression(CPPExpression::type_trait(KW_IS_CONVERTIBLE_TO, $3, $5)); +} + | KW_IS_DESTRUCTIBLE '(' full_type ')' +{ + $$ = new CPPExpression(CPPExpression::type_trait(KW_IS_DESTRUCTIBLE, $3)); +} + | KW_IS_EMPTY '(' full_type ')' +{ + $$ = new CPPExpression(CPPExpression::type_trait(KW_IS_EMPTY, $3)); +} + | KW_IS_ENUM '(' full_type ')' +{ + $$ = new CPPExpression(CPPExpression::type_trait(KW_IS_ENUM, $3)); +} + | KW_IS_FINAL '(' full_type ')' +{ + $$ = new CPPExpression(CPPExpression::type_trait(KW_IS_FINAL, $3)); +} + | KW_IS_FUNDAMENTAL '(' full_type ')' +{ + $$ = new CPPExpression(CPPExpression::type_trait(KW_IS_FUNDAMENTAL, $3)); +} + | KW_IS_POD '(' full_type ')' +{ + $$ = new CPPExpression(CPPExpression::type_trait(KW_IS_POD, $3)); +} + | KW_IS_POLYMORPHIC '(' full_type ')' +{ + $$ = new CPPExpression(CPPExpression::type_trait(KW_IS_POLYMORPHIC, $3)); +} + | KW_IS_STANDARD_LAYOUT '(' full_type ')' +{ + $$ = new CPPExpression(CPPExpression::type_trait(KW_IS_STANDARD_LAYOUT, $3)); +} + | KW_IS_TRIVIAL '(' full_type ')' +{ + $$ = new CPPExpression(CPPExpression::type_trait(KW_IS_TRIVIAL, $3)); +} + | KW_IS_UNION '(' full_type ')' +{ + $$ = new CPPExpression(CPPExpression::type_trait(KW_IS_UNION, $3)); } ; @@ -3276,6 +3570,10 @@ formal_const_expr: | KW_SIZEOF '(' full_type ')' %prec UNARY { $$ = new CPPExpression(CPPExpression::sizeof_func($3)); +} + | KW_SIZEOF ELLIPSIS '(' name ')' %prec UNARY +{ + $$ = new CPPExpression(CPPExpression::sizeof_ellipsis_func($4)); } | KW_ALIGNOF '(' full_type ')' %prec UNARY { @@ -3518,6 +3816,12 @@ class_derivation_name: | KW_TYPENAME name { $$ = CPPType::new_type(new CPPTBDType($2)); +} + | name ELLIPSIS +{ + CPPClassTemplateParameter *ctp = new CPPClassTemplateParameter($1); + ctp->_packed = true; + $$ = CPPType::new_type(ctp); } ; @@ -3550,6 +3854,10 @@ name: | TYPENAME_IDENTIFIER { $$ = $1; +} + | TYPEPACK_IDENTIFIER +{ + $$ = $1; } | KW_FINAL { @@ -3595,6 +3903,10 @@ name_no_final: | TYPENAME_IDENTIFIER { $$ = $1; +} + | TYPEPACK_IDENTIFIER +{ + $$ = $1; } | KW_OVERRIDE { diff --git a/dtool/src/cppparser/cppClassTemplateParameter.cxx b/dtool/src/cppparser/cppClassTemplateParameter.cxx index 1c39532be5..602f367722 100644 --- a/dtool/src/cppparser/cppClassTemplateParameter.cxx +++ b/dtool/src/cppparser/cppClassTemplateParameter.cxx @@ -21,7 +21,8 @@ CPPClassTemplateParameter:: CPPClassTemplateParameter(CPPIdentifier *ident, CPPType *default_type) : CPPType(CPPFile()), _ident(ident), - _default_type(default_type) + _default_type(default_type), + _packed(false) { } @@ -41,8 +42,15 @@ is_fully_specified() const { void CPPClassTemplateParameter:: output(ostream &out, int indent_level, CPPScope *scope, bool complete) const { if (complete) { - out << "class "; - _ident->output(out, scope); + if (_ident != NULL) { + out << "class "; + _ident->output(out, scope); + } else { + out << "class"; + } + if (_packed) { + out << "..."; + } if (_default_type) { out << " = "; _default_type->output(out, indent_level, scope, false); @@ -82,6 +90,14 @@ is_equal(const CPPDeclaration *other) const { return false; } + if (_packed != ot->_packed) { + return false; + } + + if (_ident == NULL || ot->_ident == NULL) { + return _ident == ot->_ident; + } + return *_ident == *ot->_ident; } @@ -99,5 +115,13 @@ is_less(const CPPDeclaration *other) const { return _default_type < ot->_default_type; } + if (_packed != ot->_packed) { + return _packed < ot->_packed; + } + + if (_ident == NULL || ot->_ident == NULL) { + return _ident < ot->_ident; + } + return *_ident < *ot->_ident; } diff --git a/dtool/src/cppparser/cppClassTemplateParameter.h b/dtool/src/cppparser/cppClassTemplateParameter.h index 89923bd067..d936ca01ea 100644 --- a/dtool/src/cppparser/cppClassTemplateParameter.h +++ b/dtool/src/cppparser/cppClassTemplateParameter.h @@ -37,6 +37,7 @@ public: CPPIdentifier *_ident; CPPType *_default_type; + bool _packed; protected: virtual bool is_equal(const CPPDeclaration *other) const; diff --git a/dtool/src/cppparser/cppConstType.cxx b/dtool/src/cppparser/cppConstType.cxx index da5c0d18fe..f1851b5233 100644 --- a/dtool/src/cppparser/cppConstType.cxx +++ b/dtool/src/cppparser/cppConstType.cxx @@ -86,6 +86,22 @@ is_tbd() const { return _wrapped_around->is_tbd(); } +/** + * Returns true if the type is considered a fundamental type. + */ +bool CPPConstType:: +is_fundamental() const { + return _wrapped_around->is_fundamental(); +} + +/** + * Returns true if the type is considered a standard layout type. + */ +bool CPPConstType:: +is_standard_layout() const { + return _wrapped_around->is_standard_layout(); +} + /** * Returns true if the type is considered a Plain Old Data (POD) type. */ @@ -94,12 +110,20 @@ is_trivial() const { return _wrapped_around->is_trivial(); } +/** + * Returns true if the type can be constructed using the given argument. + */ +bool CPPConstType:: +is_constructible(const CPPType *given_type) const { + return _wrapped_around->is_constructible(given_type); +} + /** * Returns true if the type is default-constructible. */ bool CPPConstType:: is_default_constructible() const { - return false; + return _wrapped_around->is_default_constructible(); } /** @@ -110,6 +134,23 @@ is_copy_constructible() const { return _wrapped_around->is_copy_constructible(); } +/** + * Returns true if the type is destructible. + */ +bool CPPConstType:: +is_destructible() const { + return _wrapped_around->is_destructible(); +} + +/** + * Returns true if variables of this type may be implicitly converted to + * the other type. + */ +bool CPPConstType:: +is_convertible_to(const CPPType *other) const { + return _wrapped_around->is_convertible_to(other); +} + /** * This is a little more forgiving than is_equal(): it returns true if the * types appear to be referring to the same thing, even if they may have diff --git a/dtool/src/cppparser/cppConstType.h b/dtool/src/cppparser/cppConstType.h index dbc3e166d4..ef0943ca13 100644 --- a/dtool/src/cppparser/cppConstType.h +++ b/dtool/src/cppparser/cppConstType.h @@ -36,9 +36,14 @@ public: CPPScope *global_scope); virtual bool is_tbd() const; + virtual bool is_fundamental() const; + virtual bool is_standard_layout() const; virtual bool is_trivial() const; + virtual bool is_constructible(const CPPType *type) const; virtual bool is_default_constructible() const; virtual bool is_copy_constructible() const; + virtual bool is_destructible() const; + virtual bool is_convertible_to(const CPPType *other) const; virtual bool is_equivalent(const CPPType &other) const; virtual void output(ostream &out, int indent_level, CPPScope *scope, diff --git a/dtool/src/cppparser/cppDeclaration.cxx b/dtool/src/cppparser/cppDeclaration.cxx index d2399c0fbb..76f72c43e0 100644 --- a/dtool/src/cppparser/cppDeclaration.cxx +++ b/dtool/src/cppparser/cppDeclaration.cxx @@ -41,8 +41,13 @@ CPPDeclaration(const CPPDeclaration ©) : /** * */ -CPPDeclaration:: -~CPPDeclaration() { +CPPDeclaration &CPPDeclaration:: +operator = (const CPPDeclaration ©) { + _vis = copy._vis; + _template_scope = copy._template_scope; + _file = copy._file; + _leading_comment = copy._leading_comment; + return *this; } /** @@ -124,6 +129,7 @@ CPPDeclaration *CPPDeclaration:: substitute_decl(SubstDecl &subst, CPPScope *, CPPScope *) { SubstDecl::const_iterator si = subst.find(this); if (si != subst.end()) { + assert((*si).second != NULL); return (*si).second; } return this; diff --git a/dtool/src/cppparser/cppDeclaration.h b/dtool/src/cppparser/cppDeclaration.h index f1ce96820f..a06baa3123 100644 --- a/dtool/src/cppparser/cppDeclaration.h +++ b/dtool/src/cppparser/cppDeclaration.h @@ -89,7 +89,9 @@ public: CPPDeclaration(const CPPFile &file); CPPDeclaration(const CPPDeclaration ©); - virtual ~CPPDeclaration(); + virtual ~CPPDeclaration() {}; + + CPPDeclaration &operator = (const CPPDeclaration ©); bool operator == (const CPPDeclaration &other) const; bool operator != (const CPPDeclaration &other) const; @@ -139,6 +141,73 @@ public: virtual CPPMakeProperty *as_make_property(); virtual CPPMakeSeq *as_make_seq(); + inline const CPPInstance *as_instance() const { + return ((CPPDeclaration *)this)->as_instance(); + } + inline const CPPClassTemplateParameter *as_class_template_parameter() const { + return ((CPPDeclaration *)this)->as_class_template_parameter(); + } + inline const CPPTypedefType *as_typedef_type() const { + return ((CPPDeclaration *)this)->as_typedef_type(); + } + inline const CPPTypeDeclaration *as_type_declaration() const { + return ((CPPDeclaration *)this)->as_type_declaration(); + } + inline const CPPExpression *as_expression() const { + return ((CPPDeclaration *)this)->as_expression(); + } + inline const CPPType *as_type() const { + return ((CPPDeclaration *)this)->as_type(); + } + inline const CPPNamespace *as_namespace() const { + return ((CPPDeclaration *)this)->as_namespace(); + } + inline const CPPUsing *as_using() const { + return ((CPPDeclaration *)this)->as_using(); + } + inline const CPPSimpleType *as_simple_type() const { + return ((CPPDeclaration *)this)->as_simple_type(); + } + inline const CPPPointerType *as_pointer_type() const { + return ((CPPDeclaration *)this)->as_pointer_type(); + } + inline const CPPReferenceType *as_reference_type() const { + return ((CPPDeclaration *)this)->as_reference_type(); + } + inline const CPPArrayType *as_array_type() const { + return ((CPPDeclaration *)this)->as_array_type(); + } + inline const CPPConstType *as_const_type() const { + return ((CPPDeclaration *)this)->as_const_type(); + } + inline const CPPFunctionType *as_function_type() const { + return ((CPPDeclaration *)this)->as_function_type(); + } + inline const CPPFunctionGroup *as_function_group() const { + return ((CPPDeclaration *)this)->as_function_group(); + } + inline const CPPExtensionType *as_extension_type() const { + return ((CPPDeclaration *)this)->as_extension_type(); + } + inline const CPPStructType *as_struct_type() const { + return ((CPPDeclaration *)this)->as_struct_type(); + } + inline const CPPEnumType *as_enum_type() const { + return ((CPPDeclaration *)this)->as_enum_type(); + } + inline const CPPTBDType *as_tbd_type() const { + return ((CPPDeclaration *)this)->as_tbd_type(); + } + inline const CPPTypeProxy *as_type_proxy() const { + return ((CPPDeclaration *)this)->as_type_proxy(); + } + inline const CPPMakeProperty *as_make_property() const { + return ((CPPDeclaration *)this)->as_make_property(); + } + inline const CPPMakeSeq *as_make_seq() const { + return ((CPPDeclaration *)this)->as_make_seq(); + } + CPPVisibility _vis; CPPTemplateScope *_template_scope; CPPFile _file; diff --git a/dtool/src/cppparser/cppExpression.cxx b/dtool/src/cppparser/cppExpression.cxx index 7ef5ec85fb..f185514de4 100644 --- a/dtool/src/cppparser/cppExpression.cxx +++ b/dtool/src/cppparser/cppExpression.cxx @@ -24,6 +24,7 @@ #include "cppInstance.h" #include "cppFunctionGroup.h" #include "cppFunctionType.h" +#include "cppStructType.h" #include "cppBison.h" #include "pdtoa.h" @@ -389,6 +390,19 @@ typeid_op(CPPExpression *op1, CPPType *std_type_info) { return expr; } +/** + * Creates an expression that returns a particular type trait. + */ +CPPExpression CPPExpression:: +type_trait(int trait, CPPType *type, CPPType *arg) { + CPPExpression expr(0); + expr._type = T_type_trait; + expr._u._type_trait._trait = trait; + expr._u._type_trait._type = type; + expr._u._type_trait._arg = arg; + return expr; +} + /** * */ @@ -401,6 +415,17 @@ sizeof_func(CPPType *type) { return expr; } +/** + * + */ +CPPExpression CPPExpression:: +sizeof_ellipsis_func(CPPIdentifier *ident) { + CPPExpression expr(0); + expr._type = T_sizeof_ellipsis; + expr._u._ident = ident; + return expr; +} + /** * */ @@ -492,13 +517,6 @@ get_delete() { return expr; } -/** - * - */ -CPPExpression:: -~CPPExpression() { -} - /** * */ @@ -579,6 +597,7 @@ evaluate() const { case T_new: case T_default_new: case T_sizeof: + case T_sizeof_ellipsis: return Result(); case T_alignof: @@ -801,6 +820,95 @@ evaluate() const { case T_typeid_expr: return Result(); + case T_type_trait: + switch (_u._type_trait._trait) { + case KW_HAS_VIRTUAL_DESTRUCTOR: + { + CPPStructType *struct_type = _u._type_trait._type->as_struct_type(); + return Result(struct_type != NULL && struct_type->has_virtual_destructor()); + } + + case KW_IS_ABSTRACT: + { + CPPStructType *struct_type = _u._type_trait._type->as_struct_type(); + return Result(struct_type != NULL && struct_type->is_abstract()); + } + + case KW_IS_BASE_OF: + { + CPPStructType *struct_type1 = _u._type_trait._type->as_struct_type(); + CPPStructType *struct_type2 = _u._type_trait._arg->as_struct_type(); + return Result(struct_type1 != NULL && struct_type2 != NULL && struct_type1->is_base_of(struct_type2)); + } + + case KW_IS_CLASS: + { + CPPExtensionType *ext_type = _u._type_trait._type->as_extension_type(); + return Result(ext_type != NULL && ( + ext_type->_type == CPPExtensionType::T_class || + ext_type->_type == CPPExtensionType::T_struct)); + } + + case KW_IS_CONSTRUCTIBLE: + if (_u._type_trait._arg == NULL) { + return Result(_u._type_trait._type->is_default_constructible()); + } else { + return Result(_u._type_trait._type->is_constructible(_u._type_trait._arg)); + } + + case KW_IS_CONVERTIBLE_TO: + assert(_u._type_trait._arg != NULL); + return Result(_u._type_trait._type->is_convertible_to(_u._type_trait._arg)); + + case KW_IS_DESTRUCTIBLE: + return Result(_u._type_trait._type->is_destructible()); + + case KW_IS_EMPTY: + { + CPPStructType *struct_type = _u._type_trait._type->as_struct_type(); + return Result(struct_type != NULL && struct_type->is_empty()); + } + + case KW_IS_ENUM: + return Result(_u._type_trait._type->is_enum()); + + case KW_IS_FINAL: + { + CPPStructType *struct_type = _u._type_trait._type->as_struct_type(); + return Result(struct_type != NULL && struct_type->is_final()); + } + + case KW_IS_FUNDAMENTAL: + return Result(_u._type_trait._type->is_fundamental()); + + case KW_IS_POD: + return Result(_u._type_trait._type->is_trivial() && + _u._type_trait._type->is_standard_layout()); + + case KW_IS_POLYMORPHIC: + { + CPPStructType *struct_type = _u._type_trait._type->as_struct_type(); + return Result(struct_type != NULL && struct_type->is_polymorphic()); + } + + case KW_IS_STANDARD_LAYOUT: + return Result(_u._type_trait._type->is_standard_layout()); + + case KW_IS_TRIVIAL: + return Result(_u._type_trait._type->is_trivial()); + + case KW_IS_UNION: + { + CPPExtensionType *ext_type = _u._type_trait._type->as_extension_type(); + return Result(ext_type != NULL && + ext_type->_type == CPPExtensionType::T_union); + } + + default: + cerr << "**unexpected type trait**\n"; + abort(); + } + default: cerr << "**invalid operand**\n"; abort(); @@ -916,6 +1024,7 @@ determine_type() const { return CPPType::new_type(new CPPPointerType(_u._typecast._to)); case T_sizeof: + case T_sizeof_ellipsis: case T_alignof: // Note: this should actually be size_t, but that is defined as a typedef // in parser-inc. We could try to resolve it, but that's hacky. Eh, it's @@ -1057,6 +1166,9 @@ determine_type() const { case T_typeid_expr: return _u._typeid._std_type_info; + case T_type_trait: + return bool_type; + default: cerr << "**invalid operand**\n"; abort(); @@ -1113,6 +1225,9 @@ is_fully_specified() const { case T_alignof: return _u._typecast._to->is_fully_specified(); + case T_sizeof_ellipsis: + return _u._ident->is_fully_specified(); + case T_trinary_operation: if (!_u._op._op3->is_fully_specified()) { return false; @@ -1141,6 +1256,9 @@ is_fully_specified() const { case T_typeid_expr: return _u._typeid._expr->is_fully_specified(); + case T_type_trait: + return _u._type_trait._type->is_fully_specified(); + default: return true; } @@ -1276,6 +1394,13 @@ substitute_decl(CPPDeclaration::SubstDecl &subst, any_changed = any_changed || (rep->_u._typeid._expr != _u._typeid._expr); break; + case T_type_trait: + rep->_u._type_trait._type = + _u._type_trait._type->substitute_decl(subst, current_scope, global_scope) + ->as_type(); + any_changed = any_changed || (rep->_u._type_trait._type != _u._type_trait._type); + break; + default: break; } @@ -1350,6 +1475,9 @@ is_tbd() const { case T_typeid_expr: return _u._typeid._expr->is_tbd(); + case T_type_trait: + return _u._type_trait._type->is_tbd(); + default: return false; } @@ -1541,6 +1669,12 @@ output(ostream &out, int indent_level, CPPScope *scope, bool) const { out << ")"; break; + case T_sizeof_ellipsis: + out << "sizeof...("; + _u._ident->output(out, scope); + out << ")"; + break; + case T_alignof: out << "alignof("; _u._typecast._to->output(out, indent_level, scope, false); @@ -1753,6 +1887,65 @@ output(ostream &out, int indent_level, CPPScope *scope, bool) const { out << "delete"; break; + case T_type_trait: + switch (_u._type_trait._trait) { + case KW_HAS_VIRTUAL_DESTRUCTOR: + out << "__has_virtual_destructor"; + break; + case KW_IS_ABSTRACT: + out << "__is_abstract"; + break; + case KW_IS_BASE_OF: + out << "__is_base_of"; + break; + case KW_IS_CLASS: + out << "__is_class"; + break; + case KW_IS_CONSTRUCTIBLE: + out << "__is_constructible"; + break; + case KW_IS_CONVERTIBLE_TO: + out << "__is_convertible_to"; + break; + case KW_IS_DESTRUCTIBLE: + out << "__is_destructible"; + break; + case KW_IS_EMPTY: + out << "__is_empty"; + break; + case KW_IS_ENUM: + out << "__is_enum"; + break; + case KW_IS_FINAL: + out << "__is_final"; + break; + case KW_IS_FUNDAMENTAL: + out << "__is_fundamental"; + break; + case KW_IS_POD: + out << "__is_pod"; + break; + case KW_IS_POLYMORPHIC: + out << "__is_polymorphic"; + break; + case KW_IS_STANDARD_LAYOUT: + out << "__is_standard_layout"; + break; + case KW_IS_TRIVIAL: + out << "__is_trivial"; + break; + case KW_IS_UNION: + out << "__is_union"; + break; + default: + out << (evaluate().as_boolean() ? "true" : "false"); + return; + } + out << '('; + _u._type_trait._type->output(out, indent_level, scope, false); + out << ')'; + break; + default: out << "(** invalid operand type " << (int)_type << " **)"; } @@ -1864,6 +2057,7 @@ is_equal(const CPPDeclaration *other) const { return _u._fgroup == ot->_u._fgroup; case T_unknown_ident: + case T_sizeof_ellipsis: return *_u._ident == *ot->_u._ident; case T_typecast: @@ -1907,6 +2101,10 @@ is_equal(const CPPDeclaration *other) const { case T_typeid_expr: return _u._typeid._expr == ot->_u._typeid._expr; + case T_type_trait: + return _u._type_trait._trait == ot->_u._type_trait._trait && + _u._type_trait._type == ot->_u._type_trait._type; + default: cerr << "(** invalid operand type " << (int)_type << " **)"; } @@ -1954,6 +2152,7 @@ is_less(const CPPDeclaration *other) const { return *_u._fgroup < *ot->_u._fgroup; case T_unknown_ident: + case T_sizeof_ellipsis: return *_u._ident < *ot->_u._ident; case T_typecast: @@ -2007,6 +2206,12 @@ is_less(const CPPDeclaration *other) const { case T_typeid_expr: return *_u._typeid._expr < *ot->_u._typeid._expr; + case T_type_trait: + if (_u._type_trait._trait != ot->_u._type_trait._trait) { + return _u._type_trait._trait < ot->_u._type_trait._trait; + } + return *_u._type_trait._type < *ot->_u._type_trait._type; + default: cerr << "(** invalid operand type " << (int)_type << " **)"; } diff --git a/dtool/src/cppparser/cppExpression.h b/dtool/src/cppparser/cppExpression.h index 71df065fd9..c3483ef3e9 100644 --- a/dtool/src/cppparser/cppExpression.h +++ b/dtool/src/cppparser/cppExpression.h @@ -51,6 +51,7 @@ public: T_new, T_default_new, T_sizeof, + T_sizeof_ellipsis, T_alignof, T_unary_operation, T_binary_operation, @@ -59,6 +60,7 @@ public: T_raw_literal, T_typeid_type, T_typeid_expr, + T_type_trait, // These are used when parsing =default and =delete methods. T_default, @@ -81,7 +83,9 @@ public: static CPPExpression new_op(CPPType *type, CPPExpression *op1 = NULL); static CPPExpression typeid_op(CPPType *type, CPPType *std_type_info); static CPPExpression typeid_op(CPPExpression *op1, CPPType *std_type_info); + static CPPExpression type_trait(int trait, CPPType *type, CPPType *arg = NULL); static CPPExpression sizeof_func(CPPType *type); + static CPPExpression sizeof_ellipsis_func(CPPIdentifier *ident); static CPPExpression alignof_func(CPPType *type); static CPPExpression literal(unsigned long long value, CPPInstance *lit_op); @@ -93,8 +97,6 @@ public: static const CPPExpression &get_default(); static const CPPExpression &get_delete(); - ~CPPExpression(); - enum ResultType { RT_integer, RT_real, @@ -170,6 +172,11 @@ public: CPPInstance *_operator; CPPExpression *_value; } _literal; + struct { + int _trait; + CPPType *_type; + CPPType *_arg; + } _type_trait; } _u; protected: diff --git a/dtool/src/cppparser/cppExtensionType.cxx b/dtool/src/cppparser/cppExtensionType.cxx index 36bdd307fe..8a0676883d 100644 --- a/dtool/src/cppparser/cppExtensionType.cxx +++ b/dtool/src/cppparser/cppExtensionType.cxx @@ -87,12 +87,32 @@ is_tbd() const { return false; } +/** + * Returns true if the type is considered a standard layout type. + */ +bool CPPExtensionType:: +is_standard_layout() const { + return (_type == T_enum || _type == T_enum_class || _type == T_enum_struct); +} + /** * Returns true if the type is considered a Plain Old Data (POD) type. */ bool CPPExtensionType:: is_trivial() const { - return (_type == T_enum); + return (_type == T_enum || _type == T_enum_class || _type == T_enum_struct); +} + +/** + * Returns true if the type can be constructed using the given argument. + */ +bool CPPExtensionType:: +is_constructible(const CPPType *given_type) const { + if (_type == T_enum || _type == T_enum_class || _type == T_enum_struct) { + const CPPExtensionType *other = ((CPPType *)given_type)->remove_reference()->remove_const()->as_extension_type(); + return other != NULL && is_equal(other); + } + return false; } /** @@ -100,7 +120,7 @@ is_trivial() const { */ bool CPPExtensionType:: is_default_constructible() const { - return (_type == T_enum); + return (_type == T_enum || _type == T_enum_class || _type == T_enum_struct); } /** @@ -108,7 +128,7 @@ is_default_constructible() const { */ bool CPPExtensionType:: is_copy_constructible() const { - return (_type == T_enum); + return (_type == T_enum || _type == T_enum_class || _type == T_enum_struct); } /** diff --git a/dtool/src/cppparser/cppExtensionType.h b/dtool/src/cppparser/cppExtensionType.h index e60aeb9f21..7f7bf15abf 100644 --- a/dtool/src/cppparser/cppExtensionType.h +++ b/dtool/src/cppparser/cppExtensionType.h @@ -47,7 +47,9 @@ public: virtual bool is_incomplete() const; virtual bool is_tbd() const; + virtual bool is_standard_layout() const; virtual bool is_trivial() const; + virtual bool is_constructible(const CPPType *type) const; virtual bool is_default_constructible() const; virtual bool is_copy_constructible() const; diff --git a/dtool/src/cppparser/cppFunctionType.cxx b/dtool/src/cppparser/cppFunctionType.cxx index 3232fc56fa..371b714c2d 100644 --- a/dtool/src/cppparser/cppFunctionType.cxx +++ b/dtool/src/cppparser/cppFunctionType.cxx @@ -89,9 +89,11 @@ substitute_decl(CPPDeclaration::SubstDecl &subst, } CPPFunctionType *rep = new CPPFunctionType(*this); - rep->_return_type = - _return_type->substitute_decl(subst, current_scope, global_scope) - ->as_type(); + if (_return_type != NULL) { + rep->_return_type = + _return_type->substitute_decl(subst, current_scope, global_scope) + ->as_type(); + } rep->_parameters = _parameters->substitute_decl(subst, current_scope, global_scope); @@ -265,6 +267,9 @@ output_instance(ostream &out, int indent_level, CPPScope *scope, if (_flags & F_const_method) { out << " const"; } + if (_flags & F_volatile_method) { + out << " volatile"; + } if (_flags & F_noexcept) { out << " noexcept"; } diff --git a/dtool/src/cppparser/cppFunctionType.h b/dtool/src/cppparser/cppFunctionType.h index 6618c625fe..f08de51e45 100644 --- a/dtool/src/cppparser/cppFunctionType.h +++ b/dtool/src/cppparser/cppFunctionType.h @@ -40,6 +40,9 @@ public: F_trailing_return_type = 0x800, F_final = 0x1000, F_override = 0x2000, + F_volatile_method = 0x4000, + F_lvalue_method = 0x8000, + F_rvalue_method = 0x10000, }; CPPFunctionType(CPPType *return_type, CPPParameterList *parameters, diff --git a/dtool/src/cppparser/cppInstance.cxx b/dtool/src/cppparser/cppInstance.cxx index ce01da78e4..86768af511 100644 --- a/dtool/src/cppparser/cppInstance.cxx +++ b/dtool/src/cppparser/cppInstance.cxx @@ -82,6 +82,10 @@ CPPInstance(CPPType *type, CPPInstanceIdentifier *ii, int storage_class, // anyway. } + if (ii->_packed) { + _storage_class |= SC_parameter_pack; + } + delete ii; } @@ -353,11 +357,7 @@ check_for_constructor(CPPScope *current_scope, CPPScope *global_scope) { CPPReferenceType *ref_type = param_type->as_reference_type(); if (ref_type != NULL) { - param_type = ref_type->_pointing_at; - - if (param_type->get_subtype() == CPPDeclaration::ST_const) { - param_type = param_type->as_const_type()->_wrapped_around; - } + param_type = ref_type->_pointing_at->remove_cv(); if (class_name == param_type->get_simple_name()) { if (ref_type->_value_category == CPPReferenceType::VC_rvalue) { @@ -563,6 +563,9 @@ output(ostream &out, int indent_level, CPPScope *scope, bool complete, if (_ident != NULL) { name = _ident->get_local_name(scope); } + if (_storage_class & SC_parameter_pack) { + name = "..." + name; + } if (_type->as_function_type()) { _type->as_function_type()-> diff --git a/dtool/src/cppparser/cppInstance.h b/dtool/src/cppparser/cppInstance.h index 74473df660..675ba83507 100644 --- a/dtool/src/cppparser/cppInstance.h +++ b/dtool/src/cppparser/cppInstance.h @@ -68,6 +68,9 @@ public: // This isn't really a storage class. It's only used temporarily by the // parser, to make parsing specifier sequences a bit easier. SC_const = 0x20000, + + // Used to indicate that this is a parameter pack. + SC_parameter_pack = 0x40000, }; CPPInstance(CPPType *type, const string &name, int storage_class = 0); diff --git a/dtool/src/cppparser/cppInstanceIdentifier.cxx b/dtool/src/cppparser/cppInstanceIdentifier.cxx index 96f14e27ce..fe723f552d 100644 --- a/dtool/src/cppparser/cppInstanceIdentifier.cxx +++ b/dtool/src/cppparser/cppInstanceIdentifier.cxx @@ -26,12 +26,11 @@ */ CPPInstanceIdentifier::Modifier:: Modifier(CPPInstanceIdentifierType type) : - _type(type) -{ - _func_params = NULL; - _func_flags = 0; - _scoping = NULL; - _expr = NULL; + _type(type), + _func_params(NULL), + _func_flags(0), + _scoping(NULL), + _expr(NULL) { } /** @@ -83,7 +82,8 @@ initializer_type(CPPParameterList *params) { CPPInstanceIdentifier:: CPPInstanceIdentifier(CPPIdentifier *ident) : _ident(ident), - _bit_width(-1) { + _bit_width(-1), + _packed(false) { } /** diff --git a/dtool/src/cppparser/cppInstanceIdentifier.h b/dtool/src/cppparser/cppInstanceIdentifier.h index a96086a2ee..8433b30313 100644 --- a/dtool/src/cppparser/cppInstanceIdentifier.h +++ b/dtool/src/cppparser/cppInstanceIdentifier.h @@ -88,8 +88,12 @@ public: typedef vector Modifiers; Modifiers _modifiers; + // If not -1, indicates a bitfield int _bit_width; + // Indicates a parameter pack + bool _packed; + private: CPPType * r_unroll_type(CPPType *start_type, Modifiers::const_iterator mi); diff --git a/dtool/src/cppparser/cppPointerType.cxx b/dtool/src/cppparser/cppPointerType.cxx index 59734ed575..6fac65a6b1 100644 --- a/dtool/src/cppparser/cppPointerType.cxx +++ b/dtool/src/cppparser/cppPointerType.cxx @@ -14,6 +14,9 @@ #include "cppPointerType.h" #include "cppFunctionType.h" #include "cppIdentifier.h" +#include "cppArrayType.h" +#include "cppStructType.h" +#include "cppSimpleType.h" /** * @@ -88,6 +91,14 @@ is_tbd() const { return _pointing_at->is_tbd(); } +/** + * Returns true if the type is considered a standard layout type. + */ +bool CPPPointerType:: +is_standard_layout() const { + return true; +} + /** * Returns true if the type is considered a Plain Old Data (POD) type. */ @@ -96,6 +107,60 @@ is_trivial() const { return true; } +/** + * Returns true if the type can be constructed using the given argument. + */ +bool CPPPointerType:: +is_constructible(const CPPType *given_type) const { + given_type = ((CPPType *)given_type)->remove_reference()->remove_cv(); + + // Can convert from compatible pointer or array type. + CPPType *other_target; + switch (given_type->get_subtype()) { + case ST_array: + other_target = given_type->as_array_type()->_element_type; + break; + + case ST_pointer: + other_target = given_type->as_pointer_type()->_pointing_at; + break; + + case ST_simple: + // Can initialize from nullptr. + return given_type->as_simple_type()->_type == CPPSimpleType::T_nullptr; + + default: + return false; + } + + // Can't convert const to non-const pointer. + if (other_target->is_const() && !_pointing_at->is_const()) { + return false; + } + + // Are we pointing to the same type? That's always OK. + const CPPType *a = _pointing_at->remove_cv(); + const CPPType *b = other_target->remove_cv(); + if (a == b || *a == *b) { + return true; + } + + // Can initialize void pointer with any pointer. + const CPPSimpleType *simple_type = a->as_simple_type(); + if (simple_type != NULL) { + return simple_type->_type == CPPSimpleType::T_void; + } + + // Can initialize from derived class pointer. + const CPPStructType *a_struct = a->as_struct_type(); + const CPPStructType *b_struct = b->as_struct_type(); + if (a_struct != NULL && b_struct != NULL) { + return a_struct->is_base_of(b_struct); + } + + return false; +} + /** * Returns true if the type is default-constructible. */ diff --git a/dtool/src/cppparser/cppPointerType.h b/dtool/src/cppparser/cppPointerType.h index 2bb0fea0c1..41aed4876b 100644 --- a/dtool/src/cppparser/cppPointerType.h +++ b/dtool/src/cppparser/cppPointerType.h @@ -36,7 +36,9 @@ public: CPPScope *global_scope); virtual bool is_tbd() const; + virtual bool is_standard_layout() const; virtual bool is_trivial() const; + virtual bool is_constructible(const CPPType *other) const; virtual bool is_default_constructible() const; virtual bool is_copy_constructible() const; virtual bool is_equivalent(const CPPType &other) const; diff --git a/dtool/src/cppparser/cppPreprocessor.cxx b/dtool/src/cppparser/cppPreprocessor.cxx index a6ad3d1cad..5df779fc1d 100644 --- a/dtool/src/cppparser/cppPreprocessor.cxx +++ b/dtool/src/cppparser/cppPreprocessor.cxx @@ -18,6 +18,7 @@ #include "cppIdentifier.h" #include "cppTemplateScope.h" #include "cppTemplateParameterList.h" +#include "cppClassTemplateParameter.h" #include "cppConstType.h" #include "cppFunctionGroup.h" #include "cppFunctionType.h" @@ -416,7 +417,14 @@ get_next_token0() { int token_type = IDENTIFIER; CPPDeclaration *decl = ident->find_symbol(current_scope, global_scope); if (decl != NULL && decl->as_type() != NULL) { - token_type = TYPENAME_IDENTIFIER; + // We need to see type pack template parameters as a different type of + // identifier to resolve a parser ambiguity. + CPPClassTemplateParameter *ctp = decl->as_class_template_parameter(); + if (ctp && ctp->_packed) { + token_type = TYPEPACK_IDENTIFIER; + } else { + token_type = TYPENAME_IDENTIFIER; + } } _last_token_loc = loc; @@ -2451,11 +2459,27 @@ check_keyword(const string &name) { if (name == "friend") return KW_FRIEND; if (name == "for") return KW_FOR; if (name == "goto") return KW_GOTO; + if (name == "__has_virtual_destructor") return KW_HAS_VIRTUAL_DESTRUCTOR; if (name == "if") return KW_IF; if (name == "inline") return KW_INLINE; if (name == "__inline") return KW_INLINE; if (name == "__inline__") return KW_INLINE; if (name == "int") return KW_INT; + if (name == "__is_abstract") return KW_IS_ABSTRACT; + if (name == "__is_base_of") return KW_IS_BASE_OF; + if (name == "__is_class") return KW_IS_CLASS; + if (name == "__is_constructible") return KW_IS_CONSTRUCTIBLE; + if (name == "__is_convertible_to") return KW_IS_CONVERTIBLE_TO; + if (name == "__is_destructible") return KW_IS_DESTRUCTIBLE; + if (name == "__is_empty") return KW_IS_EMPTY; + if (name == "__is_enum") return KW_IS_ENUM; + if (name == "__is_final") return KW_IS_FINAL; + if (name == "__is_fundamental") return KW_IS_FUNDAMENTAL; + if (name == "__is_pod") return KW_IS_POD; + if (name == "__is_polymorphic") return KW_IS_POLYMORPHIC; + if (name == "__is_standard_layout") return KW_IS_STANDARD_LAYOUT; + if (name == "__is_trivial") return KW_IS_TRIVIAL; + if (name == "__is_union") return KW_IS_UNION; if (name == "long") return KW_LONG; if (name == "__make_map_property") return KW_MAKE_MAP_PROPERTY; if (name == "__make_property") return KW_MAKE_PROPERTY; @@ -2490,6 +2514,7 @@ check_keyword(const string &name) { if (name == "typedef") return KW_TYPEDEF; if (name == "typeid") return KW_TYPEID; if (name == "typename") return KW_TYPENAME; + if (name == "__underlying_type") return KW_UNDERLYING_TYPE; if (name == "union") return KW_UNION; if (name == "unsigned") return KW_UNSIGNED; if (name == "using") return KW_USING; @@ -2751,7 +2776,7 @@ nested_parse_template_instantiation(CPPTemplateScope *scope) { _parsing_template_params = true; CPPToken token = internal_get_next_token(); - if (token._token == '>') { + if (token._token == '>' || token._token == 0) { _parsing_template_params = false; } else { _saved_tokens.push_back(token); @@ -2760,36 +2785,53 @@ nested_parse_template_instantiation(CPPTemplateScope *scope) { CPPTemplateParameterList *actual_params = new CPPTemplateParameterList; for (pi = formal_params._parameters.begin(); - pi != formal_params._parameters.end() && _parsing_template_params; - ++pi) { + pi != formal_params._parameters.end() && _parsing_template_params;) { CPPToken token = peek_next_token(); YYLTYPE loc = token._lloc; CPPDeclaration *decl = (*pi); - if (decl->as_type()) { + CPPClassTemplateParameter *param = decl->as_class_template_parameter(); + CPPInstance *inst = decl->as_instance(); + if (param) { // Parse a typename template parameter. _saved_tokens.push_back(CPPToken(START_TYPE)); CPPType *type = ::parse_type(this, current_scope, global_scope); if (type == NULL) { loc.last_line = get_line_number(); loc.last_column = get_col_number() - 1; - warning("Invalid type", loc); + warning("invalid type", loc); skip_to_end_nested(); type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_unknown)); } actual_params->_parameters.push_back(type); - } else { + + // If this is a variadic template, keep reading using this parameter. + if (!param->_packed) { + ++pi; + } + } else if (inst) { // Parse a constant expression template parameter. _saved_tokens.push_back(CPPToken(START_CONST_EXPR)); CPPExpression *expr = parse_const_expr(this, current_scope, global_scope); if (expr == NULL) { loc.last_line = get_line_number(); loc.last_column = get_col_number() - 1; - warning("Invalid expression", loc); + warning("invalid expression", loc); skip_to_end_nested(); expr = new CPPExpression(0); } actual_params->_parameters.push_back(expr); + + // If this is a variadic template, keep reading using this parameter. + if ((inst->_storage_class & CPPInstance::SC_parameter_pack) == 0) { + ++pi; + } + } else { + loc.last_line = get_line_number(); + loc.last_column = get_col_number() - 1; + warning("invalid template parameter", loc); + skip_to_end_nested(); + ++pi; } _state = S_nested; diff --git a/dtool/src/cppparser/cppReferenceType.cxx b/dtool/src/cppparser/cppReferenceType.cxx index edb29a91e2..bbb1f1a50e 100644 --- a/dtool/src/cppparser/cppReferenceType.cxx +++ b/dtool/src/cppparser/cppReferenceType.cxx @@ -12,6 +12,8 @@ */ #include "cppReferenceType.h" +#include "cppTypedefType.h" +#include "cppStructType.h" /** * @@ -87,6 +89,14 @@ is_tbd() const { return _pointing_at->is_tbd(); } +/** + * Returns true if the type is considered a standard layout type. + */ +bool CPPReferenceType:: +is_standard_layout() const { + return false; +} + /** * Returns true if the type is considered a Plain Old Data (POD) type. */ @@ -95,6 +105,67 @@ is_trivial() const { return false; } +/** + * Returns true if the type can be constructed using the given argument. + */ +bool CPPReferenceType:: +is_constructible(const CPPType *given_type) const { + const CPPType *a; + const CPPType *b; + + CPPReferenceType *ref_type = ((CPPType *)given_type)->as_reference_type(); + if (ref_type != NULL) { + if (ref_type->_value_category == VC_rvalue) { + return is_constructible(ref_type->_pointing_at); + } + + if (_value_category == VC_rvalue) { + // Can never initialize an rvalue ref from an lvalue ref. + return false; + } + + if (!_pointing_at->is_const()) { + // Cannot initialize a non-const reference using a const one. + if (ref_type->_pointing_at->is_const()) { + return false; + } + } + + a = _pointing_at->remove_cv(); + b = ref_type->_pointing_at->remove_cv(); + + } else { + // Initializing using an rvalue. + if (!_pointing_at->is_const()) { + // Cannot initialize a non-const reference using a const one. + if (given_type->is_const()) { + return false; + } + + // Cannot initalise a non-const lvalue reference with an rvalue ref. + if (_value_category == VC_lvalue) { + return false; + } + } + + a = _pointing_at->remove_cv(); + b = ((CPPType *)given_type)->remove_cv(); + } + + if (a == b || *a == *b) { + return true; + } + + // Can initialize from derived class pointer. + const CPPStructType *a_struct = a->as_struct_type(); + const CPPStructType *b_struct = b->as_struct_type(); + if (a_struct != NULL && b_struct != NULL) { + return a_struct->is_base_of(b_struct); + } + + return false; +} + /** * Returns true if the type is default-constructible. */ @@ -111,6 +182,14 @@ is_copy_constructible() const { return (_value_category == VC_lvalue); } +/** + * Returns true if the type is destructible. + */ +bool CPPReferenceType:: +is_destructible() const { + return false; +} + /** * This is a little more forgiving than is_equal(): it returns true if the * types appear to be referring to the same thing, even if they may have diff --git a/dtool/src/cppparser/cppReferenceType.h b/dtool/src/cppparser/cppReferenceType.h index 96b898ce2b..89feba8d2c 100644 --- a/dtool/src/cppparser/cppReferenceType.h +++ b/dtool/src/cppparser/cppReferenceType.h @@ -42,9 +42,12 @@ public: CPPScope *global_scope); virtual bool is_tbd() const; + virtual bool is_standard_layout() const; virtual bool is_trivial() const; + virtual bool is_constructible(const CPPType *type) const; virtual bool is_default_constructible() const; virtual bool is_copy_constructible() const; + virtual bool is_destructible() const; virtual bool is_equivalent(const CPPType &other) const; virtual void output(ostream &out, int indent_level, CPPScope *scope, diff --git a/dtool/src/cppparser/cppScope.cxx b/dtool/src/cppparser/cppScope.cxx index 9945a1a72d..a340a5a709 100644 --- a/dtool/src/cppparser/cppScope.cxx +++ b/dtool/src/cppparser/cppScope.cxx @@ -27,7 +27,6 @@ #include "cppPreprocessor.h" #include "cppTemplateScope.h" #include "cppClassTemplateParameter.h" -#include "cppConstType.h" #include "cppFunctionType.h" #include "cppUsing.h" #include "cppBisonDefs.h" diff --git a/dtool/src/cppparser/cppSimpleType.cxx b/dtool/src/cppparser/cppSimpleType.cxx index 8c9b323945..82d7735bdc 100644 --- a/dtool/src/cppparser/cppSimpleType.cxx +++ b/dtool/src/cppparser/cppSimpleType.cxx @@ -34,6 +34,30 @@ is_tbd() const { return (_type == T_unknown); } +/** + * Returns true if the type is a boolean, floating point or integral type. + */ +bool CPPSimpleType:: +is_arithmetic() const { + return (_type > T_unknown && _type < T_void); +} + +/** + * Returns true if the type is considered a fundamental type. + */ +bool CPPSimpleType:: +is_fundamental() const { + return (_type != T_unknown && _type != T_parameter && _type != T_auto); +} + +/** + * Returns true if the type is considered a standard layout type. + */ +bool CPPSimpleType:: +is_standard_layout() const { + return (_type != T_unknown && _type != T_parameter && _type != T_auto); +} + /** * Returns true if the type is considered a Plain Old Data (POD) type. */ @@ -42,6 +66,27 @@ is_trivial() const { return true; } +/** + * Returns true if the type can be constructed using the given argument. + */ +bool CPPSimpleType:: +is_constructible(const CPPType *given_type) const { + given_type = ((CPPType *)given_type)->remove_reference()->remove_cv(); + + const CPPSimpleType *simple_type = given_type->as_simple_type(); + if (simple_type == NULL) { + return given_type->is_enum() && is_arithmetic(); + } else if (_type == T_nullptr) { + return simple_type->_type == T_nullptr; + } else if (_type == T_bool) { + return simple_type->is_arithmetic() || simple_type->_type == T_nullptr; + } else if (is_arithmetic()) { + return simple_type->is_arithmetic(); + } else { + return false; + } +} + /** * Returns true if the type is default-constructible. */ @@ -58,6 +103,14 @@ is_copy_constructible() const { return (_type != T_void); } +/** + * Returns true if the type is destructible. + */ +bool CPPSimpleType:: +is_destructible() const { + return (_type != T_void); +} + /** * Returns true if the type is a special parameter expression type. * diff --git a/dtool/src/cppparser/cppSimpleType.h b/dtool/src/cppparser/cppSimpleType.h index 12ee96857f..8adb254a1b 100644 --- a/dtool/src/cppparser/cppSimpleType.h +++ b/dtool/src/cppparser/cppSimpleType.h @@ -19,7 +19,7 @@ #include "cppType.h" /** - * + * Represents a C++ fundamental type. */ class CPPSimpleType : public CPPType { public: @@ -40,12 +40,11 @@ public: // nullptr_t, which is a typedef of decltype(nullptr). T_nullptr, -/* - * T_parameter is a special type which is assigned to expressions that are - * discovered where a formal parameter was expected. This is a special case - * for handling cases like this: int foo(0); which really means the same thing - * as: int foo = 0; but it initially looks like a function prototype. - */ + // T_parameter is a special type which is assigned to expressions that are + // discovered where a formal parameter was expected. This is a special + // case for handling cases like this: int foo(0); which really means the + // same thing as: int foo = 0; but it initially looks like a function + // prototype. T_parameter, // T_auto is also a special type that corresponds to the "auto" keyword @@ -69,9 +68,14 @@ public: int _flags; virtual bool is_tbd() const; + bool is_arithmetic() const; + virtual bool is_fundamental() const; + virtual bool is_standard_layout() const; virtual bool is_trivial() const; + virtual bool is_constructible(const CPPType *type) const; virtual bool is_default_constructible() const; virtual bool is_copy_constructible() const; + virtual bool is_destructible() const; virtual bool is_parameter_expr() const; virtual string get_preferred_name() const; diff --git a/dtool/src/cppparser/cppStructType.cxx b/dtool/src/cppparser/cppStructType.cxx index 49eee9c436..f33112d686 100644 --- a/dtool/src/cppparser/cppStructType.cxx +++ b/dtool/src/cppparser/cppStructType.cxx @@ -126,16 +126,154 @@ is_abstract() const { return !funcs.empty(); } +/** + * Returns true if this struct declaration is a base class of the other given + * class, or the same class. + */ +bool CPPStructType:: +is_base_of(const CPPStructType *other) const { + if (this == other) { + return true; + } + Derivation::const_iterator di; + for (di = other->_derivation.begin(); di != other->_derivation.end(); ++di) { + const CPPStructType *base = (*di)._base->as_struct_type(); + if (base != NULL && is_base_of(base)) { + return true; + } + } + return false; +} + +/** + * Returns true if this struct declaration defines no non-static data members + * other than bit-fields of size 0, no virtual functions, no virtual base + * classes, and no non-empty base classes, and is not a union. + */ +bool CPPStructType:: +is_empty() const { + if (_type == T_union) { + return false; + } + + if (check_virtual()) { + return false; + } + + // Make sure all base classes are empty and non-virtual. + Derivation::const_iterator di; + for (di = _derivation.begin(); di != _derivation.end(); ++di) { + CPPStructType *base = (*di)._base->as_struct_type(); + if ((*di)._is_virtual || (base != NULL && !base->is_empty())) { + return false; + } + } + + // Make sure there are no non-static data members. + CPPScope::Variables::const_iterator vi; + for (vi = _scope->_variables.begin(); vi != _scope->_variables.end(); ++vi) { + CPPInstance *instance = (*vi).second; + assert(instance != NULL); + + if (instance->_storage_class & CPPInstance::SC_static) { + // Static members don't count. + continue; + } + + // Only members with a bit width of 0 are okay. + if (instance->_bit_width != 0) { + return false; + } + } + + return true; +} + +/** + * Returns true if this class or any of its base classes have virtual methods. + */ +bool CPPStructType:: +is_polymorphic() const { + if (_type == T_union) { + return false; + } + return check_virtual(); +} + +/** + * Returns true if the type is considered a standard layout type. + */ +bool CPPStructType:: +is_standard_layout() const { + assert(_scope != NULL); + + CPPVisibility member_vis = V_unknown; + + // Make sure all data members have the same vis and are standard layout. + CPPScope::Variables::const_iterator vi; + for (vi = _scope->_variables.begin(); vi != _scope->_variables.end(); ++vi) { + CPPInstance *instance = (*vi).second; + assert(instance != NULL); + + if (instance->_storage_class & CPPInstance::SC_static) { + // Static members don't count. + continue; + } + + // Finally, check if the data member itself is standard layout. + assert(instance->_type != NULL); + if (!instance->_type->is_standard_layout()) { + return false; + } + + if (member_vis == V_unknown) { + // The first non-static data member may not be a base class. + CPPStructType *struct_type = instance->_type->remove_cv()->as_struct_type(); + if (struct_type != NULL && struct_type->is_base_of(this)) { + return false; + } + member_vis = instance->_vis; + + } else if (member_vis != instance->_vis) { + // All members need to have the same access control. + return false; + } + } + + // Make sure all base classes are standard-layout and non-virtual. + Derivation::const_iterator di; + for (di = _derivation.begin(); di != _derivation.end(); ++di) { + CPPStructType *base = (*di)._base->as_struct_type(); + if ((*di)._is_virtual) { + return false; + } + + // If this class had instance members, all base classes need to be empty. + if (member_vis != V_unknown) { + if (!base->is_empty()) { + return false; + } + } else { + if (!base->is_standard_layout()) { + return false; + } + } + } + + // Make sure we have no virtual functions. + return !check_virtual(); +} + /** * Returns true if the type is considered a Plain Old Data (POD) type. */ bool CPPStructType:: is_trivial() const { - // Make sure all base classes are trivial. + // Make sure all base classes are trivial and non-virtual. Derivation::const_iterator di; for (di = _derivation.begin(); di != _derivation.end(); ++di) { CPPStructType *base = (*di)._base->as_struct_type(); - if (base != NULL && !base->is_trivial()) { + if ((*di)._is_virtual || (base != NULL && !base->is_trivial())) { return false; } } @@ -166,7 +304,7 @@ is_trivial() const { } } - // Now look for functions that are virtual or condestructors. + // Now look for functions that are virtual or con/destructors. bool is_default_constructible = true; CPPScope::Functions::const_iterator fi; for (fi = _scope->_functions.begin(); fi != _scope->_functions.end(); ++fi) { @@ -193,8 +331,8 @@ is_trivial() const { if (ftype->_flags & (CPPFunctionType::F_destructor | CPPFunctionType::F_move_constructor | CPPFunctionType::F_copy_constructor)) { - // User-provided destructors and copymove constructors are not trivial - // unless they are defaulted (and not virtual). + // User-provided destructors and copy/move constructors are not + // trivial unless they are defaulted (and not virtual). return false; } @@ -220,6 +358,62 @@ is_trivial() const { return is_default_constructible; } +/** + * Returns true if the type can be constructed using the given argument. + * This implementation is rudimentary, as it does not attempt to follow all of + * the implicit type conversion rules, but it is still useful. + */ +bool CPPStructType:: +is_constructible(const CPPType *given_type) const { + // Does the type match the copy constructor or move constructor? + CPPType *base_type = ((CPPType *)given_type)->remove_reference(); + if (is_equivalent(*base_type->remove_cv())) { + const CPPReferenceType *ref_type = given_type->as_reference_type(); + if (ref_type == NULL || + ref_type->_value_category == CPPReferenceType::VC_rvalue) { + return is_move_constructible(V_public); + } else { + return is_copy_constructible(V_public); + } + } + + // Check for a different constructor. + CPPFunctionGroup *fgroup = get_constructor(); + if (fgroup != (CPPFunctionGroup *)NULL) { + CPPFunctionGroup::Instances::const_iterator ii; + for (ii = fgroup->_instances.begin(); + ii != fgroup->_instances.end(); + ++ii) { + CPPInstance *inst = (*ii); + assert(inst->_type != (CPPType *)NULL); + + CPPFunctionType *ftype = inst->_type->as_function_type(); + assert(ftype != (CPPFunctionType *)NULL); + + CPPParameterList *params = ftype->_parameters; + if (params->_parameters.size() == 1 && !params->_includes_ellipsis) { + CPPType *param_type = params->_parameters[0]->_type->remove_reference(); + + if (!param_type->is_const() && base_type->is_const()) { + // Can't pass a const object to a function taking a non-const. + continue; + } + + // It's deleted, anyhow. + if ((inst->_storage_class & CPPInstance::SC_deleted) != 0) { + continue; + } + + if (param_type->is_equivalent(*base_type)) { + return true; + } + } + } + } + + return false; +} + /** * Returns true if the type is default-constructible. */ @@ -236,6 +430,14 @@ is_copy_constructible() const { return is_copy_constructible(V_public); } +/** + * Returns true if the type is destructible. + */ +bool CPPStructType:: +is_destructible() const { + return is_destructible(V_public); +} + /** * Returns true if the type is default-constructible. */ @@ -399,6 +601,139 @@ is_copy_constructible(CPPVisibility min_vis) const { return true; } +/** + * Returns true if the type is move-constructible. + */ +bool CPPStructType:: +is_move_constructible(CPPVisibility min_vis) const { + CPPInstance *constructor = get_move_constructor(); + if (constructor != (CPPInstance *)NULL) { + // It has a user-declared move constructor. + if (constructor->_vis > min_vis) { + // Inaccessible move constructor. + return false; + } + + if (constructor->_storage_class & CPPInstance::SC_deleted) { + // It is deleted. + return false; + } + + return true; + } + + return is_copy_constructible(min_vis); +} + +/** + * Returns true if the type is destructible. + */ +bool CPPStructType:: +is_destructible(CPPVisibility min_vis) const { + // Do we have an explicit destructor? + CPPInstance *destructor = get_destructor(); + if (destructor != (CPPInstance *)NULL) { + if (destructor->_vis > min_vis) { + // Yes, but it's inaccessible. + return false; + } + + if (destructor->_storage_class & CPPInstance::SC_deleted) { + // Yes, but it's explicitly been deleted. + return false; + } + + return true; + } + + // Make sure all base classes are destructible. + Derivation::const_iterator di; + for (di = _derivation.begin(); di != _derivation.end(); ++di) { + CPPStructType *base = (*di)._base->as_struct_type(); + if (base != NULL && !base->is_destructible(V_protected)) { + return false; + } + } + + assert(_scope != NULL); + + // Make sure all members are destructible. + CPPScope::Variables::const_iterator vi; + for (vi = _scope->_variables.begin(); vi != _scope->_variables.end(); ++vi) { + CPPInstance *instance = (*vi).second; + assert(instance != NULL); + + if (instance->_storage_class & CPPInstance::SC_static) { + // Static members don't count. + continue; + } + + // If the data member is not destructible, no go. + assert(instance->_type != NULL); + if (!instance->_type->is_destructible()) { + return false; + } + } + + return true; +} + +/** + * Returns true if variables of this type may be implicitly converted to + * the other type. + */ +bool CPPStructType:: +is_convertible_to(const CPPType *other) const { + if (CPPType::is_convertible_to(other)) { + return true; + } + + // Check all typecast operators to see whether we can cast to a type that is + // convertible to the other type. + CPPScope::Functions::const_iterator fi; + for (fi = _scope->_functions.begin(); fi != _scope->_functions.end(); ++fi) { + CPPFunctionGroup *fgroup = (*fi).second; + + CPPFunctionGroup::Instances::const_iterator ii; + for (ii = fgroup->_instances.begin(); ii != fgroup->_instances.end(); ++ii) { + CPPInstance *inst = (*ii); + + if (inst->_storage_class & (CPPInstance::SC_deleted | CPPInstance::SC_static | CPPInstance::SC_explicit)) { + // Exclude static/deleted/explicit methods. + continue; + } + + // Also, the instance needs to be publicly visible. + if (inst->_vis > V_public) { + continue; + } + + assert(inst->_type != (CPPType *)NULL); + CPPFunctionType *ftype = inst->_type->as_function_type(); + assert(ftype != (CPPFunctionType *)NULL); + + if (ftype->_return_type != NULL && + (ftype->_flags & CPPFunctionType::F_operator_typecast) != 0) { + // Yes, this is a typecast operator. Test using the return type. + if (ftype->_return_type->is_convertible_to(other)) { + return true; + } + } + } + } + + // Check whether any of the base classes are convertible. + Derivation::const_iterator di; + for (di = _derivation.begin(); di != _derivation.end(); ++di) { + CPPStructType *base = (*di)._base->as_struct_type(); + if (base != NULL && (*di)._vis <= V_public && !base->is_convertible_to(other)) { + return true; + } + } + + return false; +} + /** * Ensures all functions are correctly marked with the "virtual" flag if they * are truly virtual by virtue of inheritance, rather than simply being @@ -420,6 +755,30 @@ check_virtual() const { return !funcs.empty(); } +/** + * Returns true if this class, or any of its base classes, has a virtual + * destructor. + */ +bool CPPStructType:: +has_virtual_destructor() const { + CPPInstance *destructor = get_destructor(); + if (destructor != NULL) { + if (destructor->_storage_class & CPPInstance::SC_virtual) { + return true; + } + } + + Derivation::const_iterator di; + for (di = _derivation.begin(); di != _derivation.end(); ++di) { + CPPStructType *base = (*di)._base->as_struct_type(); + if (base != NULL && base->has_virtual_destructor()) { + return true; + } + } + + return false; +} + /** * Returns true if this declaration is an actual, factual declaration, or * false if some part of the declaration depends on a template parameter which @@ -459,7 +818,7 @@ get_constructor() const { /** * Returns the default constructor defined for the struct type, or NULL if - * there is none. + * there is no user-declared constructor that takes 0 arguments. */ CPPInstance *CPPStructType:: get_default_constructor() const { @@ -490,7 +849,7 @@ get_default_constructor() const { /** * Returns the copy constructor defined for the struct type, or NULL if no - * copy constructor exists. + * user-declared copy constructor exists. */ CPPInstance *CPPStructType:: get_copy_constructor() const { @@ -519,7 +878,7 @@ get_copy_constructor() const { /** * Returns the move constructor defined for the struct type, or NULL if no - * move constructor exists. + * user-declared move constructor exists. */ CPPInstance *CPPStructType:: get_move_constructor() const { @@ -548,7 +907,7 @@ get_move_constructor() const { /** * Returns the destructor defined for the struct type, if any, or NULL if no - * destructor is found. + * user-declared destructor is found. */ CPPInstance *CPPStructType:: get_destructor() const { diff --git a/dtool/src/cppparser/cppStructType.h b/dtool/src/cppparser/cppStructType.h index 46c7a428b3..585c7476b2 100644 --- a/dtool/src/cppparser/cppStructType.h +++ b/dtool/src/cppparser/cppStructType.h @@ -44,14 +44,26 @@ public: CPPScope *get_scope() const; bool is_abstract() const; + bool is_base_of(const CPPStructType *other) const; + bool is_empty() const; + bool is_polymorphic() const; bool check_virtual() const; + bool has_virtual_destructor() const; virtual bool is_fully_specified() const; virtual bool is_incomplete() const; + virtual bool is_standard_layout() const; virtual bool is_trivial() const; + virtual bool is_constructible(const CPPType *arg_type) const; virtual bool is_default_constructible() const; virtual bool is_copy_constructible() const; + virtual bool is_destructible() const; bool is_default_constructible(CPPVisibility min_vis) const; bool is_copy_constructible(CPPVisibility min_vis) const; + bool is_move_constructible(CPPVisibility min_vis) const; + bool is_destructible(CPPVisibility min_vis) const; + virtual bool is_convertible_to(const CPPType *other) const; + + inline bool is_final() const { return _final; } CPPFunctionGroup *get_constructor() const; CPPInstance *get_default_constructor() const; diff --git a/dtool/src/cppparser/cppTemplateScope.cxx b/dtool/src/cppparser/cppTemplateScope.cxx index 50618b026d..2960718205 100644 --- a/dtool/src/cppparser/cppTemplateScope.cxx +++ b/dtool/src/cppparser/cppTemplateScope.cxx @@ -97,8 +97,10 @@ add_template_parameter(CPPDeclaration *param) { CPPClassTemplateParameter *cl = param->as_class_template_parameter(); if (cl != NULL) { // Create an implicit typedef for this class parameter. - string name = cl->_ident->get_local_name(); - _types[name] = cl; + if (cl->_ident != NULL) { + string name = cl->_ident->get_local_name(); + _types[name] = cl; + } } CPPInstance *inst = param->as_instance(); diff --git a/dtool/src/cppparser/cppType.cxx b/dtool/src/cppparser/cppType.cxx index e6430e6b45..780ebfc0ef 100644 --- a/dtool/src/cppparser/cppType.cxx +++ b/dtool/src/cppparser/cppType.cxx @@ -12,7 +12,11 @@ */ #include "cppType.h" -#include "cppTypedefType.h" +#include "cppConstType.h" +#include "cppPointerType.h" +#include "cppReferenceType.h" +#include "cppStructType.h" +#include "cppExtensionType.h" #include CPPType::Types CPPType::_types; @@ -57,6 +61,22 @@ is_tbd() const { return false; } +/** + * Returns true if the type is considered a fundamental type. + */ +bool CPPType:: +is_fundamental() const { + return false; +} + +/** + * Returns true if the type is considered a standard layout type. + */ +bool CPPType:: +is_standard_layout() const { + return false; +} + /** * Returns true if the type is considered a Plain Old Data (POD) type. */ @@ -65,6 +85,14 @@ is_trivial() const { return false; } +/** + * Returns true if the type can be constructed using the given argument. + */ +bool CPPType:: +is_constructible(const CPPType *given_type) const { + return false; +} + /** * Returns true if the type is default-constructible. */ @@ -81,6 +109,14 @@ is_copy_constructible() const { return false; } +/** + * Returns true if the type is destructible. + */ +bool CPPType:: +is_destructible() const { + return !is_incomplete(); +} + /** * Returns true if the type is a special parameter expression type. * @@ -92,6 +128,136 @@ is_parameter_expr() const { return false; } +/** + * Returns true if this is an enum type, or a typedef to an enum type. + */ +bool CPPType:: +is_enum() const { + const CPPTypedefType *td_type = as_typedef_type(); + if (td_type != NULL) { + return td_type->_type->is_enum(); + } + const CPPExtensionType *ext_type = as_extension_type(); + if (ext_type != NULL) { + return ext_type->_type == CPPExtensionType::T_enum || + ext_type->_type == CPPExtensionType::T_enum_struct || + ext_type->_type == CPPExtensionType::T_enum_class; + } + return false; +} + +/** + * Returns true if this is a const type, or a typedef to a const type. + */ +bool CPPType:: +is_const() const { + const CPPTypedefType *td_type = as_typedef_type(); + if (td_type != NULL) { + return td_type->_type->is_const(); + } + return get_subtype() == ST_const; +} + +/** + * Returns true if this is a reference type, or a typedef to a reference type. + */ +bool CPPType:: +is_reference() const { + const CPPTypedefType *td_type = as_typedef_type(); + if (td_type != NULL) { + return td_type->_type->is_reference(); + } + return get_subtype() == ST_reference; +} + +/** + * Returns true if this is an unqualified or cv-qualified pointer type, or a + * typedef to one. + */ +bool CPPType:: +is_pointer() const { + const CPPTypedefType *td_type = as_typedef_type(); + if (td_type != NULL) { + return td_type->_type->is_pointer(); + } + const CPPConstType *const_type = as_const_type(); + if (const_type != NULL) { + return const_type->_wrapped_around->is_pointer(); + } + return get_subtype() == ST_pointer; +} + +/** + * Returns the type with any const qualifier stripped off. Will follow + * typedefs, but only if necessary. + */ +CPPType *CPPType:: +remove_const() { + const CPPTypedefType *td_type = as_typedef_type(); + if (td_type != NULL) { + CPPType *unwrapped = td_type->_type->remove_const(); + if (unwrapped != td_type->_type) { + return unwrapped; + } else { + return this; + } + } + const CPPConstType *const_type = as_const_type(); + if (const_type != NULL) { + return const_type->_wrapped_around->remove_const(); + } + return this; +} + +/** + * Returns the type with any reference stripped off. + */ +CPPType *CPPType:: +remove_reference() { + const CPPTypedefType *td_type = as_typedef_type(); + if (td_type != NULL) { + CPPType *unwrapped = td_type->_type->remove_reference(); + if (unwrapped != td_type->_type) { + return unwrapped; + } else { + return this; + } + } + const CPPReferenceType *ref_type = as_reference_type(); + if (ref_type != NULL) { + return ref_type->_pointing_at; + } + return this; +} + +/** + * Returns the type with any pointer and cv-qualifiers stripped off. + */ +CPPType *CPPType:: +remove_pointer() { + switch (get_subtype()) { + case ST_typedef: + { + const CPPTypedefType *td_type = as_typedef_type(); + CPPType *unwrapped = td_type->_type->remove_pointer(); + if (unwrapped != td_type->_type) { + return unwrapped; + } else { + return this; + } + } + + case ST_pointer: + return ((const CPPPointerType *)this)->_pointing_at; + + case ST_const: + return ((const CPPConstType *)this)->_wrapped_around->remove_pointer(); + + default: + return this; + } +} + /** * Returns true if the type has even been typedef'ed and therefore has a * simple name available to stand for it. Extension types are all implicitly @@ -229,6 +395,14 @@ is_equivalent(const CPPType &other) const { return is_equal(&other); } +/** + * Returns true if variables of this type may be implicitly converted to + * the other type. + */ +bool CPPType:: +is_convertible_to(const CPPType *other) const { + return other->is_constructible(this); +} /** * Formats a C++-looking line that defines an instance of the given type, with diff --git a/dtool/src/cppparser/cppType.h b/dtool/src/cppparser/cppType.h index 298eaf179c..c709c475d6 100644 --- a/dtool/src/cppparser/cppType.h +++ b/dtool/src/cppparser/cppType.h @@ -45,11 +45,27 @@ public: CPPScope *global_scope); virtual bool is_tbd() const; + virtual bool is_fundamental() const; + virtual bool is_standard_layout() const; virtual bool is_trivial() const; + virtual bool is_constructible(const CPPType *type) const; virtual bool is_default_constructible() const; virtual bool is_copy_constructible() const; + virtual bool is_destructible() const; virtual bool is_parameter_expr() const; + // Convenience methods. + bool is_enum() const; + bool is_const() const; + bool is_reference() const; + bool is_pointer() const; + + CPPType *remove_const(); + inline CPPType *remove_volatile() { return this; } + inline CPPType *remove_cv() { return remove_const(); }; + CPPType *remove_reference(); + CPPType *remove_pointer(); + bool has_typedef_name() const; string get_typedef_name(CPPScope *scope = NULL) const; @@ -61,6 +77,7 @@ public: string get_alt_name(int n) const; virtual bool is_incomplete() const; + virtual bool is_convertible_to(const CPPType *other) const; virtual bool is_equivalent(const CPPType &other) const; void output_instance(ostream &out, const string &name, diff --git a/dtool/src/cppparser/cppTypedefType.cxx b/dtool/src/cppparser/cppTypedefType.cxx index aaede09529..61c569760e 100644 --- a/dtool/src/cppparser/cppTypedefType.cxx +++ b/dtool/src/cppparser/cppTypedefType.cxx @@ -157,6 +157,22 @@ is_tbd() const { return _type->is_tbd(); } +/** + * Returns true if the type is considered a fundamental type. + */ +bool CPPTypedefType:: +is_fundamental() const { + return _type->is_fundamental(); +} + +/** + * Returns true if the type is considered a standard layout type. + */ +bool CPPTypedefType:: +is_standard_layout() const { + return _type->is_standard_layout(); +} + /** * Returns true if the type is considered a Plain Old Data (POD) type. */ @@ -165,6 +181,14 @@ is_trivial() const { return _type->is_trivial(); } +/** + * Returns true if the type can be constructed using the given argument. + */ +bool CPPTypedefType:: +is_constructible(const CPPType *given_type) const { + return _type->is_constructible(given_type); +} + /** * Returns true if the type is default-constructible. */ @@ -181,6 +205,14 @@ is_copy_constructible() const { return _type->is_copy_constructible(); } +/** + * Returns true if the type is destructible. + */ +bool CPPTypedefType:: +is_destructible() const { + return _type->is_destructible(); +} + /** * Returns true if this declaration is an actual, factual declaration, or * false if some part of the declaration depends on a template parameter which @@ -300,6 +332,15 @@ resolve_type(CPPScope *current_scope, CPPScope *global_scope) { return this; } +/** + * Returns true if variables of this type may be implicitly converted to + * the other type. + */ +bool CPPTypedefType:: +is_convertible_to(const CPPType *other) const { + return _type->is_convertible_to(other); +} + /** * This is a little more forgiving than is_equal(): it returns true if the * types appear to be referring to the same thing, even if they may have diff --git a/dtool/src/cppparser/cppTypedefType.h b/dtool/src/cppparser/cppTypedefType.h index 2eae58cc68..280033738d 100644 --- a/dtool/src/cppparser/cppTypedefType.h +++ b/dtool/src/cppparser/cppTypedefType.h @@ -42,9 +42,13 @@ public: virtual bool is_incomplete() const; virtual bool is_tbd() const; + virtual bool is_fundamental() const; + virtual bool is_standard_layout() const; virtual bool is_trivial() const; + virtual bool is_constructible(const CPPType *type) const; virtual bool is_default_constructible() const; virtual bool is_copy_constructible() const; + virtual bool is_destructible() const; virtual bool is_fully_specified() const; @@ -60,6 +64,7 @@ public: virtual CPPType *resolve_type(CPPScope *current_scope, CPPScope *global_scope); + virtual bool is_convertible_to(const CPPType *other) const; virtual bool is_equivalent(const CPPType &other) const; virtual void output(ostream &out, int indent_level, CPPScope *scope, diff --git a/dtool/src/interrogate/interrogateBuilder.cxx b/dtool/src/interrogate/interrogateBuilder.cxx index 11ac166440..83f36c533b 100644 --- a/dtool/src/interrogate/interrogateBuilder.cxx +++ b/dtool/src/interrogate/interrogateBuilder.cxx @@ -2401,7 +2401,7 @@ define_struct_type(InterrogateType &itype, CPPStructType *cpptype, cpptype = TypeManager::resolve_type(cpptype)->as_struct_type(); assert(cpptype != (CPPStructType *)NULL); - bool has_virt_methods = cpptype->check_virtual(); + bool has_virt_methods = cpptype->is_polymorphic(); switch (cpptype->_type) { case CPPExtensionType::T_class: @@ -2501,7 +2501,7 @@ define_struct_type(InterrogateType &itype, CPPStructType *cpptype, // (For many compilers, this does not require a pointer change.) generate_casts = true; - } else if (has_virt_methods && (base_type->as_struct_type() == (CPPStructType *)NULL || !base_type->as_struct_type()->check_virtual())) { + } else if (has_virt_methods && (base_type->as_struct_type() == (CPPStructType *)NULL || !base_type->as_struct_type()->is_polymorphic())) { // Finally, if this class has virtual methods, but its parent // doesn't, then we have to upcast (because this class will require // space for a virtual function table pointer, while the parent @@ -2651,7 +2651,11 @@ define_struct_type(InterrogateType &itype, CPPStructType *cpptype, } } - if ((itype._flags & InterrogateType::F_inherited_destructor) != 0) { + if (!cpptype->is_destructible()) { + // There's no way to destruct the type. + itype._destructor = 0; + + } else if ((itype._flags & InterrogateType::F_inherited_destructor) != 0) { // If we have inherited our virtual destructor from our base class, go // ahead and assign the same function index. assert(!itype._derivations.empty()); diff --git a/dtool/src/interrogatedb/extension.h b/dtool/src/interrogatedb/extension.h index dd995081c1..8e844e3ebc 100644 --- a/dtool/src/interrogatedb/extension.h +++ b/dtool/src/interrogatedb/extension.h @@ -47,6 +47,14 @@ invoke_extension(T *ptr) { return ext; } +template +inline Extension +invoke_extension(T &ptr) { + Extension ext; + ext._this = &ptr; + return ext; +} + /** * The const version of the above function. */ @@ -58,4 +66,12 @@ invoke_extension(const T *ptr) { return ext; } +template +inline const Extension +invoke_extension(const T &ptr) { + Extension ext; + ext._this = (T *) &ptr; + return ext; +} + #endif diff --git a/dtool/src/parser-inc/type_traits b/dtool/src/parser-inc/type_traits new file mode 100644 index 0000000000..7e55b03fbc --- /dev/null +++ b/dtool/src/parser-inc/type_traits @@ -0,0 +1,96 @@ +#pragma once + +#include + +namespace std { + template + struct integral_constant { + static constexpr T value = v; + typedef T value_type; + constexpr operator value_type() const noexcept { return value; } + constexpr value_type operator()() const noexcept { return value; } + }; + + typedef integral_constant true_type; + typedef integral_constant false_type; + + template + struct is_same : std::false_type {}; + + template + struct is_same : std::true_type {}; + + template + struct is_void : std::false_type {}; + + template<> + struct is_void : std::true_type {}; + + template + struct is_enum : integral_constant {}; + + template + struct is_union : integral_constant {}; + + template + struct is_class : integral_constant {}; + + template + struct is_fundamental : integral_constant {}; + + template + struct is_compound : integral_constant {}; + + template + struct is_trivial : integral_constant {}; + + template + struct is_standard_layout : integral_constant {}; + + template + struct is_pod : integral_constant {}; + + template + struct is_empty : integral_constant {}; + + template + struct is_polymorphic : integral_constant {}; + + template + struct is_abstract : integral_constant {}; + + template + struct is_final : integral_constant {}; + + template + struct is_default_constructible : integral_constant {}; + + template + struct is_copy_constructible : integral_constant {}; + + template + struct is_move_constructible : integral_constant {}; + + template + struct is_destructible : integral_constant {}; + + template + struct has_virtual_destructor : integral_constant {}; + + template + struct alignment_of : std::integral_constant {}; + + template + struct is_base_of : integral_constant {}; + + template + struct is_convertible : integral_constant {}; + + template struct add_cv { typedef const volatile T type; }; + template struct add_const { typedef const T type; }; + template struct add_volatile { typedef volatile T type; }; + + template struct add_lvalue_reference { typedef T &type; }; + template struct add_rvalue_reference { typedef T &&type; }; + template struct add_pointer { typedef T *type; }; +} diff --git a/dtool/src/parser-inc/xmmintrin.h b/dtool/src/parser-inc/xmmintrin.h new file mode 100644 index 0000000000..eb127708a8 --- /dev/null +++ b/dtool/src/parser-inc/xmmintrin.h @@ -0,0 +1 @@ +struct __m128; From c2abb4b2f86501108a905e37d70a5997dbccdfd0 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 3 Nov 2016 19:27:04 +0700 Subject: [PATCH 094/112] Revert code that is triggering an odd compiler quirk in MSVC --- dtool/src/interrogatedb/extension.h | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/dtool/src/interrogatedb/extension.h b/dtool/src/interrogatedb/extension.h index 8e844e3ebc..dd995081c1 100644 --- a/dtool/src/interrogatedb/extension.h +++ b/dtool/src/interrogatedb/extension.h @@ -47,14 +47,6 @@ invoke_extension(T *ptr) { return ext; } -template -inline Extension -invoke_extension(T &ptr) { - Extension ext; - ext._this = &ptr; - return ext; -} - /** * The const version of the above function. */ @@ -66,12 +58,4 @@ invoke_extension(const T *ptr) { return ext; } -template -inline const Extension -invoke_extension(const T &ptr) { - Extension ext; - ext._this = (T *) &ptr; - return ext; -} - #endif From c0fd29d822571b9a1a865f4446f895a3f4b721db Mon Sep 17 00:00:00 2001 From: tobspr Date: Thu, 3 Nov 2016 14:08:25 +0100 Subject: [PATCH 095/112] Add functional header to parser-inc (#126) * Support for the functional header * Add unordered_map and initializer_list * Add unordered_set header * Fix spacing, and remove unecessary defines * Add missing definitions to memory header * Use variadic templates in functional header --- dtool/src/parser-inc/functional | 153 +++++++++++++++++++++ dtool/src/parser-inc/initializer_list | 34 +++++ dtool/src/parser-inc/memory | 184 +++++++++++++++++++++++--- dtool/src/parser-inc/unordered_map | 84 ++++++++++++ dtool/src/parser-inc/unordered_set | 83 ++++++++++++ 5 files changed, 516 insertions(+), 22 deletions(-) create mode 100644 dtool/src/parser-inc/functional create mode 100644 dtool/src/parser-inc/initializer_list create mode 100644 dtool/src/parser-inc/unordered_map create mode 100644 dtool/src/parser-inc/unordered_set diff --git a/dtool/src/parser-inc/functional b/dtool/src/parser-inc/functional new file mode 100644 index 0000000000..4d09ed13bf --- /dev/null +++ b/dtool/src/parser-inc/functional @@ -0,0 +1,153 @@ +/** + * 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." + * + * @file functional + * @author tobspr + * @date 2016-11-01 + */ + +// This file, and all the other files in this directory, aren't +// intended to be compiled--they're just parsed by CPPParser (and +// interrogate) in lieu of the actual system headers, to generate the +// interrogate database. + +#ifndef FUNCTIONAL_H +#define FUNCTIONAL_H + +#include + +namespace std { + + // base (deprecated): + template struct unary_function; + template struct binary_function; + + // reference_wrapper: + template class reference_wrapper; + + // arithmetic operations: + template struct plus; + template struct minus; + template struct multiplies; + template struct divides; + template struct modulus; + template struct negate; + + // comparisons: + template struct equal_to; + template struct not_equal_to; + template struct greater; + template struct less; + template struct greater_equal; + template struct less_equal; + + // logical operations: + template struct logical_and; + template struct logical_or; + template struct logical_not; + + // bitwise operations: + template struct bit_and; + template struct bit_or; + template struct bit_xor; + + // negators: + template class unary_negate; + template class binary_negate; + + // bind: + template struct is_bind_expression; + template struct is_placeholder; + + namespace placeholders { + // M is the implementation-defined number of placeholders + // (8 should be enough for interrogate) + extern char _1; + extern char _2; + extern char _3; + extern char _4; + extern char _5; + extern char _6; + extern char _7; + extern char _8; + } + + // binders (deprecated): + template class binder1st; + template class binder2nd; + + // adaptors (deprecated): + template class pointer_to_unary_function; + template + class pointer_to_binary_function; + + // adaptors (deprecated): + template class mem_fun_t; + template class mem_fun1_t; + template class mem_fun_ref_t; + template class mem_fun1_ref_t; + template class const_mem_fun_t; + template class const_mem_fun1_t; + template class const_mem_fun_ref_t; + template class const_mem_fun1_ref_t; + + + // polymorphic function wrappers: + class bad_function_call; + + // hash function base template: + template struct hash; + + // Hash function specializations + template <> struct hash; + template <> struct hash; + template <> struct hash; + template <> struct hash; + template <> struct hash; + template <> struct hash; + template <> struct hash; + template <> struct hash; + template <> struct hash; + template <> struct hash; + template <> struct hash; + template <> struct hash; + template <> struct hash; + template <> struct hash; + template <> struct hash; + template <> struct hash; + template <> struct hash; + template <> struct hash; + template struct hash; + + template class reference_wrapper { + public : + // types + typedef T type; + typedef void result_type; // not always defined + typedef void argument_type; // not always defined + typedef void first_argument_type; // not always defined + typedef void second_argument_type; // not always defined + }; + + template struct is_bind_expression {}; + // : integral_constant {}; + + class bad_function_call : public std::exception {}; + + // template class function; // undefined + + template< class R, class... ArgTypes > + class function { + public: + typedef R result_type; + }; + +} + + +#endif diff --git a/dtool/src/parser-inc/initializer_list b/dtool/src/parser-inc/initializer_list new file mode 100644 index 0000000000..57a3f7f6c1 --- /dev/null +++ b/dtool/src/parser-inc/initializer_list @@ -0,0 +1,34 @@ +/** + * 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." + * + * @file initializer_list + * @author tobspr + * @date 2016-11-01 + */ + +// This file, and all the other files in this directory, aren't +// intended to be compiled--they're just parsed by CPPParser (and +// interrogate) in lieu of the actual system headers, to generate the +// interrogate database. + +#ifndef INITIALIZER_LIST_H +#define INITIALIZER_LIST_H + +#include + +namespace std { + template class initializer_list { + public: + typedef E value_type; + typedef const E& reference; + typedef const E& const_reference; + typedef size_t size_type; + typedef const E* iterator; + typedef const E* const_iterator; + }; +} diff --git a/dtool/src/parser-inc/memory b/dtool/src/parser-inc/memory index 1f76249963..30a54d006a 100644 --- a/dtool/src/parser-inc/memory +++ b/dtool/src/parser-inc/memory @@ -1,16 +1,15 @@ -// Filename: allocator -// Created by: drose (12May00) -// -//////////////////////////////////////////////////////////////////// -// -// 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." -// -//////////////////////////////////////////////////////////////////// +/** + * 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." + * + * @file memory + * @author tobspr + * @date 2016-11-01 + */ // This file, and all the other files in this directory, aren't // intended to be compiled--they're just parsed by CPPParser (and @@ -21,6 +20,8 @@ #define ALLOCATOR_H #include +#include + #ifdef GCC_STYLE_ALLOCATOR @@ -33,16 +34,155 @@ public: #else // GCC_STYLE_ALLOCATOR namespace std { - template - class allocator { - public: - typedef Type *pointer; - typedef const Type *const_pointer; - typedef size_t size_type; - pointer allocate(size_type n, allocator::const_pointer hint = 0); - void deallocate(pointer p, size_type n); - }; + // pointer traits + template struct pointer_traits; + template struct pointer_traits; + + // pointer safety + enum class pointer_safety { relaxed, preferred, strict }; + + // allocator argument tag + struct allocator_arg_t { }; + constexpr allocator_arg_t allocator_arg = allocator_arg_t(); + + // uses_allocator + template struct uses_allocator; + + // allocator traits + template struct allocator_traits; + + // the default allocator: + template class allocator; + template <> class allocator; + + // raw storage iterator: + template class raw_storage_iterator; + + // class template unique_ptr: + template class default_delete; + template class default_delete; + template > class unique_ptr; + template class unique_ptr; + // class bad_weak_ptr: + class bad_weak_ptr; + + // class template shared_ptr: + template class shared_ptr; + // class template weak_ptr: + template class weak_ptr; + + // class template owner_less: + template class owner_less; + + // class template enable_shared_from_this: + template class enable_shared_from_this; + + // hash support + template struct hash; + template struct hash >; + template struct hash >; + + // auto_ptr (deprecated) + template class auto_ptr; + + template struct pointer_traits { + typedef Ptr pointer; + typedef Ptr element_type; + typedef ptrdiff_t difference_type; + + template using rebind = U; + }; + + template struct pointer_traits { + typedef T* pointer; + typedef T element_type; + typedef ptrdiff_t difference_type; + + template using rebind = U*; + }; + + + template struct allocator_traits { + typedef Alloc allocator_type; + + typedef typename Alloc::value_type value_type; + + typedef void* pointer; + typedef const void* const_pointer; + typedef void* void_pointer; + typedef const void* const_void_pointer; + + typedef std::ptrdiff_t difference_type; + typedef size_t size_type; + + struct propagate_on_container_copy_assignment; + struct propagate_on_container_move_assignment; + struct propagate_on_container_swap; + struct is_always_equal; + + template using rebind_alloc = size_t; + template using rebind_traits = allocator_traits >; + }; + + template class allocator; + // specialize for void: + template <> class allocator { + public: + typedef void* pointer; + typedef const void* const_pointer; + // reference-to-void members are impossible. + typedef void value_type; + template struct rebind { typedef allocator other; }; + }; + template class allocator { + public: + struct true_type_; // do not depend on type_traits header + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef T* pointer; + typedef const T* const_pointer; + typedef T& reference; + typedef const T& const_reference; + typedef T value_type; + template struct rebind { typedef allocator other; }; + typedef true_type_ propagate_on_container_move_assignment; + typedef true_type_ is_always_equal; + + }; + + template + class raw_storage_iterator + : public iterator { + public: + }; + + + template struct default_delete {}; + + template struct default_delete {}; + + // unique_ptr for single objects + template > class unique_ptr { + public: + typedef T* pointer; + typedef T element_type; + typedef D deleter_type; + }; + + class bad_weak_ptr: public std::exception {}; + + template class shared_ptr { + public: + typedef T element_type; + }; + + template class weak_ptr { + public: + typedef T element_type; + }; + + template class enable_shared_from_this {}; } #endif // GCC_STYLE_ALLOCATOR diff --git a/dtool/src/parser-inc/unordered_map b/dtool/src/parser-inc/unordered_map new file mode 100644 index 0000000000..e3c6220d35 --- /dev/null +++ b/dtool/src/parser-inc/unordered_map @@ -0,0 +1,84 @@ +/** + * 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." + * + * @file unordered_map + * @author tobspr + * @date 2016-11-01 + */ + +// This file, and all the other files in this directory, aren't +// intended to be compiled--they're just parsed by CPPParser (and +// interrogate) in lieu of the actual system headers, to generate the +// interrogate database. + +#ifndef UNORDERED_MAP_H +#define UNORDERED_MAP_H + +#include +#include +#include +#include +#include + +namespace std { + + template , + class Pred = std::equal_to, + class Allocator = std::allocator > > + class unordered_map + { + public: + // types + typedef Key key_type; + typedef Key value_type; + typedef Hash hasher; + typedef Pred key_equal; + typedef Allocator allocator_type; + typedef typename allocator_type::pointer pointer; + typedef typename allocator_type::const_pointer const_pointer; + typedef typename allocator_type::reference reference; + typedef typename allocator_type::const_reference const_reference; + typedef size_t size_type; + typedef std::ptrdiff_t difference_type; + class iterator; + class const_iterator; + class local_iterator; + class const_local_iterator; + }; + + template , + class Pred = std::equal_to, + class Allocator = std::allocator > > + class unordered_multimap + { + public: + // types + typedef Key key_type; + typedef Key value_type; + typedef Hash hasher; + typedef Pred key_equal; + typedef Allocator allocator_type; + typedef typename allocator_type::pointer pointer; + typedef typename allocator_type::const_pointer const_pointer; + typedef typename allocator_type::reference reference; + typedef typename allocator_type::const_reference const_reference; + typedef size_t size_type; + typedef std::ptrdiff_t difference_type; + class iterator; + class const_iterator; + class local_iterator; + class const_local_iterator; + }; + +} // namespace std + +#endif diff --git a/dtool/src/parser-inc/unordered_set b/dtool/src/parser-inc/unordered_set new file mode 100644 index 0000000000..766161d12b --- /dev/null +++ b/dtool/src/parser-inc/unordered_set @@ -0,0 +1,83 @@ +/** + * 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." + * + * @file unordered_set + * @author tobspr + * @date 2016-11-01 + */ + +// This file, and all the other files in this directory, aren't +// intended to be compiled--they're just parsed by CPPParser (and +// interrogate) in lieu of the actual system headers, to generate the +// interrogate database. + +#ifndef UNORDERED_SET_H +#define UNORDERED_SET_H + +#include +#include +#include +#include +#include + +namespace std { + + template , + class Pred = std::equal_to, + class Allocator = std::allocator > + class unordered_set + { + public: + // types + typedef Key key_type; + typedef Key value_type; + typedef Hash hasher; + typedef Pred key_equal; + typedef Allocator allocator_type; + typedef typename allocator_type::pointer pointer; + typedef typename allocator_type::const_pointer const_pointer; + typedef typename allocator_type::reference reference; + typedef typename allocator_type::const_reference const_reference; + typedef size_t size_type; + typedef std::ptrdiff_t difference_type; + + class iterator; + class const_iterator; + class local_iterator; + class const_local_iterator; + }; + + template , + class Pred = std::equal_to, + class Allocator = std::allocator > + class unordered_multiset + { + public: + // types + typedef Key key_type; + typedef Key value_type; + typedef Hash hasher; + typedef Pred key_equal; + typedef Allocator allocator_type; + typedef typename allocator_type::pointer pointer; + typedef typename allocator_type::const_pointer const_pointer; + typedef typename allocator_type::reference reference; + typedef typename allocator_type::const_reference const_reference; + typedef size_t size_type; + typedef std::ptrdiff_t difference_type; + class iterator; + class const_iterator; + class local_iterator; + class const_local_iterator; + }; + +} // namespace std + +#endif From d54d43ac3401a64ab4a1137bd17477f5bb0d6fa0 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 3 Nov 2016 18:04:14 +0100 Subject: [PATCH 096/112] cppparser: fix issue with templated external method definitions --- dtool/src/cppparser/cppBison.cxx.prebuilt | 11 ++++++++++- dtool/src/cppparser/cppBison.yxx | 11 ++++++++++- dtool/src/cppparser/cppClassTemplateParameter.cxx | 11 +++++------ dtool/src/cppparser/cppScope.h | 5 +++-- 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/dtool/src/cppparser/cppBison.cxx.prebuilt b/dtool/src/cppparser/cppBison.cxx.prebuilt index dcc103b178..877a9636e1 100644 --- a/dtool/src/cppparser/cppBison.cxx.prebuilt +++ b/dtool/src/cppparser/cppBison.cxx.prebuilt @@ -5426,7 +5426,16 @@ yyreduce: case 174: #line 1619 "dtool/src/cppparser/cppBison.yxx" /* yacc.c:1646 */ { - push_scope((yyvsp[-1].u.inst_ident)->get_scope(current_scope, global_scope)); + // Create a scope for this function (in case it is a function) + CPPScope *scope = new CPPScope((yyvsp[-1].u.inst_ident)->get_scope(current_scope, global_scope), + CPPNameComponent(""), V_private); + + // It still needs to be able to pick up any template arguments, if this is + // a definition for a method template. Add a fake "using" declaration to + // accomplish this. + scope->_using.insert(current_scope); + + push_scope(scope); } #line 5432 "built/tmp/cppBison.yxx.c" /* yacc.c:1646 */ break; diff --git a/dtool/src/cppparser/cppBison.yxx b/dtool/src/cppparser/cppBison.yxx index f5200316d0..04cdb53a4b 100644 --- a/dtool/src/cppparser/cppBison.yxx +++ b/dtool/src/cppparser/cppBison.yxx @@ -1617,7 +1617,16 @@ instance_identifier: } | instance_identifier '(' { - push_scope($1->get_scope(current_scope, global_scope)); + // Create a scope for this function (in case it is a function) + CPPScope *scope = new CPPScope($1->get_scope(current_scope, global_scope), + CPPNameComponent(""), V_private); + + // It still needs to be able to pick up any template arguments, if this is + // a definition for a method template. Add a fake "using" declaration to + // accomplish this. + scope->_using.insert(current_scope); + + push_scope(scope); } formal_parameter_list ')' function_post { diff --git a/dtool/src/cppparser/cppClassTemplateParameter.cxx b/dtool/src/cppparser/cppClassTemplateParameter.cxx index 602f367722..7ed9a94faf 100644 --- a/dtool/src/cppparser/cppClassTemplateParameter.cxx +++ b/dtool/src/cppparser/cppClassTemplateParameter.cxx @@ -42,15 +42,14 @@ is_fully_specified() const { void CPPClassTemplateParameter:: output(ostream &out, int indent_level, CPPScope *scope, bool complete) const { if (complete) { - if (_ident != NULL) { - out << "class "; - _ident->output(out, scope); - } else { - out << "class"; - } + out << "class"; if (_packed) { out << "..."; } + if (_ident != NULL) { + out << " "; + _ident->output(out, scope); + } if (_default_type) { out << " = "; _default_type->output(out, indent_level, scope, false); diff --git a/dtool/src/cppparser/cppScope.h b/dtool/src/cppparser/cppScope.h index 75eaa53c6a..dc8c7e0295 100644 --- a/dtool/src/cppparser/cppScope.h +++ b/dtool/src/cppparser/cppScope.h @@ -139,11 +139,12 @@ public: Templates _templates; CPPNameComponent _name; + typedef set Using; + Using _using; + protected: CPPScope *_parent_scope; CPPStructType *_struct_type; - typedef set Using; - Using _using; CPPVisibility _current_vis; private: From b0a84087556b24b9fa76306a80ed7fb59f2dac11 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 4 Nov 2016 00:49:04 +0700 Subject: [PATCH 097/112] Fix issue with Windows build --- dtool/src/parser-inc/stdtypedefs.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dtool/src/parser-inc/stdtypedefs.h b/dtool/src/parser-inc/stdtypedefs.h index 5a92caaff7..a14a140d2f 100644 --- a/dtool/src/parser-inc/stdtypedefs.h +++ b/dtool/src/parser-inc/stdtypedefs.h @@ -39,6 +39,8 @@ inline namespace std { #endif } +struct timeval; + #ifdef __cplusplus #define NULL 0L #else From e9a43a21fa63f535fe48c6a92078ad752fc3b34f Mon Sep 17 00:00:00 2001 From: Tohka Date: Tue, 1 Nov 2016 17:25:47 +0200 Subject: [PATCH 098/112] Remove PiratesMagicWordManager VR Studio code reference --- direct/src/distributed/DistributedObjectGlobalUD.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/direct/src/distributed/DistributedObjectGlobalUD.py b/direct/src/distributed/DistributedObjectGlobalUD.py index b8f84b472e..34cfa3a213 100755 --- a/direct/src/distributed/DistributedObjectGlobalUD.py +++ b/direct/src/distributed/DistributedObjectGlobalUD.py @@ -26,11 +26,7 @@ class DistributedObjectGlobalUD(DistributedObjectUD): def execCommand(self, command, mwMgrId, avId, zoneId): text = str(self.__execMessage(command))[:config.GetInt("ai-debug-length",300)] - - dclass = uber.air.dclassesByName.get("PiratesMagicWordManagerAI") - dg = dclass.aiFormatUpdate( - "setMagicWordResponse", mwMgrId, (1<<32)+avId, uber.air.ourChannel, [text]) - uber.air.send(dg) + self.notify.info(text) def __execMessage(self, message): if not self.ExecNamespace: From 8c1f64e086e3dd12be80a97b2e35ce3cffbff6d2 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 14 Nov 2016 19:40:46 +0100 Subject: [PATCH 099/112] Fix for 1.9: fix errors when Cg-style matrix inputs are mat3 --- doc/ReleaseNotes | 1 + panda/src/glstuff/glShaderContext_src.cxx | 12 ++++++++++-- panda/src/glstuff/glShaderContext_src.h | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index 157a20b2bf..b7462a97d6 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -47,6 +47,7 @@ This issue fixes several bugs that were still found in 1.9.2. * Fix compilation errors with Bullet 2.84 * Fix exception when trying to pickle NodePathCollection objects * Fix error when trying to raise vectors to a power +* GLSL: fix error when legacy matrix generator inputs are mat3 ------------------------ RELEASE 1.9.2 ------------------------ diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index df8ea97655..5ce322bfac 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -51,7 +51,7 @@ TypeHandle CLP(ShaderContext)::_type_handle; // actually picked up and the appropriate ShaderMatSpec pushed onto _mat_spec. //////////////////////////////////////////////////////////////////// bool CLP(ShaderContext):: -parse_and_set_short_hand_shader_vars(Shader::ShaderArgId &arg_id, Shader *objShader) { +parse_and_set_short_hand_shader_vars(Shader::ShaderArgId &arg_id, GLenum param_type, Shader *objShader) { Shader::ShaderArgInfo p; p._id = arg_id; p._cat = GLCAT; @@ -167,6 +167,14 @@ parse_and_set_short_hand_shader_vars(Shader::ShaderArgId &arg_id, Shader *objSha else if (pieces[0] == "col2") bind._piece = Shader::SMP_col2; else if (pieces[0] == "col3") bind._piece = Shader::SMP_col3; + if (param_type == GL_FLOAT_MAT3) { + if (bind._piece == Shader::SMP_whole) { + bind._piece = Shader::SMP_upper3x3; + } else if (bind._piece == Shader::SMP_transpose) { + bind._piece = Shader::SMP_transpose3x3; + } + } + if (!objShader->cp_parse_coord_sys(p, pieces, next, bind, true)) { return false; } @@ -614,7 +622,7 @@ CLP(ShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderContext } //Tries to parse shorthand notations like mspos_XXX and trans_model_to_clip_of_XXX - if (parse_and_set_short_hand_shader_vars(arg_id, s)) { + if (parse_and_set_short_hand_shader_vars(arg_id, param_type, s)) { continue; } diff --git a/panda/src/glstuff/glShaderContext_src.h b/panda/src/glstuff/glShaderContext_src.h index 62d54ed675..51376e44f4 100644 --- a/panda/src/glstuff/glShaderContext_src.h +++ b/panda/src/glstuff/glShaderContext_src.h @@ -87,7 +87,7 @@ private: void glsl_report_program_errors(GLuint program, bool fatal); bool glsl_compile_shader(Shader::ShaderType type); bool glsl_compile_and_link(); - bool parse_and_set_short_hand_shader_vars(Shader::ShaderArgId &arg_id, Shader *s); + bool parse_and_set_short_hand_shader_vars(Shader::ShaderArgId &arg_id, GLenum param_type, Shader *s); void release_resources(); public: From b02e3521bcf1ab064dbfb1fa05d265ee1681db44 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 27 Nov 2016 12:30:37 +0100 Subject: [PATCH 100/112] Fix wrong GL texture being bound to image slot after being recreated --- panda/src/glstuff/glShaderContext_src.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index 3e1fe026f9..e133664912 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -2446,8 +2446,8 @@ update_shader_texture_bindings(ShaderContext *prev) { if (gtc != (TextureContext*)NULL) { input._gtc = gtc; - gl_tex = gtc->_index; _glgsg->update_texture(gtc, true); + gl_tex = gtc->_index; if (gtc->needs_barrier(GL_SHADER_IMAGE_ACCESS_BARRIER_BIT)) { barriers |= GL_SHADER_IMAGE_ACCESS_BARRIER_BIT; From cf389276da45f564c9fcd6b0d8886096fa39d759 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 27 Nov 2016 13:04:54 +0100 Subject: [PATCH 101/112] Backport b02e352 to 1.9: rdb: Fix wrong GL texture being bound to image slot after being recreated --- panda/src/glstuff/glShaderContext_src.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index 5ce322bfac..6c68aeb4a6 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -1684,8 +1684,8 @@ update_shader_texture_bindings(ShaderContext *prev) { if (gtc != (TextureContext*)NULL) { _glsl_img_textures[i] = gtc; - gl_tex = gtc->_index; _glgsg->update_texture(gtc, true); + gl_tex = gtc->_index; if (gtc->needs_barrier(GL_SHADER_IMAGE_ACCESS_BARRIER_BIT)) { barriers |= GL_SHADER_IMAGE_ACCESS_BARRIER_BIT; From 78bf339c4160f3b9e6630afa767ebc6b3f58d57a Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 27 Nov 2016 14:24:37 +0100 Subject: [PATCH 102/112] Fix material shader inputs not being updated properly --- panda/src/glstuff/glShaderContext_src.cxx | 2 +- panda/src/gobj/shader.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index e133664912..b02ec341df 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -901,7 +901,7 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { bind._func = Shader::SMF_first; bind._part[0] = Shader::SMO_attr_material; bind._arg[0] = NULL; - bind._dep[0] = Shader::SSD_general | Shader::SSD_material; + bind._dep[0] = Shader::SSD_general | Shader::SSD_material | Shader::SSD_frame; bind._part[1] = Shader::SMO_identity; bind._arg[1] = NULL; bind._dep[1] = Shader::SSD_NONE; diff --git a/panda/src/gobj/shader.cxx b/panda/src/gobj/shader.cxx index d9cf151e83..e067c18582 100644 --- a/panda/src/gobj/shader.cxx +++ b/panda/src/gobj/shader.cxx @@ -376,7 +376,7 @@ cp_dependency(ShaderMatInput inp) { return SSD_NONE; } if (inp == SMO_attr_material || inp == SMO_attr_material2) { - dep |= SSD_material; + dep |= SSD_material | SSD_frame; } if (inp == SMO_attr_color) { dep |= SSD_color; From 7db45cb647a160dc0acd14f291124d6bd1f71dea Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 27 Nov 2016 14:25:00 +0100 Subject: [PATCH 103/112] Make fetching of p3d_LightSource[n] input clearly defined for non-existent lights Refer to OpenGL 2.1 spec page 61 Closes: #129 --- panda/src/display/graphicsStateGuardian.cxx | 125 ++++++++++++++------ 1 file changed, 92 insertions(+), 33 deletions(-) diff --git a/panda/src/display/graphicsStateGuardian.cxx b/panda/src/display/graphicsStateGuardian.cxx index ad532c5643..67fbdb2f6c 100644 --- a/panda/src/display/graphicsStateGuardian.cxx +++ b/panda/src/display/graphicsStateGuardian.cxx @@ -1363,8 +1363,18 @@ fetch_specified_part(Shader::ShaderMatInput part, InternalName *name, } } - // TODO: dummy light - nassertr(false, &LMatrix4::ident_mat()); + // Apply the default OpenGL lights otherwise. + // Special exception for light 0, which defaults to white. + if (index == 0) { + string basename = name->get_basename(); + if (basename == "color" || basename == "diffuse") { + t.set_row(3, _light_color_scale); + return &t; + } else if (basename == "specular") { + return &LMatrix4::ones_mat(); + } + } + return fetch_specified_member(NodePath(), name, t); } default: nassertr(false /*should never get here*/, &LMatrix4::ident_mat()); @@ -1395,8 +1405,16 @@ fetch_specified_member(const NodePath &np, CPT_InternalName attrib, LMatrix4 &t) static const CPT_InternalName IN_quadraticAttenuation("quadraticAttenuation"); static const CPT_InternalName IN_shadowMatrix("shadowMatrix"); + PandaNode *node = NULL; + if (!np.is_empty()) { + node = np.node(); + } + if (attrib == IN_color) { - Light *light = np.node()->as_light(); + if (node == (PandaNode *)NULL) { + return &LMatrix4::ident_mat(); + } + Light *light = node->as_light(); nassertr(light != (Light *)NULL, &LMatrix4::ident_mat()); LColor c = light->get_color(); c.componentwise_mult(_light_color_scale); @@ -1404,9 +1422,12 @@ fetch_specified_member(const NodePath &np, CPT_InternalName attrib, LMatrix4 &t) return &t; } else if (attrib == IN_ambient) { - Light *light = np.node()->as_light(); + if (node == (PandaNode *)NULL) { + return &LMatrix4::ident_mat(); + } + Light *light = node->as_light(); nassertr(light != (Light *)NULL, &LMatrix4::ident_mat()); - if (np.node()->is_of_type(AmbientLight::get_class_type())) { + if (node->is_of_type(AmbientLight::get_class_type())) { LColor c = light->get_color(); c.componentwise_mult(_light_color_scale); t.set_row(3, c); @@ -1417,9 +1438,12 @@ fetch_specified_member(const NodePath &np, CPT_InternalName attrib, LMatrix4 &t) return &t; } else if (attrib == IN_diffuse) { - Light *light = np.node()->as_light(); + if (node == (PandaNode *)NULL) { + return &LMatrix4::ident_mat(); + } + Light *light = node->as_light(); nassertr(light != (Light *)NULL, &LMatrix4::ones_mat()); - if (np.node()->is_of_type(AmbientLight::get_class_type())) { + if (node->is_of_type(AmbientLight::get_class_type())) { // Ambient light has no diffuse color. t.set_row(3, LColor(0.0f, 0.0f, 0.0f, 1.0f)); } else { @@ -1430,19 +1454,25 @@ fetch_specified_member(const NodePath &np, CPT_InternalName attrib, LMatrix4 &t) return &t; } else if (attrib == IN_specular) { - Light *light = np.node()->as_light(); + if (node == (PandaNode *)NULL) { + return &LMatrix4::ident_mat(); + } + Light *light = node->as_light(); nassertr(light != (Light *)NULL, &LMatrix4::ones_mat()); t.set_row(3, light->get_specular_color()); return &t; } else if (attrib == IN_position) { - if (np.node()->is_of_type(AmbientLight::get_class_type())) { + if (np.is_empty()) { + t = LMatrix4(0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0); + return &t; + } else if (node->is_of_type(AmbientLight::get_class_type())) { // Ambient light has no position. t = LMatrix4(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); return &t; - } else if (np.node()->is_of_type(DirectionalLight::get_class_type())) { + } else if (node->is_of_type(DirectionalLight::get_class_type())) { DirectionalLight *light; - DCAST_INTO_R(light, np.node(), &LMatrix4::ident_mat()); + DCAST_INTO_R(light, node, &LMatrix4::ident_mat()); CPT(TransformState) transform = np.get_transform(_scene_setup->get_scene_root().get_parent()); LVector3 dir = -(light->get_direction() * transform->get_mat()); @@ -1451,7 +1481,7 @@ fetch_specified_member(const NodePath &np, CPT_InternalName attrib, LMatrix4 &t) return &t; } else { LightLensNode *light; - DCAST_INTO_R(light, np.node(), &LMatrix4::ident_mat()); + DCAST_INTO_R(light, node, &LMatrix4::ident_mat()); Lens *lens = light->get_lens(); nassertr(lens != (Lens *)NULL, &LMatrix4::ident_mat()); @@ -1466,13 +1496,16 @@ fetch_specified_member(const NodePath &np, CPT_InternalName attrib, LMatrix4 &t) } } else if (attrib == IN_halfVector) { - if (np.node()->is_of_type(AmbientLight::get_class_type())) { + if (np.is_empty()) { + t = LMatrix4(0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0); + return &t; + } else if (node->is_of_type(AmbientLight::get_class_type())) { // Ambient light has no half-vector. t = LMatrix4(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); return &t; - } else if (np.node()->is_of_type(DirectionalLight::get_class_type())) { + } else if (node->is_of_type(DirectionalLight::get_class_type())) { DirectionalLight *light; - DCAST_INTO_R(light, np.node(), &LMatrix4::ident_mat()); + DCAST_INTO_R(light, node, &LMatrix4::ident_mat()); CPT(TransformState) transform = np.get_transform(_scene_setup->get_scene_root().get_parent()); LVector3 dir = -(light->get_direction() * transform->get_mat()); @@ -1484,7 +1517,7 @@ fetch_specified_member(const NodePath &np, CPT_InternalName attrib, LMatrix4 &t) return &t; } else { LightLensNode *light; - DCAST_INTO_R(light, np.node(), &LMatrix4::ident_mat()); + DCAST_INTO_R(light, node, &LMatrix4::ident_mat()); Lens *lens = light->get_lens(); nassertr(lens != (Lens *)NULL, &LMatrix4::ident_mat()); @@ -1502,13 +1535,16 @@ fetch_specified_member(const NodePath &np, CPT_InternalName attrib, LMatrix4 &t) } } else if (attrib == IN_spotDirection) { - if (np.node()->is_of_type(AmbientLight::get_class_type())) { + if (node == (PandaNode *)NULL) { + t.set_row(3, LVector3(0.0f, 0.0f, -1.0f)); + return &t; + } else if (node->is_of_type(AmbientLight::get_class_type())) { // Ambient light has no spot direction. t.set_row(3, LVector3(0.0f, 0.0f, 0.0f)); return &t; } else { LightLensNode *light; - DCAST_INTO_R(light, np.node(), &LMatrix4::ident_mat()); + DCAST_INTO_R(light, node, &LMatrix4::ident_mat()); Lens *lens = light->get_lens(); nassertr(lens != (Lens *)NULL, &LMatrix4::ident_mat()); @@ -1523,9 +1559,10 @@ fetch_specified_member(const NodePath &np, CPT_InternalName attrib, LMatrix4 &t) } } else if (attrib == IN_spotCutoff) { - if (np.node()->is_of_type(Spotlight::get_class_type())) { + if (node != (PandaNode *)NULL && + node->is_of_type(Spotlight::get_class_type())) { LightLensNode *light; - DCAST_INTO_R(light, np.node(), &LMatrix4::ident_mat()); + DCAST_INTO_R(light, node, &LMatrix4::ident_mat()); Lens *lens = light->get_lens(); nassertr(lens != (Lens *)NULL, &LMatrix4::ident_mat()); @@ -1539,9 +1576,10 @@ fetch_specified_member(const NodePath &np, CPT_InternalName attrib, LMatrix4 &t) } } else if (attrib == IN_spotCosCutoff) { - if (np.node()->is_of_type(Spotlight::get_class_type())) { + if (node != (PandaNode *)NULL && + node->is_of_type(Spotlight::get_class_type())) { LightLensNode *light; - DCAST_INTO_R(light, np.node(), &LMatrix4::ident_mat()); + DCAST_INTO_R(light, node, &LMatrix4::ident_mat()); Lens *lens = light->get_lens(); nassertr(lens != (Lens *)NULL, &LMatrix4::ident_mat()); @@ -1553,51 +1591,72 @@ fetch_specified_member(const NodePath &np, CPT_InternalName attrib, LMatrix4 &t) t.set_row(3, LVecBase4(-1)); return &t; } + } else if (attrib == IN_spotExponent) { - Light *light = np.node()->as_light(); + if (node == (PandaNode *)NULL) { + return &LMatrix4::zeros_mat(); + } + Light *light = node->as_light(); nassertr(light != (Light *)NULL, &LMatrix4::ident_mat()); t.set_row(3, LVecBase4(light->get_exponent())); return &t; } else if (attrib == IN_attenuation) { - Light *light = np.node()->as_light(); - nassertr(light != (Light *)NULL, &LMatrix4::ones_mat()); + if (node != (PandaNode *)NULL) { + Light *light = node->as_light(); + nassertr(light != (Light *)NULL, &LMatrix4::ones_mat()); - t.set_row(3, LVecBase4(light->get_attenuation(), 0)); + t.set_row(3, LVecBase4(light->get_attenuation(), 0)); + } else { + t.set_row(3, LVecBase4(1, 0, 0, 0)); + } return &t; } else if (attrib == IN_constantAttenuation) { - Light *light = np.node()->as_light(); + if (node == (PandaNode *)NULL) { + return &LMatrix4::ones_mat(); + } + Light *light = node->as_light(); nassertr(light != (Light *)NULL, &LMatrix4::ones_mat()); t.set_row(3, LVecBase4(light->get_attenuation()[0])); return &t; } else if (attrib == IN_linearAttenuation) { - Light *light = np.node()->as_light(); + if (node == (PandaNode *)NULL) { + return &LMatrix4::zeros_mat(); + } + Light *light = node->as_light(); nassertr(light != (Light *)NULL, &LMatrix4::ident_mat()); t.set_row(3, LVecBase4(light->get_attenuation()[1])); return &t; } else if (attrib == IN_quadraticAttenuation) { - Light *light = np.node()->as_light(); + if (node == (PandaNode *)NULL) { + return &LMatrix4::zeros_mat(); + } + Light *light = node->as_light(); nassertr(light != (Light *)NULL, &LMatrix4::ident_mat()); t.set_row(3, LVecBase4(light->get_attenuation()[2])); return &t; } else if (attrib == IN_shadowMatrix) { - LensNode *lnode; - DCAST_INTO_R(lnode, np.node(), &LMatrix4::ident_mat()); - Lens *lens = lnode->get_lens(); - static const LMatrix4 biasmat(0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 0.5f, 0.0f, 0.5f, 0.5f, 0.5f, 1.0f); + if (node == (PandaNode *)NULL) { + return &biasmat; + } + + LensNode *lnode; + DCAST_INTO_R(lnode, node, &LMatrix4::ident_mat()); + Lens *lens = lnode->get_lens(); + t = get_external_transform()->get_mat() * get_scene()->get_camera_transform()->get_mat() * np.get_net_transform()->get_inverse()->get_mat() * From 1e2961f7efb7264acdfa9ef2c887f0aa292d72da Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 29 Nov 2016 21:53:37 +0100 Subject: [PATCH 104/112] Improve windows installer: .prc file assoc, use DOS newlines for prc, error if installing 64-bit version on 32-bit Windows --- makepanda/installer.nsi | 12 ++++++++++++ makepanda/makepanda.py | 19 +++++++++++++++---- makepanda/makepandacore.py | 19 +++++++++++++++---- 3 files changed, 42 insertions(+), 8 deletions(-) diff --git a/makepanda/installer.nsi b/makepanda/installer.nsi index a1f364910d..04d9e521d0 100755 --- a/makepanda/installer.nsi +++ b/makepanda/installer.nsi @@ -31,6 +31,7 @@ SetCompressor ${COMPRESSOR} !include "Sections.nsh" !include "WinMessages.nsh" !include "WordFunc.nsh" +!include "x64.nsh" !define MUI_WELCOMEFINISHPAGE_BITMAP "panda-install.bmp" !define MUI_UNWELCOMEFINISHPAGE_BITMAP "panda-install.bmp" @@ -120,6 +121,14 @@ Function runFunction ExecShell "open" "$SMPROGRAMS\${TITLE}\Panda3D Manual.lnk" FunctionEnd +Function .onInit + ${If} ${REGVIEW} = 64 + ${AndIfNot} ${RunningX64} + MessageBox MB_OK|MB_ICONEXCLAMATION "You are attempting to install the 64-bit version of Panda3D on a 32-bit version of Windows. Please download and install the 32-bit version of Panda3D instead." + Abort + ${EndIf} +FunctionEnd + SectionGroup "Panda3D Libraries" Section "Core Libraries" SecCore SectionIn 1 2 RO @@ -634,6 +643,9 @@ Section -post WriteRegStr HKCU "Software\Classes\.pz" "PerceivedType" "compressed" WriteRegStr HKCU "Software\Classes\.mf" "" "Panda3D.Multifile" WriteRegStr HKCU "Software\Classes\.mf" "PerceivedType" "compressed" + WriteRegStr HKCU "Software\Classes\.prc" "" "inifile" + WriteRegStr HKCU "Software\Classes\.prc" "Content Type" "text/plain" + WriteRegStr HKCU "Software\Classes\.prc" "PerceivedType" "text" ; For convenience, if nobody registered .pyd, we will. ReadRegStr $0 HKCR "Software\Classes\.pyd" "" diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 18c73e5f26..27a5192f2b 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -2781,8 +2781,13 @@ if (GetTarget() == 'darwin'): # OpenAL is not yet working well on OSX for us, so let's do this for now. configprc = configprc.replace("p3openal_audio", "p3fmod_audio") -ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc) -ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc) +if GetTarget() == 'windows': + # Convert to Windows newlines. + ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc, newline='\r\n') + ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc, newline='\r\n') +else: + ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc) + ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc) ########################################################################################## # @@ -2902,8 +2907,14 @@ if tp_dir is not None: ## ######################################################################## -CopyFile(GetOutputDir()+"/", "doc/LICENSE") -CopyFile(GetOutputDir()+"/", "doc/ReleaseNotes") +if GetTarget() == 'windows': + # Convert to Windows newlines so they can be opened by notepad. + WriteFile(GetOutputDir() + "/LICENSE", ReadFile("doc/LICENSE"), newline='\r\n') + WriteFile(GetOutputDir() + "/ReleaseNotes", ReadFile("doc/ReleaseNotes"), newline='\r\n') +else: + CopyFile(GetOutputDir()+"/", "doc/LICENSE") + CopyFile(GetOutputDir()+"/", "doc/ReleaseNotes") + if (PkgSkip("PANDATOOL")==0): CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".mel") CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".ms") diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index 29ecf9f06d..123c2bb555 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -966,7 +966,12 @@ def ReadBinaryFile(wfile): ex = sys.exc_info()[1] exit("Cannot read %s: %s" % (wfile, ex)) -def WriteFile(wfile, data): +def WriteFile(wfile, data, newline=None): + if newline is not None: + data = data.replace('\r\n', '\n') + data = data.replace('\r', '\n') + data = data.replace('\n', newline) + try: dsthandle = open(wfile, "w") dsthandle.write(data) @@ -984,18 +989,24 @@ def WriteBinaryFile(wfile, data): ex = sys.exc_info()[1] exit("Cannot write to %s: %s" % (wfile, ex)) -def ConditionalWriteFile(dest, desiredcontents): +def ConditionalWriteFile(dest, data, newline=None): + if newline is not None: + data = data.replace('\r\n', '\n') + data = data.replace('\r', '\n') + data = data.replace('\n', newline) + try: rfile = open(dest, 'r') contents = rfile.read(-1) rfile.close() except: contents = 0 - if contents != desiredcontents: + + if contents != data: if VERBOSE: print("Writing %s" % (dest)) sys.stdout.flush() - WriteFile(dest, desiredcontents) + WriteFile(dest, data) def DeleteVCS(dir): if dir == "": dir = "." From 948ff8562d54f74c6ae8d29e6e0c89c1f91ad472 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 29 Nov 2016 22:41:46 +0100 Subject: [PATCH 105/112] Support targeting Windows XP with MSVC 2015 --- makepanda/installer.nsi | 16 ++++++-- makepanda/makepanda.py | 82 +++++++++++++++++++++++++++++++------- makepanda/makepandacore.py | 23 +++++++++++ 3 files changed, 104 insertions(+), 17 deletions(-) diff --git a/makepanda/installer.nsi b/makepanda/installer.nsi index 04d9e521d0..d14cb44da9 100755 --- a/makepanda/installer.nsi +++ b/makepanda/installer.nsi @@ -143,12 +143,22 @@ SectionGroup "Panda3D Libraries" SetOutPath "$INSTDIR" File "${BUILT}\LICENSE" File /r /x CVS "${BUILT}\ReleaseNotes" - SetOutPath $INSTDIR\bin - File /r /x libpandagl.dll /x libpandadx9.dll /x cgD3D*.dll /x python*.dll /x libpandaode.dll /x libp3fmod_audio.dll /x fmodex*.dll /x libp3ffmpeg.dll /x av*.dll /x postproc*.dll /x swscale*.dll /x swresample*.dll /x NxCharacter*.dll /x cudart*.dll /x PhysX*.dll /x libpandaphysx.dll /x libp3rocket.dll /x boost_python*.dll /x Rocket*.dll /x _rocket*.pyd /x libpandabullet.dll /x OpenAL32.dll /x *_oal.dll /x libp3openal_audio.dll "${BUILT}\bin\*.dll" - File /nonfatal /r "${BUILT}\bin\Microsoft.*.manifest" + SetOutPath $INSTDIR\etc File /r "${BUILT}\etc\*" + SetOutPath $INSTDIR\bin + File /r /x api-ms-win-*.dll /x ucrtbase.dll /x libpandagl.dll /x libpandadx9.dll /x cgD3D*.dll /x python*.dll /x libpandaode.dll /x libp3fmod_audio.dll /x fmodex*.dll /x libp3ffmpeg.dll /x av*.dll /x postproc*.dll /x swscale*.dll /x swresample*.dll /x NxCharacter*.dll /x cudart*.dll /x PhysX*.dll /x libpandaphysx.dll /x libp3rocket.dll /x boost_python*.dll /x Rocket*.dll /x _rocket*.pyd /x libpandabullet.dll /x OpenAL32.dll /x *_oal.dll /x libp3openal_audio.dll "${BUILT}\bin\*.dll" + File /nonfatal /r "${BUILT}\bin\Microsoft.*.manifest" + + ; Before Windows 10, we need these stubs for the UCRT as well. + ReadRegDWORD $0 HKLM "Software\Microsoft\Windows NT\CurrentVersion" "CurrentMajorVersionNumber" + ${If} $0 < 10 + ClearErrors + File /nonfatal /r "${BUILT}\bin\api-ms-win-*.dll" + File /nonfatal "${BUILT}\bin\ucrtbase.dll" + ${Endif} + SetDetailsPrint both DetailPrint "Installing models..." SetDetailsPrint listonly diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 27a5192f2b..af852dc161 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -1060,6 +1060,10 @@ def CompileCxx(obj,src,opts): cmd += "/DWINVER=0x601 " else: cmd += "/DWINVER=0x501 " + # Work around a WinXP/2003 bug when using VS 2015+. + if SDK.get("VISUALSTUDIO_VERSION") == '14.0': + cmd += "/Zc:threadSafeInit- " + cmd += "/Fo" + obj + " /nologo /c" if GetTargetArch() != 'x64' and (not PkgSkip("SSE2") or 'SSE2' in opts): cmd += " /arch:SSE2" @@ -2884,22 +2888,72 @@ if tp_dir is not None: if GetTarget() == 'windows': CopyAllFiles(GetOutputDir() + "/bin/", tp_dir + "extras/bin/") - if not PkgSkip("PYTHON"): - pydll = "/" + SDK["PYTHONVERSION"].replace(".", "") - if (GetOptimize() <= 2): pydll += "_d.dll" - else: pydll += ".dll" - CopyFile(GetOutputDir() + "/bin" + pydll, SDK["PYTHON"] + pydll) - for fn in glob.glob(SDK["PYTHON"] + "/vcruntime*.dll"): - CopyFile(GetOutputDir() + "/bin/", fn) + if not PkgSkip("PYTHON") and not RTDIST: + #XXX rdb I don't think we need to copy over the Python DLL, do we? + #pydll = "/" + SDK["PYTHONVERSION"].replace(".", "") + #if (GetOptimize() <= 2): pydll += "_d.dll" + #else: pydll += ".dll" + #CopyFile(GetOutputDir() + "/bin" + pydll, SDK["PYTHON"] + pydll) - if not RTDIST: - CopyTree(GetOutputDir() + "/python", SDK["PYTHON"]) - if not os.path.isfile(SDK["PYTHON"] + "/ppython.exe") and os.path.isfile(SDK["PYTHON"] + "/python.exe"): - CopyFile(GetOutputDir() + "/python/ppython.exe", SDK["PYTHON"] + "/python.exe") - if not os.path.isfile(SDK["PYTHON"] + "/ppythonw.exe") and os.path.isfile(SDK["PYTHON"] + "/pythonw.exe"): - CopyFile(GetOutputDir() + "/python/ppythonw.exe", SDK["PYTHON"] + "/pythonw.exe") - ConditionalWriteFile(GetOutputDir() + "/python/panda.pth", "..\n../bin\n") + #for fn in glob.glob(SDK["PYTHON"] + "/vcruntime*.dll"): + # CopyFile(GetOutputDir() + "/bin/", fn) + + # Copy the whole Python directory. + CopyTree(GetOutputDir() + "/python", SDK["PYTHON"]) + + # NB: Python does not always ship with the correct manifest/dll. + # Figure out the correct one to ship, and grab it from WinSxS dir. + manifest = GetOutputDir() + '/tmp/python.manifest' + if os.path.isfile(manifest): + os.unlink(manifest) + oscmd('mt -inputresource:"%s\\python.exe";#1 -out:"%s" -nologo' % (SDK["PYTHON"], manifest), True) + + if os.path.isfile(manifest): + import xml.etree.ElementTree as ET + tree = ET.parse(manifest) + idents = tree.findall('./{urn:schemas-microsoft-com:asm.v1}dependency/{urn:schemas-microsoft-com:asm.v1}dependentAssembly/{urn:schemas-microsoft-com:asm.v1}assemblyIdentity') + else: + idents = () + + for ident in tree.findall('./{urn:schemas-microsoft-com:asm.v1}dependency/{urn:schemas-microsoft-com:asm.v1}dependentAssembly/{urn:schemas-microsoft-com:asm.v1}assemblyIdentity'): + sxs_name = '_'.join([ + ident.get('processorArchitecture'), + ident.get('name').lower(), + ident.get('publicKeyToken'), + ident.get('version'), + ]) + + # Find the manifest matching these parameters. + pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', 'Manifests', sxs_name + '_*.manifest') + manifests = glob.glob(pattern) + if not manifests: + print("%sWARNING:%s Could not locate manifest %s. You may need to reinstall the Visual C++ Redistributable." % (GetColor("red"), GetColor(), pattern)) + continue + + CopyFile(GetOutputDir() + "/python/" + ident.get('name') + ".manifest", manifests[0]) + + # Also copy the corresponding msvcr dll. + pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', sxs_name + '_*', 'msvcr*.dll') + for file in glob.glob(pattern): + CopyFile(GetOutputDir() + "/python/", file) + + # Copy python.exe to ppython.exe. + if not os.path.isfile(SDK["PYTHON"] + "/ppython.exe") and os.path.isfile(SDK["PYTHON"] + "/python.exe"): + CopyFile(GetOutputDir() + "/python/ppython.exe", SDK["PYTHON"] + "/python.exe") + if not os.path.isfile(SDK["PYTHON"] + "/ppythonw.exe") and os.path.isfile(SDK["PYTHON"] + "/pythonw.exe"): + CopyFile(GetOutputDir() + "/python/ppythonw.exe", SDK["PYTHON"] + "/pythonw.exe") + ConditionalWriteFile(GetOutputDir() + "/python/panda.pth", "..\n../bin\n") + +# Copy over the MSVC runtime. +if GetTarget() == 'windows' and "VISUALSTUDIO" in SDK: + vcver = SDK["VISUALSTUDIO_VERSION"].replace('.', '') + crtname = "Microsoft.VC%s.CRT" % (vcver) + dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "redist", GetTargetArch(), crtname) + + if os.path.isdir(dir): + CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "vcruntime" + vcver + ".dll")) + CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcp" + vcver + ".dll")) ######################################################################## ## diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index 123c2bb555..2b9e9d4a32 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -512,6 +512,7 @@ def oscmd(cmd, ignoreError = False): exit("Cannot find "+exe+" on search path") res = os.spawnl(os.P_WAIT, exe_path, cmd) else: + cmd = cmd.replace(';', '\\;') res = subprocess.call(cmd, shell=True) sig = res & 0x7F if (GetVerbose() and res != 0): @@ -2068,6 +2069,10 @@ def SdkLocateWindows(version = '7.1'): # Choose the latest version of the Windows 10 SDK. platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", "KitsRoot10") + # Fallback in case we can't read the registry. + if not platsdk or not os.path.isdir(platsdk): + platsdk = "C:\\Program Files (x86)\\Windows Kits\\10\\" + if platsdk and os.path.isdir(platsdk): incdirs = glob.glob(os.path.join(platsdk, 'Include', version + '.*.*')) max_version = () @@ -2100,6 +2105,10 @@ def SdkLocateWindows(version = '7.1'): # We chose a specific version of the Windows 10 SDK. Verify it exists. platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", "KitsRoot10") + # Fallback in case we can't read the registry. + if not platsdk or not os.path.isdir(platsdk): + platsdk = "C:\\Program Files (x86)\\Windows Kits\\10\\" + if version.count('.') == 2: version += '.0' @@ -2109,6 +2118,10 @@ def SdkLocateWindows(version = '7.1'): elif version == '8.1': platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", "KitsRoot81") + # Fallback in case we can't read the registry. + if not platsdk or not os.path.isdir(platsdk): + platsdk = "C:\\Program Files (x86)\\Windows Kits\\8.1\\" + elif version == '8.0': platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", "KitsRoot") @@ -2414,9 +2427,19 @@ def SetupVisualStudioEnviron(): # with Visual Studio 2015 requires use of the Universal CRT. if winsdk_ver == '7.1' and SDK["VISUALSTUDIO_VERSION"] == '14.0': win_kit = GetRegistryKey("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", "KitsRoot10") + + # Fallback in case we can't read the registry. + if not win_kit or not os.path.isdir(win_kit): + win_kit = "C:\\Program Files (x86)\\Windows Kits\\10\\" + elif not win_kit.endswith('\\'): + win_kit += '\\' + AddToPathEnv("LIB", win_kit + "Lib\\10.0.10150.0\\ucrt\\" + arch) AddToPathEnv("INCLUDE", win_kit + "Include\\10.0.10150.0\\ucrt") + # Copy the DLLs to the bin directory. + CopyAllFiles(GetOutputDir() + "/bin/", win_kit + "Redist\\ucrt\\DLLs\\" + arch + "\\") + ######################################################################## # # Include and Lib directories. From 5ad900a413b27548640fdece2f56f33f3b9539bc Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 29 Nov 2016 22:43:28 +0100 Subject: [PATCH 106/112] Bullet fixes: copying compound shapes, compile warnings, motion state alignment --- panda/src/bullet/bulletBodyNode.cxx | 11 ++++++++++- panda/src/bullet/bulletGhostNode.cxx | 2 +- panda/src/bullet/bulletRigidBodyNode.I | 1 - panda/src/bullet/bulletRigidBodyNode.cxx | 20 ++++++++------------ panda/src/bullet/bulletRigidBodyNode.h | 2 +- 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/panda/src/bullet/bulletBodyNode.cxx b/panda/src/bullet/bulletBodyNode.cxx index 6580c79722..cb4d39c444 100644 --- a/panda/src/bullet/bulletBodyNode.cxx +++ b/panda/src/bullet/bulletBodyNode.cxx @@ -45,7 +45,16 @@ BulletBodyNode(const BulletBodyNode ©) : _shapes(copy._shapes) { if (copy._shape && copy._shape->getShapeType() == COMPOUND_SHAPE_PROXYTYPE) { - _shape = new btCompoundShape(copy._shape); + // btCompoundShape does not define a copy constructor. Manually copy. + btCompoundShape *shape = new btCompoundShape; + _shape = shape; + + btCompoundShape *copy_shape = (btCompoundShape *)copy._shape; + int num_children = copy_shape->getNumChildShapes(); + for (int i = 0; i < num_children; ++i) { + shape->addChildShape(copy_shape->getChildTransform(i), + copy_shape->getChildShape(i)); + } } else if (copy._shape && copy._shape->getShapeType() == EMPTY_SHAPE_PROXYTYPE) { _shape = new btEmptyShape(); diff --git a/panda/src/bullet/bulletGhostNode.cxx b/panda/src/bullet/bulletGhostNode.cxx index 8f8c783943..ddead41067 100644 --- a/panda/src/bullet/bulletGhostNode.cxx +++ b/panda/src/bullet/bulletGhostNode.cxx @@ -55,7 +55,7 @@ void BulletGhostNode:: parents_changed() { Parents parents = get_parents(); - for (int i=0; i < parents.get_num_parents(); ++i) { + for (size_t i = 0; i < parents.get_num_parents(); ++i) { PandaNode *parent = parents.get_parent(i); TypeHandle type = parent->get_type(); diff --git a/panda/src/bullet/bulletRigidBodyNode.I b/panda/src/bullet/bulletRigidBodyNode.I index 6be1af948f..de1d5eea05 100644 --- a/panda/src/bullet/bulletRigidBodyNode.I +++ b/panda/src/bullet/bulletRigidBodyNode.I @@ -18,7 +18,6 @@ INLINE BulletRigidBodyNode:: ~BulletRigidBodyNode() { delete _rigid; - delete _motion; } /** diff --git a/panda/src/bullet/bulletRigidBodyNode.cxx b/panda/src/bullet/bulletRigidBodyNode.cxx index 23c6d17afd..5c5e722785 100644 --- a/panda/src/bullet/bulletRigidBodyNode.cxx +++ b/panda/src/bullet/bulletRigidBodyNode.cxx @@ -21,16 +21,12 @@ TypeHandle BulletRigidBodyNode::_type_handle; */ BulletRigidBodyNode:: BulletRigidBodyNode(const char *name) : BulletBodyNode(name) { - - // Motion state - _motion = new MotionState(); - // Mass properties btScalar mass(0.0); btVector3 inertia(0, 0, 0); // construction info - btRigidBody::btRigidBodyConstructionInfo ci(mass, _motion, _shape, inertia); + btRigidBody::btRigidBodyConstructionInfo ci(mass, &_motion, _shape, inertia); // Additional damping if (bullet_additional_damping) { @@ -52,13 +48,13 @@ BulletRigidBodyNode(const char *name) : BulletBodyNode(name) { */ BulletRigidBodyNode:: BulletRigidBodyNode(const BulletRigidBodyNode ©) : - BulletBodyNode(copy) + BulletBodyNode(copy), + _motion(copy._motion) { - _motion = new MotionState(*copy._motion); _rigid = new btRigidBody(*copy._rigid); _rigid->setUserPointer(this); _rigid->setCollisionShape(_shape); - _rigid->setMotionState(_motion); + _rigid->setMotionState(&_motion); } /** @@ -280,7 +276,7 @@ apply_central_impulse(const LVector3 &impulse) { void BulletRigidBodyNode:: transform_changed() { - if (_motion->sync_disabled()) return; + if (_motion.sync_disabled()) return; NodePath np = NodePath::any_path((PandaNode *)this); CPT(TransformState) ts = np.get_net_transform(); @@ -290,7 +286,7 @@ transform_changed() { // transform within the motion state. For dynamic bodies we need to store // the net scale within the motion state, since Bullet might update the // transform via MotionState::setWorldTransform. - _motion->set_net_transform(ts); + _motion.set_net_transform(ts); // For dynamic or static bodies we directly apply the new transform. if (!is_kinematic()) { @@ -334,7 +330,7 @@ sync_p2b() { void BulletRigidBodyNode:: sync_b2p() { - _motion->sync_b2p((PandaNode *)this); + _motion.sync_b2p((PandaNode *)this); } /** @@ -589,7 +585,7 @@ pick_dirty_flag() { bool BulletRigidBodyNode:: pick_dirty_flag() { - return _motion->pick_dirty_flag(); + return _motion.pick_dirty_flag(); } /** diff --git a/panda/src/bullet/bulletRigidBodyNode.h b/panda/src/bullet/bulletRigidBodyNode.h index 42b2495aff..ea59c9202c 100644 --- a/panda/src/bullet/bulletRigidBodyNode.h +++ b/panda/src/bullet/bulletRigidBodyNode.h @@ -124,7 +124,7 @@ private: bool _was_dirty; }; - MotionState *_motion; + MotionState _motion; btRigidBody *_rigid; public: From 80af51477a8c03df06f1f16a848866613045f7e3 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 29 Nov 2016 22:59:51 +0100 Subject: [PATCH 107/112] Backport ability to create a pdb zipfile to 1.9 --- makepanda/makepanda.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 17778946f2..4adcb96d5e 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -6459,6 +6459,26 @@ def MakeInstallerNSIS(file, title, installdir): oscmd(cmd) os.rename("nsis-output.exe", file) +def MakeDebugSymbolArchive(zipname, dirname): + import zipfile + zip = zipfile.ZipFile(zipname, 'w', zipfile.ZIP_DEFLATED) + + for fn in glob.glob(os.path.join(GetOutputDir(), 'bin', '*.pdb')): + zip.write(fn, dirname + '/bin/' + os.path.basename(fn)) + + for fn in glob.glob(os.path.join(GetOutputDir(), 'panda3d', '*.pdb')): + zip.write(fn, dirname + '/panda3d/' + os.path.basename(fn)) + + for fn in glob.glob(os.path.join(GetOutputDir(), 'plugins', '*.pdb')): + zip.write(fn, dirname + '/plugins/' + os.path.basename(fn)) + + for fn in glob.glob(os.path.join(GetOutputDir(), 'python', '*.pdb')): + zip.write(fn, dirname + '/python/' + os.path.basename(fn)) + + for fn in glob.glob(os.path.join(GetOutputDir(), 'python', 'DLLs', '*.pdb')): + zip.write(fn, dirname + '/python/DLLs/' + os.path.basename(fn)) + + zip.close() INSTALLER_DEB_FILE=""" Package: panda3dMAJOR @@ -7012,11 +7032,13 @@ try: MakeInstallerNSIS("Panda3D-Runtime-"+VERSION+dbg+"-x64.exe", "Panda3D "+VERSION, "C:\\Panda3D-"+VERSION+"-x64") else: MakeInstallerNSIS("Panda3D-"+VERSION+dbg+"-x64.exe", "Panda3D SDK "+VERSION, "C:\\Panda3D-"+VERSION+"-x64") + MakeDebugSymbolArchive("Panda3D-"+VERSION+dbg+"-x64-pdb.zip", "Panda3D-"+VERSION+"-x64") else: if (RUNTIME): MakeInstallerNSIS("Panda3D-Runtime-"+VERSION+dbg+".exe", "Panda3D "+VERSION, "C:\\Panda3D-"+VERSION) else: MakeInstallerNSIS("Panda3D-"+VERSION+dbg+".exe", "Panda3D SDK "+VERSION, "C:\\Panda3D-"+VERSION) + MakeDebugSymbolArchive("Panda3D-"+VERSION+dbg+"-pdb.zip", "Panda3D-"+VERSION) elif (target == 'linux'): MakeInstallerLinux() elif (target == 'darwin'): From 441b791e574a432ae912fdd959ee17cdb041f22b Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 29 Nov 2016 23:05:01 +0100 Subject: [PATCH 108/112] Fix extract_texture_data for buffer textures --- .../glstuff/glGraphicsStateGuardian_src.cxx | 57 +++++++++++++------ .../src/glstuff/glGraphicsStateGuardian_src.h | 1 + panda/src/gobj/texture.cxx | 3 + 3 files changed, 44 insertions(+), 17 deletions(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 296b38df76..dc2c0c45e6 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -1356,6 +1356,8 @@ reset() { get_extension_func("glMapBuffer"); _glUnmapBuffer = (PFNGLUNMAPBUFFERPROC) get_extension_func("glUnmapBuffer"); + _glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC) + get_extension_func("glGetBufferSubData"); #endif } #ifndef OPENGLES_1 @@ -1376,6 +1378,8 @@ reset() { get_extension_func("glMapBufferARB"); _glUnmapBuffer = (PFNGLUNMAPBUFFERPROC) get_extension_func("glUnmapBufferARB"); + _glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC) + get_extension_func("glGetBufferSubDataARB"); } #endif // OPENGLES_1 @@ -12644,20 +12648,26 @@ do_extract_texture_data(CLP(TextureContext) *gtc) { GLint minfilter, magfilter; GLfloat border_color[4]; - glGetTexParameteriv(target, GL_TEXTURE_WRAP_S, &wrap_u); - glGetTexParameteriv(target, GL_TEXTURE_WRAP_T, &wrap_v); - wrap_w = GL_REPEAT; -#ifndef OPENGLES_1 - if (_supports_3d_texture) { - glGetTexParameteriv(target, GL_TEXTURE_WRAP_R, &wrap_w); - } +#ifdef OPENGLES + if (true) { +#else + if (target != GL_TEXTURE_BUFFER) { #endif - glGetTexParameteriv(target, GL_TEXTURE_MIN_FILTER, &minfilter); - glGetTexParameteriv(target, GL_TEXTURE_MAG_FILTER, &magfilter); + glGetTexParameteriv(target, GL_TEXTURE_WRAP_S, &wrap_u); + glGetTexParameteriv(target, GL_TEXTURE_WRAP_T, &wrap_v); + wrap_w = GL_REPEAT; +#ifndef OPENGLES_1 + if (_supports_3d_texture) { + glGetTexParameteriv(target, GL_TEXTURE_WRAP_R, &wrap_w); + } +#endif + glGetTexParameteriv(target, GL_TEXTURE_MIN_FILTER, &minfilter); + glGetTexParameteriv(target, GL_TEXTURE_MAG_FILTER, &magfilter); #ifndef OPENGLES - glGetTexParameterfv(target, GL_TEXTURE_BORDER_COLOR, border_color); + glGetTexParameterfv(target, GL_TEXTURE_BORDER_COLOR, border_color); #endif + } GLenum page_target = target; if (target == GL_TEXTURE_CUBE_MAP) { @@ -13122,14 +13132,20 @@ do_extract_texture_data(CLP(TextureContext) *gtc) { tex->set_component_type(type); tex->set_format(format); - tex->set_wrap_u(get_panda_wrap_mode(wrap_u)); - tex->set_wrap_v(get_panda_wrap_mode(wrap_v)); - tex->set_wrap_w(get_panda_wrap_mode(wrap_w)); - tex->set_border_color(LColor(border_color[0], border_color[1], - border_color[2], border_color[3])); +#ifdef OPENGLES + if (true) { +#else + if (target != GL_TEXTURE_BUFFER) { +#endif + tex->set_wrap_u(get_panda_wrap_mode(wrap_u)); + tex->set_wrap_v(get_panda_wrap_mode(wrap_v)); + tex->set_wrap_w(get_panda_wrap_mode(wrap_w)); + tex->set_border_color(LColor(border_color[0], border_color[1], + border_color[2], border_color[3])); - tex->set_minfilter(get_panda_filter_type(minfilter)); - // tex->set_magfilter(get_panda_filter_type(magfilter)); + tex->set_minfilter(get_panda_filter_type(minfilter)); + //tex->set_magfilter(get_panda_filter_type(magfilter)); + } PTA_uchar image; size_t page_size = 0; @@ -13216,6 +13232,13 @@ extract_texture_image(PTA_uchar &image, size_t &page_size, } } +#ifndef OPENGLES + } else if (target == GL_TEXTURE_BUFFER) { + // In the case of a buffer texture, we need to get it from the buffer. + image = PTA_uchar::empty_array(tex->get_expected_ram_mipmap_image_size(n)); + _glGetBufferSubData(target, 0, image.size(), image.p()); +#endif + } else if (compression == Texture::CM_off) { // An uncompressed 1-d, 2-d, or 3-d texture. image = PTA_uchar::empty_array(tex->get_expected_ram_mipmap_image_size(n)); diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.h b/panda/src/glstuff/glGraphicsStateGuardian_src.h index 3c93fcd174..8080670fc5 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.h +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.h @@ -801,6 +801,7 @@ public: #ifndef OPENGLES PFNGLMAPBUFFERPROC _glMapBuffer; PFNGLUNMAPBUFFERPROC _glUnmapBuffer; + PFNGLGETBUFFERSUBDATAPROC _glGetBufferSubData; #endif #ifdef OPENGLES diff --git a/panda/src/gobj/texture.cxx b/panda/src/gobj/texture.cxx index a3ce86c7dd..b5d7fc3ac5 100644 --- a/panda/src/gobj/texture.cxx +++ b/panda/src/gobj/texture.cxx @@ -7411,6 +7411,9 @@ do_set_simple_ram_image(CData *cdata, CPTA_uchar image, int x_size, int y_size) */ int Texture:: do_get_expected_num_mipmap_levels(const CData *cdata) const { + if (cdata->_texture_type == Texture::TT_buffer_texture) { + return 1; + } int size = max(cdata->_x_size, cdata->_y_size); if (cdata->_texture_type == Texture::TT_3d_texture) { size = max(size, cdata->_z_size); From 1c957b26b48cb36cb4244902fd866f244f3119ba Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 29 Nov 2016 23:07:09 +0100 Subject: [PATCH 109/112] Fix for getting R8 and R8G8 formats via FrameBufferProperties --- panda/src/display/frameBufferProperties.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/panda/src/display/frameBufferProperties.cxx b/panda/src/display/frameBufferProperties.cxx index 51120fbec1..98b8341322 100644 --- a/panda/src/display/frameBufferProperties.cxx +++ b/panda/src/display/frameBufferProperties.cxx @@ -659,7 +659,7 @@ setup_color_texture(Texture *tex) const { // as the below one would be generated dynamically by the GSG to reflect the // formats that are supported for render-to-texture. - static const int num_formats = 15; + static const int num_formats = 17; static const struct { unsigned char color_bits, red_bits, green_bits, blue_bits, alpha_bits; bool has_float; @@ -669,6 +669,8 @@ setup_color_texture(Texture *tex) const { { 1, 1, 1, 0, 0, false, Texture::F_rg }, { 1, 1, 1, 1, 0, false, Texture::F_rgb }, { 1, 1, 1, 1, 1, false, Texture::F_rgba }, + { 8, 8, 0, 0, 0, false, Texture::F_red }, + { 16, 8, 8, 0, 0, false, Texture::F_rg }, { 24, 8, 8, 8, 0, false, Texture::F_rgb8 }, { 32, 8, 8, 8, 8, false, Texture::F_rgba8 }, { 16, 16, 0, 0, 0, true, Texture::F_r16 }, From 335debee54c1f02bea505bd199e95497099c999c Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 29 Nov 2016 23:53:57 +0100 Subject: [PATCH 110/112] Fix error building debian package --- makepanda/makepanda.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index af852dc161..b6d2cc1b8b 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -6844,9 +6844,9 @@ def MakeInstallerLinux(): txt = txt.replace("VERSION", DEBVERSION).replace("ARCH", pkg_arch).replace("PV", PV).replace("MAJOR", MAJOR_VERSION) txt = txt.replace("INSTSIZE", str(GetDirectorySize("targetroot") / 1024)) oscmd("mkdir --mode=0755 -p targetroot/DEBIAN") - oscmd("cd targetroot ; (find usr -type f -exec md5sum {} \;) > DEBIAN/md5sums") + oscmd("cd targetroot && (find usr -type f -exec md5sum {} ;) > DEBIAN/md5sums") if (not RUNTIME): - oscmd("cd targetroot ; (find etc -type f -exec md5sum {} \;) >> DEBIAN/md5sums") + oscmd("cd targetroot && (find etc -type f -exec md5sum {} ;) >> DEBIAN/md5sums") WriteFile("targetroot/DEBIAN/conffiles","/etc/Config.prc\n") WriteFile("targetroot/DEBIAN/postinst","#!/bin/sh\necho running ldconfig\nldconfig\n") oscmd("cp targetroot/DEBIAN/postinst targetroot/DEBIAN/postrm") @@ -6874,7 +6874,7 @@ def MakeInstallerLinux(): if RUNTIME: # The runtime doesn't export any useful symbols, so just query the dependencies. - oscmd("cd targetroot; %(dpkg_shlibdeps)s -x%(pkg_name)s %(lib_pattern)s %(bin_pattern)s*" % locals()) + oscmd("cd targetroot && %(dpkg_shlibdeps)s -x%(pkg_name)s %(lib_pattern)s %(bin_pattern)s*" % locals()) depends = ReadFile("targetroot/debian/substvars").replace("shlibs:Depends=", "").strip() recommends = "" else: @@ -6882,12 +6882,12 @@ def MakeInstallerLinux(): pkg_dir = "debian/panda3d" + MAJOR_VERSION # Generate a symbols file so that other packages can know which symbols we export. - oscmd("cd targetroot; dpkg-gensymbols -q -ODEBIAN/symbols -v%(pkg_version)s -p%(pkg_name)s -e%(lib_pattern)s" % locals()) + oscmd("cd targetroot && dpkg-gensymbols -q -ODEBIAN/symbols -v%(pkg_version)s -p%(pkg_name)s -e%(lib_pattern)s" % locals()) # Library dependencies are required, binary dependencies are recommended. # We explicitly exclude libphysx-extras since we don't want to depend on PhysX. - oscmd("cd targetroot; LD_LIBRARY_PATH=usr/%(lib_dir)s/panda3d %(dpkg_shlibdeps)s -Tdebian/substvars_dep --ignore-missing-info -x%(pkg_name)s -xlibphysx-extras %(lib_pattern)s" % locals()) - oscmd("cd targetroot; LD_LIBRARY_PATH=usr/%(lib_dir)s/panda3d %(dpkg_shlibdeps)s -Tdebian/substvars_rec --ignore-missing-info -x%(pkg_name)s %(bin_pattern)s" % locals()) + oscmd("cd targetroot && LD_LIBRARY_PATH=usr/%(lib_dir)s/panda3d %(dpkg_shlibdeps)s -Tdebian/substvars_dep --ignore-missing-info -x%(pkg_name)s -xlibphysx-extras %(lib_pattern)s" % locals()) + oscmd("cd targetroot && LD_LIBRARY_PATH=usr/%(lib_dir)s/panda3d %(dpkg_shlibdeps)s -Tdebian/substvars_rec --ignore-missing-info -x%(pkg_name)s %(bin_pattern)s" % locals()) # Parse the substvars files generated by dpkg-shlibdeps. depends = ReadFile("targetroot/debian/substvars_dep").replace("shlibs:Depends=", "").strip() From 6259feb9344689686b036c989adaad31777bd6d2 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 30 Nov 2016 00:05:36 +0100 Subject: [PATCH 111/112] Fix issue building against copy of Python that was compiled with MSVC 2010 --- makepanda/makepanda.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index b6d2cc1b8b..bade6c8288 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -2951,9 +2951,12 @@ if GetTarget() == 'windows' and "VISUALSTUDIO" in SDK: crtname = "Microsoft.VC%s.CRT" % (vcver) dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "redist", GetTargetArch(), crtname) - if os.path.isdir(dir): - CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "vcruntime" + vcver + ".dll")) + if os.path.isfile(os.path.join(dir, "msvcr" + vcver + ".dll")): + CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcr" + vcver + ".dll")) + if os.path.isfile(os.path.join(dir, "msvcp" + vcver + ".dll")): CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcp" + vcver + ".dll")) + if os.path.isfile(os.path.join(dir, "vcruntime" + vcver + ".dll")): + CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "vcruntime" + vcver + ".dll")) ######################################################################## ## From 573dad8dde37f9f37d008c720a35784a4f2a1e58 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 30 Nov 2016 19:07:47 -0800 Subject: [PATCH 112/112] general: Fix missing includes. --- dtool/src/cppparser/cppScope.cxx | 1 + dtool/src/cppparser/cppStructType.cxx | 1 + dtool/src/cppparser/cppType.cxx | 1 + panda/src/egg2pg/save_egg_file.cxx | 1 + 4 files changed, 4 insertions(+) diff --git a/dtool/src/cppparser/cppScope.cxx b/dtool/src/cppparser/cppScope.cxx index a340a5a709..a873cfa3cf 100644 --- a/dtool/src/cppparser/cppScope.cxx +++ b/dtool/src/cppparser/cppScope.cxx @@ -28,6 +28,7 @@ #include "cppTemplateScope.h" #include "cppClassTemplateParameter.h" #include "cppFunctionType.h" +#include "cppConstType.h" #include "cppUsing.h" #include "cppBisonDefs.h" #include "indent.h" diff --git a/dtool/src/cppparser/cppStructType.cxx b/dtool/src/cppparser/cppStructType.cxx index f33112d686..73712c66ad 100644 --- a/dtool/src/cppparser/cppStructType.cxx +++ b/dtool/src/cppparser/cppStructType.cxx @@ -13,6 +13,7 @@ #include "cppStructType.h" #include "cppTypedefType.h" +#include "cppReferenceType.h" #include "cppScope.h" #include "cppTypeProxy.h" #include "cppTemplateScope.h" diff --git a/dtool/src/cppparser/cppType.cxx b/dtool/src/cppparser/cppType.cxx index 780ebfc0ef..801c571add 100644 --- a/dtool/src/cppparser/cppType.cxx +++ b/dtool/src/cppparser/cppType.cxx @@ -16,6 +16,7 @@ #include "cppPointerType.h" #include "cppReferenceType.h" #include "cppStructType.h" +#include "cppTypedefType.h" #include "cppExtensionType.h" #include diff --git a/panda/src/egg2pg/save_egg_file.cxx b/panda/src/egg2pg/save_egg_file.cxx index 95afdf5be2..520987da68 100644 --- a/panda/src/egg2pg/save_egg_file.cxx +++ b/panda/src/egg2pg/save_egg_file.cxx @@ -14,6 +14,7 @@ #include "save_egg_file.h" #include "eggSaver.h" #include "config_egg2pg.h" +#include "modelRoot.h" #include "sceneGraphReducer.h" #include "virtualFileSystem.h" #include "config_util.h"