aboutsummaryrefslogtreecommitdiff
path: root/backends/fs/windows
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-02-20 15:33:14 +0000
committerTorbjörn Andersson2005-02-20 15:33:14 +0000
commitb1039bb59e76912528dcf1ad439e70f3f1485a50 (patch)
tree36a689f6a95ce4a2a3e56770e94883ab61bd5eda /backends/fs/windows
parent79a04349716a45e01ef4ab89aac9ab1b1ab867aa (diff)
downloadscummvm-rg350-b1039bb59e76912528dcf1ad439e70f3f1485a50.tar.gz
scummvm-rg350-b1039bb59e76912528dcf1ad439e70f3f1485a50.tar.bz2
scummvm-rg350-b1039bb59e76912528dcf1ad439e70f3f1485a50.zip
Fixed warning, hopefully without breaking anything. (GCC doesn't like
casting from "const char *" to "char *".) svn-id: r16826
Diffstat (limited to 'backends/fs/windows')
-rw-r--r--backends/fs/windows/windows-fs.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/backends/fs/windows/windows-fs.cpp b/backends/fs/windows/windows-fs.cpp
index 2ab0d24797..c0fd2031d6 100644
--- a/backends/fs/windows/windows-fs.cpp
+++ b/backends/fs/windows/windows-fs.cpp
@@ -54,7 +54,7 @@ public:
private:
static char *toAscii(TCHAR *x);
- static TCHAR* toUnicode(char *x);
+ static const TCHAR* toUnicode(const char *x);
static void addFile (FSList &list, ListMode mode, const char *base, WIN32_FIND_DATA* find_data);
};
@@ -70,12 +70,11 @@ char* WindowsFilesystemNode::toAscii(TCHAR *x) {
#endif
}
-TCHAR* WindowsFilesystemNode::toUnicode(char *x) {
-
+const TCHAR* WindowsFilesystemNode::toUnicode(const char *x) {
#ifndef UNICODE
- return (TCHAR*)x;
+ return (const TCHAR *)x;
#else
- static TCHAR unicodeString[MAX_PATH];
+ static const TCHAR unicodeString[MAX_PATH];
MultiByteToWideChar(CP_ACP, 0, x, strlen(x) + 1, unicodeString, sizeof(unicodeString));
return unicodeString;
#endif
@@ -150,7 +149,7 @@ WindowsFilesystemNode::WindowsFilesystemNode(const String &p) {
_displayName = String(str + offset, len);
// Check whether it is a directory, and whether the file actually exists
- DWORD fileAttribs = GetFileAttributes(toUnicode((char *)_path.c_str()));
+ DWORD fileAttribs = GetFileAttributes(toUnicode(_path.c_str()));
if (fileAttribs == 0xffffffff) {
_isValid = false;
@@ -199,8 +198,8 @@ FSList WindowsFilesystemNode::listDir(ListMode mode) const {
else {
// Files enumeration
WIN32_FIND_DATA desc;
- HANDLE handle;
- char searchPath[MAX_PATH + 10];
+ HANDLE handle;
+ char searchPath[MAX_PATH + 10];
sprintf(searchPath, "%s*", _path.c_str());