- Unbreak

- Fix build with gcc 4.2

PR:		117765
Submitted by:	Pietro Cerutti <gahr@gahr.ch>
Approved by:	portmgr (pav)
This commit is contained in:
Martin Wilke 2007-11-05 10:04:34 +00:00
parent cba8c01b3d
commit f0b9b9e97e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=202510
7 changed files with 175 additions and 4 deletions

View file

@ -46,10 +46,6 @@ MAN5= directfbrc.5
.include <bsd.port.pre.mk>
.if ${OSVERSION} >= 700042
BROKEN= Does not compile with GCC 4.2
.endif
.if ${ARCH} == "alpha"
BROKEN= Does not compile on alpha
.endif

View file

@ -0,0 +1,20 @@
--- interfaces/IDirectFBImageProvider/idirectfbimageprovider_jpeg.c.orig 2007-11-02 12:40:44.000000000 +0100
+++ interfaces/IDirectFBImageProvider/idirectfbimageprovider_jpeg.c 2007-11-02 12:42:20.000000000 +0100
@@ -464,7 +464,7 @@
BUG("unsupported format not filtered before");
return DFB_BUG;
}
- (__u8*)row_ptr += pitch;
+ row_ptr = (__u8*)row_ptr + pitch;
}
}
else { /* image must be scaled */
@@ -474,7 +474,7 @@
while (cinfo.output_scanline < cinfo.output_height) {
jpeg_read_scanlines(&cinfo, buffer, 1);
copy_line32( (__u32*)row_ptr, *buffer, cinfo.output_width);
- (__u32*)row_ptr += cinfo.output_width;
+ row_ptr = (__u32*)row_ptr + cinfo.output_width;
}
dfb_scale_linear_32( dst, image_data, cinfo.output_width,
cinfo.output_height, rect.w, rect.h,

View file

@ -0,0 +1,11 @@
--- src/core/input.c.orig 2002-12-29 01:17:06.000000000 +0100
+++ src/core/input.c 2007-11-02 12:17:48.000000000 +0100
@@ -1312,7 +1312,7 @@
write( fd, buf24, surface->width * 3 );
- ((__u8*)data) += pitch;
+ data = (__u8*)data + pitch;
}
dfb_surface_unlock( surface, (surface->caps & DSCAPS_FLIPPING) );

View file

@ -0,0 +1,15 @@
--- src/display/idirectfbsurface.c.orig 2007-11-02 12:19:20.000000000 +0100
+++ src/display/idirectfbsurface.c 2007-11-02 12:27:33.000000000 +0100
@@ -298,9 +298,9 @@
if (ret)
return ret;
- (__u8*)(*ptr) += data->area.current.y * (*pitch) +
- data->area.current.x *
- DFB_BYTES_PER_PIXEL(data->surface->format);
+ *ptr = (__u8 *)(*ptr) + (data->area.current.y * (*pitch) +
+ data->area.current.x *
+ DFB_BYTES_PER_PIXEL(data->surface->format));
data->locked = front + 1;

View file

@ -0,0 +1,12 @@
--- src/gfx/generic/generic.c.orig 2007-11-02 12:36:17.000000000 +0100
+++ src/gfx/generic/generic.c 2007-11-02 12:40:03.000000000 +0100
@@ -555,7 +555,8 @@
__u16 *S = (__u16*)Bop;
if (((long)D)&2) {
- *(((__u16*)D)++) = *S;
+ D = (__u16*)D++;
+ *D = *S;
i += SperD;
w--;
}

View file

@ -0,0 +1,71 @@
--- src/misc/gfx_util.c.orig 2007-11-02 12:28:22.000000000 +0100
+++ src/misc/gfx_util.c 2007-11-02 12:32:42.000000000 +0100
@@ -138,14 +138,14 @@
*(__u8 *)dst++ = *src >> 24;
src++;
}
- (__u8 *)dst += dskip;
+ dst = (__u8 *)dst + dskip;
}
break;
case DSPF_ARGB:
for (y = 0; y < h; y++) {
dfb_memcpy (dst, src, w * 4);
- (__u8 *)dst += w * 4 + dskip;
+ dst = (__u8 *)dst + (w * 3 + dskip);
src += w;
}
break;
@@ -174,10 +174,10 @@
a, dst_format, palette);
break;
}
- (__u8 *)dst += DFB_BYTES_PER_PIXEL (dst_format);
+ dst = (__u8 *)dst + (DFB_BYTES_PER_PIXEL (dst_format));
src++;
}
- (__u8 *)dst += dskip;
+ dst = (__u8 *)dst + dskip;
}
break;
}
@@ -380,7 +380,7 @@
x += x_step;
}
- return dst;
+ return (char *)dst;
}
void dfb_scale_linear_32( void *dst, __u32 *src, int sw, int sh,
@@ -446,9 +446,9 @@
y_start++;
}
- (__u8 *)outbuf =
+ outbuf =
dst + i * (DFB_BYTES_PER_PIXEL (dst_format) * dw + dskip);
- (__u8 *)outbuf_end = outbuf + DFB_BYTES_PER_PIXEL (dst_format) * dw;
+ outbuf_end = outbuf + DFB_BYTES_PER_PIXEL (dst_format) * dw;
x = scaled_x_offset;
x_start = x >> SCALE_SHIFT;
dest_x = 0;
@@ -462,7 +462,7 @@
x += x_step;
x_start = x >> SCALE_SHIFT;
dest_x++;
- (__u8 *)outbuf += DFB_BYTES_PER_PIXEL (dst_format);
+ outbuf = (__u8 *)outbuf + DFB_BYTES_PER_PIXEL (dst_format);
}
new_outbuf = scale_line (run_weights, filter.n_x, filter.n_y, outbuf,
@@ -480,7 +480,7 @@
x >> SCALE_SHIFT, sw, dst_format, palette);
x += x_step;
- (__u8 *)outbuf += DFB_BYTES_PER_PIXEL (dst_format);
+ outbuf = (__u8 *)outbuf + DFB_BYTES_PER_PIXEL (dst_format);
}
y += y_step;

