[openrtm-commit:02395] r2927 - trunk/OpenRTM-aist/src/lib/coil/common
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 2月 7日 (火) 12:39:29 JST
Author: miyamoto
Date: 2017-02-07 12:39:29 +0900 (Tue, 07 Feb 2017)
New Revision: 2927
Modified:
trunk/OpenRTM-aist/src/lib/coil/common/Logger.h
Log:
[compat] refs #3902
Modified: trunk/OpenRTM-aist/src/lib/coil/common/Logger.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/coil/common/Logger.h 2017-02-06 19:44:42 UTC (rev 2926)
+++ trunk/OpenRTM-aist/src/lib/coil/common/Logger.h 2017-02-07 03:39:29 UTC (rev 2927)
@@ -226,7 +226,7 @@
virtual std::streamsize xsputn(const char_type* s, std::streamsize n)
{
stream_sputn();
- for (int i(0), len(m_streams.size()); i < len; ++i)
+ for (size_t i(0), len(m_streams.size()); i < len; ++i)
{
Guard gaurd(m_streams[i].mutex_);
m_streams[i].stream_->sputn(s, n);
@@ -251,20 +251,20 @@
*/
virtual std::streamsize stream_sputn()
{
- int bytes_to_write;
+ size_t bytes_to_write;
bytes_to_write = this->pptr() - this->gptr();
if (bytes_to_write > 0)
{
- for (int i(0), len(m_streams.size()); i < len; ++i)
+ for (size_t i(0), len(m_streams.size()); i < len; ++i)
{
Guard gaurd(m_streams[i].mutex_);
m_streams[i].stream_->sputn(this->gptr(), bytes_to_write);
}
- this->gbump(bytes_to_write);
+ this->gbump((int)bytes_to_write);
if (this->gptr() >= this->pptr())
{
- this->pbump(this->pbase() - this->pptr());
- this->gbump(this->pbase() - this->gptr());
+ this->pbump((int)(this->pbase() - this->pptr()));
+ this->gbump((int)(this->pbase() - this->gptr()));
}
}
return bytes_to_write;
@@ -293,7 +293,7 @@
virtual std::streamsize stream_sputn(const char_type* s, std::streamsize n)
{
- for (int i(0), len(m_streams.size()); i < len; ++i)
+ for (size_t i(0), len(m_streams.size()); i < len; ++i)
{
Guard gaurd(m_streams[i].mutex_);
m_streams[i].stream_->sputn(s, n);
@@ -343,15 +343,15 @@
this->pbump(1);
}
// Number of characters to write to file
- int bytes_to_write = this->pptr() - this->gptr();
+ size_t bytes_to_write = this->pptr() - this->gptr();
// Overflow doesn't fail if nothing is to be written
if (bytes_to_write > 0)
{
if (stream_sputn(this->gptr(), bytes_to_write) != bytes_to_write)
return traits_type::eof();
// Reset next pointer to point to pbase on success
- this->pbump(this->pbase() - this->pptr());
- this->gbump(this->pbase() - this->gptr());
+ this->pbump((int)(this->pbase() - this->pptr()));
+ this->gbump((int)(this->pbase() - this->gptr()));
}
}
// Write extra character to file if not EOF
@@ -394,7 +394,7 @@
if (this->pptr() > this->epptr() || this->pptr() < this->pbase())
return -1;
- int bytes_to_write;
+ size_t bytes_to_write;
bytes_to_write = this->pptr() - this->gptr();
if (bytes_to_write > 0)
{
@@ -402,11 +402,11 @@
{
return -1;
}
- this->gbump(bytes_to_write);
+ this->gbump((int)bytes_to_write);
if (this->gptr() >= this->pptr())
{
- this->pbump(this->pbase() - this->pptr());
- this->gbump(this->pbase() - this->gptr());
+ this->pbump((int)(this->pbase() - this->pptr()));
+ this->gbump((int)(this->pbase() - this->gptr()));
}
}
}
More information about the openrtm-commit
mailing list