Removed float/double warning

This commit is contained in:
Paolo Cignoni 2004-03-18 15:30:57 +00:00
parent 1a4283c2af
commit b3252d15b3
2 changed files with 11 additions and 6 deletions

View File

@ -24,6 +24,9 @@
History
$Log: not supported by cvs2svn $
Revision 1.2 2004/03/09 21:26:47 cignoni
cr lf mismatch
Revision 1.1 2004/03/08 09:21:33 cignoni
Initial commit
@ -375,14 +378,14 @@ static bool Save(SaveMeshType &m, const char * filename, bool binary, PlyInfo &
for(i=0;i<pi.vdn;i++)
{
float tf;
float tf; double td;
int ti;
switch (pi.VertexData[i].memtype1)
{
case ply::T_FLOAT : tf=*( (float *) (((char *)vp)+pi.VertexData[i].offset1)); fprintf(fpout,"%g ",tf); break;
case ply::T_DOUBLE : tf=*( (double *) (((char *)vp)+pi.VertexData[i].offset1)); fprintf(fpout,"%g ",tf); break;
case ply::T_DOUBLE : td=*( (double *) (((char *)vp)+pi.VertexData[i].offset1)); fprintf(fpout,"%g ",tf); break;
case ply::T_INT : ti=*( (int *) (((char *)vp)+pi.VertexData[i].offset1)); fprintf(fpout,"%i ",ti); break;
case ply::T_SHORT : ti=*( (short *) (((char *)vp)+pi.VertexData[i].offset1)); fprintf(fpout,"%i ",ti); break;
case ply::T_SHORT : ti=*( (short *) (((char *)vp)+pi.VertexData[i].offset1)); fprintf(fpout,"%i ",ti); break;
case ply::T_CHAR : ti=*( (char *) (((char *)vp)+pi.VertexData[i].offset1)); fprintf(fpout,"%i ",ti); break;
case ply::T_UCHAR : ti=*( (unsigned char *) (((char *)vp)+pi.VertexData[i].offset1)); fprintf(fpout,"%i ",ti); break;
default : assert(0);
@ -545,12 +548,12 @@ static bool Save(SaveMeshType &m, const char * filename, bool binary, PlyInfo &
for(i=0;i<pi.fdn;i++)
{
float tf;
float tf; double td;
int ti;
switch (pi.FaceData[i].memtype1)
{
case ply::T_FLOAT : tf=*( (float *) (((char *)fp)+pi.FaceData[i].offset1)); fprintf(fpout,"%g ",tf); break;
case ply::T_DOUBLE : tf=*( (double *) (((char *)fp)+pi.FaceData[i].offset1)); fprintf(fpout,"%g ",tf); break;
case ply::T_DOUBLE : td=*( (double *) (((char *)fp)+pi.FaceData[i].offset1)); fprintf(fpout,"%g ",tf); break;
case ply::T_INT : ti=*( (int *) (((char *)fp)+pi.FaceData[i].offset1)); fprintf(fpout,"%i ",ti); break;
case ply::T_SHORT : ti=*( (short *) (((char *)fp)+pi.FaceData[i].offset1)); fprintf(fpout,"%i ",ti); break;
case ply::T_CHAR : ti=*( (char *) (((char *)fp)+pi.FaceData[i].offset1)); fprintf(fpout,"%i ",ti); break;

View File

@ -25,6 +25,9 @@
History
$Log: not supported by cvs2svn $
Revision 1.3 2004/03/12 21:42:52 cignoni
First working version!
****************************************************************************/
#ifndef __VCGLIB_IMPORT_STL
@ -141,7 +144,6 @@ static int OpenBinary( OpenMeshType &m, const char * filename, CallBackPos *cb=0
static int OpenAscii( OpenMeshType &m, const char * filename, CallBackPos *cb=0)
{
FILE *fp;
bool binary;
fp = fopen(filename, "r");
if(fp == NULL)
{