]> granicus.if.org Git - postgis/commitdiff
Replace INFINITY with MAXFLOAT. Should fix Solaris build [#1396]
authorSandro Santilli <strk@keybit.net>
Thu, 22 Dec 2011 08:01:43 +0000 (08:01 +0000)
committerSandro Santilli <strk@keybit.net>
Thu, 22 Dec 2011 08:01:43 +0000 (08:01 +0000)
I don't think it makes a difference as those functions are not
documented about the exceptional return, and no regression test
fails with the change.

git-svn-id: http://svn.osgeo.org/postgis/trunk@8499 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/gserialized_gist_2d.c

index add618bbc1e6006bd70c04b1d5844beb1ce70e13..84efa9e9ec3d1c51cc9f0aac45ed35b42153d5b4 100644 (file)
@@ -32,6 +32,7 @@
 #include "liblwgeom.h"         /* For standard geometry types. */
 #include "lwgeom_pg.h"       /* For debugging macros. */
 #include "gserialized_gist.h"       /* For utility functions. */
+#include "liblwgeom_internal.h"  /* For MAXFLOAT */
 
 /*
 ** When is a node split not so good? If more than 90% of the entries
@@ -465,7 +466,7 @@ static double box2df_distance(const BOX2DF *a, const BOX2DF *b)
                        return b->ymin - a->ymax;
        }
        
-       return INFINITY;
+       return MAXFLOAT;
 }
 
 
@@ -572,7 +573,7 @@ Datum gserialized_distance_centroid_2d(PG_FUNCTION_ARGS)
                POSTGIS_DEBUGF(3, "got boxes %s and %s", box2df_to_string(&b1), box2df_to_string(&b2));
                PG_RETURN_FLOAT8(distance);
        }
-       PG_RETURN_FLOAT8(INFINITY);
+       PG_RETURN_FLOAT8(MAXFLOAT);
 }
 
 PG_FUNCTION_INFO_V1(gserialized_distance_box_2d);
@@ -592,7 +593,7 @@ Datum gserialized_distance_box_2d(PG_FUNCTION_ARGS)
                POSTGIS_DEBUGF(3, "got boxes %s and %s", box2df_to_string(&b1), box2df_to_string(&b2));
                PG_RETURN_FLOAT8(distance);
        }
-       PG_RETURN_FLOAT8(INFINITY);
+       PG_RETURN_FLOAT8(MAXFLOAT);
 }
 
 PG_FUNCTION_INFO_V1(gserialized_same_2d);
@@ -958,14 +959,14 @@ Datum gserialized_gist_distance_2d(PG_FUNCTION_ARGS)
     *  and '14' as the gist distance-between-boxes strategy number */
     if ( strategy != 13 && strategy != 14 ) {
         elog(ERROR, "unrecognized strategy number: %d", strategy);
-               PG_RETURN_FLOAT8(INFINITY);
+               PG_RETURN_FLOAT8(MAXFLOAT);
        }
 
        /* Null box should never make this far. */
        if ( gserialized_datum_get_box2df_p(PG_GETARG_DATUM(1), &query_box) == LW_FAILURE )
        {
                POSTGIS_DEBUG(4, "[GIST] null query_gbox_index!");
-               PG_RETURN_FLOAT8(INFINITY);
+               PG_RETURN_FLOAT8(MAXFLOAT);
        }
 
        /* Get the entry box */