]> git.sesse.net Git - mlt/commitdiff
Constness changes
authorRay Lehtiniemi <rayl@mail.com>
Tue, 7 Apr 2009 18:54:32 +0000 (12:54 -0600)
committerRay Lehtiniemi <rayl@mail.com>
Tue, 7 Apr 2009 20:04:26 +0000 (14:04 -0600)
Signed-off-by: Ray Lehtiniemi <rayl@mail.com>
src/framework/mlt_multitrack.c
src/modules/effectv/image.c
src/modules/gtk2/producer_pango.c
src/modules/jackrack/jack_rack.c
src/modules/motion_est/filter_motion_est.c
src/modules/xine/xineutils.h

index 89d1dc2652c620b5b080cfb847266ba3e2d81314..a98d4120e5fe7e3a0950f779499707b3ad81e9a0 100644 (file)
@@ -261,7 +261,7 @@ mlt_producer mlt_multitrack_track( mlt_multitrack this, int track )
 
 static int position_compare( const void *p1, const void *p2 )
 {
-       return *( mlt_position * )p1 - *( mlt_position * )p2;
+       return *( const mlt_position * )p1 - *( const mlt_position * )p2;
 }
 
 /** Add a position to a set.
index dbd848f34316f67c1b0189e8154fec2d29fc0052..ce8157f231f55d82e5a4f959bcf4965bfa50609d 100644 (file)
@@ -51,12 +51,12 @@ void image_bgsubtract_y(unsigned char *diff, const RGB32 *background, const RGB3
        int i;
        int R, G, B;
        const RGB32 *p;
-       short *q;
+       const short *q;
        unsigned char *r;
        int v;
 
        p = src;
-       q = (short *)background;
+       q = (const short *)background;
        r = diff;
        for(i=0; i<video_area; i++) {
                /* FIXME: endianess */
@@ -256,12 +256,13 @@ void image_y_under(unsigned char *diff, const RGB32 *src, int video_area, int y_
 void image_edge(unsigned char *diff2, const RGB32 *src, int width, int height, int y_threshold)
 {
        int x, y;
-       unsigned char *p, *q;
+       const unsigned char *p;
+       unsigned char *q;
        int r, g, b;
        int ar, ag, ab;
        int w;
 
-       p = (unsigned char *)src;
+       p = (const unsigned char *)src;
        q = diff2;
        w = width * sizeof(RGB32);
 
index 4756213eef8e22deed81af2c990fb3b08c85e3cc..7b14d3a47cc2ab6f0cd57a1d2a7493f9fbb629dd 100644 (file)
@@ -146,7 +146,7 @@ mlt_producer producer_pango_init( const char *filename )
                        ( *strrchr( markup, '.' ) ) = '\0';
                        while ( strchr( markup, '~' ) )
                                ( *strchr( markup, '~' ) ) = '\n';
-                       mlt_properties_set( properties, "resource", ( char * )filename );
+                       mlt_properties_set( properties, "resource", filename );
                        mlt_properties_set( properties, "markup", markup );
                        free( copy );
                }
@@ -156,7 +156,7 @@ mlt_producer producer_pango_init( const char *filename )
                        mlt_properties contents = mlt_properties_load( filename );
                        mlt_geometry key_frames = mlt_geometry_init( );
                        struct mlt_geometry_item_s item;
-                       mlt_properties_set( properties, "resource", ( char * )filename );
+                       mlt_properties_set( properties, "resource", filename );
                        mlt_properties_set_data( properties, "contents", contents, 0, ( mlt_destructor )mlt_properties_close, NULL );
                        mlt_properties_set_data( properties, "key_frames", key_frames, 0, ( mlt_destructor )mlt_geometry_close, NULL );
 
@@ -202,8 +202,8 @@ mlt_producer producer_pango_init( const char *filename )
                                if ( markup[ strlen( markup ) - 1 ] == '\n' ) 
                                        markup[ strlen( markup ) - 1 ] = '\0';
 
-                               mlt_properties_set( properties, "resource", ( char * ) filename );
-                               mlt_properties_set( properties, "markup", ( char * ) ( markup == NULL ? "" : markup ) );
+                               mlt_properties_set( properties, "resource", filename );
+                               mlt_properties_set( properties, "markup", ( markup == NULL ? "" : markup ) );
                                free( markup );
                        }
                        else
index 2d66f951d38edf4dda129d9a73b651d08db6d74c..92f82721c2452486ac418598d668a5dbf353e19a 100644 (file)
@@ -39,8 +39,8 @@
 #ifndef _
 #define _(x) x
 #endif
-#define _x (xmlChar*)
-#define _s (char*)
+#define _x (const xmlChar*)
+#define _s (const char*)
 
 jack_rack_t *
 jack_rack_new (const char * client_name, unsigned long channels)
index 80a11ad950a03505f21173347cb7ee017947124c..6e8b021880e0938cebe6bf4cfe34293c2cf6718b 100644 (file)
@@ -392,7 +392,7 @@ static void full_search(
 
 int ncompare (const void * a, const void * b)
 {
-       return ( *(int*)a - *(int*)b );
+       return ( *(const int*)a - *(const int*)b );
 }
 
 // motion vector denoising
index d4dba6498a0cfedc5328e7fded54b327e1dcb3ea..f0d74cea5b7e216ca0469dee9484dadbb40bc34a 100644 (file)
@@ -659,13 +659,13 @@ void xine_strdupa(char *dest, char *src);
 #ifdef HAVE_STRPBRK
 #define xine_strpbrk strpbrk
 #else
-static inline char *_private_strpbrk(const char *s, const char *accept) {
+static inline const char *_private_strpbrk(const char *s, const char *accept) {
 
   while(*s != '\0') {
     const char *a = accept;
     while(*a != '\0')
       if(*a++ == *s)
-       return(char *) s;
+       return s;
     ++s;
   }