Commit Graph

28107 Commits

Author SHA1 Message Date
Matthias Clasen
8009afe73d docs: Move the GParamSpec SECTION
Move the content to the struct docs. Also drop the paramspecs SECTION,
as it was largely duplicated information.

Helps: #3037
2023-10-16 23:34:48 +01:00
Matthias Clasen
6e1d5302ed docs: Move the GSignalGroup SECTION
Move the contents to the struct docs.

Helps: #3037
2023-10-16 23:34:44 +01:00
Matthias Clasen
36d65922e2 docs: Move the GValueArray SECTION
Move the contents to the struct docs.

Helps: #3037
2023-10-16 23:34:39 +01:00
Matthias Clasen
95717eacea docs: Move the signal SECTION
Move the content to the new signals.md file.

Helps: #3037
2023-10-16 23:34:35 +01:00
Matthias Clasen
f3eac349f9 docs: Move the GType SECTION
Move the contents to the new types.md files.

Helps: #3037
2023-10-16 23:34:29 +01:00
Matthias Clasen
f471ebd300 docs: Move the GObject SECTION
Move the contents into the struct docs.

Helps: #3037
2023-10-16 23:34:24 +01:00
Matthias Clasen
89fe3bc4e4 docs: Move the GBindingGroup SECTION
Move the content to the struct docs.

Helps: #3037
2023-10-16 23:34:20 +01:00
Matthias Clasen
e7720a2c1a docs: Move the GBinding SECTION
Move the content into the struct docs.

Helps: #3037
2023-10-16 23:34:04 +01:00
Philip Withnall
fa165204ae Merge branch 'fix-warnings-clang-windows' into 'main'
Fix warnings with Clang on Windows and enable --Werror in CI

See merge request GNOME/glib!3635
2023-10-16 21:29:09 +00:00
Khalid Abu Shawarib
c70b8a7500 gio-tool: add a "default-modified-time" option
As with `default-permissions` option, this overrides the `perserve`
option.
2023-10-16 18:12:49 +03:00
Khalid Abu Shawarib
db01c11540 gio: add tests for default modification time flag
Add test cases for the G_FILE_COPY_TARGET_DEFAULT_MODIFIED_TIME
file copy flag.
2023-10-16 18:12:49 +03:00
Khalid Abu Shawarib
8d91430279 gio: add a file copy flag for default modification time
Add a default modification timestamp flag to g_file_copy so that it
doesn't copy the modification time from the source file as it does by
default. Similarly to G_FILE_COPY_TARGET_DEFAULT_PERMS, this flag
overrides the G_FILE_COPY_ALL_METADATA flag.

Fixes: https://gitlab.gnome.org/GNOME/glib/-/issues/3140
2023-10-16 18:12:49 +03:00
Michael Catanzaro
6d460f6c7e Merge branch 'ebassi/mips-test-check' into 'main'
build: Simplify MIPS test check

See merge request GNOME/glib!3641
2023-10-16 14:32:29 +00:00
Luca Bacci
e56bb89b83 CI: Remove workaround for Python in MSYS2 jobs
It was added in 13fe2e0c, but it's now unnecessary since
the issue has been fixed.

See https://github.com/msys2/MINGW-packages/issues/17415
2023-10-16 15:02:18 +02:00
Luca Bacci
ee4aaed516 CI: Enable --Werror in MSYS2 CLANG64 job 2023-10-16 15:02:18 +02:00
Luca Bacci
4aa051cafb valgrind.h: Fix macro definition for Windows x64
The Windows x64 ABI follows the LLP64 model, so unsigned long int is 32 bits

