Commit Graph

16287 Commits

Author SHA1 Message Date
GNOME Translation Robot
03cb2eb088 Added Scottish Gaelic translation 2015-11-16 18:20:41 +00:00
Allison Ryan Lortie
db2367e878 GLib: clean up the "inline" mess once and for all
It's been a long time since we've been unconditionally saying "static
inline" in GLib headers without complaints so it's safe to assume that
all compilers that we care about support this.

One thing that is not yet totally supported is the unadorned use of the
word "inline".  Depending on the flags (-std=c89, for example), even GCC
will complain about this.  Detect missing C99 support and define
"inline" to "__inline" in that case.  Some research shows "__inline"
appears to be the most widely-supported keyword here, but we may need to
tweak this if we get some reports of breakage.

Clean up all of the configure checks around this and define G_CAN_INLINE
unconditionally.  Unfortunately, we must assume that some people are
still using G_IMPLEMENT_INLINES, we must continue to implement that
(including undefining G_CAN_INLINE and redefining G_INLINE_FUNC) if
requested.

It is not our intent to break existing users of the old-style
G_INLINE_FUNC approach and if that has happened, we may need to make
some further adjustments.

https://bugzilla.gnome.org/show_bug.cgi?id=757374
2015-11-16 13:14:19 -05:00
Allison Ryan Lortie
9834f79279 gutils: clean up bit funcs inlining mess
gutils.h and gutils.c define three utility functions as inlines that are
also exported via the ABI.  This is done via complicated G_INLINE_FUNC
and G_IMPLEMENT_INLINES logic.

In order to be able to remove this mess, we create a another convoluted
but slightly cleaner approach: write straight-up inline versions of the
functions named _impl() in the header.  Define macros with the "public"
function names that call these inlines.  From the .c file, export the
ABI versions of these functions, implemented using the _impl() version.

https://bugzilla.gnome.org/show_bug.cgi?id=757374
2015-11-16 13:14:19 -05:00
Allison Ryan Lortie
0bfbb0d257 GTrashStack: uninline and deprecate
Deprecate GTrashStack and remove the inline implementations for the
functions.  This will help us clean up the mess that is inline functions
in GLib.

Because of how G_INLINE_FUNC worked, we have these functions on our ABI,
so we must continue to export them as normal functions.  We are safe to
remove the inline versions, however, because any existing binaries will
continue to carry them and any new builds will just start using the
non-inline versions.

https://bugzilla.gnome.org/show_bug.cgi?id=757374
2015-11-16 13:14:19 -05:00
Ben Iofel
7ab79b3879 GTask: fix example code in docs
https://bugzilla.gnome.org/show_bug.cgi?id=758181
2015-11-16 12:33:02 -05:00
Kjartan Maraas
448e01353a Updated Norwegian bokmål translation. 2015-11-15 23:59:35 +01:00
Chun-wei Fan
c50bb218de MSVC 2010+ builds: Do not explicitly use /LTCG
This partially reverts dc4361f.

As we now ensure that items using GResources and GConstructors are always
referenced so that the linker does not optimize them out in a default
Release build, we no longer need to enforce the use of /LTCG, so
/LTCG:incremental will work as well.
2015-11-12 15:26:20 +08:00
Chun-wei Fan
db4df9908e gconstructor: Work around constructors being optimized away on MSVC
Whole program optimization is enabled by default in visual studio
release builds, and this causes constructors (for e.g. resources) to be
optimized away as they are not referenced from elsewhere.

This works around this by some pragma magic.

https://bugzilla.gnome.org/show_bug.cgi?id=752837
2015-11-12 15:01:54 +08:00
Jeff Bai
228ad1ed9c Update zh_CN translations 2015-11-12 11:02:56 +08:00
Mikhail Zabaluev
0a10d38d15 Return value of g_hash_table_get_{keys,values} is (transfer container)
https://bugzilla.gnome.org/show_bug.cgi?id=757742
2015-11-07 18:55:17 +02:00
Mikhail Zabaluev
42463b840f ghash: Correctly annotate (nullable) and (out) parameters
https://bugzilla.gnome.org/show_bug.cgi?id=757742
2015-11-07 18:55:17 +02:00
Balázs Úr
0e53659971 Updated Hungarian translation 2015-11-07 15:08:05 +00:00
Philip Withnall
779b5c9af0 gtestutils: Fix a function name in a documentation example 2015-11-07 13:55:24 +01:00
Philip Withnall
25a7c817d3 glib: Add missing (nullable) and (optional) annotations
Add various (nullable) and (optional) annotations which were missing
from a variety of functions. Also port a couple of existing (allow-none)
annotations in the same files to use (nullable) and (optional) as
appropriate instead.

Secondly, add various (not nullable) annotations as needed by the new
default in gobject-introspection of marking gpointers as (nullable). See
https://bugzilla.gnome.org/show_bug.cgi?id=729660.

This includes adding some stub documentation comments for the
assertion macro error functions, which weren’t previously documented.
The new comments are purely to allow for annotations, and hence are
marked as (skip) to prevent the symbols appearing in the GIR file.

