tags 322750 + patch
thanks

Hi,

Attached is a patch for this bug.  I've checked and it builds, runs and
loads example files on AMD64 and still works on i386.  The patch is
fairly small and I've submitted it as a patch which creates and enables
a dpatch in the debian directory.

Cheers,

Mark

-- 
Mark Hymers <[EMAIL PROTECTED]>

"The older I grow, the more I distrust the familiar doctrine that age
 brings wisdom."
     H.L. Mencken
diff -Naur ghemical-1.51/debian/patches/00list 
ghemical-1.51-working/debian/patches/00list
--- ghemical-1.51/debian/patches/00list 2005-09-04 19:23:42.000000000 +0100
+++ ghemical-1.51-working/debian/patches/00list 2005-09-04 19:22:22.000000000 
+0100
@@ -1,3 +1,4 @@
 07_object_protected
 08_gcc-4.0
+09_64bit_glu_fix
 90_config_guess_sub
diff -Naur ghemical-1.51/debian/patches/09_64bit_glu_fix.dpatch 
ghemical-1.51-working/debian/patches/09_64bit_glu_fix.dpatch
--- ghemical-1.51/debian/patches/09_64bit_glu_fix.dpatch        1970-01-01 
01:00:00.000000000 +0100
+++ ghemical-1.51-working/debian/patches/09_64bit_glu_fix.dpatch        
2005-09-04 19:21:28.000000000 +0100
@@ -0,0 +1,89 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 09_64bit_glu_fix.dpatch by  <[EMAIL PROTECTED]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Patch to fix attempt to use 64 bit pointer as 32 bit unique value
+
[EMAIL PROTECTED]@
+
+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,

Attachment: signature.asc
Description: Digital signature

Reply via email to