# SDL\_image: showimage, showanim: constify col\[\] array (0b440)

**URL:** <https://discourse.libsdl.org/t/sdl-image-showimage-showanim-constify-col-array-0b440/59242>\
**Category:** SDL Commits\
**Created:** [April 16, 2025, 4:50pm UTC](https://discourse.libsdl.org/t/sdl-image-showimage-showanim-constify-col-array-0b440/59242 "2025-04-16T16:50:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [April 16, 2025, 4:50pm UTC](https://discourse.libsdl.org/t/sdl-image-showimage-showanim-constify-col-array-0b440/59242/1 "2025-04-16T16:50:18Z")

</div>

> <https://github.com/libsdl-org/SDL_image/commit/0b440e1532addd05e47935cffba9dcfa2811b0e6>

```diff
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;

```
