[MPlayer-cvslog] r18884 - in trunk: libmpcodecs/ad_libvorbis.c libmpcodecs/ad_mpc.c libmpcodecs/ad_speex.c libmpcodecs/dec_audio.c libmpcodecs/vd_ffmpeg.c libmpcodecs/vd_mpng.c libmpcodecs/vd_theora.c libmpcodecs/vd_xvid.c libmpcodecs/vd_xvid4.c libmpcodecs/ve_nuv.c libmpcodecs/vf_screenshot.c libmpdemux/http.c libmpdemux/url.c libmpdvdkit2/ifo_read.c m_config.c m_option.c playtree.c playtreeparser.c

reynaldo subversion at mplayerhq.hu
Sun Jul 2 10:17:15 CEST 2006


Author: reynaldo
Date: Sun Jul  2 10:17:07 2006
New Revision: 18884

Modified:
   trunk/libmpcodecs/ad_libvorbis.c
   trunk/libmpcodecs/ad_mpc.c
   trunk/libmpcodecs/ad_speex.c
   trunk/libmpcodecs/dec_audio.c
   trunk/libmpcodecs/vd_ffmpeg.c
   trunk/libmpcodecs/vd_mpng.c
   trunk/libmpcodecs/vd_theora.c
   trunk/libmpcodecs/vd_xvid.c
   trunk/libmpcodecs/vd_xvid4.c
   trunk/libmpcodecs/ve_nuv.c
   trunk/libmpcodecs/vf_screenshot.c
   trunk/libmpdemux/http.c
   trunk/libmpdemux/url.c
   trunk/libmpdvdkit2/ifo_read.c
   trunk/m_config.c
   trunk/m_option.c
   trunk/playtree.c
   trunk/playtreeparser.c

Log:
rm unnecesary casts from void* - part 3

Modified: trunk/libmpcodecs/ad_libvorbis.c
==============================================================================
--- trunk/libmpcodecs/ad_libvorbis.c	(original)
+++ trunk/libmpcodecs/ad_libvorbis.c	Sun Jul  2 10:17:07 2006
@@ -72,7 +72,7 @@
   }
 
   /// 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);
 

Modified: trunk/libmpcodecs/ad_mpc.c
==============================================================================
--- trunk/libmpcodecs/ad_mpc.c	(original)
+++ trunk/libmpcodecs/ad_mpc.c	Sun Jul  2 10:17:07 2006
@@ -203,7 +203,7 @@
 
 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++) {

Modified: trunk/libmpcodecs/ad_speex.c
==============================================================================
--- trunk/libmpcodecs/ad_speex.c	(original)
+++ trunk/libmpcodecs/ad_speex.c	Sun Jul  2 10:17:07 2006
@@ -36,7 +36,7 @@
 }
 
 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) {

Modified: trunk/libmpcodecs/dec_audio.c
==============================================================================
--- trunk/libmpcodecs/dec_audio.c	(original)
+++ trunk/libmpcodecs/dec_audio.c	Sun Jul  2 10:17:07 2006
@@ -290,7 +290,7 @@
 	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));
   }
 

Modified: trunk/libmpcodecs/vd_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/vd_ffmpeg.c	(original)
+++ trunk/libmpcodecs/vd_ffmpeg.c	Sun Jul  2 10:17:07 2006
@@ -383,7 +383,7 @@
     /* 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 */

Modified: trunk/libmpcodecs/vd_mpng.c
==============================================================================
--- trunk/libmpcodecs/vd_mpng.c	(original)
+++ trunk/libmpcodecs/vd_mpng.c	Sun Jul  2 10:17:07 2006
@@ -135,7 +135,7 @@
     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 );

