Browse Source

Fix building with --enable-debug

Serj Kalichev 9 years ago
parent
commit
7db3d35a9d
4 changed files with 7 additions and 9 deletions
  1. 3 0
      bin/clish.c
  2. 1 2
      clish/shell/shell_startup.c
  3. 0 4
      clish/shell/shell_xml.c
  4. 3 3
      clish/view/view_dump.c

+ 3 - 0
bin/clish.c

@@ -303,6 +303,9 @@ int main(int argc, char **argv)
 		if ((sym = clish_shell_get_hook(shell, CLISH_SYM_TYPE_LOG)))
 			clish_sym__set_permanent(sym, BOOL_FALSE);
 	}
+#ifdef DEBUG
+	clish_shell_dump(shell);
+#endif
 
 	/* Set source of command stream: files or interactive tty */
 	if(optind < argc) {

+ 1 - 2
clish/shell/shell_startup.c

@@ -161,8 +161,7 @@ int clish_shell_prepare(clish_shell_t *this)
 
 	/* Add default plugin to the list of plugins */
 	if (this->default_plugin) {
-		clish_plugin_t *plugin;
-		plugin = clish_shell_find_create_plugin(this, "clish");
+		clish_shell_find_create_plugin(this, "clish");
 		/* Default hooks */
 		for (i = 0; i < CLISH_SYM_TYPE_MAX; i++) {
 			if (this->hooks_use[i])

+ 0 - 4
clish/shell/shell_xml.c

@@ -135,12 +135,8 @@ int clish_shell_load_scheme(clish_shell_t *this, const char *xml_path)
 		if (res)
 			break;
 	}
-	/* tidy up */
 	lub_string_free(buffer);
 
-#ifdef DEBUG
-	clish_shell_dump(this);
-#endif
 	return res;
 }
 

+ 3 - 3
clish/view/view_dump.c

@@ -12,7 +12,7 @@ void clish_view_dump(clish_view_t * this)
 {
 	clish_command_t *c;
 	lub_list_node_t *iter;
-	unsigned i;
+	lub_bintree_iterator_t iterc;
 	clish_nspace_t *nspace;
 
 	lub_dump_printf("view(%p)\n", this);
@@ -31,8 +31,8 @@ void clish_view_dump(clish_view_t * this)
 
 	/* Iterate the tree of commands */
 	c = lub_bintree_findfirst(&this->tree);
-	for (lub_bintree_iterator_init(&iter, &this->tree, c);
-		c; c = lub_bintree_iterator_next(&iter)) {
+	for (lub_bintree_iterator_init(&iterc, &this->tree, c);
+		c; c = lub_bintree_iterator_next(&iterc)) {
 		clish_command_dump(c);
 	}