[yocto] [psplash][PATCH 2/5] psplash-fb: fix sign-compare warning

Richard Leitner richard.leitner at skidata.com
Thu Apr 14 03:58:34 PDT 2016


Cast font->index[i] to wchar_t for the comparison.

This fixes following sign-compare warning:

psplash-fb.c: In function 'psplash_font_glyph':
psplash-fb.c:452:33: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]

Signed-off-by: Richard Leitner <richard.leitner at skidata.com>
---
 psplash-fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/psplash-fb.c b/psplash-fb.c
index 38cd6a4..cdcbc19 100644
--- a/psplash-fb.c
+++ b/psplash-fb.c
@@ -449,7 +449,7 @@ psplash_font_glyph (const PSplashFont *font, wchar_t wc, u_int32_t **bitmap)
     {
       for (i = font->offset[wc & mask]; font->index[i]; i += 2)
 	{
-	  if ((font->index[i] & ~mask) == (wc & ~mask))
+	  if ((wchar_t)(font->index[i] & ~mask) == (wc & ~mask))
 	    {
 	      if (bitmap != NULL)
 		*bitmap = &font->content[font->index[i+1]];
-- 
2.1.4




More information about the yocto mailing list