Commit 1d49d9ca authored by Sebastian Ramacher's avatar Sebastian Ramacher

Fix variable shadowing

parent 7b92eb5e
......@@ -460,9 +460,9 @@ girara_callback_inputbar_activate(GtkEntry* entry, girara_session_t* session)
gchar *cmd = argv[0];
/* search commands */
GIRARA_LIST_FOREACH_BODY_WITH_ITER(session->bindings.commands, girara_command_t*, iter, command,
if ((g_strcmp0(cmd, command->command) == 0) ||
(g_strcmp0(cmd, command->abbr) == 0)) {
GIRARA_LIST_FOREACH_BODY_WITH_ITER(session->bindings.commands, girara_command_t*, iter, binding_command,
if ((g_strcmp0(cmd, binding_command->command) == 0) ||
(g_strcmp0(cmd, binding_command->abbr) == 0)) {
girara_list_t* argument_list = girara_list_new();
if (argument_list == NULL) {
g_free(input);
......@@ -478,7 +478,7 @@ girara_callback_inputbar_activate(GtkEntry* entry, girara_session_t* session)
girara_list_append(argument_list, (void*) argument);
}
command->function(session, argument_list);
binding_command->function(session, argument_list);
girara_list_free(argument_list);
g_free(input);
......
......@@ -452,7 +452,7 @@ girara_node_free(girara_tree_node_t* node)
}
g_return_if_fail(node->node);
girara_tree_node_data_t* nodedata = (girara_tree_node_data_t*) node->node->data;
girara_tree_node_data_t* nodedata = node->node->data;
g_return_if_fail(nodedata);
if (node->free != NULL) {
......@@ -463,8 +463,8 @@ girara_node_free(girara_tree_node_t* node)
GNode* childnode = node->node->children;
while (childnode != NULL) {
girara_tree_node_data_t* nodedata = (girara_tree_node_data_t*) childnode->data;
girara_node_free(nodedata->node);
girara_tree_node_data_t* childnodedata = childnode->data;
girara_node_free(childnodedata->node);
childnode = childnode->next;
}
......
......@@ -401,8 +401,8 @@ argument_to_argument_list(girara_argument_t* argument) {
girara_list_set_free_function(argument_list, g_free);
if (g_shell_parse_argv((const gchar*) argument->data, &argc, &argv, NULL) != FALSE) {
for (int i = 0; i < argc; i++) {
char* argument = g_strdup(argv[i]);
girara_list_append(argument_list, (void*) argument);
char* arg = g_strdup(argv[i]);
girara_list_append(argument_list, arg);
}
return argument_list;
......@@ -544,9 +544,9 @@ girara_sc_feedkeys(girara_session_t* session, girara_argument_t* argument,
keyval = tmp[2];
found = true;
} else {
for (unsigned int i = 0; i < LENGTH(gdk_keyboard_buttons); i++) {
if (g_strcmp0(tmp + 2, gdk_keyboard_buttons[i].identifier) == 0) {
keyval = gdk_keyboard_buttons[i].keyval;
for (unsigned int j = 0; j < LENGTH(gdk_keyboard_buttons); ++j) {
if (g_strcmp0(tmp + 2, gdk_keyboard_buttons[j].identifier) == 0) {
keyval = gdk_keyboard_buttons[j].keyval;
found = true;
break;
}
......@@ -554,9 +554,9 @@ girara_sc_feedkeys(girara_session_t* session, girara_argument_t* argument,
}
/* Possible special key */
} else {
for (unsigned int i = 0; i < LENGTH(gdk_keyboard_buttons); i++) {
if (g_strcmp0(tmp, gdk_keyboard_buttons[i].identifier) == 0) {
keyval = gdk_keyboard_buttons[i].keyval;
for (unsigned int j = 0; i < LENGTH(gdk_keyboard_buttons); ++j) {
if (g_strcmp0(tmp, gdk_keyboard_buttons[j].identifier) == 0) {
keyval = gdk_keyboard_buttons[j].keyval;
found = true;
break;
}
......
......@@ -325,7 +325,7 @@ START_TEST(test_datastructures_node) {
girara_list_iterator_t* iter2 = girara_list_iterator(grandchildren);
while (girara_list_iterator_is_valid(iter2))
{
char* expected = g_strdup_printf("child_%u_%u", i, j);
expected = g_strdup_printf("child_%u_%u", i, j);
girara_tree_node_t* gchild = (girara_tree_node_t*)girara_list_iterator_data(iter2);
fail_unless((g_strcmp0((char*)girara_node_get_data(gchild), expected) == 0), NULL);
fail_unless((girara_node_get_parent(gchild) == child), NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment