Re: ole32: Void functions should not return a value
James Hawkins wrote: > Read Andrew's last sentence. Technically no return is needed, but it > can be added for aesthetics. > Thanks, James (and everyone). If the patch gets rejected, I shall resubmit it with added returns. -- Andy.
Re: ole32: Void functions should not return a value
On 4/12/07, Brian Gerst <[EMAIL PROTECTED]> wrote: Andrew Talbot wrote: > Robert Shearman wrote: > >> Andrew Talbot wrote: >>> diff -urN a/dlls/ole32/rpc.c b/dlls/ole32/rpc.c >>> --- a/dlls/ole32/rpc.c 2007-03-28 12:43:32.0 +0100 >>> +++ b/dlls/ole32/rpc.c 2007-04-12 20:20:48.0 +0100 >>> @@ -1352,7 +1352,7 @@ >>> TRACE("ipid = %s, iMethod = %d\n", debugstr_guid(&ipid), >>> msg->ProcNum); >>> >>> params = HeapAlloc(GetProcessHeap(), 0, sizeof(*params)); >>> -if (!params) return RpcRaiseException(E_OUTOFMEMORY); >>> +if (!params) RpcRaiseException(E_OUTOFMEMORY); >>> >>> hr = ipid_get_dispatch_params(&ipid, &apt, ¶ms->stub, >>> ¶ms->chan, >>>¶ms->iid, ¶ms->iface); >>> @@ -1360,7 +1360,7 @@ >>> { >>> ERR("no apartment found for ipid %s\n", debugstr_guid(&ipid)); >>> HeapFree(GetProcessHeap(), 0, params); >>> -return RpcRaiseException(hr); >>> +RpcRaiseException(hr); >>> } >>> >>> params->msg = (RPCOLEMESSAGE *)msg; >>> >> You've changed the code paths here. >> > > Hi Rob, > > I'm not quite sure what you mean. Are you implying that I need return > statements after the RpcRaiseException() calls? Can one not just rely on > the fact that RpcRaiseException() does not return to the caller? > You completely removed the return from the function at those two points, allowing it to fall through. Read Andrew's last sentence. Technically no return is needed, but it can be added for aesthetics. -- James Hawkins
Re: ole32: Void functions should not return a value
Andrew Talbot wrote: > Robert Shearman wrote: > >> Andrew Talbot wrote: >>> diff -urN a/dlls/ole32/rpc.c b/dlls/ole32/rpc.c >>> --- a/dlls/ole32/rpc.c 2007-03-28 12:43:32.0 +0100 >>> +++ b/dlls/ole32/rpc.c 2007-04-12 20:20:48.0 +0100 >>> @@ -1352,7 +1352,7 @@ >>> TRACE("ipid = %s, iMethod = %d\n", debugstr_guid(&ipid), >>> msg->ProcNum); >>> >>> params = HeapAlloc(GetProcessHeap(), 0, sizeof(*params)); >>> -if (!params) return RpcRaiseException(E_OUTOFMEMORY); >>> +if (!params) RpcRaiseException(E_OUTOFMEMORY); >>> >>> hr = ipid_get_dispatch_params(&ipid, &apt, ¶ms->stub, >>> ¶ms->chan, >>>¶ms->iid, ¶ms->iface); >>> @@ -1360,7 +1360,7 @@ >>> { >>> ERR("no apartment found for ipid %s\n", debugstr_guid(&ipid)); >>> HeapFree(GetProcessHeap(), 0, params); >>> -return RpcRaiseException(hr); >>> +RpcRaiseException(hr); >>> } >>> >>> params->msg = (RPCOLEMESSAGE *)msg; >>> >> You've changed the code paths here. >> > > Hi Rob, > > I'm not quite sure what you mean. Are you implying that I need return > statements after the RpcRaiseException() calls? Can one not just rely on > the fact that RpcRaiseException() does not return to the caller? > > -- Andy. > > > > You completely removed the return from the function at those two points, allowing it to fall through. -- Brian Gerst
Re: ole32: Void functions should not return a value
Robert Shearman wrote: > Andrew Talbot wrote: >> diff -urN a/dlls/ole32/rpc.c b/dlls/ole32/rpc.c >> --- a/dlls/ole32/rpc.c 2007-03-28 12:43:32.0 +0100 >> +++ b/dlls/ole32/rpc.c 2007-04-12 20:20:48.0 +0100 >> @@ -1352,7 +1352,7 @@ >> TRACE("ipid = %s, iMethod = %d\n", debugstr_guid(&ipid), >> msg->ProcNum); >> >> params = HeapAlloc(GetProcessHeap(), 0, sizeof(*params)); >> -if (!params) return RpcRaiseException(E_OUTOFMEMORY); >> +if (!params) RpcRaiseException(E_OUTOFMEMORY); >> >> hr = ipid_get_dispatch_params(&ipid, &apt, ¶ms->stub, >> ¶ms->chan, >>¶ms->iid, ¶ms->iface); >> @@ -1360,7 +1360,7 @@ >> { >> ERR("no apartment found for ipid %s\n", debugstr_guid(&ipid)); >> HeapFree(GetProcessHeap(), 0, params); >> -return RpcRaiseException(hr); >> +RpcRaiseException(hr); >> } >> >> params->msg = (RPCOLEMESSAGE *)msg; >> > > You've changed the code paths here. > Hi Rob, I'm not quite sure what you mean. Are you implying that I need return statements after the RpcRaiseException() calls? Can one not just rely on the fact that RpcRaiseException() does not return to the caller? -- Andy.
Re: ole32: Void functions should not return a value
Andrew Talbot wrote: diff -urN a/dlls/ole32/rpc.c b/dlls/ole32/rpc.c --- a/dlls/ole32/rpc.c 2007-03-28 12:43:32.0 +0100 +++ b/dlls/ole32/rpc.c 2007-04-12 20:20:48.0 +0100 @@ -1352,7 +1352,7 @@ TRACE("ipid = %s, iMethod = %d\n", debugstr_guid(&ipid), msg->ProcNum); params = HeapAlloc(GetProcessHeap(), 0, sizeof(*params)); -if (!params) return RpcRaiseException(E_OUTOFMEMORY); +if (!params) RpcRaiseException(E_OUTOFMEMORY); hr = ipid_get_dispatch_params(&ipid, &apt, ¶ms->stub, ¶ms->chan, ¶ms->iid, ¶ms->iface); @@ -1360,7 +1360,7 @@ { ERR("no apartment found for ipid %s\n", debugstr_guid(&ipid)); HeapFree(GetProcessHeap(), 0, params); -return RpcRaiseException(hr); +RpcRaiseException(hr); } params->msg = (RPCOLEMESSAGE *)msg; You've changed the code paths here. -- Rob Shearman