Got rid of var-arg macros

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@83 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Peter Åstrand 2002-07-30 07:30:12 +00:00
parent 52da555640
commit 6d144afb8c
3 changed files with 22 additions and 21 deletions

View File

@ -32,9 +32,9 @@
#endif #endif
#if defined(WITH_DEBUG_KBD) #if defined(WITH_DEBUG_KBD)
#define DEBUG_KBD(...) fprintf(stderr, __VA_ARGS__); #define DEBUG_KBD(args) printf args;
#else #else
#define DEBUG_KBD(...) #define DEBUG_KBD(args)
#endif #endif
#define STRNCPY(dst,src,n) { strncpy(dst,src,n-1); dst[n-1] = 0; } #define STRNCPY(dst,src,n) { strncpy(dst,src,n-1); dst[n-1] = 0; }

View File

@ -53,8 +53,8 @@ add_to_keymap(char *keyname, uint8 scancode, uint16 modifiers, char *mapname)
return; return;
} }
DEBUG_KBD("Adding translation, keysym=0x%x, scancode=0x%x, " DEBUG_KBD(("Adding translation, keysym=0x%x, scancode=0x%x, "
"modifiers=0x%x\n", (unsigned int) keysym, scancode, modifiers); "modifiers=0x%x\n", (unsigned int) keysym, scancode, modifiers));
keymap[keysym & KEYMAP_MASK].scancode = scancode; keymap[keysym & KEYMAP_MASK].scancode = scancode;
keymap[keysym & KEYMAP_MASK].modifiers = modifiers; keymap[keysym & KEYMAP_MASK].modifiers = modifiers;
@ -116,14 +116,14 @@ xkeymap_read(char *mapname)
if (strncmp(line, "map ", 4) == 0) if (strncmp(line, "map ", 4) == 0)
{ {
keylayout = strtol(line + 4, NULL, 16); keylayout = strtol(line + 4, NULL, 16);
DEBUG_KBD("Keylayout 0x%x\n", keylayout); DEBUG_KBD(("Keylayout 0x%x\n", keylayout));
continue; continue;
} }
/* compose */ /* compose */
if (strncmp(line, "enable_compose", 15) == 0) if (strncmp(line, "enable_compose", 15) == 0)
{ {
DEBUG_KBD("Enabling compose handling\n"); DEBUG_KBD(("Enabling compose handling\n"));
enable_compose = True; enable_compose = True;
continue; continue;
} }
@ -242,8 +242,8 @@ xkeymap_translate_key(KeySym keysym, unsigned int keycode, unsigned int state)
if (tr.scancode != 0) if (tr.scancode != 0)
{ {
DEBUG_KBD DEBUG_KBD
("Found key translation, scancode=0x%x, modifiers=0x%x\n", (("Found key translation, scancode=0x%x, modifiers=0x%x\n",
tr.scancode, tr.modifiers); tr.scancode, tr.modifiers));
return tr; return tr;
} }
@ -372,7 +372,7 @@ ensure_remote_modifiers(uint32 ev_time, key_translation tr)
!= MASK_HAS_BITS(remote_modifier_state, MapNumLockMask)) != MASK_HAS_BITS(remote_modifier_state, MapNumLockMask))
{ {
/* The remote modifier state is not correct */ /* The remote modifier state is not correct */
DEBUG_KBD("Remote NumLock state is incorrect. Toggling\n"); DEBUG_KBD(("Remote NumLock state is incorrect. Toggling\n"));
if (MASK_HAS_BITS(tr.modifiers, MapNumLockMask)) if (MASK_HAS_BITS(tr.modifiers, MapNumLockMask))
{ {
/* Needs this modifier. Toggle */ /* Needs this modifier. Toggle */
@ -394,8 +394,8 @@ static void
update_modifier_state(uint16 modifiers, BOOL pressed) update_modifier_state(uint16 modifiers, BOOL pressed)
{ {
DEBUG_KBD("Before updating modifier_state:0x%x, pressed=0x%x\n", DEBUG_KBD(("Before updating modifier_state:0x%x, pressed=0x%x\n",
remote_modifier_state, pressed); remote_modifier_state, pressed));
switch (modifiers) switch (modifiers)
{ {
case SCANCODE_CHAR_LSHIFT: case SCANCODE_CHAR_LSHIFT:
@ -436,7 +436,7 @@ update_modifier_state(uint16 modifiers, BOOL pressed)
} }
break; break;
} }
DEBUG_KBD("After updating modifier_state:0x%x\n", remote_modifier_state); DEBUG_KBD(("After updating modifier_state:0x%x\n", remote_modifier_state));
} }
@ -448,14 +448,14 @@ rdp_send_scancode(uint32 time, uint16 flags, uint16 scancode)
if (scancode & SCANCODE_EXTENDED) if (scancode & SCANCODE_EXTENDED)
{ {
DEBUG_KBD("Sending extended scancode=0x%x, flags=0x%x\n", DEBUG_KBD(("Sending extended scancode=0x%x, flags=0x%x\n",
scancode & ~SCANCODE_EXTENDED, flags); scancode & ~SCANCODE_EXTENDED, flags));
rdp_send_input(time, RDP_INPUT_SCANCODE, flags | KBD_FLAG_EXT, rdp_send_input(time, RDP_INPUT_SCANCODE, flags | KBD_FLAG_EXT,
scancode & ~SCANCODE_EXTENDED, 0); scancode & ~SCANCODE_EXTENDED, 0);
} }
else else
{ {
DEBUG_KBD("Sending scancode=0x%x, flags=0x%x\n", scancode, flags); DEBUG_KBD(("Sending scancode=0x%x, flags=0x%x\n", scancode, flags);
rdp_send_input(time, RDP_INPUT_SCANCODE, flags, scancode, 0); rdp_send_input(time, RDP_INPUT_SCANCODE, flags, scancode, 0));
} }
} }

