Fix various warnings turned up with -Wall. After fixing these remaining
issues, plymouth now builds successfully with gcc 4.8 using
"-Werror -Wno-error=unused-result -Wno-error=sign-compare".
const char *default_tty,
bool should_add_displays);
static void toggle_between_splash_and_details (state_t *state);
+#ifdef PLY_ENABLE_SYSTEMD_INTEGRATION
static void tell_systemd_to_print_details (state_t *state);
static void tell_systemd_to_stop_printing_details (state_t *state);
+#endif
static const char * get_cache_file_for_mode (ply_mode_t mode);
static void
case PLY_BOOT_SPLASH_MODE_UPDATES:
obj = script_obj_new_string ("updates");
break;
+ case PLY_BOOT_SPLASH_MODE_INVALID:
default:
obj = script_obj_new_string ("unknown");
break;
#include <stdbool.h>
#include <unistd.h>
#include <string.h>
+#include <limits.h>
#include "ply-bitarray.h"
#include "script-scan.h"
{
int i;
- if (scan->tokencount <= n)
+ /* we're screwed long before we ever actually hit INT_MAX; but at least
+ * we shouldn't get ourselves stuck in an infinite loop. */
+ if (scan->tokencount <= n && n < INT_MAX)
{
scan->tokens =
realloc (scan->tokens, (n + 1) * sizeof (script_scan_token_t *));
- for (i = scan->tokencount; i <= n; i++) /* FIXME warning about possibely inifnite loop */
+ for (i = scan->tokencount; i <= n; i++)
{
scan->tokens[i] = malloc (sizeof (script_scan_token_t));
scan->tokens[i]->type = SCRIPT_SCAN_TOKEN_TYPE_EMPTY;