u03: Fix warnings by -Wextra

This does not fix one instance of -Wdeprecated-copy, because I don’t
know how to resolve it.

The only other warnings still existing are for the unimplemented tool.
This commit is contained in:
Simon Bruder 2023-05-20 12:09:52 +02:00
parent 0958009b4c
commit 329aa0b455

View file

@ -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;
}