]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[script] Fix some compile warnings
authorCharlie Brej <cbrej@cs.man.ac.uk>
Wed, 8 Jul 2009 10:02:10 +0000 (11:02 +0100)
committerCharlie Brej <cbrej@cs.man.ac.uk>
Wed, 8 Jul 2009 10:02:10 +0000 (11:02 +0100)
Fixed by making most plugin functions static as they dont get linked from
outside anyway. Also changed some char* to const char*.

src/plugins/splash/script/plugin.c
src/plugins/splash/script/ply-scan.c
src/plugins/splash/script/script-lib-image.c
src/plugins/splash/script/script-object.h
src/plugins/splash/script/script-parse.c

index 8575914f710d20b3b48fd07e66db49de6012b93d..d20c2fef526ee252d55e31753d940fb538624a74 100644 (file)
@@ -96,6 +96,7 @@ static void remove_handlers (ply_boot_splash_plugin_t *plugin);
 static void detach_from_event_loop (ply_boot_splash_plugin_t *plugin);
 static void stop_animation (ply_boot_splash_plugin_t *plugin);
 ply_boot_splash_plugin_t *create_plugin (ply_key_file_t *key_file);
+ply_boot_splash_plugin_interface_t *ply_boot_splash_plugin_get_interface (void);
 
 ply_boot_splash_plugin_t *
 create_plugin (ply_key_file_t *key_file)
@@ -224,7 +225,7 @@ detach_from_event_loop (ply_boot_splash_plugin_t *plugin)
   plugin->loop = NULL;
 }
 
-void
+static void
 on_keyboard_input (ply_boot_splash_plugin_t *plugin,
                    const char               *keyboard_input,
                    size_t                    character_size)
@@ -239,16 +240,16 @@ on_keyboard_input (ply_boot_splash_plugin_t *plugin,
                                          keyboard_string);
 }
 
-void
+static void
 on_backspace (ply_boot_splash_plugin_t *plugin)
 {}
 
-void
+static void
 on_enter (ply_boot_splash_plugin_t *plugin,
           const char               *text)
 {}
 
