From e1d56395f6b16cb70f8dbb942a117dc01fd7e74c Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Tue, 23 Apr 2019 08:19:47 +1000 Subject: [PATCH] build: remove buzstats tool --- CMakeLists.txt | 2 +- tools/buzstats.cpp | 32 -------------------------------- 2 files changed, 1 insertion(+), 33 deletions(-) delete mode 100644 tools/buzstats.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 922379e7..2f3903fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -542,7 +542,7 @@ endif () ############################################################################### -foreach (tool buzstats cpuid poisson macro scratch) +foreach (tool cpuid poisson macro scratch) add_executable (util_${tool} tools/${tool}.cpp) set_target_properties (util_${tool} PROPERTIES OUTPUT_NAME ${tool}) target_link_libraries (util_${tool} cruft) diff --git a/tools/buzstats.cpp b/tools/buzstats.cpp deleted file mode 100644 index 4c3a3ed7..00000000 --- a/tools/buzstats.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include "hash/buzhash.hpp" -#include "io.hpp" - -#include - -int main (int argc, char const **argv) -{ - (void)argc; - - cruft::mapped_file src (argv[1]); - cruft::view bytes (src); - - static constexpr std::size_t BITS = 16; - std::vector counts (BITS, 0); - - static constexpr std::size_t WINDOW = 48; - cruft::hash::buzhash h (WINDOW, bytes); - - for (auto const &val: bytes.consume (WINDOW)) { - auto const res = h (&val); - - std::size_t mask = ~u64(0) >> (64 - BITS); - for (std::size_t i = 0; i < BITS; ++i) { - if ((res & mask) == 0) - counts[i]++; - mask >>= 1; - } - } - - for (auto const &i: counts) - std::cout << i << '\n'; -} \ No newline at end of file