Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding comments and const #788

Merged
merged 1 commit into from
Jun 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions navit/item.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
22 changes: 20 additions & 2 deletions navit/transform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions navit/transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down