wfreerdp: fix compilation warnings and errors

This commit is contained in:
Marc-André Moreau 2011-11-12 00:51:41 -05:00
parent aca5643d2b
commit 150ff56f5f
13 changed files with 27 additions and 63 deletions

View File

@ -267,41 +267,6 @@ void wf_gdi_mem3blt(rdpUpdate* update, MEM3BLT_ORDER* mem3blt)
}
void wf_gdi_fast_index(rdpUpdate* update, FAST_INDEX_ORDER* fast_index)
{
}
void wf_gdi_cache_color_table(rdpUpdate* update, CACHE_COLOR_TABLE_ORDER* cache_color_table)
{
palette_cache_put(update->context->cache->color_table, cache_color_table->cacheIndex, (void*) cache_color_table->colorTable);
}
void wf_gdi_cache_glyph(rdpUpdate* update, CACHE_GLYPH_ORDER* cache_glyph)
{
int i;
wfBitmap* wf_bmp;
GLYPH_DATA* glyph;
wfInfo* wfi = ((wfContext*) update->context)->wfi;
for (i = 0; i < cache_glyph->cGlyphs; i++)
{
glyph = cache_glyph->glyphData[i];
wf_bmp = wf_glyph_new(wfi, glyph);
glyph_cache_put(update->context->cache->glyph, cache_glyph->cacheId, glyph->cacheIndex, glyph, (void*) wf_bmp);
}
}
void wf_gdi_cache_glyph_v2(rdpUpdate* update, CACHE_GLYPH_V2_ORDER* cache_glyph_v2)
{
}
void wf_gdi_cache_brush(rdpUpdate* update, CACHE_BRUSH_ORDER* cache_brush)
{
}
void wf_gdi_surface_bits(rdpUpdate* update, SURFACE_BITS_COMMAND* surface_bits_command)
{
@ -327,17 +292,12 @@ void wf_gdi_register_update_callbacks(rdpUpdate* update)
update->Mem3Blt = wf_gdi_mem3blt;
update->SaveBitmap = NULL;
update->GlyphIndex = NULL;
update->FastIndex = wf_gdi_fast_index;
update->FastIndex = NULL;
update->FastGlyph = NULL;
update->PolygonSC = NULL;
update->PolygonCB = NULL;
update->EllipseSC = NULL;
update->EllipseCB = NULL;
update->CacheColorTable = wf_gdi_cache_color_table;
update->CacheGlyph = wf_gdi_cache_glyph;
update->CacheGlyphV2 = wf_gdi_cache_glyph_v2;
update->CacheBrush = wf_gdi_cache_brush;
update->SurfaceBits = wf_gdi_surface_bits;
}

View File

@ -31,7 +31,7 @@ void update_gdi_memblt(rdpUpdate* update, MEMBLT_ORDER* memblt)
if (memblt->cacheId == 0xFF)
bitmap = offscreen_cache_get(cache->offscreen, memblt->cacheIndex);
else
bitmap = bitmap_cache_get(cache->bitmap, memblt->cacheId, memblt->cacheIndex);
bitmap = bitmap_cache_get(cache->bitmap, (uint8) memblt->cacheId, memblt->cacheIndex);
memblt->bitmap = bitmap;
IFCALL(cache->bitmap->MemBlt, update, memblt);
@ -45,7 +45,7 @@ void update_gdi_mem3blt(rdpUpdate* update, MEM3BLT_ORDER* mem3blt)
if (mem3blt->cacheId == 0xFF)
bitmap = offscreen_cache_get(cache->offscreen, mem3blt->cacheIndex);
else
bitmap = bitmap_cache_get(cache->bitmap, mem3blt->cacheId, mem3blt->cacheIndex);
bitmap = bitmap_cache_get(cache->bitmap, (uint8) mem3blt->cacheId, mem3blt->cacheIndex);
mem3blt->bitmap = bitmap;
IFCALL(cache->bitmap->Mem3Blt, update, mem3blt);

View File