View file

@ -0,0 +1,46 @@
--- src/misc/memcpy.c.orig 2007-11-02 12:33:04.000000000 +0100
+++ src/misc/memcpy.c 2007-11-02 12:35:27.000000000 +0100
@@ -226,8 +226,8 @@
"movq %%mm6, 48(%1)\n"
"movq %%mm7, 56(%1)\n"
:: "r" (from), "r" (to) : "memory");
- ((const unsigned char *)from)+=64;
- ((unsigned char *)to)+=64;
+ from = (const unsigned char *)from + 64;
+ to = (unsigned char *)to + 64;
}
__asm__ __volatile__ ("emms":::"memory");
}
@@ -288,8 +288,8 @@
"movntq %%mm6, 48(%1)\n"
"movntq %%mm7, 56(%1)\n"
:: "r" (from), "r" (to) : "memory");
- ((const unsigned char *)from)+=64;
- ((unsigned char *)to)+=64;
+ from = (const unsigned char *)from + 64;
+ to = (unsigned char *)to + 64;
}
/* since movntq is weakly-ordered, a "sfence"
* is needed to become ordered again. */
@@ -346,8 +346,8 @@
"movntps %%xmm2, 32(%1)\n"
"movntps %%xmm3, 48(%1)\n"
:: "r" (from), "r" (to) : "memory");
- ((const unsigned char *)from)+=64;
- ((unsigned char *)to)+=64;
+ from = (const unsigned char *)from + 64;
+ to = (unsigned char *)to + 64;
}
else
/*
@@ -368,8 +368,8 @@
"movntps %%xmm2, 32(%1)\n"
"movntps %%xmm3, 48(%1)\n"
:: "r" (from), "r" (to) : "memory");
- ((const unsigned char *)from)+=64;
- ((unsigned char *)to)+=64;
+ from = (const unsigned char *)from + 64;
+ to = (unsigned char *)to + 64;
}
/* since movntq is weakly-ordered, a "sfence"
* is needed to become ordered again. */