Added casts to remove warnings

This commit is contained in:
Paolo Cignoni 2006-10-09 19:58:08 +00:00
parent b9b2725478
commit 162c7256e5
3 changed files with 17 additions and 7 deletions

View File

@ -25,6 +25,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.4 2006/09/18 12:14:38 cignoni
Removed bug in the creation of the material filename
Revision 1.3 2006/03/07 13:19:29 cignoni Revision 1.3 2006/03/07 13:19:29 cignoni
First Release with OBJ import support First Release with OBJ import support
@ -206,8 +209,8 @@ namespace io {
fprintf(fp,"v %f %f %f\n",(*vi).P()[0],(*vi).P()[1],(*vi).P()[2]); fprintf(fp,"v %f %f %f\n",(*vi).P()[0],(*vi).P()[1],(*vi).P()[2]);
if (cb !=NULL) { if (cb !=NULL) {
if(*cb)((100*++current)/max, "writing vertices "); if(!(*cb)((100*++current)/max, "writing vertices "))
else { fclose(fp); return E_ABORTED;} } { fclose(fp); return E_ABORTED;} }
} }
fprintf(fp,"# %d vertices, %d vertices normals\n\n",m.vert.size(),NormalVertex.size()); fprintf(fp,"# %d vertices, %d vertices normals\n\n",m.vert.size(),NormalVertex.size());
@ -277,8 +280,9 @@ namespace io {
fprintf(fp,"\n"); fprintf(fp,"\n");
} }
if (cb !=NULL) { if (cb !=NULL) {
if(*cb)((100*++current)/max, "writing vertices "); if(!(*cb)((100*++current)/max, "writing vertices "))
else { fclose(fp); return E_ABORTED;} } { fclose(fp); return E_ABORTED;}
}
}//for }//for
fprintf(fp,"# %d faces, %d coords texture\n\n",m.face.size(),CoordIndexTexture.size()); fprintf(fp,"# %d faces, %d coords texture\n\n",m.face.size(),CoordIndexTexture.size());

View File

@ -25,6 +25,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.8 2006/07/09 05:41:17 cignoni
Major rewrite. Now shorter and more robust.
Revision 1.7 2006/06/21 04:26:26 cignoni Revision 1.7 2006/06/21 04:26:26 cignoni
added initial test on end of file in the tokenize added initial test on end of file in the tokenize
@ -478,7 +481,7 @@ static int Open( OpenMeshType &m, const char * filename, Info &oi)
// callback invocation, abort loading process if the call returns false // callback invocation, abort loading process if the call returns false
if ((cb !=NULL)&& (((numTriangles + numVertices)%100)==0) ) if ((cb !=NULL)&& (((numTriangles + numVertices)%100)==0) )
{ {
if (!(*cb)((100.0f * (numTriangles +numVertices) / numVerticesPlusFaces), "Face Loading")) if (!(*cb)( (100*(numTriangles +numVertices))/ numVerticesPlusFaces, "Face Loading"))
return E_ABORTED; return E_ABORTED;
} }
} }
@ -771,7 +774,7 @@ static bool LoadMask(const char * filename, int &mask)
} }
else if (header.compare("f")==0) else if (header.compare("f")==0)
{ {
numTriangles += (tokens.size() - 3); numTriangles += (int)tokens.size() - 3;
std::string remainingText = tokens[1]; std::string remainingText = tokens[1];
// we base our assumption on the fact that the way vertex data is // we base our assumption on the fact that the way vertex data is

View File

@ -25,6 +25,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.1 2006/03/07 13:19:29 cignoni
First Release with OBJ import support
Revision 1.1 2006/02/16 19:28:36 fmazzant Revision 1.1 2006/02/16 19:28:36 fmazzant
transfer of Export_3ds.h, Export_obj.h, Io_3ds_obj_material.h from Meshlab to vcg transfer of Export_3ds.h, Export_obj.h, Io_3ds_obj_material.h from Meshlab to vcg
@ -116,7 +119,7 @@ namespace io {
*/ */
inline static int MaterialsCompare(std::vector<Material> &materials, Material mtl) inline static int MaterialsCompare(std::vector<Material> &materials, Material mtl)
{ {
for(int i=0;i<materials.size();i++) for(unsigned int i=0;i<materials.size();i++)
{ {
bool ka = materials[i].Ka == mtl.Ka; bool ka = materials[i].Ka == mtl.Ka;
bool kd = materials[i].Kd == mtl.Kd; bool kd = materials[i].Kd == mtl.Kd;