diff options
author | Christian Beier <dontmind@freeshell.org> | 2016-06-05 18:19:47 +0200 |
---|---|---|
committer | Christian Beier <dontmind@freeshell.org> | 2016-06-05 18:19:47 +0200 |
commit | 6f4f31fe93a790e0b310eddcad9e5fc4f3a4ccb2 (patch) | |
tree | 08f81e9290bc9aa2b76679283caaf77433286c40 /rfb | |
parent | 962e1082e835b95abc448cacba2c9ea5cdd200c1 (diff) | |
parent | 684ebe02a202da178f8ae60e601f628ce801c9f9 (diff) | |
download | libtdevnc-6f4f31fe93a790e0b310eddcad9e5fc4f3a4ccb2.tar.gz libtdevnc-6f4f31fe93a790e0b310eddcad9e5fc4f3a4ccb2.zip |
Merge pull request #84 from plettix/master
fix for issue 81
Diffstat (limited to 'rfb')
-rw-r--r-- | rfb/rfb.h | 4 | ||||
-rw-r--r-- | rfb/rfbclient.h | 4 |
2 files changed, 4 insertions, 4 deletions
@@ -720,10 +720,10 @@ typedef struct _rfbClientRec { #define Swap24(l) ((((l) & 0xff) << 16) | (((l) >> 16) & 0xff) | \ (((l) & 0x00ff00))) -#define Swap32(l) (((l) >> 24) | \ +#define Swap32(l) ((((l) >> 24) & 0x000000ff)| \ (((l) & 0x00ff0000) >> 8) | \ (((l) & 0x0000ff00) << 8) | \ - ((l) << 24)) + (((l) & 0x000000ff) << 24)) extern char rfbEndianTest; diff --git a/rfb/rfbclient.h b/rfb/rfbclient.h index c18eaf9..37c47e4 100644 --- a/rfb/rfbclient.h +++ b/rfb/rfbclient.h @@ -47,13 +47,13 @@ (*(char *)&client->endianTest ? ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) : (s)) #define rfbClientSwap32IfLE(l) \ - (*(char *)&client->endianTest ? ((((l) & 0xff000000) >> 24) | \ + (*(char *)&client->endianTest ? ((((l) >> 24) & 0x000000ff) | \ (((l) & 0x00ff0000) >> 8) | \ (((l) & 0x0000ff00) << 8) | \ (((l) & 0x000000ff) << 24)) : (l)) #define rfbClientSwap64IfLE(l) \ - (*(char *)&client->endianTest ? ((((l) & 0xff00000000000000ULL) >> 56) | \ + (*(char *)&client->endianTest ? ((((l) >> 56 ) & 0xff00000000000000ULL) | \ (((l) & 0x00ff000000000000ULL) >> 40) | \ (((l) & 0x0000ff0000000000ULL) >> 24) | \ (((l) & 0x000000ff00000000ULL) >> 8) | \ |