From: Ray Lehtiniemi Date: Thu, 5 Mar 2009 05:33:04 +0000 (-0700) Subject: Constness changes X-Git-Url: http://research.m1stereo.tv/gitweb?a=commitdiff_plain;h=a6e713dda24ecfa8d1432342a8f0a49b48941598;p=melted Constness changes Signed-off-by: Ray Lehtiniemi --- diff --git a/src/framework/mlt_events.c b/src/framework/mlt_events.c index 4a813fe..c27a545 100644 --- a/src/framework/mlt_events.c +++ b/src/framework/mlt_events.c @@ -183,7 +183,7 @@ int mlt_events_register( mlt_properties this, char *id, mlt_transmitter transmit * \param id the name of an event */ -void mlt_events_fire( mlt_properties this, char *id, ... ) +void mlt_events_fire( mlt_properties this, const char *id, ... ) { mlt_events events = mlt_events_fetch( this ); if ( events != NULL ) @@ -231,7 +231,7 @@ void mlt_events_fire( mlt_properties this, char *id, ... ) * \return */ -mlt_event mlt_events_listen( mlt_properties this, void *service, char *id, mlt_listener listener ) +mlt_event mlt_events_listen( mlt_properties this, void *service, const char *id, mlt_listener listener ) { mlt_event event = NULL; mlt_events events = mlt_events_fetch( this ); @@ -413,7 +413,7 @@ static void mlt_events_listen_for( mlt_properties this, condition_pair *pair ) * \return an event */ -mlt_event mlt_events_setup_wait_for( mlt_properties this, char *id ) +mlt_event mlt_events_setup_wait_for( mlt_properties this, const char *id ) { condition_pair *pair = malloc( sizeof( condition_pair ) ); pair->done = 0; diff --git a/src/framework/mlt_events.h b/src/framework/mlt_events.h index 8500160..2fe597d 100644 --- a/src/framework/mlt_events.h +++ b/src/framework/mlt_events.h @@ -44,13 +44,13 @@ typedef void ( *mlt_listener )( ); extern void mlt_events_init( mlt_properties self ); extern int mlt_events_register( mlt_properties self, char *id, mlt_transmitter transmitter ); -extern void mlt_events_fire( mlt_properties self, char *id, ... ); -extern mlt_event mlt_events_listen( mlt_properties self, void *service, char *id, mlt_listener listener ); +extern void mlt_events_fire( mlt_properties self, const char *id, ... ); +extern mlt_event mlt_events_listen( mlt_properties self, void *service, const char *id, mlt_listener listener ); extern void mlt_events_block( mlt_properties self, void *service ); extern void mlt_events_unblock( mlt_properties self, void *service ); extern void mlt_events_disconnect( mlt_properties self, void *service ); -extern mlt_event mlt_events_setup_wait_for( mlt_properties self, char *id ); +extern mlt_event mlt_events_setup_wait_for( mlt_properties self, const char *id ); extern void mlt_events_wait_for( mlt_properties self, mlt_event event ); extern void mlt_events_close_wait_for( mlt_properties self, mlt_event event ); diff --git a/src/framework/mlt_factory.c b/src/framework/mlt_factory.c index c9bdb11..552b8ce 100644 --- a/src/framework/mlt_factory.c +++ b/src/framework/mlt_factory.c @@ -226,7 +226,7 @@ static void set_common_properties( mlt_properties properties, mlt_profile profil * \return a new producer */ -mlt_producer mlt_factory_producer( mlt_profile profile, const char *service, void *input ) +mlt_producer mlt_factory_producer( mlt_profile profile, const char *service, const void *input ) { mlt_producer obj = NULL; @@ -259,7 +259,7 @@ mlt_producer mlt_factory_producer( mlt_profile profile, const char *service, voi * \return a new filter */ -mlt_filter mlt_factory_filter( mlt_profile profile, const char *service, void *input ) +mlt_filter mlt_factory_filter( mlt_profile profile, const char *service, const void *input ) { mlt_filter obj = NULL; @@ -288,7 +288,7 @@ mlt_filter mlt_factory_filter( mlt_profile profile, const char *service, void *i * \return a new transition */ -mlt_transition mlt_factory_transition( mlt_profile profile, const char *service, void *input ) +mlt_transition mlt_factory_transition( mlt_profile profile, const char *service, const void *input ) { mlt_transition obj = NULL; @@ -317,7 +317,7 @@ mlt_transition mlt_factory_transition( mlt_profile profile, const char *service, * \return a new consumer */ -mlt_consumer mlt_factory_consumer( mlt_profile profile, const char *service, void *input ) +mlt_consumer mlt_factory_consumer( mlt_profile profile, const char *service, const void *input ) { mlt_consumer obj = NULL; diff --git a/src/framework/mlt_factory.h b/src/framework/mlt_factory.h index cd0dc7f..29dc62a 100644 --- a/src/framework/mlt_factory.h +++ b/src/framework/mlt_factory.h @@ -43,10 +43,10 @@ extern const char *mlt_factory_directory( ); extern char *mlt_environment( const char *name ); extern int mlt_environment_set( const char *name, const char *value ); extern mlt_properties mlt_factory_event_object( ); -extern mlt_producer mlt_factory_producer( mlt_profile profile, const char *name, void *input ); -extern mlt_filter mlt_factory_filter( mlt_profile profile, const char *name, void *input ); -extern mlt_transition mlt_factory_transition( mlt_profile profile, const char *name, void *input ); -extern mlt_consumer mlt_factory_consumer( mlt_profile profile, const char *name, void *input ); +extern mlt_producer mlt_factory_producer( mlt_profile profile, const char *name, const void *input ); +extern mlt_filter mlt_factory_filter( mlt_profile profile, const char *name, const void *input ); +extern mlt_transition mlt_factory_transition( mlt_profile profile, const char *name, const void *input ); +extern mlt_consumer mlt_factory_consumer( mlt_profile profile, const char *name, const void *input ); extern void mlt_factory_register_for_clean_up( void *ptr, mlt_destructor destructor ); extern void mlt_factory_close( ); extern mlt_properties mlt_global_properties( ); diff --git a/src/framework/mlt_repository.c b/src/framework/mlt_repository.c index d4241e2..c843ecb 100644 --- a/src/framework/mlt_repository.c +++ b/src/framework/mlt_repository.c @@ -208,7 +208,7 @@ static mlt_properties get_service_properties( mlt_repository this, mlt_service_t * \param input an optional argument to the service constructor */ -void *mlt_repository_create( mlt_repository this, mlt_profile profile, mlt_service_type type, const char *service, void *input ) +void *mlt_repository_create( mlt_repository this, mlt_profile profile, mlt_service_type type, const char *service, const void *input ) { mlt_properties properties = get_service_properties( this, type, service ); if ( properties != NULL ) diff --git a/src/framework/mlt_repository.h b/src/framework/mlt_repository.h index 428efc8..a653b49 100644 --- a/src/framework/mlt_repository.h +++ b/src/framework/mlt_repository.h @@ -39,7 +39,7 @@ typedef void ( *mlt_repository_callback )( mlt_repository ); /** The callback function that modules implement to construct a service. */ -typedef void *( *mlt_register_callback )( mlt_profile, mlt_service_type, const char * /* service name */, void * /* arg */ ); +typedef void *( *mlt_register_callback )( mlt_profile, mlt_service_type, const char * /* service name */, const void * /* arg */ ); /** The callback function that modules implement to supply metadata as a properties list. */ @@ -57,7 +57,7 @@ typedef mlt_properties ( *mlt_metadata_callback )( mlt_service_type, const char extern mlt_repository mlt_repository_init( const char *directory ); extern void mlt_repository_register( mlt_repository self, mlt_service_type service_type, const char *service, mlt_register_callback ); -extern void *mlt_repository_create( mlt_repository self, mlt_profile profile, mlt_service_type type, const char *service, void *arg ); +extern void *mlt_repository_create( mlt_repository self, mlt_profile profile, mlt_service_type type, const char *service, const void *arg ); extern void mlt_repository_close( mlt_repository self ); extern mlt_properties mlt_repository_consumers( mlt_repository self ); extern mlt_properties mlt_repository_filters( mlt_repository self ); diff --git a/src/valerie/valerie_response.c b/src/valerie/valerie_response.c index 5b9491c..9b6a964 100644 --- a/src/valerie/valerie_response.c +++ b/src/valerie/valerie_response.c @@ -119,7 +119,7 @@ int valerie_response_count( valerie_response response ) /** Set the error and description associated to the response. */ -void valerie_response_set_error( valerie_response response, int error_code, char *error_string ) +void valerie_response_set_error( valerie_response response, int error_code, const char *error_string ) { if ( response->count == 0 ) { @@ -157,15 +157,15 @@ int valerie_response_printf( valerie_response response, size_t size, char *forma /** Write text to the reponse. */ -int valerie_response_write( valerie_response response, char *text, int size ) +int valerie_response_write( valerie_response response, const char *text, int size ) { int ret = 0; - char *ptr = text; + const char *ptr = text; while ( size > 0 ) { int index = response->count - 1; - char *lf = strchr( ptr, '\n' ); + const char *lf = strchr( ptr, '\n' ); int length_of_string = 0; /* Make sure we have space in the dynamic array. */ diff --git a/src/valerie/valerie_response.h b/src/valerie/valerie_response.h index b59ac88..f44eae6 100644 --- a/src/valerie/valerie_response.h +++ b/src/valerie/valerie_response.h @@ -49,9 +49,9 @@ extern int valerie_response_get_error_code( valerie_response ); extern char *valerie_response_get_error_string( valerie_response ); extern char *valerie_response_get_line( valerie_response, int ); extern int valerie_response_count( valerie_response ); -extern void valerie_response_set_error( valerie_response, int, char * ); +extern void valerie_response_set_error( valerie_response, int, const char * ); extern int valerie_response_printf( valerie_response, size_t, char *, ... ); -extern int valerie_response_write( valerie_response, char *, int ); +extern int valerie_response_write( valerie_response, const char *, int ); extern void valerie_response_close( valerie_response ); #ifdef __cplusplus