if(option_values.num_files > 0) {
unsigned i = 0;
- if(0 == (option_values.filenames = malloc(sizeof(char *) * option_values.num_files)))
+ if(0 == (option_values.filenames = (char**)malloc(sizeof(char*) * option_values.num_files)))
die("out of memory allocating space for file names list");
while(share__optind < argc)
option_values.filenames[i++] = local_strdup(argv[share__optind++]);
const size_t nn = strlen(field_name);
const size_t nv = strlen(field_value);
entry->length = nn + 1 /*=*/ + nv;
- if(0 == (entry->entry = malloc(entry->length+1)))
+ if(0 == (entry->entry = (FLAC__byte*)malloc(entry->length+1)))
return false;
memcpy(entry->entry, field_name, nn);
entry->entry[nn] = '=';
FLAC__ASSERT(0 != eq);
if(0 == eq)
return false; /* double protection */
- if(0 == (*field_name = malloc(nn+1)))
+ if(0 == (*field_name = (char*)malloc(nn+1)))
return false;
- if(0 == (*field_value = malloc(nv+1))) {
+ if(0 == (*field_value = (char*)malloc(nv+1))) {
free(*field_name);
return false;
}
}
/* allocate space for the page header */
- if(0 == (page->header = malloc(OGG_MAX_HEADER_LEN))) {
+ if(0 == (page->header = (unsigned char *)malloc(OGG_MAX_HEADER_LEN))) {
encoder->protected_->state = OggFLAC__SEEKABLE_STREAM_ENCODER_MEMORY_ALLOCATION_ERROR;
return false;
}
}
/* allocate space for the page body */
- if(0 == (page->body = malloc(page->body_len))) {
+ if(0 == (page->body = (unsigned char *)malloc(page->body_len))) {
encoder->protected_->state = OggFLAC__SEEKABLE_STREAM_ENCODER_MEMORY_ALLOCATION_ERROR;
return false;
}
/* Due to a GLIBC bug, round outbuf_size up to a multiple of 4 */
/* + 1 for nul in case len == 1 */
outsize = ((length + 3) & ~3) + 1;
- out = malloc(outsize);
+ out = (char*)malloc(outsize);
outleft = outsize - 1;
outptr = out;
const size_t value_len = strlen(value);
const size_t separator_len = strlen(separator);
FLAC__byte *new_entry;
- if(0 == (new_entry = realloc(entry->entry, entry->length + value_len + separator_len + 1)))
+ if(0 == (new_entry = (FLAC__byte*)realloc(entry->entry, entry->length + value_len + separator_len + 1)))
return false;
memcpy(new_entry+entry->length, separator, separator_len);
entry->length += separator_len;
\r
len = strlen(src) + 1;\r
/* copy */\r
- dest = malloc(len*sizeof(wchar_t));\r
+ dest = (wchar_t*)malloc(len*sizeof(wchar_t));\r
if (dest) mbstowcs(dest, src, len);\r
return dest;\r
}\r