Browse Source

Fix extra warnings

Serj Kalichev 10 years ago
parent
commit
2b1c1bf0a9

+ 2 - 0
bin/clish.c

@@ -414,5 +414,7 @@ static void help(int status, const char *argv0)
  */
 static void sighandler(int signo)
 {
+	signo = signo; /* Happy compiler */
+
 	return;
 }

+ 1 - 1
bin/konf.c

@@ -46,7 +46,7 @@ int main(int argc, char **argv)
 	char *line = NULL;
 	char *str = NULL;
 	const char *socket_path = KONFD_SOCKET_PATH;
-	unsigned i = 0;
+	int i = 0;
 
 	/* Signal vars */
 	struct sigaction sigpipe_act;

+ 4 - 2
bin/konfd.c

@@ -96,7 +96,7 @@ struct options {
 int main(int argc, char **argv)
 {
 	int retval = -1;
-	unsigned int i;
+	int i;
 	char *str;
 	konf_tree_t *conf;
 	lub_bintree_t bufs;
@@ -382,7 +382,7 @@ err1:
 /*--------------------------------------------------------- */
 static char * process_query(konf_buf_t *tbuf, konf_tree_t * conf, char *str)
 {
-	unsigned int i;
+	int i;
 	int res;
 	konf_tree_t *iconf;
 	konf_tree_t *tmpconf;
@@ -516,6 +516,8 @@ static char * process_query(konf_buf_t *tbuf, konf_tree_t * conf, char *str)
  */
 static void sighandler(int signo)
 {
+	signo = signo; /* Happy compiler */
+
 	sigterm = 1;
 }
 

+ 1 - 1
clish/command.h

@@ -71,7 +71,7 @@ void clish_command__set_viewid(clish_command_t * instance, const char *viewid);
 void clish_command__force_viewid(clish_command_t * instance, const char *viewid);
 void clish_command__set_pview(clish_command_t * instance, clish_view_t * view);
 clish_view_t *clish_command__get_pview(const clish_command_t * instance);
-unsigned clish_command__get_depth(const clish_command_t * instance);
+int clish_command__get_depth(const clish_command_t * instance);
 clish_config_t *clish_command__get_config(const clish_command_t *instance);
 clish_view_restore_t clish_command__get_restore(const clish_command_t * instance);
 const clish_command_t * clish_command__get_orig(const clish_command_t * instance);

+ 3 - 1
clish/command/command.c

@@ -174,6 +174,8 @@ void clish_command_insert_param(clish_command_t * this, clish_param_t * param)
 /*--------------------------------------------------------- */
 int clish_command_help(const clish_command_t *this)
 {
+	this = this; /* Happy compiler */
+
 	return 0;
 }
 
@@ -374,7 +376,7 @@ clish_view_t *clish_command__get_pview(const clish_command_t * this)
 }
 
 /*--------------------------------------------------------- */
-unsigned clish_command__get_depth(const clish_command_t * this)
+int clish_command__get_depth(const clish_command_t * this)
 {
 	if (!this->pview)
 		return 0;

+ 2 - 0
clish/param/param.c

@@ -185,6 +185,8 @@ void clish_param_help(const clish_param_t * this, clish_help_t *help)
 void clish_param_help_arrow(const clish_param_t * this, size_t offset)
 {
 	fprintf(stderr, "%*c\n", (int)offset, '^');
+
+	this = this; /* Happy compiler */
 }
 
 /*--------------------------------------------------------- */

+ 1 - 1
clish/ptype/ptype.c

@@ -148,7 +148,7 @@ static const char *method_names[] = {
 /*--------------------------------------------------------- */
 const char *clish_ptype_method__get_name(clish_ptype_method_e method)
 {
-	int max_method = sizeof(method_names) / sizeof(char *);
+	unsigned int max_method = sizeof(method_names) / sizeof(char *);
 
 	if (method >= max_method)
 		return NULL;

+ 12 - 1
clish/shell/shell_expat.c

@@ -268,6 +268,8 @@ static void clish_expat_element_end(void *data, const char *el)
 	if (doc->current) {
 		doc->current = doc->current->parent;
 	}
+
+	el = el; /* Happy compiler */
 }
 
 /** Free a node, its children and its attributes
@@ -383,21 +385,29 @@ int clish_xmldoc_is_valid(clish_xmldoc_t *doc)
 
 int clish_xmldoc_error_caps(clish_xmldoc_t *doc)
 {
+	doc = doc; /* Happy compiler */
+
 	return CLISH_XMLERR_NOCAPS;
 }
 
 int clish_xmldoc_get_err_line(clish_xmldoc_t *doc)
 {
+	doc = doc; /* Happy compiler */
+
 	return -1;
 }
 
 int clish_xmldoc_get_err_col(clish_xmldoc_t *doc)
 {
+	doc = doc; /* Happy compiler */
+
 	return -1;
 }
 
 const char *clish_xmldoc_get_err_msg(clish_xmldoc_t *doc)
 {
+	doc = doc; /* Happy compiler */
+
 	return "";
 }
 
@@ -449,7 +459,7 @@ char *clish_xmlnode_fetch_attr(clish_xmlnode_t *node,
 int clish_xmlnode_get_content(clish_xmlnode_t *node, char *content,
 			      unsigned int *contentlen)
 {
-	int minlen = 1;
+	unsigned int minlen = 1;
 
 	if (node && content && contentlen) {
 		clish_xmlnode_t *children = node->children;
@@ -509,6 +519,7 @@ void clish_xmlnode_print(clish_xmlnode_t *node, FILE *out)
 
 void clish_xml_release(void *p)
 {
+	p = p; /* Happy compiler */
 	/* nothing to release */
 }
 

+ 1 - 1
clish/shell/shell_help.c

@@ -109,7 +109,7 @@ void clish_shell_help(clish_shell_t *this, const char *line)
 	clish_help_t help;
 	size_t max_width = 0;
 	const clish_command_t *cmd;
-	int i;
+	unsigned int i;
 
 	help.name = lub_argv_new(NULL, 0);
 	help.help = lub_argv_new(NULL, 0);

+ 2 - 0
clish/shell/shell_wdog.c

@@ -40,6 +40,8 @@ int clish_shell_keypress_fn(tinyrl_t *tinyrl, int key)
 		tinyrl__set_timeout(tinyrl, this->idle_timeout);
 	}
 
+	key = key; /* Happy compiler */
+
 	return 0;
 }
 

+ 57 - 35
clish/shell/shell_xml.c

@@ -30,8 +30,8 @@ const char* clish_plugin_default_hook[] = {
 #define CLISH_XML_ERROR_STR "Error parsing XML: "
 #define CLISH_XML_ERROR_ATTR(attr) CLISH_XML_ERROR_STR"The \""attr"\" attribute is required.\n"
 
-typedef int (PROCESS_FN) (clish_shell_t * instance,
-	clish_xmlnode_t * element, void *parent);
+typedef int (PROCESS_FN) (clish_shell_t *instance,
+	clish_xmlnode_t *element, void *parent);
 
 /* Define a control block for handling the decode of an XML file */
 typedef struct clish_xml_cb_s clish_xml_cb_t;
@@ -184,7 +184,8 @@ int clish_shell_load_scheme(clish_shell_t *this, const char *xml_path)
  * This function reads an element from the XML stream and processes it.
  * ------------------------------------------------------
  */
-static int process_node(clish_shell_t * shell, clish_xmlnode_t * node, void *parent)
+static int process_node(clish_shell_t *shell, clish_xmlnode_t *node,
+	void *parent)
 {
 	int res = 0;
 
@@ -263,7 +264,7 @@ static int process_children(clish_shell_t *shell,
 }
 
 /* ------------------------------------------------------ */
-int clish_shell_xml_read(clish_shell_t * shell, const char *filename)
+int clish_shell_xml_read(clish_shell_t *shell, const char *filename)
 {
 	int ret = -1;
 	clish_xmldoc_t *doc;
@@ -291,18 +292,22 @@ int clish_shell_xml_read(clish_shell_t * shell, const char *filename)
 }
 
 /* ------------------------------------------------------ */
-static int
-process_clish_module(clish_shell_t * shell, clish_xmlnode_t * element, void *parent)
+static int process_clish_module(clish_shell_t *shell, clish_xmlnode_t *element,
+	void *parent)
 {
 	/* Create the global view */
 	if (!shell->global)
 		shell->global = clish_shell_find_create_view(shell,
 			"global", "");
+
+	parent = parent; /* Happy compiler */
+
 	return process_children(shell, element, shell->global);
 }
 
 /* ------------------------------------------------------ */
-static int process_view(clish_shell_t * shell, clish_xmlnode_t * element, void *parent)
+static int process_view(clish_shell_t *shell, clish_xmlnode_t *element,
+	void *parent)
 {
 	clish_view_t *view;
 	int res = -1;
@@ -348,12 +353,14 @@ error:
 	clish_xml_release(restore);
 	clish_xml_release(access);
 
+	parent = parent; /* Happy compiler */
+
 	return res;
-;
 }
 
 /* ------------------------------------------------------ */
-static int process_ptype(clish_shell_t * shell, clish_xmlnode_t * element, void *parent)
+static int process_ptype(clish_shell_t *shell, clish_xmlnode_t *element,
+	void *parent)
 {
 	clish_ptype_method_e method;
 	clish_ptype_preprocess_e preprocess;
@@ -389,12 +396,14 @@ error:
 	clish_xml_release(method_name);
 	clish_xml_release(preprocess_name);
 
+	parent = parent; /* Happy compiler */
+
 	return res;
 }
 
 /* ------------------------------------------------------ */
-static int
-process_overview(clish_shell_t * shell, clish_xmlnode_t * element, void *parent)
+static int process_overview(clish_shell_t *shell, clish_xmlnode_t *element,
+	void *parent)
 {
 	char *content = NULL;
 	unsigned int content_len = 2048;
@@ -423,12 +432,14 @@ process_overview(clish_shell_t * shell, clish_xmlnode_t * element, void *parent)
 	if (content)
 		free(content);
 
+	parent = parent; /* Happy compiler */
+
 	return 0;
 }
 
 /* ------------------------------------------------------ */
-static int
-process_command(clish_shell_t * shell, clish_xmlnode_t * element, void *parent)
+static int process_command(clish_shell_t *shell, clish_xmlnode_t *element,
+	void *parent)
 {
 	clish_view_t *v = (clish_view_t *) parent;
 	clish_command_t *cmd = NULL;
@@ -576,8 +587,8 @@ error:
 }
 
 /* ------------------------------------------------------ */
-static int
-process_startup(clish_shell_t * shell, clish_xmlnode_t * element, void *parent)
+static int process_startup(clish_shell_t *shell, clish_xmlnode_t *element,
+	void *parent)
 {
 	clish_view_t *v = (clish_view_t *) parent;
 	clish_command_t *cmd = NULL;
@@ -652,8 +663,8 @@ error:
 }
 
 /* ------------------------------------------------------ */
-static int
-process_param(clish_shell_t * shell, clish_xmlnode_t * element, void *parent)
+static int process_param(clish_shell_t *shell, clish_xmlnode_t *element,
+	void *parent)
 {
 	clish_command_t *cmd = NULL;
 	clish_param_t *p_param = NULL;
@@ -831,8 +842,8 @@ error:
 }
 
 /* ------------------------------------------------------ */
-static int
-process_action(clish_shell_t *shell, clish_xmlnode_t *element, void *parent)
+static int process_action(clish_shell_t *shell, clish_xmlnode_t *element,
+	void *parent)
 {
 	clish_action_t *action = NULL;
 	char *builtin = clish_xmlnode_fetch_attr(element, "builtin");
@@ -876,8 +887,8 @@ process_action(clish_shell_t *shell, clish_xmlnode_t *element, void *parent)
 }
 
 /* ------------------------------------------------------ */
-static int
-process_detail(clish_shell_t * shell, clish_xmlnode_t * element, void *parent)
+static int process_detail(clish_shell_t *shell, clish_xmlnode_t *element,
+	void *parent)
 {
 	clish_command_t *cmd = (clish_command_t *) parent;
 
@@ -892,12 +903,14 @@ process_detail(clish_shell_t * shell, clish_xmlnode_t * element, void *parent)
 	if (text)
 		free(text);
 
+	shell = shell; /* Happy compiler */
+
 	return 0;
 }
 
 /* ------------------------------------------------------ */
-static int
-process_namespace(clish_shell_t * shell, clish_xmlnode_t * element, void *parent)
+static int process_namespace(clish_shell_t *shell, clish_xmlnode_t *element,
+	void *parent)
 {
 	clish_view_t *v = (clish_view_t *) parent;
 	clish_nspace_t *nspace = NULL;
@@ -979,8 +992,8 @@ error:
 }
 
 /* ------------------------------------------------------ */
-static int
-process_config(clish_shell_t * shell, clish_xmlnode_t * element, void *parent)
+static int process_config(clish_shell_t *shell, clish_xmlnode_t *element,
+	void *parent)
 {
 	clish_command_t *cmd = (clish_command_t *)parent;
 	clish_config_t *config;
@@ -1064,12 +1077,14 @@ process_config(clish_shell_t * shell, clish_xmlnode_t * element, void *parent)
 	clish_xml_release(unique);
 	clish_xml_release(depth);
 
+	shell = shell; /* Happy compiler */
+
 	return 0;
 }
 
 /* ------------------------------------------------------ */
-static int
-process_var(clish_shell_t * shell, clish_xmlnode_t * element, void *parent)
+static int process_var(clish_shell_t *shell, clish_xmlnode_t *element,
+	void *parent)
 {
 	clish_var_t *var = NULL;
 	int res = -1;
@@ -1106,12 +1121,13 @@ error:
 	clish_xml_release(dynamic);
 	clish_xml_release(value);
 
+	parent = parent; /* Happy compiler */
+
 	return res;
 }
 
 /* ------------------------------------------------------ */
-static int
-process_wdog(clish_shell_t *shell,
+static int process_wdog(clish_shell_t *shell,
 	clish_xmlnode_t *element, void *parent)
 {
 	clish_view_t *v = (clish_view_t *)parent;
@@ -1137,8 +1153,8 @@ error:
 }
 
 /* ------------------------------------------------------ */
-static int
-process_hotkey(clish_shell_t *shell, clish_xmlnode_t* element, void *parent)
+static int process_hotkey(clish_shell_t *shell, clish_xmlnode_t *element,
+	void *parent)
 {
 	clish_view_t *v = (clish_view_t *)parent;
 	int res = -1;
@@ -1163,12 +1179,14 @@ error:
 	clish_xml_release(key);
 	clish_xml_release(cmd);
 
+	shell = shell; /* Happy compiler */
+
 	return res;
 }
 
 /* ------------------------------------------------------ */
-static int
-process_plugin(clish_shell_t *shell, clish_xmlnode_t* element, void *parent)
+static int process_plugin(clish_shell_t *shell, clish_xmlnode_t *element,
+	void *parent)
 {
 	clish_plugin_t *plugin;
 	char *file = clish_xmlnode_fetch_attr(element, "file");
@@ -1205,12 +1223,14 @@ error:
 	clish_xml_release(name);
 	clish_xml_release(alias);
 
+	parent = parent; /* Happy compiler */
+
 	return res;
 }
 
 /* ------------------------------------------------------ */
-static int
-process_hook(clish_shell_t *shell, clish_xmlnode_t* element, void *parent)
+static int process_hook(clish_shell_t *shell, clish_xmlnode_t *element,
+	void *parent)
 {
 	char *name = clish_xmlnode_fetch_attr(element, "name");
 	char *builtin = clish_xmlnode_fetch_attr(element, "builtin");
@@ -1250,6 +1270,8 @@ error:
 	clish_xml_release(name);
 	clish_xml_release(builtin);
 
+	parent = parent; /* Happy compiler */
+
 	return res;
 }
 

+ 1 - 1
clish/view/view.c

@@ -318,7 +318,7 @@ void clish_view_insert_nspace(clish_view_t * this, clish_nspace_t * nspace)
 /*--------------------------------------------------------- */
 void clish_view_clean_proxy(clish_view_t * this)
 {
-	int i;
+	unsigned int i;
 
 	/* Iterate namespace instances */
 	for (i = 0; i < this->nspacec; i++) {

+ 1 - 1
konf/buf/buf.c

@@ -146,7 +146,7 @@ int konf_buf_read(konf_buf_t *this)
 /*--------------------------------------------------------- */
 char * konf_buf_string(char *buf, int len)
 {
-	unsigned i;
+	int i;
 	char *str;
 
 	for (i = 0; i < len; i++) {

+ 1 - 1
konf/query/query.c

@@ -87,7 +87,7 @@ void konf_query_free(konf_query_t *this)
 /* Parse query */
 int konf_query_parse(konf_query_t *this, int argc, char **argv)
 {
-	unsigned i = 0;
+	int i = 0;
 	int pwdc = 0;
 
 	static const char *shortopts = "suoedtp:q:r:l:f:inh:";

+ 2 - 0
plugins/clish/builtin_init.c

@@ -31,6 +31,8 @@ CLISH_PLUGIN_INIT(clish)
 	clish_plugin_add_psym(plugin, clish_macros, "clish_macros");
 	clish_plugin_add_sym(plugin, clish_script, "clish_script");
 
+	clish_shell = clish_shell; /* Happy compiler */
+
 	return 0;
 }
 

+ 3 - 0
plugins/clish/hook_access.c

@@ -75,6 +75,9 @@ CLISH_HOOK_ACCESS(clish_hook_access)
 	lub_string_free(full_access);
 	free(group_list);
 #endif
+
+	clish_context = clish_context; /* Happy compiler */
+
 	return allowed;
 }
 

+ 29 - 0
plugins/clish/sym_misc.c

@@ -23,6 +23,10 @@ CLISH_PLUGIN_SYM(clish_close)
 {
 	clish_shell_t *this = clish_context__get_shell(clish_context);
 	clish_shell__set_state(this, SHELL_STATE_CLOSING);
+
+	script = script; /* Happy compiler */
+	out = out; /* Happy compiler */
+
 	return 0;
 }
 
@@ -68,6 +72,9 @@ static int clish_source_internal(clish_context_t *context,
 CLISH_PLUGIN_SYM(clish_source)
 {
 	clish_context_t *context = (clish_context_t *)clish_context;
+
+	out = out; /* Happy compiler */
+
 	return (clish_source_internal(context, script, BOOL_TRUE));
 }
 
@@ -80,6 +87,9 @@ CLISH_PLUGIN_SYM(clish_source)
 CLISH_PLUGIN_SYM(clish_source_nostop)
 {
 	clish_context_t *context = (clish_context_t *)clish_context;
+
+	out = out; /* Happy compiler */
+
 	return (clish_source_internal(context, script, BOOL_FALSE));
 }
 
@@ -92,6 +102,10 @@ CLISH_PLUGIN_SYM(clish_overview)
 	clish_shell_t *this = clish_context__get_shell(clish_context);
 	tinyrl_t *tinyrl = clish_shell__get_tinyrl(this);
 	tinyrl_printf(tinyrl, "%s\n", clish_shell__get_overview(this));
+
+	script = script; /* Happy compiler */
+	out = out; /* Happy compiler */
+
 	return 0;
 }
 
@@ -124,6 +138,9 @@ CLISH_PLUGIN_SYM(clish_history)
 			tinyrl_history_entry__get_index(entry),
 			tinyrl_history_entry__get_line(entry));
 	}
+
+	out = out; /* Happy compiler */
+
 	return 0;
 }
 
@@ -146,6 +163,9 @@ CLISH_PLUGIN_SYM(clish_nested_up)
 	depth--;
 	clish_shell__set_depth(this, depth);
 
+	script = script; /* Happy compiler */
+	out = out; /* Happy compiler */
+
 	return 0;
 }
 
@@ -155,6 +175,10 @@ CLISH_PLUGIN_SYM(clish_nested_up)
  */
 CLISH_PLUGIN_SYM(clish_nop)
 {
+	script = script; /* Happy compiler */
+	out = out; /* Happy compiler */
+	clish_context = clish_context; /* Happy compiler */
+
 	return 0;
 }
 
@@ -175,6 +199,8 @@ CLISH_PLUGIN_SYM(clish_wdog)
 
 	clish_shell__set_wdog_timeout(this, (unsigned int)atoi(arg));
 
+	out = out; /* Happy compiler */
+
 	return 0;
 }
 
@@ -187,6 +213,9 @@ CLISH_PLUGIN_SYM(clish_macros)
 	if (!script) /* Nothing to do */
 		return 0;
 	*out = lub_string_dup(script);
+
+	clish_context = clish_context; /* Happy compiler */
+
 	return 0;
 }
 

+ 2 - 0
tinyrl/tinyrl.c

@@ -261,6 +261,8 @@ static void changed_line(tinyrl_t * this)
 /*----------------------------------------------------------------------- */
 static int tinyrl_timeout_default(tinyrl_t *this)
 {
+	this = this; /* Happy compiler */
+
 	/* Return -1 to close session on timeout */
 	return -1;
 }

+ 2 - 0
tinyrl/vt100/vt100.c

@@ -48,6 +48,8 @@ tinyrl_vt100_escape_t tinyrl_vt100_escape_decode(const tinyrl_vt100_t *this,
 		break;
 	}
 
+	this = this; /* Happy compiler */
+
 	return result;
 }