MAKELONGLONG macro



  • Hi!

    I woluld like to use a macro to create QListWidgetItem longlong data. I would like to store two long variable in it. I created this macro like MAKELONG, but not working, contains only lower long, the higher is always zero:

    #define MAKELONGLONG(l, h) ((LONGLONG)(((LONG)(l) & 0xffffffff) | (((LONG)(h) & 0xffffffff) << 32)))
    

    Any ideas?
    Thanks in advance.



  • Ok, I found the solution, before shifting left the hilong, required to cast it to LONGLONG, this code is working:

    #define MAKELONGLONG(l, h) ((LONGLONG)(((LONG)(l) & 0xffffffff) | (((LONGLONG)(h) & 0xffffffff) << 32)))
    

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.