platform/upstream/glib.git
11 years agoFix the GLib Visual Studio Projects
Chun-wei Fan [Mon, 27 May 2013 05:23:58 +0000 (13:23 +0800)]
Fix the GLib Visual Studio Projects

Define the G_LOG_DOMAIN of the GLib DLL as "GLib", because:
-This makes it consistent with the autotools builds
-Some tests expect the log domain to be "GLib"

11 years agoUpdate config.h.win32(.in)
Chun-wei Fan [Mon, 27 May 2013 04:49:47 +0000 (12:49 +0800)]
Update config.h.win32(.in)

Make the entries of config.h.win32(.in) consistent with the entries
that are generated from the autotools build (config.h.in).

11 years agoAvoid a segfault in gdbus tool
Matthias Clasen [Sun, 26 May 2013 03:07:03 +0000 (23:07 -0400)]
Avoid a segfault in gdbus tool

When the interface name is invalid, we don't get an error
back from g_dbus_connection_call_sync.

11 years agobuild: Fix usage of %.test again
Colin Walters [Fri, 24 May 2013 21:16:44 +0000 (22:16 +0100)]
build: Fix usage of %.test again

We actually need the first dependency because it includes the
final executable name.  Rather, fix the original bug by using
the variable $(EXEEXT).

11 years agotests: Drop unnecessary % from .test pattern match rule
Colin Walters [Fri, 24 May 2013 19:42:12 +0000 (15:42 -0400)]
tests: Drop unnecessary % from .test pattern match rule

On Windows, the executables will have .exe, so this won't
match.  Furthermore, they aren't actually dependent on the
executable to build.

11 years agoUpdated Spanish translation
Daniel Mustieles [Fri, 24 May 2013 11:57:47 +0000 (13:57 +0200)]
Updated Spanish translation

11 years agoAssamese translation updated
Nilamdyuti Goswami [Fri, 24 May 2013 11:58:12 +0000 (17:28 +0530)]
Assamese translation updated

11 years agoUpdated Gujarati Translations
Sweta Kothari [Fri, 24 May 2013 07:51:27 +0000 (13:21 +0530)]
Updated Gujarati Translations

11 years agoG_GNUC_FORMAT: documentation error
Simon Kågedal Reimer [Mon, 6 May 2013 20:04:32 +0000 (22:04 +0200)]
G_GNUC_FORMAT: documentation error

Attribute should be placed just before the semicolon, not after.
As can be seen in the example.

https://bugzilla.gnome.org/show_bug.cgi?id=699779

11 years agospelling fixes of 'runtine' and 'adresses' in cross.xml and running.xml, respectively
Jason L. Quinn [Fri, 12 Apr 2013 03:43:17 +0000 (23:43 -0400)]
spelling fixes of 'runtine' and 'adresses' in cross.xml and running.xml, respectively

https://bugzilla.gnome.org/show_bug.cgi?id=697849

11 years agogsignal: remove some pointless locking
Ryan Lortie [Thu, 21 Feb 2013 17:48:04 +0000 (17:48 +0000)]
gsignal: remove some pointless locking

We previously hold a lock in the loop that collects the arguments for
g_signal_emit(), which we drop before calling into the argument
collection functions and reacquire again at the bottom of the loop (ie:
one release/acquire pair for each argument collected).  To make matters
worse, the lock is just released again after the loop.

Presumably that was done to protect the access to the parameter array,
but it's pretty unlikely that this is needed because the only way it
changes is if the signal is unloaded.  That only happens when unloading
types which is quite unlikely to happen while we are emitting on an
instance of that type (and, as an aside, never happens anymore anyway).

If we move the unlock below the loop up above it and remove the
acquire/release pair from the loop, we improve performance in the new
arg-collecting performance tests by ~15% (more like ~18% in the case
where we only emit to one handler -- where argument collection dominates
more).

https://bugzilla.gnome.org/show_bug.cgi?id=694380

11 years agoperformance test: add signal test with args
Ryan Lortie [Thu, 21 Feb 2013 17:47:08 +0000 (17:47 +0000)]
performance test: add signal test with args

Add a signal that has some typical arguments (a uint and a pointer)
since all of the other signal performance tests are for signals with no
args.

https://bugzilla.gnome.org/show_bug.cgi?id=694380

11 years agoperformance test: share some code
Ryan Lortie [Thu, 21 Feb 2013 17:44:56 +0000 (17:44 +0000)]
performance test: share some code

The handled and unhandled cases share the same data and _run()
functions.  Refactor into a common section.

https://bugzilla.gnome.org/show_bug.cgi?id=694380

