Bug 1684491 - Run cargo fmt after clippy changes. r=aosmond

Differential Revision: https://phabricator.services.mozilla.com/D100540
This commit is contained in:
Jeff Muizelaar 2020-12-30 15:12:28 +00:00
Родитель 74039caf3c
Коммит 3ff01f82d3
4 изменённых файлов: 17 добавлений и 33 удалений

Просмотреть файл

@ -135,8 +135,7 @@ unsafe extern "C" fn qcms_data_from_file(
(length as libc::c_ulong - ::std::mem::size_of::<be32>() as libc::c_ulong) as u32;
/* read the rest profile */
read_length = fread(
(data as *mut libc::c_uchar).add(::std::mem::size_of::<be32>())
as *mut libc::c_void,
(data as *mut libc::c_uchar).add(::std::mem::size_of::<be32>()) as *mut libc::c_void,
1,
remaining_length as usize,
file,

Просмотреть файл

@ -229,9 +229,7 @@ fn read_u32(mut mem: &mut mem_source, mut offset: usize) -> u32 {
invalid_source(mem, "Invalid offset");
0
} else {
let k = unsafe {
std::ptr::read_unaligned(mem.buf.as_ptr().add(offset) as *const be32)
};
let k = unsafe { std::ptr::read_unaligned(mem.buf.as_ptr().add(offset) as *const be32) };
be32_to_cpu(k)
}
}
@ -240,9 +238,7 @@ fn read_u16(mut mem: &mut mem_source, mut offset: usize) -> u16 {
invalid_source(mem, "Invalid offset");
0u16
} else {
let k = unsafe {
std::ptr::read_unaligned(mem.buf.as_ptr().add(offset) as *const be16)
};
let k = unsafe { std::ptr::read_unaligned(mem.buf.as_ptr().add(offset) as *const be16) };
be16_to_cpu(k)
}
}

Просмотреть файл

@ -1173,19 +1173,14 @@ pub fn transform_create(
}
let mut transform: Box<qcms_transform> = Box::new(Default::default());
let mut precache: bool = false;
if out.output_table_r.is_some()
&& out.output_table_g.is_some()
&& out.output_table_b.is_some()
if out.output_table_r.is_some() && out.output_table_g.is_some() && out.output_table_b.is_some()
{
precache = true
}
// This precache assumes RGB_SIGNATURE (fails on GRAY_SIGNATURE, for instance)
if qcms_supports_iccv4.load(Ordering::Relaxed) as i32 != 0
&& (in_type == DATA_RGB_8 || in_type == DATA_RGBA_8 || in_type == DATA_BGRA_8)
&& (in_0.A2B0.is_some()
|| out.B2A0.is_some()
|| in_0.mAB.is_some()
|| out.mAB.is_some())
&& (in_0.A2B0.is_some() || out.B2A0.is_some() || in_0.mAB.is_some() || out.mAB.is_some())
{
// Precache the transformation to a CLUT 33x33x33 in size.
// 33 is used by many profiles and works well in pratice.

Просмотреть файл

@ -87,15 +87,12 @@ unsafe extern "C" fn qcms_transform_data_template_lut_avx<F: Format>(
vec_r0 = _mm_broadcast_ss(&*igtbl_r.offset(*src.add(F::kRIndex) as isize));
vec_g0 = _mm_broadcast_ss(&*igtbl_g.offset(*src.add(F::kGIndex) as isize));
vec_b0 = _mm_broadcast_ss(&*igtbl_b.offset(*src.add(F::kBIndex) as isize));
vec_r1 = _mm_broadcast_ss(
&*igtbl_r.offset(*src.add(F::kRIndex + components as usize) as isize),
);
vec_g1 = _mm_broadcast_ss(
&*igtbl_g.offset(*src.add(F::kGIndex + components as usize) as isize),
);
vec_b1 = _mm_broadcast_ss(
&*igtbl_b.offset(*src.add(F::kBIndex + components as usize) as isize),
);
vec_r1 =
_mm_broadcast_ss(&*igtbl_r.offset(*src.add(F::kRIndex + components as usize) as isize));
vec_g1 =
_mm_broadcast_ss(&*igtbl_g.offset(*src.add(F::kGIndex + components as usize) as isize));
vec_b1 =
_mm_broadcast_ss(&*igtbl_b.offset(*src.add(F::kBIndex + components as usize) as isize));
vec_r = _mm256_insertf128_ps(_mm256_castps128_ps256(vec_r0), vec_r1, 1);
vec_g = _mm256_insertf128_ps(_mm256_castps128_ps256(vec_g0), vec_g1, 1);
vec_b = _mm256_insertf128_ps(_mm256_castps128_ps256(vec_b0), vec_b1, 1);
@ -131,15 +128,12 @@ unsafe extern "C" fn qcms_transform_data_template_lut_avx<F: Format>(
vec_r0 = _mm_broadcast_ss(&*igtbl_r.offset(*src.add(F::kRIndex) as isize));
vec_g0 = _mm_broadcast_ss(&*igtbl_g.offset(*src.add(F::kGIndex) as isize));
vec_b0 = _mm_broadcast_ss(&*igtbl_b.offset(*src.add(F::kBIndex) as isize));
vec_r1 = _mm_broadcast_ss(
&*igtbl_r.offset(*src.add(F::kRIndex + components as usize) as isize),
);
vec_g1 = _mm_broadcast_ss(
&*igtbl_g.offset(*src.add(F::kGIndex + components as usize) as isize),
);
vec_b1 = _mm_broadcast_ss(
&*igtbl_b.offset(*src.add(F::kBIndex + components as usize) as isize),
);
vec_r1 =
_mm_broadcast_ss(&*igtbl_r.offset(*src.add(F::kRIndex + components as usize) as isize));
vec_g1 =
_mm_broadcast_ss(&*igtbl_g.offset(*src.add(F::kGIndex + components as usize) as isize));
vec_b1 =
_mm_broadcast_ss(&*igtbl_b.offset(*src.add(F::kBIndex + components as usize) as isize));
vec_r = _mm256_insertf128_ps(_mm256_castps128_ps256(vec_r0), vec_r1, 1);
vec_g = _mm256_insertf128_ps(_mm256_castps128_ps256(vec_g0), vec_g1, 1);
vec_b = _mm256_insertf128_ps(_mm256_castps128_ps256(vec_b0), vec_b1, 1);