Commit Graph

17439 Commits

Author SHA1 Message Date
Nelson Benítez León
32a9b88b20 gio/tests: Add testcase for bug 787731
Add testcase for function g_file_query_filesystem_info()
reporting outdated info for "filesystem::readonly" attribute
when said attribute was different in a previous mounted
partition in the same device (as GIO maintains a mounts cache
per 'st_dev' stat() member).

To trigger a mount operation, testcase uses program 'bindfs'
instead of 'mount --bind' as bindfs does not require root
privileges. And 'fusermount -u' command is used to unmount said
bindfs mount.

As a reference in Fedora, 'bindfs' is installed from 'bindfs'
package and 'fusermount' from 'fuse' package (this one is installed
by default as being part of 'System Tools' group).

The test creates a directory with a file in it, then mounts it
readonly over another directory (the mountpoint), it then checks
that g_file_query_filesystem_info() for the file in it indeed reports
"filesystem::readonly" as TRUE. Then unmounts and mounts again this
time rw (not readonly), it then checks again if g_file_query_filesystem_info()
is reporting "filesystem::readonly" as TRUE, if that's the case, it
confirms the bug by opening said file in write mode.

Testcase is only added for Unix builds.

https://bugzilla.gnome.org/show_bug.cgi?id=787731
2017-09-22 20:28:44 +05:00
Philip Withnall
1304197ed0 gmessages: Fix a typo in the documentation for g_log_set_handler_full()
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-09-22 13:34:19 +01:00
Philip Withnall
09796b3ccc Partially revert "gio: Add missing (array length) annotations"
This reverts commit 8028494335.

Adding (array length=…) to a gchar* parameter causes the GIR file to
contain an array of strings, rather than an array of characters. While
we fix GIR, revert those changes.

Some of the other changes in the file (which have an explicit
(element-type) already) are fine.

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

https://bugzilla.gnome.org/show_bug.cgi?id=765063
2017-09-21 12:05:06 +01:00
Alisa Maas
8028494335 gio: Add missing (array length) annotations
https://bugzilla.gnome.org/show_bug.cgi?id=765063
2017-09-21 11:08:12 +01:00
Matej Urbančič
e7a60ed262 Updated Slovenian translation 2017-09-20 14:11:11 +02:00
Chun-wei Fan
213c31a49d build: Change DLL naming in Visual Studio projects
The previous commit to glib/glibconfig.h.win32.in, though it improves
the state of GLib and fixes bugs, cannot be used as a drop-in
replacement for code that builds against the previous
glib/glibconfig.h(.win32.in) that were build using the Visual Studio
projects.  Change the DLL names as a result so that the likelihood of
problems caused by replacing existing GLib DLLs can be reduced--code
that was built against previous GLib MSVC builds should be rebuilt, so
that things will work with the newer DLLs, instead of depending on the
older DLLs.

Note that if Visual Studio builds are done through Meson, existing code
that link against GLib should be rebuilt as well, for the same reason.
DLLs built with the Visual Studio projects from 2.55.0 onwards should be
compatible with the ones that are built with Visual Studio via Meson.
2017-09-15 12:56:40 +08:00
Chun-wei Fan
4fd056a5f5 glib/glibconfig.h.win32.in: Update and clean up
Make the entries in here more consistent with what Meson produces with
its Visual Studio builds.  Also fix the macros [GSIZE|GSSIZE]_TO_[LE|BE]
for x64 builds.
2017-09-15 12:50:50 +08:00
Chun-wei Fan
9831516835 config.h.win32.in: Fix previous commit
We should still let people building via the MSVC projects decide whether
they use the bundled PCRE sources for building GLib.  Accidentally
changed it in the previous commit.
2017-09-15 11:48:58 +08:00
Chun-wei Fan
751a757766 build: Update config.h.win32.in
Update config.h.win32.in to match closely to what Meson will produce for
the various Visual Studio versions (2008~2017), as it seems that Meson
produces a better config.h for our MSVC builds of GLib.

One of the major changes in this is that all Visual Studio builds
(either through Meson, which is already so, or via the existing
projects) is that the built binaries will require Windows 7 or later,
so that we let people know early on in a cycle that MSVC builds of
2.55.0 and later will definitely need Windows 7 or later.
2017-09-15 11:37:40 +08:00
Robert Ancell
db2ae64636 Fix comment/docs grammar: incase -> in case 2017-09-15 13:50:41 +12:00
Chun-wei Fan
a7a6449f4d meson: Install items according to their relevance
The m4 and bash completion items are usable and relevant
depending on the host system's configuration.  So, we check for the
presence of the programs that these items depend on, and only install
them when those programs are found.

For the Valgrind suppression files, we don't install them on Windows as
Valgrind is currently not supported on Windows.

Als fix the path where the GDB helpers are installed, as the path is
incorrectly constructed.

This will fix the "install" stage when building on Visual Studio at
least as there are some post-install steps that are related to them,
which will make use of these programs.

https://bugzilla.gnome.org/show_bug.cgi?id=783270
2017-09-14 16:02:03 +08:00
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