11 years agogunixconnection: added ngettext to support plural forms
Elisabeth Henry [Mon, 1 Apr 2013 02:11:01 +0000 (04:11 +0200)]
gunixconnection: added ngettext to support plural forms

While those strings ("Expecting 1 control message, got %d" and
"Expecting one fd, but got %d\n") have same singular/plural form
in english, it is not necessarily the case in other languages.

https://bugzilla.gnome.org/show_bug.cgi?id=695233

11 years agoGLocalFileOutputStream: Further deduplicate error code path
Colin Walters [Thu, 9 May 2013 17:47:50 +0000 (18:47 +0100)]
GLocalFileOutputStream: Further deduplicate error code path

Just code cleanup.

https://bugzilla.gnome.org/699959

11 years agoGLocalFileOutputStream: Deduplicate stream creation code
Colin Walters [Thu, 9 May 2013 17:39:50 +0000 (18:39 +0100)]
GLocalFileOutputStream: Deduplicate stream creation code

Lots of copy/paste of the error handling path, let's deduplicate
so I can sanely patch this code later.

https://bugzilla.gnome.org/699959

11 years agogdbus-peer: Drop some usage of g_thread_yield()
Colin Walters [Wed, 22 May 2013 16:41:32 +0000 (17:41 +0100)]
gdbus-peer: Drop some usage of g_thread_yield()

It's a recipe for race conditions and error; on some hardware
architectures one thread isn't guaranteed to see the results
of writes from another thread without a cache flush.

https://bugzilla.gnome.org/show_bug.cgi?id=700855

11 years agoglib/tests/cond: Fix race condition
Colin Walters [Thu, 23 May 2013 00:07:13 +0000 (01:07 +0100)]
glib/tests/cond: Fix race condition

The producer could push two values with the first one being
lost.  Fix this by blocking the producer until a consumer
reads.

11 years agogtestutils: Use stdio rather than write() to be Windows-friendly
Dan Winship [Wed, 22 May 2013 17:20:08 +0000 (14:20 -0300)]
gtestutils: Use stdio rather than write() to be Windows-friendly

Windows doesn't define STDOUT_FILENO and STDERR_FILENO, and they're
not even guaranteed to be 1 and 2. So just use stdio instead. Also fix
a counting error. Pointed out on gtk-devel-list.

11 years agoTimeout the test if dbus sevice has not appeared in due time.
Josep Puigdemont [Tue, 21 May 2013 14:46:25 +0000 (16:46 +0200)]
Timeout the test if dbus sevice has not appeared in due time.

The test /gdbus/connection/large_message waits for a dbus name to appear.
The dbus name is created by a another process executed in the background.
If for some reason this fails, the test will likely wait forever.
This will avoid this situation by making the test fail if the dbus service
has not appeared after 10 seconds.

https://bugzilla.gnome.org/show_bug.cgi?id=698981

11 years agopo: update for quote changes
Dan Winship [Tue, 21 May 2013 12:52:32 +0000 (09:52 -0300)]
po: update for quote changes

https://bugzilla.gnome.org/show_bug.cgi?id=700746

11 years agoUse 'dumb quotes' rather than `really dumb quotes'
Dan Winship [Mon, 20 May 2013 20:54:48 +0000 (17:54 -0300)]
Use 'dumb quotes' rather than `really dumb quotes'

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

11 years agotests: fix a few recently-broken tests
Dan Winship [Tue, 21 May 2013 14:21:36 +0000 (11:21 -0300)]
tests: fix a few recently-broken tests

11 years agogio/tests: Fix gdbus-connection when run from "make check"
Colin Walters [Tue, 21 May 2013 13:21:21 +0000 (09:21 -0400)]
gio/tests: Fix gdbus-connection when run from "make check"

11 years agoConvert more tests to installed tests
Matthias Clasen [Tue, 21 May 2013 01:05:56 +0000 (21:05 -0400)]
Convert more tests to installed tests

This makes the tests in tests installed, except for
the performance tests.

11 years agoConvert more tests to installed tests
Matthias Clasen [Tue, 21 May 2013 01:05:56 +0000 (21:05 -0400)]
Convert more tests to installed tests

11 years agogio/tests: gsettings is a developer-only test
Colin Walters [Mon, 20 May 2013 23:12:31 +0000 (00:12 +0100)]
gio/tests: gsettings is a developer-only test

It tries to run glib-compile-schemas and glib-mkenums, which
we won't have in the runtime tree.

Anyways it's kind of a dumb test since the best test for
compilation tools is...compiling things, which we already
do frequently.

11 years agogmessages: Fix up testing commit to handle fatal masquerading
Colin Walters [Mon, 20 May 2013 23:07:18 +0000 (00:07 +0100)]
gmessages: Fix up testing commit to handle fatal masquerading

