Fix sign-compare warning

This commit is contained in:
Maarten Bent
2020-12-22 15:44:24 +01:00
parent da455f3c0b
commit e889924bc1
6 changed files with 13 additions and 13 deletions

View File

@@ -464,14 +464,14 @@ bool wxChmInputStream::Eof() const
return (m_content==NULL ||
m_contentStream==NULL ||
m_contentStream->Eof() ||
m_pos>m_size);
(size_t)m_pos>m_size);
}
size_t wxChmInputStream::OnSysRead(void *buffer, size_t bufsize)
{
if ( m_pos >= m_size )
if ( (size_t)m_pos >= m_size )
{
m_lasterror = wxSTREAM_EOF;
return 0;

View File

@@ -419,7 +419,7 @@ int wxFileDialog::ShowModal()
m_firstFileTypeFilter = -1;
if ( m_useFileTypeFilter
&& m_filterIndex >= 0 && m_filterIndex < m_filterExtensions.GetCount() )
&& m_filterIndex >= 0 && (size_t)m_filterIndex < m_filterExtensions.GetCount() )
{
m_firstFileTypeFilter = m_filterIndex;
}

View File

@@ -87,7 +87,7 @@ WXGLPixelFormat WXGLChoosePixelFormat(const int *GLAttrs,
if ( GLAttrs && n1 > 1 )
{
n1--; // skip the ending '0'
while ( p < n1 )
while ( p < (unsigned)n1 )
{
data[p] = (NSOpenGLPixelFormatAttribute) GLAttrs[p];
p++;
@@ -98,7 +98,7 @@ WXGLPixelFormat WXGLChoosePixelFormat(const int *GLAttrs,
{
n2--; // skip the ending '0'
unsigned p2 = 0;
while ( p2 < n2 )
while ( p2 < (unsigned)n2 )
data[p++] = (NSOpenGLPixelFormatAttribute) ctxAttrs[p2++];
}

View File

@@ -316,7 +316,7 @@ void* wxMessageDialog::ConstructNSAlert()
m_buttonId[ m_buttonCount++ ] = wxID_HELP;
}
wxASSERT_MSG( m_buttonCount <= WXSIZEOF(m_buttonId), "Too many buttons" );
wxASSERT_MSG( m_buttonCount <= (int)WXSIZEOF(m_buttonId), "Too many buttons" );
return alert;
}

View File

@@ -168,7 +168,7 @@ NSView* wxMacEditHelper::ms_viewCurrentlyEdited = nil;
if ( maxLength > 0 )
{
if ( [*partialStringPtr length] > maxLength )
if ( [*partialStringPtr length] > (unsigned)maxLength )
{
field->SendMaxLenEvent();
return NO;
@@ -909,7 +909,7 @@ bool wxNSTextViewControl::PositionToXY(long pos, long *x, long *y) const
wxCHECK_MSG( pos >= 0, false, wxS("Invalid character position") );
NSString* txt = [m_textView string];
if ( pos > [txt length] )
if ( (unsigned)pos > [txt length] )
return false;
// Last valid position is past the last character
@@ -987,7 +987,7 @@ long wxNSTextViewControl::XYToPosition(long x, long y) const
// Return error if given x position
// is past the line.
if ( x >= lineRng.length )
if ( (unsigned)x >= lineRng.length )
return -1;
return lineRng.location + x;
@@ -1452,7 +1452,7 @@ bool wxNSTextFieldControl::PositionToXY(long pos, long *x, long *y) const
{
wxCHECK_MSG( pos >= 0, false, wxS("Invalid character position") );
if ( pos > [[m_textField stringValue] length] )
if ( (unsigned)pos > [[m_textField stringValue] length] )
return false;
if ( y )
@@ -1469,7 +1469,7 @@ long wxNSTextFieldControl::XYToPosition(long x, long y) const
wxCHECK_MSG( x >= 0 && y >= 0, -1, wxS("Invalid line/column number") );
// Last valid position is after the last character.
if ( y != 0 || x > [[m_textField stringValue] length] )
if ( y != 0 || (unsigned)x > [[m_textField stringValue] length] )
return -1;
return x;

View File

@@ -2025,7 +2025,7 @@ void wxCocoaGesturesImpl::TouchesMoved(NSEvent* event)
// Iterate through all moving touches to check if the touch corresponding to "press"
// in Press and Tap event is moving.
for ( int i = 0; i < [array count]; ++i )
for ( unsigned i = 0; i < [array count]; ++i )
{
NSTouch* touch = [array objectAtIndex:i];
@@ -2108,7 +2108,7 @@ void wxCocoaGesturesImpl::TouchesEnded(NSEvent* event)
bool isPressTouch = false;
// Iterate through all ended touches
for( int i = 0; i < [array count]; ++i )
for( unsigned i = 0; i < [array count]; ++i )
{
NSTouch* touch = [array objectAtIndex:i];