Mercurial > mplayer.hg
diff loader/module.c @ 30702:9fc9d1e788aa
Do not cast the results of malloc/calloc/realloc.
These functions return void*, which is compatible with any pointer,
so there is no need for casts.
| author | diego |
|---|---|
| date | Fri, 26 Feb 2010 15:01:37 +0000 |
| parents | 4feb81c515fa |
| children | ff7b06c867cd |
line wrap: on
line diff
--- a/loader/module.c Fri Feb 26 12:49:49 2010 +0000 +++ b/loader/module.c Fri Feb 26 15:01:37 2010 +0000 @@ -241,7 +241,7 @@ //local_wm=wm; if(local_wm) { - local_wm->next = (modref_list*) malloc(sizeof(modref_list)); + local_wm->next = malloc(sizeof(modref_list)); local_wm->next->prev=local_wm; local_wm->next->next=NULL; local_wm->next->wm=wm; @@ -854,7 +854,7 @@ // memory management: case 0x150011: //NewPtrClear case 0x150012: //NewPtrSysClear - reg->eax=(uint32_t)malloc(((uint32_t *)stack_base)[1]); + reg->eax = malloc(((uint32_t *)stack_base)[1]); memset((void *)reg->eax,0,((uint32_t *)stack_base)[1]); #ifdef DEBUG_QTX_API printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax); @@ -862,7 +862,7 @@ return 1; case 0x15000F: //NewPtr case 0x150010: //NewPtrSys - reg->eax=(uint32_t)malloc(((uint32_t *)stack_base)[1]); + reg->eax = malloc(((uint32_t *)stack_base)[1]); #ifdef DEBUG_QTX_API printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax); #endif
