From 7a568308dae494d2b8e866bc5ee664535a69c9e2 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 9 Sep 2015 20:58:08 -0700 Subject: linenoise: fix g++ signed/unsigned warning. * linenoise/linenoise.c (sync_data_to_buf): Cast l->dpos to the signed type ptrdiff_t when comparing to difference between two pointers. --- linenoise/linenoise.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'linenoise') diff --git a/linenoise/linenoise.c b/linenoise/linenoise.c index 791d99ed..0f220512 100644 --- a/linenoise/linenoise.c +++ b/linenoise/linenoise.c @@ -43,6 +43,7 @@ #include #include +#include #include #include #include @@ -403,7 +404,7 @@ static void sync_data_to_buf(lino_t *l) char *dptr = l->data, *bptr = l->buf; for (;;) { - if (dptr - l->data == l->dpos) + if (dptr - l->data == (ptrdiff_t) l->dpos) l->pos = bptr - l->buf; if (*dptr) { -- cgit v1.2.3