• Philip Withnall's avatar
    gtask: Ensure to return 1 or 0 from getters rather than truthy ints · ae381d79
    Philip Withnall authored
    Since commit 290bb0dd, where various members of GTask were converted to
    a bitfield, some of the getters:
     • g_task_get_check_cancellable()
     • g_task_get_return_on_cancel()
     • g_task_get_completed()
    have been returning truthy ints (zero or an arbitrary non-zero integer)
    as boolean values, rather than the canonical boolean ints of 1 and 0.
    This broke the `yield` statement in Vala, whose generated C code
    compares `g_task_get_completed (…) != TRUE`. i.e. Whether the
    `completed` field has a value not equal to 1.
    Fix this by explicitly converting truthy ints to canonical boolean ints
    in all getters.
    Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
gtask.c 62.4 KB