From 803a5bf22ad8f34e693cb4e8ab853d22df169c9e Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Fri, 6 Nov 2009 15:10:30 +0100 Subject: [PATCH] Fixed const qualifiers --- fwp/lib/fwp/fwp_endpoint.c | 8 ++++---- fwp/lib/fwp/fwp_endpoint.h | 6 +++--- fwp/lib/fwp/fwp_vres.c | 3 ++- fwp/lib/fwp/fwp_vres.h | 3 ++- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/fwp/lib/fwp/fwp_endpoint.c b/fwp/lib/fwp/fwp_endpoint.c index 56964aa..7eb7d0b 100644 --- a/fwp/lib/fwp/fwp_endpoint.c +++ b/fwp/lib/fwp/fwp_endpoint.c @@ -578,14 +578,14 @@ ssize_t fwp_recv(struct fwp_endpoint *ep, * @return */ ssize_t fwp_endpoint_do_send(struct fwp_endpoint *ep, - void *data, const size_t size) + const void *data, const size_t size) { struct iovec iov; struct msghdr msg = {0}; ssize_t ret; char cmsg_buf[CMSG_SPACE(sizeof(struct in_pktinfo))]; - iov.iov_base = data; + iov.iov_base = (void*)data; iov.iov_len = size; msg.msg_iov = &iov; @@ -625,7 +625,7 @@ ssize_t fwp_endpoint_do_send(struct fwp_endpoint *ep, * On error, -1 is returned and errno is set appropriately. * */ -int fwp_send_async(struct fwp_endpoint *ep, void *msg, size_t size) +int fwp_send_async(struct fwp_endpoint *ep, const void *msg, size_t size) { int ret; @@ -639,7 +639,7 @@ int fwp_send_async(struct fwp_endpoint *ep, void *msg, size_t size) return ret; } -int fwp_send_sync(struct fwp_endpoint *ep, void *msg, size_t size) +int fwp_send_sync(struct fwp_endpoint *ep, const void *msg, size_t size) { int ret; diff --git a/fwp/lib/fwp/fwp_endpoint.h b/fwp/lib/fwp/fwp_endpoint.h index 8ddee25..c8a298f 100644 --- a/fwp/lib/fwp/fwp_endpoint.h +++ b/fwp/lib/fwp/fwp_endpoint.h @@ -86,10 +86,10 @@ int fwp_send_endpoint_unbind(struct fwp_endpoint *ep); ssize_t fwp_recv(struct fwp_endpoint *ep, void *buffer, const size_t buffer_size, unsigned int *from, int flags); -int fwp_send_sync(struct fwp_endpoint *ep, void *msg, const size_t size); -int fwp_send_async(struct fwp_endpoint *ep, void *msg, const size_t size); +int fwp_send_sync(struct fwp_endpoint *ep, const void *msg, const size_t size); +int fwp_send_async(struct fwp_endpoint *ep, const void *msg, const size_t size); ssize_t fwp_endpoint_do_send(struct fwp_endpoint *ep, - void *data, const size_t size); + const void *data, const size_t size); int fwp_endpoint_attr_init(fwp_endpoint_attr_t *attr); static inline int fwp_endpoint_attr_setreliability(fwp_endpoint_attr_t *attr, diff --git a/fwp/lib/fwp/fwp_vres.c b/fwp/lib/fwp/fwp_vres.c index 1177a4e..64c5a70 100644 --- a/fwp/lib/fwp/fwp_vres.c +++ b/fwp/lib/fwp/fwp_vres.c @@ -424,7 +424,8 @@ int fwp_vres_consume_budget(struct fwp_vres *vres, size_t size, bool can_block) return ret; } -int fwp_vres_enqueue(struct fwp_vres *vres, struct fwp_endpoint *ep, void *msg, size_t size) +int fwp_vres_enqueue(struct fwp_vres *vres, struct fwp_endpoint *ep, + const void *msg, size_t size) { struct fwp_msgb *msgb; int ret; diff --git a/fwp/lib/fwp/fwp_vres.h b/fwp/lib/fwp/fwp_vres.h index 4d36ffb..62561f5 100644 --- a/fwp/lib/fwp/fwp_vres.h +++ b/fwp/lib/fwp/fwp_vres.h @@ -95,7 +95,8 @@ int fwp_vres_destroy(fwp_vres_t *vres); int fwp_vres_consume_budget(struct fwp_vres *vres, size_t size, bool can_block); struct fwp_endpoint; -int fwp_vres_enqueue(struct fwp_vres *vres, struct fwp_endpoint *ep, void *msg, size_t size); +int fwp_vres_enqueue(struct fwp_vres *vres, struct fwp_endpoint *ep, + const void *msg, size_t size); int fwp_vres_bind(fwp_vres_t *vres, struct fwp_endpoint *ep, int sockd); int fwp_vres_unbind(fwp_vres_t *vres); -- 2.39.2