[warnings] fix casts

This commit is contained in:
akallabeth
2024-09-12 10:46:17 +02:00
parent adc4f2abf8
commit 2638d9d894
3 changed files with 7 additions and 7 deletions

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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);