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

Side by Side Diff: fusl/src/stdio/setvbuf.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 unified diff | Download patch
OLDNEW
1 #include "stdio_impl.h" 1 #include "stdio_impl.h"
2 2
3 /* This function makes no attempt to protect the user from his/her own 3 /* This function makes no attempt to protect the user from his/her own
4 * stupidity. If called any time but when then ISO C standard specifically 4 * stupidity. If called any time but when then ISO C standard specifically
5 * allows it, all hell can and will break loose, especially with threads! 5 * allows it, all hell can and will break loose, especially with threads!
6 * 6 *
7 * This implementation ignores all arguments except the buffering type, 7 * This implementation ignores all arguments except the buffering type,
8 * and uses the existing buffer allocated alongside the FILE object. 8 * and uses the existing buffer allocated alongside the FILE object.
9 * In the case of stderr where the preexisting buffer is length 1, it 9 * In the case of stderr where the preexisting buffer is length 1, it
10 * is not possible to set line buffering or full buffering. */ 10 * is not possible to set line buffering or full buffering. */
11 11
12 int setvbuf(FILE *restrict f, char *restrict buf, int type, size_t size) 12 int setvbuf(FILE* restrict f, char* restrict buf, int type, size_t size) {
13 { 13 f->lbf = EOF;
14 » f->lbf = EOF;
15 14
16 » if (type == _IONBF) 15 if (type == _IONBF)
17 » » f->buf_size = 0; 16 f->buf_size = 0;
18 » else if (type == _IOLBF) 17 else if (type == _IOLBF)
19 » » f->lbf = '\n'; 18 f->lbf = '\n';
20 19
21 » f->flags |= F_SVB; 20 f->flags |= F_SVB;
22 21
23 » return 0; 22 return 0;
24 } 23 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698