I found the problem. Xcode C++ treats 'long int' as a 32 bit number.  
This code:

        cout << "sizeof(long) = " << sizeof(long) << endl;
        cout << "sizeof(int) = " << sizeof(int) << endl;
        cout << "sizeof(long long) = " << sizeof(long long) << endl;
        cout << "sizeof(long int) = " << sizeof(long int) << endl;

gives the output:

sizeof(long) = 4
sizeof(int) = 4
sizeof(long long) = 8
sizeof(long int) = 4

So long is 4 bytes or 32 bits, int is 32 bits, long long is 64 bits,  
but long int is only 32 bits! What a terrible trap for any programmer!

Bob


On Dec 14, 2007, at 10:13 PM, Bob Delaney wrote:

>
> On Dec 14, 2007, at 12:15 AM, Bob Delaney wrote:
>
>> So the same problem exists for an Int64 value. RB incorrectly passes
>> only the lower 32 bits of the Int64 value to a plugin.
>
> This turns out to be incorrect. I wrote a very simple program:
>
> static long long getINT64(long long x)
> {
>       return x;
>       
> }/* getINT64 */
>
> and another method definition:
>
> { (REALproc) getINT64, REALnoImplementation, "getINT64(x As INT64) As
> INT64" }
>
> When tested, this worked perfectly. All 64 bits were passed. Something
> else is going on in changing an Int64 to a Decimal.
>
> Bob
>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
>
> Search the archives:
> <http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to