tests: Initialise an array’s elements to NULL

This is not strictly necessary, but helps scan-build understand that the
`g_thread_join()` calls are not going to use uninitialised `GThread`
pointers. It can’t reason that the number of loop iterations on the
`g_thread_create()` and `g_thread_join()` loops are identical.

Fixes:
```
../../../glib/tests/mutex.c:271:5: warning: 1st function call argument is an uninitialized value [core.CallAndMessage]
  271 |     g_thread_join (threads[i]);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
```

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
Philip Withnall 2024-12-31 12:53:12 +00:00
parent 472aef8278
commit 61ce6d5511
No known key found for this signature in database
GPG Key ID: C5C42CFB268637CA

View File

@ -246,7 +246,7 @@ static void
test_mutex_perf (gconstpointer data)
{
const guint n_threads = GPOINTER_TO_UINT (data);
GThread *threads[THREADS];
GThread *threads[THREADS] = { NULL, };
gint64 start_time;
gdouble rate;
gint x = -1;