Use spaces instead of tabs

This commit is contained in:
Christophe Bourcier 2023-05-03 16:11:14 +02:00
parent 23a2fe916c
commit dc881f9d8c

View File

@ -467,10 +467,10 @@ namespace SMESHUtils_MGLicenseKeyGen // API implementation
SMESH_CATCH( SMESH::returnError ); SMESH_CATCH( SMESH::returnError );
if ( !error.empty() ) if ( !error.empty() )
{ {
std::cerr << "error: " << error << std::endl; std::cerr << "error: " << error << std::endl;
ok = false; ok = false;
} }
else if ( !ok ) else if ( !ok )
error = "UnlockProduct() failed (located in '" + libraryFile._name + "')"; error = "UnlockProduct() failed (located in '" + libraryFile._name + "')";
} }
@ -489,13 +489,13 @@ namespace SMESHUtils_MGLicenseKeyGen // API implementation
{ {
const char *meshGemsOldStyleEnvVar( getenv( MESHGEMS_OLD_STYLE ) ); const char *meshGemsOldStyleEnvVar( getenv( MESHGEMS_OLD_STYLE ) );
if ( !meshGemsOldStyleEnvVar || strlen(meshGemsOldStyleEnvVar) == 0 ) if ( !meshGemsOldStyleEnvVar || strlen(meshGemsOldStyleEnvVar) == 0 )
{ {
if (NeedsMGSpatialEnvLicense(error)) if (NeedsMGSpatialEnvLicense(error))
// SignCAD is only called by cadsurf. Other components call SignMesh // SignCAD is only called by cadsurf. Other components call SignMesh
return UnlockProduct("cadsurf", error); return UnlockProduct("cadsurf", error);
else else
return SignCAD_After(meshgems_cad, error); return SignCAD_After(meshgems_cad, error);
} }
else else
return true; return true;
} }
@ -552,14 +552,14 @@ namespace SMESHUtils_MGLicenseKeyGen // API implementation
{ {
const char *meshGemsOldStyleEnvVar( getenv( MESHGEMS_OLD_STYLE ) ); const char *meshGemsOldStyleEnvVar( getenv( MESHGEMS_OLD_STYLE ) );
if ( !meshGemsOldStyleEnvVar || strlen(meshGemsOldStyleEnvVar) == 0 ) if ( !meshGemsOldStyleEnvVar || strlen(meshGemsOldStyleEnvVar) == 0 )
{ {
if (NeedsMGSpatialEnvLicense(error)) if (NeedsMGSpatialEnvLicense(error))
// unlock product (MG 2.15) // unlock product (MG 2.15)
return UnlockProduct(product, error); return UnlockProduct(product, error);
else else
// sign the mesh (MG 2.13 and 2.14) // sign the mesh (MG 2.13 and 2.14)
return SignMesh_After(meshgems_mesh, error); return SignMesh_After(meshgems_mesh, error);
} }
else else
// use DLIM8 server (nothing to do here) // use DLIM8 server (nothing to do here)
return true; return true;
@ -576,11 +576,11 @@ namespace SMESHUtils_MGLicenseKeyGen // API implementation
//================================================================================ //================================================================================
std::string GetKey_After(const std::string& gmfFile, std::string GetKey_After(const std::string& gmfFile,
int nbVertex, int nbVertex,
int nbEdge, int nbEdge,
int nbFace, int nbFace,
int nbVol, int nbVol,
std::string& error) std::string& error)
{ {
std::string key; std::string key;
LibraryFile libraryFile; LibraryFile libraryFile;
@ -657,11 +657,11 @@ namespace SMESHUtils_MGLicenseKeyGen // API implementation
if ( !keyFun ) if ( !keyFun )
{ {
if ( ! getLastError( error )) if ( ! getLastError( error ))
error = SMESH_Comment( "Can't find symbol 'GetVersionMinor' in '") << getenv( theEnvVar ) << "'"; error = SMESH_Comment( "Can't find symbol 'GetVersionMinor' in '") << getenv( theEnvVar ) << "'";
} }
else else
{ {
v_min = keyFun( ); v_min = keyFun( );
} }
if ( v_min==-1 ) if ( v_min==-1 )
error = "GetVersionMinor() failed (located in '" + libraryFile._name + "')"; error = "GetVersionMinor() failed (located in '" + libraryFile._name + "')";
@ -676,11 +676,11 @@ namespace SMESHUtils_MGLicenseKeyGen // API implementation
if ( !keyFun ) if ( !keyFun )
{ {
if ( ! getLastError( error )) if ( ! getLastError( error ))
error = SMESH_Comment( "Can't find symbol 'GetVersionMajor' in '") << getenv( theEnvVar ) << "'"; error = SMESH_Comment( "Can't find symbol 'GetVersionMajor' in '") << getenv( theEnvVar ) << "'";
} }
else else
{ {
v_maj = keyFun( ); v_maj = keyFun( );
} }
if ( v_maj==-1 ) if ( v_maj==-1 )
error = "GetVersionMajor() failed (located in '" + libraryFile._name + "')"; error = "GetVersionMajor() failed (located in '" + libraryFile._name + "')";
@ -695,11 +695,11 @@ namespace SMESHUtils_MGLicenseKeyGen // API implementation
if ( !keyFun ) if ( !keyFun )
{ {
if ( ! getLastError( error )) if ( ! getLastError( error ))
error = SMESH_Comment( "Can't find symbol 'GetVersionPatch' in '") << getenv( theEnvVar ) << "'"; error = SMESH_Comment( "Can't find symbol 'GetVersionPatch' in '") << getenv( theEnvVar ) << "'";
} }
else else
{ {
v_patch = keyFun( ); v_patch = keyFun( );
} }
if ( v_patch==-1 ) if ( v_patch==-1 )
error = "GetVersionPatch() failed (located in '" + libraryFile._name + "')"; error = "GetVersionPatch() failed (located in '" + libraryFile._name + "')";
@ -763,37 +763,37 @@ namespace SMESHUtils_MGLicenseKeyGen // API implementation
*/ */
//================================================================================ //================================================================================
std::string GetKey(const std::string& gmfFile, std::string GetKey(const std::string& gmfFile,
int nbVertex, int nbVertex,
int nbEdge, int nbEdge,
int nbFace, int nbFace,
int nbVol, int nbVol,
std::string& error) std::string& error)
{ {
// default key if MESHGEMS_OLD_STYLE or SPATIAL_LICENSE is set // default key if MESHGEMS_OLD_STYLE or SPATIAL_LICENSE is set
std::string key("0"); std::string key("0");
const char *meshGemsOldStyleEnvVar( getenv( MESHGEMS_OLD_STYLE ) ); const char *meshGemsOldStyleEnvVar( getenv( MESHGEMS_OLD_STYLE ) );
if ( !meshGemsOldStyleEnvVar || strlen(meshGemsOldStyleEnvVar) == 0 ) if ( !meshGemsOldStyleEnvVar || strlen(meshGemsOldStyleEnvVar) == 0 )
{
const char *spatialLicenseEnvVar( getenv( SPATIAL_LICENSE ) );
if ( !spatialLicenseEnvVar || strlen(spatialLicenseEnvVar) == 0 )
{ {
const char *spatialLicenseEnvVar( getenv( SPATIAL_LICENSE ) ); if (NeedsMGSpatialEnvLicense(error))
if ( !spatialLicenseEnvVar || strlen(spatialLicenseEnvVar) == 0 ) {
{ // if MG version > 2.15, set environment license, don't return it as a key
if (NeedsMGSpatialEnvLicense(error)) // otherwise it will be printed in the command line
{ MESSAGE("SPATIAL_LICENSE not in env => we add it from MGKeygen .so");
// if MG version > 2.15, set environment license, don't return it as a key SetMGSpatialEnvLicense(error);
// otherwise it will be printed in the command line }
MESSAGE("SPATIAL_LICENSE not in env => we add it from MGKeygen .so"); else
SetMGSpatialEnvLicense(error); {
} // generate the key from the mesh info (MG 2.13 and 2.14)
else MESSAGE("MG < 2.15 => get the key from MGKeygen .so and this mesh info");
{ key = GetKey_After(gmfFile,nbVertex,nbEdge,nbFace,nbVol,error);
// generate the key from the mesh info (MG 2.13 and 2.14) }
MESSAGE("MG < 2.15 => get the key from MGKeygen .so and this mesh info");
key = GetKey_After(gmfFile,nbVertex,nbEdge,nbFace,nbVol,error);
}
}
else
MESSAGE("SPATIAL_LICENSE already in env => we use it");
} }
else
MESSAGE("SPATIAL_LICENSE already in env => we use it");
}
if (! error.empty()) if (! error.empty())
std::cerr << error; std::cerr << error;
return key; return key;
@ -816,16 +816,16 @@ namespace SMESHUtils_MGLicenseKeyGen // API implementation
if ( !meshGemsOldStyleEnvVar || strlen(meshGemsOldStyleEnvVar) == 0 ){ if ( !meshGemsOldStyleEnvVar || strlen(meshGemsOldStyleEnvVar) == 0 ){
const char *spatialLicenseEnvVar( getenv( SPATIAL_LICENSE ) ); const char *spatialLicenseEnvVar( getenv( SPATIAL_LICENSE ) );
if ( !spatialLicenseEnvVar || strlen(spatialLicenseEnvVar) == 0 ) if ( !spatialLicenseEnvVar || strlen(spatialLicenseEnvVar) == 0 )
{ {
MESSAGE("SPATIAL_LICENSE not in env => we add it from MGKeygen .so"); MESSAGE("SPATIAL_LICENSE not in env => we add it from MGKeygen .so");
// use new style, i.e. key in a library // use new style, i.e. key in a library
key = GetKey_After(error); key = GetKey_After(error);
} }
else else
{ {
MESSAGE("SPATIAL_LICENSE already in env => we use it"); MESSAGE("SPATIAL_LICENSE already in env => we use it");
key = std::string(spatialLicenseEnvVar); key = std::string(spatialLicenseEnvVar);
} }
} }
if (! error.empty()) if (! error.empty())
std::cerr << error; std::cerr << error;