]> git.sesse.net Git - vlc/commitdiff
* various little portability fixes
authorGildas Bazin <gbazin@videolan.org>
Tue, 26 Mar 2002 23:08:40 +0000 (23:08 +0000)
committerGildas Bazin <gbazin@videolan.org>
Tue, 26 Mar 2002 23:08:40 +0000 (23:08 +0000)
include/audio_output.h
plugins/dummy/vout_dummy.c
plugins/gtk/gtk_menu.h
plugins/spudec/spu_decoder.c
plugins/text/rc.c
src/audio_output/aout_ext-dec.c
src/input/input_ext-plugins.c
src/interface/intf_eject.c
src/interface/main.c
src/misc/configuration.c

index f5707be3f964fc21ef4799042b649f12c30fa3ba..ea7822462de9bf24e543da32462cb9a87191ac13 100644 (file)
@@ -2,7 +2,7 @@
  * audio_output.h : audio output thread interface
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: audio_output.h,v 1.44 2002/03/04 22:18:25 gbazin Exp $
+ * $Id: audio_output.h,v 1.45 2002/03/26 23:08:40 gbazin Exp $
  *
  * Authors: Michel Kaempf <maxx@via.ecp.fr>
  *          Cyril Deguet <asmax@via.ecp.fr>
@@ -86,7 +86,7 @@ typedef struct aout_fifo_s
     vlc_mutex_t         data_lock;
     vlc_cond_t          data_wait;
 
-    void *              buffer;
+    u8 *                buffer;
     mtime_t *           date;
 
     /* The start frame is the first frame in the buffer that contains decoded
index de264a0af2de85de98435a3bef44004392b20e45..e624522c98668901d1429e88f051d5b8f79622a2 100644 (file)
@@ -2,7 +2,7 @@
  * vout_dummy.c: Dummy video output display method for testing purposes
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: vout_dummy.c,v 1.19 2002/03/16 23:03:19 sam Exp $
+ * $Id: vout_dummy.c,v 1.20 2002/03/26 23:08:40 gbazin Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -47,6 +47,9 @@ typedef struct vout_sys_s
 {
     /* Nothing needed here. Maybe stats ? */
 
+    /* Prevent malloc(0) */
+    int i_dummy;
+
 } vout_sys_t;
 
 /*****************************************************************************
index f22715dc5a3b91e09a6f1ed74ee869874019b094..99950007583e934da6154e087a2ab5e7845c039a 100644 (file)
@@ -2,7 +2,7 @@
  * gtk_menu.h: prototypes for menu functions
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: gtk_menu.h,v 1.5 2001/11/11 18:15:42 sam Exp $
+ * $Id: gtk_menu.h,v 1.6 2002/03/26 23:08:40 gbazin Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Stéphane Borel <stef@via.ecp.fr>
@@ -36,6 +36,6 @@ gint GtkSetupMenus( struct intf_thread_s * );
  *****************************************************************************/
 #define DATA2TITLE( user_data )    ( (gint)((long)(user_data)) >> 16 )
 #define DATA2CHAPTER( user_data )  ( (gint)((long)(user_data)) & 0xffff )
-#define POS2DATA( title, chapter ) ( NULL + ( ((title) << 16) \
-                                            | ((chapter) & 0xffff)) )
+#define POS2DATA( title, chapter ) ( 0 + ( ((title) << 16) \
+                                         | ((chapter) & 0xffff)) )
 
index cc1c095e75c85bf40361daffd8146884f9eabe3e..25c71e6d8c636a92f413991290f7a0717e0b5cf1 100644 (file)
@@ -2,7 +2,7 @@
  * spu_decoder.c : spu decoder thread
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: spu_decoder.c,v 1.13 2002/03/15 18:20:27 sam Exp $
+ * $Id: spu_decoder.c,v 1.14 2002/03/26 23:08:40 gbazin Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -277,7 +277,7 @@ static void ParsePacket( spudec_thread_t *p_spudec )
 
     /* Fill the p_spu structure */
     p_spu->pf_render = RenderSPU;
-    p_spu->p_sys->p_data = (void*)p_spu->p_sys
+    p_spu->p_sys->p_data = (u8*)p_spu->p_sys
                             + sizeof( struct subpicture_sys_s );
     p_spu->p_sys->b_palette = 0;
 
index 3a43d5ff538c81764000608dfe804c6c1a588913..61e3b0816865521d1031fe6b89ad7e1117ae941b 100644 (file)
@@ -2,7 +2,7 @@
  * rc.c : remote control stdin/stdout plugin for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: rc.c,v 1.10 2002/02/15 13:32:53 sam Exp $
+ * $Id: rc.c,v 1.11 2002/03/26 23:08:40 gbazin Exp $
  *
  * Authors: Peter Surda <shurdeek@panorama.sth.ac.at>
  *
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
+#include <videolan/vlc.h>
+
 #include <stdlib.h>                                      /* malloc(), free() */
 #include <string.h>
 
 #include <errno.h>                                                 /* ENOMEM */
 #include <stdio.h>
 #include <ctype.h>
