From d485d8a5ff5068f08e7ff38f5cda53739226777e Mon Sep 17 00:00:00 2001 From: Stephen Torri Date: Tue, 16 Sep 2003 02:11:45 +0000 Subject: Removed headers that provided nothing needed to the build. Replaced 'while((int) ptr % alignment)' with 'while((size_t) ptr % alignment)' On a 32-bit architecture the comparision of ptr and alignment is fine. On a 64-bit architecture the comparision of ptr (32bits) and alignment (64bits) can cause problems in the desired behaviour. So casting the ptr to the same size as alignment cleared this issue. CVS patchset: 5392 CVS date: 2003/09/16 02:11:45 --- src/xine-utils/utils.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/xine-utils/utils.c b/src/xine-utils/utils.c index 02c9b1ef6..b3286c11a 100644 --- a/src/xine-utils/utils.c +++ b/src/xine-utils/utils.c @@ -17,7 +17,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: utils.c,v 1.17 2003/07/27 12:47:23 hadess Exp $ + * $Id: utils.c,v 1.18 2003/09/16 02:11:45 storri Exp $ * */ #define _POSIX_PTHREAD_SEMANTICS 1 /* for 5-arg getpwuid_r on solaris */ @@ -28,15 +28,8 @@ #include "xineutils.h" -#include -#include #include -#include -#include #include -#include -#include -#include #if HAVE_EXECINFO_H #include #endif @@ -44,7 +37,6 @@ #include #endif -#include "compat.h" void *xine_xmalloc(size_t size) { void *ptr; @@ -68,7 +60,7 @@ void *xine_xmalloc_aligned(size_t alignment, size_t size, void **base) { *base = ptr = xine_xmalloc (size+alignment); - while ((int) ptr % alignment) + while ((size_t) ptr % alignment) ptr++; return ptr; @@ -161,7 +153,7 @@ void xine_print_trace (void) { size = backtrace (array, 10); strings = backtrace_symbols (array, size); - printf ("Obtained %d stack frames.\n", size); + printf ("Obtained %lu stack frames.\n", (unsigned long) size); for (i = 0; i < size; i++) { printf ("%s\n", strings[i]); -- cgit v1.2.3