aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-x11.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2010-04-20 00:18:51 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2010-04-20 00:18:51 +0000
commitea254104154f58affdedbb6b641235e8c66a3049 (patch)
tree3ffe6b27bbd8427cd6747a44bcf5e02c7d56ec47 /epan/dissectors/packet-x11.c
parentc10087d7f4a907364c1a41be9038e5ea10e8096c (diff)
From Peter Harris via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4481 :
The XKEYBOARD extension is a pain in the... so XCB had to grow new ways to describe the protocol. This patch adds support to the Wireshark dissector, so it can successfully process the XCB description of the XKEYBOARD extension. Without this patch, "make x11-dissector" chokes on the current xcbproto from git. Also update the script to deal with the new mesa directory structure. svn path=/trunk/; revision=32520
Diffstat (limited to 'epan/dissectors/packet-x11.c')
-rw-r--r--epan/dissectors/packet-x11.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/epan/dissectors/packet-x11.c b/epan/dissectors/packet-x11.c
index 33f70ab443..4cdd7825d9 100644
--- a/epan/dissectors/packet-x11.c
+++ b/epan/dissectors/packet-x11.c
@@ -3044,6 +3044,20 @@ static void set_handler(const char *name, void (*func)(tvbuff_t *tvb, packet_inf
g_hash_table_insert(reply_table, (gpointer)name, (gpointer)reply_info);
}
+static int popcount(unsigned int mask)
+{
+#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+ /* GCC 3.4 or newer */
+ return __builtin_popcount(mask);
+#else
+ /* HACKMEM 169 */
+ unsigned long y;
+
+ y = (mask >> 1) &033333333333;
+ y = mask - y - ((y >>1) & 033333333333);
+ return (((y + (y >> 3)) & 030707070707) % 077);
+#endif
+}
#include "x11-extension-errors.h"
#include "x11-extension-implementation.h"