summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/format.cc
diff options
context:
space:
mode:
authorHaran Pilpel <haranp@users.sourceforge.net>2010-01-28 08:51:05 +0200
committerHaran Pilpel <haranp@users.sourceforge.net>2010-01-29 16:43:46 +0200
commit5f6162a4a0661e62e2426960d4cb5380a0b749d8 (patch)
tree7a662e7f90c4744bb6ba7bf0559bc934ff196fa4 /crawl-ref/source/format.cc
parent721a4e7bc5152fae1ce7c16ec7b6c25283defa18 (diff)
downloadcrawl-ref-5f6162a4a0661e62e2426960d4cb5380a0b749d8.tar.gz
crawl-ref-5f6162a4a0661e62e2426960d4cb5380a0b749d8.zip
Nuke a whole lot of old-style casts, and remove some casts completely
(you don't need to cast an X* to a void* and you don't need to cast arguments to math.h functions such as sqrt.)
Diffstat (limited to 'crawl-ref/source/format.cc')
-rw-r--r--crawl-ref/source/format.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/crawl-ref/source/format.cc b/crawl-ref/source/format.cc
index 34b0f46439..9c1e02cf81 100644
--- a/crawl-ref/source/format.cc
+++ b/crawl-ref/source/format.cc
@@ -3,6 +3,8 @@
* Created by: haranp on Sat Feb 17 13:35:54 2007 UTC
*/
+#include <limits.h>
+
#include "AppHdr.h"
#include "colour.h"
@@ -436,7 +438,7 @@ int formatted_string::find_last_colour() const
formatted_string formatted_string::substr(size_t start, size_t substr_length) const
{
- const unsigned int NONE = (unsigned int)-1;
+ const unsigned int NONE = UINT_MAX; // from limits.h
unsigned int last_FSOP_COLOUR = NONE;
unsigned int last_FSOP_CURSOR = NONE;