[Scummvm-git-logs] scummvm-tools master -> 4ec5ee3809f835ec711eb7b1c92b59133778c9bf

bgK bastien.bouclet at gmail.com
Sun Jun 24 21:15:12 CEST 2018


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm-tools' repo located at https://github.com/scummvm/scummvm-tools .

Summary:
4ec5ee3809 TOOLS: Fix SWAP_32 not to truncate at 16 bits


Commit: 4ec5ee3809f835ec711eb7b1c92b59133778c9bf
    https://github.com/scummvm/scummvm-tools/commit/4ec5ee3809f835ec711eb7b1c92b59133778c9bf
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2018-06-24T21:14:56+02:00

Commit Message:
TOOLS: Fix SWAP_32 not to truncate at 16 bits

Changed paths:
    common/endian.h


diff --git a/common/endian.h b/common/endian.h
index a7c0e0b..20ab962 100644
--- a/common/endian.h
+++ b/common/endian.h
@@ -41,8 +41,11 @@
 #endif
 
 static inline uint32 SWAP_32(uint32 a) {
-	return uint16(((a >> 24) & 0xFF) | ((a >> 8) & 0xFF00) | ((a << 8) & 0xFF0000) |
-		((a << 24) & 0xFF000000));
+	return (uint32)
+		(((a >> 24) & 0x000000FF) |
+		 ((a >>  8) & 0x0000FF00) |
+		 ((a <<  8) & 0x00FF0000) |
+		 ((a << 24) & 0xFF000000));
 }
 
 static inline uint16 SWAP_16(uint16 a) {





More information about the Scummvm-git-logs mailing list