Commit Graph

12378 Commits

Author SHA1 Message Date
Antoine Jacoutot
9e0ea40537 OpenBSD: explicitely define nitems
nitems is never guaranteed to be defined in sys/params.h as it is meant
to be defined within a protected ifdef __KERNEL condition.
2012-07-14 16:33:22 -04:00
Ryan Lortie
f6b98fe7a7 GVariant: support comparing booleans
g_variant_compare() is documented as working on booleans but somehow
this case was missed.  Add it and test it.

Problem discovered by Charles Kerr.
2012-07-14 16:33:21 -04:00
Ryan Lortie
e6f659a898 GSettings: be more careful about keys names with /
Prevent attempts to access keys ending with slashes that exist in the
schema file as references to child schemas.

Also: don't emit change signals for these same keys.
2012-07-14 16:33:21 -04:00
Emmanuele Bassi
6f2b9223be 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-14 16:33:21 -04:00
Matthias Clasen
89c5e035b3 Improve the g_dir_read_name documentation
This function can return NULL in error cases as well. Document
this, and explain how to discriminate the cases.
https://bugzilla.gnome.org/show_bug.cgi?id=639771
2012-07-14 16:33:20 -04:00
Neil Roberts
1eea903dcf Fix the 'Since' tag for G_SOURCE_{REMOVE,CONTINUE}
The Since tag for these was saying 2.28 but it was actually added in
2.31. It looks like all of the Since tags list stable version numbers
so this patch bumps that up to 2.32.

