Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
spectrwm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
shut a bunch of warnings up
[spectrwm.git]
/
spectrwm.c
diff --git
a/spectrwm.c
b/spectrwm.c
index
6242ac6
..
6e88cdd
100644
(file)
--- a/
spectrwm.c
+++ b/
spectrwm.c
@@
-701,7
+701,7
@@
void update_window(struct ws_win *);
char *
expand_tilde(char *s)
{
char *
expand_tilde(char *s)
{
- struct passwd *pwd;
+ struct passwd *ppwd;
int i, max;
char *user;
const char *sc = s;
int i, max;
char *user;
const char *sc = s;
@@
-728,11
+728,11
@@
expand_tilde(char *s)
user[i] = '\0';
s = &s[i];
user[i] = '\0';
s = &s[i];
- pwd = strlen(user) == 0 ? getpwuid(getuid()) : getpwnam(user);
- if (pwd == NULL)
+ ppwd = strlen(user) == 0 ? getpwuid(getuid()) : getpwnam(user);
+ if (ppwd == NULL)
result = strdup(sc);
else
result = strdup(sc);
else
- if (asprintf(&result, "%s%s", pwd->pw_dir, s) == -1)
+ if (asprintf(&result, "%s%s", ppwd->pw_dir, s) == -1)
result = NULL;
out:
if (result == NULL)
result = NULL;
out:
if (result == NULL)
@@
-1009,7
+1009,7
@@
ewmh_update_actions(struct ws_win *win)
#define _NET_WM_STATE_TOGGLE 2 /* toggle property */
void
#define _NET_WM_STATE_TOGGLE 2 /* toggle property */
void
-ewmh_update_win_state(struct ws_win *win, long state, long action)
+ewmh_update_win_state(struct ws_win *win, xcb_atom_t state, long action)
{
unsigned int mask = 0;
unsigned int changed = 0;
{
unsigned int mask = 0;
unsigned int changed = 0;
@@
-1908,7
+1908,7
@@
bar_refresh(void)
void
bar_setup(struct swm_region *r)
{
void
bar_setup(struct swm_region *r)
{
- char *font, *fontpos, *dup, *search;
+ char *font, *fontpos, *d, *search;
int count;
xcb_screen_t *screen;
uint32_t wa[3];
int count;
xcb_screen_t *screen;
uint32_t wa[3];
@@
-1924,9
+1924,9
@@
bar_setup(struct swm_region *r)
err(1, "bar_setup: calloc: failed to allocate memory.");
if (bar_font == NULL) {
err(1, "bar_setup: calloc: failed to allocate memory.");
if (bar_font == NULL) {
- if ((dup = strdup(bar_fonts)) == NULL)
+ if ((d = strdup(bar_fonts)) == NULL)
errx(1, "insufficient memory.");
errx(1, "insufficient memory.");
- search = dup;
+ search = d;
while ((font = strsep(&search, ",")) != NULL) {
if (*font == '\0')
continue;
while ((font = strsep(&search, ",")) != NULL) {
if (*font == '\0')
continue;
@@
-1955,7
+1955,7
@@
bar_setup(struct swm_region *r)
break;
}
}
break;
}
}
- free(dup);
+ free(d);
}
if (bar_font == NULL)
}
if (bar_font == NULL)
@@
-5780,7
+5780,7
@@
setconfquirk(char *selector, char *value, int flags)
{
char *cp, *class, *name;
int retval;
{
char *cp, *class, *name;
int retval;
- unsigned long quirks;
+ unsigned long qrks;
/* suppress unused warning since var is needed */
(void)flags;
/* suppress unused warning since var is needed */
(void)flags;
@@
-5792,8
+5792,8
@@
setconfquirk(char *selector, char *value, int flags)
*cp = '\0';
class = selector;
name = cp + 1;
*cp = '\0';
class = selector;
name = cp + 1;
- if ((retval = parsequirks(value, &quirks)) == 0)
- setquirk(class, name, quirks);
+ if ((retval = parsequirks(value, &qrks)) == 0)
+ setquirk(class, name, qrks);
return (retval);
}
return (retval);
}
@@
-6139,7
+6139,7
@@
setautorun(char *selector, char *value, int flags)
int
setlayout(char *selector, char *value, int flags)
{
int
setlayout(char *selector, char *value, int flags)
{
- int ws_id, i, x, mg, ma, si, raise, f = 0;
+ int ws_id, i, x, mg, ma, si, ar, f = 0;
int st = SWM_V_STACK, num_screens;
char s[1024];
struct workspace *ws;
int st = SWM_V_STACK, num_screens;
char s[1024];
struct workspace *ws;
@@
-6153,7
+6153,7
@@
setlayout(char *selector, char *value, int flags)
bzero(s, sizeof s);
if (sscanf(value, "ws[%d]:%d:%d:%d:%d:%1023c",
bzero(s, sizeof s);
if (sscanf(value, "ws[%d]:%d:%d:%d:%d:%1023c",
- &ws_id, &mg, &ma, &si, &raise, s) != 6)
+ &ws_id, &mg, &ma, &si, &ar, s) != 6)
errx(1, "invalid layout entry, should be 'ws[<idx>]:"
"<master_grow>:<master_add>:<stack_inc>:<always_raise>:"
"<type>'");
errx(1, "invalid layout entry, should be 'ws[<idx>]:"
"<master_grow>:<master_add>:<stack_inc>:<always_raise>:"
"<type>'");
@@
-6183,7
+6183,7
@@
setlayout(char *selector, char *value, int flags)
ws = (struct workspace *)&screens[i].ws;
ws[ws_id].cur_layout = &layouts[st];
ws = (struct workspace *)&screens[i].ws;
ws[ws_id].cur_layout = &layouts[st];
- ws[ws_id].always_raise = raise;
+ ws[ws_id].always_raise = ar;
if (st == SWM_MAX_STACK)
continue;
if (st == SWM_MAX_STACK)
continue;
@@
-6279,7
+6279,7
@@
conf_load(char *filename, int keymapping)
FILE *config;
char *line, *cp, *optsub, *optval;
size_t linelen, lineno = 0;
FILE *config;
char *line, *cp, *optsub, *optval;
size_t linelen, lineno = 0;
- int wordlen, i, optind;
+ int wordlen, i, optidx;
struct config_option *opt;
DNPRINTF(SWM_D_CONF, "conf_load: begin\n");
struct config_option *opt;
DNPRINTF(SWM_D_CONF, "conf_load: begin\n");
@@
-6315,16
+6315,16
@@
conf_load(char *filename, int keymapping)
filename, lineno);
goto out;
}
filename, lineno);
goto out;
}
- optind = -1;
+ optidx = -1;
for (i = 0; i < LENGTH(configopt); i++) {
opt = &configopt[i];
if (!strncasecmp(cp, opt->optname, wordlen) &&
(int)strlen(opt->optname) == wordlen) {
for (i = 0; i < LENGTH(configopt); i++) {
opt = &configopt[i];
if (!strncasecmp(cp, opt->optname, wordlen) &&
(int)strlen(opt->optname) == wordlen) {
- optind = i;
+ optidx = i;
break;
}
}
break;
}
}
- if (optind == -1) {
+ if (optidx == -1) {
warnx("%s: line %zd: unknown option %.*s",
filename, lineno, wordlen, cp);
goto out;
warnx("%s: line %zd: unknown option %.*s",
filename, lineno, wordlen, cp);
goto out;
@@
-6363,10
+6363,10
@@
conf_load(char *filename, int keymapping)
/* get RHS value */
optval = strdup(cp);
/* call function to deal with it all */
/* get RHS value */
optval = strdup(cp);
/* call function to deal with it all */
- if (configopt[optind].func(optsub, optval,
- configopt[optind].funcflags) != 0)
+ if (configopt[optidx].func(optsub, optval,
+ configopt[optidx].funcflags) != 0)
errx(1, "%s: line %zd: invalid data for %s",
errx(1, "%s: line %zd: invalid data for %s",
- filename, lineno, configopt[optind].optname);
+ filename, lineno, configopt[optidx].optname);
free(optval);
free(optsub);
free(line);
free(optval);
free(optsub);
free(line);
@@
-7407,13
+7407,12
@@
clientmessage(xcb_client_message_event_t *e)
xcb_flush(conn);
}
xcb_flush(conn);
}
-#ifdef XCB_CONN_ERROR
void
check_conn(void)
{
int errcode = xcb_connection_has_error(conn);
void
check_conn(void)
{
int errcode = xcb_connection_has_error(conn);
+#ifdef XCB_CONN_ERROR
char *s;
char *s;
-
switch (errcode) {
case XCB_CONN_ERROR:
s = "Socket error, pipe error or other stream error.";
switch (errcode) {
case XCB_CONN_ERROR:
s = "Socket error, pipe error or other stream error.";
@@
-7433,18
+7432,13
@@
check_conn(void)
default:
s = "Unknown error.";
}
default:
s = "Unknown error.";
}
-
if (errcode)
errx(errcode, "X CONNECTION ERROR: %s", s);
if (errcode)
errx(errcode, "X CONNECTION ERROR: %s", s);
-}
#else
#else
-void
-check_conn(void)
-{
- if (conn->has_error)
- errx(1, "X CONNECTION ERROR");
-}
+ if (errcode)
+ errx(errcode, "X CONNECTION ERROR");
#endif
#endif
+}
int
enable_wm(void)
int
enable_wm(void)