Translate REAL (32bits Data type) to the equivalente in 64 bits

Started by GUAN DE DIO, June 03, 2010, 06:45:01 AM

Previous topic - Next topic

GUAN DE DIO

Hi everybody,

     I need to know what is the equivalent data type for REAL in 64 bits.

     I know for example that the HANDLE (in 32bits) is translate to QWORD, and  INT  is translate to DWORD. I don't remember well the equivalence to float data, and I don't find the website where I found these tips.


Thanks in advance,
GUAN

jj2007

Quote from: GUAN DE DIO on June 03, 2010, 06:45:01 AM
Hi everybody,

     I need to know what is the equivalent data type for REAL in 64 bits.

     I know for example that the HANDLE (in 32bits) is translate to QWORD, and  INT  is translate to DWORD. I don't remember well the equivalence to float data, and I don't find the website where I found these tips.


Thanks in advance,
GUAN

REAL is not a data type in Masm. REAL4, REAL8, REAL10 are - and that won't change in the 64-bit world afaik.

GUAN DE DIO

Ok I don't explain well.

That's the point.

     I'm currently translate the protocols of gdiplus for using the invoke macros declaring within xcalling64

    If we have for example this API
       
       GpStatus WINGDIPAPI GdipAddPathArc(
             GpPath *path,
             REAL x,
             REAL y,
             REAL width,
             REAL height,
             REAL startAngle,
             REAL sweepAngle
      );

     For making the translation I need to know what type data corresponding in 64bit with REAL type.

      I currently use REAL4, so my prototype is:

      funcproto extern, GdipAddPathArc,QWORD, REAL4, REAL4, REAL4, REAL4, REAL4, REAL4

      But I don't sure about it.

Best Regards,
GUAN

jj2007

Quote from: GUAN DE DIO on June 03, 2010, 07:47:30 AM
Ok I don't explain well.

Not your fault - my point was not clear enough.

If you have to convert an address, you obviously need to use 64 bits instead of 32 bits.

If you want to draw a rectangle on your 1280x960 screen, then a REAL4 with 6-7 digits of precision can help to determine if the length is 1279 or 1278, expressed as INT(1278.499) vs INT(1278.501). Changing that to REAL8 or REAL10 is an overkill of precision.
So logically it would be sufficient to stick with REAL4. Which is not a complete answer to your question, given that the developers of the 64-bit ABI seem to have an ambiguous and difficult relationship with logic... ::)

gwapo

Quote from: GUAN DE DIO on June 03, 2010, 07:47:30 AM
     I'm currently translate the protocols of gdiplus for using the invoke macros declaring within xcalling64

    If we have for example this API
       
       GpStatus WINGDIPAPI GdipAddPathArc(
             GpPath *path,
             REAL x,
             REAL y,
             REAL width,
             REAL height,
             REAL startAngle,
             REAL sweepAngle
      );


You would translate it using REAL4 as jj2007 said:


GdipAddPathArc proto :DWORD64, :REAL4, :REAL4, :REAL4, :REAL4, :REAL4, :REAL4

GUAN DE DIO

Well  I finally found the declaration


typedef float REAL; within GdiPlusTypes.h  so I'm right, I need to use REAL4 in my prototype.

Thanks for all.

GUAN