From 1498a699f89f7b5aebdc4629c645c3702ee04f92 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 24 Jun 2015 01:13:26 +0300 Subject: Add A_NONNULL attribute to all parameters with class Graphics. --- src/resources/map/map.h | 14 +++++++++----- src/resources/map/mapitem.h | 5 +++-- src/resources/map/maplayer.h | 41 ++++++++++++++++++++++++++-------------- src/resources/map/speciallayer.h | 5 +++-- 4 files changed, 42 insertions(+), 23 deletions(-) (limited to 'src/resources/map') diff --git a/src/resources/map/map.h b/src/resources/map/map.h index 28bf9c4b2..4553f5aa8 100644 --- a/src/resources/map/map.h +++ b/src/resources/map/map.h @@ -109,14 +109,17 @@ class Map final : public Properties, public ConfigListener * the clipping rectangle set on the Graphics object. However, * currently the map is always drawn full-screen. */ - void draw(Graphics *const graphics, int scrollX, int scrollY); + void draw(Graphics *const graphics, + int scrollX, + int scrollY) A_NONNULL(2); /** * Visualizes collision layer for debugging */ void drawCollision(Graphics *const graphics, - const int scrollX, const int scrollY, - const MapTypeT drawFlags) const; + const int scrollX, + const int scrollY, + const MapTypeT drawFlags) const A_NONNULL(2); /** * Adds a layer to this map. The map takes ownership of the layer. @@ -357,8 +360,9 @@ class Map final : public Properties, public ConfigListener /** * Draws the foreground or background layers to the given graphics output. */ - void drawAmbientLayers(Graphics *const graphics, const LayerType type, - const int detail) const; + void drawAmbientLayers(Graphics *const graphics, + const LayerType type, + const int detail) const A_NONNULL(2); /** * Tells whether the given coordinates fall within the map boundaries. diff --git a/src/resources/map/mapitem.h b/src/resources/map/mapitem.h index e9203e564..4fd84320f 100644 --- a/src/resources/map/mapitem.h +++ b/src/resources/map/mapitem.h @@ -71,8 +71,9 @@ class MapItem final void setName(const std::string &name) { mName = name; } - void draw(Graphics *const graphics, const int x, const int y, - const int dx, const int dy) const; + void draw(Graphics *const graphics, + const int x, const int y, + const int dx, const int dy) const A_NONNULL(2); private: Image *mImage; diff --git a/src/resources/map/maplayer.h b/src/resources/map/maplayer.h index 4cf30ade1..6588e0303 100644 --- a/src/resources/map/maplayer.h +++ b/src/resources/map/maplayer.h @@ -87,30 +87,43 @@ class MapLayer final: public ConfigListener * layer. */ void draw(Graphics *const graphics, - int startX, int startY, int endX, int endY, - const int scrollX, const int scrollY) const; + int startX, + int startY, + int endX, + int endY, + const int scrollX, + const int scrollY) const A_NONNULL(2); - void drawSDL(Graphics *const graphics) const; + void drawSDL(Graphics *const graphics) const A_NONNULL(2); #ifdef USE_OPENGL - void drawOGL(Graphics *const graphics) const; + void drawOGL(Graphics *const graphics) const A_NONNULL(2); void updateOGL(Graphics *const graphics, - int startX, int startY, - int endX, int endY, - const int scrollX, const int scrollY); + int startX, + int startY, + int endX, + int endY, + const int scrollX, + const int scrollY) A_NONNULL(2); #endif void updateSDL(const Graphics *const graphics, - int startX, int startY, - int endX, int endY, - const int scrollX, const int scrollY); + int startX, + int startY, + int endX, + int endY, + const int scrollX, + const int scrollY) A_NONNULL(2); void drawFringe(Graphics *const graphics, - int startX, int startY, - int endX, int endY, - const int scrollX, const int scrollY, - const Actors *const actors) const; + int startX, + int startY, + int endX, + int endY, + const int scrollX, + const int scrollY, + const Actors *const actors) const A_NONNULL(2); bool isFringeLayer() const A_WARN_UNUSED { return mIsFringeLayer; } diff --git a/src/resources/map/speciallayer.h b/src/resources/map/speciallayer.h index 518f23bcf..13a75a9d5 100644 --- a/src/resources/map/speciallayer.h +++ b/src/resources/map/speciallayer.h @@ -40,9 +40,10 @@ class SpecialLayer final ~SpecialLayer(); - void draw(Graphics *const graphics, int startX, int startY, + void draw(Graphics *const graphics, + int startX, int startY, int endX, int endY, - const int scrollX, const int scrollY) const; + const int scrollX, const int scrollY) const A_NONNULL(2); MapItem* getTile(const int x, const int y) const A_WARN_UNUSED; -- cgit v1.2.3-70-g09d2