gimp-plugin-ng fails to compile (AMD64, PATCH included)
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/
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(
*TrPtr,
DENTER;
register int x,y;
int cdy, csy;
- unsigned char *dest, *src, *d,*s;
+ unsigned char *dest, *src;
int bpp = TrPtr->
int BitsPerChannel,
@@ -670,8 +670,8 @@ static void ShiftImage(
*TrPtr,
TrPtr->
x<TrPtr-
- 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;
*(s++);
@@ -690,15 +690,15 @@ static void
ShiftImage(
TrPtr->
x<TrPtr-
- 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);
-
*(((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/
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 )
\
{ \
\
{ \
- r = ((unsigned psize**)rgb)
[k] + SamplesPerPixel - 3; \
+ r = rgb_[k] +
SamplesPerPixel - 3; \
\
\
\
@@ -356,16 +358,16 @@ unsigned short
gamma_correct( double pix
\
\
}
\
- *((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
\
{ \
\
\
{ \
- r = ((unsigned psize**)rgb)
[k] + SamplesPerPixel - 3 + color;\
+ r = (rgb_)[k] +
SamplesPerPixel - 3 + color;\
\
\
\
@@ -381,7 +383,7 @@ unsigned short
gamma_correct( double pix
{ \
\
}
\
- *((unsigned psize*)dst+color) =
gamma_correct( rd ); \
+ *(dst_+color) =
gamma_correct( rd ); \
}
\
Logged In: YES
user_id=597819
Compilation breaks here as well:
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. include/ gimp-2. 0 -I/usr/ include/ glib-2. 0 lib/glib- 2.0/include -I/usr/ include/ gtk-2.0 lib/gtk- 2.0/include -I/usr/ include/ atk-1.0 include/ cairo -I/usr/ include/ pango-1. 0 -I/usr/include \""/usr/ share/locale" \" \""/usr/ share/PanoPlugi n"\" -g -O2 -Wall -MT correct. Tpo"; exit 1; \ avp/soft/ build/graphics/ panorama/ gimp-plugin- ng-rev569/ src' avp/soft/ build/graphics/ panorama/ gimp-plugin- ng-rev569'
-I/usr/
-I/usr/
-I/usr/
-I/usr/
-DLOCALEDIR=
-DDATADIR=
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/
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/
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
`/home/
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,