Fixed longid support in Gadget format 1
This commit is contained in:
parent
537a68b668
commit
6370a4ee17
@ -172,9 +172,9 @@ SimuData *CosmoTool::loadGadgetMulti(const char *fname, int id,
|
||||
|
||||
ssize_t NumPart = 0, NumPartTotal = 0;
|
||||
#define ENSURE2(name,out_sz) { \
|
||||
int64_t sz; \
|
||||
if (GadgetFormat == 2) { \
|
||||
BlockMap::iterator iter = blockTable.find(name); \
|
||||
int64_t sz; \
|
||||
if (iter == blockTable.end()) { \
|
||||
std::cerr << "GADGET2: Cannot find block named '" << name << "'" << endl; \
|
||||
if (data) delete data; \
|
||||
@ -184,7 +184,14 @@ SimuData *CosmoTool::loadGadgetMulti(const char *fname, int id,
|
||||
f->seek(iter->second.position); \
|
||||
sz = iter->second.size; \
|
||||
out_sz = sz;\
|
||||
} else if (GadgetFormat==1) { \
|
||||
int64_t oldpos = f->position(); \
|
||||
f->beginCheckpoint(); \
|
||||
out_sz = f->getBlockSize(); \
|
||||
f->endCheckpoint(true); \
|
||||
f->seek(oldpos); \
|
||||
} \
|
||||
\
|
||||
}
|
||||
#define ENSURE(name) ENSURE2(name,sz);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user