ProtoStream: member variable -> local var
The contained state is not used over function boundaries anyways. Found by Coverity Scan, CID 25689. Change-Id: I34e42c227710be4859f6d62de9311c4201ed29b0
This commit is contained in:
@ -11,7 +11,7 @@ ProtoOStream::ProtoOStream(std::ostream *outfile) : m_outfile(outfile)
|
||||
|
||||
bool ProtoOStream::writeMessage(google::protobuf::Message *m)
|
||||
{
|
||||
m_size = htonl(m->ByteSize());
|
||||
uint32_t m_size = htonl(m->ByteSize());
|
||||
m_outfile->write(reinterpret_cast<char*>(&m_size), sizeof(m_size));
|
||||
|
||||
if (m_outfile->bad()) {
|
||||
@ -40,6 +40,7 @@ void ProtoIStream::reset()
|
||||
|
||||
bool ProtoIStream::getNext(google::protobuf::Message *m)
|
||||
{
|
||||
uint32_t m_size;
|
||||
m_infile->read(reinterpret_cast<char*>(&m_size), sizeof(m_size));
|
||||
if (!m_infile->good())
|
||||
return false;
|
||||
|
||||
@ -34,7 +34,7 @@ namespace fail {
|
||||
*/
|
||||
class ProtoOStream {
|
||||
private:
|
||||
uint32_t m_size; // TODO: comments needed here
|
||||
// TODO: comments needed here
|
||||
Logger m_log;
|
||||
std::ostream* m_outfile;
|
||||
public:
|
||||
@ -56,8 +56,7 @@ public:
|
||||
*/
|
||||
class ProtoIStream {
|
||||
private:
|
||||
uint32_t m_size; // TODO: comments needed here
|
||||
long m_sizeOfInfile;
|
||||
// TODO: comments needed here
|
||||
Logger m_log;
|
||||
std::istream *m_infile;
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user