From 0ab2f39e45b4fba5a196555d5366f90c06a34771 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 23 Mar 2017 07:32:58 +0100 Subject: Use rtl::isAscii* instead of ctype.h is* (and fix passing plain char) Change-Id: Ie37f15379b0e10912ef2e0ac94249da11040eede --- idl/source/cmptools/lex.cxx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/idl/source/cmptools/lex.cxx b/idl/source/cmptools/lex.cxx index 482eaf6293c5..d5e1d943fa6e 100644 --- a/idl/source/cmptools/lex.cxx +++ b/idl/source/cmptools/lex.cxx @@ -166,9 +166,9 @@ sal_uLong SvTokenStream::GetNumber() if( nLog == 16 ) { - while( isxdigit( c ) ) + while( rtl::isAsciiHexDigit( static_cast(c) ) ) { - if( isdigit( c ) ) + if( rtl::isAsciiDigit( static_cast(c) ) ) l = l * nLog + (c - '0'); else l = l * nLog @@ -179,7 +179,7 @@ sal_uLong SvTokenStream::GetNumber() } else { - while( isdigit( c ) || 'x' == c ) + while( rtl::isAsciiDigit( static_cast(c) ) || 'x' == c ) { l = l * nLog + (c - '0'); c = GetFastNextChar(); @@ -196,7 +196,8 @@ bool SvTokenStream::MakeToken( SvToken & rToken ) if( 0 == c ) c = GetNextChar(); // skip whitespace - while( isspace( c ) || 26 == c ) + while( rtl::isAsciiWhiteSpace( static_cast(c) ) + || 26 == c ) { c = GetFastNextChar(); nColumn += c == '\t' ? nTabSize : 1; @@ -280,16 +281,17 @@ bool SvTokenStream::MakeToken( SvToken & rToken ) rToken.nType = SVTOKENTYPE::String; rToken.aString = aStr.makeStringAndClear(); } - else if( isdigit( c ) ) + else if( rtl::isAsciiDigit( static_cast(c) ) ) { rToken.nType = SVTOKENTYPE::Integer; rToken.nLong = GetNumber(); } - else if( isalpha (c) || (c == '_') ) + else if( rtl::isAsciiAlpha (static_cast(c)) || (c == '_') ) { OStringBuffer aBuf; - while( isalnum( c ) || c == '_' ) + while( rtl::isAsciiAlphanumeric( static_cast(c) ) + || c == '_' ) { aBuf.append(c); c = GetFastNextChar(); -- cgit