Merge pull request #11030 from akallabeth/sign-fixes

Sign fixes
This commit is contained in:
akallabeth
2025-01-08 00:09:48 +01:00
committed by GitHub
24 changed files with 92 additions and 104 deletions

View File

@@ -64,9 +64,9 @@ typedef struct
rdpContext* rdpcontext;
} DRIVE_DEVICE;
static INT32 drive_map_windows_err(DWORD fs_errno)
static NTSTATUS drive_map_windows_err(DWORD fs_errno)
{
INT32 rc = 0;
NTSTATUS rc = 0;
/* try to return NTSTATUS version of error code */

View File

@@ -74,7 +74,7 @@ static UINT irp_complete(IRP* irp)
pos = Stream_GetPosition(irp->output);
Stream_SetPosition(irp->output, RDPDR_DEVICE_IO_RESPONSE_LENGTH - 4);
Stream_Write_UINT32(irp->output, irp->IoStatus); /* IoStatus (4 bytes) */
Stream_Write_INT32(irp->output, irp->IoStatus); /* IoStatus (4 bytes) */
Stream_SetPosition(irp->output, pos);
error = rdpdr_send(rdpdr, irp->output);

View File

@@ -1516,8 +1516,7 @@ static UINT dummy_irp_response(rdpdrPlugin* rdpdr, wStream* s)
Stream_Read_UINT32(s, FileId); /* FileId (4 bytes) */
Stream_Read_UINT32(s, CompletionId); /* CompletionId (4 bytes) */
if (!rdpdr_write_iocompletion_header(output, DeviceId, CompletionId,
(UINT32)STATUS_UNSUCCESSFUL))
if (!rdpdr_write_iocompletion_header(output, DeviceId, CompletionId, STATUS_UNSUCCESSFUL))
return CHANNEL_RC_NO_MEMORY;
return rdpdr_send(rdpdr, output);

View File

@@ -191,11 +191,11 @@ BOOL rdpei_read_4byte_unsigned(wStream* s, UINT32* value)
break;
case 3:
*value = ((byte & 0x3F) << 24) & 0xFF000000;
*value = ((UINT32)(byte & 0x3F) << 24) & 0xFF000000;
Stream_Read_UINT8(s, byte);
*value |= ((byte << 16) & 0xFF0000);
*value |= ((UINT32)(byte << 16) & 0xFF0000);
Stream_Read_UINT8(s, byte);
*value |= ((byte << 8) & 0xFF00);
*value |= ((UINT32)(byte << 8) & 0xFF00);
Stream_Read_UINT8(s, byte);
*value |= byte;
break;

View File

@@ -69,7 +69,7 @@ typedef struct
} IRP_THREAD_DATA;
static void close_terminated_irp_thread_handles(SERIAL_DEVICE* serial, BOOL forceClose);
static INT32 GetLastErrorToIoStatus(SERIAL_DEVICE* serial)
static NTSTATUS GetLastErrorToIoStatus(SERIAL_DEVICE* serial)
{
/* http://msdn.microsoft.com/en-us/library/ff547466%28v=vs.85%29.aspx#generic_status_values_for_serial_device_control_requests
*/

View File

@@ -273,7 +273,7 @@ static int error_info_to_error(freerdp* instance, DWORD* pcode, char** msg, size
const int exit_code = sdl_map_error_to_exit_code(code);
winpr_asprintf(msg, len, "Terminate with %s due to ERROR_INFO %s [0x%08" PRIx32 "]: %s",
sdl_map_error_to_code_tag(exit_code), name, code, str);
sdl_map_error_to_code_tag(code), name, code, str);
WLog_DBG(SDL_TAG, "%s", *msg);
if (pcode)
*pcode = code;

View File

@@ -17,8 +17,9 @@ bool SdlButtonList::populate(SDL_Renderer* renderer, const std::vector<std::stri
assert(labels.size() == ids.size());
_list.clear();
size_t button_width = ids.size() * (width + hpadding) + hpadding;
size_t offsetX = total_width - std::min<size_t>(total_width, button_width);
size_t button_width = ids.size() * (static_cast<size_t>(width) + hpadding) + hpadding;
size_t offsetX = static_cast<size_t>(total_width) -
std::min<size_t>(static_cast<size_t>(total_width), button_width);
for (size_t x = 0; x < ids.size(); x++)
{
const size_t curOffsetX = offsetX + x * (static_cast<size_t>(width) + hpadding);

View File

@@ -12,7 +12,7 @@ SdlSelectList::SdlSelectList(const std::string& title, const std::vector<std::st
const size_t total_height = labels.size() * (widget_height + vpadding) + vpadding;
const size_t height = total_height + widget_height;
assert(widget_width <= INT32_MAX);
static_assert(widget_width <= INT32_MAX);
assert(height <= INT32_MAX);
auto rc = SDL_CreateWindowAndRenderer(
title.c_str(), static_cast<int>(widget_width), static_cast<int>(height),

View File

@@ -250,7 +250,7 @@ static int sdl_map_error_to_exit_code(DWORD error)
return SDL_EXIT_CONN_FAILED;
}
static const char* sdl_map_error_to_code_tag(INT32 error)
static const char* sdl_map_error_to_code_tag(UINT32 error)
{
const struct sdl_exit_code_map_t* entry = sdl_map_entry_by_error(error);
if (entry)
@@ -274,7 +274,7 @@ static int error_info_to_error(freerdp* instance, DWORD* pcode, char** msg, size
const int exit_code = sdl_map_error_to_exit_code(code);
winpr_asprintf(msg, len, "Terminate with %s due to ERROR_INFO %s [0x%08" PRIx32 "]: %s",
sdl_map_error_to_code_tag(exit_code), name, code, str);
sdl_map_error_to_code_tag(code), name, code, str);
WLog_DBG(SDL_TAG, "%s", *msg);
if (pcode)
*pcode = code;

View File

@@ -358,7 +358,7 @@ struct S_IRP
UINT32 MinorFunction;
wStream* input;
UINT32 IoStatus;
NTSTATUS IoStatus;
wStream* output;
pcIRPResponse Complete;

View File

@@ -54,7 +54,7 @@ extern "C"
FREERDP_API const char* scard_get_ioctl_string(UINT32 ioControlCode, BOOL funcName);
FREERDP_API BOOL rdpdr_write_iocompletion_header(wStream* out, UINT32 DeviceId,
UINT32 CompletionId, UINT32 ioStatus);
UINT32 CompletionId, NTSTATUS ioStatus);
FREERDP_API void rdpdr_dump_received_packet(wLog* log, DWORD lvl, wStream* out,
const char* custom);

View File

@@ -56,7 +56,7 @@ extern "C"
FREERDP_API void* smartcard_call_get_context(scard_call_context* ctx, SCARDCONTEXT hContext);
FREERDP_API LONG smartcard_irp_device_control_call(scard_call_context* context, wStream* out,
UINT32* pIoStatus,
NTSTATUS* pIoStatus,
SMARTCARD_OPERATION* operation);
#ifdef __cplusplus

View File

@@ -31,7 +31,7 @@ static BOOL run_encode_decode_single(UINT16 bpp, BITMAP_INTERLEAVED_CONTEXT* enc
const UINT32 bstep = FreeRDPGetBytesPerPixel(format);
const size_t step = (13ULL + w) * 4ULL;
const size_t SrcSize = step * h;
const float maxDiff = 4.0f * ((bpp < 24) ? 2.0f : 1.0f);
const int maxDiff = 4 * ((bpp < 24) ? 2 : 1);
UINT32 DstSize = SrcSize;
BYTE* pSrcData = calloc(1, SrcSize);
BYTE* pDstData = calloc(1, SrcSize);
@@ -79,13 +79,13 @@ static BOOL run_encode_decode_single(UINT16 bpp, BITMAP_INTERLEAVED_CONTEXT* enc
FreeRDPSplitColor(srcColor, format, &r, &g, &b, NULL, NULL);
FreeRDPSplitColor(dstColor, format, &dr, &dg, &db, NULL, NULL);
if (fabsf((float)r - dr) > maxDiff)
if (abs(r - dr) > maxDiff)
goto fail;
if (fabsf((float)g - dg) > maxDiff)
if (abs(g - dg) > maxDiff)
goto fail;
if (fabsf((float)b - db) > maxDiff)
if (abs(b - db) > maxDiff)
goto fail;
}
}

View File

@@ -1185,8 +1185,17 @@ static WINPR_NORETURN(void usage(const char* name))
static void print_codec_stats(const char* name, UINT64 timeNS)
{
const double dectimems = timeNS / 1000000.0;
(void)fprintf(stderr, "[%s] took %lf ms to decode\n", name, dectimems);
const double dectimeMS = (double)timeNS / 1000.0 / 1000.0;
(void)fprintf(stderr, "[%s] took %lf ms to decode\n", name, dectimeMS);
}
static UINT64 measure_diff_and_print(const char* cname, UINT32 frameId, UINT64 start)
{
const UINT64 end = winpr_GetTickCount64NS();
const UINT64 diff = end - start;
const double ddiff = (double)diff / 1000000.0;
(void)fprintf(stderr, "frame [%s] %" PRIu32 " took %lf ms\n", cname, frameId, ddiff);
return diff;
}
static int test_dump(int argc, char* argv[])
@@ -1264,12 +1273,7 @@ static int test_dump(int argc, char* argv[])
success = progressive_decompress(codecs->progressive, cmd.data, cmd.length,
dst, DstFormat, 0, cmd.left, cmd.top,
&invalid, cmd.surfaceId, frameId);
const UINT64 end = winpr_GetTickCount64NS();
const UINT64 diff = end - start;
const double ddiff = diff / 1000000.0;
(void)fprintf(stderr, "frame [%s] %" PRIu32 " took %lf ms\n", cname, frameId,
ddiff);
CAPROGRESSIVE_dectime += diff;
CAPROGRESSIVE_dectime += measure_diff_and_print(cname, frameId, start);
}
break;
@@ -1286,12 +1290,7 @@ static int test_dump(int argc, char* argv[])
.right = (UINT16)MIN(UINT16_MAX, cmd.right),
.bottom = (UINT16)MIN(UINT16_MAX, cmd.bottom) };
region16_union_rect(&invalid, &invalid, &invalidRect);
const UINT64 end = winpr_GetTickCount64NS();
const UINT64 diff = end - start;
const double ddiff = diff / 1000000.0;
(void)fprintf(stderr, "frame [%s] %" PRIu32 " took %lf ms\n", cname, frameId,
ddiff);
UNCOMPRESSED_dectime += diff;
UNCOMPRESSED_dectime += measure_diff_and_print(cname, frameId, start);
}
break;
case RDPGFX_CODECID_CAVIDEO:
@@ -1301,12 +1300,7 @@ static int test_dump(int argc, char* argv[])
dst, DstFormat, stride, height, &invalid))
success = -1;
const UINT64 end = winpr_GetTickCount64NS();
const UINT64 diff = end - start;
const double ddiff = diff / 1000000.0;
(void)fprintf(stderr, "frame [%s] %" PRIu32 " took %lf ms\n", cname, frameId,
ddiff);
CAVIDEO_dectime += diff;
CAVIDEO_dectime += measure_diff_and_print(cname, frameId, start);
}
break;
case RDPGFX_CODECID_CLEARCODEC:
@@ -1322,12 +1316,7 @@ static int test_dump(int argc, char* argv[])
.bottom =
(UINT16)MIN(UINT16_MAX, cmd.bottom) };
region16_union_rect(&invalid, &invalid, &invalidRect);
const UINT64 end = winpr_GetTickCount64NS();
const UINT64 diff = end - start;
const double ddiff = diff / 1000000.0;
(void)fprintf(stderr, "frame [%s] %" PRIu32 " took %lf ms\n", cname, frameId,
ddiff);
CLEARCODEC_dectime += diff;
CLEARCODEC_dectime += measure_diff_and_print(cname, frameId, start);
}
break;
case RDPGFX_CODECID_PLANAR:
@@ -1346,24 +1335,14 @@ static int test_dump(int argc, char* argv[])
(UINT16)MIN(UINT16_MAX, cmd.bottom) };
region16_union_rect(&invalid, &invalid, &invalidRect);
const UINT64 end = winpr_GetTickCount64NS();
const UINT64 diff = end - start;
const double ddiff = diff / 1000000.0;
(void)fprintf(stderr, "frame [%s] %" PRIu32 " took %lf ms\n", cname, frameId,
ddiff);
PLANAR_dectime += diff;
PLANAR_dectime += measure_diff_and_print(cname, frameId, start);
}
break;
case RDPGFX_CODECID_AVC420:
{
const UINT64 start = winpr_GetTickCount64NS();
const UINT64 end = winpr_GetTickCount64NS();
const UINT64 diff = end - start;
const double ddiff = diff / 1000000.0;
(void)fprintf(stderr, "frame [%s] %" PRIu32 " took %lf ms\n", cname, frameId,
ddiff);
AVC420_dectime += diff;
AVC420_dectime += measure_diff_and_print(cname, frameId, start);
success = -1;
}
break;
@@ -1371,12 +1350,7 @@ static int test_dump(int argc, char* argv[])
{
const UINT64 start = winpr_GetTickCount64NS();
const UINT64 end = winpr_GetTickCount64NS();
const UINT64 diff = end - start;
const double ddiff = diff / 1000000.0;
(void)fprintf(stderr, "frame [%s] %" PRIu32 " took %lf ms\n", cname, frameId,
ddiff);
ALPHA_dectime += diff;
ALPHA_dectime += measure_diff_and_print(cname, frameId, start);
success = -1;
}
break;
@@ -1384,12 +1358,7 @@ static int test_dump(int argc, char* argv[])
{
const UINT64 start = winpr_GetTickCount64NS();
const UINT64 end = winpr_GetTickCount64NS();
const UINT64 diff = end - start;
const double ddiff = diff / 1000000.0;
(void)fprintf(stderr, "frame [%s] %" PRIu32 " took %lf ms\n", cname, frameId,
ddiff);
AVC444_dectime += diff;
AVC444_dectime += measure_diff_and_print(cname, frameId, start);
success = -1;
}
break;
@@ -1397,12 +1366,7 @@ static int test_dump(int argc, char* argv[])
{
const UINT64 start = winpr_GetTickCount64NS();
const UINT64 end = winpr_GetTickCount64NS();
const UINT64 diff = end - start;
const double ddiff = diff / 1000000.0;
(void)fprintf(stderr, "frame [%s] %" PRIu32 " took %lf ms\n", cname, frameId,
ddiff);
AVC444v2_dectime += diff;
AVC444v2_dectime += measure_diff_and_print(cname, frameId, start);
success = -1;
}
break;
@@ -1429,11 +1393,7 @@ static int test_dump(int argc, char* argv[])
rect->left, rect->top, NULL, 0))
success = -42;
}
const UINT64 end = winpr_GetTickCount64NS();
const UINT64 diff = end - start;
const double ddiff = diff / 1000000.0;
(void)fprintf(stderr, "frame %" PRIu32 " copy took %lf ms\n", frameId, ddiff);
copytime += diff;
copytime += measure_diff_and_print(cname, frameId, start);
}
region16_clear(&invalid);
}

