# HG changeset patch # User erik # Date 1313256517 0 # Node ID 8fab3ce417edad0d133bc52d509f061640b94d74 # Parent d16d554fa2157040a6c48c7e2f5714d67cd73241 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. diff -r d16d554fa215 -r 8fab3ce417ed ifo_read.c --- 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;