SDL: os2: fix multiple gcc -Wformat warnings.

From f9954da42cead9397a2e43b77033adff97d1dbbc Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Thu, 1 Oct 2026 23:55:02 +0300
Subject: [PATCH] os2: fix multiple gcc -Wformat warnings.

---
 src/audio/os2/SDL_os2audio.c      |  8 +++-----
 src/audio/os2/SDL_os2audio.h      |  3 +--
 src/core/os2/geniconv/geniconv.c  |  3 ---
 src/core/os2/geniconv/geniconv.h  |  3 ---
 src/core/os2/geniconv/os2cp.c     |  4 +---
 src/core/os2/geniconv/os2cp.h     |  2 --
 src/core/os2/geniconv/os2iconv.c  |  4 +---
 src/core/os2/geniconv/sys2utf8.c  |  4 +---
 src/core/os2/geniconv/test.c      |  2 --
 src/loadso/os2/SDL_sysloadso.c    |  4 ++--
 src/thread/os2/SDL_sysmutex.c     | 10 +++++-----
 src/thread/os2/SDL_syssem.c       | 14 +++++++-------
 src/thread/os2/SDL_systhread.c    |  4 ++--
 src/thread/os2/SDL_systls.c       |  4 ++--
 src/timer/os2/SDL_systimer.c      |  8 ++++----
 src/video/os2/SDL_os2dive.c       | 20 +++++++++-----------
 src/video/os2/SDL_os2messagebox.c |  2 --
 src/video/os2/SDL_os2messagebox.h |  2 --
 src/video/os2/SDL_os2mouse.c      |  8 +++-----
 src/video/os2/SDL_os2output.h     |  2 --
 src/video/os2/SDL_os2util.c       |  2 --
 src/video/os2/SDL_os2util.h       |  3 ---
 src/video/os2/SDL_os2video.c      | 14 ++++++--------
 src/video/os2/SDL_os2video.h      |  3 +--
 src/video/os2/SDL_os2vman.c       |  8 +++-----
 25 files changed, 51 insertions(+), 90 deletions(-)