View File

@@ -1152,7 +1152,6 @@ int freerdp_tcp_default_connect(rdpContext* context, rdpSettings* settings, cons
if (sockfd < 0)
{
freerdp_set_last_error_if_not(context, FREERDP_ERROR_CONNECT_FAILED);
return -1;
}
}
@@ -1163,10 +1162,19 @@ int freerdp_tcp_default_connect(rdpContext* context, rdpSettings* settings, cons
#if defined(HAVE_AF_VSOCK_H)
hostname = vsock;
sockfd = socket(AF_VSOCK, SOCK_STREAM, 0);
if (sockfd < 0)
{
char buffer[256] = { 0 };
WLog_WARN(TAG, "socket(AF_VSOCK, SOCK_STREAM, 0) failed with %s [%d]",
winpr_strerror(errno, buffer, sizeof(buffer)));
freerdp_set_last_error_if_not(context, FREERDP_ERROR_CONNECT_FAILED);
return -1;
}
struct sockaddr_vm addr = { 0 };
addr.svm_family = AF_VSOCK;
addr.svm_port = port;
addr.svm_port = WINPR_ASSERTING_INT_CAST(typeof(addr.svm_port), port);
errno = 0;
char* ptr = NULL;
@@ -1178,7 +1186,7 @@ int freerdp_tcp_default_connect(rdpContext* context, rdpSettings* settings, cons
winpr_strerror(errno, ebuffer, sizeof(ebuffer)));
return -1;
}
addr.svm_cid = val;
addr.svm_cid = WINPR_ASSERTING_INT_CAST(typeof(addr.svm_cid), val);
if (addr.svm_cid == 2)
{
addr.svm_flags = VMADDR_FLAG_TO_HOST;

View File

@@ -175,7 +175,8 @@ BOOL gdi_LineTo(HGDI_DC hdc, INT32 nXEnd, INT32 nYEnd)
{
if ((x >= bx1 && x <= bx2) && (y >= by1 && y <= by2))
{
BYTE* pixel = gdi_GetPointer(bmp, x, y);
BYTE* pixel = gdi_GetPointer(bmp, WINPR_ASSERTING_INT_CAST(uint32_t, x),
WINPR_ASSERTING_INT_CAST(uint32_t, y));
WINPR_ASSERT(pixel);
gdi_rop_color(rop2, pixel, pen, bmp->format);
}

View File

@@ -242,7 +242,7 @@ sse2_yCbCrToRGB_16s8u_P3AC4R_BGRX(const INT16* WINPR_RESTRICT pSrc[3], UINT32 sr
const INT16* cr_buf = pSrc[2];
const UINT32 pad = roi->width % 16;
const UINT32 step = sizeof(__m128i) / sizeof(INT16);
const UINT32 imax = (roi->width - pad) * sizeof(INT16) / sizeof(__m128i);
const size_t imax = (roi->width - pad) * sizeof(INT16) / sizeof(__m128i);
BYTE* d_buf = pDst;
const size_t dstPad = (dstStep - roi->width * 4);
#ifdef DO_PREFETCH
@@ -250,7 +250,7 @@ sse2_yCbCrToRGB_16s8u_P3AC4R_BGRX(const INT16* WINPR_RESTRICT pSrc[3], UINT32 sr
/* Prefetch Y's, Cb's, and Cr's. */
for (UINT32 yp = 0; yp < roi->height; yp++)
{
for (int i = 0; i < imax; i += (CACHE_LINE_BYTES / sizeof(__m128i)))
for (size_t i = 0; i < imax; i += (CACHE_LINE_BYTES / sizeof(__m128i)))
{
_mm_prefetch((char*)(&((__m128i*)y_buf)[i]), _MM_HINT_NTA);
_mm_prefetch((char*)(&((__m128i*)cb_buf)[i]), _MM_HINT_NTA);
@@ -269,7 +269,7 @@ sse2_yCbCrToRGB_16s8u_P3AC4R_BGRX(const INT16* WINPR_RESTRICT pSrc[3], UINT32 sr
for (UINT32 yp = 0; yp < roi->height; ++yp)
{
for (UINT32 i = 0; i < imax; i += 2)
for (size_t i = 0; i < imax; i += 2)
{
/* In order to use SSE2 signed 16-bit integer multiplication
* we need to convert the floating point factors to signed int
@@ -427,7 +427,7 @@ sse2_yCbCrToRGB_16s8u_P3AC4R_RGBX(const INT16* WINPR_RESTRICT pSrc[3], UINT32 sr
const INT16* cr_buf = pSrc[2];
const UINT32 pad = roi->width % 16;
const UINT32 step = sizeof(__m128i) / sizeof(INT16);
const UINT32 imax = (roi->width - pad) * sizeof(INT16) / sizeof(__m128i);
const size_t imax = (roi->width - pad) * sizeof(INT16) / sizeof(__m128i);
BYTE* d_buf = pDst;
const size_t dstPad = (dstStep - roi->width * 4);
#ifdef DO_PREFETCH
@@ -435,7 +435,7 @@ sse2_yCbCrToRGB_16s8u_P3AC4R_RGBX(const INT16* WINPR_RESTRICT pSrc[3], UINT32 sr
/* Prefetch Y's, Cb's, and Cr's. */
for (UINT32 yp = 0; yp < roi->height; yp++)
{
for (int i = 0; i < imax; i += (CACHE_LINE_BYTES / sizeof(__m128i)))
for (size_t i = 0; i < imax; i += (CACHE_LINE_BYTES / sizeof(__m128i)))
{
_mm_prefetch((char*)(&((__m128i*)y_buf)[i]), _MM_HINT_NTA);
_mm_prefetch((char*)(&((__m128i*)cb_buf)[i]), _MM_HINT_NTA);
@@ -454,7 +454,7 @@ sse2_yCbCrToRGB_16s8u_P3AC4R_RGBX(const INT16* WINPR_RESTRICT pSrc[3], UINT32 sr
for (UINT32 yp = 0; yp < roi->height; ++yp)
{
for (UINT32 i = 0; i < imax; i += 2)
for (size_t i = 0; i < imax; i += 2)
{
/* In order to use SSE2 signed 16-bit integer multiplication
* we need to convert the floating point factors to signed int
@@ -631,7 +631,6 @@ sse2_RGBToYCbCr_16s16s_P3P3(const INT16* WINPR_RESTRICT pSrc[3], int srcStep,
__m128i* y_buf = (__m128i*)(pDst[0]);
__m128i* cb_buf = (__m128i*)(pDst[1]);
__m128i* cr_buf = (__m128i*)(pDst[2]);
int imax = 0;
if (((ULONG_PTR)(pSrc[0]) & 0x0f) || ((ULONG_PTR)(pSrc[1]) & 0x0f) ||
((ULONG_PTR)(pSrc[2]) & 0x0f) || ((ULONG_PTR)(pDst[0]) & 0x0f) ||
@@ -678,11 +677,11 @@ sse2_RGBToYCbCr_16s16s_P3P3(const INT16* WINPR_RESTRICT pSrc[3], int srcStep,
g_buf = (__m128i*)(pSrc[1]);
b_buf = (__m128i*)(pSrc[2]);
#endif /* DO_PREFETCH */
imax = roi->width * sizeof(INT16) / sizeof(__m128i);
const size_t imax = roi->width * sizeof(INT16) / sizeof(__m128i);
for (UINT32 yp = 0; yp < roi->height; ++yp)
{
for (int i = 0; i < imax; i++)
for (size_t i = 0; i < imax; i++)
{
/* In order to use SSE2 signed 16-bit integer multiplication we
* need to convert the floating point factors to signed int

View File

@@ -252,7 +252,7 @@ const char* rdpdr_packetid_string(UINT16 packetid)
}
BOOL rdpdr_write_iocompletion_header(wStream* out, UINT32 DeviceId, UINT32 CompletionId,
UINT32 ioStatus)
NTSTATUS ioStatus)
{
WINPR_ASSERT(out);
Stream_SetPosition(out, 0);
@@ -262,7 +262,7 @@ BOOL rdpdr_write_iocompletion_header(wStream* out, UINT32 DeviceId, UINT32 Compl
Stream_Write_UINT16(out, PAKID_CORE_DEVICE_IOCOMPLETION); /* PacketId (2 bytes) */
Stream_Write_UINT32(out, DeviceId); /* DeviceId (4 bytes) */
Stream_Write_UINT32(out, CompletionId); /* CompletionId (4 bytes) */
Stream_Write_UINT32(out, ioStatus); /* IoStatus (4 bytes) */
Stream_Write_INT32(out, ioStatus); /* IoStatus (4 bytes) */
return TRUE;
}

View File

@@ -1548,7 +1548,7 @@ static LONG smartcard_LocateCardsByATRA_Call(scard_call_context* smartcard, wStr
}
LONG smartcard_irp_device_control_call(scard_call_context* smartcard, wStream* out,
UINT32* pIoStatus, SMARTCARD_OPERATION* operation)
NTSTATUS* pIoStatus, SMARTCARD_OPERATION* operation)
{
LONG result = 0;
UINT32 offset = 0;

View File

@@ -10,5 +10,21 @@ has_data_members_inserted_at = end
# winpr_strerror did use unsigned instead of signed int as argument
[suppress_function]
change_kine = function-subtype-change
change_kind = function-subtype-change
name = winpr_strerror
# NtStatus2Tag did use unsigned instead of signed NTSTATUS as argument
[suppress_function]
change_kind = function-subtype-change
name = NtStatus2Tag
# rdpdr_write_iocompletion_header did use unsigned instead of signed NTSTATUS as argument
[suppress_function]
change_kind = function-subtype-change
name = rdpdr_write_iocompletion_header
# smartcard_irp_device_control_call did use unsigned instead of signed NTSTATUS as argument
[suppress_function]
change_kind = function-subtype-change
name = smartcard_irp_device_control_call

View File

@@ -35,6 +35,8 @@
#include <sys/timerfd.h>
#include <sys/epoll.h>
#include <winpr/cast.h>
#include "uwac-os.h"
#include "wayland-cursor.h"
#include "wayland-client-protocol.h"
@@ -59,7 +61,7 @@ static struct wl_buffer* create_pointer_buffer(UwacSeat* seat, const void* src,
}
memcpy(data, src, size);
pool = wl_shm_create_pool(seat->display->shm, fd, size);
pool = wl_shm_create_pool(seat->display->shm, fd, WINPR_ASSERTING_INT_CAST(int32_t, size));
if (!pool)
{

View File

@@ -683,7 +683,9 @@ UwacReturnCode UwacWindowSetInputRegion(UwacWindow* window, uint32_t x, uint32_t
if (!window->input_region)
return UWAC_ERROR_NOMEMORY;
wl_region_add(window->input_region, x, y, width, height);
wl_region_add(window->input_region, WINPR_ASSERTING_INT_CAST(int32_t, x),
WINPR_ASSERTING_INT_CAST(int32_t, y), WINPR_ASSERTING_INT_CAST(int32_t, width),
WINPR_ASSERTING_INT_CAST(int32_t, height));
wl_surface_set_input_region(window->surface, window->input_region);
return UWAC_SUCCESS;
}

View File

@@ -1562,7 +1562,7 @@ extern "C"
{
#endif
WINPR_API const char* NtStatus2Tag(DWORD ntstatus);
WINPR_API const char* NtStatus2Tag(NTSTATUS ntstatus);
WINPR_API const char* Win32ErrorCode2Tag(UINT16 code);
#ifdef __cplusplus

View File

@@ -4613,7 +4613,7 @@ static int ntstatus_compare(const void* pKey, const void* pValue)
return *key < cur->code ? -1 : 1;
}
const char* NtStatus2Tag(DWORD ntstatus)
const char* NtStatus2Tag(NTSTATUS ntstatus)
{
#if 1 /* Requires sorted struct */