Last change
on this file since 108911 was 108911, checked in by vboxsync, 4 weeks ago |
libs/liblzma: Applied and adjusted our liblzma changes to 5.8.1 and export to OSE. jiraref:VBP-1635
|
-
Property svn:eol-style
set to
native
-
Property svn:keywords
set to
Author Date Id Revision
-
Property sync-process
set to
export
|
File size:
561 bytes
|
Line | |
---|
1 | // SPDX-License-Identifier: 0BSD
|
---|
2 |
|
---|
3 | ///////////////////////////////////////////////////////////////////////////////
|
---|
4 | //
|
---|
5 | /// \file vli_size.c
|
---|
6 | /// \brief Calculates the encoded size of a variable-length integer
|
---|
7 | //
|
---|
8 | // Author: Lasse Collin
|
---|
9 | //
|
---|
10 | ///////////////////////////////////////////////////////////////////////////////
|
---|
11 |
|
---|
12 | #include "common.h"
|
---|
13 |
|
---|
14 |
|
---|
15 | extern LZMA_API(uint32_t)
|
---|
16 | lzma_vli_size(lzma_vli vli)
|
---|
17 | {
|
---|
18 | if (vli > LZMA_VLI_MAX)
|
---|
19 | return 0;
|
---|
20 |
|
---|
21 | uint32_t i = 0;
|
---|
22 | do {
|
---|
23 | vli >>= 7;
|
---|
24 | ++i;
|
---|
25 | } while (vli != 0);
|
---|
26 |
|
---|
27 | assert(i <= LZMA_VLI_BYTES_MAX);
|
---|
28 | return i;
|
---|
29 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.