Re: [Mesa-dev] [PATCH 4/7] u_math.h: fix 64 to 32 bit truncation warning

2014-07-28 Thread Brian Paul

On 07/22/2014 03:07 PM, Alon Levy wrote:

Signed-off-by: Alon Levy 
---
This file is common so this warning comes up a lot.

  src/gallium/auxiliary/util/u_math.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/util/u_math.h 
b/src/gallium/auxiliary/util/u_math.h
index 60995d7..7c1ac4a 100644
--- a/src/gallium/auxiliary/util/u_math.h
+++ b/src/gallium/auxiliary/util/u_math.h
@@ -760,7 +760,7 @@ util_bswap64(uint64_t n)
  #if defined(HAVE___BUILTIN_BSWAP64)
 return __builtin_bswap64(n);
  #else
-   return ((uint64_t)util_bswap32(n) << 32) |
+   return ((uint64_t)util_bswap32((uint32_t)n) << 32) |
util_bswap32((n >> 32));
  #endif
  }



Reviewed-by: Brian Paul 

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 4/7] u_math.h: fix 64 to 32 bit truncation warning

2014-07-22 Thread Alon Levy
Signed-off-by: Alon Levy 
---
This file is common so this warning comes up a lot.

 src/gallium/auxiliary/util/u_math.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/util/u_math.h 
b/src/gallium/auxiliary/util/u_math.h
index 60995d7..7c1ac4a 100644
--- a/src/gallium/auxiliary/util/u_math.h
+++ b/src/gallium/auxiliary/util/u_math.h
@@ -760,7 +760,7 @@ util_bswap64(uint64_t n)
 #if defined(HAVE___BUILTIN_BSWAP64)
return __builtin_bswap64(n);
 #else
-   return ((uint64_t)util_bswap32(n) << 32) |
+   return ((uint64_t)util_bswap32((uint32_t)n) << 32) |
   util_bswap32((n >> 32));
 #endif
 }
-- 
1.9.3

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev