mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0032908: Coding Rules - fix E0349 MSVC compilation error on VS2019/C++20
Get rid of raw C strings in error code to avoid error 0349. Use std::string instead.
This commit is contained in:
parent
1966e6af07
commit
73035770f6
@ -40,7 +40,8 @@
|
|||||||
#include <XSDRAW.hxx>
|
#include <XSDRAW.hxx>
|
||||||
#include <XSDRAW_Vars.hxx>
|
#include <XSDRAW_Vars.hxx>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
//#include <XSDRAW_Shape.hxx>
|
//#include <XSDRAW_Shape.hxx>
|
||||||
static int deja = 0, dejald = 0;
|
static int deja = 0, dejald = 0;
|
||||||
//unused variable
|
//unused variable
|
||||||
@ -256,16 +257,23 @@ void XSDRAW::LoadDraw (Draw_Interpretor& theCommands)
|
|||||||
Handle(TColStd_HSequenceOfTransient) XSDRAW::GetList
|
Handle(TColStd_HSequenceOfTransient) XSDRAW::GetList
|
||||||
(const Standard_CString first, const Standard_CString second)
|
(const Standard_CString first, const Standard_CString second)
|
||||||
{
|
{
|
||||||
Handle(TColStd_HSequenceOfTransient) list;
|
if ( !first || first[0] == '\0' )
|
||||||
if (!first || first[0] == '\0') {
|
{
|
||||||
char ligne[80]; ligne[0] = '\0'; char truc;
|
std::string aLineFirst;
|
||||||
// std::cin.clear(); std::cin.get (ligne,79,'\n');
|
std::cin >> aLineFirst;
|
||||||
std::cin >> ligne; Standard_Size ln = strlen(ligne);
|
|
||||||
char *ff = &ligne[0], *ss = NULL;
|
char terminateSymbol = '\0';
|
||||||
std::cin.get(truc); if (truc != '\n') { std::cin>>&ligne[ln+1]; ss = &ligne[ln+1]; }
|
std::cin.get(terminateSymbol);
|
||||||
return XSDRAW::GetList (ff,ss);
|
|
||||||
|
if ( terminateSymbol == '\n' )
|
||||||
|
return XSDRAW::GetList (aLineFirst.c_str(), nullptr);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::string aLineSecond;
|
||||||
|
std::cin >> aLineSecond;
|
||||||
|
return XSDRAW::GetList (aLineFirst.c_str(), aLineSecond.c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// return IFSelect_Functions::GiveList (Session(),first,second);
|
|
||||||
return IFSelect_Functions::GiveList (Session(),first,second);
|
return IFSelect_Functions::GiveList (Session(),first,second);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user