summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTING.md6
-rw-r--r--docs/CODEOWNERS6
-rw-r--r--docs/reference/gio/gdbus-codegen.xml2
-rw-r--r--docs/reference/glib/building.xml2
-rw-r--r--docs/reference/glib/programming.xml30
-rw-r--r--docs/supported-platforms.md16
-rw-r--r--gio/gwin32networkmonitor.c24
-rw-r--r--gio/tests/meson.build4
-rw-r--r--gio/tests/socket-common.c2
-rw-r--r--gio/tests/socket-testclient.c (renamed from gio/tests/socket-client.c)0
-rw-r--r--gio/tests/socket-testserver.c (renamed from gio/tests/socket-server.c)0
-rw-r--r--glib/tests/assert-msg-test.c38
-rw-r--r--glib/tests/messages-low-memory.c9
-rw-r--r--meson.build2
14 files changed, 106 insertions, 35 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index efeea85c2..5e28db343 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -114,7 +114,7 @@ development tools appropriate for your operating system, including:
- Meson
- Ninja
- Gettext (19.7 or newer)
- - a [C99 compatible compiler](https://wiki.gnome.org/Projects/GLib/CompilerRequirements)
+ - a [C99 compatible compiler](./docs/toolchain-requirements.md)
Up-to-date instructions about developing GNOME applications and libraries
can be found on [the GNOME Developer Center](https://developer.gnome.org).
@@ -187,7 +187,7 @@ With each code review, we intend to:
adequately tested, either through requiring tests to be submitted at the
same time, or as a follow-up.
0. Ensure that all new APIs are documented and have [introspection
- annotations](https://wiki.gnome.org/Projects/GObjectIntrospection/Annotations).
+ annotations](https://gi.readthedocs.io/en/latest/annotations/giannotations.html).
0. Check that the contribution is split into logically separate commits, each
with a good commit message.
0. Encourage further high quality contributions.
@@ -272,4 +272,4 @@ GLib to follow a few rules:
If you have been contributing to GLib for a while and you don’t have commit
access to the repository, you may ask to obtain it following the [GNOME account
-process](https://wiki.gnome.org/AccountsTeam/NewAccounts).
+process](https://wiki.gnome.org/Infrastructure/NewAccounts).
diff --git a/docs/CODEOWNERS b/docs/CODEOWNERS
index 41e657dfb..cd4ef7391 100644
--- a/docs/CODEOWNERS
+++ b/docs/CODEOWNERS
@@ -38,13 +38,13 @@ subprojects/ @xclaesse @nirbheek @pwithnall
*.m @jralls @pwithnall @sdroege
# Windows support
-*win32* @lrn @creiter @fanc999 @pwithnall @sdroege @nirbheek
+*win32* @lrn @creiter @fanc999 @pwithnall @sdroege @nirbheek @lb90
# Windows support (MSVC-specific)
-*msvc* @fanc999 @creiter @pwithnall @sdroege @nirbheek
+*msvc* @fanc999 @creiter @pwithnall @sdroege @nirbheek @lb90
# Windows support (UWP-specific)
-*uwp* @nirbheek
+*uwp* @nirbheek @lb90
# Android support
*android* @xclaesse @pwithnall @sdroege
diff --git a/docs/reference/gio/gdbus-codegen.xml b/docs/reference/gio/gdbus-codegen.xml
index 5860fed97..7feed9124 100644
--- a/docs/reference/gio/gdbus-codegen.xml
+++ b/docs/reference/gio/gdbus-codegen.xml
@@ -1156,7 +1156,7 @@ on_handle_hello_world (MyAppFrobber *interface,
<para>
The generated C code currently happens to be annotated with <ulink
url="http://www.gtk.org/gtk-doc/">gtk-doc</ulink> / <ulink
- url="https://wiki.gnome.org/Projects/GObjectIntrospection">GObject
+ url="https://gi.readthedocs.io/en/latest/">GObject
Introspection</ulink> comments / annotations. The layout and
contents might change in the future so no guarantees about
e.g. <literal>SECTION</literal> usage etc. is given.
diff --git a/docs/reference/glib/building.xml b/docs/reference/glib/building.xml
index dd1a4495b..e30cd66c4 100644
--- a/docs/reference/glib/building.xml
+++ b/docs/reference/glib/building.xml
@@ -60,7 +60,7 @@
Before you can compile the GLib library, you need to have
various other tools and libraries installed on your system.
If you are building from a release archive, you will need
- <ulink url="https://wiki.gnome.org/Projects/GLib/CompilerRequirements">a compliant C toolchain</ulink>,
+ <ulink url="https://gitlab.gnome.org/GNOME/glib/-/blob/main/docs/toolchain-requirements.md">a compliant C toolchain</ulink>,
<application>Meson</application>, and <application>pkg-config</application>;
the requirements are the same when building from a Git repository clone
of GLib.
diff --git a/docs/reference/glib/programming.xml b/docs/reference/glib/programming.xml
index 2c38fee5d..9efa19d33 100644
--- a/docs/reference/glib/programming.xml
+++ b/docs/reference/glib/programming.xml
@@ -31,6 +31,36 @@ to test all the allocation failure code paths.
</refsect2>
<refsect2>
+<title>UTF-8 and String Encoding</title>
+
+<para>
+All GLib, GObject and GIO functions accept and return strings in
+<ulink url="https://en.wikipedia.org/wiki/UTF-8">UTF-8 encoding</ulink>
+unless otherwise specified.
+</para>
+
+<para>
+Input strings to function calls are <emphasis>not</emphasis> checked to see if
+they are valid UTF-8: it is the application developer’s responsibility to
+validate input strings at the time of input, either at the program or library
+boundary, and to only use valid UTF-8 string constants in their application.
+If GLib were to UTF-8 validate all string inputs to all functions, there would
+be a significant drop in performance.
+</para>
+
+<para>Similarly, output strings from functions are guaranteed to be in UTF-8,
+and this does not need to be validated by the calling function. If a function
+returns invalid UTF-8 (and is not documented as doing so), that’s a bug.
+</para>
+
+<para>
+See <link linkend='g-utf8-validate'><function>g_utf8_validate()</function></link>
+and <link linkend='g-utf8-make-valid'><function>g_utf8_make_valid()</function></link>
+for validating UTF-8 input.
+</para>
+</refsect2>
+
+<refsect2>
<title>Threads</title>
<para>
diff --git a/docs/supported-platforms.md b/docs/supported-platforms.md
index fbda4266c..43b652d8f 100644
--- a/docs/supported-platforms.md
+++ b/docs/supported-platforms.md
@@ -32,14 +32,14 @@ GLib is regularly built on at least the following systems:
* FreeBSD: https://wiki.gnome.org/Projects/Jhbuild/FreeBSD
* openSUSE: https://build.opensuse.org/package/show/GNOME:Factory/glib2
* CI runners, https://gitlab.gnome.org/GNOME/glib/blob/main/.gitlab-ci.yml:
- * Fedora (34, https://gitlab.gnome.org/GNOME/glib/-/blob/main/.gitlab-ci/fedora.Dockerfile)
- * Debian (Bullseye, https://gitlab.gnome.org/GNOME/glib/-/blob/main/.gitlab-ci/debian-stable.Dockerfile)
- * Windows (MinGW64)
- * Windows (msys2-mingw32)
- * Windows (Visual Studio 2017, and a static linking version)
- * Android (NDK r23b, API 31, arm64, https://gitlab.gnome.org/GNOME/glib/-/blob/main/.gitlab-ci/android-ndk.sh)
- * FreeBSD (12 and 13)
- * macOS
+ - Fedora (34, https://gitlab.gnome.org/GNOME/glib/-/blob/main/.gitlab-ci/fedora.Dockerfile)
+ - Debian (Bullseye, https://gitlab.gnome.org/GNOME/glib/-/blob/main/.gitlab-ci/debian-stable.Dockerfile)
+ - Windows (MinGW64)
+ - Windows (msys2-mingw32)
+ - Windows (Visual Studio 2017, and a static linking version)
+ - Android (NDK r23b, API 31, arm64, https://gitlab.gnome.org/GNOME/glib/-/blob/main/.gitlab-ci/android-ndk.sh)
+ - FreeBSD (12 and 13)
+ - macOS
If other platforms are to be supported, we need to set up regular CI testing for
them. Please contact us if you want to help.
diff --git a/gio/gwin32networkmonitor.c b/gio/gwin32networkmonitor.c
index 9dd5da757..e219225f0 100644
--- a/gio/gwin32networkmonitor.c
+++ b/gio/gwin32networkmonitor.c
@@ -78,24 +78,24 @@ g_win32_network_monitor_init (GWin32NetworkMonitor *win)
}
static gboolean
-win_network_monitor_get_ip_info (IP_ADDRESS_PREFIX prefix,
- GSocketFamily *family,
- const guint8 **dest,
- gsize *len)
+win_network_monitor_get_ip_info (const IP_ADDRESS_PREFIX *prefix,
+ GSocketFamily *family,
+ const guint8 **dest,
+ gsize *len)
{
- switch (prefix.Prefix.si_family)
+ switch (prefix->Prefix.si_family)
{
case AF_UNSPEC:
/* Fall-through: AF_UNSPEC deliveres both IPV4 and IPV6 infos, let`s stick with IPV4 here */
case AF_INET:
*family = G_SOCKET_FAMILY_IPV4;
- *dest = (guint8 *) &prefix.Prefix.Ipv4.sin_addr;
- *len = prefix.PrefixLength;
+ *dest = (guint8 *) &(prefix->Prefix.Ipv4.sin_addr);
+ *len = prefix->PrefixLength;
break;
case AF_INET6:
*family = G_SOCKET_FAMILY_IPV6;
- *dest = (guint8 *) &prefix.Prefix.Ipv6.sin6_addr;
- *len = prefix.PrefixLength;
+ *dest = (guint8 *) &(prefix->Prefix.Ipv6.sin6_addr);
+ *len = prefix->PrefixLength;
break;
default:
return FALSE;
@@ -152,7 +152,7 @@ win_network_monitor_process_table (GWin32NetworkMonitor *win,
route = routes->Table + i;
- if (!win_network_monitor_get_ip_info (route->DestinationPrefix, &family, &dest, &len))
+ if (!win_network_monitor_get_ip_info (&route->DestinationPrefix, &family, &dest, &len))
continue;
network = get_network_mask (family, dest, len);
@@ -218,13 +218,13 @@ win_network_monitor_invoke_route_changed (gpointer user_data)
switch (route_data->type)
{
case MibDeleteInstance:
- if (!win_network_monitor_get_ip_info (route_data->route->DestinationPrefix, &family, &dest, &len))
+ if (!win_network_monitor_get_ip_info (&route_data->route->DestinationPrefix, &family, &dest, &len))
break;
remove_network (route_data->win, family, dest, len);
break;
case MibAddInstance:
- if (!win_network_monitor_get_ip_info (route_data->route->DestinationPrefix, &family, &dest, &len))
+ if (!win_network_monitor_get_ip_info (&route_data->route->DestinationPrefix, &family, &dest, &len))
break;
add_network (route_data->win, family, dest, len);
diff --git a/gio/tests/meson.build b/gio/tests/meson.build
index 8da884001..2ff34a5d0 100644
--- a/gio/tests/meson.build
+++ b/gio/tests/meson.build
@@ -590,8 +590,8 @@ test_extra_programs += {
'proxy' : {'install' : false},
'resolver' : {'install' : false},
'send-data' : {'install' : false},
- 'socket-server' : {'install' : false},
- 'socket-client' : {
+ 'socket-testserver' : {'install' : false},
+ 'socket-testclient' : {
'extra_sources' : ['gtlsconsoleinteraction.c'],
'install' : false,
},
diff --git a/gio/tests/socket-common.c b/gio/tests/socket-common.c
index 18d083a30..b740f68e7 100644
--- a/gio/tests/socket-common.c
+++ b/gio/tests/socket-common.c
@@ -1,4 +1,4 @@
-/* #included into both socket-client.c and socket-server.c */
+/* #included into both socket-testclient.c and socket-testserver.c */
#ifdef G_OS_UNIX
static const char *unix_socket_address_types[] = {
diff --git a/gio/tests/socket-client.c b/gio/tests/socket-testclient.c
index 025632767..025632767 100644
--- a/gio/tests/socket-client.c
+++ b/gio/tests/socket-testclient.c
diff --git a/gio/tests/socket-server.c b/gio/tests/socket-testserver.c
index 61715b02d..61715b02d 100644
--- a/gio/tests/socket-server.c
+++ b/gio/tests/socket-testserver.c
diff --git a/glib/tests/assert-msg-test.c b/glib/tests/assert-msg-test.c
index 75591c853..b46496635 100644
--- a/glib/tests/assert-msg-test.c
+++ b/glib/tests/assert-msg-test.c
@@ -1,7 +1,39 @@
+/* GLib testing framework examples and tests
+ *
+ * Copyright © 2009 Canonical Limited
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+#ifdef HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
#include <glib.h>
-int main(int argc, char **argv)
+int
+main (int argc,
+ char **argv)
{
- g_assert(42 < 0);
- return 0;
+#ifdef HAVE_SYS_RESOURCE_H
+ /* We expect this test to abort, so try to avoid that creating a coredump */
+ struct rlimit limit = { 0, 0 };
+ (void) setrlimit (RLIMIT_CORE, &limit);
+#endif
+
+ g_assert (42 < 0);
+ return 0;
}
diff --git a/glib/tests/messages-low-memory.c b/glib/tests/messages-low-memory.c
index af35c4e26..ecb507024 100644
--- a/glib/tests/messages-low-memory.c
+++ b/glib/tests/messages-low-memory.c
@@ -23,6 +23,9 @@
#include "config.h"
#include <dlfcn.h>
+#ifdef HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
#include <glib.h>
static gboolean malloc_eom = FALSE;
@@ -56,6 +59,12 @@ int
main (int argc,
char *argv[])
{
+#ifdef HAVE_SYS_RESOURCE_H
+ /* We expect this test to abort, so try to avoid that creating a coredump */
+ struct rlimit limit = { 0, 0 };
+ (void) setrlimit (RLIMIT_CORE, &limit);
+#endif
+
g_setenv ("LC_ALL", "C", TRUE);
#ifndef ENOMEM
diff --git a/meson.build b/meson.build
index 3cb72aae4..f275a3475 100644
--- a/meson.build
+++ b/meson.build
@@ -509,7 +509,7 @@ if cc.get_id() == 'gcc' or cc.get_id() == 'clang'
# building with -Wbad-function-cast.
'-Wno-cast-function-type',
# Due to function casts through (void*) we cannot support -Wpedantic:
- # https://wiki.gnome.org/Projects/GLib/CompilerRequirements#Function_pointer_conversions.
+ # ./docs/toolchain-requirements.md#Function_pointer_conversions.
'-Wno-pedantic',
# A zero-length format string shouldn't be considered an issue.
'-Wno-format-zero-length',