Browse Source

Fix deprecation warnings and add more deprecation attributes.

I should really at least commpile before pushing.
pull/175/merge
Vladimír Vondruš 10 years ago
parent
commit
b0f6be40e1
  1. 7
      src/Magnum/Buffer.cpp
  2. 20
      src/Magnum/Buffer.h
  3. 7
      src/Magnum/DebugOutput.cpp
  4. 2
      src/Magnum/DebugOutput.h

7
src/Magnum/Buffer.cpp

@ -676,6 +676,10 @@ Debug& operator<<(Debug& debug, Buffer::Target value) {
#endif #endif
#ifdef MAGNUM_BUILD_DEPRECATED #ifdef MAGNUM_BUILD_DEPRECATED
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
case Buffer::Target::Array: case Buffer::Target::Array:
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
case Buffer::Target::CopyRead: case Buffer::Target::CopyRead:
@ -695,6 +699,9 @@ Debug& operator<<(Debug& debug, Buffer::Target value) {
#endif #endif
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
case Buffer::Target::TransformFeedback: case Buffer::Target::TransformFeedback:
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#endif #endif
return debug << static_cast<Buffer::TargetHint>(value); return debug << static_cast<Buffer::TargetHint>(value);
#endif #endif

20
src/Magnum/Buffer.h

@ -370,7 +370,7 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* @deprecated For @ref setTargetHint() only, use * @deprecated For @ref setTargetHint() only, use
* @ref TargetHint::Array instead. * @ref TargetHint::Array instead.
*/ */
Array = GL_ARRAY_BUFFER, Array CORRADE_DEPRECATED_ENUM("use Buffer::TargetHint::Array instead") = GL_ARRAY_BUFFER,
#endif #endif
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
@ -391,14 +391,14 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* @deprecated For @ref setTargetHint() only, use * @deprecated For @ref setTargetHint() only, use
* @ref TargetHint::CopyRead instead. * @ref TargetHint::CopyRead instead.
*/ */
CopyRead = GL_COPY_READ_BUFFER, CopyRead CORRADE_DEPRECATED_ENUM("use Buffer::TargetHint::CopyRead instead") = GL_COPY_READ_BUFFER,
/** /**
* @copydoc TargetHint::CopyWrite * @copydoc TargetHint::CopyWrite
* @deprecated For @ref setTargetHint() only, use * @deprecated For @ref setTargetHint() only, use
* @ref TargetHint::CopyWrite instead. * @ref TargetHint::CopyWrite instead.
*/ */
CopyWrite = GL_COPY_WRITE_BUFFER, CopyWrite CORRADE_DEPRECATED_ENUM("use Buffer::TargetHint::CopyWrite instead") = GL_COPY_WRITE_BUFFER,
#endif #endif
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
@ -407,14 +407,14 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* @deprecated For @ref setTargetHint() only, use * @deprecated For @ref setTargetHint() only, use
* @ref TargetHint::DispatchIndirect instead. * @ref TargetHint::DispatchIndirect instead.
*/ */
DispatchIndirect = GL_DISPATCH_INDIRECT_BUFFER, DispatchIndirect CORRADE_DEPRECATED_ENUM("use Buffer::TargetHint::DispatchIndirect instead") = GL_DISPATCH_INDIRECT_BUFFER,
/** /**
* @copydoc TargetHint::DrawIndirect * @copydoc TargetHint::DrawIndirect
* @deprecated For @ref setTargetHint() only, use * @deprecated For @ref setTargetHint() only, use
* @ref TargetHint::DrawIndirect instead. * @ref TargetHint::DrawIndirect instead.
*/ */
DrawIndirect = GL_DRAW_INDIRECT_BUFFER, DrawIndirect CORRADE_DEPRECATED_ENUM("use Buffer::TargetHint::DrawIndirect instead") = GL_DRAW_INDIRECT_BUFFER,
#endif #endif
/** /**
@ -422,7 +422,7 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* @deprecated For @ref setTargetHint() only, use * @deprecated For @ref setTargetHint() only, use
* @ref TargetHint::ElementArray instead. * @ref TargetHint::ElementArray instead.
*/ */
ElementArray = GL_ELEMENT_ARRAY_BUFFER, ElementArray CORRADE_DEPRECATED_ENUM("use Buffer::TargetHint::ElementArray instead") = GL_ELEMENT_ARRAY_BUFFER,
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
/** /**
@ -430,14 +430,14 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* @deprecated For @ref setTargetHint() only, use * @deprecated For @ref setTargetHint() only, use
* @ref TargetHint::PixelPack instead. * @ref TargetHint::PixelPack instead.
*/ */
PixelPack = GL_PIXEL_PACK_BUFFER, PixelPack CORRADE_DEPRECATED_ENUM("use Buffer::TargetHint::PixelPack instead") = GL_PIXEL_PACK_BUFFER,
/** /**
* @copydoc TargetHint::PixelUnpack * @copydoc TargetHint::PixelUnpack
* @deprecated For @ref setTargetHint() only, use * @deprecated For @ref setTargetHint() only, use
* @ref TargetHint::PixelUnpack instead. * @ref TargetHint::PixelUnpack instead.
*/ */
PixelUnpack = GL_PIXEL_UNPACK_BUFFER, PixelUnpack CORRADE_DEPRECATED_ENUM("use Buffer::TargetHint::PixelUnpack instead") = GL_PIXEL_UNPACK_BUFFER,
#endif #endif
#endif #endif
@ -458,7 +458,7 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* @deprecated For @ref setTargetHint() only, use * @deprecated For @ref setTargetHint() only, use
* @ref TargetHint::Texture instead. * @ref TargetHint::Texture instead.
*/ */
Texture = GL_TEXTURE_BUFFER, Texture CORRADE_DEPRECATED_ENUM("use Buffer::TargetHint::Texture instead") = GL_TEXTURE_BUFFER,
#endif #endif
#if defined(MAGNUM_BUILD_DEPRECATED) && !defined(MAGNUM_TARGET_GLES2) #if defined(MAGNUM_BUILD_DEPRECATED) && !defined(MAGNUM_TARGET_GLES2)
@ -467,7 +467,7 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* @deprecated For @ref setTargetHint() only, use * @deprecated For @ref setTargetHint() only, use
* @ref TargetHint::TransformFeedback instead. * @ref TargetHint::TransformFeedback instead.
*/ */
TransformFeedback = GL_TRANSFORM_FEEDBACK_BUFFER, TransformFeedback CORRADE_DEPRECATED_ENUM("use Buffer::TargetHint::TransformFeedback instead") = GL_TRANSFORM_FEEDBACK_BUFFER,
#endif #endif
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2

7
src/Magnum/DebugOutput.cpp

@ -324,11 +324,18 @@ Debug& operator<<(Debug& debug, const DebugMessage::Source value) {
_c(Application) _c(Application)
#undef _c #undef _c
#ifdef MAGNUM_BUILD_DEPRECATED #ifdef MAGNUM_BUILD_DEPRECATED
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
case DebugMessage::Source::Api: case DebugMessage::Source::Api:
case DebugMessage::Source::WindowSystem: case DebugMessage::Source::WindowSystem:
case DebugMessage::Source::ShaderCompiler: case DebugMessage::Source::ShaderCompiler:
case DebugMessage::Source::Other: case DebugMessage::Source::Other:
return debug << DebugOutput::Source(value); return debug << DebugOutput::Source(value);
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#endif #endif
/* LCOV_EXCL_STOP */ /* LCOV_EXCL_STOP */
} }

2
src/Magnum/DebugOutput.h

@ -635,7 +635,7 @@ class MAGNUM_EXPORT DebugMessage {
/** @copybrief DebugOutput::setCallback() /** @copybrief DebugOutput::setCallback()
* @deprecated Use @ref DebugOutput::setCallback() instead. * @deprecated Use @ref DebugOutput::setCallback() instead.
*/ */
CORRADE_DEPRECATED("use DebugOutput::setCallback() instead") static void setCallback(Callback callback, const void* userParam = nullptr) { CORRADE_DEPRECATED("use DebugOutput::setCallback() instead") static void setCallback(DebugOutput::Callback callback, const void* userParam = nullptr) {
DebugOutput::setCallback(reinterpret_cast<DebugOutput::Callback>(callback), userParam); DebugOutput::setCallback(reinterpret_cast<DebugOutput::Callback>(callback), userParam);
} }

Loading…
Cancel
Save