mesa: move _mesa_half_is_negative() to half_float.h
authorBrian Paul <brianp@vmware.com>
Thu, 5 Oct 2017 19:34:52 +0000 (13:34 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 10 Oct 2017 17:28:31 +0000 (11:28 -0600)
v2: use !! in the function to be explicit about type conversion.  Though,
gcc generates the same code with or without the logical !!.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/main/imports.h
src/util/half_float.h

index a4964a34ccabb515c2992f49c33a5f63e7d0a6b6..51fa72cbc37a465ae52d144df1434d9004095ace 100644 (file)
@@ -333,12 +333,6 @@ _mesa_bitcount_64(uint64_t n);
 #endif
 
 
 #endif
 
 
-static inline bool
-_mesa_half_is_negative(GLhalfARB h)
-{
-   return h & 0x8000;
-}
-
 extern int
 _mesa_snprintf( char *str, size_t size, const char *fmt, ... ) PRINTFLIKE(3, 4);
 
 extern int
 _mesa_snprintf( char *str, size_t size, const char *fmt, ... ) PRINTFLIKE(3, 4);
 
index 64f2042101857f4b6560446a43337ece72ee7666..b3bc3f687ad9647597426e679fa024d8073f2698 100644 (file)
@@ -25,6 +25,7 @@
 #ifndef _HALF_FLOAT_H_
 #define _HALF_FLOAT_H_
 
 #ifndef _HALF_FLOAT_H_
 #define _HALF_FLOAT_H_
 
+#include <stdbool.h>
 #include <stdint.h>
 
 #ifdef __cplusplus
 #include <stdint.h>
 
 #ifdef __cplusplus
@@ -34,6 +35,13 @@ extern "C" {
 uint16_t _mesa_float_to_half(float val);
 float _mesa_half_to_float(uint16_t val);
 
 uint16_t _mesa_float_to_half(float val);
 float _mesa_half_to_float(uint16_t val);
 
+static inline bool
+_mesa_half_is_negative(uint16_t h)
+{
+   return !!(h & 0x8000);
+}
+
+
 #ifdef __cplusplus
 } /* extern C */
 #endif
 #ifdef __cplusplus
 } /* extern C */
 #endif