Kaydet (Commit) 520a67cc authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Make violation of "trailing OUString NUL is impl. detail" more obvious

Change-Id: I4e91b73dc276f984a4fe324c3a80cb94e8df6ee3
üst 8e48edad
......@@ -270,7 +270,7 @@ sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
rpStartPos = mpActualPos;
sal_Unicode c = peekChar();
if( c == CHAR_EOF )
if( c == 0 )
return sal_False;
getChar();
......@@ -331,7 +331,7 @@ sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
{
// Remove all characters until end of line or EOF
sal_Unicode cPeek = peekChar();
while( cPeek != CHAR_EOF && testCharFlags( cPeek, CHAR_EOL ) == sal_False )
while( cPeek != 0 && testCharFlags( cPeek, CHAR_EOL ) == sal_False )
{
c = getChar();
cPeek = peekChar();
......@@ -372,7 +372,7 @@ sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
if (cPeekNext=='-')
{
// Remove all characters until end of line or EOF
while( cPeekNext != CHAR_EOF && testCharFlags( cPeekNext, CHAR_EOL ) == sal_False )
while( cPeekNext != 0 && testCharFlags( cPeekNext, CHAR_EOL ) == sal_False )
{
getChar();
cPeekNext = peekChar();
......@@ -386,7 +386,7 @@ sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
if (cPeekNext=='/')
{
// Remove all characters until end of line or EOF
while( cPeekNext != CHAR_EOF && testCharFlags( cPeekNext, CHAR_EOL ) == sal_False )
while( cPeekNext != 0 && testCharFlags( cPeekNext, CHAR_EOL ) == sal_False )
{
getChar();
cPeekNext = peekChar();
......@@ -403,7 +403,7 @@ sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
// Remove all characters until end of line or EOF
sal_Unicode cPeek = c;
while( cPeek != CHAR_EOF && testCharFlags( cPeek, CHAR_EOL ) == sal_False )
while( cPeek != 0 && testCharFlags( cPeek, CHAR_EOL ) == sal_False )
{
getChar();
cPeek = peekChar();
......@@ -497,7 +497,7 @@ sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
while( peekChar() != cEndString )
{
// Detect EOF before getChar(), so we do not loose EOF
if( peekChar() == CHAR_EOF )
if( peekChar() == 0 )
{
// ERROR: unterminated string literal
reType = TT_ERROR;
......@@ -540,7 +540,7 @@ sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
// All other will remain TT_UNKNOWN
// Save end position
rpEndPos = *mpActualPos == CHAR_EOF ? mpActualPos - 1 : mpActualPos;
rpEndPos = *mpActualPos == 0 ? mpActualPos - 1 : mpActualPos;
return sal_True;
}
......
......@@ -71,9 +71,6 @@ struct HighlightPortion {
#define CHAR_SPACE 0x0100
#define CHAR_EOL 0x0200
#define CHAR_EOF 0x00
// Language mode of the Highlighter (possibly to be refined later with keyword
// lists, C comment flags)
enum HighlighterLanguage
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment