summaryrefslogtreecommitdiffstats
path: root/util.c
diff options
context:
space:
mode:
authorBert <ber.t@gmx.com>2011-07-26 18:01:29 +0200
committerBert <ber.t@gmx.com>2011-07-26 18:01:29 +0200
commitb8ff1677b1cbb4d3e769861d1e14234c6a38a80a (patch)
tree32da4629b8874fbe17deab774f78314b56607302 /util.c
parenta271e167443aedca2ed9c28b51fc6de33692dadb (diff)
downloadnsxiv-b8ff1677b1cbb4d3e769861d1e14234c6a38a80a.tar.zst
Major code refactoring
- Configurable key and mouse mappings in config.h - Put event handling code from main.c into events.[ch]
Diffstat (limited to 'util.c')
-rw-r--r--util.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/util.c b/util.c
index 3957629..dee497d 100644
--- a/util.c
+++ b/util.c
@@ -26,8 +26,10 @@
#include "options.h"
#include "util.h"
-#define DNAME_CNT 512
-#define FNAME_LEN 1024
+enum {
+ DNAME_CNT = 512,
+ FNAME_LEN = 1024
+};
void cleanup();
@@ -78,7 +80,7 @@ void size_readable(float *size, const char **unit) {
const char *units[] = { "", "K", "M", "G" };
int i;
- for (i = 0; i < LEN(units) && *size > 1024; ++i)
+ for (i = 0; i < LEN(units) && *size > 1024; i++)
*size /= 1024;
*unit = units[MIN(i, LEN(units) - 1)];
}