summaryrefslogtreecommitdiff
path: root/xkb
AgeCommit message (Collapse)AuthorFilesLines
2013-07-02xkb: don't call atoi(NULL) when parsing argvJulien Cristau1-2/+4
If the -ardelay or -arinterval options have no argument, there's no point trying to read it. See http://www.forallsecure.com/bug-reports/feb3db57fc206d8df22ca53a6907f74973876272/ Reported-by: Alexandre Rebert <alexandre@cmu.edu> Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-05-10input: print warnings if drivers don't initialize properlyPeter Hutterer1-2/+3
If drivers supply incorrect values don't just quietly return False, spew to the log so we can detect what's going on. All these cases are driver bugs and should be fixed immediately. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dave Airlie <airlied@redhat.com>
2013-05-10dix: don't overwrite proximity/focus classesPeter Hutterer1-1/+2
InitPointerClassDeviceStruct/InitKeyboardDeviceStruct allocate a proximity/focus class, respectively. If a driver calls InitFocusClassDeviceStruct or InitProximityClassDeviceStruct beforehand, the previously allocated class is overwritten, leaking the memory. Neither takes a parameter other than the device, so we can simply skip initialising it if we already have one. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dave Airlie <airlied@redhat.com>
2013-05-07xkb: free XkbRulesUsed and XkbRulesDflt on extension cleanupPeter Hutterer1-0/+15
==2547== 1 bytes in 1 blocks are still reachable in loss record 1 of 111 ==2547== at 0x4C2A4CD: malloc (vg_replace_malloc.c:236) ==2547== by 0x64D1551: strdup (strdup.c:43) ==2547== by 0x4802FB: Xstrdup (utils.c:1113) ==2547== by 0x585B6C: XkbSetRulesUsed (xkbInit.c:219) ==2547== by 0x58700F: InitKeyboardDeviceStruct (xkbInit.c:595) ==2547== by 0x419FA3: vfbKeybdProc (InitInput.c:74) ==2547== by 0x425A3D: ActivateDevice (devices.c:540) ==2547== by 0x425F65: InitAndStartDevices (devices.c:713) ==2547== by 0x5ACA57: main (main.c:259) and a few more of the above. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2013-03-06xkb: Fixes to LatchMods/LatchGroupAndreas Wettstein1-69/+80
The main problem this patch addresses is that if a latch is put on multi-level key with a Latch/Lock/Set, it is possible that after all keys are released, still base modifiers are set, which typically will make the keyboard unusable. To see how it happens (without the patch), assume that key AltGr sets Mod5 when pressed by itself, and latches Mod3 when pressed together with Shift. Now press Shift, then AltGr and release both keys in reverse order. Mod3 is now latched, and the LatchMods filter remains active as the second filter. Now press AltGr; Mod5 base modifier gets set, and the SetMods filter will become active as the first filter. Release AltGr: First, the SetMods filter will set clearMods to Mod5, then the LatchMods filter will overwrite clearMods with Mod3. Result: the Mod5 base modifier will remain set. This example becomes practically relevant for the revised German standard layout (DIN 2137-1:2012-06). Other changes implement the latch behaviour more accurately according to the specification. For example, releasing a modifier latching key can at the same time clear a locked modifier, promote another modifier that is latched to locked, and latch a third modifier. Overall, what the code does should be straightforward to compare what the XKB protocol specification demands, see the table in section 6.3. Finally, releasing a key no longer cancels a latch that has not become pending yet. In my opinion, the specification is not clear; it speaks of "operating" a key, which the patch effectivly interprets as "press" rather than "press or release". From my experience, using the latter interpretation makes latches on higher levels practically unusable. In the example given above, one would have to release AltGr always before Shift to get the Mod3-Latch. The practical relevance of latches on higher levels is once more given by the revised German standard layout. Signed-off-by: Andreas Wettstein <wettstein509@solnet.ch> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-02-21xkb: Set nIndicators in XkbGetIndicatorMapPeter Harris1-0/+1
Xlib doesn't use this value (it computes it from the reply length instead) which is why nobody has noticed yet. But the spec http://www.x.org/releases/X11R7.7/doc/kbproto/xkbproto.html says that it should be set. Signed-off-by: Peter Harris <pharris@opentext.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-02-15xkb: remove unused variable 'names'Peter Hutterer1-2/+0
xkb.c: In function '_XkbSetNamesCheck': xkb.c:3987:18: warning: variable 'names' set but not used [-Wunused-but-set-variable] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2013-02-08xkb: Fix repeat behaviour of redirect and message actionsAndreas Wettstein1-57/+90
The redirect and the message action filter functions implicitly assumed that when they receive an event for the same keycode they were activated for, that this is the a release of the key that activated the filter. This is not true if the key autorepeats. Due to the incorrect assumption, the effective key repeat rate was effectively halved. Signed-off-by: Andreas Wettstein <wettstein509@solnet.ch> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-01-09xkb: Do not use base group as an array index.Andreas Wettstein1-2/+8
The base group is not brought into range and, therefore, using it as an array index crashed the X server. Also, at this place, we should ignore locked groups, but not latched groups. Therefore, use sum of base and latched groups, brought into range. Reproducible with: key <FK07> { type= "ONE_LEVEL", symbols[Group1]= [ NoSymbol ], actions[Group1]= [ LatchGroup(group=-1, clearLocks) ] }; And hitting F7 will exceed the group level and access arbitrary memory. Signed-off-by: Andreas Wettstein <wettstein509@solnet.ch> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-12-19Merge remote-tracking branch 'yselkowitz/master'Keith Packard2-19/+19
I checked this patch with diff -w to check that it only affected whitespace.
2012-12-05Fix formatting of address operatorsYaakov Selkowitz2-19/+19
The formatter confused address operators preceded by casts with bitwise-and expressions, placing spaces on either side of both. That syntax isn't used by ordinary address operators, however, so fix them for consistency. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-12-05xkb: only post a XTest release if the XTest device has the button downPeter Hutterer1-2/+7
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-12-05xkb: always post XTest button up when the physical button released (#28808)Peter Hutterer1-15/+14
Regression introduced by commit 2decff6393a44b56d80d53570718f95354fde454 xkb: ProcesssPointerEvent must work on the VCP if it gets the VCP XTest buttons must be released when a physical button is released. This was fixed in 14327858391ebe929b806efb53ad79e789361883, but 2decff6393a44b56d80d53570718f95354fde454 changed a condition that this code didn't get triggered anymore. "dev" for pointer events is now always the VCP which doesn't have a xkbi struct. So move this condition out and always trigger the XTest released for button events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Frank Roscher <Frank-Roscher@gmx.net>
2012-11-29xkb: fill in keycode and event type for slow keys enablementPeter Hutterer1-2/+4
eventType is set for the type that triggered a XkbControlsNotify event. Technically, SlowKeys is triggered by a timer which doesn't have a matching core event type. So we used to use 0 here. Practically, the timer is triggered by a key press + hold and cancelled when the key is released before the timeout expires. So we might as well set KeyPress (keycode) in the ControlsNotify to give clients a chance to differ between timer-triggered SlowKeys and client-triggered ones. This is a chance in behaviour, though I suspect with little impact. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Daniel Stone <daniel@fooishbar.org>
2012-11-19XKB: Remove component listing supportDaniel Stone3-335/+20
No-one uses this - not xkbcomp, not GNOME, not KDE. The preferred way to deal with component listing (which gives you RMLVO rather than KcCGST) is to use the XML files on the client side. Indeed, a couple of hours after making this commit, it emerged that all *.dir files built with xkbcomp 1.1.1 (released two years ago) and later have been catastrophically broken and nearly empty. So I think that's reasonable proof that no-one uses them. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-11-05Merge remote-tracking branch 'whot/for-keith'Keith Packard1-0/+1
2012-11-06Apply partial matches for option (#25873)Alexey Ten (Lynn)1-0/+1
Rules which match star (*) and option, like one below, should be applied layout[2] option = symbols * misc:typo = +typo(base) This is port of patch from #19563 (https://bugs.freedesktop.org/19563) because here we have own copy of maprules.c X.Org Bug 25873 <http://bugs.freedesktop.org/show_bug.cgi?id=25873> Signed-off-by: Alexey Ten (Lynn) <alexeyten@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-11-05xkb: fix shadow warningsYaakov Selkowitz5-21/+15
Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-10-29xkb: ProcesssPointerEvent must work on the VCP if it gets the VCPPeter Hutterer1-1/+1
For button release events, the current code picks the VCK. Because that has a XKB struct, it thinks this is a PointerKeys event and proceeds to send the release event through the XTest pointer. That has no effect in normal operation as the button is never down and an attempt is silently discarded (normal event processing continues with the VCP). On server shutdown, the XTest device is already removed, leading to a null-pointer derefernce when the device is checked for whether buttons are down (XkbFakeDeviceButton → button_is_down(xtest pointer)). The current state has only worked by accident, the right approach here is to handle the VCP's event as such and not switch to the keyboard. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2012-07-17xwin: Clean up os wrappers for System, Popen and Pclose on WindowsKeith Packard2-81/+0
Popen and Pclose are never used on Windows, so don't bother to even try to define them. System(s) was defined as system(s), but the two users of that function are in xkb, which carefully redefines that as Win32System. Move Win32System and Win32TempDir to os/utils.c, renaming Win32System to be just System, which simplifies the xkb code Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-07-10XKB: Geom: Remove unused codeDaniel Stone2-146/+0
These codepaths were never called by anyone. Shame there weren't more of them. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-09Move extension initialisation prototypes into extinit.hDaniel Stone2-2/+1
Create extinit.h (and xf86Extensions.h, for Xorg-specific extensions) to hold all our extension initialisation prototypes, rather than duplicating them everywhere. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-09Use C99 designated initializers in extension EventsAlan Coopersmith1-16/+23
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09Use C99 designated initializers in xkb RepliesAlan Coopersmith1-160/+164
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09Remove unneccesary casts from WriteToClient callsAlan Coopersmith2-30/+30
Casting return to (void) was used to tell lint that you intended to ignore the return value, so it didn't warn you about it. Casting the third argument to (char *) was used as the most generic pointer type in the days before compilers supported C89 (void *) (except for a couple places it's used for byte-sized pointer math). Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-04xkb: use local variable instead of casting argPeter Hutterer1-5/+5
No functional changes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-06-07xkb: warn if XKB SlowKeys have been automatically enabledPeter Hutterer1-2/+7
Slow keys are enabled when the XKB AccessX features are generally enabled (ctrls->enabled_ctrls & XkbAccessXKeysMask) and either shift key is held for 8 seconds. For the unsuspecting user this appears as if the keyboard suddenly stops working. Print a warning to the log, so we can later tell them "told you so". Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2012-06-04xkb: Allocate size_syms correctly when width of a type increasesSiddhesh Poyarekar1-2/+4
The current code seems to skip syms with width less than type->num_levels when calculating the total size for the new size_syms. This leads to less space being allocated than necessary during the next phase, which is to copy over the syms to the new location. This results in an overflow leading to a crash. Signed-off-by: Siddhesh Poyarekar <siddhesh.poyarekar@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-05-14xkb: Remove redundant declarations.Michal Suchanek2-2/+0
Signed-off-by: Michal Suchanek <hramrach@gmail.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-22XKB: Redirect actions defunct with Gtk3 (XInput?)Andreas Wettstein1-4/+22
When redirect actions are used with Gtk3, Gtk3 complained about events not holding a GdkDevice. This was caused by device IDs not being set for redirect actions. More seriously, Gtk3 did not receive state changes redirect actions might specify. This was because event_set_state in dix/inpututils.c accesses the prev_state field, but the changes for the redirect action were only put into the state field. Signed-off-by: Andreas Wettstein <wettstein509@solnet.ch> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-03-21Indentation: Change '& stuff' to '&stuff'Daniel Stone1-2/+2
If the typedef wasn't perfect, indent would get confused and change: foo = (SomePointlessTypedef *) &stuff[1]; to: foo = (SomePointlessTypedef *) & stuff[1]; Fix this up with a really naïve sed script, plus some hand-editing to change some false positives in XKB back. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-03-21Introduce a consistent coding styleKeith Packard28-15401/+15882
This is strictly the application of the script 'x-indent-all.sh' from util/modular. Compared to the patch that Daniel posted in January, I've added a few indent flags: -bap -psl -T PrivatePtr -T pmWait -T _XFUNCPROTOBEGIN -T _XFUNCPROTOEND -T _X_EXPORT The typedefs were needed to make the output of sdksyms.sh match the previous output, otherwise, the code is formatted badly enough that sdksyms.sh generates incorrect output. The generated code was compared with the previous version and found to be essentially identical -- "assert" line numbers and BUILD_TIME were the only differences found. The comparison was done with this script: dir1=$1 dir2=$2 for dir in $dir1 $dir2; do (cd $dir && find . -name '*.o' | while read file; do dir=`dirname $file` base=`basename $file .o` dump=$dir/$base.dump objdump -d $file > $dump done) done find $dir1 -name '*.dump' | while read dump; do otherdump=`echo $dump | sed "s;$dir1;$dir2;"` diff -u $dump $otherdump done Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Daniel Stone <daniel@fooishbar.org> Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-01-09xkb: Message actions suppress other key presses #28575Andreas Wettstein1-1/+1
When a key to which a message action is mapped is held down, presses of other keys were not registered. Signed-off-by: Andreas Wettstein <wettstein509@solnet.ch> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12_XkbFilterDeviceBtn: move variable declarations to match usage scopeAlan Coopersmith1-4/+5
The main body of this function is an if { } else if { } pair of blocks. Previously there was int button at the top level scope which is used only in the first block, and a redeclaration of int button inside the second block. Since there's no overlap in the code paths for the two uses of button, move the one from the outer block into the first block to help the programmer more quickly determine they are unrelated usages, and to silence the gcc warning of: xkbActions.c: In function '_XkbFilterDeviceBtn': xkbActions.c:999:6: warning: declaration of 'button' shadows a previous local xkbActions.c:955:6: warning: shadowed declaration is here For consistency, move DeviceIntPtr dev declarations as well that are used in the same way. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12XkbFindSrvLedInfo: remove extraneous name-clashing sli variableAlan Coopersmith1-4/+2
Variable is already defined outside the outer if statement, and there's no need to redefine inside the if statement. No point in setting sli before if (dev->kbdfeed->xkb_sli==NULL) check - if check is true, we immediately set it, if check is false, we immediately return without further reference or use of it. The one thing we do with it inside the inner if statement is store an allocation in it for a brief moment before writing to the final destination, which is immediately returned to the caller. In short, there's no benefit to the variable at all in this block, it just gives the optimizer more code to figure out how to omit. Fixes gcc warning: xkbLEDs.c: In function 'XkbFindSrvLedInfo': xkbLEDs.c:683:19: warning: declaration of 'sli' shadows a previous local xkbLEDs.c:679:18: warning: shadowed declaration is here Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-11-23Fix gcc -Wwrite-strings warnings in XkbGetRulesDfltsAlan Coopersmith1-16/+5
Stop temporarily storing a pointer to a constant literal string in a char *, just to strdup it a few lines later. Fixes gcc -Wwrite-strings warnings: xkbInit.c: In function 'XkbGetRulesDflts': xkbInit.c:121:38: warning: assignment discards qualifiers from pointer target type xkbInit.c:123:23: warning: assignment discards qualifiers from pointer target type xkbInit.c:125:24: warning: assignment discards qualifiers from pointer target type xkbInit.c:127:25: warning: assignment discards qualifiers from pointer target type xkbInit.c:129:25: warning: assignment discards qualifiers from pointer target type Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23Mark XKB char * as const to clean up gcc -Wwrite-strings warningsAlan Coopersmith6-18/+18
Cleans up around 120 warnings from this set Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23Reduce unnecessary string copying in xkbtext routinesAlan Coopersmith1-10/+8
Instead of using sprintf to copy a static string to a local buffer, just to pass it to TryCopyStr, pass the static string to TryCopyStr directly, as is already done in other parts of this code. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23Convert a bunch of sprintf to snprintf callsAlan Coopersmith1-71/+71
This batch is the straightforward set - others are more complex and need more analysis to determine right size to pass. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23Remove unnecessary variable rtrn in XkbKeysymTextAlan Coopersmith1-4/+4
Also removes even more unnecessary use of variable assignment inside function arguments. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-11-23Convert strncpy/strncat to strlcpy/strlcatAlan Coopersmith3-8/+4
As long as we're carrying around a compatibility copy in os/strl*.c, might as well use them. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-09input: replace remaining GetPairedDevice() with GetMaster()Peter Hutterer1-1/+1
Wherever it's obvious which device we need (keyboard or pointer), use GetMaster() instead of GetPairedDevice(). It is more reliable in actually getting the device type we want. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-11-02Xming: Always remove temporary file used when invoking xkbcomp on Win32Colin Harrison2-2/+9
When built for native Win32, pipe() & fork() aren't available, so we use a tempoary file and system() to invoke xkbcomp Ensure the temporary file is always removed. It was only being removed on most errors, not on success :S Also fix a couple of warnings which occur when built with WIN32 defined Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-10-25xkb: Support noLock and noUnlock flags for LockModsAndreas Wettstein1-2/+5
These flags are required by the XKB spec section 6.3. Signed-off-by: Andreas Wettstein <wettstein509@solnet.ch> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-03Add #include "inpututils.h" to xkbAccessX.c for init_device_eventAlan Coopersmith1-0/+1
Fixes Sun compiler warning: "xkbAccessX.c", line 128: warning: implicit function declaration: init_device_event Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-09-26Merge remote-tracking branch 'whot/next'Keith Packard1-6/+2
2011-09-21xkb: add missing swaps for xkbGetDeviceInfoReplyPeter Harris1-0/+3
Caught during review of e095369bf. Signed-off-by: Peter Harris <pharris@opentext.com> Reviewed-by-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-09-21Cast char* buffers to swap functionsMatt Turner1-6/+6
Reviewed-by: Peter Harris <pharris@opentext.com> Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-09-21Use correct swap{l,s} (or none at all for CARD8)Matt Turner1-1/+0
Swapping the wrong size was never caught because swap{l,s} are macros. It's clear in the case of Xext/xres.c, that the author believed client_major/minor to be CARD16 from looking at the code in the first hunk. v2: dmx.c fixes from Keith. Reviewed-by: Peter Harris <pharris@opentext.com> Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-09-21Use internal temp variable for swap macrosMatt Turner4-488/+371
Also, fix whitespace, mainly around swaps(&rep.sequenceNumber) Reviewed-by: Peter Harris <pharris@opentext.com> Signed-off-by: Matt Turner <mattst88@gmail.com>