From 1198458b867e7f9a2bb556fbae5c3236a2b94d30 Mon Sep 17 00:00:00 2001 From: Gines Hidalgo Date: Mon, 9 Nov 2020 23:34:43 -0500 Subject: [PATCH] Ubuntu20: Removed compiler warnings Signed-off-by: Gines Hidalgo --- CMakeLists.txt | 2 +- doc/release_notes.md | 3 ++- include/openpose/core/matrix.hpp | 2 +- src/openpose/core/array.cpp | 2 +- src/openpose/core/datum.cpp | 2 +- src/openpose/core/matrix.cpp | 2 +- src/openpose/utilities/fileSystem.cpp | 2 +- 7 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cd73979b..33ba5a3e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -506,7 +506,7 @@ if (UNIX OR APPLE) if (${GPU_MODE} MATCHES "CUDA") # Set CUDA Flags - set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -std=c++11") + set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -std=c++14") # Thrust library requires C++14 for CUDA >= 11 set(CUDA_NVCC_FLAGS_DEBUG "${CUDA_NVCC_FLAGS_DEBUG} -D_DEBUG -g") if (NOT CUDA_FOUND) diff --git a/doc/release_notes.md b/doc/release_notes.md index 35829439..165ff577 100644 --- a/doc/release_notes.md +++ b/doc/release_notes.md @@ -397,13 +397,13 @@ OpenPose Library - Release Notes 7. String is used in `include/openpose/wrapper/` to avoid std::string to cause errors for using diferent std DLLs. 8. Added `ScaleMode::ZeroToOneFixedAspect` and `ScaleMode::PlusMinusOneFixedAspect`. Compared to `ZeroToOne` and `PlusMinusOne`, the new ones also preserve the aspect ratio of each axis. 9. Added more verbose to wrapper when it is been configured, showing the values of some of its parameters. + 10. Removed many Visual Studio (Windows) warnings. 2. Functions or parameters renamed: 1. All headers moved into `openpose_private`, all 3rd-party library calls in headers, and std::string calls in `include/openpose/wrapper/`. 2. Renamed `dLog()` as `opLogIfDebug()`, `log()` as `opLog()`, `check()` as `checkBool()`, and also renamed all the `checkX()` functions in `include/openpose/utilities/check.hpp`. This avoids compiling crashes when exporting OpenPose to other projects which contain other 3rd-party libraries that define functions with the same popular names with `#define`. 3. Main bugs fixed: 1. Debug version of OpenPose actually targets debug lib/DLL files of 3rd-party libraries. 2. Debug version no longer prints on console a huge log message from Caffe with the network when starting OpenPose (fixed by using the right debug libraries). - 3. Removed many Visual Studio (Windows) warnings. 4. Natural sort now works properly with filenames containining numbers longer than the limit of an int. 5. Optionally auto-generated bin folder only contains the required DLLs (depending on the CMake configuration), instead of all of them. 6. When WrapperStructFace and WrapperStructHand are not called and configured for Wrapper, setting body to CPU rendering was not working. @@ -421,6 +421,7 @@ OpenPose Library - Release Notes 3. Added Asynchronous mode to Python API. 4. Added compatibility with Ubuntu 20.04, CUDA 11.X, and cuDNN 8.0.X. 5. Installation documentation highly simplified and improved. + 6. Removed all compiler warnings for Ubuntu 20.04. 2. Functions or parameters renamed: 3. Main bugs fixed: 1. 90 and 270-degree rotations working again. diff --git a/include/openpose/core/matrix.hpp b/include/openpose/core/matrix.hpp index bce5be90..67d77812 100644 --- a/include/openpose/core/matrix.hpp +++ b/include/openpose/core/matrix.hpp @@ -32,7 +32,7 @@ namespace op // ... // Matrix opMat = CV2OPCONSTMAT(Matrix()); #define OP_CV2OPCONSTMAT(cvMat) \ - (op::Matrix((const void* const)&(cvMat))) + (op::Matrix((const void*)&(cvMat))) // Convert from std::vector into std::vector. Usage example: // #include diff --git a/src/openpose/core/array.cpp b/src/openpose/core/array.cpp index 6d2c2a0d..df6e57dd 100644 --- a/src/openpose/core/array.cpp +++ b/src/openpose/core/array.cpp @@ -270,7 +270,7 @@ namespace op // Equivalent: std::copy(spData.get(), spData.get() + mVolume, array.spData.get()); std::copy(pData, pData + mVolume, array.pData); // Return - return std::move(array); + return array; } catch (const std::exception& e) { diff --git a/src/openpose/core/datum.cpp b/src/openpose/core/datum.cpp index 8fe5b032..0840fe94 100644 --- a/src/openpose/core/datum.cpp +++ b/src/openpose/core/datum.cpp @@ -361,7 +361,7 @@ namespace op #endif #endif // Return - return std::move(datum); + return datum; } catch (const std::exception& e) { diff --git a/src/openpose/core/matrix.cpp b/src/openpose/core/matrix.cpp index e7bf67a1..3cc25e09 100644 --- a/src/openpose/core/matrix.cpp +++ b/src/openpose/core/matrix.cpp @@ -111,7 +111,7 @@ namespace op { try { - return (const void* const)(&spImpl->mCvMat); + return (const void*)(&spImpl->mCvMat); } catch (const std::exception& e) { diff --git a/src/openpose/utilities/fileSystem.cpp b/src/openpose/utilities/fileSystem.cpp index 0de503f6..59de1065 100644 --- a/src/openpose/utilities/fileSystem.cpp +++ b/src/openpose/utilities/fileSystem.cpp @@ -48,7 +48,7 @@ namespace op if (aNumberAsString.size() != bNumberAsString.size()) return aNumberAsString.size() < bNumberAsString.size(); // Both same length --> Compare them - for (auto i = 0 ; i < aNumberAsString.size() ; ++i) + for (auto i = 0u ; i < aNumberAsString.size() ; ++i) if (aNumberAsString[i] != bNumberAsString[i]) return aNumberAsString[i] < bNumberAsString[i]; // Both same number --> Remove and return compareNat after removing those characters -- GitLab