1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +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

@@ -290,8 +290,8 @@ static int initActivator = 0;
}
Standard_Real Rmin=0., Rmax=0.;
if (argc > 4) {
Rmin = atof(pilot->Word(4).ToCString());
Rmax = atof(pilot->Word(5).ToCString());
Rmin = Atof(pilot->Word(4).ToCString());
Rmax = Atof(pilot->Word(5).ToCString());
if (Rmin <= 0 || Rmax <= 0) { cout<<"intervalle : donner reels > 0"<<endl; return IFSelect_RetError; }
}
Handle(IGESSelect_FloatFormat) fm = new IGESSelect_FloatFormat;

View File

@@ -99,9 +99,9 @@ IGESSelect_Dumper::IGESSelect_Dumper () { }
if (hasrange) {
char flotrange[20];
file.SendText(forminrange.ToCString());
sprintf(flotrange,"%f",rangemin);
Sprintf(flotrange,"%f",rangemin);
file.SendText(flotrange);
sprintf(flotrange,"%f",rangemax);
Sprintf(flotrange,"%f",rangemax);
file.SendText(flotrange);
}
return Standard_True;
@@ -214,8 +214,8 @@ IGESSelect_Dumper::IGESSelect_Dumper () { }
if (file.NbParams() >= 5) {
//char flotrange[20]; //szv#4:S4163:12Mar99 unused
Standard_Real rangemin, rangemax;
rangemin = atof (file.ParamValue(4).ToCString());
rangemax = atof (file.ParamValue(5).ToCString());
rangemin = Atof (file.ParamValue(4).ToCString());
rangemax = Atof (file.ParamValue(5).ToCString());
ff->SetFormatForRange (file.ParamValue(3).ToCString(),rangemin,rangemax);
}
item = ff;

View File

@@ -36,9 +36,9 @@ IGESSelect_FloatFormat::IGESSelect_FloatFormat ()
} else {
char format[20];
char pourcent = '%'; char point = '.';
sprintf(format, "%c%d%c%dE",pourcent,digits+2,point,digits);
Sprintf(format, "%c%d%c%dE",pourcent,digits+2,point,digits);
themainform.AssignCat (format);
sprintf(format, "%c%d%c%df",pourcent,digits+2,point,digits);
Sprintf(format, "%c%d%c%df",pourcent,digits+2,point,digits);
theformrange.AssignCat (format);
}
therangemin = 0.1; therangemax = 1000.;
@@ -90,7 +90,7 @@ IGESSelect_FloatFormat::IGESSelect_FloatFormat ()
lab.AssignCat (themainform);
if (theformrange.Length() > 0) {
char mess[30];
// sprintf(mess,", in range %f %f %s",
// Sprintf(mess,", in range %f %f %s",
// therangemin,therangemax,theformrange.ToCString());
// lab.AssignCat(mess);
// ... FloatFormat a droit aussi a un beau format pour son propre compte ...