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>
#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);
#ifndef _HALF_FLOAT_H_
#define _HALF_FLOAT_H_
+#include <stdbool.h>
#include <stdint.h>
#ifdef __cplusplus
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