This is an automated email from Gerrit. Anonymous Coward ([email protected]) just uploaded a new patch set to Gerrit, which you can find at http://openocd.zylin.com/3232
-- gerrit commit 04c73696791b85a47658f1e0168b30165ceb4db8 Author: Alexander Kurz <[email protected]> Date: Sat Feb 13 10:54:52 2016 +0100 Helper time_support: const function arguments duration_elapsed and duration_kbps will not modify the struct duration passed as function argument, hence it should be declared const. Change-Id: I459c396952c78e907257e2c2f2c630abde92aaa8 Signed-off-by: Alexander Kurz <[email protected]> diff --git a/src/helper/time_support.c b/src/helper/time_support.c index c5978b4..780eb96 100644 --- a/src/helper/time_support.c +++ b/src/helper/time_support.c @@ -78,14 +78,14 @@ int duration_measure(struct duration *duration) return retval; } -float duration_elapsed(struct duration *duration) +float duration_elapsed(const struct duration *duration) { float t = duration->elapsed.tv_sec; t += (float)duration->elapsed.tv_usec / 1000000.0; return t; } -float duration_kbps(struct duration *duration, size_t count) +float duration_kbps(const struct duration *duration, size_t count) { return count / (1024.0 * duration_elapsed(duration)); } diff --git a/src/helper/time_support.h b/src/helper/time_support.h index ab83982..5a95e7e 100644 --- a/src/helper/time_support.h +++ b/src/helper/time_support.h @@ -55,8 +55,8 @@ int duration_start(struct duration *duration); int duration_measure(struct duration *duration); /** @returns Elapsed time in seconds. */ -float duration_elapsed(struct duration *duration); +float duration_elapsed(const struct duration *duration); /** @returns KB/sec for the elapsed @a duration and @a count bytes. */ -float duration_kbps(struct duration *duration, size_t count); +float duration_kbps(const struct duration *duration, size_t count); #endif /* TIME_SUPPORT_H */ -- ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 _______________________________________________ OpenOCD-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openocd-devel
