gimp-plugin-ng fails to compile (AMD64, PATCH included)

Bug #686458 reported by roger_j_larsson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Panotools
New
Undecided
Unassigned

Bug Description

I think this patch is a possible workaround.
Not fully tested since I found out that this program
was not the one I am looking for...

Note1: In stead of d16, s16 it would be possible to
use the d and s...
Note2: Compilers usually have problems with
generation effective code when pointers are
incremented all the time...

/RogerL

Index: src/correct.c
===================================================================
RCS
file: /cvsroot/panotools/gimp-plugin-ng/src/correct.c,v
retrieving revision 1.1.1.1
diff -u -3 -p -r1.1.1.1 correct.c
--- src/correct.c 5 Jan 2005 07:39:15 -0000
1.1.1.1
+++ src/correct.c 16 Jun 2006 23:27:12 -0000
@@ -640,7 +640,7 @@ static void ShiftImage(TrformStr
*TrPtr,
     DENTER;
        register int x,y;
        int cdy, csy;
- unsigned char *dest, *src, *d,*s;
+ unsigned char *dest, *src;
        int bpp = TrPtr->src->bitsPerPixel/8;
        int BitsPerChannel,channels,fcb;

@@ -670,8 +670,8 @@ static void ShiftImage(TrformStr
*TrPtr,
                        csy = (y+yoff) *
TrPtr->src->bytesPerLine;
                        for(x=0;
x<TrPtr->dest->width; x++)
                        {
- d = dest + cdy +
x*bpp;
- s = src + csy +
(x+xoff)*bpp;
+ unsigned char *d =
dest + cdy + x*bpp;
+ unsigned char *s =
src + csy + (x+xoff)*bpp;
                                if(fcb)
                                {
                                        *(d++) =
*(s++);
@@ -690,15 +690,15 @@ static void
ShiftImage(TrformStr *TrPtr,
                        csy = (y+yoff) *
TrPtr->src->bytesPerLine;
                        for(x=0;
x<TrPtr->dest->width; x++)
                        {
- d = dest + cdy +
x*bpp;
- s = src + csy +
(x+xoff)*bpp;
+ USHORT* d16 = (USHORT*)(dest + cdy +
x*bpp);
+ USHORT* s16 =
(USHORT*)(src + csy + (x+xoff)*bpp);
                                if(fcb)
                                {
-
*(((USHORT*)d)++) = *(((USHORT*)s)++);
+ *(d16++) =
*(s16++);
                                }
- *(((USHORT*)d)++) =
*(((USHORT*)s)++);
- *(((USHORT*)d)++) =
*(((USHORT*)s)++);
- *(((USHORT*)d)++) =
*(((USHORT*)s)++);
+ *(d16++) = *(s16++);
+ *(d16++) = *(s16++);
+ *(d16++) = *(s16++);
                        }
                }
        }
Index: src/resample.c
===================================================================
RCS
file: /cvsroot/panotools/gimp-plugin-ng/src/resample.c,v
retrieving revision 1.1.1.1
diff -u -3 -p -r1.1.1.1 resample.c
--- src/resample.c 5 Jan 2005 07:39:27 -0000
1.1.1.1
+++ src/resample.c 16 Jun 2006 23:27:13 -0000
@@ -325,14 +325,16 @@ unsigned short
gamma_correct( double pix
        double yr[ndim], yg[ndim], yb[ndim], w[ndim];
\
        register double rd, gd, bd, weight ;
\
        register int k,i;
\
- register unsigned psize *r, *ri;
\
+ register unsigned psize *r, *ri;
\
+ unsigned psize** rgb_=(unsigned psize**)rgb;
\
+ unsigned psize** dst_=(unsigned psize**)dst;
\

\
        intpol( Dx, w, ndim )
\
        if( color == 0 )
\

{ \
                for(k=0; k<ndim; k++)
\

{ \
- r = ((unsigned psize**)rgb)
[k] + SamplesPerPixel - 3; \
+ r = rgb_[k] +
SamplesPerPixel - 3; \
                        rd = gd = bd = 0.0;
\

\
                        for(i=0; i<ndim; i++)
\
@@ -356,16 +358,16 @@ unsigned short
gamma_correct( double pix
                        gd += yg[i] * weight;
\
                        bd += yb[i] * weight;
\
                }
\
- *((unsigned psize*)dst)++ =
gamma_correct( rd ); \
- *((unsigned psize*)dst)++ =
gamma_correct( gd ); \
- *((unsigned psize*)dst) =
gamma_correct( bd ); \
+ *(dst_)++ =
gamma_correct( rd ); \
+ *(dst_)++ =
gamma_correct( gd ); \
+ *(dst_) =
gamma_correct( bd ); \
        }
\
        else
\

{ \
                color-=1;
\
                for(k=0; k<ndim; k++)
\

{ \
- r = ((unsigned psize**)rgb)
[k] + SamplesPerPixel - 3 + color;\
+ r = (rgb_)[k] +
SamplesPerPixel - 3 + color;\
                        yr[k] = 0.0;
\

\
                        for(i=0; i<ndim; i++)
\
@@ -381,7 +383,7 @@ unsigned short
gamma_correct( double pix

{ \
                        rd += yr[i] * w[ i ];
\
                }
\
- *((unsigned psize*)dst+color) =
gamma_correct( rd ); \
+ *(dst_+color) =
gamma_correct( rd ); \
        }
\

Revision history for this message
prokoudine (prokoudine-users) wrote :

Logged In: YES
user_id=597819

Compilation breaks here as well:

if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I..
-I/usr/include/gimp-2.0 -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -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
-DLOCALEDIR=\""/usr/share/locale"\"
-DDATADIR=\""/usr/share/PanoPlugin"\" -g -O2 -Wall -MT
correct.o -MD -MP -MF ".deps/correct.Tpo" \
          -c -o correct.o `test -f 'correct.c' || echo
'./'`correct.c; \
        then mv -f ".deps/correct.Tpo" ".deps/correct.Po"; \
        else rm -f ".deps/correct.Tpo"; exit 1; \
        fi
correct.c: In function ‘ShiftImage’:
correct.c:697: error: invalid lvalue in increment
correct.c:697: error: invalid lvalue in increment
correct.c:699: error: invalid lvalue in increment
correct.c:699: error: invalid lvalue in increment
correct.c:700: error: invalid lvalue in increment
correct.c:700: error: invalid lvalue in increment
correct.c:701: error: invalid lvalue in increment
correct.c:701: error: invalid lvalue in increment
make[2]: *** [correct.o] Error 1
make[2]: Leaving directory
`/home/avp/soft/build/graphics/panorama/gimp-plugin-ng-rev569/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
`/home/avp/soft/build/graphics/panorama/gimp-plugin-ng-rev569'
make: *** [all] Error 2

Trying to apply the patch above doesn't help:

avp@traveller:~/soft/build/graphics/panorama/gimp-plugin-ng-rev569$
patch -p0 < fix.patch
patching file src/correct.c
patch: **** malformed patch at line 11: *TrPtr,

Revision history for this message
roger_j_larsson (roger-j-larsson) wrote :

Logged In: YES
user_id=296574

The patch had destroyed white space.
Regenerated the patch.

I had some differences in the build system too, but they
look newer. And I can not remember where I got them from...

Revision history for this message
roger_j_larsson (roger-j-larsson) wrote :

The file gimp-plugin-ng-64bit2.patch was added: Recreated patch

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.