From 301a730dd1a4729c39df7e6e6ebdd90660b8e5b6 Mon Sep 17 00:00:00 2001 From: Angus Salkeld Date: Tue, 21 Oct 2008 21:44:29 +0000 Subject: [PATCH] remove some new warnings from corosync git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1677 fd59a12c-fef9-0310-b244-a6a79926bd2f --- exec/apidef.c | 7 ++++++- exec/crypto.c | 2 +- exec/ipc.c | 4 +++- exec/vsf_quorum.c | 2 +- include/corosync/engine/coroapi.h | 11 +++++++++++ services/confdb.c | 3 +++ test/evsverify.c | 4 ++-- test/testquorum.c | 4 ++-- tools/corosync-cfgtool.c | 4 ++-- tools/corosync-objctl.c | 2 +- 10 files changed, 32 insertions(+), 11 deletions(-) diff --git a/exec/apidef.c b/exec/apidef.c index a3b3520b..0bf27952 100644 --- a/exec/apidef.c +++ b/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) { diff --git a/exec/crypto.c b/exec/crypto.c index 031cca61..6ba5534a 100644 --- a/exec/crypto.c +++ b/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)); diff --git a/exec/ipc.c b/exec/ipc.c index 4222b471..42505210 100644 --- a/exec/ipc.c +++ b/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 ( diff --git a/exec/vsf_quorum.c b/exec/vsf_quorum.c index b129ff78..bbfd2e28 100644 --- a/exec/vsf_quorum.c +++ b/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; diff --git a/include/corosync/engine/coroapi.h b/include/corosync/engine/coroapi.h index b285c966..e5b04545 100644 --- a/include/corosync/engine/coroapi.h +++ b/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); diff --git a/services/confdb.c b/services/confdb.c index 687175f4..d59c1840 100644 --- a/services/confdb.c +++ b/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); diff --git a/test/evsverify.c b/test/evsverify.c index 10a33f40..c6777e5c 100644 --- a/test/evsverify.c +++ b/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]; diff --git a/test/testquorum.c b/test/testquorum.c index 30277f7d..d2d7a8b9 100644 --- a/test/testquorum.c +++ b/test/testquorum.c @@ -3,8 +3,8 @@ #include #include #include -#include -#include "../include/corosync/quorum.h" +#include +#include static quorum_handle_t handle; diff --git a/tools/corosync-cfgtool.c b/tools/corosync-cfgtool.c index fe8a8a87..82e09852 100644 --- a/tools/corosync-cfgtool.c +++ b/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 (); diff --git a/tools/corosync-objctl.c b/tools/corosync-objctl.c index f2a777f0..e6106ad8 100644 --- a/tools/corosync-objctl.c +++ b/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;