Commit Graph

1156 Commits

Author SHA1 Message Date
Ryan Lortie
d89fb7bf10 gsignal: fix closure invalidation code
This is the bug that has been causing segfaults and criticals when accel
keys are used to close windows via GtkUIManager.

The main cause of this problem was a mistake made in the original patch
when modifying the handler_lookup() to take the extra 'closure'
parameter.  The original check used was:

    if (handler->sequential_number == handler_id ||
       (closure && handler->closure == closure))

It was called to find a particular closure like so:

    handler_lookup (instance, 0, closure, &signal_id);

The problem is that the check will return if either the signal ID or
closure matches (if a closure was given).  The calling code assumes 0 to
be an invalid signal ID which will match no handlers, but unfortunately
the rest of gsignal code uses this to denote a signal that has already
been disconnected.  The result is that this function was searching for a
matching closure _or_ the first already-disconnected handler.  When it
found the already-disconnected handler, we'd get criticals and crashes.

The condition has been corrected; it now ignores the handler_id
parameter if the closure parameter is non-NULL.

While we're in here, change the lifecycle of the invalidation notify to
be easier to understand.

Before, the notify was removed when the last reference on the handler
dropped.  This could happen in very many situations; often at the end of
an emission.  Instead, we now tie the registration of the notifier to
the lifecycle of the signal connection.  When the signal is disconnected
we remove the notification, even if other references are held (eg:
because it is currently being dispatched).

https://bugzilla.gnome.org/show_bug.cgi?id=690118
2013-01-16 23:04:11 -05:00
Chun-wei Fan
38229d47d1 Revert "Improvde #include order consistency"
This reverts commit f2e00a07f4.

Moving the block up would prevent G_OS_WIN32 being checked correctly as
it is a macro that is defined by including the GLib header(s), at least for
Visual C++ builds.

https://bugzilla.gnome.org/show_bug.cgi?id=691769
2013-01-15 19:35:52 +08:00
Ryan Lortie
5d42fdd068 visibility: Use a separate CFLAGS variable
We only want to control the default visibility for our five main
installable libraries: libglib, libgthread, libgmodule, libgobject,
libgio.  We should therefore only set -fvisibility=hidden when building
those.

Use a separate substitution variable for this purpose.

Using CFLAGS directly leads to some modules built in testcases not
exporting their symbols (and then the tests fail).  It also affects the
fam file monitoring module.

Colin had originally done it this way in his visibility patch series but
I failed to understand why so I didn't copy it.  Now I do.

Also: revert changes made to two testcases in an attempt to work around
this issue.

https://bugzilla.gnome.org/show_bug.cgi?id=691756
2013-01-14 23:31:59 -05:00
Matthias Clasen
57041baf58 Make the build more quiet 2013-01-14 16:14:28 -05:00
Martin Pitt
aac8267233 GParamSpec: Make constructors introspectable
Commit 282366c326 unnecessarily (skip)ed all the GParamSpec constructors like
g_param_spec_bool(). Make those introspectable by dropping the (skip) and
adding proper transfer annotations.

Keep g_param_spec_value_array() skipped as GValueArray is deprecated.
2013-01-14 11:36:14 +01:00
Ryan Lortie
068a119f74 win32: build: stop using .def files
With visibility now under the control of __declspec(dllexport) we no
longer need to build .def files or use them for building our various
.dll files.

.def files used to be installed (even though it is only really useful
when creating the .dll or .lib file).  Don't do that anymore either.

The Makefiles still contain rules to create a .lib file for use with
Visual Studio and these rules require .def files.  There are special
requirements to using these rules (like having installed and setup
Microsoft tools for use during the build) and therefore the problem of
creating a .def file for use with them is left open to anyone willing to
make the effort.  Many options are available depending on which
toolchain is in use (dlltool, pexport, gendef, dumpbin.exe, just to name
a few).

