Skip to content

Commit ea89fac

Browse files
committed
Minor refactoring.
1 parent 5a60906 commit ea89fac

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,20 @@ set(CMAKE_CXX_STANDARD 20)
55

66
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
77

8-
function(target_set_warnings target)
8+
function(target_set_options target)
99
target_compile_options(${target} PRIVATE $<$<CXX_COMPILER_ID:MSVC>:/W4> $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wall -Wextra -pedantic>)
1010
endfunction()
1111

1212
file(GLOB_RECURSE NWTREES_CORE_SRC src/nwtrees/*.cpp src/nwtrees/*.hpp)
1313
add_library(nwtrees_core ${NWTREES_CORE_SRC})
14-
target_set_warnings(nwtrees_core)
14+
target_set_options(nwtrees_core)
1515

1616
file(GLOB_RECURSE NWTREES_COMPILER_SRC src/compiler/*.cpp src/compiler/*.hpp)
1717
add_executable(nwtrees ${NWTREES_COMPILER_SRC})
1818
target_link_libraries(nwtrees nwtrees_core)
19-
target_set_warnings(nwtrees)
19+
target_set_options(nwtrees)
2020

2121
file(GLOB_RECURSE NWTREES_TESTS_SRC tests/*.cpp tests/*.hpp)
2222
add_executable(nwtrees_tests ${NWTREES_TESTS_SRC})
2323
target_link_libraries(nwtrees_tests nwtrees_core)
24+
target_set_options(nwtrees_tests)

tests/Lexer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ TEST_CLASS(Lexer)
158158
TEST_EXPECT(token.type == nwtrees::Token::Literal);
159159
TEST_EXPECT(token.literal == nwtrees::Literal::Float);
160160

161-
const float as_flt = std::atof(literals[i]);
161+
const float as_flt = (float)std::atof(literals[i]);
162162
TEST_EXPECT(token.literal_data.flt == as_flt);
163163
}
164164
}

0 commit comments

Comments
 (0)