diff --git a/src/audio/os2/SDL_os2audio.c b/src/audio/os2/SDL_os2audio.c
index d966d15e67308..55b7c6bde47a0 100644
--- a/src/audio/os2/SDL_os2audio.c
+++ b/src/audio/os2/SDL_os2audio.c
@@ -72,7 +72,7 @@ static LONG APIENTRY cbAudioWriteEvent(ULONG ulStatus, PMCI_MIX_BUFFER pBuffer,
     SDL_PrivateAudioData *pAData = (SDL_PrivateAudioData *)_this->hidden;
     ULONG   ulRC;
 
-    debug_os2("cbAudioWriteEvent: ulStatus = %lu, pBuffer = %p, ulFlags = %#lX",ulStatus,pBuffer,ulFlags);
+    debug_os2("cbAudioWriteEvent: ulStatus = %lu, pBuffer = %p, ulFlags = %lX",ulStatus,pBuffer,ulFlags);
 
     if (pAData->ulState == 2)
     {
@@ -107,7 +107,7 @@ static LONG APIENTRY cbAudioReadEvent(ULONG ulStatus, PMCI_MIX_BUFFER pBuffer,
     SDL_PrivateAudioData *pAData = (SDL_PrivateAudioData *)_this->hidden;
     ULONG   ulRC;
 
-    debug_os2("cbAudioReadEvent: ulStatus = %lu, pBuffer = %p, ulFlags = %#lX",ulStatus,pBuffer,ulFlags);
+    debug_os2("cbAudioReadEvent: ulStatus = %lu, pBuffer = %p, ulFlags = %lX",ulStatus,pBuffer,ulFlags);
 
     if (pAData->ulState == 2)
     {
@@ -317,7 +317,7 @@ static int OS2_CaptureFromDevice(_THIS,void *buffer,int buflen)
     SDL_memcpy(buffer,pMixBuffer->pBuffer, len);
     pAData->pDrainBuffer = _getNextBuffer(pAData, pMixBuffer);
 
-    debug_os2("buflen = %u, ulBufferLength = %lu",buflen,pMixBuffer->ulBufferLength);
+    debug_os2("buflen = %d, ulBufferLength = %lu",buflen,pMixBuffer->ulBufferLength);
 
     return len;
 }
@@ -597,5 +597,3 @@ AudioBootStrap OS2AUDIO_bootstrap = {
 };
 
 #endif /* SDL_AUDIO_DRIVER_OS2 */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/audio/os2/SDL_os2audio.h b/src/audio/os2/SDL_os2audio.h
index f7704a12b056e..a749c8df42da6 100644
--- a/src/audio/os2/SDL_os2audio.h
+++ b/src/audio/os2/SDL_os2audio.h
@@ -18,6 +18,7 @@
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
 */
+
 #include "../../SDL_internal.h"
 
 #ifndef SDL_os2mm_h_
@@ -51,5 +52,3 @@ typedef struct SDL_PrivateAudioData
 } SDL_PrivateAudioData;
 
 #endif /* SDL_os2mm_h_ */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/core/os2/geniconv/geniconv.c b/src/core/os2/geniconv/geniconv.c
index 04edaebd35e51..1dc45379f05fc 100644
--- a/src/core/os2/geniconv/geniconv.c
+++ b/src/core/os2/geniconv/geniconv.c
@@ -21,7 +21,6 @@
 
 /*
   Universal iconv implementation for OS/2.
-
   Andrey Vasilkin, 2016.
 */
 
@@ -157,5 +156,3 @@ int libiconv_close(iconv_t cd)
 {
     return fn_iconv_close(cd);
 }
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/core/os2/geniconv/geniconv.h b/src/core/os2/geniconv/geniconv.h
index e75e9b7c22438..0cac8aa6041b6 100644
--- a/src/core/os2/geniconv/geniconv.h
+++ b/src/core/os2/geniconv/geniconv.h
@@ -21,7 +21,6 @@
 
 /*
   Universal iconv implementation for OS/2.
-
   Andrey Vasilkin, 2016.
 */
 
@@ -81,5 +80,3 @@ char *StrUTF8New(int to_utf8, char *str, int c_str);
 void StrUTF8Free(char *str);
 
 #endif /* GENICONV_H */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/core/os2/geniconv/os2cp.c b/src/core/os2/geniconv/os2cp.c
index 086ba4ff5d464..83ddc1f7b84f2 100644
--- a/src/core/os2/geniconv/os2cp.c
+++ b/src/core/os2/geniconv/os2cp.c
@@ -27,7 +27,7 @@
 
 #ifndef GENICONV_STANDALONE
 #include "../../../SDL_internal.h"
-#else
+#else  /**/
 #include <string.h>
 #include <ctype.h>
 #define SDL_isspace isspace
@@ -412,5 +412,3 @@ unsigned long os2cpFromName(char *cp)
 
     return (lFound == -1)? 0 : aName2CP[lFound].ulCode;
 }
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/core/os2/geniconv/os2cp.h b/src/core/os2/geniconv/os2cp.h
index e859e3eff3cbc..96f8f22c889bc 100644
--- a/src/core/os2/geniconv/os2cp.h
+++ b/src/core/os2/geniconv/os2cp.h
@@ -28,5 +28,3 @@ char *os2cpToName(unsigned long cp);
 unsigned long os2cpFromName(char *cp);
 
 #endif /* OS2CP_H */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/core/os2/geniconv/os2iconv.c b/src/core/os2/geniconv/os2iconv.c
index e2cff262293bd..86a23dfc249ce 100644
--- a/src/core/os2/geniconv/os2iconv.c
+++ b/src/core/os2/geniconv/os2iconv.c
@@ -103,7 +103,7 @@ static int uconv_open(const char *code, UconvObject *uobj)
     if (rc != ULS_SUCCESS) {
         unsigned long cp = os2cpFromName((char *)code);
         char cp_name[16];
-        if (cp != 0 && SDL_snprintf(cp_name, sizeof(cp_name), "IBM-%u", cp) > 0) {
+        if (cp != 0 && SDL_snprintf(cp_name, sizeof(cp_name), "IBM-%lu", cp) > 0) {
             rc = _createUconvObj(cp_name, uobj);
         }
     }
@@ -282,5 +282,3 @@ int _System os2_iconv_close(iconv_t cd)
 
     return 0;
 }
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/core/os2/geniconv/sys2utf8.c b/src/core/os2/geniconv/sys2utf8.c
index cf1a308a3895a..fea9075849c31 100644
--- a/src/core/os2/geniconv/sys2utf8.c
+++ b/src/core/os2/geniconv/sys2utf8.c
@@ -23,7 +23,7 @@
 
 #ifndef GENICONV_STANDALONE
 #include "../../../SDL_internal.h"
-#else
+#else  /**/
 #include <stdlib.h>
 #define SDL_malloc malloc
 #define SDL_realloc realloc
@@ -115,5 +115,3 @@ void StrUTF8Free(char *str)
 {
     SDL_free(str);
 }
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/core/os2/geniconv/test.c b/src/core/os2/geniconv/test.c
index e6912a2e78eef..5e2279b7e3c2b 100644
--- a/src/core/os2/geniconv/test.c
+++ b/src/core/os2/geniconv/test.c
@@ -65,5 +65,3 @@ int main(void)
     puts("Done.");
     return 0;
 }
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/loadso/os2/SDL_sysloadso.c b/src/loadso/os2/SDL_sysloadso.c
index 8fc6940e420b9..5ac6f25a5c5e3 100644
--- a/src/loadso/os2/SDL_sysloadso.c
+++ b/src/loadso/os2/SDL_sysloadso.c
@@ -56,7 +56,7 @@ void *SDL_LoadObject(const char *sofile)
         }
     }
     if (ulRC != NO_ERROR) {
-        SDL_SetError("Failed loading %s: %s (E%u)", sofile, acError, ulRC);
+        SDL_SetError("Failed loading %s: %s (E%lu)", sofile, acError, ulRC);
         hModule = NULLHANDLE;
     }
     SDL_free(pszModName);
