changeset 10288:5e972e2deffe

avoid some possible gnulib #defines
author John W. Eaton <jwe@octave.org>
date Tue, 09 Feb 2010 20:10:35 -0500
parents 7c7685cc0676
children 4b124317dc38
files src/ChangeLog src/c-file-ptr-stream.cc src/c-file-ptr-stream.h src/oct-stdstrm.h
diffstat 4 files changed, 23 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Tue Feb 09 17:44:22 2010 -0500
+++ b/src/ChangeLog	Tue Feb 09 20:10:35 2010 -0500
@@ -1,3 +1,11 @@
+2010-02-09  John W. Eaton  <jwe@octave.org>
+
+	* c-file-ptr-stream.h (c_file_ptr_buf::buf_close): Rename from close.
+	(c_file_ptr_buf::file_close): Rename from fclose.
+	(c_file_ptr_stream::stream_close): Rename from close.
+	(c_zfile_ptr_buf:buf_close): Rename from close.
+	Change all callers.
+
 2010-02-09  John W. Eaton  <jwe@octave.org>
 
 	* dynamic-ld.cc (clear): Only warn if reloading a dynamically
--- a/src/c-file-ptr-stream.cc	Tue Feb 09 17:44:22 2010 -0500
+++ b/src/c-file-ptr-stream.cc	Tue Feb 09 20:10:35 2010 -0500
@@ -43,7 +43,7 @@
 
 c_file_ptr_buf::~c_file_ptr_buf (void)
 {
-  close ();
+  buf_close ();
 }
 
 // FIXME -- I'm sure there is room for improvement here...
@@ -178,7 +178,7 @@
 }
 
 int
-c_file_ptr_buf::close (void)
+c_file_ptr_buf::buf_close (void)
 {
   int retval = -1;
 
@@ -197,7 +197,7 @@
 
 c_zfile_ptr_buf::~c_zfile_ptr_buf (void)
 {
-  close ();
+  buf_close ();
 }
 
 // FIXME -- I'm sure there is room for improvement here...
@@ -327,7 +327,7 @@
 }
 
 int
-c_zfile_ptr_buf::close (void)
+c_zfile_ptr_buf::buf_close (void)
 {
   int retval = -1;
 
--- a/src/c-file-ptr-stream.h	Tue Feb 09 17:44:22 2010 -0500
+++ b/src/c-file-ptr-stream.h	Tue Feb 09 20:10:35 2010 -0500
@@ -43,7 +43,7 @@
 
   FILE* stdiofile (void) { return f; }
 
-  c_file_ptr_buf (FILE *f_arg, close_fcn cf_arg = fclose)
+  c_file_ptr_buf (FILE *f_arg, close_fcn cf_arg = file_close)
     : std::streambuf (), f (f_arg), cf (cf_arg)
     { }
 
@@ -71,7 +71,7 @@
 
   int flush (void);
 
-  int close (void);
+  int buf_close (void);
 
   int file_number () const { return f ? fileno (f) : -1; }
 
@@ -82,7 +82,7 @@
 
   void clear (void) { if (f) clearerr (f); }
 
-  static int fclose (FILE *f) { return ::fclose (f); }
+  static int file_close (FILE *f) { return ::fclose (f); }
 
 protected:
 
@@ -104,14 +104,14 @@
 {
 public:
 
-  c_file_ptr_stream (FILE_T f, typename BUF_T::close_fcn cf = BUF_T::fclose)
+  c_file_ptr_stream (FILE_T f, typename BUF_T::close_fcn cf = BUF_T::file_close)
     : STREAM_T (0), buf (new BUF_T (f, cf)) { STREAM_T::init (buf); }
 
   ~c_file_ptr_stream (void) { delete buf; buf = 0; }
 
   BUF_T *rdbuf (void) { return buf; }
 
-  void close (void) { if (buf) buf->close (); }
+  void stream_close (void) { if (buf) buf->buf_close (); }
 
   int seek (long offset, int origin)
     { return buf ? buf->seek (offset, origin) : -1; }
@@ -150,7 +150,7 @@
 
   gzFile stdiofile (void) { return f; }
 
-  c_zfile_ptr_buf (gzFile f_arg, close_fcn cf_arg = fclose)
+  c_zfile_ptr_buf (gzFile f_arg, close_fcn cf_arg = file_close)
     : std::streambuf (), f (f_arg), cf (cf_arg)
     { }
 
@@ -178,7 +178,7 @@
 
   int flush (void);
 
-  int close (void);
+  int buf_close (void);
 
   int file_number () const { return -1; }
 
@@ -189,7 +189,7 @@
 
   void clear (void) { if (f) gzclearerr (f); }
 
-  static int fclose (gzFile f) { return ::gzclose (f); }
+  static int file_close (gzFile f) { return ::gzclose (f); }
 
 protected:
 
--- a/src/oct-stdstrm.h	Tue Feb 09 17:44:22 2010 -0500
+++ b/src/oct-stdstrm.h	Tue Feb 09 20:10:35 2010 -0500
@@ -37,7 +37,7 @@
 		       std::ios::openmode m = std::ios::in|std::ios::out,
 		       oct_mach_info::float_format ff
 		         = oct_mach_info::native_float_format (),
-		       typename BUF_T::close_fcn cf = BUF_T::fclose)
+		       typename BUF_T::close_fcn cf = BUF_T::file_close)
     : octave_base_stream (m, ff), nm (n), md (m),
       s (f ? new STREAM_T (f, cf) : 0)
   { }
@@ -47,7 +47,7 @@
 	  std::ios::openmode m = std::ios::in|std::ios::out,
 	  oct_mach_info::float_format ff
 	    = oct_mach_info::native_float_format (),
-	  typename BUF_T::close_fcn cf = BUF_T::fclose)
+	  typename BUF_T::close_fcn cf = BUF_T::file_close)
   {
     return octave_stream (new octave_tstdiostream (n, f, m, ff, cf));
   }
@@ -81,7 +81,7 @@
 
   void clear (void) { if (s) s->clear (); }
 
-  void do_close (void) { if (s) s->close (); }
+  void do_close (void) { if (s) s->stream_close (); }
 
 protected: