clang-format

This commit is contained in:
2024-09-10 13:03:02 -04:00
parent 53c617d779
commit d66450e427
381 changed files with 28864 additions and 34170 deletions

View File

@@ -35,22 +35,20 @@
* and return it or the symbolic constant EOF (-1).
*/
int
getchar(void)
{
char ch;
int len;
int getchar(void) {
char ch;
int len;
len = read(STDIN_FILENO, &ch, 1);
if (len<=0) {
/* end of file or error */
return EOF;
}
len = read(STDIN_FILENO, &ch, 1);
if (len <= 0) {
/* end of file or error */
return EOF;
}
/*
* Cast through unsigned char, to prevent sign extension. This
* sends back values on the range 0-255, rather than -128 to 127,
* so EOF can be distinguished from legal input.
*/
return (int)(unsigned char)ch;
/*
* Cast through unsigned char, to prevent sign extension. This
* sends back values on the range 0-255, rather than -128 to 127,
* so EOF can be distinguished from legal input.
*/
return (int)(unsigned char)ch;
}