mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +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:
@@ -478,13 +478,13 @@ VrmlData_ErrorStatus VrmlData_Group::Write (const char * thePrefix) const
|
||||
};
|
||||
// Check that the box is not void
|
||||
if (aBoxCorner[0].X() < aBoxCorner[1].X() + Precision::Confusion()) {
|
||||
sprintf (buf, "bboxCenter %.9g %.9g %.9g",
|
||||
Sprintf (buf, "bboxCenter %.9g %.9g %.9g",
|
||||
0.5 * (aBoxCorner[0].X() + aBoxCorner[1].X()),
|
||||
0.5 * (aBoxCorner[0].Y() + aBoxCorner[1].Y()),
|
||||
0.5 * (aBoxCorner[0].Z() + aBoxCorner[1].Z()));
|
||||
aStatus = aScene.WriteLine (buf);
|
||||
if (OK(aStatus)) {
|
||||
sprintf (buf, "bboxSize %.9g %.9g %.9g",
|
||||
Sprintf (buf, "bboxSize %.9g %.9g %.9g",
|
||||
aBoxCorner[1].X() - aBoxCorner[0].X(),
|
||||
aBoxCorner[1].Y() - aBoxCorner[0].Y(),
|
||||
aBoxCorner[1].Z() - aBoxCorner[0].Z());
|
||||
@@ -499,7 +499,7 @@ VrmlData_ErrorStatus VrmlData_Group::Write (const char * thePrefix) const
|
||||
if ((aScaleFactor - 1.)*(aScaleFactor - 1.) >
|
||||
0.0001*Precision::Confusion())
|
||||
{
|
||||
sprintf (buf, "scale %.12g %.12g %.12g",
|
||||
Sprintf (buf, "scale %.12g %.12g %.12g",
|
||||
aScaleFactor, aScaleFactor, aScaleFactor);
|
||||
aStatus = aScene.WriteLine (buf);
|
||||
}
|
||||
@@ -507,7 +507,7 @@ VrmlData_ErrorStatus VrmlData_Group::Write (const char * thePrefix) const
|
||||
// Output the Translation
|
||||
const gp_XYZ& aTrans = myTrsf.TranslationPart();
|
||||
if (aTrans.SquareModulus() > 0.0001*Precision::Confusion()) {
|
||||
sprintf (buf, "translation %.12g %.12g %.12g",
|
||||
Sprintf (buf, "translation %.12g %.12g %.12g",
|
||||
aTrans.X(), aTrans.Y(), aTrans.Z());
|
||||
aStatus = aScene.WriteLine (buf);
|
||||
}
|
||||
@@ -517,7 +517,7 @@ VrmlData_ErrorStatus VrmlData_Group::Write (const char * thePrefix) const
|
||||
Standard_Real anAngle;
|
||||
if (myTrsf.GetRotation (anAxis, anAngle)) {
|
||||
// output the Rotation
|
||||
sprintf (buf, "rotation %.12g %.12g %.12g %.9g",
|
||||
Sprintf (buf, "rotation %.12g %.12g %.12g %.9g",
|
||||
anAxis.X(), anAxis.Y(), anAxis.Z(), anAngle);
|
||||
aStatus = aScene.WriteLine (buf);
|
||||
}
|
||||
|
Reference in New Issue
Block a user