From: Graham Percival Date: Thu, 8 Dec 2011 11:05:32 +0000 (-0800) Subject: Avoid conversion changing signedness X-Git-Tag: release/2.15.22-1~11 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=3540adb8b1fc55709776c9cf971e5ccefc22388a;p=lilypond.git Avoid conversion changing signedness /home/gperciva/src/lilypond/flower/file-cookie.cc:45:50: error: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Werror,-Wsign-conversion] return Memory_out_stream::writer (file, buf, i); ~~~~~~~~~~~~~~~~~ ^ --- diff --git a/flower/file-cookie.cc b/flower/file-cookie.cc index 90aa5c908d..762acb1c06 100644 --- a/flower/file-cookie.cc +++ b/flower/file-cookie.cc @@ -39,10 +39,10 @@ extern "C" { static char buf[65536]; int i = vsnprintf (buf, sizeof (buf), format, ap); - if (i == -1 || (unsigned) i > sizeof (buf)) + if (i < 0 || (unsigned) i > sizeof (buf)) assert (false); va_end (ap); - return Memory_out_stream::writer (file, buf, i); + return Memory_out_stream::writer (file, buf, (unsigned)i); } ssize_t