This makes glib/tests/testing pass again.

11 years agogio/tests: Disable desktop-app-info test in installed mode for now
Colin Walters [Mon, 20 May 2013 23:02:39 +0000 (00:02 +0100)]
gio/tests: Disable desktop-app-info test in installed mode for now

It wants a writable copy of the applications, and appears to
depend on a prior execution of "mimeapps".  This will take
a bit of work to untangle.

11 years agogio/tests: Make gdbus-peer work in installed mode
Colin Walters [Mon, 20 May 2013 20:50:28 +0000 (21:50 +0100)]
gio/tests: Make gdbus-peer work in installed mode

There's no /etc/hosts in gnome-ostree...

11 years agogio/tests: Fix gapplication test in installed mode
Colin Walters [Mon, 20 May 2013 20:43:52 +0000 (21:43 +0100)]
gio/tests: Fix gapplication test in installed mode

11 years agogio/tests: Some more fixes for installed tests
Colin Walters [Mon, 20 May 2013 20:33:00 +0000 (21:33 +0100)]
gio/tests: Some more fixes for installed tests

file passes now, appinfo needs a bit more work, but is getting
there.

11 years agogio/tests: Deduplicate Makefile.am a bit
Colin Walters [Mon, 20 May 2013 19:15:43 +0000 (20:15 +0100)]
gio/tests: Deduplicate Makefile.am a bit

We can just add all the static test data to EXTRA_DIST.

11 years agogtestutils: Ensure test subprocesses don't dump core
Colin Walters [Mon, 20 May 2013 13:31:48 +0000 (14:31 +0100)]
gtestutils: Ensure test subprocesses don't dump core

Since we expect them to crash, let's not spam the system
core dump collection (systemd, abrt).  At the moment
systemd is not very robust against programs crashing
in loops.

Instead of aborting, we exit(1).

https://bugzilla.gnome.org/show_bug.cgi?id=700714

11 years agoUpdated Norwegian bokmål translation
Kjartan Maraas [Mon, 20 May 2013 12:51:04 +0000 (14:51 +0200)]
Updated Norwegian bokmål translation

11 years agoConvert remaining gio tests to installed
Matthias Clasen [Mon, 20 May 2013 12:46:21 +0000 (08:46 -0400)]
Convert remaining gio tests to installed

11 years agoConvert some gio tests to installed tests
Matthias Clasen [Mon, 20 May 2013 10:38:41 +0000 (06:38 -0400)]
Convert some gio tests to installed tests

11 years agoMake gobject tests installable
Matthias Clasen [Mon, 20 May 2013 01:49:51 +0000 (21:49 -0400)]
Make gobject tests installable

This makes the gobject tests run as part of the ostree integration
tests.

11 years ago[l10n] Updated Italian translation.
Milo Casagrande [Sun, 19 May 2013 11:30:46 +0000 (13:30 +0200)]
[l10n] Updated Italian translation.

11 years agoAdd --enable-installed-tests configure option
Colin Walters [Mon, 6 May 2013 13:47:00 +0000 (09:47 -0400)]
Add --enable-installed-tests configure option

See https://live.gnome.org/GnomeGoals/InstalledTests for more
information.

The tests now support being run both uninstalled and installed, so
'make check' works for those who want it.  For tests which need data
files, the way this works is they look in the compiled in value of
SRCDIR by default, and the generated tests use "env G_TEST_DATA=" to
override that.

This patch only converts glib/tests for now; if this patch looks good,
I'll do the rest of the tests.

https://bugzilla.gnome.org/show_bug.cgi?id=699079

11 years agoglib/tests: Drop unnecessary SRCDIR definitions
Colin Walters [Mon, 6 May 2013 13:24:25 +0000 (09:24 -0400)]
glib/tests: Drop unnecessary SRCDIR definitions

It's always going to be defined, we don't support compiling these
tests "by hand".  This is a cleanup commit for the installed tests
work.

https://bugzilla.gnome.org/show_bug.cgi?id=699079

11 years agoglib/tests: Use explicit file listings
Colin Walters [Fri, 3 May 2013 22:36:43 +0000 (18:36 -0400)]
glib/tests: Use explicit file listings

This is a preparatory commit for installed tests work; having things
cleanly categorized helps.

https://bugzilla.gnome.org/show_bug.cgi?id=699079

11 years agoglib/tests/mappedfile: Copy test file before writing to it
Colin Walters [Fri, 3 May 2013 22:13:51 +0000 (18:13 -0400)]
glib/tests/mappedfile: Copy test file before writing to it

This way we're *always* testing writability rather than only sometimes
doing it in the source directory.

https://bugzilla.gnome.org/show_bug.cgi?id=699079

