Commit Graph

17428 Commits

Author SHA1 Message Date
Chun-wei Fan
65d6990579 build: Dist the other required Meson build files
Some of the Meson build files are not dist'ed by 'make dist', which are
reqired for things to work, and there was a missing '\' that cause some
of the meson.build files under tests/ not to be disted.

https://bugzilla.gnome.org/show_bug.cgi?id=783210
2017-09-14 16:02:00 +08:00
Chun-wei Fan
4c417c4965 build: Define G_HAVE_GNUC_[VARARGS|VISIBILITY] conditionally
They are not supported by Visual Studio, so only define them in
glibconfig.h.in when not on Visual Studio.  Fixes builds of GTK+-2.x
against Meson/MSVC builds of GLib.

https://bugzilla.gnome.org/show_bug.cgi?id=783270
2017-09-14 10:23:34 +08:00
Philip Withnall
5e55a4e243 gtlsbackend: Default to indicating no support for DTLS in GTlsBackend
I’m unsure what the original reasoning for returning TRUE by default
from supports_dtls was, but it is not backwards-compatible. If a
pre-existing GTlsBackend implementation never implements the
supports_dtls vfunc, the supports_dtls() method will magically return
TRUE rather than FALSE.

Since any backend which does implement DTLS should be implementing the
supports_dtls vfunc (and no DTLS-supporting backends have actually been
merged yet; see bug #697908), it seems safer to make this slight API
break in the name of backwards compatibility than to leave it as
returning TRUE incorrectly.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=787485
2017-09-13 17:38:42 +01:00
Philip Withnall
015ab311f8 gmessages: Add IDs for documentation headers
This fixes some broken cross-references between various places in the
logging documentation.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-09-13 17:07:29 +01:00
Philip Withnall
a2cf4806a4 tests: Add tests for g_slist_copy() and g_slist_copy_deep()
This gives us 100% coverage of GSList (when running `make lcov`).

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=787581
2017-09-13 13:37:13 +01:00
Sam Thursfield
bb26bc29e3 Make GListModelInterface::get_item usable from GObject Introspection bindings
Language bindings have so far been unable to implement the GListModel
interface because the ::get_item virtual function returns a
non-bindable type (gpointer). The `gpointer` type gets translated into
`void` by G-I meaning that get_item() implementations can't return any
items.

We can set the return type of the get_item() vfunc explicitly to
GObject, which fixes the issue.

This patch also removes the existing (type GObject) annotation on
g_list_model_get_item(), which is necessary because if its return type
matches that of the get_item() vfunc, G-I connects the two and
propagates the 'skip' annotation from one to the other resulting in the
get_item() vfunc being hidden. There's no API break here because the
'skip' annotation makes g_list_model_get_item() invisible to G-I users
anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=787271
2017-09-12 12:32:20 +01:00
Philip Withnall
1a5cebec39 docs: Discourage use of gstdio.h and clarify its header requirements
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=781598
2017-09-12 12:20:18 +01:00
Philip Withnall
39469aa7bb Revert "gstdio: #include fcntl.h on UNIX in gstdio.h"
This reverts commit 6f8073d44a.

As per further discussion on bug #781598, we can’t do this in GLib,
since fcntl.h is not guaranteed to be present on all Unix systems. Users
of GLib *must* do a header check (for example, using AC_CHECK_HEADERS)
and #include fcntl.h themselves.
2017-09-12 12:12:27 +01:00
Christian Schramm
54e3ed17f0 gslist: Simplified node removal and got rid of some code duplication
Merged two almost identical functions for removing at most one
or all nodes containing some data. Also simplified the code a bit
by using a pointer to a pointer (see
http://wordaligned.org/articles/two-star-programming).

(Modified by Philip Withnall to fix two code formatting nitpicks.)

https://bugzilla.gnome.org/show_bug.cgi?id=722256
2017-09-12 12:11:06 +01:00
Reuben Thomas
6f8073d44a gstdio: #include fcntl.h on UNIX in gstdio.h
https://bugzilla.gnome.org/show_bug.cgi?id=781598
2017-09-12 11:10:54 +01:00
Philip Chimento
7b9503a4f8 docs: Clarify relationship of quit() to hold count
Calling g_application_quit() ignores the hold count; this patch adds a
warning to the documentation about other code having a hold on the
application and expecting it to exist.

https://bugzilla.gnome.org/show_bug.cgi?id=737278
2017-09-11 22:26:04 +01:00
Daniel Macks
b8f9c08a09 Avoid setting unused variables (-Wself-assign)
Setting a variable and then assigning it to itself avoids
-Wunused-but-set-variable but this specific trick is now caught by
-Wself-assign. Instead, actually use the value or don't bother
assigning it at all:

gdbusauthmechanismsha1.c: #ifdef a var decl to match its actual use use
gdbusauthmechanismsha1.c: call g_ascii_strtoll() in void context

https://bugzilla.gnome.org/show_bug.cgi?id=745723
2017-09-11 22:18:42 +01:00
Daniel Macks
190f64a0fb Avoid setting unused variables (-Wself-assign)
Setting a variable and then assigning it to itself avoids
-Wunused-but-set-variable but this specific trick is now caught by
-Wself-assign. Instead, actually use the value or don't bother
assigning it at all:

gdbusauth.c: call g_data_input_stream_read_byte() in void context
gdbusauthmechanismsha1.c: value is actually used
gdbusmessage.c: use consistent preprocessor-token protection
gthreadedresolver.c: skip over bytes in data blob
httpd.c: do something useful with the value

https://bugzilla.gnome.org/show_bug.cgi?id=745723
2017-09-11 22:14:18 +01:00
Emmanuele Bassi
5d9ccf162e gio: Annotate GDBusObjectManagerClient signal appropriately
https://bugzilla.gnome.org/show_bug.cgi?id=756009
2017-09-11 21:31:13 +01:00
Philip Withnall
1275b94fe7 gsettings: Fix copy-paste error in property documentation
This should fix the introspection binding for that property too.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=656502
2017-09-11 21:28:40 +01:00
Nicolas Dufresne
0d9c5122bc valuearray: Skip g_value_array_free() in bindings
Calling this function can easily lead to an interpreter crash.

https://bugzilla.gnome.org/show_bug.cgi?id=780202
2017-09-11 21:11:55 +01:00
Mikhail Zabaluev
e5db8ec787 Skip g_subprocess_launcher_set_child_setup() in introspection
It's not likely that the runtime of a bound language using the
introspection supports running in a process forked by a foreign
library, so that a closure programmed in that language would work
safely.

Any programming environment supporting that would probably have
its own advanced facilities for process spawning, or be able
to access the GLib spawning APIs via raw C bindings (still
represented in the introspection, (skip) only adds a flag)
and do any low-level preparatory dances as necessary for the
forked runtime.

Note that there are other APIs making use of GSpawnChildSetupFunc,
but they are usable with the closure nullified, and we cannot annotate
the closure parameters away because that would break the annotated API
for bindings; accordingly to bug #738176 comment #3, the current bindings'
users are expected to pass null.
2017-09-11 21:07:09 +01:00
Mikhail Zabaluev
48cf1d32c6 Fix up closure annotations for GSpawnChildSetupFunc
https://bugzilla.gnome.org/show_bug.cgi?id=738176
2017-09-11 21:07:08 +01:00
Mikhail Zabaluev
3ee5bb1120 Annotate g_bookmark_file_new() as a constructor
https://bugzilla.gnome.org/show_bug.cgi?id=756011
2017-09-11 21:01:15 +01:00
Mikhail Zabaluev
7759542ee3 gconvert: Skip the GIConv API from introspection
It's ugly:
- The core method, g_iconv(), can't be annotated with good semantics.
- The error value of g_iconv_open() is not representable in today's
  introspection.

https://bugzilla.gnome.org/show_bug.cgi?id=756128
2017-09-11 20:47:11 +01:00
Mikhail Zabaluev
01544c9269 Skip g_base64_decode_step() in introspection
The length of the caller-allocated (that flag was missing; added as well)
output array is calculated by a formula, so none of the usual array length
annotations apply. The state parameters need to be initialized with zero.

Just let them use the basic API.

https://bugzilla.gnome.org/show_bug.cgi?id=756103
2017-09-11 20:44:39 +01:00
Mikhail Zabaluev
0ea004c6f9 gobject: Skip more non-introspectable data/qdata methods
https://bugzilla.gnome.org/show_bug.cgi?id=756588
2017-09-11 20:34:46 +01:00
Mikhail Zabaluev
1e45c0a0e1 gobject: Add missing (nullable) and (out) annotations on the data/qdata API
https://bugzilla.gnome.org/show_bug.cgi?id=756588
2017-09-11 20:34:45 +01:00
Mikhail Zabaluev
28e8684168 gdataset: Skip problematic functions in the introspection
The functions with a GDestroyNotify to the data, or other ill-fitting
allocation semantics, are not currently introspectable.

The effect for the binding user would be that they're unable to
create or destroy a GData list, but they might still have an API
to poke at some data pointers from it.

In fact, none of the functions dealing with GData** or a dataset
location pointer are likely to get sensible bindings anyway;
the annotations added are mostly to avoid memory unsafety
and leaks.

https://bugzilla.gnome.org/show_bug.cgi?id=756470
2017-09-11 20:26:53 +01:00
Mikhail Zabaluev
a3ba8ea7d3 gdataset: Annotate the closures
Annotate the closure parameters in GDataForeachFunc, GDuplicateFunc,
and the functions using them.

https://bugzilla.gnome.org/show_bug.cgi?id=756470
2017-09-11 20:26:53 +01:00
Mikhail Zabaluev
2a0e1c8422 gdataset: Correct (nullable) and (transfer none) annotations
https://bugzilla.gnome.org/show_bug.cgi?id=756470
2017-09-11 20:26:53 +01:00
Mikhail Zabaluev
595a7e3bb2 g_datalist_id_replace_data: Annotate the out parameter
https://bugzilla.gnome.org/show_bug.cgi?id=756470
2017-09-11 20:26:52 +01:00
Alberto Ruiz
df8350b316 GSubprocessLauncher: add (transfer none) annotation
https://bugzilla.gnome.org/show_bug.cgi?id=753521
2017-09-11 20:23:13 +01:00
Robert Ancell
491f835c17 GDateTime: Support parsing ISO 8601 strings
This supports a subset of ISO 8601 since that is a commonly used standard for
storing date and time information. We support only ISO 8601 strings that contain
full date and time information as this would otherwise not map to GDateTime.
This subset includes all of RFC 3339 which is commonly used on the Internet and
the week and ordinal day formats as these are supported in the GDateTime APIs.

(Minor modification by Philip Withnall to change API versions from 2.54
to 2.56.)

https://bugzilla.gnome.org/show_bug.cgi?id=753459
2017-09-11 19:29:34 +01:00
Philip Withnall
d5933142c8 build: Bump version to 2.55.0
Ready for the new unstable release series.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-09-11 19:25:56 +01:00
Philip Withnall
0c15e9cd56 gversionmacros: Add version macros for GLib 2.56
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-09-11 19:24:06 +01:00
Philip Withnall
52dd98475c gtlsbackend: Add missing preconditions for DTLS virtual methods
Make it a bit more obvious when the DTLS methods aren’t implemented by a
particular TLS backend; return an invalid type rather than crashing.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=752240
2017-09-11 19:15:15 +01:00
Federico Mena Quintero
51e852e5d0 validate_pspec_to_install(): Factor out function to validate a GParamSpec
This was duplicated also in g_object_interface_install_property().

Now, validations specific to classes happen in
validate_and_install_class_property() - specifically, the checks for
the presence of the get_property() and set_property() methods.

https://bugzilla.gnome.org/show_bug.cgi?id=787551
2017-09-11 12:44:45 -05:00
Federico Mena Quintero
20720eaf1e validate_and_install_property(): Check pspec-specific fields in the same order as g_object_interface_install_property()
https://bugzilla.gnome.org/show_bug.cgi?id=787551
2017-09-11 12:44:45 -05:00
Federico Mena Quintero
95f44b280f validate_and_install_property(): Validate presence of get/set_property methods last
https://bugzilla.gnome.org/show_bug.cgi?id=787551
2017-09-11 12:44:45 -05:00
Federico Mena Quintero
1b08414f06 g_object_interface_install_property(): Do interface-specific validations first
https://bugzilla.gnome.org/show_bug.cgi?id=787551
2017-09-11 12:44:45 -05:00
Federico Mena Quintero
e667d0d4c0 install_property_internal(): Propagate failure when installing duplicated properties
https://bugzilla.gnome.org/show_bug.cgi?id=787551
2017-09-11 12:44:41 -05:00
Federico Mena Quintero
9dd9fe4feb validate_and_install_class_property(): Factor out function to add a new property to a class
This was duplicated between g_object_class_install_property() and
g_object_class_install_properties().

https://bugzilla.gnome.org/show_bug.cgi?id=787551
2017-09-11 11:26:01 -05:00
Federico Mena Quintero
85ef144334 GObjectClass: extract class type and parent type at the beginning
https://bugzilla.gnome.org/show_bug.cgi?id=787551
2017-09-11 11:26:01 -05:00
Federico Mena Quintero
7d9a6c8687 GObjectClass: Validate installing property/properties in the same way
Then we'll be able to factor out duplicated code.

https://bugzilla.gnome.org/show_bug.cgi?id=787551
2017-09-11 11:26:01 -05:00
Carlo Caione
6503352be1 gvariant: Add g_variant_get() example for dicts
In the Dictionary section of the gvariant-format-strings documentation
only how to construct a dictionary is shown.

Add a small example showing how to extract data from a nested dictionary
and specifically from a GVariant of type "(oa{sa{sv})". Move also the
Dictionary section after the GVariant * section for the sake of clarity.

https://bugzilla.gnome.org/show_bug.cgi?id=786737
2017-09-11 09:46:21 +01:00
Matthias Clasen
738eff5dec 2.54.0 2017-09-10 20:18:10 -04:00
Anders Jonsson
b6ea70bf0b Update Swedish translation 2017-09-10 12:26:26 +00:00
Daniel Șerbănescu
aceedae17d Update Romanian translation 2017-09-10 11:37:50 +00:00
Jordi Mas
1ad6e4f254 Fixes to Catalan translation 2017-09-10 08:08:43 +02:00
Inaki Larranaga Murgoitio
c0a04b60a2 Update Basque language 2017-09-09 16:11:31 +02:00
Cosimo Cecchi
88a39670e7 GSettingsBackend: use a GWeakRef during dispatch
Instead of a full reference, which causes problems for clients that
expect a GSettings instance to stop firing signals once they drop the
last reference.

https://bugzilla.gnome.org/show_bug.cgi?id=780861
2017-09-08 09:29:18 -07:00
INSUN PYO
61cb8b232b GMainLoop: match of parameter pair of LOCK_CONTEXT/UNLOCK_CONTEXT
There is no reason to use source->context as as parameter of UNLOCK_CONTEXT.
To avoid confusion, change to the parameter used in LOCK_CONTEXT.

https://bugzilla.gnome.org/show_bug.cgi?id=787146
2017-09-08 15:57:59 +01:00
Bastien Nocera
f813ce6abe glib: Slightly update GIOChannel documentation
Explain the default values of _{get,set}_close_on_unref() in the main
description rather than the argument one, link to the GIOChannel
structure when talking about it, and mention the default value of
"close on unref" in g_io_channel_unix_new().

https://bugzilla.gnome.org/show_bug.cgi?id=787123
2017-09-08 15:40:15 +01:00
Philip Chimento
a72f57eeab valgrind: Add false positive to suppressions file
Valgrind will check that the third argument to ioctl() is a valid
pointer, but some ioctls interpret that argument as an integer, and that
is the case here (it's a file descriptor), so this is a false positive.

https://bugzilla.gnome.org/show_bug.cgi?id=787109
2017-09-08 15:36:32 +01:00