GNOME Bugzilla – Bug 614629
utils: Use G_GNUC_CONST instead of G_GNUC_PURE for conversion functions
Last modified: 2010-06-28 09:59:54 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.
Created attachment 157728 [details] [review] utils: Use G_GNUC_CONST instead of G_GNUC_PURE for conversion functions Closes: bgo
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.
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.
The conversion functions are correct, only the scaling functions are not. I don't think we use G_GNUC_{CONST,PURE} anywhere else.
I meant in other non-GStreamer libraries (I seem to remember there were similar changes in other modules/libs).
(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.
(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. :-(