11 years agoAdded Aragonese translation
Jorge Pérez Pérez [Wed, 15 May 2013 21:05:10 +0000 (23:05 +0200)]
Added Aragonese translation

11 years agom4macros/glib-gettext.m4: Don't use AC_HEADER_STDC
Adrian Bunk [Mon, 13 May 2013 22:48:37 +0000 (01:48 +0300)]
m4macros/glib-gettext.m4: Don't use AC_HEADER_STDC

AC_HEADER_STDC is obsolete (pre-C89 headers are no longer an issue),
and the resulting STDC_HEADERS define is anyway not used.

https://bugzilla.gnome.org/show_bug.cgi?id=700263

11 years agoupdated kn translations
Shankar Prasad [Tue, 14 May 2013 09:56:07 +0000 (15:26 +0530)]
updated kn translations

11 years agotests/slice: use G_GNUC_BEGIN_IGNORE_DEPRECATIONS
Dan Winship [Mon, 13 May 2013 15:47:12 +0000 (11:47 -0400)]
tests/slice: use G_GNUC_BEGIN_IGNORE_DEPRECATIONS

rather than implementing it by hand

11 years agogtestutils: use g_clear_pointer
Dan Winship [Mon, 13 May 2013 15:38:53 +0000 (11:38 -0400)]
gtestutils: use g_clear_pointer

11 years agogtestutils: deprecate g_test_trap_fork()
Dan Winship [Wed, 5 Dec 2012 16:28:53 +0000 (11:28 -0500)]
gtestutils: deprecate g_test_trap_fork()

https://bugzilla.gnome.org/show_bug.cgi?id=679683

11 years agotests: port from g_test_trap_subprocess() to g_test_trap_fork()
Dan Winship [Sat, 24 Nov 2012 20:58:36 +0000 (15:58 -0500)]
tests: port from g_test_trap_subprocess() to g_test_trap_fork()

https://bugzilla.gnome.org/show_bug.cgi?id=679683

11 years agotests/protocol: redo a bit
Dan Winship [Sun, 25 Nov 2012 16:50:09 +0000 (11:50 -0500)]
tests/protocol: redo a bit

Rather than overloading --verbose, just skip the tests that aren't
supposed to be run in the parent process (so that if you do run the
toplevel test with --verbose, it doesn't immediately error out).

https://bugzilla.gnome.org/show_bug.cgi?id=679683

11 years agogtestutils: add g_test_trap_subprocess()
Dan Winship [Sat, 24 Nov 2012 20:58:27 +0000 (15:58 -0500)]
gtestutils: add g_test_trap_subprocess()

g_test_trap_fork() doesn't work on Windows and is potentially flaky on
unix anyway given the fork-but-don't-exec. Replace it with
g_test_trap_subprocess(), which re-spawns the same program with
arguments telling it to run a specific (otherwise-ignored) test case.

Make the existing g_test_trap_fork() unit tests be unix-only (they
never passed on Windows anyway), and add a parallel set of
g_test_trap_subprocess() tests.

Also fix the logic of gtestutils's "-p" argument (which is used by the
subprocess tests); previously if you had tests "/foo/bar" and
"/foo/bar/baz", and ran the test program with "-p /foo/bar/baz", it
would run "/foo/bar" too. Fix that and add tests.

https://bugzilla.gnome.org/show_bug.cgi?id=679683

11 years agog_test_trap_fork: don't blow away the SIGCHLD handler
Dan Winship [Wed, 19 Dec 2012 20:59:55 +0000 (15:59 -0500)]
g_test_trap_fork: don't blow away the SIGCHLD handler

Not sure why it was doing this, but it's not necessary (all of glib's
tests pass fine without it), and it breaks tests that try to use
g_spawn_sync() or GChildWatchSource after doing a g_test_trap_fork().

https://bugzilla.gnome.org/show_bug.cgi?id=679683

11 years agotests/spawn-*.c: fix on Windows
Dan Winship [Sun, 25 Nov 2012 18:52:20 +0000 (13:52 -0500)]
tests/spawn-*.c: fix on Windows

Need to append ".exe" to the spawned binary name on Windows

https://bugzilla.gnome.org/show_bug.cgi?id=679683

11 years agoapp: Document when floating variants are consumed
Christian Persch [Sun, 12 May 2013 19:52:54 +0000 (21:52 +0200)]
app: Document when floating variants are consumed

Bug #700203.

11 years agoUpdated Odia Translation.
ManojKumar Giri [Fri, 10 May 2013 06:38:27 +0000 (12:08 +0530)]
Updated Odia Translation.

11 years agoClarify GValueArray docs
Matthias Clasen [Thu, 9 May 2013 20:02:52 +0000 (16:02 -0400)]
Clarify GValueArray docs

