From fbb008a5185a002c89c2ce3c3b1cf15042635d91 Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Thu, 11 Feb 2021 21:24:11 +0330 Subject: [PATCH 06/11] stoll --- Source/LexerParser/cmCTestResourceGroupsLexer.cxx | 4 ++-- Source/LexerParser/cmCTestResourceGroupsLexer.in.l | 4 ++-- Source/LexerParser/cmExprLexer.cxx | 4 ++-- Source/LexerParser/cmExprLexer.in.l | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/LexerParser/cmCTestResourceGroupsLexer.cxx b/Source/LexerParser/cmCTestResourceGroupsLexer.cxx index de07c46..3f59b61 100644 --- a/Source/LexerParser/cmCTestResourceGroupsLexer.cxx +++ b/Source/LexerParser/cmCTestResourceGroupsLexer.cxx @@ -992,14 +992,14 @@ YY_RULE_SETUP { BEGIN(RESOURCE_GROUPS_END); - std::size_t len = yyleng; - yyextra->SetProcessCount(std::stoll(yytext, &len, 10)); + char* end = nullptr; + yyextra->SetProcessCount(strtoll(yytext, &end, 10)); } YY_BREAK case 3: YY_RULE_SETUP { BEGIN(RESOURCE_END); - std::size_t len = yyleng; - yyextra->SetNeededSlots(std::stoll(yytext, &len, 10)); + char* end = nullptr; + yyextra->SetNeededSlots(strtoll(yytext, &end, 10)); yyextra->WriteRequirement(); } diff --git a/Source/LexerParser/cmCTestResourceGroupsLexer.in.l b/Source/LexerParser/cmCTestResourceGroupsLexer.in.l index 2aabea4..ca5f3e5 100644 --- a/Source/LexerParser/cmCTestResourceGroupsLexer.in.l +++ b/Source/LexerParser/cmCTestResourceGroupsLexer.in.l @@ -55,13 +55,13 @@ IDENTIFIER [a-z_][a-z0-9_]* {NUMBER} { BEGIN(RESOURCE_GROUPS_END); - std::size_t len = yyleng; - yyextra->SetProcessCount(std::stoll(yytext, &len, 10)); + char* end = nullptr; + yyextra->SetNeededSlots(strtoll(yytext, &end, 10)); } {NUMBER} { BEGIN(RESOURCE_END); - std::size_t len = yyleng; - yyextra->SetNeededSlots(std::stoll(yytext, &len, 10)); + char* end = nullptr; + yyextra->SetNeededSlots(strtoll(yytext, &end, 10)); yyextra->WriteRequirement(); } diff --git a/Source/LexerParser/cmExprLexer.cxx b/Source/LexerParser/cmExprLexer.cxx index 72e59b6..6b743e0 100644 --- a/Source/LexerParser/cmExprLexer.cxx +++ b/Source/LexerParser/cmExprLexer.cxx @@ -992,11 +992,11 @@ YY_RULE_SETUP YY_BREAK case 2: YY_RULE_SETUP -{ yylvalp->Number = std::stoll(yytext, nullptr, 10); return exp_NUMBER; } +{ yylvalp->Number = strtoll(yytext, nullptr, 10); return exp_NUMBER; } YY_BREAK case 3: YY_RULE_SETUP -{ yylvalp->Number = std::stoll(yytext, nullptr, 16); return exp_NUMBER; } +{ yylvalp->Number = strtoll(yytext, nullptr, 16); return exp_NUMBER; } YY_BREAK case 4: YY_RULE_SETUP diff --git a/Source/LexerParser/cmExprLexer.in.l b/Source/LexerParser/cmExprLexer.in.l index f8a4224..822aaf5 100644 --- a/Source/LexerParser/cmExprLexer.in.l +++ b/Source/LexerParser/cmExprLexer.in.l @@ -44,8 +44,8 @@ Modify cmExprLexer.cxx: %% [ \t] {} -[0-9][0-9]* { yylvalp->Number = std::stoll(yytext, nullptr, 10); return exp_NUMBER; } -0[xX][0-9a-fA-F][0-9a-fA-F]* { yylvalp->Number = std::stoll(yytext, nullptr, 16); return exp_NUMBER; } +[0-9][0-9]* { yylvalp->Number = strtoll(yytext, nullptr, 10); return exp_NUMBER; } +0[xX][0-9a-fA-F][0-9a-fA-F]* { yylvalp->Number = strtoll(yytext, nullptr, 16); return exp_NUMBER; } "+" { return exp_PLUS; } "-" { return exp_MINUS; } -- 2.30.1