[vlc-devel] [PATCH 1/2] player: fix unused var warning with NDEBUG

Thomas Guillem thomas at gllm.fr
Wed Sep 4 12:44:43 CEST 2019


Indeed, it should be a noop.

On Wed, Sep 4, 2019, at 11:34, Rémi Denis-Courmont wrote:
> Hi,
> 
> Conventionally, assertions are not evaluated in release builds. It's confusing enough already. I don't think we should add exceptions to that principle.
> 
> Le 4 septembre 2019 10:14:13 GMT+03:00, Thomas Guillem <thomas at gllm.fr> a écrit :
>>  src/player/player.h | 4 ++++
>>  1 file changed, 4 insertions(+)
>> 
>> diff --git a/src/player/player.h b/src/player/player.h
>> index 36caa46299..60321cb8d0 100644
>> --- a/src/player/player.h
>> +++ b/src/player/player.h
>> @@ -169,6 +169,7 @@ struct vlc_player_t
>>      } destructor;
>>  };
>>  
>> +#ifndef NDEBUG
>>  /*
>>   * Assert that the player mutex is locked.
>>   *
>> @@ -181,6 +182,9 @@ vlc_player_assert_locked(vlc_player_t *player)
>>      assert(player);
>>      vlc_mutex_assert(&player->lock);
>>  }
>> +#else
>> +#define vlc_player_assert_locked(x) VLC_UNUSED(x)
>> +#endif
>>  
>>  static inline struct vlc_player_input *
>>  vlc_player_get_input_locked(vlc_player_t *player)
> 
> -- 
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté. 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20190904/53024e53/attachment.html>


More information about the vlc-devel mailing list