Don't refer to Quicksort in the documentation of
g_value_array_sort, but just to qsort().

11 years agoUpdated Telugu Translations
Krishnababu Krothapalli [Thu, 9 May 2013 12:33:09 +0000 (18:03 +0530)]
Updated Telugu Translations

11 years agoFix minor typos in GSocketConnectable example code
Zeeshan Ali (Khattak) [Tue, 20 Mar 2012 20:40:32 +0000 (22:40 +0200)]
Fix minor typos in GSocketConnectable example code

11 years agoDeclare res_init() for builds against Android's Bionic
Sebastian Dröge [Mon, 6 May 2013 14:06:48 +0000 (16:06 +0200)]
Declare res_init() for builds against Android's Bionic

res_init() exists in the C library here and as such is detected
by configure, but it is not declared in any header.

11 years agoGProxyAddressEnumerator: add default-port property
Dan Winship [Sun, 5 May 2013 20:50:43 +0000 (16:50 -0400)]
GProxyAddressEnumerator: add default-port property

Although none of the in-tree GSocketConnectable types need it, other
types (like SoupAddress) may find it useful to be able to pass a URI
and a default-port to GProxyAddressEnumerator separately (the same way
you can with GNetworkAddress). So add a default-port property.

https://bugzilla.gnome.org/show_bug.cgi?id=698877

11 years agoDocument all gtester-report options
Matthias Clasen [Sun, 5 May 2013 01:10:43 +0000 (21:10 -0400)]
Document all gtester-report options

The --subunit option was missing from the man page.

11 years agoDocument all glib-mkenums placeholders
Matthias Clasen [Sun, 5 May 2013 01:08:18 +0000 (21:08 -0400)]
Document all glib-mkenums placeholders

The @ENUMPREFIX@ placeholder was missing in the man page.

11 years agoDocument all glib-genmarshal options
Matthias Clasen [Sun, 5 May 2013 01:05:24 +0000 (21:05 -0400)]
Document all glib-genmarshal options

The --stdinc option was missing from the man page.

11 years agoFix a typo
Matthias Clasen [Sun, 5 May 2013 01:03:00 +0000 (21:03 -0400)]
Fix a typo

11 years agoDocument all gdbus-codegen options
Matthias Clasen [Sun, 5 May 2013 01:01:35 +0000 (21:01 -0400)]
Document all gdbus-codegen options

The --help and --xml-files options were missing from the man page.

11 years agogbitlock: fix this to not unconditionally use futex emulation
Dan Winship [Thu, 2 May 2013 14:14:57 +0000 (10:14 -0400)]
gbitlock: fix this to not unconditionally use futex emulation

Ryan accidentally committed some debugging code a long time ago,
causing this file to always use futex emulation even when real futex
support was available. I noticed this a while later and pointed it out
to him, and assumed he was going to fix it, but I guess he assumed I
was going to fix it, and then neither of us did...

https://bugzilla.gnome.org/show_bug.cgi?id=699500

11 years agoSilently handle icon being NULL
Matthias Clasen [Fri, 3 May 2013 01:00:57 +0000 (21:00 -0400)]
Silently handle icon being NULL

While an emblemed icon without a base icon is not very
useful, no need to crash here.
This was crashing the object finalization test in gtk.

11 years agobinding: Add an explicit unbind()
Emmanuele Bassi [Sun, 14 Apr 2013 20:04:41 +0000 (21:04 +0100)]
binding: Add an explicit unbind()

Higher order languages with garbage collection can have issues releasing
a binding, as they do not control the last reference being dropped on
the binding, source, or target instances.

https://bugzilla.gnome.org/show_bug.cgi?id=698018

11 years agotests/mappedfile: Also handle ENOMEM
Colin Walters [Thu, 2 May 2013 15:39:11 +0000 (11:39 -0400)]
tests/mappedfile: Also handle ENOMEM

The RHEL6.4 kernel gives me that instead of EINVAL.

https://bugzilla.gnome.org/show_bug.cgi?id=699485

11 years agogobject: rename an unused parameter to make AIX happy
Dan Winship [Thu, 2 May 2013 17:58:25 +0000 (13:58 -0400)]
gobject: rename an unused parameter to make AIX happy

11 years agoGSocks5Proxy: don't crash if parsing negotiation reply fails
Simon McVittie [Thu, 2 May 2013 15:50:01 +0000 (16:50 +0100)]
GSocks5Proxy: don't crash if parsing negotiation reply fails

The GError should be initialized to NULL, otherwise we'll
"pile up" errors, then try to free an uninitialized pointer.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=699493

11 years agohindi update
Rajesh Ranjan [Thu, 2 May 2013 08:15:46 +0000 (13:45 +0530)]
hindi update

