]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[window] Fix signedness confusion
authorRay Strode <rstrode@redhat.com>
Thu, 6 Aug 2009 02:48:16 +0000 (22:48 -0400)
committerRay Strode <rstrode@redhat.com>
Thu, 6 Aug 2009 02:49:12 +0000 (22:49 -0400)
src/libplybootsplash/ply-window.c

index 9fca3eb98e59a6eb182040ab0e268d52a01c2f5a..0d12da170c3aa30284b8f26b59a38c652761b3c5 100644 (file)
@@ -227,7 +227,7 @@ ply_window_reset_colors (ply_window_t *window)
 static void
 process_backspace (ply_window_t *window)
 {
-  ssize_t bytes_to_remove;
+  size_t bytes_to_remove;
   ssize_t previous_character_size;
   const char *bytes;
   size_t size;
@@ -237,7 +237,7 @@ process_backspace (ply_window_t *window)
   size = ply_buffer_get_size (window->line_buffer);
 
   bytes_to_remove = MIN(size, PLY_UTF8_CHARACTER_SIZE_MAX);
-  while ((previous_character_size = ply_utf8_character_get_size (bytes + size - bytes_to_remove, bytes_to_remove)) < bytes_to_remove)
+  while ((previous_character_size = ply_utf8_character_get_size (bytes + size - bytes_to_remove, bytes_to_remove)) < (ssize_t) bytes_to_remove)
     {
       if (previous_character_size > 0)
         bytes_to_remove -= previous_character_size;
@@ -787,7 +787,7 @@ ply_window_get_color_hex_value (ply_window_t       *window,
   uint32_t hex_value;
 
   assert (window != NULL);
-  assert (color >= 0 && color <= PLY_WINDOW_COLOR_WHITE);
+  assert (color <= PLY_WINDOW_COLOR_WHITE);
 
   red = (uint8_t) *(window->color_palette + 3 * color);
   green = (uint8_t) *(window->color_palette + 3 * color + 1);
@@ -806,7 +806,7 @@ ply_window_set_color_hex_value (ply_window_t       *window,
   uint8_t red, green, blue;
 
   assert (window != NULL);
-  assert (color >= 0 && color <= PLY_WINDOW_COLOR_WHITE);
+  assert (color <= PLY_WINDOW_COLOR_WHITE);
 
   red = (uint8_t) ((hex_value >> 16) & 0xff);
   green = (uint8_t) ((hex_value >> 8) & 0xff);