You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by se...@apache.org on 2008/08/01 03:10:24 UTC

svn commit: r681574 - /stdcxx/branches/4.2.x/src/file.cpp

Author: sebor
Date: Thu Jul 31 18:10:24 2008
New Revision: 681574

URL: http://svn.apache.org/viewvc?rev=681574&view=rev
Log:
2008-07-31  Martin Sebor  <se...@roguewave.com>

	* src/file.cpp: Globally replaced all uses of the _RWSTD_SIZE_T
	and _RWSTD_PTRDIFF_T macros (necessary in library headers for
	namespace cleanliness) with the equivalent typedefs.

Modified:
    stdcxx/branches/4.2.x/src/file.cpp

Modified: stdcxx/branches/4.2.x/src/file.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/file.cpp?rev=681574&r1=681573&r2=681574&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/src/file.cpp (original)
+++ stdcxx/branches/4.2.x/src/file.cpp Thu Jul 31 18:10:24 2008
@@ -38,8 +38,9 @@
 #endif   // _RWSTD_NO_DEPRECATED_C_HEADERS
 
 #include <errno.h>    // for ERANGE, errno
+#include <stddef.h>   // for ptrdiff_t
 #include <stdio.h>    // for P_tmpdir, std{err,in,out}, tmpnam()
-#include <stdlib.h>   // for mkstemp(), strtoul()
+#include <stdlib.h>   // for mkstemp(), strtoul(), size_t
 #include <ctype.h>    // for isalpha(), isspace(), toupper()
 
 
@@ -198,7 +199,7 @@
 __rw_io_mode (int openmode)
 {
     // mask out irrelevant bits
-    const _RWSTD_SIZE_T inx = openmode & __rw_openmode_mask;
+    const size_t inx = openmode & __rw_openmode_mask;
 
     if (sizeof __rw_io_modes / sizeof *__rw_io_modes <= inx)
         return -1;
@@ -224,7 +225,7 @@
 __rw_stdio_mode (int openmode)
 {
     // mask out irrelevant bits
-    const _RWSTD_SIZE_T inx = openmode & __rw_openmode_mask;
+    const size_t inx = openmode & __rw_openmode_mask;
 
     if (sizeof __rw_stdio_modes / sizeof *__rw_stdio_modes <= inx)
         return "";   // error -- bad mode
@@ -478,7 +479,7 @@
 #endif
 
 _RWSTD_EXPORT long
-__rw_fseek (void *file, int flags, _RWSTD_PTRDIFF_T offset, int origin)
+__rw_fseek (void *file, int flags, ptrdiff_t offset, int origin)
 {
     if (flags & _RWSTD_IOS_STDIO) {
         FILE* const fp = _RWSTD_STATIC_CAST (FILE*, file);
@@ -496,8 +497,8 @@
 }
 
 
-_RWSTD_EXPORT _RWSTD_SIZE_T
-__rw_fread (void *file, int flags, void *buf, _RWSTD_SIZE_T size)
+_RWSTD_EXPORT size_t
+__rw_fread (void *file, int flags, void *buf, size_t size)
 {
     if (flags & _RWSTD_IOS_STDIO) {
         FILE* const fp = _RWSTD_STATIC_CAST (FILE*, file);
@@ -511,13 +512,13 @@
 }
 
 
-_RWSTD_EXPORT _RWSTD_PTRDIFF_T
-__rw_fwrite (void *file, int flags, const void *buf, _RWSTD_SIZE_T size)
+_RWSTD_EXPORT ptrdiff_t
+__rw_fwrite (void *file, int flags, const void *buf, size_t size)
 {
     if (flags & _RWSTD_IOS_STDIO) {
         FILE* const fp = _RWSTD_STATIC_CAST (FILE*, file);
 
-        return _RWSTD_STATIC_CAST (_RWSTD_PTRDIFF_T, fwrite (buf, 1, size, fp));
+        return _RWSTD_STATIC_CAST (ptrdiff_t, fwrite (buf, 1, size, fp));
     }
 
     const int fd = int (_RWSTD_STATIC_CAST (char*, file) - 1 - (char*)0);