search for: preadbuff

Displaying 10 results from an estimated 10 matches for "preadbuff".

Did you mean: preadbuffer
2019 Jan 25
0
[klibc:update-dash] input: Make preadbuffer static
...libs/klibc/klibc.git;a=commit;h=ae796209b661a744c84147507984da19d4547c1f Author: Herbert Xu <herbert at gondor.apana.org.au> AuthorDate: Sun, 4 Jan 2015 21:37:13 +1100 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Fri, 25 Jan 2019 02:57:21 +0000 [klibc] input: Make preadbuffer static The function preadbuffer should be static as it's only used in input.c. Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/input.c | 4 ++-- usr/dash/input.h | 1 - 2 files changed, 2 insertions(...
2020 Mar 28
0
[klibc:update-dash] dash: input: Make preadbuffer static
...libc/klibc.git;a=commit;h=b660c1b8d408a311b9bbf631db53e5d507c54d43 Author: Herbert Xu <herbert at gondor.apana.org.au> AuthorDate: Sun, 4 Jan 2015 21:37:13 +1100 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Sat, 28 Mar 2020 21:42:54 +0000 [klibc] dash: input: Make preadbuffer static [ dash commit dee20c64b4d2625bbe6e7329404e749d5b22b2f3 ] The function preadbuffer should be static as it's only used in input.c. Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/input.c | 4 ++...
2019 Jan 25
0
[klibc:update-dash] [INPUT] Replace open-coded flushall in preadbuffer
...t;h=9a8f7bd9327b38f276e528e3429649c5f4991d91 Author: Herbert Xu <herbert at gondor.apana.org.au> AuthorDate: Mon, 27 Oct 2014 15:39:39 +0800 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Fri, 25 Jan 2019 02:57:21 +0000 [klibc] [INPUT] Replace open-coded flushall in preadbuffer Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/input.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/usr/dash/input.c b/usr/dash/input.c index 9e533a47..f11ac842 100644 --- a/us...
2020 Mar 28
0
[klibc:update-dash] dash: [INPUT] Replace open-coded flushall in preadbuffer
...ef351e06e79d4c976674939de5c321557b3cfb Author: Herbert Xu <herbert at gondor.apana.org.au> AuthorDate: Mon, 27 Oct 2014 15:39:39 +0800 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Sat, 28 Mar 2020 21:42:54 +0000 [klibc] dash: [INPUT] Replace open-coded flushall in preadbuffer [ dash commit c4d12c3f6424e801ccddda8894aad04d24333f82 ] Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/input.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/usr/dash/input.c b...
2019 Jan 25
0
[klibc:update-dash] input: Allow two consecutive calls to pungetc
...h/input.c @@ -102,10 +102,20 @@ RESET { int pgetc(void) { + int c; + + if (parsefile->unget) + return parsefile->lastc[--parsefile->unget]; + if (--parsefile->nleft >= 0) - return (signed char)*parsefile->nextc++; + c = (signed char)*parsefile->nextc++; else - return preadbuffer(); + c = preadbuffer(); + + parsefile->lastc[1] = parsefile->lastc[0]; + parsefile->lastc[0] = c; + + return c; } @@ -194,7 +204,7 @@ static int preadbuffer(void) #endif char savec; - while (unlikely(parsefile->strpush)) { + if (unlikely(parsefile->strpush)) { if (...
2020 Mar 28
0
[klibc:update-dash] dash: input: Allow two consecutive calls to pungetc
...h/input.c @@ -102,10 +102,20 @@ RESET { int pgetc(void) { + int c; + + if (parsefile->unget) + return parsefile->lastc[--parsefile->unget]; + if (--parsefile->nleft >= 0) - return (signed char)*parsefile->nextc++; + c = (signed char)*parsefile->nextc++; else - return preadbuffer(); + c = preadbuffer(); + + parsefile->lastc[1] = parsefile->lastc[0]; + parsefile->lastc[0] = c; + + return c; } @@ -194,7 +204,7 @@ static int preadbuffer(void) #endif char savec; - while (unlikely(parsefile->strpush)) { + if (unlikely(parsefile->strpush)) { if (...
2019 Jan 25
0
[klibc:update-dash] [INPUT] Kill pgetc_macro
...7 deletions(-) diff --git a/usr/dash/input.c b/usr/dash/input.c index d31c45bb..9e533a47 100644 --- a/usr/dash/input.c +++ b/usr/dash/input.c @@ -134,7 +134,10 @@ RESET { int pgetc(void) { - return pgetc_macro(); + if (--parsenleft >= 0) + return (signed char)*parsenextc++; + else + return preadbuffer(); } @@ -147,7 +150,7 @@ pgetc2() { int c; do { - c = pgetc_macro(); + c = pgetc(); } while (c == PEOA); return c; } diff --git a/usr/dash/input.h b/usr/dash/input.h index 50a77971..775291b8 100644 --- a/usr/dash/input.h +++ b/usr/dash/input.h @@ -61,6 +61,3 @@ void setinputstrin...
2020 Mar 28
0
[klibc:update-dash] dash: [INPUT] Kill pgetc_macro
...7 deletions(-) diff --git a/usr/dash/input.c b/usr/dash/input.c index d31c45bb..9e533a47 100644 --- a/usr/dash/input.c +++ b/usr/dash/input.c @@ -134,7 +134,10 @@ RESET { int pgetc(void) { - return pgetc_macro(); + if (--parsenleft >= 0) + return (signed char)*parsenextc++; + else + return preadbuffer(); } @@ -147,7 +150,7 @@ pgetc2() { int c; do { - c = pgetc_macro(); + c = pgetc(); } while (c == PEOA); return c; } diff --git a/usr/dash/input.h b/usr/dash/input.h index 50a77971..775291b8 100644 --- a/usr/dash/input.h +++ b/usr/dash/input.h @@ -61,6 +61,3 @@ void setinputstrin...
2019 Jan 25
0
[klibc:update-dash] input: Move all input state into parsefile
...lear input buffer */ + basepf.lleft = basepf.nleft = 0; popallfiles(); } #endif @@ -131,8 +102,8 @@ RESET { int pgetc(void) { - if (--parsenleft >= 0) - return (signed char)*parsenextc++; + if (--parsefile->nleft >= 0) + return (signed char)*parsefile->nextc++; else return preadbuffer(); } @@ -158,7 +129,7 @@ preadfd(void) { int nr; char *buf = parsefile->buf; - parsenextc = buf; + parsefile->nextc = buf; retry: #ifndef SMALL @@ -225,29 +196,32 @@ static int preadbuffer(void) while (unlikely(parsefile->strpush)) { if ( - parsenleft == -1 &&...
2020 Mar 28
0
[klibc:update-dash] dash: input: Move all input state into parsefile
...lear input buffer */ + basepf.lleft = basepf.nleft = 0; popallfiles(); } #endif @@ -131,8 +102,8 @@ RESET { int pgetc(void) { - if (--parsenleft >= 0) - return (signed char)*parsenextc++; + if (--parsefile->nleft >= 0) + return (signed char)*parsefile->nextc++; else return preadbuffer(); } @@ -158,7 +129,7 @@ preadfd(void) { int nr; char *buf = parsefile->buf; - parsenextc = buf; + parsefile->nextc = buf; retry: #ifndef SMALL @@ -225,29 +196,32 @@ static int preadbuffer(void) while (unlikely(parsefile->strpush)) { if ( - parsenleft == -1 &&...