Commit b8696fde authored by Johann's avatar Johann Committed by Commit Bot

add const to casts

When casting a const value, ensure the cast is const as well.

BUG=webm:1509

Change-Id: I5b597fdcc148d111e9824bc7cf918fc5f24e970f
Reviewed-on: https://chromium-review.googlesource.com/996553Reviewed-by: 's avatarFrank Barchard <fbarchard@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
parent 7e5e1275
......@@ -55,7 +55,7 @@ uint32_t HammingDistance_C(const uint8_t* src_a,
int i;
for (i = 0; i < count - 3; i += 4) {
uint32_t x = *((uint32_t*)src_a) ^ *((uint32_t*)src_b); // NOLINT
uint32_t x = *((const uint32_t*)src_a) ^ *((const uint32_t*)src_b);
uint32_t u = x - ((x >> 1) & 0x55555555);
u = ((u >> 2) & 0x33333333) + (u & 0x33333333);
diff += ((((u + (u >> 4)) & 0x0f0f0f0f) * 0x01010101) >> 24);
......
......@@ -1154,8 +1154,8 @@ int I420ToRGB565Dither(const uint8_t* src_y,
for (y = 0; y < height; ++y) {
I422ToARGBRow(src_y, src_u, src_v, row_argb, &kYuvI601Constants, width);
ARGBToRGB565DitherRow(row_argb, dst_rgb565,
*(uint32_t*)(dither4x4 + ((y & 3) << 2)), // NOLINT
width); // NOLINT
*(const uint32_t*)(dither4x4 + ((y & 3) << 2)),
width);
dst_rgb565 += dst_stride_rgb565;
src_y += src_stride_y;
if (y & 1) {
......
......@@ -1050,8 +1050,8 @@ int ARGBToRGB565Dither(const uint8_t* src_argb,
for (y = 0; y < height; ++y) {
ARGBToRGB565DitherRow(src_argb, dst_rgb565,
*(uint32_t*)(dither4x4 + ((y & 3) << 2)), // NOLINT
width); /* NOLINT */
*(const uint32_t*)(dither4x4 + ((y & 3) << 2)),
width);
src_argb += src_stride_argb;
dst_rgb565 += dst_stride_rgb565;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment