Hi, Ghemical-1.90 fails on ia64, alpha and amd64 with this error: x86_64-linux-gnu-g++ -c -g -O2 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gtkglext-1.0 -I/usr/lib/gtkglext-1.0/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/atk-1.0 -I/usr/include/libglade-2.0 -I/usr/include/gtk-2.0 -I/usr/include/libxml2 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/ghemical -I/usr/include/sc -I/usr/include/openbabel -Wall -fno-exceptions -I../src/glade -I/build/buildd/ghemical-1.90/src ./project.cpp [...] ./project.cpp: In member function 'bool project::AddGlobalLight(light*)': ./project.cpp:709: warning: unused variable 'total_lights' ./project.cpp: In member function 'bool project::AddLocalLight(light*, camera*)': ./project.cpp:735: warning: unused variable 'total_lights' ./project.cpp: In member function 'void project::RenderScene(graphics_view*, project::rmode, bool)': ./project.cpp:2804: error: cast from 'atom*' to 'i32u' loses precision ./project.cpp:2867: error: cast from 'atom*' to 'i32u' loses precision ./project.cpp:2927: error: cast from 'atom*' to 'i32u' loses precision /usr/include/sc/util/ref/ref.h: At global scope: /usr/include/sc/util/ref/ref.h:292: warning: inline function 'sc::RefBase::RefBase()' used but never defined make[2]: *** [project.o] Error 1 See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=322750 for more discussion. The attached patch has been proposed, is this the correct one? cheers, Michael -- Michael Banck Debian Developer mbanck at debian.org http://www.advogato.org/person/mbanck/diary.html -------------- next part -------------- diff -Naur ghemical-1.51/src/project.cpp ghemical-1.51-working/src/project.cpp --- ghemical-1.51/src/project.cpp 2005-07-01 12:31:55.000000000 +0100 +++ ghemical-1.51-working/src/project.cpp 2005-09-04 19:12:49.000000000 +0100 @@ -80,6 +80,8 @@ current_traj_frame = NOT_DEFINED; mt_a1 = mt_a2 = mt_a3 = NULL; + + glu_laval = 0; } project::~project(void) @@ -2570,6 +2572,20 @@ // delete [] label_color; } +i32u project::ptr_to_int(void* ptr) +{ + map<void*, i32u>::iterator itr; + + if ((itr = glumap.find(ptr)) == glumap.end()) + { + glu_laval++; + glumap[ptr] = glu_laval; + return glu_laval; + } + else + return itr->second; +} + void project::RenderScene(graphics_view * gv, rmode rm, bool accum) { bool do_bw = (gv->cam->stereo_mode && !gv->cam->stereo_relaxed); @@ -2585,7 +2601,7 @@ for (iter_al it1 = atom_list.begin();it1 != atom_list.end();it1++) // wireframe atoms { if (!TestAtom(& (* it1), rm)) continue; - glPushName(GLNAME_MD_TYPE1); glPushName((i32u) & (* it1)); + glPushName(GLNAME_MD_TYPE1); glPushName(ptr_to_int(&(*it1))); glBegin(GL_POINTS); SetColor(gv->colormode, & (* it1), do_bw); @@ -2648,7 +2664,7 @@ break; } - glPushName(GLNAME_MD_TYPE1); glPushName((i32u) & (* it1)); + glPushName(GLNAME_MD_TYPE1); glPushName(ptr_to_int(& (* it1))); GLUquadricObj * qo = gluNewQuadric(); gluQuadricDrawStyle(qo, (GLenum) GLU_FILL); @@ -2708,7 +2724,7 @@ break; } - glPushName(GLNAME_MD_TYPE1); glPushName((i32u) (* it1).atmr[n2]); + glPushName(GLNAME_MD_TYPE1); glPushName(ptr_to_int((* it1).atmr[n2])); GLUquadricObj * qo = gluNewQuadric(); gluQuadricDrawStyle(qo, (GLenum) GLU_FILL); diff -Naur ghemical-1.51/src/project.h ghemical-1.51-working/src/project.h --- ghemical-1.51/src/project.h 2005-07-01 12:31:55.000000000 +0100 +++ ghemical-1.51-working/src/project.h 2005-09-04 19:09:34.000000000 +0100 @@ -51,6 +51,7 @@ #include <gnome.h> #include <vector> +#include <map> using namespace std; #define FILENAME_FILTER "*.gpr" @@ -77,6 +78,9 @@ vector<camera *> camera_vector; vector<graphics_view *> graphics_view_vector; vector<plotting_view *> plotting_view_vector; + map<void*, i32u> glumap; + i32u glu_laval; + i32u ptr_to_int(void*); /** A static counter of display list IDs. In some targets there can be several GUI's running simultaneously,