Skip to content

Commit

Permalink
Remove redundant libc::c_int (the most common) type annotations.
Browse files Browse the repository at this point in the history
`: libc::c_int = ([0-9]+)` => ` = $1`
  • Loading branch information
kkysen committed Aug 31, 2023
1 parent 15cf426 commit da4ee09
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6021,7 +6021,7 @@ pub unsafe extern "C" fn dav1d_submit_frame(c: *mut Dav1dContext) -> libc::c_int
(*c).frame_hdr_ref = 0 as *mut Dav1dRef;
(*f).dsp =
&mut *((*c).dsp).as_mut_ptr().offset((*(*f).seq_hdr).hbd as isize) as *mut Dav1dDSPContext;
let bpc: libc::c_int = 8 + 2 * (*(*f).seq_hdr).hbd;
let bpc = 8 + 2 * (*(*f).seq_hdr).hbd;
if ((*(*f).dsp).ipred.intra_pred[DC_PRED as libc::c_int as usize]).is_none() {
let dsp: *mut Dav1dDSPContext =
&mut *((*c).dsp).as_mut_ptr().offset((*(*f).seq_hdr).hbd as isize)
Expand Down
18 changes: 9 additions & 9 deletions src/obu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1353,11 +1353,11 @@ unsafe extern "C" fn parse_frame_hdr(c: *mut Dav1dContext, gb: *mut GetBits) ->
&& dav1d_get_bit(gb) == 0) as libc::c_int;
(*hdr).tiling.uniform = dav1d_get_bit(gb) as libc::c_int;
let sbsz_min1: libc::c_int = ((64 as libc::c_int) << (*seqhdr).sb128) - 1;
let sbsz_log2: libc::c_int = 6 + (*seqhdr).sb128;
let sbsz_log2 = 6 + (*seqhdr).sb128;
let sbw: libc::c_int = (*hdr).width[0] + sbsz_min1 >> sbsz_log2;
let sbh: libc::c_int = (*hdr).height + sbsz_min1 >> sbsz_log2;
let max_tile_width_sb: libc::c_int = 4096 >> sbsz_log2;
let max_tile_area_sb: libc::c_int = 4096 * 2304 >> 2 * sbsz_log2;
let max_tile_width_sb = 4096 >> sbsz_log2;
let max_tile_area_sb = 4096 * 2304 >> 2 * sbsz_log2;
(*hdr).tiling.min_log2_cols = tile_log2(max_tile_width_sb, sbw);
(*hdr).tiling.max_log2_cols = tile_log2(1 as libc::c_int, imin(sbw, 64 as libc::c_int));
(*hdr).tiling.max_log2_rows = tile_log2(1 as libc::c_int, imin(sbh, 64 as libc::c_int));
Expand All @@ -1370,7 +1370,7 @@ unsafe extern "C" fn parse_frame_hdr(c: *mut Dav1dContext, gb: *mut GetBits) ->
while (*hdr).tiling.log2_cols < (*hdr).tiling.max_log2_cols && dav1d_get_bit(gb) != 0 {
(*hdr).tiling.log2_cols += 1;
}
let tile_w: libc::c_int = 1 + (sbw - 1 >> (*hdr).tiling.log2_cols);
let tile_w = 1 + (sbw - 1 >> (*hdr).tiling.log2_cols);
(*hdr).tiling.cols = 0 as libc::c_int;
let mut sbx = 0;
while sbx < sbw {
Expand All @@ -1384,7 +1384,7 @@ unsafe extern "C" fn parse_frame_hdr(c: *mut Dav1dContext, gb: *mut GetBits) ->
while (*hdr).tiling.log2_rows < (*hdr).tiling.max_log2_rows && dav1d_get_bit(gb) != 0 {
(*hdr).tiling.log2_rows += 1;
}
let tile_h: libc::c_int = 1 + (sbh - 1 >> (*hdr).tiling.log2_rows);
let tile_h = 1 + (sbh - 1 >> (*hdr).tiling.log2_rows);
(*hdr).tiling.rows = 0 as libc::c_int;
let mut sby = 0;
while sby < sbh {
Expand Down Expand Up @@ -1773,8 +1773,8 @@ unsafe extern "C" fn parse_frame_hdr(c: *mut Dav1dContext, gb: *mut GetBits) ->
let poc: libc::c_uint = (*hdr).frame_offset as libc::c_uint;
let mut off_before: libc::c_uint = 0xffffffff as libc::c_uint;
let mut off_after: libc::c_int = -(1 as libc::c_int);
let mut off_before_idx: libc::c_int = 0;
let mut off_after_idx: libc::c_int = 0;
let mut off_before_idx = 0;
let mut off_after_idx = 0;
let mut i_16 = 0;
while i_16 < 7 {
if ((*c).refs[(*hdr).refidx[i_16 as usize] as usize]
Expand Down Expand Up @@ -1825,7 +1825,7 @@ unsafe extern "C" fn parse_frame_hdr(c: *mut Dav1dContext, gb: *mut GetBits) ->
(*hdr).skip_mode_allowed = 1 as libc::c_int;
} else if off_before != 0xffffffff as libc::c_uint {
let mut off_before2: libc::c_uint = 0xffffffff as libc::c_uint;
let mut off_before2_idx: libc::c_int = 0;
let mut off_before2_idx = 0;
let mut i_17 = 0;
while i_17 < 7 {
if ((*c).refs[(*hdr).refidx[i_17 as usize] as usize]
Expand Down Expand Up @@ -2057,7 +2057,7 @@ unsafe extern "C" fn parse_frame_hdr(c: *mut Dav1dContext, gb: *mut GetBits) ->
.wrapping_add(8 as libc::c_int as libc::c_uint)
as libc::c_int;
(*fgd).ar_coeff_lag = dav1d_get_bits(gb, 2 as libc::c_int) as libc::c_int;
let num_y_pos: libc::c_int = 2 * (*fgd).ar_coeff_lag * ((*fgd).ar_coeff_lag + 1);
let num_y_pos = 2 * (*fgd).ar_coeff_lag * ((*fgd).ar_coeff_lag + 1);
if (*fgd).num_y_points != 0 {
let mut i_23 = 0;
while i_23 < num_y_pos {
Expand Down
8 changes: 4 additions & 4 deletions tests/seek_stress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ unsafe extern "C" fn decode_rand(
data: *mut Dav1dData,
fps: libc::c_double,
) -> libc::c_int {
let mut res: libc::c_int = 0;
let mut res = 0;
let mut p: Dav1dPicture = Dav1dPicture {
seq_hdr: 0 as *mut Dav1dSequenceHeader,
frame_hdr: 0 as *mut Dav1dFrameHeader,
Expand Down Expand Up @@ -483,7 +483,7 @@ unsafe fn main_0(argc: libc::c_int, argv: *const *mut libc::c_char) -> libc::c_i
spf = i_fps[1] as libc::c_double / i_fps[0] as libc::c_double;
fps = i_fps[0] as libc::c_double / i_fps[1] as libc::c_double;
if !(fps < 1 as libc::c_double) {
let mut i: libc::c_int = 0;
let mut i = 0;
loop {
if !(i < 3) {
current_block = 5948590327928692120;
Expand Down Expand Up @@ -593,7 +593,7 @@ unsafe fn main_0(argc: libc::c_int, argv: *const *mut libc::c_char) -> libc::c_i
}
}
// simulate seeking after the end of the file
let mut i_1: libc::c_int = 0;
let mut i_1 = 0;
while i_1 < 2 {
if seek(
in_0,
Expand All @@ -611,7 +611,7 @@ unsafe fn main_0(argc: libc::c_int, argv: *const *mut libc::c_char) -> libc::c_i
if decode_all(in_0, c, &mut data) != 0 {
break;
}
let mut num_flush: libc::c_int = 1 + 64 + xor128_rand() % 64;
let mut num_flush = 1 + 64 + xor128_rand() % 64;
loop {
num_flush -= 1;
if num_flush == 0 {
Expand Down

0 comments on commit da4ee09

Please sign in to comment.