use const char*'s when we should be
This commit is contained in:
parent
5fa443efc8
commit
3678f8df8a
13 changed files with 37 additions and 37 deletions
|
@ -136,7 +136,7 @@ static void send_to_update(ObMenuFrame *frame, gpointer data)
|
|||
return;
|
||||
|
||||
for (i = 0; i <= screen_num_desktops; ++i) {
|
||||
gchar *name;
|
||||
const gchar *name;
|
||||
guint desk;
|
||||
|
||||
if (i >= screen_num_desktops) {
|
||||
|
|
|
@ -28,7 +28,7 @@ void ob_debug_show_output(gboolean enable)
|
|||
show = enable;
|
||||
}
|
||||
|
||||
void ob_debug(gchar *a, ...)
|
||||
void ob_debug(const gchar *a, ...)
|
||||
{
|
||||
va_list vl;
|
||||
|
||||
|
|
|
@ -23,6 +23,6 @@
|
|||
|
||||
void ob_debug_show_output(gboolean enable);
|
||||
|
||||
void ob_debug(gchar *a, ...);
|
||||
void ob_debug(const gchar *a, ...);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -243,7 +243,7 @@ parse_menu_fail:
|
|||
g_free(script);
|
||||
}
|
||||
|
||||
ObMenu* menu_new(gchar *name, gchar *title, gpointer data)
|
||||
ObMenu* menu_new(const gchar *name, const gchar *title, gpointer data)
|
||||
{
|
||||
ObMenu *self;
|
||||
|
||||
|
@ -405,7 +405,7 @@ void menu_entry_remove(ObMenuEntry *self)
|
|||
menu_entry_free(self);
|
||||
}
|
||||
|
||||
ObMenuEntry* menu_add_normal(ObMenu *self, gint id, gchar *label,
|
||||
ObMenuEntry* menu_add_normal(ObMenu *self, gint id, const gchar *label,
|
||||
GSList *actions)
|
||||
{
|
||||
ObMenuEntry *e;
|
||||
|
@ -418,7 +418,7 @@ ObMenuEntry* menu_add_normal(ObMenu *self, gint id, gchar *label,
|
|||
return e;
|
||||
}
|
||||
|
||||
ObMenuEntry* menu_add_submenu(ObMenu *self, gint id, gchar *submenu)
|
||||
ObMenuEntry* menu_add_submenu(ObMenu *self, gint id, const gchar *submenu)
|
||||
{
|
||||
ObMenuEntry *e;
|
||||
|
||||
|
|
|
@ -120,7 +120,7 @@ struct _ObMenuEntry
|
|||
void menu_startup(gboolean reconfig);
|
||||
void menu_shutdown(gboolean reconfig);
|
||||
|
||||
ObMenu* menu_new(gchar *name, gchar *title, gpointer data);
|
||||
ObMenu* menu_new(const gchar *name, const gchar *title, gpointer data);
|
||||
void menu_free(ObMenu *menu);
|
||||
|
||||
/* Repopulate a pipe-menu by running its command */
|
||||
|
@ -133,9 +133,9 @@ void menu_set_execute_func(ObMenu *menu, ObMenuExecuteFunc func);
|
|||
void menu_set_destroy_func(ObMenu *menu, ObMenuDestroyFunc func);
|
||||
|
||||
/* functions for building menus */
|
||||
ObMenuEntry* menu_add_normal(ObMenu *menu, gint id, gchar *label,
|
||||
ObMenuEntry* menu_add_normal(ObMenu *menu, gint id, const gchar *label,
|
||||
GSList *actions);
|
||||
ObMenuEntry* menu_add_submenu(ObMenu *menu, gint id, gchar *submenu);
|
||||
ObMenuEntry* menu_add_submenu(ObMenu *menu, gint id, const gchar *submenu);
|
||||
ObMenuEntry* menu_add_separator(ObMenu *menu, gint id);
|
||||
|
||||
void menu_clear_entries(ObMenu *menu);
|
||||
|
|
|
@ -73,7 +73,7 @@ void moveresize_shutdown(gboolean reconfig)
|
|||
popup = NULL;
|
||||
}
|
||||
|
||||
static void popup_coords(ObClient *c, gchar *format, gint a, gint b)
|
||||
static void popup_coords(ObClient *c, const gchar *format, gint a, gint b)
|
||||
{
|
||||
gchar *text;
|
||||
|
||||
|
|
|
@ -440,7 +440,7 @@ static void parse_args(gint argc, gchar **argv)
|
|||
}
|
||||
}
|
||||
|
||||
void ob_exit_with_error(gchar *msg)
|
||||
void ob_exit_with_error(const gchar *msg)
|
||||
{
|
||||
g_critical(msg);
|
||||
session_shutdown(TRUE);
|
||||
|
|
|
@ -54,7 +54,7 @@ void ob_exit_replace();
|
|||
|
||||
void ob_reconfigure();
|
||||
|
||||
void ob_exit_with_error(gchar *msg);
|
||||
void ob_exit_with_error(const gchar *msg);
|
||||
|
||||
Cursor ob_cursor(ObCursor cursor);
|
||||
|
||||
|
|
|
@ -401,7 +401,7 @@ void prop_set_array32(Window win, Atom prop, Atom type, gulong *val,
|
|||
(guchar*)val, num);
|
||||
}
|
||||
|
||||
void prop_set_string_utf8(Window win, Atom prop, gchar *val)
|
||||
void prop_set_string_utf8(Window win, Atom prop, const gchar *val)
|
||||
{
|
||||
XChangeProperty(ob_display, win, prop, prop_atoms.utf8, 8,
|
||||
PropModeReplace, (guchar*)val, strlen(val));
|
||||
|
|
|
@ -186,7 +186,7 @@ gboolean prop_get_strings_utf8(Window win, Atom prop, gchar ***ret);
|
|||
void prop_set32(Window win, Atom prop, Atom type, gulong val);
|
||||
void prop_set_array32(Window win, Atom prop, Atom type, gulong *val,
|
||||
guint num);
|
||||
void prop_set_string_utf8(Window win, Atom prop, gchar *val);
|
||||
void prop_set_string_utf8(Window win, Atom prop, const gchar *val);
|
||||
void prop_set_strings_utf8(Window win, Atom prop, gchar **strs);
|
||||
|
||||
void prop_erase(Window win, Atom prop);
|
||||
|
|
|
@ -52,7 +52,7 @@ static void measure_font(const RrInstance *inst, RrFont *f)
|
|||
g_free(locale);
|
||||
}
|
||||
|
||||
RrFont *RrFontOpen(const RrInstance *inst, gchar *name, gint size,
|
||||
RrFont *RrFontOpen(const RrInstance *inst, const gchar *name, gint size,
|
||||
RrFontWeight weight, RrFontSlant slant)
|
||||
{
|
||||
RrFont *out;
|
||||
|
|
|
@ -121,7 +121,7 @@ struct _RrTextureText {
|
|||
RrFont *font;
|
||||
RrJustify justify;
|
||||
RrColor *color;
|
||||
gchar *string;
|
||||
const gchar *string;
|
||||
gint shadow_offset_x;
|
||||
gint shadow_offset_y;
|
||||
RrColor *shadow_color;
|
||||
|
@ -229,7 +229,7 @@ RrAppearance *RrAppearanceNew (const RrInstance *inst, gint numtex);
|
|||
RrAppearance *RrAppearanceCopy (RrAppearance *a);
|
||||
void RrAppearanceFree (RrAppearance *a);
|
||||
|
||||
RrFont *RrFontOpen (const RrInstance *inst, gchar *name, gint size,
|
||||
RrFont *RrFontOpen (const RrInstance *inst, const gchar *name, gint size,
|
||||
RrFontWeight weight, RrFontSlant slant);
|
||||
RrFont *RrFontOpenDefault (const RrInstance *inst);
|
||||
void RrFontClose (RrFont *f);
|
||||
|
|
|
@ -40,27 +40,27 @@ static void parse_style(gchar *tex, RrSurfaceColorType *grad,
|
|||
RrReliefType *relief, RrBevelType *bevel,
|
||||
gboolean *interlaced, gboolean *border,
|
||||
gboolean allow_trans);
|
||||
static gboolean read_mask(ParseState *ps, gchar *maskname,
|
||||
static gboolean read_mask(ParseState *ps, const gchar *maskname,
|
||||
RrPixmapMask **value);
|
||||
static RrPixel32* read_c_image(gint width, gint height, const guint8 *data);
|
||||
static void set_default_appearance(RrAppearance *a);
|
||||
static xmlNodePtr find_node(xmlNodePtr n, gchar *names[]);
|
||||
static gboolean find_int(ParseState *ps, xmlNodePtr n, gchar *names[],
|
||||
static xmlNodePtr find_node(xmlNodePtr n, const gchar *names[]);
|
||||
static gboolean find_int(ParseState *ps, xmlNodePtr n, const gchar *names[],
|
||||
gint *integer, gint lower, gint upper);
|
||||
static gboolean find_string(ParseState *ps, xmlNodePtr n, gchar *names[],
|
||||
gchar **string);
|
||||
static gboolean find_color(ParseState *ps, xmlNodePtr n, gchar *names[],
|
||||
static gboolean find_string(ParseState *ps, xmlNodePtr n, const gchar *names[],
|
||||
const gchar **string);
|
||||
static gboolean find_color(ParseState *ps, xmlNodePtr n, const gchar *names[],
|
||||
RrColor **color, gchar *alpha);
|
||||
static gboolean find_point(ParseState *ps, xmlNodePtr n, gchar *names[],
|
||||
static gboolean find_point(ParseState *ps, xmlNodePtr n, const gchar *names[],
|
||||
gint *x, gint *y,
|
||||
gint lowx, gint lowy, gint upx, gint upy);
|
||||
static gboolean find_shadow(ParseState *ps, xmlNodePtr n, gchar *names[],
|
||||
static gboolean find_shadow(ParseState *ps, xmlNodePtr n, const gchar *names[],
|
||||
RrAppearance *a);
|
||||
static gboolean find_appearance(ParseState *ps, xmlNodePtr n, gchar *names[],
|
||||
static gboolean find_appearance(ParseState *ps, xmlNodePtr n, const gchar *names[],
|
||||
RrAppearance *a, gboolean allow_trans);
|
||||
|
||||
/* make a null terminated array out of a list of strings */
|
||||
#define L(args...) (gchar*[]){args,NULL}
|
||||
#define L(args...) (const gchar*[]){args,NULL}
|
||||
/* shortcut to the various find_* functions */
|
||||
#define FIND(type, args...) find_##type(&ps, root, args)
|
||||
|
||||
|
@ -71,7 +71,7 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name,
|
|||
ParseState ps;
|
||||
xmlNodePtr root;
|
||||
RrJustify winjust, mtitlejust;
|
||||
gchar *str;
|
||||
const gchar *str;
|
||||
RrTheme *theme;
|
||||
|
||||
if (name) {
|
||||
|
@ -1131,7 +1131,7 @@ void RrThemeFree(RrTheme *theme)
|
|||
}
|
||||
}
|
||||
|
||||
static gboolean read_mask(ParseState *ps, gchar *maskname,
|
||||
static gboolean read_mask(ParseState *ps, const gchar *maskname,
|
||||
RrPixmapMask **value)
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
|
@ -1245,7 +1245,7 @@ static void parse_style(gchar *tex, RrSurfaceColorType *grad,
|
|||
}
|
||||
}
|
||||
|
||||
static xmlNodePtr find_node(xmlNodePtr n, gchar *names[])
|
||||
static xmlNodePtr find_node(xmlNodePtr n, const gchar *names[])
|
||||
{
|
||||
gint i;
|
||||
|
||||
|
@ -1254,7 +1254,7 @@ static xmlNodePtr find_node(xmlNodePtr n, gchar *names[])
|
|||
return n;
|
||||
}
|
||||
|
||||
static gboolean find_int(ParseState *ps, xmlNodePtr n, gchar *names[],
|
||||
static gboolean find_int(ParseState *ps, xmlNodePtr n, const gchar *names[],
|
||||
gint *integer, gint lower, gint upper)
|
||||
{
|
||||
gint i;
|
||||
|
@ -1269,8 +1269,8 @@ static gboolean find_int(ParseState *ps, xmlNodePtr n, gchar *names[],
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean find_string(ParseState *ps, xmlNodePtr n, gchar *names[],
|
||||
gchar **string)
|
||||
static gboolean find_string(ParseState *ps, xmlNodePtr n, const gchar *names[],
|
||||
const gchar **string)
|
||||
{
|
||||
if ((n = find_node(n, names))) {
|
||||
*string = parse_string(ps->doc, n);
|
||||
|
@ -1279,7 +1279,7 @@ static gboolean find_string(ParseState *ps, xmlNodePtr n, gchar *names[],
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean find_color(ParseState *ps, xmlNodePtr n, gchar *names[],
|
||||
static gboolean find_color(ParseState *ps, xmlNodePtr n, const gchar *names[],
|
||||
RrColor **color, gchar *alpha)
|
||||
{
|
||||
if ((n = find_node(n, names))) {
|
||||
|
@ -1299,7 +1299,7 @@ static gboolean find_color(ParseState *ps, xmlNodePtr n, gchar *names[],
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean find_point(ParseState *ps, xmlNodePtr n, gchar *names[],
|
||||
static gboolean find_point(ParseState *ps, xmlNodePtr n, const gchar *names[],
|
||||
gint *x, gint *y,
|
||||
gint lowx, gint upx, gint lowy, gint upy)
|
||||
{
|
||||
|
@ -1316,7 +1316,7 @@ static gboolean find_point(ParseState *ps, xmlNodePtr n, gchar *names[],
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean find_shadow(ParseState *ps, xmlNodePtr n, gchar *names[],
|
||||
static gboolean find_shadow(ParseState *ps, xmlNodePtr n, const gchar *names[],
|
||||
RrAppearance *a)
|
||||
{
|
||||
return find_point(ps, n, names,
|
||||
|
@ -1325,7 +1325,7 @@ static gboolean find_shadow(ParseState *ps, xmlNodePtr n, gchar *names[],
|
|||
-20, 20, -20, 20);
|
||||
}
|
||||
|
||||
static gboolean find_appearance(ParseState *ps, xmlNodePtr n, gchar *names[],
|
||||
static gboolean find_appearance(ParseState *ps, xmlNodePtr n, const gchar *names[],
|
||||
RrAppearance *a, gboolean allow_trans)
|
||||
{
|
||||
xmlNodePtr n2;
|
||||
|
|
Loading…
Reference in a new issue