[Mesa-dev] [PATCH] util: Use LONG_MAX instead of LONG_BIT.

Matt Turner mattst88 at gmail.com
Sun Aug 9 15:30:04 PDT 2015


On Sun, Aug 9, 2015 at 2:40 PM, Jose Fonseca <jfonseca at vmware.com> wrote:
> More portable.  Based on Roland Scheidegger's idea.
>
> Tested with roundevent_test on Linux, MinGW, and MSVC.
>
> https://bugs.freedesktop.org/show_bug.cgi?id=91591
> ---
>  src/util/rounding.h | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/src/util/rounding.h b/src/util/rounding.h
> index 2d8f8d4..1116c31 100644
> --- a/src/util/rounding.h
> +++ b/src/util/rounding.h
> @@ -28,6 +28,9 @@
>
>  #include <math.h>
>  #include <limits.h>
> +#include <stdint.h>
> +
> +#include "macros.h" // STATIC_ASSERT

I don't think the STATIC_ASSERTs really add any safety, but they do
unfortunately cause us to include macros.h. :(

I'd personally remove them, but whatever you like.

Reviewed-by: Matt Turner <mattst88 at gmail.com>


More information about the mesa-dev mailing list