Skip to content

Commit 3999db1

Browse files
committed
Fixed some compiler warnings.
1 parent 24b2b72 commit 3999db1

13 files changed

Lines changed: 34 additions & 36 deletions

File tree

benchmarks/src/Main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ namespace {
3232

3333
using namespace react;
3434

35-
REACTIVE_DOMAIN(ToposortSTDomain, ToposortEngine<sequential>);
36-
REACTIVE_DOMAIN(ToposortDomain, ToposortEngine<parallel>);
37-
REACTIVE_DOMAIN(PulsecountDomain, PulsecountEngine<parallel>);
38-
REACTIVE_DOMAIN(SubtreeDomain, SubtreeEngine<parallel>);
35+
REACTIVE_DOMAIN(ToposortSTDomain, ToposortEngine<sequential>)
36+
REACTIVE_DOMAIN(ToposortDomain, ToposortEngine<parallel>)
37+
REACTIVE_DOMAIN(PulsecountDomain, PulsecountEngine<parallel>)
38+
REACTIVE_DOMAIN(SubtreeDomain, SubtreeEngine<parallel>)
3939

4040
void runBenchmarkGrid(std::ostream& out)
4141
{

examples/src/BasicSignals.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace example1
3535
// The concat function
3636
string concatFunc(string first, string second) {
3737
return first + string(" ") + second;
38-
};
38+
}
3939

4040
// A signal that concatenates both words
4141
namespace v1

include/react/detail/ObserverBase.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ class ObserverRegistry
6060
{
6161
public:
6262
Entry(std::unique_ptr<IObserver>&& nodePtr, const Observable<D>* subjectPtr) :
63-
nodePtr_( std::move(nodePtr) ),
64-
SubjectPtr( subjectPtr )
63+
SubjectPtr( subjectPtr ),
64+
nodePtr_( std::move(nodePtr) )
6565
{}
6666

6767
Entry(const Entry&) = delete;
6868

6969
Entry(Entry&& other) :
70-
nodePtr_( std::move(other.nodePtr_) ),
71-
SubjectPtr( other.SubjectPtr )
70+
SubjectPtr( other.SubjectPtr ),
71+
nodePtr_( std::move(other.nodePtr_) )
7272
{}
7373

7474
const Observable<D>* SubjectPtr;
@@ -85,7 +85,7 @@ class ObserverRegistry
8585
// Use raw ptr copy as index to find owned version of itself
8686
auto* rawObsPtr = obsPtr.get();
8787

88-
observerMap_.emplace(rawObsPtr, Entry{ std::move(obsPtr), subjectPtr });
88+
observerMap_.emplace(rawObsPtr, Entry( std::move(obsPtr), subjectPtr ));
8989

9090
return rawObsPtr;
9191
}

include/react/detail/graph/AlgorithmNodes.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ class SyncedIterateNode : public SignalNode<D,S>
245245

246246
std::shared_ptr<EventStreamNode<D,E>> events_;
247247

248-
DepHolderT deps_;
249248
TFunc func_;
249+
DepHolderT deps_;
250250
};
251251

252252
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -345,8 +345,8 @@ class SyncedIterateByRefNode : public SignalNode<D,S>
345345

346346
std::shared_ptr<EventStreamNode<D,E>> events_;
347347

348-
DepHolderT deps_;
349348
TFunc func_;
349+
DepHolderT deps_;
350350
};
351351

352352
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -588,7 +588,7 @@ class PulseNode : public EventStreamNode<D,S>
588588
REACT_LOG(D::Log().template Append<NodeEvaluateBeginEvent>(
589589
GetObjectId(*this), turn.Id()));
590590

591-
for (const auto& e : trigger_->Events())
591+
for (uint i=0; i<trigger_->Events().size(); i++)
592592
this->events_.push_back(target_->ValueRef());
593593

594594
REACT_LOG(D::Log().template Append<NodeEvaluateEndEvent>(

include/react/detail/graph/EventNodes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,8 +625,8 @@ class SyncedEventTransformNode : public EventStreamNode<D,TOut>
625625

626626
std::shared_ptr<EventStreamNode<D,TIn>> source_;
627627

628-
DepHolderT deps_;
629628
TFunc func_;
629+
DepHolderT deps_;
630630
};
631631

632632
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -719,8 +719,8 @@ class SyncedEventFilterNode : public EventStreamNode<D,E>
719719

720720
std::shared_ptr<EventStreamNode<D,E>> source_;
721721

722-
DepHolderT deps_;
723722
TFunc filter_;
723+
DepHolderT deps_;
724724
};
725725

726726
/****************************************/ REACT_IMPL_END /***************************************/

include/react/detail/graph/ObserverNodes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ class SyncedObserverNode : public ObserverNode<D>
284284

285285
std::weak_ptr<EventStreamNode<D,E>> subject_;
286286

287-
DepHolderT deps_;
288287
TFunc func_;
288+
DepHolderT deps_;
289289

