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

Steve Lhomme robux4 at videolabs.io
Fri Jun 26 12:48:57 CEST 2015


On Fri, Jun 26, 2015 at 11:29 AM, Rémi Denis-Courmont <remi at remlab.net> wrote:
> 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.

I tried that first. But it didn't work:
error: expected unqualified-id before 'int'

It may have to do with the fact MsgCallback is a static callback.

> --
> Rémi Denis-Courmont
> http://www.remlab.net/
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel



More information about the vlc-devel mailing list