diff --git a/native/src/capi/capi.cpp b/native/src/capi/capi.cpp index 97744575d64e7017734177a5721e521059f0b10f..0f8b5d897f1a05b23f8b6af94d3fd6c7dd2c5753 100644 --- a/native/src/capi/capi.cpp +++ b/native/src/capi/capi.cpp @@ -415,7 +415,7 @@ public: static void TestExampleV1(Logger_t logger, progress_t progress, tokencb_t tokencb) { if (logger) { - bool ok_logger = logger(2, "Testing from example_1"); + /*bool ok_logger = */logger(2, "Testing from example_1"); //std::cerr << "CAPI: Logger delegate returned " << ok_logger << std::endl; } else @@ -424,7 +424,7 @@ public: } if (progress) { - bool ok_progress = progress(5, 42); + /*bool ok_progress = */progress(5, 42); //std::cerr << "CAPI: progress delegate returned " << ok_progress << std::endl; } else diff --git a/native/src/capi/handle.cpp b/native/src/capi/handle.cpp index 8da5444579b22c7a9e6148a4c9d4c146d98ff1fc..527e9e46e1881bdc37a0a5f3172f2bc41a106a39 100644 --- a/native/src/capi/handle.cpp +++ b/native/src/capi/handle.cpp @@ -243,7 +243,7 @@ void test_instanciate_handles() // Hand written ZgySuccessHandle success; ZgyErrorHandle error("error", "oops!"); - ZgyCleanupHandle cleanup(); + ZgyCleanupHandle cleanup; ZgyStringHandle string("hello!"); // From a single template ZgyReaderHandle reader(nullptr); diff --git a/native/src/impl/file_relay.h b/native/src/impl/file_relay.h index 588bad47f00b9a6e7cb9a51ba6ccad653696a65c..5458f2a41387220057d3099fe3b58f223623a2da 100644 --- a/native/src/impl/file_relay.h +++ b/native/src/impl/file_relay.h @@ -34,7 +34,7 @@ namespace InternalZGY { * typically used when just a few methods are to be intercepted and * it makes sense to have a default that just passes on the call. */ -class FileRelayBase : public FileADT +class OPENZGY_TEST_API FileRelayBase : public FileADT { private: std::shared_ptr<IFileBase> _relay; diff --git a/native/src/impl/file_sd.cpp b/native/src/impl/file_sd.cpp index d78576d3866d2c158a1ebb337fc3fb1565746dc4..8da4e86f5ff6ff11a62cf75122ffc08c795c54d1 100644 --- a/native/src/impl/file_sd.cpp +++ b/native/src/impl/file_sd.cpp @@ -1292,7 +1292,7 @@ SeismicStoreFile::_set_backoff(ISDGenericDataset* sdgd) * If dictated by the iocontext, turn on the read-only flag first. */ std::shared_ptr<ISDGenericDataset> -SeismicStoreFile::_open_dataset_ro(const std::shared_ptr<seismicdrive::SDManager>& manager, const std::string& filename, const std::unordered_map<std::string, std::string>& extra, bool sd_ds_log, const SeismicStoreIOContext */*context*/) +SeismicStoreFile::_open_dataset_ro(const std::shared_ptr<seismicdrive::SDManager>& manager, const std::string& filename, const std::unordered_map<std::string, std::string>& extra, bool sd_ds_log, const SeismicStoreIOContext* /*context*/) { if (_logger(5, "")) _sslogger(5, std::stringstream() @@ -1363,7 +1363,7 @@ SeismicStoreFile::_open_dataset_rw(const std::shared_ptr<seismicdrive::SDManager dataset->open(disp, extra); _logger(2, "Readonly flag already off for \"" + filename + "\""); } - catch (const seismicdrive::SDException& ex) { + catch (const seismicdrive::SDException&) { // TODO-Low: A specific SDAPI exception "read-only dataset" // Currently a SDExceptionSDAccessorError is thrown, which is // more about *where* the error occured and not *what* went wrong. diff --git a/native/src/impl/locker.h b/native/src/impl/locker.h index 368236e916905916cc90425d869fe079b4e0d6d2..b56b80c6a652d35b7cdcaa7c7f5effcdc3ecead4 100644 --- a/native/src/impl/locker.h +++ b/native/src/impl/locker.h @@ -20,6 +20,7 @@ #include <mutex> #include <stdexcept> #include <string> +#include "../declspec.h" namespace InternalZGY { #if 0 @@ -31,7 +32,7 @@ class ISDGenericDataset; /** * Maintain block level read- and write locks for an open file. */ -class Locker +class OPENZGY_TEST_API Locker { private: struct Entry diff --git a/native/src/impl/sdasyncio.cpp b/native/src/impl/sdasyncio.cpp index 6f41224a29b56fb8a14a924dfdb22b21210c5156..f0634920494b4858cfa6404d8ffabc691553aa1f 100644 --- a/native/src/impl/sdasyncio.cpp +++ b/native/src/impl/sdasyncio.cpp @@ -203,7 +203,7 @@ public: std::shared_ptr<ISDGenericDataset> sgds, std::int64_t highwater, const LoggerFn& logger) - : tracker_(std::make_shared<Locker>(highwater, logger)) + : tracker_(std::make_shared<Locker>((int)highwater, logger)) , relay_(sgds) , logger_(logger) { @@ -387,7 +387,7 @@ private: bool check_and_overwrite) { try { - relay->writeBlock(blocknum, data.get(), nbytes, check_and_overwrite); + relay->writeBlock((int)blocknum, data.get(), nbytes, check_and_overwrite); } catch(...) { tracker->setException(std::current_exception()); diff --git a/native/src/test/test_api.cpp b/native/src/test/test_api.cpp index edfd092b10ed9cb15528d7f1fcd379d51c6c7adb..7d758611564955e5d4aea637fd3a59924d3547a8 100644 --- a/native/src/test/test_api.cpp +++ b/native/src/test/test_api.cpp @@ -2277,7 +2277,6 @@ test_hammer() static void test_sderrors() { - typedef OpenZGY::IZgyWriter::size3i_t size3i_t; const std::string filename = cloud_synt2_name(); SeismicStoreIOContext context(*Test_Utils::default_sd_context()); diff --git a/native/src/test/test_locker.cpp b/native/src/test/test_locker.cpp index 77b5adcac54227a29a9263e324bab6081a650293..57194d98752601d814542d91203d4111a07369bd 100644 --- a/native/src/test/test_locker.cpp +++ b/native/src/test/test_locker.cpp @@ -407,11 +407,12 @@ public: // Disabled by default because on failure these tend to hang or // crash. And there might be failures due to race conditions in // the tests themselves. -#if 0 - register_test("locker.simple", test_simple); - register_test("locker.mixed", test_mixed); - register_test("locker.global", test_global); -#endif + static bool enable_ = false; // Avoid "unused" warning. + if (enable_) { + register_test("locker.simple", test_simple); + register_test("locker.mixed", test_mixed); + register_test("locker.global", test_global); + } } } dummy; diff --git a/native/src/tools/zgycopyc.cpp b/native/src/tools/zgycopyc.cpp index 6697b814967a315add5334bc1bdc06fde461075d..2588ee59160a511d65a289664a9c8003d6495138 100644 --- a/native/src/tools/zgycopyc.cpp +++ b/native/src/tools/zgycopyc.cpp @@ -951,13 +951,13 @@ addNoise(T *data, const std::array<std::int64_t,3>& size3d, int factor, float va void sigpipe_report(int) { static const char* msg = "WARNING: caught a SIGPIPE\n"; - write(2, msg, strlen(msg)); + (void)write(2, msg, strlen(msg)); } void sigpipe_fatal(int) { static const char* msg = "FATAL: caught a SIGPIPE\n"; - write(2, msg, strlen(msg)); + (void)write(2, msg, strlen(msg)); _exit(3); }