diff --git a/CMakeLists.txt b/CMakeLists.txt index f70bec5..f22584b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,4 @@ -cmake_minimum_required(VERSION 2.6) -cmake_policy(VERSION 2.6) -if(POLICY CMP0063) - cmake_policy(SET CMP0063 OLD) -endif() +cmake_minimum_required(VERSION 3.1) project(TinyEXIF) include(GNUInstallDirs) @@ -14,12 +10,13 @@ find_package(tinyxml2 REQUIRED) ################################ # set lib version here -set(GENERIC_LIB_VERSION "1.0.0") +set(GENERIC_LIB_VERSION "1.0.1") set(GENERIC_LIB_SOVERSION "1") ################################ # Add definitions +set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG") ################################ diff --git a/TinyEXIF.cpp b/TinyEXIF.cpp index 5e1800c..d1cc003 100644 --- a/TinyEXIF.cpp +++ b/TinyEXIF.cpp @@ -703,7 +703,7 @@ int EXIFInfo::parseFrom(EXIFStream& stream) { int EXIFInfo::parseFrom(const uint8_t* buf, unsigned len) { class EXIFStreamBuffer : public EXIFStream { public: - EXIFStreamBuffer(const uint8_t* buf, unsigned len) + explicit EXIFStreamBuffer(const uint8_t* buf, unsigned len) : it(buf), end(buf+len) {} bool IsValid() const override { return it != NULL; @@ -722,7 +722,8 @@ int EXIFInfo::parseFrom(const uint8_t* buf, unsigned len) { private: const uint8_t* it, * const end; }; - return parseFrom(EXIFStreamBuffer(buf, len)); + EXIFStreamBuffer stream(buf, len); + return parseFrom(stream); } // diff --git a/TinyEXIF.h b/TinyEXIF.h index 12b8cd9..689fab0 100644 --- a/TinyEXIF.h +++ b/TinyEXIF.h @@ -39,7 +39,7 @@ #define TINYEXIF_MAJOR_VERSION 1 #define TINYEXIF_MINOR_VERSION 0 -#define TINYEXIF_PATCH_VERSION 0 +#define TINYEXIF_PATCH_VERSION 1 #ifdef _MSC_VER # ifdef TINYEXIF_EXPORT diff --git a/main.cpp b/main.cpp index 5e1e1b5..9d6686f 100644 --- a/main.cpp +++ b/main.cpp @@ -11,7 +11,7 @@ class EXIFStreamFile : public TinyEXIF::EXIFStream { public: - EXIFStreamFile(const char* fileName) + explicit EXIFStreamFile(const char* fileName) : file(fileName, std::ifstream::in|std::ifstream::binary) {} bool IsValid() const override { return file.is_open();