mirror of
https://github.com/SChernykh/p2pool.git
synced 2024-12-22 19:39:22 +00:00
Added cppcheck workflow
This commit is contained in:
parent
abf5918da9
commit
6816ab5861
6 changed files with 37 additions and 1 deletions
26
.github/workflows/cppcheck.yml
vendored
Normal file
26
.github/workflows/cppcheck.yml
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
name: C/C++ CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
cppcheck-ubuntu:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Install cppcheck
|
||||
run: sudo apt update && sudo apt install cppcheck
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Run cppcheck
|
||||
run: |
|
||||
cd cppcheck
|
||||
./run.sh
|
|
@ -1,3 +1,7 @@
|
|||
#!/bin/bash
|
||||
cppcheck ../src -DZMQ_STATIC --platform=unix64 --std=c++14 --enable=all --inconclusive --inline-suppr --template="{file}:{line}:{id}{inconclusive: INCONCLUSIVE} {message}" -I ../src/ -I ../external/src/ -I ../external/src/cryptonote/ -I ../external/src/libuv/ -I ../external/src/cppzmq/ -I ../external/src/libzmq/ -I ../external/src/llhttp/ -I ../external/src/randomx/src/ --suppressions-list=suppressions.txt --output-file=errors_full.txt
|
||||
grep -v 'external' errors_full.txt > errors_filtered.txt
|
||||
grep -v 'external' errors_full.txt | grep -v 'unmatchedSuppression' > errors_filtered.txt
|
||||
if [ -s errors_filtered.txt ]; then
|
||||
cat errors_filtered.txt
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
@ -75,6 +75,7 @@ static FORCEINLINE bool less32(const uint8_t* k0, const uint8_t* k1)
|
|||
return false;
|
||||
}
|
||||
|
||||
// cppcheck-suppress constParameter
|
||||
void generate_keys(hash& pub, hash& sec)
|
||||
{
|
||||
// l = 2^252 + 27742317777372353535851937790883648493.
|
||||
|
@ -152,6 +153,7 @@ static FORCEINLINE void derivation_to_scalar(const hash& derivation, size_t outp
|
|||
hash_to_scalar(begin, end - begin, res);
|
||||
}
|
||||
|
||||
// cppcheck-suppress constParameter
|
||||
bool derive_public_key(const hash& derivation, size_t output_index, const hash& base, hash& derived_key)
|
||||
{
|
||||
uint8_t scalar[HASH_SIZE];
|
||||
|
|
|
@ -240,6 +240,7 @@ static Worker worker;
|
|||
|
||||
#endif // P2POOL_LOG_DISABLE
|
||||
|
||||
// cppcheck-suppress uninitMemberVar
|
||||
NOINLINE Writer::Writer(Severity severity) : Stream(m_stackBuf)
|
||||
{
|
||||
m_buf[0] = static_cast<char>(severity);
|
||||
|
|
|
@ -129,6 +129,7 @@ void p2pool_api::dump_to_file()
|
|||
}
|
||||
|
||||
for (auto& it : data) {
|
||||
// cppcheck-suppress uninitvar
|
||||
DumpFileWork* work = new DumpFileWork{ {}, {}, {}, it.first, std::move(it.second) };
|
||||
work->open_req.data = work;
|
||||
work->write_req.data = work;
|
||||
|
|
|
@ -164,6 +164,7 @@ void RandomX_Hasher::set_seed(const hash& seed)
|
|||
}
|
||||
|
||||
{
|
||||
// cppcheck-suppress unreadVariable
|
||||
ON_SCOPE_LEAVE([this]() { uv_rwlock_wrunlock(&m_cacheLock); });
|
||||
|
||||
if (m_stopped.load()) {
|
||||
|
@ -296,6 +297,7 @@ bool RandomX_Hasher::calculate(const void* data, size_t size, const hash& seed,
|
|||
{
|
||||
// First try to use the dataset if it's ready
|
||||
if (uv_rwlock_tryrdlock(&m_datasetLock) == 0) {
|
||||
// cppcheck-suppress unreadVariable
|
||||
ON_SCOPE_LEAVE([this]() { uv_rwlock_rdunlock(&m_datasetLock); });
|
||||
|
||||
if (m_stopped.load()) {
|
||||
|
|
Loading…
Reference in a new issue