]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/mosaic.c
Adjust: code cosmetics
[vlc] / modules / video_filter / mosaic.c
index ea47c41eec8b686fa82e4f138f021ea9dc4eaddd..faae53dd0ea2055c5177f108922738bb87e99aff 100644 (file)
 
 #include <math.h>
 #include <limits.h> /* INT_MAX */
-#include <assert.h>
 
 #include <vlc_filter.h>
 #include <vlc_image.h>
 
-#include <vlc_memory.h>
-
 #include "mosaic.h"
 
 #define BLANK_DELAY INT64_C(1000000)
@@ -257,16 +254,14 @@ static void __mosaic_ParseSetOffsets( vlc_object_t *p_this,
         {
             i_index++;
 
-            p_sys->pi_x_offsets = realloc_or_free( p_sys->pi_x_offsets,
+            p_sys->pi_x_offsets = xrealloc( p_sys->pi_x_offsets,
                                                    i_index * sizeof(int) );
-            assert( p_sys->pi_x_offsets );
             p_sys->pi_x_offsets[i_index - 1] = atoi( psz_offsets );
             psz_end = strchr( psz_offsets, ',' );
             psz_offsets = psz_end + 1;
 
-            p_sys->pi_y_offsets = realloc_or_free( p_sys->pi_y_offsets,
+            p_sys->pi_y_offsets = xrealloc( p_sys->pi_y_offsets,
                                                    i_index * sizeof(int) );
-            assert( p_sys->pi_y_offsets );
             p_sys->pi_y_offsets[i_index - 1] = atoi( psz_offsets );
             psz_end = strchr( psz_offsets, ',' );
             psz_offsets = psz_end + 1;
@@ -364,9 +359,8 @@ static int CreateFilter( vlc_object_t *p_this )
         {
             psz_end = strchr( psz_order, ',' );
             i_index++;
-            p_sys->ppsz_order = realloc_or_free( p_sys->ppsz_order,
+            p_sys->ppsz_order = xrealloc( p_sys->ppsz_order,
                                                  i_index * sizeof(char *) );
-            assert( p_sys->ppsz_order );
             p_sys->ppsz_order[i_index - 1] = strndup( psz_order,
                                            psz_end - psz_order );
             psz_order = psz_end+1;
@@ -755,7 +749,7 @@ static int MosaicCallback( vlc_object_t *p_this, char const *psz_var,
     {
         vlc_mutex_lock( &p_sys->lock );
         msg_Dbg( p_this, "changing alpha from %d/255 to %d/255",
-                         p_sys->i_alpha, newval.i_int);
+                         p_sys->i_alpha, (int)newval.i_int);
         p_sys->i_alpha = __MIN( __MAX( newval.i_int, 0 ), 255 );
         vlc_mutex_unlock( &p_sys->lock );
     }
@@ -763,7 +757,7 @@ static int MosaicCallback( vlc_object_t *p_this, char const *psz_var,
     {
         vlc_mutex_lock( &p_sys->lock );
         msg_Dbg( p_this, "changing height from %dpx to %dpx",
-                          p_sys->i_height, newval.i_int );
+                          p_sys->i_height, (int)newval.i_int );
         p_sys->i_height = __MAX( newval.i_int, 0 );
         vlc_mutex_unlock( &p_sys->lock );
     }
@@ -771,7 +765,7 @@ static int MosaicCallback( vlc_object_t *p_this, char const *psz_var,
     {
         vlc_mutex_lock( &p_sys->lock );
         msg_Dbg( p_this, "changing width from %dpx to %dpx",
-                         p_sys->i_width, newval.i_int );
+                         p_sys->i_width, (int)newval.i_int );
         p_sys->i_width = __MAX( newval.i_int, 0 );
         vlc_mutex_unlock( &p_sys->lock );
     }
@@ -779,7 +773,7 @@ static int MosaicCallback( vlc_object_t *p_this, char const *psz_var,
     {
         vlc_mutex_lock( &p_sys->lock );
         msg_Dbg( p_this, "changing x offset from %dpx to %dpx",
-                         p_sys->i_xoffset, newval.i_int );
+                         p_sys->i_xoffset, (int)newval.i_int );
         p_sys->i_xoffset = __MAX( newval.i_int, 0 );
         vlc_mutex_unlock( &p_sys->lock );
     }
@@ -787,7 +781,7 @@ static int MosaicCallback( vlc_object_t *p_this, char const *psz_var,
     {
         vlc_mutex_lock( &p_sys->lock );
         msg_Dbg( p_this, "changing y offset from %dpx to %dpx",
-                         p_sys->i_yoffset, newval.i_int );
+                         p_sys->i_yoffset, (int)newval.i_int );
         p_sys->i_yoffset = __MAX( newval.i_int, 0 );
         vlc_mutex_unlock( &p_sys->lock );
     }
@@ -802,7 +796,7 @@ static int MosaicCallback( vlc_object_t *p_this, char const *psz_var,
         while( pi_align_values[i_new] != newval.i_int ) i_new++;
         msg_Dbg( p_this, "changing alignment from %d (%s) to %d (%s)",
                      p_sys->i_align, ppsz_align_descriptions[i_old],
-                     newval.i_int, ppsz_align_descriptions[i_new] );
+                     (int)newval.i_int, ppsz_align_descriptions[i_new] );
         p_sys->i_align = newval.i_int;
         vlc_mutex_unlock( &p_sys->lock );
     }
@@ -810,7 +804,7 @@ static int MosaicCallback( vlc_object_t *p_this, char const *psz_var,
     {
         vlc_mutex_lock( &p_sys->lock );
         msg_Dbg( p_this, "changing border width from %dpx to %dpx",
-                         p_sys->i_borderw, newval.i_int );
+                         p_sys->i_borderw, (int)newval.i_int );
         p_sys->i_borderw = __MAX( newval.i_int, 0 );
         vlc_mutex_unlock( &p_sys->lock );
     }
@@ -818,7 +812,7 @@ static int MosaicCallback( vlc_object_t *p_this, char const *psz_var,
     {
         vlc_mutex_lock( &p_sys->lock );
         msg_Dbg( p_this, "changing border height from %dpx to %dpx",
-                         p_sys->i_borderh, newval.i_int );
+                         p_sys->i_borderh, (int)newval.i_int );
         p_sys->i_borderh = __MAX( newval.i_int, 0 );
         vlc_mutex_unlock( &p_sys->lock );
     }
@@ -837,7 +831,7 @@ static int MosaicCallback( vlc_object_t *p_this, char const *psz_var,
             vlc_mutex_lock( &p_sys->lock );
             msg_Dbg( p_this, "changing position method from %d (%s) to %d (%s)",
                     p_sys->i_position, ppsz_pos_descriptions[p_sys->i_position],
-                    newval.i_int, ppsz_pos_descriptions[newval.i_int]);
+                     (int)newval.i_int, ppsz_pos_descriptions[newval.i_int]);
             p_sys->i_position = newval.i_int;
             vlc_mutex_unlock( &p_sys->lock );
         }
@@ -846,7 +840,7 @@ static int MosaicCallback( vlc_object_t *p_this, char const *psz_var,
     {
         vlc_mutex_lock( &p_sys->lock );
         msg_Dbg( p_this, "changing number of rows from %d to %d",
-                         p_sys->i_rows, newval.i_int );
+                         p_sys->i_rows, (int)newval.i_int );
         p_sys->i_rows = __MAX( newval.i_int, 1 );
         vlc_mutex_unlock( &p_sys->lock );
     }
@@ -854,7 +848,7 @@ static int MosaicCallback( vlc_object_t *p_this, char const *psz_var,
     {
         vlc_mutex_lock( &p_sys->lock );
         msg_Dbg( p_this, "changing number of columns from %d to %d",
-                         p_sys->i_cols, newval.i_int );
+                         p_sys->i_cols, (int)newval.i_int );
         p_sys->i_cols = __MAX( newval.i_int, 1 );
         vlc_mutex_unlock( &p_sys->lock );
     }
@@ -882,9 +876,8 @@ static int MosaicCallback( vlc_object_t *p_this, char const *psz_var,
             {
                 psz_end = strchr( psz_order, ',' );
                 i_index++;
-                p_sys->ppsz_order = realloc_or_free( p_sys->ppsz_order,
+                p_sys->ppsz_order = xrealloc( p_sys->ppsz_order,
                                                    i_index * sizeof(char *) );
-                assert( p_sys->ppsz_order );
                 p_sys->ppsz_order[i_index - 1] = strndup( psz_order,
                                            psz_end - psz_order );
                 psz_order = psz_end+1;