From 1ab8d5fb3f871fc4b9da7e4331b4c5b9a3a05c85 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Sat, 21 Jan 2023 18:57:23 +0100 Subject: [PATCH] src: remove currently unused submodules --- CMakeLists.txt | 4 -- compile_flags.txt | 1 - src/check/dtx_boost_pfr.cpp | 82 ---------------------------------- src/check/dtx_rangeless_fn.cpp | 64 -------------------------- src/conf.h | 46 ------------------- 5 files changed, 197 deletions(-) delete mode 100644 src/check/dtx_boost_pfr.cpp delete mode 100644 src/check/dtx_rangeless_fn.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index cbbb7356..415bf2c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -239,10 +239,6 @@ if(NOT UPX_CONFIG_DISABLE_ZSTD) target_compile_definitions(${t} PRIVATE WITH_ZSTD=1) target_link_libraries(upx upx_vendor_zstd) endif() -if(Threads_FOUND AND 0) - # for RANGELESS_FN_ENABLE_PARALLEL multithreading test - target_link_libraries(upx Threads::Threads) -endif() #*********************************************************************** # "ctest" diff --git a/compile_flags.txt b/compile_flags.txt index 3826c7f8..486ef41c 100644 --- a/compile_flags.txt +++ b/compile_flags.txt @@ -1,6 +1,5 @@ -std=gnu++17 -Ivendor --Ivendor/boost-pfr/include -fno-strict-aliasing -fno-strict-overflow -funsigned-char diff --git a/src/check/dtx_boost_pfr.cpp b/src/check/dtx_boost_pfr.cpp deleted file mode 100644 index 954a5cae..00000000 --- a/src/check/dtx_boost_pfr.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* dtx_.cpp -- DocTest eXtra checks - - This file is part of the UPX executable compressor. - - Copyright (C) 1996-2023 Markus Franz Xaver Johannes Oberhumer - All Rights Reserved. - - UPX and the UCL library are free software; you can redistribute them - and/or modify them under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, Inc., - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - Markus F.X.J. Oberhumer - - */ - -#if DEBUG && 0 -#ifndef WITH_BOOST_PFR -#define WITH_BOOST_PFR 1 -#endif -#endif - -#include "../conf.h" - -/************************************************************************* -// -**************************************************************************/ - -#if WITH_BOOST_PFR - -TEST_CASE("boost::pfr") { - struct Foo { - BE16 b16; - BE32 b32; - BE64 b64; - LE16 l16; - LE32 l32; - LE64 l64; - }; - - { - int i = -1; - CHECK_EQ(strcmp(pfr_str(i), "-1"), 0); - BE32 b32; - b32 = 1; - LE32 l32; - l32 = 2; - CHECK_EQ(strcmp(pfr_str(b32), "1"), 0); - CHECK_EQ(strcmp(pfr_str(l32), "2"), 0); - } - { - Foo foo; - foo.b16 = 1; - foo.b32 = 2; - foo.b64 = 3; - foo.l16 = 4; - foo.l32 = 5; - foo.l64 = 6; - CHECK_EQ(strcmp(pfr_str("foo", "=", foo), "foo = {1, 2, 3, 4, 5, 6}"), 0); - } - { -#if (ACC_ABI_BIG_ENDIAN) -#else - constexpr Foo foo{{1}, {1}, {1}, {1}, {1}, {1}}; - CHECK_EQ(strcmp(pfr_str(foo), "{256, 16777216, 72057594037927936, 1, 1, 1}"), 0); -#endif - } -} - -#endif // WITH_BOOST_PFR - -/* vim:set ts=4 sw=4 et: */ diff --git a/src/check/dtx_rangeless_fn.cpp b/src/check/dtx_rangeless_fn.cpp deleted file mode 100644 index af6453a8..00000000 --- a/src/check/dtx_rangeless_fn.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* dtx_.cpp -- DocTest eXtra checks - - This file is part of the UPX executable compressor. - - Copyright (C) 1996-2023 Markus Franz Xaver Johannes Oberhumer - All Rights Reserved. - - UPX and the UCL library are free software; you can redistribute them - and/or modify them under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, Inc., - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - Markus F.X.J. Oberhumer - - */ - -#if DEBUG && 0 -#ifndef WITH_RANGELESS_FN -#define WITH_RANGELESS_FN 1 -#endif -#endif - -#if WITH_RANGELESS_FN -#define RANGELESS_FN_ENABLE_RUN_TESTS 1 -#if defined(__i386__) && defined(__MSDOS__) && defined(__DJGPP__) && defined(__GNUC__) -#define RANGELESS_FN_ENABLE_PARALLEL 0 -#elif defined(__m68k__) && defined(__atarist__) && defined(__GNUC__) -#define RANGELESS_FN_ENABLE_PARALLEL 0 -#else -// disable multithreading for now; needs CMake find_package(Threads) -#define RANGELESS_FN_ENABLE_PARALLEL 0 -#endif -#endif // WITH_RANGELESS_FN - -#include "../conf.h" - -/************************************************************************* -// -**************************************************************************/ - -#if WITH_RANGELESS_FN && RANGELESS_FN_ENABLE_RUN_TESTS - -TEST_CASE("rangeless::fn") { CHECK_NOTHROW(rangeless::fn::impl::run_tests()); } - -#if RANGELESS_FN_ENABLE_PARALLEL -TEST_CASE("rangeless::fn parallel") { - // CHECK_NOTHROW(rangeless::mt::impl::run_tests()); - ACC_UNUSED_FUNC(rangeless::mt::impl::run_tests); -} -#endif - -#endif // WITH_RANGELESS_FN - -/* vim:set ts=4 sw=4 et: */ diff --git a/src/conf.h b/src/conf.h index 6ae3d00b..70eb5c79 100644 --- a/src/conf.h +++ b/src/conf.h @@ -855,52 +855,6 @@ int upx_test_overlap ( const upx_bytep buf, const upx_compress_result_t *cresult ); -/************************************************************************* -// -**************************************************************************/ - -#if WITH_BOOST_PFR -template -__acc_noinline std::string pfr_string(const A &a) { - std::ostringstream ss; - ss << boost::pfr::io(a); - return ss.str(); -} -template -__acc_noinline std::string pfr_string(const A &a, const B &b) { - std::ostringstream ss; - ss << boost::pfr::io(a); - ss << ' '; - ss << boost::pfr::io(b); - return ss.str(); -} -template -__acc_noinline std::string pfr_string(const A &a, const B &b, const C &c) { - std::ostringstream ss; - ss << boost::pfr::io(a); - ss << ' '; - ss << boost::pfr::io(b); - ss << ' '; - ss << boost::pfr::io(c); - return ss.str(); -} -template -__acc_noinline std::string pfr_string(const A &a, const B &b, const C &c, const D &d) { - std::ostringstream ss; - ss << boost::pfr::io(a); - ss << ' '; - ss << boost::pfr::io(b); - ss << ' '; - ss << boost::pfr::io(c); - ss << ' '; - ss << boost::pfr::io(d); - return ss.str(); -} -// note: this MUST be a macro and not a function because of implicit temporary variable -#define pfr_str(a,...) (pfr_string(a, ##__VA_ARGS__).c_str()) -#endif // WITH_BOOST_PFR - - /************************************************************************* // raw_bytes() - get underlying memory from checked buffers/pointers. // This is overloaded by various utility classes like BoundedPtr,