silence some type size related warnings

size_t/ptrdiff_t -> uint32_t

Change-Id: Ic4d889b9239752311b9ed906c83076829d850874
This commit is contained in:
James Zern 2012-02-08 12:30:30 -08:00
parent 85b6ff6897
commit 1601a39b09
3 changed files with 8 additions and 4 deletions

View File

@ -13,6 +13,7 @@
#include "./vp8i.h"
#include "./webpi.h"
#include "../mux/muxi.h" // For MAX_CHUNK_PAYLOAD.
#include "../webp/mux.h" // For 'ALPHA_FLAG'.
#if defined(__cplusplus) || defined(c_plusplus)
@ -257,7 +258,8 @@ VP8StatusCode WebPParseHeaders(const uint8_t** data, uint32_t* data_size,
*vp8_size = vp8_size_tmp;
}
*bytes_skipped = buf - *data;
*bytes_skipped = (uint32_t)(buf - *data);
assert(buf - *data < MAX_CHUNK_PAYLOAD);
assert(*bytes_skipped == *data_size - buf_size);
*data = buf;
*data_size = buf_size;

View File

@ -54,7 +54,8 @@ static WebPEncodingError PutRIFFHeader(const VP8Encoder* const enc,
uint8_t riff[RIFF_HEADER_SIZE] = {
'R', 'I', 'F', 'F', 0, 0, 0, 0, 'W', 'E', 'B', 'P'
};
PutLE32(riff + TAG_SIZE, riff_size);
assert(riff_size == (uint32_t)riff_size);
PutLE32(riff + TAG_SIZE, (uint32_t)riff_size);
if (!pic->writer(riff, sizeof(riff), pic)) {
return VP8_ENC_ERROR_BAD_WRITE;
}
@ -115,7 +116,8 @@ static WebPEncodingError PutVP8Header(const WebPPicture* const pic,
uint8_t vp8_chunk_hdr[CHUNK_HEADER_SIZE] = {
'V', 'P', '8', ' '
};
PutLE32(vp8_chunk_hdr + TAG_SIZE, vp8_size);
assert(vp8_size == (uint32_t)vp8_size);
PutLE32(vp8_chunk_hdr + TAG_SIZE, (uint32_t)vp8_size);
if (!pic->writer(vp8_chunk_hdr, sizeof(vp8_chunk_hdr), pic)) {
return VP8_ENC_ERROR_BAD_WRITE;
}

View File

@ -548,7 +548,7 @@ static WebPMuxError CreateVP8XChunk(WebPMux* const mux) {
uint32_t width = 0;
uint32_t height = 0;
uint8_t data[VP8X_CHUNK_SIZE];
const size_t data_size = VP8X_CHUNK_SIZE;
const uint32_t data_size = VP8X_CHUNK_SIZE;
const WebPMuxImage* images = NULL;
images = mux->images_; // First image.