If we can find a free tool for creating .lib files in the future, we
should probably revisit this issue and add proper support back to our
build system.
2013-01-13 22:59:40 -05:00
Ryan Lortie
3bd09b5fa6 gmarshal.h: replace "extern" with GLIB_AVAILABLE_IN_ALL
This was one of the few public header files that was properly declaring
functions as "extern".  Switch it to use GLIB_AVAILABLE_IN_ALL instead.

https://bugzilla.gnome.org/show_bug.cgi?id=688681
2013-01-13 13:13:55 -05:00
Ryan Lortie
b91c476827 Add a new _GLIB_EXTERN macro for "extern"
This macro simply evaluates the "extern" unless it has been explicitly
defined to something else.

All of the version macros (including the unversioned deprecation markers
and GLIB_AVAILABLE_IN_ALL) now include _GLIB_EXTERN as part of their
definition.

G_INLINE has also been modified to use _GLIB_EXTERN where appropriate.

This macro should never be used outside of the gmacros.h/gversonmacros.h
headers.

The effect of this patch is that "extern" has now been added to all
functions declared in installed headers.  Strictly speaking, this is
something we should have had all along...

GLIB_VAR and GOBJECT_VAR have also been modified to use _GLIB_EXTERN on
non-Windows, instead of "extern" which they were using before.  The
eventual goal is to use the normal version/deprecation macros on
exported variables and drop GLIB_VAR but we need to see how this will
work on Windows before we go ahead with that.

https://bugzilla.gnome.org/show_bug.cgi?id=688681
2013-01-13 13:13:36 -05:00
Ryan Lortie
0156092a42 various: add GLIB_AVAILABLE_IN_ALL everywhere else
Add the GLIB_AVAILABLE_IN_ALL annotation to all old functions (that
haven't already been annotated with the GLIB_AVAILABLE_IN_* macros or a
deprecation macro).

If we discover in the future that we cannot use only one macro on
Windows, it will be an easy sed patch to fix that.

https://bugzilla.gnome.org/show_bug.cgi?id=688681
2013-01-13 13:11:57 -05:00
Ryan Lortie
c2055f22f4 gtype: disallow adding interfaces after the fact
Add a check to prevent adding an interface to a class that has already
had its class_init done.

This is an incompatible change but it is suspected that there are not
many users of this functionality.  Two known exceptions are pygobject
(fixed in bug 686149) and our own testsuite (affected tests have been
temporarily disabled by this patch).

Once we confirm that nobody else is using this functionality we can
remove a rather large amount of code for dealing with this case.

https://bugzilla.gnome.org/show_bug.cgi?id=687659
2013-01-04 21:20:04 +01:00
Rico Tzschichholz
efa7b5f1e7 Revert "gtype: disallow adding interfaces after the fact"
This reverts commit d6a075b0d8.
2013-01-04 20:25:46 +01:00
Dan Winship
03e84f936f GValueArray: clarify the deprecation warnings
GValueArray as a whole is deprecated in favor of GArray (with GValue
elements); warnings like "'g_value_array_get_nth' is deprecated: Use
'g_array_index' instead" are confusing because they suggest that the
GArray functions can be used with GValueArrays. Make them say "Use
'GArray' instead" instead.

https://bugzilla.gnome.org/show_bug.cgi?id=690970
2013-01-02 13:02:51 -05:00
Matthias Clasen
86610b0594 Move testgobject to tests/
And fix it to actually check the right things.
2013-01-01 14:06:20 -05:00
Matthias Clasen
f2e00a07f4 Improvde #include order consistency
This was mostly fixed already, just re-fix a few details here.
https://bugzilla.gnome.org/show_bug.cgi?id=71704
2013-01-01 13:54:54 -05:00
Jasper St. Pierre
5e62827efd gmarkup: Make GMarkupParseContext a boxed type
At the same time, add a refcount and public ref/unref methods.
This makes it usable from introspectable.

