1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-25 04:38:01 +00:00

rm unnecesary casts from void* - part 3

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18884 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reynaldo 2006-07-02 08:17:07 +00:00
parent 9d9a15d185
commit 3afd65b3af
18 changed files with 73 additions and 73 deletions

View File

@ -72,7 +72,7 @@ static int init(sh_audio_t *sh)
}
/// Init the decoder with the 3 header packets
ov = (struct ov_struct_st*)malloc(sizeof(struct ov_struct_st));
ov = malloc(sizeof(struct ov_struct_st));
vorbis_info_init(&ov->vi);
vorbis_comment_init(&vc);

View File

@ -203,7 +203,7 @@ static int check_clip(void *buf, int len) {
static int control(sh_audio_t *sh, int cmd, void* arg, ...) {
if (cmd == ADCTRL_RESYNC_STREAM) {
unsigned char *buf = (unsigned char *)malloc(MAX_FRAMESIZE);
unsigned char *buf = malloc(MAX_FRAMESIZE);
int i;
int nr_ok = 0;
for (i = 0; i < MAX_SEEK_DISCARD; i++) {

View File

@ -36,7 +36,7 @@ static int preinit(sh_audio_t *sh) {
}
static int init(sh_audio_t *sh) {
context_t *ctx = (context_t *)calloc(1, sizeof(context_t));
context_t *ctx = calloc(1, sizeof(context_t));
const SpeexMode *spx_mode;
const SpeexStereoState st_st = SPEEX_STEREO_STATE_INIT; // hack
if (!sh->wf || sh->wf->cbSize < 80) {

View File

@ -290,7 +290,7 @@ int init_audio_filters(sh_audio_t *sh_audio,
int out_minsize, int out_maxsize){
af_stream_t* afs=sh_audio->afilter;
if(!afs){
afs = (af_stream_t*)malloc(sizeof(af_stream_t));
afs = malloc(sizeof(af_stream_t));
memset(afs,0,sizeof(af_stream_t));
}

View File

@ -383,7 +383,7 @@ static int init(sh_video_t *sh){
/* Pass palette to codec */
#if LIBAVCODEC_BUILD >= 4689
if (sh->bih && (sh->bih->biBitCount <= 8)) {
avctx->palctrl = (AVPaletteControl*)calloc(1,sizeof(AVPaletteControl));
avctx->palctrl = calloc(1,sizeof(AVPaletteControl));
avctx->palctrl->palette_changed = 1;
if (sh->bih->biSize-sizeof(BITMAPINFOHEADER))
/* Palette size in biSize */

View File

@ -135,7 +135,7 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
if(!mpi) return NULL;
// Let's DECODE!
row_p=(png_bytep*)malloc( sizeof( png_bytep ) * png_height );
row_p=malloc( sizeof( png_bytep ) * png_height );
//png_get_rowbytes( png,info )
for ( i=0; i < png_height; i++ ) row_p[i]=mpi->planes[0] + mpi->stride[0]*i;
png_read_image( png,row_p );

View File

@ -64,7 +64,7 @@ static int init(sh_video_t *sh){
/* this is not a loop, just a context, from which we can break on error */
do
{
context = (theora_struct_t *)calloc (sizeof (theora_struct_t), 1);
context = calloc (sizeof (theora_struct_t), 1);
sh->context = context;
if (!context)
break;

View File

@ -152,7 +152,7 @@ static int init(sh_video_t *sh){
return 0;
}
p = (priv_t*)malloc(sizeof(priv_t));
p = malloc(sizeof(priv_t));
p->cs = cs;
p->hdl = dec_p.handle;
sh->context = p;

View File

@ -174,7 +174,7 @@ static int init(sh_video_t *sh)
return(0);
}
p = (priv_t*)malloc(sizeof(priv_t));
p = malloc(sizeof(priv_t));
p->cs = cs;
p->hdl = dec_p.handle;
p->vo_initialized = 0;

View File

@ -217,7 +217,7 @@ static int vf_open(vf_instance_t *vf, char* args){
vf->priv->lzo = 0;
}
vf->priv->zbuffer = (lzo_bytep)malloc(FRAMEHEADERSIZE + LZO_OUT_LEN);
vf->priv->zmem = (long*)malloc(sizeof(long)*LZO_AL(LZO1X_1_MEM_COMPRESS));
vf->priv->zmem = malloc(sizeof(long)*LZO_AL(LZO1X_1_MEM_COMPRESS));
}
return 1;

View File

@ -87,7 +87,7 @@ static void write_png(char *fname, unsigned char *buffer, int width, int height,
png_set_bgr(png_ptr);
row_pointers = (png_byte**)malloc(height*sizeof(png_byte*));
row_pointers = malloc(height*sizeof(png_byte*));
for (k = 0; k < height; k++) {
unsigned char* s=buffer + stride*k;
row_pointers[k] = s;

View File

@ -111,7 +111,7 @@ static void scast_meta_read(int fd, streaming_ctrl_t *sc) {
my_read(fd, &tmp, 1, sc);
metalen = tmp * 16;
if (metalen > 0) {
char *info = (char *)malloc(metalen + 1);
char *info = malloc(metalen + 1);
unsigned nlen = my_read(fd, info, metalen, sc);
info[nlen] = 0;
mp_msg(MSGT_DEMUXER, MSGL_INFO, "\nICY Info: %s\n", info);
@ -282,7 +282,7 @@ HTTP_header_t *
http_new_header(void) {
HTTP_header_t *http_hdr;
http_hdr = (HTTP_header_t*)malloc(sizeof(HTTP_header_t));
http_hdr = malloc(sizeof(HTTP_header_t));
if( http_hdr==NULL ) return NULL;
memset( http_hdr, 0, sizeof(HTTP_header_t) );
@ -356,7 +356,7 @@ http_response_parse( HTTP_header_t *http_hdr ) {
return -1;
}
len = hdr_ptr-http_hdr->buffer;
http_hdr->protocol = (char*)malloc(len+1);
http_hdr->protocol = malloc(len+1);
if( http_hdr->protocol==NULL ) {
mp_msg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed\n");
return -1;
@ -384,7 +384,7 @@ http_response_parse( HTTP_header_t *http_hdr ) {
return -1;
}
len = ptr-hdr_ptr;
http_hdr->reason_phrase = (char*)malloc(len+1);
http_hdr->reason_phrase = malloc(len+1);
if( http_hdr->reason_phrase==NULL ) {
mp_msg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed\n");
return -1;
@ -448,7 +448,7 @@ http_build_request( HTTP_header_t *http_hdr ) {
if( http_hdr->method==NULL ) http_set_method( http_hdr, "GET");
if( http_hdr->uri==NULL ) http_set_uri( http_hdr, "/");
else {
uri = (char*)malloc(strlen(http_hdr->uri) + 1);
uri = malloc(strlen(http_hdr->uri) + 1);
if( uri==NULL ) {
mp_msg(MSGT_NETWORK,MSGL_ERR,"Memory allocation failed\n");
return NULL;
@ -476,7 +476,7 @@ http_build_request( HTTP_header_t *http_hdr ) {
free( http_hdr->buffer );
http_hdr->buffer = NULL;
}
http_hdr->buffer = (char*)malloc(len+1);
http_hdr->buffer = malloc(len+1);
if( http_hdr->buffer==NULL ) {
mp_msg(MSGT_NETWORK,MSGL_ERR,"Memory allocation failed\n");
return NULL;
@ -542,13 +542,13 @@ http_set_field( HTTP_header_t *http_hdr, const char *field_name ) {
HTTP_field_t *new_field;
if( http_hdr==NULL || field_name==NULL ) return;
new_field = (HTTP_field_t*)malloc(sizeof(HTTP_field_t));
new_field = malloc(sizeof(HTTP_field_t));
if( new_field==NULL ) {
mp_msg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed\n");
return;
}
new_field->next = NULL;
new_field->field_name = (char*)malloc(strlen(field_name)+1);
new_field->field_name = malloc(strlen(field_name)+1);
if( new_field->field_name==NULL ) {
mp_msg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed\n");
return;
@ -568,7 +568,7 @@ void
http_set_method( HTTP_header_t *http_hdr, const char *method ) {
if( http_hdr==NULL || method==NULL ) return;
http_hdr->method = (char*)malloc(strlen(method)+1);
http_hdr->method = malloc(strlen(method)+1);
if( http_hdr->method==NULL ) {
mp_msg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed\n");
return;
@ -580,7 +580,7 @@ void
http_set_uri( HTTP_header_t *http_hdr, const char *uri ) {
if( http_hdr==NULL || uri==NULL ) return;
http_hdr->uri = (char*)malloc(strlen(uri)+1);
http_hdr->uri = malloc(strlen(uri)+1);
if( http_hdr->uri==NULL ) {
mp_msg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed\n");
return;
@ -599,7 +599,7 @@ http_add_basic_authentication( HTTP_header_t *http_hdr, const char *username, co
pass_len = strlen(password);
}
usr_pass = (char*)malloc(strlen(username)+pass_len+2);
usr_pass = malloc(strlen(username)+pass_len+2);
if( usr_pass==NULL ) {
mp_msg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed\n");
goto out;
@ -609,7 +609,7 @@ http_add_basic_authentication( HTTP_header_t *http_hdr, const char *username, co
// Base 64 encode with at least 33% more data than the original size
encoded_len = strlen(usr_pass)*2;
b64_usr_pass = (char*)malloc(encoded_len);
b64_usr_pass = malloc(encoded_len);
if( b64_usr_pass==NULL ) {
mp_msg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed\n");
goto out;
@ -623,7 +623,7 @@ http_add_basic_authentication( HTTP_header_t *http_hdr, const char *username, co
b64_usr_pass[out_len]='\0';
auth = (char*)malloc(encoded_len+22);
auth = malloc(encoded_len+22);
if( auth==NULL ) {
mp_msg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed\n");
goto out;

View File

@ -40,7 +40,7 @@ url_new(const char* url) {
}
// Create the URL container
Curl = (URL_t*)malloc(sizeof(URL_t));
Curl = malloc(sizeof(URL_t));
if( Curl==NULL ) {
mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
goto err_out;
@ -72,7 +72,7 @@ url_new(const char* url) {
}
}
pos1 = ptr1-escfilename;
Curl->protocol = (char*)malloc(pos1+1);
Curl->protocol = malloc(pos1+1);
if( Curl->protocol==NULL ) {
mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
goto err_out;
@ -94,7 +94,7 @@ url_new(const char* url) {
if( ptr2!=NULL ) {
// We got something, at least a username...
int len = ptr2-ptr1;
Curl->username = (char*)malloc(len+1);
Curl->username = malloc(len+1);
if( Curl->username==NULL ) {
mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
goto err_out;
@ -107,7 +107,7 @@ url_new(const char* url) {
// We also have a password
int len2 = ptr2-ptr3-1;
Curl->username[ptr3-ptr1]='\0';
Curl->password = (char*)malloc(len2+1);
Curl->password = malloc(len2+1);
if( Curl->password==NULL ) {
mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
goto err_out;
@ -159,7 +159,7 @@ url_new(const char* url) {
}
if( v6addr ) pos2--;
// copy the hostname in the URL container
Curl->hostname = (char*)malloc(pos2-pos1+1);
Curl->hostname = malloc(pos2-pos1+1);
if( Curl->hostname==NULL ) {
mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
goto err_out;
@ -183,7 +183,7 @@ url_new(const char* url) {
}
// Check if a filename was given or set, else set it with '/'
if( Curl->file==NULL ) {
Curl->file = (char*)malloc(2);
Curl->file = malloc(2);
if( Curl->file==NULL ) {
mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
goto err_out;

View File

@ -97,7 +97,7 @@ static inline int DVDFileSeek_( dvd_file_t *dvd_file, uint32_t offset ) {
ifo_handle_t *ifoOpen(dvd_reader_t *dvd, int title) {
ifo_handle_t *ifofile;
ifofile = (ifo_handle_t *)malloc(sizeof(ifo_handle_t));
ifofile = malloc(sizeof(ifo_handle_t));
if(!ifofile)
return 0;
@ -182,7 +182,7 @@ ifo_handle_t *ifoOpen(dvd_reader_t *dvd, int title) {
ifo_handle_t *ifoOpenVMGI(dvd_reader_t *dvd) {
ifo_handle_t *ifofile;
ifofile = (ifo_handle_t *)malloc(sizeof(ifo_handle_t));
ifofile = malloc(sizeof(ifo_handle_t));
if(!ifofile)
return 0;
@ -209,7 +209,7 @@ ifo_handle_t *ifoOpenVMGI(dvd_reader_t *dvd) {
ifo_handle_t *ifoOpenVTSI(dvd_reader_t *dvd, int title) {
ifo_handle_t *ifofile;
ifofile = (ifo_handle_t *)malloc(sizeof(ifo_handle_t));
ifofile = malloc(sizeof(ifo_handle_t));
if(!ifofile)
return 0;
@ -274,7 +274,7 @@ void ifoClose(ifo_handle_t *ifofile) {
static int ifoRead_VMG(ifo_handle_t *ifofile) {
vmgi_mat_t *vmgi_mat;
vmgi_mat = (vmgi_mat_t *)malloc(sizeof(vmgi_mat_t));
vmgi_mat = malloc(sizeof(vmgi_mat_t));
if(!vmgi_mat)
return 0;
@ -365,7 +365,7 @@ static int ifoRead_VTS(ifo_handle_t *ifofile) {
vtsi_mat_t *vtsi_mat;
int i;
vtsi_mat = (vtsi_mat_t *)malloc(sizeof(vtsi_mat_t));
vtsi_mat = malloc(sizeof(vtsi_mat_t));
if(!vtsi_mat)
return 0;
@ -493,7 +493,7 @@ static int ifoRead_PGC_COMMAND_TBL(ifo_handle_t *ifofile,
if(cmd_tbl->nr_of_pre != 0) {
unsigned int pre_cmds_size = cmd_tbl->nr_of_pre * COMMAND_DATA_SIZE;
cmd_tbl->pre_cmds = (vm_cmd_t *)malloc(pre_cmds_size);
cmd_tbl->pre_cmds = malloc(pre_cmds_size);
if(!cmd_tbl->pre_cmds)
return 0;
@ -505,7 +505,7 @@ static int ifoRead_PGC_COMMAND_TBL(ifo_handle_t *ifofile,
if(cmd_tbl->nr_of_post != 0) {
unsigned int post_cmds_size = cmd_tbl->nr_of_post * COMMAND_DATA_SIZE;
cmd_tbl->post_cmds = (vm_cmd_t *)malloc(post_cmds_size);
cmd_tbl->post_cmds = malloc(post_cmds_size);
if(!cmd_tbl->post_cmds) {
if(cmd_tbl->pre_cmds)
free(cmd_tbl->pre_cmds);
@ -521,7 +521,7 @@ static int ifoRead_PGC_COMMAND_TBL(ifo_handle_t *ifofile,
if(cmd_tbl->nr_of_cell != 0) {
unsigned int cell_cmds_size = cmd_tbl->nr_of_cell * COMMAND_DATA_SIZE;
cmd_tbl->cell_cmds = (vm_cmd_t *)malloc(cell_cmds_size);
cmd_tbl->cell_cmds = malloc(cell_cmds_size);
if(!cmd_tbl->cell_cmds) {
if(cmd_tbl->pre_cmds)
free(cmd_tbl->pre_cmds);
@ -748,7 +748,7 @@ int ifoRead_FP_PGC(ifo_handle_t *ifofile) {
if(ifofile->vmgi_mat->first_play_pgc == 0)
return 1;
ifofile->first_play_pgc = (pgc_t *)malloc(sizeof(pgc_t));
ifofile->first_play_pgc = malloc(sizeof(pgc_t));
if(!ifofile->first_play_pgc)
return 0;
@ -802,7 +802,7 @@ int ifoRead_TT_SRPT(ifo_handle_t *ifofile) {
if(!DVDFileSeek_(ifofile->file, ifofile->vmgi_mat->tt_srpt * DVD_BLOCK_LEN))
return 0;
tt_srpt = (tt_srpt_t *)malloc(sizeof(tt_srpt_t));
tt_srpt = malloc(sizeof(tt_srpt_t));
if(!tt_srpt)
return 0;
@ -819,7 +819,7 @@ int ifoRead_TT_SRPT(ifo_handle_t *ifofile) {
info_length = tt_srpt->last_byte + 1 - TT_SRPT_SIZE;
tt_srpt->title = (title_info_t *)malloc(info_length);
tt_srpt->title = malloc(info_length);
if(!tt_srpt->title) {
free(tt_srpt);
ifofile->tt_srpt = 0;
@ -904,7 +904,7 @@ int ifoRead_VTS_PTT_SRPT(ifo_handle_t *ifofile) {
ifofile->vtsi_mat->vts_ptt_srpt * DVD_BLOCK_LEN))
return 0;
vts_ptt_srpt = (vts_ptt_srpt_t *)malloc(sizeof(vts_ptt_srpt_t));
vts_ptt_srpt = malloc(sizeof(vts_ptt_srpt_t));
if(!vts_ptt_srpt)
return 0;
@ -925,7 +925,7 @@ int ifoRead_VTS_PTT_SRPT(ifo_handle_t *ifofile) {
info_length = vts_ptt_srpt->last_byte + 1 - VTS_PTT_SRPT_SIZE;
data = (uint32_t *)malloc(info_length);
data = malloc(info_length);
if(!data) {
free(vts_ptt_srpt);
ifofile->vts_ptt_srpt = 0;
@ -1043,7 +1043,7 @@ int ifoRead_PTL_MAIT(ifo_handle_t *ifofile) {
if(!DVDFileSeek_(ifofile->file, ifofile->vmgi_mat->ptl_mait * DVD_BLOCK_LEN))
return 0;
ptl_mait = (ptl_mait_t *)malloc(sizeof(ptl_mait_t));
ptl_mait = malloc(sizeof(ptl_mait_t));
if(!ptl_mait)
return 0;
@ -1067,7 +1067,7 @@ int ifoRead_PTL_MAIT(ifo_handle_t *ifofile) {
<= ptl_mait->last_byte + 1 - PTL_MAIT_SIZE);
info_length = ptl_mait->nr_of_countries * sizeof(ptl_mait_country_t);
ptl_mait->countries = (ptl_mait_country_t *)malloc(info_length);
ptl_mait->countries = malloc(info_length);
if(!ptl_mait->countries) {
free(ptl_mait);
ifofile->ptl_mait = 0;
@ -1108,7 +1108,7 @@ int ifoRead_PTL_MAIT(ifo_handle_t *ifofile) {
return 0;
}
info_length = (ptl_mait->nr_of_vtss + 1) * sizeof(pf_level_t);
pf_temp = (uint16_t *)malloc(info_length);
pf_temp = malloc(info_length);
if(!pf_temp) {
for(j = 0; j < i ; j++) {
free(ptl_mait->countries[j].pf_ptl_mai);
@ -1130,7 +1130,7 @@ int ifoRead_PTL_MAIT(ifo_handle_t *ifofile) {
for (j = 0; j < ((ptl_mait->nr_of_vtss + 1) * 8); j++) {
B2N_16(pf_temp[j]);
}
ptl_mait->countries[i].pf_ptl_mai = (pf_level_t *)malloc(info_length);
ptl_mait->countries[i].pf_ptl_mai = malloc(info_length);
if(!ptl_mait->countries[i].pf_ptl_mai) {
free(pf_temp);
for(j = 0; j < i ; j++) {
@ -1194,7 +1194,7 @@ int ifoRead_VTS_TMAPT(ifo_handle_t *ifofile) {
if(!DVDFileSeek_(ifofile->file, offset))
return 0;
vts_tmapt = (vts_tmapt_t *)malloc(sizeof(vts_tmapt_t));
vts_tmapt = malloc(sizeof(vts_tmapt_t));
if(!vts_tmapt)
return 0;
@ -1214,7 +1214,7 @@ int ifoRead_VTS_TMAPT(ifo_handle_t *ifofile) {
info_length = vts_tmapt->nr_of_tmaps * 4;
vts_tmap_srp = (uint32_t *)malloc(info_length);
vts_tmap_srp = malloc(info_length);
if(!vts_tmap_srp) {
free(vts_tmapt);
ifofile->vts_tmapt = NULL;
@ -1238,7 +1238,7 @@ int ifoRead_VTS_TMAPT(ifo_handle_t *ifofile) {
info_length = vts_tmapt->nr_of_tmaps * sizeof(vts_tmap_t);
vts_tmapt->tmap = (vts_tmap_t *)malloc(info_length);
vts_tmapt->tmap = malloc(info_length);
if(!vts_tmapt->tmap) {
free(vts_tmap_srp);
free(vts_tmapt);
@ -1270,7 +1270,7 @@ int ifoRead_VTS_TMAPT(ifo_handle_t *ifofile) {
info_length = vts_tmapt->tmap[i].nr_of_entries * sizeof(map_ent_t);
vts_tmapt->tmap[i].map_ent = (map_ent_t *)malloc(info_length);
vts_tmapt->tmap[i].map_ent = malloc(info_length);
if(!vts_tmapt->tmap[i].map_ent) {
ifoFree_VTS_TMAPT(ifofile);
return 0;
@ -1318,7 +1318,7 @@ int ifoRead_TITLE_C_ADT(ifo_handle_t *ifofile) {
if(ifofile->vtsi_mat->vts_c_adt == 0) /* mandatory */
return 0;
ifofile->vts_c_adt = (c_adt_t *)malloc(sizeof(c_adt_t));
ifofile->vts_c_adt = malloc(sizeof(c_adt_t));
if(!ifofile->vts_c_adt)
return 0;
@ -1350,7 +1350,7 @@ int ifoRead_C_ADT(ifo_handle_t *ifofile) {
return 0;
}
ifofile->menu_c_adt = (c_adt_t *)malloc(sizeof(c_adt_t));
ifofile->menu_c_adt = malloc(sizeof(c_adt_t));
if(!ifofile->menu_c_adt)
return 0;
@ -1392,7 +1392,7 @@ static int ifoRead_C_ADT_internal(ifo_handle_t *ifofile,
c_adt->nr_of_vobs = info_length / sizeof(cell_adr_t);
}
c_adt->cell_adr_table = (cell_adr_t *)malloc(info_length);
c_adt->cell_adr_table = malloc(info_length);
if(!c_adt->cell_adr_table)
return 0;
@ -1452,7 +1452,7 @@ int ifoRead_TITLE_VOBU_ADMAP(ifo_handle_t *ifofile) {
if(ifofile->vtsi_mat->vts_vobu_admap == 0) /* mandatory */
return 0;
ifofile->vts_vobu_admap = (vobu_admap_t *)malloc(sizeof(vobu_admap_t));
ifofile->vts_vobu_admap = malloc(sizeof(vobu_admap_t));
if(!ifofile->vts_vobu_admap)
return 0;
@ -1484,7 +1484,7 @@ int ifoRead_VOBU_ADMAP(ifo_handle_t *ifofile) {
return 0;
}
ifofile->menu_vobu_admap = (vobu_admap_t *)malloc(sizeof(vobu_admap_t));
ifofile->menu_vobu_admap = malloc(sizeof(vobu_admap_t));
if(!ifofile->menu_vobu_admap)
return 0;
@ -1517,7 +1517,7 @@ static int ifoRead_VOBU_ADMAP_internal(ifo_handle_t *ifofile,
Titles with a VOBS that has no VOBUs. */
CHECK_VALUE(info_length % sizeof(uint32_t) == 0);
vobu_admap->vobu_start_sectors = (uint32_t *)malloc(info_length);
vobu_admap->vobu_start_sectors = malloc(info_length);
if(!vobu_admap->vobu_start_sectors) {
return 0;
}
@ -1569,7 +1569,7 @@ int ifoRead_PGCIT(ifo_handle_t *ifofile) {
if(ifofile->vtsi_mat->vts_pgcit == 0) /* mandatory */
return 0;
ifofile->vts_pgcit = (pgcit_t *)malloc(sizeof(pgcit_t));
ifofile->vts_pgcit = malloc(sizeof(pgcit_t));
if(!ifofile->vts_pgcit)
return 0;
@ -1699,7 +1699,7 @@ int ifoRead_PGCI_UT(ifo_handle_t *ifofile) {
return 0;
}
ifofile->pgci_ut = (pgci_ut_t *)malloc(sizeof(pgci_ut_t));
ifofile->pgci_ut = malloc(sizeof(pgci_ut_t));
if(!ifofile->pgci_ut)
return 0;
@ -1889,7 +1889,7 @@ int ifoRead_VTS_ATRT(ifo_handle_t *ifofile) {
if(!DVDFileSeek_(ifofile->file, sector * DVD_BLOCK_LEN))
return 0;
vts_atrt = (vts_atrt_t *)malloc(sizeof(vts_atrt_t));
vts_atrt = malloc(sizeof(vts_atrt_t));
if(!vts_atrt)
return 0;
@ -1911,7 +1911,7 @@ int ifoRead_VTS_ATRT(ifo_handle_t *ifofile) {
VTS_ATRT_SIZE < vts_atrt->last_byte + 1);
info_length = vts_atrt->nr_of_vtss * sizeof(uint32_t);
data = (uint32_t *)malloc(info_length);
data = malloc(info_length);
if(!data) {
free(vts_atrt);
ifofile->vts_atrt = 0;
@ -1933,7 +1933,7 @@ int ifoRead_VTS_ATRT(ifo_handle_t *ifofile) {
}
info_length = vts_atrt->nr_of_vtss * sizeof(vts_attributes_t);
vts_atrt->vts = (vts_attributes_t *)malloc(info_length);
vts_atrt->vts = malloc(info_length);
if(!vts_atrt->vts) {
free(data);
free(vts_atrt);
@ -1989,7 +1989,7 @@ int ifoRead_TXTDT_MGI(ifo_handle_t *ifofile) {
ifofile->vmgi_mat->txtdt_mgi * DVD_BLOCK_LEN))
return 0;
txtdt_mgi = (txtdt_mgi_t *)malloc(sizeof(txtdt_mgi_t));
txtdt_mgi = malloc(sizeof(txtdt_mgi_t));
if(!txtdt_mgi) {
return 0;
}

View File

@ -47,7 +47,7 @@ m_config_new(void) {
};
int i;
config = (m_config_t*)calloc(1,sizeof(m_config_t));
config = calloc(1,sizeof(m_config_t));
config->lvl = 1; // 0 Is the defaults
if(!inited) {
inited = 1;
@ -133,7 +133,7 @@ m_config_push(m_config_t* config) {
m_option_save(co->opt,co->slots->data,co->opt->p);
// Allocate a new slot
slot = (m_config_save_slot_t*)calloc(1,sizeof(m_config_save_slot_t) + co->opt->type->size);
slot = calloc(1,sizeof(m_config_save_slot_t) + co->opt->type->size);
slot->lvl = config->lvl;
slot->prev = co->slots;
co->slots = slot;
@ -193,7 +193,7 @@ m_config_add_option(m_config_t *config, m_option_t *arg, char* prefix) {
#endif
// Allocate a new entry for this option
co = (m_config_option_t*)calloc(1,sizeof(m_config_option_t) + arg->type->size);
co = calloc(1,sizeof(m_config_option_t) + arg->type->size);
co->opt = arg;
// Fill in the full name
@ -225,7 +225,7 @@ m_config_add_option(m_config_t *config, m_option_t *arg, char* prefix) {
}
if(!(co->flags & M_CFG_OPT_ALIAS)) {
// Allocate a slot for the defaults
sl = (m_config_save_slot_t*)calloc(1,sizeof(m_config_save_slot_t) + arg->type->size);
sl = calloc(1,sizeof(m_config_save_slot_t) + arg->type->size);
m_option_save(arg,sl->data,(void**)arg->p);
// Hack to avoid too much trouble with dynamicly allocated data :
// We always use a dynamic version
@ -235,7 +235,7 @@ m_config_add_option(m_config_t *config, m_option_t *arg, char* prefix) {
}
sl->lvl = 0;
sl->prev = NULL;
co->slots = (m_config_save_slot_t*)calloc(1,sizeof(m_config_save_slot_t) + arg->type->size);
co->slots = calloc(1,sizeof(m_config_save_slot_t) + arg->type->size);
co->slots->prev = sl;
co->slots->lvl = config->lvl;
m_option_copy(co->opt,co->slots->data,sl->data);

View File

@ -699,7 +699,7 @@ static int parse_func_pf(m_option_t* opt,char *name, char *param, void* dst, int
if(!dst)
return 1;
s = (m_func_save_t*)calloc(1,sizeof(m_func_save_t));
s = calloc(1,sizeof(m_func_save_t));
s->name = strdup(name);
s->param = param ? strdup(param) : NULL;
@ -724,7 +724,7 @@ static void copy_func_pf(m_option_t* opt,void* dst, void* src) {
free_func_pf(dst);
while(s) {
d = (m_func_save_t*)calloc(1,sizeof(m_func_save_t));
d = calloc(1,sizeof(m_func_save_t));
d->name = strdup(s->name);
d->param = s->param ? strdup(s->param) : NULL;
if(last)

View File

@ -20,7 +20,7 @@ play_tree_is_valid(play_tree_t* pt);
play_tree_t*
play_tree_new(void) {
play_tree_t* r = (play_tree_t*)calloc(1,sizeof(play_tree_t));
play_tree_t* r = calloc(1,sizeof(play_tree_t));
if(r == NULL)
mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't allocate %d bytes of memory\n",sizeof(play_tree_t));
r->entry_type = PLAY_TREE_ENTRY_NODE;
@ -480,7 +480,7 @@ play_tree_iter_new(play_tree_t* pt,m_config_t* config) {
if( ! play_tree_is_valid(pt))
return NULL;
iter = (play_tree_iter_t*)calloc(1,sizeof(play_tree_iter_t));
iter = calloc(1,sizeof(play_tree_iter_t));
if(! iter) {
mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't allocate new iterator (%d bytes of memory)\n",sizeof(play_tree_iter_t));
return NULL;

View File

@ -694,7 +694,7 @@ play_tree_parser_t*
play_tree_parser_new(stream_t* stream,int deep) {
play_tree_parser_t* p;
p = (play_tree_parser_t*)calloc(1,sizeof(play_tree_parser_t));
p = calloc(1,sizeof(play_tree_parser_t));
if(!p)
return NULL;
p->stream = stream;