Fixed GCC warnings.

This commit is contained in:
bkaradzic 2013-05-15 21:35:26 -07:00
parent 88162a78cc
commit 45e14926d2
2 changed files with 9 additions and 9 deletions

View file

@ -59,7 +59,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
TrueTypeHandle fontFiles[fontCount]; TrueTypeHandle fontFiles[fontCount];
FontHandle fonts[fontCount]; FontHandle fonts[fontCount];
for (int32_t ii = 0; ii < fontCount; ++ii) for (uint32_t ii = 0; ii < fontCount; ++ii)
{ {
//instantiate a usable font //instantiate a usable font
fontFiles[ii] = fontManager->loadTrueTypeFromFile(fontNames[ii]); fontFiles[ii] = fontManager->loadTrueTypeFromFile(fontNames[ii]);
@ -83,7 +83,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
//the pen position represent the top left of the box of the first line of text //the pen position represent the top left of the box of the first line of text
textBufferManager->setPenPosition(staticText, 24.0f, 100.0f); textBufferManager->setPenPosition(staticText, 24.0f, 100.0f);
for (int32_t ii = 0; ii < fontCount; ++ii) for (uint32_t ii = 0; ii < fontCount; ++ii)
{ {
//add some text to the buffer //add some text to the buffer
textBufferManager->appendText(staticText, fonts[ii], L"The quick brown fox jumps over the lazy dog\n"); textBufferManager->appendText(staticText, fonts[ii], L"The quick brown fox jumps over the lazy dog\n");

View file

@ -278,16 +278,16 @@ void TextBuffer::appendText(FontHandle _fontHandle, const char* _string)
m_lineAscender = 0; //font.m_ascender; m_lineAscender = 0; //font.m_ascender;
} }
uint32_t codepoint; CodePoint_t codepoint = 0;
uint32_t state = 0; uint32_t state = 0;
for (; *_string; ++_string) for (; *_string; ++_string)
{ {
if (!utf8_decode(&state, &codepoint, *_string) ) if (!utf8_decode(&state, (uint32_t*)&codepoint, *_string) )
{ {
if (m_fontManager->getGlyphInfo(_fontHandle, (CodePoint_t)codepoint, glyph) ) if (m_fontManager->getGlyphInfo(_fontHandle, codepoint, glyph) )
{ {
appendGlyph( (CodePoint_t)codepoint, font, glyph); appendGlyph(codepoint, font, glyph);
} }
else else
{ {
@ -296,8 +296,6 @@ void TextBuffer::appendText(FontHandle _fontHandle, const char* _string)
} }
} }
//printf("U+%04X\n", codepoint);
if (state != UTF8_ACCEPT) if (state != UTF8_ACCEPT)
{ {
// assert(false && "The string is not well-formed"); // assert(false && "The string is not well-formed");
@ -558,7 +556,9 @@ void TextBuffer::verticalCenterLastLine(float _dy, float _top, float _bottom)
} }
} }
TextBufferManager::TextBufferManager(FontManager* _fontManager) : m_fontManager(_fontManager), m_textBufferHandles(MAX_TEXT_BUFFER_COUNT) TextBufferManager::TextBufferManager(FontManager* _fontManager)
: m_textBufferHandles(MAX_TEXT_BUFFER_COUNT)
, m_fontManager(_fontManager)
{ {
m_textBuffers = new BufferCache[MAX_TEXT_BUFFER_COUNT]; m_textBuffers = new BufferCache[MAX_TEXT_BUFFER_COUNT];