https://bugzilla.gnome.org/show_bug.cgi?id=690084
2013-01-01 11:03:19 -05:00
Matthias Clasen
e1b99b2ddc Move single-include guards inside include guards
gcc has optimizations for include guards that only work
if they are outermost in the the header.
https://bugzilla.gnome.org/show_bug.cgi?id=689810
2012-12-27 23:43:14 -05:00
Matthias Clasen
0178402c6d Revert "tests: port from g_test_trap_subprocess() to g_test_trap_fork()"
This reverts commit ea06ec8063.
2012-12-19 15:20:37 -05:00
Dan Winship
ea06ec8063 tests: port from g_test_trap_subprocess() to g_test_trap_fork()
(or, in a few cases, to g_test_expect_message())

https://bugzilla.gnome.org/show_bug.cgi?id=679683
2012-12-19 14:35:10 -05:00
Ryan Lortie
5df1edaf70 gtype: disallow adding interfaces after the fact
Add a check to prevent adding an interface to a class that has already
had its class_init done.

This is an incompatible change but it is suspected that there are not
many users of this functionality.  Two known exceptions are pygobject
(fixed in bug 686149) and our own testsuite (affected tests have been
temporarily disabled by this patch).

Once we confirm that nobody else is using this functionality we can
remove a rather large amount of code for dealing with this case.

https://bugzilla.gnome.org/show_bug.cgi?id=687659
2012-12-18 21:37:07 +01:00
Rico Tzschichholz
d1ab41c940 Revert "gtype: disallow adding interfaces after the fact"
This reverts commit d6a075b0d8.
2012-12-18 21:23:13 +01:00
Christophe Fergeau
b055c82815 Fix g_type_add_class_private() name in g_warning
When g_type_class_get_private is called without calling
g_type_add_class_private first, a g_warning is issued, but
the name of the function to call is wrong:
g_type_class_add_class_private.

https://bugzilla.gnome.org/show_bug.cgi?id=690348
2012-12-17 15:51:07 +01:00
Colin Walters
5baa26be72 gobject.symbols: Update for g_checksum_get_type()
See previous commit.
2012-12-10 20:30:44 -05:00
Colin Walters
bf1e63c2aa Make GChecksum more fully introspectable
In 2.34, g_compute_checksum_for_bytes() was added, but this patch
allows binding users to use the incremental update API; this is
significantly more efficient than reading entire files into memory.

https://bugzilla.gnome.org/show_bug.cgi?id=689982
2012-12-10 20:08:09 -05:00
Alexander Larsson
e218b96a6b Add g_type_get_type_registration_serial()
This lets you cache type lookup information and then know when
the cache information is out of date. In particular, we want this
in order to be able to cache g_type_from_name() lookups in the Gtk+
theme machinery.

https://bugzilla.gnome.org/show_bug.cgi?id=689847
2012-12-10 12:55:28 +01:00
Colin Walters
33de093b5a gobject: Use local variable names in macros less likely to clash
At least GDBus had code that had "_object" as a parameter to one of
its functions, but this clashes with the GObject macro
G_OBJECT_WARN_INVALID_PROPERTY_ID() which created a local "_object".

Since many of us cargo cult around copies of objects, let's be
defensive here and use local variable names less likely to clash with
application code.

https://bugzilla.gnome.org/show_bug.cgi?id=689377
2012-12-05 13:30:14 -05:00
Ryan Lortie
37f369a41e stop using libgthread internally
The gobject tools (glib-genmarshal and gobject-query) were linking
against libgthread.  Stop that.

Also, remove the gthread_INCLUDES internal automake substitution.
2012-11-25 14:51:04 -05:00
Kjell Ahlstedt
269f890474 GObject: Fix code snippet in description of floating reference.
https://bugzilla.gnome.org/show_bug.cgi?id=688180
2012-11-21 18:09:46 -05:00
Sebastian Dröge
46a92a760b Add boxed GType for GThread
https://bugzilla.gnome.org/show_bug.cgi?id=688704
2012-11-20 15:03:06 +01:00
Ryan Lortie
5272bc4d67 Revert "[gobject] set all properties before constructed()"
This reverts commit 028d4a03f2.

I thought that we would be able to get away with this incompatible
change but it appears to impact far too much existing code.  The only
thing we can do is revert.

