Tidy applied with all safe checks on all arm, mips and intel, 32 and 64 bit

Using clang-tidy 7.
warnings=-*,mpi-*,objc-*,llvm-*,hicpp-*,-hicpp-use-noexcept,llvm-*,-hicpp-deprecated-headers,-hicpp-use-auto,bugprone-*,cert-*,google-*,-google-readability-casting,misc-*,,-misc-unused-parameters,-misc-macro-parentheses,cppcoreguidelines-*,-cppcoreguidelines-pro-type-member-init,readability-*,-readability-non-const-parameter,-readability-implicit-bool-conversion,fuchsia-*,-fuchsia-multiple-inheritance,-android-cloexec-*

~/bin/clang-tidy -fix-errors -format-style=file -checks=$warnings $* -- -Iinclude -D__ARM_NEON__ -D__arm__   -D__clang__ -D__clang_major__=6 -DHAVE_JPEG
~/bin/clang-tidy -fix-errors -format-style=file -checks=$warnings $* -- -Iinclude -D__mips_msa               -D__clang__ -D__clang_major__=6 -DHAVE_JPEG
~/bin/clang-tidy -fix-errors -format-style=file -checks=$warnings $* -- -Iinclude -D__aarch64__              -D__clang__ -D__clang_major__=6 -DHAVE_JPEG
~/bin/clang-tidy -fix-errors -format-style=file -checks=$warnings $* -- -Iinclude -D_MSC_VER=1600 -D_M_IX86  -D__clang__ -D__clang_major__=6 -DHAVE_JPEG
~/bin/clang-tidy -fix-errors -format-style=file -checks=$warnings $* -- -Iinclude -D_MSC_VER=1600 -D_M_X64   -D__clang__ -D__clang_major__=6 -DHAVE_JPEG
~/bin/clang-tidy -fix-errors -format-style=file -checks=$warnings $* -- -Iinclude -D__i386__                 -D__clang__ -D__clang_major__=6 -DHAVE_JPEG
~/bin/clang-tidy -fix-errors -format-style=file -checks=$warnings $* -- -Iinclude -D__x86_64__               -D__clang__ -D__clang_major__=6 -DHAVE_JPEG

Bug: libyuv:750
Test: builds and runs and passes more tidy tests
Change-Id: Ieb0f026c5b5a1d2daf8aca18b9290927fdaaa55c
Reviewed-on: https://chromium-review.googlesource.com/907853
Reviewed-by: Weiyong Yao <braveyao@chromium.org>
This commit is contained in:
Frank Barchard 2018-02-09 12:19:02 -08:00 committed by Frank Barchard
parent 724dbeba6c
commit 8a00c2bb4d
8 changed files with 20 additions and 23 deletions

View File

@ -168,8 +168,8 @@ class LIBYUV_API MJpegDecoder {
int GetComponentScanlinePadding(int component);
// A buffer holding the input data for a frame.
Buffer buf_;
BufferVector buf_vec_;
Buffer buf_{};
BufferVector buf_vec_{};
jpeg_decompress_struct* decompress_struct_;
jpeg_source_mgr* source_mgr_;
@ -181,12 +181,12 @@ class LIBYUV_API MJpegDecoder {
// Temporaries used to point to scanline outputs.
int num_outbufs_; // Outermost size of all arrays below.
uint8_t*** scanlines_;
int* scanlines_sizes_;
uint8_t*** scanlines_{};
int* scanlines_sizes_{};
// Temporary buffer used for decoding when we can't decode directly to the
// output buffers. Large enough for just one iMCU row.
uint8_t** databuf_;
int* databuf_strides_;
uint8_t** databuf_{};
int* databuf_strides_{};
};
} // namespace libyuv

View File

@ -1445,8 +1445,8 @@ void Convert16To8Row_Any_AVX2(const uint16_t* src_ptr,
int scale,
int width);
void CopyRow_SSE2(const uint8_t* src, uint8_t* dst, int count);
void CopyRow_AVX(const uint8_t* src, uint8_t* dst, int count);
void CopyRow_SSE2(const uint8_t* src, uint8_t* dst, int width);
void CopyRow_AVX(const uint8_t* src, uint8_t* dst, int width);
void CopyRow_ERMS(const uint8_t* src, uint8_t* dst, int width);
void CopyRow_NEON(const uint8_t* src, uint8_t* dst, int width);
void CopyRow_MIPS(const uint8_t* src, uint8_t* dst, int count);

