TextGapBuffer: Style changes
Change long to int32 Removed useless parenthesis
This commit is contained in:
@@ -112,8 +112,8 @@ TextGapBuffer::InsertText(BFile* file, int32 fileOffset, int32 inNumItems,
|
|||||||
void
|
void
|
||||||
TextGapBuffer::RemoveRange(int32 start, int32 end)
|
TextGapBuffer::RemoveRange(int32 start, int32 end)
|
||||||
{
|
{
|
||||||
long inAtIndex = start;
|
int32 inAtIndex = start;
|
||||||
long inNumItems = end - start;
|
int32 inNumItems = end - start;
|
||||||
|
|
||||||
if (inNumItems < 1)
|
if (inNumItems < 1)
|
||||||
return;
|
return;
|
||||||
@@ -142,8 +142,8 @@ TextGapBuffer::GetString(int32 fromOffset, int32* _numBytes)
|
|||||||
if (numBytes < 1)
|
if (numBytes < 1)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
bool isStartBeforeGap = (fromOffset < fGapIndex);
|
bool isStartBeforeGap = fromOffset < fGapIndex;
|
||||||
bool isEndBeforeGap = ((fromOffset + numBytes - 1) < fGapIndex);
|
bool isEndBeforeGap = (fromOffset + numBytes - 1) < fGapIndex;
|
||||||
|
|
||||||
if (isStartBeforeGap == isEndBeforeGap) {
|
if (isStartBeforeGap == isEndBeforeGap) {
|
||||||
result = fBuffer + fromOffset;
|
result = fBuffer + fromOffset;
|
||||||
@@ -155,7 +155,7 @@ TextGapBuffer::GetString(int32 fromOffset, int32* _numBytes)
|
|||||||
fScratchSize = numBytes;
|
fScratchSize = numBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (long i = 0; i < numBytes; i++)
|
for (int32 i = 0; i < numBytes; i++)
|
||||||
fScratchBuffer[i] = RealCharAt(fromOffset + i);
|
fScratchBuffer[i] = RealCharAt(fromOffset + i);
|
||||||
|
|
||||||
result = fScratchBuffer;
|
result = fScratchBuffer;
|
||||||
@@ -190,8 +190,8 @@ TextGapBuffer::GetString(int32 fromOffset, int32* _numBytes)
|
|||||||
bool
|
bool
|
||||||
TextGapBuffer::FindChar(char inChar, int32 fromIndex, int32* ioDelta)
|
TextGapBuffer::FindChar(char inChar, int32 fromIndex, int32* ioDelta)
|
||||||
{
|
{
|
||||||
long numChars = *ioDelta;
|
int32 numChars = *ioDelta;
|
||||||
for (long i = 0; i < numChars; i++) {
|
for (int32 i = 0; i < numChars; i++) {
|
||||||
char realChar = RealCharAt(fromIndex + i);
|
char realChar = RealCharAt(fromIndex + i);
|
||||||
if ((realChar & 0xc0) == 0x80)
|
if ((realChar & 0xc0) == 0x80)
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user