[Groonga-commit] groonga/groonga at 521aa5c [master] Define GRN_GEO_MIN_XXX

Back to archive index

Kouhei Sutou null+****@clear*****
Sat Dec 7 21:44:46 JST 2013


Kouhei Sutou	2013-12-07 21:44:46 +0900 (Sat, 07 Dec 2013)

  New Revision: 521aa5c5897f87d47e8552aa7a4624c5d1f36a90
  https://github.com/groonga/groonga/commit/521aa5c5897f87d47e8552aa7a4624c5d1f36a90

  Message:
    Define GRN_GEO_MIN_XXX

  Modified files:
    lib/db.c
    lib/geo.h

  Modified: lib/db.c (+2 -2)
===================================================================
--- lib/db.c    2013-12-07 20:47:31 +0900 (9b162f3)
+++ lib/db.c    2013-12-07 21:44:46 +0900 (c87fa09)
@@ -4798,9 +4798,9 @@ grn_obj_cast(grn_ctx *ctx, grn_obj *src, grn_obj *dest, grn_bool addp)
               }
             }
             if (!rc && cur == str_end) {
-              if ((-GRN_GEO_MAX_LATITUDE <= latitude &&
+              if ((GRN_GEO_MIN_LATITUDE <= latitude &&
                    latitude <= GRN_GEO_MAX_LATITUDE) &&
-                  (-GRN_GEO_MAX_LONGITUDE <= longitude &&
+                  (GRN_GEO_MIN_LONGITUDE <= longitude &&
                    longitude <= GRN_GEO_MAX_LONGITUDE)) {
                 GRN_GEO_POINT_SET(ctx, dest, latitude, longitude);
               } else {

  Modified: lib/geo.h (+2 -0)
===================================================================
--- lib/geo.h    2013-12-07 20:47:31 +0900 (1b76284)
+++ lib/geo.h    2013-12-07 21:44:46 +0900 (5a839ad)
@@ -46,6 +46,8 @@ extern "C" {
 
 #define GRN_GEO_MAX_LATITUDE  324000000 /*  90 * 60 * 60 * 1000 */
 #define GRN_GEO_MAX_LONGITUDE 648000000 /* 180 * 60 * 60 * 1000 */
+#define GRN_GEO_MIN_LATITUDE  -GRN_GEO_MAX_LATITUDE
+#define GRN_GEO_MIN_LONGITUDE -GRN_GEO_MAX_LONGITUDE
 
 #define GRN_GEO_POINT_VALUE_RAW(obj) (grn_geo_point *)GRN_BULK_HEAD(obj)
 #define GRN_GEO_POINT_VALUE_RADIUS(obj,_latitude,_longitude) do {\
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index