apps/graphics/nxwidgets: Fixes a few warnnigs.
This commit is contained in:
parent
dee7f14b49
commit
c7da99d6a5
@ -1134,7 +1134,7 @@ bool CMultiLineTextBox::isCursorVisible(void) const
|
||||
|
||||
nxwidget_char_t CMultiLineTextBox::getCursorChar(void) const
|
||||
{
|
||||
if (m_cursorPos < m_text->getLength())
|
||||
if (m_cursorPos < (int)m_text->getLength())
|
||||
{
|
||||
return m_text->getCharAt(m_cursorPos);
|
||||
}
|
||||
|
@ -76,9 +76,9 @@
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <cstring>
|
||||
#include <cstdarg>
|
||||
#include <cstdio>
|
||||
|
||||
#include "graphics/nxwidgets/cnxstring.hxx"
|
||||
#include "graphics/nxwidgets/cstringiterator.hxx"
|
||||
@ -808,7 +808,7 @@ CNxString CNxString::format(const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
size_t len = vsnprintf(nullptr, 0, fmt, args) + 1;
|
||||
size_t len = std::vsnprintf((FAR char *)0, 0, fmt, args) + 1;
|
||||
va_end(args);
|
||||
|
||||
va_start(args, fmt);
|
||||
|
@ -306,7 +306,7 @@ void CTextBox::handleCursorControlEvent(const CWidgetEventArgs &e)
|
||||
}
|
||||
else if (control == CURSOR_RIGHT)
|
||||
{
|
||||
if (m_cursorPos < m_text.getLength())
|
||||
if (m_cursorPos < (int)m_text.getLength())
|
||||
{
|
||||
moveCursorToPosition(m_cursorPos + 1);
|
||||
}
|
||||
@ -572,7 +572,7 @@ const nxgl_coord_t CTextBox::getCursorXPos(void) const
|
||||
|
||||
nxgl_coord_t CTextBox::getCursorWidth(void) const
|
||||
{
|
||||
if (m_cursorPos < m_text.getLength())
|
||||
if (m_cursorPos < (int)m_text.getLength())
|
||||
{
|
||||
// Cursor within the string - get the width of the character
|
||||
|
||||
@ -639,7 +639,7 @@ void CTextBox::calculateTextPositionHorizontal(void)
|
||||
// Text is wider than box - view needs to follow the cursor
|
||||
// If cursor is at the end of the text, we can just right-align
|
||||
|
||||
if (m_cursorPos == m_text.getLength())
|
||||
if (m_cursorPos == (int)m_text.getLength())
|
||||
{
|
||||
m_align.x = width - stringWidth;
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user