[Interest] Bug in QCodoaWindow?

Andy asmaloney at gmail.com
Thu Aug 27 23:25:11 CEST 2020


Bitwise "&" has precedence over logical "&&", so I think this is alright.

https://en.cppreference.com/w/cpp/language/operator_precedence

(Regardless I would always use parens in cases like this to make it easier
for humans reading the code.)

---
Andy Maloney  //  https://asmaloney.com
twitter ~ @asmaloney <https://twitter.com/asmaloney>



On Thu, Aug 27, 2020 at 5:17 PM John Weeks <john at wavemetrics.com> wrote:

> Isn't this a bug?
>
>  bool QCocoaWindow::isTransitioningToFullScreen() const
> {
>     NSWindow *window = m_view.window;
>     return window.styleMask & NSWindowStyleMaskFullScreen &&
> !window.qt_fullScreen;
> }
>
> Seems like the bitwise & needs parens.
>
> This is from Qt 5.12.9. Haven't checked Qt 5.15.
>
> -John Weeks
> WaveMetrics, Inc.
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200827/aebd893a/attachment.html>


More information about the Interest mailing list