Commit Graph

9806 Commits

Author SHA1 Message Date
Matthias Clasen
6ea2291573 Pre-release bump 2011-05-04 14:53:08 -04:00
Matthias Clasen
5b45c39b4b Updates 2011-05-04 14:33:03 -04:00
Ray Strode
c062350159 gdbus-codegen: don't assert non-negativity for unsigned values
The code generator sprinkles a few asserts in its output of the form:

g_assert (prop_id - 1 >= 0 && prop_id - 1 < %d);\n

prop_id is unsigned, though, so this generates a compiler warning for
me.

This commit changes the code to merely check for prop_id != 0 instead of
prop_id - 1 >= 0
2011-05-04 12:45:22 -04:00
Ryan Lortie
e823ba10d3 GVariant: Better handling of invalid UTF-8
g_variant_new_string() hits a g_return_if_fail() when given invalid
UTF-8.  That's certainly the right thing to do, but
g_variant_builder_add() uses this function internally and crashes when
it returns NULL due to the user passing a non-utf8 string.

We can protect the internal code by returning "[Invalid UTF-8]" in this
case while also making the problem easier to debug (and less fatal).

Closes #632631.
2011-05-04 18:20:23 +02:00
Alexander Larsson
d97cbc6731 gdbus-codegen: Make sure we pass -Werror
_g_value_equal might not always be used, so mark it G_GNUC_UNUSED
to make sure we're -Werror clean.
2011-05-04 13:54:34 +02:00
Kjartan Maraas
985fd99e06 Updated Norwegian bokmål translation 2011-05-04 11:07:32 +02:00
David Zeuthen
1ab29b6c4a GDBusObjectManagerServer: Allow setting :connection property
.. and add a C setter to do this. Also make the C getter return a
reference since the property may be set from another thread. Also
change the constructor to _not_ take a GDBusConnection since this is
something you almost always want to do _after_ creating it. The
API/ABI break is fine as there has never been a GLib release with this
type.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-05-04 03:43:52 -04:00
Colin Walters
542215b78a Rename g_unix_pipe_flags to g_unix_open_pipe
From IRC discussion, people liked this name more.

https://bugzilla.gnome.org/show_bug.cgi?id=649322
2011-05-03 23:34:17 -04:00
Matthias Clasen
ba5c9bd39f Remove extraneous decorations
Since in a doc comment takes no leading '@'.
2011-05-03 19:15:46 -04:00
Colin Walters
511070fb28 glib-unix.c: Don't leak FDs if pipe2() succeeds 2011-05-03 16:22:13 -04:00
Matthias Clasen
e5c986cbcf Only remove the lines that are no longer needed 2011-05-03 12:41:11 -04:00
Matthias Clasen
5d1aba2464 Revert "[build] Remove stale LDADD lines from tests/Makefile.am to allow build"
This reverts commit b0874ce28e.
2011-05-03 12:37:45 -04:00
Colin Walters
11bb78105d Use g types in public API for consistency 2011-05-03 10:57:22 -04:00
Colin Walters
c078223b38 GCancellable: Use g_unix_pipe_flags with FD_CLOEXEC
The old code was creating a pipe and setting FD_CLOEXEC
non-atomically.

https://bugzilla.gnome.org/show_bug.cgi?id=649225
2011-05-03 10:14:48 -04:00
Colin Walters
ed37970a04 g_unix_set_fd_nonblocking: New API to control file descriptor blocking state
And use it in relevant places in GLib.

https://bugzilla.gnome.org/show_bug.cgi?id=649225
2011-05-03 10:14:48 -04:00
Colin Walters
e08e70e08d glib-unix.h: Unconditionally include unistd.h
danw points out it's part of POSIX.

https://bugzilla.gnome.org/show_bug.cgi?id=649201
2011-05-03 08:37:27 -04:00
Dan Winship
e56498ee0b Fix usage of _GNU_SOURCE
_GNU_SOURCE must be defined before including any other (system)
header, so defining it in glib-unix.h (and hoping no one has included
anything else before that) is wrong. And the "#define _USE_GNU"
workaround for this problem in gnetworkingprivate.h is even wronger
(and still prone to failure anyway due to single-include guards).

