Commit Graph

15957 Commits

Author SHA1 Message Date
Dan Winship
96675446c5 Make g_strerror() do less work
Store the (translated, UTF-8-encoded) error strings in a hash table to
avoid doing translation and (possibly) g_locale_to_utf8() in every
g_strerror() call.

https://bugzilla.gnome.org/show_bug.cgi?id=754788
2015-09-11 12:39:44 -04:00
Dan Winship
19eb511ba4 More g_strerror() fixes
Add a check to configure.ac for strerror_r, since we don't currently
require POSIX.1-2001 conformance in general. Add back a
plain-strerror() case as a fallback, and rearrange the glibc-vs-POSIX
strerror_r() branches.

Update the docs to not claim that "not all platforms support the
strerror() function" (we require C90), but still mention the UTF-8 and
always-valid-string benefits. (And make test_strerror() check that
last part.)

https://bugzilla.gnome.org/show_bug.cgi?id=754788
2015-09-11 12:38:18 -04:00
Michael Catanzaro
ee6740aa78 Fix a typo 2015-09-10 20:46:37 -05:00
Kalev Lember
b8a5e22b6b Bump version
So that early adopters of new api have a version to target.
2015-09-10 15:06:56 +02:00
Kalev Lember
d19411a76f autocleanups: Add GString type
https://bugzilla.gnome.org/show_bug.cgi?id=754831
2015-09-10 14:36:43 +02:00
Chun-wei Fan
4025b5a54f MSVC Builds: "Add" MSVC 2015 Projects
This "adds" the Visual Studio 2015 Project files by doing what we did
before: copying the Visual Studio 2010 projects and replacing items
in them, as the formats of the Visual Studio 201x projects are largely
the same.
2015-09-09 15:21:26 +08:00
Chun-wei Fan
9c7df09c3b MSVC Builds: Simplify Script to Generate glib-mkenums
Use a simple all-purpose utility script to generate the glib-mkenums
PERL script with the version info, and stop using the script that
tries to parse the autotools files.  Move the things that
were taken out from build/win32/setup.py back there.
2015-09-09 15:21:12 +08:00
Matej Urbančič
0570adff80 Updated Slovenian translation 2015-09-08 23:19:40 +02:00
Sebastian Dröge
20e8b63477 gioerror: Add more mappings for WinSock error codes
https://bugzilla.gnome.org/show_bug.cgi?id=754560
2015-09-08 17:39:07 +03:00
Rico Tzschichholz
5a84f84325 gparam: Fix Since tag of g_param_spec_get_name_quark 2015-09-08 14:15:44 +02:00
Rico Tzschichholz
925dca1746 docs: Add index for 2.46 api 2015-09-08 14:14:13 +02:00
Chun-wei Fan
0be6766d9b MSVC Builds: Prepare For Visual Studio 2015
Update the autotools module so that we can use it to upgrade the
Visual Studio 2010 projects to become Visual Studio 2015-compatible.

Note that this will make the MSVC 2015 builds use the the the latest
VC140 CRT.
2015-09-08 15:51:58 +08:00
Matthias Clasen
00933dfc9c Speed up property change notification a bit
Avoid the quark lock and hash table lookup for every
emission of ::notify.
2015-09-07 20:56:10 -04:00
Matthias Clasen
41c0d15a6d Add a method to get the pspec name quark
This lets us avoid the quark lookup in the hot
property change notification path.
2015-09-07 20:54:01 -04:00
Matthias Clasen
a62ad79f5c Clean up locking in g_object_notify_queue_add
Instaed of returning with the lock held, simply assert
that this cannot happen:

https://bugzilla.gnome.org/show_bug.cgi?id=749678#c4
2015-09-07 19:57:53 -04:00
Matthias Clasen
087d75e3c3 Make g_set_object more symmetric
As argued in bug 748633, and order of ref, assign, unref is
preferable.
2015-09-07 19:43:19 -04:00
Ting-Wei Lan
ebf961a58d Make g_strerror work with non-glibc POSIX systems
We should only use GNU-specific strerror_r on glibc. On other systems,
we should use the XSI-compliant version.

https://bugzilla.gnome.org/show_bug.cgi?id=754601
2015-09-07 15:18:01 -04:00
Matthias Clasen
e773acfe9a tests: Don't test g_utf8_to_ucs4_fast too rigorously
The function is documented to assume valid input, and doesn't
guarantee behavior with invalid input. So don't test that.

