1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-29 14:00:49 +03:00

0022898: IGES import fails in german environment

Added DRAW command dlocale to set and query current locale of the C subsystem
Equivalents of C functions working with conversions of strings to/from reals added in Standard_CString, providing locale-independent behavior (using always "C" locale)
In DRAW packages, calls to atof() and atoi() are replaced by direct calls to Draw::Atof() and Draw::Atoi(), respectively, instead of substituting by #define
Use of atof(), strtod(), and *scanf() involving floating point conversions in OCCT code replaced by locale-independent Atof() and Strtod()
Calls to sprintf() involving floating point in OCCT code are replaced by call to locale-independent Sprintf(), except a few places where converted strings are used immediately for display in the 3d viewer
Changes of global locale are eliminated throughout OCCT code
Proposed correction for GNU libC where v*printf_l functions are absent
Added test case (bugs xde bug22898) for data exchange operations with non-standard locale
Use xlocale on Mac OS X and within glibc
Corrected strtod_l wrapper
Generate error rather than warning
Introduce Standard_CLocaleSentry replacement for removed OSD_Localizer
Standard_CLocaleSentry - copy locale string
Standard_CLocaleSentry - use _configthreadlocale on Windows
Standard_CLocaleSentry::GetCLocale() - return locale_t rather than void*
Corrected misprint in ~Standard_CLocaleSentry()
Use French locale in bug22898 test case
Mark test case as skipped if locale is unavailable on tested system.
Use fr_FR locale for tests on Mac OS X
This commit is contained in:
abv
2013-02-01 18:41:16 +04:00
parent 3bea4c165c
commit 91322f44fd
203 changed files with 2707 additions and 2807 deletions

View File

@@ -40,7 +40,7 @@ void MoniTool_Timer::Dump(Standard_OStream &ostr)
Standard_Real elapsed = seconds + minutes*60 + hours*3600;
char buff[1024];
sprintf ( buff, "Elapsed:%6.1f sec, CPU User:%9.4f sec, CPU Sys:%9.4f sec, hits: %d",
Sprintf ( buff, "Elapsed:%6.1f sec, CPU User:%9.4f sec, CPU Sys:%9.4f sec, hits: %d",
elapsed, user, system, myCount );
ostr << buff << endl;
@@ -113,7 +113,7 @@ void MoniTool_Timer::DumpTimers (Standard_OStream &ostr)
}
//Handle(MoniTool_Timer) MT = iter.Value();
char buff[1024];
sprintf ( buff, "%-20s\t", stmp );
Sprintf ( buff, "%-20s\t", stmp );
ostr << "TIMER: " << buff;
//iter.Value()->Dump ( ostr );
Timer(stmp)->Dump(ostr);

View File

@@ -156,11 +156,11 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val)
def.AssignCat("Integer");
Standard_Integer ilim;
if (IntegerLimit(Standard_False, ilim)) {
sprintf(mess," >= %d",ilim);
Sprintf(mess," >= %d",ilim);
def.AssignCat(mess);
}
if (IntegerLimit(Standard_True, ilim)) {
sprintf(mess," <= %d",ilim);
Sprintf(mess," <= %d",ilim);
def.AssignCat(mess);
}
}
@@ -169,11 +169,11 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val)
def.AssignCat("Real");
Standard_Real rlim;
if (RealLimit(Standard_False, rlim)) {
sprintf(mess," >= %f",rlim);
Sprintf(mess," >= %f",rlim);
def.AssignCat(mess);
}
if (RealLimit(Standard_True, rlim)) {
sprintf(mess," <= %f",rlim);
Sprintf(mess," <= %f",rlim);
def.AssignCat(mess);
}
if (theunidef.Length() > 0)
@@ -184,12 +184,12 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val)
def.AssignCat("Enum");
Standard_Integer startcase, endcase; Standard_Boolean match;
EnumDef (startcase,endcase,match);
sprintf(mess," [%s%d-%d]",(match ? "in " : ""),startcase,endcase);
Sprintf(mess," [%s%d-%d]",(match ? "in " : ""),startcase,endcase);
def.AssignCat(mess);
for (Standard_Integer i = startcase; i <= endcase; i ++) {
Standard_CString enva = EnumVal(i);
if (enva[0] == '?' || enva[0] == '\0') continue;
sprintf(mess," %d:%s",i,enva);
Sprintf(mess," %d:%s",i,enva);
def.AssignCat (mess);
}
if (!theeadds.IsNull()) {
@@ -198,7 +198,7 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val)
for (listadd.Start(); listadd.More(); listadd.Next()) {
Standard_CString enva = listadd.Name().ToCString();
if (enva[0] == '?') continue;
sprintf(mess,":%d ",listadd.Value());
Sprintf(mess,":%d ",listadd.Value());
def.AssignCat (enva);
def.AssignCat (mess);
}
@@ -216,7 +216,7 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val)
case MoniTool_ValueText : {
def.AssignCat("Text");
if (themaxlen > 0) {
sprintf (mess," <= %d C.",themaxlen);
Sprintf (mess," <= %d C.",themaxlen);
def.AssignCat (mess);
}
break;
@@ -280,9 +280,9 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val)
else if (init[0] == 'i' && init[2] == 'a') // imax ival
SetIntegerLimit (Standard_True ,atoi(&init[iblc]));
else if (init[0] == 'r' && init[2] == 'i') // rmin rval
SetRealLimit (Standard_False,atof(&init[iblc]));
SetRealLimit (Standard_False,Atof(&init[iblc]));
else if (init[0] == 'r' && init[2] == 'a') // rmax rval
SetRealLimit (Standard_True ,atof(&init[iblc]));
SetRealLimit (Standard_True ,Atof(&init[iblc]));
else if (init[0] == 'u') // unit name
SetUnitDef (&init[iblc]);
else if (init[0] == 'e' && init[1] == 'm') // ematch istart