From 2897f29a10ba95a96af2139b982ddaddfd49a60d Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sun, 23 Jan 2011 15:40:18 +0100 Subject: cfdisk: data type mismatch, and other, compiler warning fixes Following warnings will longer appear when one will compile with gcc flags -Wall -Wextra -pedantic cfdisk.c:475:3: warning: comparison of unsigned expression < 0 is always false cfdisk.c:487:16: warning: comparison between signed and unsigned integer expressions cfdisk.c:492:14: warning: comparison between signed and unsigned integer expressions cfdisk.c:565:19: warning: comparison between signed and unsigned integer expressions cfdisk.c:569:19: warning: comparison between signed and unsigned integer expressions cfdisk.c:1070:14: warning: comparison between signed and unsigned integer expressions cfdisk.c:1568:5: warning: missing initializer cfdisk.c:1568:5: warning: (near initialization for 'tmp_ext.volume_label') mbsalign.c:131:2: warning: comparison of unsigned expression >= 0 is always true Signed-off-by: Sami Kerola --- lib/mbsalign.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/mbsalign.c b/lib/mbsalign.c index 82ffc09c..468e35b5 100644 --- a/lib/mbsalign.c +++ b/lib/mbsalign.c @@ -106,12 +106,12 @@ rpl_wcswidth (const wchar_t *s, size_t n) size_t mbs_truncate(char *str, size_t *width) { - size_t bytes = strlen(str); + ssize_t bytes = strlen(str); #ifdef HAVE_WIDECHAR - size_t sz = mbstowcs(NULL, str, 0); + ssize_t sz = mbstowcs(NULL, str, 0); wchar_t *wcs = NULL; - if (sz == (size_t) -1) + if (sz == (ssize_t) -1) goto done; wcs = malloc((sz + 1) * sizeof(wchar_t)); -- cgit v1.2.3