mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-01-09 05:51:00 +00:00
mingw32 build: fix signed/unsigned warnings as errors
This commit is contained in:
parent
2cd07dd8f3
commit
06749bd66b
@ -1233,7 +1233,7 @@ ModifierKey modifier_keys[] = {
|
||||
void Application::sync_keyboard_modifiers()
|
||||
{
|
||||
uint32_t modifiers = Platform::get_keyboard_modifiers();
|
||||
for (int i = 0; i < sizeof(modifier_keys) / sizeof(modifier_keys[0]); i++) {
|
||||
for (size_t i = 0; i < sizeof(modifier_keys) / sizeof(modifier_keys[0]); i++) {
|
||||
if (modifiers & modifier_keys[i].modifier) {
|
||||
on_key_down(modifier_keys[i].key);
|
||||
} else {
|
||||
@ -2012,7 +2012,7 @@ bool Application::set_host_cert_subject(const char* subject, const char* arg0)
|
||||
while (true) {
|
||||
if ((iter == subject_str.end()) || (*iter == ',')) {
|
||||
RedPeer::HostAuthOptions::CertFieldValuePair entry_pair;
|
||||
int value_pos = entry.find_first_of('=');
|
||||
size_t value_pos = entry.find_first_of('=');
|
||||
if ((value_pos == std::string::npos) || (value_pos == (entry.length() - 1))) {
|
||||
Platform::term_printf("%s: host_subject bad format: assignment for %s is missing\n",
|
||||
arg0, entry.c_str());
|
||||
|
||||
@ -436,7 +436,7 @@ char* CmdLineParser::next_argument()
|
||||
void CmdLineParser::show_help()
|
||||
{
|
||||
static const int HELP_START_POS = 30;
|
||||
static const int HELP_WIDTH = 80 - HELP_START_POS;
|
||||
static const unsigned HELP_WIDTH = 80 - HELP_START_POS;
|
||||
std::ostringstream os;
|
||||
|
||||
os << _argv[0] << " - " << _description.c_str() << "\n\noptions:\n\n";
|
||||
|
||||
@ -363,7 +363,7 @@ void VideoStream::remove_dead_frames(uint32_t mm_time)
|
||||
void VideoStream::drop_one_frame()
|
||||
{
|
||||
ASSERT(MAX_VIDEO_FRAMES > 2 && (_frames_head - _frames_tail) == MAX_VIDEO_FRAMES);
|
||||
int frame_index = _frames_head - _kill_mark++ % (MAX_VIDEO_FRAMES - 2) - 2;
|
||||
unsigned frame_index = _frames_head - _kill_mark++ % (MAX_VIDEO_FRAMES - 2) - 2;
|
||||
|
||||
free_frame(frame_index);
|
||||
|
||||
|
||||
@ -114,7 +114,7 @@ void HotKeysParser::add_key(HotkeySet& keys, const char* key)
|
||||
{ "f12", REDKEY_F12, REDKEY_INVALID }
|
||||
};
|
||||
|
||||
for (int i = 0; i < (sizeof(keyboard) / sizeof(keyboard[0])); ++i) {
|
||||
for (unsigned i = 0; i < (sizeof(keyboard) / sizeof(keyboard[0])); ++i) {
|
||||
if (strcasecmp(key, keyboard[i].name) == 0) {
|
||||
HotkeyKey hotkey;
|
||||
hotkey.main = keyboard[i].main;
|
||||
|
||||
@ -108,7 +108,7 @@ void MJpegDecoder::convert_scanline(void)
|
||||
uint32_t *row;
|
||||
uint32_t c;
|
||||
uint8_t *s;
|
||||
int x;
|
||||
unsigned x;
|
||||
|
||||
ASSERT(_width % 2 == 0);
|
||||
ASSERT(_height % 2 == 0);
|
||||
|
||||
@ -59,13 +59,13 @@ private:
|
||||
size_t _data_end;
|
||||
size_t _extra_skip;
|
||||
|
||||
int _width;
|
||||
int _height;
|
||||
unsigned _width;
|
||||
unsigned _height;
|
||||
int _stride;
|
||||
uint8_t *_frame;
|
||||
bool _back_compat;
|
||||
|
||||
int _y;
|
||||
unsigned _y;
|
||||
uint8_t *_scanline;
|
||||
|
||||
int _state;
|
||||
|
||||
@ -221,7 +221,7 @@ void TimersQueue::deactivate_interval_timer(Timer* timer)
|
||||
}
|
||||
}
|
||||
|
||||
int TimersQueue::get_soonest_timeout()
|
||||
unsigned int TimersQueue::get_soonest_timeout()
|
||||
{
|
||||
RecurciveLock lock(_timers_lock);
|
||||
TimersSet::iterator iter;
|
||||
@ -236,7 +236,7 @@ int TimersQueue::get_soonest_timeout()
|
||||
if (next_time <= now) {
|
||||
return 0;
|
||||
}
|
||||
return (int)(next_time - now);
|
||||
return (next_time - now);
|
||||
}
|
||||
|
||||
|
||||
@ -392,7 +392,7 @@ void ProcessLoop::deactivate_interval_timer(Timer* timer)
|
||||
_timers_queue.deactivate_interval_timer(timer);
|
||||
}
|
||||
|
||||
int ProcessLoop::get_soonest_timeout()
|
||||
unsigned ProcessLoop::get_soonest_timeout()
|
||||
{
|
||||
return _timers_queue.get_soonest_timeout();
|
||||
}
|
||||
|
||||
@ -165,7 +165,7 @@ public:
|
||||
void activate_interval_timer(Timer* timer, unsigned int millisec);
|
||||
void deactivate_interval_timer(Timer* timer);
|
||||
|
||||
int get_soonest_timeout();
|
||||
unsigned int get_soonest_timeout();
|
||||
void timers_action();
|
||||
|
||||
private:
|
||||
@ -207,7 +207,7 @@ public:
|
||||
void process_events_queue();
|
||||
/* can be used for handling timers in modal loop state in Windows (mainly,
|
||||
for updating the screen) */
|
||||
int get_soonest_timeout();
|
||||
unsigned int get_soonest_timeout();
|
||||
void timers_action();
|
||||
|
||||
void* get_owner() { return _owner;}
|
||||
|
||||
@ -770,8 +770,8 @@ void RedClient::calc_pixmap_cach_and_glz_window_size(uint32_t display_channels_h
|
||||
{
|
||||
#ifdef WIN32
|
||||
display_channels_hint = MAX(1, display_channels_hint);
|
||||
int max_cache_size = display_channels_hint * MAX_DISPLAY_PIXMAP_CACHE;
|
||||
int min_cache_size = display_channels_hint * MIN_DISPLAY_PIXMAP_CACHE;
|
||||
uint64_t max_cache_size = display_channels_hint * MAX_DISPLAY_PIXMAP_CACHE;
|
||||
uint64_t min_cache_size = display_channels_hint * MIN_DISPLAY_PIXMAP_CACHE;
|
||||
|
||||
MEMORYSTATUSEX mem_status;
|
||||
mem_status.dwLength = sizeof(mem_status);
|
||||
|
||||
@ -364,7 +364,7 @@ bool RedPeer::verify_subject(X509* cert, const HostAuthOptions::CertFieldValueLi
|
||||
return false;
|
||||
}
|
||||
|
||||
if (X509_NAME_entry_count(cert_subject) != subject.size()) {
|
||||
if ((size_t)X509_NAME_entry_count(cert_subject) != subject.size()) {
|
||||
DBG(0, "subject mismatch: #entries cert=%d, input=%d",
|
||||
X509_NAME_entry_count(cert_subject), subject.size());
|
||||
return false;
|
||||
|
||||
@ -133,7 +133,7 @@ private:
|
||||
int _in_msg_len;
|
||||
|
||||
std::string _out_msg; // <virtual ip>\n
|
||||
int _out_msg_pos;
|
||||
unsigned _out_msg_pos;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@ -108,7 +108,7 @@ void Platform::send_quit_request()
|
||||
static uint32_t get_clipboard_type(uint32_t format) {
|
||||
uint32_t* types = NULL;
|
||||
|
||||
for (int i = 0; i < clipboard_formats_count && !types; i++) {
|
||||
for (size_t i = 0; i < clipboard_formats_count && !types; i++) {
|
||||
if (clipboard_formats[i].format == format) {
|
||||
types = clipboard_formats[i].types;
|
||||
}
|
||||
@ -125,7 +125,7 @@ static uint32_t get_clipboard_type(uint32_t format) {
|
||||
}
|
||||
|
||||
static uint32_t get_clipboard_format(uint32_t type) {
|
||||
for (int i = 0; i < clipboard_formats_count; i++) {
|
||||
for (size_t i = 0; i < clipboard_formats_count; i++) {
|
||||
for (uint32_t* ptype = clipboard_formats[i].types; *ptype; ptype++) {
|
||||
if (*ptype == type) {
|
||||
return clipboard_formats[i].format;
|
||||
@ -140,7 +140,7 @@ static int get_available_clipboard_types(uint32_t** types)
|
||||
int count = 0;
|
||||
|
||||
*types = new uint32_t[clipboard_formats_count * CLIPBOARD_FORMAT_MAX_TYPES];
|
||||
for (int i = 0; i < clipboard_formats_count; i++) {
|
||||
for (size_t i = 0; i < clipboard_formats_count; i++) {
|
||||
if (IsClipboardFormatAvailable(clipboard_formats[i].format)) {
|
||||
for (uint32_t* ptype = clipboard_formats[i].types; *ptype; ptype++) {
|
||||
(*types)[count++] = *ptype;
|
||||
@ -156,7 +156,7 @@ static int get_available_clipboard_types(uint32_t** types)
|
||||
|
||||
static DWORD get_cximage_format(uint32_t type)
|
||||
{
|
||||
for (int i = 0; i < sizeof(image_types) / sizeof(image_types[0]); i++) {
|
||||
for (size_t i = 0; i < sizeof(image_types) / sizeof(image_types[0]); i++) {
|
||||
if (image_types[i].type == type) {
|
||||
return image_types[i].cximage_format;
|
||||
}
|
||||
@ -503,7 +503,7 @@ bool WinMonitor::best_display_setting(uint32_t width, uint32_t height, uint32_t
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mod_waste == ~0) {
|
||||
if (mod_waste == ~0u) {
|
||||
return false;
|
||||
}
|
||||
mode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL | DM_DISPLAYFREQUENCY;
|
||||
@ -882,7 +882,7 @@ void WinPlatform::enter_modal_loop()
|
||||
|
||||
static bool set_modal_loop_timer()
|
||||
{
|
||||
int timeout = main_loop->get_soonest_timeout();
|
||||
unsigned timeout = main_loop->get_soonest_timeout();
|
||||
if (timeout == INFINITE) {
|
||||
timeout = MODAL_LOOP_DEFAULT_TIMEOUT; /* for cases timeouts are added after
|
||||
the enterance to the loop*/
|
||||
|
||||
@ -146,7 +146,7 @@ typedef struct QuicData {
|
||||
jmp_buf jmp_env;
|
||||
char message_buf[512];
|
||||
SpiceChunks *chunks;
|
||||
int current_chunk;
|
||||
uint32_t current_chunk;
|
||||
} QuicData;
|
||||
|
||||
typedef struct CanvasBase {
|
||||
@ -809,8 +809,8 @@ static pixman_image_t *canvas_get_lz(CanvasBase *canvas, SpiceImage *image, int
|
||||
CANVAS_ERROR("unexpected LZ image type");
|
||||
}
|
||||
|
||||
ASSERT(width == image->descriptor.width);
|
||||
ASSERT(height == image->descriptor.height);
|
||||
ASSERT((unsigned)width == image->descriptor.width);
|
||||
ASSERT((unsigned)height == image->descriptor.height);
|
||||
|
||||
ASSERT((image->descriptor.type == SPICE_IMAGE_TYPE_LZ_PLT) || (n_comp_pixels == width * height));
|
||||
#ifdef WIN32
|
||||
@ -3309,7 +3309,7 @@ static void unimplemented_op(SpiceCanvas *canvas)
|
||||
inline static void canvas_base_init_ops(SpiceCanvasOps *ops)
|
||||
{
|
||||
void **ops_cast;
|
||||
int i;
|
||||
unsigned i;
|
||||
|
||||
ops_cast = (void **)ops;
|
||||
for (i = 0; i < sizeof(SpiceCanvasOps) / sizeof(void *); i++) {
|
||||
|
||||
@ -633,7 +633,7 @@ void lz_decode(LzContext *lz, LzImageType to_type, uint8_t *buf)
|
||||
Encoder *encoder = (Encoder *)lz;
|
||||
size_t out_size = 0;
|
||||
size_t alpha_size = 0;
|
||||
int size = 0;
|
||||
size_t size = 0;
|
||||
if (IS_IMAGE_TYPE_PLT[encoder->type]) {
|
||||
if (to_type == encoder->type) {
|
||||
size = encoder->height * encoder->stride;
|
||||
|
||||
@ -976,8 +976,8 @@ static void canvas_put_image(SpiceCanvas *spice_canvas,
|
||||
{
|
||||
SwCanvas *canvas = (SwCanvas *)spice_canvas;
|
||||
pixman_image_t *src;
|
||||
int dest_width;
|
||||
int dest_height;
|
||||
uint32_t dest_width;
|
||||
uint32_t dest_height;
|
||||
double sx, sy;
|
||||
pixman_transform_t transform;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user