From f70cd404cac37e8e033062f07d3a6c6b7a68cddc Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Tue, 10 Oct 2023 09:56:44 -0400 Subject: [PATCH] Squashed 'externals/coda-oss/' changes from b6ead418c..434b85fe5 434b85fe5 Merge branch 'main' into cpp17 4a2f472c7 add extensions for .log and known Windows/Linux binaries (#746) 18f2c051f more FmtX() -> str::Format() changes (#745) git-subtree-dir: externals/coda-oss git-subtree-split: 434b85fe537621a2fe3f525f685126480ea4c153 --- .gitattributes | 11 +++++++++++ build/scripts/makeEnums.py | 6 +++--- modules/c++/dbi/tests/SQLTest1.cpp | 2 +- modules/c++/dbi/tests/SQLTest2.cpp | 2 +- modules/c++/io/tests/ioTest1.cpp | 2 +- modules/c++/io/tests/ioTest3.cpp | 2 +- modules/c++/io/tests/ioTest4.cpp | 2 +- modules/c++/io/tests/serializeTest1.cpp | 12 ++++++------ modules/c++/mt/tests/MTSingletonTest.cpp | 2 +- modules/c++/net.ssl/tests/SSLTestClient.cpp | 2 +- modules/c++/net.ssl/tests/SSLTestClientNoURL.cpp | 2 +- modules/c++/net/tests/NetConnectionClientTest.cpp | 2 +- modules/c++/net/tests/NetConnectionServerTest.cpp | 2 +- modules/c++/net/tests/SerializableTestClient.cpp | 2 +- modules/c++/net/tests/URLTest.cpp | 2 +- modules/c++/str/tests/VersionTest.cpp | 2 +- modules/c++/sys/tests/OSTest.cpp | 2 +- modules/c++/tiff/tests/DumpHeader.cpp | 4 ++-- modules/c++/xml.lite/tests/AttributeValueTest.cpp | 2 +- modules/c++/xml.lite/tests/MinidomParserTest1.cpp | 2 +- modules/c++/xml.lite/tests/MinidomParserTest2.cpp | 4 ++-- modules/c++/xml.lite/tests/XMLReaderTest.cpp | 2 +- 22 files changed, 41 insertions(+), 30 deletions(-) diff --git a/.gitattributes b/.gitattributes index 6e07f483bd..803f17ffe9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -18,10 +18,12 @@ CMakeLists.txt text eol=lf # Text file formats *.txt text eol=lf +*.text text eol=lf *.md text eol=lf *.tex text eol=lf *.?ml text eol=lf *.kmz binary +*.log text eol=lf # Programming languages *.htm? text eol=lf @@ -54,12 +56,21 @@ CMakeLists.txt text eol=lf ###################### # Known binary files +# executables, libraries; yes, sometimes they're part of a repository +*.exe binary +*.out binary +lib*.so* binary +*.dll binary +lib*.a* binary +*.lib binary + # from various unit_test/ directories *.dat binary *.*hdr binary *.flat binary *.sig binary *.bin binary +*.dump binary # images *.bmp binary diff --git a/build/scripts/makeEnums.py b/build/scripts/makeEnums.py index 911a7fefee..6e909511c3 100755 --- a/build/scripts/makeEnums.py +++ b/build/scripts/makeEnums.py @@ -110,7 +110,7 @@ def cmpValues(x, y): s.write(' %sif (s == "%s")\n value = %s%s;\n' % (i > 0 and 'else ' or '', n, values.cleanPrefix, item.names[0].replace(' ', '_'))) i += 1 - s.write(' else\n throw except::InvalidFormatException(Ctxt(FmtX("Invalid enum value: %s", s.c_str())));\n') + s.write(' else\n throw except::InvalidFormatException(Ctxt(str::Format("Invalid enum value: %s", s.c_str())));\n') s.write(' }\n\n') s.write(' //! int constructor\n') @@ -123,7 +123,7 @@ def cmpValues(x, y): try: idx += 1 except:{} - s.write(' default:\n throw except::InvalidFormatException(Ctxt(FmtX("Invalid enum value: %d", i)));\n') + s.write(' default:\n throw except::InvalidFormatException(Ctxt(str::Format("Invalid enum value: %d", i)));\n') s.write(' }\n }\n\n') s.write(' //! destructor\n') @@ -142,7 +142,7 @@ def cmpValues(x, y): try: idx += 1 except:{} - s.write(' default:\n throw except::InvalidFormatException(Ctxt(FmtX("Invalid enum value: %d", value)));\n') + s.write(' default:\n throw except::InvalidFormatException(Ctxt(str::Format("Invalid enum value: %d", value)));\n') s.write(' }\n }\n\n') s.write(' //! assignment operator\n') diff --git a/modules/c++/dbi/tests/SQLTest1.cpp b/modules/c++/dbi/tests/SQLTest1.cpp index dbca6e5e83..ad1b0eb8d7 100644 --- a/modules/c++/dbi/tests/SQLTest1.cpp +++ b/modules/c++/dbi/tests/SQLTest1.cpp @@ -30,7 +30,7 @@ int main(int argc, char* argv[]) { try { - if (argc < 4) throw except::Exception(Ctxt(FmtX("Usage %s [host] [port]", argv[0]))); + if (argc < 4) throw except::Exception(Ctxt(str::Format("Usage %s [host] [port]", argv[0]))); std::string database(argv[1]); std::string user(argv[2]); diff --git a/modules/c++/dbi/tests/SQLTest2.cpp b/modules/c++/dbi/tests/SQLTest2.cpp index 843a4d2780..c1bc60f2d7 100644 --- a/modules/c++/dbi/tests/SQLTest2.cpp +++ b/modules/c++/dbi/tests/SQLTest2.cpp @@ -30,7 +30,7 @@ int main(int argc, char* argv[]) { try { - if (argc != 6) throw except::Exception(Ctxt(FmtX("Usage %s ", argv[0]))); + if (argc != 6) throw except::Exception(Ctxt(str::Format("Usage %s ", argv[0]))); std::string database(argv[1]); std::string host(argv[4]); diff --git a/modules/c++/io/tests/ioTest1.cpp b/modules/c++/io/tests/ioTest1.cpp index 56cd99924e..f803f47e89 100644 --- a/modules/c++/io/tests/ioTest1.cpp +++ b/modules/c++/io/tests/ioTest1.cpp @@ -33,7 +33,7 @@ int main(int argc, char **argv) { if (argc != 3) { - throw Exception(Ctxt(FmtX("Usage: %s ", + throw Exception(Ctxt(str::Format("Usage: %s ", argv[0]))); } diff --git a/modules/c++/io/tests/ioTest3.cpp b/modules/c++/io/tests/ioTest3.cpp index 39a85190b7..f00693da4f 100644 --- a/modules/c++/io/tests/ioTest3.cpp +++ b/modules/c++/io/tests/ioTest3.cpp @@ -48,7 +48,7 @@ int main(int argc, char **argv) try { if (argc != 3) - throw Exception(Ctxt(FmtX("Usage: %s ", argv[0]))); + throw Exception(Ctxt(str::Format("Usage: %s ", argv[0]))); Copy::run(argv[1], argv[2]); } diff --git a/modules/c++/io/tests/ioTest4.cpp b/modules/c++/io/tests/ioTest4.cpp index a45f89b7fe..7121f9b0eb 100644 --- a/modules/c++/io/tests/ioTest4.cpp +++ b/modules/c++/io/tests/ioTest4.cpp @@ -53,7 +53,7 @@ int main(int argc, char **argv) if (argc != 3) throw except::Error( Ctxt( - FmtX( + str::Format( "Usage: %s ", argv[0]))); diff --git a/modules/c++/io/tests/serializeTest1.cpp b/modules/c++/io/tests/serializeTest1.cpp index 2037899aee..01fb74dd89 100644 --- a/modules/c++/io/tests/serializeTest1.cpp +++ b/modules/c++/io/tests/serializeTest1.cpp @@ -47,9 +47,9 @@ class A : public Serializable virtual void serialize(OutputStream& os) override { os.writeln("Class A"); - os.writeln(FmtX("%f", vec[0])); - os.writeln(FmtX("%f", vec[1])); - os.writeln(FmtX("%f", vec[2])); + os.writeln(str::Format("%f", vec[0])); + os.writeln(str::Format("%f", vec[1])); + os.writeln(str::Format("%f", vec[2])); } virtual void deserialize(InputStream& is) override @@ -60,9 +60,9 @@ class A : public Serializable string vec_2 = fillString(is); assert(classType == "Class A"); - dbg.writeln(FmtX("vec[0] = %s", vec_0.c_str())); - dbg.writeln(FmtX("vec[1] = %s", vec_1.c_str())); - dbg.writeln(FmtX("vec[2] = %s", vec_2.c_str())); + dbg.writeln(str::Format("vec[0] = %s", vec_0.c_str())); + dbg.writeln(str::Format("vec[1] = %s", vec_1.c_str())); + dbg.writeln(str::Format("vec[2] = %s", vec_2.c_str())); vec[0] = str::toType(vec_0); vec[1] = str::toType(vec_1); diff --git a/modules/c++/mt/tests/MTSingletonTest.cpp b/modules/c++/mt/tests/MTSingletonTest.cpp index beb1719e35..e71dce3454 100644 --- a/modules/c++/mt/tests/MTSingletonTest.cpp +++ b/modules/c++/mt/tests/MTSingletonTest.cpp @@ -103,7 +103,7 @@ class Thespian : public Runnable } void run() override { - //__debugln__(FmtX("[%s]:", mName.c_str())); + //__debugln__(str::Format("[%s]:", mName.c_str())); doLines(); } virtual void doLines() = 0; diff --git a/modules/c++/net.ssl/tests/SSLTestClient.cpp b/modules/c++/net.ssl/tests/SSLTestClient.cpp index 074b4abb23..ff8db2b6fd 100644 --- a/modules/c++/net.ssl/tests/SSLTestClient.cpp +++ b/modules/c++/net.ssl/tests/SSLTestClient.cpp @@ -39,7 +39,7 @@ int main(int argc, char **argv) try { if (argc != 2) - throw Exception(FmtX("Usage: %s ", argv[0])); + throw Exception(str::Format("Usage: %s ", argv[0])); URL url(argv[1]); //int sslOn = atoi(argv[2]); diff --git a/modules/c++/net.ssl/tests/SSLTestClientNoURL.cpp b/modules/c++/net.ssl/tests/SSLTestClientNoURL.cpp index 60baa34faa..89c4d64764 100644 --- a/modules/c++/net.ssl/tests/SSLTestClientNoURL.cpp +++ b/modules/c++/net.ssl/tests/SSLTestClientNoURL.cpp @@ -40,7 +40,7 @@ int main(int argc, char** argv) try { if (argc != 3) - throw Exception(FmtX("Usage: %s ", argv[0])); + throw Exception(str::Format("Usage: %s ", argv[0])); std::string host(argv[1]); int port(atoi(argv[2])); diff --git a/modules/c++/net/tests/NetConnectionClientTest.cpp b/modules/c++/net/tests/NetConnectionClientTest.cpp index 992ac5eca0..abe0b35790 100644 --- a/modules/c++/net/tests/NetConnectionClientTest.cpp +++ b/modules/c++/net/tests/NetConnectionClientTest.cpp @@ -39,7 +39,7 @@ int main(int argc, char **argv) try { if (argc != 3) - throw Exception(FmtX("Usage: %s ", argv[0])); + throw Exception(str::Format("Usage: %s ", argv[0])); std::string host(argv[1]); int port(atoi(argv[2])); diff --git a/modules/c++/net/tests/NetConnectionServerTest.cpp b/modules/c++/net/tests/NetConnectionServerTest.cpp index ed72a907ba..0cb8cdb0cf 100644 --- a/modules/c++/net/tests/NetConnectionServerTest.cpp +++ b/modules/c++/net/tests/NetConnectionServerTest.cpp @@ -74,7 +74,7 @@ int main(int argc, char **argv) try { if (argc < 2) - throw Exception(FmtX("Usage: %s (-mt|-st|-tp)", argv[0])); + throw Exception(str::Format("Usage: %s (-mt|-st|-tp)", argv[0])); net::AllocStrategy* strategy = nullptr; diff --git a/modules/c++/net/tests/SerializableTestClient.cpp b/modules/c++/net/tests/SerializableTestClient.cpp index 229758ca3f..0c472bf09f 100644 --- a/modules/c++/net/tests/SerializableTestClient.cpp +++ b/modules/c++/net/tests/SerializableTestClient.cpp @@ -39,7 +39,7 @@ int main(int argc, char **argv) try { if (argc != 2) - throw Exception(FmtX("Usage: %s ", argv[0])); + throw Exception(str::Format("Usage: %s ", argv[0])); URL url(argv[1]); diff --git a/modules/c++/net/tests/URLTest.cpp b/modules/c++/net/tests/URLTest.cpp index aacde069ca..e6c5f79320 100644 --- a/modules/c++/net/tests/URLTest.cpp +++ b/modules/c++/net/tests/URLTest.cpp @@ -36,7 +36,7 @@ int main(int argc, char **argv) try { if (argc != 2) - throw Exception(FmtX("Usage: %s ", argv[0])); + throw Exception(str::Format("Usage: %s ", argv[0])); URL url(argv[1]); diff --git a/modules/c++/str/tests/VersionTest.cpp b/modules/c++/str/tests/VersionTest.cpp index aa1d9625dc..627696cdf5 100644 --- a/modules/c++/str/tests/VersionTest.cpp +++ b/modules/c++/str/tests/VersionTest.cpp @@ -25,7 +25,7 @@ int main() { - std::cout << FmtX("Your version of str is %d.%d.%d\n", + std::cout << str::Format("Your version of str is %d.%d.%d\n", STR_MAJOR_VERSION, STR_MINOR_VERSION, STR_MICRO_VERSION); std::cout << "Specialization for string test...\n"; std::string ok("This test passes"); diff --git a/modules/c++/sys/tests/OSTest.cpp b/modules/c++/sys/tests/OSTest.cpp index 330493eb76..79be99659a 100644 --- a/modules/c++/sys/tests/OSTest.cpp +++ b/modules/c++/sys/tests/OSTest.cpp @@ -92,7 +92,7 @@ int main(int argc, char **argv) std::string tempFileName = os.getTempName(); std::ofstream ofs(tempFileName.c_str()); if (!ofs.is_open()) - throw except::Exception(FmtX("Could not open file named: %s", + throw except::Exception(str::Format("Could not open file named: %s", tempFileName.c_str())); ofs << "Im writing some crap to this file!" << std::endl; ofs.close(); diff --git a/modules/c++/tiff/tests/DumpHeader.cpp b/modules/c++/tiff/tests/DumpHeader.cpp index 1c310f4419..2e0be41cbe 100644 --- a/modules/c++/tiff/tests/DumpHeader.cpp +++ b/modules/c++/tiff/tests/DumpHeader.cpp @@ -31,7 +31,7 @@ int main(int argc, char **argv) try { if (argc < 2) - throw except::Exception(FmtX("usage: %s ", argv[0])); + throw except::Exception(str::Format("usage: %s ", argv[0])); sys::OS os; std::string path = sys::Path::absolutePath(argv[1]); @@ -47,7 +47,7 @@ int main(int argc, char **argv) if (tiff::Utils::hasGeoTiffIFD(reader[i]->getIFD())) { outStream.writeln("==========================="); - outStream.writeln(FmtX("GeoTIFF detected: Image %d\n", (i + 1))); + outStream.writeln(str::Format("GeoTIFF detected: Image %d\n", (i + 1))); tiff::IFD *geoIFD = tiff::Utils::createGeoTiffIFD(reader[i]->getIFD()); geoIFD->print(outStream); diff --git a/modules/c++/xml.lite/tests/AttributeValueTest.cpp b/modules/c++/xml.lite/tests/AttributeValueTest.cpp index c66f466caa..01e66e1e0a 100644 --- a/modules/c++/xml.lite/tests/AttributeValueTest.cpp +++ b/modules/c++/xml.lite/tests/AttributeValueTest.cpp @@ -41,7 +41,7 @@ int main(int argc, char **argv) // Check to make sure we have right length if (argc != 2) - throw Exception(Ctxt(FmtX("Usage: %s \n", argv[0]))); + throw Exception(Ctxt(str::Format("Usage: %s \n", argv[0]))); // Create an input stream FileInputStream xmlFile(argv[1]); diff --git a/modules/c++/xml.lite/tests/MinidomParserTest1.cpp b/modules/c++/xml.lite/tests/MinidomParserTest1.cpp index ac5ffa42ea..aaa37b9abe 100644 --- a/modules/c++/xml.lite/tests/MinidomParserTest1.cpp +++ b/modules/c++/xml.lite/tests/MinidomParserTest1.cpp @@ -39,7 +39,7 @@ int main(int argc, char **argv) // Check to make sure we have right length if (argc != 2) - throw Exception(Ctxt(FmtX("Usage: %s \n", argv[0]))); + throw Exception(Ctxt(str::Format("Usage: %s \n", argv[0]))); // Create an input stream FileInputStream xmlFile(argv[1]); diff --git a/modules/c++/xml.lite/tests/MinidomParserTest2.cpp b/modules/c++/xml.lite/tests/MinidomParserTest2.cpp index ee28d77d8c..78c01da3bc 100644 --- a/modules/c++/xml.lite/tests/MinidomParserTest2.cpp +++ b/modules/c++/xml.lite/tests/MinidomParserTest2.cpp @@ -52,7 +52,7 @@ int main(int argc, char **argv) { if (argc != 5) { - throw Exception(Ctxt(FmtX( + throw Exception(Ctxt(str::Format( "Usage: %s [OPTION] \n\n\t-a\tadd service\n\t-s\tsubtract service\n\t-o\toutput file\n", argv[0]))); } @@ -123,7 +123,7 @@ int main(int argc, char **argv) if (rootElement) rootElement->print(out); break; default: - throw Exception(Ctxt(FmtX( + throw Exception(Ctxt(str::Format( "Usage: %s [OPTION] \n\n\t-a\tadd service\n\t-s\tsubtract service\n\t-o\toutput file\n", argv[0]))); } diff --git a/modules/c++/xml.lite/tests/XMLReaderTest.cpp b/modules/c++/xml.lite/tests/XMLReaderTest.cpp index 8e4cf9a080..83989cb4a1 100644 --- a/modules/c++/xml.lite/tests/XMLReaderTest.cpp +++ b/modules/c++/xml.lite/tests/XMLReaderTest.cpp @@ -134,7 +134,7 @@ int main(int argc, char **argv) { // Check to make sure we have right length if (argc != 2) - throw Exception(Ctxt(FmtX("Usage: %s \n", argv[0]))); + throw Exception(Ctxt(str::Format("Usage: %s \n", argv[0]))); // Create an input stream FileInputStream