@@ -81,7 +81,7 @@ void *SDL_LoadFunction(void *handle, const char *name)
         SDL_small_free(_name, isstack);
     }
     if (ulRC != NO_ERROR) {
-        SDL_SetError("Failed loading procedure %s (E%u)", name, ulRC);
+        SDL_SetError("Failed loading procedure %s (E%lu)", name, ulRC);
         return NULL;
     }
 
diff --git a/src/thread/os2/SDL_sysmutex.c b/src/thread/os2/SDL_sysmutex.c
index 17c4035477e6e..219ba310c5a5e 100644
--- a/src/thread/os2/SDL_sysmutex.c
+++ b/src/thread/os2/SDL_sysmutex.c
@@ -44,7 +44,7 @@ SDL_mutex *SDL_CreateMutex(void)
 
     ulRC = DosCreateMutexSem(NULL, &hMtx, 0, FALSE);
     if (ulRC != NO_ERROR) {
-        debug_os2("DosCreateMutexSem(), rc = %u", ulRC);
+        debug_os2("DosCreateMutexSem(), rc = %lu", ulRC);
         return NULL;
     }
 
@@ -58,7 +58,7 @@ void SDL_DestroyMutex(SDL_mutex * mutex)
     if (hMtx != NULLHANDLE) {
         const ULONG ulRC = DosCloseMutexSem(hMtx);
         if (ulRC != NO_ERROR) {
-            debug_os2("DosCloseMutexSem(), rc = %u", ulRC);
+            debug_os2("DosCloseMutexSem(), rc = %lu", ulRC);
         }
     }
 }
@@ -74,7 +74,7 @@ int SDL_LockMutex(SDL_mutex * mutex) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang does
 
     ulRC = DosRequestMutexSem(hMtx, SEM_INDEFINITE_WAIT);
     if (ulRC != NO_ERROR) {
-      debug_os2("DosRequestMutexSem(), rc = %u", ulRC);
+      debug_os2("DosRequestMutexSem(), rc = %lu", ulRC);
       return -1;
     }
 
@@ -96,7 +96,7 @@ int SDL_TryLockMutex(SDL_mutex * mutex)
         return SDL_MUTEX_TIMEDOUT;
 
     if (ulRC != NO_ERROR) {
-        debug_os2("DosRequestMutexSem(), rc = %u", ulRC);
+        debug_os2("DosRequestMutexSem(), rc = %lu", ulRC);
         return -1;
     }
 
@@ -114,7 +114,7 @@ int SDL_UnlockMutex(SDL_mutex * mutex) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang do
 
     ulRC = DosReleaseMutexSem(hMtx);
     if (ulRC != NO_ERROR)
-        return SDL_SetError("DosReleaseMutexSem(), rc = %u", ulRC);
+        return SDL_SetError("DosReleaseMutexSem(), rc = %lu", ulRC);
 
     return 0;
 }
