[Mesa-dev] [PATCH 34/41] glapi: glX_proto_send.py: don't unpack useless values.

Ian Romanick idr at freedesktop.org
Tue Apr 19 23:32:42 UTC 2016


This patch is

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

On 03/31/2016 05:04 PM, Dylan Baker wrote:
> There are two ways to handle this. One is to use the _ placeholder value
> when multiple values are needed. The second is to use list indexing to
> get only the values actually needed when only one value is desired.
> 
> Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
> ---
>  src/mapi/glapi/gen/glX_proto_send.py | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/src/mapi/glapi/gen/glX_proto_send.py b/src/mapi/glapi/gen/glX_proto_send.py
> index 3de11d4..8ea799a 100644
> --- a/src/mapi/glapi/gen/glX_proto_send.py
> +++ b/src/mapi/glapi/gen/glX_proto_send.py
> @@ -65,7 +65,7 @@ def hash_pixel_function(func):
>      hash_suf = ""
>      for param in func.parameterIterateGlxSend():
>          if param.is_image():
> -            [dim, junk, junk, junk, junk] = param.get_dimensions()
> +            dim = param.get_dimensions()[0]
>  
>              d = (dim + 1) & ~1
>              hash_pre = "%uD%uD_" % (d - 1, d)
> @@ -512,7 +512,7 @@ class PrintGlxProtoStubs(glX_proto_common.glx_print_proto):
>                      print '(void) memcpy((void *)(%s + %u), zero, 4);' % (pc, (param.offset + param.size()) + adjust)
>  
>              else:
> -                [dim, width, height, depth, extent] = param.get_dimensions()
> +                dim, width, height, depth, _ = param.get_dimensions()
>                  if f.glx_rop == ~0:
>                      dim_str = "dim"
>                  else:
> @@ -662,7 +662,7 @@ class PrintGlxProtoStubs(glX_proto_common.glx_print_proto):
>                  print '        %s_reply_t *reply = %s_reply(c, %s, NULL);' % (xcb_name, xcb_name, xcb_request)
>                  if output:
>                      if output.is_image():
> -                        [dim, w, h, d, junk] = output.get_dimensions()
> +                        dim, w, h, d, _ = output.get_dimensions()
>                          if f.dimensions_in_reply:
>                              w = "reply->width"
>                              h = "reply->height"
> @@ -732,7 +732,7 @@ class PrintGlxProtoStubs(glX_proto_common.glx_print_proto):
>  
>              for p in f.parameterIterateOutputs():
>                  if p.is_image():
> -                    [dim, w, h, d, junk] = p.get_dimensions()
> +                    dim, w, h, d, _ = p.get_dimensions()
>                      if f.dimensions_in_reply:
>                          print "        __glXReadPixelReply(dpy, gc, %u, 0, 0, 0, %s, %s, %s, GL_TRUE);" % (dim, p.img_format, p.img_type, p.name)
>                      else:
> @@ -796,7 +796,7 @@ class PrintGlxProtoStubs(glX_proto_common.glx_print_proto):
>                  p_string += ", " + param.name
>  
>                  if param.is_image():
> -                    [dim, junk, junk, junk, junk] = param.get_dimensions()
> +                    dim = param.get_dimensions()[0]
>  
>                  if f.pad_after(param):
>                      p_string += ", 1"
> 



More information about the mesa-dev mailing list