https://bugzilla.gnome.org/show_bug.cgi?id=754636
2015-09-07 15:01:16 -04:00
Matthias Clasen
db3ffe5bf1 unicode-encoding test: Differentiate error messages
Spitting out the same error for different cases in not helpful.
2015-09-07 15:01:16 -04:00
Changwoo Ryu
cb3a03e1e2 Updated Korean translation 2015-09-08 01:59:08 +09:00
Matthias Clasen
23229bfd0c GString: Avoid some repeated parameter checking
Many of the append and prepend variants are just thin wrappers
around another one. Remove parameter checking in the wrapper
for these cases. The wrapped function is checking them anyway.
2015-09-07 10:35:13 -04:00
Matthias Clasen
03db1f455b Remove some unused code
The function unescape_gstring_inplace was maintaining a line count
without ever making use of it. Drop that.
2015-09-07 09:50:41 -04:00
Matthias Clasen
44af2b1c17 Simplify g_param_spec_get_redirect_target a bit more
It is enough to look for exact matches here, so no need to
dive into g_type_instance_is_a and take locks, etc.
2015-09-07 03:02:11 -04:00
Matthias Clasen
f1f80111c9 Simplify g_param_spec_get_redirect_target
There is no need to do a type check in a g_return_if_fail if the
type check is tne next thing the function does anyway.
2015-09-07 02:33:50 -04:00
Mikhail Zabaluev
401f78652c Reorganized utf8-performance tests
Now each function-string pair gets its own test path to track
a single performance result.

https://bugzilla.gnome.org/show_bug.cgi?id=738504
2015-09-05 13:14:11 -04:00
Mikhail Zabaluev
b963565125 Unrolled implementation of g_utf8_to_ucs4_fast()
Unrolling the branches and expressions for all expected cases
of UTF-8 sequences facilitates the work of both an optimizing compiler
and the branch prediction logic in the CPU. This speeds up decoding
noticeably on text composed primarily of longer sequences.

https://bugzilla.gnome.org/show_bug.cgi?id=738504
2015-09-05 13:12:48 -04:00
Mikhail Zabaluev
3188b8ee79 Optimized branching in g_utf8_validate()
The number of branches and logical operations can be reduced by
never producing a resulting wide character value to check its range.
Instead, individual bytes in the sequence are validated
depending on the branch taken on the basis of preceding bytes.
The syntax given in RFC 3629 is made use of.

https://bugzilla.gnome.org/show_bug.cgi?id=738504
2015-09-05 13:10:57 -04:00
Matthias Clasen
5644ee5083 markup: trivial refactor
Avoid an unnecessary branch.
2015-09-05 13:02:33 -04:00
Matthias Clasen
d28639507d list store: Fix a parameter check
Getting this wrong causes build failures.

https://bugzilla.gnome.org/show_bug.cgi?id=754582
2015-09-04 13:56:57 -04:00
Baurzhan Muftakhidinov
da4927b7fb Updated Kazakh translation 2015-09-04 16:23:43 +00:00
Milo Casagrande
6e16185600 Updated Italian translation 2015-09-04 07:49:58 +00:00
Chun-wei Fan
1387a16bf4 MSVC Builds: Remove Static Items
... which are now generated with the new autotools module, so we just
need to ensure the generated items are being dist'ed.

https://bugzilla.gnome.org/show_bug.cgi?id=735429
2015-09-03 19:10:26 +08:00
Chun-wei Fan
041e77249a Cleanup and Enhance the MSVC Project Generation
Make use of the common autotools module that is used to generate the MSVC
project files from their respective templates so that the main build files
beccome cleaner, and enhance them in a way that the headers that should be
installed can be written to the property sheets during 'make dist', so that
the chances of missing headers for MSVC builds can be greatly reduced.

Also use this autotools module to fill in the projects for
glib-compile-schemas and glib-compile-resources.

https://bugzilla.gnome.org/show_bug.cgi?id=735429
2015-09-03 19:10:06 +08:00
Chun-wei Fan
700983c8c9 build: Add Common Autotools Module for MSVC Projects
This adds a common autotools module that can be used by various
projects to generate the Visual Studio projects as needed, and
if necessary, generate the headers listings to "install" for that
project, based on items passed in to this.  This is modelled on the
Makefile.introspection autotools file that is used by many GNOME
projects to generate the introspection files.