diff --git a/src/thread/os2/SDL_syssem.c b/src/thread/os2/SDL_syssem.c
index c18588b0a226a..f77bf0e349bd0 100644
--- a/src/thread/os2/SDL_syssem.c
+++ b/src/thread/os2/SDL_syssem.c
@@ -51,14 +51,14 @@ SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
 
     ulRC = DosCreateEventSem(NULL, &pSDLSem->hEv, DCE_AUTORESET, FALSE);
     if (ulRC != NO_ERROR) {
-        debug_os2("DosCreateEventSem(), rc = %u", ulRC);
+        debug_os2("DosCreateEventSem(), rc = %lu", ulRC);
         SDL_free(pSDLSem);
         return NULL;
     }
 
     ulRC = DosCreateMutexSem(NULL, &pSDLSem->hMtx, 0, FALSE);
     if (ulRC != NO_ERROR) {
-        debug_os2("DosCreateMutexSem(), rc = %u", ulRC);
+        debug_os2("DosCreateMutexSem(), rc = %lu", ulRC);
         DosCloseEventSem(pSDLSem->hEv);
         SDL_free(pSDLSem);
         return NULL;
@@ -94,7 +94,7 @@ int SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout)
     while (TRUE) {
         ulRC = DosRequestMutexSem(sem->hMtx, SEM_INDEFINITE_WAIT);
         if (ulRC != NO_ERROR)
-            return SDL_SetError("DosRequestMutexSem() failed, rc = %u", ulRC);
+            return SDL_SetError("DosRequestMutexSem() failed, rc = %lu", ulRC);
 
         cPost = sem->cPost;
         if (sem->cPost != 0)
@@ -120,7 +120,7 @@ int SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout)
             return SDL_MUTEX_TIMEDOUT;
 
         if (ulRC != NO_ERROR)
-            return SDL_SetError("DosWaitEventSem() failed, rc = %u", ulRC);
+            return SDL_SetError("DosWaitEventSem() failed, rc = %lu", ulRC);
     }
 
     return 0;
@@ -147,7 +147,7 @@ Uint32 SDL_SemValue(SDL_sem * sem)
 
     ulRC = DosRequestMutexSem(sem->hMtx, SEM_INDEFINITE_WAIT);
     if (ulRC != NO_ERROR)
-        return SDL_SetError("DosRequestMutexSem() failed, rc = %u", ulRC);
+        return SDL_SetError("DosRequestMutexSem() failed, rc = %lu", ulRC);
 
     ulRC = sem->cPost;
     DosReleaseMutexSem(sem->hMtx);
@@ -164,13 +164,13 @@ int SDL_SemPost(SDL_sem * sem)
 
     ulRC = DosRequestMutexSem(sem->hMtx, SEM_INDEFINITE_WAIT);
     if (ulRC != NO_ERROR)
-        return SDL_SetError("DosRequestMutexSem() failed, rc = %u", ulRC);
+        return SDL_SetError("DosRequestMutexSem() failed, rc = %lu", ulRC);
 
     sem->cPost++;
 
     ulRC = DosPostEventSem(sem->hEv);
     if (ulRC != NO_ERROR && ulRC != ERROR_ALREADY_POSTED) {
-        debug_os2("DosPostEventSem() failed, rc = %u", ulRC);
+        debug_os2("DosPostEventSem() failed, rc = %lu", ulRC);
     }
 
     DosReleaseMutexSem(sem->hMtx);
diff --git a/src/thread/os2/SDL_systhread.c b/src/thread/os2/SDL_systhread.c
index 40eca079869d7..3aacb3e792366 100644
--- a/src/thread/os2/SDL_systhread.c
+++ b/src/thread/os2/SDL_systhread.c
@@ -103,7 +103,7 @@ int SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority)
                             PRTYC_REGULAR,
                           0, 0);
     if (ulRC != NO_ERROR)
-        return SDL_SetError("DosSetPriority() failed, rc = %u", ulRC);
+        return SDL_SetError("DosSetPriority() failed, rc = %lu", ulRC);
 
     return 0;
 }
@@ -113,7 +113,7 @@ void SDL_SYS_WaitThread(SDL_Thread * thread)
     ULONG ulRC = DosWaitThread((PTID)&thread->handle, DCWW_WAIT);
 
     if (ulRC != NO_ERROR) {
-        debug_os2("DosWaitThread() failed, rc = %u", ulRC);
+        debug_os2("DosWaitThread() failed, rc = %lu", ulRC);
     }
 }
 
diff --git a/src/thread/os2/SDL_systls.c b/src/thread/os2/SDL_systls.c
index 250c1fb9e71e9..9e0120253696e 100644
--- a/src/thread/os2/SDL_systls.c
+++ b/src/thread/os2/SDL_systls.c
@@ -42,7 +42,7 @@ void SDL_SYS_InitTLSData(void)
         /* Allocate the thread local memory (1 DWORD) */
         ulRC = DosAllocThreadLocalMemory(1, (PULONG *)&ppSDLTLSData);
         if (ulRC != NO_ERROR) {
-            debug_os2("DosAllocThreadLocalMemory() failed, rc = %u", ulRC);
+            debug_os2("DosAllocThreadLocalMemory() failed, rc = %lu", ulRC);
         }
     }
 }
