summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2022-12-03 17:15:46 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2022-12-03 17:19:50 +0000
commitf5842253bdb62fef9543e58ae38c232f5b4f982a (patch)
tree63b21310cfc75f1bb41d5bf36c8d3948b89fa7a4
parentb441838df4b58902c64eef094c635c23c8321895 (diff)
downloadlibcss-master.tar.gz
libcss-master.tar.bz2
select: generator: Simplify function parameter generationHEADmaster
-rw-r--r--src/select/select_generator.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/select/select_generator.py b/src/select/select_generator.py
index 6906478..9e92909 100644
--- a/src/select/select_generator.py
+++ b/src/select/select_generator.py
@@ -322,18 +322,16 @@ class CSSProperty:
"""
vals = []
for v in self.values:
+ star = '*' if pointer else ''
vt, vn = shift_star(v.type, v.name)
- vn += v.suffix
+ vn = star + vn + v.suffix
if pointer:
- vn = '*' + vn
if v.name == 'counter_arr' or v.name == 'content_item':
vt = 'const ' + vt
vals.append((vt, vn))
if v.bits is not None:
- bt, bn = shift_star(v.bits['type'], v.bits['name'])
- bn += v.suffix
- if pointer:
- bn = '*' + bn
+ bt = v.bits['type']
+ bn = star + v.bits['name'] + v.suffix
vals.append((bt, bn))
return vals