Minor cleanup.

This commit is contained in:
Kris Maglione 2010-06-27 17:11:08 -04:00
parent 86d42bceb6
commit a5ca791958
3 changed files with 10 additions and 37 deletions

View File

@ -15,7 +15,6 @@ enum DebugOpt {
#define Dprint(x, ...) BLOCK( if((debugflag|debugfile)&(x)) debug(x, __VA_ARGS__) ) #define Dprint(x, ...) BLOCK( if((debugflag|debugfile)&(x)) debug(x, __VA_ARGS__) )
void debug(int, const char*, ...); void debug(int, const char*, ...);
void dprint(const char*, ...);
void dwrite(int, void*, int, bool); void dwrite(int, void*, int, bool);
bool setdebug(int); bool setdebug(int);
void vdebug(int, const char*, va_list); void vdebug(int, const char*, va_list);

View File

@ -226,13 +226,6 @@ char* readctl_view(View*);
Area* strarea(View*, ulong, const char*); Area* strarea(View*, ulong, const char*);
void warning(const char*, ...); void warning(const char*, ...);
/* debug */
void debug(int, const char*, ...);
void dprint(const char*, ...);
void dwrite(int, void*, int, bool);
bool setdebug(int);
void vdebug(int, const char*, va_list);
/* mouse.c */ /* mouse.c */
Window* constraintwin(Rectangle); Window* constraintwin(Rectangle);
void destroyconstraintwin(Window*); void destroyconstraintwin(Window*);

View File

@ -189,15 +189,6 @@ debug(int flag, const char *fmt, ...) {
va_end(ap); va_end(ap);
} }
void
dprint(const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
vdebug(0, fmt, ap);
va_end(ap);
}
void void
dwrite(int flag, void *buf, int n, bool always) { dwrite(int flag, void *buf, int n, bool always) {
int i; int i;
@ -255,8 +246,10 @@ lookup_file(IxpFileId *parent, char *name)
last = &ret; last = &ret;
ret = nil; ret = nil;
for(; dir->name; dir++) { for(; dir->name; dir++) {
# define push_file(nam) \ # define push_file(nam, id_, vol) \
file = ixp_srv_getfile(); \ file = ixp_srv_getfile(); \
file->id = id_; \
file->volatil = vol; \
*last = file; \ *last = file; \
last = &file->next; \ last = &file->next; \
file->tab = *dir; \ file->tab = *dir; \
@ -267,10 +260,8 @@ lookup_file(IxpFileId *parent, char *name)
case FsDClients: case FsDClients:
if(!name || !strcmp(name, "sel")) { if(!name || !strcmp(name, "sel")) {
if((c = selclient())) { if((c = selclient())) {
push_file("sel"); push_file("sel", c->w.xid, true);
file->volatil = true;
file->p.client = c; file->p.client = c;
file->id = c->w.xid;
file->index = c->w.xid; file->index = c->w.xid;
} }
if(name) if(name)
@ -284,10 +275,8 @@ lookup_file(IxpFileId *parent, char *name)
} }
for(c=client; c; c=c->next) { for(c=client; c; c=c->next) {
if(!name || c->w.xid == id) { if(!name || c->w.xid == id) {
push_file(sxprint("%#C", c)); push_file(sxprint("%#C", c), c->w.xid, true);
file->volatil = true;
file->p.client = c; file->p.client = c;
file->id = c->w.xid;
file->index = c->w.xid; file->index = c->w.xid;
assert(file->tab.name); assert(file->tab.name);
if(name) if(name)
@ -298,8 +287,7 @@ lookup_file(IxpFileId *parent, char *name)
case FsDDebug: case FsDDebug:
for(i=0; i < nelem(pdebug); i++) for(i=0; i < nelem(pdebug); i++)
if(!name || !strcmp(name, debugtab[i])) { if(!name || !strcmp(name, debugtab[i])) {
push_file(debugtab[i]); push_file(debugtab[i], i, false);
file->id = i;
if(name) if(name)
goto LastItem; goto LastItem;
} }
@ -307,20 +295,16 @@ lookup_file(IxpFileId *parent, char *name)
case FsDTags: case FsDTags:
if(!name || !strcmp(name, "sel")) { if(!name || !strcmp(name, "sel")) {
if(selview) { if(selview) {
push_file("sel"); push_file("sel", selview->id, true);
file->volatil = true;
file->p.view = selview; file->p.view = selview;
file->id = selview->id;
} }
if(name) if(name)
goto LastItem; goto LastItem;
} }
for(v=view; v; v=v->next) { for(v=view; v; v=v->next) {
if(!name || !strcmp(name, v->name)) { if(!name || !strcmp(name, v->name)) {
push_file(v->name); push_file(v->name, v->id, true);
file->volatil = true;
file->p.view = v; file->p.view = v;
file->id = v->id;
if(name) if(name)
goto LastItem; goto LastItem;
} }
@ -329,10 +313,8 @@ lookup_file(IxpFileId *parent, char *name)
case FsDBars: case FsDBars:
for(b=*parent->p.bar_p; b; b=b->next) { for(b=*parent->p.bar_p; b; b=b->next) {
if(!name || !strcmp(name, b->name)) { if(!name || !strcmp(name, b->name)) {
push_file(b->name); push_file(b->name, b->id, true);
file->volatil = true;
file->p.bar = b; file->p.bar = b;
file->id = b->id;
if(name) if(name)
goto LastItem; goto LastItem;
} }
@ -341,8 +323,7 @@ lookup_file(IxpFileId *parent, char *name)
} }
}else /* Static dirs */ }else /* Static dirs */
if(!name && !(dir->flags & FLHide) || name && !strcmp(name, dir->name)) { if(!name && !(dir->flags & FLHide) || name && !strcmp(name, dir->name)) {
push_file(file->tab.name); push_file(file->tab.name, 0, false);
file->id = 0;
file->p.ref = parent->p.ref; file->p.ref = parent->p.ref;
file->index = parent->index; file->index = parent->index;
/* Special considerations: */ /* Special considerations: */