Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 264b227

Browse files
committedApr 15, 2025·
showimage, showanim: constify col[] array
1 parent b2eed83 commit 264b227

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed
 

‎examples/showanim.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727
/* Draw a Gimpish background pattern to show transparency in the image */
2828
static void draw_background(SDL_Renderer *renderer, int w, int h)
2929
{
30-
SDL_Color col[2] = {
30+
const SDL_Color col[2] = {
3131
{ 0x66, 0x66, 0x66, 0xff },
32-
{ 0x99, 0x99, 0x99, 0xff },
32+
{ 0x99, 0x99, 0x99, 0xff }
3333
};
34-
int i, x, y;
35-
SDL_FRect rect;
3634
const int dx = 8, dy = 8;
35+
SDL_FRect rect;
36+
int i, x, y;
3737

3838
rect.w = (float)dx;
3939
rect.h = (float)dy;

‎examples/showimage.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727
/* Draw a Gimpish background pattern to show transparency in the image */
2828
static void draw_background(SDL_Renderer *renderer, int w, int h)
2929
{
30-
SDL_Color col[2] = {
30+
const SDL_Color col[2] = {
3131
{ 0x66, 0x66, 0x66, 0xff },
32-
{ 0x99, 0x99, 0x99, 0xff },
32+
{ 0x99, 0x99, 0x99, 0xff }
3333
};
34-
int i, x, y;
35-
SDL_FRect rect;
3634
const int dx = 8, dy = 8;
35+
SDL_FRect rect;
36+
int i, x, y;
3737

3838
rect.w = (float)dx;
3939
rect.h = (float)dy;

0 commit comments

Comments
 (0)
Please sign in to comment.