Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:plater
libunicap
libunicap_0912_fixPrivate.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File libunicap_0912_fixPrivate.patch of Package libunicap
Index: libunicap-0.9.12/include/unicap.h =================================================================== --- libunicap-0.9.12.orig/include/unicap.h 2010-08-05 08:51:58.000000000 +0200 +++ libunicap-0.9.12/include/unicap.h 2020-06-05 10:40:26.525774869 +0200 @@ -215,7 +215,7 @@ struct _unicap_data_buffer_t unicap_buffer_flags_t flags; - unicap_data_buffer_private_t *private; + unicap_data_buffer_private_t *private_buffer; }; typedef struct _unicap_data_buffer_t unicap_data_buffer_t; Index: libunicap-0.9.12/src/unicap.c =================================================================== --- libunicap-0.9.12.orig/src/unicap.c 2010-09-19 09:02:48.000000000 +0200 +++ libunicap-0.9.12/src/unicap.c 2020-06-05 10:40:26.525774869 +0200 @@ -1467,7 +1467,7 @@ unicap_data_buffer_t *unicap_data_buffer buffer->buffer_size = buffer->format.buffer_size; buffer->data = malloc( buffer->buffer_size ); unicap_copy_format( &buffer->format, format ); - buffer->private = NULL; + buffer->private_buffer = NULL; return buffer; } @@ -1475,28 +1475,28 @@ unicap_data_buffer_t *unicap_data_buffer void unicap_data_buffer_init( unicap_data_buffer_t *buffer, unicap_format_t *format, unicap_data_buffer_init_data_t *init_data ) { unicap_copy_format( &buffer->format, format ); - buffer->private = malloc( sizeof( unicap_data_buffer_private_t ) ); - sem_init( &buffer->private->lock, 0, 1 ); - buffer->private->ref_count = 0; - buffer->private->free_func = init_data->free_func; - buffer->private->free_func_data = init_data->free_func_data; - buffer->private->ref_func = init_data->ref_func; - buffer->private->ref_func_data = init_data->ref_func_data; - buffer->private->unref_func = init_data->unref_func; - buffer->private->unref_func_data = init_data->unref_func_data; + buffer->private_buffer = malloc( sizeof( unicap_data_buffer_private_t ) ); + sem_init( &buffer->private_buffer->lock, 0, 1 ); + buffer->private_buffer->ref_count = 0; + buffer->private_buffer->free_func = init_data->free_func; + buffer->private_buffer->free_func_data = init_data->free_func_data; + buffer->private_buffer->ref_func = init_data->ref_func; + buffer->private_buffer->ref_func_data = init_data->ref_func_data; + buffer->private_buffer->unref_func = init_data->unref_func; + buffer->private_buffer->unref_func_data = init_data->unref_func_data; } void unicap_data_buffer_free( unicap_data_buffer_t *buffer ) { - sem_wait( &buffer->private->lock ); - if( buffer->private->ref_count > 0 ){ - TRACE( "freeing a buffer with refcount = %d!!!\n", buffer->private.refcount ); + sem_wait( &buffer->private_buffer->lock ); + if( buffer->private_buffer->ref_count > 0 ){ + TRACE( "freeing a buffer with refcount = %d!!!\n", buffer->private_buffer.refcount ); } - if( buffer->private->free_func ){ - buffer->private->free_func( buffer, buffer->private->free_func_data ); + if( buffer->private_buffer->free_func ){ + buffer->private_buffer->free_func( buffer, buffer->private_buffer->free_func_data ); } - sem_destroy( &buffer->private->lock ); + sem_destroy( &buffer->private_buffer->lock ); if (buffer->data) free( buffer->data ); free( buffer ); @@ -1504,9 +1504,9 @@ void unicap_data_buffer_free( unicap_dat unicap_status_t unicap_data_buffer_ref( unicap_data_buffer_t *buffer ) { - sem_wait( &buffer->private->lock ); - buffer->private->ref_count++; - sem_post( &buffer->private->lock ); + sem_wait( &buffer->private_buffer->lock ); + buffer->private_buffer->ref_count++; + sem_post( &buffer->private_buffer->lock ); return STATUS_SUCCESS; } @@ -1514,36 +1514,36 @@ unicap_status_t unicap_data_buffer_ref( unicap_status_t unicap_data_buffer_unref( unicap_data_buffer_t *buffer ) { unicap_status_t status = STATUS_SUCCESS; - sem_wait( &buffer->private->lock ); - if( buffer->private->ref_count > 0 ){ - buffer->private->ref_count--; - if (buffer->private->unref_func){ - buffer->private->unref_func (buffer, buffer->private->unref_func_data); + sem_wait( &buffer->private_buffer->lock ); + if( buffer->private_buffer->ref_count > 0 ){ + buffer->private_buffer->ref_count--; + if (buffer->private_buffer->unref_func){ + buffer->private_buffer->unref_func (buffer, buffer->private_buffer->unref_func_data); } - if (buffer->private->ref_count == 0 ){ + if (buffer->private_buffer->ref_count == 0 ){ unicap_data_buffer_free( buffer ); } }else{ TRACE( "unref of a buffer with refcount <= 0!" ); status = STATUS_FAILURE; } - sem_post (&buffer->private->lock); + sem_post (&buffer->private_buffer->lock); return status; } unsigned int unicap_data_buffer_get_refcount( unicap_data_buffer_t *buffer ) { - return buffer->private->ref_count; + return buffer->private_buffer->ref_count; } void *unicap_data_buffer_set_user_data( unicap_data_buffer_t *buffer, void *data ) { - void *old_data = buffer->private->user_data; - buffer->private->user_data = data; + void *old_data = buffer->private_buffer->user_data; + buffer->private_buffer->user_data = data; return old_data; } void *unicap_data_buffer_get_user_data( unicap_data_buffer_t *buffer ) { - return buffer->private->user_data; + return buffer->private_buffer->user_data; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor