[Therion] Weird Error

2005-12-14 Thread Stacho Mudrak
Quoting Olly Betts :
> A couple of hours ago I sent a patch which improves matters, and may
> even fix them.  But the list seems to have eaten it.

I received all the mails now - even the first one with attachement. Thanks. I
will aply it and we will see, whether it helps.

> If that doesn't fully fix it, I have an x86_64 linux machine, so can
> dig further when I have a spare moment.

Thanks again, S.



[Therion] Weird Error

2005-12-14 Thread Olly Betts
On Wed, Dec 14, 2005 at 10:10:58AM +, Wookey wrote:
> +++ Philip Balister [05-12-13 16:53 -0500]:
> > You should spend some time and figure out why it doesn't work for 64 
> > bits. 
> 
> Seconded. What we have so far is a workaround, not a fix. Few of us
> currently have access to 64bit machines, but they are rapidly becoming more
> common. Finding out what problem therion has is well worth spending
> some time on.

A couple of hours ago I sent a patch which improves matters, and may
even fix them.  But the list seems to have eaten it.  Perhaps it's
set to reject attachements, or a spam filter doesn't like them or
something.

Anyway, it's here:

http://www.survex.com/~olly/therion-0.3.9-64bit.patch

If that doesn't fully fix it, I have an x86_64 linux machine, so can
dig further when I have a spare moment.

Cheers,
Olly



[Therion] Weird Error

2005-12-14 Thread Wookey
+++ Philip Balister [05-12-13 16:53 -0500]:
> You should spend some time and figure out why it doesn't work for 64 
> bits. 

Seconded. What we have so far is a workaround, not a fix. Few of us
currently have access to 64bit machines, but they are rapidly becoming more
common. Finding out what problem therion has is well worth spending
some time on.

