• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

randombit / botan / 5357593265

23 Jun 2023 03:19PM UTC coverage: 91.735% (-0.01%) from 91.746%
5357593265

push

github

randombit
Merge GH #3595 Apply clang-tidy more universally

Previously clang-tidy ruleset disabled certain rules for the cli and
tests. Remove these exceptions, and fix the relevant warnings.

Also fix compile_commands.json which had previously not provided information for
the examples, BoGo shim, or fuzzers. As a result, clang-tidy was effectively
blind to them. Fix various clang-tidy findings in these files.

Additionally fix clang-tidy warnings that were in Boost or Sqlite3 specific
code, which had been accidentally omitted in past checks.

Modify the nightly clang-tidy run to additionally check the examples, fuzzers,
shim, and Sqlite3/Boost specific code.

78174 of 85217 relevant lines covered (91.74%)

12400844.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

71.43
/src/lib/utils/thread_utils/semaphore.cpp
1
/*
2
* Semaphore
3
* (C) 2013 Joel Low
4
*
5
* Botan is released under the Simplified BSD License (see license.txt)
6
*/
7

8
#include <botan/internal/semaphore.h>
9

10
// Based on code by Pierre Gaston (http://p9as.blogspot.com/2012/06/c11-semaphores.html)
11

12
namespace Botan {
13

14
void Semaphore::release(size_t n) {
922✔
15
   for(size_t i = 0; i != n; ++i) {
5,526✔
16
      std::lock_guard<std::mutex> lock(m_mutex);
4,604✔
17

18
      if(m_value++ < 0) {
4,604✔
19
         ++m_wakeups;
×
20
         m_cond.notify_one();
×
21
      }
22
   }
4,604✔
23
}
922✔
24

25
void Semaphore::acquire() {
4,604✔
26
   std::unique_lock<std::mutex> lock(m_mutex);
4,604✔
27
   if(m_value-- <= 0) {
4,604✔
28
      m_cond.wait(lock, [this] { return m_wakeups > 0; });
×
29
      --m_wakeups;
×
30
   }
31
}
4,604✔
32

33
}  // namespace Botan
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc