[PATCH] regedit: Rename variable to fix compile warning
Christof Schmitt
cs at samba.org
Wed Feb 18 14:53:17 MST 2015
From 97fd05b8b8afca4d4c2e91e0385775e5a5ecc96f Mon Sep 17 00:00:00 2001
From: Christof Schmitt <cs at samba.org>
Date: Wed, 18 Feb 2015 14:42:11 -0700
Subject: [PATCH] regedit: Rename variable to fix compile warning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
With --picky-developer this warning is turned into an error:
cc1: warnings being treated as errors
../source3/utils/regedit_treeview.c: In function ‘tree_node_load_children’:
../source3/utils/regedit_treeview.c:256: error: declaration of ‘key_name’ shadows a global declaration
/usr/include/ncurses.h:1419: error: shadowed declaration is here
Fix this by renaming the local variable.
Signed-off-by: Christof Schmitt <cs at samba.org>
---
source3/utils/regedit_treeview.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/source3/utils/regedit_treeview.c b/source3/utils/regedit_treeview.c
index ece15e5..f9e4d0a 100644
--- a/source3/utils/regedit_treeview.c
+++ b/source3/utils/regedit_treeview.c
@@ -253,7 +253,7 @@ void tree_node_insert_sorted(struct tree_node *list, struct tree_node *node)
WERROR tree_node_load_children(struct tree_node *node)
{
struct registry_key *key;
- const char *key_name, *klass;
+ const char *reg_key_name, *klass;
NTTIME modified;
uint32_t i, nsubkeys, count;
WERROR rv;
@@ -274,18 +274,18 @@ WERROR tree_node_load_children(struct tree_node *node)
for (count = 0, i = 0; i < nsubkeys; ++i) {
rv = reg_key_get_subkey_by_index(node, node->key, i,
- &key_name, &klass,
+ ®_key_name, &klass,
&modified);
if (!W_ERROR_IS_OK(rv)) {
goto finish;
}
- rv = reg_open_key(node, node->key, key_name, &key);
+ rv = reg_open_key(node, node->key, reg_key_name, &key);
if (!W_ERROR_IS_OK(rv)) {
continue;
}
- array[count] = tree_node_new(array, node, key_name, key);
+ array[count] = tree_node_new(array, node, reg_key_name, key);
if (array[count] == NULL) {
rv = WERR_NOMEM;
goto finish;
--
1.7.1
More information about the samba-technical
mailing list