ソースを参照

Remove redundant static declaration

master
Arun Prakash Jana 6年前
コミット
9422a38b0d
この署名に対応する既知のキーがデータベースに存在しません GPGキーID: A75979F35C080412
2個のファイルの変更8行の追加11行の削除
  1. +1
    -1
      README.md
  2. +7
    -10
      src/nnn.c

+ 1
- 1
README.md ファイルの表示

@@ -137,7 +137,7 @@ Stripped binary (or script) size and memory usage of `nnn` and some other simila
<b> 1M</b> 50496 <b>15328</b> 4076 S 0.2 vifm <b> 1M</b> 50496 <b>15328</b> 4076 S 0.2 vifm
<b> 1M</b> 72152 <b>12468</b> 7336 S 0.2 mc <b> 1M</b> 72152 <b>12468</b> 7336 S 0.2 mc
<b> 70K</b> 16068 <b> 4620</b> 2408 S 0.1 ncdu <b> 70K</b> 16068 <b> 4620</b> 2408 S 0.1 ncdu
<b> 55K</b> 15720 <b> 4200</b> 2344 S 0.1 nnn -S
<b> 52K</b> 15712 <b> 4368</b> 2512 S 0.1 nnn -S
</pre> </pre>


Intrigued? Find out [HOW](https://github.com/jarun/nnn/wiki/performance-factors). Intrigued? Find out [HOW](https://github.com/jarun/nnn/wiki/performance-factors).


+ 7
- 10
src/nnn.c ファイルの表示

@@ -2536,10 +2536,10 @@ static void redraw(char *path)


static void browse(char *ipath) static void browse(char *ipath)
{ {
static char newpath[PATH_MAX] __attribute__ ((aligned));
static char mark[PATH_MAX] __attribute__ ((aligned));
static char rundir[PATH_MAX] __attribute__ ((aligned));
static char runfile[NAME_MAX + 1] __attribute__ ((aligned));
char newpath[PATH_MAX] __attribute__ ((aligned));
char mark[PATH_MAX] __attribute__ ((aligned));
char rundir[PATH_MAX] __attribute__ ((aligned));
char runfile[NAME_MAX + 1] __attribute__ ((aligned));
char *path, *lastdir, *lastname; char *path, *lastdir, *lastname;
char *dir, *tmp; char *dir, *tmp;
struct stat sb; struct stat sb;
@@ -2610,7 +2610,7 @@ begin:
} }
#endif #endif


for (;;) {
while (1) {
redraw(path); redraw(path);
nochange: nochange:
/* Exit if parent has exited */ /* Exit if parent has exited */
@@ -3368,7 +3368,7 @@ nochange:


/* Check if this is a directory */ /* Check if this is a directory */
if (!S_ISREG(dents[cur].mode)) { if (!S_ISREG(dents[cur].mode)) {
printmsg("not a regular file");
printmsg("not regular file");
goto nochange; goto nochange;
} }


@@ -3430,9 +3430,6 @@ nochange:
else else
tmp = NULL; tmp = NULL;
spawn(shell, runpath, tmp, path, F_NORMAL | F_SIGINT); spawn(shell, runpath, tmp, path, F_NORMAL | F_SIGINT);
} else {
printmsg("unsupported file");
goto nochange;
} }
break; break;
default: /* SEL_RUNCMD */ default: /* SEL_RUNCMD */
@@ -3548,7 +3545,7 @@ static void usage(void)


int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
static char cwd[PATH_MAX] __attribute__ ((aligned));
char cwd[PATH_MAX] __attribute__ ((aligned));
char *ipath = NULL; char *ipath = NULL;
int opt; int opt;




読み込み中…
キャンセル
保存