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 614864 - add g_key_file_get_int64, g_key_file_get_uint64 (from telepathy-glib)
add g_key_file_get_int64, g_key_file_get_uint64 (from telepathy-glib)
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2010-04-05 10:52 UTC by Simon McVittie
Modified: 2010-05-09 01:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed implementation, with trivial smoke-test (9.38 KB, patch)
2010-05-05 16:19 UTC, Simon McVittie
none Details | Review
updated patch (8.68 KB, patch)
2010-05-05 17:42 UTC, Simon McVittie
none Details | Review

Description Simon McVittie 2010-04-05 10:52:04 UTC
On gtk-devel-list, Andy Spencer requested a switch to gint64. Tor Lillqvist rejected this for compatibility reasons, and suggested adding separate accessors.

telepathy-glib already needs to store 64-bit integers in keyfiles, so we added some accessor functions, tp_g_key_file_get_[u]int64, implemented in terms of g_key_file_get_value: http://git.collabora.co.uk/?p=telepathy-glib.git;a=blob;f=telepathy-glib/util.c;hb=master#l755

I'll submit a patch to add these to GLib (unless someone extracts them from telepathy-glib first :-)

(Copyright status of those functions: © 2009 Collabora Ltd. / © 2009 Nokia Corporation.)
Comment 1 Matthias Clasen 2010-04-05 12:48:05 UTC
Sounds like a very reasonable addition.
Comment 2 Simon McVittie 2010-05-05 16:19:38 UTC
Created attachment 160354 [details] [review]
proposed implementation, with trivial smoke-test

Also available as the g_key_file_get_int64 branch in my repository:
* http://cgit.freedesktop.org/~smcv/glib/
* git://anongit.freedesktop.org/~smcv/glib
Comment 3 Matthias Clasen 2010-05-05 17:16:26 UTC
Implementation looks good to me. 
You probably want to update the copyright years to 2010.
The test should ideally be added to the existing glib/tests/keyfile.c file.
Please commit with that change.
Comment 4 Simon McVittie 2010-05-05 17:42:39 UTC
Created attachment 160364 [details] [review]
updated patch

> Implementation looks good to me. 
> You probably want to update the copyright years to 2010.

Indeed.

> The test should ideally be added to the existing glib/tests/keyfile.c file.

Oh, I'd wondered why /tests was smaller than I'd expected :-)

make -C glib check now passes (I added these functions to glib.symbols, too).

> Please commit with that change.

I don't have GNOME git access (that I know of); if you're happy with the updated patch, please apply it, or merge it from my freedesktop.org repository.