diff options
author | Joseph Herlant <aerostitch@users.noreply.github.com> | 2018-05-30 08:43:42 -0700 |
---|---|---|
committer | jkoan <jkoan@users.noreply.github.com> | 2018-05-30 17:43:42 +0200 |
commit | 567a02aa949dfa34f7b2c2246c6eb6f8818fdf01 (patch) | |
tree | 4bb102fa60f0d01db0184d1424a5fc822ba79bc9 /navit/layout.c | |
parent | cd477eb0e05b74b8dd26aa2df2778505a3b3c37c (diff) | |
download | navit-567a02aa949dfa34f7b2c2246c6eb6f8818fdf01.tar.gz |
Cleanup:global:force the re-attach the return type to the function declaration (#605)
* Cleanup:global:force the re-attach the return type to the function declaration
* cleanup:global:some loose ends
Diffstat (limited to 'navit/layout.c')
-rw-r--r-- | navit/layout.c | 63 |
1 files changed, 21 insertions, 42 deletions
diff --git a/navit/layout.c b/navit/layout.c index a62b21901..25f60bc4b 100644 --- a/navit/layout.c +++ b/navit/layout.c @@ -69,13 +69,11 @@ layout_attr_iter_new(void) { return g_new0(struct attr_iter, 1); } -void -layout_attr_iter_destroy(struct attr_iter *iter) { +void layout_attr_iter_destroy(struct attr_iter *iter) { g_free(iter); } -int -layout_get_attr(struct layout *layout, enum attr_type type, struct attr *attr, struct attr_iter *iter) { +int layout_get_attr(struct layout *layout, enum attr_type type, struct attr *attr, struct attr_iter *iter) { GList *cursor,*layer; attr->type=type; switch (type) { @@ -122,8 +120,7 @@ layout_get_attr(struct layout *layout, enum attr_type type, struct attr *attr, s } -int -layout_add_attr(struct layout *layout, struct attr *attr) { +int layout_add_attr(struct layout *layout, struct attr *attr) { switch (attr->type) { case attr_cursor: layout->cursors = g_list_append(layout->cursors, attr->u.cursor); @@ -198,8 +195,7 @@ cursor_new(struct attr *parent, struct attr **attrs) { return this; } -void -cursor_destroy(struct cursor *this_) { +void cursor_destroy(struct cursor *this_) { if (this_->sequence_range) g_free(this_->sequence_range); if (this_->name) { @@ -208,8 +204,7 @@ cursor_destroy(struct cursor *this_) { g_free(this_); } -int -cursor_add_attr(struct cursor *this_, struct attr *attr) { +int cursor_add_attr(struct cursor *this_, struct attr *attr) { switch (attr->type) { case attr_itemgra: this_->attrs=attr_generic_add_attr(this_->attrs, attr); @@ -220,8 +215,7 @@ cursor_add_attr(struct cursor *this_, struct attr *attr) { return 0; } -static int -layer_set_attr_do(struct layer *l, struct attr *attr, int init) { +static int layer_set_attr_do(struct layer *l, struct attr *attr, int init) { struct attr_iter *iter; struct navit_object *obj; struct attr layer; @@ -282,8 +276,7 @@ struct layer * layer_new(struct attr *parent, struct attr **attrs) { return l; } -int -layer_get_attr(struct layer *layer, enum attr_type type, struct attr *attr, struct attr_iter *iter) { +int layer_get_attr(struct layer *layer, enum attr_type type, struct attr *attr, struct attr_iter *iter) { attr->type=type; switch(type) { case attr_active: @@ -304,8 +297,7 @@ layer_get_attr(struct layer *layer, enum attr_type type, struct attr *attr, stru return 0; } -int -layer_add_attr(struct layer *layer, struct attr *attr) { +int layer_add_attr(struct layer *layer, struct attr *attr) { switch (attr->type) { case attr_itemgra: layer->itemgras = g_list_append(layer->itemgras, attr->u.itemgra); @@ -315,13 +307,11 @@ layer_add_attr(struct layer *layer, struct attr *attr) { } } -int -layer_set_attr(struct layer *layer, struct attr *attr) { +int layer_set_attr(struct layer *layer, struct attr *attr) { return layer_set_attr_do(layer, attr, 0); } -static void -layer_destroy(struct layer *layer) { +static void layer_destroy(struct layer *layer) { attr_list_free(layer->attrs); g_free(layer->name); g_free(layer); @@ -366,8 +356,7 @@ struct itemgra * itemgra_new(struct attr *parent, struct attr **attrs) { } return itm; } -int -itemgra_add_attr(struct itemgra *itemgra, struct attr *attr) { +int itemgra_add_attr(struct itemgra *itemgra, struct attr *attr) { switch (attr->type) { case attr_polygon: case attr_polyline: @@ -384,8 +373,7 @@ itemgra_add_attr(struct itemgra *itemgra, struct attr *attr) { } } -static void -element_set_color(struct element *e, struct attr **attrs) { +static void element_set_color(struct element *e, struct attr **attrs) { struct attr *color; color=attr_search(attrs, NULL, attr_color); if (color) @@ -393,8 +381,7 @@ element_set_color(struct element *e, struct attr **attrs) { } -static void -element_set_background_color(struct color *c, struct attr **attrs) { +static void element_set_background_color(struct color *c, struct attr **attrs) { struct attr *color; color=attr_search(attrs, NULL, attr_background_color); if (color) @@ -402,32 +389,28 @@ element_set_background_color(struct color *c, struct attr **attrs) { } -static void -element_set_text_size(struct element *e, struct attr **attrs) { +static void element_set_text_size(struct element *e, struct attr **attrs) { struct attr *text_size; text_size=attr_search(attrs, NULL, attr_text_size); if (text_size) e->text_size=text_size->u.num; } -static void -element_set_polyline_width(struct element *e, struct attr **attrs) { +static void element_set_polyline_width(struct element *e, struct attr **attrs) { struct attr *width; width=attr_search(attrs, NULL, attr_width); if (width) e->u.polyline.width=width->u.num; } -static void -element_set_polyline_directed(struct element *e, struct attr **attrs) { +static void element_set_polyline_directed(struct element *e, struct attr **attrs) { struct attr *directed; directed=attr_search(attrs, NULL, attr_directed); if (directed) e->u.polyline.directed=directed->u.num; } -static void -element_set_polyline_dash(struct element *e, struct attr **attrs) { +static void element_set_polyline_dash(struct element *e, struct attr **attrs) { struct attr *dash; int i; @@ -442,24 +425,21 @@ element_set_polyline_dash(struct element *e, struct attr **attrs) { } } -static void -element_set_polyline_offset(struct element *e, struct attr **attrs) { +static void element_set_polyline_offset(struct element *e, struct attr **attrs) { struct attr *offset; offset=attr_search(attrs, NULL, attr_offset); if (offset) e->u.polyline.offset=offset->u.num; } -static void -element_set_circle_width(struct element *e, struct attr **attrs) { +static void element_set_circle_width(struct element *e, struct attr **attrs) { struct attr *width; width=attr_search(attrs, NULL, attr_width); if (width) e->u.circle.width=width->u.num; } -static void -element_set_circle_radius(struct element *e, struct attr **attrs) { +static void element_set_circle_radius(struct element *e, struct attr **attrs) { struct attr *radius; radius=attr_search(attrs, NULL, attr_radius); if (radius) @@ -579,8 +559,7 @@ arrows_new(struct attr *parent, struct attr **attrs) { return (struct arrows *)e; } -int -element_add_attr(struct element *e, struct attr *attr) { +int element_add_attr(struct element *e, struct attr *attr) { switch (attr->type) { case attr_coord: e->coord=g_realloc(e->coord,(e->coord_count+1)*sizeof(struct coord)); |