<div dir="ltr">Thanks, pushed!<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 28, 2013 at 6:53 PM, Steve Langasek <span dir="ltr"><<a href="mailto:steve.langasek@canonical.com" target="_blank">steve.langasek@canonical.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From a38267d05a9621ef8b1e1a53152338026266b523 Mon Sep 17 00:00:00 2001<br>
From: Steve Langasek <<a href="mailto:steve.langasek@canonical.com">steve.langasek@canonical.com</a>><br>
Date: Fri, 28 Jun 2013 14:29:15 -0700<br>
Subject: [PATCH] Miscellaneous fixes for compiler warnings<br>
<br>
Fix various warnings turned up with -Wall.  After fixing these remaining<br>
issues, plymouth now builds successfully with gcc 4.8 using<br>
"-Werror -Wno-error=unused-result -Wno-error=sign-compare".<br>
---<br>
 src/main.c                                      | 2 ++<br>
 src/plugins/splash/script/script-lib-plymouth.c | 1 +<br>
 src/plugins/splash/script/script-scan.c         | 7 +++++--<br>
 3 files changed, 8 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/main.c b/src/main.c<br>
index 2a9c84d..81584a5 100644<br>
--- a/src/main.c<br>
+++ b/src/main.c<br>
@@ -150,8 +150,10 @@ static void check_for_consoles (state_t    *state,<br>
                                 const char *default_tty,<br>
                                 bool        should_add_displays);<br>
 static void toggle_between_splash_and_details (state_t *state);<br>
+#ifdef PLY_ENABLE_SYSTEMD_INTEGRATION<br>
 static void tell_systemd_to_print_details (state_t *state);<br>
 static void tell_systemd_to_stop_printing_details (state_t *state);<br>
+#endif<br>
 static const char * get_cache_file_for_mode (ply_mode_t mode);<br>
<br>
 static void<br>
diff --git a/src/plugins/splash/script/script-lib-plymouth.c b/src/plugins/splash/script/script-lib-plymouth.c<br>
index 7f143ae..ab2ec44 100644<br>
--- a/src/plugins/splash/script/script-lib-plymouth.c<br>
+++ b/src/plugins/splash/script/script-lib-plymouth.c<br>
@@ -64,6 +64,7 @@ static script_return_t plymouth_get_mode (script_state_t *state,<br>
       case PLY_BOOT_SPLASH_MODE_UPDATES:<br>
         obj = script_obj_new_string ("updates");<br>
         break;<br>
+      case PLY_BOOT_SPLASH_MODE_INVALID:<br>
       default:<br>
         obj = script_obj_new_string ("unknown");<br>
         break;<br>
diff --git a/src/plugins/splash/script/script-scan.c b/src/plugins/splash/script/script-scan.c<br>
index 3efef48..5d1aa64 100644<br>
--- a/src/plugins/splash/script/script-scan.c<br>
+++ b/src/plugins/splash/script/script-scan.c<br>
@@ -30,6 +30,7 @@<br>
 #include <stdbool.h><br>
 #include <unistd.h><br>
 #include <string.h><br>
+#include <limits.h><br>
<br>
 #include "ply-bitarray.h"<br>
 #include "script-scan.h"<br>
@@ -371,11 +372,13 @@ static script_scan_token_t *script_scan_peek_token (script_scan_t *scan,<br>
 {<br>
   int i;<br>
<br>
-  if (scan->tokencount <= n)<br>
+  /* we're screwed long before we ever actually hit INT_MAX; but at least<br>
+   * we shouldn't get ourselves stuck in an infinite loop. */<br>
+  if (scan->tokencount <= n && n < INT_MAX)<br>
     {<br>
       scan->tokens =<br>
         realloc (scan->tokens, (n + 1) * sizeof (script_scan_token_t *));<br>
-      for (i = scan->tokencount; i <= n; i++)                                   /* FIXME warning about possibely inifnite loop */<br>
+      for (i = scan->tokencount; i <= n; i++)<br>
         {<br>
           scan->tokens[i] = malloc (sizeof (script_scan_token_t));<br>
           scan->tokens[i]->type = SCRIPT_SCAN_TOKEN_TYPE_EMPTY;<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.3.1<br>
</font></span><br>_______________________________________________<br>
plymouth mailing list<br>
<a href="mailto:plymouth@lists.freedesktop.org">plymouth@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/plymouth" target="_blank">http://lists.freedesktop.org/mailman/listinfo/plymouth</a><br>
<br></blockquote></div><br></div>