diff options
author | Stefan Metzmacher <metze@samba.org> | 2014-11-13 09:12:56 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2014-11-25 07:25:45 +0100 |
commit | 5d070d9f1844ebb120cf254c57f45c3aba9618ef (patch) | |
tree | d6ddc72fa291baa4bf37fc640ca4f37af0e26fef | |
parent | 002a1c57a962779372643abf0857e820541c1b0d (diff) | |
download | samba-5d070d9f1844ebb120cf254c57f45c3aba9618ef.tar.gz samba-5d070d9f1844ebb120cf254c57f45c3aba9618ef.tar.xz samba-5d070d9f1844ebb120cf254c57f45c3aba9618ef.zip |
s3:utils: rename variables in regedit_*.c to fix shadow warnings
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r-- | source3/utils/regedit_dialog.c | 14 | ||||
-rw-r--r-- | source3/utils/regedit_hexedit.c | 6 | ||||
-rw-r--r-- | source3/utils/regedit_treeview.c | 14 | ||||
-rw-r--r-- | source3/utils/regedit_valuelist.c | 4 |
4 files changed, 19 insertions, 19 deletions
diff --git a/source3/utils/regedit_dialog.c b/source3/utils/regedit_dialog.c index d0b486feef..07fb1909c0 100644 --- a/source3/utils/regedit_dialog.c +++ b/source3/utils/regedit_dialog.c @@ -969,7 +969,7 @@ WERROR dialog_section_text_field_set_lines(TALLOC_CTX *ctx, const char **array) { int rows, cols, max; - size_t padding, length, index; + size_t padding, length, idx; const char **arrayp; char *buf = NULL; struct dialog_section_text_field *text_field = @@ -979,7 +979,7 @@ WERROR dialog_section_text_field_set_lines(TALLOC_CTX *ctx, /* try to fit each string on it's own line. each line needs to be padded with whitespace manually, since ncurses fields do not have newlines. */ - for (index = 0, arrayp = array; *arrayp != NULL; ++arrayp) { + for (idx = 0, arrayp = array; *arrayp != NULL; ++arrayp) { length = MIN(strlen(*arrayp), cols); padding = cols - length; buf = talloc_realloc(ctx, buf, char, @@ -988,11 +988,11 @@ WERROR dialog_section_text_field_set_lines(TALLOC_CTX *ctx, if (buf == NULL) { return WERR_NOMEM; } - memcpy(&buf[index], *arrayp, length); - index += length; - memset(&buf[index], ' ', padding); - index += padding; - buf[index] = '\0'; + memcpy(&buf[idx], *arrayp, length); + idx += length; + memset(&buf[idx], ' ', padding); + idx += padding; + buf[idx] = '\0'; } set_field_buffer(text_field->field[0], 0, buf); diff --git a/source3/utils/regedit_hexedit.c b/source3/utils/regedit_hexedit.c index 377eef97ad..d70c521fa6 100644 --- a/source3/utils/regedit_hexedit.c +++ b/source3/utils/regedit_hexedit.c @@ -459,7 +459,7 @@ static void erase_at(struct hexedit *buf, size_t pos) static void do_backspace(struct hexedit *buf) { size_t off; - bool erase = true; + bool do_erase = true; if (buf->cursor_offset == 0) { return; @@ -479,11 +479,11 @@ static void do_backspace(struct hexedit *buf) calc_cursor_offset(buf); } else { if (buf->cursor_x < ASCII_COL && buf->nibble) { - erase = false; + do_erase = false; } cursor_left(buf); } - if (erase) { + if (do_erase) { erase_at(buf, off - 1); } } diff --git a/source3/utils/regedit_treeview.c b/source3/utils/regedit_treeview.c index 4c68feab8b..ece15e5239 100644 --- a/source3/utils/regedit_treeview.c +++ b/source3/utils/regedit_treeview.c @@ -481,11 +481,11 @@ void tree_view_driver(struct tree_view *view, int c) multilist_driver(view->list, c); } -void tree_view_set_selected(struct tree_view *view, bool select) +void tree_view_set_selected(struct tree_view *view, bool reverse) { attr_t attr = A_NORMAL; - if (select) { + if (reverse) { attr = A_REVERSE; } mvwchgat(view->window, 0, HEADING_X, 3, attr, 0, NULL); @@ -649,7 +649,7 @@ void tree_view_resize(struct tree_view *view, int nlines, int ncols, const char **tree_node_get_path(TALLOC_CTX *ctx, struct tree_node *node) { const char **array; - size_t nitems, index; + size_t nitems, idx; struct tree_node *p; for (nitems = 0, p = node; !tree_node_is_root(p); p = p->parent) { @@ -661,11 +661,11 @@ const char **tree_node_get_path(TALLOC_CTX *ctx, struct tree_node *node) return NULL; } - for (index = nitems - 1, p = node; + for (idx = nitems - 1, p = node; !tree_node_is_root(p); - p = p->parent, --index) { - array[index] = talloc_strdup(array, p->name); - if (array[index] == NULL) { + p = p->parent, --idx) { + array[idx] = talloc_strdup(array, p->name); + if (array[idx] == NULL) { talloc_free(discard_const(array)); return NULL; } diff --git a/source3/utils/regedit_valuelist.c b/source3/utils/regedit_valuelist.c index f12a81ebd2..76417ce589 100644 --- a/source3/utils/regedit_valuelist.c +++ b/source3/utils/regedit_valuelist.c @@ -169,11 +169,11 @@ fail: return NULL; } -void value_list_set_selected(struct value_list *vl, bool select) +void value_list_set_selected(struct value_list *vl, bool reverse) { attr_t attr = A_NORMAL; - if (select) { + if (reverse) { attr = A_REVERSE; } mvwchgat(vl->window, 0, HEADING_X, 5, attr, 0, NULL); |