mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-07 23:45:12 +00:00
IsGood() check elimination
Reasons: 1) It's unsafe - we cannot guarantee that address is still good while it is used. 2) It's wrong in many modules which are usually just compare pointer with zero.
This commit is contained in:
parent
48514b0e93
commit
8f04ab07ed
52 changed files with 104 additions and 1450 deletions
|
|
@ -26,12 +26,6 @@ int cellNetCtlGetState(mem32_t state)
|
|||
{
|
||||
cellNetCtl->Log("cellNetCtlGetState(state_addr=0x%x)", state.GetAddr());
|
||||
|
||||
if (!state.IsGood())
|
||||
{
|
||||
cellNetCtl->Error("cellNetCtlGetState : CELL_NET_CTL_ERROR_INVALID_ADDR");
|
||||
return CELL_NET_CTL_ERROR_INVALID_ADDR;
|
||||
}
|
||||
|
||||
state = CELL_NET_CTL_STATE_Disconnected; // TODO: Allow other states
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -58,12 +52,6 @@ int cellNetCtlNetStartDialogLoadAsync(mem_ptr_t<CellNetCtlNetStartDialogParam> p
|
|||
{
|
||||
cellNetCtl->Todo("cellNetCtlNetStartDialogLoadAsync(param_addr=0x%x)", param.GetAddr());
|
||||
|
||||
if (!param.IsGood())
|
||||
{
|
||||
cellNetCtl->Error("cellNetCtlNetStartDialogLoadAsync : CELL_NET_CTL_ERROR_INVALID_ADDR");
|
||||
return CELL_NET_CTL_ERROR_INVALID_ADDR;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
|
@ -77,12 +65,6 @@ int cellNetCtlNetStartDialogUnloadAsync(mem_ptr_t<CellNetCtlNetStartDialogResult
|
|||
{
|
||||
cellNetCtl->Todo("cellNetCtlNetStartDialogUnloadAsync(result_addr=0x%x)", result.GetAddr());
|
||||
|
||||
if (!result.IsGood())
|
||||
{
|
||||
cellNetCtl->Error("cellNetCtlNetStartDialogLoadAsync : CELL_NET_CTL_ERROR_INVALID_ADDR");
|
||||
return CELL_NET_CTL_ERROR_INVALID_ADDR;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
|
@ -90,12 +72,6 @@ int cellNetCtlGetNatInfo(mem_ptr_t<CellNetCtlNatInfo> natInfo)
|
|||
{
|
||||
cellNetCtl->Todo("cellNetCtlGetNatInfo(natInfo_addr=0x%x)", natInfo.GetAddr());
|
||||
|
||||
if (!natInfo.IsGood())
|
||||
{
|
||||
cellNetCtl->Error("cellNetCtlGetNatInfo : CELL_NET_CTL_ERROR_INVALID_ADDR");
|
||||
return CELL_NET_CTL_ERROR_INVALID_ADDR;
|
||||
}
|
||||
|
||||
if (natInfo->size == 0)
|
||||
{
|
||||
cellNetCtl->Error("cellNetCtlGetNatInfo : CELL_NET_CTL_ERROR_INVALID_SIZE");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue