From 45a26a45975210bdc0aa7f6ac41c194d9c8431ab Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Thu, 21 Oct 2010 15:55:12 +0000 Subject: [PATCH] - cleaned up more compiler warnings - added unsigned 64 bit type for windows --- source/glest_map_editor/map.cpp | 6 +++--- source/shared_lib/include/platform/win32/types.h | 1 + source/shared_lib/sources/xml/xml_parser.cpp | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/source/glest_map_editor/map.cpp b/source/glest_map_editor/map.cpp index 677d497a..d4efd237 100644 --- a/source/glest_map_editor/map.cpp +++ b/source/glest_map_editor/map.cpp @@ -142,8 +142,8 @@ void Map::pirateChangeHeight(int x, int y, int height, int radius) { // round off the corners int ti, tj; if (abs(i - x) == abs(j - y)) { - ti = (i - x) * 0.707 + x + 0.5; - tj = (j - y) * 0.707 + y + 0.5; + ti = (int)((i - x) * 0.707 + x + 0.5); + tj = (int)((j - y) * 0.707 + y + 0.5); } else { ti = i; tj = j; @@ -154,7 +154,7 @@ void Map::pirateChangeHeight(int x, int y, int height, int radius) { //gradient[indexI][indexJ] = 0; } else { // assume outside the map bounds is height 10 - gradient[indexI][indexJ] = (10.0 - goalAlt) / radius; + gradient[indexI][indexJ] = (10.0f - (float)goalAlt) / (float)radius; } //std::cout << "gradient[" << indexI << "][" << indexJ << "] = " << gradient[indexI][indexJ] << std::endl; //std::cout << "derived from height " << cells[ti][tj].height << " at " << ti << " " << tj << std::endl; diff --git a/source/shared_lib/include/platform/win32/types.h b/source/shared_lib/include/platform/win32/types.h index c796f17d..e92380a7 100644 --- a/source/shared_lib/include/platform/win32/types.h +++ b/source/shared_lib/include/platform/win32/types.h @@ -31,6 +31,7 @@ typedef unsigned short int uint16; typedef int int32; typedef unsigned int uint32; typedef long long int64; +typedef unsigned long long uint64; }}//end namespace diff --git a/source/shared_lib/sources/xml/xml_parser.cpp b/source/shared_lib/sources/xml/xml_parser.cpp index 07dbee37..0094b129 100644 --- a/source/shared_lib/sources/xml/xml_parser.cpp +++ b/source/shared_lib/sources/xml/xml_parser.cpp @@ -19,6 +19,7 @@ #include #include #include "util.h" +#include "types.h" #include "leak_dumper.h" @@ -41,7 +42,7 @@ public: char msgStr[strSize], fileStr[strSize]; XMLString::transcode(domError.getMessage(), msgStr, strSize-1); XMLString::transcode(domError.getLocation()->getURI(), fileStr, strSize-1); - uint64 lineNumber= domError.getLocation()->getLineNumber(); + Shared::Platform::uint64 lineNumber= domError.getLocation()->getLineNumber(); throw runtime_error("Error parsing XML, file: " + string(fileStr) + ", line: " + intToStr(lineNumber) + ": " + string(msgStr)); } return true;