Skip to content

Commit

Permalink
avoid compiler warning
Browse files Browse the repository at this point in the history
  • Loading branch information
rfm committed Nov 23, 2023
1 parent d22abee commit c1c17df
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions Source/GSString.m
Original file line number Diff line number Diff line change
Expand Up @@ -306,26 +306,29 @@ static BOOL isByteEncoding(NSStringEncoding enc)
{
return NO;
}
size_t end = s->nxcslen;
static const int buffer_size = 64;
unichar buffer1[buffer_size];
unichar buffer2[buffer_size];
NSRange r = { 0, buffer_size };
do
{
if (r.location + r.length > end)
{
r.length = s->nxcslen - r.location;
}
[s getCharacters: buffer1 range: r];
[o getCharacters: buffer2 range: r];
if (memcmp(buffer1, buffer2, r.length * sizeof(unichar)) != 0)
else
{
size_t end = s->nxcslen;
static const int buffer_size = 64;
unichar buffer1[buffer_size];
unichar buffer2[buffer_size];
NSRange r = { 0, buffer_size };
do
{
return NO;
}
r.location += buffer_size;
} while (r.location < end);
return YES;
if (r.location + r.length > end)
{
r.length = s->nxcslen - r.location;
}
[s getCharacters: buffer1 range: r];
[o getCharacters: buffer2 range: r];
if (memcmp(buffer1, buffer2, r.length * sizeof(unichar)) != 0)
{
return NO;
}
r.location += buffer_size;
} while (r.location < end);
return YES;
}
#else
unsigned len = o->_count;

Expand Down

0 comments on commit c1c17df

Please sign in to comment.