Modified: trunk/libmpcodecs/vd_theora.c
==============================================================================
--- trunk/libmpcodecs/vd_theora.c	(original)
+++ trunk/libmpcodecs/vd_theora.c	Sun Jul  2 10:17:07 2006
@@ -64,7 +64,7 @@
     /* 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;

Modified: trunk/libmpcodecs/vd_xvid.c
==============================================================================
--- trunk/libmpcodecs/vd_xvid.c	(original)
+++ trunk/libmpcodecs/vd_xvid.c	Sun Jul  2 10:17:07 2006
@@ -152,7 +152,7 @@
     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;

Modified: trunk/libmpcodecs/vd_xvid4.c
==============================================================================
--- trunk/libmpcodecs/vd_xvid4.c	(original)
+++ trunk/libmpcodecs/vd_xvid4.c	Sun Jul  2 10:17:07 2006
@@ -174,7 +174,7 @@
 		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;

Modified: trunk/libmpcodecs/ve_nuv.c
==============================================================================
--- trunk/libmpcodecs/ve_nuv.c	(original)
+++ trunk/libmpcodecs/ve_nuv.c	Sun Jul  2 10:17:07 2006
@@ -217,7 +217,7 @@
       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;

Modified: trunk/libmpcodecs/vf_screenshot.c
==============================================================================
--- trunk/libmpcodecs/vf_screenshot.c	(original)
+++ trunk/libmpcodecs/vf_screenshot.c	Sun Jul  2 10:17:07 2006
@@ -87,7 +87,7 @@
         
     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;

Modified: trunk/libmpdemux/http.c
==============================================================================
--- trunk/libmpdemux/http.c	(original)
+++ trunk/libmpdemux/http.c	Sun Jul  2 10:17:07 2006
@@ -111,7 +111,7 @@
   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_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 @@
 		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 @@
 		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 @@
 	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 @@
 		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_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 @@
 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 @@
 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 @@
 		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 @@
 
 	// 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 @@
 
 	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;

Modified: trunk/libmpdemux/url.c
==============================================================================
--- trunk/libmpdemux/url.c	(original)
+++ trunk/libmpdemux/url.c	Sun Jul  2 10:17:07 2006
@@ -40,7 +40,7 @@
         }
 
 	// 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 @@
 		}
 	}
 	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 @@
 	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 @@
 			// 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 @@
 	}
 	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 @@
 	} 
 	// 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;

Modified: trunk/libmpdvdkit2/ifo_read.c
==============================================================================
--- trunk/libmpdvdkit2/ifo_read.c	(original)
+++ trunk/libmpdvdkit2/ifo_read.c	Sun Jul  2 10:17:07 2006
@@ -97,7 +97,7 @@
 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 *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 *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 @@
 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 @@
   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 @@
      
   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 @@
   
   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 @@
 
   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 @@
   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 @@
   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 @@
   
   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 @@
 		   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 @@
   
   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 @@
   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 @@
 	      <= 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 @@
       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 @@
     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 @@
   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 @@
   
   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 @@
   
   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 @@
     
     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 @@
   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 @@
     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 @@
     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 @@
   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 @@
     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 @@
      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 @@
   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 @@
     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 @@
   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 @@
          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 @@
   }
   
   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 @@
 		   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;
   }

Modified: trunk/m_config.c
==============================================================================
--- trunk/m_config.c	(original)
+++ trunk/m_config.c	Sun Jul  2 10:17:07 2006
@@ -47,7 +47,7 @@
   };
   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_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 @@
 #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 @@
     }
     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 @@
     }
     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);

Modified: trunk/m_option.c
==============================================================================
--- trunk/m_option.c	(original)
+++ trunk/m_option.c	Sun Jul  2 10:17:07 2006
@@ -699,7 +699,7 @@
   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 @@
     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)

Modified: trunk/playtree.c
==============================================================================
--- trunk/playtree.c	(original)
+++ trunk/playtree.c	Sun Jul  2 10:17:07 2006
@@ -20,7 +20,7 @@
 
 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 @@
   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;

Modified: trunk/playtreeparser.c
==============================================================================
--- trunk/playtreeparser.c	(original)
+++ trunk/playtreeparser.c	Sun Jul  2 10:17:07 2006
@@ -694,7 +694,7 @@
 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;



More information about the MPlayer-cvslog mailing list