https://bugzilla.gnome.org/show_bug.cgi?id=688596
2012-11-19 10:30:47 -05:00
Paul Menzel
834e6e96b3 docs: Fix spelling of "exceed" in gobject/gtype.c
https://bugzilla.gnome.org/show_bug.cgi?id=688338
2012-11-16 08:44:23 +00:00
Ryan Lortie
d6a075b0d8 gtype: disallow adding interfaces after the fact
Add a check to prevent adding an interface to a class that has already
had its class_init done.

This is an incompatible change but it is suspected that there are not
many users of this functionality.  Two known exceptions are pygobject
(fixed in bug 686149) and our own testsuite (affected tests have been
temporarily disabled by this patch).

Once we confirm that nobody else is using this functionality we can
remove a rather large amount of code for dealing with this case.

https://bugzilla.gnome.org/show_bug.cgi?id=687659
2012-11-05 13:20:28 -05:00
Martin Pitt
1af1b2b2bb Box GPollFD to make it introspectable
https://bugzilla.gnome.org/show_bug.cgi?id=686797
2012-11-05 14:41:31 +01:00
Simon Feltman
8e92798612 Add array length annotation to GSignalQuery param_types field
https://bugzilla.gnome.org/show_bug.cgi?id=687541
2012-11-04 13:51:15 +01:00
Colin Walters
8e59d8602c Use (void) for no parameters, not ()
This ensures we build with -Werror=missing-parameter-type.

https://bugzilla.gnome.org/show_bug.cgi?id=687385
2012-11-01 20:12:02 -04:00
Colin Walters
84475e4320 build: Prototype GType accessors for private classes
Otherwise we fail to build with -Werror=missing-prototypes.

https://bugzilla.gnome.org/show_bug.cgi?id=687385
2012-11-01 20:12:02 -04:00
Colin Walters
f6da43f56c build: Ensure we #include header files for glib-genmarshal code
Otherwise we fail with -Werror=missing-prototypes.

https://bugzilla.gnome.org/show_bug.cgi?id=687385
2012-11-01 20:12:01 -04:00
Colin Walters
4447d5ce11 tests/signals: Disable large enumeration value test that is failing on PPC64
Basically due to a combination of va_args semantics around
signed/unsigned ints, this test case fails on ppc64.  At the moment,
we have as yet to find any real-world consumer with such a large
enumeration value.

Unfortunately, the possible fixes for this are extremely invasive;
we would have to define a new enum API.

Given both of these facts, we believe it makes the most sense at the
current time to simply not test this. If we at a later time determine
there is such a real-world consumer, we can look at doing the
necessary fixes.

https://bugzilla.gnome.org/show_bug.cgi?id=686662
2012-10-31 17:45:21 -04:00
Martin Pitt
a5c5730085 Revert "Box GPollFD to make it introspectable"
This reverts commit 932f4250b8.

This got pushed accidentally and has not been accepted yet. It's also not clear
whether we want this in the first place.

https://bugzilla.gnome.org/show_bug.cgi?id=686797
2012-10-25 11:27:39 +02:00
Martin Pitt
932f4250b8 Box GPollFD to make it introspectable
https://bugzilla.gnome.org/show_bug.cgi?id=686797
2012-10-25 07:58:09 +02:00
Ryan Lortie
df02fa1e4c Properly deprecate g_type_init()
Now that all internal users of it are gone.

https://bugzilla.gnome.org/show_bug.cgi?id=686161
2012-10-16 09:39:24 -04:00
Ryan Lortie
1dc774a653 Remove g_type_init() calls
Very many testcases, some GLib tools (resource compiler, etc) and
GApplication were calling g_type_init().

Remove those uses, as they are no longer required.

https://bugzilla.gnome.org/show_bug.cgi?id=686161
2012-10-16 09:39:24 -04:00
Ryan Lortie
7c42ab23b5 Convert g_type_init() to a ctor
Move the guts of g_type_init() into a ctor and turn g_type_init() itself
into a do-nothing function.

g_type_init_with_debug_flags() now ignores its arguments, but it has
always been possible to achieve the same effect via environment
variables.

