Updated rapidjson
This commit is contained in:
+11
-1
@@ -1,9 +1,19 @@
|
|||||||
@echo off
|
@echo off
|
||||||
"..\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
|
"..\cppcheck-main\bin\cppcheck.exe" ../src/*.cpp -D__cppcheck__ -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:"external\src" errors_full.txt > errors_filtered0.txt
|
||||||
findstr /V /C:":checkersReport" errors_filtered0.txt > errors_filtered.txt
|
findstr /V /C:":checkersReport" errors_filtered0.txt > errors_filtered.txt
|
||||||
|
|
||||||
|
findstr /C:"There were critical errors" checkers_report.txt > checkers_report_filtered.txt
|
||||||
|
|
||||||
for /f %%i in ("errors_filtered.txt") do set size=%%~zi
|
for /f %%i in ("errors_filtered.txt") do set size=%%~zi
|
||||||
if %size% gtr 0 (
|
if %size% gtr 0 (
|
||||||
type errors_filtered.txt
|
type errors_filtered.txt
|
||||||
exit 1
|
exit 1
|
||||||
)
|
)
|
||||||
|
|
||||||
|
for /f %%i in ("checkers_report_filtered.txt") do set size2=%%~zi
|
||||||
|
if %size2% gtr 0 (
|
||||||
|
type checkers_report_filtered.txt
|
||||||
|
exit 1
|
||||||
|
)
|
||||||
|
|||||||
@@ -1,8 +1,17 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
../cppcheck-main/cppcheck --project=../build/compile_commands.json -DSIZE_MAX=UINT64_MAX -DRAPIDJSON_ENDIAN=RAPIDJSON_LITTLEENDIAN -DRAPIDJSON_64BIT=1 -D__SSE2__=1 -D__BYTE_ORDER__=1 -D__ORDER_LITTLE_ENDIAN__=1 -D__linux__=1 -D__x86_64 -D_M_AMD64 -D_M_X64 --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 -DRAPIDJSON_64BIT=1 -D__SSE2__=1 -D__BYTE_ORDER__=1 -D__ORDER_LITTLE_ENDIAN__=1 -D__linux__=1 -D__x86_64 -D_M_AMD64 -D_M_X64 --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 'external' errors_full.txt > errors_filtered0.txt
|
||||||
grep -v ':checkersReport' errors_filtered0.txt > errors_filtered.txt
|
grep -v ':checkersReport' errors_filtered0.txt > errors_filtered.txt
|
||||||
|
|
||||||
|
grep 'There were critical errors' checkers_report.txt > checkers_report_filtered.txt
|
||||||
|
|
||||||
if [ -s errors_filtered.txt ]; then
|
if [ -s errors_filtered.txt ]; then
|
||||||
cat errors_filtered.txt
|
cat errors_filtered.txt
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -s checkers_report_filtered.txt ]; then
|
||||||
|
cat checkers_report_filtered.txt
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|||||||
Vendored
+1
-1
Submodule external/src/rapidjson updated: 5eb4b2335a...a6f1188841
@@ -22,7 +22,7 @@
|
|||||||
#include "params.h"
|
#include "params.h"
|
||||||
#include "json_rpc_request.h"
|
#include "json_rpc_request.h"
|
||||||
#include "json_parsers.h"
|
#include "json_parsers.h"
|
||||||
#include <rapidjson/document.h>
|
#include "rapidjson_wrapper.h"
|
||||||
|
|
||||||
LOG_CATEGORY(MergeMiningClientJSON_RPC)
|
LOG_CATEGORY(MergeMiningClientJSON_RPC)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -28,7 +28,7 @@
|
|||||||
#include "block_template.h"
|
#include "block_template.h"
|
||||||
#include "p2pool_api.h"
|
#include "p2pool_api.h"
|
||||||
#include "stratum_server.h"
|
#include "stratum_server.h"
|
||||||
#include <rapidjson/document.h>
|
#include "rapidjson_wrapper.h"
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@
|
|||||||
#include "zmq_reader.h"
|
#include "zmq_reader.h"
|
||||||
#include "mempool.h"
|
#include "mempool.h"
|
||||||
#include "json_rpc_request.h"
|
#include "json_rpc_request.h"
|
||||||
#include "rapidjson/document.h"
|
#include "rapidjson_wrapper.h"
|
||||||
#include "json_parsers.h"
|
#include "json_parsers.h"
|
||||||
#include "pow_hash.h"
|
#include "pow_hash.h"
|
||||||
#include "block_template.h"
|
#include "block_template.h"
|
||||||
|
|||||||
+1
-1
@@ -26,7 +26,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#include "json_rpc_request.h"
|
#include "json_rpc_request.h"
|
||||||
#include "json_parsers.h"
|
#include "json_parsers.h"
|
||||||
#include <rapidjson/document.h>
|
#include "rapidjson_wrapper.h"
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
LOG_CATEGORY(RandomX_Hasher)
|
LOG_CATEGORY(RandomX_Hasher)
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#if defined(_MSC_VER) && defined(__cppcheck__)
|
||||||
|
// cppcheck chokes on rapidjson headers in Windows
|
||||||
|
#else
|
||||||
|
#include <rapidjson/document.h>
|
||||||
|
#endif
|
||||||
@@ -34,8 +34,12 @@
|
|||||||
#include "json_parsers.h"
|
#include "json_parsers.h"
|
||||||
#include "crypto.h"
|
#include "crypto.h"
|
||||||
#include "hardforks/hardforks.h"
|
#include "hardforks/hardforks.h"
|
||||||
|
|
||||||
|
#if !defined(_MSC_VER) || !defined(__cppcheck__)
|
||||||
#include <rapidjson/document.h>
|
#include <rapidjson/document.h>
|
||||||
#include <rapidjson/istreamwrapper.h>
|
#include <rapidjson/istreamwrapper.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
#include "p2pool_api.h"
|
#include "p2pool_api.h"
|
||||||
#include "p2p_server.h"
|
#include "p2p_server.h"
|
||||||
|
|
||||||
|
#include "rapidjson_wrapper.h"
|
||||||
|
|
||||||
LOG_CATEGORY(StratumServer)
|
LOG_CATEGORY(StratumServer)
|
||||||
|
|
||||||
static constexpr int DEFAULT_BACKLOG = 128;
|
static constexpr int DEFAULT_BACKLOG = 128;
|
||||||
@@ -1311,7 +1313,8 @@ bool StratumServer::StratumClient::process_request(char* data, uint32_t size)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StratumServer::StratumClient::process_login(rapidjson::Document& doc, uint32_t id)
|
template<typename T>
|
||||||
|
bool StratumServer::StratumClient::process_login(T& doc, uint32_t id)
|
||||||
{
|
{
|
||||||
const auto params_it = doc.FindMember("params");
|
const auto params_it = doc.FindMember("params");
|
||||||
if (params_it == doc.MemberEnd()) {
|
if (params_it == doc.MemberEnd()) {
|
||||||
@@ -1340,7 +1343,8 @@ bool StratumServer::StratumClient::process_login(rapidjson::Document& doc, uint3
|
|||||||
return static_cast<StratumServer*>(m_owner)->on_login(this, id, login.GetString());
|
return static_cast<StratumServer*>(m_owner)->on_login(this, id, login.GetString());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StratumServer::StratumClient::process_submit(rapidjson::Document& doc, uint32_t id)
|
template<typename T>
|
||||||
|
bool StratumServer::StratumClient::process_submit(T& doc, uint32_t id)
|
||||||
{
|
{
|
||||||
const auto params_it = doc.FindMember("params");
|
const auto params_it = doc.FindMember("params");
|
||||||
if (params_it == doc.MemberEnd()) {
|
if (params_it == doc.MemberEnd()) {
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "tcp_server.h"
|
#include "tcp_server.h"
|
||||||
#include <rapidjson/document.h>
|
|
||||||
|
|
||||||
namespace p2pool {
|
namespace p2pool {
|
||||||
|
|
||||||
@@ -50,8 +49,8 @@ public:
|
|||||||
[[nodiscard]] bool on_read(const char* data, uint32_t size) override;
|
[[nodiscard]] bool on_read(const char* data, uint32_t size) override;
|
||||||
|
|
||||||
[[nodiscard]] bool process_request(char* data, uint32_t size);
|
[[nodiscard]] bool process_request(char* data, uint32_t size);
|
||||||
[[nodiscard]] bool process_login(rapidjson::Document& doc, uint32_t id);
|
template<typename T> [[nodiscard]] bool process_login(T& doc, uint32_t id);
|
||||||
[[nodiscard]] bool process_submit(rapidjson::Document& doc, uint32_t id);
|
template<typename T> [[nodiscard]] bool process_submit(T& doc, uint32_t id);
|
||||||
|
|
||||||
bool send_http_response(bool send_content);
|
bool send_http_response(bool send_content);
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "zmq_reader.h"
|
#include "zmq_reader.h"
|
||||||
#include "json_parsers.h"
|
#include "json_parsers.h"
|
||||||
#include <rapidjson/document.h>
|
#include "rapidjson_wrapper.h"
|
||||||
|
|
||||||
LOG_CATEGORY(ZMQReader)
|
LOG_CATEGORY(ZMQReader)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user