File: Remove-initial-declaration-from-for-loop.patch

package info (click to toggle)
libsdl1.2 1.2.15%2Bdfsg2-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 17,596 kB
  • sloc: ansic: 128,539; cpp: 11,192; sh: 9,887; asm: 2,553; objc: 2,128; makefile: 349; csh: 248; perl: 35; pascal: 8
file content (26 lines) | stat: -rw-r--r-- 997 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From: Cameron Cawley <ccawley2011@gmail.com>
Date: Wed, 24 Apr 2019 20:20:15 +0100
Subject: Remove initial declaration from for loop

Origin: upstream, commit:https://github.com/libsdl-org/SDL-1.2/commit/51bb3400817c422715614c335e4740a8388c4662
---
 src/video/SDL_pixels.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c
index 44626b7..17f1a71 100644
--- a/src/video/SDL_pixels.c
+++ b/src/video/SDL_pixels.c
@@ -292,10 +292,11 @@ void SDL_DitherColors(SDL_Color *colors, int bpp)
 Uint16 SDL_CalculatePitch(SDL_Surface *surface)
 {
 	unsigned int pitch = 0;
+	Uint8 byte;
 
 	/* Surface should be 4-byte aligned for speed */
 	/* The code tries to prevent from an Uint16 overflow. */;
-	for (Uint8 byte = surface->format->BytesPerPixel; byte; byte--) {
+	for (byte = surface->format->BytesPerPixel; byte; byte--) {
 		pitch += (unsigned int)surface->w;
 		if (pitch < surface->w) {
 			SDL_SetError("A scanline is too wide");