diff options
author | Lionel AINS <lains@caramail.com> | 2019-05-15 10:37:55 +0200 |
---|---|---|
committer | Lionel AINS <lains@caramail.com> | 2019-05-15 10:37:55 +0200 |
commit | 59b2ee4c4f5ac6cb41abaa89e870666e0c3b5752 (patch) | |
tree | 98711a73299917ffc7be90467c1d3876facb78a1 | |
parent | 7523c112affbf4f15fb04b5130b93cfc0a1d46fa (diff) | |
download | navit-59b2ee4c4f5ac6cb41abaa89e870666e0c3b5752.tar.gz |
Adding comments and const
-rw-r--r-- | navit/item.c | 6 | ||||
-rw-r--r-- | navit/transform.c | 22 | ||||
-rw-r--r-- | navit/transform.h | 4 |
3 files changed, 25 insertions, 7 deletions
diff --git a/navit/item.c b/navit/item.c index 4f64a1edb..c17f31f8b 100644 --- a/navit/item.c +++ b/navit/item.c @@ -345,10 +345,10 @@ void item_attr_rewind(struct item *it) { * This function is not safe to call after destroying the item's map rect, and doing so may cause errors * with some map implementations. * - * @param it The map item whose attribute to retrieve. This must be the active item, i.e. the last one retrieved from the + * @param[in] it The map item whose attribute to retrieve. This must be the active item, i.e. the last one retrieved from the * {@code map_rect}. There can only be one active item per {@code map_rect}. - * @param attr_type The attribute type to retrieve, or `attr_any` to retrieve the next attribute - * @param attr Receives the attribute retrieved + * @param[in] attr_type The attribute type to retrieve, or `attr_any` to retrieve the next attribute + * @param[out] attr Receives the attribute retrieved * * @return True on success, false on failure */ diff --git a/navit/transform.c b/navit/transform.c index 4c0cb68b1..771037f8c 100644 --- a/navit/transform.c +++ b/navit/transform.c @@ -261,7 +261,16 @@ transform_dup(struct transformation *t) { static const navit_float gar2geo_units = 360.0/(1<<24); static const navit_float geo2gar_units = 1/(360.0/(1<<24)); -void transform_to_geo(enum projection pro, struct coord *c, struct coord_geo *g) { +/** + * @brief Transform the coordinates of a geographical point from a coord representation to a geographical (lat, long) representation + * + * @note This is the reverse of transform_from_geo() + * + * @param pro The projection to use during the transformation + * @param[in] c The coordinates as a struct coord format + * @param[out] g The coordinates converted to coord_geo (latitude, longitude) + */ +void transform_to_geo(enum projection pro, const struct coord *c, struct coord_geo *g) { int x,y,northern,zone; switch (pro) { case projection_mg: @@ -288,7 +297,16 @@ void transform_to_geo(enum projection pro, struct coord *c, struct coord_geo *g) } } -void transform_from_geo(enum projection pro, struct coord_geo *g, struct coord *c) { +/** + * @brief Transform the coordinates of a geographical point from a geographical (lat, long) representation to a coord representation + * + * @note This is the reverse of transform_to_geo() + * + * @param pro The projection to use during the transformation + * @param[in] g The coordinates as coord_geo (latitude, longitude) + * @param[out] c The coordinates converted to a struct coord format + */ +void transform_from_geo(enum projection pro, const struct coord_geo *g, struct coord *c) { switch (pro) { case projection_mg: c->x=g->lng*6371000.0*M_PI/180; diff --git a/navit/transform.h b/navit/transform.h index e58e136d5..dab69fd47 100644 --- a/navit/transform.h +++ b/navit/transform.h @@ -47,8 +47,8 @@ int transform_set_attr(struct transformation *this_, struct attr *attr); int transformation_get_order_base(struct transformation *this_); void transform_set_order_base(struct transformation *this_, int order_base); struct transformation *transform_dup(struct transformation *t); -void transform_to_geo(enum projection pro, struct coord *c, struct coord_geo *g); -void transform_from_geo(enum projection pro, struct coord_geo *g, struct coord *c); +void transform_to_geo(enum projection pro, const struct coord *c, struct coord_geo *g); +void transform_from_geo(enum projection pro, const struct coord_geo *g, struct coord *c); void transform_from_to_count(struct coord *cfrom, enum projection from, struct coord *cto, enum projection to, int count); void transform_from_to(struct coord *cfrom, enum projection from, struct coord *cto, enum projection to); void transform_geo_to_cart(struct coord_geo *geo, navit_float a, navit_float b, struct coord_geo_cart *cart); |