aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2018-03-12 14:35:43 -0700
committerAnders Broman <a.broman58@gmail.com>2018-03-13 17:18:01 +0000
commit0874b8bac6ca89f1d91d30d66d54f425e4e7c81e (patch)
treea55f7711fae9f423d66ccff34a48feedf7c51551 /wsutil
parenta2cbec743e9c25154281413ea6062ecf81a8a5ea (diff)
Remove popcount in favor of ws_count_ones.
Remove our popcount implementation in favor of ws_count_ones, which is our other popcount implementation. This required updating and running process-x11-xcb.pl. Change-Id: I8634c55242113b338c5b0173837c35f98b148b4f Reviewed-on: https://code.wireshark.org/review/26454 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'wsutil')
-rw-r--r--wsutil/CMakeLists.txt4
-rw-r--r--wsutil/Makefile.am2
-rw-r--r--wsutil/popcount.c30
-rw-r--r--wsutil/popcount.h18
4 files changed, 0 insertions, 54 deletions
diff --git a/wsutil/CMakeLists.txt b/wsutil/CMakeLists.txt
index aefc0273f6..cd5c826000 100644
--- a/wsutil/CMakeLists.txt
+++ b/wsutil/CMakeLists.txt
@@ -207,10 +207,6 @@ if(NOT HAVE_GETOPT_LONG)
list(APPEND WSUTIL_FILES getopt_long.c)
endif()
-if(NOT HAVE_POPCOUNT)
- list(APPEND WSUTIL_FILES popcount.c)
-endif()
-
if(NOT HAVE_STRPTIME)
list(APPEND WSUTIL_FILES strptime.c)
endif()
diff --git a/wsutil/Makefile.am b/wsutil/Makefile.am
index b60aded329..2e29e2b143 100644
--- a/wsutil/Makefile.am
+++ b/wsutil/Makefile.am
@@ -198,8 +198,6 @@ EXTRA_DIST = \
file_util.h \
getopt_long.c \
getopt_long.h \
- popcount.c \
- popcount.h \
strptime.c \
strptime.h \
win32-utils.c \
diff --git a/wsutil/popcount.c b/wsutil/popcount.c
deleted file mode 100644
index 7c0105e41e..0000000000
--- a/wsutil/popcount.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* popcount.c
- *
- * popcount() replacement function for systems that don't provide their own.
- *
- * Wireshark - Network traffic analyzer
- * By Gerald Combs <gerald@wireshark.org>
- * Copyright 1998 Gerald Combs
- *
- * SPDX-License-Identifier: GPL-2.0-or-later
- */
-
-#include "config.h"
-
-#include "wsutil/popcount.h"
-
-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
-}
diff --git a/wsutil/popcount.h b/wsutil/popcount.h
deleted file mode 100644
index 561dd25338..0000000000
--- a/wsutil/popcount.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/* popcount.h
- *
- * Wireshark - Network traffic analyzer
- * By Gerald Combs <gerald@wireshark.org>
- * Copyright 1998 Gerald Combs
- *
- * SPDX-License-Identifier: GPL-2.0-or-later
- */
-
-#ifndef __POPCOUNT_H__
-#define __POPCOUNT_H__
-
-#include "ws_symbol_export.h"
-
-WS_DLL_PUBLIC int popcount(unsigned int mask);
-
-#endif /* __POPCOUNT_H__ */
-