X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=lzma%2Flzma%2Ffastpos_tablegen.c;fp=lzma%2Flzma%2Ffastpos_tablegen.c;h=0000000000000000000000000000000000000000;hb=b98de15a9347ff313c6c1775ea964f5f89f2ee21;hp=c97e6f411c2774aad309bcd70851ec7644f40d9a;hpb=001a7667ffa1aaf5dc664cffa6dae6016c9e4cbc;p=zpackage diff --git a/lzma/lzma/fastpos_tablegen.c b/lzma/lzma/fastpos_tablegen.c deleted file mode 100644 index c97e6f4..0000000 --- a/lzma/lzma/fastpos_tablegen.c +++ /dev/null @@ -1,56 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// -/// \file fastpos_tablegen.c -/// \brief Generates the lzma_fastpos[] lookup table -/// -// Authors: Igor Pavlov -// Lasse Collin -// -// This file has been put into the public domain. -// You can do whatever you want with this file. -// -/////////////////////////////////////////////////////////////////////////////// - -#include -#include -#include -#include "fastpos.h" - - -int -main(void) -{ - uint8_t fastpos[1 << FASTPOS_BITS]; - - const uint8_t fast_slots = 2 * FASTPOS_BITS; - uint32_t c = 2; - - fastpos[0] = 0; - fastpos[1] = 1; - - for (uint8_t slot_fast = 2; slot_fast < fast_slots; ++slot_fast) { - const uint32_t k = 1 << ((slot_fast >> 1) - 1); - for (uint32_t j = 0; j < k; ++j, ++c) - fastpos[c] = slot_fast; - } - - printf("/* This file has been automatically generated " - "by fastpos_tablegen.c. */\n\n" - "#include \"common.h\"\n" - "#include \"fastpos.h\"\n\n" - "const uint8_t lzma_fastpos[1 << FASTPOS_BITS] = {"); - - for (size_t i = 0; i < (1 << FASTPOS_BITS); ++i) { - if (i % 16 == 0) - printf("\n\t"); - - printf("%3u", (unsigned int)(fastpos[i])); - - if (i != (1 << FASTPOS_BITS) - 1) - printf(","); - } - - printf("\n};\n"); - - return 0; -}