After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 561296 - Add "storage type" to the typelib data for enums
Add "storage type" to the typelib data for enums
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2008-11-18 01:24 UTC by Owen Taylor
Modified: 2015-02-07 16:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add "storage type" to the typelib data for enums (11.07 KB, patch)
2008-11-18 01:24 UTC, Owen Taylor
committed Details | Review
Add enums to the Everything test module (2.92 KB, patch)
2008-11-18 01:28 UTC, Owen Taylor
committed Details | Review

Description Owen Taylor 2008-11-18 01:24:29 UTC
In order to set and get enum and flag fields in structures, we need
to know the integral type that the enumeration is stored as. We are already
computing that at compile time in order to compute struct offsets, so the
easiest thing to do is to save that in the typelib.

* docs/typelib-format.txt girepository/girnode.[ch] girepository/giroffsets.c
girepository/gtypelib.h: Add 'storage_type' to the typelib format for EnumBlob
and compute and save it at compile time.

* girepository/girepository.h girepository/ginfo.c:
Add g_enum_info_get_storage_type().

* girepository/gfield.c: Implement reading and writing enum and flags fields
based on the storage type.
Comment 1 Owen Taylor 2008-11-18 01:24:36 UTC
Created attachment 122893 [details] [review]
Add "storage type" to the typelib data for enums
Comment 2 Owen Taylor 2008-11-18 01:28:16 UTC
Created attachment 122894 [details] [review]
Add enums to the Everything test module

* tests/everything/everything.[ch]: Add TestEnum and TestFlags to the Everything
test module and register them as GTypes.

https://bugzilla.gnome.org/show_bug.cgi?id=561296
Comment 3 Colin Walters 2008-11-18 02:29:09 UTC
Trivial typo: implemenation

Otherwise looks good.
Comment 4 Owen Taylor 2008-11-18 12:29:56 UTC
Typo fixed, both patches committed.
Comment 5 André Klapper 2015-02-07 16:45:25 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]