mirror of
https://github.com/chatmail/core.git
synced 2026-04-21 15:36:30 +03:00
Make dc_tools::dc_exactly_one_bit_set safe and return bool
This commit is contained in:
committed by
Floris Bruynooghe
parent
3eaab07b0b
commit
6c818c6123
@@ -20,8 +20,8 @@ no references to Context and other "larger" classes here. */
|
||||
// for carray etc.
|
||||
/* ** library-private **********************************************************/
|
||||
/* math tools */
|
||||
pub unsafe fn dc_exactly_one_bit_set(v: libc::c_int) -> libc::c_int {
|
||||
return (0 != v && 0 == v & v - 1i32) as libc::c_int;
|
||||
pub fn dc_exactly_one_bit_set(v: libc::c_int) -> bool {
|
||||
0 != v && 0 == v & v - 1i32
|
||||
}
|
||||
|
||||
/* string tools */
|
||||
|
||||
Reference in New Issue
Block a user