httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joachim Zobel <jzo...@heute-morgen.de>
Subject Re: Coding style
Date Mon, 02 Oct 2006 21:11:49 GMT
Am Montag, den 02.10.2006, 22:39 +0200 schrieb Ruediger Pluem:
> if (((rc = apr_procattr_create(&procattr, p)) == APR_SUCCESS)
>         && ((rc = apr_procattr_cmdtype_set(procattr,
>                                            APR_SHELLCMD_ENV)) == APR_SUCCESS)
>         && ((rc = apr_procattr_io_set(procattr,
>                                       APR_FULL_BLOCK,
>                                       APR_NO_PIPE,
>                                       APR_NO_PIPE)) == APR_SUCCESS)
>         && ((rc = apr_procattr_error_check_set(procattr, 1)) == APR_SUCCESS)
>         && ((rc = apr_procattr_child_errfn_set(procattr, log_child_errfn)) ==
APR_SUCCESS)) {
> 
> To get the same thing with above style you would create a lot
> of nested if statements or you would have to use a lot of if statements and goto.

I would put this in a seperate function where it turns into the easy to
read classic, that returns after any unsuccessfull call. These returns
are hidden gotos, of course.

Sincerely,
Joachim



Mime
View raw message