[vlc-devel] [vlc-commits] qt: use QAtomicInt

Rémi Denis-Courmont remi at remlab.net
Fri Jun 26 11:29:40 CEST 2015


Le 2015-06-26 11:32, Steve Lhomme a écrit :
> On Thu, Jun 25, 2015 at 11:09 PM, Rémi Denis-Courmont
> <git at videolan.org> wrote:
>> vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri 
>> Jun 26 00:06:44 2015 +0300| [d2571e643edb0f1cb217805ef8d5ac172d59a864] 
>> | committer: Rémi Denis-Courmont
>>
>> qt: use QAtomicInt
>>
>>> 
>>> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d2571e643edb0f1cb217805ef8d5ac172d59a864
>> ---
>>
>>  modules/gui/qt4/dialogs/messages.cpp |    4 ++--
>>  modules/gui/qt4/dialogs/messages.hpp |    4 ++--
>>  2 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/modules/gui/qt4/dialogs/messages.cpp 
>> b/modules/gui/qt4/dialogs/messages.cpp
>> index 21c1110..d23007f 100644
>> --- a/modules/gui/qt4/dialogs/messages.cpp
>> +++ b/modules/gui/qt4/dialogs/messages.cpp
>> @@ -146,7 +146,7 @@ MessagesDialog::~MessagesDialog()
>>
>>  void MessagesDialog::changeVerbosity( int i_verbosity )
>>  {
>> -    atomic_store( &this->verbosity, i_verbosity );
>> +    verbosity = i_verbosity;
>>  }
>>
>>  void MessagesDialog::updateConfig()
>> @@ -340,7 +340,7 @@ void MessagesDialog::MsgCallback( void *self, 
>> int type, const vlc_log_t *item,
>>  {
>>      MessagesDialog *dialog = (MessagesDialog *)self;
>>      char *str;
>> -    int verbosity = atomic_load( &dialog->verbosity );
>> +    int verbosity = dialog->verbosity;
>
> This fails to build for me in msys2+mingw64.
> `error: cannot convert 'QAtomicInt' to 'int' in initialization`

According to Qt doc, there is an operator int. It is equivalent to 
explicit load, AFAIK.

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list