Fix constness warnings
This commit is contained in:
parent
27b37407d0
commit
25a796afc6
@ -547,7 +547,7 @@ meta_display_open (void)
|
|||||||
guint32 timestamp;
|
guint32 timestamp;
|
||||||
|
|
||||||
/* A list of all atom names, so that we can intern them in one go. */
|
/* 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,
|
#define item(x) #x,
|
||||||
#include <x11/atomnames.h>
|
#include <x11/atomnames.h>
|
||||||
#undef item
|
#undef item
|
||||||
@ -605,7 +605,7 @@ meta_display_open (void)
|
|||||||
meta_prefs_add_listener (prefs_changed_callback, display);
|
meta_prefs_add_listener (prefs_changed_callback, display);
|
||||||
|
|
||||||
meta_verbose ("Creating %d atoms\n", (int) G_N_ELEMENTS (atom_names));
|
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);
|
False, atoms);
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
@ -188,7 +188,7 @@ reload_modmap (MetaKeyBindingManager *keys)
|
|||||||
|
|
||||||
/* Modifiers to find. */
|
/* Modifiers to find. */
|
||||||
struct {
|
struct {
|
||||||
char *name;
|
const char *name;
|
||||||
xkb_mod_mask_t *mask_p;
|
xkb_mod_mask_t *mask_p;
|
||||||
} mods[] = {
|
} mods[] = {
|
||||||
{ "ScrollLock", &scroll_lock_mask },
|
{ "ScrollLock", &scroll_lock_mask },
|
||||||
|
@ -44,7 +44,7 @@ print_version (const gchar *option_name,
|
|||||||
exit (0);
|
exit (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gchar *plugin = "default";
|
static const char *plugin = "default";
|
||||||
|
|
||||||
GOptionEntry mutter_options[] = {
|
GOptionEntry mutter_options[] = {
|
||||||
{
|
{
|
||||||
|
@ -161,8 +161,8 @@ typedef struct
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
char *key;
|
const char *key;
|
||||||
char *schema;
|
const char *schema;
|
||||||
MetaPreference pref;
|
MetaPreference pref;
|
||||||
} MetaBasePreference;
|
} MetaBasePreference;
|
||||||
|
|
||||||
|
@ -2100,7 +2100,7 @@ meta_screen_queue_workarea_recalc (MetaScreen *screen)
|
|||||||
|
|
||||||
|
|
||||||
#ifdef WITH_VERBOSE_MODE
|
#ifdef WITH_VERBOSE_MODE
|
||||||
static char *
|
static const char *
|
||||||
meta_screen_corner_to_string (MetaScreenCorner corner)
|
meta_screen_corner_to_string (MetaScreenCorner corner)
|
||||||
{
|
{
|
||||||
switch (corner)
|
switch (corner)
|
||||||
|
@ -1055,7 +1055,7 @@ meta_workspace_get_onmonitor_region (MetaWorkspace *workspace,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WITH_VERBOSE_MODE
|
#ifdef WITH_VERBOSE_MODE
|
||||||
static char *
|
static const char *
|
||||||
meta_motion_direction_to_string (MetaMotionDirection direction)
|
meta_motion_direction_to_string (MetaMotionDirection direction)
|
||||||
{
|
{
|
||||||
switch (direction)
|
switch (direction)
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <X11/extensions/sync.h>
|
#include <X11/extensions/sync.h>
|
||||||
|
|
||||||
char *client_id = "0";
|
const char *client_id = "0";
|
||||||
static gboolean wayland;
|
static gboolean wayland;
|
||||||
GHashTable *windows;
|
GHashTable *windows;
|
||||||
|
|
||||||
|
@ -1120,7 +1120,7 @@ main (int argc, char **argv)
|
|||||||
|
|
||||||
/* Then initalize mutter with a different set of arguments */
|
/* 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];
|
fake_args[0] = argv[0];
|
||||||
char **fake_argv = fake_args;
|
char **fake_argv = fake_args;
|
||||||
int fake_argc = 2;
|
int fake_argc = 2;
|
||||||
|
@ -312,8 +312,8 @@ meta_session_init (const char *previous_client_id,
|
|||||||
|
|
||||||
prgname = g_get_prgname ();
|
prgname = g_get_prgname ();
|
||||||
|
|
||||||
prop1.name = SmProgram;
|
prop1.name = (char *)SmProgram;
|
||||||
prop1.type = SmARRAY8;
|
prop1.type = (char *)SmARRAY8;
|
||||||
prop1.num_vals = 1;
|
prop1.num_vals = 1;
|
||||||
prop1.vals = &prop1val;
|
prop1.vals = &prop1val;
|
||||||
prop1val.value = (char *)prgname;
|
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
|
/* twm sets getuid() for this, but the SM spec plainly
|
||||||
* says pw_name, twm is on crack
|
* says pw_name, twm is on crack
|
||||||
*/
|
*/
|
||||||
prop2.name = SmUserID;
|
prop2.name = (char *)SmUserID;
|
||||||
prop2.type = SmARRAY8;
|
prop2.type = (char *)SmARRAY8;
|
||||||
prop2.num_vals = 1;
|
prop2.num_vals = 1;
|
||||||
prop2.vals = &prop2val;
|
prop2.vals = &prop2val;
|
||||||
prop2val.value = (char*) g_get_user_name ();
|
prop2val.value = (char*) g_get_user_name ();
|
||||||
prop2val.length = strlen (prop2val.value);
|
prop2val.length = strlen (prop2val.value);
|
||||||
|
|
||||||
prop3.name = SmRestartStyleHint;
|
prop3.name = (char *)SmRestartStyleHint;
|
||||||
prop3.type = SmCARD8;
|
prop3.type = (char *)SmCARD8;
|
||||||
prop3.num_vals = 1;
|
prop3.num_vals = 1;
|
||||||
prop3.vals = &prop3val;
|
prop3.vals = &prop3val;
|
||||||
prop3val.value = &hint;
|
prop3val.value = &hint;
|
||||||
prop3val.length = 1;
|
prop3val.length = 1;
|
||||||
|
|
||||||
sprintf (pid, "%d", getpid ());
|
sprintf (pid, "%d", getpid ());
|
||||||
prop4.name = SmProcessID;
|
prop4.name = (char *)SmProcessID;
|
||||||
prop4.type = SmARRAY8;
|
prop4.type = (char *)SmARRAY8;
|
||||||
prop4.num_vals = 1;
|
prop4.num_vals = 1;
|
||||||
prop4.vals = &prop4val;
|
prop4.vals = &prop4val;
|
||||||
prop4val.value = pid;
|
prop4val.value = pid;
|
||||||
prop4val.length = strlen (prop4val.value);
|
prop4val.length = strlen (prop4val.value);
|
||||||
|
|
||||||
/* Always start in home directory */
|
/* Always start in home directory */
|
||||||
prop5.name = SmCurrentDirectory;
|
prop5.name = (char *)SmCurrentDirectory;
|
||||||
prop5.type = SmARRAY8;
|
prop5.type = (char *)SmARRAY8;
|
||||||
prop5.num_vals = 1;
|
prop5.num_vals = 1;
|
||||||
prop5.vals = &prop5val;
|
prop5.vals = &prop5val;
|
||||||
prop5val.value = (char*) g_get_home_dir ();
|
prop5val.value = (char*) g_get_home_dir ();
|
||||||
prop5val.length = strlen (prop5val.value);
|
prop5val.length = strlen (prop5val.value);
|
||||||
|
|
||||||
prop6.name = "_GSM_Priority";
|
prop6.name = (char *)"_GSM_Priority";
|
||||||
prop6.type = SmCARD8;
|
prop6.type = (char *)SmCARD8;
|
||||||
prop6.num_vals = 1;
|
prop6.num_vals = 1;
|
||||||
prop6.vals = &prop6val;
|
prop6.vals = &prop6val;
|
||||||
prop6val.value = &priority;
|
prop6val.value = &priority;
|
||||||
@ -588,15 +588,15 @@ set_clone_restart_commands (void)
|
|||||||
|
|
||||||
/* Restart (use same client ID) */
|
/* Restart (use same client ID) */
|
||||||
|
|
||||||
prop1.name = SmRestartCommand;
|
prop1.name = (char *)SmRestartCommand;
|
||||||
prop1.type = SmLISTofARRAY8;
|
prop1.type = (char *)SmLISTofARRAY8;
|
||||||
|
|
||||||
g_return_if_fail (client_id);
|
g_return_if_fail (client_id);
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
restartv[i] = (char *)prgname;
|
restartv[i] = (char *)prgname;
|
||||||
++i;
|
++i;
|
||||||
restartv[i] = "--sm-client-id";
|
restartv[i] = (char *)"--sm-client-id";
|
||||||
++i;
|
++i;
|
||||||
restartv[i] = client_id;
|
restartv[i] = client_id;
|
||||||
++i;
|
++i;
|
||||||
@ -619,8 +619,8 @@ set_clone_restart_commands (void)
|
|||||||
++i;
|
++i;
|
||||||
clonev[i] = NULL;
|
clonev[i] = NULL;
|
||||||
|
|
||||||
prop2.name = SmCloneCommand;
|
prop2.name = (char *)SmCloneCommand;
|
||||||
prop2.type = SmLISTofARRAY8;
|
prop2.type = (char *)SmLISTofARRAY8;
|
||||||
|
|
||||||
prop2.vals = g_new (SmPropValue, i);
|
prop2.vals = g_new (SmPropValue, i);
|
||||||
i = 0;
|
i = 0;
|
||||||
@ -635,16 +635,16 @@ set_clone_restart_commands (void)
|
|||||||
/* Discard */
|
/* Discard */
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
discardv[i] = "rm";
|
discardv[i] = (char *)"rm";
|
||||||
++i;
|
++i;
|
||||||
discardv[i] = "-f";
|
discardv[i] = (char *)"-f";
|
||||||
++i;
|
++i;
|
||||||
discardv[i] = (char*) full_save_file ();
|
discardv[i] = (char*) full_save_file ();
|
||||||
++i;
|
++i;
|
||||||
discardv[i] = NULL;
|
discardv[i] = NULL;
|
||||||
|
|
||||||
prop3.name = SmDiscardCommand;
|
prop3.name = (char *)SmDiscardCommand;
|
||||||
prop3.type = SmLISTofARRAY8;
|
prop3.type = (char *)SmLISTofARRAY8;
|
||||||
|
|
||||||
prop3.vals = g_new (SmPropValue, i);
|
prop3.vals = g_new (SmPropValue, i);
|
||||||
i = 0;
|
i = 0;
|
||||||
@ -1792,8 +1792,8 @@ warn_about_lame_clients_and_finish_interact (gboolean shutdown)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
columns = g_slist_prepend (columns, "Window");
|
columns = g_slist_prepend (columns, (gpointer)"Window");
|
||||||
columns = g_slist_prepend (columns, "Class");
|
columns = g_slist_prepend (columns, (gpointer)"Class");
|
||||||
|
|
||||||
lame = g_slist_sort (lame, (GCompareFunc) windows_cmp_by_title);
|
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;
|
MetaWindow *w = tmp->data;
|
||||||
|
|
||||||
lame_details = g_slist_prepend (lame_details,
|
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,
|
lame_details = g_slist_prepend (lame_details,
|
||||||
w->title);
|
w->title);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user