989 khiops raw gui not active despite driver being installed#1008
Conversation
c7ba60b to
06ea2a7
Compare
The method GetLearningRawGuiModeMode() call GetLearningDefaultRawGuiModeMode() Then, it must be called after SetLearningDefaultRawGuiModeMode()
60f8f8a to
1143018
Compare
marcboulle
left a comment
There was a problem hiding this comment.
Modifier le générateur de code pour ne pas générer les variables locales inutilisées provoquant un warning.
Méthodes impactées:
- TableGenerator::GenerateAttributeViewC
- TableGenerator::GenerateAttributeArrayViewC
Code impacté:
ost << "void " << GetArrayViewClassName() << "::EventUpdate(Object* object)"
<< "\n";
ost << "{"
<< "\n";
ost << "\t" << GetModelClassName() << "* editedObject;"
<< "\n";
ost << ""
<< "\n";
ost << "\trequire(object != NULL);"
<< "\n";
ost << ""
<< "\n";
if (GetSuperClassName() != "")
ost << "\t" << GetArrayViewSuperClassName() << "::EventUpdate(object);\n";
ost << "\teditedObject = cast(" << GetModelClassName() << "*, object);"
<< "\n";
for (nCurrent = 0; nCurrent < GetFieldNumber(); nCurrent++)
{
att = GetFieldAt(nCurrent);
if (att->GetVisible() and not att->GetDerived())
{
ost << "\teditedObject->Set" << att->GetName() << "("
<< "Get" << att->GetFieldType() << "ValueAt(\"" << att->GetName() << "\")"
<< ");"
<< "\n";
}
}
ost << ""
<< "\n";
GenerateUserCodeSection(ost, "\t", "Custom update");
ost << "}"
Conditionner la génération de la variable locale (ost << "\t" << GetModelClassName() << "* editedObject;"), et son accès ( ost << "\teditedObject = cast(" << GetModelClassName() << "*, object);" par un nombre de champs non null (if (GetFieldNumber() > 0)).
| DTAttributeSelection* attributegenerator; | ||
| boolean bRegressionWithEqualFreqDiscretization = false; | ||
| boolean bRegressionWithMODLDiscretization = false; | ||
| int nBuidTreeNumber; |
There was a problem hiding this comment.
Utilisé dans le bloc de trace GENERATE_PYTHON_REPORTING_TRACES (ligne 1157).
On ne peut pas supprimer cette variable
There was a problem hiding this comment.
j'ai tout mis dans le ifdef GENERATE_PYTHON_REPORTING_TRACES
| // bOk = false; | ||
| // break; | ||
| //} | ||
| previousSlice = slice; |
There was a problem hiding this comment.
Plutot que d'enlever cette variable, il faudrait changer le code mort
// if (previousSlice != NULL and previousSlice->CompareLexicographicOrder(slice) >= 0)
//{
// AddError("Wrong ordering between " + slice->GetClassLabel() + "s " +
// previousSlice->GetObjectLabel() + " and " + slice->GetObjectLabel());
// bOk = false;
// break;
//}
en
assert(previousSlice == NULL or previousSlice->CompareLexicographicOrder(slice) < 0)
| // Memorisation des nombre de modalites, groupes et classes cibles | ||
| nModalityNumber = kwftSource->GetFrequencyVectorNumber(); | ||
| nGroupNumber = kwftTarget->GetFrequencyVectorNumber(); | ||
| nTargetNumber = kwftSource->GetFrequencyVectorSize(); |
There was a problem hiding this comment.
il n'y a plus et classes dans le commentaire
| @@ -1572,7 +1569,7 @@ void DTGrouperMODL::FastPostOptimizeGroupsWithGarbage(KWFrequencyTable* kwftSour | |||
| // Memorisation des nombre de modalites, groupes et classes cibles | |||
There was a problem hiding this comment.
il n'y a plus et classes dans le commentaire
| @@ -2080,7 +2076,6 @@ void DTGrouperMODL::PostOptimizeGroupsWithGarbageSearch(ObjectArray* oaInitialGr | |||
| // Memorisation des nombre de modalites, groupes et classes cibles | |||
There was a problem hiding this comment.
il n'y a plus et classes dans le commentaire
|
|
||
| // Acces a la base source | ||
| sourceDatabase = shared_sourceDatabase.GetPLDatabase(); | ||
| timer.Start(); |
There was a problem hiding this comment.
déplacer cette instruction e,tre le commentaire et la première instruction suivante bOk = bOk and...
| SystemFileDriverCreator::RegisterExternalDrivers(); | ||
|
|
||
| // Parametrage du mode d'interface graphique en fonction des drivers de fichiers enregistres | ||
| SetLearningDefaultRawGuiModeMode(SystemFileDriverCreator::GetExternalDriverNumber()); |
There was a problem hiding this comment.
être plus explicite en passant un booléen en paramètre
SetLearningDefaultRawGuiModeMode(SystemFileDriverCreator::GetExternalDriverNumber() > 0);
| lSelectionScorerMemory = ComputeSlaveScorerNecessaryMemory(); | ||
|
|
||
| // La memoire de l'esclave est celle des | ||
| lSlaveMemory = lLayoutMemory + lTargetValuesMemory + lBinarySliceSetSelfMemory; |
There was a problem hiding this comment.
J'ai plutôt l'impression qu'il s'agit d'un oubli.
On devrait avoir
lSlaveMemory = lLayoutMemory + lTargetValuesMemory + lBinarySliceSetSelfMemory + lSelectionScorerMemory ;
| int nErrorNumber; | ||
| int i; | ||
| boolean bOk; | ||
| boolean bVerbose = false; |
There was a problem hiding this comment.
changer en const boolean bTrace = false;
| require(IsEmpty()); | ||
|
|
||
| bMissingMemory = GetMissingMemory() > 0; | ||
| bMissingDisk = GetMissingDisk() > 0; |
There was a problem hiding this comment.
Il ne devrait pas y avoir un message en cas de manque de mémoire disque?
There was a problem hiding this comment.
c'est déjà le cas...
- warnings 'Set but not used [-Wunused-but-set-parameter]' - warnings for variable uninitialized - warnings: implicit conversion from 'long' to 'double' - warnings: first argument in call to 'memset' is a pointer to non-trivially copyable type 'Symbol' - warning: ignoring duplicate libraries - warning: Unused parameter Silence warning with (void)variable [IA Generated] In C/C++, writing (void)variable means: Convert the expression to type void Discard its value Tell the compiler: this is intentionally unused So for an unused parameter, this pattern avoids warnings like “unused parameter”. Why it helps in your case: variable = NULL writes to the parameter, so compiler can warn “set but not used” (void)variable does not write anything, it only marks the parameter as intentionally consumed Typical use: (void)kwoObject; (void)indexedKeyBlock; It has no runtime effect in practice, it is only for clarity and warning suppression.
When there isn't any attribute, it is not necessary to declare and cast the object. It produces a warning "Set but not used"
e10b111 to
a0775f5
Compare
-
KWDerivationRule.cpp: Affectations with NULL commented with "Pour eviter le warning" produce a warning.-
MHFloatingPointFrequencyTableBuilder::InitializeBins: variable 'cMantissa' set but not used. Weird...- KWGrouperMODLOptimization.cpp: in method EMPostOptimizeGroupsWithGarbage, variable nStart is not used but initialized with RandomInt. It could change the references in LearningTest
- KWDataPreparation/* to avoid difficult conflicts
- KWTest/*
Important
LearningTest full passed