Run Nindent on libfat/cache.c
authorH. Peter Anvin <hpa@zytor.com>
Fri, 29 May 2009 22:10:32 +0000 (15:10 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Fri, 29 May 2009 22:10:32 +0000 (15:10 -0700)
Automatically reformat libfat/cache.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>
libfat/cache.c

index 9e8df36..85b7ead 100644 (file)
 #include <stdlib.h>
 #include "libfatint.h"
 
-void * libfat_get_sector(struct libfat_filesystem *fs, libfat_sector_t n)
+void *libfat_get_sector(struct libfat_filesystem *fs, libfat_sector_t n)
 {
-  struct libfat_sector *ls;
+    struct libfat_sector *ls;
 
-  for ( ls = fs->sectors ; ls ; ls = ls->next ) {
-    if ( ls->n == n )
-      return ls->data;         /* Found in cache */
-  }
+    for (ls = fs->sectors; ls; ls = ls->next) {
+       if (ls->n == n)
+           return ls->data;    /* Found in cache */
+    }
 
-  /* Not found in cache */
-  ls = malloc(sizeof(struct libfat_sector));
-  if ( !ls ) {
-    libfat_flush(fs);
+    /* Not found in cache */
     ls = malloc(sizeof(struct libfat_sector));
+    if (!ls) {
+       libfat_flush(fs);
+       ls = malloc(sizeof(struct libfat_sector));
 
-    if ( !ls )
-      return NULL;             /* Can't allocate memory */
-  }
+       if (!ls)
+           return NULL;        /* Can't allocate memory */
+    }
 
-  if ( fs->read(fs->readptr, ls->data, LIBFAT_SECTOR_SIZE, n)
-       != LIBFAT_SECTOR_SIZE ) {
-    free(ls);
-    return NULL;               /* I/O error */
-  }
+    if (fs->read(fs->readptr, ls->data, LIBFAT_SECTOR_SIZE, n)
+       != LIBFAT_SECTOR_SIZE) {
+       free(ls);
+       return NULL;            /* I/O error */
+    }
 
-  ls->n = n;
-  ls->next = fs->sectors;
-  fs->sectors = ls;
+    ls->n = n;
+    ls->next = fs->sectors;
+    fs->sectors = ls;
 
-  return ls->data;
+    return ls->data;
 }
 
 void libfat_flush(struct libfat_filesystem *fs)
 {
-  struct libfat_sector *ls, *lsnext;
+    struct libfat_sector *ls, *lsnext;
 
-  lsnext = fs->sectors;
-  fs->sectors = NULL;
+    lsnext = fs->sectors;
+    fs->sectors = NULL;
 
-  for ( ls = lsnext ; ls ; ls = lsnext ) {
-    lsnext = ls->next;
-    free(ls);
-  }
+    for (ls = lsnext; ls; ls = lsnext) {
+       lsnext = ls->next;
+       free(ls);
+    }
 }