diff options
author | Steve Reinhardt <stever@eecs.umich.edu> | 2005-12-23 13:32:31 -0500 |
---|---|---|
committer | Steve Reinhardt <stever@eecs.umich.edu> | 2005-12-23 13:32:31 -0500 |
commit | 0cdcb08d908bc20f614dd164f8e43287406e81a3 (patch) | |
tree | ba6da1e59f9ca5c67c9aa067f374c77129722a52 /base/intmath.cc | |
parent | 627f540e3119e09747005e208daa8153b22d9967 (diff) | |
download | gem5-0cdcb08d908bc20f614dd164f8e43287406e81a3.tar.xz |
Change base/intmath.{cc,hh} to follow m5 style.
arch/alpha/alpha_tru64_process.cc:
base/intmath.hh:
base/statistics.cc:
base/str.cc:
cpu/o3/btb.cc:
sim/process.cc:
sim/syscall_emul.hh:
Rename intmath.hh functions to follow m5 style
(RoundUp -> roundUp, etc.).
base/intmath.cc:
Rename intmath.hh functions to follow m5 style
(RoundUp -> roundUp, etc.).
Also reindent code in m5 style.
--HG--
extra : convert_revision : 57b853002bc3c9911e122599d9062b41a06d8e6a
Diffstat (limited to 'base/intmath.cc')
-rw-r--r-- | base/intmath.cc | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/base/intmath.cc b/base/intmath.cc index 099ab1c9a..f1c1651ba 100644 --- a/base/intmath.cc +++ b/base/intmath.cc @@ -29,30 +29,30 @@ #include "base/intmath.hh" int -PrevPrime(int n) +prevPrime(int n) { - int decr; + int decr; - // If the number is even, let's start with the previous odd number. - if (!(n & 1)) - --n; + // If the number is even, let's start with the previous odd number. + if (!(n & 1)) + --n; - // Lets test for divisibility by 3. Then we will be able to easily - // avoid numbers that are divisible by 3 in the future. - decr = n % 3; - if (decr == 0) { - n -= 2; - decr = 2; - } - else if (decr == 1) - decr = 4; + // Lets test for divisibility by 3. Then we will be able to easily + // avoid numbers that are divisible by 3 in the future. + decr = n % 3; + if (decr == 0) { + n -= 2; + decr = 2; + } + else if (decr == 1) + decr = 4; - for (;;) { - if (IsPrime(n)) - return n; - n -= decr; - // Toggle between 2 and 4 to prevent trying numbers that are known - // to be divisible by 3. - decr = 6 - decr; - } + for (;;) { + if (isPrime(n)) + return n; + n -= decr; + // Toggle between 2 and 4 to prevent trying numbers that are known + // to be divisible by 3. + decr = 6 - decr; + } } |