mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[warnings] fix casts
This commit is contained in:
@@ -246,8 +246,8 @@ static BOOL sdl_apply_display_properties(SdlContext* sdl)
|
||||
}
|
||||
}
|
||||
|
||||
const float dw = 1.0f * rect.w / scaleRect.w;
|
||||
const float dh = 1.0f * rect.h / scaleRect.h;
|
||||
const float dw = 1.0f * static_cast<float>(rect.w) / static_cast<float>(scaleRect.w);
|
||||
const float dh = 1.0f * static_cast<float>(rect.h) / static_cast<float>(scaleRect.h);
|
||||
hdpi /= dw;
|
||||
vdpi /= dh;
|
||||
}
|
||||
|
||||
@@ -245,8 +245,8 @@ static BOOL sdl_apply_display_properties(SdlContext* sdl)
|
||||
}
|
||||
SDL_free(modes);
|
||||
|
||||
const float dw = 1.0f * rect.w / scaleRect.w;
|
||||
const float dh = 1.0f * rect.h / scaleRect.h;
|
||||
const float dw = 1.0f * static_cast<float>(rect.w) / static_cast<float>(scaleRect.w);
|
||||
const float dh = 1.0f * static_cast<float>(rect.h) / static_cast<float>(scaleRect.h);
|
||||
hdpi /= dw;
|
||||
vdpi /= dh;
|
||||
}
|
||||
|
||||
@@ -427,7 +427,7 @@ static BOOL freerdp_assistance_parse_attr(const char** opt, size_t* plength, con
|
||||
const int rc = _snprintf(bkey, sizeof(bkey), "%s=\"", key);
|
||||
WINPR_ASSERT(rc > 0);
|
||||
WINPR_ASSERT((size_t)rc < sizeof(bkey));
|
||||
if ((rc <= 0) || (rc >= sizeof(bkey)))
|
||||
if ((rc <= 0) || ((size_t)rc >= sizeof(bkey)))
|
||||
return FALSE;
|
||||
|
||||
char* p = strstr(tag, bkey);
|
||||
@@ -529,7 +529,7 @@ static char* freerdp_assistance_contains_element(char* input, size_t ilen, const
|
||||
const int rc = _snprintf(bkey, sizeof(bkey), "<%s", key);
|
||||
WINPR_ASSERT(rc > 0);
|
||||
WINPR_ASSERT((size_t)rc < sizeof(bkey));
|
||||
if ((rc < 0) || (rc >= sizeof(bkey)))
|
||||
if ((rc < 0) || ((size_t)rc >= sizeof(bkey)))
|
||||
return NULL;
|
||||
|
||||
char* tag = strstr(input, bkey);
|
||||
@@ -570,7 +570,7 @@ static char* freerdp_assistance_contains_element(char* input, size_t ilen, const
|
||||
const int erc = _snprintf(ekey, sizeof(ekey), "</%s>", key);
|
||||
WINPR_ASSERT(erc > 0);
|
||||
WINPR_ASSERT((size_t)erc < sizeof(ekey));
|
||||
if ((erc <= 0) || (erc >= sizeof(ekey)))
|
||||
if ((erc <= 0) || ((size_t)erc >= sizeof(ekey)))
|
||||
return NULL;
|
||||
const size_t offset = start - tag;
|
||||
dend = end = strrstr(start, ilen - offset, ekey);
|
||||
|
||||
Reference in New Issue
Block a user