From 35f9cb6c53feeed235e2965796d2578a96428d41 Mon Sep 17 00:00:00 2001 From: Sylwester Fraczek Date: Fri, 24 Jan 2020 16:37:18 +0100 Subject: [PATCH] Fix compiler warnings --- src/cpio.cpp | 10 ++++++++++ src/cpio.hpp | 7 ------- src/etl_localization_rcnn.cpp | 2 +- src/interface.cpp | 2 ++ src/interface.hpp | 2 +- src/log.hpp | 2 +- src/provider.hpp | 2 +- test/test_manifest_tsv.cpp | 3 +++ 8 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/cpio.cpp b/src/cpio.cpp index 1d77e109..17c1f73b 100644 --- a/src/cpio.cpp +++ b/src/cpio.cpp @@ -25,6 +25,16 @@ using namespace nervana; namespace nervana { + namespace cpio + { + static const uint32_t FORMAT_VERSION = 1; + static const uint32_t WRITER_VERSION = 1; + static const char MAGIC_STRING[] = "MACR"; + static const char CPIO_TRAILER[] = "TRAILER!!!"; + static const char AEON_HEADER[] = "cpiohdr"; + static const char AEON_TRAILER[] = "cpiotlr"; + } + template void read_single_value(istream& ifs, T* data) { diff --git a/src/cpio.hpp b/src/cpio.hpp index 8ef90bd7..c8ff74c3 100644 --- a/src/cpio.hpp +++ b/src/cpio.hpp @@ -34,13 +34,6 @@ namespace nervana { namespace cpio { - static const uint32_t FORMAT_VERSION = 1; - static const uint32_t WRITER_VERSION = 1; - static const char* MAGIC_STRING = "MACR"; - static const char* CPIO_TRAILER = "TRAILER!!!"; - static const char* AEON_HEADER = "cpiohdr"; - static const char* AEON_TRAILER = "cpiotlr"; - class record_header; class file_header; class file_trailer; diff --git a/src/etl_localization_rcnn.cpp b/src/etl_localization_rcnn.cpp index 1e626d9b..c72d0cca 100644 --- a/src/etl_localization_rcnn.cpp +++ b/src/etl_localization_rcnn.cpp @@ -110,7 +110,7 @@ shared_ptr } cv::Size im_size{mp->width(), mp->height()}; - auto crop = settings->cropbox; + //auto crop = settings->cropbox; im_size = cv::Size{int(unbiased_round(input_size.width * im_scale)), int(unbiased_round(input_size.height * im_scale))}; diff --git a/src/interface.cpp b/src/interface.cpp index dbfdb3f8..4d0af621 100644 --- a/src/interface.cpp +++ b/src/interface.cpp @@ -24,6 +24,8 @@ using namespace nervana; using namespace std; using namespace nlohmann; +int IGNORE_VALUE; + void json_configurable::verify_config( const std::string& location, const vector>& config, diff --git a/src/interface.hpp b/src/interface.hpp index 0a7c47ef..f9518f1f 100644 --- a/src/interface.hpp +++ b/src/interface.hpp @@ -30,7 +30,7 @@ #include "json.hpp" #include "log.hpp" -static int IGNORE_VALUE; +extern int IGNORE_VALUE; namespace nervana { diff --git a/src/log.hpp b/src/log.hpp index d951c871..eb36627e 100644 --- a/src/log.hpp +++ b/src/log.hpp @@ -30,7 +30,7 @@ namespace nervana level_undefined, }; - static const char* log_level_env_var = "AEON_LOG_LEVEL"; + static const char log_level_env_var[] = "AEON_LOG_LEVEL"; static const nervana::log_level default_log_level = nervana::log_level::level_warning; class conststring diff --git a/src/provider.hpp b/src/provider.hpp index b9c16120..24e20a7a 100644 --- a/src/provider.hpp +++ b/src/provider.hpp @@ -104,7 +104,7 @@ class nervana::provider::interface : public nervana::provider_interface private: void provide(int idx, nervana::encoded_record& in_buf, - nervana::fixed_buffer_map& out_buf) const + nervana::fixed_buffer_map& out_buf) const override { } }; diff --git a/test/test_manifest_tsv.cpp b/test/test_manifest_tsv.cpp index 96eb5448..3e39f0c0 100644 --- a/test/test_manifest_tsv.cpp +++ b/test/test_manifest_tsv.cpp @@ -182,6 +182,9 @@ void test_multinode_manifest(bool shuffle) auto block = manifest.next(); auto block_node1 = manifest_node1.next(); auto block_node2 = manifest_node2.next(); + (void) block; + (void) block_node1; + (void) block_node2; manifest.reset(); manifest_node1.reset();