Skip to content

Commit

Permalink
fixup! CI: Enforce -Wall and -Werror
Browse files Browse the repository at this point in the history
Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
  • Loading branch information
vicentebolea committed Jun 16, 2021
1 parent 088641b commit 9e361b8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
6 changes: 4 additions & 2 deletions source/adios2/engine/ssc/SscReader.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,13 @@ SscReader::BlocksInfoCommon(const Variable<T> &variable,
m_WriterDefinitionsLocked == false ||
m_ReaderSelectionsLocked == false)
{
std::memcpy(&b.Value, v.value.data(), v.value.size());
std::memcpy(reinterpret_cast<char *>(&b.Value),
v.value.data(), v.value.size());
}
else
{
std::memcpy(&b.Value, m_Buffer.data() + v.bufferStart,
std::memcpy(reinterpret_cast<char *>(&b.Value),
m_Buffer.data() + v.bufferStart,
v.bufferCount);
}
}
Expand Down
9 changes: 6 additions & 3 deletions source/adios2/toolkit/format/bp5/BP5Deserializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#include "BP5Deserializer.h"
#include "BP5Deserializer.tcc"

#include <limits.h>
#include <math.h>
#include <string.h>

#ifdef _WIN32
Expand Down Expand Up @@ -771,12 +773,13 @@ int BP5Deserializer::FindOffset(size_t Dims, const size_t *Size,

static int FindOffsetCM(size_t Dims, const size_t *Size, const size_t *Index)
{
int Offset = 0;
size_t Offset = 0;
for (size_t i = Dims - 1; i >= 0; i--)
{
Offset = Index[i] + (Size[i] * Offset);
}
return Offset;

return std::min(static_cast<size_t>(INT_MAX), Offset);
}

#define MAX(x, y) (((x) > (y)) ? (x) : (y))
Expand Down Expand Up @@ -830,7 +833,7 @@ void BP5Deserializer::ExtractSelectionFromPartialRM(

BlockSize = 1;
OperantDims = Dims;
OperantElementSize = ElementSize;
OperantElementSize = static_cast<size_t>(ElementSize);
for (size_t Dim = Dims - 1; Dim >= 0; Dim--)
{
if ((GlobalDims[Dim] == PartialCounts[Dim]) &&
Expand Down
7 changes: 6 additions & 1 deletion source/h5vol/H5VolError.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ void *safe_malloc(size_t n, unsigned long line);
#define SAFE_MALLOC(n) safe_malloc(n, __LINE__)

void safe_free(void **p);
#define SAFE_FREE(ptr) safe_free(&ptr)

#ifdef __cplusplus
#define SAFE_FREE(ptr) safe_free(reinterpret_cast<void **>(&ptr))
#else
#define SAFE_FREE(ptr) safe_free((void **)(&ptr))
#endif

void *safe_ralloc(void *ptr, size_t newsize, unsigned long line);
#define SAFE_REALLOC(ptr, newsize) safe_ralloc(ptr, newsize, __LINE__)
Expand Down

0 comments on commit 9e361b8

Please sign in to comment.