$NetBSD: patch-bb,v 1.1 2010/09/26 23:15:18 tron Exp $

Avoid conflict with NetBSD's popcount(3).

--- epan/dissectors/x11-extension-implementation.h.orig	2011-07-18 21:17:51.000000000 +0100
+++ epan/dissectors/x11-extension-implementation.h	2011-07-20 19:08:11.000000000 +0100
@@ -20760,8 +20760,8 @@
     int f_namesPresent;
     f_namesPresent = VALUE32(tvb, *offsetp + size + 4);
     f_mapsPresent = VALUE32(tvb, *offsetp + size + 8);
-    size += popcount(f_namesPresent) * 4;
-    size += popcount(f_mapsPresent) * 12;
+    size += my_popcount(f_namesPresent) * 4;
+    size += my_popcount(f_mapsPresent) * 12;
     return size + 20;
 }
 
@@ -20794,8 +20794,8 @@
 	f_state = VALUE32(tvb, *offsetp);
 	proto_tree_add_item(t, hf_x11_struct_DeviceLedInfo_state, tvb, *offsetp, 4, little_endian);
 	*offsetp += 4;
-	listOfCard32(tvb, offsetp, t, hf_x11_struct_DeviceLedInfo_names, hf_x11_struct_DeviceLedInfo_names_item, popcount(f_namesPresent), little_endian);
-	struct_IndicatorMap(tvb, offsetp, t, little_endian, popcount(f_mapsPresent));
+	listOfCard32(tvb, offsetp, t, hf_x11_struct_DeviceLedInfo_names, hf_x11_struct_DeviceLedInfo_names_item, my_popcount(f_namesPresent), little_endian);
+	struct_IndicatorMap(tvb, offsetp, t, little_endian, my_popcount(f_mapsPresent));
     }
 }
 
@@ -23093,7 +23093,7 @@
     *offsetp += 2;
     UNUSED(16);
     listOfByte(tvb, offsetp, t, hf_x11_xkb_GetCompatMap_reply_si_rtrn, (16 * f_nSIRtrn), little_endian);
-    struct_ModDef(tvb, offsetp, t, little_endian, popcount(f_groupsRtrn));
+    struct_ModDef(tvb, offsetp, t, little_endian, my_popcount(f_groupsRtrn));
 }
 
 static void xkbSetCompatMap(tvbuff_t *tvb, packet_info *pinfo _U_, int *offsetp, proto_tree *t, int little_endian, int length _U_)
@@ -23133,8 +23133,8 @@
     UNUSED(2);
     listOfByte(tvb, offsetp, t, hf_x11_xkb_SetCompatMap_si, (16 * f_nSI), little_endian);
     length -= (16 * f_nSI) * 1;
-    struct_ModDef(tvb, offsetp, t, little_endian, popcount(f_groups));
-    length -= popcount(f_groups) * 4;
+    struct_ModDef(tvb, offsetp, t, little_endian, my_popcount(f_groups));
+    length -= my_popcount(f_groups) * 4;
 }
 
 static void xkbGetIndicatorState(tvbuff_t *tvb, packet_info *pinfo _U_, int *offsetp, proto_tree *t, int little_endian, int length _U_)
@@ -23229,8 +23229,8 @@
     f_which = VALUE32(tvb, *offsetp);
     proto_tree_add_item(t, hf_x11_xkb_SetIndicatorMap_which, tvb, *offsetp, 4, little_endian);
     *offsetp += 4;
-    struct_IndicatorMap(tvb, offsetp, t, little_endian, popcount(f_which));
-    length -= popcount(f_which) * 12;
+    struct_IndicatorMap(tvb, offsetp, t, little_endian, my_popcount(f_which));
+    length -= my_popcount(f_which) * 12;
 }
 
 static void xkbGetNamedIndicator(tvbuff_t *tvb, packet_info *pinfo _U_, int *offsetp, proto_tree *t, int little_endian, int length _U_)
