]> rtime.felk.cvut.cz Git - frescor/fwp.git/commitdiff
Fixed const qualifiers
authorMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 6 Nov 2009 14:10:30 +0000 (15:10 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 6 Nov 2009 14:10:30 +0000 (15:10 +0100)
fwp/lib/fwp/fwp_endpoint.c
fwp/lib/fwp/fwp_endpoint.h
fwp/lib/fwp/fwp_vres.c
fwp/lib/fwp/fwp_vres.h

index 56964aadb8745ac0edb7247d858de500324c6acc..7eb7d0b7fb70086f3e71b25c44580bb6b5f3da84 100644 (file)
@@ -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;
 
index 8ddee25b81add6a89d04b603aa67c80fdb0293a3..c8a298f68f49e6ce704f72d6679da7be3899344a 100644 (file)
@@ -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, 
index 1177a4eb1ffa5b931f1cbe0c983ec605ced15a1e..64c5a70ad124e20c89092a839b8e8c6929a190c4 100644 (file)
@@ -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;
index 4d36ffb1b4c351ed223bfe4e4b9cbaff50a2b0fd..62561f56ea66fce1139133f716c3980960114723 100644 (file)
@@ -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);