gmain: Initialise a variable

This fixes a scan-build warning:
```
../../../../source/glib/glib/gmain.c:4193:18: warning: 2nd function call argument is an uninitialized value [core.CallAndMessage]
  while ((nfds = g_main_context_query (context, max_priority, &timeout, fds,
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

This is a valid situation which can occur if the preceding
`g_main_context_prepare()` call returns `FALSE` and doesn’t set
`max_priority`.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #1767
This commit is contained in:
Philip Withnall 2022-04-28 10:40:38 +01:00
parent 7a1a9259a1
commit 86b8891add

View File

@ -4147,7 +4147,7 @@ g_main_context_iterate (GMainContext *context,
gboolean dispatch,
GThread *self)
{
gint max_priority;
gint max_priority = 0;
gint timeout;
gboolean some_ready;
gint nfds, allocated_nfds;