Skip to content

Commit

Permalink
Fix CMakeLists.txt and image_class.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
osamu620 committed Jun 13, 2024
1 parent 47118d2 commit 41a29ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ else()
endif()
enable_language(CXX)

set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

############################################################
# Parse version file
# credit: https://stackoverflow.com/a/47084079 and OpenJPH project https://github.com/aous72/OpenJPH
Expand Down Expand Up @@ -185,9 +188,6 @@ endif()
# add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/source/thirdparty/highway
# EXCLUDE_FROM_ALL)

set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

# INSTALL related settings
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
Expand Down
3 changes: 2 additions & 1 deletion source/apps/imgcmp/image_class.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ class image {
int read_pnmpgx(const char *name) {
constexpr char SP = ' ';
constexpr char LF = '\n';
constexpr char CR = 13;

FILE *fp = fopen(name, "rb");
if (fp == nullptr) {
Expand Down Expand Up @@ -222,7 +223,7 @@ class image {
}
}
// read numerical value
while (c != SP && c != LF) {
while (c != SP && c != LF && c != CR) {
val *= 10;
val += c - '0';
c = fgetc(fp);
Expand Down

0 comments on commit 41a29ac

Please sign in to comment.