diff --git a/exec/main.c b/exec/main.c index e60e8f53..b29f9521 100644 --- a/exec/main.c +++ b/exec/main.c @@ -481,7 +481,7 @@ int main_mcast ( return (totempg_groups_mcast_joined (corosync_group_handle, iovec, iov_len, guarantee)); } -int message_source_is_local (mar_message_source_t *source) +int message_source_is_local (const mar_message_source_t *source) { int ret = 0; diff --git a/exec/main.h b/exec/main.h index 8b116745..a0a5c968 100644 --- a/exec/main.h +++ b/exec/main.h @@ -62,6 +62,6 @@ extern int main_mcast ( extern void message_source_set (mar_message_source_t *source, void *conn); -extern int message_source_is_local (mar_message_source_t *source); +extern int message_source_is_local (const mar_message_source_t *source); #endif /* MAIN_H_DEFINED */ diff --git a/include/corosync/engine/coroapi.h b/include/corosync/engine/coroapi.h index 7d597f05..cb46ce26 100644 --- a/include/corosync/engine/coroapi.h +++ b/include/corosync/engine/coroapi.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008 Red Hat, Inc. + * Copyright (c) 2008, 2009 Red Hat, Inc. * * All rights reserved. * @@ -386,7 +386,7 @@ struct corosync_api_v1 { */ void (*ipc_source_set) (mar_message_source_t *source, void *conn); - int (*ipc_source_is_local) (mar_message_source_t *source); + int (*ipc_source_is_local) (const mar_message_source_t *source); void *(*ipc_private_data_get) (void *conn); @@ -557,7 +557,7 @@ struct corosync_lib_handler { }; struct corosync_exec_handler { - void (*exec_handler_fn) (void *msg, unsigned int nodeid); + void (*exec_handler_fn) (const void *msg, unsigned int nodeid); void (*exec_endian_convert_fn) (void *msg); }; diff --git a/services/cpg.c b/services/cpg.c index ae1a6654..7cedcd6c 100644 --- a/services/cpg.c +++ b/services/cpg.c @@ -131,11 +131,11 @@ static int cpg_lib_init_fn (void *conn); static int cpg_lib_exit_fn (void *conn); static void message_handler_req_exec_cpg_procjoin ( - void *message, + const void *message, unsigned int nodeid); static void message_handler_req_exec_cpg_procleave ( - void *message, + const void *message, unsigned int nodeid); static void message_handler_req_exec_cpg_joinlist ( @@ -143,11 +143,11 @@ static void message_handler_req_exec_cpg_joinlist ( unsigned int nodeid); static void message_handler_req_exec_cpg_mcast ( - void *message, + const void *message, unsigned int nodeid); static void message_handler_req_exec_cpg_downlist ( - void *message, + const void *message, unsigned int nodeid); static void exec_cpg_procjoin_endian_convert (void *msg); @@ -780,10 +780,10 @@ local_join: } static void message_handler_req_exec_cpg_downlist ( - void *message, + const void *message, unsigned int nodeid) { - struct req_exec_cpg_downlist *req_exec_cpg_downlist = (struct req_exec_cpg_downlist *)message; + const struct req_exec_cpg_downlist *req_exec_cpg_downlist = message; int i; struct list_head removed_list; @@ -813,10 +813,10 @@ static void message_handler_req_exec_cpg_downlist ( } static void message_handler_req_exec_cpg_procjoin ( - void *message, + const void *message, unsigned int nodeid) { - struct req_exec_cpg_procjoin *req_exec_cpg_procjoin = (struct req_exec_cpg_procjoin *)message; + const struct req_exec_cpg_procjoin *req_exec_cpg_procjoin = message; log_printf(LOG_LEVEL_DEBUG, "got procjoin message from cluster node %d\n", nodeid); @@ -826,10 +826,10 @@ static void message_handler_req_exec_cpg_procjoin ( } static void message_handler_req_exec_cpg_procleave ( - void *message, + const void *message, unsigned int nodeid) { - struct req_exec_cpg_procjoin *req_exec_cpg_procjoin = (struct req_exec_cpg_procjoin *)message; + const struct req_exec_cpg_procjoin *req_exec_cpg_procjoin = message; struct group_info *gi; struct process_info *pi; struct list_head *iter; @@ -895,10 +895,10 @@ static void message_handler_req_exec_cpg_joinlist ( } static void message_handler_req_exec_cpg_mcast ( - void *message, + const void *message, unsigned int nodeid) { - struct req_exec_cpg_mcast *req_exec_cpg_mcast = (struct req_exec_cpg_mcast *)message; + const struct req_exec_cpg_mcast *req_exec_cpg_mcast = message; struct res_lib_cpg_deliver_callback *res_lib_cpg_mcast; int msglen = req_exec_cpg_mcast->msglen; char buf[sizeof(*res_lib_cpg_mcast) + msglen]; @@ -922,8 +922,8 @@ static void message_handler_req_exec_cpg_mcast ( } memcpy(&res_lib_cpg_mcast->group_name, &gi->group_name, sizeof(mar_cpg_name_t)); - memcpy(&res_lib_cpg_mcast->message, (char*)message+sizeof(*req_exec_cpg_mcast), - msglen); + memcpy(&res_lib_cpg_mcast->message, + (const char*)message+sizeof(*req_exec_cpg_mcast), msglen); /* Send to all interested members */ for (iter = gi->members.next; iter != &gi->members; iter = iter->next) {