Commit Graph

16529 Commits

Author SHA1 Message Date
Marek Černocký
2e918501db Updated Czech translation 2015-12-24 14:40:22 +01:00
Philip Withnall
30788dff5b gutf8: Fix typo in GIR annotation for g_utf8_to_ucs4() 2015-12-23 16:48:10 +00:00
Steven Chamberlain
42b160b19f gio: drop obsoleted lock causing deadlocks on FreeBSD
I think it is a recursion from the GUnixMountMonitor constructor, to a
GLocalFileMonitor on /etc/fstab, and into GUnixMountMonitor again, now
with a mutex already held, so it deadlocks.
https://bugzilla.gnome.org/page.cgi?id=traceparser/trace.html&trace_id=235354

That mutex in glocalfile.c:g_local_file_find_enclosing_mount() doesn't
seem necessary any more IMHO.  Inside it, only 'mount' is modified, but
that's just a stack variable local to this function.  When
klass->get_mount_for_mount_path is called, it's given one const
parameter and the other is unused, so they're unchanged. 'klass'
doesn't seem it could be modified either inside that function.

It doesn't recurse infinitely, but seems to work correctly and pass the
testsuite after this change.

The FreeBSD project already applied my patch in their ports tree, and
their users seem happy with it.

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=712848#64
and https://bugzilla.gnome.org/show_bug.cgi?id=753378
2015-12-23 09:40:54 -05:00
Chun-wei Fan
bec6a9a300 g_application_run(): Fix on Windows When Using Bindings
As g_win32_get_command_line() calls CommandLineToArgvW() to acquire the
arguments passed into a GApplication program, it actually returns the
whole command line which is used to invoke the program, including the
script interpreter and its flags when a script using GNOME bindings
(e.g. PyGObject and so on) is being invoked.

The issue here is that g_application_run() would most probably have
trouble in the scripts scenario on Windows as it is likely unable to
"recognize" the script interpreter, causing such scripts to fail to run.

Largely based on the patch by Ray Donnelly <mingw.android@gmail.com>.

https://bugzilla.gnome.org/show_bug.cgi?id=734095
2015-12-22 17:33:33 +08:00
Ignacio Casal Quinteiro
5f4b92202b win32: fix warnings avoid discarding const qualifier 2015-12-21 12:22:10 +01:00
Aurimas Černius
07e55c049d Updated Lithuanian translation 2015-12-20 15:02:49 +02:00
Xavier Claessens
aa9a33b0da GApplication: Avoid getting the default context repeatidly
This avoids getting a global lock on every main loop iteration.

https://bugzilla.gnome.org/show_bug.cgi?id=759554
2015-12-16 11:44:43 -05:00
Matthias Clasen
1f341afa9a More updates 2015-12-16 09:16:35 -05:00
Jasper St. Pierre
a379a0ad59 gapplication: Acquire the main context before running
Otherwise, we'll acquire it on every loop iteration, which can leave us
vulnerable to racing another thread for the acquisition of the main
context.

This can break methods like g_main_context_invoke, which try to acquire
a context to figure out if it can invoke the method synchronously or
need to defer to an idle. In these cases, it isn't guaranteed that the
invocation function will be invoked in the default main context,
e.g. the one that GApplication is holding.

This also matches what GMainLoop is doing.

https://bugzilla.gnome.org/show_bug.cgi?id=752983
2015-12-16 09:15:43 -05:00
Matthias Clasen
5e73ca974d 2.47.4 2015-12-16 07:52:05 -05:00
Руслан Ижбулатов
ce985f13f4 Enable contenttype test on W32, tweak it to pass (mostly)
* On W32 use a real directory (SYSTEMROOT) instead of '/etc/'
* Disable test_symbolic_icon() as it can't be passed (symbolic icons are not
  really supported)

* PowerPoint/Gettext test still fails, presumably because msvcrt qsort() moves
  the entires (both have the same priority)

https://bugzilla.gnome.org/show_bug.cgi?id=735696
2015-12-16 07:47:54 -05:00
Руслан Ижбулатов
b86e46e8e7 xdgmime: Finer handling for cases where mmap() is not available
Allocate an empty cache object, check cache objects for being empty
before using them.
Otherwise the code will re-read cache every 5 seconds, as NULL cache
does not trigger the code that stores mtime, which makes the cache
file appear modified/unloaded permanently.

https://bugzilla.gnome.org/show_bug.cgi?id=735696
2015-12-16 07:47:54 -05:00
Simon Feltman
1513efc904 Add GParamSpec object ref management annotations
Add ref-func, unref-func, set-value-func, and get-value-func annotations to
GParamSpec so that it can be managed generically as a fundamental type with
introspection.

