]> git.sesse.net Git - vlc/commitdiff
* include/vlc_common.h: avoid compiler warnings.
authorGildas Bazin <gbazin@videolan.org>
Tue, 8 Feb 2005 14:18:05 +0000 (14:18 +0000)
committerGildas Bazin <gbazin@videolan.org>
Tue, 8 Feb 2005 14:18:05 +0000 (14:18 +0000)
include/vlc_common.h

index 93cd22cc22b10e4b85261daa64c2eeb2ff08e2d7..65aeab7abdff099b7df9238e7f7d50ae090537e0 100644 (file)
@@ -521,21 +521,19 @@ static int64_t GCD( int64_t a, int64_t b )
 }
 
 /* Dynamic array handling: realloc array, move data, increment position */
+#if defined( _MSC_VER )
+#   define VLCCVP (void**) /* Work-around for broken compiler */
+#else
+#   define VLCCVP
+#endif
 #define INSERT_ELEM( p_ar, i_oldsize, i_pos, elem )                           \
     do                                                                        \
     {                                                                         \
-        if( i_oldsize )                                                       \
-        {                                                                     \
-            (p_ar) = (void**)realloc( p_ar, ((i_oldsize) + 1) * sizeof( *(p_ar) ) );  \
-        }                                                                     \
-        else                                                                  \
-        {                                                                     \
-            (p_ar) = (void**)malloc( ((i_oldsize) + 1) * sizeof( *(p_ar) ) ); \
-        }                                                                     \
+        if( !i_oldsize ) (p_ar) = NULL;                                       \
+        (p_ar) = VLCCVP realloc( p_ar, ((i_oldsize) + 1) * sizeof(*(p_ar)) ); \
         if( (i_oldsize) - (i_pos) )                                           \
         {                                                                     \
-            memmove( (p_ar) + (i_pos) + 1,                                    \
-                     (p_ar) + (i_pos),                                        \
+            memmove( (p_ar) + (i_pos) + 1, (p_ar) + (i_pos),                  \
                      ((i_oldsize) - (i_pos)) * sizeof( *(p_ar) ) );           \
         }                                                                     \
         (p_ar)[i_pos] = elem;                                                 \
@@ -960,14 +958,6 @@ typedef __int64 off_t;
 #   include <tchar.h>
 #endif
 
-/* lseek (defined in src/extras/libc.c) */
-#ifndef HAVE_LSEEK
-#   define lseek vlc_lseek
-    VLC_EXPORT( off_t, vlc_lseek, ( int fildes, off_t offset, int whence ) );
-#elif !defined(__PLUGIN__)
-#   define vlc_lseek NULL
-#endif
-
 VLC_EXPORT( vlc_bool_t, vlc_reduce, ( int *, int *, int64_t, int64_t, int64_t ) );
 VLC_EXPORT( char **, vlc_parse_cmdline, ( const char *, int * ) );