# HG changeset patch # User Rik # Date 1631505447 25200 # Node ID 4412f57132c4282d7cf61ae25c67e7a78b0bee07 # Parent 5acddd64527ea5cb7fbc3bd22b7cf401a9341f8d maint: use "m_" prefix for member variables in classes gzifstream, gzofstream. * gzfstream.cc, gzfstream.h: Use "m_" prefix for member variables in classes gzifstream, gzofstream. diff -r 5acddd64527e -r 4412f57132c4 libinterp/corefcn/gzfstream.cc --- a/libinterp/corefcn/gzfstream.cc Sun Sep 12 20:50:13 2021 -0700 +++ b/libinterp/corefcn/gzfstream.cc Sun Sep 12 20:57:27 2021 -0700 @@ -522,22 +522,22 @@ // Default constructor initializes stream buffer gzifstream::gzifstream () - : std::istream (nullptr), sb () -{ this->init (&sb); } + : std::istream (nullptr), m_sb () +{ this->init (&m_sb); } // Initialize stream buffer and open file gzifstream::gzifstream (const char *name, std::ios_base::openmode mode) - : std::istream (nullptr), sb () + : std::istream (nullptr), m_sb () { - this->init (&sb); + this->init (&m_sb); this->open (name, mode); } // Initialize stream buffer and attach to file gzifstream::gzifstream (int fd, std::ios_base::openmode mode) - : std::istream (nullptr), sb () + : std::istream (nullptr), m_sb () { - this->init (&sb); + this->init (&m_sb); this->attach (fd, mode); } @@ -545,7 +545,7 @@ void gzifstream::open (const char *name, std::ios_base::openmode mode) { - if (! sb.open (name, mode | std::ios_base::in)) + if (! m_sb.open (name, mode | std::ios_base::in)) this->setstate (std::ios_base::failbit); else this->clear (); @@ -555,7 +555,7 @@ void gzifstream::attach (int fd, std::ios_base::openmode mode) { - if (! sb.attach (fd, mode | std::ios_base::in)) + if (! m_sb.attach (fd, mode | std::ios_base::in)) this->setstate (std::ios_base::failbit); else this->clear (); @@ -565,28 +565,28 @@ void gzifstream::close () { - if (! sb.close ()) + if (! m_sb.close ()) this->setstate (std::ios_base::failbit); } // Default constructor initializes stream buffer gzofstream::gzofstream () - : std::ostream (nullptr), sb () -{ this->init (&sb); } + : std::ostream (nullptr), m_sb () +{ this->init (&m_sb); } // Initialize stream buffer and open file gzofstream::gzofstream (const char *name, std::ios_base::openmode mode) - : std::ostream (nullptr), sb () + : std::ostream (nullptr), m_sb () { - this->init (&sb); + this->init (&m_sb); this->open (name, mode); } // Initialize stream buffer and attach to file gzofstream::gzofstream (int fd, std::ios_base::openmode mode) - : std::ostream (nullptr), sb () + : std::ostream (nullptr), m_sb () { - this->init (&sb); + this->init (&m_sb); this->attach (fd, mode); } @@ -594,7 +594,7 @@ void gzofstream::open (const char *name, std::ios_base::openmode mode) { - if (! sb.open (name, mode | std::ios_base::out)) + if (! m_sb.open (name, mode | std::ios_base::out)) this->setstate (std::ios_base::failbit); else this->clear (); @@ -604,7 +604,7 @@ void gzofstream::attach (int fd, std::ios_base::openmode mode) { - if (! sb.attach (fd, mode | std::ios_base::out)) + if (! m_sb.attach (fd, mode | std::ios_base::out)) this->setstate (std::ios_base::failbit); else this->clear (); @@ -614,7 +614,7 @@ void gzofstream::close () { - if (! sb.close ()) + if (! m_sb.close ()) this->setstate (std::ios_base::failbit); } diff -r 5acddd64527e -r 4412f57132c4 libinterp/corefcn/gzfstream.h --- a/libinterp/corefcn/gzfstream.h Sun Sep 12 20:50:13 2021 -0700 +++ b/libinterp/corefcn/gzfstream.h Sun Sep 12 20:57:27 2021 -0700 @@ -307,14 +307,14 @@ */ gzfilebuf* rdbuf () const - { return const_cast(&sb); } + { return const_cast(&m_sb); } /** * @brief Check if file is open. * @return True if file is open. */ bool - is_open () { return sb.is_open (); } + is_open () { return m_sb.is_open (); } /** * @brief Open gzipped file. @@ -356,7 +356,7 @@ /** * Underlying stream buffer. */ - gzfilebuf sb; + gzfilebuf m_sb; }; /** @@ -394,14 +394,14 @@ */ gzfilebuf* rdbuf () const - { return const_cast(&sb); } + { return const_cast(&m_sb); } /** * @brief Check if file is open. * @return True if file is open. */ bool - is_open () { return sb.is_open (); } + is_open () { return m_sb.is_open (); } /** * @brief Open gzipped file. @@ -443,7 +443,7 @@ /** * Underlying stream buffer. */ - gzfilebuf sb; + gzfilebuf m_sb; }; /**