c_client.py: fix pyflakes errors
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@gmail.com> Reviewed-by: Christian Linhart <chris@demorecorder.com>
This commit is contained in:
parent
12d23b934f
commit
70d32ce7d8
|
@ -1,12 +1,9 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
from xml.etree.cElementTree import *
|
|
||||||
from os.path import basename
|
|
||||||
from functools import reduce
|
from functools import reduce
|
||||||
import getopt
|
import getopt
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import errno
|
import errno
|
||||||
import time
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
# Jump to the bottom of this file for the main routine
|
# Jump to the bottom of this file for the main routine
|
||||||
|
@ -1670,7 +1667,6 @@ def _c_accessor_get_expr(expr, field_mapping):
|
||||||
return c_name
|
return c_name
|
||||||
elif expr.op == 'sumof':
|
elif expr.op == 'sumof':
|
||||||
# locate the referenced list object
|
# locate the referenced list object
|
||||||
list_obj = expr.lenfield_type
|
|
||||||
field = None
|
field = None
|
||||||
for f in expr.lenfield_parent.fields:
|
for f in expr.lenfield_parent.fields:
|
||||||
if f.field_name == expr.lenfield_name:
|
if f.field_name == expr.lenfield_name:
|
||||||
|
@ -2069,10 +2065,8 @@ def _c_complex(self, force_packed = False):
|
||||||
struct_fields = []
|
struct_fields = []
|
||||||
maxtypelen = 0
|
maxtypelen = 0
|
||||||
|
|
||||||
varfield = None
|
|
||||||
for field in self.fields:
|
for field in self.fields:
|
||||||
if not field.type.fixed_size() and not self.is_switch and not self.is_union:
|
if not field.type.fixed_size() and not self.is_switch and not self.is_union:
|
||||||
varfield = field.c_field_name
|
|
||||||
continue
|
continue
|
||||||
if field.wire:
|
if field.wire:
|
||||||
struct_fields.append(field)
|
struct_fields.append(field)
|
||||||
|
@ -2377,7 +2371,6 @@ def _c_request_helper(self, name, cookie_type, void, regular, aux=False, reply_f
|
||||||
else:
|
else:
|
||||||
list_length = _c_accessor_get_expr(field.type.expr, None)
|
list_length = _c_accessor_get_expr(field.type.expr, None)
|
||||||
|
|
||||||
length = ''
|
|
||||||
_c(" xcb_parts[%d].iov_len = 0;" % count)
|
_c(" xcb_parts[%d].iov_len = 0;" % count)
|
||||||
_c(" xcb_tmp = (char *)%s;", field.c_field_name)
|
_c(" xcb_tmp = (char *)%s;", field.c_field_name)
|
||||||
_c(" for(i=0; i<%s; i++) {" % list_length)
|
_c(" for(i=0; i<%s; i++) {" % list_length)
|
||||||
|
@ -2742,8 +2735,6 @@ def _man_request(self, name, cookie_type, void, aux):
|
||||||
# 'R': parents[0] is always the 'toplevel' container type
|
# 'R': parents[0] is always the 'toplevel' container type
|
||||||
params.append(('const %s *\\fIreply\\fP' % parents[0].c_type, parents[0]))
|
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))
|
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:
|
if switch_obj is not None:
|
||||||
# now look where the fields are defined that are needed to evaluate
|
# now look where the fields are defined that are needed to evaluate
|
||||||
|
@ -2767,9 +2758,6 @@ def _man_request(self, name, cookie_type, void, aux):
|
||||||
prefix.append((p.name[-1], '.', p))
|
prefix.append((p.name[-1], '.', p))
|
||||||
fields.update(_c_helper_field_mapping(p, prefix, flat=True))
|
fields.update(_c_helper_field_mapping(p, prefix, flat=True))
|
||||||
|
|
||||||
# auxiliary object for 'S' parameter
|
|
||||||
S_obj = parents[1]
|
|
||||||
|
|
||||||
if list.member.fixed_size():
|
if list.member.fixed_size():
|
||||||
idx = 1 if switch_obj is not None else 0
|
idx = 1 if switch_obj is not None else 0
|
||||||
f.write('.HP\n')
|
f.write('.HP\n')
|
||||||
|
|
Loading…
Reference in New Issue