From 0b440e1532addd05e47935cffba9dcfa2811b0e6 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Tue, 15 Apr 2025 23:11:50 +0300
Subject: [PATCH] showimage, showanim: constify col[] array
---
examples/showanim.c | 6 +++---
examples/showimage.c | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/examples/showanim.c b/examples/showanim.c
index 041343b43..a35b3b9c3 100644
--- a/examples/showanim.c
+++ b/examples/showanim.c
@@ -26,12 +26,12 @@
/* Draw a Gimpish background pattern to show transparency in the image */
static void draw_background(SDL_Renderer *renderer, int w, int h)
{
- SDL_Color col[2] = {
+ const SDL_Color col[2] = {
{ 0x66, 0x66, 0x66, 0xff },
- { 0x99, 0x99, 0x99, 0xff },
+ { 0x99, 0x99, 0x99, 0xff }
};
- int i, x, y;
SDL_Rect rect;
+ int i, x, y;
rect.w = 8;
rect.h = 8;
diff --git a/examples/showimage.c b/examples/showimage.c
index 24417d774..d6647e59d 100644
--- a/examples/showimage.c
+++ b/examples/showimage.c
@@ -26,12 +26,12 @@
/* Draw a Gimpish background pattern to show transparency in the image */
static void draw_background(SDL_Renderer *renderer, int w, int h)
{
- SDL_Color col[2] = {
+ const SDL_Color col[2] = {
{ 0x66, 0x66, 0x66, 0xff },
- { 0x99, 0x99, 0x99, 0xff },
+ { 0x99, 0x99, 0x99, 0xff }
};
- int i, x, y;
SDL_Rect rect;
+ int i, x, y;
rect.w = 8;
rect.h = 8;