From 1974b3e692a1d817d837bd34a02d6e2971ada5a1 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 12 Jun 2016 12:04:03 +0200 Subject: [PATCH 01/53] Fix deadlock waiting for Python task to end at end of program --- panda/src/display/graphicsEngine.cxx | 3 +++ panda/src/display/graphicsEngine.h | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/panda/src/display/graphicsEngine.cxx b/panda/src/display/graphicsEngine.cxx index 9bd325fc95..da90172088 100644 --- a/panda/src/display/graphicsEngine.cxx +++ b/panda/src/display/graphicsEngine.cxx @@ -638,6 +638,9 @@ remove_all_windows() { // And, hey, let's stop the vertex paging threads, if any. VertexDataPage::stop_threads(); + // Stopping the tasks means we have to release the Python GIL while + // this method runs (hence it is marked BLOCKING), so that any + // Python tasks on other threads won't deadlock grabbing the GIL. AsyncTaskManager::get_global_ptr()->stop_threads(); #ifdef DO_PSTATS diff --git a/panda/src/display/graphicsEngine.h b/panda/src/display/graphicsEngine.h index cb371076ee..122d8be359 100644 --- a/panda/src/display/graphicsEngine.h +++ b/panda/src/display/graphicsEngine.h @@ -58,7 +58,7 @@ class Texture; class EXPCL_PANDA_DISPLAY GraphicsEngine : public ReferenceCount { PUBLISHED: GraphicsEngine(Pipeline *pipeline = NULL); - ~GraphicsEngine(); + BLOCKING ~GraphicsEngine(); void set_threading_model(const GraphicsThreadingModel &threading_model); GraphicsThreadingModel get_threading_model() const; @@ -94,7 +94,7 @@ PUBLISHED: bool add_window(GraphicsOutput *window, int sort); bool remove_window(GraphicsOutput *window); - void remove_all_windows(); + BLOCKING void remove_all_windows(); void reset_all_windows(bool swapchain); bool is_empty() const; From bf26cecb32d277b63d3bcd867a1147ec8e941176 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 22 Jun 2016 13:44:16 +0200 Subject: [PATCH 02/53] Fix some compile warnings --- panda/src/gobj/shader.cxx | 12 ++++++++---- panda/src/linmath/lvecBase2_src.I | 5 ++--- panda/src/linmath/lvecBase3_src.I | 7 +++---- panda/src/linmath/lvecBase4_src.I | 9 ++++----- panda/src/pnmimagetypes/pnmFileTypeBMPReader.cxx | 2 +- panda/src/pnmimagetypes/pnmFileTypePNM.cxx | 4 ++-- panda/src/rocket/rocketRegion_ext.cxx | 3 ++- 7 files changed, 22 insertions(+), 20 deletions(-) diff --git a/panda/src/gobj/shader.cxx b/panda/src/gobj/shader.cxx index bac1aa61b2..b4b628744a 100644 --- a/panda/src/gobj/shader.cxx +++ b/panda/src/gobj/shader.cxx @@ -1492,11 +1492,15 @@ cg_compile_entry_point(const char *entry, const ShaderCaps &caps, compiler_args[nargs++] = "ATI_draw_buffers"; } - char version_arg[16]; - if (!cg_glsl_version.empty() && cgGetProfileProperty((CGprofile) active, CG_IS_GLSL_PROFILE)) { - snprintf(version_arg, 16, "version=%s", cg_glsl_version.c_str()); + string version_arg; + if (!cg_glsl_version.empty() && active != CG_PROFILE_UNKNOWN && + cgGetProfileProperty((CGprofile) active, CG_IS_GLSL_PROFILE)) { + + version_arg = "version="; + version_arg += cg_glsl_version; + compiler_args[nargs++] = "-po"; - compiler_args[nargs++] = version_arg; + compiler_args[nargs++] = version_arg.c_str(); } compiler_args[nargs] = 0; diff --git a/panda/src/linmath/lvecBase2_src.I b/panda/src/linmath/lvecBase2_src.I index 14057fbd50..b561cb0b7a 100644 --- a/panda/src/linmath/lvecBase2_src.I +++ b/panda/src/linmath/lvecBase2_src.I @@ -514,9 +514,8 @@ INLINE_LINMATH size_t FLOATNAME(LVecBase2):: add_hash(size_t hash) const { TAU_PROFILE("size_t LVecBase2::add_hash(size_t)", " ", TAU_USER); #ifdef FLOATTYPE_IS_INT - int_hash ihasher; - hash = ihasher.add_hash(hash, _v(0)); - hash = ihasher.add_hash(hash, _v(1)); + hash = int_hash::add_hash(hash, _v(0)); + hash = int_hash::add_hash(hash, _v(1)); return hash; #else return add_hash(hash, NEARLY_ZERO(FLOATTYPE)); diff --git a/panda/src/linmath/lvecBase3_src.I b/panda/src/linmath/lvecBase3_src.I index 41a0d9ccce..13310a8af1 100644 --- a/panda/src/linmath/lvecBase3_src.I +++ b/panda/src/linmath/lvecBase3_src.I @@ -674,10 +674,9 @@ INLINE_LINMATH size_t FLOATNAME(LVecBase3):: add_hash(size_t hash) const { TAU_PROFILE("size_t LVecBase3::add_hash(size_t)", " ", TAU_USER); #ifdef FLOATTYPE_IS_INT - int_hash ihasher; - hash = ihasher.add_hash(hash, _v(0)); - hash = ihasher.add_hash(hash, _v(1)); - hash = ihasher.add_hash(hash, _v(2)); + hash = int_hash::add_hash(hash, _v(0)); + hash = int_hash::add_hash(hash, _v(1)); + hash = int_hash::add_hash(hash, _v(2)); return hash; #else return add_hash(hash, NEARLY_ZERO(FLOATTYPE)); diff --git a/panda/src/linmath/lvecBase4_src.I b/panda/src/linmath/lvecBase4_src.I index f8c8422c58..5b42095e93 100644 --- a/panda/src/linmath/lvecBase4_src.I +++ b/panda/src/linmath/lvecBase4_src.I @@ -663,11 +663,10 @@ INLINE_LINMATH size_t FLOATNAME(LVecBase4):: add_hash(size_t hash) const { TAU_PROFILE("size_t LVecBase4::add_hash(size_t)", " ", TAU_USER); #ifdef FLOATTYPE_IS_INT - int_hash ihasher; - hash = ihasher.add_hash(hash, _v(0)); - hash = ihasher.add_hash(hash, _v(1)); - hash = ihasher.add_hash(hash, _v(2)); - hash = ihasher.add_hash(hash, _v(3)); + hash = int_hash::add_hash(hash, _v(0)); + hash = int_hash::add_hash(hash, _v(1)); + hash = int_hash::add_hash(hash, _v(2)); + hash = int_hash::add_hash(hash, _v(3)); return hash; #else return add_hash(hash, NEARLY_ZERO(FLOATTYPE)); diff --git a/panda/src/pnmimagetypes/pnmFileTypeBMPReader.cxx b/panda/src/pnmimagetypes/pnmFileTypeBMPReader.cxx index e0ec77441d..917c009647 100644 --- a/panda/src/pnmimagetypes/pnmFileTypeBMPReader.cxx +++ b/panda/src/pnmimagetypes/pnmFileTypeBMPReader.cxx @@ -227,7 +227,7 @@ BMPreadinfoheader( * for the required total. */ if (classv != C_OS2) { - for (int i = 0; i < cbFix - 16; i += 4) { + for (int i = 0; i < (int)cbFix - 16; i += 4) { GetLong(fp); } } diff --git a/panda/src/pnmimagetypes/pnmFileTypePNM.cxx b/panda/src/pnmimagetypes/pnmFileTypePNM.cxx index 6e800c3372..ff22462d11 100644 --- a/panda/src/pnmimagetypes/pnmFileTypePNM.cxx +++ b/panda/src/pnmimagetypes/pnmFileTypePNM.cxx @@ -650,10 +650,10 @@ writePackedRawRow(ostream * const fileP, const unsigned char * const packed_bits, int const cols) { - int bytesWritten; fileP->write((const char *)packed_bits, pbm_packed_bytes(cols)); - if (fileP->fail()) + if (fileP->fail()) { pm_error("I/O error writing packed row to raw PBM file."); + } } static void diff --git a/panda/src/rocket/rocketRegion_ext.cxx b/panda/src/rocket/rocketRegion_ext.cxx index 06791ded82..a6c0e33a63 100644 --- a/panda/src/rocket/rocketRegion_ext.cxx +++ b/panda/src/rocket/rocketRegion_ext.cxx @@ -45,7 +45,8 @@ get_context() const { context->AddReference(); return py_context.ptr(); - } catch (const python::error_already_set& e) { + } catch (const python::error_already_set &e) { + (void)e; // Return NULL, which will trigger the exception in Python } return NULL; From 0821bec2d0f9664b9a84f9789f37ad918e648e26 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 22 Jun 2016 15:04:00 +0200 Subject: [PATCH 03/53] Backport 2f0bc01 to 1.9: Fix bug causing random crash during module initialization --- .../src/interrogate/interfaceMakerPythonNative.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index 1091132312..db1825c079 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -1198,6 +1198,10 @@ write_sub_module(ostream &out, Object *obj) { if (!isExportThisRun(wrapped_itype._cpptype)) { _external_imports.insert(wrapped_itype._cpptype); + } else { + // If this is a typedef to a class defined in the same module, make sure + // that the class is initialized before we try to define the typedef. + out << " Dtool_PyModuleClassInit_" << class_name << "(module);\n"; } } @@ -2595,6 +2599,12 @@ write_module_class(ostream &out, Object *obj) { out << "#if PY_VERSION_HEX >= 0x02050000\n"; write_function_slot(out, 2, slots, "nb_index"); out << "#endif\n"; + + out << "#if PY_VERSION_HEX >= 0x03050000\n"; + write_function_slot(out, 2, slots, "nb_matrix_multiply"); + write_function_slot(out, 2, slots, "nb_inplace_matrix_multiply"); + out << "#endif\n"; + out << "};\n\n"; // NB: it's tempting not to write this table when a class doesn't have them. @@ -2843,6 +2853,10 @@ write_module_class(ostream &out, Object *obj) { out << "#if PY_VERSION_HEX >= 0x02060000\n"; out << " 0, // tp_version_tag\n"; out << "#endif\n"; + // destructor tp_finalize + out << "#if PY_VERSION_HEX >= 0x03040000\n"; + out << " 0, // tp_finalize\n"; + out << "#endif\n"; out << " },\n"; out << " Dtool_UpcastInterface_" << ClassName << ",\n"; out << " Dtool_DowncastInterface_" << ClassName << ",\n"; From 4724a7ddbc6c43d8eabb42bfcadad0309421f194 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 22 Jun 2016 17:22:06 +0200 Subject: [PATCH 04/53] Add 1.9.3 release notes, bump version number --- doc/ReleaseNotes | 18 ++++++++++++++++++ dtool/PandaVersion.pp | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index 90c661c63a..a4a0b49a02 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -1,3 +1,21 @@ +------------------------ RELEASE 1.9.3 ------------------------ + +This issue fixes several bugs that were still found in 1.9.2. + +* Fix crash when running in Steam on Linux when using OpenAL +* Fix crash using wx/tkinter on Mac as long as want-wx/tk is set +* Fix loading models from 'models' package with models/ prefix +* Fix random crashes in task system +* Fix memory leaks in BulletTriangleMesh +* Fix loading old models with MovingPart +* Improve performance of CPU vertex animation somewhat +* Show framebuffer properties when fbprop request fails +* Fix hang on exit when using Python task on threaded task chain +* Fix inability to get RGBA renderbuffer in certain cases +* Work around GLSL issue with #pragma and certain Intel drivers +* Improve performance of texture load and store operations +* Fix crashes with pbuffers on Intel cards on Windows + ------------------------ RELEASE 1.9.2 ------------------------ This is a minor bugfix release, fixing a few minor issues that diff --git a/dtool/PandaVersion.pp b/dtool/PandaVersion.pp index d6461256ad..0e01d82c67 100644 --- a/dtool/PandaVersion.pp +++ b/dtool/PandaVersion.pp @@ -3,7 +3,7 @@ // ppremake scripts for Panda. // Use spaces to separate the major, minor, and sequence numbers here. -#define PANDA_VERSION 1 9 2 +#define PANDA_VERSION 1 9 3 // This variable will be defined to false in the CVS repository, but // scripts that generate source tarballs and/or binary releases for From 9b5ff080113bf0d2f987fe6fa9b785084d475160 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 23 Jun 2016 22:27:34 +0200 Subject: [PATCH 05/53] Fix crash loading null audio manager --- panda/src/audio/audioManager.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/audio/audioManager.cxx b/panda/src/audio/audioManager.cxx index bde70f8dba..d7eb0846fe 100644 --- a/panda/src/audio/audioManager.cxx +++ b/panda/src/audio/audioManager.cxx @@ -71,7 +71,7 @@ PT(AudioManager) AudioManager::create_AudioManager() { if (handle == (void *)NULL) { audio_error(" load_dso(" << dl_name << ") failed, will use NullAudioManager"); audio_error(" "< Date: Thu, 23 Jun 2016 22:56:18 +0200 Subject: [PATCH 06/53] Fix race condition when multiple threads write to MultiplexStream simultaneously --- panda/src/downloader/multiplexStreamBuf.cxx | 18 +++++------------- panda/src/downloader/multiplexStreamBuf.h | 2 ++ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/panda/src/downloader/multiplexStreamBuf.cxx b/panda/src/downloader/multiplexStreamBuf.cxx index e78eb1d838..daa2d78ed9 100644 --- a/panda/src/downloader/multiplexStreamBuf.cxx +++ b/panda/src/downloader/multiplexStreamBuf.cxx @@ -12,6 +12,7 @@ */ #include "multiplexStreamBuf.h" +#include "lightMutexHolder.h" #if defined(WIN32_VC) || defined(WIN64_VC) #define WINDOWS_LEAN_AND_MEAN @@ -113,10 +114,8 @@ void MultiplexStreamBuf:: add_output(MultiplexStreamBuf::BufferType buffer_type, MultiplexStreamBuf::OutputType output_type, ostream *out, FILE *fout, bool owns_obj) { -#ifdef OLD_HAVE_IPC // Ensure that we have the mutex while we fiddle with the list of outputs. - mutex_lock m(_lock); -#endif + LightMutexHolder holder(_lock); Output o; o._buffer_type = buffer_type; @@ -133,9 +132,7 @@ add_output(MultiplexStreamBuf::BufferType buffer_type, */ void MultiplexStreamBuf:: flush() { -#ifdef OLD_HAVE_IPC - mutex_lock m(_lock); -#endif + LightMutexHolder holder(_lock); write_chars("", 0, true); } @@ -146,9 +143,7 @@ flush() { */ int MultiplexStreamBuf:: overflow(int ch) { -#ifdef OLD_HAVE_IPC - mutex_lock m(_lock); -#endif + LightMutexHolder holder(_lock); streamsize n = pptr() - pbase(); @@ -172,9 +167,7 @@ overflow(int ch) { */ int MultiplexStreamBuf:: sync() { -#ifdef OLD_HAVE_IPC - mutex_lock m(_lock); -#endif + LightMutexHolder holder(_lock); streamsize n = pptr() - pbase(); @@ -242,5 +235,4 @@ write_chars(const char *start, int length, bool flush) { break; } } - } diff --git a/panda/src/downloader/multiplexStreamBuf.h b/panda/src/downloader/multiplexStreamBuf.h index e2d0f589b5..52a75c5ff9 100644 --- a/panda/src/downloader/multiplexStreamBuf.h +++ b/panda/src/downloader/multiplexStreamBuf.h @@ -17,6 +17,7 @@ #include "pandabase.h" #include "pvector.h" +#include "lightMutex.h" #include /** @@ -69,6 +70,7 @@ private: typedef pvector Outputs; Outputs _outputs; + LightMutex _lock; string _line_buffer; }; From 9963fe2c3c9ded6bbd57935ccfc55be419076be4 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 23 Jun 2016 22:59:50 +0200 Subject: [PATCH 07/53] Fix a couple of compile warnings, reduce unnecessary includes --- dtool/src/dtoolutil/filename.cxx | 6 +- .../src/interrogatedb/interrogate_request.cxx | 4 + dtool/src/prc/notifyCategory.cxx | 9 +- makepanda/makepanda.py | 2 +- panda/src/downloader/httpDate.cxx | 5 +- panda/src/dxml/config_dxml.cxx | 8 + panda/src/glstuff/glShaderContext_src.cxx | 1 - panda/src/gobj/shader.I | 22 - panda/src/gobj/shader.cxx | 22 + panda/src/gobj/shader.h | 10 +- panda/src/gobj/texture.h | 1 - panda/src/nativenet/time_clock.h | 581 +++++++++--------- panda/src/nativenet/time_general.h | 144 ++--- panda/src/nativenet/time_span.h | 534 ++++++++-------- panda/src/pstatclient/pStatClient.I | 94 +-- panda/src/pstatclient/pStatClient.cxx | 93 +++ panda/src/pstatclient/pStatClient.h | 23 +- panda/src/pstatclient/pStatThread.I | 26 - panda/src/pstatclient/pStatThread.cxx | 27 + panda/src/pstatclient/pStatThread.h | 4 +- panda/src/putil/bamCacheRecord.cxx | 11 +- pandatool/src/win-stats/winStats.cxx | 20 +- 22 files changed, 836 insertions(+), 811 deletions(-) diff --git a/dtool/src/dtoolutil/filename.cxx b/dtool/src/dtoolutil/filename.cxx index 8d6fa1e415..169f4bee05 100644 --- a/dtool/src/dtoolutil/filename.cxx +++ b/dtool/src/dtoolutil/filename.cxx @@ -443,7 +443,11 @@ temporary(const string &dirname, const string &prefix, const string &suffix, // generate a 6-character hex code. int hash = (clock() * time(NULL)) & 0xffffff; char hex_code[10]; - sprintf(hex_code, "%06x", hash); +#ifdef _WIN32 + sprintf_s(hex_code, 10, "%06x", hash); +#else + snprintf(hex_code, 10, "%06x", hash); +#endif result = Filename(fdirname, Filename(prefix + hex_code + suffix)); result.set_type(type); } while (result.exists()); diff --git a/dtool/src/interrogatedb/interrogate_request.cxx b/dtool/src/interrogatedb/interrogate_request.cxx index 49ccff4333..3e02a9eecb 100644 --- a/dtool/src/interrogatedb/interrogate_request.cxx +++ b/dtool/src/interrogatedb/interrogate_request.cxx @@ -20,7 +20,11 @@ void interrogate_request_database(const char *database_filename) { InterrogateModuleDef *def = new InterrogateModuleDef; memset(def, 0, sizeof(InterrogateModuleDef)); +#ifdef _WIN32 + def->database_filename = _strdup(database_filename); +#else def->database_filename = strdup(database_filename); +#endif // Don't think of this as a leak; think of it as a one-time database // allocation. diff --git a/dtool/src/prc/notifyCategory.cxx b/dtool/src/prc/notifyCategory.cxx index e44b33dffa..a6e0a0181c 100644 --- a/dtool/src/prc/notifyCategory.cxx +++ b/dtool/src/prc/notifyCategory.cxx @@ -74,10 +74,15 @@ out(NotifySeverity severity, bool prefix) const { if (get_notify_timestamp()) { // Format a timestamp to include as a prefix as well. time_t now = time(NULL) + _server_delta; - struct tm *ptm = localtime(&now); + struct tm atm; +#ifdef _WIN32 + localtime_s(&atm, &now); +#else + localtime_r(&now, &atm); +#endif char buffer[128]; - strftime(buffer, 128, ":%m-%d-%Y %H:%M:%S ", ptm); + strftime(buffer, 128, ":%m-%d-%Y %H:%M:%S ", &atm); nout << buffer; } diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 4865b2b65a..6e4c06b7d2 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -1056,7 +1056,7 @@ def CompileCxx(obj,src,opts): cmd = "cl " if GetTargetArch() == 'x64': cmd += "/favor:blend " - cmd += "/wd4996 /wd4275 /wd4267 /wd4101 /wd4273 " + cmd += "/wd4996 /wd4275 /wd4273 " # Enable Windows 7 interfaces if we need Touchinput. if PkgSkip("TOUCHINPUT") == 0: diff --git a/panda/src/downloader/httpDate.cxx b/panda/src/downloader/httpDate.cxx index e2df9d1530..f3d156fc6a 100644 --- a/panda/src/downloader/httpDate.cxx +++ b/panda/src/downloader/httpDate.cxx @@ -223,8 +223,9 @@ HTTPDate(const string &format) { struct tm *tp = localtime(&now); _time -= tp->tm_gmtoff; #elif defined(_WIN32) - extern long int _timezone; - _time -= _timezone; + long int timezone; + _get_timezone(&timezone); + _time -= timezone; #else extern long int timezone; _time -= timezone; diff --git a/panda/src/dxml/config_dxml.cxx b/panda/src/dxml/config_dxml.cxx index 48c9161805..e6691bc676 100644 --- a/panda/src/dxml/config_dxml.cxx +++ b/panda/src/dxml/config_dxml.cxx @@ -94,7 +94,15 @@ BEGIN_PUBLISH void print_xml_to_file(const Filename &filename, TiXmlNode *xnode) { string os_name = filename.to_os_specific(); +#ifdef _WIN32 + FILE *file; + if (fopen_s(&file, os_name.c_str(), "w") != 0) { +#else FILE *file = fopen(os_name.c_str(), "w"); + if (file == NULL) { +#endif + dxml_cat.error() << "Failed to open " << filename << " for writing\n"; + } xnode->Print(file, 0); fclose(file); } diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index b5262ade6a..0324fbb4a1 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -510,7 +510,6 @@ reflect_uniform_block(int i, const char *name, char *name_buffer, GLsizei name_b GLint data_size = 0; GLint param_count = 0; - GLsizei param_size; _glgsg->_glGetActiveUniformBlockiv(_glsl_program, i, GL_UNIFORM_BLOCK_DATA_SIZE, &data_size); _glgsg->_glGetActiveUniformBlockiv(_glsl_program, i, GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS, ¶m_count); diff --git a/panda/src/gobj/shader.I b/panda/src/gobj/shader.I index 166343f10d..fe74b2bda6 100644 --- a/panda/src/gobj/shader.I +++ b/panda/src/gobj/shader.I @@ -792,25 +792,3 @@ operator < (const Shader::ShaderFile &other) const { } return false; } - -/** - * Returns the filename of the included shader with the given source file - * index (as recorded in the #line statement in r_preprocess_source). We use - * this to associate error messages with included files. - */ -INLINE Filename Shader:: -get_filename_from_index(int index, ShaderType type) const { - if (index == 0) { - Filename fn = get_filename(type); - if (!fn.empty()) { - return fn; - } - } else if (glsl_preprocess && index >= 2048 && - (index - 2048) < (int)_included_files.size()) { - return _included_files[(size_t)index - 2048]; - } - // Must be a mistake. Quietly put back the integer. - char str[32]; - sprintf(str, "%d", index); - return Filename(str); -} diff --git a/panda/src/gobj/shader.cxx b/panda/src/gobj/shader.cxx index dede60afbc..d668af1882 100644 --- a/panda/src/gobj/shader.cxx +++ b/panda/src/gobj/shader.cxx @@ -21,6 +21,7 @@ #include "virtualFileSystem.h" #include "config_util.h" #include "bamCache.h" +#include "string_utils.h" #ifdef HAVE_CG #include @@ -2615,6 +2616,27 @@ Shader:: }*/ } +/** + * Returns the filename of the included shader with the given source file + * index (as recorded in the #line statement in r_preprocess_source). We use + * this to associate error messages with included files. + */ +Filename Shader:: +get_filename_from_index(int index, ShaderType type) const { + if (index == 0) { + Filename fn = get_filename(type); + if (!fn.empty()) { + return fn; + } + } else if (glsl_preprocess && index >= 2048 && + (index - 2048) < (int)_included_files.size()) { + return _included_files[(size_t)index - 2048]; + } + // Must be a mistake. Quietly put back the integer. + string str = format_string(index); + return Filename(str); +} + /** * Loads the shader with the given filename. */ diff --git a/panda/src/gobj/shader.h b/panda/src/gobj/shader.h index 106350066a..e7e843b9c6 100644 --- a/panda/src/gobj/shader.h +++ b/panda/src/gobj/shader.h @@ -556,10 +556,10 @@ public: #endif public: - pvector _ptr_spec; - epvector _mat_spec; - pvector _tex_spec; - pvector _var_spec; + pvector _ptr_spec; + epvector _mat_spec; + pvector _tex_spec; + pvector _var_spec; int _mat_deps; bool _error_flag; @@ -616,7 +616,7 @@ private: public: ~Shader(); - INLINE Filename get_filename_from_index(int index, ShaderType type) const; + Filename get_filename_from_index(int index, ShaderType type) const; public: static void register_with_read_factory(); diff --git a/panda/src/gobj/texture.h b/panda/src/gobj/texture.h index 71d5784dcf..010f847b6a 100644 --- a/panda/src/gobj/texture.h +++ b/panda/src/gobj/texture.h @@ -40,7 +40,6 @@ #include "cycleDataStageWriter.h" #include "pipelineCycler.h" #include "samplerState.h" -#include "pnmImage.h" #include "colorSpace.h" #include "geomEnums.h" #include "bamCacheRecord.h" diff --git a/panda/src/nativenet/time_clock.h b/panda/src/nativenet/time_clock.h index b02d4af01c..2c326fd7da 100644 --- a/panda/src/nativenet/time_clock.h +++ b/panda/src/nativenet/time_clock.h @@ -1,182 +1,176 @@ #ifndef __Time_H__ #define __Time_H__ -/** - * This class is to provide a consistant interface and storage to clock time - * .. Epoch based time to the second - * - * jan-2000 .. rhh changing all time to use sub second timing... - * - */ - #include class Time_Span; -class Time_Clock -{ - friend class Time_Span; +/** + * This class is to provide a consistant interface and storage to clock time + * .. Epoch based time to the second + * + * jan-2000 .. rhh changing all time to use sub second timing... + */ +class Time_Clock { + friend class Time_Span; public: - // Constructors - static Time_Clock GetCurrentTime(); - void ToCurrentTime(); - Time_Clock( timeval &in_mytime) - { - _my_time = in_mytime; - }; - Time_Clock(); - Time_Clock(time_t time); - Time_Clock(long secs, long usecs); - Time_Clock(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, long microseconds = 0, int nDST = -1); - Time_Clock(const Time_Clock& timeSrc); + // Constructors + static Time_Clock GetCurrentTime(); + void ToCurrentTime(); + inline Time_Clock(const timeval &in_mytime) { + _my_time = in_mytime; + } + Time_Clock(); + Time_Clock(time_t time); + Time_Clock(long secs, long usecs); + Time_Clock(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, long microseconds = 0, int nDST = -1); + Time_Clock(const Time_Clock& timeSrc); - inline const Time_Clock& operator=(const Time_Clock& timeSrc); - inline const Time_Clock& operator=(time_t t); + inline const Time_Clock &operator=(const Time_Clock& timeSrc); + inline const Time_Clock &operator=(time_t t); - // Attributes - struct tm* GetGmtTm(struct tm* ptm = NULL) const; - struct tm* GetLocalTm(struct tm* ptm = NULL) const; + // Attributes + struct tm *GetGmtTm(struct tm *ptm) const; + struct tm *GetLocalTm(struct tm *ptm) const; - time_t GetTime() const; - int GetYear() const; - int GetMonth() const; // month of year (1 = Jan) - int GetDay() const; // day of month - int GetHour() const; - int GetMinute() const; - int GetSecond() const; - int GetDayOfWeek() const; // 1=Sun, 2=Mon, ..., 7=Sat + time_t GetTime() const; + int GetYear() const; + int GetMonth() const; // month of year (1 = Jan) + int GetDay() const; // day of month + int GetHour() const; + int GetMinute() const; + int GetSecond() const; + int GetDayOfWeek() const; // 1=Sun, 2=Mon, ..., 7=Sat - void Set(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, long microseconds = 0, int nDST = -1); + void Set(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, long microseconds = 0, int nDST = -1); + // Operations time math + const Time_Clock& operator+=(const Time_Span &Time_Span); + const Time_Clock& operator-=(const Time_Span &Time_Span); + bool operator==(const Time_Clock &time) const; + bool operator!=(const Time_Clock &time) const; + bool operator<(const Time_Clock &time) const; + bool operator>(const Time_Clock &time) const; + bool operator<=(const Time_Clock &time) const; + bool operator>=(const Time_Clock &time) const; - // Operations time math - const Time_Clock& operator+=(const Time_Span &Time_Span); - const Time_Clock& operator-=(const Time_Span &Time_Span); - bool operator==(const Time_Clock &time) const; - bool operator!=(const Time_Clock &time) const; - bool operator<(const Time_Clock &time) const; - bool operator>(const Time_Clock &time) const; - bool operator<=(const Time_Clock &time) const; - bool operator>=(const Time_Clock &time) const; + inline time_t GetTime_t() { + return _my_time.tv_sec; + } + inline long GetUsecPart() { + return _my_time.tv_usec; + } + // formatting using "C" strftime + std::string Format(const char *pFormat) const; + std::string FormatGmt(const char *pFormat) const; - time_t GetTime_t() - { - return _my_time.tv_sec; - }; - long GetUsecPart() - { - return _my_time.tv_usec; - }; + const timeval &GetTval() { + return _my_time; + } + const timeval &GetTval() const { + return _my_time; + } - // formatting using "C" strftime - std::string Format(const char * pFormat) const; - std::string FormatGmt(const char * pFormat) const; - const timeval & GetTval() - { - return _my_time; - }; - const timeval & GetTval() const - { - return _my_time; - } ; - private: - struct timeval _my_time; +private: + struct timeval _my_time; }; /** * Construction from parts */ -inline Time_Clock::Time_Clock(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, long microseconds , int nDST) -{ - struct tm atm; - atm.tm_sec = nSec; - atm.tm_min = nMin; - atm.tm_hour = nHour; - assert(nDay >= 1 && nDay <= 31); - atm.tm_mday = nDay; - assert(nMonth >= 1 && nMonth <= 12); - atm.tm_mon = nMonth - 1; // tm_mon is 0 based - assert(nYear >= 1900); - atm.tm_year = nYear - 1900; // tm_year is 1900 based - atm.tm_isdst = nDST; - _my_time.tv_sec = (long)mktime(&atm); - assert(_my_time.tv_sec != -1); // indicates an illegal input time - _my_time.tv_usec = microseconds; - assert(_my_time.tv_usec < 1000000); +inline Time_Clock:: +Time_Clock(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, long microseconds, int nDST) { + struct tm atm; + atm.tm_sec = nSec; + atm.tm_min = nMin; + atm.tm_hour = nHour; + assert(nDay >= 1 && nDay <= 31); + atm.tm_mday = nDay; + assert(nMonth >= 1 && nMonth <= 12); + atm.tm_mon = nMonth - 1; // tm_mon is 0 based + assert(nYear >= 1900); + atm.tm_year = nYear - 1900; // tm_year is 1900 based + atm.tm_isdst = nDST; + _my_time.tv_sec = (long)mktime(&atm); + assert(_my_time.tv_sec != -1); // indicates an illegal input time + _my_time.tv_usec = microseconds; + assert(_my_time.tv_usec < 1000000); } + /** * */ -inline void Time_Clock::Set(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, long microseconds , int nDST) -{ - struct tm atm; - atm.tm_sec = nSec; - atm.tm_min = nMin; - atm.tm_hour = nHour; - assert(nDay >= 1 && nDay <= 31); - atm.tm_mday = nDay; - assert(nMonth >= 1 && nMonth <= 12); - atm.tm_mon = nMonth - 1; // tm_mon is 0 based - assert(nYear >= 1900); - atm.tm_year = nYear - 1900; // tm_year is 1900 based - atm.tm_isdst = nDST; - _my_time.tv_sec = (long)mktime(&atm); - assert(_my_time.tv_sec != -1); // indicates an illegal input time - _my_time.tv_usec = microseconds; - assert(_my_time.tv_usec < 1000000); +inline void Time_Clock:: +Set(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, long microseconds , int nDST) { + struct tm atm; + atm.tm_sec = nSec; + atm.tm_min = nMin; + atm.tm_hour = nHour; + assert(nDay >= 1 && nDay <= 31); + atm.tm_mday = nDay; + assert(nMonth >= 1 && nMonth <= 12); + atm.tm_mon = nMonth - 1; // tm_mon is 0 based + assert(nYear >= 1900); + atm.tm_year = nYear - 1900; // tm_year is 1900 based + atm.tm_isdst = nDST; + _my_time.tv_sec = (long)mktime(&atm); + assert(_my_time.tv_sec != -1); // indicates an illegal input time + _my_time.tv_usec = microseconds; + assert(_my_time.tv_usec < 1000000); } + /** * The Default no param constructor.. Will set time to current system time */ -inline Time_Clock Time_Clock::GetCurrentTime() -{ - return Time_Clock(); +inline Time_Clock Time_Clock:: +GetCurrentTime() { + return Time_Clock(); } + /** * */ -inline Time_Clock::Time_Clock() -{ - gettimeofday(&_my_time, NULL); +inline Time_Clock:: +Time_Clock() { + gettimeofday(&_my_time, NULL); } + /** * Load this object with the current OS time */ -inline void Time_Clock::ToCurrentTime() -{ - gettimeofday(&_my_time, NULL); +inline void Time_Clock:: +ToCurrentTime() { + gettimeofday(&_my_time, NULL); } + /** * Access the stored time and converts to a struct tm format If storage * location is specified then it will stor information in the provided buffer * else it will use the library's internal buffer space */ -inline struct tm* Time_Clock::GetGmtTm(struct tm* ptm) const -{ - if (ptm != NULL) - { - *ptm = *gmtime((const time_t *)&_my_time.tv_sec); - return ptm; - } else - return gmtime((const time_t *)&_my_time.tv_sec); +inline struct tm *Time_Clock:: +GetGmtTm(struct tm *ptm) const { + nassertr(ptm != NULL, NULL); +#ifdef _WIN32 + return (gmtime_s(ptm, (const time_t *)&_my_time.tv_sec) == 0) ? ptm : NULL; +#else + return gmtime_r((const time_t *)&_my_time.tv_sec, ptm); +#endif } /** * Gets The local time in a tm structre from the internal time value */ -inline struct tm* Time_Clock::GetLocalTm(struct tm* ptm) const -{ - if (ptm != NULL) - { - struct tm* ptmTemp = localtime((const time_t *)&_my_time.tv_sec); - if (ptmTemp == NULL) - return NULL; // indicates the _my_time.tv_sec was not initialized! - *ptm = *ptmTemp; - return ptm; - } else - return localtime((const time_t *)&_my_time.tv_sec); +inline struct tm *Time_Clock:: +GetLocalTm(struct tm *ptm) const { + nassertr(ptm != NULL, NULL); +#ifdef _WIN32 + return (localtime_s(ptm, (const time_t *)&_my_time.tv_sec) == 0) ? ptm : NULL; +#else + return localtime_r((const time_t *)&_my_time.tv_sec, ptm); +#endif } // String formatting Verifies will fail if the needed buffer size is too large #define maxTimeBufferSize 4096 @@ -184,235 +178,260 @@ inline struct tm* Time_Clock::GetLocalTm(struct tm* ptm) const /** * Used to allow access to the "C" library strftime functions.. */ -inline std::string Time_Clock::Format(const char * pFormat) const -{ +inline std::string Time_Clock:: +Format(const char *pFormat) const { + char szBuffer[maxTimeBufferSize]; + char ch, ch1; + char *pch = szBuffer; - char szBuffer[maxTimeBufferSize]; - char ch, ch1; - char * pch = szBuffer; - - while ((ch = *pFormat++) != '\0') - { - assert(pch < &szBuffer[maxTimeBufferSize]); - if (ch == '%') - { - switch (ch1 = *pFormat++) - { - default: - *pch++ = ch; - *pch++ = ch1; - break; - case 'N': - pch += sprintf(pch, "%03ld", (long)(_my_time.tv_usec / 1000)); - break; - } - } - else - { - *pch++ = ch; - } + while ((ch = *pFormat++) != '\0') { + assert(pch < &szBuffer[maxTimeBufferSize]); + if (ch == '%') { + switch (ch1 = *pFormat++) { + default: + *pch++ = ch; + *pch++ = ch1; + break; + case 'N': +#ifdef _WIN32 + pch += sprintf_s(pch, maxTimeBufferSize, "%03ld", (long)(_my_time.tv_usec / 1000)); +#else + pch += snprintf(pch, maxTimeBufferSize, "%03ld", (long)(_my_time.tv_usec / 1000)); +#endif + break; + } + } else { + *pch++ = ch; } + } - *pch = '\0'; + *pch = '\0'; - char szBuffer1[maxTimeBufferSize]; + char szBuffer1[maxTimeBufferSize]; - struct tm* ptmTemp = localtime((const time_t *)&_my_time.tv_sec); - if (ptmTemp == NULL || - !strftime(szBuffer1, sizeof(szBuffer1), szBuffer, ptmTemp)) - szBuffer1[0] = '\0'; - return std::string(szBuffer1); + struct tm tmTemp; + if (GetLocalTm(&tmTemp) == NULL || + !strftime(szBuffer1, sizeof(szBuffer1), szBuffer, &tmTemp)) { + szBuffer1[0] = '\0'; + } + return std::string(szBuffer1); } + /** * A Wraper to size_t strftime( char *strDest, size_t maxsize, const char * *format, const struct tm *timeptr ); * */ -inline std::string Time_Clock::FormatGmt(const char * pFormat) const -{ +inline std::string Time_Clock:: +FormatGmt(const char *pFormat) const { + char szBuffer[maxTimeBufferSize]; + char ch, ch1; + char *pch = szBuffer; - char szBuffer[maxTimeBufferSize]; - char ch, ch1; - char * pch = szBuffer; - - while ((ch = *pFormat++) != '\0') - { - assert(pch < &szBuffer[maxTimeBufferSize]); - if (ch == '%') - { - switch (ch1 = *pFormat++) - { - default: - *pch++ = ch; - *pch++ = ch1; - break; - case 'N': - pch += sprintf(pch, "%03ld", (long)(_my_time.tv_usec / 1000)); - break; - } - } - else - { - *pch++ = ch; - } + while ((ch = *pFormat++) != '\0') { + assert(pch < &szBuffer[maxTimeBufferSize]); + if (ch == '%') { + switch (ch1 = *pFormat++) { + default: + *pch++ = ch; + *pch++ = ch1; + break; + case 'N': +#ifdef _WIN32 + pch += sprintf_s(pch, maxTimeBufferSize, "%03ld", (long)(_my_time.tv_usec / 1000)); +#else + pch += snprintf(pch, maxTimeBufferSize, "%03ld", (long)(_my_time.tv_usec / 1000)); +#endif + break; + } + } else { + *pch++ = ch; } - *pch = '\0'; + } + *pch = '\0'; - char szBuffer1[maxTimeBufferSize]; + char szBuffer1[maxTimeBufferSize]; - struct tm* ptmTemp = gmtime((const time_t *)&_my_time.tv_sec); - if (ptmTemp == NULL || - !strftime(szBuffer1, sizeof(szBuffer1), szBuffer, ptmTemp)) - szBuffer1[0] = '\0'; - return std::string(szBuffer1); + struct tm tmTemp; + if (GetGmtTm(&tmTemp) == NULL || + !strftime(szBuffer1, sizeof(szBuffer1), szBuffer, &tmTemp)) { + szBuffer1[0] = '\0'; + } + return std::string(szBuffer1); } + /** * The Constructor that take a time_t objext */ -inline Time_Clock::Time_Clock(time_t time) -{ - _my_time.tv_sec = (long)time; - _my_time.tv_usec = 0; -}; +inline Time_Clock:: +Time_Clock(time_t time) { + _my_time.tv_sec = (long)time; + _my_time.tv_usec = 0; +} + /** * Constructor that takes in sec and usecs.. */ -inline Time_Clock::Time_Clock(long secs, long usecs) -{ - _my_time.tv_sec = secs; - _my_time.tv_usec = usecs; - NormalizeTime(_my_time); -}; +inline Time_Clock:: +Time_Clock(long secs, long usecs) { + _my_time.tv_sec = secs; + _my_time.tv_usec = usecs; + NormalizeTime(_my_time); +} + /** * yet another constructor */ -inline Time_Clock::Time_Clock(const Time_Clock& timeSrc) -{ - _my_time.tv_sec = timeSrc._my_time.tv_sec; - _my_time.tv_usec = timeSrc._my_time.tv_usec; +inline Time_Clock:: +Time_Clock(const Time_Clock& timeSrc) { + _my_time.tv_sec = timeSrc._my_time.tv_sec; + _my_time.tv_usec = timeSrc._my_time.tv_usec; } + /** * .. is time equal */ -inline bool Time_Clock::operator==(const Time_Clock &time) const -{ - return ((_my_time.tv_sec == time._my_time.tv_sec) && (_my_time.tv_usec == time._my_time.tv_usec)); +inline bool Time_Clock:: +operator==(const Time_Clock &time) const { + return ((_my_time.tv_sec == time._my_time.tv_sec) && (_my_time.tv_usec == time._my_time.tv_usec)); } + /** * .is time != */ -inline bool Time_Clock::operator!=(const Time_Clock &time) const -{ - return ((_my_time.tv_sec != time._my_time.tv_sec) || (_my_time.tv_usec != time._my_time.tv_usec)); +inline bool Time_Clock:: +operator!=(const Time_Clock &time) const { + return ((_my_time.tv_sec != time._my_time.tv_sec) || (_my_time.tv_usec != time._my_time.tv_usec)); } /** * */ -inline bool Time_Clock::operator<(const Time_Clock &time) const -{ - return ((_my_time.tv_sec < time._my_time.tv_sec) || - ((_my_time.tv_sec == time._my_time.tv_sec) && (_my_time.tv_usec < time._my_time.tv_usec))); +inline bool Time_Clock:: +operator<(const Time_Clock &time) const { + return ((_my_time.tv_sec < time._my_time.tv_sec) || + ((_my_time.tv_sec == time._my_time.tv_sec) && (_my_time.tv_usec < time._my_time.tv_usec))); } -/** - * - */ -inline bool Time_Clock::operator>(const Time_Clock &time) const -{ - return ((_my_time.tv_sec > time._my_time.tv_sec) || - ((_my_time.tv_sec == time._my_time.tv_sec) && (_my_time.tv_usec > time._my_time.tv_usec))); -} -/** - * - */ -inline bool Time_Clock::operator<=(const Time_Clock &time) const -{ - return ((_my_time.tv_sec < time._my_time.tv_sec) || - ((_my_time.tv_sec == time._my_time.tv_sec) && (_my_time.tv_usec <= time._my_time.tv_usec))); -} -/** - * - */ -inline bool Time_Clock::operator>=(const Time_Clock &time) const -{ - return ((_my_time.tv_sec > time._my_time.tv_sec) || - ((_my_time.tv_sec == time._my_time.tv_sec) && (_my_time.tv_usec >= time._my_time.tv_usec))); -} -/** - * - */ -inline const Time_Clock& Time_Clock::operator=(const Time_Clock& timeSrc) -{ - if (&timeSrc == this) - return * this; - _my_time = timeSrc._my_time; +/** + * + */ +inline bool Time_Clock:: +operator>(const Time_Clock &time) const { + return ((_my_time.tv_sec > time._my_time.tv_sec) || + ((_my_time.tv_sec == time._my_time.tv_sec) && (_my_time.tv_usec > time._my_time.tv_usec))); +} + +/** + * + */ +inline bool Time_Clock:: +operator<=(const Time_Clock &time) const { + return ((_my_time.tv_sec < time._my_time.tv_sec) || + ((_my_time.tv_sec == time._my_time.tv_sec) && (_my_time.tv_usec <= time._my_time.tv_usec))); +} + +/** + * + */ +inline bool Time_Clock:: +operator>=(const Time_Clock &time) const { + return ((_my_time.tv_sec > time._my_time.tv_sec) || + ((_my_time.tv_sec == time._my_time.tv_sec) && (_my_time.tv_usec >= time._my_time.tv_usec))); +} + +/** + * + */ +inline const Time_Clock& Time_Clock:: +operator=(const Time_Clock& timeSrc) { + if (&timeSrc == this) { return *this; + } + + _my_time = timeSrc._my_time; + return *this; } + /** * */ -inline const Time_Clock& Time_Clock::operator=(time_t t) -{ - _my_time.tv_sec = (long)t; - _my_time.tv_usec = 0; - return *this; +inline const Time_Clock& Time_Clock:: +operator=(time_t t) { + _my_time.tv_sec = (long)t; + _my_time.tv_usec = 0; + return *this; } + /** * */ -inline time_t Time_Clock::GetTime() const -{ - return _my_time.tv_sec; +inline time_t Time_Clock:: +GetTime() const { + return _my_time.tv_sec; } + /** * */ -inline int Time_Clock::GetYear() const -{ - return (GetLocalTm(NULL)->tm_year) + 1900; +inline int Time_Clock:: +GetYear() const { + struct tm atm; + return (GetLocalTm(&atm)->tm_year) + 1900; } + /** * */ -inline int Time_Clock::GetMonth() const -{ - return GetLocalTm(NULL)->tm_mon + 1; +inline int Time_Clock:: +GetMonth() const { + struct tm atm; + return GetLocalTm(&atm)->tm_mon + 1; } + /** * */ -inline int Time_Clock::GetDay() const -{ - return GetLocalTm(NULL)->tm_mday; +inline int Time_Clock:: +GetDay() const { + struct tm atm; + return GetLocalTm(&atm)->tm_mday; } + /** * */ -inline int Time_Clock::GetHour() const -{ - return GetLocalTm(NULL)->tm_hour; +inline int Time_Clock:: +GetHour() const { + struct tm atm; + return GetLocalTm(&atm)->tm_hour; } + /** * */ -inline int Time_Clock::GetMinute() const -{ - return GetLocalTm(NULL)->tm_min; +inline int Time_Clock:: +GetMinute() const { + struct tm atm; + return GetLocalTm(&atm)->tm_min; } + /** * */ -inline int Time_Clock::GetSecond() const -{ - return GetLocalTm(NULL)->tm_sec; +inline int Time_Clock:: +GetSecond() const { + struct tm atm; + return GetLocalTm(&atm)->tm_sec; } + /** * */ -inline int Time_Clock::GetDayOfWeek() const -{ - return GetLocalTm(NULL)->tm_wday + 1; +inline int Time_Clock:: +GetDayOfWeek() const { + struct tm atm; + return GetLocalTm(&atm)->tm_wday + 1; } #endif //__Time_H__ diff --git a/panda/src/nativenet/time_general.h b/panda/src/nativenet/time_general.h index cb7a756ea9..5fac081a32 100644 --- a/panda/src/nativenet/time_general.h +++ b/panda/src/nativenet/time_general.h @@ -1,128 +1,82 @@ #ifndef __TIME_GENERAL_H__ #define __TIME_GENERAL_H__ - Time_Span TimeDifference(const Time_Clock &time1, const Time_Clock &time2); -Time_Clock TimeDifference( const Time_Clock &time1, const Time_Span &Time_Span); +Time_Clock TimeDifference(const Time_Clock &time1, const Time_Span &Time_Span); Time_Clock TimeAddition(const Time_Clock &time1, Time_Span &Time_Span); - Time_Clock operator+(const Time_Clock &tm, const Time_Span &ts); Time_Clock operator-(const Time_Clock &tm, const Time_Span &ts); - -bool SetFromTimeStr(const char * str, Time_Clock & outtime); -std::string GetTimeStr(const Time_Clock & intime); +/** + * + */ +inline Time_Span TimeDifference(const Time_Clock &time1, const Time_Clock &time2) { + timeval ans; + TimeDif(time2.GetTval(), time1.GetTval(), ans); + return Time_Span(ans); +} /** * */ -inline Time_Span TimeDifference(const Time_Clock &time1, const Time_Clock &time2) -{ - timeval ans; - TimeDif(time2.GetTval(), time1.GetTval(), ans); - return Time_Span(ans); -} -/** - * - */ -inline Time_Clock TimeDifference( const Time_Clock &time1, const Time_Span &Time_Span) -{ - timeval ans; - TimeDif(Time_Span.GetTval(), time1.GetTval(), ans); - return Time_Clock(ans); +inline Time_Clock TimeDifference(const Time_Clock &time1, const Time_Span &Time_Span) { + timeval ans; + TimeDif(Time_Span.GetTval(), time1.GetTval(), ans); + return Time_Clock(ans); } + /** * */ inline Time_Clock TimeAddition(const Time_Clock &time1, Time_Span &Time_Span) { - timeval ans; - TimeAdd(time1.GetTval(), Time_Span.GetTval(), ans); - return Time_Clock(ans); + timeval ans; + TimeAdd(time1.GetTval(), Time_Span.GetTval(), ans); + return Time_Clock(ans); } -/** - * - */ -inline const Time_Clock& Time_Clock::operator+=(const Time_Span &Time_Span) -{ - _my_time.tv_usec += Time_Span._my_time.tv_usec; - _my_time.tv_sec += Time_Span._my_time.tv_sec; - NormalizeTime(_my_time); - return *this; -} -/** - * - */ -inline Time_Clock operator+(const Time_Clock &tm, const Time_Span &ts) -{ - Time_Clock work(tm); - work += ts; - return work; -} -/** - * - */ -inline Time_Clock operator-(const Time_Clock &tm, const Time_Span &ts) -{ - return TimeDifference(tm, ts); -} -/** - * - */ -inline const Time_Clock& Time_Clock::operator-=(const Time_Span &Time_Span) -{ - _my_time.tv_usec -= Time_Span._my_time.tv_usec; - _my_time.tv_sec -= Time_Span._my_time.tv_sec; - NormalizeTime(_my_time); - return *this; -} -/** - * - */ -inline Time_Span operator-(const Time_Clock &tm1, const Time_Clock &tm2) -{ - return TimeDifference(tm1, tm2); -} -/** - * - */ -inline std::string GetTimeStr(const Time_Clock & intime) -{ - static std::string ts; - static Time_Clock prev_time; - if (prev_time != intime || ts.empty()) - { - ts = intime.Format("%Y-%m-%d %H:%M:%S"); - prev_time = intime; - } - return ts; -} /** * */ -inline std::string GetTimeStr() -{ - return GetTimeStr(Time_Clock::GetCurrentTime()); +inline const Time_Clock &Time_Clock::operator+=(const Time_Span &Time_Span) { + _my_time.tv_usec += Time_Span._my_time.tv_usec; + _my_time.tv_sec += Time_Span._my_time.tv_sec; + NormalizeTime(_my_time); + return *this; } + /** * */ -inline bool SetFromTimeStr(const char * str, Time_Clock & outtime) -{ - int year = 0; - int month = 0; - int day = 0; - int hour = 0; - int min = 0; - int sec = 0; +inline Time_Clock operator+(const Time_Clock &tm, const Time_Span &ts) { + Time_Clock work(tm); + work += ts; + return work; +} - if (sscanf(str, "%d-%d-%d %d:%d:%d", &year, &month, &day, &hour, &min, &sec) != 6) - return false; +/** + * + */ +inline Time_Clock operator-(const Time_Clock &tm, const Time_Span &ts) { + return TimeDifference(tm, ts); +} - outtime.Set(year, month, day, hour, min, sec); - return true; +/** + * + */ +inline const Time_Clock& Time_Clock::operator-=(const Time_Span &Time_Span) { + _my_time.tv_usec -= Time_Span._my_time.tv_usec; + _my_time.tv_sec -= Time_Span._my_time.tv_sec; + NormalizeTime(_my_time); + return *this; +} + +/** + * + */ +inline Time_Span operator-(const Time_Clock &tm1, const Time_Clock &tm2) { + return TimeDifference(tm1, tm2); } #endif //__TIME_GENERAL_H__ diff --git a/panda/src/nativenet/time_span.h b/panda/src/nativenet/time_span.h index f27d7401ab..4633ffef3c 100644 --- a/panda/src/nativenet/time_span.h +++ b/panda/src/nativenet/time_span.h @@ -1,360 +1,376 @@ #ifndef __TIME_SPAN_H__ #define __TIME_SPAN_H__ + /** * */ -class Time_Span -{ +class Time_Span { public: - // Constructors - Time_Span() - { - } + // Constructors + Time_Span() {} - Time_Span(struct timeval time) - { - _my_time = time;NormalizeTime(_my_time); - } + Time_Span(struct timeval time) { + _my_time = time; + NormalizeTime(_my_time); + } - Time_Span(time_t time); - Time_Span(long lDays, int nHours, int nMins, int nSecs, int usecs); - Time_Span(long seconds, int usecs ) ; - Time_Span(const Time_Span& Time_SpanSrc); - Time_Span(const Time_Clock& Time_SpanSrc); - Time_Span(PN_stdfloat Seconds); + Time_Span(time_t time); + Time_Span(long lDays, int nHours, int nMins, int nSecs, int usecs); + Time_Span(long seconds, int usecs); + Time_Span(const Time_Span &Time_SpanSrc); + Time_Span(const Time_Clock &Time_SpanSrc); + Time_Span(PN_stdfloat Seconds); + const Time_Span &operator=(const Time_Span &Time_SpanSrc); - const Time_Span& operator=(const Time_Span& Time_SpanSrc); + // Attributes extract parts + long GetDays() const; // total # of days + long GetTotalHours() const; + int GetHours() const; + long GetTotalMinutes() const; + int GetMinutes() const; + long GetTotalSeconds() const; + int GetSeconds() const; + long GetTotalMSeconds() const; + long GetTotal100Seconds() const; + long GetMSeconds() const; - // Attributes extract parts - long GetDays() const; // total # of days - long GetTotalHours() const; - int GetHours() const; - long GetTotalMinutes() const; - int GetMinutes() const; - long GetTotalSeconds() const; - int GetSeconds() const; - long GetTotalMSeconds() const; - long GetTotal100Seconds() const; - long GetMSeconds() const; + // Operations time math + const Time_Span &operator+=(Time_Span &Time_Span); + const Time_Span &operator-=(Time_Span &Time_Span); + bool operator==(Time_Span &Time_Span) const; + bool operator!=(Time_Span &Time_Span) const; + bool operator<(Time_Span &Time_Span) const; + bool operator>(Time_Span &Time_Span) const; + bool operator<=(Time_Span &Time_Span) const; + bool operator>=(Time_Span &Time_Span) const; + const timeval &GetTval() const { + return _my_time; + } - // Operations time math - const Time_Span& operator+=(Time_Span &Time_Span); - const Time_Span& operator-=(Time_Span &Time_Span); - bool operator==(Time_Span &Time_Span) const; - bool operator!=(Time_Span &Time_Span) const; - bool operator<(Time_Span &Time_Span) const; - bool operator>(Time_Span &Time_Span) const; - bool operator<=(Time_Span &Time_Span) const; - bool operator>=(Time_Span &Time_Span) const; - const timeval & GetTval() const - { - return _my_time; - } + void Set(long lDays, int nHours, int nMins, int nSecs, int usecs); + std::string Format(char *pFormat) const; - void Set(long lDays, int nHours, int nMins, int nSecs, int usecs); - - std::string Format(char *pFormat) const; private: - struct timeval _my_time; - friend class Time_Clock; + struct timeval _my_time; + friend class Time_Clock; }; + /** * */ -inline Time_Span::Time_Span(long seconds, int usecs) -{ - _my_time.tv_sec = seconds; - _my_time.tv_usec = usecs; - NormalizeTime(_my_time); +inline Time_Span:: +Time_Span(long seconds, int usecs) { + _my_time.tv_sec = seconds; + _my_time.tv_usec = usecs; + NormalizeTime(_my_time); } + /** * */ -inline Time_Span::Time_Span(time_t time) -{ - _my_time.tv_usec = 0; - _my_time.tv_sec = (long)time; +inline Time_Span:: +Time_Span(time_t time) { + _my_time.tv_usec = 0; + _my_time.tv_sec = (long)time; } + /** * */ -inline Time_Span::Time_Span(PN_stdfloat Seconds) -{ - _my_time.tv_sec = (long)Seconds; // this truncats .. desired result.. - _my_time.tv_usec = (long)((Seconds - (double)_my_time.tv_sec) * (double)USEC); +inline Time_Span:: +Time_Span(PN_stdfloat Seconds) { + _my_time.tv_sec = (long)Seconds; // this truncats .. desired result.. + _my_time.tv_usec = (long)((Seconds - (double)_my_time.tv_sec) * (double)USEC); } + /** * */ -inline Time_Span::Time_Span(long lDays, int nHours, int nMins, int nSecs, int usecs) -{ - _my_time.tv_sec = nSecs + 60 * (nMins + 60 * (nHours + 24 * lDays)); - _my_time.tv_usec = usecs; +inline Time_Span:: +Time_Span(long lDays, int nHours, int nMins, int nSecs, int usecs) { + _my_time.tv_sec = nSecs + 60 * (nMins + 60 * (nHours + 24 * lDays)); + _my_time.tv_usec = usecs; } /** * */ -inline void Time_Span::Set(long lDays, int nHours, int nMins, int nSecs, int usecs) -{ - _my_time.tv_sec = nSecs + 60 * (nMins + 60 * (nHours + 24 * lDays)); - _my_time.tv_usec = usecs; +inline void Time_Span:: +Set(long lDays, int nHours, int nMins, int nSecs, int usecs) { + _my_time.tv_sec = nSecs + 60 * (nMins + 60 * (nHours + 24 * lDays)); + _my_time.tv_usec = usecs; } /** * */ -inline Time_Span::Time_Span(const Time_Span& Time_SpanSrc) -{ - _my_time = Time_SpanSrc._my_time; +inline Time_Span:: +Time_Span(const Time_Span &Time_SpanSrc) { + _my_time = Time_SpanSrc._my_time; } /** * */ -inline Time_Span::Time_Span(const Time_Clock& Time_SpanSrc) -{ - _my_time = Time_SpanSrc._my_time; +inline Time_Span:: +Time_Span(const Time_Clock &Time_SpanSrc) { + _my_time = Time_SpanSrc._my_time; } /** * */ -inline const Time_Span& Time_Span::operator=(const Time_Span& Time_SpanSrc) -{ - if (&Time_SpanSrc == this) - return * this; - _my_time = Time_SpanSrc._my_time; return *this; -} - -/** - * - */ -inline long Time_Span::GetDays() const -{ - return _my_time.tv_sec / (24*3600L); -} - -/** - * - */ -inline long Time_Span::GetTotalHours() const -{ - return _my_time.tv_sec / 3600; -} - -/** - * - */ -inline int Time_Span::GetHours() const -{ - return (int)(GetTotalHours() - GetDays()*24); -} - -/** - * - */ -inline long Time_Span::GetTotalMinutes() const -{ - return _my_time.tv_sec / 60; -} - -/** - * - */ -inline int Time_Span::GetMinutes() const -{ - return (int)(GetTotalMinutes() - GetTotalHours()*60); -} - -/** - * - */ -inline long Time_Span::GetTotalSeconds() const -{ - return _my_time.tv_sec; -} - -/** - * - */ -inline long Time_Span::GetTotalMSeconds() const -{ - return (_my_time.tv_sec * 1000) + (_my_time.tv_usec / 1000); -} - - -inline long Time_Span::GetTotal100Seconds() const -{ - return (_my_time.tv_sec * 100) + (_my_time.tv_usec / 10000); -} - - - -/** - * - */ -inline long Time_Span::GetMSeconds() const -{ - return (_my_time.tv_usec / 1000); -} - - -/** - * - */ -inline int Time_Span::GetSeconds() const -{ - return (int)(GetTotalSeconds() - GetTotalMinutes()*60); -} - -/** - * - */ -inline Time_Span TimeDifference(const Time_Span &Time_Span1, const Time_Span &Time_Span2) -{ - timeval ans; - TimeDif(Time_Span2.GetTval(), Time_Span1.GetTval(), ans); - return Time_Span(ans); -} - -/** - * - */ -inline Time_Span TimeAddition(const Time_Span &Time_Span1, const Time_Span &Time_Span2) -{ - timeval ans; - TimeAdd(Time_Span2.GetTval(), Time_Span1.GetTval(), ans); - return Time_Span(ans); -} - -/** - * - */ -inline const Time_Span& Time_Span::operator+=(Time_Span &Time_Span) -{ - _my_time.tv_usec += Time_Span._my_time.tv_usec; - _my_time.tv_sec += Time_Span._my_time.tv_sec; - NormalizeTime(_my_time); +inline const Time_Span &Time_Span:: +operator=(const Time_Span &Time_SpanSrc) { + if (&Time_SpanSrc == this) { return *this; + } + _my_time = Time_SpanSrc._my_time; + return *this; } /** * */ -inline const Time_Span& Time_Span::operator-=(Time_Span &Time_Span) -{ - _my_time.tv_usec -= Time_Span._my_time.tv_usec; - _my_time.tv_sec -= Time_Span._my_time.tv_sec; - NormalizeTime(_my_time); - return *this; +inline long Time_Span:: +GetDays() const { + return _my_time.tv_sec / (24*3600L); } /** * */ -inline bool Time_Span::operator==(Time_Span &Time_Span) const -{ - return ((_my_time.tv_sec == Time_Span._my_time.tv_sec) && (_my_time.tv_usec == Time_Span._my_time.tv_usec)); +inline long Time_Span:: +GetTotalHours() const { + return _my_time.tv_sec / 3600; } /** * */ -inline bool Time_Span::operator!=(Time_Span &Time_Span) const -{ - return ((_my_time.tv_sec != Time_Span._my_time.tv_sec) || (_my_time.tv_usec != Time_Span._my_time.tv_usec)); +inline int Time_Span:: +GetHours() const { + return (int)(GetTotalHours() - GetDays()*24); } /** * */ -inline bool Time_Span::operator<(Time_Span &Time_Span) const -{ - return ((_my_time.tv_sec < Time_Span._my_time.tv_sec) || - ((_my_time.tv_sec == Time_Span._my_time.tv_sec) && (_my_time.tv_usec < Time_Span._my_time.tv_usec))); +inline long Time_Span:: +GetTotalMinutes() const { + return _my_time.tv_sec / 60; } /** * */ -inline bool Time_Span::operator>(Time_Span &Time_Span) const -{ - return ((_my_time.tv_sec > Time_Span._my_time.tv_sec) || - ((_my_time.tv_sec == Time_Span._my_time.tv_sec) && (_my_time.tv_usec > Time_Span._my_time.tv_usec))); +inline int Time_Span:: +GetMinutes() const { + return (int)(GetTotalMinutes() - GetTotalHours()*60); } /** * */ -inline bool Time_Span::operator<=(Time_Span &Time_Span) const -{ - return ((_my_time.tv_sec < Time_Span._my_time.tv_sec) || - ((_my_time.tv_sec == Time_Span._my_time.tv_sec) && (_my_time.tv_usec <= Time_Span._my_time.tv_usec))); +inline long Time_Span:: +GetTotalSeconds() const { + return _my_time.tv_sec; } /** * */ -inline bool Time_Span::operator>=(Time_Span &Time_Span) const -{ - return ((_my_time.tv_sec > Time_Span._my_time.tv_sec) || - ((_my_time.tv_sec == Time_Span._my_time.tv_sec) && (_my_time.tv_usec >= Time_Span._my_time.tv_usec))); +inline long Time_Span:: +GetTotalMSeconds() const { + return (_my_time.tv_sec * 1000) + (_my_time.tv_usec / 1000); +} + +inline long Time_Span:: +GetTotal100Seconds() const { + return (_my_time.tv_sec * 100) + (_my_time.tv_usec / 10000); } /** * */ -inline std::string Time_Span::Format(char * pFormat) const +inline long Time_Span:: +GetMSeconds() const { + return (_my_time.tv_usec / 1000); +} + +/** + * + */ +inline int Time_Span:: +GetSeconds() const { + return (int)(GetTotalSeconds() - GetTotalMinutes()*60); +} + +/** + * + */ +inline Time_Span TimeDifference(const Time_Span &Time_Span1, const Time_Span &Time_Span2) { + timeval ans; + TimeDif(Time_Span2.GetTval(), Time_Span1.GetTval(), ans); + return Time_Span(ans); +} + +/** + * + */ +inline Time_Span TimeAddition(const Time_Span &Time_Span1, const Time_Span &Time_Span2) { + timeval ans; + TimeAdd(Time_Span2.GetTval(), Time_Span1.GetTval(), ans); + return Time_Span(ans); +} + +/** + * + */ +inline const Time_Span &Time_Span:: +operator+=(Time_Span &Time_Span) { + _my_time.tv_usec += Time_Span._my_time.tv_usec; + _my_time.tv_sec += Time_Span._my_time.tv_sec; + NormalizeTime(_my_time); + return *this; +} + +/** + * + */ +inline const Time_Span &Time_Span:: +operator-=(Time_Span &Time_Span) { + _my_time.tv_usec -= Time_Span._my_time.tv_usec; + _my_time.tv_sec -= Time_Span._my_time.tv_sec; + NormalizeTime(_my_time); + return *this; +} + +/** + * + */ +inline bool Time_Span:: +operator==(Time_Span &Time_Span) const { + return ((_my_time.tv_sec == Time_Span._my_time.tv_sec) && (_my_time.tv_usec == Time_Span._my_time.tv_usec)); +} + +/** + * + */ +inline bool Time_Span:: +operator!=(Time_Span &Time_Span) const { + return ((_my_time.tv_sec != Time_Span._my_time.tv_sec) || (_my_time.tv_usec != Time_Span._my_time.tv_usec)); +} + +/** + * + */ +inline bool Time_Span:: +operator<(Time_Span &Time_Span) const { + return ((_my_time.tv_sec < Time_Span._my_time.tv_sec) || + ((_my_time.tv_sec == Time_Span._my_time.tv_sec) && (_my_time.tv_usec < Time_Span._my_time.tv_usec))); +} + +/** + * + */ +inline bool Time_Span:: +operator>(Time_Span &Time_Span) const { + return ((_my_time.tv_sec > Time_Span._my_time.tv_sec) || + ((_my_time.tv_sec == Time_Span._my_time.tv_sec) && (_my_time.tv_usec > Time_Span._my_time.tv_usec))); +} + +/** + * + */ +inline bool Time_Span:: +operator<=(Time_Span &Time_Span) const { + return ((_my_time.tv_sec < Time_Span._my_time.tv_sec) || + ((_my_time.tv_sec == Time_Span._my_time.tv_sec) && (_my_time.tv_usec <= Time_Span._my_time.tv_usec))); +} + +/** + * + */ +inline bool Time_Span:: +operator>=(Time_Span &Time_Span) const { + return ((_my_time.tv_sec > Time_Span._my_time.tv_sec) || + ((_my_time.tv_sec == Time_Span._my_time.tv_sec) && (_my_time.tv_usec >= Time_Span._my_time.tv_usec))); +} + +/** + * + */ +inline std::string Time_Span:: +Format(char *pFormat) const { /* - * formatting Time_Spans is a little trickier than formatting * we are only - * interested in relative time formats, ie. it is illegal to format anything - * dealing with absolute time (i.e. years, months, day of week, day of year, - * timezones, ...) * the only valid formats: %D - # of days -- NEW !!! %H - - * hour in 24 hour format %M - minute (0-59) %S - seconds (0-59) %% - percent - * sign %N - nanosecs - */ -{ - char szBuffer[maxTimeBufferSize]; - char ch; - char * pch = szBuffer; +* formatting Time_Spans is a little trickier than formatting * we are only +* interested in relative time formats, ie. it is illegal to format anything +* dealing with absolute time (i.e. years, months, day of week, day of year, +* timezones, ...) * the only valid formats: %D - # of days -- NEW !!! %H - +* hour in 24 hour format %M - minute (0-59) %S - seconds (0-59) %% - percent +* sign %N - nanosecs +*/ + char szBuffer[maxTimeBufferSize]; + char ch; + char *pch = szBuffer; - while ((ch = *pFormat++) != '\0') { - assert(pch < &szBuffer[maxTimeBufferSize]); - if (ch == '%') { - switch (ch = *pFormat++) { - default: - assert(false); // probably a bad format character - case '%': - *pch++ = ch; - break; - case 'D': - pch += sprintf(pch, "%ld", GetDays()); - break; - case 'H': - pch += sprintf(pch, "%02d", GetHours()); - break; - case 'M': - pch += sprintf(pch, "%02d", GetMinutes()); - break; - case 'S': - pch += sprintf(pch, "%02d", GetSeconds()); - break; - case 'N': - pch += sprintf(pch, "%03ld", (long)(_my_time.tv_usec / 1000)); - break; - } - } else { - *pch++ = ch; - } + while ((ch = *pFormat++) != '\0') { + assert(pch < &szBuffer[maxTimeBufferSize]); + if (ch == '%') { + switch (ch = *pFormat++) { + default: + assert(false); // probably a bad format character + case '%': + *pch++ = ch; + break; + case 'D': +#ifdef _WIN32 + pch += sprintf_s(pch, maxTimeBufferSize, "%ld", GetDays()); +#else + pch += snprintf(pch, maxTimeBufferSize, "%ld", GetDays()); +#endif + break; + case 'H': +#ifdef _WIN32 + pch += sprintf_s(pch, maxTimeBufferSize, "%02d", GetHours()); +#else + pch += snprintf(pch, maxTimeBufferSize, "%02d", GetHours()); +#endif + break; + case 'M': +#ifdef _WIN32 + pch += sprintf_s(pch, maxTimeBufferSize, "%02d", GetMinutes()); +#else + pch += snprintf(pch, maxTimeBufferSize, "%02d", GetMinutes()); +#endif + break; + case 'S': +#ifdef _WIN32 + pch += sprintf_s(pch, maxTimeBufferSize, "%02d", GetSeconds()); +#else + pch += snprintf(pch, maxTimeBufferSize, "%02d", GetSeconds()); +#endif + break; + case 'N': +#ifdef _WIN32 + pch += sprintf_s(pch, maxTimeBufferSize, "%03ld", (long)(_my_time.tv_usec / 1000)); +#else + pch += snprintf(pch, maxTimeBufferSize, "%03ld", (long)(_my_time.tv_usec / 1000)); +#endif + break; + } + } else { + *pch++ = ch; } + } - *pch = '\0'; - return std::string(szBuffer); + *pch = '\0'; + return std::string(szBuffer); } #endif //__TIME_SPAN_H__ diff --git a/panda/src/pstatclient/pStatClient.I b/panda/src/pstatclient/pStatClient.I index 5416b31234..8ce9381978 100644 --- a/panda/src/pstatclient/pStatClient.I +++ b/panda/src/pstatclient/pStatClient.I @@ -11,47 +11,6 @@ * @date 2000-07-16 */ -/** - * Sets the name of the client. This is reported to the PStatsServer, and - * will presumably be written in the title bar or something. - */ -INLINE void PStatClient:: -set_client_name(const string &name) { - get_impl()->set_client_name(name); -} - -/** - * Retrieves the name of the client as set. - */ -INLINE string PStatClient:: -get_client_name() const { - return get_impl()->get_client_name(); -} - -/** - * Controls the number of packets that will be sent to the server. Normally, - * one packet is sent per frame, but this can flood the server with more - * packets than it can handle if the frame rate is especially good (e.g. if - * nothing is onscreen at the moment). Set this parameter to a reasonable - * number to prevent this from happening. - * - * This number specifies the maximum number of packets that will be sent to - * the server per second, per thread. - */ -INLINE void PStatClient:: -set_max_rate(double rate) { - get_impl()->set_max_rate(rate); -} - -/** - * Returns the maximum number of packets that will be sent to the server per - * second, per thread. See set_max_rate(). - */ -INLINE double PStatClient:: -get_max_rate() const { - return get_impl()->get_max_rate(); -} - /** * Returns the total number of collectors the Client knows about. */ @@ -111,20 +70,6 @@ get_thread_object(int index) const { return thread->_thread; } -/** - * Returns the time according to to the PStatClient's clock object. It keeps - * its own clock, instead of using the global clock object, so the stats won't - * get mucked up if you put the global clock in non-real-time mode or - * something. - */ -INLINE double PStatClient:: -get_real_time() const { - if (has_impl()) { - return _impl->get_real_time(); - } - return 0.0f; -} - /** * Attempts to establish a connection to the indicated PStatServer. Returns * true if successful, false on failure. @@ -161,36 +106,6 @@ resume_after_pause() { get_global_pstats()->client_resume_after_pause(); } -/** - * The nonstatic implementation of connect(). - */ -INLINE bool PStatClient:: -client_connect(string hostname, int port) { - ReMutexHolder holder(_lock); - client_disconnect(); - return get_impl()->client_connect(hostname, port); -} - -/** - * The nonstatic implementation of is_connected(). - */ -INLINE bool PStatClient:: -client_is_connected() const { - return has_impl() && _impl->client_is_connected(); -} - -/** - * Resumes the PStatClient after the simulation has been paused for a while. - * This allows the stats to continue exactly where it left off, instead of - * leaving a big gap that would represent a chug. - */ -INLINE void PStatClient:: -client_resume_after_pause() { - if (has_impl()) { - _impl->client_resume_after_pause(); - } -} - /** * Returns true if the PStatClientImpl object has been created for this object * yet, false otherwise. @@ -208,9 +123,8 @@ INLINE PStatClientImpl *PStatClient:: get_impl() { ReMutexHolder holder(_lock); if (_impl == (PStatClientImpl *)NULL) { - _impl = new PStatClientImpl(this); + make_impl(); } - return _impl; } @@ -220,7 +134,11 @@ get_impl() { */ INLINE const PStatClientImpl *PStatClient:: get_impl() const { - return ((PStatClient *)this)->get_impl(); + ReMutexHolder holder(_lock); + if (_impl == (PStatClientImpl *)NULL) { + make_impl(); + } + return _impl; } /** diff --git a/panda/src/pstatclient/pStatClient.cxx b/panda/src/pstatclient/pStatClient.cxx index 9d87a13036..906d99a29a 100644 --- a/panda/src/pstatclient/pStatClient.cxx +++ b/panda/src/pstatclient/pStatClient.cxx @@ -104,6 +104,47 @@ PStatClient:: disconnect(); } +/** + * Sets the name of the client. This is reported to the PStatsServer, and + * will presumably be written in the title bar or something. + */ +void PStatClient:: +set_client_name(const string &name) { + get_impl()->set_client_name(name); +} + +/** + * Retrieves the name of the client as set. + */ +string PStatClient:: +get_client_name() const { + return get_impl()->get_client_name(); +} + +/** + * Controls the number of packets that will be sent to the server. Normally, + * one packet is sent per frame, but this can flood the server with more + * packets than it can handle if the frame rate is especially good (e.g. if + * nothing is onscreen at the moment). Set this parameter to a reasonable + * number to prevent this from happening. + * + * This number specifies the maximum number of packets that will be sent to + * the server per second, per thread. + */ +void PStatClient:: +set_max_rate(double rate) { + get_impl()->set_max_rate(rate); +} + +/** + * Returns the maximum number of packets that will be sent to the server per + * second, per thread. See set_max_rate(). + */ +double PStatClient:: +get_max_rate() const { + return get_impl()->get_max_rate(); +} + /** * Returns the nth collector. */ @@ -175,6 +216,20 @@ get_current_thread() const { return PStatThread(Thread::get_current_thread(), (PStatClient *)this); } +/** + * Returns the time according to to the PStatClient's clock object. It keeps + * its own clock, instead of using the global clock object, so the stats won't + * get mucked up if you put the global clock in non-real-time mode or + * something. + */ +double PStatClient:: +get_real_time() const { + if (has_impl()) { + return _impl->get_real_time(); + } + return 0.0f; +} + /** * A convenience function to call new_frame() on the global PStatClient's main * thread, and any other threads with a sync_name of "Main". @@ -383,6 +438,16 @@ client_thread_tick(const string &sync_name) { } } +/** + * The nonstatic implementation of connect(). + */ +bool PStatClient:: +client_connect(string hostname, int port) { + ReMutexHolder holder(_lock); + client_disconnect(); + return get_impl()->client_connect(hostname, port); +} + /** * The nonstatic implementation of disconnect(). */ @@ -416,6 +481,26 @@ client_disconnect() { } } +/** + * The nonstatic implementation of is_connected(). + */ +bool PStatClient:: +client_is_connected() const { + return has_impl() && _impl->client_is_connected(); +} + +/** + * Resumes the PStatClient after the simulation has been paused for a while. + * This allows the stats to continue exactly where it left off, instead of + * leaving a big gap that would represent a chug. + */ +void PStatClient:: +client_resume_after_pause() { + if (has_impl()) { + _impl->client_resume_after_pause(); + } +} + /** * Returns a pointer to the global PStatClient object. It's legal to declare * your own PStatClient locally, but it's also convenient to have a global one @@ -433,6 +518,14 @@ get_global_pstats() { return _global_pstats; } +/** + * Creates the PStatClientImpl class for this PStatClient. + */ +void PStatClient:: +make_impl() const { + _impl = new PStatClientImpl((PStatClient *)this); +} + /** * Returns a PStatCollector suitable for measuring categories with the * indicated name. This is normally called by a PStatCollector constructor. diff --git a/panda/src/pstatclient/pStatClient.h b/panda/src/pstatclient/pStatClient.h index 05d5dbadea..2d285c6f8a 100644 --- a/panda/src/pstatclient/pStatClient.h +++ b/panda/src/pstatclient/pStatClient.h @@ -17,7 +17,6 @@ #include "pandabase.h" #include "pStatFrameData.h" -#include "pStatClientImpl.h" #include "pStatCollectorDef.h" #include "reMutex.h" #include "lightMutex.h" @@ -31,6 +30,7 @@ #include "numeric_types.h" #include "bitArray.h" +class PStatClientImpl; class PStatCollector; class PStatCollectorDef; class PStatThread; @@ -50,16 +50,16 @@ class GraphicsStateGuardian; * is therefore defined as a stub class. */ #ifdef DO_PSTATS -class EXPCL_PANDA_PSTATCLIENT PStatClient : public ConnectionManager, public Thread::PStatsCallback { +class EXPCL_PANDA_PSTATCLIENT PStatClient : public Thread::PStatsCallback { public: PStatClient(); ~PStatClient(); PUBLISHED: - INLINE void set_client_name(const string &name); - INLINE string get_client_name() const; - INLINE void set_max_rate(double rate); - INLINE double get_max_rate() const; + void set_client_name(const string &name); + string get_client_name() const; + void set_max_rate(double rate); + double get_max_rate() const; INLINE int get_num_collectors() const; PStatCollector get_collector(int index) const; @@ -78,7 +78,7 @@ PUBLISHED: PStatThread get_main_thread() const; PStatThread get_current_thread() const; - INLINE double get_real_time() const; + double get_real_time() const; MAKE_PROPERTY(client_name, get_client_name, set_client_name); MAKE_PROPERTY(max_rate, get_max_rate, set_max_rate); @@ -99,11 +99,11 @@ PUBLISHED: void client_main_tick(); void client_thread_tick(const string &sync_name); - INLINE bool client_connect(string hostname, int port); + bool client_connect(string hostname, int port); void client_disconnect(); - INLINE bool client_is_connected() const; + bool client_is_connected() const; - INLINE void client_resume_after_pause(); + void client_resume_after_pause(); static PStatClient *get_global_pstats(); @@ -111,6 +111,7 @@ private: INLINE bool has_impl() const; INLINE PStatClientImpl *get_impl(); INLINE const PStatClientImpl *get_impl() const; + void make_impl() const; PStatCollector make_collector_with_relname(int parent_index, string relname); PStatCollector make_collector_with_name(int parent_index, const string &name); @@ -227,7 +228,7 @@ private: AtomicAdjust::Integer _threads_size; // size of the allocated array AtomicAdjust::Integer _num_threads; // number of in-use elements within the array - PStatClientImpl *_impl; + mutable PStatClientImpl *_impl; static PStatCollector _heap_total_size_pcollector; static PStatCollector _heap_overhead_size_pcollector; diff --git a/panda/src/pstatclient/pStatThread.I b/panda/src/pstatclient/pStatThread.I index fcfa992576..4fd43c5669 100644 --- a/panda/src/pstatclient/pStatThread.I +++ b/panda/src/pstatclient/pStatThread.I @@ -75,32 +75,6 @@ operator = (const PStatThread ©) { _index = copy._index; } -/** - * This must be called at the start of every "frame", whatever a frame may be - * deemed to be, to accumulate all the stats that have collected so far for - * the thread and ship them off to the server. - * - * Calling PStatClient::thread_tick() will automatically call this for any - * threads with the indicated sync name. - */ -INLINE void PStatThread:: -new_frame() { -#ifdef DO_PSTATS - _client->get_impl()->new_frame(_index); -#endif -} - -/** - * This is a slightly lower-level version of new_frame that also specifies the - * data to send for this frame. - */ -INLINE void PStatThread:: -add_frame(const PStatFrameData &frame_data) { -#ifdef DO_PSTATS - _client->get_impl()->add_frame(_index, frame_data); -#endif -} - /** * Returns the index number of this particular thread within the PStatClient. */ diff --git a/panda/src/pstatclient/pStatThread.cxx b/panda/src/pstatclient/pStatThread.cxx index 533fd10789..e263ac089a 100644 --- a/panda/src/pstatclient/pStatThread.cxx +++ b/panda/src/pstatclient/pStatThread.cxx @@ -13,6 +13,33 @@ #include "pStatThread.h" #include "pStatClient.h" +#include "pStatClientImpl.h" + +/** + * This must be called at the start of every "frame", whatever a frame may be + * deemed to be, to accumulate all the stats that have collected so far for + * the thread and ship them off to the server. + * + * Calling PStatClient::thread_tick() will automatically call this for any + * threads with the indicated sync name. + */ +void PStatThread:: +new_frame() { +#ifdef DO_PSTATS + _client->get_impl()->new_frame(_index); +#endif +} + +/** + * This is a slightly lower-level version of new_frame that also specifies the + * data to send for this frame. + */ +void PStatThread:: +add_frame(const PStatFrameData &frame_data) { +#ifdef DO_PSTATS + _client->get_impl()->add_frame(_index, frame_data); +#endif +} /** * Returns the Panda Thread object associated with this particular diff --git a/panda/src/pstatclient/pStatThread.h b/panda/src/pstatclient/pStatThread.h index 23ba20af8e..0ad8567c7a 100644 --- a/panda/src/pstatclient/pStatThread.h +++ b/panda/src/pstatclient/pStatThread.h @@ -36,8 +36,8 @@ PUBLISHED: INLINE PStatThread(const PStatThread ©); INLINE void operator = (const PStatThread ©); - INLINE void new_frame(); - INLINE void add_frame(const PStatFrameData &frame_data); + void new_frame(); + void add_frame(const PStatFrameData &frame_data); Thread *get_thread() const; INLINE int get_index() const; diff --git a/panda/src/putil/bamCacheRecord.cxx b/panda/src/putil/bamCacheRecord.cxx index b13f1807ef..487d2b1e5d 100644 --- a/panda/src/putil/bamCacheRecord.cxx +++ b/panda/src/putil/bamCacheRecord.cxx @@ -232,15 +232,20 @@ format_timestamp(time_t timestamp) { } time_t now = time(NULL); - struct tm *tm_p = localtime(×tamp); + struct tm atm; +#ifdef _WIN32 + localtime_s(&atm, ×tamp); +#else + localtime_r(×tamp, &atm); +#endif if (timestamp > now || (now - timestamp > 86400 * 365)) { // A timestamp in the future, or more than a year in the past, gets a year // appended. - strftime(buffer, buffer_size, "%b %d %Y", tm_p); + strftime(buffer, buffer_size, "%b %d %Y", &atm); } else { // Otherwise, within the past year, show the date and time. - strftime(buffer, buffer_size, "%b %d %H:%M", tm_p); + strftime(buffer, buffer_size, "%b %d %H:%M", &atm); } return buffer; diff --git a/pandatool/src/win-stats/winStats.cxx b/pandatool/src/win-stats/winStats.cxx index 35e58f6367..2ec39a7e83 100644 --- a/pandatool/src/win-stats/winStats.cxx +++ b/pandatool/src/win-stats/winStats.cxx @@ -79,17 +79,7 @@ create_toplevel_window(HINSTANCE application) { return toplevel_window; } - -// WinMain() is the correct way to start a Windows-only application, but it is -// sometimes more convenient during development to use main() instead, which -// doesn't squelch the stderr output. - -#ifndef DEVELOP_WINSTATS -int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) -#else -int main(int argc, char *argv[]) -#endif -{ +int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) { HINSTANCE application = GetModuleHandle(NULL); HWND toplevel_window = create_toplevel_window(application); @@ -128,3 +118,11 @@ int main(int argc, char *argv[]) return (0); } + +// WinMain() is the correct way to start a Windows-only application, but it is +// sometimes more convenient during development to use main() instead, which +// doesn't squelch the stderr output. + +int main(int argc, char *argv[]) { + return WinMain(NULL, NULL, NULL, 0); +} From 2933b8ed3972ff288cb1a10b513241f7838f1f54 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 25 Jun 2016 19:09:47 -0700 Subject: [PATCH 08/53] general: Fix missing includes. --- dtool/src/cppparser/cppEnumType.h | 1 + dtool/src/cppparser/cppScope.cxx | 1 + dtool/src/cppparser/cppTypedefType.cxx | 2 ++ panda/src/gobj/matrixLens.cxx | 1 + panda/src/movies/flacAudioCursor.cxx | 2 ++ panda/src/nativenet/socket_address.I | 2 ++ panda/src/pgraphnodes/sphereLight.h | 1 + 7 files changed, 10 insertions(+) diff --git a/dtool/src/cppparser/cppEnumType.h b/dtool/src/cppparser/cppEnumType.h index c22742203c..a218feead4 100644 --- a/dtool/src/cppparser/cppEnumType.h +++ b/dtool/src/cppparser/cppEnumType.h @@ -16,6 +16,7 @@ #include "dtoolbase.h" +#include "cppBisonDefs.h" #include "cppExtensionType.h" #include diff --git a/dtool/src/cppparser/cppScope.cxx b/dtool/src/cppparser/cppScope.cxx index e61b42f19e..9945a1a72d 100644 --- a/dtool/src/cppparser/cppScope.cxx +++ b/dtool/src/cppparser/cppScope.cxx @@ -18,6 +18,7 @@ #include "cppTypedefType.h" #include "cppTypeDeclaration.h" #include "cppExtensionType.h" +#include "cppEnumType.h" #include "cppInstance.h" #include "cppInstanceIdentifier.h" #include "cppIdentifier.h" diff --git a/dtool/src/cppparser/cppTypedefType.cxx b/dtool/src/cppparser/cppTypedefType.cxx index 7f3443f600..aaede09529 100644 --- a/dtool/src/cppparser/cppTypedefType.cxx +++ b/dtool/src/cppparser/cppTypedefType.cxx @@ -14,6 +14,8 @@ #include "cppTypedefType.h" #include "cppIdentifier.h" #include "cppInstanceIdentifier.h" +#include "cppTemplateScope.h" +#include "indent.h" /** * diff --git a/panda/src/gobj/matrixLens.cxx b/panda/src/gobj/matrixLens.cxx index f501e7c6d4..147870a954 100644 --- a/panda/src/gobj/matrixLens.cxx +++ b/panda/src/gobj/matrixLens.cxx @@ -14,6 +14,7 @@ #include "matrixLens.h" #include "indent.h" #include "bamReader.h" +#include "bamWriter.h" TypeHandle MatrixLens::_type_handle; diff --git a/panda/src/movies/flacAudioCursor.cxx b/panda/src/movies/flacAudioCursor.cxx index 3ea294c7ce..839fc8724c 100644 --- a/panda/src/movies/flacAudioCursor.cxx +++ b/panda/src/movies/flacAudioCursor.cxx @@ -12,7 +12,9 @@ */ #include "flacAudioCursor.h" +#include "flacAudio.h" #include "virtualFileSystem.h" +#include "config_movies.h" #define DR_FLAC_IMPLEMENTATION #define DR_FLAC_NO_STDIO diff --git a/panda/src/nativenet/socket_address.I b/panda/src/nativenet/socket_address.I index cb36122c2a..87213df01d 100644 --- a/panda/src/nativenet/socket_address.I +++ b/panda/src/nativenet/socket_address.I @@ -11,6 +11,8 @@ * @date 2014-10-19 */ +#include "pnotify.h" + /** * Constructor that lets us set a port value */ diff --git a/panda/src/pgraphnodes/sphereLight.h b/panda/src/pgraphnodes/sphereLight.h index da36d71fc2..4e4c885f7c 100644 --- a/panda/src/pgraphnodes/sphereLight.h +++ b/panda/src/pgraphnodes/sphereLight.h @@ -17,6 +17,7 @@ #include "pandabase.h" #include "lightLensNode.h" +#include "pointLight.h" /** * A sphere light is like a point light, except that it represents a sphere From 7dfd907e1733179259cab65a4d579f44c0f55308 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 27 Jun 2016 00:38:14 +0200 Subject: [PATCH 09/53] Try to report red/green/blue bits for Cocoa windows --- .../cocoaGraphicsStateGuardian.mm | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/panda/src/cocoadisplay/cocoaGraphicsStateGuardian.mm b/panda/src/cocoadisplay/cocoaGraphicsStateGuardian.mm index 01e4624015..6856fecbc5 100644 --- a/panda/src/cocoadisplay/cocoaGraphicsStateGuardian.mm +++ b/panda/src/cocoadisplay/cocoaGraphicsStateGuardian.mm @@ -105,6 +105,26 @@ get_properties(FrameBufferProperties &properties, NSOpenGLPixelFormat* pixel_for } //TODO: add aux buffers + // Cocoa doesn't provide individual RGB bits. Make assumptions. + // Note that color_size seems to be returning values like 32, which + // suggests that it contains the alpha size as well. + + if (color_size == 24 || color_size == 32) { + properties.set_rgba_bits(8, 8, 8, alpha_size); + + } else if (color_size == 64) { + properties.set_rgba_bits(16, 16, 16, alpha_size); + + } else if (color_size == 128) { + properties.set_rgba_bits(32, 32, 32, alpha_size); + + } else if (color_size >= 3) { + // Assume it's giving us at least one of each. + properties.set_red_bits(1); + properties.set_green_bits(1); + properties.set_blue_bits(1); + } + // Extract the renderer ID bits and check if our // renderer matches the known software renderers. renderer_id &= kCGLRendererIDMatchingMask; From 46147e9a09fb55d94b4d8bb8aa2e5833bac4f98f Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 27 Jun 2016 01:06:07 +0200 Subject: [PATCH 10/53] Maya 2016.5 on 1.9 branch; fix Maya 2016.5 build on Mac OS X --- doc/ReleaseNotes | 1 + makepanda/makepandacore.py | 1 + pandatool/src/maya/mayaApi.cxx | 5 +++-- pandatool/src/maya/pre_maya_include.h | 8 ++++++-- pandatool/src/mayaprogs/mayaSavePview.h | 8 ++++++-- pandatool/src/mayaprogs/mayapath.cxx | 1 + 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index a4a0b49a02..ec8621329d 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -15,6 +15,7 @@ This issue fixes several bugs that were still found in 1.9.2. * Work around GLSL issue with #pragma and certain Intel drivers * Improve performance of texture load and store operations * Fix crashes with pbuffers on Intel cards on Windows +* Support for Autodesk Maya 2016.5 ------------------------ RELEASE 1.9.2 ------------------------ diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index 205caa896e..1b011188ff 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -80,6 +80,7 @@ MAYAVERSIONINFO = [("MAYA6", "6.0"), ("MAYA2014","2014"), ("MAYA2015","2015"), ("MAYA2016","2016"), + ("MAYA20165","2016.5"), ] MAXVERSIONINFO = [("MAX6", "SOFTWARE\\Autodesk\\3DSMAX\\6.0", "installdir", "maxsdk\\cssdk\\include"), diff --git a/pandatool/src/maya/mayaApi.cxx b/pandatool/src/maya/mayaApi.cxx index 1014b64661..be1c281918 100644 --- a/pandatool/src/maya/mayaApi.cxx +++ b/pandatool/src/maya/mayaApi.cxx @@ -199,9 +199,10 @@ open_api(string program_name, bool view_license, bool revertdir) { size_t dot2 = runtime_version.find('.', dot1 + 1); if (dot2 == string::npos) { - rtver_b = 0; + string_to_int(runtime_version.substr(dot1 + 1), rtver_b); + } else { - string_to_int(runtime_version.substr(dot1, dot2 - dot1), rtver_b); + string_to_int(runtime_version.substr(dot1 + 1, dot2 - dot1 - 1), rtver_b); simple_runtime_version = runtime_version.substr(0, dot2); } } diff --git a/pandatool/src/maya/pre_maya_include.h b/pandatool/src/maya/pre_maya_include.h index 5f6d2f9877..1138e89daa 100644 --- a/pandatool/src/maya/pre_maya_include.h +++ b/pandatool/src/maya/pre_maya_include.h @@ -64,8 +64,12 @@ typedef istream maya_istream; #endif // PHAVE_IOSTREAM #ifdef __MACH__ -#undef _BOOL -#include "maya/OpenMayaMac.h" +#define OSMac_ 1 +// This defines MAYA_API_VERSION +#include +#if MAYA_API_VERSION < 201600 +#include +#endif #endif #endif // MAYA_PRE_5_0 diff --git a/pandatool/src/mayaprogs/mayaSavePview.h b/pandatool/src/mayaprogs/mayaSavePview.h index 5cd8d5dafd..6eeb744bd4 100644 --- a/pandatool/src/mayaprogs/mayaSavePview.h +++ b/pandatool/src/mayaprogs/mayaSavePview.h @@ -26,8 +26,12 @@ #endif #ifdef __MACH__ -#undef _BOOL -#include "maya/OpenMayaMac.h" +#define OSMac_ 1 +// This defines MAYA_API_VERSION +#include +#if MAYA_API_VERSION < 201600 +#include +#endif #endif // Even though we don't include any Panda headers, it's safe to diff --git a/pandatool/src/mayaprogs/mayapath.cxx b/pandatool/src/mayaprogs/mayapath.cxx index dfeb68fc5c..22b854fdc5 100644 --- a/pandatool/src/mayaprogs/mayapath.cxx +++ b/pandatool/src/mayaprogs/mayapath.cxx @@ -102,6 +102,7 @@ struct MayaVerInfo maya_versions[] = { { "MAYA2014", "2014"}, { "MAYA2015", "2015"}, { "MAYA2016", "2016"}, + { "MAYA20165", "2016.5"}, { 0, 0 }, }; From 0846a89677604a7b225b7db2d86779e3549031ba Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 27 Jun 2016 00:06:40 -0700 Subject: [PATCH 11/53] general: Stop using several deprecated pandac.PandaModules imports. --- direct/src/controls/BattleWalker.py | 2 +- direct/src/controls/NonPhysicsWalker.py | 2 +- direct/src/distributed/CartesianGridBase.py | 2 +- direct/src/distributed/ClientRepositoryBase.py | 3 ++- direct/src/distributed/ConnectionRepository.py | 3 ++- direct/src/distributed/DistributedCamera.py | 3 ++- direct/src/distributed/DistributedCameraOV.py | 3 ++- direct/src/distributed/DistributedCartesianGrid.py | 3 ++- direct/src/distributed/DistributedCartesianGridAI.py | 3 ++- direct/src/distributed/DistributedNodeAI.py | 2 +- direct/src/distributed/DistributedObjectGlobalUD.py | 4 ++-- direct/src/distributed/DistributedObjectUD.py | 3 ++- direct/src/distributed/DistributedSmoothNode.py | 3 ++- direct/src/distributed/DoInterestManager.py | 3 ++- direct/src/distributed/GridParent.py | 3 ++- direct/src/distributed/ServerRepository.py | 3 ++- direct/src/distributed/TimeManager.py | 2 +- direct/src/distributed/TimeManagerAI.py | 2 +- direct/src/showbase/ExceptionVarDump.py | 1 + direct/src/showbase/LeakDetectors.py | 2 +- direct/src/showbase/MirrorDemo.py | 2 +- direct/src/showbase/ShadowDemo.py | 2 +- direct/src/showbase/ShadowPlacer.py | 2 +- 23 files changed, 35 insertions(+), 23 deletions(-) diff --git a/direct/src/controls/BattleWalker.py b/direct/src/controls/BattleWalker.py index a26beb4103..104dc3e55b 100755 --- a/direct/src/controls/BattleWalker.py +++ b/direct/src/controls/BattleWalker.py @@ -1,7 +1,7 @@ from direct.showbase.InputStateGlobal import inputState from direct.task.Task import Task -from pandac.PandaModules import * +from panda3d.core import * from . import GravityWalker BattleStrafe = 0 diff --git a/direct/src/controls/NonPhysicsWalker.py b/direct/src/controls/NonPhysicsWalker.py index 02d2edae30..de5a6bfb00 100755 --- a/direct/src/controls/NonPhysicsWalker.py +++ b/direct/src/controls/NonPhysicsWalker.py @@ -19,7 +19,7 @@ from direct.showbase import DirectObject from direct.controls.ControlManager import CollisionHandlerRayStart from direct.showbase.InputStateGlobal import inputState from direct.task.Task import Task -from pandac.PandaModules import * +from panda3d.core import * class NonPhysicsWalker(DirectObject.DirectObject): notify = DirectNotifyGlobal.directNotify.newCategory("NonPhysicsWalker") diff --git a/direct/src/distributed/CartesianGridBase.py b/direct/src/distributed/CartesianGridBase.py index d45fb00292..f5e9d90339 100755 --- a/direct/src/distributed/CartesianGridBase.py +++ b/direct/src/distributed/CartesianGridBase.py @@ -1,4 +1,4 @@ -from pandac.PandaModules import Vec3 +from panda3d.core import Vec3 # Utility functions that are useful to both AI and client CartesianGrid code class CartesianGridBase: diff --git a/direct/src/distributed/ClientRepositoryBase.py b/direct/src/distributed/ClientRepositoryBase.py index 9836f0fd0b..826d3058fd 100644 --- a/direct/src/distributed/ClientRepositoryBase.py +++ b/direct/src/distributed/ClientRepositoryBase.py @@ -1,4 +1,5 @@ -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from .MsgTypes import * from direct.task import Task from direct.directnotify import DirectNotifyGlobal diff --git a/direct/src/distributed/ConnectionRepository.py b/direct/src/distributed/ConnectionRepository.py index deda5ab5c6..105b77a9a9 100644 --- a/direct/src/distributed/ConnectionRepository.py +++ b/direct/src/distributed/ConnectionRepository.py @@ -1,4 +1,5 @@ -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from direct.task import Task from direct.directnotify.DirectNotifyGlobal import directNotify from direct.distributed.DoInterestManager import DoInterestManager diff --git a/direct/src/distributed/DistributedCamera.py b/direct/src/distributed/DistributedCamera.py index 297a24bf98..8c9b076338 100755 --- a/direct/src/distributed/DistributedCamera.py +++ b/direct/src/distributed/DistributedCamera.py @@ -1,4 +1,5 @@ -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from direct.fsm.FSM import FSM from direct.interval.IntervalGlobal import * from direct.distributed.DistributedObject import DistributedObject diff --git a/direct/src/distributed/DistributedCameraOV.py b/direct/src/distributed/DistributedCameraOV.py index 82945de29e..a539b12794 100755 --- a/direct/src/distributed/DistributedCameraOV.py +++ b/direct/src/distributed/DistributedCameraOV.py @@ -1,4 +1,5 @@ -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from direct.distributed.DistributedObjectOV import DistributedObjectOV class DistributedCameraOV(DistributedObjectOV): diff --git a/direct/src/distributed/DistributedCartesianGrid.py b/direct/src/distributed/DistributedCartesianGrid.py index 8c156af9d1..3942f3a154 100755 --- a/direct/src/distributed/DistributedCartesianGrid.py +++ b/direct/src/distributed/DistributedCartesianGrid.py @@ -1,5 +1,6 @@ -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from direct.interval.IntervalGlobal import * from direct.directnotify.DirectNotifyGlobal import directNotify diff --git a/direct/src/distributed/DistributedCartesianGridAI.py b/direct/src/distributed/DistributedCartesianGridAI.py index 3b830b8028..2ad2983aa1 100755 --- a/direct/src/distributed/DistributedCartesianGridAI.py +++ b/direct/src/distributed/DistributedCartesianGridAI.py @@ -1,5 +1,6 @@ -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from direct.directnotify.DirectNotifyGlobal import directNotify from direct.task import Task from .DistributedNodeAI import DistributedNodeAI diff --git a/direct/src/distributed/DistributedNodeAI.py b/direct/src/distributed/DistributedNodeAI.py index 3d30e8d707..f119ee6a93 100644 --- a/direct/src/distributed/DistributedNodeAI.py +++ b/direct/src/distributed/DistributedNodeAI.py @@ -1,4 +1,4 @@ -from pandac.PandaModules import NodePath +from panda3d.core import NodePath from . import DistributedObjectAI from . import GridParent diff --git a/direct/src/distributed/DistributedObjectGlobalUD.py b/direct/src/distributed/DistributedObjectGlobalUD.py index c5be6f012a..b8f84b472e 100755 --- a/direct/src/distributed/DistributedObjectGlobalUD.py +++ b/direct/src/distributed/DistributedObjectGlobalUD.py @@ -35,9 +35,9 @@ class DistributedObjectGlobalUD(DistributedObjectUD): def __execMessage(self, message): if not self.ExecNamespace: # Import some useful variables into the ExecNamespace initially. - import pandac.PandaModules + import panda3d.core - for key, value in pandac.PandaModules.__dict__.items(): + for key, value in panda3d.core.__dict__.items(): if not key.startswith('__'): self.ExecNamespace[key] = value #self.importExecNamespace() diff --git a/direct/src/distributed/DistributedObjectUD.py b/direct/src/distributed/DistributedObjectUD.py index 4309ad7d80..c67d0004cc 100755 --- a/direct/src/distributed/DistributedObjectUD.py +++ b/direct/src/distributed/DistributedObjectUD.py @@ -3,7 +3,8 @@ from direct.directnotify.DirectNotifyGlobal import directNotify from direct.distributed.DistributedObjectBase import DistributedObjectBase from direct.showbase import PythonUtil -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * #from PyDatagram import PyDatagram #from PyDatagramIterator import PyDatagramIterator diff --git a/direct/src/distributed/DistributedSmoothNode.py b/direct/src/distributed/DistributedSmoothNode.py index cdc2dc034e..1d6aef43fb 100644 --- a/direct/src/distributed/DistributedSmoothNode.py +++ b/direct/src/distributed/DistributedSmoothNode.py @@ -1,6 +1,7 @@ """DistributedSmoothNode module: contains the DistributedSmoothNode class""" -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from .ClockDelta import * from . import DistributedNode from . import DistributedSmoothNodeBase diff --git a/direct/src/distributed/DoInterestManager.py b/direct/src/distributed/DoInterestManager.py index a81000a788..eb616d3f26 100755 --- a/direct/src/distributed/DoInterestManager.py +++ b/direct/src/distributed/DoInterestManager.py @@ -7,7 +7,8 @@ zone, remove interest in that zone. p.s. A great deal of this code is just code moved from ClientRepository.py. """ -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from .MsgTypes import * from direct.showbase.PythonUtil import * from direct.showbase import DirectObject diff --git a/direct/src/distributed/GridParent.py b/direct/src/distributed/GridParent.py index 1fc9713897..5d5d47b8e5 100755 --- a/direct/src/distributed/GridParent.py +++ b/direct/src/distributed/GridParent.py @@ -1,5 +1,6 @@ -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * # # GridParent.py diff --git a/direct/src/distributed/ServerRepository.py b/direct/src/distributed/ServerRepository.py index 11cec06ac3..4031998b50 100644 --- a/direct/src/distributed/ServerRepository.py +++ b/direct/src/distributed/ServerRepository.py @@ -1,6 +1,7 @@ """ServerRepository module: contains the ServerRepository class""" -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from direct.distributed.MsgTypesCMU import * from direct.task import Task from direct.directnotify import DirectNotifyGlobal diff --git a/direct/src/distributed/TimeManager.py b/direct/src/distributed/TimeManager.py index f74a97300b..714abd7f7d 100644 --- a/direct/src/distributed/TimeManager.py +++ b/direct/src/distributed/TimeManager.py @@ -1,5 +1,5 @@ from direct.showbase.DirectObject import * -from pandac.PandaModules import * +from panda3d.core import * from direct.task import Task from direct.distributed import DistributedObject from direct.directnotify import DirectNotifyGlobal diff --git a/direct/src/distributed/TimeManagerAI.py b/direct/src/distributed/TimeManagerAI.py index c912394326..2e235523ce 100644 --- a/direct/src/distributed/TimeManagerAI.py +++ b/direct/src/distributed/TimeManagerAI.py @@ -1,5 +1,5 @@ from direct.distributed.ClockDelta import * -from pandac.PandaModules import * +from panda3d.core import * from direct.distributed import DistributedObjectAI class TimeManagerAI(DistributedObjectAI.DistributedObjectAI): diff --git a/direct/src/showbase/ExceptionVarDump.py b/direct/src/showbase/ExceptionVarDump.py index 82060a7d24..42aca9b7c9 100755 --- a/direct/src/showbase/ExceptionVarDump.py +++ b/direct/src/showbase/ExceptionVarDump.py @@ -1,5 +1,6 @@ __all__ = ["install"] +from panda3d.core import * from direct.directnotify.DirectNotifyGlobal import directNotify from direct.showbase.PythonUtil import fastRepr import sys diff --git a/direct/src/showbase/LeakDetectors.py b/direct/src/showbase/LeakDetectors.py index 1124d1301d..38d45d225b 100755 --- a/direct/src/showbase/LeakDetectors.py +++ b/direct/src/showbase/LeakDetectors.py @@ -1,6 +1,6 @@ # objects that report different types of leaks to the ContainerLeakDetector -from pandac.PandaModules import * +from panda3d.core import * from direct.showbase.DirectObject import DirectObject from direct.showbase.Job import Job import gc, sys diff --git a/direct/src/showbase/MirrorDemo.py b/direct/src/showbase/MirrorDemo.py index f72142b634..e2a77dbf82 100755 --- a/direct/src/showbase/MirrorDemo.py +++ b/direct/src/showbase/MirrorDemo.py @@ -23,7 +23,7 @@ surface are possible, like a funhouse mirror. However, the reflection itself is always basically planar; for more accurate convex reflections, you will need to use a sphere map or a cube map.""" -from pandac.PandaModules import * +from panda3d.core import * from direct.task import Task def setupMirror(name, width, height, rootCamera = None): diff --git a/direct/src/showbase/ShadowDemo.py b/direct/src/showbase/ShadowDemo.py index b7fff5e596..78f9d33dd0 100755 --- a/direct/src/showbase/ShadowDemo.py +++ b/direct/src/showbase/ShadowDemo.py @@ -14,7 +14,7 @@ multitexture rendering techniques. It's not a particularly great way to do shadows. """ -from pandac.PandaModules import * +from panda3d.core import * from direct.task import Task sc = None diff --git a/direct/src/showbase/ShadowPlacer.py b/direct/src/showbase/ShadowPlacer.py index b0563d007c..80826926f7 100755 --- a/direct/src/showbase/ShadowPlacer.py +++ b/direct/src/showbase/ShadowPlacer.py @@ -12,7 +12,7 @@ the its parent node. from direct.controls.ControlManager import CollisionHandlerRayStart from direct.directnotify import DirectNotifyGlobal -from pandac.PandaModules import * +from panda3d.core import * from . import DirectObject class ShadowPlacer(DirectObject.DirectObject): From 7eb7ffbb024c110b321b0a202e758969015366fa Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 28 Jun 2016 02:57:50 +0200 Subject: [PATCH 12/53] Update .gitignore, add core dumps --- .gitignore | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index fe2e883a65..e198328787 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,9 @@ -/built_x64 -/built -/thirdparty -/targetroot +/built*/ +/thirdparty/ +/targetroot/ +/dstroot/ +core +core.* +vgcore.* +*.save +*.save.1 From 99f7fb6fcd84db0c8c7ea209ec49dbf087da4812 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 28 Jun 2016 02:58:06 +0200 Subject: [PATCH 13/53] Show error instead of crash when using method or property before C++ object is constructed --- doc/ReleaseNotes | 1 + dtool/src/interrogatedb/py_panda.cxx | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index ec8621329d..3a02861ab3 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -10,6 +10,7 @@ This issue fixes several bugs that were still found in 1.9.2. * Fix loading old models with MovingPart * Improve performance of CPU vertex animation somewhat * Show framebuffer properties when fbprop request fails +* Show error instead of crash on use of object before __init__ * Fix hang on exit when using Python task on threaded task chain * Fix inability to get RGBA renderbuffer in certain cases * Work around GLSL issue with #pragma and certain Intel drivers diff --git a/dtool/src/interrogatedb/py_panda.cxx b/dtool/src/interrogatedb/py_panda.cxx index 02666e0fb0..ed81825bd8 100644 --- a/dtool/src/interrogatedb/py_panda.cxx +++ b/dtool/src/interrogatedb/py_panda.cxx @@ -70,7 +70,7 @@ void DTOOL_Call_ExtractThisPointerForType(PyObject *self, Dtool_PyTypedObject *c // wrong type, raises an AttributeError. //////////////////////////////////////////////////////////////////// bool Dtool_Call_ExtractThisPointer(PyObject *self, Dtool_PyTypedObject &classdef, void **answer) { - if (self == NULL || !DtoolCanThisBeAPandaInstance(self)) { + if (self == NULL || !DtoolCanThisBeAPandaInstance(self) || ((Dtool_PyInstDef *)self)->_ptr_to_object == NULL) { Dtool_Raise_TypeError("C++ object is not yet constructed, or already destructed."); return false; } @@ -93,7 +93,7 @@ bool Dtool_Call_ExtractThisPointer(PyObject *self, Dtool_PyTypedObject &classdef bool Dtool_Call_ExtractThisPointer_NonConst(PyObject *self, Dtool_PyTypedObject &classdef, void **answer, const char *method_name) { - if (self == NULL || !DtoolCanThisBeAPandaInstance(self)) { + if (self == NULL || !DtoolCanThisBeAPandaInstance(self) || ((Dtool_PyInstDef *)self)->_ptr_to_object == NULL) { Dtool_Raise_TypeError("C++ object is not yet constructed, or already destructed."); return false; } From 7e20626915c50b044589a27e1ae088f4071816f5 Mon Sep 17 00:00:00 2001 From: Michael Wass Date: Tue, 28 Jun 2016 12:15:00 -0400 Subject: [PATCH 14/53] Fix a TypeError in direct.fsm.FSM --- direct/src/fsm/FSM.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/direct/src/fsm/FSM.py b/direct/src/fsm/FSM.py index 577c1232b7..3aa583f007 100644 --- a/direct/src/fsm/FSM.py +++ b/direct/src/fsm/FSM.py @@ -149,7 +149,7 @@ class FSM(DirectObject): def __init__(self, name): self.fsmLock = RLock() - self.name = name + self._name = name self.stateArray = [] self._serialNum = FSM.SerialNum FSM.SerialNum += 1 @@ -185,7 +185,7 @@ class FSM(DirectObject): # the messenger on every state change. The new and old states are # accessible as self.oldState and self.newState, and the transition # functions will already have been called. - return 'FSM-%s-%s-stateChange' % (self._serialNum, self.name) + return 'FSM-%s-%s-stateChange' % (self._serialNum, self._name) def getCurrentFilter(self): if not self.state: @@ -240,7 +240,7 @@ class FSM(DirectObject): try: assert isinstance(request, str) self.notify.debug("%s.forceTransition(%s, %s" % ( - self.name, request, str(args)[1:])) + self._name, request, str(args)[1:])) if not self.state: # Queue up the request. @@ -268,7 +268,7 @@ class FSM(DirectObject): try: assert isinstance(request, str) self.notify.debug("%s.demand(%s, %s" % ( - self.name, request, str(args)[1:])) + self._name, request, str(args)[1:])) if not self.state: # Queue up the request. self.__requestQueue.append(PythonUtil.Functor( @@ -307,7 +307,7 @@ class FSM(DirectObject): try: assert isinstance(request, str) self.notify.debug("%s.request(%s, %s" % ( - self.name, request, str(args)[1:])) + self._name, request, str(args)[1:])) filter = self.getCurrentFilter() result = filter(request, args) @@ -385,7 +385,7 @@ class FSM(DirectObject): # In either case, we quietly ignore unhandled command # (lowercase) requests. - assert self.notify.debug("%s ignoring request %s from state %s." % (self.name, request, self.state)) + assert self.notify.debug("%s ignoring request %s from state %s." % (self._name, request, self.state)) return None def filterOff(self, request, args): @@ -444,7 +444,7 @@ class FSM(DirectObject): # Internal function to change unconditionally to the indicated # state. assert self.state - assert self.notify.debug("%s to state %s." % (self.name, newState)) + assert self.notify.debug("%s to state %s." % (self._name, newState)) self.oldState = self.state self.newState = newState @@ -476,7 +476,7 @@ class FSM(DirectObject): if self.__requestQueue: request = self.__requestQueue.pop(0) - assert self.notify.debug("%s continued queued request." % (self.name)) + assert self.notify.debug("%s continued queued request." % (self._name)) request() def __callEnterFunc(self, name, *args): @@ -525,9 +525,9 @@ class FSM(DirectObject): try: className = self.__class__.__name__ if self.state: - str = ('%s FSM:%s in state "%s"' % (className, self.name, self.state)) + str = ('%s FSM:%s in state "%s"' % (className, self._name, self.state)) else: - str = ('%s FSM:%s in transition from \'%s\' to \'%s\'' % (className, self.name, self.oldState, self.newState)) + str = ('%s FSM:%s in transition from \'%s\' to \'%s\'' % (className, self._name, self.oldState, self.newState)) return str finally: self.fsmLock.release() From 54819dbcde1c1e4f31f205a51f97b51eaa7f0795 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 28 Jun 2016 19:11:58 +0200 Subject: [PATCH 15/53] Fix crash when using TextGraphic in texts --- panda/src/text/textAssembler.cxx | 42 +++++++++++++++++--------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/panda/src/text/textAssembler.cxx b/panda/src/text/textAssembler.cxx index 996713a85a..933712c531 100644 --- a/panda/src/text/textAssembler.cxx +++ b/panda/src/text/textAssembler.cxx @@ -544,32 +544,34 @@ assemble_text() { } } - if (properties->has_shadow()) { + if (!placement._glyph.is_null()) { + if (properties->has_shadow()) { + if (_dynamic_merge) { + if (placement._glyph->has_quad()) { + placement.assign_quad_to(quad_shadow_map, shadow_state, shadow); + } else { + placement.assign_append_to(geom_shadow_collector_map, shadow_state, shadow); + } + } else { + placement.assign_to(shadow_geom_node, shadow_state, shadow); + } + + // Don't shadow the graphics. That can result in duplication of button + // objects, plus it looks weird. If you want a shadowed graphic, you + // can shadow it yourself before you add it. + // placement.copy_graphic_to(shadow_node, shadow_state, shadow); + any_shadow = true; + } + if (_dynamic_merge) { if (placement._glyph->has_quad()) { - placement.assign_quad_to(quad_shadow_map, shadow_state, shadow); + placement.assign_quad_to(quad_map, text_state); } else { - placement.assign_append_to(geom_shadow_collector_map, shadow_state, shadow); + placement.assign_append_to(geom_collector_map, text_state); } } else { - placement.assign_to(shadow_geom_node, shadow_state, shadow); + placement.assign_to(text_geom_node, text_state); } - - // Don't shadow the graphics. That can result in duplication of button - // objects, plus it looks weird. If you want a shadowed graphic, you - // can shadow it yourself before you add it. - // placement.copy_graphic_to(shadow_node, shadow_state, shadow); - any_shadow = true; - } - - if (_dynamic_merge) { - if (placement._glyph->has_quad()) { - placement.assign_quad_to(quad_map, text_state); - } else { - placement.assign_append_to(geom_collector_map, text_state); - } - } else { - placement.assign_to(text_geom_node, text_state); } placement.copy_graphic_to(text_node, text_state); } From 1b33fec978047c483659686e2bd2cd02b93bc08c Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 28 Jun 2016 21:35:09 +0200 Subject: [PATCH 16/53] Remove assertion when reregistering the same AudioManager constructor --- panda/src/audio/audioManager.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/audio/audioManager.cxx b/panda/src/audio/audioManager.cxx index d7eb0846fe..8dd52a8786 100644 --- a/panda/src/audio/audioManager.cxx +++ b/panda/src/audio/audioManager.cxx @@ -40,7 +40,7 @@ Create_AudioManager_proc *AudioManager::_create_AudioManager = NULL; void AudioManager:: register_AudioManager_creator(Create_AudioManager_proc* proc) { - nassertv(_create_AudioManager == NULL); + nassertv(_create_AudioManager == NULL || _create_AudioManager == proc); _create_AudioManager = proc; } From a906f34eee6fa573017efa15d6f9c21937bb25cc Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 28 Jun 2016 22:13:33 +0200 Subject: [PATCH 17/53] M_alpha now no longer squares the alpha component it writes to the framebuffer. To re-enable the old behaviour, set old-alpha-blend in Config.prc. --- panda/src/display/config_display.cxx | 9 +++++++++ panda/src/display/config_display.h | 1 + panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx | 9 ++++++++- panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 13 +++++++++++-- panda/src/tinydisplay/zbuffer.h | 15 +++++++++------ 5 files changed, 38 insertions(+), 9 deletions(-) diff --git a/panda/src/display/config_display.cxx b/panda/src/display/config_display.cxx index 0b46da0252..391a7e8676 100644 --- a/panda/src/display/config_display.cxx +++ b/panda/src/display/config_display.cxx @@ -298,6 +298,15 @@ ConfigVariableBool allow_incomplete_render "geometry is always paged in immediately when needed, holding up " "the frame render if necessary.")); +ConfigVariableBool old_alpha_blend +("old-alpha-blend", false, + PRC_DESC("Set this to true to enable the old alpha blending behavior from " + "Panda 1.9 in which the alpha value written out to the framebuffer " + "is squared. The new behavior is more intuitive when compositing " + "an semitransparent image produced using render-to-texture. You " + "should generally leave this false unless you have an effect that " + "relies on the old behavior, or you suspect an implementation bug.")); + ConfigVariableInt win_size ("win-size", "800 600", PRC_DESC("This is the default size at which to open a new window. This " diff --git a/panda/src/display/config_display.h b/panda/src/display/config_display.h index 1196389f5a..0b76e06472 100644 --- a/panda/src/display/config_display.h +++ b/panda/src/display/config_display.h @@ -68,6 +68,7 @@ extern EXPCL_PANDA_DISPLAY ConfigVariableBool default_stereo_camera; extern EXPCL_PANDA_DISPLAY ConfigVariableBool color_scale_via_lighting; extern EXPCL_PANDA_DISPLAY ConfigVariableBool alpha_scale_via_texture; extern EXPCL_PANDA_DISPLAY ConfigVariableBool allow_incomplete_render; +extern EXPCL_PANDA_DISPLAY ConfigVariableBool old_alpha_blend; extern EXPCL_PANDA_DISPLAY ConfigVariableInt win_size; extern EXPCL_PANDA_DISPLAY ConfigVariableInt win_origin; diff --git a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx index 43bf6d3311..03b5e8b6cb 100644 --- a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx +++ b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx @@ -3798,7 +3798,14 @@ do_issue_blending() { case TransparencyAttrib::M_multisample_mask: case TransparencyAttrib::M_dual: set_render_state(D3DRS_ALPHABLENDENABLE, TRUE); - set_render_state(D3DRS_SEPARATEALPHABLENDENABLE, FALSE); + if (old_alpha_blend) { + set_render_state(D3DRS_SEPARATEALPHABLENDENABLE, FALSE); + } else { + set_render_state(D3DRS_SEPARATEALPHABLENDENABLE, TRUE); + set_render_state(D3DRS_BLENDOPALPHA, D3DBLENDOP_ADD); + set_render_state(D3DRS_SRCBLENDALPHA, D3DBLEND_ONE); + set_render_state(D3DRS_DESTBLENDALPHA, D3DBLEND_INVSRCALPHA); + } set_render_state(D3DRS_BLENDOP, D3DBLENDOP_ADD); set_render_state(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); set_render_state(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index f078ce0d8b..bba123ea92 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -7120,11 +7120,20 @@ do_issue_blending() { enable_multisample_alpha_mask(false); enable_blend(true); _glBlendEquation(GL_FUNC_ADD); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + if (old_alpha_blend) { + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + } else { + _glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + } if (GLCAT.is_spam()) { GLCAT.spam() << "glBlendEquation(GL_FUNC_ADD)\n"; - GLCAT.spam() << "glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)\n"; + if (_supports_blend_equation_separate && !old_alpha_blend) { + GLCAT.spam() << "glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA)\n"; + } else { + GLCAT.spam() << "glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)\n"; + } } return; diff --git a/panda/src/tinydisplay/zbuffer.h b/panda/src/tinydisplay/zbuffer.h index 46190ef4e6..ced08b5e31 100644 --- a/panda/src/tinydisplay/zbuffer.h +++ b/panda/src/tinydisplay/zbuffer.h @@ -107,23 +107,26 @@ typedef unsigned int PIXEL; #define PCOMPONENT_BLEND(c1, c2, a2) \ ((((unsigned int)(c1) * ((unsigned int)0xffff - (unsigned int)(a2)) + (unsigned int)(c2) * (unsigned int)(a2))) >> 16) -#define _BLEND_RGB(r1, g1, b1, r2, g2, b2, a2) \ +#define PALPHA_BLEND(a1, a2) \ + ((((unsigned int)(a1) * ((unsigned int)0xffff - (unsigned int)(a2))) >> 16) + (unsigned int)(a2)) + +#define _BLEND_RGB(r1, g1, b1, a1, r2, g2, b2, a2) \ RGBA_TO_PIXEL(PCOMPONENT_BLEND(r1, r2, a2), \ PCOMPONENT_BLEND(g1, g2, a2), \ PCOMPONENT_BLEND(b1, b2, a2), \ - a2) + PALPHA_BLEND(a1, a2)) -#define _BLEND_SRGB(r1, g1, b1, r2, g2, b2, a2) \ +#define _BLEND_SRGB(r1, g1, b1, a1, r2, g2, b2, a2) \ SRGBA_TO_PIXEL(PCOMPONENT_BLEND(r1, r2, a2), \ PCOMPONENT_BLEND(g1, g2, a2), \ PCOMPONENT_BLEND(b1, b2, a2), \ - a2) + PALPHA_BLEND(a1, a2)) #define PIXEL_BLEND_RGB(rgb, r, g, b, a) \ - _BLEND_RGB(PIXEL_R(rgb), PIXEL_G(rgb), PIXEL_B(rgb), r, g, b, a) + _BLEND_RGB(PIXEL_R(rgb), PIXEL_G(rgb), PIXEL_B(rgb), PIXEL_A(rgb), r, g, b, a) #define PIXEL_BLEND_SRGB(rgb, r, g, b, a) \ - _BLEND_SRGB(PIXEL_SR(rgb), PIXEL_SG(rgb), PIXEL_SB(rgb), r, g, b, a) + _BLEND_SRGB(PIXEL_SR(rgb), PIXEL_SG(rgb), PIXEL_SB(rgb), PIXEL_A(rgb), r, g, b, a) typedef struct { From b3bb19180e4d96863f2ebd070b287f1b5507e178 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 29 Jun 2016 19:08:05 +0200 Subject: [PATCH 18/53] Fix LNK4217 linker warnings on Windows --- dtool/src/interrogatedb/extension.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtool/src/interrogatedb/extension.h b/dtool/src/interrogatedb/extension.h index 878c997f86..dd995081c1 100644 --- a/dtool/src/interrogatedb/extension.h +++ b/dtool/src/interrogatedb/extension.h @@ -31,7 +31,7 @@ public: * extended should create a specialization of this class template. */ template -class EXPCL_INTERROGATEDB Extension : public ExtensionBase { +class Extension : public ExtensionBase { }; /** From 5dcaac9c750ff841bc7c63f44887e1e5201c46bc Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 3 Jul 2016 09:17:43 +0200 Subject: [PATCH 19/53] 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 20/53] 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 21/53] 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 22/53] 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 23/53] 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 24/53] 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 25/53] 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 26/53] 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 27/53] 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 28/53] 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 29/53] 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 30/53] 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 31/53] 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 32/53] 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 33/53] 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 34/53] 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 35/53] 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 36/53] 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 37/53] 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 38/53] 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 39/53] 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 40/53] 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 41/53] 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 42/53] 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 43/53] 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 44/53] 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 45/53] 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 46/53] 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 47/53] 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 48/53] 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 49/53] 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 50/53] 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 51/53] 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 52/53] 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 53/53] 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);