Skip to content

Commit

Permalink
cargo fmt.
Browse files Browse the repository at this point in the history
  • Loading branch information
kkysen committed Apr 20, 2023
1 parent 5fcb578 commit 25782aa
Show file tree
Hide file tree
Showing 73 changed files with 36,717 additions and 47,203 deletions.
266 changes: 133 additions & 133 deletions c2rust-lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,143 +16,143 @@ compile_error!("No bitdepths enabled. Enable one or more of the following featur
extern crate c2rust_bitfields;
extern crate libc;
pub mod include {
pub mod common {
pub mod attributes;
pub mod dump;
pub mod frame;
pub mod intops;
} // mod common
pub mod dav1d {
pub mod common;
pub mod data;
pub mod dav1d;
pub mod headers;
pub mod picture;
} // mod dav1d
pub mod pthread;
pub mod sched;
pub mod stdatomic;
pub mod stddef;
pub mod stdint;
pub mod stdio;
pub mod sys {
pub mod types;
} // mod sys
pub mod time;
pub mod common {
pub mod attributes;
pub mod dump;
pub mod frame;
pub mod intops;
} // mod common
pub mod dav1d {
pub mod common;
pub mod data;
pub mod dav1d;
pub mod headers;
pub mod picture;
} // mod dav1d
pub mod pthread;
pub mod sched;
pub mod stdatomic;
pub mod stddef;
pub mod stdint;
pub mod stdio;
pub mod sys {
pub mod types;
} // mod sys
pub mod time;
} // mod include
pub mod src {
pub mod align;
pub mod cdef;
#[cfg(feature = "bitdepth_16")]
pub mod cdef_apply_tmpl_16;
#[cfg(feature = "bitdepth_8")]
pub mod cdef_apply_tmpl_8;
#[cfg(feature = "bitdepth_16")]
pub mod cdef_tmpl_16;
#[cfg(feature = "bitdepth_8")]
pub mod cdef_tmpl_8;
pub mod cdf;
pub mod cpu;
pub mod ctx;
pub mod data;
pub mod decode;
pub mod dequant_tables;
pub mod env;
#[cfg(feature = "bitdepth_16")]
pub mod fg_apply_tmpl_16;
#[cfg(feature = "bitdepth_8")]
pub mod fg_apply_tmpl_8;
pub mod filmgrain;
#[cfg(feature = "bitdepth_16")]
pub mod filmgrain_tmpl_16;
#[cfg(feature = "bitdepth_8")]
pub mod filmgrain_tmpl_8;
pub mod getbits;
pub mod internal;
pub mod intra_edge;
pub mod ipred_prepare;
#[cfg(feature = "bitdepth_16")]
pub mod ipred_prepare_tmpl_16;
#[cfg(feature = "bitdepth_8")]
pub mod ipred_prepare_tmpl_8;
pub mod ipred;
pub mod ipred_tmpl;
#[cfg(feature = "bitdepth_16")]
pub mod ipred_tmpl_16;
#[cfg(feature = "bitdepth_8")]
pub mod ipred_tmpl_8;
pub mod itx_1d;
#[cfg(feature = "bitdepth_16")]
pub mod itx_tmpl_16;
pub mod itx_tmpl_8;
pub mod levels;
#[cfg(feature = "bitdepth_16")]
pub mod lf_apply_tmpl_16;
#[cfg(feature = "bitdepth_8")]
pub mod lf_apply_tmpl_8;
pub mod lf_mask;
pub mod lib;
pub mod log;
#[cfg(feature = "bitdepth_16")]
pub mod loopfilter_tmpl_16;
#[cfg(feature = "bitdepth_8")]
pub mod loopfilter_tmpl_8;
pub mod looprestoration;
#[cfg(feature = "bitdepth_16")]
pub mod looprestoration_tmpl_16;
#[cfg(feature = "bitdepth_8")]
pub mod looprestoration_tmpl_8;
pub mod lr_apply;
#[cfg(feature = "bitdepth_16")]
pub mod lr_apply_tmpl_16;
#[cfg(feature = "bitdepth_8")]
pub mod lr_apply_tmpl_8;
#[cfg(feature = "bitdepth_16")]
pub mod mc_tmpl_16;
#[cfg(feature = "bitdepth_8")]
pub mod mc_tmpl_8;
pub mod mem;
pub mod msac;
pub mod obu;
pub mod picture;
pub mod qm;
pub mod r#ref;
pub mod recon;
#[cfg(feature = "bitdepth_16")]
pub mod recon_tmpl_16;
#[cfg(feature = "bitdepth_8")]
pub mod recon_tmpl_8;
pub mod refmvs;
pub mod scan;
pub mod tables;
pub mod thread_data;
pub mod thread_task;
pub mod warpmv;
pub mod wedge;
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub mod x86 {
pub mod cpu;
} // mod x86
#[cfg(any(target_arch = "arm", target_arch = "aarch64"))]
pub mod arm {
pub mod cpu;
} // mod arm
pub mod align;
pub mod cdef;
#[cfg(feature = "bitdepth_16")]
pub mod cdef_apply_tmpl_16;
#[cfg(feature = "bitdepth_8")]
pub mod cdef_apply_tmpl_8;
#[cfg(feature = "bitdepth_16")]
pub mod cdef_tmpl_16;
#[cfg(feature = "bitdepth_8")]
pub mod cdef_tmpl_8;
pub mod cdf;
pub mod cpu;
pub mod ctx;
pub mod data;
pub mod decode;
pub mod dequant_tables;
pub mod env;
#[cfg(feature = "bitdepth_16")]
pub mod fg_apply_tmpl_16;
#[cfg(feature = "bitdepth_8")]
pub mod fg_apply_tmpl_8;
pub mod filmgrain;
#[cfg(feature = "bitdepth_16")]
pub mod filmgrain_tmpl_16;
#[cfg(feature = "bitdepth_8")]
pub mod filmgrain_tmpl_8;
pub mod getbits;
pub mod internal;
pub mod intra_edge;
pub mod ipred;
pub mod ipred_prepare;
#[cfg(feature = "bitdepth_16")]
pub mod ipred_prepare_tmpl_16;
#[cfg(feature = "bitdepth_8")]
pub mod ipred_prepare_tmpl_8;
pub mod ipred_tmpl;
#[cfg(feature = "bitdepth_16")]
pub mod ipred_tmpl_16;
#[cfg(feature = "bitdepth_8")]
pub mod ipred_tmpl_8;
pub mod itx_1d;
#[cfg(feature = "bitdepth_16")]
pub mod itx_tmpl_16;
pub mod itx_tmpl_8;
pub mod levels;
#[cfg(feature = "bitdepth_16")]
pub mod lf_apply_tmpl_16;
#[cfg(feature = "bitdepth_8")]
pub mod lf_apply_tmpl_8;
pub mod lf_mask;
pub mod lib;
pub mod log;
#[cfg(feature = "bitdepth_16")]
pub mod loopfilter_tmpl_16;
#[cfg(feature = "bitdepth_8")]
pub mod loopfilter_tmpl_8;
pub mod looprestoration;
#[cfg(feature = "bitdepth_16")]
pub mod looprestoration_tmpl_16;
#[cfg(feature = "bitdepth_8")]
pub mod looprestoration_tmpl_8;
pub mod lr_apply;
#[cfg(feature = "bitdepth_16")]
pub mod lr_apply_tmpl_16;
#[cfg(feature = "bitdepth_8")]
pub mod lr_apply_tmpl_8;
#[cfg(feature = "bitdepth_16")]
pub mod mc_tmpl_16;
#[cfg(feature = "bitdepth_8")]
pub mod mc_tmpl_8;
pub mod mem;
pub mod msac;
pub mod obu;
pub mod picture;
pub mod qm;
pub mod recon;
#[cfg(feature = "bitdepth_16")]
pub mod recon_tmpl_16;
#[cfg(feature = "bitdepth_8")]
pub mod recon_tmpl_8;
pub mod r#ref;
pub mod refmvs;
pub mod scan;
pub mod tables;
pub mod thread_data;
pub mod thread_task;
pub mod warpmv;
pub mod wedge;
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub mod x86 {
pub mod cpu;
} // mod x86
#[cfg(any(target_arch = "arm", target_arch = "aarch64"))]
pub mod arm {
pub mod cpu;
} // mod arm
} // mod src
pub mod tools {
pub mod dav1d_cli_parse;
pub mod input {
pub mod annexb;
pub mod input;
pub mod ivf;
pub mod section5;
} // mod input
pub mod output {
pub mod md5;
pub mod null;
pub mod output;
pub mod y4m2;
pub mod yuv;
} // mod output
pub mod dav1d_cli_parse;
pub mod input {
pub mod annexb;
pub mod input;
pub mod ivf;
pub mod section5;
} // mod input
pub mod output {
pub mod md5;
pub mod null;
pub mod output;
pub mod y4m2;
pub mod yuv;
} // mod output
} // mod tools

// NOTE: temporary code to support Linux and macOS, should be removed eventually
Expand Down
2 changes: 1 addition & 1 deletion include/common/dump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ pub unsafe extern "C" fn ac_dump(
}
buf = buf.offset(w as isize);
printf(b"\n\0" as *const u8 as *const libc::c_char);
};
}
}
1 change: 0 additions & 1 deletion include/common/frame.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::include::dav1d::headers::Dav1dFrameHeader;


