Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTS)
# Additional setup for coverage
# https://gcovr.com/en/stable/guide/compiling.html#compiler-options
#
set(CMAKE_CXX_FLAGS "-fprofile-arcs -ftest-coverage -O0")
set(CMAKE_C_FLAGS "-fprofile-arcs -ftest-coverage -O0")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "-fprofile-arcs -ftest-coverage -O0")
set(CMAKE_C_FLAGS "-fprofile-arcs -ftest-coverage -O0")
endif()

enable_testing()
add_subdirectory(tests)
Expand Down
3 changes: 3 additions & 0 deletions src/windows/include/display_device/windows/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#pragma once

// the most stupid and smelly windows include
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>

// system includes
Expand Down
2 changes: 1 addition & 1 deletion src/windows/settings_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ namespace display_device::win_utils {
// It's hard to deal with floating values, so we just multiply it
// to keep 4 decimal places (if any) and let Windows deal with it!
// Genius idea if I'm being honest.
constexpr auto multiplier { static_cast<unsigned int>(std::pow(10, 4)) };
constexpr unsigned int multiplier { 10000 };
const double transformed_value { std::round(std::get<double>(value) * multiplier) };
return Rational { static_cast<unsigned int>(transformed_value), multiplier };
} };
Expand Down