mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-19 16:35:20 +01:00
Qt/QML edition
This commit is contained in:
commit
d7b361ba44
2168 changed files with 721948 additions and 0 deletions
56
dependencies/cmliblzma/liblzma/lzma/fastpos_tablegen.c
vendored
Normal file
56
dependencies/cmliblzma/liblzma/lzma/fastpos_tablegen.c
vendored
Normal file
|
@ -0,0 +1,56 @@
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \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 <sys/types.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h>
|
||||
#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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue