From 0a4e5ec94a1e0468c7a263934bd7f198e089c148 Mon Sep 17 00:00:00 2001 From: Steven Noonan Date: Sun, 25 Oct 2009 14:11:28 -0700 Subject: tilefont.{cc,h}: eliminate "array subscript is of type 'char'" warnings Signed-off-by: Steven Noonan --- crawl-ref/source/tilefont.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crawl-ref/source/tilefont.cc') diff --git a/crawl-ref/source/tilefont.cc b/crawl-ref/source/tilefont.cc index 517279f803..d8cec9c22f 100644 --- a/crawl-ref/source/tilefont.cc +++ b/crawl-ref/source/tilefont.cc @@ -478,7 +478,7 @@ unsigned int FTFont::string_width(const char *text) unsigned int width = base_width; unsigned int adjust = 0; - for (const char *itr = text; *itr; itr++) + for (const unsigned char *itr = (unsigned const char *)text; *itr; itr++) { if (*itr == '\n') { @@ -503,7 +503,7 @@ int FTFont::find_index_before_width(const char *text, int max_width) for (int i = 0; text[i]; i++) { - char c = text[i]; + unsigned char c = text[i]; width += m_glyphs[c].advance; int adjust = std::max(0, m_glyphs[c].width - m_glyphs[c].advance); if (width + adjust > max_width) @@ -705,7 +705,7 @@ void FTFont::store(FontBuffer &buf, float &x, float &y, } void FTFont::store(FontBuffer &buf, float &x, float &y, - char c, const VColour &col) + unsigned char c, const VColour &col) { if (!m_glyphs[c].renderable) { -- cgit v1.2.3-54-g00ecf