mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
Fixed some warnings
This commit is contained in:
committed by
Bernhard Miklautz
parent
99ad9db4e6
commit
0186a9b303
@@ -904,7 +904,7 @@ static int test_progressive_decode(PROGRESSIVE_CONTEXT* progressive, EGFX_SAMPLE
|
||||
|
||||
if (cnt)
|
||||
{
|
||||
float rate = ((float)cnt) / ((float)size) * 100.0f;
|
||||
const float rate = ((float)cnt) / ((float)size) * 100.0f;
|
||||
printf("Progressive RemoteFX decompression failure\n");
|
||||
printf("Actual, Expected (%d/%d = %.3f%%):\n", cnt, size, rate);
|
||||
}
|
||||
|
||||
@@ -1168,10 +1168,10 @@ static BOOL nla_encode_ts_credentials(rdpNla* nla)
|
||||
goto out;
|
||||
|
||||
/* pin [0] OCTET STRING */
|
||||
size_t s;
|
||||
size_t ss;
|
||||
octet_string.data =
|
||||
(BYTE*)freerdp_settings_get_string_as_utf16(settings, FreeRDP_Password, &s);
|
||||
octet_string.len = s * sizeof(WCHAR);
|
||||
(BYTE*)freerdp_settings_get_string_as_utf16(settings, FreeRDP_Password, &ss);
|
||||
octet_string.len = ss * sizeof(WCHAR);
|
||||
const BOOL res = WinPrAsn1EncContextualOctetString(enc, 0, &octet_string) > 0;
|
||||
free(octet_string.data);
|
||||
if (!res)
|
||||
@@ -1195,8 +1195,8 @@ static BOOL nla_encode_ts_credentials(rdpNla* nla)
|
||||
octet_string.len = len * sizeof(WCHAR);
|
||||
if (octet_string.len)
|
||||
{
|
||||
const BOOL res2 = WinPrAsn1EncContextualOctetString(enc, cspData_fields[i].tag, &octet_string) >
|
||||
0;
|
||||
const BOOL res2 = WinPrAsn1EncContextualOctetString(enc, cspData_fields[i].tag,
|
||||
&octet_string) > 0;
|
||||
free(octet_string.data);
|
||||
if (!res2)
|
||||
goto out;
|
||||
|
||||
@@ -1657,11 +1657,11 @@ static int test_PrimitivesYCbCr(const primitives_t* prims, UINT32 format, prim_s
|
||||
if (compare)
|
||||
{
|
||||
cnt[2] = test_bmp_cmp_count(actual, expected, dstSize, 2, margin); /* red */
|
||||
err[2] = ((float)cnt[2]) / ((float)dstSize / 4) * 100.0f;
|
||||
err[2] = ((float)cnt[2]) / ((float)dstSize / 4.0f) * 100.0f;
|
||||
cnt[1] = test_bmp_cmp_count(actual, expected, dstSize, 1, margin); /* green */
|
||||
err[1] = ((float)cnt[1]) / ((float)dstSize / 4) * 100.0f;
|
||||
err[1] = ((float)cnt[1]) / ((float)dstSize / 4.0f) * 100.0f;
|
||||
cnt[0] = test_bmp_cmp_count(actual, expected, dstSize, 0, margin); /* blue */
|
||||
err[0] = ((float)cnt[0]) / ((float)dstSize / 4) * 100.0f;
|
||||
err[0] = ((float)cnt[0]) / ((float)dstSize / 4.0f) * 100.0f;
|
||||
|
||||
if (cnt[0] || cnt[1] || cnt[2])
|
||||
{
|
||||
@@ -1678,11 +1678,11 @@ static int test_PrimitivesYCbCr(const primitives_t* prims, UINT32 format, prim_s
|
||||
}
|
||||
|
||||
cnt[2] = test_bmp_cmp_count(actual1, expected, dstSize, 2, margin); /* red */
|
||||
err[2] = ((float)cnt[2]) / ((float)dstSize / 4) * 100.0f;
|
||||
err[2] = ((float)cnt[2]) / ((float)dstSize / 4.0f) * 100.0f;
|
||||
cnt[1] = test_bmp_cmp_count(actual1, expected, dstSize, 1, margin); /* green */
|
||||
err[1] = ((float)cnt[1]) / ((float)dstSize / 4) * 100.0f;
|
||||
err[1] = ((float)cnt[1]) / ((float)dstSize / 4.0f) * 100.0f;
|
||||
cnt[0] = test_bmp_cmp_count(actual1, expected, dstSize, 0, margin); /* blue */
|
||||
err[0] = ((float)cnt[0]) / ((float)dstSize / 4) * 100.0f;
|
||||
err[0] = ((float)cnt[0]) / ((float)dstSize / 4.0f) * 100.0f;
|
||||
|
||||
if (cnt[0] || cnt[1] || cnt[2])
|
||||
{
|
||||
|
||||
@@ -73,19 +73,19 @@ void _floatprint(float t, char* output)
|
||||
f *= 10.0;
|
||||
|
||||
f /= 1000.0;
|
||||
i = ((int)(t / f + 0.5)) * (int)f;
|
||||
i = ((int)(t / f + 0.5f)) * (int)f;
|
||||
|
||||
if (t < 0.0)
|
||||
if (t < 0.0f)
|
||||
sprintf(output, "%f", t);
|
||||
else if (i == 0)
|
||||
sprintf(output, "%d", (int)(t + 0.5));
|
||||
else if (t < 1e+3)
|
||||
sprintf(output, "%d", (int)(t + 0.5f));
|
||||
else if (t < 1e+3f)
|
||||
sprintf(output, "%3d", i);
|
||||
else if (t < 1e+6)
|
||||
else if (t < 1e+6f)
|
||||
sprintf(output, "%3d,%03d", i / 1000, i % 1000);
|
||||
else if (t < 1e+9)
|
||||
else if (t < 1e+9f)
|
||||
sprintf(output, "%3d,%03d,000", i / 1000000, (i % 1000000) / 1000);
|
||||
else if (t < 1e+12)
|
||||
else if (t < 1e+12f)
|
||||
sprintf(output, "%3d,%03d,000,000", i / 1000000000, (i % 1000000000) / 1000000);
|
||||
else
|
||||
sprintf(output, "%f", t);
|
||||
|
||||
@@ -168,11 +168,6 @@ static void* clipboard_synthesize_utf8_string(wClipboard* clipboard, UINT32 form
|
||||
return NULL;
|
||||
|
||||
size = ConvertLineEndingToLF(pDstData, size);
|
||||
if (size < 0)
|
||||
{
|
||||
free(pDstData);
|
||||
return NULL;
|
||||
}
|
||||
*pSize = (UINT32)size;
|
||||
return pDstData;
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ static CK_RV object_load_attributes(NCryptP11ProviderHandle* provider, CK_SESSIO
|
||||
case CKR_OK:
|
||||
if (!attributes_have_unallocated_buffers(attributes, count))
|
||||
return rv;
|
||||
/* fallthrought */
|
||||
/* fallthrough */
|
||||
case CKR_ATTRIBUTE_SENSITIVE:
|
||||
case CKR_ATTRIBUTE_TYPE_INVALID:
|
||||
case CKR_BUFFER_TOO_SMALL:
|
||||
|
||||
@@ -321,7 +321,7 @@ int TestPrint(int argc, char* argv[])
|
||||
_printf("%3d\n", b);
|
||||
_printf("%03d\n", b);
|
||||
c = 15.3f;
|
||||
d = c / 3;
|
||||
d = c / 3.0f;
|
||||
_printf("%3.2f\n", d);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user