File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -213,7 +213,7 @@ fn type_declaration_impl(
213
213
let s = btf_type_match ! ( match ty {
214
214
BtfKind :: Void => "std::ffi::c_void" . to_string( ) ,
215
215
BtfKind :: Int ( t) => {
216
- let width = match ( t. bits + 7 ) / 8 {
216
+ let width = match t. bits. div_ceil ( 8 ) {
217
217
1 => "8" ,
218
218
2 => "16" ,
219
219
4 => "32" ,
@@ -307,7 +307,7 @@ fn size_of_type(ty: BtfType<'_>, btf: &Btf<'_>) -> Result<usize> {
307
307
let ty = ty. skip_mods_and_typedefs ( ) ;
308
308
309
309
Ok ( btf_type_match ! ( match ty {
310
- BtfKind :: Int ( t) => ( ( t. bits + 7 ) / 8 ) . into( ) ,
310
+ BtfKind :: Int ( t) => t. bits. div_ceil ( 8 ) . into( ) ,
311
311
BtfKind :: Ptr => btf. ptr_size( ) ?. get( ) ,
312
312
BtfKind :: Array ( t) => t. capacity( ) * size_of_type( t. contained_type( ) , btf) ?,
313
313
BtfKind :: Struct ( t) => t. size( ) ,
You can’t perform that action at this time.
0 commit comments