Преглед на файлове

Fix cppchecks warning

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
Jan Friesse преди 12 години
родител
ревизия
5c54f941ac
променени са 3 файла, в които са добавени 7 реда и са изтрити 7 реда
  1. 2 2
      exec/cmap.c
  2. 2 2
      exec/main.c
  3. 3 3
      exec/totemconfig.c

+ 2 - 2
exec/cmap.c

@@ -597,8 +597,8 @@ static void message_handler_req_lib_cmap_iter_next(void *conn, const void *messa
 	struct res_lib_cmap_iter_next res_lib_cmap_iter_next;
 	struct res_lib_cmap_iter_next res_lib_cmap_iter_next;
 	cs_error_t ret;
 	cs_error_t ret;
 	icmap_iter_t *iter;
 	icmap_iter_t *iter;
-	size_t value_len;
-	icmap_value_types_t type;
+	size_t value_len = 0;
+	icmap_value_types_t type = 0;
 	const char *res = NULL;
 	const char *res = NULL;
 	struct cmap_conn_info *conn_info = (struct cmap_conn_info *)api->ipc_private_data_get (conn);
 	struct cmap_conn_info *conn_info = (struct cmap_conn_info *)api->ipc_private_data_get (conn);
 
 

+ 2 - 2
exec/main.c

@@ -562,8 +562,8 @@ static void totem_dynamic_notify(
 	void *user_data)
 	void *user_data)
 {
 {
 	int res;
 	int res;
-	int ring_no;
-	int member_no;
+	unsigned int ring_no;
+	unsigned int member_no;
 	struct totem_ip_address member;
 	struct totem_ip_address member;
 	int add_new_member = 0;
 	int add_new_member = 0;
 	int remove_old_member = 0;
 	int remove_old_member = 0;

+ 3 - 3
exec/totemconfig.c

@@ -292,7 +292,7 @@ static int find_local_node_in_nodelist(struct totem_config *totem_config)
 	icmap_iter_t iter;
 	icmap_iter_t iter;
 	const char *iter_key;
 	const char *iter_key;
 	int res = 0;
 	int res = 0;
-	int node_pos;
+	unsigned int node_pos;
 	int local_node_pos = -1;
 	int local_node_pos = -1;
 	struct totem_ip_address bind_addr;
 	struct totem_ip_address bind_addr;
 	int interface_up, interface_num;
 	int interface_up, interface_num;
@@ -343,7 +343,7 @@ static void put_nodelist_members_to_config(struct totem_config *totem_config)
 	icmap_iter_t iter, iter2;
 	icmap_iter_t iter, iter2;
 	const char *iter_key, *iter_key2;
 	const char *iter_key, *iter_key2;
 	int res = 0;
 	int res = 0;
-	int node_pos;
+	unsigned int node_pos;
 	char tmp_key[ICMAP_KEYNAME_MAXLEN];
 	char tmp_key[ICMAP_KEYNAME_MAXLEN];
 	char tmp_key2[ICMAP_KEYNAME_MAXLEN];
 	char tmp_key2[ICMAP_KEYNAME_MAXLEN];
 	char *node_addr_str;
 	char *node_addr_str;
@@ -394,7 +394,7 @@ static void config_convert_nodelist_to_interface(struct totem_config *totem_conf
 	icmap_iter_t iter;
 	icmap_iter_t iter;
 	const char *iter_key;
 	const char *iter_key;
 	int res = 0;
 	int res = 0;
-	int node_pos;
+	unsigned int node_pos;
 	char tmp_key[ICMAP_KEYNAME_MAXLEN];
 	char tmp_key[ICMAP_KEYNAME_MAXLEN];
 	char tmp_key2[ICMAP_KEYNAME_MAXLEN];
 	char tmp_key2[ICMAP_KEYNAME_MAXLEN];
 	char *node_addr_str;
 	char *node_addr_str;