[GRASS-SVN] r41781 - in grass/trunk/vector: v.net.allpairs v.net.bridge v.net.centrality v.net.components v.net.connectivity v.net.distance v.net.flow v.net.spanningtree v.net.timetable

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Apr 10 13:08:11 EDT 2010


Author: martinl
Date: 2010-04-10 13:08:11 -0400 (Sat, 10 Apr 2010)
New Revision: 41781

Modified:
   grass/trunk/vector/v.net.allpairs/main.c
   grass/trunk/vector/v.net.bridge/main.c
   grass/trunk/vector/v.net.centrality/main.c
   grass/trunk/vector/v.net.components/main.c
   grass/trunk/vector/v.net.connectivity/main.c
   grass/trunk/vector/v.net.distance/main.c
   grass/trunk/vector/v.net.flow/main.c
   grass/trunk/vector/v.net.spanningtree/main.c
   grass/trunk/vector/v.net.timetable/main.c
Log:
run grass_indent.sh


Modified: grass/trunk/vector/v.net.allpairs/main.c
===================================================================
--- grass/trunk/vector/v.net.allpairs/main.c	2010-04-10 17:01:48 UTC (rev 41780)
+++ grass/trunk/vector/v.net.allpairs/main.c	2010-04-10 17:08:11 UTC (rev 41781)
@@ -71,9 +71,10 @@
     afcol = G_define_standard_option(G_OPT_DB_COLUMN);
     afcol->key = "afcolumn";
     afcol->required = NO;
-    afcol->description = _("Name of arc forward/both direction(s) cost column");
+    afcol->description =
+	_("Name of arc forward/both direction(s) cost column");
     afcol->guisection = _("Cost");
-	
+
     abcol = G_define_standard_option(G_OPT_DB_COLUMN);
     abcol->key = "abcolumn";
     abcol->required = NO;
@@ -104,8 +105,7 @@
     Vect_set_open_level(2);
 
     if (1 > Vect_open_old(&In, map_in->answer, ""))
-	G_fatal_error(_("Unable to open vector map <%s>"),
-		      map_in->answer);
+	G_fatal_error(_("Unable to open vector map <%s>"), map_in->answer);
 
     with_z = Vect_is_3d(&In);
 