@@ -23727,13 +23727,13 @@
         listOfCard32(tvb, offsetp, t, hf_x11_xkb_GetNames_reply_KTLevelNames_ktLevelNames, hf_x11_xkb_GetNames_reply_KTLevelNames_ktLevelNames_item, (length - 56) / 4, little_endian);
     }
     if ((f_which & (1 << 8)) != 0) {
-        listOfCard32(tvb, offsetp, t, hf_x11_xkb_GetNames_reply_IndicatorNames_indicatorNames, hf_x11_xkb_GetNames_reply_IndicatorNames_indicatorNames_item, popcount(f_indicators), little_endian);
+        listOfCard32(tvb, offsetp, t, hf_x11_xkb_GetNames_reply_IndicatorNames_indicatorNames, hf_x11_xkb_GetNames_reply_IndicatorNames_indicatorNames_item, my_popcount(f_indicators), little_endian);
     }
     if ((f_which & (1 << 11)) != 0) {
-        listOfCard32(tvb, offsetp, t, hf_x11_xkb_GetNames_reply_VirtualModNames_virtualModNames, hf_x11_xkb_GetNames_reply_VirtualModNames_virtualModNames_item, popcount(f_virtualMods), little_endian);
+        listOfCard32(tvb, offsetp, t, hf_x11_xkb_GetNames_reply_VirtualModNames_virtualModNames, hf_x11_xkb_GetNames_reply_VirtualModNames_virtualModNames_item, my_popcount(f_virtualMods), little_endian);
     }
     if ((f_which & (1 << 12)) != 0) {
-        listOfCard32(tvb, offsetp, t, hf_x11_xkb_GetNames_reply_GroupNames_groups, hf_x11_xkb_GetNames_reply_GroupNames_groups_item, popcount(f_groupNames), little_endian);
+        listOfCard32(tvb, offsetp, t, hf_x11_xkb_GetNames_reply_GroupNames_groups, hf_x11_xkb_GetNames_reply_GroupNames_groups_item, my_popcount(f_groupNames), little_endian);
     }
     if ((f_which & (1 << 9)) != 0) {
         struct_KeyName(tvb, offsetp, t, little_endian, f_nKeys);
@@ -23895,16 +23895,16 @@
         length -= (length - 52) / 4 * 4;
     }
     if ((f_which & (1 << 8)) != 0) {
-        listOfCard32(tvb, offsetp, t, hf_x11_xkb_SetNames_IndicatorNames_indicatorNames, hf_x11_xkb_SetNames_IndicatorNames_indicatorNames_item, popcount(f_indicators), little_endian);
-        length -= popcount(f_indicators) * 4;
+        listOfCard32(tvb, offsetp, t, hf_x11_xkb_SetNames_IndicatorNames_indicatorNames, hf_x11_xkb_SetNames_IndicatorNames_indicatorNames_item, my_popcount(f_indicators), little_endian);
+        length -= my_popcount(f_indicators) * 4;
     }
     if ((f_which & (1 << 11)) != 0) {
-        listOfCard32(tvb, offsetp, t, hf_x11_xkb_SetNames_VirtualModNames_virtualModNames, hf_x11_xkb_SetNames_VirtualModNames_virtualModNames_item, popcount(f_virtualMods), little_endian);
-        length -= popcount(f_virtualMods) * 4;
+        listOfCard32(tvb, offsetp, t, hf_x11_xkb_SetNames_VirtualModNames_virtualModNames, hf_x11_xkb_SetNames_VirtualModNames_virtualModNames_item, my_popcount(f_virtualMods), little_endian);
+        length -= my_popcount(f_virtualMods) * 4;
     }
     if ((f_which & (1 << 12)) != 0) {
-        listOfCard32(tvb, offsetp, t, hf_x11_xkb_SetNames_GroupNames_groups, hf_x11_xkb_SetNames_GroupNames_groups_item, popcount(f_groupNames), little_endian);
-        length -= popcount(f_groupNames) * 4;
+        listOfCard32(tvb, offsetp, t, hf_x11_xkb_SetNames_GroupNames_groups, hf_x11_xkb_SetNames_GroupNames_groups_item, my_popcount(f_groupNames), little_endian);
+        length -= my_popcount(f_groupNames) * 4;
     }
     if ((f_which & (1 << 9)) != 0) {
         struct_KeyName(tvb, offsetp, t, little_endian, f_nKeys);
@@ -24693,7 +24693,7 @@
         *offsetp += 2;
         UNUSED(16);
         listOfByte(tvb, offsetp, t, hf_x11_xkb_GetKbdByName_reply_CompatMap_si_rtrn, (16 * f_nSIRtrn), little_endian);
-        struct_ModDef(tvb, offsetp, t, little_endian, popcount(f_groupsRtrn));
+        struct_ModDef(tvb, offsetp, t, little_endian, my_popcount(f_groupsRtrn));
     }
     if ((f_reported & (1 << 2)) != 0) {
         int f_clientDeviceID;
@@ -25156,13 +25156,13 @@
             listOfCard32(tvb, offsetp, t, hf_x11_xkb_GetKbdByName_reply_KeyNames_KTLevelNames_ktLevelNames, hf_x11_xkb_GetKbdByName_reply_KeyNames_KTLevelNames_ktLevelNames_item, (length - 237) / 4, little_endian);
         }
         if ((f_which & (1 << 8)) != 0) {
-            listOfCard32(tvb, offsetp, t, hf_x11_xkb_GetKbdByName_reply_KeyNames_IndicatorNames_indicatorNames, hf_x11_xkb_GetKbdByName_reply_KeyNames_IndicatorNames_indicatorNames_item, popcount(f_indicators), little_endian);
+            listOfCard32(tvb, offsetp, t, hf_x11_xkb_GetKbdByName_reply_KeyNames_IndicatorNames_indicatorNames, hf_x11_xkb_GetKbdByName_reply_KeyNames_IndicatorNames_indicatorNames_item, my_popcount(f_indicators), little_endian);
         }
         if ((f_which & (1 << 11)) != 0) {
-            listOfCard32(tvb, offsetp, t, hf_x11_xkb_GetKbdByName_reply_KeyNames_VirtualModNames_virtualModNames, hf_x11_xkb_GetKbdByName_reply_KeyNames_VirtualModNames_virtualModNames_item, popcount(f_virtualMods), little_endian);
+            listOfCard32(tvb, offsetp, t, hf_x11_xkb_GetKbdByName_reply_KeyNames_VirtualModNames_virtualModNames, hf_x11_xkb_GetKbdByName_reply_KeyNames_VirtualModNames_virtualModNames_item, my_popcount(f_virtualMods), little_endian);
         }
         if ((f_which & (1 << 12)) != 0) {
-            listOfCard32(tvb, offsetp, t, hf_x11_xkb_GetKbdByName_reply_KeyNames_GroupNames_groups, hf_x11_xkb_GetKbdByName_reply_KeyNames_GroupNames_groups_item, popcount(f_groupNames), little_endian);
+            listOfCard32(tvb, offsetp, t, hf_x11_xkb_GetKbdByName_reply_KeyNames_GroupNames_groups, hf_x11_xkb_GetKbdByName_reply_KeyNames_GroupNames_groups_item, my_popcount(f_groupNames), little_endian);
         }
         if ((f_which & (1 << 9)) != 0) {
             struct_KeyName(tvb, offsetp, t, little_endian, f_nKeys);
@@ -25315,13 +25315,13 @@
             listOfCard32(tvb, offsetp, t, hf_x11_xkb_GetKbdByName_reply_OtherNames_KTLevelNames_ktLevelNames, hf_x11_xkb_GetKbdByName_reply_OtherNames_KTLevelNames_ktLevelNames_item, (length - 286) / 4, little_endian);
         }
         if ((f_which & (1 << 8)) != 0) {
-            listOfCard32(tvb, offsetp, t, hf_x11_xkb_GetKbdByName_reply_OtherNames_IndicatorNames_indicatorNames, hf_x11_xkb_GetKbdByName_reply_OtherNames_IndicatorNames_indicatorNames_item, popcount(f_indicators), little_endian);
+            listOfCard32(tvb, offsetp, t, hf_x11_xkb_GetKbdByName_reply_OtherNames_IndicatorNames_indicatorNames, hf_x11_xkb_GetKbdByName_reply_OtherNames_IndicatorNames_indicatorNames_item, my_popcount(f_indicators), little_endian);
         }
         if ((f_which & (1 << 11)) != 0) {
-            listOfCard32(tvb, offsetp, t, hf_x11_xkb_GetKbdByName_reply_OtherNames_VirtualModNames_virtualModNames, hf_x11_xkb_GetKbdByName_reply_OtherNames_VirtualModNames_virtualModNames_item, popcount(f_virtualMods), little_endian);
+            listOfCard32(tvb, offsetp, t, hf_x11_xkb_GetKbdByName_reply_OtherNames_VirtualModNames_virtualModNames, hf_x11_xkb_GetKbdByName_reply_OtherNames_VirtualModNames_virtualModNames_item, my_popcount(f_virtualMods), little_endian);
         }
         if ((f_which & (1 << 12)) != 0) {
-            listOfCard32(tvb, offsetp, t, hf_x11_xkb_GetKbdByName_reply_OtherNames_GroupNames_groups, hf_x11_xkb_GetKbdByName_reply_OtherNames_GroupNames_groups_item, popcount(f_groupNames), little_endian);
+            listOfCard32(tvb, offsetp, t, hf_x11_xkb_GetKbdByName_reply_OtherNames_GroupNames_groups, hf_x11_xkb_GetKbdByName_reply_OtherNames_GroupNames_groups_item, my_popcount(f_groupNames), little_endian);
         }
         if ((f_which & (1 << 9)) != 0) {
             struct_KeyName(tvb, offsetp, t, little_endian, f_nKeys);
