$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	2010-08-29 23:17:00.000000000 +0100
+++ epan/dissectors/x11-extension-implementation.h	2010-09-26 23:55:27.000000000 +0100
@@ -20648,8 +20648,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;
 }
 
@@ -20682,8 +20682,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));
     }
 }
 
@@ -22981,7 +22981,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_)
@@ -23021,8 +23021,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_)
@@ -23117,8 +23117,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_)
@@ -23615,13 +23615,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);
@@ -23783,16 +23783,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);
@@ -24569,7 +24569,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;
@@ -25032,13 +25032,13 @@
             listOfCard32(tvb, offsetp, t, hf_x11_xkb_GetKbdByName_reply_KeyNames_KTLevelNames_ktLevelNames, hf_x11_xkb_GetKbdByName_reply_KeyNames_KTLevelNames_ktLevelNames_item, (length - 230) / 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);
@@ -25191,13 +25191,13 @@
             listOfCard32(tvb, offsetp, t, hf_x11_xkb_GetKbdByName_reply_OtherNames_KTLevelNames_ktLevelNames, hf_x11_xkb_GetKbdByName_reply_OtherNames_KTLevelNames_ktLevelNames_item, (length - 279) / 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);
