From ac980b71cff73a80c2ea020aeed3520731cb37cf Mon Sep 17 00:00:00 2001 From: Johann Date: Tue, 23 Apr 2013 09:55:03 -0700 Subject: [PATCH] Improve sign consistency. Fix warning on windows: signed/unsigned mismatch on lines 415, 454 Comparison was between size_t data_sz >= int index_sz on 415 and unsigned int data_sz >= int index_sz on 454. Both might be changed to size_t but that would be tracing and replacing all comparisons is outside the scope of this change. In the rest of these two functions ensure unsigned values are used consistently. Change-Id: I922b399ceca612a92f44b9d1d331c1c6bae9d768 --- vp9/vp9_dx_iface.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/vp9/vp9_dx_iface.c b/vp9/vp9_dx_iface.c index d0c23f07a..69f08a7af 100644 --- a/vp9/vp9_dx_iface.c +++ b/vp9/vp9_dx_iface.c @@ -408,9 +408,9 @@ static void parse_superframe_index(const uint8_t *data, *count = 0; if ((marker & 0xe0) == 0xc0) { - const int frames = (marker & 0x7) + 1; - const int mag = ((marker >> 3) & 3) + 1; - const int index_sz = 2 + mag * frames; + const uint32_t frames = (marker & 0x7) + 1; + const uint32_t mag = ((marker >> 3) & 0x3) + 1; + const size_t index_sz = 2 + mag * frames; if (data_sz >= index_sz && data[data_sz - index_sz] == marker) { // found a valid superframe index @@ -418,7 +418,7 @@ static void parse_superframe_index(const uint8_t *data, const uint8_t *x = data + data_sz - index_sz + 1; for (i = 0; i < frames; i++) { - int this_sz = 0; + uint32_t this_sz = 0; for (j = 0; j < mag; j++) this_sz |= (*x++) << (j * 8); @@ -447,9 +447,9 @@ static vpx_codec_err_t vp9_decode(vpx_codec_alg_priv_t *ctx, // Skip over the superframe index, if present if (data_sz && (*data_start & 0xe0) == 0xc0) { const uint8_t marker = *data_start; - const int frames = (marker & 0x7) + 1; - const int mag = ((marker >> 3) & 3) + 1; - const int index_sz = 2 + mag * frames; + const uint32_t frames = (marker & 0x7) + 1; + const uint32_t mag = ((marker >> 3) & 0x3) + 1; + const uint32_t index_sz = 2 + mag * frames; if (data_sz >= index_sz && data_start[index_sz - 1] == marker) { data_start += index_sz;