]> git.sesse.net Git - vlc/blobdiff - modules/codec/cmml/history.c
Remove qnx modules.
[vlc] / modules / codec / cmml / history.c
index de4e8e2c76db7d3d769dde1f64350cb9f507a687..da82cbc5f5555195ea5dc7712f6d947239209099 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
 #include <vlc_input.h>
 
 #include "history.h"
@@ -32,7 +36,7 @@
 #include "xarray.h"
 
 #ifdef HAVE_STDLIB_H
-#   include <stdlib.h>                                          /* realloc() */
+#   include <stdlib.h>                                           /* malloc() */
 #endif
 
 #undef HISTORY_DEBUG
@@ -40,7 +44,9 @@
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
+#ifdef HISTORY_DEBUG
 static void history_Dump( history_t *p_history );
+#endif
 
 /*****************************************************************************
  * Local structure lock
@@ -53,7 +59,7 @@ static void history_Dump( history_t *p_history );
 history_t *history_New( void )
 {
    history_t *p_new_history;
-   
    p_new_history = calloc( 1, sizeof( struct history_t ) );
    if( p_new_history == NULL ) return NULL;
 
@@ -64,20 +70,10 @@ history_t *history_New( void )
        return NULL;
    }
 
-#ifndef HISTORY_DEBUG
-   /* make dummy reference to history_Dump to avoid compiler warnings */
-   while (0)
-   {
-       void *p_tmp;
-
-       p_tmp = history_Dump;
-   }
-#endif
-
    return p_new_history;
 }
 
-vlc_bool_t history_GoBackSavingCurrentItem ( history_t *p_history,
+bool history_GoBackSavingCurrentItem ( history_t *p_history,
                                              history_item_t *p_item )
 {
     history_PruneAndInsert( p_history, p_item );
@@ -91,9 +87,10 @@ vlc_bool_t history_GoBackSavingCurrentItem ( history_t *p_history,
 #ifdef HISTORY_DEBUG
     history_Dump( p_history );
 #endif
-    return VLC_TRUE;
+    return true;
 }
 
+#ifdef HISTORY_DEBUG
 static void history_Dump( history_t *p_history )
 {
     unsigned int i_count;
@@ -115,15 +112,14 @@ static void history_Dump( history_t *p_history )
             fprintf( stderr, "HISTORY: [%d] NULL\n", i );
         else
         {
-            char *psz_uri = input_item_GetURI( p_item );
             fprintf( stderr, "HISTORY: [%d] %p (%p->%s)\n", i, p_item,
-                     psz_uri, psz_uri );
-            free( psz_uri );
+                     p_item->psz_uri, p_item->psz_uri );
         }
     }
 }
+#endif
 
-vlc_bool_t history_GoForwardSavingCurrentItem ( history_t *p_history,
+bool history_GoForwardSavingCurrentItem ( history_t *p_history,
                                                 history_item_t *p_item )
 {
 #ifdef HISTORY_DEBUG
@@ -134,33 +130,33 @@ vlc_bool_t history_GoForwardSavingCurrentItem ( history_t *p_history,
         == XARRAY_SUCCESS )
     {
         p_history->i_index++;
-        return VLC_TRUE;
+        return true;
     }
     else
     {
-        return VLC_FALSE;
+        return false;
     }
 }
 
-vlc_bool_t history_CanGoBack( history_t *p_history )
+bool history_CanGoBack( history_t *p_history )
 {
     if( p_history->i_index > 0 )
-        return VLC_TRUE;
+        return true;
     else
-        return VLC_FALSE;
+        return false;
 }
 
-vlc_bool_t history_CanGoForward( history_t *p_history )
+bool history_CanGoForward( history_t *p_history )
 {
     unsigned int i_count;
 
     if( xarray_Count( p_history->p_xarray, &i_count ) != XARRAY_SUCCESS )
-        return VLC_FALSE;
+        return false;
 
     if( p_history->i_index < i_count )
-        return VLC_TRUE;
+        return true;
     else
-        return VLC_FALSE;
+        return false;
 }
 
 history_item_t *history_Item( history_t *p_history )