Author: andrew
Date: Mon Jun 26 22:32:52 2017
New Revision: 320388
URL: https://svnweb.freebsd.org/changeset/base/320388

Log:
  In _bswap16 and _bswap32 cast constant values to the appropriate type. This is
  similar to what is done in the x86 code.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/arm64/include/endian.h

Modified: head/sys/arm64/include/endian.h
==============================================================================
--- head/sys/arm64/include/endian.h     Mon Jun 26 21:45:33 2017        
(r320387)
+++ head/sys/arm64/include/endian.h     Mon Jun 26 22:32:52 2017        
(r320388)
@@ -106,12 +106,12 @@ __bswap16_var(__uint16_t v)
 
 #define        __bswap16(x)    \
     ((__uint16_t)(__builtin_constant_p(x) ?    \
-     __bswap16_constant(x) :                   \
+     __bswap16_constant((__uint16_t)x) :       \
      __bswap16_var(x)))
 
 #define        __bswap32(x)    \
     ((__uint32_t)(__builtin_constant_p(x) ?    \
-     __bswap32_constant(x) :                   \
+     __bswap32_constant((__uint32_t)x) :       \
      __bswap32_var(x)))
 
 #else
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to