[openrtm-commit:02423] r2940 - in branches/DEV_IQ_2016/OpenRTM-aist/src/lib/coil: common posix/coil win32/coil

openrtm @ openrtm.org openrtm @ openrtm.org
2017年 2月 10日 (金) 19:15:30 JST


Author: n-ando
Date: 2017-02-10 19:15:30 +0900 (Fri, 10 Feb 2017)
New Revision: 2940

Modified:
   branches/DEV_IQ_2016/OpenRTM-aist/src/lib/coil/common/PeriodicTask.cpp
   branches/DEV_IQ_2016/OpenRTM-aist/src/lib/coil/common/Properties.cpp
   branches/DEV_IQ_2016/OpenRTM-aist/src/lib/coil/common/stringutil.cpp
   branches/DEV_IQ_2016/OpenRTM-aist/src/lib/coil/posix/coil/Routing.cpp
   branches/DEV_IQ_2016/OpenRTM-aist/src/lib/coil/posix/coil/Task.cpp
   branches/DEV_IQ_2016/OpenRTM-aist/src/lib/coil/win32/coil/Task.cpp
Log:
[compat,->DEV_IQ_2016] LDRA rule "Procedure contains UR data flow anomalies." has been made a countermeasured. refs #3909

Modified: branches/DEV_IQ_2016/OpenRTM-aist/src/lib/coil/common/PeriodicTask.cpp
===================================================================
--- branches/DEV_IQ_2016/OpenRTM-aist/src/lib/coil/common/PeriodicTask.cpp	2017-02-10 10:15:20 UTC (rev 2939)
+++ branches/DEV_IQ_2016/OpenRTM-aist/src/lib/coil/common/PeriodicTask.cpp	2017-02-10 10:15:30 UTC (rev 2940)
@@ -33,8 +33,8 @@
     : m_period(0.0), m_nowait(false),
       m_func(0), m_deleteInDtor(true),
       m_alive(false), m_suspend(false),
-      m_execCount(0), m_execCountMax(10),
-      m_periodCount(0), m_periodCountMax(10)
+      m_execCount(0), m_execCountMax(1000),
+      m_periodCount(0), m_periodCountMax(1000)
   {
   }
 

Modified: branches/DEV_IQ_2016/OpenRTM-aist/src/lib/coil/common/Properties.cpp
===================================================================
--- branches/DEV_IQ_2016/OpenRTM-aist/src/lib/coil/common/Properties.cpp	2017-02-10 10:15:20 UTC (rev 2939)
+++ branches/DEV_IQ_2016/OpenRTM-aist/src/lib/coil/common/Properties.cpp	2017-02-10 10:15:30 UTC (rev 2940)
@@ -341,11 +341,11 @@
    */
   void Properties::load(std::istream& inStream)
   {
-    std::string pline;
+    std::string pline = std:s:tring();
 
     while (!inStream.eof())
       {
-        std::string tmp;
+        std::string tmp = std:s:tring();
         coil::getlinePortable(inStream, tmp);
         coil::eraseHeadBlank(tmp);
 
@@ -807,7 +807,7 @@
    */
   std::string Properties::indent(int index)
   {
-    std::string space;
+    std::string space = std::string();
     for (int i(0); i < index - 1; ++i)
       {
         space += "  ";

Modified: branches/DEV_IQ_2016/OpenRTM-aist/src/lib/coil/common/stringutil.cpp
===================================================================
--- branches/DEV_IQ_2016/OpenRTM-aist/src/lib/coil/common/stringutil.cpp	2017-02-10 10:15:20 UTC (rev 2939)
+++ branches/DEV_IQ_2016/OpenRTM-aist/src/lib/coil/common/stringutil.cpp	2017-02-10 10:15:30 UTC (rev 2940)
@@ -356,11 +356,11 @@
                 bool ignore_empty)
   {
     typedef std::string::size_type size;
-    vstring results;
+    vstring results(0);
     size delim_size = delimiter.size();
     size found_pos(0), begin_pos(0), pre_pos(0), substr_size(0);
 
-    if (input.empty()) return results;
+    if (input.empty()) { return results; }
 
     //  if (input.substr(0, delim_size) == delimiter)
     //    begin_pos = pre_pos = delim_size;
@@ -374,7 +374,10 @@
             std::string substr(input.substr(pre_pos));
             eraseHeadBlank(substr);
             eraseTailBlank(substr);
-            if (!(substr.empty() && ignore_empty)) results.push_back(substr);
+            if (!(substr.empty() && ignore_empty))
+              {
+                results.push_back(substr);
+              }
             break;
           }
         /*
@@ -390,7 +393,10 @@
             std::string substr(input.substr(pre_pos, substr_size));
             eraseHeadBlank(substr);
             eraseTailBlank(substr);
-            if (!(substr.empty() && ignore_empty)) results.push_back(substr);
+            if (!(substr.empty() && ignore_empty))
+              {
+                results.push_back(substr);
+              }
           }
         begin_pos = found_pos + delim_size;
         pre_pos   = found_pos + delim_size;
@@ -595,7 +601,7 @@
   {
     if (sv.size() == 0) return "";
 
-    std::string str;
+    std::string str = std::string();
     for (size_t i(0), len(sv.size() - 1); i < len; ++i)
       {
         str += sv[i] + delimiter;

Modified: branches/DEV_IQ_2016/OpenRTM-aist/src/lib/coil/posix/coil/Routing.cpp
===================================================================
--- branches/DEV_IQ_2016/OpenRTM-aist/src/lib/coil/posix/coil/Routing.cpp	2017-02-10 10:15:20 UTC (rev 2939)
+++ branches/DEV_IQ_2016/OpenRTM-aist/src/lib/coil/posix/coil/Routing.cpp	2017-02-10 10:15:30 UTC (rev 2940)
@@ -38,7 +38,7 @@
    */
   bool dest_to_endpoint(std::string dest_addr, std::string& endpoint)
   {
-    std::string dest_if;
+    std::string dest_if = std::string();
     if (!find_dest_ifname(dest_addr, dest_if))
       {
         return false;

Modified: branches/DEV_IQ_2016/OpenRTM-aist/src/lib/coil/posix/coil/Task.cpp
===================================================================
--- branches/DEV_IQ_2016/OpenRTM-aist/src/lib/coil/posix/coil/Task.cpp	2017-02-10 10:15:20 UTC (rev 2939)
+++ branches/DEV_IQ_2016/OpenRTM-aist/src/lib/coil/posix/coil/Task.cpp	2017-02-10 10:15:30 UTC (rev 2940)
@@ -112,7 +112,7 @@
   {
     if (m_count > 0)
       {
-        void* retval;
+        void* retval = NULL;
         ::pthread_join(m_thread, &retval);
       }
     return 0;

Modified: branches/DEV_IQ_2016/OpenRTM-aist/src/lib/coil/win32/coil/Task.cpp
===================================================================
--- branches/DEV_IQ_2016/OpenRTM-aist/src/lib/coil/win32/coil/Task.cpp	2017-02-10 10:15:20 UTC (rev 2939)
+++ branches/DEV_IQ_2016/OpenRTM-aist/src/lib/coil/win32/coil/Task.cpp	2017-02-10 10:15:30 UTC (rev 2940)
@@ -114,8 +114,7 @@
   {
     if (m_count > 0)
       {
-        DWORD retval;
-        retval = ::WaitForSingleObject(m_thread, INFINITE);
+        DWORD retval = ::WaitForSingleObject(m_thread, INFINITE);
       }
     return 0;
   }



More information about the openrtm-commit mailing list