Fix this by defining _GNU_SOURCE in config.h when building against
glibc. In theory this is bad because new releases of glibc may include
symbols that conflict with glib symbols, which could then cause
compile failures. However, most people only see new releases of glibc
when they upgrade their distro, at which point they also generally get
new releases of gcc, which have new warnings/errors to clean up
anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=649201
2011-05-03 07:07:41 -04:00
Dan Winship
33c0877adc Add back an erroneously-removed line to tests/Makefile.am 2011-05-02 17:06:37 -04:00
Colin Walters
e71fdf6b5a Drop translated g_warning/g_error
http://mail.gnome.org/archives/desktop-devel-list/2011-March/msg00069.html
2011-05-02 14:44:25 -04:00
Ray Strode
597ede957a glib/Makefile.am: add gmain-internal.h to sources
It's a new private header.

This commit adds it to the Makefile so it's properly distributed
with the sources.
2011-05-02 14:31:59 -04:00
Benjamin Otte
02877e2902 gobject: Warn if someone uses the wrong property in g_object_get/set
"Interface::property" was not detected before and led to a crash.
2011-05-02 19:33:51 +02:00
Abduxukur Abdurixit
331e15b128 Added UG translation 2011-05-02 18:29:59 +02:00
Dan Winship
bdc23c44e8 Fix compiler warnings 2011-05-02 11:50:23 -04:00
Dan Winship
6f711a76cd Fix autoconf 2.68 warnings
autoconf 2.68 is very insistent that AC_LANG_SOURCE/AC_LANG_PROGRAM
must be used in certain places, to avoid quoting/lack-of-quoting
problems, or something. Fix.
2011-05-02 11:50:23 -04:00
Behdad Esfahbod
c1d61f1971 Bug 648966 - Update g_unichar_iswide and g_unichar_iswide_cjk
Add tests.
2011-05-02 11:43:18 -04:00
Behdad Esfahbod
b0874ce28e [build] Remove stale LDADD lines from tests/Makefile.am to allow build
Automake 1.11 wasn't happy.
2011-05-02 11:43:18 -04:00
Dan Winship
181763438a Update .gitignores 2011-05-02 09:54:15 -04:00
Matthias Clasen
f4cff2b923 Some documentation additions 2011-05-01 23:02:53 -04:00
Matthias Clasen
ddcb095fb2 Avoid an unused variable warning
Also, clean up some whitespace
2011-05-01 20:43:04 -04:00
Matthias Clasen
ef5d4d55fe Fix make check
g_thread_init() causes a hash table to be allocated (in read_aliases).
Since hash tables are now a bit larger, we need to bump one of the
probe sizes to avoid our probe slice being used for the aliases
hash table.
2011-05-01 17:10:04 -04:00
Abduxukur Abdurixit
a84637377c Added UG translation 2011-05-01 20:04:51 +02:00
Matthias Clasen
d09df426ba GHash: make sets with refcounted keys work correctly
When keys == values, we have to be careful about the order in
which we replace their elements.
2011-05-01 10:55:24 -04:00
Matthias Clasen
be991170fa GHash: introduce a "set" mode
Make hash tables start out in a mode in which they don't store
values at all, until the first insertion of a non-identical
key-value pair.

This reduces memory requirements by 1/3 when using hash tables
to store sets.

Based on a patch by Morten Welinder,
https://bugzilla.gnome.org/show_bug.cgi?id=644437
2011-04-30 23:11:18 -04:00
Morten Welinder
0ae6bc3aaa GHash: eliminate one of the lookup_nodes functions.
Kill g_hash_table_lookup_node and rename g_hash_table_lookup_node_for_insertion
to g_hash_table_lookup_node.  Since at this point we already check for
toombstones in all callers of g_hash_table_lookup_node this doesn't make
a difference.

https://bugzilla.gnome.org/show_bug.cgi?id=644437
2011-04-30 23:11:18 -04:00
Morten Welinder
6e45153ef7 GHash: split nodes array into seperate arrays.
This reduces memory requirements by 1/6 on 64-bit machines since
no padding is needed.  It also puts less strain on the memory
allocator since we no longer need one giant slab of memory.

