Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: fusl/src/internal/shgetc.c

Issue 1575153003: Remove -Wno-logical-op-parentheses for fusl build (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #include "shgetc.h" 1 #include "shgetc.h"
2 2
3 void __shlim(FILE *f, off_t lim) 3 void __shlim(FILE *f, off_t lim)
4 { 4 {
5 f->shlim = lim; 5 f->shlim = lim;
6 f->shcnt = f->rend - f->rpos; 6 f->shcnt = f->rend - f->rpos;
7 if (lim && f->shcnt > lim) 7 if (lim && f->shcnt > lim)
8 f->shend = f->rpos + lim; 8 f->shend = f->rpos + lim;
9 else 9 else
10 f->shend = f->rend; 10 f->shend = f->rend;
11 } 11 }
12 12
13 int __shgetc(FILE *f) 13 int __shgetc(FILE *f)
14 { 14 {
15 int c; 15 int c;
16 » if (f->shlim && f->shcnt >= f->shlim || (c=__uflow(f)) < 0) { 16 » if ((f->shlim && f->shcnt >= f->shlim) || (c=__uflow(f)) < 0) {
17 f->shend = 0; 17 f->shend = 0;
18 return EOF; 18 return EOF;
19 } 19 }
20 if (f->shlim && f->rend - f->rpos > f->shlim - f->shcnt - 1) 20 if (f->shlim && f->rend - f->rpos > f->shlim - f->shcnt - 1)
21 f->shend = f->rpos + (f->shlim - f->shcnt - 1); 21 f->shend = f->rpos + (f->shlim - f->shcnt - 1);
22 else 22 else
23 f->shend = f->rend; 23 f->shend = f->rend;
24 if (f->rend) f->shcnt += f->rend - f->rpos + 1; 24 if (f->rend) f->shcnt += f->rend - f->rpos + 1;
25 if (f->rpos[-1] != c) f->rpos[-1] = c; 25 if (f->rpos[-1] != c) f->rpos[-1] = c;
26 return c; 26 return c;
27 } 27 }
OLDNEW
« no previous file with comments | « fusl/BUILD.gn ('k') | fusl/src/locale/iconv.c » ('j') | fusl/src/locale/locale_map.c » ('J')

Powered by Google App Engine
This is Rietveld 408576698