MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / isLoggedDivergence

Function isLoggedDivergence

src/OpenLoco/src/GameSaveCompare.cpp:80–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78
79 template<typename T1, typename T2>
80 bool isLoggedDivergence(const std::string type, const T1& lhs, const T2& rhs, bool displayAllDivergences)
81 {
82 long divergentBytesTotal = 0;
83 for (unsigned int offset = 0; offset < sizeof(lhs); offset++)
84 {
85 divergentBytesTotal = bitWiseLogDivergence(type + " [" + std::to_string(offset) + "]", lhs[offset], rhs[offset], displayAllDivergences, divergentBytesTotal);
86 }
87 if (!displayAllDivergences && divergentBytesTotal > 1)
88 {
89 Logging::info(" {} other diverging bytes omitted", divergentBytesTotal);
90 }
91 return divergentBytesTotal > 0;
92 }
93
94 template<typename T1, typename T2>
95 long logDivergence(const std::string type, const T1& lhs, const T2& rhs, int arraySize, bool displayAllDivergences)

Callers 1

compareGameStatesFunction · 0.85

Calls 2

bitWiseLogDivergenceFunction · 0.85
infoFunction · 0.85

Tested by

no test coverage detected