summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-09-18 22:39:29 +0300
committerAndrei Karas <akaras@inbox.ru>2013-09-18 22:39:29 +0300
commit6419386c4c382753509425826ee609dd07d4ae72 (patch)
treef5f6d54f86a86a21a8145891797a561f5bb8e8d8 /src/utils
parent78744020528ef6231e1606bbe2e8c53011c77935 (diff)
downloadmanaplus-6419386c4c382753509425826ee609dd07d4ae72.tar.gz
manaplus-6419386c4c382753509425826ee609dd07d4ae72.tar.bz2
manaplus-6419386c4c382753509425826ee609dd07d4ae72.tar.xz
manaplus-6419386c4c382753509425826ee609dd07d4ae72.zip
add const to other files.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/base64.cpp2
-rw-r--r--src/utils/physfstools.cpp2
-rw-r--r--src/utils/sdl2helper.cpp2
-rw-r--r--src/utils/sdl2helper.h2
-rw-r--r--src/utils/sdlhelper.cpp15
-rw-r--r--src/utils/sdlhelper.h13
6 files changed, 19 insertions, 17 deletions
diff --git a/src/utils/base64.cpp b/src/utils/base64.cpp
index ebdfcb7c3..4e1061b6e 100644
--- a/src/utils/base64.cpp
+++ b/src/utils/base64.cpp
@@ -42,7 +42,7 @@ static char base64_table[] =
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/', '\0'
};
-static char base64_pad = '=';
+static const char base64_pad = '=';
unsigned char *php3_base64_encode(const unsigned char *const string,
int length, int *const ret_length)
diff --git a/src/utils/physfstools.cpp b/src/utils/physfstools.cpp
index 38f3a408f..cf87fa9ab 100644
--- a/src/utils/physfstools.cpp
+++ b/src/utils/physfstools.cpp
@@ -61,7 +61,7 @@ namespace PhysFs
return PHYSFS_isDirectory(fname);
}
- void freeList(void *listVar)
+ void freeList(void *const listVar)
{
PHYSFS_freeList(listVar);
}
diff --git a/src/utils/sdl2helper.cpp b/src/utils/sdl2helper.cpp
index eb8179a8b..b36fd8733 100644
--- a/src/utils/sdl2helper.cpp
+++ b/src/utils/sdl2helper.cpp
@@ -88,7 +88,7 @@ bool SDL::getWindowWMInfo(SDL_Window *const window, SDL_SysWMinfo *const info)
}
SDL_Thread *SDL::createThread(SDL_ThreadFunction fn,
- const char *name, void *data)
+ const char *const name, void *const data)
{
return SDL_CreateThread(fn, name, data);
}
diff --git a/src/utils/sdl2helper.h b/src/utils/sdl2helper.h
index f8dd40270..869fc1d21 100644
--- a/src/utils/sdl2helper.h
+++ b/src/utils/sdl2helper.h
@@ -49,7 +49,7 @@ namespace SDL
bool getWindowWMInfo(SDL_Window *const window, SDL_SysWMinfo *const info);
SDL_Thread *createThread(SDL_ThreadFunction fn,
- const char *name, void *data);
+ const char *const name, void *const data);
} // namespace SDL
#endif // USE_SDL2
diff --git a/src/utils/sdlhelper.cpp b/src/utils/sdlhelper.cpp
index 691a5238e..0034ee0e8 100644
--- a/src/utils/sdlhelper.cpp
+++ b/src/utils/sdlhelper.cpp
@@ -34,7 +34,7 @@
bool SDL::getAllVideoModes(StringVect &modeList)
{
/* Get available fullscreen/hardware modes */
- SDL_Rect **const modes = SDL_ListModes(nullptr,
+ SDL_Rect *const *const modes = SDL_ListModes(nullptr,
SDL_FULLSCREEN | SDL_HWSURFACE);
/* Check which modes are available */
@@ -62,24 +62,24 @@ bool SDL::getAllVideoModes(StringVect &modeList)
}
}
-void SDL::SetWindowTitle(SDL_Surface *const window A_UNUSED,
+void SDL::SetWindowTitle(const SDL_Surface *const window A_UNUSED,
const char *const title)
{
SDL_WM_SetCaption(title, nullptr);
}
-void SDL::SetWindowIcon(SDL_Surface *const window A_UNUSED,
+void SDL::SetWindowIcon(const SDL_Surface *const window A_UNUSED,
SDL_Surface *const icon)
{
SDL_WM_SetIcon(icon, nullptr);
}
-void SDL::grabInput(SDL_Surface *const window A_UNUSED, const bool grab)
+void SDL::grabInput(const SDL_Surface *const window A_UNUSED, const bool grab)
{
SDL_WM_GrabInput(grab ? SDL_GRAB_ON : SDL_GRAB_OFF);
}
-void SDL::setGamma(SDL_Surface *const window A_UNUSED, const float gamma)
+void SDL::setGamma(const SDL_Surface *const window A_UNUSED, const float gamma)
{
SDL_SetGamma(gamma, gamma, gamma);
}
@@ -89,14 +89,15 @@ void SDL::setVsync(const int val)
SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, val);
}
-bool SDL::getWindowWMInfo(SDL_Surface *const window A_UNUSED,
+bool SDL::getWindowWMInfo(const SDL_Surface *const window A_UNUSED,
SDL_SysWMinfo *const info)
{
return SDL_GetWMInfo(info);
}
SDL_Thread *SDL::createThread(int (SDLCALL *fn)(void *),
- const char *name A_UNUSED, void *data)
+ const char *const name A_UNUSED,
+ void *const data)
{
return SDL_CreateThread(fn, data);
}
diff --git a/src/utils/sdlhelper.h b/src/utils/sdlhelper.h
index 70f266788..29d8241e3 100644
--- a/src/utils/sdlhelper.h
+++ b/src/utils/sdlhelper.h
@@ -38,23 +38,24 @@ namespace SDL
{
bool getAllVideoModes(StringVect &modeList);
- void SetWindowTitle(SDL_Surface *const window,
+ void SetWindowTitle(const SDL_Surface *const window,
const char *const title);
- void SetWindowIcon(SDL_Surface *const window A_UNUSED,
+ void SetWindowIcon(const SDL_Surface *const window A_UNUSED,
SDL_Surface *const icon);
- void grabInput(SDL_Surface *const window A_UNUSED, const bool grab);
+ void grabInput(const SDL_Surface *const window A_UNUSED, const bool grab);
- void setGamma(SDL_Surface *const window A_UNUSED, const float gamma);
+ void setGamma(const SDL_Surface *const window A_UNUSED, const float gamma);
void setVsync(const int val);
- bool getWindowWMInfo(SDL_Surface *const window A_UNUSED,
+ bool getWindowWMInfo(const SDL_Surface *const window A_UNUSED,
SDL_SysWMinfo *const info);
SDL_Thread *createThread(int (SDLCALL *fn)(void *),
- const char *name A_UNUSED, void *data);
+ const char *const name A_UNUSED,
+ void *const data);
} // namespace SDL
#endif // USE_SDL2