Constness changes
[melted] / src / modules / xine / xineutils.h
index c278f34..f0d74ce 100644 (file)
@@ -1,18 +1,18 @@
 /*
  * Copyright (C) 2000-2004 the xine project
- * 
+ *
  * This file is part of xine, a free video player.
- * 
+ *
  * xine is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * xine is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
@@ -54,7 +54,7 @@ extern "C" {
 //#ifdef HAVE_CONFIG_H
 //#include "config.h"
 //#endif
-  
+
 #include <stdio.h>
 #include <string.h>
 
@@ -70,7 +70,7 @@ extern "C" {
 
   int xine_mutex_init    (xine_mutex_t *mutex, const pthread_mutexattr_t *mutexattr,
                          char *id);
-  
+
   int xine_mutex_lock    (xine_mutex_t *mutex, char *who);
   int xine_mutex_unlock  (xine_mutex_t *mutex, char *who);
   int xine_mutex_destroy (xine_mutex_t *mutex);
@@ -84,7 +84,7 @@ extern "C" {
  * long constant values MUST be suffixed by LL and unsigned long long
  * values by ULL, lest they be truncated by the compiler)
  */
-  
+
 /* generic accelerations */
 #define MM_ACCEL_MLIB           0x00000001
 
@@ -105,7 +105,7 @@ extern "C" {
 
 uint32_t xine_mm_accel (void);
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef USE_MMX
 
 typedef        union {
        int64_t                 q;      /* Quadword (64-bit) value */
@@ -570,7 +570,7 @@ typedef     union {
        __asm__ __volatile__ ("ldmxcsr %0" \
                              : /* nothing */ \
                              : "X" (mem))
-#endif /*ARCH_X86 */
+#endif /* USE_MMX */
 
 
 
@@ -624,7 +624,7 @@ void *xine_xmalloc(size_t size) __attribute__ ((__malloc__));
  */
 void *xine_xmalloc_aligned(size_t alignment, size_t size, void **base);
 
-/* 
+/*
  * Get user home directory.
  */
 const char *xine_get_homedir(void);
@@ -659,13 +659,13 @@ void xine_strdupa(char *dest, char *src);
 #ifdef HAVE_STRPBRK
 #define xine_strpbrk strpbrk
 #else
-static inline char *_private_strpbrk(const char *s, const char *accept) {
+static inline const char *_private_strpbrk(const char *s, const char *accept) {
 
   while(*s != '\0') {
     const char *a = accept;
     while(*a != '\0')
       if(*a++ == *s)
-       return(char *) s;
+       return s;
     ++s;
   }
 
@@ -679,14 +679,14 @@ static inline char *_private_strpbrk(const char *s, const char *accept) {
 #else
 static inline char *_private_strsep(char **stringp, const char *delim) {
   char *begin, *end;
-  
+
   begin = *stringp;
   if(begin == NULL)
     return NULL;
-  
+
   if(delim[0] == '\0' || delim[1] == '\0') {
     char ch = delim[0];
-    
+
     if(ch == '\0')
       end = NULL;
     else {
@@ -700,14 +700,14 @@ static inline char *_private_strsep(char **stringp, const char *delim) {
   }
   else
     end = xine_strpbrk(begin, delim);
-  
+
   if(end) {
     *end++ = '\0';
     *stringp = end;
   }
   else
     *stringp = NULL;
-  
+
   return begin;
 }
 #define xine_strsep _private_strsep
@@ -720,7 +720,7 @@ static inline char *_private_strsep(char **stringp, const char *delim) {
 static inline void _private_setenv(const char *name, const char *val, int _xx) {
   int  len  = strlen(name) + strlen(val) + 2;
   char env[len];
-  
+
   sprintf(env, "%s%c%s", name, '=', val);
   putenv(env);
 }
@@ -730,8 +730,8 @@ static inline void _private_setenv(const char *name, const char *val, int _xx) {
 /*
  * Color Conversion Utility Functions
  * The following data structures and functions facilitate the conversion
- * of RGB images to packed YUV (YUY2) images. There are also functions to 
- * convert from YUV9 -> YV12. All of the meaty details are written in 
+ * of RGB images to packed YUV (YUY2) images. There are also functions to
+ * convert from YUV9 -> YV12. All of the meaty details are written in
  * color.c.
  */
 
@@ -762,16 +762,16 @@ extern void (*yuv411_to_yv12)
    unsigned char *v_src, int v_src_pitch, unsigned char *v_dest, int v_dest_pitch,
    int width, int height);
 extern void (*yv12_to_yuy2)
-  (unsigned char *y_src, int y_src_pitch, 
-   unsigned char *u_src, int u_src_pitch, 
-   unsigned char *v_src, int v_src_pitch, 
+  (unsigned char *y_src, int y_src_pitch,
+   unsigned char *u_src, int u_src_pitch,
+   unsigned char *v_src, int v_src_pitch,
    unsigned char *yuy2_map, int yuy2_pitch,
    int width, int height, int progressive);
 extern void (*yuy2_to_yv12)
   (unsigned char *yuy2_map, int yuy2_pitch,
-   unsigned char *y_dst, int y_dst_pitch, 
-   unsigned char *u_dst, int u_dst_pitch, 
-   unsigned char *v_dst, int v_dst_pitch, 
+   unsigned char *y_dst, int y_dst_pitch,
+   unsigned char *u_dst, int u_dst_pitch,
+   unsigned char *v_dst, int v_dst_pitch,
    int width, int height);
 
 #define SCALEFACTOR 65536
@@ -829,7 +829,7 @@ extern void yuy2_to_yuy2
   (unsigned char *src, int src_pitch,
    unsigned char *dst, int dst_pitch,
    int width, int height);
+
 /* print a hexdump of the given data */
 void xine_hexdump (const char *buf, int length);
 
@@ -844,7 +844,7 @@ void xine_hexdump (const char *buf, int length);
 #  define EXPECT_TRUE(x)  __builtin_expect((x),1)
 #  define EXPECT_FALSE(x) __builtin_expect((x),0)
 #endif
-  
+
 #ifdef NDEBUG
 #define _x_assert(exp) \
   do {                                                                \
@@ -937,7 +937,7 @@ void xine_hexdump (const char *buf, int length);
         printf( "%s", fmtargs );                                            \
       }                                                                     \
     }while(0)
-#else 
+#else
   #define llprintf(cat, ...)                                                \
     do{                                                                     \
       if(cat){                                                              \
@@ -963,7 +963,7 @@ void xine_hexdump (const char *buf, int length);
         xine_log(xine, XINE_LOG_TRACE, fmtargs);                            \
       }                                                                     \
     } while(0)
-#else 
+#else
   #define xprintf(xine, verbose, ...)                                       \
     do {                                                                    \
       if((xine) && (xine)->verbosity >= verbose){                           \
@@ -1011,11 +1011,11 @@ void xine_hexdump (const char *buf, int length);
 typedef struct xine_node_s {
 
   struct xine_node_s    *next, *prev;
-  
+
   void                  *content;
 
   int                    priority;
-  
+
 } xine_node_t;