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

Unified Diff: fusl/src/stdio/ungetc.c

Issue 1714623002: [fusl] clang-format fusl (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: headers too Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: fusl/src/stdio/ungetc.c
diff --git a/fusl/src/stdio/ungetc.c b/fusl/src/stdio/ungetc.c
index 180673a47663ad57b11d3e6525c35cc23858939a..c0cb9cb4d706fcfa5627bb69edc18085e8e580c9 100644
--- a/fusl/src/stdio/ungetc.c
+++ b/fusl/src/stdio/ungetc.c
@@ -1,20 +1,21 @@
#include "stdio_impl.h"
-int ungetc(int c, FILE *f)
-{
- if (c == EOF) return c;
+int ungetc(int c, FILE* f) {
+ if (c == EOF)
+ return c;
- FLOCK(f);
+ FLOCK(f);
- if (!f->rpos) __toread(f);
- if (!f->rpos || f->rpos <= f->buf - UNGET) {
- FUNLOCK(f);
- return EOF;
- }
+ if (!f->rpos)
+ __toread(f);
+ if (!f->rpos || f->rpos <= f->buf - UNGET) {
+ FUNLOCK(f);
+ return EOF;
+ }
- *--f->rpos = c;
- f->flags &= ~F_EOF;
+ *--f->rpos = c;
+ f->flags &= ~F_EOF;
- FUNLOCK(f);
- return c;
+ FUNLOCK(f);
+ return c;
}

Powered by Google App Engine
This is Rietveld 408576698