libsysprof-capture: Use stdbool instead of gboolean

Another step towards dropping GLib as a dependency of
libsysprof-capture.

Unlike the previous commit which replaced GLib integer types with the
bitwise equivalent C standard types, `stdbool` is potentially a different
width from `gboolean`, so this is an ABI break.

It therefore involves some changes to callback functions in the tests
and tools, and in libsysprof.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #40
This commit is contained in:
Philip Withnall
2020-07-01 15:35:51 +01:00
parent 2c2cbf6343
commit 5636bbf4f0
20 changed files with 235 additions and 220 deletions

View File

@ -123,10 +123,10 @@ sysprof_control_source_init (SysprofControlSource *self)
g_array_set_clear_func (self->source_ids, remove_source_id);
}
static gboolean
event_frame_cb (gconstpointer data,
gsize *length,
gpointer user_data)
static bool
event_frame_cb (const void *data,
size_t *length,
void *user_data)
{
const SysprofCaptureFrame *fr = data;
RingData *rd = user_data;

View File

@ -983,9 +983,9 @@ profiler_iface_init (SysprofProfilerInterface *iface)
iface->stopped = sysprof_local_profiler_real_stopped;
}
static gboolean
static bool
find_profiler_meta_cb (const SysprofCaptureFrame *frame,
gpointer user_data)
void *user_data)
{
const SysprofCaptureMetadata *meta = (const SysprofCaptureMetadata *)frame;
GKeyFile **keyfile = user_data;
@ -1006,7 +1006,7 @@ find_profiler_meta_cb (const SysprofCaptureFrame *frame,
return *keyfile == NULL;
}
return TRUE;
return true;
}
SysprofProfiler *

View File

@ -251,9 +251,9 @@ create_cursor (SysprofCaptureReader *reader)
return cursor;
}
static gboolean
static bool
all_allocs_foreach_cb (const SysprofCaptureFrame *frame,
gpointer user_data)
void *user_data)
{
Generate *g = user_data;
@ -273,12 +273,12 @@ all_allocs_foreach_cb (const SysprofCaptureFrame *frame,
(gchar *)g_string_chunk_insert_const (g->symbols, cmdline));
}
return TRUE;
return true;
}
/* Short-circuit if we don't care about this frame */
if (!sysprof_selection_contains (g->selection, frame->time))
return TRUE;
return true;
if (frame->type == SYSPROF_CAPTURE_FRAME_ALLOCATION)
{
@ -361,7 +361,7 @@ all_allocs_foreach_cb (const SysprofCaptureFrame *frame,
}
}
return TRUE;
return true;
}
static gint