@@ -69,7 +69,7 @@ void SDL_SYS_QuitTLSData(void)
         /* Free the thread local memory */
         ulRC = DosFreeThreadLocalMemory((PULONG)ppSDLTLSData);
         if (ulRC != NO_ERROR) {
-            debug_os2("DosFreeThreadLocalMemory() failed, rc = %u", ulRC);
+            debug_os2("DosFreeThreadLocalMemory() failed, rc = %lu", ulRC);
         } else {
             ppSDLTLSData = NULL;
         }
diff --git a/src/timer/os2/SDL_systimer.c b/src/timer/os2/SDL_systimer.c
index bd96ba40ccfaf..59412b54a3b6d 100644
--- a/src/timer/os2/SDL_systimer.c
+++ b/src/timer/os2/SDL_systimer.c
@@ -55,13 +55,13 @@ void SDL_TicksInit(void)
 
     ulRC = DosTmrQueryFreq(&ulTmrFreq);
     if (ulRC != NO_ERROR) {
-        debug_os2("DosTmrQueryFreq() failed, rc = %u", ulRC);
+        debug_os2("DosTmrQueryFreq() failed, rc = %lu", ulRC);
     } else {
         ulRC = DosTmrQueryTime((PQWORD)&ullTmrStart);
         if (ulRC == NO_ERROR) {
             return;
         }
-        debug_os2("DosTmrQueryTime() failed, rc = %u", ulRC);
+        debug_os2("DosTmrQueryTime() failed, rc = %lu", ulRC);
     }
 
     ulTmrFreq = 0; /* Error - use DosQuerySysInfo() for timer. */
@@ -131,7 +131,7 @@ void SDL_Delay(Uint32 ms)
 
     ulRC = DosCreateEventSem(NULL, &hevTimer, DC_SEM_SHARED, FALSE);
     if (ulRC != NO_ERROR) {
-        debug_os2("DosAsyncTimer() failed, rc = %u", ulRC);
+        debug_os2("DosAsyncTimer() failed, rc = %lu", ulRC);
         DosSleep(ms);
         return;
     }
@@ -164,7 +164,7 @@ void SDL_Delay(Uint32 ms)
 #endif
 
     if (ulRC != NO_ERROR) {
-        debug_os2("DosAsyncTimer() failed, rc = %u", ulRC);
+        debug_os2("DosAsyncTimer() failed, rc = %lu", ulRC);
     } else {
         DosWaitEventSem(hevTimer, SEM_INDEFINITE_WAIT);
     }
diff --git a/src/video/os2/SDL_os2dive.c b/src/video/os2/SDL_os2dive.c
index 457179eaf4d39..317e89ebb24d6 100644
--- a/src/video/os2/SDL_os2dive.c
+++ b/src/video/os2/SDL_os2dive.c
@@ -210,7 +210,7 @@ static BOOL voSetVisibleRegion(PVODATA pVOData, HWND hwnd,
                 return TRUE;
             }
 
-            SDL_SetError("DiveSetupBlitter(), rc = 0x%X", ulRC);
+            SDL_SetError("DiveSetupBlitter(), rc = 0x%lX", ulRC);
         } /* if (prectl != NULL) */
     } /* if (hrgn == NULLHANDLE) else */
 
@@ -240,7 +240,7 @@ static PVOID voVideoBufAlloc(PVODATA pVOData, ULONG ulWidth, ULONG ulHeight,
                        (ulHeight * ulScanLineSize) + sizeof(ULONG),
                        PAG_COMMIT | PAG_EXECUTE | PAG_READ | PAG_WRITE);
     if (ulRC != NO_ERROR) {
-        debug_os2("DosAllocMem(), rc = %u", ulRC);
+        debug_os2("DosAllocMem(), rc = %lu", ulRC);
         return NULL;
     }
 