@ -277,7 +277,7 @@ void* glyph_cache_fragment_get(rdpGlyphCache* glyph_cache, uint8 index, uint8* s
void* fragment;
fragment = glyph_cache->fragCache.entries[index].fragment;
*size = glyph_cache->fragCache.entries[index].size;
*size = (uint8) glyph_cache->fragCache.entries[index].size;
if (fragment == NULL)
{

View File

@ -42,7 +42,7 @@ void nsc_cl_expand(STREAM* stream, uint8 shiftcount, uint32 origsz)
bitoff = bitno % 0x8;
(*temptr) |= (sign >> bitoff);
}
while(stream->p - stream->data < origsz);
while(((uint32)(stream->p - stream->data)) < origsz);
stream->p = stream->data;
}
@ -81,7 +81,7 @@ void nsc_chroma_supersample(NSC_CONTEXT* context)
if(i == 1)
pw >>= 1;
while ((temp->p - temp->data) < context->OrgByteCount[i])
while (((uint32)(temp->p - temp->data)) < context->OrgByteCount[i])
{
bytno = temp->p - temp->data;
bitoff = bytno % 0x8;

View File

@ -269,7 +269,7 @@ char* crypto_cert_fingerprint(X509* xcert)
fp_buffer = (char*) xzalloc(3 * fp_len);
p = fp_buffer;
for (i = 0; i < fp_len - 1; i++)
for (i = 0; i < (int) (fp_len - 1); i++)
{
sprintf(p, "%02x:", fp[i]);
p = &fp_buffer[i * 3];

View File

@ -22,6 +22,7 @@
#include <stdlib.h>
#include <string.h>
#include <freerdp/freerdp.h>
#include <freerdp/utils/print.h>
#include <freerdp/utils/memory.h>
#include "extension.h"

View File

@ -21,6 +21,7 @@
#ifndef __EXTENSION_H
#define __EXTENSION_H
#include <freerdp/api.h>
#include <freerdp/freerdp.h>
#include <freerdp/extension.h>
@ -40,11 +41,11 @@ struct rdp_extension
};
typedef struct rdp_extension rdpExtension;
int extension_pre_connect(rdpExtension* extension);
int extension_post_connect(rdpExtension* extension);
FREERDP_API int extension_pre_connect(rdpExtension* extension);
FREERDP_API int extension_post_connect(rdpExtension* extension);
rdpExtension* extension_new(freerdp* instance);
void extension_free(rdpExtension* extension);
FREERDP_API rdpExtension* extension_new(freerdp* instance);
FREERDP_API void extension_free(rdpExtension* extension);
#endif /* __EXTENSION_H */

View File

@ -619,7 +619,7 @@ boolean fastpath_send_surfcmd_surface_bits(rdpFastPath* fastpath, SURFACE_BITS_C
size += SURFCMD_SURFACE_BITS_HEADER_LENGTH;
}
fragment_size = MIN(FASTPATH_MAX_PACKET_SIZE - stream_get_length(s), bitmapDataLength);
fragment_size = MIN((uint32)(FASTPATH_MAX_PACKET_SIZE - stream_get_length(s)), bitmapDataLength);
if (fragment_size == bitmapDataLength)
fragmentation = (i == 0 ? FASTPATH_FRAGMENT_SINGLE : FASTPATH_FRAGMENT_LAST);

View File

@ -78,10 +78,9 @@ static boolean freerdp_listener_open(freerdp_listener* instance, const char* bin
}
option_value = 1;
if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &option_value, sizeof(option_value)) == -1)
{
if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (void*) &option_value, sizeof(option_value)) == -1)
perror("setsockopt");
}
#ifndef _WIN32
fcntl(sockfd, F_SETFL, O_NONBLOCK);

View File

@ -139,7 +139,7 @@ boolean rdp_recv_server_redirection_pdu(rdpRdp* rdp, STREAM* s)
redirection->targetNetAddresses = (rdpString*) xzalloc(count * sizeof(rdpString));
for (i=0; i < count; i++)
for (i = 0; i < (int) count; i++)
{
freerdp_string_read_length32(s, &redirection->targetNetAddresses[i], rdp->settings->uniconv);
DEBUG_REDIR("targetNetAddresses: %s", (&redirection->targetNetAddresses[i])->ascii);

View File

@ -79,7 +79,7 @@ rdpIconCache* icon_cache_new(rdpRail* rail)
int i;
cache->rail = rail;
cache->numCaches = rail->settings->num_icon_cache_entries;
cache->numCaches = (uint8) rail->settings->num_icon_cache_entries;
cache->numCacheEntries = rail->settings->num_icon_cache_entries;
cache->caches = xzalloc(cache->numCaches * sizeof(WINDOW_ICON_CACHE));

View File

@ -26,7 +26,7 @@
#ifdef _WIN32
#include <windows.h>
#define DLOPEN(f) LoadLibrary(f)
#define DLOPEN(f) LoadLibraryA(f)
#define DLSYM(f, n) GetProcAddress(f, n)
#define DLCLOSE(f) FreeLibrary(f)
#define PATH_SEPARATOR '\\'
@ -51,13 +51,9 @@ void* freerdp_load_plugin(const char* name, const char* entry_name)
void* entry;
if (strchr(name, PATH_SEPARATOR) == NULL)
{
snprintf(path, sizeof(path), PLUGIN_PATH "%c%s." PLUGIN_EXT, PATH_SEPARATOR, name);
}
else
{
strncpy(path, name, sizeof(path));
}
module = DLOPEN(path);
if (module == NULL)

View File

@ -62,9 +62,16 @@ double stopwatch_get_elapsed_time_in_seconds(STOPWATCH* stopwatch)
void stopwatch_get_elapsed_time_in_useconds(STOPWATCH* stopwatch, uint32* sec, uint32* usec)
{
double uelapsed;
double clocks_per_usec;
*sec = ((uint32) stopwatch->elapsed) / CLOCKS_PER_SEC;
uelapsed = stopwatch->elapsed - ((double)(*sec) * CLOCKS_PER_SEC);
*usec = (uint32)(uelapsed / (CLOCKS_PER_SEC / 1000000));
clocks_per_usec = (CLOCKS_PER_SEC / 1000000);
if (clocks_per_usec > 0.0)
*usec = (uint32)(uelapsed / clocks_per_usec);
else
*usec = 0;
}