https://bugzilla.gnome.org/show_bug.cgi?id=686161
2012-10-16 09:39:24 -04:00
Matthias Clasen
691c0b053e Add missing semicolons to gobject_probes.d
Pointed out in
https://bugzilla.gnome.org/show_bug.cgi?id=686119
2012-10-15 19:48:44 -04:00
Ryan Lortie
a36028f386 gsignal: really fix closure invalidation
Commit 66b0d95f0b missed this part of the
patch.
2012-10-13 12:16:32 -04:00
Ryan Lortie
66b0d95f0b [gsignal] Fix closure invalidation
If the closure is invalidated we drop the ref on the signal handler
node, but if the signal is currently being dispatched, the ref could be
held elsewhere.

Flag that we no longer have an outstanding invalidation handler so that
we don't try to unregister ourselves when the other ref drops.

Add a testcase that catches this situation.
2012-10-09 11:40:45 -04:00
Ryan Lortie
028d4a03f2 [gobject] set all properties before constructed()
Move the constructed() call to happen after all of the properties are
set (not just the construct properties).

This is an incompatible change but we are making it under the belief
that it should be safe.  If this change impacts you in a negative way
please comment on the bug.

https://bugzilla.gnome.org/show_bug.cgi?id=685733
2012-10-08 11:40:00 -04:00
Ryan Lortie
8fd75705f4 fix g_signal_connect_object() documentation
g_signal_connect_object() now works properly, so we can remove the note
in the docs about it being broken.

https://bugzilla.gnome.org/show_bug.cgi?id=118536
2012-10-08 11:22:04 -04:00
Ryan Lortie
c15769d304 [gsignal] fix up a crasher in previous commit
The previous commit introduced a new variable in the Handler struct but
didn't initialise it.  This was causing some tests to crash.

https://bugzilla.gnome.org/show_bug.cgi?id=118536
2012-10-08 11:21:58 -04:00
Matthias Clasen
d03d26feab [gsignal] disconnect invalidated closures
Modify gsignal to automatically disconnect a GClosure that becomes
invalid (in the g_closure_invalidate() sense).

Previously, when g_signal_connect_object() was used with a GObject as
the user_data and that object was destroyed, the handler would no longer
be called but the signal handler was itself was not disconnected (ie:
the bookkeeping data was kept around).

The main effect of this patch is that these signal handlers will now
be automatically disconnected (and fully freed).

The documentation for g_signal_connect_object() has anticipated this
change for over 10 years and has advised the following workaround when
disconnecting signal handlers connected with g_signal_connect_object():

 if (g_signal_handler_is_connected (instance, id))
   g_signal_handler_disconnect (instance, id);

If your code follows this practice then it will continue to work.

If your code never disconnects the signal handler then it was wasting
memory before (and this commit fixes that).

If your code unconditionally disconnects the signal handler then you
will start to see (harmless) g_critical() warnings about this and you
should fix them.

https://bugzilla.gnome.org/show_bug.cgi?id=118536
2012-10-08 11:21:48 -04:00
Matthias Clasen
26ecc52073 Clarify g_type_init docs
Mention that there's no way to undo it.
https://bugzilla.gnome.org/show_bug.cgi?id=654239
2012-09-23 11:13:57 -04:00
Martin Pitt
02f143c2d9 Box GTimeZone to make it introspectable
https://bugzilla.gnome.org/show_bug.cgi?id=683167
2012-09-06 06:18:42 +02:00
Dan Winship
4d1b0d46db update .gitignore 2012-09-03 08:56:10 -04:00
Dan Winship
03be681e08 gobject/tests: plug leaks
https://bugzilla.gnome.org/show_bug.cgi?id=682560
2012-09-03 08:36:10 -04:00
Dan Winship
e0cba35d41 gobject/tests: use g_test_expect_messages()
https://bugzilla.gnome.org/show_bug.cgi?id=682560
2012-09-03 08:36:10 -04:00
Matthias Clasen
a30f6a6eb8 Add new api to symbol lists and docs
https://bugzilla.gnome.org/show_bug.cgi?id=682849
2012-09-02 15:10:20 -04:00
Matthias Clasen
d80d70458a Add a threaded test for g_object_replace_data
This is the threaded atomic add test from glib/tests/atomic.c,
redone using qdata instead of an atomic int to store the values.
2012-09-02 15:10:20 -04:00
Matthias Clasen
2fa77fb76c Add some tests for new object data api
These are non-threaded, but the do test dup and destroy somewhat.

