From 463c9e4189a86679ff6d9d2d57cdafadcf9281ce Mon Sep 17 00:00:00 2001 From: "J. Daniel Smith" Date: Mon, 6 Feb 2023 14:35:07 -0500 Subject: [PATCH] latest from coda-oss (#531) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * latest from coda-oss * Squashed 'externals/coda-oss/' changes from 67d6362bcf..d06dc6534d d06dc6534d mem::AutoPtr for C++17 (#615) 83443602a6 mem::AutoPtr class to aid C++17 transition (#614) f10fa2009c Release 2022-11-04 (#613) a32e697044 remove exception specifications (#609) 084f19126a utilities to find files/directories for unittests (#608) a3cedada96 Merge branch 'master' fde6c864fa Merge pull request #607 from mdaus/bugfix/change-order-of-config-header-install c8a0044010 Install the cmake-configured header after installing the xercesc source tree. Otherwise, the original config will persist in the install dda2c9acda Merge pull request #606 from mdaus/fix-xerces-config 004a00f09b Bump zlib version for conan builds 207f4dbb9f Fix Xerces config issue and install its config.h b842417671 Add support for debug optimizations. 0f6cda57dc Use enhanced debug information with gcc/gdb. 5047dce1a9 Work around GCC avx support bug. 001ab18751 Rebuild the waf self-extractor with a fix for the FIPS error. 5a7f64fca2 Revert "Rebuild the waf self-extractor with a fix for the FIPS problem." 9f6f775f8f Rebuild the waf self-extractor with a fix for the FIPS problem. af7229bd83 utilities to find files from a build (#605) 264ae49dd7 be sure downstream projects build w/C++14 (#604) 7a7b13cbd5 "hello world" for HDF5 (#602) 33cff0ff43 more C++14 963e8ff40c Revert "add HDF5 source code (#603)" 7b5e71a006 add HDF5 source code (#603) ec7bb2e520 add HDF5 source code (#603) ec26f703e7 build in NITRO and SIX (#601) f4361a9730 make it easier to write cli unit-tests (#600) 34b6fdeee1 tweak toString() to reduce specialization (#599) 5907b3ed60 remove C++11 workarounds (#598) caed59480d Release 2022-08-30_cpp14 (#597) 2630d41e08 get rid of merge conflict 652bce3854 Merge branch 'master' 6f41c09d71 Release 2022-08-30 (#596) 838c323d6a Merge branch 'master' f916680126 Added handler accessor to MinidomParser for inheriting modules (#594) 72d29e9c27 get unittests working when "nested" in other projects (#595) f8f18fea5f Actually look at unit test results when using waf (#593) 4189c429e8 Merge branch 'master' cda679ceee more overloads to take a string length (#592) b95a32bc4c by default, Uri()s aren't validated (#591) 903ee7ffff Merge branch 'master' 173930a6f2 fix a UTF-8 conversion bug (#590) a1c0a1eea6 Merge branch 'master' c5c221a832 CODA code inherits from xml.lite classes :-( (#589) 1bfe5fc402 Merge branch 'master' a4c6294c30 use EncodedStringView instead of _bstr_t (#588) 6c2df8bb62 "main" is now C++14 (not C++20) 2ce4161080 Squashed commit of the following: 3a0f7fd14d Merge branch 'master' 83c982f0cf remove work-arounds to write non-UTF-8 XML (#586) 142fd7185e Merge branch 'master' ebf6db1762 is part of C++20 d3aa8aa5ce std::u8string is in C++20, not C++17 03654933c4 changes to math.linear from coda (#587) d442e5be0f Merge branch 'master' 5a2f8e52f1 release 2022-08-02 (#585) e5516aba29 tweak names to match utf8:: conventions (#584) 32f08a9e40 Squashed commit of the following: ee15ba3172 Merge branch 'master' 3083ec7915 move most platform-specific code to EncodedStringView (#583) bede753547 fix unit-test with C++20 61a8033f62 consistent use of coda_oss:: and std:: 5d3bf9eb83 Merge branch 'master' 36371410c0 EncodedString tweaks for XML processing (#582) cf2016205c remove any vestiges of Expat and libXML (#580) 33538aa0fc update for newer Intel compiler ed65e4ccc5 Add two patch candidates to fix FIPS problems in waf. 34c40bd397 Merge branch 'master' a731ebf8e8 release 2022-06-29 (#579) a9b9d2a9fa Merge branch 'master' 59387bd87b update "ReleaseNotes.md" for recent changes (#578) 24a3f01afe Merge branch 'master' e4f940854a remove "boost" and "serialize" (#577) 80b70537e9 update to zlib-1.2.12 (#576) f92811a53b Merge branch 'master' 202084bacb Remove some compiler warnings (#575) 414c25c551 build with C++20 in VS 1a99a29da3 Merge branch 'master' c61232224b build most code with Visual Studio (#574) 5cca863d7e Merge branch 'master' 6e4d952bea some unit-tests need argc/argv (#573) 36e051d7b6 Add run1D method to GenerationThreadPool (#572) 6d4776235e Merge branch 'master' 0a08b8e4e9 build "coda-oss-lite" as a VS2022 project (#571) 6677cc38e3 simplify creation of encodes string (#570) ba62c610c1 Add the 'universal_newlines=True' flag to python Popen calls. 984e4a96ce Fix a bug in waf platform detection. 8f1173f4a6 fix build errors f21af35b0b Merge branch 'master' d2aca8d4b5 release 2022-05-03 (#569) ff55fed596 can't replace all TEST_ASSERT macros with functions (#568) 4db8ada411 restore changes clobbered with merge from "master" a1f36e1839 Merge branch 'master' 89a636a6af fix copy/assignment in EncodedString (#567) c3fe91d424 latest tweaks to build with C++17 (#566) a59a51b571 be sure we use a 64-bit time_t (#565) 1f79fb3ddf Poly2D::atY() bugfix (#564) ac5307662d Testing to see if windows-2019 works with github actions (#563) 8d0726b37e Fix a bug in waf platform detection. 80fe8e9f8a Merge branch 'master' c662b5aac3 Update ReleaseNotes.md ef4a3bbd9a Release 2022-02-22 (aka 2/22/22) (#562) 33b0f3f6eb Merge branch 'master' 8bd0c8cf4a Merge branch 'main' of github.com:mdaus/coda-oss 0a0e6cf145 use char16_t on Linux (#560) 7e41b4b5e4 Merge branch 'feature/use-cpp11-code' fe65bfddfb fix units for ICC, sys::filesystem (#559) fc99e4b3e6 recreate from "master" 510317c07a use std::filesystem to "implement" sys::filesystem 895f6c77cd always implement sys::filesystem 0d83ae22fc "units" changes from master b58173b781 latest from "master" (not quite) 793e3442c8 Squashed commit of the following: 91a729f5a2 re-create from "master" def979170b update to GSL 4.0.0 (#558) fe365e5a41 fix XML validation for UTF-8 (#557) 502e5829b8 support conversion to std::wstring (#556) e69422596a Delete codeql-analysis.yml 45bc6a9640 Create codeql-analysis.yml 87d9a7ef54 remove CodeQL eab5ecb899 Update build_unittest.yml 8ab12d47e9 Delete codeql-analysis.yml 9e542092b8 try running CodeQL as part of build-linux-cmake de0c50651e Create codeql-analysis.yml 049608782b tweaks to build in "coda" (#554) 0ba24233b9 replace sys::U8string with coda_oss::u8string (#553) bcee6551f2 add EncodedString class (#552) c2eecd3925 simplify implementation of EncodedStringView (#551) c1320ef00d fix 'typename' for other compilers (#550) ac3b93931f tweaks to make "main" build easier (#549) 78da741cf5 remove sys/Optional.h (#548) f31730ac77 put our std work-arounds in one place (#547) 9b7bb571a9 Add an EncodedStringView class (#545) c0e1da5201 another batch of tweaks to cleanup compiler warnings, etc. (#546) 0f3bfd9d05 added missing "virtual", support unique_ptr (#544) ca32f99c03 Add option to specify curl installation location. (#501) 2df9c1a819 allow std::filesystem::path to be used for validation (#543) 2891435760 add SinCos for units::Angle (#542) e430eddefb Delete log4j as 1) it's old, 2) coda-oss doesn't use it, and 3) remove any questions about security vulnerability (#541) bb11134fd0 xml.lite tweaks (#540) 955b33e215 Release 2021_12_13 (#539) d73d74d5c1 xml.lite tweaks (#537) 3a90e25c6f use more C++11 functionality (#538) 9ca2a0e50c remove more compiler warnings (#536) 0ec9da1e91 be sure == and != are in-sync (#535) 9084be32c4 fix size_t compiler warnings (#534) abd6469ec8 fix ICC errors (#533) 09cb36fff4 update version number before cutting a new release (#532) c29e4d2988 fix ICC warnings/errors from high-side (#531) 91f8f1c089 simplify our std:: implementations (#530) 7c633c7bb5 Further reduce use of std::auto_ptr (#529) d85883749c Provide support for creating simple version numbers (#528) b035825929 Merge pull request #527 from mdaus/fix-crypt-h-clash ffed3d6339 Disable encryption support in minizip build and remove crypt.h header ee2b2bf8c0 Merge pull request #525 from mdaus/swig-fix 3c02ff2893 Fix config-python prefix issue 6149053d4e Add new config-python module for SWIG compatibility workarounds 30acf5b9af mt::transform_async(), mem::SharedPtr, math::SinCos() (#526) 21efd6a6c9 Implement better workaround for lack of SWIG support for "final" 60837a62ea Revert unneeded changes 0bc994dea7 Fix SWIG path issue for waf build 070f4e9150 Update SWIG generated files f8472b0c46 Fix SWIG path issues and warnings e10707f758 Set minimum SWIG version to 4.0.1 b8cdba5c75 Fix waf SWIG build issue 2bd0ee39e5 Enable SWIG in Github waf build f2b001146f Try fixing SWIG compile issue again afafabcc28 Fix SWIG compile issue on Linux due to missing macro 7c8d4a81d5 Add SWIG to the CI flow 4023d721c5 Regenerate SWIG bindings 1d8c70109c Add some compile definitions needed by SWIG for CMake build e5cc58545f Remove some functions which return unique_ptr from SWIG bindings (incompatible). 965a2913dd Remove "final" specifier from structs bound in SWIG (incompatible) f1bec56014 Merge branch 'master' of https://github.com/mdaus/coda-oss c01c4d7de5 do in-line initialization (#524) fb7230ea1e Update CMakeLists.txt 5dfb056898 tweaks for C++17 (#523) 1a7d3ab522 Merge pull request #515 from mdaus/security-and-conan-updates d13885df66 make it easier to create a new Element with the right encoding (#522) 3fb09e73ab Merge pull request #359 from mdaus/parseArgUpdate 0d546a8f1b Tweak some ArgumentParser tests for the ignoreUnknownArguments option 14bd1f26d4 Merge remote-tracking branch 'origin/master' into parseArgUpdate cf398c0d36 tweak code for C++11/C++17 (#521) 2d0322b070 reduce use of std::auto_ptr (#520) 853320e90f reduce use of deprecated C++98 code (#519) 4752ba2221 Replace some warning pragmas with macros 32685554ff Merge remote-tracking branch 'origin/master' into security-and-conan-updates f0350c0cfd Merge pull request #518 from mdaus/bugfix/python3.9-related fc01df0d8c fix typos in gcc macros 9d356f36cd fix gcc impl 8124da763f remove unreachable code d034b3a849 clobber warnings from numpy innards 9941a401e1 macros to disable warnings around system headers 8a725bb8f3 Merge pull request #516 from mdaus/mbraswell-enablecpp17-windows 2e7b8165ae Fixed pragma stuff on gcc 9775bb02d9 Fixed pragma stuff on gcc 680d3cce41 Merge branch 'master' of https://github.com/mdaus/coda-oss 8ffd6ed790 forgot to add "units" to CMakeFiles.txt 06835676e5 Remove Auto_ptr flag and make disable warnings cross_platform compatible d62efece56 Merge branch 'master' of https://github.com/mdaus/coda-oss into mbraswell-enablecpp17-windows d04042ee9a Merge pull request #517 from mdaus/develop/compiler-warning-helpers cf5cd16b33 Fix macro usage on gcc a88bbcd202 Macros to narrowly target disabling warnings c0d5cdf004 Formatting Changes be019b44b2 Formatting Changes 2eb04dc9e7 Fixed compiler warnings and added option to compile cpp17 with waf on windows 5d9f27faeb Refactor coda-oss conan recipe ce66457149 Disable warning for MSVC2017 and earlier ecfefbfbec Merge remote-tracking branch 'origin/master' into security-and-conan-updates 8b1479881d Merge pull request #514 from mdaus/develop/fix-unused-symbol-errors 1d9a4ec712 Add conan option to use std::regex instead of pcre 6dd5d44576 add required include 4c0ae77811 add required include 1873ceeb8a parameterize build (somewhat) c9ef567a7a fix Release compile error e6b47e94ee fix compiler error eff205ba2d helper macro to fix unusual targets 342098a32c Fix CMake build for modules without include files 5625706ebf Enable cpp17 option for windows builds 98e12b138e Use consistent line endings for *.in template files d01fea0b73 Configure coda_add_module to install more file extension types 30823f673b Delete stray file ac7760ba22 Load dependency targets when loading coda-oss for conan build 14781cab8e Implement conan build for openjpeg and pcre2 dependencies 9d955efa53 Exclude unsupported XML backend wrappers from CMake build to remove warnings 1e8c9b2643 Merge remote-tracking branch 'origin/master' into security-and-conan-updates 772d804951 Implement conan build for libjpeg dependency 98b653dea4 Implement conan build for xerces-c dependency 11323e8e98 Implement conan build for zlib dependency d0e6bf2c4b Improve conan test_package a03e1294e1 Fix uninitialized member variable warning in mt::AbstractTiedThreadPool c7bb47b5f8 Remove member variable duplicated in derived class io::ToggleOutputStream 0838ac2ca2 Use consistent line endings for conan recipes and CMake files. 2768e5f07e Update libjpeg to v9d d75f55bcac Update zlib to 1.2.11 ca2f84cff3 Fix warning in GSL for MSVC 2015 and earlier 1babd19b55 Fix warning in thread tests for MSVC 2f17632496 Fix warning in except module for Visual Studio 2015 and earlier a485bf6bb1 Fix BIGENDIAN redefinition warning 59543e42b2 Disable warning in dbi for MSVC 2017 and earlier b4b212834b Fix warnings in numpyutils for MSVC 2017 and earlier 2b179b6587 Fix integer overflow issue 898151ad75 Hook up simple "units" (#513) 4d6beeecc5 Merge pull request #511 from mdaus/develop/horizontal-improved-numerical-precision c1878b228e Fix for numerical precision issues surrounding horizontal lines 7d1442c66c Merge pull request #510 from mbraswell/fix-testnumelements-build 58fc85f096 Whitespace change to trigger workflow ab74026b9f Fix wscript to successfully build test_num_elements 323283cd78 Merge pull request #509 from mbraswell/develop-mbraswell-cpp17 16a5502896 Added option to enable cpp17 b0625cf5a2 tweak debug stuff (#508) 8455494878 fix RowCol casting (#507) 01fbb5f008 Get std::u8string working right with C++20 (#506) df9413efae more "noexcept" for fewer code-analysis diagnostics (#505) e6219f97f9 reduce compiler warnings/code-analysis diagnostics (#504) 4c9ea0ef18 tweaks for VS2019 16.10 (#503) 0d8ea070a5 reduce compiler warnings (#502) 625b8b59d4 reduce compiler warnings (#500) 3795758da0 get rid of more compiler warnings/code-analysis diagnostics (#499) 427f91be85 reduce compiler-warnings and code-analysis diagnostics (#498) c82dd9e370 cleanup compiler and code-analysis diagnistics (#496) b5105b54ae reduce compiler warnings (#495) e0099cc269 Develop/compiler optimizations (#494) 0eeb3f9638 tweaks to python wrappers made in "nitro" (#492) 5f91f70604 fix printf() format string (#491) 55b855a865 Delete codeql-analysis.yml 603c192d3b Update codeql-analysis.yml f306979e87 Update codeql-analysis.yml 4a1f78f8ef Create codeql-analysis.yml 3c80a65680 add back coda_oss::filesystem::path (#490) eaea659ed3 tweak how std:: features are exposed (#489) 0492f0d95f simplify code exposing std:: routines (#488) e5f3d77701 remove code-analysis diagnostics (#485) 5be599e5af make HOME and USERPROFILE the same (#484) 62b22ae019 cleanup more compiler warnings (#483) c32ec7dcc1 add unit-tests for env-var editing (#482) 311aea4623 allow an environment-variable to be "edited" during expansion (#481) bbcab13103 static_assert is C++11, don't use it when checking for C++11 (#480) 068562f589 fix glitches in expandEnviromentVariables() (#479) 30ed1d95e2 produce a new Path::expandEnviromentVariables() function (#478) 074a873b28 remove compiler warnings (#477) e29f65479f latest C++17 tweaks (#476) c4e681b0ae tweak code when wchar_t is a built-in type (#474) 8449ac29a4 wchar_t might not be a built-in type on old systems (#473) a62bdb3e64 add operator= to sys::Optional (#472) 8e310a776d use compiler-provided macros to determine features (#470) 88405c8edb "constexpr" can be hard to get right with older compilers; don't even try (#471) b195ab3efc need at least VS2017 to use the real GSL (#469) 2978f9114f tweaks to build with older compilers (#468) 7235b898d3 The (old) version of SWIG we're using doesn't like certain C++11 features. (#464) cccde7f126 only look in the Win1252->UTF-8 map as a last resort (#467) 3db09742c1 get rid of more compiler warnings (#465) 5e0d2e8451 get rid of "char8_t" compiler warning (#463) d710bc6882 make getValue() easier to use (#462) f5a9284768 make getElement*() be consistent for both 0 and >1 (#461) 88be6dba35 consistently add C++14/17/20 library features (#459) 59c3a7e2ef use coda_oss:: as a drop-in replacement for std:: (#458) 35de4524c4 use sys::Filesystem::path rather than std::string (#457) cace666005 make sys::Filesystem::path better conform to std::filesystem::path (#456) f395edc891 remove ambiguous overloads w/C++17 (#455) eac4371f19 use newly added sys::Optional<> to manage "encoding" (#454) 243ef5e500 don't derive from std::iterator (#453) a48b011411 Arguments should be "const&" to prevent C4866 (#452) 878bff901f provide std::span (#451) 81727c4854 remove newly added a new pure virtual as that's a breaking change (#450) 93cf0f03ef main -> master (#449) 5af37a7363 be sure code compiles with C++17 (#448) 82b5aecfb5 build with C++17 (#407) 6ffb888d79 reduce compiler warnings (#439) 9137dda7dc GSL (Guideline Support Library) from https://github.com/Microsoft/GSL (#423) bc5552cd20 update to xerces-c-3.2.3 (#409) 6fe09e1dbb update to openjpeg-2.3.1 (#417) 6405c0ce59 reduce differences in #407 (#438) 2987bbf8d6 tweak how std::filesystem is enabled (#437) 8fd3c2f202 tweak how std::endian is enabled (#436) 138372c886 more straight-forward reduction of std::auto_ptr (#435) f13c7cec89 straight-forward reduction of std::auto_ptr (#434) d243b08e1b add mem::auto_ptr for transition to C++17 (#432) 54ed52158e allow clients to specify custom toType and toString (#431) 7f90aab25e remove trailing underscore from macro (#429) 999e490686 with C++11, several sys typedefs are the same on both Windows & *nix (#427) 6f075b1be5 add sys::Byte (#426) 92221bd0d9 allow except::Throwable to derive from std::exception (#421) a8f52d0ad4 reduce compiler warnings (#424) 63ea20af69 #including w/C++17 generates warnings (#408) 10ef060313 reduce compiler warnings (#405) cf233fdcfd forgot Conf.cpp changes for sys::Endian (#403) cc53b18537 fix several compiler warnings/code-analysis diagnostics (#404) 1db3751a3c implmeent sys::Endian from C++20 (#402) f042cd6bb9 support std::filesystem if desired (#400) 4895a9f2dc WIN32 is old, but existing code might still use it; _WIN32 is better (#398) e2a62f8ec2 make it easier to use xml.lite (#396) 1059b7da1c allow for explicit use of a UTF-8 string (#395) 27de8b8a44 Optionally record how std::string is encoded when manipulating XML (#378) e0018cea75 implement some -like routines until we can use C++17 (#388) cafb2365b7 Merge pull request #363 from mdaus/feature/fix-compiler-warnings 6a78bec201 use the existing sys::ubyte rather than making our own pre-C++17 std::byte 14c9fc4ca4 fix a couple of G++ compiler warnings via static_cast<> e596a60070 std::numeric_limits::epsilon() can be "constexpr" 78b0f6bb26 another try at removing the compiler warning from tiff::split() 8e1de21e17 fixed typo; added a few nots about why we're not using strncpy() fed3ba8cdb retore previous tiff::split() code as the change got rid of the compiler warning but wasn't portable 98a589616d get rid of g++ strncpy() warning 798f847117 don't use memset(0) with C++ objects 7f697d078c casting result of system() to void doesn't get rid of compiler warning d55a849c51 remove new g++ compiler warnings in WSL d0aaa29884 Merge pull request #361 from mdaus/feature/fix-compiler-warnings cc62e866b0 fix compiler warnings d45c1f9a09 Updates based on peer review comments which include changing ostream to pointer, adding a couple of more tests, and updating all auto_ptr to unique_ptr in unit test. fb12ba1266 Update ArgumentParser to use a stream as an argument if the ignore unknown argument flag is set to true. 536d2b0cad Added ability to ignore unknown arguments in the ArgumentParser. 27288f49bb Merge pull request #358 from mdaus/conan-options fd5e1eecb7 Expose additional CMake options in conan recipe c972161793 Remove unneeded CMake function git-subtree-dir: externals/coda-oss git-subtree-split: d06dc6534d713ecce71db9986d8db3bb5f7a213f * Squashed 'externals/coda-oss/' changes from d06dc6534d..8241dfe7e6 8241dfe7e6 remove last vestiges of std::auto_ptr (#616) git-subtree-dir: externals/coda-oss git-subtree-split: 8241dfe7e68d566d9b7ca1ccf572279f41cf6848 * Squashed 'externals/coda-oss/' changes from 8241dfe7e6..ab45464820 ab45464820 remove C++17 workarounds (#618) 3d5daf702e unittests for creating XML from scratch (#617) git-subtree-dir: externals/coda-oss git-subtree-split: ab454648207b2923020bea7614a49def65f1108f * copy_externals.csh utility script * latest from coda-oss * Squashed 'externals/coda-oss/' changes from ab45464820..61aa5e4303 61aa5e4303 Squashed commit of the following: 6557ee34cd Yet another attempt at finding test files for unittests (#621) 501add035a -march=native for fastest optimization level (#620) f1dd0a5b4f overloads to make creating XML documents easier (#619) git-subtree-dir: externals/coda-oss git-subtree-split: 61aa5e430345711abf61b4f46a67df88fe6c465d * Squashed 'externals/coda-oss/' changes from 61aa5e430..566597043 566597043 Conan versioning, hdf5, and pcre2 fixes (#622) git-subtree-dir: externals/coda-oss git-subtree-split: 56659704390d9cd8a19931676454f498b245e027 * remove .git/ right away * latest from coda-oss * Squashed 'externals/coda-oss/' changes from 566597043..59d2f678e 59d2f678e Release 2022-12-14 (#628) 1e8244291 new --with-optz=fastest-possible option (#627) 6ae81142d new --optz=faster option for WAF builds (#626) 11206c179 sym-links don't work on Windows filesystems edd3e8fb9 overloads to make simplify routine XML processing (#625) dfece6106 use sym-links rather than copying files (#624) 22f1f0776 build hdf5.lite with WAF (#623) git-subtree-dir: externals/coda-oss git-subtree-split: 59d2f678e3035988a90dcc2887c3870417104904 * trying to fix build error on github * latest from coda-oss * Squashed 'externals/coda-oss/' changes from 59d2f678e..c53304a90 c53304a90 using std::auto_ptr can cause 'deprecated' warnings 418130d4d trying to fix build error on github git-subtree-dir: externals/coda-oss git-subtree-split: c53304a907986d7e59cbc3848c9a9523cba0e721 * latest from coda-oss * Squashed 'externals/coda-oss/' changes from c53304a90..1384b8a5e 1384b8a5e Merge pull request #629 from mdaus/zlib-update ebbd57247 ZIP APIs use std::string in this branch 9cc19fe82 ZIP unittests b8d25d364 Update zlib to 1.2.13 git-subtree-dir: externals/coda-oss git-subtree-split: 1384b8a5e260c4a7418904508b1ab671950d8e45 * copy_externals * Squashed 'externals/coda-oss/' changes from 1384b8a5e..1582c6ac9 1582c6ac9 further progress on implementing hdf5::lite (#631) 0622af1fe rename "11" exception classes to "Ex" (#630) git-subtree-dir: externals/coda-oss git-subtree-split: 1582c6ac9e9f26ee4dbaa7018e6c98ab92ca88ec * remove eXecute bit from CPP files * Squashed 'externals/coda-oss/' changes from 1582c6ac9..986307c9c 986307c9c Merge branch 'master' e1b0fa349 commit (but not build) HDF5 source code (#634) 3fd5ddae5 Merge branch 'main' into develop/remove-cpp11-workarounds 37d7ec76e restore C++14 workarounds for older compilers (#632) 244dfdb3d Merge branch 'develop/main' into develop/remove-cpp11-workarounds 714ca4ed7 restore C++14 workarounds for older compilers 640f2247c Delete hdf5-hdf5-1_13_2.tar.gz eb365cbfb Merge branch 'master' into develop/remove-cpp11-workarounds 57b938eeb don't need __INTEL_COMPILER work-around with C++14 65779f3b1 build C code with -std=gnu99 94dc9280f C++14 work-arounds for an old version of the Intel compiler 3744d05e2 slam-in "main" 82b2fd63b restore some C++14 work-arounds for old compilers that only have partial C++14 support 94f6950a2 Merge branch 'main' into develop/remove-cpp11-workarounds 1ac97fe48 add HDF5 source code (not built) (#612) 8ab982820 Squashed commit of the following: 31781a14a remove C++17 work-arounds c15f6930c Revert " is in C++17" 0fe38c16f restore recent buld.py changes 0c75411ee is in C++17 bbbcd562a remove C++11 work-arounds c1e15e9d9 Merge branch 'main' into main-cpp17 bea818fb0 must use C++17 in this branch 91653a096 another place where C++17 is set 7d555f2be back to C++17 b1969d996 merge main 0792c77bf Merge branch 'main' into develop/remove-cpp11-workarounds e49f273c1 Merge branch 'main' into develop/remove-cpp11-workarounds 240b61044 allow sys::Mutex references, instead of pointers, to be passed to sys::ConditionVar 9500d6f4b Merge branch 'main' into develop/remove-cpp11-workarounds f1529942f std::make_unique instead of new be9b6a71c Squashed commit of the following: 62a2ec4e1 Revert "remove our GSL work-around for C++11" 1db082c21 Revert "try the current "main" of GSL" 44b70edde try the current "main" of GSL 4edbf6bad Revert ""There is no warning 4814"" bcd7458be "There is no warning 4814" c185bf3f1 starting working on MutexCpp11 313bdd1d9 AtomicCounter* files have been removed c1c448051 remove our GSL work-around for C++11 37ae1193e remove our mem::SharedPtr, it's now always std::shared_ptr 71f3c1299 remove no-longer-used NSPR code 8e77cb210 removed no-longer-used Irix and Solaris files fabef6966 use std::atomic for all AtomicCounter implementations ace5b6d5a TEST_FAIL -> TEST_FAIL_MSG 30076c1d1 turns out there was already a TEST_FAIL macro d73ee16fb need "::" to find global test ba01c48df remove C++11 workarounds for C++14 features cbd4a31ae Squashed commit of the following: b21c203b8 Squashed commit of the following: 5b542c60f Squashed commit of the following: cb0cf94ff ByteStream.cpp is now warning-free f5daa37fc cast to DWORD; "const" correctness bfaf644ff #pragma-away compiler warnings from standard headers 72d202dbe Merge branch 'master' into develop/reduce-compiler-warnings b076580cd trying to fix GCC compiler warning 1687dc7fc Merge branch 'master' into develop/reduce-compiler-warnings 2c5db86db Merge branch 'master' into develop/reduce-compiler-warnings 6f76c2e3e Update CMakeLists.txt c3ca4a538 do in-line initialization 8e6733618 remove G++ compiler warning a0eff51cf Merge branch 'master' into develop/reduce-compiler-warnings af19d88a6 Merge branch 'master' into develop/reduce-compiler-warnings ba31cbaa9 use "void*" to avoid reinterpret_cast<> 08da1f8a1 Merge branch 'master' into develop/reduce-compiler-warnings d1d453a2e Merge branch 'master' into develop/reduce-compiler-warnings f5074a996 CODA_OSS_NDEBUG is extra gunk and not used; omit for now. 22de48858 don't even bother compiling our own versions of localtime_s() and gmtime_s() if we're not going to use them (compiler warning about "unused static funtion.") 0c92eba58 tweak NDEBUG/CODA_OSS_NDEBUG; update comments 544604775 Don't need to expose our own versions of localtime_s() and gmtime_s() a050796c1 Merge branch 'develop/reduce-compiler-warnings' of github.com:mdaus/coda-oss into develop/reduce-compiler-warnings fed604617 older compilers want std::string() as argument to std::logic_error() cf2c502a6 do more debug & release builds on GitHub d4aa99256 build some debug targets on Gitlab 368245258 tweak CODA_OSS_DEBUG again for G++ 24ba64f71 tweak how CODA_OSS_DEBUG is set 9680e8f0e add check for _GLIBCXX_DEBUG 943218f83 Merge branch 'master' into develop/reduce-compiler-warnings 01c68e705 %#@*@%)*%@ fix RowCol::cast() again! :-( b8472b457 oops ... gsl::narrow<> should be gsl::narrow_cast<> so that int/double conversion doesn't throw 109255ca8 "final" breaks SWIG; wrap RowCol use of gsl::narrow e51e4c2ad no need to create local just to return e546f2510 Merge branch 'master' into develop/reduce-compiler-warnings d1391f989 use template for to_std_string() overloading 566942680 fix std::char8_t when building with C++20 cf604b1ab fix C++17 build errors 48a0fbedb get rid of coda_oss namespace; use CODA_OSS_cpp17 instead 9706a4336 remove code-analysis diagnostics 50592e4f8 G++ complains about an unneeded call to std::move() 9c7643c3f Merge branch 'master' into develop/reduce-compiler-warnings ecfe1f8a7 more "noexcept" b7ac50fb9 Merge branch 'master' into develop/reduce-compiler-warnings eaecf46ed tweak CODA_OSS_cplusplus from "main" 5773b1ec1 trying to get C++17 WAF build working on Windows a048a00a1 unique names for waf & CMake 7a5a0d5b2 do a better job of setting CODA_OSS_DEBUG 4355aae92 Merge branch 'master' into develop/reduce-compiler-warnings 1fd8cede2 cleanup for VS 2019 16.10 4dffa1394 explicitly =delete copy/assignment df8f8920a Merge branch 'master' into develop/reduce-compiler-warnings 42b4e99b6 remove code-analysis diagnostics 70ce322c9 reduce compiler warnings/code-analysis diagnostics when building six 20eac2f49 Merge branch 'master' into develop/reduce-compiler-warnings ff3ded56d get rid of more compiler warnings/code-analysis diagnostics 669dd51ff Merge branch 'master' into develop/reduce-compiler-warnings 623b65ab9 Merge branch 'master' into develop/reduce-compiler-warnings 11c75df53 fix release build errors 66f048b92 turn on more compiler warnings where possible eb615e315 consolidate calls to mem::make::unique a6f5eb690 reduce use of explicit new 84d5e1b01 use mem::make::unique instead of explicit new 019d726ea = default for default constructors 86ab5d8f3 use std::unique_ptr and "const noexcept" b071972d7 another batch of =default for default constructors 98276da94 more =default for default .ctor()s ceb7bc596 do default constructors with =default 7bed51750 more code-analysis cleanup f9c04b117 "noexcept" code-analysis warnings 6586ae390 need gsl::make_span from gsl/span_ext 722089774 remove gsl/mem dependency cycle d741a0761 use gsl::narrow<> instead of static_cast 99eb4b36e get rid of signed/unsigned mismatch compiler warning 814450522 remove more code-analysis diagnostics c8441b309 Merge branch 'master' into develop/reduce-compiler-warnings e6d70a9ff last of "const" from code-analysis b8445814a mark a few more things as "const" per code-analysis d18544ec7 don't need to create temporary std::strings ee7faa979 still more code-analysis cleanup 5cd6f864d cleanup more code-analysis diagnostics 492fb0a86 one more compiler warning about implicitly deleted copy/assignment b8f782c88 remove compiler warnings about implicitly deleted copy/assignment/move 14d1d1cb8 #pragma-away warnings from GSL 86c40ea6c assert() to prevent some code-analysis diagnostics 7204517a9 make copy/assignment explicit 3ce824079 reduce code-analysis diagnostics 01e367a56 Merge branch 'master' into develop/reduce-compiler-warnings 03f3ddde9 proper printf format 877d7dc93 Merge branch 'master' into develop/reduce-compiler-warnings 5a4a3d575 code-analysis doesn't like C-style casts a3fdae416 code-analysis doesn't like NULL 6309baedc Merge branch 'master' into develop/reduce-compiler-warnings d1194a2fe Merge branch 'master' into develop/reduce-compiler-warnings 535b4757d Merge branch 'develop/reduce-compiler-warnings' of github.com:mdaus/coda-oss into develop/reduce-compiler-warnings a60b95d60 "constexpr" can be hard to get right with older C++11 compilers; don't even try c07b5303e Merge branch 'master' into develop/reduce-compiler-warnings 04306bbee need at least VS2017 to use the real GSL 796ad820b Merge branch 'master' into develop/reduce-compiler-warnings 16c240cd6 Merge branch 'master' into develop/reduce-compiler-warnings e07e89f0c turn on "warnings as errors" for CMAKE builds 5c019f891 complex "constexpr" functions not available with our version of g++ 4ab074a58 fix a few more compiler warnings ... nearing the end! :-) dea7ea41b And still more compiler warnings ... almost done 🤞🏻 fbe3bbb20 remove assorted compiler warnings e60b7fd3c Merge branch 'master' into develop/reduce-compiler-warnings e9df212c6 Arguments should be "const&" to prevent C4866 94e75cbed Merge branch 'master' into develop/reduce-compiler-warnings d3130414a Merge branch 'master' into develop/reduce-compiler-warnings 9a5e71f31 Merge branch 'master' into develop/reduce-compiler-warnings bd27c0232 Merge branch 'master' into develop/reduce-compiler-warnings c053362d2 remove still more compiler warnings 9f133b85a remove some more compiler warnings 0883c729c Merge branch 'master' into develop/reduce-compiler-warnings f4b766880 avoid comparision between signed/unsigned to prevent compiler warning 1e6564a6e eliminate more compiler warnings 85a7b8ad0 remove a few compiler warnings 09c82049f Merge branch 'master' into develop/reduce-compiler-warnings 31f1662fa Merge branch 'master' into develop/reduce-compiler-warnings a313562a3 Merge branch 'feature/fix-compiler-warnings' into develop/reduce-compiler-warnings 8547cdd24 eliminiate GCC warnings from Filesystem.h b5044b2a2 fix several compiler warnings/code-analysis diagnostics 9d2f90b8c GetEnvironmentVariable() and getenv() aren't quite the same 6faa3666f remove more compiler warnings git-subtree-dir: externals/coda-oss git-subtree-split: 986307c9c05f6b341e78245d220115fabe5b2fdb * latest from coda-oss * Squashed 'externals/coda-oss/' changes from 986307c9c..b44709a95 b44709a95 added ComplexSpansView utility (#635) git-subtree-dir: externals/coda-oss git-subtree-split: b44709a950f710ff790aae6f9f8eb9f6ec6b0df8 * latest from coda-oss * Squashed 'externals/coda-oss/' changes from b44709a95..e460970a7 e460970a7 increase GCC warnings (#640) 91284249b provide ComplexView iterator support (#639) 453b7ec68 try to get std::make_unique working with old Intel compiler (#638) 5736cfd4d is_trivially_copyable for old Intel compiler (#637) 7c2aea38f use H5 SDK naming conventions (#636) fc3008b8d use 'modern' C pre-processor git-subtree-dir: externals/coda-oss git-subtree-split: e460970a7c5b3e6a51b0c74dcabeb70fbf4f0f59 * latest from coda-oss * Squashed 'externals/coda-oss/' changes from e460970a7..b04ccca17 b04ccca17 remove more C++11 work-arounds (#641) git-subtree-dir: externals/coda-oss git-subtree-split: b04ccca17493e538130c350208da59be42eb6bc7 * --depth 1 for git-clone * latest from coda-oss * Squashed 'externals/coda-oss/' changes from b04ccca17..9cfe9a4a8 9cfe9a4a8 Merge branch 'master' e989b0910 createElement() needs to be virtual (#646) 4bdaf10d9 Change xml lite function to virtual (#645) d17b57a54 Merge branch 'master' fa00a5430 move debug -g flags to be turned on only if debugging (#644) 6be8f0a2e move debug -g flags to be turned on only if debugging (#644) 44ab72854 routines for simple writing to HDF5 files (#643) aabc5818e remove more C++11 work-arounds (#642) git-subtree-dir: externals/coda-oss git-subtree-split: 9cfe9a4a8b92e982a5afce3938219dc3dc38bcc2 * changes from SIX * latest from coda-oss * Squashed 'externals/coda-oss/' changes from 9cfe9a4a8..b9ea37bbf b9ea37bbf xml::lite::Validator can be moved (#648) git-subtree-dir: externals/coda-oss git-subtree-split: b9ea37bbf3fce6f09a8e1b4bb2deb6abb57ca075 --- copy_externals.csh | 2 +- externals/coda-oss/.gitignore | 6 +- externals/coda-oss/build/build.py | 27 ++-- .../c++/coda_oss/include/coda_oss/CPlusPlus.h | 10 -- .../c++/coda_oss/include/coda_oss/optional_.h | 30 ++--- .../coda_oss/include/coda_oss/type_traits.h | 14 --- .../c++/except/include/except/Backtrace.h | 1 + .../c++/hdf5.lite/include/hdf5/lite/Read.h | 9 +- .../c++/hdf5.lite/include/hdf5/lite/SpanRC.h | 115 ++++++++++++++++++ .../c++/hdf5.lite/include/hdf5/lite/Write.h | 80 ++++++++++++ .../modules/c++/hdf5.lite/source/Read.cpp | 17 +-- .../modules/c++/hdf5.lite/source/Write.cpp | 115 ++++++++++++++++++ .../modules/c++/hdf5.lite/source/hdf5.lite.h | 7 ++ .../hdf5.lite/unittests/test_hdf5write.cpp | 93 ++++++++++++++ .../c++/str/include/str/EncodedStringView.h | 4 +- .../xml.lite/include/xml/lite/Attributes.h | 5 +- .../c++/xml.lite/include/xml/lite/Document.h | 2 +- .../include/xml/lite/ValidatorXerces.h | 4 +- .../xml.lite/unittests/test_soapelements.cpp | 65 ++++++++++ .../xml.lite/unittests/test_xmlattribute.cpp | 4 +- .../xml.lite/unittests/test_xmlelement.cpp | 4 +- modules/c++/cpp.h | 3 + modules/c++/nitf/include/nitf/Object.hpp | 3 +- modules/c++/pch.h | 2 + 24 files changed, 539 insertions(+), 83 deletions(-) create mode 100644 externals/coda-oss/modules/c++/hdf5.lite/include/hdf5/lite/SpanRC.h create mode 100644 externals/coda-oss/modules/c++/hdf5.lite/include/hdf5/lite/Write.h create mode 100644 externals/coda-oss/modules/c++/hdf5.lite/source/Write.cpp create mode 100644 externals/coda-oss/modules/c++/hdf5.lite/unittests/test_hdf5write.cpp create mode 100644 externals/coda-oss/modules/c++/xml.lite/unittests/test_soapelements.cpp diff --git a/copy_externals.csh b/copy_externals.csh index 0f5b0fd28..1674c143d 100755 --- a/copy_externals.csh +++ b/copy_externals.csh @@ -1,7 +1,7 @@ #!/bin/csh -f rm -r -f tmp && mkdir tmp && cd tmp -git clone -b main git@github.com:mdaus/coda-oss.git +git clone --depth 1 -b main git@github.com:mdaus/coda-oss.git rm -r -f coda-oss/.git cd .. diff --git a/externals/coda-oss/.gitignore b/externals/coda-oss/.gitignore index e1ff9db15..7489cb720 100644 --- a/externals/coda-oss/.gitignore +++ b/externals/coda-oss/.gitignore @@ -2,8 +2,8 @@ *~ *.pyc __pycache__/ -# Build artifacts +# Build artifacts install/ install-*/ target/ @@ -20,6 +20,7 @@ CMakeFiles/ Makefile modules/**/Makefile out/ +CMakeSettings.json # Waf .waf-* @@ -51,4 +52,5 @@ project.sln **/x64/ *.vcxproj.user -CMakeSettings.json +# Unit-tests +TEST_*_TMP.* diff --git a/externals/coda-oss/build/build.py b/externals/coda-oss/build/build.py index 847e0e8fd..516a0ee9b 100644 --- a/externals/coda-oss/build/build.py +++ b/externals/coda-oss/build/build.py @@ -891,12 +891,6 @@ def configureCompilerOptions(self): # If you want the plugins to not depend on Intel libraries, # configure with: # --with-cflags=-static-intel --with-cxxflags=-static-intel --with-linkflags=-static-intel - if cxxCompiler == 'gcc': - config['cxx']['debug'] = '-ggdb3' - config['cxx']['optz_debug'] = '-Og' - elif cxxCompiler == 'icpc': - config['cxx']['debug'] = '-g' - config['cxx']['optz_debug'] = '' if cxxCompiler == 'g++' or cxxCompiler == 'icpc': config['cxx']['warn'] = warningFlags.split() config['cxx']['verbose'] = '-v' @@ -931,12 +925,21 @@ def configureCompilerOptions(self): self.env.append_value('LINKFLAGS', linkFlags.split()) - if ccCompiler == 'gcc': - config['cc']['debug'] = '-ggdb3' - config['cc']['optz_debug'] = '-Og' - elif ccCompiler == 'icc': - config['cc']['debug'] = '-g' - config['cc']['optz_debug'] = '' + if Options.options.debugging: + if cxxCompiler == 'g++': + config['cxx']['debug'] = '-ggdb3' + config['cxx']['optz_debug'] = '-Og' + elif cxxCompiler == 'icpc': + config['cxx']['debug'] = '-g' + config['cxx']['optz_debug'] = '' + + if ccCompiler == 'gcc': + config['cc']['debug'] = '-ggdb3' + config['cc']['optz_debug'] = '-Og' + elif ccCompiler == 'icc': + config['cc']['debug'] = '-g' + config['cc']['optz_debug'] = '' + if ccCompiler == 'gcc' or ccCompiler == 'icc': config['cc']['warn'] = warningFlags.split() config['cc']['verbose'] = '-v' diff --git a/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/CPlusPlus.h b/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/CPlusPlus.h index 388cb8fd5..f28d64236 100644 --- a/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/CPlusPlus.h +++ b/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/CPlusPlus.h @@ -53,16 +53,6 @@ #endif // __INTEL_COMPILER #endif // CODA_OSS_cplusplus -#if CODA_OSS_cplusplus < 201402L - // oops ... try to fix - #if defined(__INTEL_COMPILER) && (__INTEL_COMPILER_BUILD_DATE >= 20151021) - // __cplusplus is 201300, not 201402L - // Enough C++14, at least with our std/ work-arounds - #undef CODA_OSS_cplusplus - #define CODA_OSS_cplusplus 201402L - #endif -#endif // CODA_OSS_cplusplus - #if CODA_OSS_cplusplus < 202002L // oops ... try to fix #if defined(__GNUC__) && (__cplusplus >= 201709L) // note > C++ 17 of 201703L diff --git a/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/optional_.h b/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/optional_.h index 9ce2bf2ef..c321b5b70 100644 --- a/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/optional_.h +++ b/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/optional_.h @@ -63,27 +63,21 @@ class optional final using value_type = T; #if defined(_MSC_VER) && _PREFAST_ // Visual Studio /analyze - __pragma(warning(push)) __pragma(warning( - disable : 26495)) // Variable '...' is uninitialized. Always - // initialize a member variable(type.6). + __pragma(warning(push)) __pragma(warning(disable : 26495)) // Variable '...' is uninitialized. Always initialize a member variable(type.6). #endif - optional() noexcept + optional() noexcept { } #if defined(_MSC_VER) && _PREFAST_ __pragma(warning(pop)) #endif - optional(const value_type& v) : - value_(v), has_value_(true) + optional(const value_type& v) : value_(v), has_value_(true) { } #if defined(_MSC_VER) && _PREFAST_ // Visual Studio /analyze - __pragma(warning(push)) __pragma(warning( - disable : 26495)) // Variable '...' is uninitialized. Always - // initialize a member variable(type.6). + __pragma(warning(push)) __pragma(warning(disable : 26495)) // Variable '...' is uninitialized. Always initialize a member variable(type.6). #endif - optional(const optional& other) : - has_value_(other.has_value_) + optional(const optional& other) : has_value_(other.has_value_) { if (has_value()) { @@ -94,18 +88,15 @@ class optional final __pragma(warning(pop)) #endif - template < - typename... Args> // https://en.cppreference.com/w/cpp/utility/Optional/emplace - T& emplace(Args&&... args) + template // https://en.cppreference.com/w/cpp/utility/Optional/emplace + T& emplace(Args&&... args) { value_ = value_type(std::forward(args)...); has_value_ = true; return value_; } - template < - typename U = - T> // https://en.cppreference.com/w/cpp/utility/optional/operator%3D + template // https://en.cppreference.com/w/cpp/utility/optional/operator%3D optional& operator=(U&& value) noexcept { value_ = std::forward(value); @@ -163,11 +154,10 @@ class optional final // contains a value!" } - const T& operator*() const& + const T& operator*() const& noexcept { assert(has_value()); - return value_; // "This operator does not check whether the optional - // contains a value!" + return value_; // "This operator does not check whether the optional contains a value!" } T& operator*() & { diff --git a/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/type_traits.h b/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/type_traits.h index 5bd920a91..5c92c1d32 100644 --- a/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/type_traits.h +++ b/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/type_traits.h @@ -29,21 +29,7 @@ #include "coda_oss/namespace_.h" namespace coda_oss { -// workaround missing "is_trivially_copyable" in g++ < 5.0 -// https://stackoverflow.com/a/31798726/8877 -#if defined(__GNUC__) && (__GNUC__ < 5) -template -struct is_trivially_copyable final -{ - // This old Intel compiler has enough C++14 for our needs; see CPlusPlus.h - #if !(defined(__INTEL_COMPILER) && (__INTEL_COMPILER_BUILD_DATE <= 20151021)) - static_assert(CODA_OSS_cplusplus < 201402L, "C++14 must have is_trivially_copyable."); - #endif - static constexpr bool value = __has_trivial_copy(T); -}; -#else using std::is_trivially_copyable; -#endif } #endif // CODA_OSS_coda_oss_type_traits_h_INCLUDED_ diff --git a/externals/coda-oss/modules/c++/except/include/except/Backtrace.h b/externals/coda-oss/modules/c++/except/include/except/Backtrace.h index 697889526..42cf6ba6a 100644 --- a/externals/coda-oss/modules/c++/except/include/except/Backtrace.h +++ b/externals/coda-oss/modules/c++/except/include/except/Backtrace.h @@ -42,6 +42,7 @@ namespace version { namespace except { #if _MSC_VER #pragma warning(push) +#pragma warning(disable: 4619) // #pragma warning: there is no warning number '...' #pragma warning(disable: 5264) // '...': '...' variable is not used #endif // _MSC_VER diff --git a/externals/coda-oss/modules/c++/hdf5.lite/include/hdf5/lite/Read.h b/externals/coda-oss/modules/c++/hdf5.lite/include/hdf5/lite/Read.h index ed57dd12b..09a8502ee 100644 --- a/externals/coda-oss/modules/c++/hdf5.lite/include/hdf5/lite/Read.h +++ b/externals/coda-oss/modules/c++/hdf5.lite/include/hdf5/lite/Read.h @@ -28,7 +28,7 @@ * \file Read.h * \brief HDF File-reading API * - * These are simple routines to read HDF5 files; they're loosly modeled after the MATLab API + * These are simple routines to read HDF5 files; they're loosely modeled after the MATLab API * https://www.mathworks.com/help/matlab/import_export/import-hdf5-files.html */ @@ -39,16 +39,17 @@ #include "sys/filesystem.h" #include "types/RowCol.h" +#include "SpanRC.h" + namespace hdf5 { namespace lite { -CODA_OSS_API types::RowCol readFile(const coda_oss::filesystem::path&, const std::string& loc, std::vector&); -CODA_OSS_API types::RowCol readFile(const coda_oss::filesystem::path&, const std::string& loc, std::vector&); +CODA_OSS_API SpanRC readFile(const coda_oss::filesystem::path&, const std::string& loc, std::vector&); +CODA_OSS_API SpanRC readFile(const coda_oss::filesystem::path&, const std::string& loc, std::vector&); } } #endif // CODA_OSS_hdf5_lite_Read_h_INCLUDED_ - diff --git a/externals/coda-oss/modules/c++/hdf5.lite/include/hdf5/lite/SpanRC.h b/externals/coda-oss/modules/c++/hdf5.lite/include/hdf5/lite/SpanRC.h new file mode 100644 index 000000000..7d6582124 --- /dev/null +++ b/externals/coda-oss/modules/c++/hdf5.lite/include/hdf5/lite/SpanRC.h @@ -0,0 +1,115 @@ +/* ========================================================================= + * This file is part of hdf5.lite-c++ + * ========================================================================= + * + * (C) Copyright 2022, Maxar Technologies, Inc. + * + * hdf5.lite-c++ is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; If not, + * see . + * + */ + +#ifndef CODA_OSS_hdf5_lite_SpanRC_h_INCLUDED_ +#define CODA_OSS_hdf5_lite_SpanRC_h_INCLUDED_ +#pragma once + +/*! + * \file SpanRC.h + * + * This is a super-simple version of C++23's mdspan. It's here because 1) don't want widespread use, and + * 2) CODA already has a View2D. + */ + +#include + +#include "config/Exports.h" +#include "coda_oss/span.h" +#include "types/RowCol.h" + +namespace hdf5 +{ +namespace lite +{ + +template +struct SpanRC final +{ + using size_type = types::RowCol; + using element_type = T; + using pointer = T*; + using reference = T&; + + SpanRC() = default; + SpanRC(pointer p, size_type rc) noexcept : s_(p, rc.area()), rc_(rc) + { + } + SpanRC(pointer p, size_t r, size_t c) noexcept : SpanRC(p, size_type(r, c)) + { + } + SpanRC(const SpanRC&) noexcept = default; + + constexpr pointer data() const noexcept + { + return s_.data(); + } + + /*constexpr*/ reference operator[](size_t idx) const noexcept + { + assert(idx < size()); // prevents "constexpr" in C++11 + return data()[idx]; + } + /*constexpr*/ reference operator()(size_t r, size_t c) const noexcept + { + const auto offset = (r * dims().col) + c; + return (*this)[offset]; + } + /*constexpr*/ reference operator[](size_type idx) const noexcept + { + return (*this)(idx.row, idx.col); + } + + constexpr size_t size() const noexcept + { + assert(s_.size() == rc_.area()); + return s_.size(); + } + constexpr size_t area() const noexcept + { + return size(); + } + + constexpr size_type size_bytes() const noexcept + { + return s_.size_bytes(); + } + + constexpr bool empty() const noexcept + { + return s_.empty(); + } + + const auto& dims() const + { + return rc_; + } + + private: + types::RowCol rc_; + coda_oss::span s_; +}; + +} +} + +#endif // CODA_OSS_hdf5_lite_SpanRC_h_INCLUDED_ diff --git a/externals/coda-oss/modules/c++/hdf5.lite/include/hdf5/lite/Write.h b/externals/coda-oss/modules/c++/hdf5.lite/include/hdf5/lite/Write.h new file mode 100644 index 000000000..3a0e4c7c2 --- /dev/null +++ b/externals/coda-oss/modules/c++/hdf5.lite/include/hdf5/lite/Write.h @@ -0,0 +1,80 @@ +/* ========================================================================= + * This file is part of hdf5.lite-c++ + * ========================================================================= + * + * (C) Copyright 2023, Maxar Technologies, Inc. + * + * hdf5.lite-c++ is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; If not, + * see . + * + */ + +#ifndef CODA_OSS_hdf5_lite_Write_h_INCLUDED_ +#define CODA_OSS_hdf5_lite_Write_h_INCLUDED_ +#pragma once + +/*! + * \file Read.h + * \brief HDF File-reading API + * + * These are simple routines to write HDF5 files; they're loosely modeled after the MATLab API + * https://www.mathworks.com/help/matlab/ref/h5create.html + * https://www.mathworks.com/help/matlab/ref/h5write.html + */ + +#include +#include + +#include "config/Exports.h" +#include "sys/filesystem.h" +#include "types/RowCol.h" + +#include "SpanRC.h" + +namespace hdf5 +{ +namespace lite +{ +template // currently implemented for float and double +CODA_OSS_API void createFile(const coda_oss::filesystem::path&, const std::string& ds, const types::RowCol&); +CODA_OSS_API void createFile(const coda_oss::filesystem::path&, const std::string& ds, SpanRC); +inline void createFile(const coda_oss::filesystem::path& path, const std::string& ds, SpanRC data_) +{ + SpanRC data(data_.data(), data_.dims()); + createFile(path, ds, data); +} +CODA_OSS_API void createFile(const coda_oss::filesystem::path&, const std::string& ds, SpanRC); +inline void createFile(const coda_oss::filesystem::path& path, const std::string& ds, SpanRC data_) +{ + SpanRC data(data_.data(), data_.dims()); + createFile(path, ds, data); +} + +CODA_OSS_API void writeFile(const coda_oss::filesystem::path&, const std::string& loc, SpanRC); +inline void writeFile(const coda_oss::filesystem::path& path, const std::string& ds, SpanRC data_) +{ + SpanRC data(data_.data(), data_.dims()); + writeFile(path, ds, data); +} +CODA_OSS_API void writeFile(const coda_oss::filesystem::path&, const std::string& loc, SpanRC); +inline void writeFile(const coda_oss::filesystem::path& path, const std::string& ds, SpanRC data_) +{ + SpanRC data(data_.data(), data_.dims()); + writeFile(path, ds, data); +} + +} +} + +#endif // CODA_OSS_hdf5_lite_Write_h_INCLUDED_ diff --git a/externals/coda-oss/modules/c++/hdf5.lite/source/Read.cpp b/externals/coda-oss/modules/c++/hdf5.lite/source/Read.cpp index c4f567658..325111a4f 100644 --- a/externals/coda-oss/modules/c++/hdf5.lite/source/Read.cpp +++ b/externals/coda-oss/modules/c++/hdf5.lite/source/Read.cpp @@ -56,7 +56,7 @@ static void read(const H5::DataSet& dataset, std::vector& result) dataset.read(result.data(), mem_type); } template -static types::RowCol readDatasetT(const H5::DataSet& dataset, std::vector& result) +static hdf5::lite::SpanRC readDatasetT(const H5::DataSet& dataset, std::vector& result) { if (dataset.getTypeClass() != H5T_FLOAT) { @@ -64,8 +64,9 @@ static types::RowCol readDatasetT(const H5::DataSet& dataset, std::vecto throw hdf5::lite::DataSetException(context); } - const auto retval = hdf5::lite::details::getSimpleExtentSize(dataset); - result.resize(retval.area()); + const auto dims = hdf5::lite::details::getSimpleExtentSize(dataset); + result.resize(dims.area()); + hdf5::lite::SpanRC retval(result.data(), dims); // dataset.read() doesn't care about the buffer type ... that's because H5Dread() also // uses void*. However, the LT API has H5LTread_dataset_double() and H5LTread_dataset_float(), @@ -74,16 +75,16 @@ static types::RowCol readDatasetT(const H5::DataSet& dataset, std::vecto return retval; } -inline types::RowCol readDataset_(const H5::DataSet& dataset, std::vector& result) +inline hdf5::lite::SpanRC readDataset_(const H5::DataSet& dataset, std::vector& result) { return readDatasetT(dataset, result); } -inline types::RowCol readDataset_(const H5::DataSet& dataset, std::vector& result) +inline hdf5::lite::SpanRC readDataset_(const H5::DataSet& dataset, std::vector& result) { return readDatasetT(dataset, result); } template -static types::RowCol readFile_(const coda_oss::filesystem::path& fileName, const std::string& datasetName, +static hdf5::lite::SpanRC readFile_(const coda_oss::filesystem::path& fileName, const std::string& datasetName, std::vector& result) { /* @@ -94,12 +95,12 @@ static types::RowCol readFile_(const coda_oss::filesystem::path& fileNam return readDataset_(dataset, result); } -types::RowCol hdf5::lite::readFile(const coda_oss::filesystem::path& fileName, const std::string& loc, +hdf5::lite::SpanRC hdf5::lite::readFile(const coda_oss::filesystem::path& fileName, const std::string& loc, std::vector& result) { return details::try_catch_H5Exceptions(readFile_, __FILE__, __LINE__, fileName, loc, result); } -types::RowCol hdf5::lite::readFile(const coda_oss::filesystem::path& fileName, const std::string& loc, +hdf5::lite::SpanRC hdf5::lite::readFile(const coda_oss::filesystem::path& fileName, const std::string& loc, std::vector& result) { return details::try_catch_H5Exceptions(readFile_, __FILE__, __LINE__, fileName, loc, result); diff --git a/externals/coda-oss/modules/c++/hdf5.lite/source/Write.cpp b/externals/coda-oss/modules/c++/hdf5.lite/source/Write.cpp new file mode 100644 index 000000000..ce140935a --- /dev/null +++ b/externals/coda-oss/modules/c++/hdf5.lite/source/Write.cpp @@ -0,0 +1,115 @@ +/* ========================================================================= + * This file is part of hd5.lite-c++ + * ========================================================================= + * + * (C) Copyright 2023, Maxar Technologies, Inc. + * + * hd5.lite-c++ is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; If not, + * see . + * + */ + +#include "hdf5/lite/Write.h" + +#include // std::ignore +#include + +#include "coda_oss/cstddef.h" // byte + +#include "hdf5/lite/HDF5Exception.h" +#include "H5.h" +#include "hdf5.lite.h" + +// https://raw.githubusercontent.com/HDFGroup/hdf5/develop/c++/examples/h5tutr_rdwt.cpp + +template static H5::PredType getPredType(); +template <> +inline H5::PredType getPredType() +{ + static_assert(sizeof(float) * 8 == 32, "'float' should be 32-bits"); // IEEE_F32LE + return H5::PredType::IEEE_F32LE; +} +template <> +inline H5::PredType getPredType() +{ + static_assert(sizeof(double) * 8 == 64, "'double' should be 64-bits"); // IEEE_F64LE + return H5::PredType::IEEE_F64LE; +} + +template +static void createFile_(const coda_oss::filesystem::path& fileName, const std::string& ds, const types::RowCol& sz) +{ + // https://raw.githubusercontent.com/HDFGroup/hdf5/develop/c++/examples/h5tutr_crtdat.cpp + // + // Create a new file using the default property lists. + H5::H5File file(fileName.string(), H5F_ACC_TRUNC); + + // Create the data space for the dataset. + constexpr int RANK = 2; + const hsize_t dims[]{sz.row, sz.col}; // dataset dimensions + H5::DataSpace dataspace(RANK, dims); + + // Create the dataset. + const auto data_type = getPredType(); + std::ignore = file.createDataSet(ds, data_type, dataspace); +} +template<> +void hdf5::lite::createFile(const coda_oss::filesystem::path& fileName, const std::string& ds, const types::RowCol& sz) +{ + details::try_catch_H5ExceptionsV(createFile_, __FILE__, __LINE__, fileName, ds, sz); +} +template<> +void hdf5::lite::createFile(const coda_oss::filesystem::path& fileName, const std::string& ds, const types::RowCol& sz) +{ + details::try_catch_H5ExceptionsV(createFile_, __FILE__, __LINE__, fileName, ds, sz); +} +void hdf5::lite::createFile(const coda_oss::filesystem::path& fileName, const std::string& ds, hdf5::lite::SpanRC data) +{ + createFile(fileName, ds, data.dims()); +} +void hdf5::lite::createFile(const coda_oss::filesystem::path& fileName, const std::string& ds, hdf5::lite::SpanRC data) +{ + createFile(fileName, ds, data.dims()); +} + + +template +static void writeFile_(const coda_oss::filesystem::path& fileName, const std::string& ds, hdf5::lite::SpanRC data) +{ + // https://raw.githubusercontent.com/HDFGroup/hdf5/develop/c++/examples/h5tutr_rdwt.cpp + + // Open an existing file and dataset. + H5::H5File file(fileName.string(), H5F_ACC_RDWR); + auto dataset = file.openDataSet(ds); + + const auto dims = hdf5::lite::details::getSimpleExtentSize(dataset); + if (data.dims() != dims) + { + const except::Context ctx("dataSet dimensions do not match data dimensions", __FILE__, __LINE__, "writeFile"); + throw hdf5::lite::DataSetException(ctx); + } + + // Write the data to the dataset using default memory space, file + // space, and transfer properties. + const auto data_type = getPredType(); + dataset.write(data.data(), data_type); +} +void hdf5::lite::writeFile(const coda_oss::filesystem::path& fileName, const std::string& ds, SpanRC data) +{ + details::try_catch_H5ExceptionsV(writeFile_, __FILE__, __LINE__, fileName, ds, data); +} +void hdf5::lite::writeFile(const coda_oss::filesystem::path& fileName, const std::string& ds, SpanRC data) +{ + details::try_catch_H5ExceptionsV(writeFile_, __FILE__, __LINE__, fileName, ds, data); +} diff --git a/externals/coda-oss/modules/c++/hdf5.lite/source/hdf5.lite.h b/externals/coda-oss/modules/c++/hdf5.lite/source/hdf5.lite.h index 709cc784c..fce6fb7c0 100644 --- a/externals/coda-oss/modules/c++/hdf5.lite/source/hdf5.lite.h +++ b/externals/coda-oss/modules/c++/hdf5.lite/source/hdf5.lite.h @@ -60,6 +60,13 @@ auto try_catch_H5Exceptions(TFunc f, const char* file, int line, TArgs&&... args details::try_catch_H5Exceptions_(call_f, file, line, &retval /*context*/); return retval; } +template +auto try_catch_H5ExceptionsV(TFunc f, const char* file, int line, TArgs&&... args) +{ + // "Hide" the arguments inside of a lambda + auto call_f = [&](void*) { f(std::forward(args)...); }; + details::try_catch_H5Exceptions_(call_f, file, line, nullptr /*context*/); +} } } diff --git a/externals/coda-oss/modules/c++/hdf5.lite/unittests/test_hdf5write.cpp b/externals/coda-oss/modules/c++/hdf5.lite/unittests/test_hdf5write.cpp new file mode 100644 index 000000000..0d99d1105 --- /dev/null +++ b/externals/coda-oss/modules/c++/hdf5.lite/unittests/test_hdf5write.cpp @@ -0,0 +1,93 @@ +/* ========================================================================= + * This file is part of hdf5.lite-c++ + * ========================================================================= + * + * (C) Copyright 2023, Maxar Technologies, Inc. + * + * hdf5.lite-c++ is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; If not, + * see . + * + */ + +#include +#include +#include +#include + +#include + +#include "sys/FileFinder.h" + +#include "hdf5/lite/Write.h" +#include "hdf5/lite/HDF5Exception.h" +#include "hdf5/lite/Info.h" +#include "hdf5/lite/Read.h" + +static std::filesystem::path find_unittest_file(const std::filesystem::path& name) +{ + static const auto unittests = std::filesystem::path("modules") / "c++" / "hdf5.lite" / "unittests"; + return sys::test::findGITModuleFile("coda-oss", unittests, name); +} + +TEST_CASE(test_hdf5Create) +{ + static const auto path_ = find_unittest_file("example.h5"); + static const auto path = path_.parent_path() / "TEST_hdf5Create_TMP.h5"; + + // https://www.mathworks.com/help/matlab/ref/h5write.html + hdf5::lite::createFile(path, "/DS1", {10, 20}); +} + +TEST_CASE(test_hdf5Write) +{ + static const auto path_ = find_unittest_file("example.h5"); + static const auto path = path_.parent_path() / "TEST_hdf5Write_TMP.h5"; + + const types::RowCol dims{10, 20}; + std::vector data_(dims.area()); + const hdf5::lite::SpanRC data(data_.data(), dims); + double d = 0.0; + for (size_t r = 0; r result; + const auto rc = hdf5::lite::readFile(path, "/DS1", result); + TEST_ASSERT(rc.dims() == dims); + TEST_ASSERT_EQ(dims.area(), result.size()); + for (size_t i = 0; i < result.size(); i++) + { + const auto expected = static_cast(i); + TEST_ASSERT_ALMOST_EQ(result[i], expected); + } +} + +TEST_MAIN( + TEST_CHECK(test_hdf5Create); + TEST_CHECK(test_hdf5Write); +) diff --git a/externals/coda-oss/modules/c++/str/include/str/EncodedStringView.h b/externals/coda-oss/modules/c++/str/include/str/EncodedStringView.h index 38beb310b..1fd1e99ac 100644 --- a/externals/coda-oss/modules/c++/str/include/str/EncodedStringView.h +++ b/externals/coda-oss/modules/c++/str/include/str/EncodedStringView.h @@ -110,7 +110,7 @@ class CODA_OSS_API EncodedStringView final std::wstring wstring() const; // UTF-16 on Windows, UTF-32 on Linux // These are for "advanced" use, most "normal" code should use the routines above. - std::string::const_pointer c_str() const + std::string::const_pointer c_str() const noexcept { return mString.data(); } @@ -122,7 +122,7 @@ class CODA_OSS_API EncodedStringView final { return mIsUtf8 ? nullptr : cast(c_str()); } - size_t size() const + size_t size() const noexcept { return mString.size(); } diff --git a/externals/coda-oss/modules/c++/xml.lite/include/xml/lite/Attributes.h b/externals/coda-oss/modules/c++/xml.lite/include/xml/lite/Attributes.h index 17c40e410..8b354844b 100644 --- a/externals/coda-oss/modules/c++/xml.lite/include/xml/lite/Attributes.h +++ b/externals/coda-oss/modules/c++/xml.lite/include/xml/lite/Attributes.h @@ -31,6 +31,7 @@ #include "except/Exception.h" #include "xml/lite/QName.h" #include "str/Convert.h" +#include "gsl/gsl.h" /*! * \file Attributes.h @@ -330,7 +331,7 @@ struct Attributes final } std::string operator[](const xml::lite::QName& name) const { - const size_t idx = getIndex(name); + const auto idx = gsl::narrow(getIndex(name)); return mAttributes[idx].getValue(); } @@ -348,7 +349,7 @@ struct Attributes final } std::string operator[](const std::string& s) const { - const size_t idx = getIndex(s); + const auto idx = gsl::narrow(getIndex(s)); return mAttributes[idx].getValue(); } diff --git a/externals/coda-oss/modules/c++/xml.lite/include/xml/lite/Document.h b/externals/coda-oss/modules/c++/xml.lite/include/xml/lite/Document.h index e61422d30..1d53fdbab 100644 --- a/externals/coda-oss/modules/c++/xml.lite/include/xml/lite/Document.h +++ b/externals/coda-oss/modules/c++/xml.lite/include/xml/lite/Document.h @@ -104,7 +104,7 @@ struct Document // SOAPDocument derives :-( * \param characterData The character data (if any) * \return A new element */ - Element *createElement(const std::string & qname, const std::string & uri, std::string characterData = ""); + virtual Element *createElement(const std::string & qname, const std::string & uri, std::string characterData = ""); #ifndef SWIG // SWIG doesn't like std::unique_ptr std::unique_ptr createElement(const xml::lite::QName&, const std::string& characterData) const; std::unique_ptr createElement(const xml::lite::QName&, const coda_oss::u8string& characterData) const; diff --git a/externals/coda-oss/modules/c++/xml.lite/include/xml/lite/ValidatorXerces.h b/externals/coda-oss/modules/c++/xml.lite/include/xml/lite/ValidatorXerces.h index dc2cb3939..8942aaf57 100644 --- a/externals/coda-oss/modules/c++/xml.lite/include/xml/lite/ValidatorXerces.h +++ b/externals/coda-oss/modules/c++/xml.lite/include/xml/lite/ValidatorXerces.h @@ -120,8 +120,8 @@ class ValidatorXerces : public ValidatorInterface ValidatorXerces(const ValidatorXerces&) = delete; ValidatorXerces& operator=(const ValidatorXerces&) = delete; - ValidatorXerces(ValidatorXerces&&) = delete; - ValidatorXerces& operator=(ValidatorXerces&&) = delete; + ValidatorXerces(ValidatorXerces&&) = default; + ValidatorXerces& operator=(ValidatorXerces&&) = default; using ValidatorInterface::validate; diff --git a/externals/coda-oss/modules/c++/xml.lite/unittests/test_soapelements.cpp b/externals/coda-oss/modules/c++/xml.lite/unittests/test_soapelements.cpp new file mode 100644 index 000000000..21ecbfdd8 --- /dev/null +++ b/externals/coda-oss/modules/c++/xml.lite/unittests/test_soapelements.cpp @@ -0,0 +1,65 @@ +/* ========================================================================= + * This file is part of xml.lite-c++ + * ========================================================================= + * + * (C) Copyright 2004 - 2019, MDA Information Systems LLC + * (C) Copyright 2023, Maxar Technologies, Inc. + * + * xml.lite-c++ is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; If not, + * see . + * + */ + +#include +#include "xml/lite/Document.h" +#include "xml/lite/Element.h" +#include "xml/lite/QName.h" +static const std::string test_text = "SOAP Test"; + +struct SOAPBody final : public xml::lite::Element +{ + SOAPBody() = default; + SOAPBody (const xml::lite::QName& qname) + { + setQName(qname); + } +}; + +struct SOAP final : public xml::lite::Document +{ + xml::lite::Element* createElement(const std::string & qname, + const std::string& uri, + std::string characterData = "") override { + const xml::lite::QName asQName(uri, qname); + xml::lite::Element* elem = new SOAPBody(asQName); + elem->setCharacterData(test_text); + return elem; + } +}; + +TEST_CASE(test_overrideCreateElement) +{ + SOAP soap_test; + auto a = soap_test.createElement("a","b","Not SOAP Test"); + auto b = dynamic_cast(a); + TEST_ASSERT_NOT_NULL(b); + TEST_ASSERT_EQ(a->getCharacterData(), test_text); + TEST_ASSERT_EQ(b->getCharacterData(), test_text); +} + +TEST_MAIN +( + TEST_CHECK(test_overrideCreateElement); +) + diff --git a/externals/coda-oss/modules/c++/xml.lite/unittests/test_xmlattribute.cpp b/externals/coda-oss/modules/c++/xml.lite/unittests/test_xmlattribute.cpp index f94a13653..011bb79d1 100644 --- a/externals/coda-oss/modules/c++/xml.lite/unittests/test_xmlattribute.cpp +++ b/externals/coda-oss/modules/c++/xml.lite/unittests/test_xmlattribute.cpp @@ -1,10 +1,10 @@ /* ========================================================================= - * This file is part of io-c++ + * This file is part of xml.lite-c++ * ========================================================================= * * (C) Copyright 2004 - 2019, MDA Information Systems LLC * - * io-c++ is free software; you can redistribute it and/or modify + * xml.lite-c++ is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. diff --git a/externals/coda-oss/modules/c++/xml.lite/unittests/test_xmlelement.cpp b/externals/coda-oss/modules/c++/xml.lite/unittests/test_xmlelement.cpp index ccbdde0a7..a9890ab00 100644 --- a/externals/coda-oss/modules/c++/xml.lite/unittests/test_xmlelement.cpp +++ b/externals/coda-oss/modules/c++/xml.lite/unittests/test_xmlelement.cpp @@ -1,10 +1,10 @@ /* ========================================================================= - * This file is part of io-c++ + * This file is part of xml.lite-c++ * ========================================================================= * * (C) Copyright 2004 - 2019, MDA Information Systems LLC * - * io-c++ is free software; you can redistribute it and/or modify + * xml.lite-c++ is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. diff --git a/modules/c++/cpp.h b/modules/c++/cpp.h index f3e3960da..931c7632d 100644 --- a/modules/c++/cpp.h +++ b/modules/c++/cpp.h @@ -1,6 +1,8 @@ #pragma once #pragma warning(push) +#pragma warning(disable: 4619) // #pragma warning: there is no warning number '...' + #pragma warning(disable: 4668) // '...' is not defined as a preprocessor macro, replacing with '...' for '...' #pragma warning(disable: 4820) // '...': '...' bytes padding added after data member '...' #pragma warning(disable: 4710) // '...': function not inlined @@ -16,6 +18,7 @@ #pragma warning(disable: 5027) // '...': move assignment operator was implicitly defined as deleted #pragma warning(disable: 5219) // implicit conversion from '...' to '...', possible loss of data #pragma warning(disable: 6285) // ( || ) is always a non-zero constant. Did you intend to use the bitwise-and operator? +#pragma warning(disable: 5264) // '...': '...' variable is not used #define _USE_MATH_DEFINES #include diff --git a/modules/c++/nitf/include/nitf/Object.hpp b/modules/c++/nitf/include/nitf/Object.hpp index 7b5c1eb68..3a264b0c4 100644 --- a/modules/c++/nitf/include/nitf/Object.hpp +++ b/modules/c++/nitf/include/nitf/Object.hpp @@ -208,8 +208,9 @@ class NITRO_NITFCPP_API Object * corresponding nitf_##_destruct method. */ +// Don't need both "override" and "final": https://learn.microsoft.com/en-us/cpp/code-quality/c26435?view=msvc-170 #define DECLARE_CLASS_IN_operator_function_(Name_, Package_) \ -void operator()(Package_##_##Name_ * nativeObject) NITRO_nitf_MemoryDestructor_noexcept_false_ override final \ +void operator()(Package_##_##Name_ * nativeObject) NITRO_nitf_MemoryDestructor_noexcept_false_ final \ { Package_##_##Name_##_destruct(&nativeObject); } #ifdef _MSC_VER diff --git a/modules/c++/pch.h b/modules/c++/pch.h index 03f81a187..a969486e3 100644 --- a/modules/c++/pch.h +++ b/modules/c++/pch.h @@ -1,9 +1,11 @@ #pragma once +#pragma warning(disable: 4619) // #pragma warning: there is no warning number '...' #pragma warning(disable: 4820) // '...': '...' bytes padding added after data member '...' #pragma warning(disable: 4710) // '...': function not inlined #pragma warning(disable: 5045) // Compiler will insert Spectre mitigation for memory load if / Qspectre switch specified #pragma warning(disable: 4668) // '...' is not defined as a preprocessor macro, replacing with '...' for '...' +#pragma warning(disable: 5264) // '...': '...' variable is not used // TODO: get rid of these someday? #pragma warning(disable: 4514) // '...': unreferenced inline function has been removed #pragma warning(disable: 26823) // Dereferencing a possibly null pointer '...' (lifetime.1).