[openrtm-commit:02240] r2850 - branches/DEV_IQ_2016/OpenRTM-aist/src/lib/rtm
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 1月 17日 (火) 19:40:00 JST
Author: sec_fukai
Date: 2017-01-17 19:40:00 +0900 (Tue, 17 Jan 2017)
New Revision: 2850
Modified:
branches/DEV_IQ_2016/OpenRTM-aist/src/lib/rtm/CorbaNaming.cpp
branches/DEV_IQ_2016/OpenRTM-aist/src/lib/rtm/ExecutionContextBase.cpp
branches/DEV_IQ_2016/OpenRTM-aist/src/lib/rtm/ExecutionContextProfile.cpp
branches/DEV_IQ_2016/OpenRTM-aist/src/lib/rtm/OpenHRPExecutionContext.cpp
branches/DEV_IQ_2016/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrConsumer.cpp
branches/DEV_IQ_2016/OpenRTM-aist/src/lib/rtm/PeriodicExecutionContext.cpp
Log:
[compat,->DEV_IQ_2016]Modify coding style. refs #3816
Modified: branches/DEV_IQ_2016/OpenRTM-aist/src/lib/rtm/CorbaNaming.cpp
===================================================================
--- branches/DEV_IQ_2016/OpenRTM-aist/src/lib/rtm/CorbaNaming.cpp 2017-01-17 10:02:02 UTC (rev 2849)
+++ branches/DEV_IQ_2016/OpenRTM-aist/src/lib/rtm/CorbaNaming.cpp 2017-01-17 10:40:00 UTC (rev 2850)
@@ -679,7 +679,7 @@
slen = getNameLength(name);
CORBA::String_var string_name = CORBA::string_alloc(slen);
- nameToString(name, <char*>string_name, slen);
+ nameToString(name, static_cast<char*>(string_name), slen);
return string_name._retn();
}
Modified: branches/DEV_IQ_2016/OpenRTM-aist/src/lib/rtm/ExecutionContextBase.cpp
===================================================================
--- branches/DEV_IQ_2016/OpenRTM-aist/src/lib/rtm/ExecutionContextBase.cpp 2017-01-17 10:02:02 UTC (rev 2849)
+++ branches/DEV_IQ_2016/OpenRTM-aist/src/lib/rtm/ExecutionContextBase.cpp 2017-01-17 10:40:00 UTC (rev 2850)
@@ -83,13 +83,13 @@
RTC_DEBUG(("Exec rate : %f [Hz]", getRate()));
RTC_DEBUG(("Activation : Sync = %s, Timeout = %f",
m_syncActivation ? "YES" : "NO",
- <double>m_activationTimeout));
+ static_cast<double>(m_activationTimeout)));
RTC_DEBUG(("Deactivation: Sync = %s, Timeout = %f",
m_syncDeactivation ? "YES" : "NO",
- <double>m_deactivationTimeout));
+ static_cast<double>(m_deactivationTimeout)));
RTC_DEBUG(("Reset : Sync = %s, Timeout = %f",
m_syncReset ? "YES" : "NO",
- <double>m_resetTimeout));
+ static_cast<double>(m_resetTimeout)));
// Setting given Properties to EC's profile::properties
setProperties(props);
}
@@ -376,9 +376,9 @@
return ret;
}
long int cycle =
- (long int)(<double>m_activationTimeout / <double>getPeriod());
+ static_cast<long int>(static_cast<double>(m_activationTimeout) / static_cast<double>(getPeriod()));
RTC_DEBUG(("Timeout is %f [s] (%f [s] in %d times)",
- <double>m_activationTimeout, getRate(), cycle));
+ static_cast<double>(m_activationTimeout), getRate(), cycle));
// Wating INACTIVE -> ACTIVE
coil::TimeValue starttime(coil::gettimeofday());
while (rtobj->isCurrentState(RTC::INACTIVE_STATE))
@@ -392,7 +392,7 @@
coil::sleep(getPeriod());
coil::TimeValue delta(coil::gettimeofday() - starttime);
RTC_DEBUG(("Waiting to be ACTIVE state. %f [s] slept (%d/%d)",
- <double>delta, count, cycle));
+ static_cast<double>(delta), count, cycle));
++count;
if (delta > m_activationTimeout || count > cycle)
{
@@ -464,9 +464,9 @@
return ret;
}
long int cycle =
- (long int)(<double>m_deactivationTimeout / <double>getPeriod());
+ static_cast<long int>(static_cast<double>(m_deactivationTimeout) / static_cast<double>(getPeriod()));
RTC_DEBUG(("Timeout is %f [s] (%f [s] in %d times)",
- <double>m_deactivationTimeout, getRate(), cycle));
+ static_cast<double>(m_deactivationTimeout), getRate(), cycle));
// Wating ACTIVE -> INACTIVE
coil::TimeValue starttime(coil::gettimeofday());
while (rtobj->isCurrentState(RTC::ACTIVE_STATE))
@@ -480,7 +480,7 @@
coil::sleep(getPeriod());
coil::TimeValue delta(coil::gettimeofday() - starttime);
RTC_DEBUG(("Waiting to be INACTIVE state. Sleeping %f [s] (%d/%d)",
- <double>delta, count, cycle));
+ static_cast<double>(delta), count, cycle));
++count;
if (delta > m_deactivationTimeout || count > cycle)
{
@@ -551,9 +551,9 @@
return ret;
}
long int cycle =
- (long int)(<double>m_resetTimeout / <double>getPeriod());
+ static_cast<long int>(static_cast<double>(m_resetTimeout) / static_cast<double>(getPeriod()));
RTC_DEBUG(("Timeout is %f [s] (%f [s] in %d times)",
- <double>m_resetTimeout, getRate(), cycle));
+ static_cast<double>(m_resetTimeout), getRate(), cycle));
// Wating ERROR -> INACTIVE
coil::TimeValue starttime(coil::gettimeofday());
while (rtobj->isCurrentState(RTC::ERROR_STATE))
@@ -567,7 +567,7 @@
coil::sleep(getPeriod());
coil::TimeValue delta(coil::gettimeofday() - starttime);
RTC_DEBUG(("Waiting to be INACTIVE state. Sleeping %f [s] (%d/%d)",
- <double>delta, count, cycle));
+ static_cast<double>(delta), count, cycle));
++count;
if (delta > m_resetTimeout || count > cycle)
{
Modified: branches/DEV_IQ_2016/OpenRTM-aist/src/lib/rtm/ExecutionContextProfile.cpp
===================================================================
--- branches/DEV_IQ_2016/OpenRTM-aist/src/lib/rtm/ExecutionContextProfile.cpp 2017-01-17 10:02:02 UTC (rev 2849)
+++ branches/DEV_IQ_2016/OpenRTM-aist/src/lib/rtm/ExecutionContextProfile.cpp 2017-01-17 10:40:00 UTC (rev 2850)
@@ -36,7 +36,7 @@
ExecutionContextProfile::
ExecutionContextProfile(RTC::ExecutionKind kind)
: rtclog("periodic_ecprofile"),
- m_period(<double>DEEFAULT_PERIOD),
+ m_period(static_cast<double>(DEEFAULT_PERIOD)),
m_ref(RTC::ExecutionContextService::_nil())
{
RTC_TRACE(("ExecutionContextProfile()"));
@@ -130,11 +130,14 @@
RTC::ReturnCode_t ExecutionContextProfile::setPeriod(coil::TimeValue period)
{
- RTC_TRACE(("setPeriod(%f [sec])", <double>period));
- if (<double>period <= 0.0) { return RTC::BAD_PARAMETER; }
+ RTC_TRACE(("setPeriod(%f [sec])", static_cast<double>(period)));
+ if (static_cast<double>(period) <= 0.0)
+ {
+ return RTC::BAD_PARAMETER;
+ }
Guard guard(m_profileMutex);
- m_profile.rate = 1.0 / <double>period;
+ m_profile.rate = 1.0 / static_cast<double>(period);
m_period = period;
return RTC::RTC_OK;
}
Modified: branches/DEV_IQ_2016/OpenRTM-aist/src/lib/rtm/OpenHRPExecutionContext.cpp
===================================================================
--- branches/DEV_IQ_2016/OpenRTM-aist/src/lib/rtm/OpenHRPExecutionContext.cpp 2017-01-17 10:02:02 UTC (rev 2849)
+++ branches/DEV_IQ_2016/OpenRTM-aist/src/lib/rtm/OpenHRPExecutionContext.cpp 2017-01-17 10:40:00 UTC (rev 2850)
@@ -86,10 +86,10 @@
coil::TimeValue period(getPeriod());
if (m_count > 1000)
{
- RTC_PARANOID(("Period: %f [s]", <double>period));
- RTC_PARANOID(("Exec-Do: %f [s]", <double>(t1 - t0)));
- RTC_PARANOID(("Exec-PostDo: %f [s]", <double>(t2 - t1)));
- RTC_PARANOID(("Sleep: %f [s]", <double>(period - (t2 - t0))));
+ RTC_PARANOID(("Period: %f [s]", static_cast<double>(period)));
+ RTC_PARANOID(("Exec-Do: %f [s]", static_cast<double>(t1 - t0)));
+ RTC_PARANOID(("Exec-PostDo: %f [s]", static_cast<double>(t2 - t1)));
+ RTC_PARANOID(("Sleep: %f [s]", static_cast<double>(period - (t2 - t0))));
}
coil::TimeValue t3(coil::gettimeofday());
if (period > (t2 - t0))
@@ -100,7 +100,7 @@
if (m_count > 1000)
{
coil::TimeValue t4(coil::gettimeofday());
- RTC_PARANOID(("Slept: %f [s]", <double>(t4 - t3)));
+ RTC_PARANOID(("Slept: %f [s]", static_cast<double>(t4 - t3)));
m_count = 0;
}
++m_count;
Modified: branches/DEV_IQ_2016/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrConsumer.cpp
===================================================================
--- branches/DEV_IQ_2016/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrConsumer.cpp 2017-01-17 10:02:02 UTC (rev 2849)
+++ branches/DEV_IQ_2016/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrConsumer.cpp 2017-01-17 10:40:00 UTC (rev 2850)
@@ -106,7 +106,7 @@
if (ret == ::OpenRTM::PORT_OK)
{
RTC_DEBUG(("get() successful"));
- data.put_octet_array(&(cdr_data[0]), <int>cdr_data->length());
+ data.put_octet_array(&(cdr_data[0]), static_cast<int>(cdr_data->length()));
RTC_PARANOID(("CDR data length: %d", cdr_data->length()));
onReceived(data);
Modified: branches/DEV_IQ_2016/OpenRTM-aist/src/lib/rtm/PeriodicExecutionContext.cpp
===================================================================
--- branches/DEV_IQ_2016/OpenRTM-aist/src/lib/rtm/PeriodicExecutionContext.cpp 2017-01-17 10:02:02 UTC (rev 2849)
+++ branches/DEV_IQ_2016/OpenRTM-aist/src/lib/rtm/PeriodicExecutionContext.cpp 2017-01-17 10:40:00 UTC (rev 2850)
@@ -52,7 +52,7 @@
// profile initialization
setKind(RTC::PERIODIC);
- setRate(1.0 / <double>DEEFAULT_PERIOD);
+ setRate(1.0 / static_cast<double>(DEEFAULT_PERIOD));
RTC_DEBUG(("Actual period: %d [sec], %d [usec]",
m_profile.getPeriod().sec(), m_profile.getPeriod().usec()));
@@ -178,9 +178,9 @@
coil::TimeValue period(getPeriod());
if (count > 1000)
{
- RTC_PARANOID(("Period: %f [s]", <double>period));
- RTC_PARANOID(("Execution: %f [s]", <double>(t1 - t0)));
- RTC_PARANOID(("Sleep: %f [s]", <double>(period - (t1 - t0))));
+ RTC_PARANOID(("Period: %f [s]", static_cast<double>(period)));
+ RTC_PARANOID(("Execution: %f [s]", static_cast<double>(t1 - t0)));
+ RTC_PARANOID(("Sleep: %f [s]", static_cast<double>(period - (t1 - t0))));
}
coil::TimeValue t2(coil::gettimeofday());
if (!m_nowait && period > (t1 - t0))
@@ -191,7 +191,7 @@
if (count > 1000)
{
coil::TimeValue t3(coil::gettimeofday());
- RTC_PARANOID(("Slept: %f [s]", <double>(t3 - t2)));
+ RTC_PARANOID(("Slept: %f [s]", static_cast<double>(t3 - t2)));
count = 0;
}
++count;
More information about the openrtm-commit
mailing list