From b2b43689f03a63e136aa54e604df5d64f3d20a23 Mon Sep 17 00:00:00 2001 From: yorhel <yorhel@ce56bc8d-f834-0410-b703-f827bd498a76> Date: Sun, 29 Jul 2007 14:06:05 +0000 Subject: [PATCH] Preperations for the export feature: re-ordered the file flags and removed FF_OTHER (which is the same as \!(FF_DIR | FF_FILE)) git-svn-id: svn://blicky.net/ncdu/trunk@16 ce56bc8d-f834-0410-b703-f827bd498a76 --- src/browser.c | 3 ++- src/calc.c | 3 +-- src/ncdu.h | 17 ++++++++--------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/browser.c b/src/browser.c index f77da29..8d25ae8 100644 --- a/src/browser.c +++ b/src/browser.c @@ -227,7 +227,8 @@ void drawBrowser(int change) { n->flags & FF_ERR ? '!' : n->flags & FF_SERR ? '.' : n->flags & FF_OTHFS ? '>' : - n->flags & FF_OTHER ? '@' : + !(n->flags & FF_FILE + || n->flags & FF_DIR) ? '@' : n->flags & FF_DIR && n->sub == NULL ? 'e' : ' ' ; diff --git a/src/calc.c b/src/calc.c index 08ef922..5a6f528 100644 --- a/src/calc.c +++ b/src/calc.c @@ -313,8 +313,7 @@ int calcDir(struct dir *dest, char *path) { if(!(d->flags & FF_EXL)) for(t = dest; t != NULL; t = t->parent) t->dirs++; - } else - d->flags |= FF_OTHER; + } /* count the size */ if(!(d->flags & FF_EXL || d->flags & FF_OTHFS)) { diff --git a/src/ncdu.h b/src/ncdu.h index b529c63..7e947b6 100644 --- a/src/ncdu.h +++ b/src/ncdu.h @@ -80,15 +80,14 @@ * G L O B A L F L A G S */ /* File Flags (struct dir -> flags) */ -#define FF_DIR 1 -#define FF_FILE 2 -#define FF_OTHER 4 -#define FF_ERR 8 -#define FF_OTHFS 16 -#define FF_SERR 32 /* error in subdirectory */ -#define FF_BSEL 64 /* selected */ -#define FF_EXL 128 /* excluded using exlude patterns */ -#define FF_PAR 256 /* reference to parent directory (hack) */ +#define FF_DIR 0x01 +#define FF_FILE 0x02 +#define FF_ERR 0x04 /* error while reading this item */ +#define FF_OTHFS 0x08 /* excluded because it was an other filesystem */ +#define FF_EXL 0x10 /* excluded using exlude patterns */ +#define FF_SERR 0x20 /* error in subdirectory */ +#define FF_BSEL 0x40 /* selected */ +#define FF_PAR 0x80 /* reference to parent directory (hack) */ /* Settings Flags (int sflags) */ #define SF_SMFS 1 /* same filesystem */ -- GitLab