[gi-docgen/ebassi/bit-fields] generate: Include bits in structure fields
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gi-docgen/ebassi/bit-fields] generate: Include bits in structure fields
- Date: Sat, 11 Dec 2021 00:33:58 +0000 (UTC)
commit cd69287db1da70e3cdabc541f25a46e908cfe49d
Author: Emmanuele Bassi <ebassi gnome org>
Date: Sat Dec 11 00:33:14 2021 +0000
generate: Include bits in structure fields
If the GIR parser found them, we should include them in the C
declaration.
Fixes: #119
gidocgen/gdgenerate.py | 3 +++
1 file changed, 3 insertions(+)
---
diff --git a/gidocgen/gdgenerate.py b/gidocgen/gdgenerate.py
index 1168fe1..fa286b0 100644
--- a/gidocgen/gdgenerate.py
+++ b/gidocgen/gdgenerate.py
@@ -1166,6 +1166,7 @@ class TemplateField:
self.type_name = 'none'
self.type_cname = 'gpointer'
self.private = field.private
+ self.bits = field.bits
if field.doc is not None:
self.description = utils.preprocess_docs(field.doc.content, namespace)
else:
@@ -1632,6 +1633,8 @@ class TemplateRecord:
for field in self.fields:
if field.is_callback:
res += [f" {field.type_cname};"]
+ elif field.bits > 0:
+ res += [f" {field.type_cname} {field.name} : {field.bits};"]
else:
res += [f" {field.type_cname} {field.name};"]
else:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]