Avoid -Wcast-qual warnings
Avoid some -Wfloat-conversion warnings
Avoid -Wdouble-promotion warning
| ... | ... | @@ -163,7 +163,7 @@ void wxGetWorkAreaX11(Screen* screen, int& x, int& y, int& width, int& height) |
| 163 | 163 | if (status == Success && actual_type == XA_CARDINAL &&
|
| 164 | 164 | actual_format == 32 && nitems == 4)
|
| 165 | 165 | {
|
| 166 | - const long* p = (long*)data.get();
|
|
| 166 | + const long* p = (const long*)data.get();
|
|
| 167 | 167 | x = p[0];
|
| 168 | 168 | y = p[1];
|
| 169 | 169 | width = p[2];
|
| ... | ... | @@ -744,7 +744,7 @@ void WidgetsFrame::InitBook() |
| 744 | 744 | |
| 745 | 745 | wxTreeItemIdValue cookie;
|
| 746 | 746 | tree->EnsureVisible(tree->GetFirstChild(tree->GetRootItem(), cookie));
|
| 747 | - tree->SetMinSize(wxSize(tree->GetBestSize().GetWidth() * 1.1, wxDefaultCoord));
|
|
| 747 | + tree->SetMinSize(wxSize(tree->GetBestSize().GetWidth() * 9 / 8, wxDefaultCoord));
|
|
| 748 | 748 | #else
|
| 749 | 749 | if ( !pageSet || !m_book->GetCurrentPage() )
|
| 750 | 750 | {
|
| ... | ... | @@ -581,7 +581,7 @@ wxGetFrameExtents(GdkWindow* window, wxTopLevelWindow::DecorSize* decorSize) |
| 581 | 581 | if (wx_is_at_least_gtk3(10))
|
| 582 | 582 | scale = gdk_window_get_scale_factor(window);
|
| 583 | 583 | #endif
|
| 584 | - long* p = (long*)data.get();
|
|
| 584 | + const long* p = (const long*)data.get();
|
|
| 585 | 585 | decorSize->left = int(p[0]) / scale;
|
| 586 | 586 | decorSize->right = int(p[1]) / scale;
|
| 587 | 587 | decorSize->top = int(p[2]) / scale;
|
| ... | ... | @@ -1021,7 +1021,7 @@ void wxWebViewWebKit::SetWebkitZoom(float level) |
| 1021 | 1021 | |
| 1022 | 1022 | float wxWebViewWebKit::GetWebkitZoom() const
|
| 1023 | 1023 | {
|
| 1024 | - return webkit_web_view_get_zoom_level(m_web_view);
|
|
| 1024 | + return float(webkit_web_view_get_zoom_level(m_web_view));
|
|
| 1025 | 1025 | }
|
| 1026 | 1026 | |
| 1027 | 1027 | void wxWebViewWebKit::EnableAccessToDevTools(bool enable)
|
| ... | ... | @@ -212,7 +212,7 @@ wxSize wxQtDCImpl::GetPPI() const |
| 212 | 212 | if (!srn)
|
| 213 | 213 | return wxSize(m_qtPainter->device()->logicalDpiX(), m_qtPainter->device()->logicalDpiY());
|
| 214 | 214 | qreal dotsPerInch = srn->logicalDotsPerInch();
|
| 215 | - return wxSize(round(dotsPerInch), round(dotsPerInch));
|
|
| 215 | + return wxSize(std::lround(dotsPerInch), std::lround(dotsPerInch));
|
|
| 216 | 216 | }
|
| 217 | 217 | |
| 218 | 218 | void wxQtDCImpl::SetFont(const wxFont& font)
|
| ... | ... | @@ -84,7 +84,7 @@ private: |
| 84 | 84 | for ( size_t i = 0; i < stops.GetCount(); ++i )
|
| 85 | 85 | {
|
| 86 | 86 | const wxGraphicsGradientStop stop = stops.Item(i);
|
| 87 | - qstops.append(QGradientStop(stop.GetPosition(),
|
|
| 87 | + qstops.append(QGradientStop(double(stop.GetPosition()),
|
|
| 88 | 88 | stop.GetColour().GetQColor()));
|
| 89 | 89 | }
|
| 90 | 90 | |
| ... | ... | @@ -1562,12 +1562,14 @@ wxQtGraphicsRenderer::CreateSubBitmap(const wxGraphicsBitmap& bitmap, |
| 1562 | 1562 | const int srcHeight = sourcePixmap.height();
|
| 1563 | 1563 | const int dstWidth = wxRound(w);
|
| 1564 | 1564 | const int dstHeight = wxRound(h);
|
| 1565 | + const int dstX = wxRound(x);
|
|
| 1566 | + const int dstY = wxRound(y);
|
|
| 1565 | 1567 | |
| 1566 | - wxCHECK_MSG(x >= 0.0 && y >= 0.0 && dstWidth > 0 && dstHeight > 0 &&
|
|
| 1567 | - x + dstWidth <= srcWidth && y + dstHeight <= srcHeight,
|
|
| 1568 | + wxCHECK_MSG(dstX >= 0 && dstY >= 0 && dstWidth > 0 && dstHeight > 0 &&
|
|
| 1569 | + dstX + dstWidth <= srcWidth && dstY + dstHeight <= srcHeight,
|
|
| 1568 | 1570 | wxNullGraphicsBitmap, wxS("Invalid bitmap region"));
|
| 1569 | 1571 | |
| 1570 | - QPixmap subPixmap = sourcePixmap.copy(x, y, w, h);
|
|
| 1572 | + QPixmap subPixmap = sourcePixmap.copy(dstX, dstY, dstWidth, dstHeight);
|
|
| 1571 | 1573 | |
| 1572 | 1574 | wxGraphicsBitmap bmpRes;
|
| 1573 | 1575 | bmpRes.SetRefData(new wxQtBitmapData(this, subPixmap));
|
| ... | ... | @@ -405,7 +405,7 @@ static bool wxKwinRunning(Display *display, Window rootWnd) |
| 405 | 405 | }
|
| 406 | 406 | |
| 407 | 407 | return (type == KWIN_RUNNING &&
|
| 408 | - nitems == 1 && data && ((long*)data.get())[0] == 1);
|
|
| 408 | + nitems == 1 && data && ((const long*)data.get())[0] == 1);
|
|
| 409 | 409 | }
|
| 410 | 410 | |
| 411 | 411 | // KDE's kwin is Qt-centric so much than no normal method of fullscreen
|
—
View it on GitLab.
You're receiving this email because of your account on gitlab.com. Manage all notifications · Help