@@ -248,7 +248,7 @@ static PVOID voVideoBufAlloc(PVODATA pVOData, ULONG ulWidth, ULONG ulHeight,
                                 fccColorEncoding, ulWidth, ulHeight,
                                 ulScanLineSize, pVOData->pBuffer);
     if (ulRC != DIVE_SUCCESS) {
-        debug_os2("DiveAllocImageBuffer(), rc = 0x%X", ulRC);
+        debug_os2("DiveAllocImageBuffer(), rc = 0x%lX", ulRC);
         DosFreeMem(pVOData->pBuffer);
         pVOData->pBuffer = NULL;
         pVOData->ulDIVEBufNum = 0;
@@ -259,7 +259,7 @@ static PVOID voVideoBufAlloc(PVODATA pVOData, ULONG ulWidth, ULONG ulHeight,
     pVOData->ulWidth = ulWidth;
     pVOData->ulHeight = ulHeight;
 
-    debug_os2("buffer: 0x%P, DIVE buffer number: %u",
+    debug_os2("buffer: 0x%p, DIVE buffer number: %lu",
               pVOData->pBuffer, pVOData->ulDIVEBufNum);
 
     return pVOData->pBuffer;
@@ -272,9 +272,9 @@ static VOID voVideoBufFree(PVODATA pVOData)
     if (pVOData->ulDIVEBufNum != 0) {
         ulRC = DiveFreeImageBuffer(pVOData->hDive, pVOData->ulDIVEBufNum);
         if (ulRC != DIVE_SUCCESS) {
-            debug_os2("DiveFreeImageBuffer(,%u), rc = %u", pVOData->ulDIVEBufNum, ulRC);
+            debug_os2("DiveFreeImageBuffer(,%lu), rc = %lu", pVOData->ulDIVEBufNum, ulRC);
         } else {
-            debug_os2("DIVE buffer %u destroyed", pVOData->ulDIVEBufNum);
+            debug_os2("DIVE buffer %lu destroyed", pVOData->ulDIVEBufNum);
         }
         pVOData->ulDIVEBufNum = 0;
     }
@@ -282,7 +282,7 @@ static VOID voVideoBufFree(PVODATA pVOData)
     if (pVOData->pBuffer) {
         ulRC = DosFreeMem(pVOData->pBuffer);
         if (ulRC != NO_ERROR) {
-            debug_os2("DosFreeMem(), rc = %u", ulRC);
+            debug_os2("DosFreeMem(), rc = %lu", ulRC);
         }
         pVOData->pBuffer = NULL;
     }
@@ -317,17 +317,15 @@ static BOOL voUpdate(PVODATA pVOData, HWND hwnd, SDL_Rect *pSDLRects,
         SDL_stack_free(pbLineMask);
 
         if (ulRC != DIVE_SUCCESS) {
-            debug_os2("DiveBlitImageLines(), rc = 0x%X", ulRC);
+            debug_os2("DiveBlitImageLines(), rc = 0x%lX", ulRC);
         }
     } else {
         ulRC = DiveBlitImage(pVOData->hDive, pVOData->ulDIVEBufNum,
                              DIVE_BUFFER_SCREEN);
         if (ulRC != DIVE_SUCCESS) {
-            debug_os2("DiveBlitImage(), rc = 0x%X", ulRC);
+            debug_os2("DiveBlitImage(), rc = 0x%lX", ulRC);
         }
     }
 
     return ulRC == DIVE_SUCCESS;
 }
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/video/os2/SDL_os2messagebox.c b/src/video/os2/SDL_os2messagebox.c
index 7909344e58e52..cbf86920b3e19 100644
--- a/src/video/os2/SDL_os2messagebox.c
+++ b/src/video/os2/SDL_os2messagebox.c
@@ -557,5 +557,3 @@ int OS2_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
 }
 
 #endif /* SDL_VIDEO_DRIVER_OS2 */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/video/os2/SDL_os2messagebox.h b/src/video/os2/SDL_os2messagebox.h
index 67805d08da062..66fdd0110a199 100644
--- a/src/video/os2/SDL_os2messagebox.h
+++ b/src/video/os2/SDL_os2messagebox.h
@@ -25,5 +25,3 @@
 extern int OS2_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);
 
 #endif /* SDL_VIDEO_DRIVER_OS2 */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/video/os2/SDL_os2mouse.c b/src/video/os2/SDL_os2mouse.c
