diff options
author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2008-05-29 16:03:35 +0100 |
---|---|---|
committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2008-05-29 16:03:35 +0100 |
commit | f5345900a0e36a83841ad06b11aa4bdb22ebb883 (patch) | |
tree | 2217a11d2bf0d0bafcfbd1f9fc0f0fa1bfd91f29 | |
parent | 2c946fa6a9b7b9b3edea5351c1f7021e51b7c177 (diff) | |
parent | a5dfeeb30093308da4e614e4bc8fd642d01affcc (diff) | |
download | xine-lib-f5345900a0e36a83841ad06b11aa4bdb22ebb883.tar.gz xine-lib-f5345900a0e36a83841ad06b11aa4bdb22ebb883.tar.bz2 |
Merge from 1.1.
--HG--
rename : src/xine-utils/array.h => include/xine/array.h
rename : src/xine-utils/attributes.h => include/xine/attributes.h
rename : src/xine-engine/audio_out.h => include/xine/audio_out.h
rename : src/xine-engine/broadcaster.h => include/xine/broadcaster.h
rename : src/xine-engine/buffer.h => include/xine/buffer.h
rename : src/xine-engine/configfile.h => include/xine/configfile.h
rename : src/xine-utils/list.h => include/xine/list.h
rename : src/xine-engine/metronom.h => include/xine/metronom.h
rename : src/xine-engine/osd.h => include/xine/osd.h
rename : src/xine-utils/pool.h => include/xine/pool.h
rename : src/xine-engine/refcounter.h => include/xine/refcounter.h
rename : src/xine-utils/ring_buffer.h => include/xine/ring_buffer.h
rename : src/xine-engine/scratch.h => include/xine/scratch.h
rename : src/xine-utils/sorted_array.h => include/xine/sorted_array.h
rename : src/xine-engine/video_out.h => include/xine/video_out.h
rename : src/xine-engine/video_overlay.h => include/xine/video_overlay.h
rename : src/xine-engine/xine_internal.h => include/xine/xine_internal.h
rename : src/xine-utils/xineutils.h => include/xine/xineutils.h
rename : src/libspucc/cc_decoder.c => src/spu_dec/cc_decoder.c
57 files changed, 214 insertions, 275 deletions
@@ -47,6 +47,7 @@ debian/libxine2-dbg debian/libxine2-doc debian/tmp debian/*.debhelper +debian/*.debhelper.log debian/*.substvars contrib/ffmpeg/*.pc diff --git a/configure.ac b/configure.ac index c1cd6a38a..9e13fd2f6 100644 --- a/configure.ac +++ b/configure.ac @@ -453,6 +453,7 @@ CC_ATTRIBUTE_MALLOC CC_ATTRIBUTE_PACKED([], [AC_MSG_WARN([Your compiler doesn't support __attribute__((packed)); xine might not work as expected.])]) +CC_ATTRIBUTE_CONST CC_CHECK_CFLAGS([-pipe], [miscflags="$miscflags -pipe"]) @@ -584,12 +585,19 @@ dnl initialize arch_86 as it is later tested for != "no" arch_x86=no case "$host_or_hostalias" in - alphaev56-*) cpuflags="-mcpu=ev56 -mieee $cpuflags" ;; - alpha*) cpuflags="-mieee $cpuflags" ;; + alphaev56-*) + cpuflags="-mcpu=ev56 -mieee $cpuflags" + AC_DEFINE([ARCH_ALPHA], [], [Define this if you're running Alpha architecture]) + ;; + alpha*) + cpuflags="-mieee $cpuflags" + AC_DEFINE([ARCH_ALPHA], [], [Define this if you're running Alpha architecture]) + ;; armv4l-*-linux*) cpuflags="-mcpu=strongarm1100 -ffast-math -fsigned-char $cpuflags" DEFAULT_OCFLAGS='$(O2_CFLAGS)' + AC_DEFINE([ARCH_ARM], [], [Define this if you're running ARM architecture]) ;; sparc*-*-linux*) @@ -896,6 +904,11 @@ AC_CHECK_FUNC([opendir], AC_MSG_ERROR([dirent is needed (opendir, readdir, ...)]) fi]) +XINE_CHECK_MINMAX([], [ + AC_DEFINE([MIN(x, y)], [(x > y) ? y : x], [Get the minimum value between two]) + AC_DEFINE([MAX(x, y)], [(x > y) ? x : y], [Get the maximum value between two]) + ]) + AC_LIBSOURCE([timedlock.c]) ac_save_LIBS="$LIBS" LIBS="$LIBS $PTHREAD_LIBS" AC_CHECK_FUNCS([pthread_mutex_timedlock], diff --git a/include/xine/array.h b/include/xine/array.h index ae2093823..44f3c7632 100644 --- a/include/xine/array.h +++ b/include/xine/array.h @@ -27,7 +27,7 @@ typedef struct xine_array_s xine_array_t; /* Constructor */ -xine_array_t *xine_array_new(size_t initial_size) XINE_PROTECTED; +xine_array_t *xine_array_new(size_t initial_size) XINE_MALLOC XINE_PROTECTED; /* Destructor */ void xine_array_delete(xine_array_t *array) XINE_PROTECTED; diff --git a/include/xine/attributes.h b/include/xine/attributes.h index 29bb9f28f..3819818d5 100644 --- a/include/xine/attributes.h +++ b/include/xine/attributes.h @@ -45,6 +45,7 @@ # define SUPPORT_ATTRIBUTE_FORMAT_ARG 1 # define SUPPORT_ATTRIBUTE_MALLOC 1 # define SUPPORT_ATTRIBUTE_UNUSED 1 +# define SUPPORT_ATTRIBUTE_CONST 1 # endif # if __GNUC__ >= 4 @@ -109,4 +110,10 @@ # define XINE_PACKED #endif +#ifdef SUPPORT_ATTRIBUTE_CONST +# define XINE_CONST __attribute__((__const__)) +#else +# define XINE_CONST +#endif + #endif /* ATTRIBUTE_H_ */ diff --git a/include/xine/audio_out.h b/include/xine/audio_out.h index 25e5deb68..8b8316882 100644 --- a/include/xine/audio_out.h +++ b/include/xine/audio_out.h @@ -274,7 +274,7 @@ struct audio_driver_class_s { * * @internal */ -xine_audio_port_t *_x_ao_new_port (xine_t *xine, ao_driver_t *driver, int grab_only); +xine_audio_port_t *_x_ao_new_port (xine_t *xine, ao_driver_t *driver, int grab_only) XINE_MALLOC; /* * audio output modes + capabilities diff --git a/include/xine/broadcaster.h b/include/xine/broadcaster.h index 093fb4af0..0c6a291eb 100644 --- a/include/xine/broadcaster.h +++ b/include/xine/broadcaster.h @@ -33,7 +33,7 @@ extern "C" { typedef struct broadcaster_s broadcaster_t; -broadcaster_t *_x_init_broadcaster(xine_stream_t *stream, int port) XINE_PROTECTED; +broadcaster_t *_x_init_broadcaster(xine_stream_t *stream, int port) XINE_MALLOC XINE_PROTECTED; void _x_close_broadcaster(broadcaster_t *this) XINE_PROTECTED; int _x_get_broadcaster_port(broadcaster_t *this) XINE_PROTECTED; diff --git a/include/xine/buffer.h b/include/xine/buffer.h index a53b99db3..11d9e3730 100644 --- a/include/xine/buffer.h +++ b/include/xine/buffer.h @@ -626,7 +626,7 @@ struct fifo_buffer_s * @param buf_size Size of each buffer. * @internal Only used by video and audio decoder loops. */ -fifo_buffer_t *_x_fifo_buffer_new (int num_buffers, uint32_t buf_size); +fifo_buffer_t *_x_fifo_buffer_new (int num_buffers, uint32_t buf_size) XINE_MALLOC; /** * @brief Allocate and initialise new dummy FIFO buffers. @@ -634,7 +634,7 @@ fifo_buffer_t *_x_fifo_buffer_new (int num_buffers, uint32_t buf_size); * @param buf_size Size of each buffer. * @internal Only used by video and audio decoder loops. */ -fifo_buffer_t *_x_dummy_fifo_buffer_new (int num_buffers, uint32_t buf_size); +fifo_buffer_t *_x_dummy_fifo_buffer_new (int num_buffers, uint32_t buf_size) XINE_MALLOC; /** diff --git a/include/xine/configfile.h b/include/xine/configfile.h index e8f2c070e..f2deb1aa6 100644 --- a/include/xine/configfile.h +++ b/include/xine/configfile.h @@ -227,7 +227,7 @@ struct config_values_s { * @brief allocate and init a new xine config object * @internal */ -config_values_t *_x_config_init (void); +config_values_t *_x_config_init (void) XINE_MALLOC; /** * @brief interpret stream_setup part of mrls for config value changes diff --git a/include/xine/list.h b/include/xine/list.h index e00e30d6c..f05ed2b0e 100644 --- a/include/xine/list.h +++ b/include/xine/list.h @@ -48,7 +48,7 @@ typedef struct xine_list_s xine_list_t; typedef void* xine_list_iterator_t; /* Constructor */ -xine_list_t *xine_list_new(void) XINE_PROTECTED; +xine_list_t *xine_list_new(void) XINE_MALLOC XINE_PROTECTED; /* Destructor */ void xine_list_delete(xine_list_t *list) XINE_PROTECTED; diff --git a/include/xine/metronom.h b/include/xine/metronom.h index df08a0058..28ca7d62d 100644 --- a/include/xine/metronom.h +++ b/include/xine/metronom.h @@ -218,7 +218,7 @@ struct metronom_s { #define METRONOM_VPTS_OFFSET 6 #define METRONOM_PREBUFFER 7 -metronom_t *_x_metronom_init (int have_video, int have_audio, xine_t *xine) XINE_PROTECTED; +metronom_t *_x_metronom_init (int have_video, int have_audio, xine_t *xine) XINE_MALLOC XINE_PROTECTED; /* FIXME: reorder this structure on the next cleanup to remove the dummies */ struct metronom_clock_s { @@ -314,7 +314,7 @@ struct metronom_clock_s { #endif }; -metronom_clock_t *_x_metronom_clock_init(xine_t *xine) XINE_PROTECTED; +metronom_clock_t *_x_metronom_clock_init(xine_t *xine) XINE_MALLOC XINE_PROTECTED; /* * clock options diff --git a/include/xine/osd.h b/include/xine/osd.h index 4e34030ee..de924a1ae 100644 --- a/include/xine/osd.h +++ b/include/xine/osd.h @@ -219,7 +219,7 @@ struct osd_renderer_s { /* * initialize the osd rendering engine */ -osd_renderer_t *_x_osd_renderer_init( xine_stream_t *stream ); +osd_renderer_t *_x_osd_renderer_init( xine_stream_t *stream ) XINE_MALLOC; /* diff --git a/include/xine/pool.h b/include/xine/pool.h index 918da82a2..2667b7fdc 100644 --- a/include/xine/pool.h +++ b/include/xine/pool.h @@ -36,7 +36,7 @@ xine_pool_t *xine_pool_new(size_t object_size, void (create_object)(void *object), void (prepare_object)(void *object), void (return_object)(void *object), - void (delete_object)(void *object)) XINE_PROTECTED; + void (delete_object)(void *object)) XINE_MALLOC XINE_PROTECTED; /* Deletes a pool */ void xine_pool_delete(xine_pool_t *pool) XINE_PROTECTED; diff --git a/include/xine/refcounter.h b/include/xine/refcounter.h index a662a974e..8683bfb3f 100644 --- a/include/xine/refcounter.h +++ b/include/xine/refcounter.h @@ -35,7 +35,7 @@ typedef struct { typedef void (*refcounter_destructor)(void*); -refcounter_t* _x_new_refcounter(void *object, refcounter_destructor destructor) XINE_PROTECTED; +refcounter_t* _x_new_refcounter(void *object, refcounter_destructor destructor) XINE_MALLOC XINE_PROTECTED; int _x_refcounter_inc(refcounter_t *refcounter) XINE_PROTECTED; diff --git a/include/xine/ring_buffer.h b/include/xine/ring_buffer.h index efcffd3b7..5f104dc77 100644 --- a/include/xine/ring_buffer.h +++ b/include/xine/ring_buffer.h @@ -22,7 +22,7 @@ typedef struct xine_ring_buffer_s xine_ring_buffer_t; /* Creates a new ring buffer */ -xine_ring_buffer_t *xine_ring_buffer_new(size_t size) XINE_PROTECTED; +xine_ring_buffer_t *xine_ring_buffer_new(size_t size) XINE_MALLOC XINE_PROTECTED; /* Deletes a ring buffer */ void xine_ring_buffer_delete(xine_ring_buffer_t *ring_buffer) XINE_PROTECTED; diff --git a/include/xine/scratch.h b/include/xine/scratch.h index c0e591d31..1029276e3 100644 --- a/include/xine/scratch.h +++ b/include/xine/scratch.h @@ -51,6 +51,6 @@ struct scratch_buffer_s { pthread_mutex_t lock; }; -scratch_buffer_t *_x_new_scratch_buffer (int num_lines) XINE_PROTECTED; +scratch_buffer_t *_x_new_scratch_buffer (int num_lines) XINE_MALLOC XINE_PROTECTED; #endif diff --git a/include/xine/sorted_array.h b/include/xine/sorted_array.h index a1894eca3..c6fdd1c25 100644 --- a/include/xine/sorted_array.h +++ b/include/xine/sorted_array.h @@ -63,7 +63,7 @@ typedef struct xine_sarray_s xine_sarray_t; typedef int (*xine_sarray_comparator_t)(void*, void*); /* Constructor */ -xine_sarray_t *xine_sarray_new(size_t initial_size, xine_sarray_comparator_t comparator) XINE_PROTECTED; +xine_sarray_t *xine_sarray_new(size_t initial_size, xine_sarray_comparator_t comparator) XINE_MALLOC XINE_PROTECTED; /* Destructor */ void xine_sarray_delete(xine_sarray_t *sarray) XINE_PROTECTED; diff --git a/include/xine/video_out.h b/include/xine/video_out.h index 0bdd0f557..6952362ff 100644 --- a/include/xine/video_out.h +++ b/include/xine/video_out.h @@ -475,7 +475,7 @@ struct video_overlay_manager_s { * * @internal */ -xine_video_port_t *_x_vo_new_port (xine_t *xine, vo_driver_t *driver, int grabonly); +xine_video_port_t *_x_vo_new_port (xine_t *xine, vo_driver_t *driver, int grabonly) XINE_MALLOC; #ifdef __cplusplus } diff --git a/include/xine/video_overlay.h b/include/xine/video_overlay.h index b45f5149e..27cae6440 100644 --- a/include/xine/video_overlay.h +++ b/include/xine/video_overlay.h @@ -59,6 +59,6 @@ typedef struct video_overlay_event_s { video_overlay_object_t object; /* The image data. */ } video_overlay_event_t; -video_overlay_manager_t *_x_video_overlay_new_manager(xine_t *) XINE_PROTECTED; +video_overlay_manager_t *_x_video_overlay_new_manager(xine_t *) XINE_MALLOC XINE_PROTECTED; #endif diff --git a/include/xine/xineutils.h b/include/xine/xineutils.h index dbe5199dd..8b8c03df5 100644 --- a/include/xine/xineutils.h +++ b/include/xine/xineutils.h @@ -113,7 +113,7 @@ extern "C" { #define MM_SSE MM_ACCEL_X86_SSE #define MM_SSE2 MM_ACCEL_X86_SSE2 -uint32_t xine_mm_accel (void) XINE_PROTECTED; +uint32_t xine_mm_accel (void) XINE_CONST XINE_PROTECTED; #if defined(ARCH_X86) || defined(ARCH_X86_64) @@ -931,7 +931,7 @@ void xine_xprintf(xine_t *xine, int verbose, const char *fmt, ...); /** * get encoding of current locale */ -char *xine_get_system_encoding(void) XINE_PROTECTED; +char *xine_get_system_encoding(void) XINE_MALLOC XINE_PROTECTED; /* * guess default encoding for the subtitles diff --git a/lib/os_internal.h b/lib/os_internal.h index 873c4c3b7..01b4a5349 100644 --- a/lib/os_internal.h +++ b/lib/os_internal.h @@ -67,6 +67,10 @@ #include <stddef.h> #include <stdarg.h> +#ifdef HAVE_SYS_PARAM_H +# include <sys/param.h> +#endif + #ifdef HOST_OS_DARWIN /* Darwin (Mac OS X) needs __STDC_LIBRARY_SUPPORTED__ for SCNx64 and * SCNxMAX macros */ diff --git a/m4/Makefile.am b/m4/Makefile.am index 068661ebd..5b76df5e0 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -18,6 +18,7 @@ EXTRA_DIST = \ gas.m4 \ input.m4 \ macosx.m4 \ + misc.m4 \ objc.m4 \ pkg.m4 \ programs.m4 \ diff --git a/m4/attributes.m4 b/m4/attributes.m4 index 17d57fbeb..3fee49ab5 100644 --- a/m4/attributes.m4 +++ b/m4/attributes.m4 @@ -42,11 +42,8 @@ AC_DEFUN([CC_CHECK_CFLAGS_SILENT], [ CFLAGS="$ac_save_CFLAGS" ]) - if eval test [x$]AS_TR_SH([cc_cv_cflags_$1]) = xyes; then - ifelse([$2], , [:], [$2]) - else - ifelse([$3], , [:], [$3]) - fi + AS_IF([test x$]AS_TR_SH([cc_cv_cflags_$1])[ = xyes], + [$2], [$3]) ]) AC_DEFUN([CC_CHECK_CFLAGS], [ @@ -55,11 +52,8 @@ AC_DEFUN([CC_CHECK_CFLAGS], [ CC_CHECK_CFLAGS_SILENT([$1]) dnl Don't execute actions here! ) - if eval test [x$]AS_TR_SH([cc_cv_cflags_$1]) = xyes; then - ifelse([$2], , [:], [$2]) - else - ifelse([$3], , [:], [$3]) - fi + AS_IF([test x$]AS_TR_SH([cc_cv_cflags_$1])[ = xyes], + [$2], [$3]) ]) AC_DEFUN([CC_CHECK_LDFLAGS], [ @@ -73,11 +67,8 @@ AC_DEFUN([CC_CHECK_LDFLAGS], [ LDFLAGS="$ac_save_LDFLAGS" ]) - if eval test [x$]AS_TR_SH([cc_cv_ldflags_$1]) = xyes; then - ifelse([$2], , [:], [$2]) - else - ifelse([$3], , [:], [$3]) - fi + AS_IF([test x$]AS_TR_SH([cc_cv_ldflags_$1])[ = xyes], + [$2], [$3]) ]) dnl Check for a -Werror flag or equivalent. -Werror is the GCC @@ -109,76 +100,69 @@ AC_DEFUN([CC_CHECK_ATTRIBUTE], [ CFLAGS="$ac_save_CFLAGS" ]) - if eval test [x$]AS_TR_SH([cc_cv_attribute_$1]) = xyes; then - AC_DEFINE(AS_TR_CPP([SUPPORT_ATTRIBUTE_$1]), 1, [Define this if the compiler supports __attribute__(( ifelse([$2], , [$1], [$2]) ))]) - ifelse([$4], , [:], [$4]) - else - ifelse([$5], , [:], [$5]) - fi + AS_IF([test x$]AS_TR_SH([cc_cv_attribute_$1])[ = xyes], + [AC_DEFINE( + AS_TR_CPP([SUPPORT_ATTRIBUTE_$1]), 1, + [Define this if the compiler supports __attribute__(( ifelse([$2], , [$1], [$2]) ))] + ) + $4], + [$5]) ]) AC_DEFUN([CC_ATTRIBUTE_CONSTRUCTOR], [ CC_CHECK_ATTRIBUTE( [constructor],, [void __attribute__((constructor)) ctor() { int a; }], - [$1], - [$2]) + [$1], [$2]) ]) AC_DEFUN([CC_ATTRIBUTE_FORMAT], [ CC_CHECK_ATTRIBUTE( [format], [format(printf, n, n)], [void __attribute__((format(printf, 1, 2))) printflike(const char *fmt, ...) { fmt = (void *)0; }], - [$1], - [$2]) + [$1], [$2]) ]) AC_DEFUN([CC_ATTRIBUTE_FORMAT_ARG], [ CC_CHECK_ATTRIBUTE( [format_arg], [format_arg(printf)], [char *__attribute__((format_arg(1))) gettextlike(const char *fmt) { fmt = (void *)0; }], - [$1], - [$2]) + [$1], [$2]) ]) AC_DEFUN([CC_ATTRIBUTE_VISIBILITY], [ CC_CHECK_ATTRIBUTE( [visibility_$1], [visibility("$1")], [void __attribute__((visibility("$1"))) $1_function() { }], - [$2], - [$3]) + [$2], [$3]) ]) AC_DEFUN([CC_ATTRIBUTE_NONNULL], [ CC_CHECK_ATTRIBUTE( [nonnull], [nonnull()], [void __attribute__((nonnull())) some_function(void *foo, void *bar) { foo = (void*)0; bar = (void*)0; }], - [$1], - [$2]) + [$1], [$2]) ]) AC_DEFUN([CC_ATTRIBUTE_UNUSED], [ CC_CHECK_ATTRIBUTE( [unused], , [void some_function(void *foo, __attribute__((unused)) void *bar);], - [$1], - [$2]) + [$1], [$2]) ]) AC_DEFUN([CC_ATTRIBUTE_SENTINEL], [ CC_CHECK_ATTRIBUTE( [sentinel], , [void some_function(void *foo, ...) __attribute__((sentinel));], - [$1], - [$2]) + [$1], [$2]) ]) AC_DEFUN([CC_ATTRIBUTE_DEPRECATED], [ CC_CHECK_ATTRIBUTE( [deprecated], , [void some_function(void *foo, ...) __attribute__((deprecated));], - [$1], - [$2]) + [$1], [$2]) ]) AC_DEFUN([CC_ATTRIBUTE_ALIAS], [ @@ -186,24 +170,28 @@ AC_DEFUN([CC_ATTRIBUTE_ALIAS], [ [alias], [weak, alias], [void other_function(void *foo) { } void some_function(void *foo) __attribute__((weak, alias("other_function")));], - [$1], - [$2]) + [$1], [$2]) ]) AC_DEFUN([CC_ATTRIBUTE_MALLOC], [ CC_CHECK_ATTRIBUTE( [malloc], , [void * __attribute__((malloc)) my_alloc(int n);], - [$1], - [$2]) + [$1], [$2]) ]) AC_DEFUN([CC_ATTRIBUTE_PACKED], [ CC_CHECK_ATTRIBUTE( [packed], , [struct astructure { char a; int b; long c; void *d; } __attribute__((packed));], - [$1], - [$2]) + [$1], [$2]) +]) + +AC_DEFUN([CC_ATTRIBUTE_CONST], [ + CC_CHECK_ATTRIBUTE( + [const], , + [int __attribute__((const)) twopow(int n) { return 1 << n; } ], + [$1], [$2]) ]) AC_DEFUN([CC_FLAG_VISIBILITY], [ @@ -217,39 +205,34 @@ AC_DEFUN([CC_FLAG_VISIBILITY], [ cc_cv_flag_visibility='no') CFLAGS="$cc_flag_visibility_save_CFLAGS"]) - if test "x$cc_cv_flag_visibility" = "xyes"; then - AC_DEFINE([SUPPORT_FLAG_VISIBILITY], 1, [Define this if the compiler supports the -fvisibility flag]) - ifelse([$1], , [:], [$1]) - else - ifelse([$2], , [:], [$2]) - fi + AS_IF([test "x$cc_cv_flag_visibility" = "xyes"], + [AC_DEFINE([SUPPORT_FLAG_VISIBILITY], 1, + [Define this if the compiler supports the -fvisibility flag]) + $1], + [$2]) ]) AC_DEFUN([CC_FUNC_EXPECT], [ - AC_REQUIRE([CC_CHECK_WERROR]) - ac_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $cc_cv_werror" - AC_CACHE_CHECK([if compiler has __builtin_expect function], - [cc_cv_func_expect], - [AC_COMPILE_IFELSE([ - int some_function() - { - int a = 3; - return (int)__builtin_expect(a, 3); - } - ], - [cc_cv_func_expect=yes], - [cc_cv_func_expect=no]) - ]) - CFLAGS="$ac_save_CFLAGS" - - if test "x$cc_cv_func_expect" = "xyes"; then - AC_DEFINE([SUPPORT__BUILTIN_EXPECT], 1, [Define this if the compiler supports __builtin_expect() function]) - $1 - else - true - $2 - fi + AC_REQUIRE([CC_CHECK_WERROR]) + AC_CACHE_CHECK([if compiler has __builtin_expect function], + [cc_cv_func_expect], + [ac_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $cc_cv_werror" + AC_COMPILE_IFELSE( + [int some_function() { + int a = 3; + return (int)__builtin_expect(a, 3); + }], + [cc_cv_func_expect=yes], + [cc_cv_func_expect=no]) + CFLAGS="$ac_save_CFLAGS" + ]) + + AS_IF([test "x$cc_cv_func_expect" = "xyes"], + [AC_DEFINE([SUPPORT__BUILTIN_EXPECT], 1, + [Define this if the compiler supports __builtin_expect() function]) + $1], + [$2]) ]) AC_DEFUN([CC_ATTRIBUTE_ALIGNED], [ @@ -273,90 +256,3 @@ AC_DEFUN([CC_ATTRIBUTE_ALIGNED], [ [Define the highest alignment supported]) fi ]) - -AC_DEFUN([CC_ATTRIBUTE_PACKED], [ - AC_REQUIRE([CC_CHECK_WERROR]) - AC_CACHE_CHECK([if $CC supports __attribute__((packed))], - [cc_cv_attribute_packed], - [ac_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $cc_cv_werror" - AC_COMPILE_IFELSE([struct { char a; short b; int c; } __attribute__((packed)) foo;], - [cc_cv_attribute_packed=yes], - [cc_cv_attribute_packed=no]) - CFLAGS="$ac_save_CFLAGS" - ]) - - if test x$cc_cv_attribute_packed = xyes; then - AC_DEFINE([SUPPORT_ATTRIBUTE_PACKED], 1, [Define this if the compiler supports __attribute__((packed))]) - ifelse([$1], , [:], [$1]) - else - ifelse([$2], , [:], [$2]) - fi -]) - -AC_DEFUN([CC_ATTRIBUTE_MALLOC], [ - AC_REQUIRE([CC_CHECK_WERROR]) - AC_CACHE_CHECK([if $CC supports __attribute__((__malloc__))], - [cc_cv_attribute_malloc], - [ac_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $cc_cv_werror" - AC_COMPILE_IFELSE([void *fooalloc(int size) __attribute__((__malloc__));], - [cc_cv_attribute_malloc=yes], - [cc_cv_attribute_malloc=no]) - CFLAGS="$ac_save_CFLAGS" - ]) - - if test x$cc_cv_attribute_malloc = xyes; then - AC_DEFINE([SUPPORT_ATTRIBUTE_MALLOC], 1, [Define this if the compiler supports __attribute__((__malloc__))]) - ifelse([$1], , [:], [$1]) - else - ifelse([$2], , [:], [$2]) - fi -]) - - -dnl AC_C_ALWAYS_INLINE -dnl Define inline to something appropriate, including the new always_inline -dnl attribute from gcc 3.1 -dnl Thanks to Michel LESPINASSE <walken@zoy.org> -dnl __inline__ "check" added by Darren Salt -AC_DEFUN([AC_C_ALWAYS_INLINE], [ - AC_C_INLINE - if test x"$GCC" = x"yes" -a x"$ac_cv_c_inline" = x"inline"; then - AC_MSG_CHECKING([for always_inline]) - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Wall -Werror" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[inline __attribute__ ((__always_inline__)) void f (void);]])], - [ac_cv_always_inline=yes],[ac_cv_always_inline=no]) - CFLAGS="$SAVE_CFLAGS" - AC_MSG_RESULT([$ac_cv_always_inline]) - if test x"$ac_cv_always_inline" = x"yes"; then - AH_TOP([ -#ifdef inline -/* the strange formatting below is needed to prevent config.status from rewriting it */ -# undef \ - inline -#endif - ]) - AC_DEFINE_UNQUOTED([inline],[inline __attribute__ ((__always_inline__))]) - fi - ac_cv_c___inline__='' - else - # FIXME: test the compiler to see if it supports __inline__ - # instead of assuming that if it isn't gcc, it doesn't - case "$ac_cv_c_inline" in - yes) - ac_cv_c___inline__=inline - ;; - inline|__inline__) - ac_cv_c___inline__='' - ;; - *) - ac_cv_c___inline__="$ac_cv_c_inline" - ;; - esac - fi - if test x"$ac_cv_c___inline__" != x; then - AC_DEFINE_UNQUOTED([__inline__],[$ac_cv_c___inline__],[Define if the compiler doesn't recognise __inline__]) - fi -]) diff --git a/m4/misc.m4 b/m4/misc.m4 new file mode 100644 index 000000000..83246f36c --- /dev/null +++ b/m4/misc.m4 @@ -0,0 +1,55 @@ +dnl Miscellaneous M4 macros for configure +dnl Copyright (c) 2008 Diego Pettenò <flameeyes@gmail.com> +dnl Copyright (c) 2008 xine project +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2, or (at your option) +dnl any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +dnl 02110-1301, USA. +dnl +dnl As a special exception, the copyright owners of the +dnl macro gives unlimited permission to copy, distribute and modify the +dnl configure scripts that are the output of Autoconf when processing the +dnl Macro. You need not follow the terms of the GNU General Public +dnl License when using or distributing such scripts, even though portions +dnl of the text of the Macro appear in them. The GNU General Public +dnl License (GPL) does govern all other use of the material that +dnl constitutes the Autoconf Macro. +dnl +dnl This special exception to the GPL applies to versions of the +dnl Autoconf Macro released by this project. When you make and +dnl distribute a modified version of the Autoconf Macro, you may extend +dnl this special exception to the GPL to apply to your modified version as +dnl well. + +AC_DEFUN([XINE_CHECK_MINMAX], [ + AC_CHECK_HEADERS([sys/param.h]) + AC_CACHE_CHECK([for MIN()/MAX() macros], + xine_cv_minmax, + [ + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([ + #ifdef HAVE_SYS_PARAM_H + # include <sys/param.h> + #endif + ], [ + int a = MIN(1, 3); + int b = MAX(2, 3); + ])], + [xine_cv_minmax=yes], + [xine_cv_minmax=no]) + ]) + + AS_IF([test x$xine_cv_minmax = xyes], + [$1], [$2]) +]) diff --git a/m4/pthreads.m4 b/m4/pthreads.m4 index facac076f..653a496da 100644 --- a/m4/pthreads.m4 +++ b/m4/pthreads.m4 @@ -75,26 +75,28 @@ AC_DEFUN([CC_PTHREAD_FLAGS], [ ]) AC_DEFUN([CC_PTHREAD_RECURSIVE_MUTEX], [ - AC_REQUIRE([CC_PTHREAD_FLAGS]) - AC_MSG_CHECKING([for recursive mutex support in pthread]) - - ac_save_LIBS="$LIBS" - LIBS="$LIBS $PTHREAD_LIBS" - AC_COMPILE_IFELSE(AC_LANG_SOURCE([#include <pthread.h> - + AC_REQUIRE([CC_PTHREAD_FLAGS]) + AC_CACHE_CHECK( + [for recursive mutex support in pthread], + [cc_cv_pthread_recursive_mutex], + [ac_save_LIBS="$LIBS" + LIBS="$LIBS $PTHREAD_LIBS" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([ +#include <pthread.h> + ], [ int main() { pthread_mutexattr_t attr; pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); return 0; } - ]), [have_recursive_mutex=yes], [have_recursive_mutex=no]) - LIBS="$ac_save_LIBS" - - AC_MSG_RESULT([$have_recursive_mutex]) + ]) + ], + [cc_cv_pthread_recursive_mutex=yes], + [cc_cv_pthread_recursive_mutex=no]) + LIBS="$ac_save_LIBS" + ]) - if test x"$have_recursive_mutex" = x"yes"; then - ifelse([$1], , [:], [$1]) - else - ifelse([$2], , [:], [$2]) - fi + AS_IF([test x"$cc_cv_pthread_recursive_mutex" = x"yes"], + [$1], [$2]) ]) diff --git a/src/demuxers/asfheader.h b/src/demuxers/asfheader.h index 4bd13ab3f..b895a1817 100644 --- a/src/demuxers/asfheader.h +++ b/src/demuxers/asfheader.h @@ -389,7 +389,7 @@ struct asf_stream_extension_s { int asf_find_object_id (GUID *g);
void asf_get_guid (uint8_t *buffer, GUID *value);
-asf_header_t *asf_header_new (uint8_t *buffer, int buffer_len);
+asf_header_t *asf_header_new (uint8_t *buffer, int buffer_len) XINE_MALLOC;
void asf_header_choose_streams (asf_header_t *header, uint32_t bandwidth,
int *video_id, int *audio_id);
void asf_header_disable_streams (asf_header_t *header,
diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c index b6112ab12..0f1735f96 100644 --- a/src/demuxers/demux_avi.c +++ b/src/demuxers/demux_avi.c @@ -719,7 +719,7 @@ static void reset_idx(demux_avi_t *this, avi_t *AVI) { } } -static avi_t *AVI_init(demux_avi_t *this) { +static avi_t *XINE_MALLOC AVI_init(demux_avi_t *this) { avi_t *AVI; int i, j, idx_type; diff --git a/src/demuxers/demux_matroska.c b/src/demuxers/demux_matroska.c index 976df13dc..b0919036f 100644 --- a/src/demuxers/demux_matroska.c +++ b/src/demuxers/demux_matroska.c @@ -58,13 +58,6 @@ #define WRAP_THRESHOLD 90000 -#if !defined(MIN) -#define MIN(a, b) ((a)<(b)?(a):(b)) -#endif -#if !defined(MAX) -#define MAX(a, b) ((a)>(b)?(a):(b)) -#endif - typedef struct { int track_num; off_t *pos; diff --git a/src/demuxers/demux_mpgaudio.c b/src/demuxers/demux_mpgaudio.c index 5304c9150..4171b1de8 100644 --- a/src/demuxers/demux_mpgaudio.c +++ b/src/demuxers/demux_mpgaudio.c @@ -316,8 +316,8 @@ static int parse_frame_header(mpg_audio_frame_t *const frame, const uint8_t *con * Parse a Xing header * return the Xing header or NULL on error */ -static xing_header_t* parse_xing_header(mpg_audio_frame_t *frame, - uint8_t *buf, int bufsize) { +static xing_header_t *XINE_MALLOC parse_xing_header(mpg_audio_frame_t *frame, + uint8_t *buf, int bufsize) { uint8_t *ptr = buf; xing_header_t *xing = NULL; @@ -420,8 +420,8 @@ exit_error: * Parse a Vbri header * return the Vbri header or NULL on error */ -static vbri_header_t* parse_vbri_header(mpg_audio_frame_t *frame, - uint8_t *buf, int bufsize) { +static vbri_header_t *XINE_MALLOC parse_vbri_header(mpg_audio_frame_t *frame, + uint8_t *buf, int bufsize) { int i; uint8_t *ptr = buf; diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c index ae8c6d1f7..a9224d4c4 100644 --- a/src/demuxers/demux_ts.c +++ b/src/demuxers/demux_ts.c @@ -185,9 +185,6 @@ #define INVALID_PROGRAM ((unsigned int)(-1)) #define INVALID_CC ((unsigned int)(-1)) -#define MIN(a,b) (((a)<(b))?(a):(b)) -#define MAX(a,b) (((a)>(b))?(a):(b)) - #define PROG_STREAM_MAP 0xBC #define PRIVATE_STREAM1 0xBD #define PADDING_STREAM 0xBE @@ -220,7 +217,9 @@ ISO_13818_PART7_AUDIO = 0x0f, /* ISO/IEC 13818-7 Audio with ADTS transport sytax */ ISO_14496_PART2_VIDEO = 0x10, /* ISO/IEC 14496-2 Visual (MPEG-4) */ ISO_14496_PART3_AUDIO = 0x11, /* ISO/IEC 14496-3 Audio with LATM transport syntax */ - ISO_14496_PART10_VIDEO = 0x1b /* ISO/IEC 14496-10 Video (MPEG-4 part 10/AVC, aka H.264) */ + ISO_14496_PART10_VIDEO = 0x1b, /* ISO/IEC 14496-10 Video (MPEG-4 part 10/AVC, aka H.264) */ + STREAM_VIDEO_MPEG = 0x80, + STREAM_AUDIO_AC3 = 0x81, } streamType; #define WRAP_THRESHOLD 270000 @@ -729,14 +728,14 @@ static int demux_ts_parse_pes_header (xine_t *xine, demux_ts_media *m, * do not include any of the ac3 header info in their audio tracks * these "raw" streams may begin with a byte that looks like a stream type. */ - if((m->descriptor_tag == 0x81) || /* ac3 - raw */ + if((m->descriptor_tag == STREAM_AUDIO_AC3) || /* ac3 - raw */ (p[0] == 0x0B && p[1] == 0x77)) { /* ac3 - syncword */ m->content = p; m->size = packet_len; m->type |= BUF_AUDIO_A52; return 1; - } else if (m->descriptor_tag == 0x06 + } else if (m->descriptor_tag == ISO_13818_PES_PRIVATE && p[0] == 0x20 && p[1] == 0x00) { /* DVBSUB */ long payload_len = ((buf[4] << 8) | buf[5]) - header_len - 3; @@ -784,6 +783,7 @@ static int demux_ts_parse_pes_header (xine_t *xine, demux_ts_media *m, switch (m->descriptor_tag) { case ISO_11172_VIDEO: case ISO_13818_VIDEO: + case STREAM_VIDEO_MPEG: lprintf ("demux_ts: found MPEG video type.\n"); m->type = BUF_VIDEO_MPEG; break; @@ -1327,7 +1327,7 @@ printf("Program Number is %i, looking for %i\n",program_number,this->program_num printf ("demux_ts: PMT AC3 audio pid 0x%.4x type %2.2x\n", pid, stream[0]); #endif demux_ts_pes_new(this, this->media_num, pid, - this->audio_fifo, 0x81); + this->audio_fifo, STREAM_AUDIO_AC3); this->audio_tracks[this->audio_tracks_count].pid = pid; this->audio_tracks[this->audio_tracks_count].media_index = this->media_num; diff --git a/src/demuxers/ebml.h b/src/demuxers/ebml.h index a090bb130..764f416ff 100644 --- a/src/demuxers/ebml.h +++ b/src/demuxers/ebml.h @@ -65,7 +65,7 @@ typedef struct ebml_parser_s { } ebml_parser_t; -ebml_parser_t *new_ebml_parser (xine_t *xine, input_plugin_t *input); +ebml_parser_t *new_ebml_parser (xine_t *xine, input_plugin_t *input) XINE_MALLOC; void dispose_ebml_parser (ebml_parser_t *ebml); diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c index 4a2c47bbc..baf6b3780 100644 --- a/src/input/input_dvb.c +++ b/src/input/input_dvb.c @@ -554,7 +554,7 @@ static void tuner_dispose(tuner_t * this) } -static tuner_t *tuner_init(xine_t * xine, int adapter) +static tuner_t *XINE_MALLOC tuner_init(xine_t * xine, int adapter) { tuner_t *this; diff --git a/src/input/input_pvr.c b/src/input/input_pvr.c index 83c52b1b6..17c251c40 100644 --- a/src/input/input_pvr.c +++ b/src/input/input_pvr.c @@ -376,7 +376,7 @@ static void pvrscr_exit (scr_plugin_t *scr) { free(this); } -static pvrscr_t* pvrscr_init (void) { +static pvrscr_t *XINE_MALLOC pvrscr_init (void) { pvrscr_t *this; this = calloc(1, sizeof(pvrscr_t)); diff --git a/src/input/input_v4l.c b/src/input/input_v4l.c index 192115327..bbd594418 100644 --- a/src/input/input_v4l.c +++ b/src/input/input_v4l.c @@ -372,7 +372,7 @@ static void pvrscr_exit (scr_plugin_t *scr) free(this); } -static pvrscr_t* pvrscr_init (void) +static pvrscr_t *XINE_MALLOC pvrscr_init (void) { pvrscr_t *this; diff --git a/src/input/libreal/asmrp.c b/src/input/libreal/asmrp.c index 9fc7a3867..48b54f3a0 100644 --- a/src/input/libreal/asmrp.c +++ b/src/input/libreal/asmrp.c @@ -95,7 +95,7 @@ typedef struct { } asmrp_t; -static asmrp_t *asmrp_new () { +static asmrp_t *XINE_MALLOC asmrp_new () { asmrp_t *p; diff --git a/src/input/libreal/real.c b/src/input/libreal/real.c index 38432c742..d9f175748 100644 --- a/src/input/libreal/real.c +++ b/src/input/libreal/real.c @@ -48,9 +48,6 @@ static const unsigned char xor_table[] = { #define _X_BE_32C(x,y) do { *(uint32_t *)(x) = be2me_32((y)); } while(0) #define _X_LE_32C(x,y) do { *(uint32_t *)(x) = le2me_32((y)); } while(0) -#define MAX(x,y) ((x>y) ? x : y) - - static void hash(char *field, char *param) { uint32_t a, b, c, d; diff --git a/src/input/libreal/rmff.h b/src/input/libreal/rmff.h index 3fe3af284..285d8c978 100644 --- a/src/input/libreal/rmff.h +++ b/src/input/libreal/rmff.h @@ -32,10 +32,10 @@ #include <string.h> #include <inttypes.h> - #ifndef HAVE_RMFF_H #define HAVE_RMFF_H +#include <xine/attributes.h> #define RMFF_HEADER_SIZE 0x12 @@ -220,7 +220,7 @@ rmff_data_t *rmff_new_dataheader( /* * reads header infos from data and returns a newly allocated header struct */ -rmff_header_t *rmff_scan_header(const char *data); +rmff_header_t *rmff_scan_header(const char *data) XINE_MALLOC; #if 0 /* @@ -232,7 +232,7 @@ void rmff_scan_pheader(rmff_pheader_t *h, char *data); /* * reads header infos from stream and returns a newly allocated header struct */ -rmff_header_t *rmff_scan_header_stream(int fd); +rmff_header_t *rmff_scan_header_stream(int fd) XINE_MALLOC; /* * prints header information in human readible form to stdout diff --git a/src/input/libreal/sdpplin.c b/src/input/libreal/sdpplin.c index 534d20c4b..d8a22a629 100644 --- a/src/input/libreal/sdpplin.c +++ b/src/input/libreal/sdpplin.c @@ -120,7 +120,7 @@ static int filter(const char *in, const char *filter, char **out) { return 0; } -static sdpplin_stream_t *sdpplin_parse_stream(char **data) { +static sdpplin_stream_t *XINE_MALLOC sdpplin_parse_stream(char **data) { sdpplin_stream_t *desc = calloc(1, sizeof(sdpplin_stream_t)); char *buf=xine_buffer_init(32); diff --git a/src/input/libreal/sdpplin.h b/src/input/libreal/sdpplin.h index 72cbaf731..1604ee38c 100644 --- a/src/input/libreal/sdpplin.h +++ b/src/input/libreal/sdpplin.h @@ -101,7 +101,7 @@ typedef struct { } sdpplin_t; -sdpplin_t *sdpplin_parse(char *data); +sdpplin_t *sdpplin_parse(char *data) XINE_MALLOC; void sdpplin_free(sdpplin_t *description); diff --git a/src/input/librtsp/rtsp.h b/src/input/librtsp/rtsp.h index 1cec57e1e..8aee8e049 100644 --- a/src/input/librtsp/rtsp.h +++ b/src/input/librtsp/rtsp.h @@ -40,7 +40,7 @@ typedef struct rtsp_s rtsp_t; -rtsp_t* rtsp_connect (xine_stream_t *stream, const char *mrl, const char *user_agent); +rtsp_t* rtsp_connect (xine_stream_t *stream, const char *mrl, const char *user_agent) XINE_MALLOC; int rtsp_request_options(rtsp_t *s, const char *what); int rtsp_request_describe(rtsp_t *s, const char *what); diff --git a/src/input/librtsp/rtsp_session.h b/src/input/librtsp/rtsp_session.h index b47db0730..33ac579e1 100644 --- a/src/input/librtsp/rtsp_session.h +++ b/src/input/librtsp/rtsp_session.h @@ -25,7 +25,7 @@ typedef struct rtsp_session_s rtsp_session_t; -rtsp_session_t *rtsp_session_start(xine_stream_t *stream, char *mrl); +rtsp_session_t *rtsp_session_start(xine_stream_t *stream, char *mrl) XINE_MALLOC; void rtsp_session_set_start_time(rtsp_session_t *this, int start_time); diff --git a/src/input/net_buf_ctrl.h b/src/input/net_buf_ctrl.h index 87d6d84a1..e71cbedde 100644 --- a/src/input/net_buf_ctrl.h +++ b/src/input/net_buf_ctrl.h @@ -27,7 +27,7 @@ typedef struct nbc_s nbc_t; -nbc_t *nbc_init (xine_stream_t *xine); +nbc_t *nbc_init (xine_stream_t *xine) XINE_MALLOC; void nbc_close (nbc_t *this); diff --git a/src/post/audio/stretch.c b/src/post/audio/stretch.c index 37952cd56..c082eefa6 100644 --- a/src/post/audio/stretch.c +++ b/src/post/audio/stretch.c @@ -152,7 +152,7 @@ static void stretchscr_exit (scr_plugin_t *scr) { free(this); } -static stretchscr_t* stretchscr_init (double *stretch_factor) { +static stretchscr_t *XINE_MALLOC stretchscr_init (double *stretch_factor) { stretchscr_t *this; this = calloc(1, sizeof(stretchscr_t)); diff --git a/src/post/planar/unsharp.c b/src/post/planar/unsharp.c index 91ac6de82..2f8b74496 100644 --- a/src/post/planar/unsharp.c +++ b/src/post/planar/unsharp.c @@ -26,13 +26,6 @@ #include <xine/xineutils.h> #include <pthread.h> -#ifndef MIN -#define MIN(a,b) (((a)<(b))?(a):(b)) -#endif -#ifndef MAX -#define MAX(a,b) (((a)>(b))?(a):(b)) -#endif - /*===========================================================================*/ #define MIN_MATRIX_SIZE 3 diff --git a/src/spu_dec/cc_decoder.c b/src/spu_dec/cc_decoder.c index 0a2ef18f1..7c6504f1a 100644 --- a/src/spu_dec/cc_decoder.c +++ b/src/spu_dec/cc_decoder.c @@ -216,8 +216,6 @@ static const uint8_t *const cc_alpha_palettes[NUM_CC_PALETTES] = { #define TRANSP_SPACE 0x19 /* code for transparent space, essentially arbitrary */ -#define MAX(a, b) ((a) > (b)? (a) : (b)) - /* mapping from PAC row code to actual CC row */ static const int rowdata[] = {10, -1, 0, 1, 2, 3, 11, 12, 13, 14, 4, 5, 6, 7, 8, 9}; diff --git a/src/video_out/video_out_directfb.c b/src/video_out/video_out_directfb.c index c6010a229..18df07f76 100644 --- a/src/video_out/video_out_directfb.c +++ b/src/video_out/video_out_directfb.c @@ -168,10 +168,6 @@ typedef struct { "no-deinit-check" -#ifndef MAX -# define MAX( a, b ) (((a) > (b)) ? (a) : (b)) -#endif - #define YCBCR_TO_RGB( y, cb, cr, r, g, b ) \ do { \ int _y, _cb, _cr, _r, _g, _b; \ diff --git a/src/video_out/yuv2rgb_mlib.c b/src/video_out/yuv2rgb_mlib.c index 794ce437e..b32817a90 100644 --- a/src/video_out/yuv2rgb_mlib.c +++ b/src/video_out/yuv2rgb_mlib.c @@ -38,8 +38,6 @@ #include <xine/xineutils.h> #include "yuv2rgb.h" -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) - static void mlib_yuv420_rgb24(yuv2rgb_t *this, uint8_t * image, uint8_t * py, uint8_t * pu, uint8_t * pv) diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c index 8671c60ce..f16f482aa 100644 --- a/src/xine-engine/audio_out.c +++ b/src/xine-engine/audio_out.c @@ -294,7 +294,7 @@ struct audio_fifo_s { static int ao_get_property (xine_audio_port_t *this_gen, int property); static int ao_set_property (xine_audio_port_t *this_gen, int property, int value); -static audio_fifo_t *fifo_new (xine_t *xine) { +static audio_fifo_t *XINE_MALLOC fifo_new (xine_t *xine) { audio_fifo_t *fifo; diff --git a/src/xine-engine/configfile.c b/src/xine-engine/configfile.c index 0de7c7e8e..afd99db65 100644 --- a/src/xine-engine/configfile.c +++ b/src/xine-engine/configfile.c @@ -319,7 +319,7 @@ static void config_insert(config_values_t *this, cfg_entry_t *new_entry) { this->first = new_entry; } -static cfg_entry_t *config_add (config_values_t *this, const char *key, int exp_level) { +static cfg_entry_t *XINE_MALLOC config_add (config_values_t *this, const char *key, int exp_level) { cfg_entry_t *entry; diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c index e581126fa..5e1bb0ff0 100644 --- a/src/xine-engine/demux.c +++ b/src/xine-engine/demux.c @@ -47,11 +47,6 @@ #include <winsock.h> #endif -#ifdef MIN -#undef MIN -#endif -#define MIN(a,b) ( (a) < (b) ) ? (a) : (b) - /* * Flush audio and video buffers. It is called from demuxers on * seek/stop, and may be useful when user input changes a stream and diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index c30fac308..39d97f521 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.c @@ -468,7 +468,7 @@ static int _plugin_node_comparator(void *a, void *b) { } } -static plugin_catalog_t *_new_catalog(void){ +static plugin_catalog_t *XINE_MALLOC _new_catalog(void){ plugin_catalog_t *catalog; int i; diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c index 158e2cbc8..b120181b4 100644 --- a/src/xine-engine/metronom.c +++ b/src/xine-engine/metronom.c @@ -172,7 +172,7 @@ static void unixscr_exit (scr_plugin_t *scr) { free(this); } -static scr_plugin_t* unixscr_init () { +static scr_plugin_t *XINE_MALLOC unixscr_init () { unixscr_t *this; this = calloc(1, sizeof(unixscr_t)); diff --git a/src/xine-engine/osd.c b/src/xine-engine/osd.c index 480a3f380..f0fe25e29 100644 --- a/src/xine-engine/osd.c +++ b/src/xine-engine/osd.c @@ -83,17 +83,6 @@ # define UCS2_ENCODING "UCS-2LE" #endif -#ifdef MAX -#undef MAX -#endif -#define MAX(a,b) ( (a) > (b) ) ? (a) : (b) - -#ifdef MIN -#undef MIN -#endif -#define MIN(a,b) ( (a) < (b) ) ? (a) : (b) - - #if (FREETYPE_MAJOR > 2) || \ (FREETYPE_MAJOR == 2 && FREETYPE_MINOR > 1) || \ (FREETYPE_MAJOR == 2 && FREETYPE_MINOR == 1 && FREETYPE_PATCH >= 3) @@ -237,7 +226,7 @@ struct osd_ft2context_s { * for the sake of simplicity) */ -static osd_object_t *osd_new_object (osd_renderer_t *this, int width, int height) { +static osd_object_t *XINE_MALLOC osd_new_object (osd_renderer_t *this, int width, int height) { osd_object_t *osd; diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c index 29c435e79..6a2d751bd 100644 --- a/src/xine-engine/video_out.c +++ b/src/xine-engine/video_out.c @@ -142,7 +142,7 @@ typedef struct { * frame queue (fifo) util functions */ -static img_buf_fifo_t *vo_new_img_buf_queue () { +static img_buf_fifo_t *XINE_MALLOC vo_new_img_buf_queue () { img_buf_fifo_t *queue; diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 56b5d0605..9780052ca 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.c @@ -338,7 +338,7 @@ static void ticket_dispose(xine_ticket_t *this) { free(this); } -static xine_ticket_t *ticket_init(void) { +static xine_ticket_t *XINE_MALLOC ticket_init(void) { xine_ticket_t *port_ticket; port_ticket = calloc(1, sizeof(xine_ticket_t)); diff --git a/src/xine-utils/list.c b/src/xine-utils/list.c index 3d97dd906..e57a6e604 100644 --- a/src/xine-utils/list.c +++ b/src/xine-utils/list.c @@ -67,7 +67,7 @@ struct xine_list_s { /* Allocates a new chunk of n elements * One malloc call is used to allocate the struct and the elements. */ -static xine_list_chunk_t *xine_list_alloc_chunk(size_t size) { +static xine_list_chunk_t *XINE_MALLOC xine_list_alloc_chunk(size_t size) { xine_list_chunk_t *new_chunk; size_t chunk_mem_size; diff --git a/src/xine-utils/pool.c b/src/xine-utils/pool.c index 60330ef53..9dbe4c736 100644 --- a/src/xine-utils/pool.c +++ b/src/xine-utils/pool.c @@ -55,7 +55,7 @@ struct xine_pool_s { /* Allocates a new chunk of n elements * One malloc call is used to allocate the struct and the elements. */ -static xine_pool_chunk_t *xine_pool_alloc_chunk(size_t object_size, size_t object_count) { +static xine_pool_chunk_t *XINE_MALLOC xine_pool_alloc_chunk(size_t object_size, size_t object_count) { xine_pool_chunk_t *new_chunk; size_t chunk_mem_size;; diff --git a/src/xine-utils/xmlparser.c b/src/xine-utils/xmlparser.c index 835d87b85..d8ecb251c 100644 --- a/src/xine-utils/xmlparser.c +++ b/src/xine-utils/xmlparser.c @@ -40,6 +40,7 @@ #include <xine/xineutils.h> #else #define lprintf(...) +#define XINE_MALLOC #endif #include <xine/xmllexer.h> #include <xine/xmlparser.h> @@ -85,7 +86,7 @@ static void free_xml_node(xml_node_t * node) { free(node); } -static xml_property_t * new_xml_property(void) { +static xml_property_t *XINE_MALLOC new_xml_property(void) { xml_property_t * new_property; new_property = (xml_property_t*) malloc(sizeof(xml_property_t)); |