]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLib/LibC/Stdio/refill.c
StdLib, StdLibPrivateInternalFiles: Clean up comments, Remove debugging code, Define...
[mirror_edk2.git] / StdLib / LibC / Stdio / refill.c
index 953e8f674a8f608edeb79ab0254fa1c6bd1e7e22..a69f022deea5ad2f490c396efa19f1bf4b228f29 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
+    Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>\r
     This program and the accompanying materials are licensed and made available\r
     under the terms and conditions of the BSD License that accompanies this\r
     distribution.  The full text of the license may be found at\r
@@ -41,9 +41,6 @@
     NetBSD: refill.c,v 1.13 2003/08/07 16:43:30 agc Exp\r
     refill.c  8.1 (Berkeley) 6/4/93\r
 */\r
-#include <Uefi.h>               // REMOVE, For DEBUG only\r
-#include <Library/UefiLib.h>    // REMOVE, For DEBUG only\r
-\r
 #include  <LibConfig.h>\r
 #include <sys/EfiCdefs.h>\r
 \r
@@ -93,28 +90,23 @@ __srefill(FILE *fp)
   if (!__sdidinit)\r
     __sinit();\r
 \r
-//Print(L"%a( %d)\n", __func__, fp->_file);\r
   fp->_r = 0;   /* largely a convenience for callers */\r
 \r
   /* SysV does not make this test; take it out for compatibility */\r
   if (fp->_flags & __SEOF) {\r
-//Print(L"%a: %d\n", __func__, __LINE__);\r
     return (EOF);\r
   }\r
 \r
   /* if not already reading, have to be reading and writing */\r
   if ((fp->_flags & __SRD) == 0) {\r
-//Print(L"%a: %d\n", __func__, __LINE__);\r
     if ((fp->_flags & __SRW) == 0) {\r
       errno = EBADF;\r
       fp->_flags |= __SERR;   //<dvm> Allows differentiation between errors and EOF\r
-//Print(L"%a: %d\n", __func__, __LINE__);\r
       return (EOF);\r
     }\r
     /* switch to reading */\r
     if (fp->_flags & __SWR) {\r
       if (__sflush(fp)) {\r
-//Print(L"%a: %d\n", __func__, __LINE__);\r
         return (EOF);\r
       }\r
       fp->_flags &= ~__SWR;\r
@@ -123,7 +115,6 @@ __srefill(FILE *fp)
     }\r
     fp->_flags |= __SRD;\r
   } else {\r
-//Print(L"%a: %d\n", __func__, __LINE__);\r
     /*\r
      * We were reading.  If there is an ungetc buffer,\r
      * we must have been reading from that.  Drop it,\r
@@ -134,7 +125,6 @@ __srefill(FILE *fp)
       FREEUB(fp);\r
       if ((fp->_r = fp->_ur) != 0) {\r
         fp->_p = fp->_up;\r
-//Print(L"%a: %d\n", __func__, __LINE__);\r
         return (0);\r
       }\r
     }\r
@@ -143,7 +133,6 @@ __srefill(FILE *fp)
   if (fp->_bf._base == NULL)\r
     __smakebuf(fp);\r
 \r
-//Print(L"%a: %d\n", __func__, __LINE__);\r
   /*\r
    * Before reading from a line buffered or unbuffered file,\r
    * flush all line buffered output files, per the ANSI C\r
@@ -153,7 +142,6 @@ __srefill(FILE *fp)
     rwlock_rdlock(&__sfp_lock);\r
     (void) _fwalk(lflush);\r
     rwlock_unlock(&__sfp_lock);\r
-//Print(L"%a: %d\n", __func__, __LINE__);\r
   }\r
   fp->_p = fp->_bf._base;\r
   fp->_r = (*fp->_read)(fp->_cookie, (char *)fp->_p, fp->_bf._size);\r
@@ -165,9 +153,7 @@ __srefill(FILE *fp)
       fp->_r = 0;\r
       fp->_flags |= __SERR;\r
     }\r
-//Print(L"%a: %d\n", __func__, __LINE__);\r
     return (EOF);\r
   }\r
-//Print(L"%a: %d\n", __func__, __LINE__);\r
   return (0);\r
 }\r