Forráskód Böngészése

Fixed warning C4127: conditional expression is constant

Sam Lantinga 1 éve
szülő
commit
9fc1135e3b

+ 1 - 1
src/audio/directsound/SDL_directsound.c

@@ -587,7 +587,7 @@ static int DSOUND_OpenDevice(SDL_AudioDevice *device)
                         wfmt.dwChannelMask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT;
                         break;
                     default:
-                        SDL_assert(0 && "Unsupported channel count!");
+                        SDL_assert(!"Unsupported channel count!");
                         break;
                     }
                 } else if (SDL_AUDIO_ISFLOAT(device->spec.format)) {

+ 1 - 1
src/haptic/SDL_haptic.c

@@ -674,7 +674,7 @@ int SDL_PlayHapticRumble(SDL_Haptic *haptic, float strength, Uint32 length)
         efx->leftright.small_magnitude = efx->leftright.large_magnitude = magnitude;
         efx->leftright.length = length;
     } else {
-        SDL_assert(0 && "This should have been caught elsewhere");
+        SDL_assert(!"This should have been caught elsewhere");
     }
 
     if (SDL_UpdateHapticEffect(haptic, haptic->rumble_id, &haptic->rumble_effect) < 0) {

+ 1 - 1
src/render/SDL_render.c

@@ -1035,7 +1035,7 @@ int SDL_GetRenderOutputSize(SDL_Renderer *renderer, int *w, int *h)
     } else if (renderer->window) {
         return SDL_GetWindowSizeInPixels(renderer->window, w, h);
     } else {
-        SDL_assert(0 && "This should never happen");
+        SDL_assert(!"This should never happen");
         return SDL_SetError("Renderer doesn't support querying output size");
     }
 }

+ 1 - 1
src/render/SDL_yuv_sw.c

@@ -94,7 +94,7 @@ SDL_SW_YUVTexture *SDL_SW_CreateYUVTexture(Uint32 format, int w, int h)
         break;
 
     default:
-        SDL_assert(0 && "We should never get here (caught above)");
+        SDL_assert(!"We should never get here (caught above)");
         break;
     }