Merge pull request #12357 from akallabeth/win-fixes

Windows compile warning fixes
This commit is contained in:
akallabeth
2026-02-24 09:17:00 +01:00
committed by GitHub
6 changed files with 23 additions and 18 deletions

View File

@@ -34,6 +34,7 @@
#include <winspool.h>
#include <freerdp/client/printer.h>
#include <freerdp/utils/helpers.h>
#define WIDEN_INT(x) L##x
#define WIDEN(x) WIDEN_INT(x)
@@ -75,7 +76,7 @@ typedef struct
WINPR_ATTR_MALLOC(free, 1)
static WCHAR* printer_win_get_printjob_name(size_t id)
{
struct tm tres;
struct tm tres = { 0 };
WCHAR* str = NULL;
size_t len = 0;
@@ -93,7 +94,7 @@ static WCHAR* printer_win_get_printjob_name(size_t id)
const int rc = swprintf_s(
str, len,
WIDEN("%s Print %04d-%02d-%02d% 02d-%02d-%02d - Job %") WIDEN(PRIuz) WIDEN("\0"),
WIDEN("%s Print %04d-%02d-%02d %02d-%02d-%02d - Job %") WIDEN(PRIuz) WIDEN("\0"),
freerdp_getApplicationDetailsStringW(), tres.tm_year + 1900, tres.tm_mon + 1,
tres.tm_mday, tres.tm_hour, tres.tm_min, tres.tm_sec, id);
if (rc <= 0)

View File

@@ -31,6 +31,10 @@
#define TAG FREERDP_TAG("utils.signal")
#if defined(_WIN32)
const char* strsignal(int signum);
#endif
BOOL fsig_handlers_registered = FALSE;
typedef struct

View File

@@ -96,7 +96,7 @@ static inline winpr_MD4_u32plus H(winpr_MD4_u32plus x, winpr_MD4_u32plus y, winp
* This processes one or more 64-byte data blocks, but does NOT update the bit
* counters. There are no alignment requirements.
*/
static const void* body(WINPR_MD4_CTX* ctx, const void* data, unsigned long size)
static const void* body(WINPR_MD4_CTX* ctx, const void* data, size_t size)
{
const winpr_MD4_u32plus ac1 = 0x5a827999;
const winpr_MD4_u32plus ac2 = 0x6ed9eba1;
@@ -196,18 +196,18 @@ void winpr_MD4_Init(WINPR_MD4_CTX* ctx)
ctx->hi = 0;
}
void winpr_MD4_Update(WINPR_MD4_CTX* ctx, const void* data, unsigned long size)
void winpr_MD4_Update(WINPR_MD4_CTX* ctx, const void* data, size_t size)
{
winpr_MD4_u32plus saved_lo = ctx->lo;
if ((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo)
ctx->hi++;
ctx->hi += size >> 29;
unsigned long used = saved_lo & 0x3f;
size_t used = saved_lo & 0x3f;
if (used)
{
unsigned long available = 64 - used;
size_t available = 64 - used;
if (size < available)
{
@@ -223,7 +223,7 @@ void winpr_MD4_Update(WINPR_MD4_CTX* ctx, const void* data, unsigned long size)
if (size >= 64)
{
data = body(ctx, data, size & ~(unsigned long)0x3f);
data = body(ctx, data, size & ~(size_t)0x3f);
size &= 0x3f;
}
@@ -240,11 +240,11 @@ static inline void mdOUT(unsigned char* dst, winpr_MD4_u32plus src)
void winpr_MD4_Final(unsigned char* result, WINPR_MD4_CTX* ctx)
{
unsigned long used = ctx->lo & 0x3f;
size_t used = ctx->lo & 0x3f;
ctx->buffer[used++] = 0x80;
unsigned long available = 64 - used;
size_t available = 64 - used;
if (available < 8)
{

View File

@@ -40,7 +40,7 @@ typedef struct
} WINPR_MD4_CTX;
extern void winpr_MD4_Init(WINPR_MD4_CTX* ctx);
extern void winpr_MD4_Update(WINPR_MD4_CTX* ctx, const void* data, unsigned long size);
extern void winpr_MD4_Update(WINPR_MD4_CTX* ctx, const void* data, size_t size);
extern void winpr_MD4_Final(unsigned char* result, WINPR_MD4_CTX* ctx);
#endif

View File

@@ -106,7 +106,7 @@ static inline winpr_MD5_u32plus I(winpr_MD5_u32plus x, winpr_MD5_u32plus y, winp
* This processes one or more 64-byte data blocks, but does NOT update the bit
* counters. There are no alignment requirements.
*/
static const void* body(WINPR_MD5_CTX* ctx, const void* data, unsigned long size)
static const void* body(WINPR_MD5_CTX* ctx, const void* data, size_t size)
{
const unsigned char* ptr = (const unsigned char*)data;
@@ -221,18 +221,18 @@ void winpr_MD5_Init(WINPR_MD5_CTX* ctx)
ctx->hi = 0;
}
void winpr_MD5_Update(WINPR_MD5_CTX* ctx, const void* data, unsigned long size)
void winpr_MD5_Update(WINPR_MD5_CTX* ctx, const void* data, size_t size)
{
winpr_MD5_u32plus saved_lo = ctx->lo;
if ((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo)
ctx->hi++;
ctx->hi += size >> 29;
unsigned long used = saved_lo & 0x3f;
size_t used = saved_lo & 0x3f;
if (used)
{
unsigned long available = 64 - used;
size_t available = 64 - used;
if (size < available)
{
@@ -248,7 +248,7 @@ void winpr_MD5_Update(WINPR_MD5_CTX* ctx, const void* data, unsigned long size)
if (size >= 64)
{
data = body(ctx, data, size & ~(unsigned long)0x3f);
data = body(ctx, data, size & ~(size_t)0x3f);
size &= 0x3f;
}
@@ -265,11 +265,11 @@ static inline void mdOUT(unsigned char* dst, winpr_MD5_u32plus src)
void winpr_MD5_Final(unsigned char* result, WINPR_MD5_CTX* ctx)
{
unsigned long used = ctx->lo & 0x3f;
size_t used = ctx->lo & 0x3f;
ctx->buffer[used++] = 0x80;
unsigned long available = 64 - used;
size_t available = 64 - used;
if (available < 8)
{

View File

@@ -42,7 +42,7 @@ typedef struct
} WINPR_MD5_CTX;
extern void winpr_MD5_Init(WINPR_MD5_CTX* ctx);
extern void winpr_MD5_Update(WINPR_MD5_CTX* ctx, const void* data, unsigned long size);
extern void winpr_MD5_Update(WINPR_MD5_CTX* ctx, const void* data, size_t size);
extern void winpr_MD5_Final(unsigned char* result, WINPR_MD5_CTX* ctx);
#endif