https://bugzilla.gnome.org/show_bug.cgi?id=679258
2012-07-14 16:33:20 -04:00
Simon Feltman
33f886995a Updated codegen to work with python3.
Most changes were just replacing usage of "has_key" with "in".
Also updated the sorting function which was simplified and
changed to a "key" function instead of "cmp" (which is no longer
supported in python3. Verified everything builds with
python 2.7 and 3.

https://bugzilla.gnome.org/show_bug.cgi?id=678066
2012-07-14 16:33:20 -04:00
Johan Dahlin
c147bd5b1a Use the same Python as we found in configure
Don't assume /usr/bin/python is python 2.x, on newer Ubuntu versions
it's actually python 3.x.
2012-07-14 16:33:19 -04:00
Martin Pitt
4b8c6f9d02 Fix /contenttype/guess test
After fixing bug 674452 this test case now reliably fails, as "ABC abc" is text
and definitively not PowerPoint. It previously worked as g_content_type_guess()
was reading beyond the boundary of the data due to specifying -1 as data
length.

Update that test case to expect a PO template instead, and add two more with a
definitive PO template syntax and some binary data. We do not currently have a
MIME magic for PowerPoint, so we cannot actually detect it with certainty, but
at least make sure that the returned MIME type is correct.

https://bugzilla.gnome.org/show_bug.cgi?id=678941
2012-07-14 16:33:19 -04:00
Alexander Larsson
e58a2996ba Fix the mimetype default fix
We need to ignore the defaults.list item only when there
was a mimetype handler found in a previous mimetype, not
if one was found for the same mimetype as the one that
is listed in defaults.list (same for the new-style defaults).
2012-07-14 16:33:19 -04:00
Alexander Larsson
8d0f19de81 Fix default app lookup wrt parent types and defaults.list
There was an issue when looking up the default handler
for a type where a supertype was listed in defaults.list.
We would pick the default for the parent type even if
there was a handler for the more specific type.

In the case of the new-style defaults marking (
"Default Applications" in mimeapps.list) we were already
checking for a more specific handler befor using a default,
but we also need to do a similar check for the defaults.list
case.

https://bugzilla.gnome.org/show_bug.cgi?id=678944
2012-07-14 16:33:19 -04:00
Stef Walter
5bf587caa0 GTlsInteraction: Fix incorrect locking of mutex
* Fix incorrect locking of mutex in g_tls_interaction_invoke_ask_password()

https://bugzilla.gnome.org/show_bug.cgi?id=678758
2012-07-14 16:33:18 -04:00
Martin Pitt
c1aac005d2 gio/tests/contenttype: Call g_content_type_guess() with valid data len
g_content_type_guess() requires specifying a valid data length. Fixes a
segfault when running the test.

Also add an explicit check for this and return XDG_MIME_TYPE_UNKNOWN when
data_size is specified as -1, to avoid crashing.

https://bugzilla.gnome.org/show_bug.cgi?id=674452
2012-07-14 16:33:18 -04:00
Martin Pitt
7f3295b3b3 /mainloop/timeouts test: Reduce race condition
Due to load, particular traits of the architecture, or other circumstances, the
/mainloop/timeouts sometimes manages to call the "every
100 ms" timer loop only 9 times in 1050 ms.

This is an inherent race-condition in the test; allow it some slack and accept
9 times as well.

https://bugzilla.gnome.org/show_bug.cgi?id=678959
2012-07-14 16:33:18 -04:00
Philipp Kern
567f4d0d12 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-07-14 16:33:17 -04:00
Martin Pitt
2e76d87bea Allow slightly too small poll duration in /socket/timed_wait test
Sometimes the poll duration in the /socket/timed_wait test is slightly lower
than the requested 100000, causing failures like

ERROR:/build/buildd/glib2.0-2.33.2/./gio/tests/socket.c:619:test_timed_wait:
  assertion failed (poll_duration > = 100000): (99240 >= 100000)
FAIL

Adjust the test to also allow some jitter in the "too small" direction, similar
to the already existing span for "slightly too large".

https://bugzilla.gnome.org/show_bug.cgi?id=678881
2012-07-14 16:33:17 -04:00
Lars Uebernickel
1da11292da GDbusActionGroup: always set strict when _query_action fails 2012-07-14 16:33:17 -04:00
Matthias Clasen
086603c602 Remove a few redundant ;s 2012-07-14 16:33:17 -04:00
Phil Clayton
e0281b2762 Add missing annotation to GDBusConnection::closed
Add annotation (allow-none) to the parameter error.

https://bugzilla.gnome.org/show_bug.cgi?id=677952
2012-07-14 16:33:16 -04:00
Emmanuele Bassi
945b507d6d 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-07-14 16:33:16 -04:00
Christian Persch
5468b7a59d regex: Fix unicode othercasing
The old _pcre_ucp_othercase() function was wrong in returning
NOTACHAR (0xffffffff) for characters that aren't changed by upper-
and lower-casing. This led to PCRE internally using incorrect (or
at least inefficient) character classes when using G_REGEX_CASELESS.

E.g. [Z-\x{100}] turned into:

[Z\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{39c}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{178}z-\x{101}]

instead of the expected and efficient

[Z\x{39c}\x{178}z-\x{101}]

https://bugzilla.gnome.org/show_bug.cgi?id=678273
2012-07-14 16:33:16 -04:00
Colin Walters
09aa6d3668 GRand: Check return value of fopen directly
This doesn't fix anything, it should just silence some static analysis
tools.
2012-07-14 16:33:15 -04:00
Colin Walters
fd8056b532 gspawn: Abort if we can't open /dev/null
This really "shouldn't happen", but if we have an assertion here, it
will help static analysis tools know we're not hitting undefined
state.
2012-07-14 16:33:15 -04:00
Colin Walters
2143e799f4 tests/unix: Ensure buffer is NUL terminated 2012-07-14 16:33:15 -04:00
Colin Walters
6fe87988d1 gsignal: Properly handle NULL nodes 2012-07-14 16:33:15 -04:00
Colin Walters
94201b9ba8 gresourcefile.c: Remove stray semicolon 2012-07-14 16:33:14 -04:00
Colin Walters
773f515220 gmenu: Remove stray semicolon in g_menu_clear_item() 2012-07-14 16:33:14 -04:00
Colin Walters
cbe331450f tests: Add missing initializer for return value 2012-07-14 16:33:14 -04:00
Colin Walters
9f45f340ed tests: Add missing va_end() 2012-07-14 16:33:13 -04:00
Colin Walters
e713de6780 gfileutils: Remove extra fclose()
This is a regression introduced by:
commit 6ac8e6108c
Author: Matthias Clasen <mclasen@redhat.com>
Date:   Tue Jun 14 10:12:46 2011 -0400

    Don't leak resources in error cases
2012-07-14 16:33:13 -04:00
Matthias Clasen
894cf92650 Install bash completion files in /usr/share/
The bash-completion code nowadays expects completion files to
be installed in  /usr/share/bash-completion/completions, and
expects them to be named like the command they are completing
for.

https://bugzilla.gnome.org/show_bug.cgi?id=677782
2012-07-14 16:33:13 -04:00
Dan Winship
6a9668af93 gdbus: fix generated code to not warn under -Wfloat-equal
https://bugzilla.gnome.org/show_bug.cgi?id=678333
2012-07-14 16:33:12 -04:00
Martin Pitt
8f46e27c35 Fix g_utf8_validate() out argument transfer mode
The "end" argument is unusual in g_utf8_validate(): it's not a classic out
argument which gets allocated by the called function, but merely points into
one of its input arguments. Thus it is "transfer none".

https://bugzilla.gnome.org/show_bug.cgi?id=672889
2012-07-14 16:33:12 -04:00
Dan Winship
7934d64837 docs: fix an example 2012-07-14 16:33:12 -04:00
Matthias Clasen
f03dbdc365 GKeyFile: Deal better with blank lines
There is no need to store a has_trailing_blank_line boolean for
each group, we can just check this at the time we assemble the data.

This fixes a problem without roundtrips where we would sometimes
add an extra blank line between groups.

The testcase here is inspired by
https://bugzilla.gnome.org/show_bug.cgi?id=677817
2012-07-14 16:33:12 -04:00
Matthias Clasen
747e651697 GWakeup: Avoid extraneous wakeups
We were checking the wrong number here, and waking up unnecessarily.
https://bugzilla.gnome.org/show_bug.cgi?id=678052
2012-07-14 16:33:11 -04:00
Paolo Borelli
45ff6099c6 Improve g_find_program_in_path documentation
Document that g_find_program_in_path returns a newly-allocated string
2012-07-14 16:33:11 -04:00
Benjamin Otte
d98eed087d glib-compile-resources: Forward errors from spawned processes
We just grab stderr from gdk-pixbuf-to-csource and xmllint and include
it in the error message. It's the best we can do.
2012-07-14 16:33:11 -04:00
Matthias Clasen
0a22710d67 Correct the docs for g_time_zone_adjust_time
March 13, 2010 is very ordinary.
March 14, 2010 is the special day.
2012-07-14 15:23:03 -04:00
Matthias Clasen
6541256859 Fix a typo
It is 'entries', not 'entires'.
2012-07-14 15:22:46 -04:00
Daniel Macks
c6a5b5d719 configure: Require libelf 0.8.12
Older versions don't have the required API.

(Commit message written by Colin Walters <walters@verbum.org>)

https://bugzilla.gnome.org/show_bug.cgi?id=673253
2012-07-14 15:21:16 -04:00
Martin Pitt
c149b7ecb0 g_dbus_gvariant_to_gvalue(): Add missing out annotation 2012-07-14 15:20:54 -04:00
Marc-Antoine Perennou
57214e812d glib: fix g_reload_user_special_dirs_cache
We handle a special case for G_USER_DIRECTORY_DESKTOP
when we init the values but drop it when we reload them.
Fix this by preferring old values to NULL

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

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2012-07-14 15:19:46 -04:00
Christian Persch
d43c89c286 build: Add missing AM_V_GEN to silence the build 2012-07-14 15:19:22 -04:00
Guillaume Desmottes
8dbf5a86e1 Link to gvariant-format-strings-pointers in getter API
https://bugzilla.gnome.org/show_bug.cgi?id=674777
2012-07-14 15:18:59 -04:00
Colin Walters
9851202b15 gappinfo: Fix uninitialized-variable gcc warning 2012-07-14 15:17:49 -04:00
Colin Walters
9b9e99e6c8 Annotate API introduced for 2.32 with GLIB_AVAILABLE_IN_2_32
https://bugzilla.gnome.org/show_bug.cgi?id=676816
2012-07-14 15:17:39 -04:00
Colin Walters
c1faabde81 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-07-14 15:17:33 -04:00
Christian Persch
98ae46c618 application: Save a few bytes in the library
There's really no need to put useless whitespace into the .so.
2012-07-14 15:17:10 -04:00
Marc-Antoine Perennou
8906b1f66b glib: fix build
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2012-07-14 15:16:58 -04:00