Skip to content

Commit

Permalink
indent fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
deepakchethan committed Sep 24, 2019
1 parent 318d8e5 commit 1c761b7
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 17 deletions.
1 change: 0 additions & 1 deletion libr/core/canal.c
Original file line number Diff line number Diff line change
Expand Up @@ -3216,7 +3216,6 @@ R_API int r_core_anal_fcn_list(RCore *core, const char *input, const char *rad)
r_list_append (flist, info);
}
RTable *table = r_core_table (core);
table->showHeader = false;
r_table_visual_list (table, flist, core->offset, core->blocksize,
r_cons_get_size (NULL), r_config_get_i (core->config, "scr.color"));
r_cons_printf ("\n%s\n", r_table_tostring (table));
Expand Down
3 changes: 1 addition & 2 deletions libr/core/cbin.c
Original file line number Diff line number Diff line change
Expand Up @@ -2474,8 +2474,7 @@ static int bin_sections(RCore *r, int mode, ut64 laddr, int va, ut64 at, const c
r_list_append (list, info);
}
RTable *table = r_core_table (r);
table->showHeader = false;
r_table_visual_list (table, list, r->offset, -1, cols, r->print->flags & R_PRINT_FLAGS_COLOR);
r_table_visual_list (table, list, r->offset, -1, cols, r->io->va);
r_cons_printf ("\n%s\n", r_table_tostring (table));
r_table_free (table);
r_list_free (list);
Expand Down
1 change: 0 additions & 1 deletion libr/core/cmd_anal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1964,7 +1964,6 @@ static bool anal_fcn_list_bb(RCore *core, const char *input, bool one) {
r_list_append (flist, info);
}
RTable *table = r_core_table (core);
table->showHeader = false;
r_table_visual_list (table, flist, core->offset, core->blocksize,
r_cons_get_size (NULL), r_config_get_i (core->config, "scr.color"));
r_cons_printf ("\n%s\n", r_table_tostring (table));
Expand Down
2 changes: 0 additions & 2 deletions libr/core/cmd_open.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,6 @@ static void cmd_open_bin(RCore *core, const char *input) {
r_list_append (list, info);
}
RTable *table = r_core_table (core);
table->showHeader = false;
r_table_visual_list (table, list, core->offset, core->blocksize,
r_cons_get_size (NULL), r_config_get_i (core->config, "scr.color"));
r_cons_printf ("\n%s\n", r_table_tostring (table));
Expand Down Expand Up @@ -838,7 +837,6 @@ static void cmd_open_map(RCore *core, const char *input) {
r_list_append (list, info);
}
RTable *table = r_core_table (core);
table->showHeader = false;
r_table_visual_list (table, list, core->offset, core->blocksize,
r_cons_get_size (NULL), r_config_get_i (core->config, "scr.color"));
r_cons_printf ("\n%s\n", r_table_tostring (table));
Expand Down
22 changes: 11 additions & 11 deletions libr/util/table.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,19 +244,19 @@ static void __computeTotal(RTable *t) {
RTableRow *row;
RListIter *iter, *iter2;
r_list_foreach (t->rows, iter, row) {
char *item;
int c = 0;
r_list_foreach (row->items, iter2, item) {
RTableColumn *col = r_list_get_n (t->cols, c);
if (!r_str_cmp (col->type->name, "number", r_str_ansi_len ("number")) && r_str_isnumber (item)) {
if (col->total < 0) {
col->total = 0;
}
col->total += sdb_atoi(item);
}
c++;
char *item;
int c = 0;
r_list_foreach (row->items, iter2, item) {
RTableColumn *col = r_list_get_n (t->cols, c);
if (!r_str_cmp (col->type->name, "number", r_str_ansi_len ("number")) && r_str_isnumber (item)) {
if (col->total < 0) {
col->total = 0;
}
col->total += sdb_atoi(item);
}
c++;
}
}
}

R_API char *r_table_tofancystring(RTable *t) {
Expand Down

0 comments on commit 1c761b7

Please sign in to comment.