https://bugzilla.gnome.org/show_bug.cgi?id=682849
2012-09-02 15:09:13 -04:00
Matthias Clasen
1254ca716b Add an atomic compare-and-exchange operation for object data
This is useful when using object data in thread-safe libraries.

https://bugzilla.gnome.org/show_bug.cgi?id=682849
2012-09-02 15:09:13 -04:00
Colin Walters
6e64ba58b9 Switch all open() calls to use g_open()
Because it now handles EINTR.  And we should do so.  While most people
use Linux, which tries very hard to avoid propagating EINTR back up
into userspace, it can still happen.

https://bugzilla.gnome.org/show_bug.cgi?id=682833
2012-08-28 13:56:59 -04:00
Matthias Clasen
4a8740d0d2 It is 'registered', not 'registred' 2012-08-18 23:17:47 -04:00
Matthias Clasen
e27367f341 Exterminate 'the the' 2012-08-18 23:15:58 -04:00
Mark Nauwelaerts
10fc00b385 gclosure: do not copy and leak when generically marshalling return value
https://bugzilla.gnome.org/show_bug.cgi?id=674800
2012-08-05 12:52:38 +01:00
Emmanuele Bassi
2a87010831 Constify collect and lcopy strings in GTypeValueTable
This avoids warnings when creating idiomatic value tables, like:

  static const GTypeValueTable _clutter_shader_float_value_table = {
    clutter_value_init_shader_float,
    clutter_value_free_shader_float,
    clutter_value_copy_shader_float,
    clutter_value_peek_pointer,
    "ip",
    clutter_value_collect_shader_float,
    "pp",
    clutter_value_lcopy_shader_float
  };

Because the strings are literals. And, really: nobody should be using
allocated values for the collection and lcopy strings.

https://bugzilla.gnome.org/show_bug.cgi?id=671545
2012-07-05 23:27:35 -04:00
Philipp Kern
240ef2b9e8 valuetransform: Fix definition of ulong_bool
On big endian 64 bit machines such as s390x, an uint is too small to hold a
ulong_bool; it needs to be an actual ulong.

https://bugzilla.gnome.org/show_bug.cgi?id=678949
http://bugs.debian.org/662057
2012-06-27 10:59:29 +02:00
Emmanuele Bassi
90f70099d8 Update the comment in gmarshal.list
The current note makes it look like the marshaller code generation has
been deprecated in favour of the libffi-based generic marshaller; this
is not the case, so we should probably clarify the point a bit.

https://bugzilla.gnome.org/show_bug.cgi?id=677235
2012-06-23 17:53:22 -04:00
Colin Walters
56411bb678 gsignal: Properly handle NULL nodes 2012-06-22 10:32:25 -04:00
Stefan Sauer
6c1276eb5f gtype: make these cases fatal.
Otherwise we crash with a null-ptr deref in g_object_newv and ever there we
should not return null, as we're saying that object creation will not return
null.
2012-06-12 20:45:29 +02:00
Philip Withnall
f642209ef4 gobject: Document notify signal deduplication with freeze/thaw
Expand the documentation for g_object_[freeze|thaw]_notify() to explain that
it deduplicates “notify” signals emitted by frozen objects, so that at most
one signal is emitted per property.

https://bugzilla.gnome.org/show_bug.cgi?id=676937
2012-05-28 15:47:07 +01:00
Colin Walters
a963712646 Annotate API introduced for 2.30 with GLIB_AVAILABLE_IN_2_30
I didn't do this comprehensively, since there's a lot of it, mainly
due to the GDBus object manager stuff, but anyone trying to use
that would fail fast due to lack of the gdbus code generator.