-void
+static void
 on_draw (ply_boot_splash_plugin_t *plugin,
          int                       x,
          int                       y,
@@ -256,7 +257,7 @@ on_draw (ply_boot_splash_plugin_t *plugin,
          int                       height)
 {}
 
-void
+static void
 on_erase (ply_boot_splash_plugin_t *plugin,
           int                       x,
           int                       y,
@@ -292,21 +293,21 @@ remove_handlers (ply_boot_splash_plugin_t *plugin)
   ply_window_remove_enter_handler (plugin->window, (ply_window_enter_handler_t) on_enter);
 }
 
-void
+static void
 add_window (ply_boot_splash_plugin_t *plugin,
             ply_window_t             *window)
 {
   plugin->window = window;
 }
 
-void
+static void
 remove_window (ply_boot_splash_plugin_t *plugin,
                ply_window_t             *window)
 {
   plugin->window = NULL;
 }
 
-bool
+static bool
 show_splash_screen (ply_boot_splash_plugin_t *plugin,
                     ply_event_loop_t         *loop,
                     ply_buffer_t             *boot_buffer,
@@ -340,7 +341,7 @@ show_splash_screen (ply_boot_splash_plugin_t *plugin,
   return start_animation (plugin);
 }
 
-void
+static void
 update_status (ply_boot_splash_plugin_t *plugin,
                const char               *status)
 {
@@ -350,7 +351,7 @@ update_status (ply_boot_splash_plugin_t *plugin,
                                         status);
 }
 
-void
+static void
 hide_splash_screen (ply_boot_splash_plugin_t *plugin,
                     ply_event_loop_t         *loop)
 {
@@ -373,27 +374,28 @@ hide_splash_screen (ply_boot_splash_plugin_t *plugin,
   ply_window_set_mode (plugin->window, PLY_WINDOW_MODE_TEXT);
 }
 
-void
+static void
 on_root_mounted (ply_boot_splash_plugin_t *plugin)
 {
   script_lib_plymouth_on_root_mounted (plugin->script_state,
                                        plugin->script_plymouth_lib);
 }
 
-void
+static void
 become_idle (ply_boot_splash_plugin_t *plugin,
              ply_trigger_t            *idle_trigger)
 {
   ply_trigger_pull (idle_trigger, NULL);
 }
 
-void display_normal (ply_boot_splash_plugin_t *plugin)
+static void
+display_normal (ply_boot_splash_plugin_t *plugin)
 {
   script_lib_plymouth_on_display_normal (plugin->script_state,
                                          plugin->script_plymouth_lib);
 }
 
-void
+static void
 display_password (ply_boot_splash_plugin_t *plugin,
                   const char               *prompt,
                   int                       bullets)
@@ -404,7 +406,7 @@ display_password (ply_boot_splash_plugin_t *plugin,
                                            bullets);
 }
 
-void
+static void
 display_question (ply_boot_splash_plugin_t *plugin,
                   const char               *prompt,
                   const char               *entry_text)
index 1460f61f6603c653b52ba1c643a9b7aba495270e..cc08398c5472c1f7624a9446cae4c4c25de1d596 100644 (file)
@@ -27,6 +27,7 @@
 #include <assert.h>
 #include <stdbool.h>
 #include <unistd.h>
+#include <string.h>
 
 #define COLUMN_START_INDEX 0
 
@@ -86,11 +87,11 @@ void ply_scan_token_clean (ply_scan_token_t *token)
       case PLY_SCAN_TOKEN_TYPE_INTEGER:
       case PLY_SCAN_TOKEN_TYPE_FLOAT:
       case PLY_SCAN_TOKEN_TYPE_SYMBOL:
-      case PLY_SCAN_TOKEN_TYPE_ERROR:
         break;
       case PLY_SCAN_TOKEN_TYPE_IDENTIFIER:
       case PLY_SCAN_TOKEN_TYPE_STRING:
       case PLY_SCAN_TOKEN_TYPE_COMMENT:
+      case PLY_SCAN_TOKEN_TYPE_ERROR:
         free (token->data.string);
         break;
     }
@@ -242,13 +243,13 @@ void ply_scan_read_next_token (ply_scan_t       *scan,
         {
           if (curchar == '\0')
             {
-              token->data.string = "End of file before end of string";
+              token->data.string = strdup("End of file before end of string");
               token->type = PLY_SCAN_TOKEN_TYPE_ERROR;
               return;
             }
           if (curchar == '\n')
             {
-              token->data.string = "Line terminator before end of string";
+              token->data.string = strdup("Line terminator before end of string");
               token->type = PLY_SCAN_TOKEN_TYPE_ERROR;
               return;
             }
@@ -326,7 +327,7 @@ void ply_scan_read_next_token (ply_scan_t       *scan,
           if (nextchar == '\0')
             {
               free (token->data.string);
-              token->data.string = "End of file before end of comment";
+              token->data.string = strdup("End of file before end of comment");
               token->type = PLY_SCAN_TOKEN_TYPE_ERROR;
               return;
             }
index f803ab8147e191515c0d02396508ab9b86987b88..9250414b6494cbc9710c3067a9d107ae7984d707 100644 (file)
@@ -53,7 +53,7 @@ static script_return_t image_new (script_state_t *state,
   char *path_filename;
   char *filename = script_obj_hash_get_string (state->local, "filename");
   char *test_string = filename;
-  char *prefix_string = "special://";
+  const char *prefix_string = "special://";
 
   while (*test_string && *prefix_string && *test_string == *prefix_string)
     {
index 916a7116e0c919aa94c140808f2818597f18cd81..01deae3960757a9ce2e4ae43a0eb67d6c6a77186 100644 (file)
@@ -53,6 +53,7 @@ void *script_obj_as_native_of_class_name (script_obj_t *obj,
 bool script_obj_is_null (script_obj_t *obj);
 bool script_obj_is_int (script_obj_t *obj);
 bool script_obj_is_float (script_obj_t *obj);
+bool script_obj_is_number (script_obj_t *obj);
 bool script_obj_is_string (script_obj_t *obj);
 bool script_obj_is_hash (script_obj_t *obj);
 bool script_obj_is_function (script_obj_t *obj);
index e1d0bf1b22a586f22c4eaa78d86629cda79405bb..1ed1f99992ded4b9be83b9e04d763b0b8671a97a 100644 (file)
@@ -44,7 +44,7 @@ static ply_list_t *script_parse_op_list (ply_scan_t *scan);
 static void script_parse_op_list_free (ply_list_t *op_list);
 
 static void script_parse_error (ply_scan_token_t *token,
-                                char             *expected)
+                                const char       *expected)
 {
   ply_error ("Parser error L:%d C:%d : %s\n",
              token->line_index,