There are 64bit binaries built for debian, and developer accessible
machines, so I could help with debugging there if necessary (but I am really
overloaded with things to do already so I will struggle to allocate much
time to this, but the facility is there, and I do want to know if the 64 bit
debian Therion [packages are actually broken).

Can you (philip S) post the offending dataset, (or will any dataset do?)

Wookey
-- 
Aleph One Ltd, Bottisham, CAMBRIDGE, CB5 9BA, UK  Tel +44 (0) 1223 811679
work: http://www.aleph1.co.uk/ play: http://www.chaos.org.uk/~wookey/



[Therion] Weird Error

2005-12-14 Thread Olly Betts
On Wed, Dec 14, 2005 at 07:47:42AM +0100, Stacho Mudrak wrote:
> Quoting Philip Schuchardt :
> > Just add -m32 option to the compiler and linker flags.
> 
> Great, thanks a lot. We will add it soon.

This is really a workaround rather than a fix - it assumes you've got a
multilibbed compiler and all the required libraries compiled as 32 bit.
So it won't even work for all x86_64 Linux users, let alone other 64
bit platforms which don't have a 32 bit mode.

Really, the underlying bug (presumably an assumption that sizeof(long)
== 4 or sizeof(void*) == sizeof(int) or similar) needs fixing.

Here's a patch which at least gets us some way along that road.  It may
even be a complete fix - the therion project I had to hand goes from
dying with the error Philip reported to complaining that it doesn't know
about "left" which could just be because it's too old.  I don't really
have time to dig deeper right now.

Cheers,
Olly
-- next part --
diff -ru therion-0.3.9-orig/thexpmodel.cxx therion-0.3.9/thexpmodel.cxx
--- therion-0.3.9-orig/thexpmodel.cxx   2005-05-12 21:03:46.0 +0100
+++ therion-0.3.9/thexpmodel.cxx2005-12-14 08:48:58.800754176 +
@@ -1362,7 +1362,7 @@
   sptr = (thsurvey*)(*obi);
   if (sptr->num1 > 0) {
 sptr->num1 = survnum++;
-fprintf(pltf,"S %d %d %s\n", sptr->num1, (sptr->fsptr != NULL) ? 
sptr->fsptr->num1 : -1, sptr->name);
+fprintf(pltf,"S %ld %ld %s\n", sptr->num1, (sptr->fsptr != NULL) ? 
sptr->fsptr->num1 : -1, sptr->name);
 if (strlen(sptr->title)) {
   fprintf(pltf,"C %s\n", sptr->title);
 }
@@ -1379,7 +1379,7 @@
 if (stnum[i] > 0) {
   stnum[i] = survnum;
   pst = &(dbp->db1d.station_vec[i]);
-  fprintf(pltf,"T %d %d %s %.3f %.3f %.3f G%s%s%s\n", survnum, 
pst->survey->num1, pst->name, pst->x, pst->y, pst->z, (pst->flags & 
TT_STATIONFLAG_ENTRANCE) != 0 ? "E" : "", (pst->flags & TT_STATIONFLAG_FIXED) 
!= 0 ? "F" : "", (pst->flags & TT_STATIONFLAG_CONT) != 0 ? "C" : "");
+  fprintf(pltf,"T %ld %ld %s %.3f %.3f %.3f G%s%s%s\n", survnum, 
pst->survey->num1, pst->name, pst->x, pst->y, pst->z, (pst->flags & 
TT_STATIONFLAG_ENTRANCE) != 0 ? "E" : "", (pst->flags & TT_STATIONFLAG_FIXED) 
!= 0 ? "F" : "", (pst->flags & TT_STATIONFLAG_CONT) != 0 ? "C" : "");
   if (pst->comment != NULL) {
 fprintf(pltf,"C %s\n", pst->comment);
   }
@@ -1392,7 +1392,7 @@
   tlegs = dbp->db1d.get_tree_legs();
   for(i = 0; i < nlegs; i++, tlegs++) {
 if ((*tlegs)->survey->is_selected()) {
-  fprintf(pltf,"H %d %d %d G%s%s\n", 
+  fprintf(pltf,"H %ld %ld %ld G%s%s\n", 
   stnum[(*tlegs)->leg->from.id - 1],
   stnum[(*tlegs)->leg->to.id - 1],
   (*tlegs)->survey->num1,
@@ -1416,7 +1416,7 @@
 case TT_SURFACE_CMD:
   tmp3d = ((thsurface*)(*obi))->get_3d();
   if ((tmp3d != NULL) && (tmp3d->nfaces > 0)) {
-fprintf(pltf,"X 1 %d\n", ((thsurface*)(*obi))->fsptr->num1);
+fprintf(pltf,"X 1 %ld\n", ((thsurface*)(*obi))->fsptr->num1);
 tmp3d->exp_shift_x = 0.0;
 tmp3d->exp_shift_y = 0.0;
 tmp3d->exp_shift_z = 0.0;
@@ -1447,7 +1447,7 @@
 d3d->exp_shift_x = 0.0;
 d3d->exp_shift_y = 0.0;
 d3d->exp_shift_z = 0.0;
-fprintf(pltf,"X 0 %d\n", cs->fsptr->num1);
+fprintf(pltf,"X 0 %ld\n", cs->fsptr->num1);
 d3d->export_tlx(pltf);
   }
 }
diff -ru therion-0.3.9-orig/thtexfonts.cxx therion-0.3.9/thtexfonts.cxx
--- therion-0.3.9-orig/thtexfonts.cxx   2005-05-05 12:20:53.0 +0100
+++ therion-0.3.9/thtexfonts.cxx2005-12-14 08:49:29.025159368 +
@@ -147,7 +147,7 @@
 }

 string replace_all(string s, string f, string r) {
-  unsigned int found = s.find(f);
+  size_t found = s.find(f);
   while(found != string::npos) {
 s.replace(found, f.length(), r);
 found = s.find(f);


[Therion] Weird Error

2005-12-14 Thread Stacho Mudrak
Quoting Philip Schuchardt :
> Does anyone know how get therion to work with a debugger?  Currently, I have
> tried changing the Makefile to:

Just type:

make config-debug

and it should work. I replied you yesterday, no idea why the message did not
arrieved :(

S.