@@ -187,11 +187,13 @@
     max_cat = 0;
     for (i = 1; i <= nlines; i++) {
 	int type = Vect_read_line(&In, Points, Cats, i);
+
 	for (j = 0; j < Cats->n_cats; j++)
 	    if (Cats->cat[j] > max_cat)
 		max_cat = Cats->cat[j];
 	if (type == GV_POINT) {
 	    int node;
+
 	    Vect_get_line_nodes(&In, i, &node, NULL);
 	    Vect_cat_get(Cats, layer, &cats[node]);
 	    if (cats[node] != -1) {

Modified: grass/trunk/vector/v.net.bridge/main.c
===================================================================
--- grass/trunk/vector/v.net.bridge/main.c	2010-04-10 17:01:48 UTC (rev 41780)
+++ grass/trunk/vector/v.net.bridge/main.c	2010-04-10 17:08:11 UTC (rev 41781)
@@ -45,7 +45,8 @@
     G_add_keyword(_("vector"));
     G_add_keyword(_("network"));
     G_add_keyword(_("articulation points"));
-    module->description = _("Computes bridges and articulation points in the network.");
+    module->description =
+	_("Computes bridges and articulation points in the network.");
 
     /* Define the different options as defined in gis.h */
     map_in = G_define_standard_option(G_OPT_V_INPUT);
@@ -78,8 +79,7 @@
     Vect_set_open_level(2);
 
     if (1 > Vect_open_old(&In, map_in->answer, ""))
-	G_fatal_error(_("Unable to open vector map <%s>"),
-		      map_in->answer);
+	G_fatal_error(_("Unable to open vector map <%s>"), map_in->answer);
 
     with_z = Vect_is_3d(&In);
 
@@ -119,6 +119,7 @@
 
 	for (i = 0; i < articulations; i++) {
 	    double x, y, z;
+
 	    Vect_get_node_coor(&In, articulation_list->value[i], &x, &y, &z);
 	    Vect_reset_line(Points);
 	    Vect_append_point(Points, x, y, z);

Modified: grass/trunk/vector/v.net.centrality/main.c
===================================================================
--- grass/trunk/vector/v.net.centrality/main.c	2010-04-10 17:01:48 UTC (rev 41780)
+++ grass/trunk/vector/v.net.centrality/main.c	2010-04-10 17:08:11 UTC (rev 41781)
@@ -27,6 +27,7 @@
 /*Global variables */
 struct Option *deg_opt, *close_opt, *betw_opt, *eigen_opt;
 double *deg, *close, *betw, *eigen;
+
 /* Attribute table */
 dbString sql, tmp;
 dbDriver *driver;
@@ -42,6 +43,7 @@
 void append_double(dbString * string, double d)
 {
     char buf[50];
+
     sprintf(buf, ",%f", d);
     db_append_string(string, buf);
 }
@@ -49,6 +51,7 @@
 void process_node(int node, int cat)
 {
     char buf[2000];
+
     sprintf(buf, "INSERT INTO %s VALUES(%d", Fi->table, cat);
     db_set_string(&sql, buf);
     if (deg_opt->answer)
@@ -92,8 +95,9 @@
     G_add_keyword(_("vector"));
     G_add_keyword(_("network"));
     G_add_keyword(_("centrality measures"));
-    module->description = _("Computes degree, centrality, betweeness, closeness and eigenvector "
-			    "cetrality measures in the network.");
+    module->description =
+	_("Computes degree, centrality, betweeness, closeness and eigenvector "
+	 "cetrality measures in the network.");
 
     /* Define the different options as defined in gis.h */
     map_in = G_define_standard_option(G_OPT_V_INPUT);
@@ -109,7 +113,8 @@
     afcol = G_define_standard_option(G_OPT_DB_COLUMN);
     afcol->key = "afcolumn";
     afcol->required = NO;
-    afcol->description = _("Name of arc forward/both direction(s) cost column");
+    afcol->description =
+	_("Name of arc forward/both direction(s) cost column");
     afcol->guisection = _("Cost");
 
     abcol = G_define_standard_option(G_OPT_DB_COLUMN);
@@ -117,7 +122,7 @@
     abcol->required = NO;
     abcol->description = _("Name of arc backward direction cost column");
     abcol->guisection = _("Cost");
-    
+
     deg_opt = G_define_standard_option(G_OPT_DB_COLUMN);
     deg_opt->key = "degree";
     deg_opt->required = NO;
@@ -182,8 +187,7 @@
     Vect_set_open_level(2);
 
     if (1 > Vect_open_old(&In, map_in->answer, ""))
-	G_fatal_error(_("Unable to open vector map <%s>"),
-		      map_in->answer);
+	G_fatal_error(_("Unable to open vector map <%s>"), map_in->answer);
 
     with_z = Vect_is_3d(&In);
 
@@ -292,8 +296,7 @@
 	NetA_degree_centrality(graph, deg);
     }
     if (betw_opt->answer || close_opt->answer) {
-	G_message(_
-		  ("Computing betweenness and/or closeness centrality measure"));
+	G_message(_("Computing betweenness and/or closeness centrality measure"));
 	NetA_betweenness_closeness(graph, betw, close);
 	if (close)
 	    for (i = 1; i <= nnodes; i++)
@@ -312,8 +315,10 @@
     for (i = 1; i <= nlines; i++) {
 	G_percent(i, nlines, 1);
 	int type = Vect_read_line(&In, Points, Cats, i);
+
 	if (type == GV_POINT && (!chcat || varray->c[i])) {
 	    int cat, node;
+
 	    if (!Vect_cat_get(Cats, layer, &cat))
 		continue;
 	    Vect_write_line(&Out, type, Points, Cats);

Modified: grass/trunk/vector/v.net.components/main.c
===================================================================
--- grass/trunk/vector/v.net.components/main.c	2010-04-10 17:01:48 UTC (rev 41780)
+++ grass/trunk/vector/v.net.components/main.c	2010-04-10 17:08:11 UTC (rev 41781)
@@ -24,10 +24,11 @@
 #include <grass/dbmi.h>
 #include <grass/neta.h>
 
-int insert_new_record(dbDriver * driver, struct field_info *Fi, dbString * sql,
-		      int cat, int comp)
+int insert_new_record(dbDriver * driver, struct field_info *Fi,
+		      dbString * sql, int cat, int comp)
 {
     char buf[2000];
+
     sprintf(buf, "insert into %s values (%d, %d)", Fi->table, cat, comp);
     db_set_string(sql, buf);
     G_debug(3, db_get_string(sql));
@@ -70,7 +71,7 @@
     G_add_keyword(_("components"));
     module->description =
 	_("Computes strongly and weakly connected components in the network.");
-    
+
     /* Define the different options as defined in gis.h */
     map_in = G_define_standard_option(G_OPT_V_INPUT);
     field_opt = G_define_standard_option(G_OPT_V_FIELD);
@@ -106,8 +107,7 @@
     Vect_set_open_level(2);
 
     if (1 > Vect_open_old(&In, map_in->answer, ""))
-	G_fatal_error(_("Unable to open vector map <%s>"),
-		      map_in->answer);
+	G_fatal_error(_("Unable to open vector map <%s>"), map_in->answer);
 
     with_z = Vect_is_3d(&In);
 
@@ -172,11 +172,13 @@
     nlines = Vect_get_num_lines(&In);
     for (i = 1; i <= nlines; i++) {
 	int comp, cat;
+
 	type = Vect_read_line(&In, Points, Cats, i);
 	if (!Vect_cat_get(Cats, layer, &cat))
 	    continue;
 	if (type == GV_LINE || type == GV_BOUNDARY) {
 	    int node1, node2;
+
 	    Vect_get_line_nodes(&In, i, &node1, &node2);
 	    if (component[node1] == component[node2]) {
 		comp = component[node1];
@@ -187,6 +189,7 @@
 	}
 	else if (type == GV_POINT) {
 	    int node;
+
 	    Vect_get_line_nodes(&In, i, &node, NULL);
 	    comp = component[node];
 	    covered[node] = 1;

Modified: grass/trunk/vector/v.net.connectivity/main.c
===================================================================
--- grass/trunk/vector/v.net.connectivity/main.c	2010-04-10 17:01:48 UTC (rev 41780)
+++ grass/trunk/vector/v.net.connectivity/main.c	2010-04-10 17:08:11 UTC (rev 41781)
@@ -76,7 +76,7 @@
     catset1_opt->key = "set1_cats";
     catset1_opt->label = _("Set1 category values");
     catset1_opt->guisection = _("Set1");
-    
+
     whereset1_opt = G_define_standard_option(G_OPT_DB_WHERE);
     whereset1_opt->key = "set1_where";
     whereset1_opt->label =
@@ -87,12 +87,12 @@
     fieldset2_opt->key = "set2_layer";
     fieldset2_opt->description = _("Set2 layer number or name");
     fieldset2_opt->guisection = _("Set2");
-	
+
     catset2_opt = G_define_standard_option(G_OPT_V_CATS);
     catset2_opt->key = "set2_cats";
     catset2_opt->description = _("Set2 category values");
     catset2_opt->guisection = _("Set2");
-	
+
     whereset2_opt = G_define_standard_option(G_OPT_DB_WHERE);
     whereset2_opt->key = "set2_where";
     whereset2_opt->label =
@@ -114,8 +114,7 @@
     Vect_set_open_level(2);
 
     if (1 > Vect_open_old(&In, map_in->answer, ""))
-	G_fatal_error(_("Unable to open vector map <%s>"),
-		      map_in->answer);
+	G_fatal_error(_("Unable to open vector map <%s>"), map_in->answer);
 
     with_z = Vect_is_3d(&In);
 

Modified: grass/trunk/vector/v.net.distance/main.c
===================================================================
--- grass/trunk/vector/v.net.distance/main.c	2010-04-10 17:01:48 UTC (rev 41780)
+++ grass/trunk/vector/v.net.distance/main.c	2010-04-10 17:08:11 UTC (rev 41781)
@@ -62,9 +62,10 @@
     G_add_keyword(_("shortest path"));
     module->label = _("Computes shortest distance via the network between "
 		      "the given sets of features.");
-    module->description = _("Finds the shortest paths from a feature 'to' to every feature 'from' "
-			    "and various information about this realtion are uploaded to the attribute table.");
-    
+    module->description =
+	_("Finds the shortest paths from a feature 'to' to every feature 'from' "
+	 "and various information about this realtion are uploaded to the attribute table.");
+
     /* Define the different options as defined in gis.h */
     map_in = G_define_standard_option(G_OPT_V_INPUT);
     map_out = G_define_standard_option(G_OPT_V_OUTPUT);
@@ -73,7 +74,7 @@
     fieldf_opt->key = "from_layer";
     fieldf_opt->label = _("From layer number or name");
     fieldf_opt->guisection = _("From");
-    
+
     catf_opt = G_define_standard_option(G_OPT_V_CATS);
     catf_opt->key = "from_cats";
     catf_opt->label = _("From category values");
@@ -107,7 +108,7 @@
     to_type_opt->answer = "point";
     to_type_opt->description = _("To feature type");
     to_type_opt->guisection = _("To");
-    
+
     afcol = G_define_standard_option(G_OPT_DB_COLUMN);
     afcol->key = "afcolumn";
     afcol->required = YES;
@@ -134,12 +135,11 @@
 
     Vect_check_input_output_name(map_in->answer, map_out->answer,
 				 GV_FATAL_EXIT);
-    
+
     Vect_set_open_level(2);
 
     if (1 > Vect_open_old(&In, map_in->answer, ""))
-	G_fatal_error(_("Unable to open vector map <%s>"),
-		      map_in->answer);
+	G_fatal_error(_("Unable to open vector map <%s>"), map_in->answer);
 
     with_z = Vect_is_3d(&In);
 
@@ -230,6 +230,7 @@
 	    int node, tcat, cat;
 	    double cost;
 	    dglInt32_t *vertex, vertex_id;
+
 	    if (!Vect_cat_get(Cats, flayer, &cat))
 		continue;
 	    Vect_get_line_nodes(&In, i, &node, NULL);
@@ -262,6 +263,7 @@
     for (i = 1; i <= nlines; i++)
 	if (on_path[i]->n_cats > 0) {
 	    int type = Vect_read_line(&In, Points, NULL, i);
+
 	    Vect_write_line(&Out, type, Points, on_path[i]);
 	}
 

Modified: grass/trunk/vector/v.net.flow/main.c
===================================================================
--- grass/trunk/vector/v.net.flow/main.c	2010-04-10 17:01:48 UTC (rev 41780)
+++ grass/trunk/vector/v.net.flow/main.c	2010-04-10 17:08:11 UTC (rev 41781)
@@ -69,12 +69,14 @@
 
     cut_out = G_define_standard_option(G_OPT_V_OUTPUT);
     cut_out->key = "cut";
-    cut_out->description = _("Name for output vector map containing a minimum cut");
+    cut_out->description =
+	_("Name for output vector map containing a minimum cut");
 
     afcol = G_define_standard_option(G_OPT_DB_COLUMN);
     afcol->key = "afcolumn";
     afcol->required = NO;
-    afcol->description = _("Name of arc forward/both direction(s) capacity column");
+    afcol->description =
+	_("Name of arc forward/both direction(s) capacity column");
 
     abcol = G_define_standard_option(G_OPT_DB_COLUMN);
     abcol->key = "abcolumn";
@@ -129,8 +131,7 @@
     Vect_set_open_level(2);
 
     if (1 > Vect_open_old(&In, map_in->answer, ""))
-	G_fatal_error(_("Unable to open vector map <%s>"),
-		      map_in->answer);
+	G_fatal_error(_("Unable to open vector map <%s>"), map_in->answer);
 
     with_z = Vect_is_3d(&In);
 
@@ -182,8 +183,8 @@
     sink_list = Vect_new_list();
 
     if (NetA_initialise_varray
-	(&In, atoi(fieldsource_opt->answer), GV_POINT, wheresource_opt->answer,
-	 catsource_opt->answer, &varray_source) == 2)
+	(&In, atoi(fieldsource_opt->answer), GV_POINT,
+	 wheresource_opt->answer, catsource_opt->answer, &varray_source) == 2)
 	G_fatal_error(_("Neither %s nor %s was given"), catsource_opt->key,
 		      wheresource_opt->key);
     if (NetA_initialise_varray
@@ -227,9 +228,11 @@
     for (i = 1; i <= nlines; i++) {
 	G_percent(i, nlines, 1);
 	int type = Vect_read_line(&In, Points, Cats, i);
+
 	Vect_write_line(&Out, type, Points, Cats);
 	if (type == GV_LINE) {
 	    int cat;
+
 	    Vect_cat_get(Cats, layer, &cat);
 	    if (cat == -1)
 		continue;	/*TODO: warning? */
@@ -249,6 +252,7 @@
     if (find_cut) {
 	for (i = 0; i < cut->n_values; i++) {
 	    int type = Vect_read_line(&In, Points, Cats, cut->value[i]);
+
 	    Vect_write_line(&cut_map, type, Points, Cats);
 	}
 	Vect_destroy_list(cut);

Modified: grass/trunk/vector/v.net.spanningtree/main.c
===================================================================
--- grass/trunk/vector/v.net.spanningtree/main.c	2010-04-10 17:01:48 UTC (rev 41780)
+++ grass/trunk/vector/v.net.spanningtree/main.c	2010-04-10 17:08:11 UTC (rev 41781)
@@ -46,7 +46,8 @@
     G_add_keyword(_("vector"));
     G_add_keyword(_("network"));
     G_add_keyword(_("spanning tree"));
-    module->description = _("Computes minimum spanning tree for the network.");
+    module->description =
+	_("Computes minimum spanning tree for the network.");
 
     /* Define the different options as defined in gis.h */
     map_in = G_define_standard_option(G_OPT_V_INPUT);
@@ -79,8 +80,7 @@
     Vect_set_open_level(2);
 
     if (1 > Vect_open_old(&In, map_in->answer, ""))
-	G_fatal_error(_("Unable to open vector map <%s>"),
-		      map_in->answer);
+	G_fatal_error(_("Unable to open vector map <%s>"), map_in->answer);
 
     with_z = Vect_is_3d(&In);
 
@@ -112,7 +112,8 @@
     edges = NetA_spanning_tree(graph, tree_list);
     G_debug(3, "Edges: %d", edges);
     for (i = 0; i < edges; i++) {
-	int type = Vect_read_line(&In, Points, Cats, abs(tree_list->value[i]));
+	int type =
+	    Vect_read_line(&In, Points, Cats, abs(tree_list->value[i]));
 	Vect_write_line(&Out, type, Points, Cats);
     }
     Vect_destroy_list(tree_list);

Modified: grass/trunk/vector/v.net.timetable/main.c
===================================================================
--- grass/trunk/vector/v.net.timetable/main.c	2010-04-10 17:01:48 UTC (rev 41780)
+++ grass/trunk/vector/v.net.timetable/main.c	2010-04-10 17:08:11 UTC (rev 41781)
@@ -45,8 +45,10 @@
 {
     if (result.prev_stop[connection][stop] == -1)
 	return;
-    struct segment *seg = (struct segment *)G_calloc(1, sizeof(struct segment));
+    struct segment *seg =
+	(struct segment *)G_calloc(1, sizeof(struct segment));
     int prev_conn = result.prev_conn[connection][stop];
+
     seg->next = head.next;
     head.next = seg;
     seg->route = result.prev_route[connection][stop];
@@ -80,10 +82,11 @@
 {
     dbString sql;
     char buf[2000];
+
     /* Create table */
     *Fi = Vect_default_field_info(Out, layer, NULL, GV_MTABLE);
-    Vect_map_add_dblink(Out, layer, NULL, (*Fi)->table, "cat", (*Fi)->database,
-			(*Fi)->driver);
+    Vect_map_add_dblink(Out, layer, NULL, (*Fi)->table, "cat",
+			(*Fi)->database, (*Fi)->driver);
     db_init_string(&sql);
     *driver = db_start_driver_open_database((*Fi)->driver, (*Fi)->database);
     if (*driver == NULL)
@@ -104,18 +107,22 @@
 	G_warning(_("Cannot create index"));
 
     if (db_grant_on_table
-	(*driver, (*Fi)->table, DB_PRIV_SELECT, DB_GROUP | DB_PUBLIC) != DB_OK)
-	G_fatal_error(_("Cannot grant privileges on table <%s>"), (*Fi)->table);
+	(*driver, (*Fi)->table, DB_PRIV_SELECT,
+	 DB_GROUP | DB_PUBLIC) != DB_OK)
+	G_fatal_error(_("Cannot grant privileges on table <%s>"),
+		      (*Fi)->table);
 
     db_free_string(&sql);
     db_begin_transaction(*driver);
 }
 
 void insert_point(dbDriver * driver, char *table, int cat, int path,
-		  int stop_id, int index, int arrival_time, int departure_time)
+		  int stop_id, int index, int arrival_time,
+		  int departure_time)
 {
     char buf[2000];
     dbString sql;
+
     db_init_string(&sql);
 
     sprintf(buf, "insert into %s values (%d, %d, %d, %d, %d, %d)", table, cat,
@@ -130,11 +137,13 @@
     db_free_string(&sql);
 }
 
-void insert_line(dbDriver * driver, char *table, int cat, int path, int from_id,
-		 int to_id, int route_id, int index, int from_time, int to_time)
+void insert_line(dbDriver * driver, char *table, int cat, int path,
+		 int from_id, int to_id, int route_id, int index,
+		 int from_time, int to_time)
 {
     char buf[2000];
     dbString sql;
+
     db_init_string(&sql);
 
     sprintf(buf, "insert into %s values (%d, %d, %d, %d, %d, %d, %d, %d)",
@@ -154,6 +163,7 @@
 {
     int i, mini = -1;
     double mind, d;
+
     for (i = 0; i < timetable.stops; i++) {
 	if (!found[i])
 	    continue;
@@ -173,6 +183,7 @@
     struct line_pnts *Points;
     struct line_cats *Cats;
     struct ilist *list;
+
     Points = Vect_new_line_struct();
     Cats = Vect_new_cats_struct();
     list = Vect_new_list();
@@ -199,6 +210,7 @@
 	     stop_node[timetable.route_stops[r][i + 1]], edges, list) != -1) {
 	    for (j = 0; j < list->n_values; j++) {
 		int type = Vect_read_line(&In, Points, NULL, list->value[j]);
+
 		Vect_write_line(&Out, type, Points, Cats);
 	    }
 	}
@@ -223,8 +235,8 @@
 	*stop_time_opt, *to_stop_opt, *walk_length_opt;
     int with_z;
     int layer, mask_type, path_layer;
-    int from_stop, to_stop, start_time, min_change, max_changes, walking_change,
-	ret;
+    int from_stop, to_stop, start_time, min_change, max_changes,
+	walking_change, ret;
     int *stop_pnt, i, nlines, point_counter, *route_pnt;
     int line_counter, index, j;
     struct segment *cur;
@@ -253,7 +265,8 @@
     walk_layer_opt = G_define_standard_option(G_OPT_V_FIELD_ALL);
     walk_layer_opt->key = "walk_layer";
     walk_layer_opt->answer = "-1";
-    walk_layer_opt->label = _("Layer number or name with walking connections or -1");
+    walk_layer_opt->label =
+	_("Layer number or name with walking connections or -1");
 
     path_layer_opt = G_define_standard_option(G_OPT_V_FIELD_ALL);
     path_layer_opt->key = "path_layer";
@@ -270,7 +283,8 @@
     stop_time_opt->key = "stop_time";
     stop_time_opt->required = YES;
     stop_time_opt->answer = "stop_time";
-    stop_time_opt->description = _("Name of column name with stop timestamps");
+    stop_time_opt->description =
+	_("Name of column name with stop timestamps");
 
     to_stop_opt = G_define_standard_option(G_OPT_DB_COLUMN);
     to_stop_opt->key = "to_stop";
@@ -283,7 +297,7 @@
     walk_length_opt->required = YES;
     walk_length_opt->answer = "length";
     walk_length_opt->description = _("Name of column name with walk lengths");
-    
+
     /* options and flags parser */
     if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
@@ -302,8 +316,7 @@
     Vect_set_open_level(2);
 
     if (1 > Vect_open_old(&In, map_in->answer, ""))
-	G_fatal_error(_("Unable to open vector map <%s>"),
-		      map_in->answer);
+	G_fatal_error(_("Unable to open vector map <%s>"), map_in->answer);
 
     with_z = Vect_is_3d(&In);
 
@@ -345,15 +358,16 @@
 	nnodes = Vect_get_num_nodes(&In);
 	stop_node = (int *)G_calloc(timetable.stops, sizeof(int));
 	lines =
-	    (struct ilist **)G_calloc(timetable.routes, sizeof(struct ilist *));
+	    (struct ilist **)G_calloc(timetable.routes,
+				      sizeof(struct ilist *));
 	edges = (int *)G_calloc(nnodes + 1, sizeof(int));
 	if (!edges || !stop_node || !lines)
 	    G_fatal_error(_("Out of memory"));
 	for (i = 0; i < timetable.routes; i++)
 	    lines[i] = Vect_new_list();
 
-	Vect_net_build_graph(&In, mask_type, path_layer, 0, NULL, NULL, NULL, 0,
-			     0);
+	Vect_net_build_graph(&In, mask_type, path_layer, 0, NULL, NULL, NULL,
+			     0, 0);
 	graph = &(In.graph);
     }
 
@@ -361,15 +375,17 @@
     nlines = Vect_get_num_lines(&In);
     for (i = 1; i <= nlines; i++) {
 	int type = Vect_read_line(&In, Points, Cats, i);
+
 	if (type == GV_POINT) {
 	    int cat, stop, node;
+
 	    for (j = 0; j < Cats->n_cats; j++) {
 		if (Cats->field[j] != layer)
 		    continue;
 		cat = Cats->cat[j];
 		stop_pnt =
-		    (int *)bsearch(&cat, stop_ids, timetable.stops, sizeof(int),
-				   int_cmp);
+		    (int *)bsearch(&cat, stop_ids, timetable.stops,
+				   sizeof(int), int_cmp);
 		if (!stop_pnt)
 		    continue;
 
@@ -387,6 +403,7 @@
 	}
 	else if (type == GV_LINE && path_layer > 0) {
 	    int cat;
+
 	    for (j = 0; j < Cats->n_cats; j++) {
 		if (Cats->field[j] != path_layer)
 		    continue;
@@ -409,6 +426,7 @@
     while (1) {
 	double fx, fy, tx, ty;
 	int path_id;
+
 	if (fgets(buf, sizeof(buf), stdin) == NULL)
 	    break;
 	ret =
@@ -438,8 +456,8 @@
 	    }
 	    from_stop = stop_pnt - stop_ids;
 	    stop_pnt =
-		(int *)bsearch(&to_stop, stop_ids, timetable.stops, sizeof(int),
-			       int_cmp);
+		(int *)bsearch(&to_stop, stop_ids, timetable.stops,
+			       sizeof(int), int_cmp);
 	    if (!stop_pnt) {
 		G_warning(_("No stop with category: %d"), to_stop);
 		continue;
@@ -474,12 +492,14 @@
 	Vect_cat_set(Cats, 1, point_counter);
 	Vect_write_line(&Out, GV_POINT, Cur, Cats);
 	insert_point(point_driver, point_Fi->table, point_counter, path_id,
-		     stop_ids[from_stop], 1, start_time, head.next->from_time);
+		     stop_ids[from_stop], 1, start_time,
+		     head.next->from_time);
 	point_counter++;
 	Vect_append_points(Prev, Cur, GV_FORWARD);
 	index = 1;
 	for (cur = head.next; cur; cur = cur->next) {
 	    int dept_time, route_id;
+
 	    if (cur->route == -2) {
 		printf("Walk ");
 		route_id = -1;



More information about the grass-commit mailing list