From 0c09ce2b349421eb650914c57b411f04cae2d43c Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 28 Jul 2014 10:54:25 -0400 Subject: [PATCH] Changed local var names in SDL assert macro. Otherwise, if someone added an assert to a function that has a variable named "state", the compiler might warn about shadowing a local. --- include/SDL_assert.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/include/SDL_assert.h b/include/SDL_assert.h index c8a944d9cf076..94d998770c293 100644 --- a/include/SDL_assert.h +++ b/include/SDL_assert.h @@ -141,16 +141,13 @@ extern DECLSPEC SDL_assert_state SDLCALL SDL_ReportAssertion(SDL_assert_data *, #define SDL_enabled_assert(condition) \ do { \ while ( !(condition) ) { \ - static struct SDL_assert_data assert_data = { \ + static struct SDL_assert_data sdl_assert_data = { \ 0, 0, #condition, 0, 0, 0, 0 \ }; \ - const SDL_assert_state state = SDL_ReportAssertion(&assert_data, \ - SDL_FUNCTION, \ - SDL_FILE, \ - SDL_LINE); \ - if (state == SDL_ASSERTION_RETRY) { \ + const SDL_assert_state sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \ + if (sdl_assert_state == SDL_ASSERTION_RETRY) { \ continue; /* go again. */ \ - } else if (state == SDL_ASSERTION_BREAK) { \ + } else if (sdl_assert_state == SDL_ASSERTION_BREAK) { \ SDL_TriggerBreakpoint(); \ } \ break; /* not retrying. */ \