index d6c34571f24f5..0f33feb080125 100644
--- a/src/video/os2/SDL_os2mouse.c
+++ b/src/video/os2/SDL_os2mouse.c
@@ -36,7 +36,7 @@ static SDL_Cursor* OS2_CreateCursor(SDL_Surface *surface, int hot_x, int hot_y)
     SDL_Cursor* pSDLCursor;
 
     if (surface->w > ulMaxW || surface->h > ulMaxH) {
-        debug_os2("Given image size is %u x %u, maximum allowed size is %u x %u",
+        debug_os2("Given image size is %d x %d, maximum allowed size is %lu x %lu",
                   surface->w, surface->h, ulMaxW, ulMaxH);
         return NULL;
     }
@@ -76,7 +76,7 @@ static SDL_Cursor* OS2_CreateSystemCursor(SDL_SystemCursor id)
     case SDL_SYSTEM_CURSOR_NO:        lSysId = SPTR_ILLEGAL;  break;
     case SDL_SYSTEM_CURSOR_HAND:      lSysId = SPTR_ARROW;    break;
     default:
-        debug_os2("Unknown cursor id: %u", id);
+        debug_os2("Unknown cursor id: %d", id);
         return NULL;
     }
 
@@ -85,7 +85,7 @@ static SDL_Cursor* OS2_CreateSystemCursor(SDL_SystemCursor id)
     hptr = WinQuerySysPointer(HWND_DESKTOP, lSysId,
                               id == SDL_SYSTEM_CURSOR_WAIT);
     if (hptr == NULLHANDLE) {
-        debug_os2("Cannot load OS/2 system pointer %u for SDL cursor id %u",
+        debug_os2("Cannot load OS/2 system pointer %ld for SDL cursor id %d",
                   lSysId, id);
         return NULL;
     }
@@ -190,5 +190,3 @@ void OS2_QuitMouse(_THIS)
 }
 
 #endif /* SDL_VIDEO_DRIVER_OS2 */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/video/os2/SDL_os2output.h b/src/video/os2/SDL_os2output.h
index 6642a6ed4a525..88e39ded4436e 100644
--- a/src/video/os2/SDL_os2output.h
+++ b/src/video/os2/SDL_os2output.h
@@ -55,5 +55,3 @@ extern OS2VIDEOOUTPUT voDive;
 extern OS2VIDEOOUTPUT voVMan;
 
 #endif /* SDL_os2output_ */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/video/os2/SDL_os2util.c b/src/video/os2/SDL_os2util.c
index 15a85ec0526b8..f83acdc8b4485 100644
--- a/src/video/os2/SDL_os2util.c
+++ b/src/video/os2/SDL_os2util.c
@@ -110,5 +110,3 @@ HPOINTER utilCreatePointer(SDL_Surface *surface, ULONG ulHotX, ULONG ulHotY)
 }
 
 #endif /* SDL_VIDEO_DRIVER_OS2 */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/video/os2/SDL_os2util.h b/src/video/os2/SDL_os2util.h
index c092557729b60..12773e553f24c 100644
--- a/src/video/os2/SDL_os2util.h
+++ b/src/video/os2/SDL_os2util.h
@@ -33,6 +33,3 @@
 HPOINTER utilCreatePointer(SDL_Surface *surface, ULONG ulHotX, ULONG ulHotY);
 
 #endif /* SDL_os2util_h_ */
