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 563150 - G_GU?INT*_MODIFIER/FORMAT docs
G_GU?INT*_MODIFIER/FORMAT docs
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: docs
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2008-12-03 18:35 UTC by Behdad Esfahbod
Modified: 2008-12-08 02:12 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Behdad Esfahbod 2008-12-03 18:35:30 UTC
Glib defines these:

#define             G_GINT16_MODIFIER
#define             G_GINT16_FORMAT
#define             G_GUINT16_FORMAT
#define             G_GINT32_MODIFIER
#define             G_GINT32_FORMAT
#define             G_GUINT32_FORMAT
#define             G_GINT64_MODIFIER
#define             G_GINT64_FORMAT
#define             G_GUINT64_FORMAT
#define             G_GSIZE_MODIFIER
#define             G_GSIZE_FORMAT
#define             G_GSSIZE_FORMAT

But these are not linked from gint* docs.  I looked for them there, and around docs for g_printf.  None helped.

Next, the FORMAT docs say they are for scanning and printing, while the MODIFIER docs only say printing.  Does it mean they don't work with scanf?  That doesn't make much sense as, say, for gint16, printing is automatic and doesn't need any modifier (because int16 is promoted to int), but scanning always needs the right modifier.

Currently the docs do not provide any way to correctly read a guint32 from hex.  I need this for, say, reading a "U+1234" representation of a gunichar.
Comment 1 Matthias Clasen 2008-12-04 06:11:08 UTC
Sounds like a good idea to add some cross-references.

It may be that only printing is mentioned because we have g_print, but no g_scan.
Comment 2 Behdad Esfahbod 2008-12-08 02:12:04 UTC
2008-12-07  Behdad Esfahbod  <behdad@gnome.org>

        Bug 563150 – G_GU?INT*_MODIFIER/FORMAT docs

        * glib/tmpl/glib-unused.sgml:
        * glib/tmpl/macros_misc.sgml:
        * glib/tmpl/types.sgml:
        Update docs to mention scanning as well as printing.
        Cross reference these from their respective types.