https://bugzilla.gnome.org/show_bug.cgi?id=710243
2015-12-16 07:47:54 -05:00
Matthias Clasen
04c56cf6e7 gsettings: Don't translate ""
The empty msgid is traditionally used to store po file metadata,
so calling gettext with an empty msgid is not the right thing
to do.

https://bugzilla.gnome.org/show_bug.cgi?id=756214
2015-12-16 07:47:53 -05:00
Allison Ryan Lortie
30359e7409 file monitors: reorder some code to avoid segfault
We must initialise '->source' before we use fields inside of it.

https://bugzilla.gnome.org/show_bug.cgi?id=758823
2015-12-16 07:47:53 -05:00
c2d0c40bff Fix gettext use
gettext() calls inside library have to use gi18n-lib.h.

https://bugzilla.gnome.org/show_bug.cgi?id=758553
2015-12-16 07:47:53 -05:00
Roman Lebedev
4cda92b587 glib-compile-resources: do not leak c_name
As per #578363, "if one requests e.g. strings via GOptionEntry.arg_data
then those are strduped and needs to be free'ed by the application."

Fixes following leak:

=================================================================
==29426==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 10 byte(s) in 1 object(s) allocated from:
    0 0x7f3ab783d37a in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x9437a)
    1 0x7f3ab70f7c82 in g_malloc /home/lebedevri/src/glib/glib/gmem.c:94
    2 0x7f3ab70f7f60 in g_malloc_n /home/lebedevri/src/glib/glib/gmem.c:330
    3 0x7f3ab713258e in g_strndup /home/lebedevri/src/glib/glib/gstrfuncs.c:425
    4 0x7f3ab709c86b in strdup_len /home/lebedevri/src/glib/glib/gconvert.c:864
    5 0x7f3ab709c966 in g_locale_to_utf8 /home/lebedevri/src/glib/glib/gconvert.c:905
    6 0x7f3ab7103c32 in parse_arg /home/lebedevri/src/glib/glib/goption.c:1276
    7 0x7f3ab71066fb in parse_long_option /home/lebedevri/src/glib/glib/goption.c:1670
    8 0x7f3ab7108047 in g_option_context_parse /home/lebedevri/src/glib/glib/goption.c:1997
    9 0x408532 in main /home/lebedevri/src/glib/gio/glib-compile-resources.c:629
    10 0x7f3ab6c72b44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b44)

https://bugzilla.gnome.org/show_bug.cgi?id=757299
2015-12-16 07:47:53 -05:00
Christian Hergert
3272267b99 macros: add G_GNUC_CHECK_VERSION() for compiler checks.
https://bugzilla.gnome.org/show_bug.cgi?id=728099
2015-12-16 07:47:53 -05:00
Allison Ryan Lortie
21b1c390a3 GApplication: destroy the impl on shutdown
It's theoretically possible (and see in the wild) for D-Bus messages to
come in to the application after shutdown() has been called and while
we're draining out the lingering events in the main context.

Prevent this from happening by ensuring we unregister our objects on
D-Bus during the shutdown process.

https://bugzilla.gnome.org/show_bug.cgi?id=757372
2015-12-16 07:47:53 -05:00
Ryan Lortie
aa16359986 Stop supporting non-POSIX getpwuid_r, getgrgid_r
Bug 13403 introduced support for the non-POSIX variants of these APIs
found on a system called "DG/UX".  Meanwhile, the complicated checks
here are breaking cross-builds on systems that we actually care about.

Remove the complicated checks and replace them with AC_CHECK_FUNCS.
Remove the resulting dead code from a couple of .c files.

https://bugzilla.gnome.org/show_bug.cgi?id=756475
2015-12-16 07:47:53 -05:00
Marius Gedminas
c935237e75 glib.py: Fix Python 3 TypeError in gdb pretty-printers
https://bugzilla.gnome.org/show_bug.cgi?id=749092
2015-12-15 19:40:43 -05:00
Paolo Borelli
c97729532f W32: fix uninitialized var in g_app_info_get_all_for_type
Compare with the handler->app, not with the app var which is not
initialized yet

https://bugzilla.gnome.org/show_bug.cgi?id=759408
2015-12-14 14:32:17 +01:00
Matthias Clasen
61136c2c73 Trivial doc comment fix
Use the same Since: syntax throughout.
2015-12-14 07:43:24 -05:00
Andrey Gursky
e9c9ff607c Add missing checks for gnulib vasnprintf()
Commit 212e4232e7 introduced a big update
of gnulib. Necessary changes to configure.ac from old gnulib commit
e8e63d1b31bca6c82713cba490b21a861abb24b5 have been forgotten. Actually
available functions are not discovered by autotools.

