Run Nindent on com32/lib/fopen.c
authorH. Peter Anvin <hpa@zytor.com>
Fri, 29 May 2009 22:10:23 +0000 (15:10 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Fri, 29 May 2009 22:10:23 +0000 (15:10 -0700)
Automatically reformat com32/lib/fopen.c using Nindent.

Do this for all files except HDT, gPXE and externally maintained
libraries (zlib, tinyjpeg, libpng).

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
com32/lib/fopen.c

index bf1e452..c7c122c 100644 (file)
@@ -8,36 +8,36 @@
 
 FILE *fopen(const char *file, const char *mode)
 {
-  int flags = O_RDONLY;
-  int plus = 0;
-  int fd;
+    int flags = O_RDONLY;
+    int plus = 0;
+    int fd;
 
-  while ( *mode ) {
-    switch ( *mode ) {
-    case 'r':
-      flags = O_RDONLY;
-      break;
-    case 'w':
-      flags = O_WRONLY|O_CREAT|O_TRUNC;
-      break;
-    case 'a':
-      flags = O_WRONLY|O_CREAT|O_APPEND;
-      break;
-    case '+':
-      plus = 1;
-      break;
+    while (*mode) {
+       switch (*mode) {
+       case 'r':
+           flags = O_RDONLY;
+           break;
+       case 'w':
+           flags = O_WRONLY | O_CREAT | O_TRUNC;
+           break;
+       case 'a':
+           flags = O_WRONLY | O_CREAT | O_APPEND;
+           break;
+       case '+':
+           plus = 1;
+           break;
+       }
+       mode++;
     }
-    mode++;
-  }
 
-  if ( plus ) {
-    flags = (flags & ~(O_RDONLY|O_WRONLY)) | O_RDWR;
-  }
+    if (plus) {
+       flags = (flags & ~(O_RDONLY | O_WRONLY)) | O_RDWR;
+    }
 
-  fd = open(file, flags, 0666);
+    fd = open(file, flags, 0666);
 
-  if ( fd < 0 )
-    return NULL;
-  else
-    return fdopen(fd, mode);
+    if (fd < 0)
+       return NULL;
+    else
+       return fdopen(fd, mode);
 }