6 #include "mapper-types.h"
12 path_resize(Path *path, guint size)
14 if (path->head + size != path->cap) {
15 Point *old_head = path->head;
17 path->head = g_renew(Point, old_head, size);
18 path->cap = path->head + size;
19 if (path->head != old_head) {
20 path->tail = path->head + (path->tail - old_head);
22 /* Adjust all of the waypoints. */
23 for (curr = path->whead - 1; curr++ != path->wtail;)
24 curr->point = path->head + (curr->point - old_head);
30 path_wresize(Path *path, guint wsize)
32 if (path->whead + wsize != path->wcap) {
33 WayPoint *old_whead = path->whead;
34 path->whead = g_renew(WayPoint, old_whead, wsize);
35 path->wtail = path->whead + (path->wtail - old_whead);
36 path->wcap = path->whead + wsize;