Skip to content

Commit 4f3b266

Browse files
committed
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>
1 parent b292013 commit 4f3b266

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/training/cntraining.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ int main(int argc, char *argv[]) {
164164
Config.MagicSamples = CharSample->SampleCount;
165165
while (Config.MinSamples > 0.001) {
166166
ProtoList = ClusterSamples(Clusterer, &Config);
167-
if (NumberOfProtos(ProtoList, 1, 0) > 0) {
167+
if (NumberOfProtos(ProtoList, true, false) > 0) {
168168
break;
169169
} else {
170170
Config.MinSamples *= 0.95;
@@ -232,8 +232,8 @@ static void WriteNormProtos(const char *Directory, LIST LabeledProtoList,
232232
" (%d significant protos"
233233
", %d insignificant protos)\n",
234234
LabeledProto->Label, N,
235-
NumberOfProtos(LabeledProto->List, 1, 0),
236-
NumberOfProtos(LabeledProto->List, 0, 1));
235+
NumberOfProtos(LabeledProto->List, true, false),
236+
NumberOfProtos(LabeledProto->List, false, true));
237237
exit(1);
238238
}
239239
fprintf(File, "\n%s %d\n", LabeledProto->Label, N);

src/training/commontraining.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -595,8 +595,8 @@ void CleanUpUnusedData(
595595
/*------------------------------------------------------------------------*/
596596
LIST RemoveInsignificantProtos(
597597
LIST ProtoList,
598-
BOOL8 KeepSigProtos,
599-
BOOL8 KeepInsigProtos,
598+
bool KeepSigProtos,
599+
bool KeepInsigProtos,
600600
int N)
601601

602602
{
@@ -823,8 +823,8 @@ void AddToNormProtosList(
823823
}
824824

825825
/*---------------------------------------------------------------------------*/
826-
int NumberOfProtos(LIST ProtoList, BOOL8 CountSigProtos,
827-
BOOL8 CountInsigProtos) {
826+
int NumberOfProtos(LIST ProtoList, bool CountSigProtos,
827+
bool CountInsigProtos) {
828828
int N = 0;
829829
PROTOTYPE* Proto;
830830

src/training/commontraining.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ CLUSTERER *SetUpForClustering(
142142

143143
LIST RemoveInsignificantProtos(
144144
LIST ProtoList,
145-
BOOL8 KeepSigProtos,
146-
BOOL8 KeepInsigProtos,
145+
bool KeepSigProtos,
146+
bool KeepInsigProtos,
147147
int N);
148148

149149
void CleanUpUnusedData(
@@ -181,8 +181,8 @@ void AddToNormProtosList(
181181

182182
int NumberOfProtos(
183183
LIST ProtoList,
184-
BOOL8 CountSigProtos,
185-
BOOL8 CountInsigProtos);
184+
bool CountSigProtos,
185+
bool CountInsigProtos);
186186

187187

188188
void allocNormProtos();

0 commit comments

Comments
 (0)