Skip to content

Commit 08e6b67

Browse files
committed
fix some warnings
1 parent 77a5739 commit 08e6b67

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ find_package(LibZip)
2828

2929
# set compiler flags, see http://stackoverflow.com/questions/7724569/debug-vs-release-in-cmake
3030
if(OPENMP_FOUND)
31-
set(CMAKE_CXX_FLAGS "${OpenMP_CXX_FLAGS} -O3 -Wall -Wno-format-extra-args -Wextra -Wformat-nonliteral -Wno-keyword-macro -Wformat-security -Wformat=2")
31+
set(CMAKE_CXX_FLAGS "${OpenMP_CXX_FLAGS} -O3 -Wall -Wno-format-extra-args -Wextra -Wformat-nonliteral -Wformat-security -Wformat=2")
3232

3333
else()
3434
message(STATUS "Configuring without OpenMP")
35-
set(CMAKE_CXX_FLAGS "-O3 -Wall -Wno-format-extra-args -Wextra -Wformat-nonliteral -Wno-keyword-macro -Wformat-security -Wformat=2")
35+
set(CMAKE_CXX_FLAGS "-O3 -Wall -Wno-format-extra-args -Wextra -Wformat-nonliteral -Wformat-security -Wformat=2")
3636
endif()
3737

3838
if(GUROBI_FOUND)

src/loom/optim/ExhaustiveOptimizer.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// Authors: Patrick Brosi <brosi@informatik.uni-freiburg.de>
44

55
#include <algorithm>
6+
#include <random>
7+
#include <chrono>
68
#include <unordered_map>
79

810
#include "loom/optim/ExhaustiveOptimizer.h"
@@ -130,6 +132,9 @@ void ExhaustiveOptimizer::initialConfig(const std::set<OptNode*>& g,
130132
// _____________________________________________________________________________
131133
void ExhaustiveOptimizer::initialConfig(const std::set<OptNode*>& g,
132134
OptOrderCfg* cfg, bool sorted) const {
135+
auto seed = std::chrono::system_clock::now().time_since_epoch().count();
136+
auto randEng = std::default_random_engine(seed);
137+
133138
for (OptNode* n : g) {
134139
for (OptEdge* e : n->getAdjList()) {
135140
if (e->getFrom() != n) continue;
@@ -143,7 +148,7 @@ void ExhaustiveOptimizer::initialConfig(const std::set<OptNode*>& g,
143148
if (sorted) {
144149
std::sort((*cfg)[e].begin(), (*cfg)[e].end());
145150
} else {
146-
std::random_shuffle((*cfg)[e].begin(), (*cfg)[e].end());
151+
std::shuffle((*cfg)[e].begin(), (*cfg)[e].end(), randEng);
147152
}
148153
}
149154
}

src/loom/optim/OptGraph.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,8 @@ size_t OptGraph::getNumLines() const {
676676
for (auto n : getNds()) {
677677
for (auto e : n->getAdjList()) {
678678
if (e->getFrom() != n) continue;
679-
for (auto to : getFirstLnEdgPart(e).lnEdg->pl().getLines()) {
679+
auto ep = getFirstLnEdgPart(e).lnEdg;
680+
for (auto to : ep->pl().getLines()) {
680681
lines.insert(to.line);
681682
}
682683
}

0 commit comments

Comments
 (0)