Commit 190fb79c authored by Johann's avatar Johann Committed by Frank Barchard

row_common.cc: add const to cast

When casting input for loads, include modifiers such as 'const'

Clears build warnings:

warning: cast from type 'const uint8_t* {aka const unsigned char*}' to
type 'uint32_t* {aka unsigned int*}' casts away qualifiers [-Wcast-qual]

Bug: webm:1509, libyuv:791
Test: g++ -Iinclude -I../libvpx/third_party/libwebm -I../libvpx/vp8 -I../libvpx/vp8 -I../libvpx/vp9 -I../libvpx/vp9 -Iinclude -m64 -DNDEBUG -O3 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -Wdisabled-optimization -Wfloat-conversion -Wpointer-arith -Wtype-limits -Wcast-qual -Wvla -Wuninitialized -Wunused -Wextra -I. -I"../libvpx" -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -Wno-unused-parameter -c -o third_party/libyuv/source/row_common.cc.o source/row_common.cc




Change-Id: I1e3b2fe2a4ae9dd466c3db9cde0560aceb9d1398
Reviewed-on: https://chromium-review.googlesource.com/996393Reviewed-by: 's avatarFrank Barchard <fbarchard@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
parent 6e498475
......@@ -181,7 +181,7 @@ void ARGB4444ToARGBRow_C(const uint8_t* src_argb4444,
void AR30ToARGBRow_C(const uint8_t* src_ar30, uint8_t* dst_argb, int width) {
int x;
for (x = 0; x < width; ++x) {
uint32_t ar30 = *(uint32_t*)src_ar30;
uint32_t ar30 = *(const uint32_t*)src_ar30;
uint32_t b = (ar30 >> 2) & 0xff;
uint32_t g = (ar30 >> 12) & 0xff;
uint32_t r = (ar30 >> 22) & 0xff;
......@@ -195,7 +195,7 @@ void AR30ToARGBRow_C(const uint8_t* src_ar30, uint8_t* dst_argb, int width) {
void AR30ToABGRRow_C(const uint8_t* src_ar30, uint8_t* dst_abgr, int width) {
int x;
for (x = 0; x < width; ++x) {
uint32_t ar30 = *(uint32_t*)src_ar30;
uint32_t ar30 = *(const uint32_t*)src_ar30;
uint32_t b = (ar30 >> 2) & 0xff;
uint32_t g = (ar30 >> 12) & 0xff;
uint32_t r = (ar30 >> 22) & 0xff;
......@@ -209,7 +209,7 @@ void AR30ToABGRRow_C(const uint8_t* src_ar30, uint8_t* dst_abgr, int width) {
void AR30ToAB30Row_C(const uint8_t* src_ar30, uint8_t* dst_ab30, int width) {
int x;
for (x = 0; x < width; ++x) {
uint32_t ar30 = *(uint32_t*)src_ar30;
uint32_t ar30 = *(const uint32_t*)src_ar30;
uint32_t b = ar30 & 0x3ff;
uint32_t ga = ar30 & 0xc00ffc00;
uint32_t r = (ar30 >> 20) & 0x3ff;
......
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