-
-/* vi: set ts=4 sw=4 expandtab: */
-
diff --git a/src/video/os2/SDL_os2video.c b/src/video/os2/SDL_os2video.c
index b2b6e4d883050..9e87ac2ace68c 100644
--- a/src/video/os2/SDL_os2video.c
+++ b/src/video/os2/SDL_os2video.c
@@ -1101,7 +1101,7 @@ static void OS2_SetWindowFullscreen(_THIS, SDL_Window *window,
     WINDATA         *pWinData = (WINDATA *)window->driverdata;
     SDL_DisplayMode *pSDLDisplayMode = &display->current_mode;
 
-    debug_os2("Enter, fullscreen: %u", fullscreen);
+    debug_os2("Enter, fullscreen: %d", fullscreen);
 
     if (!pSDLDisplayMode)
         return;
@@ -1150,7 +1150,7 @@ static SDL_bool OS2_GetWindowWMInfo(_THIS, SDL_Window * window,
         return SDL_TRUE;
     }
 
-    SDL_SetError("Application not compiled with SDL %u",
+    SDL_SetError("Application not compiled with SDL %d",
                  SDL_MAJOR_VERSION);
     return SDL_FALSE;
 }
@@ -1169,7 +1169,7 @@ static void OS2_SetWindowMouseGrab(_THIS, SDL_Window *window, SDL_bool grabbed)
 {
     WINDATA *pWinData = (WINDATA *)window->driverdata;
 
-    debug_os2("Enter, %u", grabbed);
+    debug_os2("Enter, %d", grabbed);
     _mouseCheck(pWinData);
 }
 
@@ -1322,7 +1322,7 @@ static int OS2_CreateWindowFramebuffer(_THIS, SDL_Window *window,
         return SDL_SetError("No mode data for the display");
 
     SDL_GetWindowSize(window, (int *)&ulWidth, (int *)&ulHeight);
-    debug_os2("Window size: %u x %u", ulWidth, ulHeight);
+    debug_os2("Window size: %lu x %lu", ulWidth, ulHeight);
 
     *pixels = pWinData->pOutput->VideoBufAlloc(
                         pWinData->pVOData, ulWidth, ulHeight, pModeData->ulDepth,
@@ -1331,7 +1331,7 @@ static int OS2_CreateWindowFramebuffer(_THIS, SDL_Window *window,
         return -1;
 
     *format = pSDLDisplayMode->format;
-    debug_os2("Pitch: %u, frame buffer: 0x%X.", *pitch, *pixels);
+    debug_os2("Pitch: %d, frame buffer: 0x%X.", *pitch, *pixels);
     WinSendMsg(pWinData->hwnd, WM_VRNENABLED, 0, 0);
 
     return 0;
@@ -1368,7 +1368,7 @@ static int OS2_SetClipboardText(_THIS, const char *text)
                               PAG_COMMIT | PAG_READ | PAG_WRITE |
                               OBJ_GIVEABLE | OBJ_GETTABLE | OBJ_TILE);
     if (ulRC != NO_ERROR) {
-        debug_os2("DosAllocSharedMem() failed, rc = %u", ulRC);
+        debug_os2("DosAllocSharedMem() failed, rc = %lu", ulRC);
         SDL_free(pszText);
         return -1;
     }
@@ -1695,5 +1695,3 @@ VideoBootStrap OS2VMAN_bootstrap =
 };
 
 #endif /* SDL_VIDEO_DRIVER_OS2 */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/video/os2/SDL_os2video.h b/src/video/os2/SDL_os2video.h
index b9069ec2fcfb9..474d243290775 100644
--- a/src/video/os2/SDL_os2video.h
+++ b/src/video/os2/SDL_os2video.h
@@ -18,6 +18,7 @@
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
 */
+
 #include "../../SDL_internal.h"
 
 #ifndef SDL_os2video_h_
@@ -78,5 +79,3 @@ typedef struct _MODEDATA {
 } MODEDATA;
 
 #endif /* SDL_os2video_h_ */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/video/os2/SDL_os2vman.c b/src/video/os2/SDL_os2vman.c
index d19ec902fbf6e..c8b014b3795c1 100644
--- a/src/video/os2/SDL_os2vman.c
+++ b/src/video/os2/SDL_os2vman.c
@@ -100,7 +100,7 @@ static BOOL _vmanInit(void)
     /* Load vman.dll */
     ulRC = DosLoadModule(acBuf, sizeof(acBuf), "VMAN", &hmodVMan);
     if (ulRC != NO_ERROR) {
-        debug_os2("Could not load VMAN.DLL, rc = %u : %s", ulRC, acBuf);
+        debug_os2("Could not load VMAN.DLL, rc = %lu : %s", ulRC, acBuf);
         hmodVMan = NULLHANDLE;
         return FALSE;
     }
@@ -286,7 +286,7 @@ static PVOID voVideoBufAlloc(PVODATA pVOData, ULONG ulWidth, ULONG ulHeight,
                        (ulHeight * ulScanLineSize) + sizeof(ULONG),
                        PAG_COMMIT | PAG_EXECUTE | PAG_READ | PAG_WRITE);
     if (ulRC != NO_ERROR) {
-        debug_os2("DosAllocMem(), rc = %u", ulRC);
+        debug_os2("DosAllocMem(), rc = %lu", ulRC);
         return NULL;
     }
 
@@ -307,7 +307,7 @@ static VOID voVideoBufFree(PVODATA pVOData)
 
     ulRC = DosFreeMem(pVOData->pBuffer);
     if (ulRC != NO_ERROR) {
-        debug_os2("DosFreeMem(), rc = %u", ulRC);
+        debug_os2("DosFreeMem(), rc = %lu", ulRC);
     } else {
         pVOData->pBuffer = NULL;
     }
@@ -479,5 +479,3 @@ static BOOL voUpdate(PVODATA pVOData, HWND hwnd, SDL_Rect *pSDLRects,
 
     return sHWReqIn.cScrChangeRects != 0;
 }
-
-/* vi: set ts=4 sw=4 expandtab: */