[warnings] fixed sign-compare
This commit is contained in:
parent
2fc791fe9b
commit
5e123735fa
@ -334,7 +334,7 @@ BOOL sdl_detect_monitors(SdlContext* sdl, UINT32* pMaxWidth, UINT32* pMaxHeight)
|
|||||||
if (!freerdp_settings_set_pointer_len(settings, FreeRDP_MonitorIds, nullptr,
|
if (!freerdp_settings_set_pointer_len(settings, FreeRDP_MonitorIds, nullptr,
|
||||||
static_cast<size_t>(numDisplays)))
|
static_cast<size_t>(numDisplays)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
for (size_t x = 0; x < numDisplays; x++)
|
for (size_t x = 0; x < static_cast<size_t>(numDisplays); x++)
|
||||||
{
|
{
|
||||||
if (!freerdp_settings_set_pointer_array(settings, FreeRDP_MonitorIds, x, &x))
|
if (!freerdp_settings_set_pointer_array(settings, FreeRDP_MonitorIds, x, &x))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -147,7 +147,7 @@ BOOL xf_detect_monitors(xfContext* xfc, UINT32* pMaxWidth, UINT32* pMaxHeight)
|
|||||||
int mouse_y = 0;
|
int mouse_y = 0;
|
||||||
int _dummy_i = 0;
|
int _dummy_i = 0;
|
||||||
Window _dummy_w = 0;
|
Window _dummy_w = 0;
|
||||||
int current_monitor = 0;
|
UINT32 current_monitor = 0;
|
||||||
Screen* screen = NULL;
|
Screen* screen = NULL;
|
||||||
#if defined WITH_XINERAMA || defined WITH_XRANDR
|
#if defined WITH_XINERAMA || defined WITH_XRANDR
|
||||||
int major = 0;
|
int major = 0;
|
||||||
|
@ -973,7 +973,7 @@ static void cliprdr_file_fuse_read(fuse_req_t fuse_req, fuse_ino_t fuse_ino, siz
|
|||||||
fuse_reply_err(fuse_req, EISDIR);
|
fuse_reply_err(fuse_req, EISDIR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!fuse_file->has_size || (offset < 0) || (offset > fuse_file->size))
|
if (!fuse_file->has_size || (offset < 0) || ((size_t)offset > fuse_file->size))
|
||||||
{
|
{
|
||||||
HashTable_Unlock(file_context->inode_table);
|
HashTable_Unlock(file_context->inode_table);
|
||||||
fuse_reply_err(fuse_req, EINVAL);
|
fuse_reply_err(fuse_req, EINVAL);
|
||||||
|
@ -409,7 +409,7 @@ static char* pf_config_decode_base64(const char* data, const char* name, size_t*
|
|||||||
while (*end == '-')
|
while (*end == '-')
|
||||||
end++;
|
end++;
|
||||||
|
|
||||||
const size_t s = MIN(ARRAYSIZE(hdr) - 1, end - data);
|
const size_t s = MIN(ARRAYSIZE(hdr) - 1ULL, (size_t)(end - data));
|
||||||
memcpy(hdr, data, s);
|
memcpy(hdr, data, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -676,12 +676,12 @@ static int x11_shadow_blend_cursor(x11ShadowSubsystem* subsystem)
|
|||||||
pDstData = surface->data;
|
pDstData = surface->data;
|
||||||
nDstStep = surface->scanline;
|
nDstStep = surface->scanline;
|
||||||
|
|
||||||
for (int y = 0; y < nHeight; y++)
|
for (size_t y = 0; y < nHeight; y++)
|
||||||
{
|
{
|
||||||
const BYTE* pSrcPixel = &pSrcData[((nYSrc + y) * nSrcStep) + (nXSrc * 4)];
|
const BYTE* pSrcPixel = &pSrcData[((nYSrc + y) * nSrcStep) + (nXSrc * 4)];
|
||||||
BYTE* pDstPixel = &pDstData[((nYDst + y) * nDstStep) + (nXDst * 4)];
|
BYTE* pDstPixel = &pDstData[((nYDst + y) * nDstStep) + (nXDst * 4)];
|
||||||
|
|
||||||
for (int x = 0; x < nWidth; x++)
|
for (size_t x = 0; x < nWidth; x++)
|
||||||
{
|
{
|
||||||
B = *pSrcPixel++;
|
B = *pSrcPixel++;
|
||||||
G = *pSrcPixel++;
|
G = *pSrcPixel++;
|
||||||
|
@ -242,7 +242,7 @@ struct uwac_window
|
|||||||
int surfaceStates;
|
int surfaceStates;
|
||||||
enum wl_shm_format format;
|
enum wl_shm_format format;
|
||||||
|
|
||||||
int nbuffers;
|
size_t nbuffers;
|
||||||
UwacBuffer* buffers;
|
UwacBuffer* buffers;
|
||||||
|
|
||||||
struct wl_region* opaque_region;
|
struct wl_region* opaque_region;
|
||||||
|
@ -58,7 +58,7 @@ static const struct wl_buffer_listener buffer_listener = { buffer_release };
|
|||||||
|
|
||||||
static void UwacWindowDestroyBuffers(UwacWindow* w)
|
static void UwacWindowDestroyBuffers(UwacWindow* w)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < w->nbuffers; i++)
|
for (size_t i = 0; i < w->nbuffers; i++)
|
||||||
{
|
{
|
||||||
UwacBuffer* buffer = &w->buffers[i];
|
UwacBuffer* buffer = &w->buffers[i];
|
||||||
#ifdef UWAC_HAVE_PIXMAN_REGION
|
#ifdef UWAC_HAVE_PIXMAN_REGION
|
||||||
@ -370,19 +370,20 @@ int UwacWindowShmAllocBuffers(UwacWindow* w, int64_t nbuffers, int64_t allocSize
|
|||||||
goto error_mmap;
|
goto error_mmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < nbuffers; i++)
|
for (int64_t i = 0; i < nbuffers; i++)
|
||||||
{
|
{
|
||||||
int bufferIdx = w->nbuffers + i;
|
const size_t idx = (size_t)i;
|
||||||
|
size_t bufferIdx = w->nbuffers + idx;
|
||||||
UwacBuffer* buffer = &w->buffers[bufferIdx];
|
UwacBuffer* buffer = &w->buffers[bufferIdx];
|
||||||
#ifdef UWAC_HAVE_PIXMAN_REGION
|
#ifdef UWAC_HAVE_PIXMAN_REGION
|
||||||
pixman_region32_init(&buffer->damage);
|
pixman_region32_init(&buffer->damage);
|
||||||
#else
|
#else
|
||||||
region16_init(&buffer->damage);
|
region16_init(&buffer->damage);
|
||||||
#endif
|
#endif
|
||||||
buffer->data = &((char*)data)[allocSize * i];
|
buffer->data = &((char*)data)[allocSize * idx];
|
||||||
buffer->size = allocSize;
|
buffer->size = allocSize;
|
||||||
buffer->wayland_buffer =
|
buffer->wayland_buffer =
|
||||||
wl_shm_pool_create_buffer(pool, allocSize * i, width, height, w->stride, format);
|
wl_shm_pool_create_buffer(pool, allocSize * idx, width, height, w->stride, format);
|
||||||
UwacBufferReleaseData* listener_data = xmalloc(sizeof(UwacBufferReleaseData));
|
UwacBufferReleaseData* listener_data = xmalloc(sizeof(UwacBufferReleaseData));
|
||||||
listener_data->window = w;
|
listener_data->window = w;
|
||||||
listener_data->bufferIdx = bufferIdx;
|
listener_data->bufferIdx = bufferIdx;
|
||||||
|
@ -278,7 +278,7 @@ DWORD GetModuleFileNameA(HMODULE hModule, LPSTR lpFilename, DWORD nSize)
|
|||||||
(void)sprintf_s(path, ARRAYSIZE(path), "/proc/%d/exe", getpid());
|
(void)sprintf_s(path, ARRAYSIZE(path), "/proc/%d/exe", getpid());
|
||||||
status = readlink(path, buffer, ARRAYSIZE(buffer) - 1);
|
status = readlink(path, buffer, ARRAYSIZE(buffer) - 1);
|
||||||
|
|
||||||
if ((status < 0) || (status >= ARRAYSIZE(buffer)))
|
if ((status < 0) || ((size_t)status >= ARRAYSIZE(buffer)))
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_INTERNAL_ERROR);
|
SetLastError(ERROR_INTERNAL_ERROR);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -184,7 +184,7 @@ static char* get_link_target(const char* base, const char* dir, const char* name
|
|||||||
rc = readlink(path, target, size);
|
rc = readlink(path, target, size);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
} while (rc >= size);
|
} while ((size_t)rc >= size);
|
||||||
|
|
||||||
apath = topath(base, dir, target);
|
apath = topath(base, dir, target);
|
||||||
fail:
|
fail:
|
||||||
|
@ -175,7 +175,7 @@ static BOOL IniFile_Load_File(wIniFile* ini, const char* filename)
|
|||||||
if (fileSize < 1)
|
if (fileSize < 1)
|
||||||
goto out_file;
|
goto out_file;
|
||||||
|
|
||||||
if (fileSize > SIZE_MAX)
|
if (fileSize > INT64_MAX)
|
||||||
goto out_file;
|
goto out_file;
|
||||||
|
|
||||||
if (!IniFile_BufferResize(ini, (size_t)fileSize + 2))
|
if (!IniFile_BufferResize(ini, (size_t)fileSize + 2))
|
||||||
|
Loading…
Reference in New Issue
Block a user