diff options
author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2008-04-30 01:12:20 +0100 |
---|---|---|
committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2008-04-30 01:12:20 +0100 |
commit | bdcbdde85d5ae6e8f415442d5c28251a4aad8088 (patch) | |
tree | b7fb5832b71a7178294c0e3874dfc07536f978aa | |
parent | ce9af0fefb2cd0dd5fe5743dcca12f17eedd1ce5 (diff) | |
download | xine-lib-bdcbdde85d5ae6e8f415442d5c28251a4aad8088.tar.gz xine-lib-bdcbdde85d5ae6e8f415442d5c28251a4aad8088.tar.bz2 |
Replace calloc (n, sizeof (char)) with malloc (n) where zero init isn't needed.
-rw-r--r-- | src/demuxers/demux_real.c | 6 | ||||
-rw-r--r-- | src/input/libreal/real.c | 2 | ||||
-rw-r--r-- | src/input/libreal/rmff.c | 16 | ||||
-rw-r--r-- | src/input/libreal/sdpplin.c | 2 |
4 files changed, 13 insertions, 13 deletions
diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c index 5a20ac92b..6a1d24dba 100644 --- a/src/demuxers/demux_real.c +++ b/src/demuxers/demux_real.c @@ -284,17 +284,17 @@ static mdpr_t *real_parse_mdpr(const char *data) { mdpr->duration=_X_BE_32(&data[28]); mdpr->stream_name_size=data[32]; - mdpr->stream_name=calloc(mdpr->stream_name_size+1, sizeof(char)); + mdpr->stream_name=malloc(mdpr->stream_name_size+1); memcpy(mdpr->stream_name, &data[33], mdpr->stream_name_size); mdpr->stream_name[(int)mdpr->stream_name_size]=0; mdpr->mime_type_size=data[33+mdpr->stream_name_size]; - mdpr->mime_type=calloc(mdpr->mime_type_size+1, sizeof(char)); + mdpr->mime_type=malloc(mdpr->mime_type_size+1); memcpy(mdpr->mime_type, &data[34+mdpr->stream_name_size], mdpr->mime_type_size); mdpr->mime_type[(int)mdpr->mime_type_size]=0; mdpr->type_specific_len=_X_BE_32(&data[34+mdpr->stream_name_size+mdpr->mime_type_size]); - mdpr->type_specific_data=calloc(mdpr->type_specific_len, sizeof(char)); + mdpr->type_specific_data=malloc(mdpr->type_specific_len); memcpy(mdpr->type_specific_data, &data[38+mdpr->stream_name_size+mdpr->mime_type_size], mdpr->type_specific_len); diff --git a/src/input/libreal/real.c b/src/input/libreal/real.c index 472120895..fecf9a794 100644 --- a/src/input/libreal/real.c +++ b/src/input/libreal/real.c @@ -660,7 +660,7 @@ rmff_header_t *real_setup_and_get_header(rtsp_t *rtsp_session, uint32_t bandwid lprintf("Stream description size: %i\n", size); - description = calloc(size+1, sizeof(char)); + description = malloc(size+1); if( rtsp_read_data(rtsp_session, description, size) <= 0) { xine_buffer_free(buf); diff --git a/src/input/libreal/rmff.c b/src/input/libreal/rmff.c index 05f914782..41f85d3ae 100644 --- a/src/input/libreal/rmff.c +++ b/src/input/libreal/rmff.c @@ -351,17 +351,17 @@ static rmff_mdpr_t *rmff_scan_mdpr(const char *data) { mdpr->duration=_X_BE_32(&data[36]); mdpr->stream_name_size=data[40]; - mdpr->stream_name = calloc(mdpr->stream_name_size+1, sizeof(char)); + mdpr->stream_name = malloc(mdpr->stream_name_size+1); memcpy(mdpr->stream_name, &data[41], mdpr->stream_name_size); mdpr->stream_name[mdpr->stream_name_size]=0; mdpr->mime_type_size=data[41+mdpr->stream_name_size]; - mdpr->mime_type = calloc(mdpr->mime_type_size+1, sizeof(char)); + mdpr->mime_type = malloc(mdpr->mime_type_size+1); memcpy(mdpr->mime_type, &data[42+mdpr->stream_name_size], mdpr->mime_type_size); mdpr->mime_type[mdpr->mime_type_size]=0; mdpr->type_specific_len=_X_BE_32(&data[42+mdpr->stream_name_size+mdpr->mime_type_size]); - mdpr->type_specific_data = calloc(mdpr->type_specific_len, sizeof(char)); + mdpr->type_specific_data = malloc(mdpr->type_specific_len); memcpy(mdpr->type_specific_data, &data[46+mdpr->stream_name_size+mdpr->mime_type_size], mdpr->type_specific_len); @@ -381,22 +381,22 @@ static rmff_cont_t *rmff_scan_cont(const char *data) { lprintf("warning: unknown object version in CONT: 0x%04x\n", cont->object_version); } cont->title_len=_X_BE_16(&data[10]); - cont->title = calloc((cont->title_len+1), sizeof(char)); + cont->title = malloc(cont->title_len+1); memcpy(cont->title, &data[12], cont->title_len); cont->title[cont->title_len]=0; pos=cont->title_len+12; cont->author_len=_X_BE_16(&data[pos]); - cont->author = calloc(cont->author_len+1, sizeof(char)); + cont->author = malloc(cont->author_len+1); memcpy(cont->author, &data[pos+2], cont->author_len); cont->author[cont->author_len]=0; pos=pos+2+cont->author_len; cont->copyright_len=_X_BE_16(&data[pos]); - cont->copyright = calloc(cont->copyright_len+1, sizeof(char)); + cont->copyright = malloc(cont->copyright_len+1); memcpy(cont->copyright, &data[pos+2], cont->copyright_len); cont->copyright[cont->copyright_len]=0; pos=pos+2+cont->copyright_len; cont->comment_len=_X_BE_16(&data[pos]); - cont->comment = calloc(cont->comment_len+1, sizeof(char)); + cont->comment = malloc(cont->comment_len+1); memcpy(cont->comment, &data[pos+2], cont->comment_len); cont->comment[cont->comment_len]=0; @@ -624,7 +624,7 @@ rmff_mdpr_t *rmff_new_mdpr( mdpr->mime_type_size=strlen(mime_type); } mdpr->type_specific_len=type_specific_len; - mdpr->type_specific_data = calloc(type_specific_len, sizeof(char)); + mdpr->type_specific_data = malloc(type_specific_len); memcpy(mdpr->type_specific_data,type_specific_data,type_specific_len); mdpr->mlti_data=NULL; diff --git a/src/input/libreal/sdpplin.c b/src/input/libreal/sdpplin.c index 04554c45e..9117d15a5 100644 --- a/src/input/libreal/sdpplin.c +++ b/src/input/libreal/sdpplin.c @@ -206,7 +206,7 @@ static sdpplin_stream_t *sdpplin_parse_stream(char **data) { if(filter(*data,"a=OpaqueData:buffer;",&buf)) { decoded = b64_decode(buf, decoded, &(desc->mlti_data_size)); if ( decoded != NULL ) { - desc->mlti_data = calloc(desc->mlti_data_size, sizeof(char)); + desc->mlti_data = malloc(desc->mlti_data_size); memcpy(desc->mlti_data, decoded, desc->mlti_data_size); handled=1; *data=nl(*data); |