From 81db0022e50e25d922ac7d67d9ec6017b8856f13 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 25 Feb 2012 21:28:51 +0300 Subject: Fix old casts. --- src/utils/physfsrwops.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/utils/physfsrwops.cpp') diff --git a/src/utils/physfsrwops.cpp b/src/utils/physfsrwops.cpp index 1960f0dee..2675b89ae 100644 --- a/src/utils/physfsrwops.cpp +++ b/src/utils/physfsrwops.cpp @@ -29,7 +29,7 @@ static int physfsrwops_seek(SDL_RWops *rw, int offset, int whence) { - PHYSFS_file *handle = (PHYSFS_file *) rw->hidden.unknown.data1; + PHYSFS_file *handle = static_cast(rw->hidden.unknown.data1); int pos = 0; if (whence == SEEK_SET) @@ -46,8 +46,8 @@ static int physfsrwops_seek(SDL_RWops *rw, int offset, int whence) return -1; } /* if */ - pos = (int)current; - if (((PHYSFS_sint64)pos) != current) + pos = static_cast(current); + if (static_cast(pos) != current) { SDL_SetError("Can't fit current file position in an int!"); return -1; @@ -67,8 +67,8 @@ static int physfsrwops_seek(SDL_RWops *rw, int offset, int whence) return -1; } /* if */ - pos = (int)len; - if (((PHYSFS_sint64)pos) != len) + pos = static_cast(len); + if (static_cast(pos) != len) { SDL_SetError("Can't fit end-of-file position in an int!"); return -1; @@ -88,7 +88,7 @@ static int physfsrwops_seek(SDL_RWops *rw, int offset, int whence) return -1; } /* if */ - if (!PHYSFS_seek(handle, (PHYSFS_uint64) pos)) + if (!PHYSFS_seek(handle, static_cast(pos))) { SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError()); return -1; @@ -99,7 +99,7 @@ static int physfsrwops_seek(SDL_RWops *rw, int offset, int whence) static int physfsrwops_read(SDL_RWops *rw, void *ptr, int size, int maxnum) { - PHYSFS_file *handle = (PHYSFS_file*)rw->hidden.unknown.data1; + PHYSFS_file *handle = static_cast(rw->hidden.unknown.data1); PHYSFS_sint64 rc = PHYSFS_read(handle, ptr, size, maxnum); if (rc != maxnum) { @@ -107,22 +107,22 @@ static int physfsrwops_read(SDL_RWops *rw, void *ptr, int size, int maxnum) SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError()); } /* if */ - return (int)rc; + return static_cast(rc); } /* physfsrwops_read */ static int physfsrwops_write(SDL_RWops *rw, const void *ptr, int size, int num) { - PHYSFS_file *handle = (PHYSFS_file*)rw->hidden.unknown.data1; + PHYSFS_file *handle = static_cast(rw->hidden.unknown.data1); PHYSFS_sint64 rc = PHYSFS_write(handle, ptr, size, num); if (rc != num) SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError()); - return (int) rc; + return static_cast(rc); } /* physfsrwops_write */ static int physfsrwops_close(SDL_RWops *rw) { - PHYSFS_file *handle = (PHYSFS_file*)rw->hidden.unknown.data1; + PHYSFS_file *handle = static_cast(rw->hidden.unknown.data1); if (!PHYSFS_close(handle)) { SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError()); -- cgit v1.2.3-70-g09d2 From 8a3adb5dc695fec3f4db5f0705c53687862fb801 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 28 Feb 2012 21:33:08 +0300 Subject: Add some missing debug includes. --- src/gui/widgets/button.cpp | 2 +- src/gui/widgets/setupitem.cpp | 2 ++ src/utils/checkutils.cpp | 2 ++ src/utils/physfsrwops.cpp | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src/utils/physfsrwops.cpp') diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp index 10a64a3d3..b430dfebb 100644 --- a/src/gui/widgets/button.cpp +++ b/src/gui/widgets/button.cpp @@ -447,5 +447,5 @@ void Button::adjustSize() void Button::setCaption(const std::string& caption) { mCaption = caption; - adjustSize(); +// adjustSize(); } diff --git a/src/gui/widgets/setupitem.cpp b/src/gui/widgets/setupitem.cpp index 7c15ea785..b3a018813 100644 --- a/src/gui/widgets/setupitem.cpp +++ b/src/gui/widgets/setupitem.cpp @@ -47,6 +47,8 @@ #include +#include "debug.h" + SetupItem::SetupItem(std::string text, std::string description, std::string keyName, SetupTabScroll *parent, std::string eventName, bool mainConfig) : diff --git a/src/utils/checkutils.cpp b/src/utils/checkutils.cpp index 64bb42d0c..abbc6138a 100644 --- a/src/utils/checkutils.cpp +++ b/src/utils/checkutils.cpp @@ -24,6 +24,8 @@ #include "logger.h" +#include "debug.h" + bool reportFalseReal(bool val, const char* file, unsigned line) { if (!val) diff --git a/src/utils/physfsrwops.cpp b/src/utils/physfsrwops.cpp index 2675b89ae..19b08d4c7 100644 --- a/src/utils/physfsrwops.cpp +++ b/src/utils/physfsrwops.cpp @@ -27,6 +27,8 @@ #include "localconsts.h" +#include "debug.h" + static int physfsrwops_seek(SDL_RWops *rw, int offset, int whence) { PHYSFS_file *handle = static_cast(rw->hidden.unknown.data1); -- cgit v1.2.3-70-g09d2