290290
virtual void detachObserver()
291291
{

src/engine/PulsecountEngine.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ namespace pulsecount {
1919
///////////////////////////////////////////////////////////////////////////////////////////////////
2020
static const uint chunk_size = 8;
2121
static const uint dfs_threshold = 3;
22-
static const uint heavy_weight = 1000;
2322

2423
///////////////////////////////////////////////////////////////////////////////////////////////////
2524
/// MarkerTask
@@ -31,16 +30,16 @@ class MarkerTask: public task
3130

3231
template <typename TInput>
3332
MarkerTask(TInput srcBegin, TInput srcEnd) :
34-
nodes_{ srcBegin, srcEnd }
33+
nodes_( srcBegin, srcEnd )
3534
{}
3635

3736
MarkerTask(MarkerTask& other, SplitTag) :
38-
nodes_{ other.nodes_, SplitTag{} }
37+
nodes_( other.nodes_, SplitTag( ) )
3938
{}
4039

4140
task* execute()
4241
{
43-
int splitCount = 0;
42+
uint splitCount = 0;
4443

4544
while (! nodes_.IsEmpty())
4645
{
@@ -88,18 +87,18 @@ class UpdaterTask: public task
8887

8988
template <typename TInput>
9089
UpdaterTask(TTurn& turn, TInput srcBegin, TInput srcEnd) :
91-
turn_( turn ), // For now, GCC requires still parenthesis here
92-
nodes_{ srcBegin, srcEnd }
90+
turn_( turn ),
91+
nodes_( srcBegin, srcEnd )
9392
{}
9493

9594
UpdaterTask(TTurn& turn, Node* node) :
9695
turn_( turn ),
97-
nodes_{ node }
96+
nodes_( node )
9897
{}
9998

10099
UpdaterTask(UpdaterTask& other, SplitTag) :
101100
turn_( other.turn_ ),
102-
nodes_{ other.nodes_, SplitTag{} }
101+
nodes_( other.nodes_, SplitTag( ) )
103102
{}
104103

105104
task* execute()
@@ -258,7 +257,7 @@ void EngineBase<TTurn>::OnDynamicNodeAttach(Node& node, Node& parent, TTurn& tur
258257
bool shouldTick = false;
259258

260259
{// parent.ShiftMutex (write)
261-
NodeShiftMutexT::scoped_lock lock(parent.ShiftMutex, true);
260+
NodeShiftMutexT::scoped_lock lock(parent.ShiftMutex, true);
262261

263262
parent.Successors.Add(node);
264263

@@ -282,7 +281,7 @@ void EngineBase<TTurn>::OnDynamicNodeAttach(Node& node, Node& parent, TTurn& tur
282281
template <typename TTurn>
283282
void EngineBase<TTurn>::OnDynamicNodeDetach(Node& node, Node& parent, TTurn& turn)
284283
{// parent.ShiftMutex (write)
285-
NodeShiftMutexT::scoped_lock lock(parent.ShiftMutex, true);
284+
NodeShiftMutexT::scoped_lock lock(parent.ShiftMutex, true);
286285

287286
parent.Successors.Remove(node);
288287
}// ~parent.ShiftMutex (write)

src/engine/SubtreeEngine.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ namespace subtree {
1919
///////////////////////////////////////////////////////////////////////////////////////////////////
2020
static const uint chunk_size = 8;
2121
static const uint dfs_threshold = 3;
22-
static const uint heavy_weight = 1000;
2322

2423
///////////////////////////////////////////////////////////////////////////////////////////////////
2524
/// Turn
@@ -63,18 +62,18 @@ class UpdaterTask: public task
6362
using BufferT = NodeBuffer<Node,chunk_size>;
6463

6564
UpdaterTask(TTurn& turn, Node* node) :
66-
turn_( turn ), // For now, GCC requires still parenthesis here
67-
nodes_{ node }
65+
turn_( turn ),
66+
nodes_( node )
6867
{}
6968

7069
UpdaterTask(UpdaterTask& other, SplitTag) :
7170
turn_( other.turn_ ),
72-
nodes_{ other.nodes_, SplitTag{} }
71+
nodes_( other.nodes_, SplitTag( ) )
7372
{}
7473

7574
task* execute()
7675
{
77-
int splitCount = 0;
76+
uint splitCount = 0;
7877

7978
while (!nodes_.IsEmpty())
8079
{

tests/src/MoveTest.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ template <typename TEngine>
2323
class MoveTest : public testing::Test
2424
{
2525
public:
26-
REACTIVE_DOMAIN(MyDomain, TEngine);
26+
REACTIVE_DOMAIN(MyDomain, TEngine)
2727

2828
struct Stats
2929
{

tests/src/ObserverTest.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ template <typename TEngine>
2727
class ObserverTest : public testing::Test
2828
{
2929
public:
30-
REACTIVE_DOMAIN(MyDomain, TEngine);
30+
REACTIVE_DOMAIN(MyDomain, TEngine)
3131
};
3232

3333
TYPED_TEST_CASE_P(ObserverTest);

0 commit comments

Comments
 (0)