use restrict everywhere it's required by c99 and/or posix 2008
[musl] / src / stdio / fputws.c
1 #include "stdio_impl.h"
2
3 int fputws(const wchar_t *restrict ws, FILE *restrict f)
4 {
5         unsigned char buf[BUFSIZ];
6         size_t l=0;
7
8         FLOCK(f);
9
10         f->mode |= f->mode+1;
11
12         while (ws && (l = wcsrtombs((void *)buf, (void*)&ws, sizeof buf, 0))+1 > 1)
13                 if (__fwritex(buf, l, f) < l) {
14                         FUNLOCK(f);
15                         return -1;
16                 }
17
18         FUNLOCK(f);
19
20         return l; /* 0 or -1 */
21 }
22
23 weak_alias(fputws, fputws_unlocked);