<p dir="ltr"><br>
On Apr 3, 2016 7:51 PM, "Kenneth Graunke" <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>> wrote:<br>
><br>
> %ld and %lu aren't the right format specifiers for int64_t and uint64_t<br>
> on 32-bit (x86) systems.  They're %zu on Linux and %Iu on Windows.<br>
><br>
> Use the standard C99 macros in hopes that they work everywhere.<br>
><br>
> Signed-off-by: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><br>
> ---<br>
>  src/compiler/nir/nir_search.c | 5 +++--<br>
>  1 file changed, 3 insertions(+), 2 deletions(-)<br>
><br>
> diff --git a/src/compiler/nir/nir_search.c b/src/compiler/nir/nir_search.c<br>
> index 6e63063..c17d47b 100644<br>
> --- a/src/compiler/nir/nir_search.c<br>
> +++ b/src/compiler/nir/nir_search.c<br>
> @@ -25,6 +25,7 @@<br>
>   *<br>
>   */<br>
><br>
> +#include <inttypes.h><br>
>  #include "nir_search.h"<br>
><br>
>  struct match_state {<br>
> @@ -483,7 +484,7 @@ construct_value(const nir_search_value *value,<br>
>           break;<br>
><br>
>        case nir_type_int:<br>
> -         load-><a href="http://def.name">def.name</a> = ralloc_asprintf(load, "%ld", c->data.i);<br>
> +         load-><a href="http://def.name">def.name</a> = ralloc_asprintf(load, "%" PRIi64, c->data.i);</p>
<p dir="ltr">Another option is to simply use lld and llu.  That should be 64-bits on all the platforms we care about.</p>
<p dir="ltr">>           switch (bitsize->dest_size) {<br>
>           case 32:<br>
>              load->value.i32[0] = c->data.i;<br>
> @@ -497,7 +498,7 @@ construct_value(const nir_search_value *value,<br>
>           break;<br>
><br>
>        case nir_type_uint:<br>
> -         load-><a href="http://def.name">def.name</a> = ralloc_asprintf(load, "%lu", c->data.u);<br>
> +         load-><a href="http://def.name">def.name</a> = ralloc_asprintf(load, "%" PRIu64, c->data.u);<br>
>           switch (bitsize->dest_size) {<br>
>           case 32:<br>
>              load->value.u32[0] = c->data.u;<br>
> --<br>
> 2.7.4<br>
><br>
> _______________________________________________<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">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</p>