-// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2024 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#define GIBI_EQUAL(var_str, stat_str) (strncmp (var_str, stat_str, strlen(stat_str)) == 0)
+namespace
+{
+ class Localizer
+ {
+ std::string _locale;
+ public:
+ Localizer()
+ {
+ _locale = setlocale(LC_NUMERIC, NULL);
+ setlocale(LC_NUMERIC, "C");
+ }
+ ~Localizer()
+ {
+ setlocale(LC_NUMERIC, _locale.c_str());
+ }
+ };
+}
+
//================================================================================
/*!
* \brief Creates a reader of a given sauve file
MEDCoupling::MEDFileData * SauvReader::loadInMEDFileDS()
{
+ Localizer loc; // localization, to read numbers in "C" locale
+
SauvUtilities::IntermediateMED iMed; // intermadiate DS
_iMed = &iMed;
while ( isSwapped )
{
isSwapped = false;
- for ( size_t i = 1; i < groups.size(); ++i )
+ for ( std::size_t i = 1; i < groups.size(); ++i )
{
- int nbN1 = groups[i-1]->empty() ? 0 : groups[i-1]->_cells[0]->_nodes.size();
- int nbN2 = groups[i ]->empty() ? 0 : groups[i ]->_cells[0]->_nodes.size();
+ std::size_t nbN1 = groups[i-1]->empty() ? 0 : groups[i-1]->_cells[0]->_nodes.size();
+ std::size_t nbN2 = groups[i ]->empty() ? 0 : groups[i ]->_cells[0]->_nodes.size();
if ( nbN1 > nbN2 )
{
isSwapped = isModified = true;
const int fixedLength = 71;
while ((int)aWholeString.length() < stringLen)
{
- int remainLen = stringLen - aWholeString.length();
+ int remainLen = (int)(stringLen - aWholeString.length());
int len;
if ( remainLen > fixedLength )
{
while ((int)aWholeString.length() < stringLen)
{
getNextLine( line );
- int remainLen = stringLen - aWholeString.length();
+ int remainLen = (int)(stringLen - aWholeString.length());
if ( remainLen > fixedLength )
{
aWholeString += line + 1;