diff options
| author | Neil <nyamatongwe@gmail.com> | 2020-06-06 15:14:08 +1000 |
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2020-06-06 15:14:08 +1000 |
| commit | d8b91fe2d61b7738feb5794b5fa551eb813b8cda (patch) | |
| tree | 824d227533cc113a1b08d6419aeb416fc8008749 | |
| parent | 554d1cc7c885291618ec50b6045e27fc1cf87a28 (diff) | |
| download | scintilla-mirror-d8b91fe2d61b7738feb5794b5fa551eb813b8cda.tar.gz | |
Backport: Prefer .data() over &[0] as more explicit.
Backport of changeset 8287:f8749b773e12, but without C++17 and C++20 features.
| -rw-r--r-- | win32/PlatWin.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index 9d5d32141..409617c97 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -692,7 +692,7 @@ void SurfaceGDI::Polygon(Point *pts, size_t npts, ColourDesired fore, ColourDesi const POINT pt = POINTFromPoint(pts[i]); outline.push_back(pt); } - ::Polygon(hdc, &outline[0], static_cast<int>(npts)); + ::Polygon(hdc, outline.data(), static_cast<int>(npts)); } void SurfaceGDI::RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back) { @@ -1489,7 +1489,7 @@ void SurfaceD2D::DrawRGBAImage(PRectangle rc, int width, int height, const unsig const D2D1_SIZE_U size = D2D1::SizeU(width, height); D2D1_BITMAP_PROPERTIES props = {{DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED}, 72.0, 72.0}; - const HRESULT hr = pRenderTarget->CreateBitmap(size, &image[0], + const HRESULT hr = pRenderTarget->CreateBitmap(size, image.data(), width * 4, &props, &bitmap); if (SUCCEEDED(hr)) { D2D1_RECT_F rcDestination = {rc.left, rc.top, rc.right, rc.bottom}; |
