From 3c9f0952ada40ad99257601ff7146a9423544bb1 Mon Sep 17 00:00:00 2001 From: Veniamin Gvozdikov <vgvozdikov@tarantool.org> Date: Thu, 17 Oct 2013 17:45:32 +0000 Subject: [PATCH] Fix #84: Incompatible pointer types in connector --- connector/c/tnt/tnt_call.c | 6 +++--- connector/c/tnt/tnt_delete.c | 4 ++-- connector/c/tnt/tnt_insert.c | 4 ++-- connector/c/tnt/tnt_ping.c | 2 +- connector/c/tnt/tnt_request.c | 22 +++++++++++----------- connector/c/tnt/tnt_select.c | 6 +++--- connector/c/tnt/tnt_update.c | 10 +++++----- 7 files changed, 27 insertions(+), 27 deletions(-) diff --git a/connector/c/tnt/tnt_call.c b/connector/c/tnt/tnt_call.c index e561839f93..fbaeabd77c 100644 --- a/connector/c/tnt/tnt_call.c +++ b/connector/c/tnt/tnt_call.c @@ -74,9 +74,9 @@ tnt_call(struct tnt_stream *s, uint32_t flags, const char *proc, hdr_call.flags = flags; /* writing data to stream */ struct iovec v[5]; - v[0].iov_base = &hdr; + v[0].iov_base = (void *)&hdr; v[0].iov_len = sizeof(struct tnt_header); - v[1].iov_base = &hdr_call; + v[1].iov_base = (void *)&hdr_call; v[1].iov_len = sizeof(struct tnt_header_call); v[2].iov_base = proc_enc; v[2].iov_len = proc_enc_size; @@ -84,7 +84,7 @@ tnt_call(struct tnt_stream *s, uint32_t flags, const char *proc, v[3].iov_len = proc_len; uint32_t argc = 0; if (args->size == 0) { - v[4].iov_base = &argc; + v[4].iov_base = (void *)&argc; v[4].iov_len = 4; } else { v[4].iov_base = args->data; diff --git a/connector/c/tnt/tnt_delete.c b/connector/c/tnt/tnt_delete.c index 75a4cf87e4..0fec8ec217 100644 --- a/connector/c/tnt/tnt_delete.c +++ b/connector/c/tnt/tnt_delete.c @@ -65,9 +65,9 @@ tnt_delete(struct tnt_stream *s, uint32_t ns, uint32_t flags, struct tnt_tuple * hdr_del.flags = flags; /* writing data to stream */ struct iovec v[3]; - v[0].iov_base = &hdr; + v[0].iov_base = (void *)&hdr; v[0].iov_len = sizeof(struct tnt_header); - v[1].iov_base = &hdr_del; + v[1].iov_base = (void *)&hdr_del; v[1].iov_len = sizeof(struct tnt_header_delete); v[2].iov_base = k->data; v[2].iov_len = k->size; diff --git a/connector/c/tnt/tnt_insert.c b/connector/c/tnt/tnt_insert.c index 91d99d821c..4fcfbca408 100644 --- a/connector/c/tnt/tnt_insert.c +++ b/connector/c/tnt/tnt_insert.c @@ -66,9 +66,9 @@ tnt_insert(struct tnt_stream *s, uint32_t ns, uint32_t flags, hdr_insert.flags = flags; /* writing data to stream */ struct iovec v[3]; - v[0].iov_base = &hdr; + v[0].iov_base = (void *)&hdr; v[0].iov_len = sizeof(struct tnt_header); - v[1].iov_base = &hdr_insert; + v[1].iov_base = (void *)&hdr_insert; v[1].iov_len = sizeof(struct tnt_header_insert); v[2].iov_base = kv->data; v[2].iov_len = kv->size; diff --git a/connector/c/tnt/tnt_ping.c b/connector/c/tnt/tnt_ping.c index b3fe1f43dc..15fb4bae20 100644 --- a/connector/c/tnt/tnt_ping.c +++ b/connector/c/tnt/tnt_ping.c @@ -58,7 +58,7 @@ tnt_ping(struct tnt_stream *s) hdr.reqid = s->reqid; /* writing data to stream */ struct iovec v[1]; - v[0].iov_base = &hdr; + v[0].iov_base = (void*)&hdr; v[0].iov_len = sizeof(struct tnt_header); return s->writev(s, v, 1); } diff --git a/connector/c/tnt/tnt_request.c b/connector/c/tnt/tnt_request.c index b371a695ab..55891354cc 100644 --- a/connector/c/tnt/tnt_request.c +++ b/connector/c/tnt/tnt_request.c @@ -146,9 +146,9 @@ tnt_request_insert(struct tnt_request *r, tnt_request_t rcv, void *ptr) tnt_mem_free(buf); return -1; } - r->v[0].iov_base = &r->h; + r->v[0].iov_base = (void *)&r->h; r->v[0].iov_len = sizeof(struct tnt_header); - r->v[1].iov_base = &r->r.insert.h; + r->v[1].iov_base = (void *)&r->r.insert.h; r->v[1].iov_len = sizeof(struct tnt_header_insert); r->v[2].iov_base = r->r.insert.t.data; r->v[2].iov_len = r->r.insert.t.size; @@ -181,9 +181,9 @@ tnt_request_delete_1_3(struct tnt_request *r, tnt_request_t rcv, void *ptr) tnt_mem_free(buf); return -1; } - r->v[0].iov_base = &r->h; + r->v[0].iov_base = (void *)&r->h; r->v[0].iov_len = sizeof(struct tnt_header); - r->v[1].iov_base = &r->r.del_1_3.h; + r->v[1].iov_base = (void *)&r->r.del_1_3.h; r->v[1].iov_len = sizeof(struct tnt_header_delete_1_3); r->v[2].iov_base = r->r.del_1_3.t.data; r->v[2].iov_len = r->r.del_1_3.t.size; @@ -216,9 +216,9 @@ tnt_request_delete(struct tnt_request *r, tnt_request_t rcv, void *ptr) tnt_mem_free(buf); return -1; } - r->v[0].iov_base = &r->h; + r->v[0].iov_base = (void *)&r->h; r->v[0].iov_len = sizeof(struct tnt_header); - r->v[1].iov_base = &r->r.del.h; + r->v[1].iov_base = (void *)&r->r.del.h; r->v[1].iov_len = sizeof(struct tnt_header_delete); r->v[2].iov_base = r->r.del.t.data; r->v[2].iov_len = r->r.del.t.size; @@ -260,9 +260,9 @@ tnt_request_call(struct tnt_request *r, tnt_request_t rcv, void *ptr) r->v = tnt_mem_alloc(r->vc * sizeof(struct iovec)); if (r->v == NULL) goto error; - r->v[0].iov_base = &r->h; + r->v[0].iov_base = (void *)&r->h; r->v[0].iov_len = sizeof(struct tnt_header); - r->v[1].iov_base = &r->r.call.h; + r->v[1].iov_base = (void *)&r->r.call.h; r->v[1].iov_len = sizeof(struct tnt_header_call); r->v[2].iov_base = r->r.call.proc_enc; r->v[2].iov_len = r->r.call.proc_enc_len; @@ -391,13 +391,13 @@ tnt_request_update(struct tnt_request *r, tnt_request_t rcv, void *ptr) r->v = tnt_mem_alloc(r->vc * sizeof(struct iovec)); if (r->v == NULL) goto error; - r->v[0].iov_base = &r->h; + r->v[0].iov_base = (void *)&r->h; r->v[0].iov_len = sizeof(struct tnt_header); - r->v[1].iov_base = &r->r.update.h; + r->v[1].iov_base = (void *)&r->r.update.h; r->v[1].iov_len = sizeof(struct tnt_header_update); r->v[2].iov_base = r->r.update.t.data; r->v[2].iov_len = r->r.update.t.size; - r->v[3].iov_base = &r->r.update.opc; + r->v[3].iov_base = (void *)&r->r.update.opc; r->v[3].iov_len = 4; r->v[4].iov_base = r->r.update.ops; r->v[4].iov_len = r->r.update.ops_size; diff --git a/connector/c/tnt/tnt_select.c b/connector/c/tnt/tnt_select.c index c8509e1732..3e3c51c42e 100644 --- a/connector/c/tnt/tnt_select.c +++ b/connector/c/tnt/tnt_select.c @@ -88,11 +88,11 @@ tnt_select(struct tnt_stream *s, return -1; } /* filling write vector */ - v[0].iov_base = &hdr; + v[0].iov_base = (void *)&hdr; v[0].iov_len = sizeof(struct tnt_header); - v[1].iov_base = &hdr_sel; + v[1].iov_base = (void *)&hdr_sel; v[1].iov_len = sizeof(struct tnt_header_select); - v[2].iov_base = &keys->count; + v[2].iov_base = (void *)&keys->count; v[2].iov_len = 4; int vi = 3; tnt_rewind(&i); diff --git a/connector/c/tnt/tnt_update.c b/connector/c/tnt/tnt_update.c index 265a2d040c..53b3989945 100644 --- a/connector/c/tnt/tnt_update.c +++ b/connector/c/tnt/tnt_update.c @@ -53,10 +53,10 @@ tnt_update_op(struct tnt_stream *s, struct iovec iov[4]; int iovc = 3; /* field */ - iov[0].iov_base = &field; + iov[0].iov_base = (void *)&field; iov[0].iov_len = 4; /* operation */ - iov[1].iov_base = &op; + iov[1].iov_base = (void *)&op; iov[1].iov_len = 1; /* encoding size */ iov[2].iov_base = enc; @@ -248,13 +248,13 @@ tnt_update(struct tnt_stream *s, uint32_t ns, uint32_t flags, hdr_update.flags = flags; /* writing data to stream */ struct iovec v[5]; - v[0].iov_base = &hdr; + v[0].iov_base = (void *)&hdr; v[0].iov_len = sizeof(struct tnt_header); - v[1].iov_base = &hdr_update; + v[1].iov_base = (void *)&hdr_update; v[1].iov_len = sizeof(struct tnt_header_update); v[2].iov_base = k->data; v[2].iov_len = k->size; - v[3].iov_base = &ops->wrcnt; + v[3].iov_base = (void *)&ops->wrcnt; v[3].iov_len = 4; v[4].iov_base = TNT_SBUF_DATA(ops); v[4].iov_len = TNT_SBUF_SIZE(ops); -- GitLab