sys: Fix clippy lints, run cargo fmt
This commit is contained in:
parent
a4e4aedc13
commit
40b7016177
@ -347,25 +347,24 @@ static POSTPROC_HEADERS: &[AVHeader] = &[AVHeader::new("postprocess.h")];
|
|||||||
struct Callbacks;
|
struct Callbacks;
|
||||||
|
|
||||||
impl ParseCallbacks for Callbacks {
|
impl ParseCallbacks for Callbacks {
|
||||||
fn int_macro(&self, _name: &str, value: i64) -> Option<IntKind> {
|
fn int_macro(&self, name: &str, value: i64) -> Option<IntKind> {
|
||||||
let ch_layout_prefix = "AV_CH_";
|
let ch_layout_prefix = "AV_CH_";
|
||||||
let codec_cap_prefix = "AV_CODEC_CAP_";
|
let codec_cap_prefix = "AV_CODEC_CAP_";
|
||||||
let codec_flag_prefix = "AV_CODEC_FLAG_";
|
let codec_flag_prefix = "AV_CODEC_FLAG_";
|
||||||
let error_max_size = "AV_ERROR_MAX_STRING_SIZE";
|
let error_max_size = "AV_ERROR_MAX_STRING_SIZE";
|
||||||
|
|
||||||
if _name.starts_with(ch_layout_prefix) {
|
if name.starts_with(ch_layout_prefix) {
|
||||||
Some(IntKind::ULongLong)
|
Some(IntKind::ULongLong)
|
||||||
} else if value >= i32::min_value() as i64
|
} else if (i32::MIN as i64..=i32::MAX as i64).contains(&value)
|
||||||
&& value <= i32::max_value() as i64
|
&& (name.starts_with(codec_cap_prefix) || name.starts_with(codec_flag_prefix))
|
||||||
&& (_name.starts_with(codec_cap_prefix) || _name.starts_with(codec_flag_prefix))
|
|
||||||
{
|
{
|
||||||
Some(IntKind::UInt)
|
Some(IntKind::UInt)
|
||||||
} else if _name == error_max_size {
|
} else if name == error_max_size {
|
||||||
Some(IntKind::Custom {
|
Some(IntKind::Custom {
|
||||||
name: "usize",
|
name: "usize",
|
||||||
is_signed: false,
|
is_signed: false,
|
||||||
})
|
})
|
||||||
} else if value >= i32::min_value() as i64 && value <= i32::max_value() as i64 {
|
} else if (i32::MIN as i64..=i32::MAX as i64).contains(&value) {
|
||||||
Some(IntKind::Int)
|
Some(IntKind::Int)
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
@ -17,7 +17,7 @@ pub unsafe fn av_cmp_q(a: AVRational, b: AVRational) -> c_int {
|
|||||||
} else if a.num != 0 && b.num != 0 {
|
} else if a.num != 0 && b.num != 0 {
|
||||||
((i64::from(a.num) >> 31) - (i64::from(b.num) >> 31)) as c_int
|
((i64::from(a.num) >> 31) - (i64::from(b.num) >> 31)) as c_int
|
||||||
} else {
|
} else {
|
||||||
c_int::min_value()
|
c_int::MIN
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user