11 years agoUpdated Slovenian translation
Matej Urbančič [Wed, 1 May 2013 18:32:44 +0000 (20:32 +0200)]
Updated Slovenian translation

11 years agoBump version to 2.37.1
Matthias Clasen [Wed, 1 May 2013 09:20:02 +0000 (05:20 -0400)]
Bump version to 2.37.1

11 years agoAdd 2.38 indexes to the docs 2.37.0
Matthias Clasen [Wed, 1 May 2013 04:16:25 +0000 (00:16 -0400)]
Add 2.38 indexes to the docs

11 years agoUpdates
Matthias Clasen [Wed, 1 May 2013 04:15:06 +0000 (00:15 -0400)]
Updates

11 years agogio: fix small leak
Tim Lunn [Wed, 1 May 2013 00:39:26 +0000 (10:39 +1000)]
gio: fix small leak

https://bugzilla.gnome.org/show_bug.cgi?id=699361

11 years agoGApplication: don't leak 'hint' on remote Open
Ryan Lortie [Sun, 21 Apr 2013 14:55:40 +0000 (10:55 -0400)]
GApplication: don't leak 'hint' on remote Open

We were using format string "s" to deconstruct the open hint into a
'const gchar *' which, of course, we never freed.  Fix that.

11 years agobytesicon: don't use g_object_unref() on GBytes
Cosimo Cecchi [Fri, 26 Apr 2013 21:11:02 +0000 (17:11 -0400)]
bytesicon: don't use g_object_unref() on GBytes

We need to use g_bytes_unref()

https://bugzilla.gnome.org/show_bug.cgi?id=699001

11 years agobytesicon: fix a memory leak
Cosimo Cecchi [Fri, 26 Apr 2013 21:07:41 +0000 (17:07 -0400)]
bytesicon: fix a memory leak

https://bugzilla.gnome.org/show_bug.cgi?id=698999

11 years agoconfigure: Assume C90 compatible malloc() prototype
Colin Walters [Fri, 26 Apr 2013 12:12:01 +0000 (08:12 -0400)]
configure: Assume C90 compatible malloc() prototype

This ancient code was attempting to cope with (unknown) systems whose
malloc() prototype was incompatible with the standard.  This test was
fragile; it would break if the build environment provided -Wall in
CFLAGS.

Now that it's 2013, let's assume that target systems have a sane
malloc().  If someone complains, we can revisit this.

https://bugzilla.gnome.org/698716

11 years agog_object_new: check for NULL from _constructor()
Ryan Lortie [Fri, 26 Apr 2013 15:27:51 +0000 (11:27 -0400)]
g_object_new: check for NULL from _constructor()

There is some code in the wild (like in gnome-session) that does this
from its custom _constructor() implementation:

{
  GObject *obj;

  obj = ((chain up));

  if (!object_is_viable (obj))
    {
      g_object_unref (obj);
      return NULL;
    }
  else
    return obj;
}

This has never been a valid use of GObject and this code has always
caused memory to be leaked[1] by growing the construction_objects list.
The ability to legitimately return NULL from a constructor was exactly
the reason that we created GInitable, in fact.

That doesn't change the fact that the g_object_new() rewrite will crash
in this case, so instead of doing that, let's emit a critical and avoid
the crash.  This will allow people to upgrade their GLib without also
upgrading their gnome-session.  Meanwhile, people can fix their broken
code.

[1] not in the strictest sense of the word, because it's still reachable

11 years agoTamil Translation Updated
Shantha kumar [Fri, 26 Apr 2013 06:10:25 +0000 (11:40 +0530)]
Tamil Translation Updated

11 years agogio/tests: Find "true" in PATH opposed to hardcoding the location
Mike Ruprecht [Thu, 25 Apr 2013 07:24:53 +0000 (02:24 -0500)]
gio/tests: Find "true" in PATH opposed to hardcoding the location

Not all systems have /usr/bin/true. Some have it in /bin/true.
Instead of trying to guess a hardcoded path to find it, let
g_app_info_create_from_commandline() internally search PATH
to find the program.

https://bugzilla.gnome.org/show_bug.cgi?id=698655

11 years ago[l10n] Updated Italian translation.
Milo Casagrande [Thu, 25 Apr 2013 07:01:11 +0000 (09:01 +0200)]
[l10n] Updated Italian translation.

11 years agodocs: fix docs for g_icon_[de]serialize()
Cosimo Cecchi [Wed, 24 Apr 2013 15:58:47 +0000 (11:58 -0400)]
docs: fix docs for g_icon_[de]serialize()

11 years agoUpdated Polish translation
Piotr Drąg [Tue, 23 Apr 2013 22:01:48 +0000 (00:01 +0200)]
Updated Polish translation

