From c1eddf31c32fe66e6f8453b5434313a982260908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Tue, 16 Aug 2011 21:08:14 -0400 Subject: [PATCH] windows: fix warnings --- CMakeLists.txt | 1 + libfreerdp-cache/bitmap_v2.c | 2 +- libfreerdp-core/bitmap_inc.c | 2 +- libfreerdp-core/certificate.c | 4 ++-- libfreerdp-core/license.c | 6 +++--- libfreerdp-core/rdp.c | 2 +- libfreerdp-core/rdp.h | 2 +- libfreerdp-core/update.c | 2 +- libfreerdp-core/vchan.c | 2 +- libfreerdp-utils/args.c | 4 ++-- libfreerdp-utils/dsp.c | 4 ++-- libfreerdp-utils/svc_plugin.c | 2 +- 12 files changed, 17 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cb152640b..56df77cb0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,6 +61,7 @@ endif() if(MSVC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Gz") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_X86_") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DFREERDP_EXPORTS") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWIN32_LEAN_AND_MEAN") endif() diff --git a/libfreerdp-cache/bitmap_v2.c b/libfreerdp-cache/bitmap_v2.c index e5297b383..d6350542b 100644 --- a/libfreerdp-cache/bitmap_v2.c +++ b/libfreerdp-cache/bitmap_v2.c @@ -112,7 +112,7 @@ void bitmap_v2_free(rdpBitmapV2* bitmap_v2) { for (i = 0; i < bitmap_v2->maxCells; i++) { - for (j = 0; j < bitmap_v2->cells[i].number; j++) + for (j = 0; j < (int) bitmap_v2->cells[i].number; j++) { if (bitmap_v2->cells[i].entries[j].entry != NULL) xfree(bitmap_v2->cells[i].entries[j].entry); diff --git a/libfreerdp-core/bitmap_inc.c b/libfreerdp-core/bitmap_inc.c index 50ab6234c..440660870 100644 --- a/libfreerdp-core/bitmap_inc.c +++ b/libfreerdp-core/bitmap_inc.c @@ -409,7 +409,7 @@ void RLEDECOMPRESS(uint8* pbSrcBuffer, uint32 cbSrcBuffer, uint8* pbDestBuffer, /* Watch out for the end of the first scanline. */ if (fFirstLine) { - if (pbDest - pbDestBuffer >= rowDelta) + if ((uint32)(pbDest - pbDestBuffer) >= rowDelta) { fFirstLine = False; fInsertFgPel = False; diff --git a/libfreerdp-core/certificate.c b/libfreerdp-core/certificate.c index 0b3a4a37f..9f8e62906 100644 --- a/libfreerdp-core/certificate.c +++ b/libfreerdp-core/certificate.c @@ -218,7 +218,7 @@ void certificate_free_x509_certificate_chain(rdpX509CertChain* x509_cert_chain) if (x509_cert_chain == NULL) return; - for (i = 0; i < x509_cert_chain->count; i++) + for (i = 0; i < (int) x509_cert_chain->count; i++) { if (x509_cert_chain->array[i].data != NULL) xfree(x509_cert_chain->array[i].data); @@ -256,7 +256,7 @@ void certificate_read_server_x509_certificate_chain(rdpCertificate* certificate, certificate->x509_cert_chain = certificate_new_x509_certificate_chain(numCertBlobs); - for (i = 0; i < numCertBlobs; i++) + for (i = 0; i < (int) numCertBlobs; i++) { stream_read_uint32(s, certLength); diff --git a/libfreerdp-core/license.c b/libfreerdp-core/license.c index 1f7debc04..cec75f4e9 100644 --- a/libfreerdp-core/license.c +++ b/libfreerdp-core/license.c @@ -148,7 +148,7 @@ STREAM* license_send_stream_init(rdpLicense* license) void license_send(rdpLicense* license, STREAM* s, uint8 type) { int length; - uint16 flags; + uint8 flags; uint16 wMsgSize; uint16 sec_flags; @@ -515,7 +515,7 @@ void license_free_binary_blob(LICENSE_BLOB* blob) void license_read_scope_list(STREAM* s, SCOPE_LIST* scopeList) { - int i; + uint32 i; uint32 scopeCount; stream_read_uint32(s, scopeCount); /* ScopeCount (4 bytes) */ @@ -556,7 +556,7 @@ SCOPE_LIST* license_new_scope_list() void license_free_scope_list(SCOPE_LIST* scopeList) { - int i; + uint32 i; for (i = 0; i < scopeList->count; i++) { diff --git a/libfreerdp-core/rdp.c b/libfreerdp-core/rdp.c index 13f6b3ea8..6cd298923 100644 --- a/libfreerdp-core/rdp.c +++ b/libfreerdp-core/rdp.c @@ -222,7 +222,7 @@ void rdp_send_pdu(rdpRdp* rdp, STREAM* s, uint16 type, uint16 channel_id) transport_write(rdp->transport, s); } -void rdp_send_data_pdu(rdpRdp* rdp, STREAM* s, uint16 type, uint16 channel_id) +void rdp_send_data_pdu(rdpRdp* rdp, STREAM* s, uint8 type, uint16 channel_id) { int length; diff --git a/libfreerdp-core/rdp.h b/libfreerdp-core/rdp.h index ee7c7148f..2a4776f48 100644 --- a/libfreerdp-core/rdp.h +++ b/libfreerdp-core/rdp.h @@ -142,7 +142,7 @@ STREAM* rdp_pdu_init(rdpRdp* rdp); void rdp_send_pdu(rdpRdp* rdp, STREAM* s, uint16 type, uint16 channel_id); STREAM* rdp_data_pdu_init(rdpRdp* rdp); -void rdp_send_data_pdu(rdpRdp* rdp, STREAM* s, uint16 type, uint16 channel_id); +void rdp_send_data_pdu(rdpRdp* rdp, STREAM* s, uint8 type, uint16 channel_id); void rdp_send(rdpRdp* rdp, STREAM* s, uint16 channel_id); void rdp_recv(rdpRdp* rdp); diff --git a/libfreerdp-core/update.c b/libfreerdp-core/update.c index eb99b1ef1..e3f9d98a5 100644 --- a/libfreerdp-core/update.c +++ b/libfreerdp-core/update.c @@ -134,7 +134,7 @@ void update_read_palette(rdpUpdate* update, STREAM* s, PALETTE_UPDATE* palette_u palette_update->number = 256; /* paletteEntries */ - for (i = 0; i < palette_update->number; i++) + for (i = 0; i < (int) palette_update->number; i++) { stream_read_uint8(s, byte); color = byte; diff --git a/libfreerdp-core/vchan.c b/libfreerdp-core/vchan.c index a1a844b1a..d498c6ef1 100644 --- a/libfreerdp-core/vchan.c +++ b/libfreerdp-core/vchan.c @@ -55,7 +55,7 @@ boolean vchan_send(rdpVchan* vchan, uint16 channel_id, uint8* data, int size) { s = rdp_send_stream_init(vchan->instance->rdp); - if (size > vchan->instance->settings->vc_chunk_size) + if (size > (int) vchan->instance->settings->vc_chunk_size) { chunk_size = vchan->instance->settings->vc_chunk_size; } diff --git a/libfreerdp-utils/args.c b/libfreerdp-utils/args.c index 340ac461c..4673af4c2 100644 --- a/libfreerdp-utils/args.c +++ b/libfreerdp-utils/args.c @@ -127,10 +127,10 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv, printf("missing width\n"); return 0; } - settings->width = strtol(argv[index], &p, 10); + settings->width = (uint16) strtol(argv[index], &p, 10); if (*p == 'x') { - settings->height = strtol(p + 1, &p, 10); + settings->height = (uint16) strtol(p + 1, &p, 10); } else { diff --git a/libfreerdp-utils/dsp.c b/libfreerdp-utils/dsp.c index 8dd7c4d64..c7d013f88 100644 --- a/libfreerdp-utils/dsp.c +++ b/libfreerdp-utils/dsp.c @@ -294,13 +294,13 @@ uint8* dsp_encode_ima_adpcm(ADPCM* adpcm, { *dst++ = adpcm->last_sample[0] & 0xff; *dst++ = (adpcm->last_sample[0] >> 8) & 0xff; - *dst++ = adpcm->last_step[0]; + *dst++ = (uint8) adpcm->last_step[0]; *dst++ = 0; if (channels > 1) { *dst++ = adpcm->last_sample[1] & 0xff; *dst++ = (adpcm->last_sample[1] >> 8) & 0xff; - *dst++ = adpcm->last_step[1]; + *dst++ = (uint8) adpcm->last_step[1]; *dst++ = 0; } } diff --git a/libfreerdp-utils/svc_plugin.c b/libfreerdp-utils/svc_plugin.c index 66c1d92af..cbf9c1ca8 100644 --- a/libfreerdp-utils/svc_plugin.c +++ b/libfreerdp-utils/svc_plugin.c @@ -153,7 +153,7 @@ static void svc_plugin_process_received(rdpSvcPlugin* plugin, void* pData, uint3 } data_in = plugin->priv->data_in; - stream_check_size(data_in, dataLength); + stream_check_size(data_in, (int) dataLength); stream_write(data_in, pData, dataLength); if (dataFlags & CHANNEL_FLAG_LAST)