From 128a1c40dbb890726ba7e8f641c1f3fbbca279ac Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Tue, 10 Nov 2026 04:40:52 +0200
Subject: [PATCH 78/78] SDL3_rotozoom.c: Replace NULL with nullptr

See RM #2474

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 client/gui-sdl3/SDL3_gfx/SDL3_rotozoom.c | 68 ++++++++++++------------
 1 file changed, 34 insertions(+), 34 deletions(-)

diff --git a/client/gui-sdl3/SDL3_gfx/SDL3_rotozoom.c b/client/gui-sdl3/SDL3_gfx/SDL3_rotozoom.c
index 8fd20a7920..dacd3383ff 100644
--- a/client/gui-sdl3/SDL3_gfx/SDL3_rotozoom.c
+++ b/client/gui-sdl3/SDL3_gfx/SDL3_rotozoom.c
@@ -199,10 +199,10 @@ static int _zoomSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int flipx, int
 	/*
 	* Allocate memory for row/column increments
 	*/
-	if ((sax = (int *) malloc((dst->w + 1) * sizeof(Uint32))) == NULL) {
+	if ((sax = (int *) malloc((dst->w + 1) * sizeof(Uint32))) == nullptr) {
 		return (-1);
 	}
-	if ((say = (int *) malloc((dst->h + 1) * sizeof(Uint32))) == NULL) {
+	if ((say = (int *) malloc((dst->h + 1) * sizeof(Uint32))) == nullptr) {
 		free(sax);
 		return (-1);
 	}
@@ -536,7 +536,7 @@ no scanning or interpolation takes place. Input surface must be 8/16/24/32 bit.
 \param src Source surface to rotate.
 \param numClockwiseTurns Number of clockwise 90 degree turns to apply to the source.
 
-\returns The new, rotated surface; or NULL for surfaces with incorrect input format.
+\returns The new, rotated surface; or nullptr for surfaces with incorrect input format.
 */
 SDL_Surface* rotateSurface90Degrees(SDL_Surface* src, int numClockwiseTurns)
 {
@@ -550,15 +550,15 @@ SDL_Surface* rotateSurface90Degrees(SDL_Surface* src, int numClockwiseTurns)
 
 	/* Has to be a valid surface pointer and be a Nbit surface where n is divisible by 8 */
 	if (!src) {
-		SDL_SetError("NULL source surface or source surface format");
-	    return NULL;
+		SDL_SetError("nullptr source surface or source surface format");
+	    return nullptr;
 	}
 
         details = SDL_GetPixelFormatDetails(src->format);
 
 	if ((details->bits_per_pixel % 8) != 0) {
 		SDL_SetError("Invalid source surface bit depth");
-	    return NULL;
+	    return nullptr;
 	}
 
 	/* normalize numClockwiseTurns */
@@ -579,7 +579,7 @@ SDL_Surface* rotateSurface90Degrees(SDL_Surface* src, int numClockwiseTurns)
 	dst = SDL_CreateSurface( newWidth, newHeight, SDL_PIXELFORMAT_RGBA8888);
 	if(!dst) {
 		SDL_SetError("Could not create destination surface");
-		return NULL;
+		return nullptr;
 	}
 
 	if (SDL_MUSTLOCK(src)) {
@@ -803,8 +803,8 @@ SDL_Surface *rotozoomSurfaceXY(SDL_Surface * src, double angle, double zoomx, do
 	/*
 	* Sanity check
 	*/
-	if (src == NULL) {
-		return (NULL);
+	if (src == nullptr) {
+		return (nullptr);
 	}
 
         details = SDL_GetPixelFormatDetails(src->format);
@@ -826,7 +826,7 @@ SDL_Surface *rotozoomSurfaceXY(SDL_Surface * src, double angle, double zoomx, do
 		rz_src =
 			SDL_CreateSurface(src->w, src->h, SDL_PIXELFORMAT_RGBA8888);
 
-		SDL_BlitSurface(src, NULL, rz_src, NULL);
+		SDL_BlitSurface(src, nullptr, rz_src, nullptr);
 
 		src_converted = 1;
 	}
@@ -872,7 +872,7 @@ SDL_Surface *rotozoomSurfaceXY(SDL_Surface * src, double angle, double zoomx, do
 		/*
 		* Alloc space to completely contain the rotated surface
 		*/
-		rz_dst = NULL;
+		rz_dst = nullptr;
 
                 /*
                  * Target surface is 32bit with source RGBA/ABGR ordering
@@ -882,8 +882,8 @@ SDL_Surface *rotozoomSurfaceXY(SDL_Surface * src, double angle, double zoomx, do
                                     rz_src->format);
 
 		/* Check target */
-		if (rz_dst == NULL)
-			return NULL;
+		if (rz_dst == nullptr)
+			return nullptr;
 
 		/* Adjust for guard rows */
 		rz_dst->h = dstheight;
@@ -931,7 +931,7 @@ SDL_Surface *rotozoomSurfaceXY(SDL_Surface * src, double angle, double zoomx, do
 		/*
 		* Alloc space to completely contain the zoomed surface
 		*/
-		rz_dst = NULL;
+		rz_dst = nullptr;
 
                 /*
                  * Target surface is 32bit with source RGBA/ABGR ordering
@@ -941,8 +941,8 @@ SDL_Surface *rotozoomSurfaceXY(SDL_Surface * src, double angle, double zoomx, do
                                     rz_src->format);
 
 		/* Check target */
-		if (rz_dst == NULL)
-			return NULL;
+		if (rz_dst == nullptr)
+			return nullptr;
 
 		/* Adjust for guard rows */
 		rz_dst->h = dstheight;
@@ -1058,8 +1058,8 @@ SDL_Surface *zoomSurface(SDL_Surface * src, double zoomx, double zoomy, int smoo
 	/*
 	* Sanity check
 	*/
-	if (src == NULL)
-		return (NULL);
+	if (src == nullptr)
+		return (nullptr);
 
         details = SDL_GetPixelFormatDetails(src->format);
 
@@ -1080,10 +1080,10 @@ SDL_Surface *zoomSurface(SDL_Surface * src, double zoomx, double zoomy, int smoo
 		rz_src =
 			SDL_CreateSurface(src->w, src->h,
                                           SDL_PIXELFORMAT_RGBA8888);
-		if (rz_src == NULL) {
-			return NULL;
+		if (rz_src == nullptr) {
+			return nullptr;
 		}
-		SDL_BlitSurface(src, NULL, rz_src, NULL);
+		SDL_BlitSurface(src, nullptr, rz_src, nullptr);
 		src_converted = 1;
 	}
 
@@ -1098,7 +1098,7 @@ SDL_Surface *zoomSurface(SDL_Surface * src, double zoomx, double zoomy, int smoo
 	/*
 	* Alloc space to completely contain the zoomed surface
 	*/
-	rz_dst = NULL;
+	rz_dst = nullptr;
 
         /*
          * Target surface is 32bit with source RGBA/ABGR ordering
@@ -1108,14 +1108,14 @@ SDL_Surface *zoomSurface(SDL_Surface * src, double zoomx, double zoomy, int smoo
                             rz_src->format);
 
 	/* Check target */
-	if (rz_dst == NULL) {
+	if (rz_dst == nullptr) {
 		/*
 		* Cleanup temp surface
 		*/
 		if (src_converted) {
 			SDL_DestroySurface(rz_src);
 		}
-		return NULL;
+		return nullptr;
 	}
 
 	/* Adjust for guard rows */
@@ -1178,7 +1178,7 @@ SDL_Surface *shrinkSurface(SDL_Surface *src, int factorx, int factory)
 {
 	int result;
 	SDL_Surface *rz_src;
-	SDL_Surface *rz_dst = NULL;
+	SDL_Surface *rz_dst = nullptr;
 	int dstwidth, dstheight;
 	int src_converted;
 	int haveError = 0;
@@ -1187,8 +1187,8 @@ SDL_Surface *shrinkSurface(SDL_Surface *src, int factorx, int factory)
 	/*
 	* Sanity check
 	*/
-	if (src == NULL) {
-		return (NULL);
+	if (src == nullptr) {
+		return (nullptr);
 	}
 
         details = SDL_GetPixelFormatDetails(src->format);
@@ -1209,12 +1209,12 @@ SDL_Surface *shrinkSurface(SDL_Surface *src, int factorx, int factory)
 		*/
 		rz_src = SDL_CreateSurface(src->w, src->h,
                                            SDL_PIXELFORMAT_RGBA8888);
-		if (rz_src==NULL) {
+		if (rz_src==nullptr) {
 			haveError = 1;
 			goto exitShrinkSurface;
 		}
 
-		SDL_BlitSurface(src, NULL, rz_src, NULL);
+		SDL_BlitSurface(src, nullptr, rz_src, nullptr);
 		src_converted = 1;
 	}
 
@@ -1247,7 +1247,7 @@ SDL_Surface *shrinkSurface(SDL_Surface *src, int factorx, int factory)
                             rz_src->format);
 
 	/* Check target */
-	if (rz_dst == NULL) {
+	if (rz_dst == nullptr) {
 		haveError = 1;
 		goto exitShrinkSurface;
 	}
@@ -1263,13 +1263,13 @@ SDL_Surface *shrinkSurface(SDL_Surface *src, int factorx, int factory)
          * Call the 32bit transformation routine to do the shrinking (using alpha)
          */
         result = _shrinkSurfaceRGBA(rz_src, rz_dst, factorx, factory);
-        if ((result!=0) || (rz_dst==NULL)) {
+        if ((result!=0) || (rz_dst==nullptr)) {
           haveError = 1;
           goto exitShrinkSurface;
         }
 
 exitShrinkSurface:
-	if (rz_src!=NULL) {
+	if (rz_src!=nullptr) {
 		/*
 		* Unlock source surface
 		*/
@@ -1287,10 +1287,10 @@ exitShrinkSurface:
 
 	/* Check error state; maybe need to cleanup destination */
 	if (haveError==1) {
-		if (rz_dst!=NULL) {
+		if (rz_dst!=nullptr) {
 			SDL_DestroySurface(rz_dst);
 		}
-		rz_dst=NULL;
+		rz_dst=nullptr;
 	}
 
 	/*
-- 
2.53.0

