Results 1 to 4 of 4
Code:
gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../../include -I../../include -I../../src -I../../src/xine-engine -I../../src/xine-engine -I../../src/xine-utils -I../../src/input -I../../src/input -I../../lib -I/usr/X11R6/include -mtune=pentiumpro -O3 -pipe -fomit-frame-pointer -falign-functions=4 -falign-loops=4 -falign-jumps=4 -mpreferred-stack-boundary=2 -fexpensive-optimizations -fschedule-insns2 -fno-strict-aliasing -ffast-math -funroll-loops ...
- 05-17-2005 #1Linux Engineer
- Join Date
- Jan 2005
- Location
- Chicago (USA)
- Posts
- 1,028
GCC4 lack of backward compatability?
Often when I try to compile something with GCC4 I get an error simalar to that, but the package compiles fine in GCC 3.4. Does anyone else get this and is there any way to stop it?Code:gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../../include -I../../include -I../../src -I../../src/xine-engine -I../../src/xine-engine -I../../src/xine-utils -I../../src/input -I../../src/input -I../../lib -I/usr/X11R6/include -mtune=pentiumpro -O3 -pipe -fomit-frame-pointer -falign-functions=4 -falign-loops=4 -falign-jumps=4 -mpreferred-stack-boundary=2 -fexpensive-optimizations -fschedule-insns2 -fno-strict-aliasing -ffast-math -funroll-loops -finline-functions -Wall -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE -Wnested-externs -Wcast-align -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -MT color.lo -MD -MP -MF .deps/color.Tpo -c color.c -fPIC -DPIC -o .libs/color.o color.c: In function 'vscale_chroma_line': color.c:498: error: invalid lvalue in increment color.c:499: error: invalid lvalue in increment make[3]: *** [color.lo] Error 1 make[3]: Leaving directory `/home/notroot/xine-lib-1.0.1/src/xine-utils' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/notroot/xine-lib-1.0.1/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/notroot/xine-lib-1.0.1' make: *** [all] Error 2 [notroot@localhost xine-lib-1.0.1]$
- 05-17-2005 #2
Can you post a piece of code that gives you that error?
Registered Linux user #270181
TechieMoe's Tech Rants
- 05-17-2005 #3Linux Engineer
- Join Date
- Jan 2005
- Location
- Chicago (USA)
- Posts
- 1,028
From color.c
The red lines are lines 498 and 499 that gave the error.static void vscale_chroma_line (unsigned char *dst, int pitch,
unsigned char *src1, unsigned char *src2, int width) {
unsigned int t1, t2;
unsigned int n1, n2, n3, n4;
unsigned int *dst1, *dst2;
int x;
dst1 = (unsigned int *) dst;
dst2 = (unsigned int *) (dst + pitch);
/* process blocks of 4 pixels */
for (x=0; x < (width / 4); x++) {
n1 = *(((unsigned int *) src1)++);
n2 = *(((unsigned int *) src2)++);
n3 = (n1 & 0xFF00FF00) >> 8;
n4 = (n2 & 0xFF00FF00) >> 8;
n1 &= 0x00FF00FF;
n2 &= 0x00FF00FF;
t1 = (2*n1 + 2*n2 + 0x20002);
t2 = (n1 - n2);
n1 = (t1 + t2);
n2 = (t1 - t2);
t1 = (2*n3 + 2*n4 + 0x20002);
t2 = (n3 - n4);
n3 = (t1 + t2);
n4 = (t1 - t2);
*(dst1++) = ((n1 >> 2) & 0x00FF00FF) | ((n3 << 6) & 0xFF00FF00);
*(dst2++) = ((n2 >> 2) & 0x00FF00FF) | ((n4 << 6) & 0xFF00FF00);
}
/* process remaining pixels */
for (x=(width & ~0x3); x < width; x++) {
n1 = src1[x];
n2 = src2[x];
dst[x] = (3*n1 + n2 + 2) >> 2;
dst[x+pitch] = (n1 + 3*n2 + 2) >> 2;
}
}
The spacing is wierd because I put it in quote tags so the bold and red tags actually did something.
- 05-18-2005 #4Linux Newbie
- Join Date
- Sep 2003
- Location
- St.Charles, Missouri, USA
- Posts
- 201
I dont have much C experience but it seems to me that you cant have 'unsigned int' where it is. I think that you have to delcare a variable and put it there for it to work correctly. The way I would fix it is like this:
With the changes i made in bold. That should compile but you might loose the functionality of modifying 4 pixel blocks. Maybe the 'process remaining pixels' will catch them.static void vscale_chroma_line (unsigned char *dst, int pitch,
unsigned char *src1, unsigned char *src2, int width) {
unsigned int t1, t2;
unsigned int n1, n2, n3, n4;
unsigned int *dst1, *dst2;
int x;
dst1 = (unsigned int *) dst;
dst2 = (unsigned int *) (dst + pitch);
/* process blocks of 4 pixels */
/*for (x=0; x < (width / 4); x++) {
n1 = *(((unsigned int *) src1)++);
n2 = *(((unsigned int *) src2)++);
n3 = (n1 & 0xFF00FF00) >> 8;
n4 = (n2 & 0xFF00FF00) >> 8;
n1 &= 0x00FF00FF;
n2 &= 0x00FF00FF;
t1 = (2*n1 + 2*n2 + 0x20002);
t2 = (n1 - n2);
n1 = (t1 + t2);
n2 = (t1 - t2);
t1 = (2*n3 + 2*n4 + 0x20002);
t2 = (n3 - n4);
n3 = (t1 + t2);
n4 = (t1 - t2);
*(dst1++) = ((n1 >> 2) & 0x00FF00FF) | ((n3 << 6) & 0xFF00FF00);
*(dst2++) = ((n2 >> 2) & 0x00FF00FF) | ((n4 << 6) & 0xFF00FF00);
}*/
/* process remaining pixels */
for (x=(width & ~0x3); x < width; x++) {
n1 = src1[x];
n2 = src2[x];
dst[x] = (3*n1 + n2 + 2) >> 2;
dst[x+pitch] = (n1 + 3*n2 + 2) >> 2;
}
}Powered by Gentoo
never ever ever use the hardened option in make.conf!


Reply With Quote
