diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2006-06-20 00:18:44 +0000 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2006-06-20 00:18:44 +0000 |
commit | 1edd2f2a81cbf1d5385f5a9f12bf8ff2c05c701d (patch) | |
tree | 50473b6c4e5b6289b7e7d6fd8e44b1497322c8f6 | |
parent | 2935be1cf5c2c3a416d8c024c8f3f9df042ab995 (diff) | |
download | xine-lib-1edd2f2a81cbf1d5385f5a9f12bf8ff2c05c701d.tar.gz xine-lib-1edd2f2a81cbf1d5385f5a9f12bf8ff2c05c701d.tar.bz2 |
Remove need to use -fno-strict-aliasing, by using an union on accept() usage, and by not using a double pointer in alphablend code (the first pointer was always dereferenced anyway).
CVS patchset: 8062
CVS date: 2006/06/20 00:18:44
-rw-r--r-- | src/xine-engine/Makefile.am | 2 | ||||
-rw-r--r-- | src/xine-engine/alphablend.c | 46 | ||||
-rw-r--r-- | src/xine-engine/broadcaster.c | 13 |
3 files changed, 32 insertions, 29 deletions
diff --git a/src/xine-engine/Makefile.am b/src/xine-engine/Makefile.am index 4d99d1452..2ec481960 100644 --- a/src/xine-engine/Makefile.am +++ b/src/xine-engine/Makefile.am @@ -1,7 +1,7 @@ include $(top_srcdir)/misc/Makefile.common include $(top_srcdir)/lib/Makefile.common -AM_CFLAGS = $(X_CFLAGS) $(FT2_CFLAGS) -fno-strict-aliasing +AM_CFLAGS = $(X_CFLAGS) $(FT2_CFLAGS) AM_CPPFLAGS = $(ZLIB_CPPFLAGS) -DXINE_LIBRARY_COMPILE LIBTOOL = $(SHELL) $(top_builddir)/libtool diff --git a/src/xine-engine/alphablend.c b/src/xine-engine/alphablend.c index 8be28ccdb..8d10d0414 100644 --- a/src/xine-engine/alphablend.c +++ b/src/xine-engine/alphablend.c @@ -1117,9 +1117,9 @@ static uint8_t *(*blend_yuv_grow_extra_data(alphablend_t *extra_data, int osd_wi int id; int max_width; uint8_t *data[ 3 ][ 2 ]; - } **header = (struct header_s **)&extra_data->buffer; + } *header = (struct header_s *)extra_data->buffer; - int needed_buffer_size = sizeof (**header) + osd_width * sizeof (uint8_t[ 3 ][ 2 ]); + int needed_buffer_size = sizeof (*header) + osd_width * sizeof (uint8_t[ 3 ][ 2 ]); if (extra_data->buffer_size < needed_buffer_size) { @@ -1132,22 +1132,22 @@ static uint8_t *(*blend_yuv_grow_extra_data(alphablend_t *extra_data, int osd_wi } extra_data->buffer_size = needed_buffer_size; - (*header)->max_width = 0; + header->max_width = 0; } - if ((*header)->id != ME_FOURCC('y', 'u', 'v', 0) || (*header)->max_width < osd_width) { - (*header)->id = ME_FOURCC('y', 'u', 'v', 0); - (*header)->max_width = osd_width; + if (header->id != ME_FOURCC('y', 'u', 'v', 0) || header->max_width < osd_width) { + header->id = ME_FOURCC('y', 'u', 'v', 0); + header->max_width = osd_width; - (*header)->data[ 0 ][ 0 ] = ((uint8_t *)extra_data->buffer) + sizeof (**header); - (*header)->data[ 0 ][ 1 ] = (*header)->data[ 0 ][ 0 ] + osd_width; - (*header)->data[ 1 ][ 0 ] = (*header)->data[ 0 ][ 1 ] + osd_width; - (*header)->data[ 1 ][ 1 ] = (*header)->data[ 1 ][ 0 ] + osd_width; - (*header)->data[ 2 ][ 0 ] = (*header)->data[ 1 ][ 1 ] + osd_width; - (*header)->data[ 2 ][ 1 ] = (*header)->data[ 2 ][ 0 ] + osd_width; + header->data[ 0 ][ 0 ] = ((uint8_t *)extra_data->buffer) + sizeof (*header); + header->data[ 0 ][ 1 ] = header->data[ 0 ][ 0 ] + osd_width; + header->data[ 1 ][ 0 ] = header->data[ 0 ][ 1 ] + osd_width; + header->data[ 1 ][ 1 ] = header->data[ 1 ][ 0 ] + osd_width; + header->data[ 2 ][ 0 ] = header->data[ 1 ][ 1 ] + osd_width; + header->data[ 2 ][ 1 ] = header->data[ 2 ][ 0 ] + osd_width; } - return &(*header)->data; + return &(header->data); } void _x_blend_yuv (uint8_t *dst_base[3], vo_overlay_t * img_overl, @@ -1528,9 +1528,9 @@ static uint8_t *(*blend_yuy2_grow_extra_data(alphablend_t *extra_data, int osd_w int id; int max_width; uint8_t *data[ 3 ]; - } **header = (struct header_s **)&extra_data->buffer; + } *header = (struct header_s *)extra_data->buffer; - int needed_buffer_size = sizeof (**header) + osd_width * sizeof (uint8_t[ 3 ]); + int needed_buffer_size = sizeof (*header) + osd_width * sizeof (uint8_t[ 3 ]); if (extra_data->buffer_size < needed_buffer_size) { @@ -1543,19 +1543,19 @@ static uint8_t *(*blend_yuy2_grow_extra_data(alphablend_t *extra_data, int osd_w } extra_data->buffer_size = needed_buffer_size; - (*header)->max_width = 0; + header->max_width = 0; } - if ((*header)->id != ME_FOURCC('y', 'u', 'y', '2') || (*header)->max_width < osd_width) { - (*header)->id = ME_FOURCC('y', 'u', 'y', '2'); - (*header)->max_width = osd_width; + if (header->id != ME_FOURCC('y', 'u', 'y', '2') || header->max_width < osd_width) { + header->id = ME_FOURCC('y', 'u', 'y', '2'); + header->max_width = osd_width; - (*header)->data[ 0 ] = ((uint8_t *)extra_data->buffer) + sizeof (**header); - (*header)->data[ 1 ] = (*header)->data[ 0 ] + osd_width; - (*header)->data[ 2 ] = (*header)->data[ 1 ] + osd_width; + header->data[ 0 ] = ((uint8_t *)extra_data->buffer) + sizeof (*header); + header->data[ 1 ] = header->data[ 0 ] + osd_width; + header->data[ 2 ] = header->data[ 1 ] + osd_width; } - return &(*header)->data; + return &(header->data); } void _x_blend_yuy2 (uint8_t * dst_img, vo_overlay_t * img_overl, diff --git a/src/xine-engine/broadcaster.c b/src/xine-engine/broadcaster.c index eeceec2bf..edf52e474 100644 --- a/src/xine-engine/broadcaster.c +++ b/src/xine-engine/broadcaster.c @@ -19,7 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: broadcaster.c,v 1.11 2006/06/18 18:50:55 dgp85 Exp $ + * $Id: broadcaster.c,v 1.12 2006/06/20 00:18:44 dgp85 Exp $ * * broadcaster.c - xine network broadcaster * @@ -206,8 +206,11 @@ broadcaster_string_write(broadcaster_t *this, char *msg, ...) { */ static void *manager_loop (void *this_gen) { broadcaster_t *this = (broadcaster_t *) this_gen; - struct sockaddr_in fsin; /* the from address of a client */ - int alen; /* from-address length */ + union { /* the from address of a client */ + struct sockaddr_in in; + struct sockaddr sa; + } fsin; + socklen_t alen; /* from-address length */ fd_set rfds; /* read file descriptor set */ fd_set efds; /* exception descriptor set */ @@ -224,9 +227,9 @@ static void *manager_loop (void *this_gen) { if (FD_ISSET(this->msock, &rfds)) { int ssock; - alen = sizeof(fsin); + alen = sizeof(fsin.in); - ssock = accept(this->msock, (struct sockaddr *)&fsin, &alen); + ssock = accept(this->msock, &(fsin.sa), &alen); if (ssock >= 0) { /* identification string, helps demuxer probing */ if( sock_string_write(this->stream->xine, ssock,"master xine v1") > 0 ) { |