My main goal was to get API additions to existing classes like
g_data_input_stream_read_line_utf8(), as well as the lower level new
API like glib-unix.h.

https://bugzilla.gnome.org/show_bug.cgi?id=676816
2012-05-26 10:13:30 -04:00
Dan Winship
e011d2c921 Add g_type_ensure() and use it rather than playing games with volatile
https://bugzilla.gnome.org/show_bug.cgi?id=605976
2012-05-15 13:46:38 -04:00
Krzesimir Nowak
ed1f10bc1c docs: Fix typo in G_DEFINE_DYNAMIC_TYPE_EXTENDED example. 2012-05-04 09:31:25 +02:00
Xavier Claessens
00285b7517 Add g_clear_pointer()
Also reimplement g_clear_object() using g_clear_pointer()

https://bugzilla.gnome.org/show_bug.cgi?id=674634
2012-04-27 09:42:29 +02:00
Colin Walters
063ec9a75d build: Fix 'make dist' regression
Commit f084b60377 incorrectly set
DIST_SUBDIRS for the toplevel Makefile.am.  In general actually we
don't need to set it, because modern automake automatically sets
it by looking at conditionals for SUBDIRS.

Tested-by: Rico Tzschichholz <ricotz@t-online.de>

https://bugzilla.gnome.org/show_bug.cgi?id=667806
2012-04-25 15:41:48 -04:00
Matthias Clasen
58f0173149 Add tests for signal convenience api 2012-04-23 08:20:22 -04:00
Matthias Clasen
e62102dbc5 Add tests for toggle reference and qdata 2012-04-23 08:20:22 -04:00
Matthias Clasen
8b618eb7f1 Improve test coverage in gobject/tests
This is just making sure that we execute property getters/setters.
2012-04-23 08:20:21 -04:00
Colin Walters
f084b60377 build: Add --disable-modular-tests build option
This patch solves two problems:

First, it allows builders to optionally cut the circular dependency
between dbus and glib by disabling the modular tests (just like how
the tests can be disabled in dbus).

Second, the tests are entirely pointless to build if cross-compiling.

It also moves us slightly closer to the long term future we want where
the tests are a separate ./configure invocation and run against the
INSTALLED glib, not the one in the source tree. This would allow us to
run the tests constantly, not just when glib is built.

https://bugzilla.gnome.org/show_bug.cgi?id=667806
2012-04-15 11:15:54 -04:00
Jasper St. Pierre
825fdfdc9a gclosure: Support return values of GVariants
https://bugzilla.gnome.org/show_bug.cgi?id=673803
2012-04-09 23:41:00 -04:00
Matthias Clasen
ee29e49684 binding: Improve test coverage 2012-04-08 10:24:52 -04:00
Dieter Verfaillie
ce7f1a0789 Fix malformed GTK-Doc comment blocks: don't confuse GTK-Doc parsers.
Found these thanks to the improved gobject-introspection
GTK-Doc comment block/annotation parser.
See https://bugzilla.gnome.org/show_bug.cgi?id=672254

https://bugzilla.gnome.org/show_bug.cgi?id=673385
2012-04-05 10:23:45 -03:00
Dieter Verfaillie
0183c1f8a1 Fix malformed GTK-Doc comment blocks: invalid parameters and tags.
Found these thanks to the improved gobject-introspection
GTK-Doc comment block/annotation parser.
See https://bugzilla.gnome.org/show_bug.cgi?id=672254

https://bugzilla.gnome.org/show_bug.cgi?id=673385
2012-04-05 10:23:42 -03:00
Chun-wei Fan
24fa2ee53c gobject/tests/signals.c: Remove C99ism
Declare variables in start of block.
2012-04-05 15:46:34 +08:00
Guillaume Desmottes
091d652120 use GLIB_DEPRECATED_IN_2_32_FOR to deprecate g_value_{g,s}et_schar
https://bugzilla.gnome.org/show_bug.cgi?id=673439
2012-04-03 16:46:13 +02:00
Matthias Clasen
bebbc69081 Improve boxed test coverage
This commit add basic tests for all GLib types that are registered
as boxed types.
2012-04-01 23:08:42 -04:00
Matthias Clasen
2826ece6fc Fix distcheck
automake decided to complain about some more leftovers.
2012-03-19 16:58:48 -04:00
Dieter Verfaillie
e2b47ae9e0 Fix out of tree build for MinGW/MSYS
When building with MinGW/MSYS with srcdir != builddir the build fails:
- to locate the generated .def files
- creating libglib-gdb.py
- creating libgobject-gdb.py

