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) ...@@ -460,9 +460,9 @@ girara_callback_inputbar_activate(GtkEntry* entry, girara_session_t* session)
gchar *cmd = argv[0]; gchar *cmd = argv[0];
/* search commands */ /* search commands */
GIRARA_LIST_FOREACH_BODY_WITH_ITER(session->bindings.commands, girara_command_t*, iter, command, GIRARA_LIST_FOREACH_BODY_WITH_ITER(session->bindings.commands, girara_command_t*, iter, binding_command,
if ((g_strcmp0(cmd, command->command) == 0) || if ((g_strcmp0(cmd, binding_command->command) == 0) ||
(g_strcmp0(cmd, command->abbr) == 0)) { (g_strcmp0(cmd, binding_command->abbr) == 0)) {
girara_list_t* argument_list = girara_list_new(); girara_list_t* argument_list = girara_list_new();
if (argument_list == NULL) { if (argument_list == NULL) {
g_free(input); g_free(input);
...@@ -478,7 +478,7 @@ girara_callback_inputbar_activate(GtkEntry* entry, girara_session_t* session) ...@@ -478,7 +478,7 @@ girara_callback_inputbar_activate(GtkEntry* entry, girara_session_t* session)
girara_list_append(argument_list, (void*) argument); girara_list_append(argument_list, (void*) argument);
} }
command->function(session, argument_list); binding_command->function(session, argument_list);
girara_list_free(argument_list); girara_list_free(argument_list);
g_free(input); g_free(input);
......
...@@ -452,7 +452,7 @@ girara_node_free(girara_tree_node_t* node) ...@@ -452,7 +452,7 @@ girara_node_free(girara_tree_node_t* node)
} }
g_return_if_fail(node->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); g_return_if_fail(nodedata);
if (node->free != NULL) { if (node->free != NULL) {
...@@ -463,8 +463,8 @@ girara_node_free(girara_tree_node_t* node) ...@@ -463,8 +463,8 @@ girara_node_free(girara_tree_node_t* node)
GNode* childnode = node->node->children; GNode* childnode = node->node->children;
while (childnode != NULL) { while (childnode != NULL) {
girara_tree_node_data_t* nodedata = (girara_tree_node_data_t*) childnode->data; girara_tree_node_data_t* childnodedata = childnode->data;
girara_node_free(nodedata->node); girara_node_free(childnodedata->node);
childnode = childnode->next; childnode = childnode->next;
} }
......
...@@ -401,8 +401,8 @@ argument_to_argument_list(girara_argument_t* argument) { ...@@ -401,8 +401,8 @@ argument_to_argument_list(girara_argument_t* argument) {
girara_list_set_free_function(argument_list, g_free); girara_list_set_free_function(argument_list, g_free);
if (g_shell_parse_argv((const gchar*) argument->data, &argc, &argv, NULL) != FALSE) { if (g_shell_parse_argv((const gchar*) argument->data, &argc, &argv, NULL) != FALSE) {
for (int i = 0; i < argc; i++) { for (int i = 0; i < argc; i++) {
char* argument = g_strdup(argv[i]); char* arg = g_strdup(argv[i]);
girara_list_append(argument_list, (void*) argument); girara_list_append(argument_list, arg);
} }
return argument_list; return argument_list;
...@@ -544,9 +544,9 @@ girara_sc_feedkeys(girara_session_t* session, girara_argument_t* argument, ...@@ -544,9 +544,9 @@ girara_sc_feedkeys(girara_session_t* session, girara_argument_t* argument,
keyval = tmp[2]; keyval = tmp[2];
found = true; found = true;
} else { } else {
for (unsigned int i = 0; i < LENGTH(gdk_keyboard_buttons); i++) { for (unsigned int j = 0; j < LENGTH(gdk_keyboard_buttons); ++j) {
if (g_strcmp0(tmp + 2, gdk_keyboard_buttons[i].identifier) == 0) { if (g_strcmp0(tmp + 2, gdk_keyboard_buttons[j].identifier) == 0) {
keyval = gdk_keyboard_buttons[i].keyval; keyval = gdk_keyboard_buttons[j].keyval;
found = true; found = true;
break; break;
} }
...@@ -554,9 +554,9 @@ girara_sc_feedkeys(girara_session_t* session, girara_argument_t* argument, ...@@ -554,9 +554,9 @@ girara_sc_feedkeys(girara_session_t* session, girara_argument_t* argument,
} }
/* Possible special key */ /* Possible special key */
} else { } else {
for (unsigned int i = 0; i < LENGTH(gdk_keyboard_buttons); i++) { for (unsigned int j = 0; i < LENGTH(gdk_keyboard_buttons); ++j) {
if (g_strcmp0(tmp, gdk_keyboard_buttons[i].identifier) == 0) { if (g_strcmp0(tmp, gdk_keyboard_buttons[j].identifier) == 0) {
keyval = gdk_keyboard_buttons[i].keyval; keyval = gdk_keyboard_buttons[j].keyval;
found = true; found = true;
break; break;
} }
......
...@@ -325,7 +325,7 @@ START_TEST(test_datastructures_node) { ...@@ -325,7 +325,7 @@ START_TEST(test_datastructures_node) {
girara_list_iterator_t* iter2 = girara_list_iterator(grandchildren); girara_list_iterator_t* iter2 = girara_list_iterator(grandchildren);
while (girara_list_iterator_is_valid(iter2)) 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); 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((g_strcmp0((char*)girara_node_get_data(gchild), expected) == 0), NULL);
fail_unless((girara_node_get_parent(gchild) == child), 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