mirror of
https://gitlab.freedesktop.org/plymouth/plymouth.git
synced 2026-05-08 10:08:06 +02:00
[script] Fix some compile warnings
Fixed by making most plugin functions static as they dont get linked from outside anyway. Also changed some char* to const char*.
This commit is contained in:
parent
d32a075e7a
commit
2b62c964bc
5 changed files with 25 additions and 21 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue