Compare commits
3 Commits
194d7bb135
...
002ef8d707
Author | SHA1 | Date |
---|---|---|
Simon Bruder | 002ef8d707 | |
Simon Bruder | 329aa0b455 | |
Simon Bruder | 0958009b4c |
|
@ -7,6 +7,11 @@ set(CMAKE_CXX_STANDARD 17)
|
|||
# On GNU this has the effect of passing -std=c++11 instead of -std=gnu++11
|
||||
set(CMAKE_CXX_EXTENSIONS no)
|
||||
|
||||
# Enable all compiler warnings (and make them errors) on GNU/Clang platforms
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "^(GNU|Clang)$")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Werror")
|
||||
endif()
|
||||
|
||||
add_library(tree node.cpp)
|
||||
add_executable(main main.cpp)
|
||||
target_link_libraries(main tree)
|
||||
|
|
|
@ -427,7 +427,7 @@ void BMP_GetPixelRGB( BMP* bmp, UINT x, UINT y, UCHAR* r, UCHAR* g, UCHAR* b )
|
|||
UINT bytes_per_row;
|
||||
UCHAR bytes_per_pixel;
|
||||
|
||||
if ( bmp == NULL || x < 0 || x >= bmp->Header.Width || y < 0 || y >= bmp->Header.Height )
|
||||
if ( bmp == NULL || x >= bmp->Header.Width || y >= bmp->Header.Height )
|
||||
{
|
||||
BMP_LAST_ERROR_CODE = BMP_INVALID_ARGUMENT;
|
||||
}
|
||||
|
@ -467,7 +467,7 @@ void BMP_SetPixelRGB( BMP* bmp, UINT x, UINT y, UCHAR r, UCHAR g, UCHAR b )
|
|||
UINT bytes_per_row;
|
||||
UCHAR bytes_per_pixel;
|
||||
|
||||
if ( bmp == NULL || x < 0 || x >= bmp->Header.Width || y < 0 || y >= bmp->Header.Height )
|
||||
if ( bmp == NULL || x >= bmp->Header.Width || y >= bmp->Header.Height )
|
||||
{
|
||||
BMP_LAST_ERROR_CODE = BMP_INVALID_ARGUMENT;
|
||||
}
|
||||
|
@ -505,7 +505,7 @@ void BMP_GetPixelIndex( BMP* bmp, UINT x, UINT y, UCHAR* val )
|
|||
UCHAR* pixel;
|
||||
UINT bytes_per_row;
|
||||
|
||||
if ( bmp == NULL || x < 0 || x >= bmp->Header.Width || y < 0 || y >= bmp->Header.Height )
|
||||
if ( bmp == NULL || x >= bmp->Header.Width || y >= bmp->Header.Height )
|
||||
{
|
||||
BMP_LAST_ERROR_CODE = BMP_INVALID_ARGUMENT;
|
||||
}
|
||||
|
@ -539,7 +539,7 @@ void BMP_SetPixelIndex( BMP* bmp, UINT x, UINT y, UCHAR val )
|
|||
UCHAR* pixel;
|
||||
UINT bytes_per_row;
|
||||
|
||||
if ( bmp == NULL || x < 0 || x >= bmp->Header.Width || y < 0 || y >= bmp->Header.Height )
|
||||
if ( bmp == NULL || x >= bmp->Header.Width || y >= bmp->Header.Height )
|
||||
{
|
||||
BMP_LAST_ERROR_CODE = BMP_INVALID_ARGUMENT;
|
||||
}
|
||||
|
|
Reference in New Issue