Commit 51ca3ed6 authored by berenger-bramas's avatar berenger-bramas
Browse files

Remove Warning.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@154 2616d619-271b-44dc-8df4-d4a8f33a7222
parent 7b54bb0b
......@@ -44,30 +44,32 @@ protected:
FReal boxWidth; //< the box width read from file
int nbParticles; //< the number of particles read from file
int removeWarning;
public:
/**
* The constructor need the file name
* @param filename the name of the file to open
* you can test if file is successfuly open by calling hasNotFinished()
*/
FFmaBinLoader(const char* const filename): file(fopen(filename, "rb")){
FFmaBinLoader(const char* const filename): file(fopen(filename, "rb")), removeWarning(0) {
// test if open
if(this->file != NULL) {
int sizeOfElement(0);
fread(&sizeOfElement, sizeof(int), 1, file);
removeWarning += fread(&sizeOfElement, sizeof(int), 1, file);
FDEBUG(if(sizeOfElement != int(sizeof(FReal)) ){)
FDEBUG( FDebug::Controller.writeFromLine("Warning type size between file and FReal are differents\n", __LINE__, __FILE__); )
printf("%d sizeofelement\n",sizeOfElement);
FDEBUG(})
fread(&this->nbParticles, sizeof(int), 1, file);
removeWarning += fread(&this->nbParticles, sizeof(int), 1, file);
fread(&this->boxWidth, sizeof(FReal), 1, file);
removeWarning += fread(&this->boxWidth, sizeof(FReal), 1, file);
this->boxWidth *= 2;
FReal x,y,z;
fread(&x, sizeof(FReal), 1, file);
fread(&y, sizeof(FReal), 1, file);
fread(&z, sizeof(FReal), 1, file);
removeWarning += fread(&x, sizeof(FReal), 1, file);
removeWarning += fread(&y, sizeof(FReal), 1, file);
removeWarning += fread(&z, sizeof(FReal), 1, file);
this->centerOfBox.setPosition(x,y,z);
}
else {
......@@ -123,10 +125,10 @@ public:
void fillParticle(ParticleClass& inParticle){
FReal x,y,z,data;
fread(&x, sizeof(FReal), 1, file);
fread(&y, sizeof(FReal), 1, file);
fread(&z, sizeof(FReal), 1, file);
fread(&data, sizeof(FReal), 1, file);
removeWarning += fread(&x, sizeof(FReal), 1, file);
removeWarning += fread(&y, sizeof(FReal), 1, file);
removeWarning += fread(&z, sizeof(FReal), 1, file);
removeWarning += fread(&data, sizeof(FReal), 1, file);
inParticle.setPosition(x,y,z);
inParticle.setPhysicalValue(data);
......
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