forked from Telodendria/Telodendria
Format code.
This commit is contained in:
parent
27b3b6cdc6
commit
a97a593f21
3 changed files with 11 additions and 12 deletions
|
@ -43,7 +43,7 @@ IoWriteFile(void *cookie, void *buf, size_t nBytes)
|
|||
* fwrite() may be buffered on some platforms, but at this low level,
|
||||
* it should not be; buffering happens in Stream, not Io.
|
||||
*/
|
||||
fflush(fp);
|
||||
fflush(fp);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
|
19
src/Stream.c
19
src/Stream.c
|
@ -97,7 +97,7 @@ StreamFd(int fd)
|
|||
}
|
||||
|
||||
Stream *
|
||||
StreamFile(FILE *fp)
|
||||
StreamFile(FILE * fp)
|
||||
{
|
||||
Io *io = IoFile(fp);
|
||||
|
||||
|
@ -164,14 +164,13 @@ StreamClose(Stream * stream)
|
|||
int
|
||||
StreamVprintf(Stream * stream, const char *fmt, va_list ap)
|
||||
{
|
||||
/* This might look like very similar code to IoVprintf(),
|
||||
* but I chose not to defer to IoVprintf() because that
|
||||
* would require us to immediately flush the buffer, since
|
||||
* the Io API is unbuffered. StreamPuts() uses StreamPutc()
|
||||
* under the hood, which is buffered. It therefore allows
|
||||
* us to finish filling the buffer and then only flush it
|
||||
* when necessary, preventing superfluous writes.
|
||||
*/
|
||||
/* This might look like very similar code to IoVprintf(), but I
|
||||
* chose not to defer to IoVprintf() because that would require us
|
||||
* to immediately flush the buffer, since the Io API is unbuffered.
|
||||
* StreamPuts() uses StreamPutc() under the hood, which is
|
||||
* buffered. It therefore allows us to finish filling the buffer
|
||||
* and then only flush it when necessary, preventing superfluous
|
||||
* writes. */
|
||||
char *buf;
|
||||
ssize_t len;
|
||||
|
||||
|
@ -382,7 +381,7 @@ StreamPutc(Stream * stream, int c)
|
|||
}
|
||||
|
||||
int
|
||||
StreamPuts(Stream *stream, char *str)
|
||||
StreamPuts(Stream * stream, char *str)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ extern int
|
|||
StreamPutc(Stream *, int);
|
||||
|
||||
extern int
|
||||
StreamPuts(Stream *, char *);
|
||||
StreamPuts(Stream *, char *);
|
||||
|
||||
extern int
|
||||
StreamEof(Stream *);
|
||||
|
|
Loading…
Reference in a new issue