Some missing from merge.

Signed-off-by: Salja <salja2012@hotmail.de>
This commit is contained in:
Salja 2012-08-05 14:54:07 +02:00 committed by Antz
parent ec939a5bce
commit f4be15a7af
1895 changed files with 160408 additions and 53601 deletions

View file

@ -1,3 +1,5 @@
// $Id: High_Res_Timer.cpp 97530 2014-01-16 10:37:21Z johnnyw $
// Be very carefull before changing the calculations inside
// ACE_High_Res_Timer. The precision matters and we are using integer
// calculations not floating point. Also look good at the emulated 64
@ -70,7 +72,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
/* static */
int ACE_High_Res_Timer::global_scale_factor_status_ = 0;
#if defined (ACE_LINUX) && !defined (ACE_LACKS_SSCANF)
#if defined (ACE_LINUX)
// Determine the apparent CPU clock speed from /proc/cpuinfo
ACE_UINT32
ACE_High_Res_Timer::get_cpuinfo (void)
@ -183,7 +185,8 @@ ACE_High_Res_Timer::get_cpuinfo (void)
return scale_factor;
}
#endif /* ACE_LINUX && !ACE_LACKS_SSCANF*/
#endif /* ACE_LINUX */
ACE_High_Res_Timer::global_scale_factor_type
ACE_High_Res_Timer::global_scale_factor (void)
@ -221,11 +224,7 @@ ACE_High_Res_Timer::global_scale_factor (void)
ACE_High_Res_Timer::global_scale_factor_status_ = -1;
}
# elif defined (ACE_LINUX)
# if defined (ACE_LACKS_SSCANF)
ACE_High_Res_Timer::global_scale_factor (1);
# else
ACE_High_Res_Timer::global_scale_factor (ACE_High_Res_Timer::get_cpuinfo ());
# endif /* ACE_LACKS_SSCANF */
# endif /* ! ACE_WIN32 && ! (ACE_LINUX && __alpha__) */
# if !defined (ACE_WIN32)
@ -443,18 +442,18 @@ ACE_High_Res_Timer::print_ave (const ACE_TCHAR *str,
if (count > 1)
{
ACE_hrtime_t avg_nsecs = total_nanoseconds / (ACE_UINT32) count;
ACE_OS::snprintf (buf, 100,
ACE_TEXT (" count = %d, total (secs %lu, usecs %u), avg usecs = %lu\n"),
count,
total_secs,
(extra_nsecs + 500u) / 1000u,
(u_long) ((avg_nsecs + 500u) / 1000u));
ACE_OS::sprintf (buf,
ACE_TEXT (" count = %d, total (secs %lu, usecs %u), avg usecs = %lu\n"),
count,
total_secs,
(extra_nsecs + 500u) / 1000u,
(u_long) ((avg_nsecs + 500u) / 1000u));
}
else
ACE_OS::snprintf (buf, 100,
ACE_TEXT (" total %3lu.%06lu secs\n"),
total_secs,
(extra_nsecs + 500lu) / 1000lu);
ACE_OS::sprintf (buf,
ACE_TEXT (" total %3lu.%06lu secs\n"),
total_secs,
(extra_nsecs + 500lu) / 1000lu);
ACE_OS::write (handle,
str,
@ -486,18 +485,18 @@ ACE_High_Res_Timer::print_total (const ACE_TCHAR *str,
{
ACE_hrtime_t avg_nsecs = this->total_ / (ACE_UINT32) count;
ACE_OS::snprintf (buf, 100,
ACE_TEXT (" count = %d, total (secs %lu, usecs %u), avg usecs = %lu\n"),
count,
total_secs,
(extra_nsecs + 500u) / 1000u,
(u_long) ((avg_nsecs + 500u) / 1000u));
ACE_OS::sprintf (buf,
ACE_TEXT (" count = %d, total (secs %lu, usecs %u), avg usecs = %lu\n"),
count,
total_secs,
(extra_nsecs + 500u) / 1000u,
(u_long) ((avg_nsecs + 500u) / 1000u));
}
else
ACE_OS::snprintf (buf, 100,
ACE_TEXT (" total %3lu.%06u secs\n"),
total_secs,
(extra_nsecs + 500u) / 1000u);
ACE_OS::sprintf (buf,
ACE_TEXT (" total %3lu.%06u secs\n"),
total_secs,
(extra_nsecs + 500u) / 1000u);
ACE_OS::write (handle,
str,