Rizin
unix-like reverse engineering framework and cli tools
vli_size.c File Reference

Calculates the encoded size of a variable-length integer. More...

#include "common.h"

Go to the source code of this file.

Functions

 LZMA_API (uint32_t)
 

Detailed Description

Calculates the encoded size of a variable-length integer.

Definition in file vli_size.c.

Function Documentation

◆ LZMA_API()

LZMA_API ( uint32_t  )

Definition at line 16 of file vli_size.c.

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
#define LZMA_VLI_BYTES_MAX
Maximum supported encoded length of variable length integers.
Definition: vli.h:44
#define LZMA_VLI_MAX
Maximum supported value of a variable-length integer.
Definition: vli.h:34

References assert(), i, LZMA_VLI_BYTES_MAX, and LZMA_VLI_MAX.