From 9927718e25ad42770550d950cd77ef94c9afafe6 Mon Sep 17 00:00:00 2001 From: SChernykh Date: Tue, 13 Jun 2023 11:53:41 +0200 Subject: [PATCH] Tweaked cppcheck command line --- cppcheck/run.cmd | 2 +- cppcheck/run.sh | 2 +- src/p2p_server.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cppcheck/run.cmd b/cppcheck/run.cmd index c6189ec..01847f2 100644 --- a/cppcheck/run.cmd +++ b/cppcheck/run.cmd @@ -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 -DRAPIDJSON_PARSE_DEFAULT_FLAGS=kParseTrailingCommasFlag --platform=win64 --std=c++14 --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 +"..\cppcheck-main\bin\cppcheck.exe" --project=..\build\p2pool.vcxproj --project-configuration="Release|x64" -DSIZE_MAX=UINT64_MAX -DRAPIDJSON_ENDIAN=RAPIDJSON_LITTLEENDIAN -DRAPIDJSON_PARSE_DEFAULT_FLAGS=kParseTrailingCommasFlag -DZMQ_CPP11 -DZMQ_CPP14 --platform=win64 --std=c++14 --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 findstr /V /C:"external\src" errors_full.txt > errors_filtered.txt for /f %%i in ("errors_filtered.txt") do set size=%%~zi if %size% gtr 0 ( diff --git a/cppcheck/run.sh b/cppcheck/run.sh index e2aedae..f370c86 100755 --- a/cppcheck/run.sh +++ b/cppcheck/run.sh @@ -1,5 +1,5 @@ #!/bin/bash -../cppcheck-main/cppcheck ../src -DSIZE_MAX=UINT64_MAX -DRAPIDJSON_ENDIAN=RAPIDJSON_LITTLEENDIAN -DRAPIDJSON_PARSE_DEFAULT_FLAGS=kParseTrailingCommasFlag --platform=unix64 --std=c++14 --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 +../cppcheck-main/cppcheck -DSIZE_MAX=UINT64_MAX -DRAPIDJSON_ENDIAN=RAPIDJSON_LITTLEENDIAN -DRAPIDJSON_PARSE_DEFAULT_FLAGS=kParseTrailingCommasFlag -DZMQ_CPP11 -DZMQ_CPP14 --platform=unix64 --std=c++14 --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 ../src grep -v 'external' errors_full.txt > errors_filtered.txt if [ -s errors_filtered.txt ]; then cat errors_filtered.txt diff --git a/src/p2p_server.cpp b/src/p2p_server.cpp index 53c9023..216f17c 100644 --- a/src/p2p_server.cpp +++ b/src/p2p_server.cpp @@ -1918,11 +1918,11 @@ void P2PServer::P2PClient::on_after_handshake(uint8_t* &p) LOGINFO(5, "sending BLOCK_REQUEST for the chain tip to " << static_cast(m_addrString)); *(p++) = static_cast(MessageId::BLOCK_REQUEST); - hash empty; - memcpy(p, empty.h, HASH_SIZE); + hash zero_hash; + memcpy(p, zero_hash.h, HASH_SIZE); p += HASH_SIZE; - m_blockPendingRequests.push_back(empty); + m_blockPendingRequests.push_back(zero_hash); m_lastBroadcastTimestamp = seconds_since_epoch(); }