11
xwin.c
View File

@ -419,7 +419,7 @@ xwin_process_events()
{ {
if (enable_compose && (XFilterEvent(&xevent, None) == True)) if (enable_compose && (XFilterEvent(&xevent, None) == True))
{ {
DEBUG_KBD("Filtering event\n"); DEBUG_KBD(("Filtering event\n"));
continue; continue;
} }
@ -445,17 +445,17 @@ xwin_process_events()
else else
{ {
/* Plain old XLookupString */ /* Plain old XLookupString */
DEBUG_KBD("No input context, using XLookupString\n"); DEBUG_KBD(("No input context, using XLookupString\n"));
XLookupString((XKeyEvent *) & xevent, XLookupString((XKeyEvent *) & xevent,
str, sizeof(str), &keysym, NULL); str, sizeof(str), &keysym, NULL);
} }
ksname = get_ksname(keysym); ksname = get_ksname(keysym);
DEBUG_KBD("\nKeyPress for (keysym 0x%lx, %s)\n", keysym, ksname); DEBUG_KBD(("\nKeyPress for (keysym 0x%lx, %s)\n", keysym, ksname));
if (inhibit_key(keysym)) if (inhibit_key(keysym))
{ {
DEBUG_KBD("Inhibiting key\n"); DEBUG_KBD(("Inhibiting key\n"));
break; break;
} }
@ -474,7 +474,8 @@ xwin_process_events()
sizeof(str), &keysym, NULL); sizeof(str), &keysym, NULL);
ksname = get_ksname(keysym); ksname = get_ksname(keysym);
DEBUG_KBD("\nKeyRelease for (keysym 0x%lx, %s)\n", keysym, ksname); DEBUG_KBD(("\nKeyRelease for (keysym 0x%lx, %s)\n", keysym,
ksname));
if (inhibit_key(keysym)) if (inhibit_key(keysym))
break; break;