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
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,16 @@ set(RAWTOACES_UTIL_LIB "rawtoaces_util")

set( CMAKE_MACOSX_RPATH 1 )

# Set strict compiler flags by default for all builds
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# set(warnings "/W4 /WX /EHsc")
add_compile_options ( /W0 )
# MSVC strict flags
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /WX /EHsc")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4 /WX")
add_compile_definitions( NOMINMAX )
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# GCC/Clang strict flags
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -pedantic")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Wall -Wextra -pedantic")
endif()

if (NOT CONFIGURED_ONCE)
Expand Down
23 changes: 9 additions & 14 deletions src/rawtoaces_core/define.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# include <windows.h>
//# define snprintf _snprintf
# define _CRT_SECURE_NO_WARNINGS
# define cmp_str stricmp
# define cmp_str _stricmp
#else
# define cmp_str strcasecmp
#endif
Expand All @@ -37,11 +37,6 @@
# define FALSE 0
#endif

#define FORI( val ) for ( int i = 0; i < val; i++ )
#define FORJ( val ) for ( int j = 0; j < val; j++ )
#define FORIJ( val1, val2 ) \
for ( int i = 0; i < val1; i++ ) \
for ( int j = 0; j < val2; j++ )
#define countSize( a ) ( static_cast<int>( sizeof( a ) / sizeof( ( a )[0] ) ) )

namespace rta
Expand Down Expand Up @@ -263,16 +258,16 @@ inline std::vector<std::string> openDir( std::string path = "." )
}

return paths;
};
}

// Function to covert upper-case to lower-case
inline void lowerCase( char *tex )
{
std::string tmp( tex );

FORI( tmp.size() )
tex[i] = tolower( tex[i] );
};
for ( size_t i = 0; i < tmp.size(); i++ )
tex[i] = static_cast<char>( tolower( tex[i] ) );
}

// Function to check if a value is numeric
inline bool isNumeric( const char *val )
Expand All @@ -283,21 +278,21 @@ inline bool isNumeric( const char *val )
return (
input.find_first_not_of( base.substr( 0, base.size() ) ) ==
std::string::npos );
};
}

// Function to check if a input is a alphabetic letter
inline bool isCTLetterDigit( const char c )
{
return (
( c >= 'a' && c <= 'z' ) || ( c >= 'A' && c <= 'Z' ) || ( c == '-' ) ||
isdigit( c ) );
};
}

// Function to check if a string is a valid input
// to represent color temperature(s) (e.g., D60, 3200K)
inline bool isValidCT( std::string str )
{
int i = 0;
size_t i = 0;
size_t length = str.length();

if ( length == 0 )
Expand Down Expand Up @@ -344,7 +339,7 @@ inline bool isValidCT( std::string str )
return false;

return true;
};
}

} // namespace core
} // namespace rta
Expand Down
Loading
Loading