From 329aa0b45524e4df0095125b15c064b35c3b80fe Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Sat, 20 May 2023 12:09:52 +0200 Subject: [PATCH] u03: Fix warnings by -Wextra MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- u03/dependencies/qdbmp/src/qdbmp.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/u03/dependencies/qdbmp/src/qdbmp.cpp b/u03/dependencies/qdbmp/src/qdbmp.cpp index 4821760..dcb04d6 100644 --- a/u03/dependencies/qdbmp/src/qdbmp.cpp +++ b/u03/dependencies/qdbmp/src/qdbmp.cpp @@ -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; }