From 8ca94138b45f1df7807a45e9faa2b6b5c873fe7c Mon Sep 17 00:00:00 2001 From: Marcus Winter Date: Wed, 24 Feb 2016 16:06:13 +0100 Subject: [PATCH] dataflow_cpp: missed some exceptions, fixed wrong asserts --- dataflow_cpp/include/embb/dataflow/internal/inputs.h | 16 +++++----------- dataflow_cpp/include/embb/dataflow/network.h | 5 ++--- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/dataflow_cpp/include/embb/dataflow/internal/inputs.h b/dataflow_cpp/include/embb/dataflow/internal/inputs.h index 28c2dd8..5792354 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/inputs.h +++ b/dataflow_cpp/include/embb/dataflow/internal/inputs.h @@ -90,10 +90,7 @@ class Inputs 0); if (--count_[idx] == 0) { count_[idx] = 1; listener_->OnClock(clock); @@ -143,7 +140,7 @@ class Inputs 0); if (--count_[idx] == 0) { count_[idx] = 2; listener_->OnClock(clock); @@ -197,10 +194,7 @@ class Inputs 0); if (--count_[idx] == 0) { count_[idx] = 3; listener_->OnClock(clock); @@ -257,7 +251,7 @@ class Inputs } virtual void OnClock(int clock) { const int idx = clock % Slices; - assert(count_[idx] == 0); + assert(count_[idx] > 0); if (--count_[idx] == 0) { count_[idx] = 4; listener_->OnClock(clock); @@ -319,7 +313,7 @@ class Inputs } virtual void OnClock(int clock) { const int idx = clock % Slices; - assert(count_[idx] == 0); + assert(count_[idx] > 0); if (--count_[idx] == 0) { count_[idx] = 5; listener_->OnClock(clock); diff --git a/dataflow_cpp/include/embb/dataflow/network.h b/dataflow_cpp/include/embb/dataflow/network.h index b10b910..4297b87 100644 --- a/dataflow_cpp/include/embb/dataflow/network.h +++ b/dataflow_cpp/include/embb/dataflow/network.h @@ -842,9 +842,8 @@ class Network : public internal::ClockListener { */ virtual void OnClock(int clock) { const int idx = clock % Slices; - const int cnt = --sink_counter_[idx]; - assert(cnt == 0); - EMBB_UNUSED_IN_RELEASE(cnt); + assert(sink_counter_[idx] > 0); + --sink_counter_[idx]; } /** -- libgit2 0.26.0