Просмотр исходного кода

remove some new warnings from corosync


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1677 fd59a12c-fef9-0310-b244-a6a79926bd2f
Angus Salkeld 17 лет назад
Родитель
Сommit
301a730dd1

+ 6 - 1
exec/apidef.c

@@ -60,6 +60,11 @@ typedef int (*typedef_tpg_leave) (corosync_tpg_handle, struct corosync_tpg_group
 typedef int (*typedef_tpg_groups_mcast) (corosync_tpg_handle, int, struct corosync_tpg_group *, int groups_cnt, struct iovec *, int);
 typedef int (*typedef_tpg_groups_send_ok) (corosync_tpg_handle, struct corosync_tpg_group *, int groups_cnt, struct iovec *, int);
 
+static inline void _corosync_public_exit_error (
+	corosync_fatal_error_t err, const char *file, unsigned int line)
+{
+	_corosync_exit_error (err, file, line);
+}
 
 static struct corosync_api_v1 apidef_corosync_api_v1 = {
 	.timer_add_duration = corosync_timer_add_duration,
@@ -100,7 +105,7 @@ static struct corosync_api_v1 apidef_corosync_api_v1 = {
 	.plugin_interface_reference = lcr_ifact_reference,
 	.plugin_interface_release = lcr_ifact_release,
 	.error_memory_failure = _corosync_out_of_memory_error,
-	.fatal_error = _corosync_exit_error
+	.fatal_error = _corosync_public_exit_error
 };
 
 void apidef_init (struct objdb_iface_ver0 *objdb) {

+ 1 - 1
exec/crypto.c

@@ -844,7 +844,7 @@ int sober128_add_entropy(const unsigned char *buf, unsigned long len, prng_state
        assert ((len & 3) == 0);
     
        for (i = 0; i < len; i += 4) {
-           k = BYTE2WORD((unsigned char *)&buf[i]);
+           k = BYTE2WORD((unsigned char*)&buf[i]);
           ADDKEY(k);
           cycle(c->R);
           XORNL(nltap(c));

+ 3 - 1
exec/ipc.c

@@ -1132,10 +1132,12 @@ int corosync_conn_send_response_no_fcc (
 	void *msg,
 	int mlen)
 {
+	int ret;
 	dont_call_flow_control = 1;
-	corosync_conn_send_response (
+	ret = corosync_conn_send_response (
 		conn, msg, mlen);
 	dont_call_flow_control = 0;
+	return ret;
 }
 
 int corosync_conn_send_response (

+ 1 - 1
exec/vsf_quorum.c

@@ -276,7 +276,7 @@ static int quorum_lib_exit_fn (void *conn)
 static int send_quorum_notification(void *conn)
 {
 	int size = sizeof(struct res_lib_quorum_notification) + sizeof(unsigned int)*quorum_view_list_entries;
-	char *buf[size];
+	char buf[size];
 	struct res_lib_quorum_notification *res_lib_quorum_notification = (struct res_lib_quorum_notification *)buf;
 	struct list_head *tmp;
 	int i;

+ 11 - 0
include/corosync/engine/coroapi.h

@@ -142,6 +142,11 @@ typedef enum {
 	OBJECT_KEY_DELETED
 } object_change_type_t;
 
+typedef enum {
+        OBJDB_RELOAD_NOTIFY_START,
+        OBJDB_RELOAD_NOTIFY_END
+} objdb_reload_notify_type_t;
+
 typedef void (*object_key_change_notify_fn_t)(object_change_type_t change_type,
 											  unsigned int parent_object_handle,
 											  unsigned int object_handle,
@@ -164,6 +169,10 @@ typedef void (*object_notify_callback_fn_t)(unsigned int object_handle,
 											object_change_type_t type,
 											void * priv_data_pt);
 
+typedef void (*object_reload_notify_fn_t) (objdb_reload_notify_type_t, int flush,
+											void *priv_data_pt);
+
+
 #endif /* OBJECT_PARENT_HANDLE_DEFINED */
 
 struct corosync_api_v1 {
@@ -285,12 +294,14 @@ struct corosync_api_v1 {
 		object_key_change_notify_fn_t key_change_notify_fn,
 		object_create_notify_fn_t object_create_notify_fn,
 		object_destroy_notify_fn_t object_destroy_notify_fn,
+		object_reload_notify_fn_t object_reload_notify_fn,
 		void * priv_data_pt);
 
 	void (*object_track_stop) (
 		object_key_change_notify_fn_t key_change_notify_fn,
 		object_create_notify_fn_t object_create_notify_fn,
 		object_destroy_notify_fn_t object_destroy_notify_fn,
+		object_reload_notify_fn_t object_reload_notify_fn,
 		void * priv_data_pt);
 
 	int (*object_write_config) (char **error_string);

+ 3 - 0
services/confdb.c

@@ -279,6 +279,7 @@ static int confdb_lib_exit_fn (void *conn)
 	api->object_track_stop(confdb_notify_lib_of_key_change,
 						   confdb_notify_lib_of_new_object,
 						   confdb_notify_lib_of_destroyed_object,
+						   NULL,
 						   api->ipc_conn_partner_get (conn));
 	return (0);
 }
@@ -682,6 +683,7 @@ static void message_handler_req_lib_confdb_track_start (void *conn, void *messag
 							confdb_notify_lib_of_key_change,
 							confdb_notify_lib_of_new_object,
 							confdb_notify_lib_of_destroyed_object,
+							NULL,
 							api->ipc_conn_partner_get (conn));
 	res.size = sizeof(res);
 	res.id = MESSAGE_RES_CONFDB_TRACK_START;
@@ -696,6 +698,7 @@ static void message_handler_req_lib_confdb_track_stop (void *conn, void *message
 	api->object_track_stop(confdb_notify_lib_of_key_change,
 						   confdb_notify_lib_of_new_object,
 						   confdb_notify_lib_of_destroyed_object,
+						   NULL,
 						   api->ipc_conn_partner_get (conn));
 
 	res.size = sizeof(res);

+ 2 - 2
test/evsverify.c

@@ -112,7 +112,7 @@ struct evs_group groups[3] = {
 
 struct msg msg;
 
-char buffer[200000];
+unsigned char buffer[200000];
 int main (void)
 {
 	evs_handle_t handle;
@@ -121,7 +121,7 @@ int main (void)
 	int fd;
 	unsigned int member_list[32];
 	unsigned int local_nodeid;
-	int member_list_entries = 32;
+	unsigned int member_list_entries = 32;
 	struct msg msg;
 	hash_state sha1_hash;
 	struct iovec iov[2];

+ 2 - 2
test/testquorum.c

@@ -3,8 +3,8 @@
 #include <stdint.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <saAis.h>
-#include "../include/corosync/quorum.h"
+#include <corosync/saAis.h>
+#include <corosync/quorum.h>
 
 static quorum_handle_t handle;
 

+ 2 - 2
tools/corosync-cfgtool.c

@@ -151,8 +151,8 @@ int main (int argc, char *argv[]) {
 	int opt;
 	int service_load = 0;
 	int service_unload = 0;
-	char *service;
-	unsigned int version;
+	char *service = NULL;
+	unsigned int version = 0;
 
 	if (argc == 1) {
 		usage_do ();

+ 1 - 1
tools/corosync-objctl.c

@@ -553,7 +553,7 @@ static void delete_object(confdb_handle_t handle, char * name_pt)
 int main (int argc, char *argv[]) {
 	confdb_handle_t handle;
 	confdb_error_t result;
-	char c;
+	int c;
 
 	action = ACTION_READ;