Skip to content

Commit

Permalink
fn {in,out}put_open: Replace offset_ofs of trailing ZSTs with `si…
Browse files Browse the repository at this point in the history
…ze_of`s as they are equivalent due to the ZST.
  • Loading branch information
kkysen committed Dec 6, 2023
1 parent 1c9bfc3 commit 52f9a52
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion tests/seek_stress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#![allow(non_upper_case_globals)]
#![feature(extern_types)]
#![feature(c_variadic)]
#![feature(offset_of)]
#![allow(clippy::all)]

#[path = "../tools/input"]
Expand Down
1 change: 0 additions & 1 deletion tools/dav1d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#![allow(non_upper_case_globals)]
#![feature(extern_types)]
#![feature(c_variadic)]
#![feature(offset_of)]
#![allow(clippy::all)]

mod input {
Expand Down
2 changes: 1 addition & 1 deletion tools/input/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ pub unsafe fn input_open(
}
c = calloc(
1,
mem::offset_of!(DemuxerContext, priv_data) + (*impl_0).priv_data_size as usize,
mem::size_of::<DemuxerContext>() + (*impl_0).priv_data_size as usize,
) as *mut DemuxerContext;
if c.is_null() {
fprintf(
Expand Down
2 changes: 1 addition & 1 deletion tools/output/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ pub unsafe fn output_open(
return -ENOPROTOOPT;
}
}
c = malloc(mem::offset_of!(MuxerContext, priv_data) + (*impl_0).priv_data_size as usize)
c = malloc(mem::size_of::<MuxerContext>() + (*impl_0).priv_data_size as usize)
as *mut MuxerContext;
if c.is_null() {
fprintf(
Expand Down

0 comments on commit 52f9a52

Please sign in to comment.