From e524edd8a428111acc97ed5f82a67a5634221d8e Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 7 Apr 2014 18:05:19 +0200 Subject: fix warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/passphrase.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/passphrase.c b/src/passphrase.c index 2098b31..679e1fa 100644 --- a/src/passphrase.c +++ b/src/passphrase.c @@ -158,7 +158,10 @@ char* passphrase_read(void) c = (char)cc; if (point == len) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" xputchar(c); +#pragma GCC diagnostic pop *(rc + len++) = c; point++; } @@ -170,7 +173,10 @@ char* passphrase_read(void) { if ((c & 0xC0) != 0x80) { xprintf("\033[@"); } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" xputchar(c); +#pragma GCC diagnostic pop for (i = len; i > point; i--) *(rc + i) = *(rc + i - 1); len++; @@ -195,10 +201,10 @@ char* passphrase_read(void) cn <<= 1; n++; } - n = n ?: 1; + n = n ? n : 1; if (len + n > size) { - if ((rc = xrealloc(rc, size, size << 1L)) == NULL) + if ((rc = xrealloc(rc, (size_t)size, (size_t)size << 1L)) == NULL) return NULL; size <<= 1L; } @@ -209,7 +215,10 @@ char* passphrase_read(void) { if (i) c = getchar(); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" xputchar(c); +#pragma GCC diagnostic pop *(rc + point++) = c; } } -- cgit v1.2.3-70-g09d2