pan-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pan-users] Re: make errors


From: David Shochat
Subject: Re: [Pan-users] Re: make errors
Date: Thu, 19 Jun 2008 21:00:57 -0400
User-agent: Thunderbird 2.0.0.14 (X11/20080421)

walt wrote:
David Shochat wrote:
Is this code from old pan or new pan? Maybe I'll try doing the actual
patch.

Please do.  My new patch based on your idea compiles beautifully but
crashes when I enter a group.  The crash report generated by bugbuddy
mentions that the value of 'tmp' was optimized out :o)  This is old pan.
Well, I don't see the difference between what you did and what I did. However, I have not yet had any crashes, so maybe someone else will see a subtle difference between our patches. I will put my patch at the end of this message. Now I did have another problem, which I think has been discussed here: 3 files failed to compile because of g_assert being undefined. I discovered that in the version of glib I have (this is Ubuntu 8.04), g_assert and friends are actually in glib/gtestutils.h. So I had to add a #include <glib/gtestutils.h> to each file where I got that error:
pan/base/pan-object.c
gmime/gmime-filter-basic.c
gmime/gmime-filter-yenc.c
With those changes plus the patch on msort.c, old pan built and seems to run ok based on very limited testing. I seem to have gcc 4.2.3.
-- David

The patch:

--- pan/base/msort.c.orig    2001-06-18 14:33:38.000000000 -0400
+++ pan/base/msort.c    2008-06-19 20:13:32.000000000 -0400
@@ -41,7 +41,9 @@
    char* t)
{
    char *tmp;
+    unsigned long int *uli_tmp;
    char *b1, *b2;
+    unsigned long int *uli_b1, *uli_b2;
    size_t n1, n2;
    const int opsiz = sizeof(unsigned long int);

@@ -65,14 +67,24 @@
            if ((*cmp) (b1, b2) <= 0)
            {
                --n1;
-                *((unsigned long int *) tmp)++ =
-                    *((unsigned long int *) b1)++;
+                /* *((unsigned long int *) tmp)++ =
+                 *((unsigned long int *) b1)++; */
+                uli_tmp = (unsigned long int *) tmp;
+                uli_b1 = (unsigned long int *) b1;
+                *uli_tmp++ = *uli_b1++;
+                tmp = (char *) uli_tmp;
+                b1 = (char *) uli_b1;
            }
            else
            {
                --n2;
-                *((unsigned long int *) tmp)++ =
-                    *((unsigned long int *) b2)++;
+                /* *((unsigned long int *) tmp)++ =
+                 *((unsigned long int *) b2)++; */
+                uli_tmp = (unsigned long int *) tmp;
+                uli_b2 = (unsigned long int *) b2;
+                *uli_tmp++ = *uli_b2++;
+                tmp = (char *) uli_tmp;
+                b2 = (char *) uli_b2;
            }
        }
    else





reply via email to

[Prev in Thread] Current Thread [Next in Thread]