Skip to content

Commit

Permalink
fix -Wincompatible-pointer-types
Browse files Browse the repository at this point in the history
  • Loading branch information
irov committed Jan 17, 2024
1 parent 52c24da commit e44c540
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
22 changes: 11 additions & 11 deletions src/hb_json/hb_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ hb_result_t hb_json_get_string_size( const hb_json_handle_t * _handle, hb_size_t
//////////////////////////////////////////////////////////////////////////
hb_result_t hb_json_get_field_string( const hb_json_handle_t * _handle, const char * _key, const char ** _value, hb_size_t * const _size )
{
hb_json_handle_t * field;
const hb_json_handle_t * field;
if( hb_json_object_get_field( _handle, _key, &field ) == HB_FAILURE )
{
return HB_FAILURE;
Expand Down Expand Up @@ -568,7 +568,7 @@ void hb_json_get_field_string_default( const hb_json_handle_t * _handle, const c
//////////////////////////////////////////////////////////////////////////
hb_result_t hb_json_copy_field_string( const hb_json_handle_t * _handle, const char * _key, char * _value, hb_size_t _capacity )
{
hb_json_handle_t * field;
const hb_json_handle_t * field;
if( hb_json_object_get_field( _handle, _key, &field ) == HB_FAILURE )
{
return HB_FAILURE;
Expand Down Expand Up @@ -608,7 +608,7 @@ hb_result_t hb_json_copy_field_string_default( const hb_json_handle_t * _handle,
//////////////////////////////////////////////////////////////////////////
hb_result_t hb_json_get_field_boolean( const hb_json_handle_t * _handle, const char * _key, hb_bool_t * const _value )
{
hb_json_handle_t * field;
const hb_json_handle_t * field;
if( hb_json_object_get_field( _handle, _key, &field ) == HB_FAILURE )
{
return HB_FAILURE;
Expand All @@ -635,7 +635,7 @@ void hb_json_get_field_boolean_default( const hb_json_handle_t * _handle, const
//////////////////////////////////////////////////////////////////////////
hb_result_t hb_json_get_field_int16( const hb_json_handle_t * _handle, const char * _key, int16_t * _value )
{
hb_json_handle_t * field;
const hb_json_handle_t * field;
if( hb_json_object_get_field( _handle, _key, &field ) == HB_FAILURE )
{
return HB_FAILURE;
Expand All @@ -651,7 +651,7 @@ hb_result_t hb_json_get_field_int16( const hb_json_handle_t * _handle, const cha
//////////////////////////////////////////////////////////////////////////
void hb_json_get_field_int16_default( const hb_json_handle_t * _handle, const char * _key, int16_t * _value, int16_t _default )
{
hb_json_handle_t * field;
const hb_json_handle_t * field;
if( hb_json_object_get_field( _handle, _key, &field ) == HB_SUCCESSFUL )
{
return;
Expand All @@ -662,7 +662,7 @@ void hb_json_get_field_int16_default( const hb_json_handle_t * _handle, const ch
//////////////////////////////////////////////////////////////////////////
hb_result_t hb_json_get_field_int32( const hb_json_handle_t * _handle, const char * _key, int32_t * _value )
{
hb_json_handle_t * field;
const hb_json_handle_t * field;
if( hb_json_object_get_field( _handle, _key, &field ) == HB_FAILURE )
{
return HB_FAILURE;
Expand All @@ -688,7 +688,7 @@ void hb_json_get_field_int32_default( const hb_json_handle_t * _handle, const ch
//////////////////////////////////////////////////////////////////////////
hb_result_t hb_json_get_field_int64( const hb_json_handle_t * _handle, const char * _key, int64_t * _value )
{
hb_json_handle_t * field;
const hb_json_handle_t * field;
if( hb_json_object_get_field( _handle, _key, &field ) == HB_FAILURE )
{
return HB_FAILURE;
Expand All @@ -714,7 +714,7 @@ void hb_json_get_field_int64_default( const hb_json_handle_t * _handle, const ch
//////////////////////////////////////////////////////////////////////////
hb_result_t hb_json_get_field_uint16( const hb_json_handle_t * _handle, const char * _key, uint16_t * _value )
{
hb_json_handle_t * field;
const hb_json_handle_t * field;
if( hb_json_object_get_field( _handle, _key, &field ) == HB_FAILURE )
{
return HB_FAILURE;
Expand All @@ -740,7 +740,7 @@ void hb_json_get_field_uint16_default( const hb_json_handle_t * _handle, const c
//////////////////////////////////////////////////////////////////////////
hb_result_t hb_json_get_field_uint32( const hb_json_handle_t * _handle, const char * _key, uint32_t * const _value )
{
hb_json_handle_t * field;
const hb_json_handle_t * field;
if( hb_json_object_get_field( _handle, _key, &field ) == HB_FAILURE )
{
return HB_FAILURE;
Expand All @@ -766,7 +766,7 @@ void hb_json_get_field_uint32_default( const hb_json_handle_t * _handle, const c
//////////////////////////////////////////////////////////////////////////
hb_result_t hb_json_get_field_uint64( const hb_json_handle_t * _handle, const char * _key, uint64_t * _value )
{
hb_json_handle_t * field;
const hb_json_handle_t * field;
if( hb_json_object_get_field( _handle, _key, &field ) == HB_FAILURE )
{
return HB_FAILURE;
Expand All @@ -792,7 +792,7 @@ void hb_json_get_field_uint64_default( const hb_json_handle_t * _handle, const c
//////////////////////////////////////////////////////////////////////////
hb_result_t hb_json_get_field_size_t( const hb_json_handle_t * _handle, const char * _key, hb_size_t * const _value )
{
hb_json_handle_t * field;
const hb_json_handle_t * field;
if( hb_json_object_get_field( _handle, _key, &field ) == HB_FAILURE )
{
return HB_FAILURE;
Expand Down
6 changes: 4 additions & 2 deletions src/hb_log_file/hb_log_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@ hb_result_t hb_log_file_initialize( const char * _file )
//////////////////////////////////////////////////////////////////////////
void hb_log_file_finalize()
{
hb_log_file_handle_t * handle;
if( hb_log_remove_observer( &__hb_log_file_observer, &handle ) == HB_SUCCESSFUL )
void * ud;
if( hb_log_remove_observer( &__hb_log_file_observer, &ud ) == HB_SUCCESSFUL )
{
hb_log_file_handle_t * handle = (hb_log_file_handle_t *)ud;

fclose( handle->f );
handle->f = HB_NULLPTR;

Expand Down
6 changes: 4 additions & 2 deletions src/hb_log_tcp/hb_log_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,11 @@ hb_result_t hb_log_tcp_initialize( const char * _url, uint16_t _port )
//////////////////////////////////////////////////////////////////////////
void hb_log_tcp_finalize()
{
hb_log_tcp_handle_t * handle;
if( hb_log_remove_observer( &__hb_log_tcp_observer, &handle ) == HB_SUCCESSFUL )
void * ud;
if( hb_log_remove_observer( &__hb_log_tcp_observer, &ud ) == HB_SUCCESSFUL )
{
hb_log_tcp_handle_t * handle = (hb_log_tcp_handle_t *)ud;

bufferevent_free( handle->bev_cnn );
event_base_free( handle->base );

Expand Down

0 comments on commit e44c540

Please sign in to comment.