From a98b74b72e184d69239468a1927ca558379cb4bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sun, 10 Jul 2005 16:24:52 +0000 Subject: [PATCH] Discarded unused variable "at" in get_rounded_cpu_speed(). Forgot to adapt the limit to switch to "GHz" in AboutHaiku. Both bugs were reported by Herve W a.k.a. "V" - whatever that means :-) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13571 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/shared/cpu_type.h | 5 +---- src/apps/abouthaiku/AboutHaiku.cpp | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/headers/private/shared/cpu_type.h b/headers/private/shared/cpu_type.h index 75efbcef68..52265eeb02 100644 --- a/headers/private/shared/cpu_type.h +++ b/headers/private/shared/cpu_type.h @@ -214,15 +214,12 @@ get_rounded_cpu_speed(void) int target = sys_info.cpu_clock_speed / 1000000; int frac = target % 100; int delta = -frac; - int at = 0; int freqs[] = { 100, 50, 25, 75, 33, 67, 20, 40, 60, 80, 10, 30, 70, 90 }; for (uint x = 0; x < sizeof(freqs) / sizeof(freqs[0]); x++) { int ndelta = freqs[x] - frac; - if (abs(ndelta) < abs(delta)) { - at = freqs[x]; + if (abs(ndelta) < abs(delta)) delta = ndelta; - } } return target + delta; } diff --git a/src/apps/abouthaiku/AboutHaiku.cpp b/src/apps/abouthaiku/AboutHaiku.cpp index 50efd059d7..da7676f379 100644 --- a/src/apps/abouthaiku/AboutHaiku.cpp +++ b/src/apps/abouthaiku/AboutHaiku.cpp @@ -208,7 +208,7 @@ AboutView::AboutView(const BRect &r) r.bottom = r.top + textHeight; int32 clockSpeed = get_rounded_cpu_speed(); - if (clockSpeed < 1000000000) + if (clockSpeed < 1000) sprintf(string,"%ld MHz", clockSpeed); else sprintf(string,"%.2f GHz", clockSpeed / 1000.0f);