[warnings] fix -Wshadow

This commit is contained in:
akallabeth
2023-05-23 09:10:36 +02:00
committed by Martin Fleisz
parent ab677f8abe
commit df76b59da7
4 changed files with 31 additions and 29 deletions

View File

@@ -797,8 +797,8 @@ static int sdl_run(sdlContext* sdl)
break;
case SDL_USEREVENT_CREATE_WINDOWS:
{
auto sdl = static_cast<sdlContext*>(windowEvent.user.data1);
sdl_create_windows(sdl);
auto ctx = static_cast<sdlContext*>(windowEvent.user.data1);
sdl_create_windows(ctx);
}
break;
case SDL_USEREVENT_WINDOW_RESIZEABLE:
@@ -1038,12 +1038,12 @@ static DWORD WINAPI sdl_client_thread_proc(void* arg)
*/
if (freerdp_focus_required(instance))
{
sdlContext* sdl = reinterpret_cast<sdlContext*>(context);
WINPR_ASSERT(sdl);
WINPR_ASSERT(sdl->input);
if (!sdl->input->keyboard_focus_in())
sdlContext* ctx = reinterpret_cast<sdlContext*>(context);
WINPR_ASSERT(ctx);
WINPR_ASSERT(ctx->input);
if (!ctx->input->keyboard_focus_in())
break;
if (!sdl->input->keyboard_focus_in())
if (!ctx->input->keyboard_focus_in())
break;
}

View File

@@ -382,10 +382,10 @@ BOOL freerdp_key_generate(rdpPrivateKey* key, size_t key_length)
}
BN_set_word(bn, RSA_F4);
const int rc = RSA_generate_key_ex(rsa, key_length, bn, NULL);
const int res = RSA_generate_key_ex(rsa, key_length, bn, NULL);
BN_clear_free(bn);
if (rc != 1)
if (res != 1)
return FALSE;
}
#endif

View File

@@ -28,31 +28,33 @@
#include <winpr/debug.h>
#if defined(WITH_VERBOSE_WINPR_ASSERT) && (WITH_VERBOSE_WINPR_ASSERT != 0)
#define WINPR_ASSERT(cond) \
do \
{ \
if (!(cond)) \
{ \
wLog* _log_cached_ptr = WLog_Get("com.freerdp.winpr.assert"); \
const size_t line = __LINE__; \
WLog_Print(_log_cached_ptr, WLOG_FATAL, "%s [%s:%s:%" PRIuz "]", #cond, __FILE__, \
__FUNCTION__, line); \
winpr_log_backtrace_ex(_log_cached_ptr, WLOG_FATAL, 20); \
abort(); \
} \
} while (0)
#else
#include <assert.h>
#define WINPR_ASSERT(cond) assert(cond)
#endif
#ifdef __cplusplus
extern "C"
{
#endif
#define WINPR_ASSERT(cond) \
do \
{ \
if (!(cond)) \
winpr_int_assert(#cond, __FILE__, __FUNCTION__, __LINE__); \
} while (0)
static INLINE WINPR_NORETURN(void winpr_int_assert(const char* condstr, const char* file,
const char* fkt, size_t line))
{
wLog* _log_cached_ptr = WLog_Get("com.freerdp.winpr.assert");
WLog_Print(_log_cached_ptr, WLOG_FATAL, "%s [%s:%s:%" PRIuz "]", condstr, file, fkt, line);
winpr_log_backtrace_ex(_log_cached_ptr, WLOG_FATAL, 20);
abort();
}
#ifdef __cplusplus
}
#endif
#else
#include <assert.h>
#define WINPR_ASSERT(cond) assert(cond)
#endif
#endif /* WINPR_ERROR_H */

View File

@@ -713,10 +713,10 @@ static BOOL makecert_create_rsa(EVP_PKEY** ppkey, size_t key_length)
}
BN_set_word(bn, RSA_F4);
const int rc = RSA_generate_key_ex(rsa, key_length, bn, NULL);
const int res = RSA_generate_key_ex(rsa, key_length, bn, NULL);
BN_clear_free(bn);
if (rc != 1)
if (res != 1)
return FALSE;
}
#endif