diff options
author | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
commit | 62b8c978ee6b8d135d9e7953221de58000dba986 (patch) | |
tree | 683b04b2e627f6710c22c151b23c8cc9a165315e /tools/perf/ui/gtk/progress.c | |
parent | 78fd82238d0e5716578c326404184a27ba67fd6e (diff) | |
download | linux-fsl-qoriq-62b8c978ee6b8d135d9e7953221de58000dba986.tar.xz |
Rewind v3.13-rc3+ (78fd82238d0e5716) to v3.12
Diffstat (limited to 'tools/perf/ui/gtk/progress.c')
-rw-r--r-- | tools/perf/ui/gtk/progress.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tools/perf/ui/gtk/progress.c b/tools/perf/ui/gtk/progress.c index b656655..482bcf3 100644 --- a/tools/perf/ui/gtk/progress.c +++ b/tools/perf/ui/gtk/progress.c @@ -7,14 +7,14 @@ static GtkWidget *dialog; static GtkWidget *progress; -static void gtk_ui_progress__update(struct ui_progress *p) +static void gtk_progress_update(u64 curr, u64 total, const char *title) { - double fraction = p->total ? 1.0 * p->curr / p->total : 0.0; + double fraction = total ? 1.0 * curr / total : 0.0; char buf[1024]; if (dialog == NULL) { GtkWidget *vbox = gtk_vbox_new(TRUE, 5); - GtkWidget *label = gtk_label_new(p->title); + GtkWidget *label = gtk_label_new(title); dialog = gtk_window_new(GTK_WINDOW_TOPLEVEL); progress = gtk_progress_bar_new(); @@ -32,7 +32,7 @@ static void gtk_ui_progress__update(struct ui_progress *p) } gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progress), fraction); - snprintf(buf, sizeof(buf), "%"PRIu64" / %"PRIu64, p->curr, p->total); + snprintf(buf, sizeof(buf), "%"PRIu64" / %"PRIu64, curr, total); gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progress), buf); /* we didn't call gtk_main yet, so do it manually */ @@ -40,7 +40,7 @@ static void gtk_ui_progress__update(struct ui_progress *p) gtk_main_iteration(); } -static void gtk_ui_progress__finish(void) +static void gtk_progress_finish(void) { /* this will also destroy all of its children */ gtk_widget_destroy(dialog); @@ -48,12 +48,12 @@ static void gtk_ui_progress__finish(void) dialog = NULL; } -static struct ui_progress_ops gtk_ui_progress__ops = { - .update = gtk_ui_progress__update, - .finish = gtk_ui_progress__finish, +static struct ui_progress gtk_progress_fns = { + .update = gtk_progress_update, + .finish = gtk_progress_finish, }; -void gtk_ui_progress__init(void) +void perf_gtk__init_progress(void) { - ui_progress__ops = >k_ui_progress__ops; + progress_fns = >k_progress_fns; } |