diff options
author | Joe Stringer <joe@ovn.org> | 2016-03-03 21:22:51 +1300 |
---|---|---|
committer | Joe Stringer <joe@ovn.org> | 2016-03-03 13:55:07 -0800 |
commit | c391558c30d7d7eb5c20da3ba0cd4700b6890962 (patch) | |
tree | de74a4fb0f6ebbe8cf3931d8161a96dc606d11bc /lib/ofpbuf.c | |
parent | 5308056f53406e75d211f73a2847f9ebdf9c91c8 (diff) | |
download | openvswitch-c391558c30d7d7eb5c20da3ba0cd4700b6890962.tar.gz |
ofpbuf: Use ptrdiff_t for pointer delta.
Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
Diffstat (limited to 'lib/ofpbuf.c')
-rw-r--r-- | lib/ofpbuf.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/ofpbuf.c b/lib/ofpbuf.c index a3c4da4bc..02c9d15f8 100644 --- a/lib/ofpbuf.c +++ b/lib/ofpbuf.c @@ -183,8 +183,7 @@ ofpbuf_clone_with_headroom(const struct ofpbuf *buffer, size_t headroom) buffer->size, headroom); if (buffer->header) { - uintptr_t data_delta - = (char *)new_buffer->data - (char *)buffer->data; + ptrdiff_t data_delta = (char *)new_buffer->data - (char *)buffer->data; new_buffer->header = (char *) buffer->header + data_delta; } @@ -267,12 +266,12 @@ ofpbuf_resize__(struct ofpbuf *b, size_t new_headroom, size_t new_tailroom) new_data = (char *) new_base + new_headroom; if (b->data != new_data) { if (b->header) { - uintptr_t data_delta = (char *) b->header - (char *) b->data; + ptrdiff_t data_delta = (char *) b->header - (char *) b->data; b->header = (char *) new_data + data_delta; } if (b->msg) { - uintptr_t data_delta = (char *) b->msg - (char *) b->data; + ptrdiff_t data_delta = (char *) b->msg - (char *) b->data; b->msg = (char *) new_data + data_delta; } |