[sysprof/wip/chergert/sysprof-3] libsysprof: style cleanup



commit 3eee149363b2c498727cf854daade1cb21990f37
Author: Christian Hergert <chergert redhat com>
Date:   Fri May 10 14:51:41 2019 -0700

    libsysprof: style cleanup

 src/libsysprof/sysprof-perf-counter.c |  3 +--
 src/libsysprof/sysprof-perf-source.c  | 13 +++++--------
 2 files changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/src/libsysprof/sysprof-perf-counter.c b/src/libsysprof/sysprof-perf-counter.c
index cb28207..ef445d3 100644
--- a/src/libsysprof/sysprof-perf-counter.c
+++ b/src/libsysprof/sysprof-perf-counter.c
@@ -293,12 +293,11 @@ static gboolean
 sysprof_perf_counter_dispatch (gpointer user_data)
 {
   SysprofPerfCounter *self = user_data;
-  guint i;
 
   g_assert (self != NULL);
   g_assert (self->info != NULL);
 
-  for (i = 0; i < self->info->len; i++)
+  for (guint i = 0; i < self->info->len; i++)
     {
       SysprofPerfCounterInfo *info = g_ptr_array_index (self->info, i);
 
diff --git a/src/libsysprof/sysprof-perf-source.c b/src/libsysprof/sysprof-perf-source.c
index 966d23d..d478d8e 100644
--- a/src/libsysprof/sysprof-perf-source.c
+++ b/src/libsysprof/sysprof-perf-source.c
@@ -592,8 +592,7 @@ sysprof_perf_source_start_pid (SysprofPerfSource  *self,
   gulong flags = 0;
   gint ncpu = g_get_num_processors ();
   gint cpu = 0;
-  gint fd;
-  gint i;
+  gint fd = -1;
 
   g_assert (SYSPROF_IS_PERF_SOURCE (self));
 
@@ -661,12 +660,10 @@ sysprof_perf_source_start_pid (SysprofPerfSource  *self,
             }
         }
 
-      for (i = 0; i < G_N_ELEMENTS(optional_tracepoints); i++)
-        {
-          sysprof_perf_source_add_optional_tracepoint (self, pid, cpu,
-                                                  &optional_tracepoints[i],
-                                                  error);
-        }
+      for (guint i = 0; i < G_N_ELEMENTS(optional_tracepoints); i++)
+        sysprof_perf_source_add_optional_tracepoint (self, pid, cpu,
+                                                     &optional_tracepoints[i],
+                                                     error);
     }
 
   return TRUE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]