[Xcb] [PATCH libxcb 03/18] c_client.py: fix pyflakes errors

Christian Linhart chris at DemoRecorder.com
Sun Mar 15 02:20:26 PDT 2015


Hi Ran,

Thank you for this patch.

I have tested it and it does not change the generated code.

Therefore, after a long delay:
Reviewed-by: Christian Linhart <chris at demorecorder.com>

Chris

P.S.: I am going to push this patch now because it really had more than enough time for being reviewed or for raising objections.

On 10/12/14 20:58, Ran Benita wrote:
> c_client.py:2: 'from xml.etree.cElementTree import *' used; unable to detect undefined names
> c_client.py:3: 'basename' imported but unused
> c_client.py:9: 'time' imported but unused
> c_client.py:1437: local variable 'list_obj' is assigned to but never used
> c_client.py:1745: local variable 'varfield' is assigned to but never used
> c_client.py:2050: local variable 'length' is assigned to but never used
> c_client.py:2416: local variable 'R_obj' is assigned to but never used
> c_client.py:2441: local variable 'S_obj' is assigned to but never used
>
> Signed-off-by: Ran Benita <ran234 at gmail.com>
> ---
>  src/c_client.py | 12 ------------
>  1 file changed, 12 deletions(-)
>
> diff --git a/src/c_client.py b/src/c_client.py
> index f3405b1..5860fb5 100644
> --- a/src/c_client.py
> +++ b/src/c_client.py
> @@ -1,12 +1,9 @@
>  #!/usr/bin/env python
> -from xml.etree.cElementTree import *
> -from os.path import basename
>  from functools import reduce
>  import getopt
>  import os
>  import sys
>  import errno
> -import time
>  import re
>  
>  # Jump to the bottom of this file for the main routine
> @@ -1434,7 +1431,6 @@ def _c_accessor_get_expr(expr, field_mapping):
>          return c_name
>      elif expr.op == 'sumof':
>          # locate the referenced list object
> -        list_obj = expr.lenfield_type
>          field = None
>          for f in expr.lenfield_parent.fields:
>              if f.field_name == expr.lenfield_name:
> @@ -1739,10 +1735,8 @@ def _c_complex(self, force_packed = False):
>      struct_fields = []
>      maxtypelen = 0
>  
> -    varfield = None
>      for field in self.fields:
>          if not field.type.fixed_size() and not self.is_switch and not self.is_union:
> -            varfield = field.c_field_name
>              continue
>          if field.wire:
>              struct_fields.append(field)
> @@ -2047,7 +2041,6 @@ def _c_request_helper(self, name, cookie_type, void, regular, aux=False, reply_f
>                          else:
>                              list_length = _c_accessor_get_expr(field.type.expr, None)
>  
> -                            length = ''
>                              _c("    xcb_parts[%d].iov_len = 0;" % count)
>                              _c("    xcb_tmp = (char *)%s;", field.c_field_name)
>                              _c("    for(i=0; i<%s; i++) {" % list_length)
> @@ -2412,8 +2405,6 @@ def _man_request(self, name, cookie_type, void, aux):
>              # 'R': parents[0] is always the 'toplevel' container type
>              params.append(('const %s *\\fIreply\\fP' % parents[0].c_type, parents[0]))
>              fields.update(_c_helper_field_mapping(parents[0], [('R', '->', parents[0])], flat=True))
> -            # auxiliary object for 'R' parameters
> -            R_obj = parents[0]
>  
>              if switch_obj is not None:
>                  # now look where the fields are defined that are needed to evaluate
> @@ -2437,9 +2428,6 @@ def _man_request(self, name, cookie_type, void, aux):
>                          prefix.append((p.name[-1], '.', p))
>                      fields.update(_c_helper_field_mapping(p, prefix, flat=True))
>  
> -                # auxiliary object for 'S' parameter
> -                S_obj = parents[1]
> -
>              if list.member.fixed_size():
>                  idx = 1 if switch_obj is not None else 0
>                  f.write('.HP\n')



More information about the Xcb mailing list