Commit fe0107e2 authored by Anton Bukov's avatar Anton Bukov

Fixed some warnings

parent 0b63c132
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
SET (CMAKE_BUILD_TYPE Release) SET (CMAKE_BUILD_TYPE Release)
SET (CMAKE_CXX_STANDARD 11) SET (CMAKE_CXX_STANDARD 11)
SET (CMAKE_CXX_STANDARD_REQUIRED ON) SET (CMAKE_CXX_STANDARD_REQUIRED ON)
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wmissing-include-dirs -Wfloat-equal -Wshadow") SET (TARGET boolinqbenchmark CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wmissing-include-dirs -Wfloat-equal -Wshadow")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wdouble-promotion -Winit-self -Weffc++") SET (TARGET boolinqbenchmark CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wdouble-promotion -Winit-self -Weffc++")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Woverloaded-virtual -Wsign-promo") SET (TARGET boolinqbenchmark CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Woverloaded-virtual -Wsign-promo")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wvla -Winvalid-pch -Winline -Wredundant-decls") SET (TARGET boolinqbenchmark CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wvla -Winvalid-pch -Winline -Wredundant-decls")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wcast-align") SET (TARGET boolinqbenchmark CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wcast-align")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wcast-qual -Wpointer-arith") SET (TARGET boolinqbenchmark CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wcast-qual -Wpointer-arith")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wold-style-cast") SET (TARGET boolinqbenchmark CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wold-style-cast")
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/externals/benchmark/include) INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/externals/benchmark/include)
......
# Common variables. # Common variables.
SET (CMAKE_CXX_STANDARD 11) SET (CMAKE_CXX_STANDARD 11)
SET (CMAKE_CXX_STANDARD_REQUIRED ON) SET (CMAKE_CXX_STANDARD_REQUIRED ON)
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wmissing-include-dirs -Wfloat-equal -Wshadow") SET (TARGET boolinqtest CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wmissing-include-dirs -Wfloat-equal -Wshadow")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wdouble-promotion -Winit-self -Weffc++ ") SET (TARGET boolinqtest CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wdouble-promotion -Winit-self -Weffc++ ")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Woverloaded-virtual -Wsign-promo") SET (TARGET boolinqtest CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Woverloaded-virtual -Wsign-promo")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wvla -Winvalid-pch -Winline -Wredundant-decls") SET (TARGET boolinqtest CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wvla -Winvalid-pch -Winline -Wredundant-decls")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wcast-align") SET (TARGET boolinqtest CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wcast-align")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wcast-qual -Wpointer-arith") SET (TARGET boolinqtest CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wcast-qual -Wpointer-arith")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wold-style-cast") SET (TARGET boolinqtest CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wold-style-cast")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage") SET (TARGET boolinqtest CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
SET (CMAKE_SHARED_LINKER_FLAGS "-fprofile-arcs -ftest-coverage") SET (CMAKE_SHARED_LINKER_FLAGS "-fprofile-arcs -ftest-coverage")
......
...@@ -246,19 +246,19 @@ TEST(Linq, Creations) ...@@ -246,19 +246,19 @@ TEST(Linq, Creations)
vec.push_back(4); vec.push_back(4);
vec.push_back(5); vec.push_back(5);
int arr[] = {1,2,3,4,5}; int arr[] = {1,2,3,4,5};
const int carr[] = {1,2,3,4,5}; //const int carr[] = {1,2,3,4,5};
int * ptr = static_cast<int *>(arr); int * ptr = static_cast<int *>(arr);
const int * cptr = const_cast<int *>(arr); //const int * cptr = const_cast<int *>(arr);
auto dst_vec = from(vec); auto dst_vec = from(vec);
auto dst_arr = from(arr); auto dst_arr = from(arr);
auto dst_carr = from(carr); //auto dst_carr = from(carr);
auto dst_ptr = from<int>(ptr, ptr+5); auto dst_ptr = from<int>(ptr, ptr+5);
auto dst_cptr = from<const int>(cptr, cptr+5); //auto dst_cptr = from<const int>(cptr, cptr+5);
auto dst_ptr_length = from<int>(ptr, 5); auto dst_ptr_length = from<int>(ptr, 5);
auto dst_cptr_length = from<const int>(cptr, 5); //auto dst_cptr_length = from<const int>(cptr, 5);
auto dst_vec_iter = from<int>(vec.begin(), vec.end()); auto dst_vec_iter = from<int>(vec.begin(), vec.end());
auto dst_vec_citer = from<const int>(vec.cbegin(), vec.cend()); //auto dst_vec_citer = from<const int>(vec.cbegin(), vec.cend());
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
......
...@@ -18,7 +18,7 @@ TEST(ToSet, Vector2Set) ...@@ -18,7 +18,7 @@ TEST(ToSet, Vector2Set)
auto rng = from(src); auto rng = from(src);
auto dst = rng.toSet(); auto dst = rng.toSet();
EXPECT_EQ(3, dst.size()); EXPECT_EQ(3U, dst.size());
EXPECT_NE(dst.end(), dst.find(1)); EXPECT_NE(dst.end(), dst.find(1));
EXPECT_NE(dst.end(), dst.find(2)); EXPECT_NE(dst.end(), dst.find(2));
EXPECT_NE(dst.end(), dst.find(3)); EXPECT_NE(dst.end(), dst.find(3));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment