From 90132a83c309b5ae0c699e4fbbb7c62656321301 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 23 Jun 2017 21:29:47 +0300 Subject: Fix code style. --- src/resources/iteminfo.cpp | 3 +-- src/resources/sdlgfxblitfunc.cpp | 19 ++++++++++--------- src/resources/sdlgfxblitfunc.h | 4 ++-- src/resources/sdlmusic.cpp | 3 ++- src/resources/sdlmusic.h | 3 ++- 5 files changed, 17 insertions(+), 15 deletions(-) (limited to 'src/resources') diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp index 8a142ec4d..6c8840f75 100644 --- a/src/resources/iteminfo.cpp +++ b/src/resources/iteminfo.cpp @@ -31,10 +31,9 @@ #include "resources/db/colordb.h" #include "resources/db/itemdb.h" -#include "configuration.h" - #include "utils/checkutils.h" #include "utils/dtor.h" +#include "utils/stringutils.h" #include "debug.h" diff --git a/src/resources/sdlgfxblitfunc.cpp b/src/resources/sdlgfxblitfunc.cpp index d7bc956f2..97a6e7bc4 100644 --- a/src/resources/sdlgfxblitfunc.cpp +++ b/src/resources/sdlgfxblitfunc.cpp @@ -332,7 +332,7 @@ namespace }; } // namespace -static void _SDL_gfxBlitBlitterRGBA(SDL_gfxBlitInfo *info) +static void _SDL_gfxBlitBlitterRGBA(const SDL_gfxBlitInfo *const info) { const int width = info->d_width; int height = info->d_height; @@ -388,10 +388,10 @@ static void _SDL_gfxBlitBlitterRGBA(SDL_gfxBlitInfo *info) } } -static int _SDL_gfxBlitRGBACall(SDL_Surface *const src, - SDL_Rect *const srcrect, - SDL_Surface *const dst, - SDL_Rect *const dstrect) +static int _SDL_gfxBlitRGBACall(const SDL_Surface *const src, + const SDL_Rect *const srcrect, + const SDL_Surface *const dst, + const SDL_Rect *const dstrect) { /* * Set up source and destination buffer pointers, then blit @@ -433,9 +433,9 @@ static int _SDL_gfxBlitRGBACall(SDL_Surface *const src, } int SDLgfxBlitRGBA(SDL_Surface *const src, - SDL_Rect *const srcrect, + const SDL_Rect *const srcrect, SDL_Surface *const dst, - SDL_Rect *const dstrect) + const SDL_Rect *const dstrect) { SDL_Rect sr; SDL_Rect dr; @@ -447,7 +447,8 @@ int SDLgfxBlitRGBA(SDL_Surface *const src, /* * Make sure the surfaces aren't locked */ - if ((src == nullptr) || (dst == nullptr)) + if (src == nullptr || + dst == nullptr) { reportAlways("SDLgfxBlitRGBA: passed a NULL surface"); return -1; @@ -499,7 +500,7 @@ int SDLgfxBlitRGBA(SDL_Surface *const src, /* * Clip the destination rectangle against the clip rectangle */ - SDL_Rect *clip = &dst->clip_rect; + const SDL_Rect *const clip = &dst->clip_rect; int dx; int dy; diff --git a/src/resources/sdlgfxblitfunc.h b/src/resources/sdlgfxblitfunc.h index 5060e3552..77a0d1e42 100644 --- a/src/resources/sdlgfxblitfunc.h +++ b/src/resources/sdlgfxblitfunc.h @@ -35,8 +35,8 @@ struct SDL_Rect; // src surface can be any format (most time 32 bit surface with any masks) // dst surface always correct 32 sufraces (shared format for all) int SDLgfxBlitRGBA(SDL_Surface *const src, - SDL_Rect *const srcrect, + const SDL_Rect *const srcrect, SDL_Surface *const dst, - SDL_Rect *const dstrect); + const SDL_Rect *const dstrect); #endif // RESOURCE_SDLGFXBLITFUNC_H diff --git a/src/resources/sdlmusic.cpp b/src/resources/sdlmusic.cpp index 4d604c8cb..d3801d453 100644 --- a/src/resources/sdlmusic.cpp +++ b/src/resources/sdlmusic.cpp @@ -57,7 +57,8 @@ SDLMusic::~SDLMusic() #endif // USE_SDL2 } -bool SDLMusic::play(const int loops, const int fadeIn) +bool SDLMusic::play(const int loops, + const int fadeIn) const { if (fadeIn > 0) return Mix_FadeInMusicPos(mMusic, loops, fadeIn, 0.0) != 0; diff --git a/src/resources/sdlmusic.h b/src/resources/sdlmusic.h index 44262b840..70614c420 100644 --- a/src/resources/sdlmusic.h +++ b/src/resources/sdlmusic.h @@ -66,7 +66,8 @@ class SDLMusic final : public Resource * @return true if the playback started properly * false otherwise. */ - bool play(const int loops = -1, const int fadeIn = 0); + bool play(const int loops = -1, + const int fadeIn = 0) const; int calcMemoryLocal() const override final; -- cgit v1.2.3-60-g2f50