Skip to content

Commit cdf035d

Browse files
author
Stefan Weil
committed
Fix compilation with g++-5
Commit 0248c7f replaced math.h by cmath. Therefore isinf and isnan are no longer declared. Replace them by their C++ 11 variant. Signed-off-by: Stefan Weil <[email protected]>
1 parent 0a93ad2 commit cdf035d

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/classify/featdefs.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ bool ValidCharDescription(const FEATURE_DEFS_STRUCT &FeatureDefs,
216216
for (int i = 0; i < CharDesc->FeatureSets[Type]->NumFeatures; i++) {
217217
FEATURE feat = CharDesc->FeatureSets[Type]->Features[i];
218218
for (int p = 0; p < feat->Type->NumParams; p++) {
219-
if (isnan(feat->Params[p]) || isinf(feat->Params[p]))
219+
if (std::isnan(feat->Params[p]) || std::isinf(feat->Params[p]))
220220
well_formed = false;
221221
else
222222
anything_written = true;

src/classify/intproto.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ void AddProtoToProtoPruner(PROTO Proto, int ProtoId,
399399

400400
Angle = Proto->Angle;
401401
#ifndef _WIN32
402-
assert(!isnan(Angle));
402+
assert(!std::isnan(Angle));
403403
#endif
404404

405405
FillPPCircularBits (ProtoSet->ProtoPruner[PRUNER_ANGLE], Index,

src/classify/mf.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ FEATURE_SET ExtractMicros(TBLOB* Blob, const DENORM& cn_denorm) {
7272
// Assert that feature parameters are well defined.
7373
int i;
7474
for (i = 0; i < Feature->Type->NumParams; i++) {
75-
ASSERT_HOST(!isnan(Feature->Params[i]));
75+
ASSERT_HOST(!std::isnan(Feature->Params[i]));
7676
}
7777
#endif
7878

src/classify/ocrfeatures.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ FEATURE ReadFeature(FILE* File, const FEATURE_DESC_STRUCT* FeatureDesc) {
134134
if (tfscanf(File, "%f", &(Feature->Params[i])) != 1)
135135
DoError (ILLEGAL_FEATURE_PARAM, "Illegal feature parameter spec");
136136
#ifndef _WIN32
137-
assert (!isnan(Feature->Params[i]));
137+
assert (!std::isnan(Feature->Params[i]));
138138
#endif
139139
}
140140
return (Feature);
@@ -181,7 +181,7 @@ FEATURE_SET ReadFeatureSet(FILE* File, const FEATURE_DESC_STRUCT* FeatureDesc) {
181181
void WriteFeature(FEATURE Feature, STRING* str) {
182182
for (int i = 0; i < Feature->Type->NumParams; i++) {
183183
#ifndef WIN32
184-
assert(!isnan(Feature->Params[i]));
184+
assert(!std::isnan(Feature->Params[i]));
185185
#endif
186186
str->add_str_double(" ", Feature->Params[i]);
187187
}

0 commit comments

Comments
 (0)