Commit 15efd3fa authored by Jørgen Lind's avatar Jørgen Lind
Browse files

Fix some warnings

parent 7b6e6147
......@@ -45,8 +45,8 @@ protected:
FileView()
: m_nReferenceCount(1)
, m_nPos(0)
, m_nSize(0)
, m_pData(nullptr)
, m_nSize(0)
{
}
virtual ~FileView()
......
......@@ -139,8 +139,8 @@ namespace OpenVDS
, m_done(false)
{
Aws::S3::Model::GetObjectRequest object_request;
object_request.SetBucket(std::move(convertStdString(bucket)));
object_request.SetKey(std::move(convertStdString(id)));
object_request.SetBucket(convertStdString(bucket));
object_request.SetKey(convertStdString(id));
if (range.end)
{
char rangeHeaderBuffer[100];
......@@ -208,8 +208,8 @@ namespace OpenVDS
, m_done(false)
{
Aws::S3::Model::PutObjectRequest put;
put.SetBucket(std::move(convertStdString(bucket)));
put.SetKey(std::move(convertStdString(id)));
put.SetBucket(convertStdString(bucket));
put.SetKey(convertStdString(id));
put.SetBody(m_stream);
if (range.end)
{
......
......@@ -35,7 +35,7 @@ class Base64Table
for(int i = 0; i < sizeof(alphabet) - 1; i++)
{
table[alphabet[i]] = i;
table[int(alphabet[i])] = i;
}
}
......@@ -57,9 +57,6 @@ bool Base64Decode(const char *data, int64_t len, std::vector<unsigned char> &res
{
bool error = false;
int
decode = 0;
// skip leading whitespace
while(len && isspace(*data)) len--, data++;
if(len == 0) { return true; }
......
......@@ -97,7 +97,7 @@ struct PendingDownloadRequest
}
};
static bool operator<(const VolumeDataChunk &a, const VolumeDataChunk &b)
inline bool operator<(const VolumeDataChunk &a, const VolumeDataChunk &b)
{
if (a.layer->getChunkDimensionGroup() == b.layer->getChunkDimensionGroup())
{
......
......@@ -59,11 +59,11 @@ VolumeDataLayout::VolumeDataLayout(VDSHandle &handle,
, m_positiveRenderMargin(layoutDescriptor.getPositiveMargin())
, m_brickSize2DMultiplier(layoutDescriptor.getBrickSizeMultiplier2D())
, m_maxLOD(layoutDescriptor.getLODLevels())
, m_isCreate2DLODs(layoutDescriptor.isCreate2DLODs())
, m_volumeDataChannelDescriptor(volumeDataChannelDescriptor)
, m_isCreate2DLODs(layoutDescriptor.isCreate2DLODs())
, m_actualValueRangeChannel(actualValueRangeChannel)
, m_actualValueRange(actualValueRange)
, m_contentsHash(volumeDataHash)
, m_actualValueRange(actualValueRange)
, m_compressionMethod(compressionMethod)
, m_compressionTolerance(compressionTolerance)
, m_isZipLosslessChannels(isZipLosslessChannels)
......@@ -91,6 +91,10 @@ VolumeDataLayout::VolumeDataLayout(VDSHandle &handle,
memset(m_primaryTopLayers, 0, sizeof(m_primaryTopLayers));
}
VolumeDataLayout::~VolumeDataLayout()
{
}
VolumeDataLayer::VolumeDataLayerID VolumeDataLayout::addDataLayer(VolumeDataLayer *layer)
{
m_volumeDataLayers.push_back(layer);
......@@ -187,9 +191,6 @@ void VolumeDataLayout::completePendingWriteChunkRequests(int32_t maxPendingWrite
{
std::unique_lock<std::mutex> pendingRequestCountMutexLock(staticGetPendingRequestCountMutex());
bool
isFirstTime = true;
while (m_pendingWriteRequests > maxPendingWriteRequests)
{
staticGetPendingRequestCountChangedCondition().wait_for(pendingRequestCountMutexLock, std::chrono::milliseconds(10));
......
......@@ -76,6 +76,8 @@ public:
bool isZipLosslessChannels,
int32_t waveletAdaptiveLoadLevel);
virtual ~VolumeDataLayout();
VDSHandle &getHandle() { return m_handle; }
uint64_t getContentsHash() const { return uint64_t(m_contentsHash); }
......
......@@ -87,8 +87,6 @@ bool VolumeDataRegion::isChunkInRegion(VolumeDataChunk const &volumeDataChunk) c
VolumeDataRegion::VolumeDataRegion(VolumeDataLayer const &volumeDataLayer, const IndexArray &min, const IndexArray &max)
: m_volumeDataLayer(&volumeDataLayer)
{
VolumeDataLayout *volumeDataLayout = volumeDataLayer.getLayout();
int64_t modulo = 1;
for(int32_t iDimension = 0; iDimension < array_size(m_chunkMin); iDimension++)
......
......@@ -108,7 +108,6 @@ static void copyLinearBufferIntoDataBlock(const void *sourceBuffer, const DataBl
int32_t allocatedSizeX = dataBlock.allocatedSize[0];
int32_t allocatedSizeY = dataBlock.allocatedSize[1];
int32_t allocatedSizeZ = dataBlock.allocatedSize[2];
if(dataBlock.format == VolumeDataChannelDescriptor::Format_1Bit)
{
......@@ -116,15 +115,14 @@ static void copyLinearBufferIntoDataBlock(const void *sourceBuffer, const DataBl
}
uint32_t elementSize = getElementSize(dataBlock);
uint32_t byteSize = sizeX * sizeY * sizeZ * elementSize;
for(int32_t iZ = 0; iZ < sizeZ; iZ++)
{
for(int32_t iY = 0; iY < sizeY; iY++)
{
uint8_t *target = targetBuffer.data() + (iZ * allocatedSizeY + iY) * allocatedSizeX * elementSize;
uint8_t *target = targetBuffer.data() + (iZ * allocatedSizeY + iY) * allocatedSizeX * elementSize;
const uint8_t *source = static_cast<const uint8_t*>(sourceBuffer) + (iZ * sizeY + iY) * sizeX * elementSize;
memcpy(target, source, sizeX * elementSize);
memcpy(target, source, size_t(sizeX) * elementSize);
}
}
}
......@@ -136,7 +134,6 @@ bool deserializeVolumeData(const std::vector<uint8_t> &serializedData, VolumeDat
const void *data = serializedData.data();
int32_t dataVersion = ((int32_t *)data)[0];
int32_t compressedSize = ((int32_t *)data)[1];
assert(dataVersion == WAVELET_DATA_VERSION_1_4);
......
......@@ -145,10 +145,6 @@ static int32_t findTransformMethod(IntVector3 (&bandSize)[TRANSFORM_MAX_ITERATIO
static void createTransformData(Wavelet_TransformData (&transformData)[TRANSFORM_MAX_ITERATIONS], const IntVector3 (&bandSize)[TRANSFORM_MAX_ITERATIONS + 1], int32_t *transformMask, int32_t transformIterations)
{
int32_t previousBandSizeX = -1;
int32_t previousBandSizeY = -1;
int32_t previousBandSizeZ = -1;
for (int i=0; i < transformIterations; i++)
{
int currentTransformMask = transformMask[i];
......@@ -393,8 +389,6 @@ Wavelet::Wavelet(const void *compressedData, int32_t transformSizeX, int32_t tra
m_transformIterations = findTransformMethod(m_bandSize, m_transformMask, m_transformSizeX, m_transformSizeY, m_transformSizeZ, m_dataVersion);
char transformMask = m_transformMask[0];
m_allocatedHalfSizeX = m_bandSize[1][0];
m_allocatedHalfSizeY = m_bandSize[1][1];
m_allocatedHalfSizeZ = m_bandSize[1][2];
......@@ -596,8 +590,6 @@ static void replaceZeroFromZeroCount(T *pic, int transformSizeY, int transformSi
#pragma omp parallel for
for (int iY=0; iY<transformSizeY;iY++)
{
int nCount = 0;
T *read = pic + iY * allocatedSizeX + iZ * allocatedSizeX * allocatedSizeY;
uint16_t count = countLow[iY + iZ * transformSizeY];
......@@ -633,8 +625,6 @@ static void decompressZerosAlongX(const uint8_t *in, void *pic, int elementSize,
int transformSizeYZ = transformSizeY * transformSizeZ;
const uint8_t *start = in;
uint8_t *countLow = temp;
uint8_t *countHigh = temp + transformSizeYZ;
......@@ -908,7 +898,6 @@ void Wavelet::inverseTransform(float *source)
int32_t bufferPitchX = bufferPitchXY * bandSizeZ; // Swapping pitches is faster.
int32_t bitCount[8] = { 0, 1, 1, 2, 1, 2, 2, 3 };
int32_t transformCount = bitCount[transformMask & 0x07];
int32_t readPitchX = m_allocatedSizeX;
int32_t readPitchXY = m_allocatedSizeXY;
......@@ -918,8 +907,6 @@ void Wavelet::inverseTransform(float *source)
float *read = source;
float *write = tempBuffer.data();
const int32_t threadCount = WAVELET_SSE_THREADS;
if (transformMask == 7)
{
// changed so it doez Z first, then Y, then X.
......@@ -1288,8 +1275,6 @@ static inline bool rleDecodeOneRun(uint8_t *&rleByte, uint32_t &setBits)
static void rleDecode(uint8_t *rleBytes, uint32_t *bitBuffer, int32_t intsToDecode)
{
int32_t bytesRead = 0;
int bitsToDecode = intsToDecode * 32;
int writeBit = 0;
......@@ -1329,8 +1314,6 @@ void Wavelet::deCompressNoValues(float *noValue, std::vector<uint32_t> &buffer)
// Create a union for type punning that works with strict aliasing
union { float fValue; int32_t iValue; } convert;
int32_t byteSize = *m_noValueData++;
convert.iValue = *m_noValueData++; *noValue = convert.fValue;
resizeVector(buffer, ((m_transformSizeX + 31) & ~31) / 32, m_transformSizeY, m_transformSizeZ);
......
......@@ -527,11 +527,6 @@ static void evalAndSplit(const WaveletAdaptiveLL_DecodeIterator& decodeIterator,
int32_t elementsThisRun = nElement - iCurrentElement;
uint8_t byte = 0;
int32_t iBit = 0;
int32_t iByteWrite = 0;
int32_t writeOut = iCurrentElement;
int32_t idealChild = 1 << dimensions;
......@@ -743,13 +738,11 @@ static int32_t decodeTreeStructure(const WaveletAdaptiveLL_DecodeIterator& decod
const Wavelet_PixelSetChildren* pixelSetChildren = decodeIterator.pixelSetChildren;
int32_t pixelSetChildrenCount = decodeIterator.pixelSetChildrenCount;
const Wavelet_PixelSetPixel* pixelSetPixelInSignificant = decodeIterator.pixelSetPixelInSignificant;
int32_t pixelSetPixelInsignificantCount = decodeIterator.pixelSetPixelInsignificantCount;
const int32_t startDecodeBits = decodeIterator.decodeBits;
const int32_t maxDecodeLevel = decodeIterator.decompressLevel;
const float startThreshold = decodeIterator.startThreshold;
const float threshold = decodeIterator.threshold;
int32_t* valueEncodingMultiple = decodeIterator.valueEncodingMultiple;
int32_t* valuesAtLevelMultiple = decodeIterator.valuesAtLevelMultiple;
......@@ -861,11 +854,6 @@ static int32_t decodeTreeStructure(const WaveletAdaptiveLL_DecodeIterator& decod
}
int32_t singleOffset = decodeIterator.maxChildren;
int32_t newValuesMultiple = valuesMultiple - signValueSetMultiple;
int32_t newValuesSingle = valuesSingle - signValueSetSingle;
// values at each decode step
valuesAtLevelMultiple[decodeBits] = valuesMultiple * multiple;
valueEncodingMultiple[decodeBits] = iStreamPos;
......@@ -1148,9 +1136,6 @@ int32_t waveletAdaptiveLL_DecompressLossless(uint8_t *in, float *pic, int32_t si
uint8_t *compressedData[4];
// FORWARD COMPATIBILITY!
const int32_t *losslessInit = (int *)in;
in += sizeof(int);
int *readSize = (int *)in;
......
......@@ -527,9 +527,8 @@ Wavelet_TransformLine_UpdateCoarse(float* write, float* read, int32_t nLength, f
inline void
Wavelet_InverseTransformLine(float* readWrite, int32_t nLength)
{
int32_t
nLengthLow = (nLength + 1) >> 1,
nLengthHigh = nLength >> 1;
int32_t nLengthLow = (nLength + 1) >> 1;
int32_t nLengthHigh = nLength >> 1;
Wavelet_TransformLine_UpdateCoarse(readWrite, readWrite + nLengthLow, nLengthLow, -1.0f / 32.0f, (float)REAL_INVSQRT2, nLength & 1);
Wavelet_TransformLine_PredictDetail(readWrite + nLengthLow, readWrite, nLengthHigh, -1.0f / 16.0f, nLength & 1);
......@@ -538,18 +537,15 @@ Wavelet_InverseTransformLine(float* readWrite, int32_t nLength)
inline void
Wavelet_InterleaveLine(float* write, float* readLow, float* readHigh, int32_t nLength)
{
int32_t
nLengthLow = (nLength + 1) >> 1,
nLengthHigh = nLength >> 1;
int32_t nLengthLow = (nLength + 1) >> 1;
int32_t nLengthHigh = nLength >> 1;
int32_t
i = 0;
int32_t i = 0;
for (; i + 8 <= nLength; i += 8)
{
__m128
mmLow = _mm_loadu_ps(readLow + (i >> 1)),
mmHigh = _mm_loadu_ps(readHigh + (i >> 1));
__m128 mmLow = _mm_loadu_ps(readLow + (i >> 1));
__m128 mmHigh = _mm_loadu_ps(readHigh + (i >> 1));
_mm_storeu_ps(write + i, _mm_unpacklo_ps(mmLow, mmHigh));
_mm_storeu_ps(write + i + 4, _mm_unpackhi_ps(mmLow, mmHigh));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment