axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fred Preston <PREST...@uk.ibm.com>
Subject Re: Stub::SetSecure() question
Date Fri, 28 Apr 2006 09:29:52 GMT
Hi Nadir,
        This is a bit of code that remained when I was looking at 
configuring SSL.  The code could be updated to the following...

    m_sArguments[6] = "false";

    if( (pszArg = pszArguments) != NULL)
    {
        do
        {
            if( pszArg == (char *) 1)
                m_sArguments[iArgIndex] = "true";
            else
                m_sArguments[iArgIndex] = pszArg;

            iArgIndex++;
        } 
        while( (pszArg = va_arg( args, char *)) != NULL && iArgIndex < 8);
    }

        But there is no real reason for having this code and it could be 
shortened to;-

    if( (pszArg = pszArguments) != NULL)
    {
        do
        {
            m_sArguments[iArgIndex] = pszArg;

            iArgIndex++;
        } 
        while( (pszArg = va_arg( args, char *)) != NULL && iArgIndex < 8);
    }

Regards,

Fred Preston.




Nadir Amra <amra@us.ibm.com> 
28/04/2006 06:19
Please respond to
"Apache AXIS C Developers List" <axis-c-dev@ws.apache.org>


To
"Apache AXIS C Developers List" <axis-c-dev@ws.apache.org>
cc

Subject
Stub::SetSecure() question






There is a line of code that I do not quite understand in Stub::SetSecure. 

 Here is the routine:

    va_list args;
    char *  pszArg = NULL;
 
    va_start( args, pszArguments);
 
    if( (pszArg = pszArguments) != NULL)
    {
        do
        {
            if( pszArg == (char *) 1)
                m_sArguments[iArgIndex] = "true";
            else
                m_sArguments[iArgIndex] = pszArg;

            iArgIndex++;
        } 
        while( (pszArg = va_arg( args, char *)) != NULL && iArgIndex < 8);

        if( iArgIndex == 6)
            m_sArguments[iArgIndex] = "false";
    }

    va_end( args);

The line I do not understand is 

            if( pszArg == (char *) 1)

Can someone please explain how this works?

Nadir K. Amra



Mime
View raw message