Fixes the following warnings when compiling for Windows x64:

  ../glib/gobject/gatomicarray.c:85:3: warning: cast to smaller integer type 'unsigned long' from 'gpointer' (aka 'void *') [-Wvoid-pointer-to-int-cast]
    VALGRIND_MALLOCLIKE_BLOCK (mem, real_size - sizeof (GAtomicArrayMetadata),
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../glib/glib/valgrind.h:6479:5: note: expanded from macro 'VALGRIND_MALLOCLIKE_BLOCK'
      VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__MALLOCLIKE_BLOCK,       \
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../glib/glib/valgrind.h:203:15: note: expanded from macro 'VALGRIND_DO_CLIENT_REQUEST_STMT'
    do { (void) VALGRIND_DO_CLIENT_REQUEST_EXPR(0,                        \
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../glib/glib/valgrind.h:417:20: note: expanded from macro 'VALGRIND_DO_CLIENT_REQUEST_EXPR'
      _zzq_args[1] = (unsigned long int)(_zzq_arg1);                \
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

See https://bugs.kde.org/show_bug.cgi?id=427146
2023-10-16 15:02:03 +02:00
Emmanuele Bassi
ccc36a2fde build: Simplify MIPS test check
Make the condition more readable, and easy to extend if necessary.

Follow-up to: !3640
2023-10-16 13:11:27 +01:00
Philip Withnall
0a6e19feee Merge branch 'test5-no-mips' into 'main'
GIO/tests: skip test_resources_binary on MIPS platforms

See merge request GNOME/glib!3640
2023-10-16 12:05:06 +00:00
YunQiang Su
8105916998 GIO/tests: skip test_resources_binary on MIPS platform
There are some flavors of MIPS ABIs, such like r6 vs legacy,
nan2008 vs nan1985 etc.

The `cc -r` may not produce the correct elf binaries.
So let's skip this test for MIPS.
2023-10-16 07:20:21 -04:00
Philip Withnall
481839c190 Merge branch 'win32-unicode-api' into 'main'
Windows: Compile with the UNICODE / _UNICODE macros

See merge request GNOME/glib!3623
2023-10-16 08:58:41 +00:00
Philip Withnall
54c9d9c0f2 Merge branch 'docs-python-gdb-fixes' into 'main'
Cleanup and add content to glib debugging using gdb scripts

See merge request GNOME/glib!3638
2023-10-16 08:50:40 +00:00
Sid
027f4b4c73 Cleanup and add content to glib debugging using gdb scripts 2023-10-16 08:50:39 +00:00
Philip Withnall
b8e805b8c6 Merge branch 'update-bit-symbol' into 'main'
gutils: Use international symbol for bits

See merge request GNOME/glib!3552
2023-10-16 08:25:03 +00:00
getsnoopy
5422d2fdb8 gutils: Use international symbol for bits 2023-10-16 08:25:03 +00:00
Philip Withnall
0a0f1f662c Merge branch 'g-strv-builder-take' into 'main'
gstrvbuilder: Add g_strv_builder_take

See merge request GNOME/glib!3637
2023-10-16 08:21:34 +00:00
Guido Günther
bc4ba05d34 gstrvbuilder: Add g_strv_builder_take
g_strv_builder_take() allows to transfer ownership of the passed in
string.

This can be useful to avoid additional allocations when using functions
that transfer ownership to the caller like g_strdup_printf().

The testcase uses g_strv_builder_take and g_strv_builder_add to demo
that calls can be mixed.
2023-10-15 15:45:58 +02:00
Michael Catanzaro
046f70cc0d Merge branch 'wip/kabus/task-return' into 'main'
Use g_task_return in task threads

See merge request GNOME/glib!3633
2023-10-12 12:27:29 +00:00
Khalid Abu Shawarib
dc0af83486 Use g_task_return in task threads 2023-10-12 12:27:28 +00:00
Luca Bacci
dfeb671c36 tests/win32: Initialize DWORD with the right constant
We were initializing a DWORD (unsigned 32 bit) with a constant
of bigger rank (G_MAXSIZE) on 64 bit systems.

Fixes the following warnings on CLang when compiling for x64:

  ../glib/glib/tests/win32.c:47:14: warning: implicit conversion from 'unsigned long long' to 'DWORD' (aka 'unsigned long') changes value from 18446744073709551615 to 4294967295 [-Wconstant-conversion]
    DWORD bp = G_MAXSIZE;
          ~~   ^~~~~~~~~
  glib/glibconfig.h:88:19: note: expanded from macro 'G_MAXSIZE'
  #define G_MAXSIZE       G_MAXUINT64
                          ^~~~~~~~~~~
  ../glib/glib/gtypes.h:107:21: note: expanded from macro 'G_MAXUINT64'
  #define G_MAXUINT64     G_GUINT64_CONSTANT(0xffffffffffffffff)
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  glib/glibconfig.h:69:52: note: expanded from macro 'G_GUINT64_CONSTANT'
  #define G_GUINT64_CONSTANT(val) (G_GNUC_EXTENSION (val##ULL))
                                                     ^~~~~~~~
  <scratch space>:96:1: note: expanded from here
  0xffffffffffffffffULL
  ^~~~~~~~~~~~~~~~~~~~~
2023-10-12 11:45:33 +02:00
Luca Bacci
8264b13737 tests/cxx: Do not assume that NULL is a pointer type starting with C++11
Many toolchain did not change the definition of NULL to avoid introducing
breaking changes in existing codebases. For example, on Windows NULL is
0 (int) regardless of the C++ standard in use.

Fixes the following warnings on CLang when compiling for Windows:

  ../glib/glib/tests/cxx.cpp:539:34: warning: missing sentinel in function call [-Wsentinel]
    g_test_init (&argc, &argv, NULL);
                                   ^
                                   , nullptr
  ../glib/glib/gtestutils.h:298:9: note: function has been explicitly marked sentinel here
  void    g_test_init                     (int            *argc,
          ^

  ../glib/gio/tests/cxx.cpp:62:34: warning: missing sentinel in function call [-Wsentinel]
    g_test_init (&argc, &argv, NULL);
                                   ^
                                   , nullptr
  ../glib/glib/gtestutils.h:298:9: note: function has been explicitly marked sentinel here
  void    g_test_init                     (int            *argc,
          ^
2023-10-12 11:45:03 +02:00
Luca Bacci
107311afce glib/gtimezone.c: Declare Unix-only functions under G_OS_UNIX
Fixes the following warnings on CLang when compiling for Windows:

  ../glib/glib/gtimezone.c:95:22: warning: unused function 'gint64_from_be' [-Wunused-function]
  static inline gint64 gint64_from_be (const gint64_be be) {
                       ^
  ../glib/glib/gtimezone.c:99:22: warning: unused function 'gint32_from_be' [-Wunused-function]
  static inline gint32 gint32_from_be (const gint32_be be) {
                       ^
  ../glib/glib/gtimezone.c:103:23: warning: unused function 'guint32_from_be' [-Wunused-function]
  static inline guint32 guint32_from_be (const guint32_be be) {
                        ^
2023-10-12 11:44:59 +02:00
Luca Bacci
5400f4e128 glib/gmessages.c: Remove unused function
Fixes the follwing warning on CLang:

  ../glib/glib/gmessages.c:433:1: warning: unused function 'dowrite' [-Wunused-function]
  dowrite (int          fd,
  ^
2023-10-12 11:44:56 +02:00
Luca Bacci
f075db637a glib/giowin32.c: Add G_GNUC_FALLTHROUGH annotation
Fixes the following warning on CLang:

  ../glib/glib/giowin32.c:1665:7: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
        default:
        ^
  ../glib/glib/giowin32.c:1665:7: note: insert '__attribute__((fallthrough));' to silence this warning
        default:
        ^
        __attribute__((fallthrough));
  ../glib/glib/giowin32.c:1665:7: note: insert 'break;' to avoid fall-through
        default:
        ^
        break;
2023-10-12 11:44:48 +02:00
Luca Bacci
985cab7737 gio/gregistrysettingsbackend.c: Use unsigned data type for bitfields that are only one-bit wide
Fixes the following warnings on CLang:

  ../glib/gio/gregistrysettingsbackend.c:1503:32: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
            child_item->readable = TRUE;
                                 ^ ~~~~
  ../glib/gio/gregistrysettingsbackend.c:1567:28: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
        child_item->readable = TRUE;
                             ^ ~~~~
2023-10-12 11:44:37 +02:00
Luca Bacci
337912072a Windows: Compile with the UNICODE / _UNICODE macros
It's the recommended way to build C/C++ projects on Windows, see
https://learn.microsoft.com/en-us/windows/win32/intl/conventions-for-function-prototypes
2023-10-12 11:32:03 +02:00
Philip Withnall
20b0d292ca Merge branch 'migrate-to-gi-docgen2' into 'main'
Switch to using gi-docgen for docs (batch 2)

See merge request GNOME/glib!3634
2023-10-11 16:54:27 +00:00
Matthias Clasen
f679a784d2 docs: Drop the GQuark SECTION
Move the content to the struct docs.

Helps: #3037
2023-10-11 17:38:31 +01:00
Matthias Clasen
5a2a0aeaf9 docs: Move the GStringChunk SECTION
Move the contents to the struct docs.

Helps: #3037
2023-10-11 17:38:31 +01:00
Matthias Clasen
57219c14a0 docs: Move the GTimer SECTION
Move the contents to the struct docs.

Helps: #3037
2023-10-11 17:38:31 +01:00
Matthias Clasen
a47bdb2638 docs: Move GRegex SECTION
Move the contents to the struct docs.

Helps: #3037
2023-10-11 17:38:31 +01:00
Matthias Clasen
45f6f43fc6 docs: Mark all GWakeup docs as private
This is not public API.

Helps: #3037
2023-10-11 17:38:31 +01:00
Matthias Clasen
ccfedf08cb docs: Move the GPatternSpec SECTION
Move the contents to the struct docs.

Helps: #3037
2023-10-11 17:38:31 +01:00
Matthias Clasen
f2b1e4d936 docs: Move the GKeyFile SECTION
Move the contents to the struct docs.

Helps: #3037
2023-10-11 17:38:31 +01:00
Matthias Clasen
f27af99233 docs: Move the unicode SECTION
Move the content to the new unicode.md file.

Helps: #3037
2023-10-11 17:38:31 +01:00
Matthias Clasen
6052639a5c docs: Update Unicode version history
Unicode 14 and 15 were missing from this list.
2023-10-11 17:38:31 +01:00
Matthias Clasen
55a844a465 docs: Move the GDate SECTION
Move the contents to the struct docs.

Helps: #3037
2023-10-11 17:38:31 +01:00
Matthias Clasen
1dae4fc618 docs: Move the GPathBuf SECTION
Move the contents to the struct docs.

Helps: #3037
2023-10-11 17:38:31 +01:00
Matthias Clasen
be9a463a10 docs: Move the GStrvBuilder SECTION
Move the contents to the struct docs.

Helps: #3037
2023-10-11 17:38:31 +01:00
Matthias Clasen
c50f94e41e docs: Move the GScanner SECTION
Not much here to begin with.

Helps: #3037
2023-10-11 17:38:31 +01:00
Matthias Clasen
5a415ee93f docs: Move the GTimeZone SECTION
Move the contents to the struct docs.

Helps: #3037
2023-10-11 17:38:31 +01:00