sal/rtl/uuid.cxx |   12 ------------
 1 file changed, 12 deletions(-)

New commits:
commit 49279212597db3993e1f8f1f70be873a2e22fe2f
Author:     Arnaud VERSINI <arnaud.vers...@libreoffice.org>
AuthorDate: Sat Aug 13 14:42:19 2022 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Tue Sep 27 10:59:22 2022 +0200

    rtl uuid : remove useless endian conversion
    
    Change-Id: I65a4dad0aceb83f2449c86c438cb478937c8b90a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138229
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sal/rtl/uuid.cxx b/sal/rtl/uuid.cxx
index 5d348cb8f8e7..22e7f0fe0416 100644
--- a/sal/rtl/uuid.cxx
+++ b/sal/rtl/uuid.cxx
@@ -25,14 +25,6 @@
 #include <rtl/uuid.h>
 #include <rtl/digest.h>
 
-#define SWAP_INT32_TO_NETWORK(x)\
-               { sal_uInt32 y = x;\
-                 sal_uInt8 *p = reinterpret_cast<sal_uInt8 *>(&(x)); \
-                 p[0] = static_cast<sal_uInt8>( ( y >> 24 ) & 0xff );\
-                 p[1] = static_cast<sal_uInt8>( ( y >> 16 ) & 0xff );\
-                 p[2] = static_cast<sal_uInt8>( ( y >> 8 )  & 0xff );\
-                 p[3] = static_cast<sal_uInt8>( ( y ) & 0xff);\
-               }
 #define SWAP_INT16_TO_NETWORK(x)\
                { sal_uInt16 y = x;\
                  sal_uInt8 *p = reinterpret_cast<sal_uInt8 *>(&(x)); \
@@ -75,8 +67,6 @@ static void write_v3( sal_uInt8 *pUuid  )
     // copy to avoid alignment problems
     memcpy(&uuid, pUuid, 16);
 
-    SWAP_NETWORK_TO_INT32(uuid.time_low);
-    SWAP_NETWORK_TO_INT16(uuid.time_mid);
     SWAP_NETWORK_TO_INT16(uuid.time_hi_and_version);
 
     /* put in the variant and version bits */
@@ -85,8 +75,6 @@ static void write_v3( sal_uInt8 *pUuid  )
     uuid.clock_seq_hi_and_reserved &= 0x3F;
     uuid.clock_seq_hi_and_reserved |= 0x80;
 
-    SWAP_INT32_TO_NETWORK(uuid.time_low);
-    SWAP_INT16_TO_NETWORK(uuid.time_mid);
     SWAP_INT16_TO_NETWORK(uuid.time_hi_and_version);
 
     memcpy(pUuid, &uuid, 16);

Reply via email to