https://bugzilla.gnome.org/show_bug.cgi?id=735429
2015-09-03 19:08:55 +08:00
Aurimas Černius
63a5556aa2 Updated Lithuanian translation 2015-09-02 21:17:11 +03:00
Philip Withnall
7a65d1d3fb gmem: Fix a typo in the g_try_new0() documentation 2015-09-02 14:52:52 +01:00
Philip Withnall
b77fe970db gstring: Mark g_string_free() as taking (transfer full) input
This is unusual, but the correct annotation for a free() function.

https://bugzilla.gnome.org/show_bug.cgi?id=742903
2015-09-02 14:51:51 +01:00
Chun-wei Fan
4cad3f5e1b glib/strfuncs.c: Fix Build on Windows
Windows does not have strerror_r(), but does have strerror_s(), which is
threadsafe, and does more or less the same thing, so use it on Windows to
fix the build.

https://bugzilla.gnome.org/show_bug.cgi?id=754431
2015-09-02 17:03:44 +08:00
Ting-Wei Lan
4a09d0cf7a Fix return value error in g_list_store_sort 2015-09-02 01:19:40 +08:00
Matthias Clasen
f14e2e5c53 2.45.7 2015-09-01 10:58:32 -04:00
Emmanuele Bassi
b04c565f33 gio: Link against gmodule when building tools
Otherwise cross-compilation will fail with linker errors.

https://bugzilla.gnome.org/show_bug.cgi?id=753745
2015-09-01 10:40:24 -04:00
Emmanuele Bassi
5ce70917df Drop binary checks when cross-compiling
We don't need to run binaries we just built in order to successfully
build GLib and friends any more.

Since commit b74e2a7, we don't need to run glib-genmarshal when building
GIO; since commit f9eb9eed, all our tests (including the ones that do
need to run binaries we just built) are only built when running "make
check", instead of unconditionally at every build.

This means that we don't need to check for existing, native binaries
when cross-compiling, and fail the configuration step if they are not
found — which also means that you don't need to natively build GLib for
your toolchain, in order to cross-compile GLib.

We can also use the cross-compilation conditional, and skip those tests
that require a binary we just built in order to build.

https://bugzilla.gnome.org/show_bug.cgi?id=753745
2015-09-01 10:40:24 -04:00
Matthias Clasen
1dec512a66 Revert "GSettings: delay backend subscription"
This reverts commit 8ff5668a45.

This change has had considerable fallout, and there was no
follow-up to address it.

https://bugzilla.gnome.org/show_bug.cgi?id=733791
2015-09-01 10:21:26 -04:00
Matthias Clasen
7fff264777 Revert "GSettings: fix check for delaying backend subscription"
This reverts commit d511d6b37f.
2015-09-01 10:18:23 -04:00
Iain Lane
16721468e5 gsignal: Don't crash when operating on signals on the wrong object 2015-09-01 14:30:43 +01:00
Iain Lane
261250c46e Test that disconnecting from the wrong thing warns and doesn't crash
This broke in 916297be79 (≥ 2.45.3)
2015-09-01 14:30:37 +01:00
Alexandre Franke
976da775cb Updated French translation 2015-09-01 07:57:48 +00:00
Dan Winship
9f2e3f6b72 gtestutils: add g_assert_cmpmem()
Add a test macro to compare two buffers (which are not already known
to be the same length) for equality.

https://bugzilla.gnome.org/show_bug.cgi?id=754283
2015-08-31 13:59:48 -04:00
Dan Winship
367f36d630 gtestutils: forbid having two tests with the same full path
In the same way that gtestutils used to let you create multiple suites
with the same name, it also let you create multiple tests with the
same name. Make that an error instead (and fix glib/tests/base64.c,
which was registering three separate tests named
"/base64/incremental/nobreak/4", and glib/tests/autoptr.c, which was
running test_g_variant_builder() twice).

https://bugzilla.gnome.org/show_bug.cgi?id=754286
2015-08-31 13:58:56 -04:00
Dan Winship
123ea70d74 gtestutils: improve non-TAP output, fix handling of incomplete tests
In non-TAP mode, tests that used g_test_skip() were labelled "OK", and
tests that used g_test_incomplete() were labelled "FAIL". Explicitly
show them as "SKIP" and "TODO" instead, like in the TAP case.

Also, incomplete/TODO tests are not supposed to be treated as
failures, so fix that too.

https://bugzilla.gnome.org/show_bug.cgi?id=754286
2015-08-31 13:58:56 -04:00