浏览代码

audio: Fix warning C4701: potentially uninitialized local variable 'isstack' used

This warning is actually wrong, as the variable is only used if the string pointer is valid, in which case it was initialized, but this is needed to quiet MSVC.

(cherry picked from commit fb940fff800fc285be7053689e66e89547bc0846)
Frank Praznik 4 月之前
父节点
当前提交
faed8b620c
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/audio/SDL_audio.c

+ 1 - 1
src/audio/SDL_audio.c

@@ -1502,7 +1502,7 @@ SDL_AudioDevice *SDL_FindPhysicalAudioDeviceByHandle(void *handle)
 
 
 const char *SDL_GetAudioDeviceName(SDL_AudioDeviceID devid)
 const char *SDL_GetAudioDeviceName(SDL_AudioDeviceID devid)
 {
 {
-    bool isstack;
+    bool isstack = false;
     char *string = NULL;
     char *string = NULL;
     const char *result = NULL;
     const char *result = NULL;
     SDL_AudioDevice *device = NULL;
     SDL_AudioDevice *device = NULL;