diff options
author | Niels De Graef <Niels.DeGraef@barco.com> | 2018-11-19 14:19:28 +0100 |
---|---|---|
committer | Niels De Graef <Niels.DeGraef@barco.com> | 2018-11-19 14:19:44 +0100 |
commit | 7efb3155685554d77b310a18a72147a88a5f8df7 (patch) | |
tree | a8ad3b5406710f3b3bfff8398a31969590139b29 /src/core/util.c | |
parent | 2dfcf8dcacc164e86608f20b6a60436613366cb7 (diff) | |
download | mutter-7efb3155685554d77b310a18a72147a88a5f8df7.tar.gz |
Diffstat (limited to 'src/core/util.c')
-rw-r--r-- | src/core/util.c | 69 |
1 files changed, 37 insertions, 32 deletions
diff --git a/src/core/util.c b/src/core/util.c index 5febb0edf..1992555f5 100644 --- a/src/core/util.c +++ b/src/core/util.c @@ -46,7 +46,7 @@ static void meta_topic_real_valist (MetaDebugTopic topic, const char *format, - va_list args) G_GNUC_PRINTF(2, 0); + va_list args) G_GNUC_PRINTF (2, 0); #endif static gboolean @@ -59,7 +59,7 @@ static int no_prefix = 0; static gboolean is_wayland_compositor = FALSE; #ifdef WITH_VERBOSE_MODE -static FILE* logfile = NULL; +static FILE *logfile = NULL; static void ensure_logfile (void) @@ -250,7 +250,7 @@ void meta_free_gslist_and_elements (GSList *list_to_deep_free) { g_slist_foreach (list_to_deep_free, - (void (*)(gpointer,gpointer))&g_free, /* ew, for ugly */ + (void (*)(gpointer, gpointer)) & g_free, /* ew, for ugly */ NULL); g_slist_free (list_to_deep_free); } @@ -297,7 +297,7 @@ meta_verbose_real (const char *format, ...) #endif /* WITH_VERBOSE_MODE */ #ifdef WITH_VERBOSE_MODE -static const char* +static const char * topic_name (MetaDebugTopic topic) { switch (topic) @@ -394,7 +394,7 @@ meta_topic_real_valist (MetaDebugTopic topic, void meta_topic_real (MetaDebugTopic topic, - const char *format, + const char *format, ...) { va_list args; @@ -513,7 +513,6 @@ meta_pop_no_msg_prefix (void) void meta_exit (MetaExitCode code) { - exit (code); } @@ -521,13 +520,13 @@ gint meta_unsigned_long_equal (gconstpointer v1, gconstpointer v2) { - return *((const gulong*) v1) == *((const gulong*) v2); + return *((const gulong *) v1) == *((const gulong *) v2); } guint meta_unsigned_long_hash (gconstpointer v) { - gulong val = * (const gulong *) v; + gulong val = *(const gulong *) v; /* I'm not sure this works so well. */ #if GLIB_SIZEOF_LONG > 4 @@ -537,7 +536,7 @@ meta_unsigned_long_hash (gconstpointer v) #endif } -const char* +const char * meta_gravity_to_string (int gravity) { switch (gravity) @@ -578,7 +577,7 @@ meta_gravity_to_string (int gravity) } } -char* +char * meta_external_binding_name_for_action (guint keybinding_action) { return g_strdup_printf ("external-grab-%u", keybinding_action); @@ -625,9 +624,9 @@ meta_show_dialog (const char *type, const char *ok_text, const char *cancel_text, const char *icon_name, - const int transient_for, - GSList *columns, - GSList *entries) + const int transient_for, + GSList *columns, + GSList *entries) { GError *error = NULL; GSList *tmp; @@ -662,7 +661,7 @@ meta_show_dialog (const char *type, { append_argument (args, "--ok-label"); append_argument (args, ok_text); - } + } if (cancel_text) { @@ -693,7 +692,7 @@ meta_show_dialog (const char *type, if (transient_for) { - gchar *env = g_strdup_printf("%d", transient_for); + gchar *env = g_strdup_printf ("%d", transient_for); setenv ("WINDOWID", env, 1); g_free (env); @@ -703,14 +702,14 @@ meta_show_dialog (const char *type, g_ptr_array_add (args, NULL); /* NULL-terminate */ g_spawn_async ( - "/", - (gchar**) args->pdata, - NULL, - G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, - NULL, NULL, - &child_pid, - &error - ); + "/", + (gchar **) args->pdata, + NULL, + G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, + NULL, NULL, + &child_pid, + &error + ); if (transient_for) unsetenv ("WINDOWID"); @@ -744,7 +743,8 @@ typedef struct gboolean run_once; } MetaLater; -static GSList *laters[] = { +static GSList *laters[] = +{ NULL, /* META_LATER_RESIZE */ NULL, /* META_LATER_CALC_SHOWING */ NULL, /* META_LATER_CHECK_FULLSCREEN */ @@ -852,8 +852,9 @@ ensure_later_repaint_func (void) later_timeline = clutter_timeline_new (G_MAXUINT); if (later_repaint_func == 0) - later_repaint_func = clutter_threads_add_repaint_func (run_all_repaint_laters, - NULL, NULL); + later_repaint_func = clutter_threads_add_repaint_func ( + run_all_repaint_laters, + NULL, NULL); /* Make sure the repaint function gets run */ clutter_timeline_start (later_timeline); @@ -878,13 +879,16 @@ call_idle_later (gpointer data) /** * meta_later_add: - * @when: enumeration value determining the phase at which to run the callback + * @when: enumeration value determining the phase at which to run the + *callback * @func: callback to run later * @data: data to pass to the callback - * @notify: function to call to destroy @data when it is no longer in use, or %NULL + * @notify: function to call to destroy @data when it is no longer in use, or + *%NULL * * Sets up a callback to be called at some later time. @when determines the - * particular later occasion at which it is called. This is much like g_idle_add(), + * particular later occasion at which it is called. This is much like + *g_idle_add(), * except that the functions interact properly with clutter event handling. * If a "later" function is added from a clutter event handler, and is supposed * to be run before the stage is redrawn, it will be run before that redraw @@ -921,7 +925,8 @@ meta_later_add (MetaLaterType when, * handler will get hit first and we want to call this function * there so it will happen before GTK+ repaints. */ - later->source = g_idle_add_full (META_PRIORITY_RESIZE, call_idle_later, later, NULL); + later->source = g_idle_add_full (META_PRIORITY_RESIZE, call_idle_later, + later, NULL); g_source_set_name_by_id (later->source, "[mutter] call_idle_later"); ensure_later_repaint_func (); break; @@ -932,7 +937,8 @@ meta_later_add (MetaLaterType when, ensure_later_repaint_func (); break; case META_LATER_IDLE: - later->source = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, call_idle_later, later, NULL); + later->source = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, call_idle_later, + later, NULL); g_source_set_name_by_id (later->source, "[mutter] call_idle_later"); break; } @@ -1012,4 +1018,3 @@ meta_generate_random_id (GRand *rand, } /* eof util.c */ - |