]> err.no Git - mapper/commitdiff
Path: move privat macros into path.c from path.h
authorKaj-Michael Lang <milang@tal.org>
Thu, 12 Jun 2008 12:16:23 +0000 (15:16 +0300)
committerKaj-Michael Lang <milang@tal.org>
Thu, 12 Jun 2008 12:16:23 +0000 (15:16 +0300)
libs/libgtkmap/path.c
libs/libgtkmap/path.h

index ec2de141585a29fa8bf27516eadcae970f5719ce..59d72b203db5d4d57483bbe5fe4c63e3b3ed6274 100644 (file)
@@ -67,6 +67,35 @@ static struct sql_select_stmt sql;
 #define PATH_SQL_INSERT_TRACK_POINT "insert into trackpoints (tid,dt,lat,lon,alt,hdop,vdop,pdop,sat,fix) values (?,?,?,?,?,?,?,?,?,?)"
 #define PATH_SQL_SELECT_TRACK_POINTS "select tid,dt,lat,lon,alt,hdop,vdop,pdop,sat,fix from trackpoints where tid=? order by dt"
 
+#define MACRO_PATH_INIT(path) { \
+       (path).head = (path).tail = g_new0(Point, ARRAY_CHUNK_SIZE); \
+       *((path).tail) = _point_null; \
+       (path).cap = (path).head + ARRAY_CHUNK_SIZE; \
+       (path).whead = g_new0(WayPoint, ARRAY_CHUNK_SIZE); \
+       (path).wtail = (path).whead; \
+       (path).wcap = (path).whead + ARRAY_CHUNK_SIZE; \
+}
+
+#define MACRO_PATH_FREE(path) if((path).head) { \
+       WayPoint *curr; \
+       g_free((path).head); \
+       (path).head = (path).tail = (path).cap = NULL; \
+       for(curr = (path).whead; curr++ != (path).wtail; ) \
+               g_free(curr->desc); \
+       g_free((path).whead); \
+       (path).whead = (path).wtail = (path).wcap = NULL; \
+}
+
+#define MACRO_PATH_INCREMENT_TAIL(route) { \
+       if(++(route).tail == (route).cap) \
+               path_resize(&(route), (route).cap - (route).head + ARRAY_CHUNK_SIZE);\
+}
+
+#define MACRO_PATH_INCREMENT_WTAIL(route) { \
+       if(++(route).wtail == (route).wcap) \
+               path_wresize(&(route), (route).wcap - (route).whead + ARRAY_CHUNK_SIZE); \
+}
+
 enum {
        NEW_POINT,                              /* A new point was appended to track track */
        NEW_BREAK,                              /* A break was appended to the track */
index 5cf25be77e93901a6bc439208a55c03083f5adab..703021c5dec5bd72176edf619ae91a6be5f7e10c 100644 (file)
@@ -197,35 +197,6 @@ gboolean path_get_waypoint_latlon(WayPoint *way, gdouble *lat, gdouble *lon);
 
 GtkListStore *path_get_waypoints_store(Path *path);
 
-#define MACRO_PATH_INIT(path) { \
-       (path).head = (path).tail = g_new0(Point, ARRAY_CHUNK_SIZE); \
-       *((path).tail) = _point_null; \
-       (path).cap = (path).head + ARRAY_CHUNK_SIZE; \
-       (path).whead = g_new0(WayPoint, ARRAY_CHUNK_SIZE); \
-       (path).wtail = (path).whead; \
-       (path).wcap = (path).whead + ARRAY_CHUNK_SIZE; \
-}
-
-#define MACRO_PATH_FREE(path) if((path).head) { \
-       WayPoint *curr; \
-       g_free((path).head); \
-       (path).head = (path).tail = (path).cap = NULL; \
-       for(curr = (path).whead; curr++ != (path).wtail; ) \
-               g_free(curr->desc); \
-       g_free((path).whead); \
-       (path).whead = (path).wtail = (path).wcap = NULL; \
-}
-
-#define MACRO_PATH_INCREMENT_TAIL(route) { \
-       if(++(route).tail == (route).cap) \
-               path_resize(&(route), (route).cap - (route).head + ARRAY_CHUNK_SIZE);\
-}
-
-#define MACRO_PATH_INCREMENT_WTAIL(route) { \
-       if(++(route).wtail == (route).wcap) \
-               path_wresize(&(route), (route).wcap - (route).whead + ARRAY_CHUNK_SIZE); \
-}
-
 G_END_DECLS
 
 #endif