Re: [Mesa-dev] [PATCH 2/2] mesa: Fix printf format specifier warn of the ptrdiff_t

2015-07-30 Thread Jose Fonseca
That's correct. We should use the inttypes.h PRI*PTR specifiers for 
portability.


Unfortunately there's no such format specificier for size_t or ssize_t, 
but  I believe intptr_t  should match on all platforms we support.


Jose

On 30/07/15 00:53, Ilia Mirkin wrote:

I assume that you mean the C99 spec? I don't think MSVC supports %t or %z :(

On Wed, Jul 29, 2015 at 7:46 PM, Edward O'Callaghan
 wrote:

See §7.19.6.1, paragraph 7 of the ISO C specification.

Signed-off-by: Edward O'Callaghan 
---
  src/mesa/main/bufferobj.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 9425b09..453b864 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -2372,7 +2372,7 @@ _mesa_map_buffer_range(struct gl_context *ctx,

 if (offset + length > bufObj->Size) {
_mesa_error(ctx, GL_INVALID_VALUE,
-  "%s(offset %ld + length %ld > buffer_size %ld)", func,
+  "%s(offset %td + length %td > buffer_size %td)", func,
offset, length, bufObj->Size);
return NULL;
 }
--
2.4.3

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev



___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] mesa: Fix printf format specifier warn of the ptrdiff_t

2015-07-29 Thread Ilia Mirkin
On Wed, Jul 29, 2015 at 10:18 PM, Edward O'Callaghan
 wrote:
> On Thu, Jul 30, 2015, at 09:53 AM, Ilia Mirkin wrote:
>> I assume that you mean the C99 spec? I don't think MSVC supports %t or %z
>> :(
>
> Correct, why not it is standard C99 sounds like a compiler bug to me if
> that is really the case :/

Be that as it may, it does get used to build the code, and so the core
code has to work with it. Driver code (except swrast) doesn't matter.

I believe the usual way to fix it is just to do %ll and typecast to long long.

  -ilia
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] mesa: Fix printf format specifier warn of the ptrdiff_t

2015-07-29 Thread Edward O'Callaghan
On Thu, Jul 30, 2015, at 09:53 AM, Ilia Mirkin wrote:
> I assume that you mean the C99 spec? I don't think MSVC supports %t or %z
> :(

Correct, why not it is standard C99 sounds like a compiler bug to me if
that is really the case :/

> 
> On Wed, Jul 29, 2015 at 7:46 PM, Edward O'Callaghan
>  wrote:
> > See §7.19.6.1, paragraph 7 of the ISO C specification.
> >
> > Signed-off-by: Edward O'Callaghan 
> > ---
> >  src/mesa/main/bufferobj.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
> > index 9425b09..453b864 100644
> > --- a/src/mesa/main/bufferobj.c
> > +++ b/src/mesa/main/bufferobj.c
> > @@ -2372,7 +2372,7 @@ _mesa_map_buffer_range(struct gl_context *ctx,
> >
> > if (offset + length > bufObj->Size) {
> >_mesa_error(ctx, GL_INVALID_VALUE,
> > -  "%s(offset %ld + length %ld > buffer_size %ld)", func,
> > +  "%s(offset %td + length %td > buffer_size %td)", func,
> >offset, length, bufObj->Size);
> >return NULL;
> > }
> > --
> > 2.4.3
> >
> > ___
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] mesa: Fix printf format specifier warn of the ptrdiff_t

2015-07-29 Thread Ilia Mirkin
I assume that you mean the C99 spec? I don't think MSVC supports %t or %z :(

On Wed, Jul 29, 2015 at 7:46 PM, Edward O'Callaghan
 wrote:
> See §7.19.6.1, paragraph 7 of the ISO C specification.
>
> Signed-off-by: Edward O'Callaghan 
> ---
>  src/mesa/main/bufferobj.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
> index 9425b09..453b864 100644
> --- a/src/mesa/main/bufferobj.c
> +++ b/src/mesa/main/bufferobj.c
> @@ -2372,7 +2372,7 @@ _mesa_map_buffer_range(struct gl_context *ctx,
>
> if (offset + length > bufObj->Size) {
>_mesa_error(ctx, GL_INVALID_VALUE,
> -  "%s(offset %ld + length %ld > buffer_size %ld)", func,
> +  "%s(offset %td + length %td > buffer_size %td)", func,
>offset, length, bufObj->Size);
>return NULL;
> }
> --
> 2.4.3
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev