Commit 64e09b61 authored by BRAMAS Berenger's avatar BRAMAS Berenger
Browse files

pass nullptr if size is zero in dyn block

parent f878449a
......@@ -248,8 +248,8 @@ public:
for(int idxLeafPtr = 0 ; idxLeafPtr < blockHeader->blockIndexesTableSize ; ++idxLeafPtr){
if(blockIndexesTable[idxLeafPtr] != LeafIsEmptyFlag){
const int id = blockIndexesTable[idxLeafPtr];
ParticlesAttachedClass leaf(symbPart + leafHeader[id].offSetSymb,
(downPart?downPart + leafHeader[id].offSetDown : nullptr));
ParticlesAttachedClass leaf( (leafHeader[id].sizeSymb? symbPart + leafHeader[id].offSetSymb : nullptr),
(downPart && leafHeader[id].sizeDown ?downPart + leafHeader[id].offSetDown : nullptr) );
function(&leaf);
}
}
......@@ -261,8 +261,8 @@ public:
ParticlesAttachedClass getLeaf(const MortonIndex leafIndex){
if(blockIndexesTable[leafIndex - blockHeader->startingIndex] != LeafIsEmptyFlag){
const int id = blockIndexesTable[leafIndex - blockHeader->startingIndex];
return ParticlesAttachedClass(symbPart + leafHeader[id].offSetSymb,
(downPart?downPart + leafHeader[id].offSetDown : nullptr));
return ParticlesAttachedClass((leafHeader[id].sizeSymb? symbPart + leafHeader[id].offSetSymb : nullptr),
(downPart && leafHeader[id].sizeDown ?downPart + leafHeader[id].offSetDown : nullptr) );
}
return ParticlesAttachedClass();
}
......@@ -271,7 +271,9 @@ public:
unsigned char* getLeafSymbBuffer(const MortonIndex leafIndex){
if(blockIndexesTable[leafIndex - blockHeader->startingIndex] != LeafIsEmptyFlag){
const int id = blockIndexesTable[leafIndex - blockHeader->startingIndex];
return (symbPart + leafHeader[id].offSetSymb);
if(leafHeader[id].sizeSymb){
return (symbPart + leafHeader[id].offSetSymb);
}
}
return nullptr;
}
......@@ -280,7 +282,9 @@ public:
unsigned char* getLeafDownBuffer(const MortonIndex leafIndex){
if(blockIndexesTable[leafIndex - blockHeader->startingIndex] != LeafIsEmptyFlag){
const int id = blockIndexesTable[leafIndex - blockHeader->startingIndex];
return (downPart?downPart + leafHeader[id].offSetDown : nullptr);
if(leafHeader[id].sizeDown){
return (downPart?downPart + leafHeader[id].offSetDown : nullptr);
}
}
return nullptr;
}
......
Markdown is supported
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