11 years agoGObject: substantially rework g_object_new()
Ryan Lortie [Thu, 28 Mar 2013 03:34:30 +0000 (23:34 -0400)]
GObject: substantially rework g_object_new()

Make a number of improvements to g_object_new():

 - instead of looking up the GParamSpec for the named property once in
   g_object_new() (in order to collect) and then again in g_object_newv
   (when actually setting the property), g_object_new_internal() is a
   new function that takes the GParamSpec on the interface to avoid the
   second lookup

 - in the case that ->constructor() is not set, we need not waste time
   creating an array of GObjectConstructParam to pass in.  Just directly
   iterate the list of parameters, calling set_property() on each.

 - instead of playing with linked lists to keep track of the construct
   properties, realise that the number of construct properties that we
   will set is exactly equal to the length of the construct_properties
   list on GObjectClass and the only thing that may change is where the
   value comes from (in the case that it was passed in)

   This assumption was already implicit in the existing code and can be
   seen from the sizing of the array used to hold the construct
   properties, but it wasn't taken advantage of to make things simpler.

 - instead of allocating and filling a separate array of the
   non-construct properties just re-iterate the passed-in list and set
   all properties that were not marked G_PARAM_CONSTRUCT (since the ones
   that were construct params were already used during construction)

 - use the new g_param_spec_get_default_value() API instead of
   allocating and setting the GValue for each construct property that
   wasn't passed from the user

Because we are now iterating the linked list of properties in-order we
need to append to that list during class initialising instead of
prepending.

These changes show a very small improvement on the simple-construction
performance testcase (probably just noise) and they improve the
complex-construction case by ~30%.

Thanks to Alex Larsson for reviews and fixes.

https://bugzilla.gnome.org/show_bug.cgi?id=698056

11 years agoGParamSpec: add g_param_spec_get_default_value()
Ryan Lortie [Tue, 23 Apr 2013 15:11:20 +0000 (11:11 -0400)]
GParamSpec: add g_param_spec_get_default_value()

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

11 years agoGType: add accessor for instance private offset
Ryan Lortie [Tue, 23 Apr 2013 14:38:23 +0000 (10:38 -0400)]
GType: add accessor for instance private offset

Since instance private data is now always at a constant offset to the
instance pointer, we can add an accessor for it that doesn't also
require an instance.

The idea is that classes can call this from their class_init and store
it in a file-scoped static variable and use that to find their private
data on instances very quickly, without a priv pointer.

https://bugzilla.gnome.org/show_bug.cgi?id=698056

11 years agoPartially revert "Merge waitpid() from g_spawn_sync into gmain()"
Ryan Lortie [Tue, 23 Apr 2013 17:26:48 +0000 (13:26 -0400)]
Partially revert "Merge waitpid() from g_spawn_sync into gmain()"

This partially reverts commit ce0022933c255313e010b27f977f4ae02aad1e7e.

It used to be safe to use g_spawn_sync() from processes that had their
own SIGCHLD handler because it simply called wait().  When it was
changed to depend on the GLib child watching infrastructure this meant
that GLib had to own the SIGCHLD handler.

This caused hangs in at least Pidgin.

The patch contained two other improvements to the child watch code which
we want to keep, so only revert the changes to gspawn itself.

https://bugzilla.gnome.org/show_bug.cgi?id=698081

11 years agoTest GUnixSocketAddress construction
Ryan Lortie [Tue, 23 Apr 2013 18:30:42 +0000 (14:30 -0400)]
Test GUnixSocketAddress construction

This test fails without the previous fix and works properly with it.

https://bugzilla.gnome.org/show_bug.cgi?id=698686

11 years agoGUnixSocketAddress: fix construct parameter issue
Ryan Lortie [Tue, 23 Apr 2013 17:38:33 +0000 (13:38 -0400)]
GUnixSocketAddress: fix construct parameter issue

GUnixSocketAddress has some very strange logic for interpreting its
construct paramters.  This logic behaves differently in these two cases:

  g_object_new (G_TYPE_UNIX_SOCKET_ADDRESS,
                "abstract", FALSE,
                "address-type", ...,
                NULL);

and

  g_object_new (G_TYPE_UNIX_SOCKET_ADDRESS,
                "address-type", ...,
                NULL);

even though the default value for "abstract" is already FALSE.

Change the way the code works so that it is not sensitive to people
merely setting a property to its default value.

https://bugzilla.gnome.org/show_bug.cgi?id=698686

11 years agogtype: tweak valgrind hints
Ryan Lortie [Tue, 23 Apr 2013 15:59:09 +0000 (11:59 -0400)]
gtype: tweak valgrind hints

