Package: yafray
Severity: normal
Tags: patch

When building 'yafray' on amd64 with gcc-4.0,
I get the following error:

g++ -Wall -DHAVE_CONFIG_H -D_PTHREADS -O3 -ffast-math -fomit-frame-pointer 
-DPLUGIN_PATH=\"/usr/lib/yafray\" -I. -Isrc/loader -Isrc/yafraycore -c -o 
src/loader/render.o src/loader/render.cc
src/loader/render.cc: In member function 'void* 
yafray::render_t::mesh(yafray::ast_t*)':
src/loader/render.cc:718: error: cast from 'yafray::point3d_t*' to 'int' loses 
precision
src/loader/render.cc:722: error: cast from 'yafray::point3d_t*' to 'int' loses 
precision
src/loader/render.cc:726: error: cast from 'yafray::point3d_t*' to 'int' loses 
precision
src/loader/render.cc:732: error: cast from 'const yafray::shader_t*' to 'int' 
loses precision
scons: *** [src/loader/render.o] Error 1
scons: building terminated because of errors.
make: *** [build-stamp] Error 2

With the attached patch 'yafray' can be compiled
on amd64 using gcc-4.0.

Regards
Andreas Jochens

diff -urN ../tmp-orig/yafray-0.0.7/src/loader/render.cc ./src/loader/render.cc
--- ../tmp-orig/yafray-0.0.7/src/loader/render.cc       2004-08-04 
03:03:24.000000000 +0200
+++ ./src/loader/render.cc      2005-02-28 15:21:06.460921071 +0100
@@ -715,21 +715,21 @@
        }
        for(vector<triangle_t>::iterator i=faces.begin();i!=faces.end();++i)
        {
-               int n=(int)((*i).a);
+               long n=(long)((*i).a);
                if((n>=(int)mesh->points->points.size()) || (n<0))
                        { WARNING<<"Point "<<n<<" out of bounds in object\n"; 
n=0; }
                (*i).a=&(mesh->points->points)[n];
-               n=(int)((*i).b);
+               n=(long)((*i).b);
                if((n>=(int)mesh->points->points.size()) || (n<0))
                        { WARNING<<"Point "<<n<<" out of bounds in object\n"; 
n=0; }
                (*i).b=&(mesh->points->points)[n];
-               n=(int)((*i).c);
+               n=(long)((*i).c);
                if((n>=(int)mesh->points->points.size()) || (n<0))
                        { WARNING<<"Point "<<n<<" out of bounds in object\n"; 
n=0; }
                (*i).c=&(mesh->points->points)[n];
                
                (*i).recNormal();
-               int ishader=(int)(*i).getShader();
+               long ishader=(long)(*i).getShader();
                if(ishader<0) 
                        (*i).setShader(NULL);
                else


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to