axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dimuthu Gamage" <>
Subject Question about AXIS2_PARAM_CHECK
Date Tue, 10 Jun 2008 02:57:47 GMT
Hi devs,

Currently in AXIS2_PARAM_CHECK, if the param is null we set the status code
to AXIS2_FAILURE and if not null set the status code AXIS2_SUCCESSS

#define AXIS2_PARAM_CHECK(error, object, error_return)                  \
    if (!object)                                                        \
    {                                                                   \
        AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_FAILURE);              \
        return error_return;                                            \
    }                                                                   \
    else                                                                \
    {                                                                   \
        AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_SUCCESS);              \

My question is, is it ok to set the status code to AXIS2_SUCCESS,
1. If  we are in happy path, the status code is already AXIS2_SUCCESS, we
don't need to explicitly set that.
2. The macro can overwrite the status, That is if the status is already set
to failure by an early case, this macro will overwrite the status to SUCCESS
which is wrong.

So my suggestion is to remove the else part from that macro?. Please let me
know your ideas, I may be wrong on this.


View raw message