From 3173688b7c1a1027257aa057039bd50738ac8bb5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 7 Mar 2016 17:57:21 +0300 Subject: In renderers in function calcTileVertexes add non null attributes. --- src/render/graphics.h | 3 ++- src/render/graphicsdef.hpp | 6 ++++-- src/render/imagegraphics.h | 1 + src/render/mobileopengl2graphics.cpp | 3 --- src/render/mobileopenglgraphics.cpp | 3 --- src/render/modernopenglgraphics.cpp | 3 --- src/render/normalopenglgraphics.cpp | 3 --- src/render/nullopenglgraphics.cpp | 3 --- src/render/sdlgraphics.cpp | 4 ---- src/render/surfacegraphics.h | 1 + 10 files changed, 8 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/render/graphics.h b/src/render/graphics.h index e72f8d1d6..98cfa899e 100644 --- a/src/render/graphics.h +++ b/src/render/graphics.h @@ -210,7 +210,8 @@ class Graphics notfinal virtual void calcTileVertexes(ImageVertexes *restrict const vert, const Image *restrict const image, - int x, int y) const restrict2 = 0; + int x, + int y) const restrict2 A_NONNULL(2, 3) = 0; virtual void calcTileSDL(ImageVertexes *restrict const vert A_UNUSED, int x A_UNUSED, diff --git a/src/render/graphicsdef.hpp b/src/render/graphicsdef.hpp index e7b775ff0..0a4f66317 100644 --- a/src/render/graphicsdef.hpp +++ b/src/render/graphicsdef.hpp @@ -72,7 +72,8 @@ public: void calcTileVertexes(ImageVertexes *restrict const vert, const Image *restrict const image, - int x, int y) const restrict2 override final; + int x, int y) const restrict2 override final + A_NONNULL(2, 3); void calcTileCollection(ImageCollection *restrict const vertCol, const Image *restrict const image, @@ -141,7 +142,8 @@ private: void inline calcTileVertexesInline(ImageVertexes *restrict const vert, const Image *restrict const image, int x, - int y) const restrict2 A_INLINE; + int y) const restrict2 + A_INLINE A_NONNULL(2, 3); void inline drawImageInline(const Image *restrict const image, int dstX, diff --git a/src/render/imagegraphics.h b/src/render/imagegraphics.h index 5e74b766a..53fc22f95 100644 --- a/src/render/imagegraphics.h +++ b/src/render/imagegraphics.h @@ -108,6 +108,7 @@ class ImegeGraphics final : public Graphics const Image *restrict const image A_UNUSED, int x A_UNUSED, int y A_UNUSED) const restrict2 override final + A_NONNULL(2, 3) { } void calcTileSDL(ImageVertexes *restrict const vert A_UNUSED, diff --git a/src/render/mobileopengl2graphics.cpp b/src/render/mobileopengl2graphics.cpp index a1bcd00b0..c1a7e43df 100644 --- a/src/render/mobileopengl2graphics.cpp +++ b/src/render/mobileopengl2graphics.cpp @@ -766,9 +766,6 @@ void MobileOpenGL2Graphics::calcTileVertexesInline(ImageVertexes * int dstX, int dstY) const restrict2 { - if (!vert || !image) - return; - const SDL_Rect &imageRect = image->mBounds; const int w = imageRect.w; const int h = imageRect.h; diff --git a/src/render/mobileopenglgraphics.cpp b/src/render/mobileopenglgraphics.cpp index fb4651409..54f9a408c 100644 --- a/src/render/mobileopenglgraphics.cpp +++ b/src/render/mobileopenglgraphics.cpp @@ -804,9 +804,6 @@ void MobileOpenGLGraphics::calcTileVertexesInline(ImageVertexes * int dstX, int dstY) const restrict2 { - if (!vert || !image) - return; - const SDL_Rect &imageRect = image->mBounds; const int srcX = imageRect.x; const int srcY = imageRect.y; diff --git a/src/render/modernopenglgraphics.cpp b/src/render/modernopenglgraphics.cpp index 6f02f022c..8f3c76ea5 100644 --- a/src/render/modernopenglgraphics.cpp +++ b/src/render/modernopenglgraphics.cpp @@ -756,9 +756,6 @@ void ModernOpenGLGraphics::calcTileVertexesInline(ImageVertexes * int dstX, int dstY) const restrict2 { - if (!vert || !image) - return; - const SDL_Rect &imageRect = image->mBounds; const int srcX = imageRect.x; const int srcY = imageRect.y; diff --git a/src/render/normalopenglgraphics.cpp b/src/render/normalopenglgraphics.cpp index 74ba1d403..c11b4d352 100644 --- a/src/render/normalopenglgraphics.cpp +++ b/src/render/normalopenglgraphics.cpp @@ -1107,9 +1107,6 @@ void NormalOpenGLGraphics::calcTileVertexesInline(ImageVertexes * int dstX, int dstY) const restrict2 { - if (!vert || !image) - return; - const SDL_Rect &imageRect = image->mBounds; const int w = imageRect.w; const int h = imageRect.h; diff --git a/src/render/nullopenglgraphics.cpp b/src/render/nullopenglgraphics.cpp index 592a749a4..9785fb089 100644 --- a/src/render/nullopenglgraphics.cpp +++ b/src/render/nullopenglgraphics.cpp @@ -795,9 +795,6 @@ void NullOpenGLGraphics::calcTileVertexesInline(ImageVertexes * int dstX, int dstY) const restrict2 { - if (!vert || !image) - return; - const SDL_Rect &imageRect = image->mBounds; const int w = imageRect.w; const int h = imageRect.h; diff --git a/src/render/sdlgraphics.cpp b/src/render/sdlgraphics.cpp index 0043d1ccc..01acb5f57 100644 --- a/src/render/sdlgraphics.cpp +++ b/src/render/sdlgraphics.cpp @@ -670,8 +670,6 @@ void SDLGraphics::calcTileVertexes(ImageVertexes *restrict const vert, const Image *restrict const image, int x, int y) const restrict2 { - if (!vert || !image) - return; vert->image = image; calcTileSDL(vert, x, y); } @@ -680,8 +678,6 @@ void SDLGraphics::calcTileVertexesInline(ImageVertexes *restrict const vert, const Image *restrict const image, int x, int y) const restrict2 { - if (!vert || !image) - return; vert->image = image; calcTileSDL(vert, x, y); } diff --git a/src/render/surfacegraphics.h b/src/render/surfacegraphics.h index 8a9a61a3b..d80161a38 100644 --- a/src/render/surfacegraphics.h +++ b/src/render/surfacegraphics.h @@ -110,6 +110,7 @@ class SurfaceGraphics final : public Graphics const Image *restrict const image A_UNUSED, int x A_UNUSED, int y A_UNUSED) const restrict2 override final + A_NONNULL(2, 3) { } void calcTileSDL(ImageVertexes *restrict const vert A_UNUSED, -- cgit v1.2.3-60-g2f50