aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-x11.c
diff options
context:
space:
mode:
authormorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>2010-04-20 00:18:51 +0000
committermorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>2010-04-20 00:18:51 +0000
commit19298bf1e9eb1317a35753eb7d8d824c92b58aa6 (patch)
tree3ffe6b27bbd8427cd6747a44bcf5e02c7d56ec47 /epan/dissectors/packet-x11.c
parent7c5dec4146f1e9dbd1987206447e9b755e4378b0 (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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32520 f5534014-38df-0310-8fa8-9805f1628bb7
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"