Commit Graph

16775 Commits

Author SHA1 Message Date
Simon McVittie
be4fd3d0b0 glib-init: statically assert that int is exactly 32 bits long
The GVariant documentation says you can assume that types of no more
than 32 bits may be assumed to be promoted to int by the usual
promotions. If we're going to document that, we should statically
assert that it's true, i.e. sizeof (int) >= sizeof (int32_t).

All reasonable modern platforms are either ILP32 (32-bit platforms),
LP64 (64-bit Linux, *BSD etc.), or LLP64 (64-bit Windows): there have
been ILP64 platforms in the past, but ILP64 has the compelling
disadvantage that {signed char, short, int} can't possibly provide
all of {int8_t, int16_t, int32_t} unless int is 32 bits long.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=730932
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Colin Walters
2016-11-22 18:50:02 +00:00
Simon McVittie
5227630077 glib-init: statically assert that "small" enums are all int-sized
ISO C allows compilers to make enums smaller than int if their
enumerated values would all fit in the range of a smaller type.

In practice, I suspect that in relevant compilers, all enums whose
values fit in the range INT32_MIN to INT32_MAX (inclusive) are the same
size as int. ISO C allows compiler to break that assumption, but those
that do would break code that works fine in other compilers, making the
compiler look bad, for no significant benefit. I conjecture that such
compilers are not popular.

Let's statically assert that my assumption holds. If all goes well,
GLib will continue to compile on every relevant platform; if it
fails to compile on some platform as a result of this change, then
there are probably a lot of naive uses of enums that need auditing
for this assumption.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=730932
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Allison Lortie
2016-11-22 18:48:17 +00:00
Pavel Grunt
c99fe67817 gtask: Add guards for public functions
https://bugzilla.gnome.org/show_bug.cgi?id=769745
2016-11-22 13:23:25 -05:00
Ondrej Holy
b626a4677a gunixmounts: Fix crash if path doesn't exist
g_unix_mount_for segfaults for nonexistent paths. Return NULL if path
doesn't exist.

https://bugzilla.gnome.org/show_bug.cgi?id=772160
2016-11-22 13:21:36 -05:00
Simon McVittie
1c47f62de7 gatomic: statically assert that our assumptions hold
This code assumes that int is exactly 32 bits, and that pointers
are either 4 or 8 bits, on platforms with __ATOMIC_SEQ_CST.
In practice this is going to be true.

A previous attempt at this assertion placed the G_STATIC_ASSERT
at the top level in gatomic.h, but that broke anjuta, which
redefined __unused__ at the time. These assertions are about the
platform/compiler ABI, so it's sufficient to check them once,
while compiling GLib itself; accordingly, move them to the
implementation.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=730932
2016-11-22 13:11:24 -05:00
Rahul Bedarkar
ecdd3c29fc gio-2.0.pc: include libmount in Libs.private
This helps with static linking. When application statically links with
libgio, it needs to link against libmount explicitly. When it is
mentioned in Libs.private, build system can figure out with which extra
libs to link against with help of pkg-config.

This build failure is detected by Buildroot autobuilder:
http://autobuild.buildroot.net/results/fdf/fdf26abbed0014606a7788ce5d60828a0e871186

Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
2016-11-22 13:06:36 -05:00
Debarshi Ray
00bf553a60 GDBusMethodInvocation: Clarify how the ownership is handled
https://bugzilla.gnome.org/show_bug.cgi?id=767952
2016-11-22 17:06:48 +01:00
Benjamin Otte
578b42a2f2 glib-compile-resources: Add suggested braces
... around empty body in an 'else' statement
2016-11-20 23:50:56 +01:00
Benjamin Otte
611b079e3d gvariant: Add suggested braces
... around empty body in an 'else' statement
2016-11-20 23:50:56 +01:00
Patrick Griffis
3a8ac6e221 glib-compile-resources: Escape file names in dependency file
https://bugzilla.gnome.org/show_bug.cgi?id=774368
2016-11-20 13:33:21 -05:00
Patrick Griffis
7a8cbc60a5 glib-compile-resources: Add --generate-phony-targets flag
This includes phony targets for each dependency in the the generated
dependency file which allows building with `ninja` which doesn't like
the phony targets[1] but also allows silencing `make` errors similar to
gcc's -MP option.

[1] - https://github.com/ninja-build/ninja/issues/1184

https://bugzilla.gnome.org/show_bug.cgi?id=774368
2016-11-20 13:33:21 -05:00
Petr Kulhavy
437474318f GSocket: do not process control messages if not requested by the user
If g_socket_receive_message_with_timeout() is called with messages ==
NULL set the msg_control buffer to empty to not request the control
messages from recvmsg() at all.

