[hackers] [quark][PATCH 2/7] arg.h: more readable NULL pointer

2021-07-04 Thread Nikita Zlobin
--- arg.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arg.h b/arg.h index 5444aad..d983ebf 100644 --- a/arg.h +++ b/arg.h @@ -22,7 +22,7 @@ extern char *argv0; /* int main(int argc, char *argv[]) */ -#define ARGBEGIN for (argv0 = *argv, *argv ? (argc--, argv++) :

[hackers] [quark][PATCH 5/7] arg.h: uncluttering

2021-07-04 Thread Nikita Zlobin
--- arg.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arg.h b/arg.h index 1c2757f..47d4afb 100644 --- a/arg.h +++ b/arg.h @@ -45,9 +45,9 @@ extern char *argv0; } \ }

[hackers] [quark][PATCH 6/7] arg.h: unconditional break

2021-07-04 Thread Nikita Zlobin
--- arg.h | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/arg.h b/arg.h index 47d4afb..d565126 100644 --- a/arg.h +++ b/arg.h @@ -35,12 +35,9 @@ extern char *argv0; switch((*argv)[i_]) #define ARGEND if (argused_) {

Re: [hackers] [st][PATCH] arg.h: optimize & style

2021-07-04 Thread Nikita Zlobin
In Sun, 4 Jul 2021 12:34:54 +0200 Laslo Hunhold wrote: > the arg.h in st has some "low-hanging" fruits regarding improvements, > and I modified it accordingly in quark and farbfeld back in 2017 (see > [0]) to fix some issues. > > One example is that in my modified form, you can actually access

[hackers] [quark][PATCH 1/7] arg.h: visual separation for blocks

2021-07-04 Thread Nikita Zlobin
- multiline declaration needs clear separation from body - ARGBEGIN & ARGEND are slightly like contiguous without empty line --- arg.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arg.h b/arg.h index 35cc7cc..5444aad 100644 --- a/arg.h +++ b/arg.h @@ -23,7 +23,8 @@

[hackers] [quark][PATCH 4/7] arg.h: clean ref for argv[1] element

2021-07-04 Thread Nikita Zlobin
--- arg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arg.h b/arg.h index ba3e34a..1c2757f 100644 --- a/arg.h +++ b/arg.h @@ -46,7 +46,7 @@ extern char *argv0; } #define ARGC() ((*argv)[i_]) #define ARGF_(x) (((*argv)[i_ + 1]) ? (argused_ = 1,

[hackers] [quark][PATCH 7/7] arg.h: pointer iterator for opt letters

2021-07-04 Thread Nikita Zlobin
--- arg.h | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/arg.h b/arg.h index d565126..5e9de7c 100644 --- a/arg.h +++ b/arg.h @@ -26,24 +26,25 @@ extern char *argv0; *argv && (*argv)[0] == '-' && (*argv)[1]; \

[hackers] [quark][PATCH 3/7] arg.h: more consistency in outer loop declaration

2021-07-04 Thread Nikita Zlobin
--- arg.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arg.h b/arg.h index d983ebf..ba3e34a 100644 --- a/arg.h +++ b/arg.h @@ -23,7 +23,8 @@ extern char *argv0; /* int main(int argc, char *argv[]) */ #define ARGBEGIN for (argv0 = *argv, *argv ? (argc--, argv++) :

Re: [hackers] [st][PATCH] arg.h: optimize & style

2021-07-04 Thread Nikita Zlobin
In Sun, 4 Jul 2021 11:55:53 +0200 Hiltjo Posthuma wrote: > Hi, > > Thanks, but I prefer the current style one. > > I'm not confident this patch doesn't modify any behaviour. > For example I see the `i` variable was removed, but it is actually > important to not modify argv as this causes

Re: [hackers] [st][PATCH] arg.h: optimize & style

2021-07-04 Thread Laslo Hunhold
On Sun, 4 Jul 2021 11:55:53 +0200 Hiltjo Posthuma wrote: Dear Hiltjo, > Thanks, but I prefer the current style one. > > I'm not confident this patch doesn't modify any behaviour. > For example I see the `i` variable was removed, but it is actually > important to not modify argv as this causes

Re: [hackers] [st][PATCH] arg.h: optimize & style

2021-07-04 Thread Nikita Zlobin
В Sun, 4 Jul 2021 11:55:53 +0200 Hiltjo Posthuma пишет: > On Sun, Jul 04, 2021 at 12:30:27PM +0500, Nikita Zlobin wrote: > > - improved code readability > > - cleaned redundant variables and checks > > - isolated reusable part for (E)ARGF > > --- > > arg.h | 65 > >

Re: [hackers] [st][PATCH] arg.h: optimize & style

2021-07-04 Thread Nikita Zlobin
In Sun, 4 Jul 2021 11:55:53 +0200 Hiltjo Posthuma wrote: > On Sun, Jul 04, 2021 at 12:30:27PM +0500, Nikita Zlobin wrote: > > - improved code readability > > - cleaned redundant variables and checks > > - isolated reusable part for (E)ARGF > > --- > > arg.h | 65 > >

Re: [hackers] [st][PATCH] arg.h: optimize & style

2021-07-04 Thread Hiltjo Posthuma
On Sun, Jul 04, 2021 at 12:30:27PM +0500, Nikita Zlobin wrote: > - improved code readability > - cleaned redundant variables and checks > - isolated reusable part for (E)ARGF > --- > arg.h | 65 +-- > 1 file changed, 32 insertions(+), 33

[hackers] [st][PATCH] arg.h: optimize & style

2021-07-04 Thread Nikita Zlobin
- improved code readability - cleaned redundant variables and checks - isolated reusable part for (E)ARGF --- arg.h | 65 +-- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/arg.h b/arg.h index a22e019..ee0bbc6 100644 ---