Solved this by explicitly instructing these files to be generated
in $(builddir)/...

https://bugzilla.gnome.org/show_bug.cgi?id=653167
2012-03-17 23:10:01 -04:00
Colin Walters
cf912785b6 gtype: Note idempotency of g_type_init() 2012-03-16 11:49:30 -04:00
Mike Gorse
53b1afba0e Invalidate single_va_closure when adding an emission hook
If the optimization is used for only having one closure handling a
signal emission, then hooks will not be run, so it should be disabled
when an emission hook is added.

https://bugzilla.gnome.org/show_bug.cgi?id=671918
2012-03-14 06:01:36 -04:00
Alexander Larsson
cb44e96dfa Fix crash in signal emission optimization
The trace of the signal emission of the was calculating the instance
type after the instance was unrefed. Fix this by keeping the instance type around.
2012-03-09 11:32:45 +01:00
Alexander Larsson
bbe4b57195 signal emission: Allocate instance_and_param with alloca
This Gives a 5% performance increase in e.g. the emit-handled test.
2012-03-09 09:57:03 +01:00
Erik van Pienbroek
7b939efa6f Use native glib-genmarshal when cross-compiling
The ability to cross-compile glib got broken after the
merge of the 'signal-performance' branch as the assumption
was made that the generated glib-genmarshal can be executed
on the host (which isn't valid when cross-compiling).

Fixed this by using the just-built glib-genmarshal for normal
compilations and the native (host) glib-genmarshal when doing a
cross-compilation as was also done in several other areas of GLib

Tested for host=x86_64-unknown-linux-gnu, target=x86_64-unknown-linux-gnu
and host=x86_64-unknown-linux-gnu, target=i686-w64-mingw32

https://bugzilla.gnome.org/show_bug.cgi?id=671676
2012-03-09 08:24:28 +01:00
Chun-wei Fan
d642bf442f glib-genmarshal.c: Use G_VA_COPY instead of va_copy()
In the code generation portion, va_copy() is not universally available,
so use the existing G_VA_COPY macro that in turn calls va_copy() if it
is available or call an appropriate emulation otherwise.
2012-03-08 15:04:17 +08:00
Chun-wei Fan
b72bb9dd08 Use G_VA_COPY instead of va_copy()
va_vopy() is not universally available in all compilers, so make use of
the existing G_VA_COPY macro which either calls va_copy() if it is
available, or emulates it if otherwise.
2012-03-08 14:51:22 +08:00
Emmanuele Bassi
75ca1cd158 gobject: Fix a compiler warning
Shuffle the parenthesis around.
2012-03-07 12:53:14 +00:00
Alexander Larsson
026340c5fc Fix unused variable warning 2012-03-06 11:35:17 +01:00
Matthias Clasen
afe30b2884 Fix a compiler warning 2012-03-05 07:54:47 -05:00
Matthias Clasen
dea3619367 gobject: Fix symbol lists 2012-03-05 07:34:58 -05:00
Alexander Larsson
f3fb42cfaf Merge branch 'signal-performance' 2012-03-05 12:29:45 +01:00
Matthias Clasen
1426a8ca07 Fix binding properties of the same object
This problem was pointed out in bug 639873.
The patch here is based on Matt Barnes patch,
I've added a testcase as well.
2012-03-04 20:49:04 -05:00
Alexander Larsson
2d6502f67b fastpath: Do allow NO_RECURSE fastpath for NOP emissions
This fixes a performance regression wrt the old NOP emission
handler.
2012-03-03 21:36:10 +01:00