https://bugzilla.gnome.org/show_bug.cgi?id=719966
2015-11-07 10:48:32 +01:00
Sebastien Bacher
90808a0279 g_local_file_trash: remove invalid free call
Commit 8ece2de964 transplanted a block of
code that contained an early-exit-on-error case which freed several
variables.

Because of the move, the normal-path unconditional free of one of these
variables is now above this early exit case, so if this block is hit, it
will now be a double-free.

Remove that.

https://bugzilla.gnome.org/show_bug.cgi?id=757693
2015-11-06 11:55:57 -05:00
Philip Withnall
1ac2a606fc gtlsconnection: Fix a typo in the documentation 2015-11-06 11:27:24 +01:00
Dan Winship
751d3f00a8 Update .gitignore for overflow tests 2015-11-05 09:42:36 -05:00
Jan de Groot
4d74ca4c3a Make gtester-report compatible with Python 3
Convert tabs to spaces and replace print with print().
The script still works with Python 2.x.

https://bugzilla.gnome.org/show_bug.cgi?id=696324
2015-11-05 12:53:19 +01:00
Jussi Kukkonen
1c6e6671d1 gio/tests: Don't depend on a data file that's not built
data.gresource is not built when cross-compiling: Don't
add it to test_data in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=757628
2015-11-05 13:50:13 +02:00
Pedro Albuquerque
503e314748 Updated Portuguese translation 2015-11-05 05:58:56 +00:00
Simon McVittie
236e8040b4 Build gdbus-example-objectmanager-server again
It was removed, apparently accidentally, in commit 5b48dc4.
This had the side-effect that it wasn't included in tarball releases,
which means that commit ab7b4be doesn't work when building a package.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=734469
Reviewed-by: Colin Walters <walters@verbum.org>
2015-11-02 20:36:42 +00:00
Mikhail Zabaluev
0dbc81c73a Move G_POLLFD_FORMAT to glibconfig.h
It's a platform-specific macro, so it belongs in glibconfig.h.
This ensures that g-ir-scanner will not pick the wrong definition
for introspection.

https://bugzilla.gnome.org/show_bug.cgi?id=757294
2015-11-02 20:03:38 +02:00
Xavier Claessens
6f1b574cea Doc: Fix missing glibconfig.h when builddir!=srcdir
Currently the doc is incomplete when builddir!=srcdir
(e.g. debian package) because glibconfig.h is generared from
configure.ac and is thus missing from srcdir. This leads to
missing doc for symbols like G_GINT64_FORMAT.

https://bugzilla.gnome.org/show_bug.cgi?id=734469
2015-11-02 10:02:43 -05:00
Xavier Claessens
86a7c864b3 Doc: copy included example files
This fix missing files when src_dir != build_dir.

https://bugzilla.gnome.org/show_bug.cgi?id=734469
2015-11-02 09:26:58 -05:00
Lars Uebernickel
ee718d3526 gapplication: reject actions without names
https://bugzilla.gnome.org/show_bug.cgi?id=756134
2015-11-02 13:52:10 +01:00
Daiki Ueno
863bffdac7 doc: fix g_task_attach_source() example
The 3rd argument of the function is not a GCallback, but a GSourceFunc.

https://bugzilla.gnome.org/show_bug.cgi?id=757451
2015-11-02 11:14:04 +09:00
Xavier Claessens
df352203d6 Stop using g_sequence_get_length() to check if it's empty
g_sequence_is_empty() is more efficient for that task.

https://bugzilla.gnome.org/show_bug.cgi?id=756988
2015-10-30 11:35:28 -04:00
Xavier Claessens
2bc32606c7 GSequence: document that _get_length() is not O(1)
https://bugzilla.gnome.org/show_bug.cgi?id=756988
2015-10-30 11:35:27 -04:00
Xavier Claessens
2331437df3 Doc: fix some gtk-doc warnings
https://bugzilla.gnome.org/show_bug.cgi?id=755364
2015-10-30 10:30:55 -04:00
Allison Ryan Lortie
7dd9ffbcff tests: test bounds-checked int arithmetic
Add some simple testcases for the new bounds-checked integer arithmetic
helpers.

Include a second build of the testcase to make sure we test the fallback
code even if we are on a compiler that supports the intrinsics.

https://bugzilla.gnome.org/show_bug.cgi?id=503096
2015-10-30 11:58:49 +01:00
Allison Ryan Lortie
d0219f2597 GLib: add bounds-checked unsigned int arithmetic
Add some helpers for builds-checked unsigned integer arithmetic to GLib.
These will be based on compiler intrinsics where they are available,
falling back to standard manual checks otherwise.

The fallback case needs to be implemented as a function (which we do
inline) because we cannot rely on statement expressions.  We also
implement the intrinsics case as an inline in order to avoid people
accidentally writing non-portable code which depends on static
evaluation of the builtin.

For now there is only support for addition and multiplication for guint,
guint64 and gsize.  It may make sense to add support for subtraction or
for the signed equivalents of those types in the future if we find a use
for that.

