Commit 386fef49 by Marcus Winter

removed cpplint warnings

parent fc85c93b
......@@ -171,7 +171,7 @@ void MergeSort(
assert(distance >= 0);
if (block_size == 0) {
block_size= (static_cast<size_t>(distance) / node.GetCoreCount());
block_size = (static_cast<size_t>(distance) / node.GetCoreCount());
if (block_size == 0)
block_size = 1;
}
......
......@@ -195,7 +195,7 @@ void QuickSort(RAI first, RAI last, ComparisonFunction comparison,
typename std::iterator_traits<RAI>::difference_type distance = last - first;
assert(distance > 0);
if (block_size == 0) {
block_size= (static_cast<size_t>(distance) / node.GetCoreCount());
block_size = (static_cast<size_t>(distance) / node.GetCoreCount());
if (block_size == 0)
block_size = 1;
}
......
......@@ -59,7 +59,7 @@ CountTest::CountTest() {
void CountTest::TestDataStructures() {
using embb::algorithms::Count;
const int size =10;
const int size = 10;
int array[] = {10, 20, 30, 30, 20, 10, 10, 20, 20, 20};
std::vector<int> vector(array, array + size);
std::deque<int> deque(array, array + size);
......@@ -73,7 +73,7 @@ void CountTest::TestDataStructures() {
void CountTest::TestCountIf() {
using embb::algorithms::CountIf;
const int size =10;
const int size = 10;
int array[] = {10, 21, 30, 31, 20, 11, 10, 21, 20, 20};
PT_EXPECT_EQ(CountIf(array, array + size, IsEven()), 6);
PT_EXPECT_EQ(CountIf(array, array + size, &IsEvenFunction), 6);
......
......@@ -105,4 +105,4 @@ typedef pthread_cond_t embb_condition_t;
} /* Close extern "C" { */
#endif
#endif /* EMBB_BASE_C_INTERNAL_PLATFORM_H_ */
#endif // EMBB_BASE_C_INTERNAL_PLATFORM_H_
......@@ -81,4 +81,4 @@ class AllocTest : public partest::TestCase {
} // namespace base
} // namespace embb
#endif /* BASE_C_TEST_ALLOC_TEST_H_ */
#endif // BASE_C_TEST_ALLOC_TEST_H_
......@@ -65,4 +65,4 @@ class ConditionVarTest : public partest::TestCase {
} // namespace base
} // namespace embb
#endif /* BASE_C_TEST_CONDITION_VAR_TEST_H_ */
#endif // BASE_C_TEST_CONDITION_VAR_TEST_H_
......@@ -51,4 +51,4 @@ class CoreSetTest : public partest::TestCase {
} // namespace base
} // namespace embb
#endif /* BASE_C_TEST_CORE_SET_TEST_H_ */
#endif // BASE_C_TEST_CORE_SET_TEST_H_
......@@ -97,4 +97,4 @@ class CounterTest : public partest::TestCase {
} // namespace base
} // namespace embb
#endif /* BASE_C_TEST_COUNTER_TEST_H_ */
#endif // BASE_C_TEST_COUNTER_TEST_H_
......@@ -73,4 +73,4 @@ class DurationTest : public partest::TestCase {
} // namespace base
} // namespace embb
#endif /* BASE_C_TEST_DURATION_TEST_H_ */
#endif // BASE_C_TEST_DURATION_TEST_H_
......@@ -78,4 +78,4 @@ int ThreadStart(void* arg);
#endif /* BASE_C_TEST_THREAD_INDEX_TEST_H_ */
#endif // BASE_C_TEST_THREAD_INDEX_TEST_H_
......@@ -61,4 +61,4 @@ class ThreadSpecificStorageTest : public partest::TestCase {
#endif /* BASE_C_TEST_THREAD_SPECIFIC_STORAGE_TEST_H_ */
#endif // BASE_C_TEST_THREAD_SPECIFIC_STORAGE_TEST_H_
......@@ -66,4 +66,4 @@ int ThreadStartFunction(void* arg);
} // namespace base
} // namespace embb
#endif /* BASE_C_TEST_THREAD_TEST_H_ */
#endif // BASE_C_TEST_THREAD_TEST_H_
\ No newline at end of file
......@@ -53,4 +53,4 @@ class TimeTest : public partest::TestCase {
#endif /* BASE_C_TEST_TIME_TEST_H_ */
#endif // BASE_C_TEST_TIME_TEST_H_
......@@ -201,4 +201,4 @@ class CoreSet {
#endif /* EMBB_BASE_CORE_SET_H_ */
#endif // EMBB_BASE_CORE_SET_H_
......@@ -522,4 +522,4 @@ class Nanoseconds : public Tick {
#include <embb/base/internal/duration-inl.h>
#endif /* EMBB_BASE_DURATION_H_ */
#endif // EMBB_BASE_DURATION_H_
......@@ -286,4 +286,4 @@ class ErrorException : public Exception {
} // namespace base
} // namespace embb
#endif /* EMBB_BASE_EXCEPTIONS_H_ */
#endif // EMBB_BASE_EXCEPTIONS_H_
......@@ -112,4 +112,4 @@ Duration<Tick>::Duration(const embb_duration_t& duration) : rep_() {
} // namespace base
} // namespace embb
#endif /* EMBB_BASE_INTERNAL_DURATION_INL_H_ */
#endif // EMBB_BASE_INTERNAL_DURATION_INL_H_
......@@ -116,4 +116,4 @@ bool UniqueLock<Mutex>::OwnsLock() const {
} // namespace base
} // namespace embb
#endif /* EMBB_BASE_INTERNAL_MUTEX_INL_H_ */
#endif // EMBB_BASE_INTERNAL_MUTEX_INL_H_
......@@ -107,4 +107,4 @@ std::basic_ostream<CharT, Traits>&
} // namespace base
} // namespace embb
#endif /* EMBB_BASE_INTERNAL_THREAD_INL_H_ */
#endif // EMBB_BASE_INTERNAL_THREAD_INL_H_
......@@ -103,4 +103,4 @@ struct ThreadClosureArg2 {
} // namespace base
} // namespace embb
#endif /* EMBB_BASE_INTERNAL_THREAD_CLOSURES_H_ */
#endif // EMBB_BASE_INTERNAL_THREAD_CLOSURES_H_
......@@ -149,4 +149,4 @@ void ThreadSpecificStorage<Type>::Prepare() {
} // namespace base
} // namespace embb
#endif /* EMBB_BASE_INTERNAL_THREAD_SPECIFIC_STORAGE_INL_H_ */
#endif // EMBB_BASE_INTERNAL_THREAD_SPECIFIC_STORAGE_INL_H_
......@@ -35,10 +35,12 @@ namespace embb {
namespace base {
namespace test {
/**
/**
* Forward declaration for friending.
*/
class ThreadSpecificStorageTest;
class ThreadSpecificStorageTest;
}
/**
......@@ -176,4 +178,4 @@ class ThreadSpecificStorage {
#include <embb/base/internal/thread_specific_storage-inl.h>
#endif /* EMBB_BASE_THREAD_SPECIFIC_STORAGE_H_ */
#endif // EMBB_BASE_THREAD_SPECIFIC_STORAGE_H_
......@@ -78,4 +78,4 @@ class Time {
} // namespace base
} // namespace embb
#endif /* EMBB_BASE_TIME_H_ */
#endif // EMBB_BASE_TIME_H_
......@@ -42,7 +42,7 @@ class ThreadSpecificStorageTest : public partest::TestCase {
/**
* Adds test units.
*/
explicit ThreadSpecificStorageTest();
ThreadSpecificStorageTest();
private:
/**
......
......@@ -43,7 +43,7 @@ class ThreadTest : public partest::TestCase {
/**
* Adds test methods.
*/
explicit ThreadTest(); /**<
ThreadTest(); /**<
number of threads concurrently running test methods */
private:
......
......@@ -87,9 +87,10 @@ class Inputs<Slices, T1, embb::base::internal::Nil, embb::base::internal::Nil,
}
virtual void OnClock(int clock) {
const int idx = clock % Slices;
if (count_[idx] == 0)
if (count_[idx] == 0) {
EMBB_THROW(embb::base::ErrorException,
"All inputs already fired for this clock.")
}
if (--count_[idx] == 0) {
count_[idx] = 1;
listener_->OnClock(clock);
......@@ -132,9 +133,10 @@ class Inputs<Slices, T1, T2, embb::base::internal::Nil,
}
virtual void OnClock(int clock) {
const int idx = clock % Slices;
if (count_[idx] == 0)
if (count_[idx] == 0) {
EMBB_THROW(embb::base::ErrorException,
"All inputs already fired for this clock.")
}
if (--count_[idx] == 0) {
count_[idx] = 2;
listener_->OnClock(clock);
......@@ -181,9 +183,10 @@ class Inputs<Slices, T1, T2, T3, embb::base::internal::Nil,
}
virtual void OnClock(int clock) {
const int idx = clock % Slices;
if (count_[idx] == 0)
if (count_[idx] == 0) {
EMBB_THROW(embb::base::ErrorException,
"All inputs already fired for this clock.")
}
if (--count_[idx] == 0) {
count_[idx] = 3;
listener_->OnClock(clock);
......@@ -233,9 +236,10 @@ class Inputs<Slices, T1, T2, T3, T4, embb::base::internal::Nil>
}
virtual void OnClock(int clock) {
const int idx = clock % Slices;
if (count_[idx] == 0)
if (count_[idx] == 0) {
EMBB_THROW(embb::base::ErrorException,
"All inputs already fired for this clock.")
}
if (--count_[idx] == 0) {
count_[idx] = 4;
listener_->OnClock(clock);
......@@ -290,9 +294,10 @@ class Inputs
}
virtual void OnClock(int clock) {
const int idx = clock % Slices;
if (count_[idx] == 0)
if (count_[idx] == 0) {
EMBB_THROW(embb::base::ErrorException,
"All inputs already fired for this clock.")
}
if (--count_[idx] == 0) {
count_[idx] = 5;
listener_->OnClock(clock);
......
......@@ -52,7 +52,7 @@ static void testQueueAction(
}
embb_mtapi_log_info("testQueueAction %d called from worker %d...\n",
workload_id, core_num);
EMBB_UNUSED_IN_RELEASE(workload_id);
EMBB_UNUSED(workload_id);
}
static void testDoSomethingElse() {
......
......@@ -50,7 +50,7 @@ static void testTaskAction(
}
embb_mtapi_log_info("testTaskAction %d called from worker %d...\n",
*reinterpret_cast<const int*>(args), core_num);
EMBB_UNUSED_IN_RELEASE(args);
EMBB_UNUSED(args);
}
static void testDoSomethingElse() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment