Merge changes I8bb7a4dc,I2c180051,I021a014f,I8a224a62

* changes:
  mux: add some missing casts
  enc/vp8l: add a missing cast
  idec: add some missing casts
  ErrorStatusLossless: correct return type
This commit is contained in:
James Zern 2013-11-27 17:06:35 -08:00 committed by Gerrit Code Review
commit cc55790e37
5 changed files with 10 additions and 9 deletions

View File

@ -485,7 +485,8 @@ static VP8StatusCode DecodeRemaining(WebPIDecoder* const idec) {
return VP8_STATUS_OK; return VP8_STATUS_OK;
} }
static int ErrorStatusLossless(WebPIDecoder* const idec, VP8StatusCode status) { static VP8StatusCode ErrorStatusLossless(WebPIDecoder* const idec,
VP8StatusCode status) {
if (status == VP8_STATUS_SUSPENDED || status == VP8_STATUS_NOT_ENOUGH_DATA) { if (status == VP8_STATUS_SUSPENDED || status == VP8_STATUS_NOT_ENOUGH_DATA) {
return VP8_STATUS_SUSPENDED; return VP8_STATUS_SUSPENDED;
} }
@ -619,11 +620,11 @@ void WebPIDelete(WebPIDecoder* idec) {
if (!idec->is_lossless_) { if (!idec->is_lossless_) {
if (idec->state_ == STATE_VP8_DATA) { if (idec->state_ == STATE_VP8_DATA) {
// Synchronize the thread, clean-up and check for errors. // Synchronize the thread, clean-up and check for errors.
VP8ExitCritical(idec->dec_, &idec->io_); VP8ExitCritical((VP8Decoder*)idec->dec_, &idec->io_);
} }
VP8Delete(idec->dec_); VP8Delete((VP8Decoder*)idec->dec_);
} else { } else {
VP8LDelete(idec->dec_); VP8LDelete((VP8LDecoder*)idec->dec_);
} }
} }
ClearMemBuffer(&idec->mem_); ClearMemBuffer(&idec->mem_);

View File

@ -892,7 +892,7 @@ static WebPEncodingError EncodePalette(VP8LBitWriter* const bw,
if (err != VP8_ENC_OK) goto Error; if (err != VP8_ENC_OK) goto Error;
dst = enc->argb_; dst = enc->argb_;
row = WebPSafeMalloc((uint64_t)width, sizeof(*row)); row = (uint8_t*)WebPSafeMalloc((uint64_t)width, sizeof(*row));
if (row == NULL) return VP8_ENC_ERROR_OUT_OF_MEMORY; if (row == NULL) return VP8_ENC_ERROR_OUT_OF_MEMORY;
ApplyPalette(src, dst, pic->argb_stride, enc->current_width_, ApplyPalette(src, dst, pic->argb_stride, enc->current_width_,

View File

@ -414,7 +414,7 @@ static WebPMuxError GetImageInfo(const WebPMuxImage* const wpi,
// Get width and height from VP8/VP8L chunk. // Get width and height from VP8/VP8L chunk.
if (width != NULL) *width = wpi->width_; if (width != NULL) *width = wpi->width_;
if (height != NULL) *height = wpi->height_; if (height != NULL) *height = wpi->height_;
return 1; return WEBP_MUX_OK;
} }
static WebPMuxError GetImageCanvasWidthHeight( static WebPMuxError GetImageCanvasWidthHeight(

View File

@ -70,7 +70,7 @@ WebPChunk* ChunkRelease(WebPChunk* const chunk) {
CHUNK_INDEX ChunkGetIndexFromTag(uint32_t tag) { CHUNK_INDEX ChunkGetIndexFromTag(uint32_t tag) {
int i; int i;
for (i = 0; kChunks[i].tag != NIL_TAG; ++i) { for (i = 0; kChunks[i].tag != NIL_TAG; ++i) {
if (tag == kChunks[i].tag) return i; if (tag == kChunks[i].tag) return (CHUNK_INDEX)i;
} }
return IDX_UNKNOWN; return IDX_UNKNOWN;
} }
@ -451,7 +451,7 @@ static int IsNotCompatible(int feature, int num_items) {
// On success returns WEBP_MUX_OK and stores the chunk count in *num. // On success returns WEBP_MUX_OK and stores the chunk count in *num.
static WebPMuxError ValidateChunk(const WebPMux* const mux, CHUNK_INDEX idx, static WebPMuxError ValidateChunk(const WebPMux* const mux, CHUNK_INDEX idx,
WebPFeatureFlags feature, WebPFeatureFlags feature,
WebPFeatureFlags vp8x_flags, uint32_t vp8x_flags,
int max, int* num) { int max, int* num) {
const WebPMuxError err = const WebPMuxError err =
WebPMuxNumChunks(mux, kChunks[idx].id, num); WebPMuxNumChunks(mux, kChunks[idx].id, num);

View File

@ -505,7 +505,7 @@ WebPMuxError WebPMuxGetAnimationParams(const WebPMux* mux,
static CHUNK_INDEX ChunkGetIndexFromId(WebPChunkId id) { static CHUNK_INDEX ChunkGetIndexFromId(WebPChunkId id) {
int i; int i;
for (i = 0; kChunks[i].id != WEBP_CHUNK_NIL; ++i) { for (i = 0; kChunks[i].id != WEBP_CHUNK_NIL; ++i) {
if (id == kChunks[i].id) return i; if (id == kChunks[i].id) return (CHUNK_INDEX)i;
} }
return IDX_NIL; return IDX_NIL;
} }