Mercurial > libdvdread4.hg
changeset 67:8fab3ce417ed src
Clean up malloc calls
Both malloc calls have a cast to the type of the pointer's
type. This is not necessary in C and is poor style.
author | erik |
---|---|
date | Sat, 13 Aug 2011 17:28:37 +0000 |
parents | d16d554fa215 |
children | 3748dde919dd |
files | ifo_read.c |
diffstat | 1 files changed, 3 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/ifo_read.c Wed Jun 15 18:09:15 2011 +0000 +++ b/ifo_read.c Sat Aug 13 17:28:37 2011 +0000 @@ -1141,7 +1141,7 @@ int ifoRead_VTS_PTT_SRPT(ifo_handle_t *ifofile) { vts_ptt_srpt_t *vts_ptt_srpt; int info_length, i, j; - uint32_t *data; + uint32_t *data = NULL; if(!ifofile) return 0; @@ -1156,7 +1156,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; @@ -1176,8 +1176,7 @@ CHECK_VALUE(vts_ptt_srpt->nr_of_srpts < 100); /* ?? */ 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;