D28062: Fix compiler warnings

Vlad Zahorodnii <[email protected]>
Newsgroups gmane.comp.kde.devel.kwin
Message-ID <[email protected]>
zzag added inline comments.

INLINE COMMENTS

> debug_console.cpp:713
>      switch (value.type()) {
> -    case QMetaType::QPoint: {
> +    case QVariant::Point: {
>          const QPoint p = value.toPoint();

According to Qt documentation, we should interpret QVariant::Type as QMetaType::Type.

> Although this function is declared as returning QVariant::Type, the return value should be interpreted as QMetaType::Type

https://doc.qt.io/qt-5/qvariant.html#type

> screenshot.cpp:661
>          // OpenGL gives RGBA; Qt wants ARGB
> -        uint *p = (uint*)img.bits();
> +        uint *p = reinterpret_cast<uint*>(img.bits());
>          uint *end = p + w * h;

Do compilers bark about using c-style casts?

> main_wayland.cpp:266
> +        p->startDetached();
> +            p->deleteLater();
>      }

Indentation is off.

> aurorae.cpp:599
>  {
> -    return client().data();
> +    return client().toStrongRef().data();
>  }

Unrelated side note: this is really wrong!

> wayland_server.cpp:734
>  {
> -    auto ids = m_clientIds.values().toSet();
>      quint16 id = 1;

Unrelated side note: I don't get why Qt folks deprecated toSet(). Range-based initialization looks very clunky if you ask me.

REPOSITORY
  R108 KWin

REVISION DETAIL
  https://phabricator.kde.org/D28062

To: apol, #kwin
Cc: zzag, kwin, Orage, cacarry, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, GB_2, mkulinski, ragreen, jackyalcine, iodelay, crozbo, bwowk, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, hardening, romangg, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.