Replace flags instead bool in global struct

This commit is contained in:
Martin Duquesnoy 2012-01-17 13:08:20 +01:00
parent 334d2d47e3
commit 717fa182d4
2 changed files with 11 additions and 10 deletions

View File

@ -154,7 +154,7 @@ wmfs_xinit(void)
*/
SLIST_INIT(&W->h.barwin);
W->running = true;
W->flags |= WMFS_RUNNING;
}
void
@ -344,7 +344,7 @@ wmfs_loop(void)
int maxfd, fd = ConnectionNumber(W->dpy);
fd_set iset;
while(W->running)
while(W->flags & WMFS_RUNNING)
{
maxfd = fd + 1;
@ -361,7 +361,7 @@ wmfs_loop(void)
{
if(FD_ISSET(fd, &iset))
{
while(W->running && XPending(W->dpy))
while((W->flags & WMFS_RUNNING) && XPending(W->dpy))
{
XNextEvent(W->dpy, &ev);
EVENT_HANDLE(&ev);
@ -446,7 +446,7 @@ wmfs_quit(void)
unlink(W->fifo.path);
}
W->running = false;
W->flags &= ~WMFS_RUNNING;
XCloseDisplay(W->dpy);
}
@ -458,8 +458,8 @@ uicb_reload(Uicb cmd)
{
(void)cmd;
W->running = false;
W->reload = true;
W->flags &= ~WMFS_RUNNING;
W->flags |= WMFS_RELOAD;
}
void
@ -467,7 +467,7 @@ uicb_quit(Uicb cmd)
{
(void)cmd;
W->running = false;
W->flags &= ~WMFS_RUNNING;
}
int
@ -519,7 +519,7 @@ main(int argc, char **argv)
wmfs_loop();
wmfs_quit();
r = W->reload;
r = (W->flags & WMFS_RELOAD);
free(W);
if(r)

View File

@ -271,13 +271,14 @@ struct wmfs
int xmaxw, xmaxh;
int nscreen;
Flags numlockmask;
#define WMFS_SCAN 0x01
#define WMFS_SCAN 0x01
#define WMFS_RUNNING 0x02
#define WMFS_RELOAD 0x04
Flags flags;
GC gc, rgc;
Atom *net_atom;
char **argv;
char confpath[MAX_PATH_LEN];
bool running, reload;
/* FIFO stuffs */
struct