# SDL: testcustomcursor: fix Wswitch warning by casting the arg to an int

**URL:** <https://discourse.libsdl.org/t/sdl-testcustomcursor-fix-wswitch-warning-by-casting-the-arg-to-an-int/39210>\
**Category:** SDL Commits\
**Created:** [October 8, 2022, 9:42pm UTC](https://discourse.libsdl.org/t/sdl-testcustomcursor-fix-wswitch-warning-by-casting-the-arg-to-an-int/39210 "2022-10-08T21:42:45Z")\
**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:** [October 8, 2022, 9:42pm UTC](https://discourse.libsdl.org/t/sdl-testcustomcursor-fix-wswitch-warning-by-casting-the-arg-to-an-int/39210/1 "2022-10-08T21:42:45Z")

</div>

> <https://github.com/libsdl-org/SDL/commit/a905db9d65dac2b72b794ef417d56e5dea5a152c>

```diff
From a905db9d65dac2b72b794ef417d56e5dea5a152c Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Wed, 5 Oct 2022 23:59:01 +0200
Subject: [PATCH] testcustomcursor: fix Wswitch warning by casting the arg to
 an int

---
 test/testcustomcursor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/testcustomcursor.c b/test/testcustomcursor.c
index 698d31f9bd78..b3ffdbc423f5 100644
--- a/test/testcustomcursor.c
+++ b/test/testcustomcursor.c
@@ -169,7 +169,7 @@ loop()
 
                 SDL_SetCursor(cursors[current_cursor]);
 
- switch (cursor_types[current_cursor]) {
+ switch ((int)cursor_types[current_cursor]) {
                     case (SDL_SystemCursor)-1: SDL_Log("Custom cursor"); break;
                     case SDL_SYSTEM_CURSOR_ARROW: SDL_Log("Arrow"); break;
                     case SDL_SYSTEM_CURSOR_IBEAM: SDL_Log("I-beam"); break;

```
