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

Tristan Matthews tmatth at videolan.org
Sat Jul 25 18:47:35 CEST 2015


On Fri, Jun 26, 2015 at 6:48 AM, Steve Lhomme <robux4 at videolabs.io> wrote:

> 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.
>

This was added in Qt 5.3, so earlier versions fail to build.


>
> 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
> _______________________________________________
> 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/20150725/a09445fe/attachment.html>


More information about the vlc-devel mailing list