This completely disables the control message processing and reduces
overhead, which might be critical at high packet rate.

https://bugzilla.gnome.org/show_bug.cgi?id=774520
2016-11-20 11:09:45 -05:00
Yosef Or Boczko
4ddaa891e0 Updated Hebrew translation 2016-11-17 22:24:26 +02:00
Ross Burton
a8c6e306bd glib-gettextize: respect @datadir@ instead of assuming $prefix/share
https://bugzilla.gnome.org/show_bug.cgi?id=774421
2016-11-14 18:33:32 +00:00
Ross Burton
11a6e19e07 tests/refcount/signals: don't shadow rand()
rand() is in the C library and some C libraries (uclibc, for example) end up
with rand() defined even if stdlib.h isn't included explicitly.

https://bugzilla.gnome.org/show_bug.cgi?id=774421
2016-11-14 18:33:32 +00:00
Philip Withnall
9f4d5e8b91 gsignal: Mention handler ID type in signal connection macro docs
gtk-doc doesn’t make the return type clear, because these are macros
rather than inline functions, so people often have to guess at the
return type (or look it up from g_signal_connect_closure(), but that’s
hard work).

Make it clear that the return type for handler IDs is gulong. While
there, fix the capitalisation of ‘id’ to ‘ID’ in a few places.
2016-11-10 16:12:41 +00:00
Philip Withnall
3f12ca57c4 gtestutils: Clarify that g_assert() should not have side effects
g_assert() gets completely compiled out if G_DISABLE_ASSERT is defined,
so applications should not depend on side effects of the expression in
an assertion.
2016-11-09 16:52:21 +00:00
Mohammed Sadiq
4607bd377f gmain: fix g_main_context_check declaration
g_main_context_check is defined as a function returning gboolean.
It should be declared as such.

https://bugzilla.gnome.org/show_bug.cgi?id=774086
2016-11-09 10:38:20 -05:00
Philip Withnall
d8acf9b956 gmacros: Clarify G_GNUC_[PRINTF|SCANF] macro documentation
Clarify that the arguments parameter can be zero if the function being
annotated just accepts a string format argument, and no varargs for it
(for example, if it takes a va_list of arguments instead).

Add some links to the GCC documentation for the `format` attribute.
2016-11-09 15:11:53 +00:00
Philip Withnall
1f36189aa5 gapplication: Fix a typo in a documentation comment
It’s ‘D-Bus’, not ‘DBus’, ‘DBUS’, ‘D Bus’, ‘Dee Buss’ or ‘the bus’.
2016-11-08 21:13:45 +00:00
Tim-Philipp Müller
932eb87083 glib-mkenums: fix variable declaration
Inconsequential, just sync up declaration with actual
name of variable to avoid confusion.

https://bugzilla.gnome.org/show_bug.cgi?id=770175
2016-11-08 15:21:03 +00:00
Patrick Griffis
d1763d899c Revert "glib-compile-resources: Output depfile in same directory as target"
This reverts commit 9006940de6.
2016-11-05 22:15:53 -04:00
Patrick Griffis
9006940de6 glib-compile-resources: Output depfile in same directory as target
https://bugzilla.gnome.org/show_bug.cgi?id=773437
2016-11-02 17:44:23 -04:00
Chun-wei Fan
acd07cfc55 build/Makefile-newvs.am: Do not hardcode the baseline MSVC version
This is to allow specification of the baseline Visual Studio 201x version as
the baseline version may not be 2010 anymore as we begin to require C99
features that will require Visual Studio 2013 or later.
2016-11-01 15:39:16 +08:00
Chun-wei Fan
1f33b36cd1 build/Makefile.msvcproj: Add rules for MSVC 2013 to be the baseline version
We are starting to require C99 features that can only be supported in
Visual Studio 2013 and later, so we need to prepare rules for Visual Studio
2013 to be our baseline version for Visual Studio builds, so that we can
move the templates from Visual Studio 2010 to Visual Studio 2013.

