Rizin
unix-like reverse engineering framework and cli tools
vli_size.c
Go to the documentation of this file.
1 //
5 //
6 // Author: Lasse Collin
7 //
8 // This file has been put into the public domain.
9 // You can do whatever you want with this file.
10 //
12 
13 #include "common.h"
14 
15 
17 lzma_vli_size(lzma_vli vli)
18 {
19  if (vli > LZMA_VLI_MAX)
20  return 0;
21 
22  uint32_t i = 0;
23  do {
24  vli >>= 7;
25  ++i;
26  } while (vli != 0);
27 
29  return i;
30 }
lzma_index ** i
Definition: index.h:629
assert(limit<=UINT32_MAX/2)
unsigned int uint32_t
Definition: sftypes.h:29
Definitions common to the whole liblzma library.
#define LZMA_VLI_BYTES_MAX
Maximum supported encoded length of variable length integers.
Definition: vli.h:44
uint64_t lzma_vli
Variable-length integer type.
Definition: vli.h:63
#define LZMA_VLI_MAX
Maximum supported value of a variable-length integer.
Definition: vli.h:34
LZMA_API(uint32_t)
Definition: vli_size.c:16