/// Checks whether the frame type is `INTER` or `SWITCH`.
pub fn is_inter_or_switch(frame_header: &Dav1dFrameHeader) -> bool {
// Both are defined as odd numbers {1, 3} and therefore have the LSB set.
Expand Down
8 changes: 2 additions & 6 deletions include/dav1d/dav1d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
#[repr(C)]
pub struct Dav1dLogger {
pub cookie: *mut libc::c_void,
pub callback: Option::<
unsafe extern "C" fn(
*mut libc::c_void,
*const libc::c_char,
::core::ffi::VaList,
) -> (),
pub callback: Option<
unsafe extern "C" fn(*mut libc::c_void, *const libc::c_char, ::core::ffi::VaList) -> (),
>,
}

Expand Down
10 changes: 4 additions & 6 deletions include/dav1d/picture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ pub struct Dav1dPicture {
#[repr(C)]
pub struct Dav1dPicAllocator {
pub cookie: *mut libc::c_void,
pub alloc_picture_callback: Option::<
unsafe extern "C" fn(*mut Dav1dPicture, *mut libc::c_void) -> libc::c_int,
>,
pub release_picture_callback: Option::<
unsafe extern "C" fn(*mut Dav1dPicture, *mut libc::c_void) -> (),
>,
pub alloc_picture_callback:
Option<unsafe extern "C" fn(*mut Dav1dPicture, *mut libc::c_void) -> libc::c_int>,
pub release_picture_callback:
Option<unsafe extern "C" fn(*mut Dav1dPicture, *mut libc::c_void) -> ()>,
}
2 changes: 1 addition & 1 deletion src/align.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! Types for enforcing alignment on struct fields.
//!
//!
//! This module defines a handful of `AlignN` types, where `N` is alignment
//! enforced by that type. These types also implement a few useful traits to
//! make them easier to use in common cases, e.g. [`From`] and
Expand Down
7 changes: 2 additions & 5 deletions src/cdef.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::include::common::intops::apply_sign;
use crate::include::common::intops::imax;
use crate::include::common::intops::imin;
use crate::include::stdint::int16_t;
use crate::include::stddef::ptrdiff_t;
use crate::include::stdint::int16_t;

pub type CdefEdgeFlags = libc::c_uint;
pub const CDEF_HAVE_BOTTOM: CdefEdgeFlags = 8;
Expand Down Expand Up @@ -34,10 +34,7 @@ pub unsafe extern "C" fn fill(
while y < h {
let mut x = 0;
while x < w {
*tmp
.offset(
x as isize,
) = (-(32767 as libc::c_int) - 1) as int16_t;
*tmp.offset(x as isize) = (-(32767 as libc::c_int) - 1) as int16_t;
x += 1;
}
tmp = tmp.offset(stride as isize);
Expand Down
Loading

0 comments on commit 25782aa

Please sign in to comment.