Fixed errors found by static analysis

This commit is contained in:
SChernykh 2020-12-08 12:16:59 +01:00
parent 1c9e959cc4
commit cafd868773
10 changed files with 16 additions and 28 deletions

View file

@ -110,7 +110,7 @@ private:
alignas(16) uint8_t m_blobs[2][Job::kMaxBlobSize * N]{};
Job m_jobs[2];
uint32_t m_rounds[2] = { 0, 0 };
uint64_t m_nonce_mask[2];
uint64_t m_nonce_mask[2] = { 0, 0 };
uint64_t m_sequence = 0;
uint8_t m_index = 0;
};

View file

@ -46,7 +46,7 @@ public:
HwlocCpuInfo();
~HwlocCpuInfo() override;
static inline bool has(Feature feature) { return m_features & feature; }
static inline bool hasFeature(Feature feature) { return m_features & feature; }
inline const std::vector<uint32_t> &nodeset() const { return m_nodeset; }
inline hwloc_topology_t topology() const { return m_topology; }

View file

@ -93,7 +93,7 @@ xmrig::OclAstroBWTRunner::~OclAstroBWTRunner()
OclLib::release(m_tmp_indices);
OclLib::release(m_filtered_hashes);
delete m_bwt_data_sizes_host;
delete [] m_bwt_data_sizes_host;
}

View file

@ -43,6 +43,9 @@
namespace xmrig {
constexpr size_t BLOB_SIZE = 40;
OclKawPowRunner::OclKawPowRunner(size_t index, const OclLaunchData &data) : OclBaseRunner(index, data)
{
switch (data.thread.worksize())
@ -82,7 +85,7 @@ void OclKawPowRunner::run(uint32_t nonce, uint32_t *hashOutput)
const size_t global_work_offset = nonce;
const size_t global_work_size = m_intensity - (m_intensity % m_workGroupSize);
enqueueWriteBuffer(m_input, CL_FALSE, 0, 40, m_blob);
enqueueWriteBuffer(m_input, CL_FALSE, 0, BLOB_SIZE, m_blob);
const uint32_t zero[2] = {};
enqueueWriteBuffer(m_output, CL_FALSE, 0, sizeof(uint32_t), zero);
@ -177,7 +180,7 @@ void OclKawPowRunner::set(const Job &job, uint8_t *blob)
OclLib::setKernelArg(m_searchKernel, 5, sizeof(m_stop), &m_stop);
m_blob = blob;
enqueueWriteBuffer(m_input, CL_TRUE, 0, sizeof(m_blob), m_blob);
enqueueWriteBuffer(m_input, CL_TRUE, 0, BLOB_SIZE, m_blob);
}