浏览代码

Use a shorter macro

master
Arun Prakash Jana 6 年前
父节点
当前提交
95d0eb6a17
找不到此签名对应的密钥 GPG 密钥 ID: A75979F35C080412
共有 2 个文件被更改,包括 7 次插入7 次删除
  1. +1
    -1
      Makefile
  2. +6
    -6
      src/nnn.c

+ 1
- 1
Makefile 查看文件

@@ -36,7 +36,7 @@ $(BIN): $(SRC)
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS) $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)


debug: $(SRC) debug: $(SRC)
$(CC) -DDEBUGMODE -g $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(BIN) $^ $(LDLIBS)
$(CC) -DDBGMODE -g $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(BIN) $^ $(LDLIBS)


install: all install: all
$(INSTALL) -m 0755 -d $(DESTDIR)$(PREFIX)/bin $(INSTALL) -m 0755 -d $(DESTDIR)$(PREFIX)/bin


+ 6
- 6
src/nnn.c 查看文件

@@ -101,7 +101,7 @@


#include "nnn.h" #include "nnn.h"


#ifdef DEBUGMODE
#ifdef DBGMODE
static int DEBUG_FD; static int DEBUG_FD;


static int static int
@@ -158,7 +158,7 @@ disabledbg()
#define DPRINTF_U(x) #define DPRINTF_U(x)
#define DPRINTF_S(x) #define DPRINTF_S(x)
#define DPRINTF_P(x) #define DPRINTF_P(x)
#endif /* DEBUGMODE */
#endif /* DBGMODE */


/* Macro definitions */ /* Macro definitions */
#define VERSION "2.3" #define VERSION "2.3"
@@ -2717,7 +2717,7 @@ static int dentfind(const char *fname, int n)


static void populate(char *path, char *lastname) static void populate(char *path, char *lastname)
{ {
#ifdef DEBUGMODE
#ifdef DBGMODE
struct timespec ts1, ts2; struct timespec ts1, ts2;


clock_gettime(CLOCK_REALTIME, &ts1); /* Use CLOCK_MONOTONIC on FreeBSD */ clock_gettime(CLOCK_REALTIME, &ts1); /* Use CLOCK_MONOTONIC on FreeBSD */
@@ -2729,7 +2729,7 @@ static void populate(char *path, char *lastname)


qsort(dents, ndents, sizeof(*dents), entrycmp); qsort(dents, ndents, sizeof(*dents), entrycmp);


#ifdef DEBUGMODE
#ifdef DBGMODE
clock_gettime(CLOCK_REALTIME, &ts2); clock_gettime(CLOCK_REALTIME, &ts2);
DPRINTF_U(ts2.tv_nsec - ts1.tv_nsec); DPRINTF_U(ts2.tv_nsec - ts1.tv_nsec);
#endif #endif
@@ -4252,7 +4252,7 @@ int main(int argc, char *argv[])
#endif #endif
read_history(NULL); read_history(NULL);


#ifdef DEBUGMODE
#ifdef DBGMODE
enabledbg(); enabledbg();
#endif #endif
if (!initcurses()) if (!initcurses())
@@ -4286,7 +4286,7 @@ int main(int argc, char *argv[])
close(kq); close(kq);
#endif #endif


#ifdef DEBUGMODE
#ifdef DBGMODE
disabledbg(); disabledbg();
#endif #endif
return 0; return 0;


正在加载...
取消
保存