Mercurial > mplayer.hg
comparison libmpdemux/cdinfo.c @ 19062:83c3afeab35d
drops casts from void * on malloc/calloc from libmpdemux code
author | reynaldo |
---|---|
date | Thu, 13 Jul 2006 16:41:13 +0000 |
parents | 32e2c59c8e86 |
children |
comparison
equal
deleted
inserted
replaced
19061:86350b4b8203 | 19062:83c3afeab35d |
---|---|
23 | 23 |
24 cd_info_t* | 24 cd_info_t* |
25 cd_info_new() { | 25 cd_info_new() { |
26 cd_info_t *cd_info = NULL; | 26 cd_info_t *cd_info = NULL; |
27 | 27 |
28 cd_info = (cd_info_t*)malloc(sizeof(cd_info_t)); | 28 cd_info = malloc(sizeof(cd_info_t)); |
29 if( cd_info==NULL ) { | 29 if( cd_info==NULL ) { |
30 mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MemAllocFailed); | 30 mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MemAllocFailed); |
31 return NULL; | 31 return NULL; |
32 } | 32 } |
33 | 33 |
57 cd_info_add_track(cd_info_t *cd_info, char *track_name, unsigned int track_nb, unsigned int min, unsigned int sec, unsigned int msec, unsigned long frame_begin, unsigned long frame_length) { | 57 cd_info_add_track(cd_info_t *cd_info, char *track_name, unsigned int track_nb, unsigned int min, unsigned int sec, unsigned int msec, unsigned long frame_begin, unsigned long frame_length) { |
58 cd_track_t *cd_track; | 58 cd_track_t *cd_track; |
59 | 59 |
60 if( cd_info==NULL || track_name==NULL ) return NULL; | 60 if( cd_info==NULL || track_name==NULL ) return NULL; |
61 | 61 |
62 cd_track = (cd_track_t*)malloc(sizeof(cd_track_t)); | 62 cd_track = malloc(sizeof(cd_track_t)); |
63 if( cd_track==NULL ) { | 63 if( cd_track==NULL ) { |
64 mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MemAllocFailed); | 64 mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MemAllocFailed); |
65 return NULL; | 65 return NULL; |
66 } | 66 } |
67 memset(cd_track, 0, sizeof(cd_track_t)); | 67 memset(cd_track, 0, sizeof(cd_track_t)); |
68 | 68 |
69 cd_track->name = (char*)malloc(strlen(track_name)+1); | 69 cd_track->name = malloc(strlen(track_name)+1); |
70 if( cd_track->name==NULL ) { | 70 if( cd_track->name==NULL ) { |
71 mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MemAllocFailed); | 71 mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MemAllocFailed); |
72 free(cd_track); | 72 free(cd_track); |
73 return NULL; | 73 return NULL; |
74 } | 74 } |