In common/ArrayBean.cpp there is the following piece of code:

.
.
       void* pItem;
       unsigned long ptrval = reinterpret_cast<unsigned long
>(m_value.cta->pObject);
.
.
.
            for (int x=0; x<m_nSize; x++)
            {                pItem = reinterpret_cast<void
*>(ptrval+x*itemsize);
.
.
.

soap/SoapDeserializer.cpp has the same kind of thing.

Integers and pointers are not the same thing on all platforms, nor is the 
size a given (64-bit vs. 32 bit, etc.).   We should avoid doing this type 
of coding.

I want to change the above code so that it looks like:

.
.
       void * pItem;
       char * ptrval = (char *)m_value.cta->pObject;
.
.
.
            for (int x=0; x<m_nSize; x++)
            {                pItem = ptrval+x*itemsize;
.
.
.

This works on OS/400, and I do not think it should be a problem on other 
platforms.  Just wanted to review with you all to ensure I am not missing 
anything. 

Nadir K. Amra

Reply via email to