1
0
Fork 0
mirror of https://github.com/SChernykh/p2pool.git synced 2024-05-19 12:20:21 +00:00

Compare commits

...

4 commits

Author SHA1 Message Date
SChernykh bd1a37e6a0 CI: cppcheck script fixes 2024-04-25 18:53:09 +02:00
SChernykh 4d04e9e2bd Merge branch 'master' into merge-mining 2024-04-25 15:10:06 +02:00
SChernykh bbddf40590 Fixed cppcheck error 2024-04-25 14:48:34 +02:00
SChernykh f4ed9e9840 CI: fixed cppcheck for Windows 2024-04-25 11:46:59 +02:00
6 changed files with 22 additions and 7 deletions

14
cppcheck/includes.txt Normal file
View file

@ -0,0 +1,14 @@
../src/
../external/src/
../external/src/crypto/
../external/src/cryptonote/
../external/src/libuv/
../external/src/cppzmq/
../external/src/libzmq/
../external/src/miniupnp/miniupnpc/include/
../external/src/randomx/src/
../external/src/rapidjson/include/
../external/src/robin-hood-hashing/src/include/
../external/src/grpc/include/
../external/src/grpc/third_party/abseil-cpp/
../external/src/grpc/third_party/protobuf/src/

View file

@ -1,5 +1,5 @@
@echo off
"..\cppcheck-main\bin\cppcheck.exe" --project=..\build\p2pool.vcxproj --project-configuration="Release|x64" -DSIZE_MAX=UINT64_MAX -DRAPIDJSON_ENDIAN=RAPIDJSON_LITTLEENDIAN --platform=win64 --std=c++17 --enable=all --inconclusive --inline-suppr --template="{file}:{line}:{id}{inconclusive: INCONCLUSIVE} {message}" --suppressions-list=suppressions.txt --output-file=errors_full.txt --max-ctu-depth=3 --check-level=exhaustive --checkers-report=checkers_report.txt
"..\cppcheck-main\bin\cppcheck.exe" ../src/*.cpp -DSIZE_MAX=UINT64_MAX -DRAPIDJSON_ENDIAN=RAPIDJSON_LITTLEENDIAN -D_WIN32=1 -D_WIN64=1 -DWIN32=1 -D_WINDOWS=1 -DNDEBUG=1 -DWITH_GRPC=1 -DPROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII=0 -DWITH_RANDOMX=1 -DWITH_UPNP=1 -DCURL_STATICLIB=1 -DWIN32_LEAN_AND_MEAN=1 -D_WIN32_WINNT=0x0600 -D_DISABLE_VECTOR_ANNOTATION=1 -D_DISABLE_STRING_ANNOTATION=1 -DZMQ_STATIC=1 -DHAVE_BITSCANREVERSE64=1 -DRAPIDJSON_PARSE_DEFAULT_FLAGS=kParseTrailingCommasFlag -DMINIUPNP_STATICLIB=1 -DCARES_STATICLIB=1 -DCMAKE_INTDIR="Release" -D__SSE2__=1 -D_MSC_VER=1929 -D__COVERITY__ --platform=win64 --std=c++17 --enable=all --inconclusive --inline-suppr --template="{file}:{line}:{id}{inconclusive: INCONCLUSIVE} {message}" --includes-file=includes.txt --suppressions-list=suppressions.txt --output-file=errors_full.txt --max-ctu-depth=3 --check-level=exhaustive --checkers-report=checkers_report.txt
findstr /V /C:"external\src" errors_full.txt > errors_filtered0.txt
findstr /V /C:":checkersReport" errors_filtered0.txt > errors_filtered.txt
for /f %%i in ("errors_filtered.txt") do set size=%%~zi

View file

@ -1,5 +1,5 @@
#!/bin/bash
../cppcheck-main/cppcheck --project=../build/compile_commands.json -DSIZE_MAX=UINT64_MAX -DRAPIDJSON_ENDIAN=RAPIDJSON_LITTLEENDIAN -D__SSE2__=1 --platform=unix64 --std=c++17 --enable=all --inconclusive --inline-suppr --template="{file}:{line}:{id}{inconclusive: INCONCLUSIVE} {message}" --suppressions-list=suppressions.txt --output-file=errors_full.txt --max-ctu-depth=3 --check-level=exhaustive --checkers-report=checkers_report.txt
../cppcheck-main/cppcheck --project=../build/compile_commands.json -DSIZE_MAX=UINT64_MAX -DRAPIDJSON_ENDIAN=RAPIDJSON_LITTLEENDIAN -D__SSE2__=1 -D__BYTE_ORDER__=1 -D__ORDER_LITTLE_ENDIAN__=1 -D__linux__=1 --platform=unix64 --std=c++17 --enable=all --inconclusive --inline-suppr --template="{file}:{line}:{id}{inconclusive: INCONCLUSIVE} {message}" --suppressions-list=suppressions.txt --output-file=errors_full.txt --max-ctu-depth=3 --check-level=exhaustive --checkers-report=checkers_report.txt
grep -v 'external' errors_full.txt > errors_filtered0.txt
grep -v ':checkersReport' errors_filtered0.txt > errors_filtered.txt
if [ -s errors_filtered.txt ]; then

View file

@ -86,8 +86,9 @@ struct BlockCache::Impl : public nocopy_nomove
#elif defined(_WIN32)
Impl()
: m_file(CreateFile(cache_name, GENERIC_ALL, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_HIDDEN, NULL))
, m_map(0)
{
m_file = CreateFile(cache_name, GENERIC_ALL, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_HIDDEN, NULL);
if (m_file == INVALID_HANDLE_VALUE) {
LOGERR(1, "couldn't open " << cache_name << ", error " << static_cast<uint32_t>(GetLastError()));
return;
@ -140,8 +141,8 @@ struct BlockCache::Impl : public nocopy_nomove
}
}
HANDLE m_file = INVALID_HANDLE_VALUE;
HANDLE m_map = 0;
HANDLE m_file;
HANDLE m_map;
#else
// Not implemented on other platforms

View file

@ -42,7 +42,7 @@ MergeMiningClientTari::MergeMiningClientTari(p2pool* pool, std::string host, con
host.erase(0, sizeof(TARI_PREFIX) - 1);
while (host.back() == '/') {
while (!host.empty() && (host.back() == '/')) {
host.pop_back();
}

View file

@ -73,7 +73,7 @@ private:
struct TariClient : public TCPServer::Client
{
TariClient();
~TariClient() {}
~TariClient() override {}
static Client* allocate() { return new TariClient(); }
virtual size_t size() const override { return sizeof(TariClient); }