-#include <unistd.h>
-#include <sys/time.h>
-#include <sys/types.h>
 
-#include <videolan/vlc.h>
+#ifdef HAVE_UNISTD_H
+#    include <unistd.h>
+#endif
+
+#ifdef HAVE_SYS_TIME_H
+#    include <sys/time.h>
+#endif
+#include <sys/types.h>
 
 #if defined( WIN32 )
 #include <winsock2.h>                                            /* select() */
index dd02f46d06e9d3e43d643fb122ca448996a4108c..db84cef5a08264dfeb2d36cde529d8bff230e7b8 100644 (file)
@@ -2,7 +2,7 @@
  * aout_ext-dec.c : exported fifo management functions
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: aout_ext-dec.c,v 1.13 2002/02/24 22:06:50 sam Exp $
+ * $Id: aout_ext-dec.c,v 1.14 2002/03/26 23:08:40 gbazin Exp $
  *
  * Authors: Michel Kaempf <maxx@via.ecp.fr>
  *          Cyril Deguet <asmax@via.ecp.fr>
@@ -139,7 +139,7 @@ aout_fifo_t * aout_CreateFifo( int i_format, int i_channels, int i_rate,
                 return( NULL );
             }
 
-            p_fifo->buffer = (void *)p_fifo->date + sizeof(mtime_t)
+            p_fifo->buffer = (u8 *)p_fifo->date + sizeof(mtime_t)
                                                      * ( AOUT_FIFO_SIZE + 1 );
 
             /* Set the fifo's buffer as empty (the first frame that is to be
index 95f87969f0887a69a7f125f7ce6675c6cbc8772e..4e7d20560094b109658b6a477709b1458d57e097 100644 (file)
@@ -2,7 +2,7 @@
  * input_ext-plugins.c: useful functions for access and demux plug-ins
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: input_ext-plugins.c,v 1.2 2002/03/02 03:53:55 xav Exp $
+ * $Id: input_ext-plugins.c,v 1.3 2002/03/26 23:08:40 gbazin Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
  * Preamble
  *****************************************************************************/
 #include <stdlib.h>
-#include <sys/time.h>
+
+#ifdef HAVE_SYS_TIME_H
+#    include <sys/time.h>
+#endif
+
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <string.h>
index 0f7232db73876a998d18981632b7c4a780d3669b..7b804aee4a46ce3c02157429f557af29c9e00604 100644 (file)
@@ -2,7 +2,7 @@
  * intf_eject.c: CD/DVD-ROM ejection handling functions
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: intf_eject.c,v 1.4 2002/01/12 02:02:44 jlj Exp $
+ * $Id: intf_eject.c,v 1.5 2002/03/26 23:08:40 gbazin Exp $
  *
  * Author: Julien Blache <jb@technologeek.org> for the Linux part
  *               with code taken from the Linux "eject" command
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  *****************************************************************************/
 
+#include <videolan/vlc.h>
+
 #include <stdio.h>
 #include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
 
-#include <videolan/vlc.h>
+#ifdef HAVE_UNISTD_H
+#    include <unistd.h>
+#endif
+
+#include <string.h>
 
 #ifdef HAVE_FCNTL_H
 #   include <fcntl.h>
index 3c74f5a9faf817ec52c557ddde053750357a11e6..68b88f55053acafc3fa5bb05718a9d8bd64aecfc 100644 (file)
@@ -4,7 +4,7 @@
  * and spawn threads.
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: main.c,v 1.170 2002/03/25 20:37:00 lool Exp $
+ * $Id: main.c,v 1.171 2002/03/26 23:08:40 gbazin Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -66,8 +66,6 @@
 #include <errno.h>                                                 /* ENOMEM */
 #include <stdlib.h>                                  /* getenv(), strtol(),  */
 #include <string.h>                                            /* strerror() */
-#include <fcntl.h>                                       /* open(), O_WRONLY */
-#include <sys/stat.h>                                             /* S_IREAD */
 
 #include "netutils.h"                                 /* network_ChannelJoin */
 
index d4c82db6eb4ae936b84280aeab159b930ad17f81..8cabf8f42d084fb3b4fb64ab7fe6c8e258717643 100644 (file)
@@ -2,7 +2,7 @@
  * configuration.c management of the modules configuration
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: configuration.c,v 1.10 2002/03/26 22:30:09 gbazin Exp $
+ * $Id: configuration.c,v 1.11 2002/03/26 23:08:40 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  *****************************************************************************/
 
+#include <videolan/vlc.h>
+
 #include <stdio.h>                                              /* sprintf() */
 #include <stdlib.h>                                      /* free(), strtol() */
 #include <string.h>                                              /* strdup() */
-#include <unistd.h>                                              /* getuid() */
 
-#include <videolan/vlc.h>
+#ifdef HAVE_UNISTD_H
+#    include <unistd.h>                                          /* getuid() */
+#endif
 
 #ifdef HAVE_GETOPT_LONG
 #   ifdef HAVE_GETOPT_H