]> git.sesse.net Git - vlc/commitdiff
Use native C/C++ boolean type
authorRémi Denis-Courmont <rem@videolan.org>
Mon, 17 Mar 2008 18:04:45 +0000 (20:04 +0200)
committerRémi Denis-Courmont <rem@videolan.org>
Mon, 17 Mar 2008 18:04:45 +0000 (20:04 +0200)
include/vlc/vlc.h
modules/access/bda/bda.c
modules/access/dvb/access.c
modules/access/fake.c
modules/demux/live555.cpp
modules/gui/macosx/voutgl.m
modules/gui/macosx/voutqt.m
modules/gui/minimal_macosx/VLCOpenGLVoutView.m
modules/video_output/msw/events.c
modules/video_output/x11/xcommon.c
src/input/es_out.c

index d8e00dcd9e3b4a78478704b10d5e96d01feac040..53e5e18933c57f67651f0176342c7fa9c9f045bd 100644 (file)
 
 # ifdef __cplusplus
 extern "C" {
+# else
+#  include <stdbool.h>
 # endif
 
 /*****************************************************************************
  * Our custom types
  *****************************************************************************/
-typedef int vlc_bool_t;
+typedef bool vlc_bool_t;
 typedef struct vlc_list_t vlc_list_t;
 typedef struct vlc_object_t vlc_object_t;
 
@@ -131,8 +133,8 @@ struct vlc_list_t
 /*****************************************************************************
  * Booleans
  *****************************************************************************/
-#define VLC_FALSE 0
-#define VLC_TRUE  1
+#define VLC_FALSE false
+#define VLC_TRUE  true
 
 /*****************************************************************************
  * Playlist
index 563f627189bef70fc287372b9cd60def52de17bc..37aa9637f809f7cbb1b350ef965ff05389b9d912 100644 (file)
@@ -525,7 +525,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
 
     case ACCESS_SET_PRIVATE_ID_STATE: /* 11 */
         i_int  = (int)va_arg( args, int );
-        b_bool = (vlc_bool_t)va_arg( args, vlc_bool_t );
+        b_bool = (bool)va_arg( args, int );
         break;
     case ACCESS_SET_PRIVATE_ID_CA:  /* 12 -From Demux */
         break;
index 7547d75c51d82be950613a10f4777d7e3df8e8b7..685a186a09e38bb3a28918e11b8bce6b6edc585c 100644 (file)
@@ -551,7 +551,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
 
         case ACCESS_SET_PRIVATE_ID_STATE:
             i_int  = (int)va_arg( args, int );               /* Private data (pid for now)*/
-            b_bool = (vlc_bool_t)va_arg( args, vlc_bool_t ); /* b_selected */
+            b_bool = (bool)va_arg( args, int ); /* b_selected */
             if( !p_sys->b_budget_mode )
             {
                 /* FIXME we may want to give the real type (me ?, I don't ;) */
index 93ae8516837152710ec2b0b2077a7366d9ba6613..d5cf5c313ea834759966d816673be27c857c2992 100644 (file)
@@ -153,7 +153,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             return VLC_SUCCESS;
 
         case DEMUX_SET_PAUSE_STATE:
-            b = (vlc_bool_t)va_arg( args, vlc_bool_t );
+            b = (bool)va_arg( args, int );
             if ( b )
             {
                 p_sys->i_pause_pts = mdate();
index 9e5035b12457cc8254c28b6222f64cbdfa7b85a1..ea58cca32f1a0ec677de5911f9bb964cfb70b998 100644 (file)
@@ -1374,7 +1374,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             double d_npt = (double) p_sys->i_npt / I64C(1000000);
             int i;
 
-            b_bool = (vlc_bool_t)va_arg( args, vlc_bool_t );
+            b_bool = (bool)va_arg( args, int );
             if( p_sys->rtsp == NULL )
                 return VLC_EGENERIC;
 
index 182f2f44df59bded3e5be16e7cbba24de25e51c0..0ed822ef00bc9e8b47ad7dfb2dafd33c7273cd27 100644 (file)
@@ -271,7 +271,7 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args )
     switch( i_query )
     {
         case VOUT_SET_STAY_ON_TOP:
-            b_arg = va_arg( args, vlc_bool_t );
+            b_arg = (bool) va_arg( args, int );
             [p_vout->p_sys->o_vout_view setOnTop: b_arg];
             return VLC_SUCCESS;
 
index 6e053e76542947ed1cca6813dbff3ee24ba3de8b..88370bdc1c9504e620a07bcc55ac895c590370c2 100644 (file)
@@ -459,7 +459,7 @@ static int ControlVideo( vout_thread_t *p_vout, int i_query, va_list args )
     switch( i_query )
     {
         case VOUT_SET_STAY_ON_TOP:
-            b_arg = va_arg( args, vlc_bool_t );
+            b_arg = (bool) va_arg( args, int );
             [p_vout->p_sys->o_vout_view setOnTop: b_arg];
             return VLC_SUCCESS;
 
index 7da994f7c92f7822e027d96be02bb88d7e091b67..8ca901272fcdbbd4bbadfaec31f109b6318cf272 100644 (file)
@@ -147,7 +147,7 @@ int cocoaglvoutviewControl( vout_thread_t *p_vout, int i_query, va_list args )
     switch( i_query )
     {
         case VOUT_SET_STAY_ON_TOP:
-            b_arg = va_arg( args, vlc_bool_t );
+            b_arg = (bool) va_arg( args, int );
             [[p_vout->p_sys->o_glview container] setOnTop: b_arg];
             return VLC_SUCCESS;
 
index 975519fdbedbaa0a01ba7a53bc94fe71f4f8f569..d2769ae7f02208cc2501c371f09a308831012422 100644 (file)
@@ -1129,7 +1129,7 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args )
 
 #ifdef MODULE_NAME_IS_wingapi
     case VOUT_SET_FOCUS:
-        b_bool = va_arg( args, vlc_bool_t );
+        b_bool = (bool) va_arg( args, int );
         p_vout->p_sys->b_parent_focus = b_bool;
         if( b_bool ) GXResume();
         else if( !p_vout->p_sys->b_focus ) GXSuspend();
index 0563c19c8bca2315ed668791739af7682555d521..e9829c77d43e05c7643d6d3945fb6d0d3c5ffcf3 100644 (file)
@@ -3139,7 +3139,7 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args )
                 return vout_ControlWindow( p_vout,
                     (void *)p_vout->p_sys->p_win->owner_window, i_query, args);
 
-            b_arg = va_arg( args, vlc_bool_t );
+            b_arg = (bool) va_arg( args, int );
             vlc_mutex_lock( &p_vout->p_sys->lock );
 #ifdef MODULE_NAME_IS_xvmc
             xvmc_context_reader_lock( &p_vout->p_sys->xvmc_lock );
index 768b66aebb5ff8a4e09108392bf1821e2ef3fca2..733d907dd874b2c7b720c749d9902d9fab2b4ade 100644 (file)
@@ -1562,7 +1562,7 @@ static int EsOutControl( es_out_t *out, int i_query, va_list args )
     {
         case ES_OUT_SET_ES_STATE:
             es = (es_out_id_t*) va_arg( args, es_out_id_t * );
-            b = (vlc_bool_t) va_arg( args, vlc_bool_t );
+            b = (bool) va_arg( args, int );
             if( b && !EsIsSelected( es ) )
             {
                 EsSelect( out, es );
@@ -1584,7 +1584,7 @@ static int EsOutControl( es_out_t *out, int i_query, va_list args )
 
         case ES_OUT_SET_ACTIVE:
         {
-            b = (vlc_bool_t) va_arg( args, vlc_bool_t );
+            b = (bool) va_arg( args, int );
             p_sys->b_active = b;
             /* Needed ? */
             if( b )