From 943d74dd1c1995387b2da534eb11df49eebd9a7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 30 Aug 2018 21:47:09 +0200 Subject: [PATCH] GL: restore backwards compatibility of deprecated Buffer::map(). Calling map() was trying to instantiate ArrayView through arrayCast(), which is not possible (void has no size etc etc.). Casting the returned pointer directly instead. Thanks to @AndySomogyi for pointing this out. --- doc/changelog.dox | 3 +++ src/Magnum/GL/Buffer.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/changelog.dox b/doc/changelog.dox index 9f56d04df..346b59f5e 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -167,6 +167,9 @@ See also: optional, defaults to @ref GL::BufferUsage::StaticDraw - Re-enabled @fn_gl{DrawRangeElements} for WebGL 2 (see [mosra/magnum#97](https://github.com/mosra/magnum/issues/97)) +- Restored backwards compatibility to the templated @ref GL::Buffer::map() + overload --- it was not possible to call it with @cpp void @ce template + parameter @subsubsection changelog-latest-changes-math Math library diff --git a/src/Magnum/GL/Buffer.h b/src/Magnum/GL/Buffer.h index 542975ca4..388b4d450 100644 --- a/src/Magnum/GL/Buffer.h +++ b/src/Magnum/GL/Buffer.h @@ -1167,7 +1167,7 @@ class MAGNUM_GL_EXPORT Buffer: public AbstractObject { * instead. */ template CORRADE_DEPRECATED("use non-templated map() and Containers::arrayCast() instead") T* map(GLintptr offset, GLsizeiptr length, MapFlags flags) { - return Containers::arrayCast(map(offset, length, flags)); + return reinterpret_cast(map(offset, length, flags).data()); } #endif