mux: cosmetics

add a few missing consts and remove an unnecessary cast

Change-Id: I396571090ce379bbc7a173cbc90714a6b7b52a2a
This commit is contained in:
James Zern 2012-02-23 13:21:43 -08:00
parent cb5810dfbe
commit dc17abdcb6

View File

@ -165,7 +165,7 @@ WebPMux* WebPMuxCreate(const uint8_t* data, uint32_t size, int copy_data,
if (wpi->is_partial_) goto Err; // Encountered a non-image chunk before if (wpi->is_partial_) goto Err; // Encountered a non-image chunk before
// getting all chunks of an image. // getting all chunks of an image.
chunk_list = GetChunkListFromId(mux, id); // List for adding this chunk. chunk_list = GetChunkListFromId(mux, id); // List for adding this chunk.
if (chunk_list == NULL) chunk_list = (WebPChunk**)&mux->unknown_; if (chunk_list == NULL) chunk_list = &mux->unknown_;
if (ChunkSetNth(&chunk, chunk_list, 0) != WEBP_MUX_OK) goto Err; if (ChunkSetNth(&chunk, chunk_list, 0) != WEBP_MUX_OK) goto Err;
} }
@ -356,9 +356,9 @@ WebPMuxError WebPMuxGetTile(const WebPMux* const mux, uint32_t nth,
// Count number of chunks matching 'tag' in the 'chunk_list'. // Count number of chunks matching 'tag' in the 'chunk_list'.
// If tag == NIL_TAG, any tag will be matched. // If tag == NIL_TAG, any tag will be matched.
static int CountChunks(WebPChunk* const chunk_list, uint32_t tag) { static int CountChunks(const WebPChunk* const chunk_list, uint32_t tag) {
int count = 0; int count = 0;
WebPChunk* current; const WebPChunk* current;
for (current = chunk_list; current != NULL; current = current->next_) { for (current = chunk_list; current != NULL; current = current->next_) {
if (tag == NIL_TAG || current->tag_ == tag) { if (tag == NIL_TAG || current->tag_ == tag) {
count++; // Count chunks whose tags match. count++; // Count chunks whose tags match.
@ -378,7 +378,7 @@ WebPMuxError WebPMuxNumNamedElements(const WebPMux* const mux, const char* tag,
if (IsWPI(id)) { if (IsWPI(id)) {
*num_elements = MuxImageCount(mux->images_, id); *num_elements = MuxImageCount(mux->images_, id);
} else { } else {
WebPChunk** chunk_list = GetChunkListFromId(mux, id); WebPChunk* const* chunk_list = GetChunkListFromId(mux, id);
if (chunk_list == NULL) { if (chunk_list == NULL) {
*num_elements = 0; *num_elements = 0;
} else { } else {