View File

@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_
#define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 1697
#define LIBYUV_VERSION 1698
#endif // INCLUDE_LIBYUV_VERSION_H_

View File

@ -1709,8 +1709,9 @@ int Android420ToI420(const uint8_t* src_y,
CopyPlane(src_v, src_stride_v, dst_v, dst_stride_v, halfwidth, halfheight);
return 0;
// Split UV planes - NV21
} else if (src_pixel_stride_uv == 2 && vu_off == -1 &&
src_stride_u == src_stride_v) {
}
if (src_pixel_stride_uv == 2 && vu_off == -1 &&
src_stride_u == src_stride_v) {
SplitUVPlane(src_v, src_stride_v, dst_v, dst_stride_v, dst_u, dst_stride_u,
halfwidth, halfheight);
return 0;

View File

@ -1944,8 +1944,9 @@ int Android420ToARGBMatrix(const uint8_t* src_y,
src_stride_v, dst_argb, dst_stride_argb,
yuvconstants, width, height);
// NV21
} else if (src_pixel_stride_uv == 2 && vu_off == -1 &&
src_stride_u == src_stride_v) {
}
if (src_pixel_stride_uv == 2 && vu_off == -1 &&
src_stride_u == src_stride_v) {
return NV21ToARGBMatrix(src_y, src_stride_y, src_v, src_stride_v, dst_argb,
dst_stride_argb, yuvconstants, width, height);
// NV12

View File

@ -552,9 +552,9 @@ JpegSubsamplingType MJpegDecoder::JpegSubsamplingTypeHelper(
if (subsample_x[0] == 1 && subsample_y[0] == 1 && subsample_x[1] == 2 &&
subsample_y[1] == 2 && subsample_x[2] == 2 && subsample_y[2] == 2) {
return kJpegYuv420;
} else if (subsample_x[0] == 1 && subsample_y[0] == 1 &&
subsample_x[1] == 2 && subsample_y[1] == 1 &&
subsample_x[2] == 2 && subsample_y[2] == 1) {
}
if (subsample_x[0] == 1 && subsample_y[0] == 1 && subsample_x[1] == 2 &&
subsample_y[1] == 1 && subsample_x[2] == 2 && subsample_y[2] == 1) {
return kJpegYuv422;
} else if (subsample_x[0] == 1 && subsample_y[0] == 1 &&
subsample_x[1] == 1 && subsample_y[1] == 1 &&

View File

@ -1192,7 +1192,6 @@ static void TestBlendPlane(int width,
free_aligned_buffer_page_end(src_argb_alpha);
free_aligned_buffer_page_end(dst_argb_c);
free_aligned_buffer_page_end(dst_argb_opt);
return;
}
TEST_F(LibYUVPlanarTest, BlendPlane_Opt) {
@ -1286,7 +1285,6 @@ static void TestI420Blend(int width,
free_aligned_buffer_page_end(dst_y_opt);
free_aligned_buffer_page_end(dst_u_opt);
free_aligned_buffer_page_end(dst_v_opt);
return;
}
TEST_F(LibYUVPlanarTest, I420Blend_Opt) {

View File

@ -19,11 +19,8 @@ namespace libyuv {
// Tests FourCC codes in video common, which are used for ConvertToI420().
static bool TestValidChar(uint32_t onecc) {
if ((onecc >= '0' && onecc <= '9') || (onecc >= 'A' && onecc <= 'Z') ||
(onecc >= 'a' && onecc <= 'z') || (onecc == ' ') || (onecc == 0xff)) {
return true;
}
return false;
return (onecc >= '0' && onecc <= '9') || (onecc >= 'A' && onecc <= 'Z') ||
(onecc >= 'a' && onecc <= 'z') || (onecc == ' ') || (onecc == 0xff);
}
static bool TestValidFourCC(uint32_t fourcc, int bpp) {