src/training: Replace more proprietary BOOL8 by standard bool data type

Update also callers of the modified functions to use
false / true instead of 0 / 1.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2018-06-04 16:04:57 +02:00
parent b292013bdc
commit 4f3b266efe
3 changed files with 11 additions and 11 deletions

View File

@ -164,7 +164,7 @@ int main(int argc, char *argv[]) {
Config.MagicSamples = CharSample->SampleCount; Config.MagicSamples = CharSample->SampleCount;
while (Config.MinSamples > 0.001) { while (Config.MinSamples > 0.001) {
ProtoList = ClusterSamples(Clusterer, &Config); ProtoList = ClusterSamples(Clusterer, &Config);
if (NumberOfProtos(ProtoList, 1, 0) > 0) { if (NumberOfProtos(ProtoList, true, false) > 0) {
break; break;
} else { } else {
Config.MinSamples *= 0.95; Config.MinSamples *= 0.95;
@ -232,8 +232,8 @@ static void WriteNormProtos(const char *Directory, LIST LabeledProtoList,
" (%d significant protos" " (%d significant protos"
", %d insignificant protos)\n", ", %d insignificant protos)\n",
LabeledProto->Label, N, LabeledProto->Label, N,
NumberOfProtos(LabeledProto->List, 1, 0), NumberOfProtos(LabeledProto->List, true, false),
NumberOfProtos(LabeledProto->List, 0, 1)); NumberOfProtos(LabeledProto->List, false, true));
exit(1); exit(1);
} }
fprintf(File, "\n%s %d\n", LabeledProto->Label, N); fprintf(File, "\n%s %d\n", LabeledProto->Label, N);

View File

@ -595,8 +595,8 @@ void CleanUpUnusedData(
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
LIST RemoveInsignificantProtos( LIST RemoveInsignificantProtos(
LIST ProtoList, LIST ProtoList,
BOOL8 KeepSigProtos, bool KeepSigProtos,
BOOL8 KeepInsigProtos, bool KeepInsigProtos,
int N) int N)
{ {
@ -823,8 +823,8 @@ void AddToNormProtosList(
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
int NumberOfProtos(LIST ProtoList, BOOL8 CountSigProtos, int NumberOfProtos(LIST ProtoList, bool CountSigProtos,
BOOL8 CountInsigProtos) { bool CountInsigProtos) {
int N = 0; int N = 0;
PROTOTYPE* Proto; PROTOTYPE* Proto;

View File

@ -142,8 +142,8 @@ CLUSTERER *SetUpForClustering(
LIST RemoveInsignificantProtos( LIST RemoveInsignificantProtos(
LIST ProtoList, LIST ProtoList,
BOOL8 KeepSigProtos, bool KeepSigProtos,
BOOL8 KeepInsigProtos, bool KeepInsigProtos,
int N); int N);
void CleanUpUnusedData( void CleanUpUnusedData(
@ -181,8 +181,8 @@ void AddToNormProtosList(
int NumberOfProtos( int NumberOfProtos(
LIST ProtoList, LIST ProtoList,
BOOL8 CountSigProtos, bool CountSigProtos,
BOOL8 CountInsigProtos); bool CountInsigProtos);
void allocNormProtos(); void allocNormProtos();