summaryrefslogtreecommitdiff
path: root/lib/ofpbuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ofpbuf.c')
-rw-r--r--lib/ofpbuf.c7
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;
}