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, ...@@ -270,7 +270,7 @@ sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
rpStartPos = mpActualPos; rpStartPos = mpActualPos;
sal_Unicode c = peekChar(); sal_Unicode c = peekChar();
if( c == CHAR_EOF ) if( c == 0 )
return sal_False; return sal_False;
getChar(); getChar();
...@@ -331,7 +331,7 @@ sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, ...@@ -331,7 +331,7 @@ sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
{ {
// Remove all characters until end of line or EOF // Remove all characters until end of line or EOF
sal_Unicode cPeek = peekChar(); 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(); c = getChar();
cPeek = peekChar(); cPeek = peekChar();
...@@ -372,7 +372,7 @@ sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, ...@@ -372,7 +372,7 @@ sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
if (cPeekNext=='-') if (cPeekNext=='-')
{ {
// Remove all characters until end of line or EOF // 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(); getChar();
cPeekNext = peekChar(); cPeekNext = peekChar();
...@@ -386,7 +386,7 @@ sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, ...@@ -386,7 +386,7 @@ sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
if (cPeekNext=='/') if (cPeekNext=='/')
{ {
// Remove all characters until end of line or EOF // 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(); getChar();
cPeekNext = peekChar(); cPeekNext = peekChar();
...@@ -403,7 +403,7 @@ sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, ...@@ -403,7 +403,7 @@ sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
// Remove all characters until end of line or EOF // Remove all characters until end of line or EOF
sal_Unicode cPeek = c; sal_Unicode cPeek = c;
while( cPeek != CHAR_EOF && testCharFlags( cPeek, CHAR_EOL ) == sal_False ) while( cPeek != 0 && testCharFlags( cPeek, CHAR_EOL ) == sal_False )
{ {
getChar(); getChar();
cPeek = peekChar(); cPeek = peekChar();
...@@ -497,7 +497,7 @@ sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, ...@@ -497,7 +497,7 @@ sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
while( peekChar() != cEndString ) while( peekChar() != cEndString )
{ {
// Detect EOF before getChar(), so we do not loose EOF // Detect EOF before getChar(), so we do not loose EOF
if( peekChar() == CHAR_EOF ) if( peekChar() == 0 )
{ {
// ERROR: unterminated string literal // ERROR: unterminated string literal
reType = TT_ERROR; reType = TT_ERROR;
...@@ -540,7 +540,7 @@ sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, ...@@ -540,7 +540,7 @@ sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
// All other will remain TT_UNKNOWN // All other will remain TT_UNKNOWN
// Save end position // Save end position
rpEndPos = *mpActualPos == CHAR_EOF ? mpActualPos - 1 : mpActualPos; rpEndPos = *mpActualPos == 0 ? mpActualPos - 1 : mpActualPos;
return sal_True; return sal_True;
} }
......
...@@ -71,9 +71,6 @@ struct HighlightPortion { ...@@ -71,9 +71,6 @@ struct HighlightPortion {
#define CHAR_SPACE 0x0100 #define CHAR_SPACE 0x0100
#define CHAR_EOL 0x0200 #define CHAR_EOL 0x0200
#define CHAR_EOF 0x00
// Language mode of the Highlighter (possibly to be refined later with keyword // Language mode of the Highlighter (possibly to be refined later with keyword
// lists, C comment flags) // lists, C comment flags)
enum HighlighterLanguage 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