aboutsummaryrefslogtreecommitdiffstats
path: root/common/nextpnr.h
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-06-19 13:40:35 +0200
committerClifford Wolf <clifford@clifford.at>2018-06-19 14:10:42 +0200
commitfd40d6f58d10b0435be1f443293e4c9405cfcf05 (patch)
tree57a3d6b2c90eccfae80e6e16b568486237f101cf /common/nextpnr.h
parent5f37da970463b4197ddcdfeb94cfd7c7d6803682 (diff)
downloadnextpnr-fd40d6f58d10b0435be1f443293e4c9405cfcf05.tar.gz
nextpnr-fd40d6f58d10b0435be1f443293e4c9405cfcf05.tar.bz2
nextpnr-fd40d6f58d10b0435be1f443293e4c9405cfcf05.zip
Updates from clangformat
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'common/nextpnr.h')
-rw-r--r--common/nextpnr.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/common/nextpnr.h b/common/nextpnr.h
index 8063a981..2d614058 100644
--- a/common/nextpnr.h
+++ b/common/nextpnr.h
@@ -291,10 +291,7 @@ struct Context : Arch
return rngstate * 0x2545F4914F6CDD1D;
}
- int rng()
- {
- return rng64() & 0x3fffffff;
- }
+ int rng() { return rng64() & 0x3fffffff; }
int rng(int n)
{
@@ -310,22 +307,25 @@ struct Context : Arch
m += 1;
while (1) {
- int x = rng64() & (m-1);
- if (x < n) return x;
+ int x = rng64() & (m - 1);
+ if (x < n)
+ return x;
}
}
void rngseed(uint64_t seed)
{
rngstate = seed ? seed : 0x3141592653589793;
- for (int i = 0; i < 5; i++) rng64();
+ for (int i = 0; i < 5; i++)
+ rng64();
}
- template<typename T>
- void shuffle(std::vector<T> &a) {
+ template <typename T> void shuffle(std::vector<T> &a)
+ {
for (size_t i = 0; i != a.size(); i++) {
size_t j = i + rng(a.size() - i);
- if (j > i) std::swap(a[i], a[j]);
+ if (j > i)
+ std::swap(a[i], a[j]);
}
}
};