diff libinterp/corefcn/c-file-ptr-stream.h @ 30125:8dd5da409418

maint: use "m_" prefix for member variables in file c-file-ptr-stream.h. * c-file-ptr-stream.cc, c-file-ptr-stream.h, oct-procbuf.cc: Use "m_" prefix for member variables in classes c_file_ptr_buf, c_file_ptr_stream, c_zfile_ptr_buf.
author Rik <rik@octave.org>
date Mon, 06 Sep 2021 11:40:04 -0700
parents 3988112c7116
children a61e1a0f6024
line wrap: on
line diff
--- a/libinterp/corefcn/c-file-ptr-stream.h	Mon Sep 06 11:30:45 2021 -0700
+++ b/libinterp/corefcn/c-file-ptr-stream.h	Mon Sep 06 11:40:04 2021 -0700
@@ -46,10 +46,10 @@
 
   typedef int (*close_fcn) (FILE *);
 
-  FILE *stdiofile (void) { return f; }
+  FILE *stdiofile (void) { return m_f; }
 
-  c_file_ptr_buf (FILE *f_arg, close_fcn cf_arg = file_close)
-    : std::streambuf (), f (f_arg), cf (cf_arg)
+  c_file_ptr_buf (FILE *f, close_fcn cf = file_close)
+    : std::streambuf (), m_f (f), m_cf (cf)
   { }
 
   // No copying!
@@ -84,21 +84,21 @@
 
   int buf_close (void);
 
-  int file_number () const { return f ? fileno (f) : -1; }
+  int file_number () const { return m_f ? fileno (m_f) : -1; }
 
   int seek (off_t offset, int origin);
 
   off_t tell (void);
 
-  void clear (void) { if (f) clearerr (f); }
+  void clear (void) { if (m_f) clearerr (m_f); }
 
-  static int file_close (FILE *f);
+  static int file_close (FILE *m_f);
 
 protected:
 
-  FILE *f;
+  FILE *m_f;
 
-  close_fcn cf;
+  close_fcn m_cf;
 
 private:
 
@@ -113,8 +113,10 @@
 {
 public:
 
-  c_file_ptr_stream (FILE_T f, typename BUF_T::close_fcn cf = BUF_T::file_close)
-    : STREAM_T (nullptr), buf (new BUF_T (f, cf)) { STREAM_T::init (buf); }
+  c_file_ptr_stream (FILE_T m_f,
+                     typename BUF_T::close_fcn m_cf = BUF_T::file_close)
+    : STREAM_T (nullptr), m_buf (new BUF_T (m_f, m_cf))
+  { STREAM_T::init (m_buf); }
 
   // No copying!
 
@@ -122,22 +124,22 @@
 
   c_file_ptr_stream& operator = (const c_file_ptr_stream&) = delete;
 
-  ~c_file_ptr_stream (void) { delete buf; buf = nullptr; }
+  ~c_file_ptr_stream (void) { delete m_buf; m_buf = nullptr; }
 
-  BUF_T * rdbuf (void) { return buf; }
+  BUF_T * rdbuf (void) { return m_buf; }
 
-  void stream_close (void) { if (buf) buf->buf_close (); }
+  void stream_close (void) { if (m_buf) m_buf->buf_close (); }
 
   int seek (off_t offset, int origin)
-  { return buf ? buf->seek (offset, origin) : -1; }
+  { return m_buf ? m_buf->seek (offset, origin) : -1; }
 
-  off_t tell (void) { return buf ? buf->tell () : -1; }
+  off_t tell (void) { return m_buf ? m_buf->tell () : -1; }
 
-  void clear (void) { if (buf) buf->clear (); STREAM_T::clear (); }
+  void clear (void) { if (m_buf) m_buf->clear (); STREAM_T::clear (); }
 
 private:
 
-  BUF_T *buf;
+  BUF_T *m_buf;
 };
 
 typedef c_file_ptr_stream<std::istream, FILE *, c_file_ptr_buf>
@@ -159,10 +161,10 @@
 
   typedef int (*close_fcn) (gzFile);
 
-  gzFile stdiofile (void) { return f; }
+  gzFile stdiofile (void) { return m_f; }
 
-  c_zfile_ptr_buf (gzFile f_arg, close_fcn cf_arg = file_close)
-    : std::streambuf (), f (f_arg), cf (cf_arg)
+  c_zfile_ptr_buf (gzFile f, close_fcn cf = file_close)
+    : std::streambuf (), m_f (f), m_cf (cf)
   { }
 
   // No copying!
@@ -200,19 +202,19 @@
   int file_number () const { return -1; }
 
   int seek (off_t offset, int origin)
-  { return f ? gzseek (f, offset, origin) >= 0 : -1; }
+  { return m_f ? gzseek (m_f, offset, origin) >= 0 : -1; }
 
-  off_t tell (void) { return f ? gztell (f) : -1; }
+  off_t tell (void) { return m_f ? gztell (m_f) : -1; }
 
-  void clear (void) { if (f) gzclearerr (f); }
+  void clear (void) { if (m_f) gzclearerr (m_f); }
 
-  static int file_close (gzFile f) { return ::gzclose (f); }
+  static int file_close (gzFile m_f) { return ::gzclose (m_f); }
 
 protected:
 
-  gzFile f;
+  gzFile m_f;
 
-  close_fcn cf;
+  close_fcn m_cf;
 
 private: