-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbits.c.v
27 lines (23 loc) · 790 Bytes
/
bits.c.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright(C) 2021 Lars Pontoppidan. All rights reserved.
// Use of this source code is governed by an MIT license
// that can be found in the LICENSE file.
module sdl
//
// SDL_bits.h
//
// NOTE not all distros include this file
/*
fn C.SDL_MostSignificantBitIndex32(x u32) int
// most_significant_bit_index32 gets the index of the most significant bit. Result is undefined when called
// with 0. This operation can also be stated as "count leading zeroes" and
// "log base 2".
//
// returns index of the most significant bit, or -1 if the value is 0.
pub fn most_significant_bit_index32(x u32) int {
return C.SDL_MostSignificantBitIndex32(x)
}
fn C.SDL_HasExactlyOneBitSet32(x u32) bool
pub fn has_exactly_one_bit_set32(x u32) bool {
return C.SDL_HasExactlyOneBitSet32(x)
}
*/