Okay.  Thanks for the references.

It just seemed a little strange that APR_SUCCESS was explicitly used for zero in one place and not in another within the same function.

On 10/24/2016 1:49 PM, Yann Ylavic wrote:
Hi Mike, Jacob,

On Mon, Oct 24, 2016 at 10:04 PM, Jacob Champion <champio...@gmail.com> wrote:
On 10/24/2016 08:54 AM, Mike Rumph wrote:
+    return status ? status : rv;
This line seems to depend on the assumption that APR_SUCCESS is coded as
zero.
Wouldn't it be better to not hard code that assumption?
This assumption is pretty deep in APR itself I think (on unix'es it
maps directly to errno).

I certainly hope that APR_SUCCESS is guaranteed to be zero on every
platform, in perpetuum... and from an old conversation [1] on the removal of
the APR_STATUS_IS_SUCCESS macro, it looks like that's the case.

[1]
https://lists.apache.org/thread.html/9b5019c15b1d19f6899141cde46261a3b7c9515e9a7026ce94d1aeb5@1021067744@%3Cdev.apr.apache.org%3E
Another (related) reference:
https://lists.apache.org/thread.html/27267666cba38edb23c93f08e6f769f7b56f3dbc04fd8b4a185e325d@1091059685@%3Cdev.apr.apache.org%3E

So it's a matter of taste actually (usually I omit comparisons to
true/false/NULL only, this time it seems I abused my own rules :)

Regards,
Yann.


Reply via email to