<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Oct 9, 2017 at 7:29 PM, Brian Paul <span dir="ltr"><<a href="mailto:brianp@vmware.com" target="_blank">brianp@vmware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">v2: use !! in the function to be explicit about type conversion.  Though,<br>
gcc generates the same code with or without the logical !!.<br>
---<br>
 src/mesa/main/imports.h | 6 ------<br>
 src/util/half_float.h   | 8 ++++++++<br>
 2 files changed, 8 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h<br>
index a4964a3..51fa72c 100644<br>
--- a/src/mesa/main/imports.h<br>
+++ b/src/mesa/main/imports.h<br>
@@ -333,12 +333,6 @@ _mesa_bitcount_64(uint64_t n);<br>
 #endif<br>
<br>
<br>
-static inline bool<br>
-_mesa_half_is_negative(<wbr>GLhalfARB h)<br>
-{<br>
-   return h & 0x8000;<br>
-}<br>
-<br>
 extern int<br>
 _mesa_snprintf( char *str, size_t size, const char *fmt, ... ) PRINTFLIKE(3, 4);<br>
<br>
diff --git a/src/util/half_float.h b/src/util/half_float.h<br>
index 64f2042..b3bc3f6 100644<br>
--- a/src/util/half_float.h<br>
+++ b/src/util/half_float.h<br>
@@ -25,6 +25,7 @@<br>
 #ifndef _HALF_FLOAT_H_<br>
 #define _HALF_FLOAT_H_<br>
<br>
+#include <stdbool.h><br>
 #include <stdint.h><br>
<br>
 #ifdef __cplusplus<br>
@@ -34,6 +35,13 @@ extern "C" {<br>
 uint16_t _mesa_float_to_half(float val);<br>
 float _mesa_half_to_float(uint16_t val);<br>
<br>
+static inline bool<br>
+_mesa_half_is_negative(<wbr>uint16_t h)<br>
+{<br>
+   return !!(h & 0x8000);<br></blockquote><div><br></div><div>I personally find != 0 to be easier to read.  Either way,</div><div><br></div><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+}<br>
+<br>
+<br>
 #ifdef __cplusplus<br>
 } /* extern C */<br>
 #endif<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.9.1<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>