Skip to content

Commit

Permalink
White space spring cleaning
Browse files Browse the repository at this point in the history
Lets squash them all, with a bit of tooling help.

Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
axboe committed Mar 27, 2012
1 parent 5570ec6 commit 3c3ed07
Show file tree
Hide file tree
Showing 22 changed files with 100 additions and 103 deletions.
8 changes: 4 additions & 4 deletions backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@ static int break_on_this_error(struct thread_data *td, enum fio_ddir ddir,
return 1;

if (td_non_fatal_error(err)) {
/*
* Continue with the I/Os in case of
/*
* Continue with the I/Os in case of
* a non fatal error.
*/
update_error_count(td, err);
Expand Down Expand Up @@ -1091,9 +1091,9 @@ static void *thread_main(void *data)
memcpy(&td->tv_cache, &td->start, sizeof(td->start));

if (td->o.ratemin[0] || td->o.ratemin[1]) {
memcpy(&td->lastrate[0], &td->bw_sample_time,
memcpy(&td->lastrate[0], &td->bw_sample_time,
sizeof(td->bw_sample_time));
memcpy(&td->lastrate[1], &td->bw_sample_time,
memcpy(&td->lastrate[1], &td->bw_sample_time,
sizeof(td->bw_sample_time));
}

Expand Down
4 changes: 2 additions & 2 deletions cairo_text_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ static void draw_aligned_text(cairo_t *cr, const char *font, double x, double y,
double factor, direction;
cairo_text_extents_t extents;

switch(alignment) {
switch (alignment) {
case CENTERED:
direction = -1.0;
factor = 0.5;
Expand Down Expand Up @@ -58,7 +58,7 @@ void draw_left_justified_text(cairo_t *cr, const char *font,
draw_aligned_text(cr, font, x, y, fontsize, text, LEFT_JUSTIFIED);
}

void draw_vertical_centered_text(cairo_t *cr, const char * font, double x,
void draw_vertical_centered_text(cairo_t *cr, const char *font, double x,
double y, double fontsize,
const char *text)
{
Expand Down
2 changes: 1 addition & 1 deletion cairo_text_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void draw_left_justified_text(cairo_t *cr, const char *font,
double x, double y,
double fontsize, const char *text);

void draw_vertical_centered_text(cairo_t *cr, const char * font, double x,
void draw_vertical_centered_text(cairo_t *cr, const char *font, double x,
double y, double fontsize,
const char *text);
#endif
8 changes: 4 additions & 4 deletions cconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ void convert_thread_options_to_cpu(struct thread_options *o,
for (i = 0; i < FIO_IO_U_LIST_MAX_LEN; i++)
o->percentile_list[i].u.f = fio_uint64_to_double(le64_to_cpu(top->percentile_list[i].u.i));
#if 0
uint8_t cpumask[FIO_TOP_STR_MAX];
uint8_t verify_cpumask[FIO_TOP_STR_MAX];
uint8_t cpumask[FIO_TOP_STR_MAX];
uint8_t verify_cpumask[FIO_TOP_STR_MAX];
#endif
}

Expand Down Expand Up @@ -370,8 +370,8 @@ void convert_thread_options_to_net(struct thread_options_pack *top,
for (i = 0; i < FIO_IO_U_LIST_MAX_LEN; i++)
top->percentile_list[i].u.i = __cpu_to_le64(fio_double_to_uint64(o->percentile_list[i].u.f));
#if 0
uint8_t cpumask[FIO_TOP_STR_MAX];
uint8_t verify_cpumask[FIO_TOP_STR_MAX];
uint8_t cpumask[FIO_TOP_STR_MAX];
uint8_t verify_cpumask[FIO_TOP_STR_MAX];
#endif

}
Expand Down
2 changes: 1 addition & 1 deletion client.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ int fio_clients_connect(void)

#ifdef WIN32
WSADATA wsd;
WSAStartup(MAKEWORD(2,2), &wsd);
WSAStartup(MAKEWORD(2, 2), &wsd);
#endif

dprint(FD_NET, "client: connect all\n");
Expand Down
4 changes: 2 additions & 2 deletions filesetup.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ static int extend_file(struct thread_data *td, struct fio_file *f)

r = fallocate(f->fd, FALLOC_FL_KEEP_SIZE, 0,
f->real_file_size);
if (r != 0) {
if (r != 0)
td_verror(td, errno, "fallocate");
}

break;
#endif /* FIO_HAVE_LINUX_FALLOCATE */
default:
Expand Down
8 changes: 4 additions & 4 deletions gclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ static void gfio_update_client_eta(struct fio_client *client, struct jobs_eta *j

sprintf(dst, " - %s", eta_str);
}

gfio_update_thread_status(ge, output, perc);
gdk_threads_leave();
}
Expand Down Expand Up @@ -514,7 +514,7 @@ static void gfio_update_all_eta(struct jobs_eta *je)

sprintf(dst, " - %s", eta_str);
}

gfio_update_thread_status_all(ui, output, perc);
gdk_threads_leave();
}
Expand Down Expand Up @@ -963,7 +963,7 @@ static void gfio_show_latency_buckets(struct gfio_client *gc, GtkWidget *vbox,
*/
if (start == -1U)
return;

tree_view = gfio_output_lat_buckets(&io_u_lat[start], &ranges[start], end - start + 1);
ge->lat_bucket_graph = setup_lat_bucket_graph("Latency Buckets", &io_u_lat[start], &ranges[start], end - start + 1, 700.0, 300.0);

Expand All @@ -980,7 +980,7 @@ static void gfio_show_latency_buckets(struct gfio_client *gc, GtkWidget *vbox,
gtk_widget_modify_bg(drawing_area, GTK_STATE_NORMAL, &gfio_color_white);
gtk_container_add(GTK_CONTAINER(completion_vbox), drawing_area);
g_signal_connect(G_OBJECT(drawing_area), GFIO_DRAW_EVENT, G_CALLBACK(on_expose_lat_drawing_area), ge->lat_bucket_graph);
g_signal_connect(G_OBJECT(drawing_area), "configure_event", G_CALLBACK(on_config_lat_drawing_area), ge->lat_bucket_graph);
g_signal_connect(G_OBJECT(drawing_area), "configure_event", G_CALLBACK(on_config_lat_drawing_area), ge->lat_bucket_graph);

gtk_box_pack_start(GTK_BOX(hbox), tree_view, TRUE, TRUE, 3);
}
Expand Down
2 changes: 1 addition & 1 deletion gcompat.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void gtk_combo_box_text_append_text(GtkComboBoxText *combo_box, const gchar *tex
void gtk_combo_box_text_insert_text(GtkComboBoxText *combo_box, gint position, const gchar *text);
void gtk_combo_box_text_prepend_text(GtkComboBoxText *combo_box, const gchar *text);
void gtk_combo_box_text_remove(GtkComboBoxText *combo_box, gint position);
gchar *gtk_combo_box_text_get_active_text (GtkComboBoxText *combo_box);
gchar *gtk_combo_box_text_get_active_text(GtkComboBoxText *combo_box);

#define GTK_COMBO_BOX_TEXT GTK_COMBO_BOX
#endif /* GTK_MAJOR_VERSION <= 2 && GTK_MINOR_VERSION < 24 */
Expand Down
11 changes: 5 additions & 6 deletions gerror.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "gerror.h"

static void on_info_bar_response(GtkWidget *widget, gint response,
gpointer data)
gpointer data)
{
struct gui *ui = (struct gui *) data;

Expand All @@ -25,16 +25,15 @@ static void report_error(struct gui_entry *ge, GError *error)

if (ui->error_info_bar == NULL) {
ui->error_info_bar = gtk_info_bar_new_with_buttons(GTK_STOCK_OK,
GTK_RESPONSE_OK,
NULL);
GTK_RESPONSE_OK, NULL);
g_signal_connect(ui->error_info_bar, "response", G_CALLBACK(on_info_bar_response), ui);
gtk_info_bar_set_message_type(GTK_INFO_BAR(ui->error_info_bar),
GTK_MESSAGE_ERROR);
GTK_MESSAGE_ERROR);

ui->error_label = gtk_label_new(error->message);
GtkWidget *container = gtk_info_bar_get_content_area(GTK_INFO_BAR(ui->error_info_bar));
gtk_container_add(GTK_CONTAINER(container), ui->error_label);

gtk_box_pack_start(GTK_BOX(ui->vbox), ui->error_info_bar, FALSE, FALSE, 0);
gtk_widget_show_all(ui->vbox);
} else {
Expand Down
18 changes: 9 additions & 9 deletions gfio.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* gfio - gui front end for fio - the flexible io tester
*
* Copyright (C) 2012 Stephen M. Cameron <[email protected]>
* Copyright (C) 2012 Stephen M. Cameron <[email protected]>
* Copyright (C) 2012 Jens Axboe <[email protected]>
*
* The license below covers all files distributed with fio unless otherwise
Expand Down Expand Up @@ -406,11 +406,11 @@ static void ge_widget_destroy(GtkWidget *w, gpointer data)

static void gfio_quit(struct gui *ui)
{
gtk_main_quit();
gtk_main_quit();
}

static void quit_clicked(__attribute__((unused)) GtkWidget *widget,
__attribute__((unused)) gpointer data)
gpointer data)
{
struct gui *ui = (struct gui *) data;

Expand Down Expand Up @@ -471,7 +471,7 @@ static void gfio_start_server(struct gui *ui)
}

static void start_job_clicked(__attribute__((unused)) GtkWidget *widget,
gpointer data)
gpointer data)
{
struct gui_entry *ge = data;
struct gfio_client *gc = ge->client;
Expand Down Expand Up @@ -876,7 +876,7 @@ static int do_file_open_with_tab(struct gui *ui, const gchar *uri)
if (get_connection_details(ge)) {
if (ge_is_new)
gtk_widget_destroy(ge->vbox);

return 1;
}

Expand Down Expand Up @@ -1016,7 +1016,7 @@ static void connect_job_entry(GtkWidget *w, gpointer data)
{
struct gui *ui = (struct gui *) data;
struct gui_entry *ge;

ge = get_ge_from_cur_tab(ui);
if (ge)
connect_clicked(w, ge);
Expand Down Expand Up @@ -1420,7 +1420,7 @@ static GtkWidget *new_client_page(struct gui_entry *ge)
setup_graphs(&ge->graphs);

/*
* Set up alignments for widgets at the bottom of ui,
* Set up alignments for widgets at the bottom of ui,
* align bottom left, expand horizontally but not vertically
*/
bottom_align = gtk_alignment_new(0, 1, 1, 0);
Expand Down Expand Up @@ -1507,7 +1507,7 @@ static GtkWidget *new_main_page(struct gui *ui)
setup_graphs(&ui->graphs);

/*
* Set up alignments for widgets at the bottom of ui,
* Set up alignments for widgets at the bottom of ui,
* align bottom left, expand horizontally but not vertically
*/
bottom_align = gtk_alignment_new(0, 1, 1, 0);
Expand Down Expand Up @@ -1670,7 +1670,7 @@ static void init_ui(int *argc, char **argv[], struct gui *ui)
gtk_settings_set_long_property(settings, "gtk_tooltip_timeout", 10, "gfio setting");
g_type_init();
gdk_color_parse("white", &gfio_color_white);

ui->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(ui->window), "fio");
gtk_window_set_default_size(GTK_WINDOW(ui->window), 1024, 768);
Expand Down
43 changes: 22 additions & 21 deletions graph.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* gfio - gui front end for fio - the flexible io tester
*
* Copyright (C) 2012 Stephen M. Cameron <[email protected]>
* Copyright (C) 2012 Stephen M. Cameron <[email protected]>
*
* The license below covers all files distributed with fio unless otherwise
* noted in the file itself.
Expand Down Expand Up @@ -87,10 +87,10 @@ struct graph {
graph_axis_unit_change_callback y_axis_unit_change_callback;
unsigned int base_offset;
unsigned int dont_graph_all_zeroes;
double left_extra;
double right_extra;
double top_extra;
double bottom_extra;
double left_extra;
double right_extra;
double top_extra;
double bottom_extra;

double xtick_zero;
double xtick_delta;
Expand Down Expand Up @@ -263,19 +263,19 @@ static void draw_bars(struct graph *bg, cairo_t *cr, struct graph_label *lb,
cairo_close_path(cr);
cairo_fill(cr);
cairo_stroke(cr);
bar_num++;
bar_num++;
}
}

static void graph_draw_common(struct graph *g, cairo_t *cr,
double *x1, double *y1, double *x2, double *y2)
{
cairo_set_source_rgb(cr, 0, 0, 0);
cairo_set_line_width (cr, 0.8);
cairo_set_line_width(cr, 0.8);

*x1 = 0.10 * g->xdim;
*x1 = 0.10 * g->xdim;
*x2 = 0.95 * g->xdim;
*y1 = 0.10 * g->ydim;
*y1 = 0.10 * g->ydim;
*y2 = 0.90 * g->ydim;

cairo_move_to(cr, *x1, *y1);
Expand Down Expand Up @@ -459,7 +459,7 @@ void bar_graph_draw(struct graph *bg, cairo_t *cr)
draw_bars(bg, cr, lb, label_offset, bar_width, mindata, maxdata);
// draw_centered_text(cr, label_offset + (bar_width / 2.0 + bar_width * 0.1), bg->ydim * 0.93,
draw_centered_text(cr, bg->font, x1 + space_per_label * (i + 0.5), bg->ydim * 0.93,
12.0, lb->label);
12.0, lb->label);
i++;
}
cairo_stroke(cr);
Expand Down Expand Up @@ -498,7 +498,7 @@ static double find_xy_value(struct graph *g, xy_value_extractor getvalue, double
first = 0;
answer = tmp;
}
answer = cmp(tmp, answer);
answer = cmp(tmp, answer);
}
}

Expand Down Expand Up @@ -618,7 +618,7 @@ static struct graph_label *graph_find_label(struct graph *bg,
{
struct flist_head *entry;
struct graph_label *i;

flist_for_each(entry, &bg->label_list) {
i = flist_entry(entry, struct graph_label, list);

Expand All @@ -632,7 +632,7 @@ static struct graph_label *graph_find_label(struct graph *bg,
graph_label_t graph_add_label(struct graph *bg, const char *label)
{
struct graph_label *i;

i = graph_find_label(bg, label);
if (i)
return i; /* already present. */
Expand Down Expand Up @@ -818,7 +818,7 @@ static void graph_free_values(struct graph_label *l)
while (!flist_empty(&l->value_list)) {
i = flist_entry(l->value_list.next, struct graph_value, list);
graph_value_drop(l, i);
}
}
}

static void graph_free_labels(struct graph *g)
Expand All @@ -830,7 +830,7 @@ static void graph_free_labels(struct graph *g)
flist_del(&i->list);
graph_free_values(i);
free(i);
}
}
}

void graph_set_color(struct graph *gr, graph_label_t label, double red,
Expand Down Expand Up @@ -878,13 +878,14 @@ void line_graph_set_data_count_limit(struct graph *g, int per_label_limit)
g->per_label_limit = per_label_limit;
}

void graph_add_extra_space(struct graph *g, double left_percent, double right_percent,
double top_percent, double bottom_percent)
void graph_add_extra_space(struct graph *g, double left_percent,
double right_percent, double top_percent,
double bottom_percent)
{
g->left_extra = left_percent;
g->right_extra = right_percent;
g->top_extra = top_percent;
g->bottom_extra = bottom_percent;
g->left_extra = left_percent;
g->right_extra = right_percent;
g->top_extra = top_percent;
g->bottom_extra = bottom_percent;
}

/*
Expand Down
6 changes: 3 additions & 3 deletions io_u.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ static void mark_random_map(struct thread_data *td, struct io_u *io_u)
mask = -1UL;
else
mask = ((1UL << this_blocks) - 1) << bit;

if (!(f->file_map[idx] & mask))
break;

Expand Down Expand Up @@ -310,7 +310,7 @@ static int get_next_block(struct thread_data *td, struct io_u *io_u,
ret = 1;
}
}

if (!ret) {
if (offset != -1ULL)
io_u->offset = offset;
Expand Down Expand Up @@ -1427,7 +1427,7 @@ static void io_completed(struct thread_data *td, struct io_u *io_u,
io_u_log_error(td, io_u);
}
if (icd->error && td_non_fatal_error(icd->error) &&
(td->o.continue_on_error & td_error_type(io_u->ddir, icd->error))) {
(td->o.continue_on_error & td_error_type(io_u->ddir, icd->error))) {
/*
* If there is a non_fatal error, then add to the error count
* and clear all the errors.
Expand Down
Loading

0 comments on commit 3c3ed07

Please sign in to comment.