From aaa81e00b75d0df6b83be5d3f6e54227110145ae Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 11 Sep 2012 04:45:43 -0700 Subject: Use HUGE_VAL instead of dividing by 0 for infinity, where possible --- utils/makehrtf.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/utils/makehrtf.c b/utils/makehrtf.c index e2e58d7c..65ca4bc1 100644 --- a/utils/makehrtf.c +++ b/utils/makehrtf.c @@ -51,6 +51,9 @@ * */ +/* Needed for 64-bit unsigned integer. */ +#include "config.h" + #include #include #include @@ -58,9 +61,6 @@ #include #include -// Needed for 64-bit unsigned integer. -#include "config.h" - // Rely (if naively) on OpenAL's header for the types used for serialization. #include "AL/al.h" @@ -68,6 +68,10 @@ #define M_PI 3.14159265358979323846 #endif +#ifndef HUGE_VAL +#define HUGE_VAL (1.0/0.0) +#endif + // The epsilon used to maintain signal stability. #define EPSILON (1e-15) @@ -1149,7 +1153,7 @@ static int ReadAsciiAsDouble (TokenReaderT * tr, const char * filename, const El else if (TrIsOperator (tr, "|")) TrReadOperator (tr, "|"); if (type == ET_FP) { - if (! TrReadFloat (tr, -1.0 / 0.0, 1.0 / 0.0, out)) { + if (! TrReadFloat (tr, -HUGE_VAL, HUGE_VAL, out)) { fprintf (stderr, "Error: Bad read from file '%s'.\n", filename); return (0); } -- cgit v1.2.3