[openrtm-commit:02436] r2947 - trunk/OpenRTM-aist/src/lib/coil/common

openrtm @ openrtm.org openrtm @ openrtm.org
2017年 2月 12日 (日) 09:13:57 JST


Author: n-ando
Date: 2017-02-12 09:13:57 +0900 (Sun, 12 Feb 2017)
New Revision: 2947

Modified:
   trunk/OpenRTM-aist/src/lib/coil/common/Logger.h
Log:
[compat] C style cast convrted to static_cast. refs #3902

Modified: trunk/OpenRTM-aist/src/lib/coil/common/Logger.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/coil/common/Logger.h	2017-02-11 04:19:31 UTC (rev 2946)
+++ trunk/OpenRTM-aist/src/lib/coil/common/Logger.h	2017-02-12 00:13:57 UTC (rev 2947)
@@ -260,11 +260,11 @@
               Guard gaurd(m_streams[i].mutex_);
               m_streams[i].stream_->sputn(this->gptr(), bytes_to_write);
             }
-          this->gbump((int)bytes_to_write);
+          this->gbump(static_cast<int>(bytes_to_write));
           if (this->gptr() >= this->pptr())
             {
-              this->pbump((int)(this->pbase() - this->pptr()));
-              this->gbump((int)(this->pbase() - this->gptr()));
+              this->pbump(static_cast<int>(this->pbase() - this->pptr()));
+              this->gbump(static_cast<int>(this->pbase() - this->gptr()));
             }
         }
       return bytes_to_write;
@@ -350,8 +350,8 @@
               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((int)(this->pbase() - this->pptr()));
-              this->gbump((int)(this->pbase() - this->gptr()));
+              this->pbump(static_cast<int>(this->pbase() - this->pptr()));
+              this->gbump(static_cast<int>(this->pbase() - this->gptr()));
             }
         }
       // Write extra character to file if not EOF
@@ -402,11 +402,11 @@
                 {
                   return -1;
                 }
-              this->gbump((int)bytes_to_write);
+              this->gbump(static_cast<int>(bytes_to_write));
               if (this->gptr() >= this->pptr())
                 {
-                  this->pbump((int)(this->pbase() - this->pptr()));
-                  this->gbump((int)(this->pbase() - this->gptr()));
+                  this->pbump(static_cast<int>(this->pbase() - this->pptr()));
+                  this->gbump(static_cast<int>(this->pbase() - this->gptr()));
                 }
             }
         }



More information about the openrtm-commit mailing list