build: fix build warnigns with Clang

This commit is contained in:
Christian Hergert
2020-08-14 12:57:50 -07:00
parent f16bbac342
commit 620f1f0ff0
15 changed files with 19 additions and 34 deletions

View File

@ -609,11 +609,11 @@ sysprof_local_profiler_authorize_cb (GObject *object,
if (priv->spawn_inherit_environ)
{
gchar **environ = g_get_environ ();
gchar **environ_ = g_get_environ ();
for (guint i = 0; environ[i]; i++)
g_ptr_array_add (env, environ[i]);
g_free (environ);
for (guint i = 0; environ_[i]; i++)
g_ptr_array_add (env, environ_[i]);
g_free (environ_);
}
if (priv->spawn_env)

View File

@ -432,7 +432,6 @@ sysprof_perf_counter_open (SysprofPerfCounter *self,
gulong flags)
{
SysprofHelpers *helpers = sysprof_helpers_get_default ();
g_autoptr(GError) error = NULL;
gint out_fd = -1;
g_return_val_if_fail (self != NULL, -1);

View File

@ -206,10 +206,8 @@ sysprof_perf_source_handle_tracepoint (SysprofPerfSource *
{
case DRM_VBLANK:
message = g_strdup_printf ("crtc=%d, seq=%u",
*(gint *)(sample->raw +
tp_desc->field_offsets[0]),
*(guint *)(sample->raw +
tp_desc->field_offsets[1]));
*(gint *)(gpointer)(sample->raw + tp_desc->field_offsets[0]),
*(guint *)(gpointer)(sample->raw + tp_desc->field_offsets[1]));
sysprof_capture_writer_add_mark (self->writer,
sample->time,
@ -224,12 +222,9 @@ sysprof_perf_source_handle_tracepoint (SysprofPerfSource *
case DRM_I915_BEGIN:
case DRM_I915_END:
message = g_strdup_printf ("ctx=%u, ring=%u, seqno=%u",
*(guint *)(sample->raw +
tp_desc->field_offsets[0]),
*(guint *)(sample->raw +
tp_desc->field_offsets[1]),
*(guint *)(sample->raw +
tp_desc->field_offsets[2]));
*(guint *)(gpointer)(sample->raw + tp_desc->field_offsets[0]),
*(guint *)(gpointer)(sample->raw + tp_desc->field_offsets[1]),
*(guint *)(gpointer)(sample->raw + tp_desc->field_offsets[2]));
sysprof_capture_writer_add_mark (self->writer,
sample->time,

View File

@ -82,7 +82,6 @@ sysprof_proc_source_populate_maps (SysprofProcSource *self,
const gchar *mountinfostr)
{
g_auto(GStrv) maps = NULL;
g_auto(GStrv) mountinfo = NULL;
guint i;
g_assert (SYSPROF_IS_PROC_SOURCE (self));

View File

@ -166,14 +166,14 @@ sysprof_spawnable_setenv (SysprofSpawnable *self,
void
sysprof_spawnable_set_environ (SysprofSpawnable *self,
const gchar * const *environ)
const gchar * const *environ_)
{
g_return_if_fail (SYSPROF_IS_SPAWNABLE (self));
if (environ != (const gchar * const *)self->environ)
if (environ_ != (const gchar * const *)self->environ)
{
g_strfreev (self->environ);
self->environ = g_strdupv ((gchar **)environ);
self->environ = g_strdupv ((gchar **)environ_);
}
}