diff options
author | Manuel Bachmann <manuel.bachmann@open.eurogiciel.org> | 2014-11-17 13:11:55 +0100 |
---|---|---|
committer | Manuel Bachmann <manuel.bachmann@open.eurogiciel.org> | 2014-11-17 13:11:55 +0100 |
commit | 0e6dd7341730320a5e5f93f6829b396c9a3bf779 (patch) | |
tree | ab8afcaf54f61c45660e3563b10793d0a8443875 /src/tz-launcher.c | |
parent | b8043731fa1a64e9abba5edb685295b1dae1ee14 (diff) | |
download | weston-common-0e6dd7341730320a5e5f93f6829b396c9a3bf779.tar.gz weston-common-0e6dd7341730320a5e5f93f6829b396c9a3bf779.tar.bz2 weston-common-0e6dd7341730320a5e5f93f6829b396c9a3bf779.zip |
tz-launcher: fix warnings, coding style, memory leaksubmit/tizen_mobile/20141120.000000submit/tizen_common/20141117.130703accepted/tizen/common/20141117.165057
This commit fixes all the warnings issued during the
"tz-launcher" compilation process. It also enforces
coding style consistency, and fixes one memory leak
of a cairo context.
Change-Id: Ide7a7d8ada146c54c8bc493277d384854793709f
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Diffstat (limited to 'src/tz-launcher.c')
-rw-r--r-- | src/tz-launcher.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/tz-launcher.c b/src/tz-launcher.c index e4851c5..8f8d9fc 100644 --- a/src/tz-launcher.c +++ b/src/tz-launcher.c @@ -11,6 +11,9 @@ gchar **desktoptable[MAX_DESKTOPFILES]; int global_argc; char **global_argv; +extern void tz_launcher_wl_reload (int desktopfiles, gchar ***desktoptable); +extern void tz_launcher_wl_run (int desktopfiles, gchar ***desktoptable); + gboolean file_is_parsable (GFile *file) @@ -153,6 +156,8 @@ tz_launcher_parse_directory (GFile *directory) case G_FILE_TYPE_DIRECTORY: tz_launcher_parse_directory (file); break; + default: + break; } g_object_unref (file); g_object_unref (info); @@ -172,9 +177,9 @@ tz_launcher_parse_config_file (GFile *file) istream = g_file_read (file, NULL, NULL); stream = g_data_input_stream_new (G_INPUT_STREAM(istream)); - while (line = g_data_input_stream_read_line (stream, NULL, NULL, NULL)) { + while ((line = g_data_input_stream_read_line (stream, NULL, NULL, NULL))) { line = g_strstrip (line); - if ((strcmp (line, "")) && (!g_str_has_prefix (line, "#"))) { + if ((g_strcmp0 (line, "")) && (!g_str_has_prefix (line, "#"))) { linefile = g_file_new_for_path (line); if (g_file_query_exists (linefile, NULL)) { @@ -191,6 +196,8 @@ tz_launcher_parse_config_file (GFile *file) case G_FILE_TYPE_DIRECTORY: tz_launcher_parse_directory (linefile); break; + default: + break; } } @@ -213,7 +220,7 @@ parse_args (int argc, char **argv) for (i = 1; i < argc ; i++) { - if (!strcmp (argv[i], "-c")) { + if (!g_strcmp0 (argv[i], "-c")) { desktopfile = g_file_new_for_path (argv[i+1]); if (!g_file_query_exists (desktopfile, NULL)) { g_printerr ("Config file \"%s\" does not exist !\n", argv[i+1]); @@ -244,6 +251,8 @@ parse_args (int argc, char **argv) case G_FILE_TYPE_DIRECTORY: tz_launcher_parse_directory (desktopfile); break; + default: + break; } g_object_unref (desktopfile); @@ -272,9 +281,6 @@ main (int argc, char **argv) return 0; } - g_type_init (); - - signal (SIGUSR1, sigreload_handler); global_argc = argc; global_argv = argv; |