https://bugzilla.gnome.org/show_bug.cgi?id=503096
2015-10-30 11:58:49 +01:00
Allison Ryan Lortie
89bda59170 macros: add dummy __has_builtin()
Add a dummy definition for Clang's __has_builtin() macro.  This will
allow us to use __has_builtin() unconditionally, in the same way as we
already do for __has_feature().

https://bugzilla.gnome.org/show_bug.cgi?id=503096
2015-10-30 11:58:49 +01:00
Yosef Or Boczko
41bd8c90ae Updated Hebrew translation 2015-10-30 12:50:00 +02:00
Murray Cumming
adfd184776 Fix tiny typo. 2015-10-28 10:50:40 +01:00
Chun-wei Fan
d52625a94a gwin32.c: Fix g_win32_check_windows_version() on 32-bit
The Windows API function RtlGetVersion() is actually a function that is
decorated by WINAPI (i.e. __stdcall), so we need to correct this so that
the symbol can be loaded correctly from ntdll.dll, so that we won't crash as
a result.  Should fix the crash due to stack overflow on 32-bit builds.

https://bugzilla.gnome.org/show_bug.cgi?id=756179
2015-10-27 09:28:10 +08:00
Matthias Clasen
f87fd39cf3 2.47.1 2015-10-26 13:52:47 -04:00
Matthias Clasen
a036bd38a5 Try to fix the desktop-app-info test
This was broken in 2bb898c60f.
2015-10-26 13:52:47 -04:00
Rico Tzschichholz
e93aaeb533 gio: Fix version of "Since" annotation 2015-10-25 19:43:54 +01:00
Rico Tzschichholz
0d4f6afcdf docs: Add index for 2.48 api 2015-10-25 19:42:18 +01:00
Dan Winship
4dae2d8289 gtask: re-fix tasks-blocking-other-tasks
The new "slowly add more task threads" code doesn't fully deal with
apps that queue lots and lots of tasks which then block on tasks from
their task threads. Fix this by bringing back the "task is blocking
other task" check and making sure that such tasks get bumped to the
front of the queue.

https://bugzilla.gnome.org/show_bug.cgi?id=687223
2015-10-24 10:37:22 -04:00
Chun-wei Fan
556705cb9c gwin32.c: Fix build on Visual Studio
ntdef.h is a header that is normally only shipped with MinGW, not Visual
Studio, which broke the build in commit 975cb91.  Fix this by including
winternl.h, which typedef's the NTSTATUS type in question on both Visual
Studio and MinGW/mingw-w64, as well as pre-2008 Visual Studio.

Clean up this inclusion part a little bit as well.
2015-10-24 11:05:27 +08:00
Dan Winship
af0a47701d gtypes.h: fix G_MAXUINT64 definition to use G_GUINT64_CONSTANT
(Noticed as part of https://bugzilla.gnome.org/show_bug.cgi?id=756550)
2015-10-23 11:38:31 -04:00
Dan Winship
263aac125e .gitignore updates 2015-10-23 11:28:03 -04:00
Ignacio Casal Quinteiro
50d704ab8f win32: make sure bytes_read/written is set to 0 on error
If we fail to PeekMessage or PostMessage we should make sure
that the output parameter bytes_read/written is set 0 instead
of being left uninitialized. This fixes an assertion in the io
channel call where the following invariant is checked:
(status == G_IO_STATUS_NORMAL) || (read_size == 0)
2015-10-23 10:34:50 +02:00
Víctor Manuel Jáquez Leal
3bb8294e00 giomodule: return a copy of module name
This is a regression from commit 6dedc0.

The clients expect to free the received module name, so the function
must return a copy.

https://bugzilla.gnome.org/show_bug.cgi?id=756952
2015-10-22 11:21:47 +02:00
Ignacio Casal Quinteiro
144a87a643 Use bin/gio/modules when building with visual studio 2015-10-22 09:22:01 +02:00
Ignacio Casal Quinteiro
6dedc0364a Factor out a get_gio_module_dir
This also fixes some memory leaks on windows
2015-10-22 08:42:22 +02:00
Robert Ancell
31c45cb6ae gkeyfile: Handle whitespace after boolean values
Ignore trailing whitespace when reading boolean values. Currently it is
very easy to manually edit a keyfile to be:

[section]
key=true_

Where '_' is a space character. g_key_file_get_boolean will read this value as
false and this is hard for a user to detect (it will be reported in GError
as an invalid value).

Trailing whitespace is ignored for numbers for the same reason. This was
fixed in 7a45dde4fe.

https://bugzilla.gnome.org/show_bug.cgi?id=664740
2015-10-21 15:26:53 +13:00
Robert Ancell
51ed0f0405 gkeyfile: Test that whitespace is allowed after numbers
Test that whitespace is allowed after numbers - this was fixed in
commit 7a45dde4fe.
2015-10-21 15:26:17 +13:00
Sebastian Dröge
975cb91085 win32: Include ntdef.h for NTSTATUS
https://bugzilla.gnome.org/show_bug.cgi?id=756875
2015-10-20 20:47:07 +03:00