warning: Value stored to 'screen_number' is never read

$ scan-build --keep-cc make
terminal-app.c:249:5: warning: Value stored to 'screen_number' is never read
                                screen_number = n;
                                ^               ~
rbuj 2019-02-20 10:50:49 +01:00 committed by ZenWalker
parent 449753407d
commit 0c49db9a61
3 changed files with 2 additions and 20 deletions

View File

@ -221,14 +221,11 @@ gsettings_remove_all_from_strv (GSettings *settings,
/* Helper functions */ /* Helper functions */
static GdkScreen* static GdkScreen*
terminal_app_get_screen_by_display_name (const char *display_name, terminal_app_get_screen_by_display_name (const char *display_name)
int screen_number)
{ {
GdkDisplay *display = NULL; GdkDisplay *display = NULL;
GdkScreen *screen = NULL; GdkScreen *screen = NULL;
/* --screen=screen_number overrides --display */
if (display_name == NULL) if (display_name == NULL)
display = gdk_display_get_default (); display = gdk_display_get_default ();
else else
@ -237,18 +234,6 @@ terminal_app_get_screen_by_display_name (const char *display_name,
const char *period; const char *period;
period = strrchr (display_name, '.'); period = strrchr (display_name, '.');
if (period)
{
gulong n;
char *end;
errno = 0;
end = NULL;
n = g_ascii_strtoull (period + 1, &end, 0);
if (errno == 0 && (period + 1) != end)
screen_number = n;
}
displays = gdk_display_manager_list_displays (gdk_display_manager_get ()); displays = gdk_display_manager_list_displays (gdk_display_manager_get ());
for (l = displays; l != NULL; l = l->next) for (l = displays; l != NULL; l = l->next)
{ {
@ -1730,8 +1715,7 @@ terminal_app_handle_options (TerminalApp *app,
GList *lw; GList *lw;
GdkScreen *gdk_screen; GdkScreen *gdk_screen;
gdk_screen = terminal_app_get_screen_by_display_name (options->display_name, gdk_screen = terminal_app_get_screen_by_display_name (options->display_name);
options->screen_number);
if (options->save_config) if (options->save_config)
{ {

View File

@ -723,7 +723,6 @@ terminal_options_parse (const char *working_directory,
options->default_title = NULL; options->default_title = NULL;
options->zoom = 1.0; options->zoom = 1.0;
options->screen_number = -1;
options->default_working_dir = g_strdup (working_directory); options->default_working_dir = g_strdup (working_directory);
/* The old -x/--execute option is broken, so we need to pre-scan for it. */ /* The old -x/--execute option is broken, so we need to pre-scan for it. */

View File

@ -32,7 +32,6 @@ typedef struct
char **env; char **env;
char *startup_id; char *startup_id;
char *display_name; char *display_name;
int screen_number;
GList *initial_windows; GList *initial_windows;
gboolean default_window_menubar_forced; gboolean default_window_menubar_forced;
gboolean default_window_menubar_state; gboolean default_window_menubar_state;