Commit Graph

1033 Commits

Author SHA1 Message Date
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
Alexander Larsson
b05ea89d0c Mask out G_SIGNAL_TYPE_STATIC_SCOPE when comparing types 2012-03-02 20:22:29 +01:00
Emmanuele Bassi
d10f79a196 build: Fix rules for marshalers.[ch] 2012-03-02 17:06:36 +00:00
Alexander Larsson
3d52ee999a Add more tests for signal emissions 2012-03-02 17:13:04 +01:00
Alexander Larsson
f02ec2f2de Optimize single-handler va_marshaller case
When there is only one closure handling a signal emission and
it doesn't have a bunch of complicated features enabled we
can short circuit the va_args collection into GValues and call the
callback via the va_marshaller directly.

https://bugzilla.gnome.org/show_bug.cgi?id=661140
2012-03-02 17:13:03 +01:00
Alexander Larsson
a3e91088ce Use builtin marshallers and va_marshallers if possible
If the signal argumment types matches a built in standard
marshaller we use the va_marshaller for that, and also the
normal marshaller if NULL was specified (as its faster than
the generic one).
2012-03-02 17:13:03 +01:00
Alexander Larsson
7964cda8e6 Add g_signal_set_va_marshaller
This lets you set a va_marshaller on your signal which will be
propagated to all closures for the signal. Also, automatically
uses the generica va_marshaller if you specify a NULL c_marshaller.

https://bugzilla.gnome.org/show_bug.cgi?id=661140
2012-03-02 17:13:03 +01:00
Alexander Larsson
1c4f0ca483 Add _g_closure_is_void to check for NULL vfuncs
https://bugzilla.gnome.org/show_bug.cgi?id=661140
2012-03-02 17:13:03 +01:00
Alexander Larsson
57051905f9 Support generating va marshallers in glib-genmarshal
https://bugzilla.gnome.org/show_bug.cgi?id=661140
2012-03-02 17:13:03 +01:00
Alexander Larsson
588af03a28 Add optional support for varargs marshallers to GClosure
These closures support being invoked on a va_args which can
be useful as you can then avoid boxing the va_args into
GValues in certain cases.

https://bugzilla.gnome.org/show_bug.cgi?id=661140
2012-03-02 17:13:03 +01:00
Alexander Larsson
d5fbbe400a Add GRealClosure and move meta_marshallers there
This means we're not abusing the notifiers for meta_marshallres,
and we're able to later cleanly add other fields to GClosure.

We still have to leave the ABI intact for the GClosure->meta_marshal
bit, as old G_CLOSURE_N_NOTIFIERS macro instances still accesses it.
However, we always set it to zero to keep those macros working.

https://bugzilla.gnome.org/show_bug.cgi?id=661140
2012-03-02 17:13:03 +01:00
Christian Dywan
cb0566eaf3 gobject/gtype.c: Emphasize use of priv in member and use g_return_val_if_fail
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=597785

Signed-off-by: Javier Jardón <jjardon@gnome.org>
2012-03-01 21:40:35 +00:00
Emmanuele Bassi
ede8707129 Version the deprecation of g_value_array_get_type()
Just like the rest of the GValueArray API.
2012-02-29 17:56:06 +00:00
Emmanuele Bassi
817d992abc value array: Annotate with versioned deprecation
https://bugzilla.gnome.org/show_bug.cgi?id=670542
2012-02-27 00:00:05 -05:00
Christian Persch
d70634526d regex: Remove --disable-regex option
https://bugzilla.gnome.org/show_bug.cgi?id=622149
2012-02-26 22:22:56 -05:00
David King
500aafd099 docs: Clarify g_type_register_fundamental() behaviour
https://bugzilla.gnome.org/show_bug.cgi?id=580873
2012-02-26 22:21:19 -05:00
Rui Matos
9ff09f34cf gvaluetransform: Fix an infinite loop with GFlagsValue sets with the 0 value
Transforming a GValue holding flags from a GFlagsValue set that includes the 0
value (no flag bits set) into a string would loop until exhausting all the
available memory.

https://bugzilla.gnome.org/show_bug.cgi?id=670557
2012-02-22 12:17:38 +01:00
Dan Winship
ca05902a58 Add G_GNUC_BEGIN/END_IGNORE_DEPRECATIONS
Add new macros to disable -Wdeprecated-declarations around a piece of
code, using the C99 (and GNU89) _Pragma() operator. Replace the
existing use of #pragma for this in gio, and suppress the warnings in
gvaluearray.c as well.

https://bugzilla.gnome.org/show_bug.cgi?id=669671
2012-02-15 09:54:38 -05:00
Dan Winship
ab59739e11 gobject: Use a destructor rather than g_atexit() for refcount debugging
https://bugzilla.gnome.org/show_bug.cgi?id=669671
2012-02-15 09:54:38 -05:00
Dan Winship
f049262a61 glib-mkenums: fix handling of forward enum declarations
Given

    typedef enum MyFoo MyFoo;

glib-mkenums would get confused, not notice the ";", and then keep
skipping lines until it found one that started with a "{", possibly
even going into the next file.

Fix it to just ignore those lines instead (and also, to error out if
it hits eof while parsing an enum).

https://bugzilla.gnome.org/show_bug.cgi?id=669595
2012-02-07 13:32:22 -05:00
Matthias Clasen
9ffc3391ed Fix doc syntax 2012-01-30 15:37:28 -05:00
Matthias Clasen
b01af10c86 Remove a check that triggers deprecation warnings 2012-01-30 14:06:22 -05:00
Emmanuele Bassi
0ac9ab4e27 Deprecate GValueArray
The GValueArray type was added in a time, during the Jurassic era or so,
when GArray did not have a representable GType. The GValueArray API has
various issues as well:

  - it doesn't match the other GLib array types;
  - it is not reference counted;
  - the structure is fully exposed on the stack, so it cannot be
    extended to add reference counting;
  - it cannot be forcibly resized.

The nice thing is that now we have a GArray type that can replace in
full GValueArray, so we can deprecate the latter, and reduce the
complexity in GLib, application code, and bindings.

https://bugzilla.gnome.org/show_bug.cgi?id=667228
2012-01-24 23:37:24 -05:00
Ryan Lortie
cf48434867 gsignal: add g_signal_handlers_disconnect_by_data
Similar to g_signal_handlers_disconnect_by_func() but disconnects all
functions that use the given user_data.

https://bugzilla.gnome.org/show_bug.cgi?id=668269
2012-01-19 10:49:31 -05:00