As this strives to be a shared autotools module between projects, there is
duplication at this point, though, because we still want to support
2008~2012 for projects that do not yet require the C99 features and depends
on GLib-2.50.x/GTK+-3.22.x or earlier.
2016-11-01 15:39:16 +08:00
Aurimas Černius
e37a3c9473 Updated Lithuanian translaton 2016-10-30 13:20:15 +02:00
Mario Blättermann
37e818696f Update German translation 2016-10-29 13:44:44 +00:00
Marek Černocký
e6990cf4ae Updated Czech translation 2016-10-28 17:59:21 +02:00
Anders Jonsson
316232211b Update Swedish translation 2016-10-27 11:49:21 +00:00
Daniel Mustieles
dadb774898 Update Spanish translation 2016-10-25 15:22:42 +00:00
Matthias Clasen
b408278446 2.51.0 2016-10-24 10:22:38 -04:00
Matthias Clasen
2d56c49b10 Partially revert 10c490cdfe
This commit broke some tests, and I don't have the time
to fix up all the expected output, so I'll revert the changes
to the affected files for now.

This needs to be redone with the necessary test fixes.
2016-10-24 10:21:59 -04:00
Daniel Macks
b56ededeec Document "-s" commandline flag for running test suites
https://bugzilla.gnome.org/show_bug.cgi?id=769135
2016-10-24 06:12:56 -04:00
Timm Bäder
f14389bec9 gapplication: Properly free the option_strings
option_strings gets set in g_application_add_main_option, so it can
contain elements independent from packed_options.

https://bugzilla.gnome.org/show_bug.cgi?id=773303
2016-10-24 06:10:57 -04:00
Hannes Müller
7470cc902b Avoid warning for G_PARAM_DEPRECATED with GCC 6 [-Wpedantic]
Refer to https://bugzilla.gnome.org/show_bug.cgi?id=767882
Related to GCC https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71803
2016-10-24 06:10:14 -04:00
Patrick Griffis
243c1b7e84 glib-compile-resources: Fix creating depfile with other targets
Follow up to 87d76a5a9c from bug 745754

https://bugzilla.gnome.org/show_bug.cgi?id=773344
2016-10-24 01:41:57 -04:00
Muhammet Kara
feeb039e70 Update Turkish translation 2016-10-23 20:06:44 +00:00
Gábor Kelemen
427ecb7502 Update Hungarian translation 2016-10-23 17:42:48 +00:00
Aurimas Černius
67e3a89d97 Updated Lithuanian translation 2016-10-23 14:27:49 +03:00
Claude Paroz
043208f614 Updated French translation 2016-10-21 10:27:36 +02:00
Sebastian Dröge
2a970e33a4 gresolver: Make get_default() thread-safe
https://bugzilla.gnome.org/show_bug.cgi?id=773262
2016-10-20 17:49:44 +03:00
Chun-wei Fan
c718bf881a build/win32/vs10/Makefile.am: Delete glib-install.props's on re-generation
This is to ensure the changes that is applied to glib-install.props here is
applied to the projects files in build/win32/vs[11|12|14] as well.
2016-10-19 15:31:24 +08:00
Chun-wei Fan
70040b4094 build/: Force MSVC project file generation on Makefile.am changes
Make the Makefile.am targets for generating the Visual Studio projects re-generate the
project files and the header listings whenever the Makefile.am's that include
build/Makefile.msvcproj changes, so that whenever a source/header is added, they will
be reflected in the projects and in the property sheets that are used to copy the
headers.

Also ensure that these are applied to the vs11, vs12 and vs14 projects when this
happens, as they are copied and processed from the Visual Studio 2010 projects.
2016-10-19 14:54:12 +08:00
Piotr Drąg
610a0a3f75 Update Polish translation 2016-10-18 22:40:25 +02:00
Kjartan Maraas
b41212a28d Updated Norwegian bokmål translation from Kjartan Maraas. 2016-10-16 19:38:11 +02:00
Aurimas Černius
55ce274dc9 Updated Lithuanian translation 2016-10-15 22:10:28 +03:00
Simon McVittie
6ab68e9668 Bump version to 2.51.0
So that we don't get "deprecation" (availability) warnings for
new functionality of GLib 2.51/2.52.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Colin Walters <walters@verbum.org>
2016-10-13 21:53:27 +01:00
Simon McVittie
c46dbd4752 Make g_utf8_make_valid public
Based on a patch by Simon van der Linden and rebased onto current GLib,
with improved documentation loosely based on Telepathy's
tp_utf8_make_valid().

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=591603
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=610969
Reviewed-by: Colin Walters <walters@verbum.org>
2016-10-13 21:52:42 +01:00
Edward E
01bfa16986 W32: pass correct (with offset) argc to protect_wargv
https://bugzilla.gnome.org/show_bug.cgi?id=772054
2016-10-13 14:10:57 +00:00
Benedikt M. Thoma
ee4c618f20 Update German translation 2016-10-13 09:22:54 +00:00