GUACAMOLE-518: Correct signedness of keyboard flag variables.

This commit is contained in:
Michael Jumper 2020-06-22 10:03:07 -07:00
parent 96c4c208b4
commit 67450d89f3
3 changed files with 12 additions and 12 deletions

View File

@ -186,7 +186,7 @@ static void guac_rdp_send_unicode_event(guac_rdp_client* rdp_client,
* lock keys will be active. * lock keys will be active.
*/ */
static void guac_rdp_send_synchronize_event(guac_rdp_client* rdp_client, static void guac_rdp_send_synchronize_event(guac_rdp_client* rdp_client,
int flags) { UINT32 flags) {
/* Skip if not yet connected */ /* Skip if not yet connected */
freerdp* rdp_inst = rdp_client->rdp_inst; freerdp* rdp_inst = rdp_client->rdp_inst;
@ -432,13 +432,13 @@ static void guac_rdp_keyboard_send_missing_key(guac_rdp_keyboard* keyboard,
} }
void guac_rdp_keyboard_update_locks(guac_rdp_keyboard* keyboard, void guac_rdp_keyboard_update_locks(guac_rdp_keyboard* keyboard,
int set_flags, int clear_flags) { unsigned int set_flags, unsigned int clear_flags) {
guac_client* client = keyboard->client; guac_client* client = keyboard->client;
guac_rdp_client* rdp_client = (guac_rdp_client*) client->data; guac_rdp_client* rdp_client = (guac_rdp_client*) client->data;
/* Calculate updated lock flags */ /* Calculate updated lock flags */
int lock_flags = (keyboard->lock_flags | set_flags) & ~clear_flags; unsigned int lock_flags = (keyboard->lock_flags | set_flags) & ~clear_flags;
/* Synchronize remote side only if lock flags have changed */ /* Synchronize remote side only if lock flags have changed */
if (lock_flags != keyboard->lock_flags) { if (lock_flags != keyboard->lock_flags) {
@ -449,7 +449,7 @@ void guac_rdp_keyboard_update_locks(guac_rdp_keyboard* keyboard,
} }
void guac_rdp_keyboard_update_modifiers(guac_rdp_keyboard* keyboard, void guac_rdp_keyboard_update_modifiers(guac_rdp_keyboard* keyboard,
int set_flags, int clear_flags) { unsigned int set_flags, unsigned int clear_flags) {
/* Only clear modifiers that are set */ /* Only clear modifiers that are set */
clear_flags &= keyboard->modifier_flags; clear_flags &= keyboard->modifier_flags;

View File

@ -86,14 +86,14 @@ typedef struct guac_rdp_keyboard {
* @see GUAC_RDP_KEYMAP_MODIFIER_SHIFT * @see GUAC_RDP_KEYMAP_MODIFIER_SHIFT
* @see GUAC_RDP_KEYMAP_MODIFIER_ALTGR * @see GUAC_RDP_KEYMAP_MODIFIER_ALTGR
*/ */
int modifier_flags; unsigned int modifier_flags;
/** /**
* The local state of all known lock keys, as a bitwise OR of all RDP lock * The local state of all known lock keys, as a bitwise OR of all RDP lock
* key flags. Legal flags are KBD_SYNC_SCROLL_LOCK, KBD_SYNC_NUM_LOCK, * key flags. Legal flags are KBD_SYNC_SCROLL_LOCK, KBD_SYNC_NUM_LOCK,
* KBD_SYNC_CAPS_LOCK, and KBD_SYNC_KANA_LOCK. * KBD_SYNC_CAPS_LOCK, and KBD_SYNC_KANA_LOCK.
*/ */
int lock_flags; UINT32 lock_flags;
/** /**
* Whether the states of remote lock keys (Caps lock, Num lock, etc.) have * Whether the states of remote lock keys (Caps lock, Num lock, etc.) have
@ -184,7 +184,7 @@ int guac_rdp_keyboard_is_defined(guac_rdp_keyboard* keyboard, int keysym);
* KBD_SYNC_KANA_LOCK. * KBD_SYNC_KANA_LOCK.
*/ */
void guac_rdp_keyboard_update_locks(guac_rdp_keyboard* keyboard, void guac_rdp_keyboard_update_locks(guac_rdp_keyboard* keyboard,
int set_flags, int clear_flags); unsigned int set_flags, unsigned int clear_flags);
/** /**
* Updates the local state of the modifier keys (such as Shift or AltGr), * Updates the local state of the modifier keys (such as Shift or AltGr),
@ -204,7 +204,7 @@ void guac_rdp_keyboard_update_locks(guac_rdp_keyboard* keyboard,
* The modifier key flags which should be cleared. * The modifier key flags which should be cleared.
*/ */
void guac_rdp_keyboard_update_modifiers(guac_rdp_keyboard* keyboard, void guac_rdp_keyboard_update_modifiers(guac_rdp_keyboard* keyboard,
int set_flags, int clear_flags); unsigned int set_flags, unsigned int clear_flags);
/** /**
* Updates the local state of the given keysym, sending the key events required * Updates the local state of the given keysym, sending the key events required

View File

@ -64,7 +64,7 @@ typedef struct guac_rdp_keysym_desc {
* @see GUAC_RDP_KEYMAP_MODIFIER_SHIFT * @see GUAC_RDP_KEYMAP_MODIFIER_SHIFT
* @see GUAC_RDP_KEYMAP_MODIFIER_ALTGR * @see GUAC_RDP_KEYMAP_MODIFIER_ALTGR
*/ */
const int set_modifiers; const unsigned int set_modifiers;
/** /**
* Bitwise-OR of the flags of any modifiers that must NOT be active for the * Bitwise-OR of the flags of any modifiers that must NOT be active for the
@ -78,7 +78,7 @@ typedef struct guac_rdp_keysym_desc {
* @see GUAC_RDP_KEYMAP_MODIFIER_SHIFT * @see GUAC_RDP_KEYMAP_MODIFIER_SHIFT
* @see GUAC_RDP_KEYMAP_MODIFIER_ALTGR * @see GUAC_RDP_KEYMAP_MODIFIER_ALTGR
*/ */
const int clear_modifiers; const unsigned int clear_modifiers;
/** /**
* Bitwise OR of the flags of all lock keys (ie: Caps lock, Num lock, etc.) * Bitwise OR of the flags of all lock keys (ie: Caps lock, Num lock, etc.)
@ -86,7 +86,7 @@ typedef struct guac_rdp_keysym_desc {
* are KBD_SYNC_SCROLL_LOCK, KBD_SYNC_NUM_LOCK, KBD_SYNC_CAPS_LOCK, and * are KBD_SYNC_SCROLL_LOCK, KBD_SYNC_NUM_LOCK, KBD_SYNC_CAPS_LOCK, and
* KBD_SYNC_KANA_LOCK. * KBD_SYNC_KANA_LOCK.
*/ */
const int set_locks; const unsigned int set_locks;
/** /**
* Bitwise OR of the flags of all lock keys (ie: Caps lock, Num lock, etc.) * Bitwise OR of the flags of all lock keys (ie: Caps lock, Num lock, etc.)
@ -94,7 +94,7 @@ typedef struct guac_rdp_keysym_desc {
* are KBD_SYNC_SCROLL_LOCK, KBD_SYNC_NUM_LOCK, KBD_SYNC_CAPS_LOCK, and * are KBD_SYNC_SCROLL_LOCK, KBD_SYNC_NUM_LOCK, KBD_SYNC_CAPS_LOCK, and
* KBD_SYNC_KANA_LOCK. * KBD_SYNC_KANA_LOCK.
*/ */
const int clear_locks; const unsigned int clear_locks;
} guac_rdp_keysym_desc; } guac_rdp_keysym_desc;