summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2015-09-24 01:13:59 +0200
committerFlorian Müllner <fmuellner@gnome.org>2015-09-24 03:01:51 +0200
commit25a796afc6c10e5ca89310ada694db5a5790f5c6 (patch)
tree7369190eb8d92c16d5d2bee6607e570bfbb59016
parent27b37407d0aa4557a4df52122beecad864b6beea (diff)
downloadmutter-25a796afc6c10e5ca89310ada694db5a5790f5c6.tar.gz
Fix constness warnings
-rw-r--r--src/core/display.c4
-rw-r--r--src/core/keybindings.c2
-rw-r--r--src/core/mutter.c2
-rw-r--r--src/core/prefs.c4
-rw-r--r--src/core/screen.c2
-rw-r--r--src/core/workspace.c2
-rw-r--r--src/tests/test-client.c2
-rw-r--r--src/tests/test-runner.c2
-rw-r--r--src/x11/session.c48
9 files changed, 34 insertions, 34 deletions
diff --git a/src/core/display.c b/src/core/display.c
index b5174c4de..e7afd63a3 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -547,7 +547,7 @@ meta_display_open (void)
guint32 timestamp;
/* A list of all atom names, so that we can intern them in one go. */
- char *atom_names[] = {
+ const char *atom_names[] = {
#define item(x) #x,
#include <x11/atomnames.h>
#undef item
@@ -605,7 +605,7 @@ meta_display_open (void)
meta_prefs_add_listener (prefs_changed_callback, display);
meta_verbose ("Creating %d atoms\n", (int) G_N_ELEMENTS (atom_names));
- XInternAtoms (display->xdisplay, atom_names, G_N_ELEMENTS (atom_names),
+ XInternAtoms (display->xdisplay, (char **)atom_names, G_N_ELEMENTS (atom_names),
False, atoms);
{
int i = 0;
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index 08d77ae80..ddbab7043 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -188,7 +188,7 @@ reload_modmap (MetaKeyBindingManager *keys)
/* Modifiers to find. */
struct {
- char *name;
+ const char *name;
xkb_mod_mask_t *mask_p;
} mods[] = {
{ "ScrollLock", &scroll_lock_mask },
diff --git a/src/core/mutter.c b/src/core/mutter.c
index c03e99148..c22cb02c8 100644
--- a/src/core/mutter.c
+++ b/src/core/mutter.c
@@ -44,7 +44,7 @@ print_version (const gchar *option_name,
exit (0);
}
-static gchar *plugin = "default";
+static const char *plugin = "default";
GOptionEntry mutter_options[] = {
{
diff --git a/src/core/prefs.c b/src/core/prefs.c
index 43828fca4..2da8da32b 100644
--- a/src/core/prefs.c
+++ b/src/core/prefs.c
@@ -161,8 +161,8 @@ typedef struct
typedef struct
{
- char *key;
- char *schema;
+ const char *key;
+ const char *schema;
MetaPreference pref;
} MetaBasePreference;
diff --git a/src/core/screen.c b/src/core/screen.c
index d2f30cc31..19f7db5e2 100644
--- a/src/core/screen.c
+++ b/src/core/screen.c
@@ -2100,7 +2100,7 @@ meta_screen_queue_workarea_recalc (MetaScreen *screen)
#ifdef WITH_VERBOSE_MODE
-static char *
+static const char *
meta_screen_corner_to_string (MetaScreenCorner corner)
{
switch (corner)
diff --git a/src/core/workspace.c b/src/core/workspace.c
index f275c00d9..cfac7dc48 100644
--- a/src/core/workspace.c
+++ b/src/core/workspace.c
@@ -1055,7 +1055,7 @@ meta_workspace_get_onmonitor_region (MetaWorkspace *workspace,
}
#ifdef WITH_VERBOSE_MODE
-static char *
+static const char *
meta_motion_direction_to_string (MetaMotionDirection direction)
{
switch (direction)
diff --git a/src/tests/test-client.c b/src/tests/test-client.c
index 35f675dc9..4c4480c28 100644
--- a/src/tests/test-client.c
+++ b/src/tests/test-client.c
@@ -25,7 +25,7 @@
#include <string.h>
#include <X11/extensions/sync.h>
-char *client_id = "0";
+const char *client_id = "0";
static gboolean wayland;
GHashTable *windows;
diff --git a/src/tests/test-runner.c b/src/tests/test-runner.c
index 7405c886a..c395d9266 100644
--- a/src/tests/test-runner.c
+++ b/src/tests/test-runner.c
@@ -1120,7 +1120,7 @@ main (int argc, char **argv)
/* Then initalize mutter with a different set of arguments */
- char *fake_args[] = { NULL, "--wayland" };
+ char *fake_args[] = { NULL, (char *)"--wayland" };
fake_args[0] = argv[0];
char **fake_argv = fake_args;
int fake_argc = 2;
diff --git a/src/x11/session.c b/src/x11/session.c
index d9c7b9d55..6f6872996 100644
--- a/src/x11/session.c
+++ b/src/x11/session.c
@@ -312,8 +312,8 @@ meta_session_init (const char *previous_client_id,
prgname = g_get_prgname ();
- prop1.name = SmProgram;
- prop1.type = SmARRAY8;
+ prop1.name = (char *)SmProgram;
+ prop1.type = (char *)SmARRAY8;
prop1.num_vals = 1;
prop1.vals = &prop1val;
prop1val.value = (char *)prgname;
@@ -322,38 +322,38 @@ meta_session_init (const char *previous_client_id,
/* twm sets getuid() for this, but the SM spec plainly
* says pw_name, twm is on crack
*/
- prop2.name = SmUserID;
- prop2.type = SmARRAY8;
+ prop2.name = (char *)SmUserID;
+ prop2.type = (char *)SmARRAY8;
prop2.num_vals = 1;
prop2.vals = &prop2val;
prop2val.value = (char*) g_get_user_name ();
prop2val.length = strlen (prop2val.value);
- prop3.name = SmRestartStyleHint;
- prop3.type = SmCARD8;
+ prop3.name = (char *)SmRestartStyleHint;
+ prop3.type = (char *)SmCARD8;
prop3.num_vals = 1;
prop3.vals = &prop3val;
prop3val.value = &hint;
prop3val.length = 1;
sprintf (pid, "%d", getpid ());
- prop4.name = SmProcessID;
- prop4.type = SmARRAY8;
+ prop4.name = (char *)SmProcessID;
+ prop4.type = (char *)SmARRAY8;
prop4.num_vals = 1;
prop4.vals = &prop4val;
prop4val.value = pid;
prop4val.length = strlen (prop4val.value);
/* Always start in home directory */
- prop5.name = SmCurrentDirectory;
- prop5.type = SmARRAY8;
+ prop5.name = (char *)SmCurrentDirectory;
+ prop5.type = (char *)SmARRAY8;
prop5.num_vals = 1;
prop5.vals = &prop5val;
prop5val.value = (char*) g_get_home_dir ();
prop5val.length = strlen (prop5val.value);
- prop6.name = "_GSM_Priority";
- prop6.type = SmCARD8;
+ prop6.name = (char *)"_GSM_Priority";
+ prop6.type = (char *)SmCARD8;
prop6.num_vals = 1;
prop6.vals = &prop6val;
prop6val.value = &priority;
@@ -588,15 +588,15 @@ set_clone_restart_commands (void)
/* Restart (use same client ID) */
- prop1.name = SmRestartCommand;
- prop1.type = SmLISTofARRAY8;
+ prop1.name = (char *)SmRestartCommand;
+ prop1.type = (char *)SmLISTofARRAY8;
g_return_if_fail (client_id);
i = 0;
restartv[i] = (char *)prgname;
++i;
- restartv[i] = "--sm-client-id";
+ restartv[i] = (char *)"--sm-client-id";
++i;
restartv[i] = client_id;
++i;
@@ -619,8 +619,8 @@ set_clone_restart_commands (void)
++i;
clonev[i] = NULL;
- prop2.name = SmCloneCommand;
- prop2.type = SmLISTofARRAY8;
+ prop2.name = (char *)SmCloneCommand;
+ prop2.type = (char *)SmLISTofARRAY8;
prop2.vals = g_new (SmPropValue, i);
i = 0;
@@ -635,16 +635,16 @@ set_clone_restart_commands (void)
/* Discard */
i = 0;
- discardv[i] = "rm";
+ discardv[i] = (char *)"rm";
++i;
- discardv[i] = "-f";
+ discardv[i] = (char *)"-f";
++i;
discardv[i] = (char*) full_save_file ();
++i;
discardv[i] = NULL;
- prop3.name = SmDiscardCommand;
- prop3.type = SmLISTofARRAY8;
+ prop3.name = (char *)SmDiscardCommand;
+ prop3.type = (char *)SmLISTofARRAY8;
prop3.vals = g_new (SmPropValue, i);
i = 0;
@@ -1792,8 +1792,8 @@ warn_about_lame_clients_and_finish_interact (gboolean shutdown)
return;
}
- columns = g_slist_prepend (columns, "Window");
- columns = g_slist_prepend (columns, "Class");
+ columns = g_slist_prepend (columns, (gpointer)"Window");
+ columns = g_slist_prepend (columns, (gpointer)"Class");
lame = g_slist_sort (lame, (GCompareFunc) windows_cmp_by_title);
@@ -1803,7 +1803,7 @@ warn_about_lame_clients_and_finish_interact (gboolean shutdown)
MetaWindow *w = tmp->data;
lame_details = g_slist_prepend (lame_details,
- w->res_class ? w->res_class : "");
+ w->res_class ? w->res_class : (gpointer)"");
lame_details = g_slist_prepend (lame_details,
w->title);