https://bugzilla.gnome.org/show_bug.cgi?id=644437
2011-04-30 23:11:18 -04:00
Morten Welinder
4d8e64e6e8 GHash: use macros to check for magic hash values.
https://bugzilla.gnome.org/show_bug.cgi?id=644437
2011-04-30 23:11:18 -04:00
Chun-wei Fan
707e011061 Update VS2008/2010 README.txt
Tell people about the usage of ZLib to avoid the
problem such as the one mentioned in Bug 633977
2011-05-01 09:42:22 +08:00
Behdad Esfahbod
acda716d2d Bug 648966 - Update g_unichar_iswide and g_unichar_iswide_cjk
Update to Unicode 6.0.  Also attach Python script that generates
the tables.
2011-04-29 18:03:24 -04:00
Ryan Lortie
426e1b6159 Remove duplicate GDBusInterface declaration
It was in gdbusinterface.h but also in giotypes.h.  Remove it from the
former.
2011-04-29 17:07:28 -04:00
David Zeuthen
92aed13eb8 Update docs to take comments/suggestions from Matthias into account
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-29 13:11:22 -04:00
David Zeuthen
0e352fdb18 Merge branch 'master' into gdbus-codegen 2011-04-29 12:01:35 -04:00
Alexander Larsson
9eba49a982 GFilterInputStream: close-base-stream should not be construct-only
This is a runtime changable property (by the methods for it), must
be a cut and paste error.
2011-04-29 16:14:17 +02:00
Colin Walters
a04efe6afb Use SIGTRAP (via G_BREAKPOINT()) if G_DEBUG=fatal-warnings
On Linux with gdb, it's much more convenient to debug programs using
G_DEBUG=fatal-warnings if we send SIGTRAP instead of abort() by
default.  The default handler for both is to terminate the process.

In particular this makes it more easily possible to debug a warning
that's not the first in a program; you can skip past it and
go to the warning you care about.

The "aborting..." message is removed since it's no longer accurate,
and anyways was never very useful; crashes should show up in ABRT/apport
type crash catching systems.

https://bugzilla.gnome.org/show_bug.cgi?id=648423
2011-04-28 14:48:48 -04:00
Daniel Mustieles
1763c2a575 Updated Spanish translation 2011-04-28 20:45:34 +02:00
Shaun McCance
e585059514 glib/gvariant.c: Fix variable name in example code 2011-04-28 12:41:41 -04:00
Colin Walters
a1fbe7ae84 Drop stray reference to gthread.la
We now build this test multithreaded in gthread/tests.
2011-04-27 19:09:38 -04:00
Colin Walters
7b04bbc8e0 glib/Makefile.am: Remove stray tab 2011-04-27 18:42:29 -04:00
Colin Walters
549d895fa4 glib-unix: New API to watch some Unix signals
This new API allows watching a few select Unix signals;
looking through the list on my system, I didn't see anything
else that I think it'd reasonable to watch.

We build on the previous patch to make the child watch helper thread
that existed on Unix handle these signals in the threaded case.
In the non-threaded case, they're just global variables.

https://bugzilla.gnome.org/show_bug.cgi?id=644941
2011-04-27 16:01:39 -04:00
Colin Walters
920899d78f gmain: Prepare child watch handling for more generic signal handling
In preparation for supporting more Unix signals such as SIGHUP,
SIGTERM etc.,

https://bugzilla.gnome.org/show_bug.cgi?id=644941
2011-04-27 14:58:36 -04:00
Colin Walters
0ff211f520 glib-unix: New Unix-specific API
GLib historically has been designed to be "mostly" portable; there
are some functions only available on Unix like g_io_channel_unix_new(),
but these are typically paired with obvious counterparts for Win32.

However, as GLib is used not only by portable software, but components
targeting Unix (or even just Linux), there are a few cases where it
would be very convenient if GLib shipped built-in functionality.

This initial patch is a basic wrapper around pipe2(), including
fallbacks for older kernels.  This pairs well with the
existing g_spawn_*() API and its child_setup functionality.

However, in the future, I want to add a signal() wrapper here,
complete with proxying the signal to a mainloop.  I have initial code
for this, but doing it sanely (including factoring out gmain.c's
private worker thread), is a complex task, and I don't want to block
on that.

See also gwin32.h for Win32 specific functionality.

https://bugzilla.gnome.org/show_bug.cgi?id=644941
2011-04-27 13:29:38 -04:00