Monado OpenXR Runtime
u_bitwise.h
Go to the documentation of this file.
1
// Copyright 2019-2020, Collabora, Ltd.
2
// SPDX-License-Identifier: BSL-1.0
3
/*!
4
* @file
5
* @brief Functions for manipulating tightly packed data as bits.
6
* @author Jakob Bornecrantz <jakob@collabora.com>
7
* @author Pete Black <pete.black@collabora.com>
8
* @ingroup aux_util
9
*/
10
11
#pragma once
12
13
#include <stdint.h>
14
15
#ifdef __cplusplus
16
extern
"C"
{
17
#endif
18
19
int
20
get_bit(
const
unsigned
char
*b,
int
num);
21
22
int
23
get_bits(
const
unsigned
char
*b,
int
start,
int
num);
24
25
/*!
26
* Interpret the least-significant 13 bits as a signed 13-bit integer, and cast
27
* it to a signed int for normal usage.
28
*/
29
int
30
sign_extend_13
(uint32_t i);
31
32
33
#ifdef __cplusplus
34
}
35
#endif
sign_extend_13
int sign_extend_13(uint32_t i)
Interpret the least-significant 13 bits as a signed 13-bit integer, and cast it to a signed int for n...
Definition:
u_bitwise.c:34
auxiliary
util
u_bitwise.h
Generated by
1.9.4