These cause a static analyzer to think we're trying to actually handle
them being NULL, which is not the case. They both must not be NULL,
period.
No idea why the code was like this originally.
Reviewed by mclasen on IRC.
Back in the far-off twentieth century, it was normal on unix
workstations for U+0060 GRAVE ACCENT to be drawn as "‛" and for U+0027
APOSTROPHE to be drawn as "’". This led to the convention of using
them as poor-man's ‛smart quotes’ in ASCII-only text.
However, "'" is now universally drawn as a vertical line, and "`" at a
45-degree angle, making them an `odd couple' when used together.
Unfortunately, there are lots of very old strings in glib, and also
lots of new strings in which people have kept up the old tradition,
perhaps entirely unaware that it used to not look stupid.
Fix this by just using 'dumb quotes' everywhere.
https://bugzilla.gnome.org/show_bug.cgi?id=700746
The way of getting the default value out of a GParamSpec is to allocate
a GValue, initialise it, then call g_param_spec_set_default() to set the
default value into that GValue.
This is exactly how we handle setting the default value for all of the
construct properties that were not explicitly passed to g_object_new().
Instead of doing the alloc/init/store on all construct properties on
every call to g_object_new(), we can cache those GValues in the private
data of the GParamSpec itself and reuse them.
This patch does not actually make that change to g_object_new() yet, but
it adds the API to GParamSpec so that a future patch to GObject can make
the change.
https://bugzilla.gnome.org/show_bug.cgi?id=698056
Either g_type_register_static_simple (used by G_DEFINE_TYPE_EXTENDED)
and G_IMPLEMENT_INTERFACE use automatic variables for GTypeInfo and
GInterfaceInfo structs, while tutorials and source code often use
static variables. This commit consistently adopts the former method.
https://bugzilla.gnome.org/show_bug.cgi?id=600161
All locks are now zero-initialised, so we can drop the G_*_INIT macros
for them.
Adjust various users around GLib accordingly and change the docs.
https://bugzilla.gnome.org/show_bug.cgi?id=659866
In an attempt to avoid some potential future abuses of the GParamSpec
API, qualify the 'name' field of the structure as 'const' and add a
comment noting that it is an interned string.
This is a theoretical API break, but it will only ever result in
warnings -- and even then, only if you were already doing something
questionable.
Clean up some of the warnings that were caused internally in gparam.c
from these changes.
g_object_class_list_properties tries to sort the returned list of
paramspecs by 'type depth' and param_id. But all the overridden
interface properties have a param_id of 0, so they come out in
a random order.
Bug 628253.
2008-08-20 Johan Dahlin <johan@gnome.org>
Bug 548689 – The type name for GParamSpec is wrong
* gparam.c (g_param_type_init):
Register the type name as GParam instead of GParamSpec.
svn path=/trunk/; revision=7374
2008-06-22 Michael Natterer <mitch@imendio.com>
* *.c: remove trailing whitespace from newly added gtk-doc
comments and reformatted some where they contained overly long or
ill-formatted lines.
svn path=/trunk/; revision=7090
2008-06-22 Michael Natterer <mitch@imendio.com>
* *.c: moved includes back to the top of the files (before gtk-doc
SECTION comments). Add "config.h" in all files and move system
included before glib includes. Remove trailing whitespace from
SECTION comments and did some reformatting where lines were overly
long, no documentation content was changed.
svn path=/trunk/; revision=7089
Wed Nov 23 18:01:46 2005 Tim Janik <timj@imendio.com>
* gobject.[hc]: added floating reference count.
g_object_is_floating():
g_object_ref_sink(): new functions to deal with floating references.
g_object_force_floating(): new funciton for object implementations
to set the floating flag.
* gobject.c (g_object_init): make objects initially floating.
Wed Nov 23 17:58:13 2005 Tim Janik <timj@gtk.org>
* gparam.[hc]: added g_param_spec_ref_sink().
Thu Sep 22 12:42:12 2005 Tim Janik <timj@gtk.org>
* gparam.c (g_param_spec_internal): fix pspec->name assignment which
needs to be strdup()ed for non G_PARAM_STATIC_NAME pspecs. this fixes
recently introduced crashes during plugin unloading.
also, ensure that static pspec names are canonicalized.
* gsignal.h: reverted last change from matthias, we don't guarantee
that type ids aren't mangled with G_SIGNAL_TYPE_STATIC_SCOPE anywhere.
2005-08-31 Matthias Clasen <mclasen@redhat.com>
* gparam.c (g_param_spec_internal): Intern the name here,
since we need the quark anyway when sending change notification.