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 614629 - utils: Use G_GNUC_CONST instead of G_GNUC_PURE for conversion functions
utils: Use G_GNUC_CONST instead of G_GNUC_PURE for conversion functions
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other All
: Normal normal
: 0.10.29
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-04-02 00:25 UTC by Philip Withnall
Modified: 2010-06-28 09:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
utils: Use G_GNUC_CONST instead of G_GNUC_PURE for conversion functions (2.47 KB, patch)
2010-04-02 00:25 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2010-04-02 00:25:02 UTC
The numeric conversion and scaling functions in gstutils.h can be marked
as const functions, since they only operate on their parameters.

I haven't tested the patch, but it should be OK.
Comment 1 Philip Withnall 2010-04-02 00:25:05 UTC
Created attachment 157728 [details] [review]
utils: Use G_GNUC_CONST instead of G_GNUC_PURE for conversion functions

Closes: bgo
Comment 2 Sebastian Dröge (slomo) 2010-04-02 16:44:05 UTC
commit 6ca0b51e4e00a296a09cc0290ac179a52c3a80f6
Author: Philip Withnall <philip@tecnocode.co.uk>
Date:   Fri Apr 2 01:16:16 2010 +0100

    utils: Use G_GNUC_CONST instead of G_GNUC_PURE for conversion functions
    
    Fixes bug #614629.
Comment 3 Tim-Philipp Müller 2010-06-28 08:59:00 UTC
As it turns out, this wasn't actually quite ok, see bug #623003 for details. Might want to double-check similar changes made elsewhere as well.
Comment 4 Sebastian Dröge (slomo) 2010-06-28 09:03:49 UTC
The conversion functions are correct, only the scaling functions are not. I don't think we use G_GNUC_{CONST,PURE} anywhere else.
Comment 5 Tim-Philipp Müller 2010-06-28 09:20:41 UTC
I meant in other non-GStreamer libraries (I seem to remember there were similar changes in other modules/libs).
Comment 6 Philip Withnall 2010-06-28 09:51:11 UTC
(In reply to comment #5)
> I meant in other non-GStreamer libraries (I seem to remember there were similar
> changes in other modules/libs).

I've proposed a few other pure/const patches for other projects, but they're for less esoteric functions. I'll go and review them just in case.
Comment 7 Philip Withnall 2010-06-28 09:59:54 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > I meant in other non-GStreamer libraries (I seem to remember there were similar
> > changes in other modules/libs).
> 
> I've proposed a few other pure/const patches for other projects, but they're
> for less esoteric functions. I'll go and review them just in case.

My memory fails me. I proposed some patches to make various parameters const pointers, but not add any other G_GNUC_[CONST|PURE] function attributes. The only other place I've used them is in my own projects, and they've worked fine there (but they were with somewhat more ordinary functions).

Sorry for all this trouble. :-(