mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +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:
@@ -48,10 +48,10 @@ TCollection_AsciiString Message::FillTime (const Standard_Integer hour,
|
||||
{
|
||||
char t [30];
|
||||
if (hour > 0)
|
||||
sprintf (t, "%02dh:%02dm:%.2fs", hour, minute, second);
|
||||
Sprintf (t, "%02dh:%02dm:%.2fs", hour, minute, second);
|
||||
else if (minute > 0)
|
||||
sprintf (t, "%02dm:%.2fs", minute, second);
|
||||
Sprintf (t, "%02dm:%.2fs", minute, second);
|
||||
else
|
||||
sprintf (t, "%.2fs", second);
|
||||
Sprintf (t, "%.2fs", second);
|
||||
return TCollection_AsciiString (t);
|
||||
}
|
||||
|
@@ -170,7 +170,7 @@ Message_Msg& Message_Msg::Arg (const Standard_CString theString)
|
||||
|
||||
// print string according to format
|
||||
char * sStringBuffer = new char [Max ((Standard_Integer)strlen(theString)+1, 1024)];
|
||||
sprintf (sStringBuffer, aFormat.ToCString(), theString);
|
||||
Sprintf (sStringBuffer, aFormat.ToCString(), theString);
|
||||
TCollection_ExtendedString aStr ( sStringBuffer );
|
||||
delete [] sStringBuffer;
|
||||
sStringBuffer = 0;
|
||||
@@ -216,7 +216,7 @@ Message_Msg& Message_Msg::Arg (const Standard_Integer theValue)
|
||||
|
||||
// print string according to format
|
||||
char sStringBuffer [64];
|
||||
sprintf (sStringBuffer, aFormat.ToCString(), theValue);
|
||||
Sprintf (sStringBuffer, aFormat.ToCString(), theValue);
|
||||
TCollection_ExtendedString aStr ( sStringBuffer );
|
||||
|
||||
// replace the format placeholder by the actual string
|
||||
@@ -240,7 +240,7 @@ Message_Msg& Message_Msg::Arg (const Standard_Real theValue)
|
||||
|
||||
// print string according to format
|
||||
char sStringBuffer [64];
|
||||
sprintf (sStringBuffer, aFormat.ToCString(), theValue);
|
||||
Sprintf (sStringBuffer, aFormat.ToCString(), theValue);
|
||||
TCollection_ExtendedString aStr ( sStringBuffer );
|
||||
|
||||
// replace the format placeholder by the actual string
|
||||
|
Reference in New Issue
Block a user