Fix:Core:Better win32 module loading
[navit-package] / navit / coord.c
index a61edde..af16946 100644 (file)
@@ -192,8 +192,10 @@ coord_parse(const char *c_str, enum projection pro, struct coord *c_ret)
                        goto out;
                }
        }
-       if (! s)
-               return 0;
+       if (! s) {
+               ret=0;
+               goto out;
+       }
        while (*s == ' ') {
                s++;
        }
@@ -254,7 +256,7 @@ coord_parse(const char *c_str, enum projection pro, struct coord *c_ret)
        ret+=str-c_str;
        if (debug) {
                printf("args=%d\n", args);
-               printf("ret=%d delta=%d ret_str='%s'\n", ret, str-c_str, c_str+ret);
+               printf("ret=%d delta=%d ret_str='%s'\n", ret, GPOINTER_TO_INT(str-c_str), c_str+ret);
        }
 out:
        if (proj)
@@ -362,4 +364,20 @@ void coord_format(float lat,float lng, enum coord_format fmt, char * buffer, int
        
 }
 
+unsigned int 
+coord_hash(const void *key)
+{
+        const struct coord *c=key;
+       return c->x^c->y;
+}
+
+int
+coord_equal(const void *a, const void *b)
+{
+        const struct coord *c_a=a;
+        const struct coord *c_b=b;
+       if (c_a->x == c_b->x && c_a->y == c_b->y)
+                return TRUE;
+        return FALSE;
+}
 /** @} */