The valgrind client requests were not producing the intended result in
some cases, so step up our game a bit.

11 years agoRevert "GObject: prevent installing properties after init"
Ryan Lortie [Mon, 22 Apr 2013 22:32:05 +0000 (18:32 -0400)]
Revert "GObject: prevent installing properties after init"

This reverts commit ddb0ce14215cd62c7a2497d6cf9f2ea63c40ebb5.

Colin's smoke testing has found issues in at least gjs and
gnome-settings-daemon.  We'll need to see if we can address those.

11 years agoGObject: prevent installing properties after init
Ryan Lortie [Mon, 22 Apr 2013 21:37:18 +0000 (17:37 -0400)]
GObject: prevent installing properties after init

GObject has previously allowed installing properties after class_init
has finished running.  This means that you could install some of your
own properties on G_TYPE_OBJECT, for example, although they wouldn't
have worked properly.

Prevent this from happening.  Require that all properties are installed by
the time class_init has finished.

Complaints go to this bug:

https://bugzilla.gnome.org/show_bug.cgi?id=698614

11 years agogtype: put private data before the instance
Ryan Lortie [Mon, 22 Apr 2013 16:33:30 +0000 (12:33 -0400)]
gtype: put private data before the instance

Classically, a GTypeInstance has had the following layout:

 [[[[GTypeInstance] GObject] TypeA] TypeB] [TypeAPrivate] [TypeBPrivate]

where TypeB is a subclass of TypeA which is a GObject.  Both TypeA and
TypeB use pivate data.

The main problem with this approach is that the offset between a pointer
to an instance of TypeA and the TypeAPrivate is not constant: it changes
depending on the depth of derivation and the size of the instance
structures of the derived types.  For example, changing the size of the
TypeB structure in the above example would push the TypeAPrivate further
along.

This complicates the implementation of g_type_instance_get_private().
In particular, during object construction when the class pointer to the
'complete type' of the object is not yet stored in the header of the
GTypeInstance, we need a lookup table in order to be able to implement
g_type_instance_get_private() accurately.

We can avoid this problem by storing the private data before the
structures, in reverse order, like so:

  [TypeBPrivate] [TypeAPrivate] [[[[GTypeInstance] GObject] TypeA] TypeB]

Now the distance between TypeA and TypeAPrivate depends only on the size
of GObject and GTypeInstance, which are static.  Even in the case of
TypeB, the distance is not statically known but can be determined at
runtime and is constant (because we will know the size of TypeAPrivate
by the time we initialise TypeB and it won't change).

This approach requires a slighty dirty trick: allocating extra memory
_before_ the pointer we return from g_type_create_instance().  The main
problem with this is that it will cause valgrind to behave very badly,
reporting almost everything as "possibly lost".

We can correct for this by including a few valgrind client requests in
order to inform it that the start of the GTypeInstance should be
considered a block of memory and that pointers to it should mean that
this block is reachable.  In order to make the private data reachable,
we also declare it as a block and include an extra pointer from the end
of the primary block pointing back at it.  All of this is only done if
we are running under Valgrind.

https://bugzilla.gnome.org/show_bug.cgi?id=698595

11 years agogslice: disable by default under valgrind
Ryan Lortie [Mon, 22 Apr 2013 16:28:44 +0000 (12:28 -0400)]
gslice: disable by default under valgrind

All experienced GLib hackers know that G_SLICE=always-malloc is
absolutely essential when valgrinding but many users of GLib don't know
about this and get hit pretty hard when valgrinding their programs.

When initialising gslice, add a check to see if we are running under
valgrind and disable ourselves if we are.

We only do the check in the case that G_SLICE= was not specified in the
environment, so setting it to an empty string will prevent this default
behaviour.

I considered modifying gslice to use the VALGRIND_MALLOCLIKE_BLOCK
client request in all cases in order to just mark the blocks properly
but these calls are not free and gslice is pretty hyper-optimised.  It's
easier to just disable gslice completely and this way we only have to do
one check during startup.  It's also theoretically possible that someone
might want to use valgrind to debug gslice, in which case the extra
annotations would probably cause quite a lot of difficulty.

https://bugzilla.gnome.org/show_bug.cgi?id=698595

11 years agoAdd a copy of valgrind.h to glib/
Ryan Lortie [Mon, 22 Apr 2013 16:10:35 +0000 (12:10 -0400)]
Add a copy of valgrind.h to glib/

This is a BSD-licenced header file that is designed to be copy-pasted
into programs.  It will allow us to detect if we are running under
Valgrind and send "client requests" to it.

We will use this for a couple of reasons in upcoming patches.

https://bugzilla.gnome.org/show_bug.cgi?id=698595