From 264b2272c2078d7e853d71a538567b6be7fb02f5 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Tue, 15 Apr 2025 23:11:10 +0300
Subject: [PATCH] showimage, showanim: constify col[] array
---
examples/showanim.c | 8 ++++----
examples/showimage.c | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/examples/showanim.c b/examples/showanim.c
index ea90a0100..06c38268a 100644
--- a/examples/showanim.c
+++ b/examples/showanim.c
@@ -27,13 +27,13 @@
/* 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_FRect rect;
const int dx = 8, dy = 8;
+ SDL_FRect rect;
+ int i, x, y;
rect.w = (float)dx;
rect.h = (float)dy;
diff --git a/examples/showimage.c b/examples/showimage.c
index 94ec6f734..8c4c631fb 100644
--- a/examples/showimage.c
+++ b/examples/showimage.c
@@ -27,13 +27,13 @@
/* 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_FRect rect;
const int dx = 8, dy = 8;
+ SDL_FRect rect;
+ int i, x, y;
rect.w = (float)dx;
rect.h = (float)dy;