https://bugzilla.gnome.org/show_bug.cgi?id=759134
2015-12-07 20:52:10 -05:00
Sebastian Rasmussen
b3e0caa3e3 Updated Swedish translation 2015-12-02 21:12:12 +00:00
Chun-wei Fan
244f9e66f9 build/win32: Add NMake Makefile module for building tests and introspection
This adds a NMake Makefile module that can be used for building tests and
introspection using, NMake.  This is not yet distributed in the main GLib
tarballs, but this is placed here as the base location as this is
intended to be used in projects that support Visual Studio builds and
support the build of tests and/or introspection under Visual Studio using
NMake.
2015-12-02 21:23:10 +08:00
Chun-wei Fan
80dcec234c config.h.win32.in: Clean up a bit
Remove the HAVE_*INLINE items from here as well, since 'inline' is
unconditionally defined in gmacros.h.
2015-12-02 21:04:43 +08:00
Emmanuele Bassi
a81568273c docs: Be more precise on the use of set_resource_base_path()
The current wording is a bit vague on when to call
set_resource_base_path() in a GApplication implementation.
2015-12-01 12:57:02 +00:00
Chun-wei Fan
cfdd4cabe7 glib/glibconfig.h.win32.in: Clean up a bit further
Also get rid of the items regarding G_HAVE_*INLINE as they aren't used
anymore as they are removed from configure.ac.

Thanks to John Emmas and desrt for the earlier patch for getting
rid of the C4005 warnings.
2015-11-30 11:22:17 +08:00
Allison Ryan Lortie
f2fb877ef7 glibconfig.h.win32.in: remove G_CAN_INLINE
We now define this unconditionally in gmacros.h.

Thanks to John Emmas for the tip.

https://bugzilla.gnome.org/show_bug.cgi?id=757374
2015-11-27 11:31:41 -05:00
Allison Ryan Lortie
ec6971b864 gtypes.h: move G_STATIC_ASSERT to function scope
It seems that some compilers get upset if this is done at global scope,
so let's move it to function scope where we know it works.
2015-11-27 11:27:51 -05:00
Allison Ryan Lortie
a266ac62ea tests: fix a test on 32-bit builds
We were trying to squeeze 64-bit test vectors into gsize, which is fine
on 64bit systems but doesn't work very well on 32-bit.

Change that to a guint64.
2015-11-26 09:26:45 -05:00
Matthias Clasen
9787790448 GApplication: improve docs
Spell out which GVariant format strings to use for which
commandline option types. I just wasted some time debugging
this in an application.
2015-11-25 21:38:20 -05:00
Evangelos Foutras
db641e3292 GDBusProxy: Fix a memory leak during initialization
https://bugzilla.gnome.org/show_bug.cgi?id=758641
2015-11-25 17:33:11 -05:00
Allison Ryan Lortie
be225b76a7 GLib 2.47.3 2015-11-25 09:41:49 -05:00
Allison Ryan Lortie
ba12fbf8f8 gutils: g_bit_ inlines: add visibility macros
My careful efforts to preserve the exporting of these symbols on our ABI
was thwarted by our symbol visibility filtering.  Let's fix that.
2015-11-25 08:48:53 -05:00
Allison Ryan Lortie
4f18c671ab GLib 2.47.2 2015-11-24 19:44:46 +00:00
Allison Ryan Lortie
398c048c66 docs: remove GDBusObjectManager example
This example has been causing on-and-off build breaks for quite some
time.  In this case, the code for copying the generated content into the
main docs of GIO is causing problems with srcdir != destdir builds (due
to the files also being copied from the read-only srcdir during
distchecks).

We could probably work around this problem yet again, but since there is
no real benefit to having this content included, so let's remove it.

https://bugzilla.gnome.org/show_bug.cgi?id=734469
2015-11-24 18:44:02 +00:00
Tom Tryfonidis
69003a0751 Updated Greek translation
(cherry picked from commit bf0f0135a3)
2015-11-23 14:58:49 +00:00
Allison Ryan Lortie
7bc6f021d7 gmacros: fix unguarded use of __STDC_VERSION__
According to the C spec, any undefined identifier used in a #if
expression is taken to have a numerical value of zero.

Commit db2367e878 introduced an #i
statement which depended on this behaviour.

gcc has a -Wundef option which warns about depending on this behaviour,
and unfortunately there are projects that are using -Werror=undef in
builds that include our headers.

Adding a check for defined(__STDC_VERSION__) before using the macro is
enough to silence gcc.
2015-11-17 13:43:49 -05:00
Daniel Mustieles
1ee2db4a28 Updated Spanish translation 2015-11-17 18:48:06 +01:00
Dan Winship
f87e002313 Fix g_strerror() on non-glibc
When using one of the codepaths that copies the error string into buf,
make sure the string gets strdup() afterward.

https://bugzilla.gnome.org/show_bug.cgi?id=758194
2015-11-16 16:57:38 -05:00
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