fix some typecasts to *malloc() return values

This commit is contained in:
rlar 2010-07-01 17:20:35 +00:00
parent 643728aca4
commit 0dbebc870c
3 changed files with 8 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2010-07-01 Robert Larice
* src/frontend/inpcom.c,
* src/spicelib/devices/cktinit.c :
fix some typecasts to *malloc() return values
2010-07-01 Robert Larice
* src/frontend/inpcom.c : explicit compare with NULL

View File

@ -1123,7 +1123,7 @@ inp_readall(FILE *fp, struct line **data, int call_depth, char *dir_name, bool c
break;
}
else if(ipc_status == IPC_STATUS_OK) {
buffer = (void *) tmalloc(strlen(ipc_buffer) + 3);
buffer = (char *) tmalloc(strlen(ipc_buffer) + 3);
strcpy(buffer, ipc_buffer);
strcat(buffer, "\n");
}

View File

@ -87,7 +87,7 @@ CKTinit(void **ckt) /* new circuit to create */
/* gtri - begin - wbk - allocate/initialize substructs */
/* Allocate evt data structure */
(sckt)->evt = (void *) MALLOC(sizeof(Evt_Ckt_Data_t));
(sckt)->evt = (Evt_Ckt_Data_t *) MALLOC(sizeof(Evt_Ckt_Data_t));
if(! (sckt)->evt)
return(E_NOMEM);
@ -95,7 +95,7 @@ CKTinit(void **ckt) /* new circuit to create */
(sckt)->evt->options.op_alternate = MIF_TRUE;
/* Allocate enh data structure */
(sckt)->enh = (void *) MALLOC(sizeof(Enh_Ckt_Data_t));
(sckt)->enh = (Enh_Ckt_Data_t *) MALLOC(sizeof(Enh_Ckt_Data_t));
if(! (sckt)->enh)
return(E_NOMEM);