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:
@@ -160,7 +160,7 @@ TCollection_AsciiString::TCollection_AsciiString(const Standard_Integer aValue)
|
||||
|
||||
union { int bid ; // ?? to ensure alignment of t[] by double-word??
|
||||
char t [13]; } CHN ;
|
||||
sprintf(&CHN.t[0],"%d",aValue);
|
||||
Sprintf(&CHN.t[0],"%d",aValue);
|
||||
#if OptJr
|
||||
STRINGLEN( CHN.t , mylength ) ;
|
||||
#else
|
||||
@@ -184,7 +184,7 @@ TCollection_AsciiString::TCollection_AsciiString(const Standard_Real aValue)
|
||||
|
||||
union { int bid ;
|
||||
char t [50]; } CHN ;
|
||||
sprintf(&CHN.t[0],"%g",aValue);
|
||||
Sprintf(&CHN.t[0],"%g",aValue);
|
||||
#if OptJr
|
||||
STRINGLEN( CHN.t , mylength ) ;
|
||||
#else
|
||||
@@ -1023,11 +1023,7 @@ Standard_Boolean TCollection_AsciiString::IsRealValue()const
|
||||
{
|
||||
char *ptr;
|
||||
if(mystring) {
|
||||
//#ifdef DEB
|
||||
// Standard_Real value = strtod(mystring,&ptr);
|
||||
//#else
|
||||
strtod(mystring,&ptr);
|
||||
//#endif
|
||||
Strtod(mystring,&ptr);
|
||||
if (ptr != mystring) return Standard_True;
|
||||
else return Standard_False;
|
||||
}
|
||||
@@ -1161,7 +1157,7 @@ Standard_Real TCollection_AsciiString::RealValue()const
|
||||
char *ptr;
|
||||
Standard_Real value = 0;
|
||||
if(mystring) {
|
||||
value = strtod(mystring,&ptr);
|
||||
value = Strtod(mystring,&ptr);
|
||||
if (ptr != mystring) return value;
|
||||
}
|
||||
Standard_NumericError::Raise("TCollection_AsciiString::RealValue");
|
||||
|
@@ -257,7 +257,7 @@ TCollection_ExtendedString::TCollection_ExtendedString
|
||||
{
|
||||
union {int bid ;
|
||||
char t [13];} CHN ;
|
||||
sprintf(&CHN.t[0],"%d",aValue);
|
||||
Sprintf(&CHN.t[0],"%d",aValue);
|
||||
#if OptJr
|
||||
STRINGLEN( CHN.t , mylength ) ;
|
||||
#else
|
||||
@@ -276,7 +276,7 @@ TCollection_ExtendedString::TCollection_ExtendedString
|
||||
{
|
||||
union {int bid ;
|
||||
char t [50];} CHN ;
|
||||
sprintf(&CHN.t[0],"%g",aValue);
|
||||
Sprintf(&CHN.t[0],"%g",aValue);
|
||||
#if OptJr
|
||||
STRINGLEN( CHN.t , mylength ) ;
|
||||
#else
|
||||
|
Reference in New Issue
Block a user