소스 검색

Fix warnings within plugins

Serj Kalichev 1 년 전
부모
커밋
245e0d55a0
4개의 변경된 파일2개의 추가작업 그리고 8개의 파일을 삭제
  1. 0 1
      plugins/klish/plugin_init.c
  2. 2 2
      plugins/lua/klish_lua.c
  3. 0 1
      plugins/script/plugin_init.c
  4. 0 4
      plugins/script/script.c

+ 0 - 1
plugins/klish/plugin_init.c

@@ -20,7 +20,6 @@ const uint8_t kplugin_klish_minor = KPLUGIN_MINOR;
 int kplugin_klish_init(kcontext_t *context)
 {
 	kplugin_t *plugin = NULL;
-	ksym_t *sym = NULL;
 
 	assert(context);
 	plugin = kcontext_plugin(context);

+ 2 - 2
plugins/lua/klish_lua.c

@@ -307,6 +307,7 @@ static void laction (int i) {
 		return;
 	lua_sethook(globalL, lstop, LUA_MASKCALL | LUA_MASKRET | LUA_MASKCOUNT, 1);
 	globalL = NULL; // run only once
+	i = i; // Happy compiler
 }
 
 
@@ -430,7 +431,7 @@ int klish_plugin_lua_action(kcontext_t *context)
 	// Restore SIGINT and SIGQUIT
 	sigaction(SIGINT, &sig_old_int, NULL);
 	sigaction(SIGQUIT, &sig_old_quit, NULL);
-err:
+
 	return status;
 }
 
@@ -494,7 +495,6 @@ int kplugin_lua_init(kcontext_t *context)
 int kplugin_lua_fini(kcontext_t *context)
 {
 	kplugin_t *plugin = NULL;
-	lua_State *L = NULL;
 	struct lua_klish_data *ctx = NULL;
 
 	assert(context);

+ 0 - 1
plugins/script/plugin_init.c

@@ -20,7 +20,6 @@ const uint8_t kplugin_script_minor = KPLUGIN_MINOR;
 int kplugin_script_init(kcontext_t *context)
 {
 	kplugin_t *plugin = NULL;
-	ksym_t *sym = NULL;
 
 	assert(context);
 	plugin = kcontext_plugin(context);

+ 0 - 4
plugins/script/script.c

@@ -22,9 +22,7 @@
 
 static char *script_mkfifo(void)
 {
-	int res = 0;
 	char *name = NULL;
-	int rc = 0;
 
 	name = faux_str_sprintf("/tmp/klish.fifo.%u.XXXXXX", getpid());
 	mktemp(name);
@@ -51,7 +49,6 @@ const char *kcontext_type_e_str[] = {
 
 static bool_t populate_env_kpargv(const kpargv_t *pargv, const char *prefix)
 {
-	kcontext_type_e type = KCONTEXT_TYPE_NONE;
 	const kentry_t *entry = NULL;
 	kpargv_pargs_node_t *iter = NULL;
 	kparg_t *parg = NULL;
@@ -72,7 +69,6 @@ static bool_t populate_env_kpargv(const kpargv_t *pargv, const char *prefix)
 	// Parameters
 	iter = kpargv_pargs_iter(pargv);
 	while ((parg = kpargv_pargs_each(&iter))) {
-		const char *str = NULL;
 		char *var = NULL;
 		entry = kparg_entry(parg);
 		if (kentry_max(entry) > 1) { // Multi