Remove casting of return value from *alloc() functions.

This commit is contained in:
Erik de Castro Lopo
2012-04-04 21:29:25 +10:00
parent afedee1251
commit 6c2040dc90
25 changed files with 130 additions and 130 deletions

View File

@@ -85,7 +85,7 @@ char* FLAC_plugin__charset_convert_string (const char *string, char *from, char
outsize = ((length + 3) & ~3) + 1;
if(outsize < length) /* overflow check */
return NULL;
out = (char*)malloc(outsize);
out = malloc(outsize);
outleft = outsize - 1;
outptr = out;

View File

@@ -128,7 +128,7 @@ static FLAC__uint16 *local__convert_utf8_to_ucs2(const char *src, unsigned lengt
}
/* allocate */
out = (FLAC__uint16*)safe_malloc_mul_2op_(chars, /*times*/sizeof(FLAC__uint16));
out = safe_malloc_mul_2op_(chars, /*times*/sizeof(FLAC__uint16));
if (0 == out) {
FLAC__ASSERT(0);
return 0;
@@ -193,7 +193,7 @@ static char *local__convert_ucs2_to_utf8(const FLAC__uint16 *src, unsigned lengt
}
/* allocate */
out = (char*)safe_malloc_mul_2op_(len, /*times*/sizeof(char));
out = safe_malloc_mul_2op_(len, /*times*/sizeof(char));
if (0 == out)
return 0;
@@ -316,7 +316,7 @@ FLAC__bool FLAC_plugin__tags_add_tag_utf8(FLAC__StreamMetadata *tags, const char
const size_t value_len = strlen(value);
const size_t separator_len = strlen(separator);
FLAC__byte *new_entry;
if(0 == (new_entry = (FLAC__byte*)safe_realloc_add_4op_(entry->entry, entry->length, /*+*/value_len, /*+*/separator_len, /*+*/1)))
if(0 == (new_entry = safe_realloc_add_4op_(entry->entry, entry->length, /*+*/value_len, /*+*/separator_len, /*+*/1)))
return false;
memcpy(new_entry+entry->length, separator, separator_len);
entry->length += separator_len;