From 988e298c31a28579005e9da5d8bb269f20f75094 Mon Sep 17 00:00:00 2001 From: Nicklas Larsson Date: Tue, 31 Jan 2023 17:59:30 +0100 Subject: [PATCH 1/2] reading 'struct Map_info*' objects is technically not const --- include/grass/defs/vector.h | 280 ++++++++++++++--------------- lib/vector/Vlib/area.c | 33 ++-- lib/vector/Vlib/area_pg.c | 2 +- lib/vector/Vlib/array.c | 9 +- lib/vector/Vlib/box.c | 11 +- lib/vector/Vlib/buffer2.c | 8 +- lib/vector/Vlib/build.c | 8 +- lib/vector/Vlib/build_sfa.c | 2 +- lib/vector/Vlib/cindex.c | 35 ++-- lib/vector/Vlib/close.c | 4 +- lib/vector/Vlib/constraint.c | 2 +- lib/vector/Vlib/copy.c | 27 ++- lib/vector/Vlib/dbcolumns.c | 6 +- lib/vector/Vlib/field.c | 18 +- lib/vector/Vlib/geos_to_wktb.c | 2 +- lib/vector/Vlib/header.c | 36 ++-- lib/vector/Vlib/header_finfo.c | 12 +- lib/vector/Vlib/hist.c | 4 +- lib/vector/Vlib/init_head.c | 2 +- lib/vector/Vlib/level.c | 2 +- lib/vector/Vlib/level_two.c | 51 +++--- lib/vector/Vlib/line.c | 2 +- lib/vector/Vlib/local_proto.h | 13 +- lib/vector/Vlib/net_analyze.c | 4 +- lib/vector/Vlib/open.c | 10 +- lib/vector/Vlib/pg_local_proto.h | 2 +- lib/vector/Vlib/poly.c | 12 +- lib/vector/Vlib/read.c | 43 ++--- lib/vector/Vlib/read_ogr.c | 9 +- lib/vector/Vlib/simple_features.c | 2 +- lib/vector/Vlib/write.c | 4 +- lib/vector/Vlib/write_nat.c | 3 +- lib/vector/Vlib/write_pg.c | 4 +- vector/v.colors/local_proto.h | 12 +- vector/v.colors/read_rgb.c | 2 +- vector/v.colors/scan_attr.c | 2 +- vector/v.colors/scan_cats.c | 2 +- vector/v.colors/write_rgb.c | 4 +- vector/v.decimate/copy_tab.c | 2 +- vector/v.decimate/main.c | 2 +- vector/v.distance/distance.c | 10 +- vector/v.distance/local_proto.h | 10 +- vector/v.extract/copy_tab.c | 2 +- vector/v.extract/local_proto.h | 2 +- vector/v.info/local_proto.h | 10 +- vector/v.info/print.c | 10 +- vector/v.out.postgis/local_proto.h | 3 +- vector/v.out.postgis/table.c | 2 +- 48 files changed, 356 insertions(+), 381 deletions(-) diff --git a/include/grass/defs/vector.h b/include/grass/defs/vector.h index 4139789dd09..c1fca8842ac 100644 --- a/include/grass/defs/vector.h +++ b/include/grass/defs/vector.h @@ -44,9 +44,9 @@ void Vect_line_buffer(const struct line_pnts *, double, double, void Vect_line_buffer2(const struct line_pnts *, double, double, double, int, int, double, struct line_pnts **, struct line_pnts ***, int *); -void Vect_area_buffer2(const struct Map_info *, int, double, double, double, - int, int, double, struct line_pnts **, - struct line_pnts ***, int *); +void Vect_area_buffer2(struct Map_info *, int, double, double, double, int, int, + double, struct line_pnts **, struct line_pnts ***, + int *); void Vect_point_buffer2(double, double, double, double, double, int, double, struct line_pnts **); @@ -60,9 +60,9 @@ int Vect_field_cat_get(const struct line_cats *, int, struct ilist *); int Vect_cat_in_array(int, const int *, int); int Vect_reset_cats(struct line_cats *); void Vect_destroy_cats_struct(struct line_cats *); -int Vect_get_area_cats(const struct Map_info *, int, struct line_cats *); -int Vect_get_area_cat(const struct Map_info *, int, int); -int Vect_get_line_cat(const struct Map_info *, int, int); +int Vect_get_area_cats(struct Map_info *, int, struct line_cats *); +int Vect_get_area_cat(struct Map_info *, int, int); +int Vect_get_line_cat(struct Map_info *, int, int); struct cat_list *Vect_cats_set_constraint(struct Map_info *, int, char *, char *); int Vect_cats_in_constraint(struct line_cats *, int, struct cat_list *); @@ -77,12 +77,12 @@ void Vect_destroy_cat_list(struct cat_list *); /* Vector array */ struct varray *Vect_new_varray(int); -int Vect_set_varray_from_cat_string(const struct Map_info *, int, const char *, - int, int, struct varray *); -int Vect_set_varray_from_cat_list(const struct Map_info *, int, - struct cat_list *, int, int, struct varray *); -int Vect_set_varray_from_db(const struct Map_info *, int, const char *, int, - int, struct varray *); +int Vect_set_varray_from_cat_string(struct Map_info *, int, const char *, int, + int, struct varray *); +int Vect_set_varray_from_cat_list(struct Map_info *, int, struct cat_list *, + int, int, struct varray *); +int Vect_set_varray_from_db(struct Map_info *, int, const char *, int, int, + struct varray *); /* DB connection - field info */ struct dblinks *Vect_new_dblinks_struct(void); @@ -93,22 +93,21 @@ int Vect_check_dblink(const struct dblinks *, int, const char *); int Vect_map_add_dblink(struct Map_info *, int, const char *, const char *, const char *, const char *, const char *); int Vect_map_del_dblink(struct Map_info *, int); -void Vect_copy_map_dblinks(const struct Map_info *, struct Map_info *, int); -int Vect_map_check_dblink(const struct Map_info *, int, const char *); +void Vect_copy_map_dblinks(struct Map_info *, struct Map_info *, int); +int Vect_map_check_dblink(struct Map_info *, int, const char *); int Vect_read_dblinks(struct Map_info *); int Vect_write_dblinks(struct Map_info *); struct field_info *Vect_default_field_info(struct Map_info *, int, const char *, int); -struct field_info *Vect_get_dblink(const struct Map_info *, int); -struct field_info *Vect_get_field(const struct Map_info *, int); -struct field_info *Vect_get_field_by_name(const struct Map_info *, - const char *); -struct field_info *Vect_get_field2(const struct Map_info *, const char *); -int Vect_get_field_number(const struct Map_info *, const char *); +struct field_info *Vect_get_dblink(struct Map_info *, int); +struct field_info *Vect_get_field(struct Map_info *, int); +struct field_info *Vect_get_field_by_name(struct Map_info *, const char *); +struct field_info *Vect_get_field2(struct Map_info *, const char *); +int Vect_get_field_number(struct Map_info *, const char *); void Vect_set_db_updated(struct Map_info *); -const char *Vect_get_column_names(const struct Map_info *, int); -const char *Vect_get_column_types(const struct Map_info *, int); -const char *Vect_get_column_names_types(const struct Map_info *, int); +const char *Vect_get_column_names(struct Map_info *, int); +const char *Vect_get_column_types(struct Map_info *, int); +const char *Vect_get_column_names_types(struct Map_info *, int); /* List of FID (feature ID) (integers) */ struct ilist *Vect_new_list(void); @@ -141,22 +140,21 @@ int Vect_box_clip(double *, double *, double *, double *, int Vect_region_box(const struct Cell_head *, struct bound_box *); /* Category index */ -int Vect_cidx_get_num_fields(const struct Map_info *); -int Vect_cidx_get_field_number(const struct Map_info *, int); -int Vect_cidx_get_field_index(const struct Map_info *, int); -int Vect_cidx_get_num_unique_cats_by_index(const struct Map_info *, int); -int Vect_cidx_get_num_cats_by_index(const struct Map_info *, int); -int Vect_cidx_get_num_types_by_index(const struct Map_info *, int); -int Vect_cidx_get_type_count_by_index(const struct Map_info *, int, int, int *, +int Vect_cidx_get_num_fields(struct Map_info *); +int Vect_cidx_get_field_number(struct Map_info *, int); +int Vect_cidx_get_field_index(struct Map_info *, int); +int Vect_cidx_get_num_unique_cats_by_index(struct Map_info *, int); +int Vect_cidx_get_num_cats_by_index(struct Map_info *, int); +int Vect_cidx_get_num_types_by_index(struct Map_info *, int); +int Vect_cidx_get_type_count_by_index(struct Map_info *, int, int, int *, int *); -int Vect_cidx_get_type_count(const struct Map_info *, int, int); -int Vect_cidx_get_cat_by_index(const struct Map_info *, int, int, int *, int *, +int Vect_cidx_get_type_count(struct Map_info *, int, int); +int Vect_cidx_get_cat_by_index(struct Map_info *, int, int, int *, int *, int *); int Vect_cidx_get_unique_cats_by_index(struct Map_info *, int, struct ilist *); -int Vect_cidx_find_next(const struct Map_info *, int, int, int, int, int *, - int *); -void Vect_cidx_find_all(const struct Map_info *, int, int, int, struct ilist *); -int Vect_cidx_dump(const struct Map_info *, FILE *); +int Vect_cidx_find_next(struct Map_info *, int, int, int, int, int *, int *); +void Vect_cidx_find_all(struct Map_info *, int, int, int, struct ilist *); +int Vect_cidx_dump(struct Map_info *, FILE *); int Vect_cidx_save(struct Map_info *); int Vect_cidx_open(struct Map_info *, int); @@ -166,62 +164,61 @@ void Vect_destroy_map_struct(struct Map_info *); /* Set/get map header info */ int Vect_read_header(struct Map_info *); -int Vect_write_header(const struct Map_info *); -const char *Vect_get_name(const struct Map_info *); -const char *Vect_get_mapset(const struct Map_info *); -const char *Vect_get_full_name(const struct Map_info *); -const char *Vect_get_finfo_dsn_name(const struct Map_info *); -char *Vect_get_finfo_layer_name(const struct Map_info *); -const char *Vect_get_finfo_format_info(const struct Map_info *); -const char *Vect_get_finfo_geometry_type(const struct Map_info *); -const struct Format_info *Vect_get_finfo(const struct Map_info *); -int Vect_get_finfo_topology_info(const struct Map_info *, char **, char **, - int *); -int Vect_is_3d(const struct Map_info *); +int Vect_write_header(struct Map_info *); +const char *Vect_get_name(struct Map_info *); +const char *Vect_get_mapset(struct Map_info *); +const char *Vect_get_full_name(struct Map_info *); +const char *Vect_get_finfo_dsn_name(struct Map_info *); +char *Vect_get_finfo_layer_name(struct Map_info *); +const char *Vect_get_finfo_format_info(struct Map_info *); +const char *Vect_get_finfo_geometry_type(struct Map_info *); +const struct Format_info *Vect_get_finfo(struct Map_info *); +int Vect_get_finfo_topology_info(struct Map_info *, char **, char **, int *); +int Vect_is_3d(struct Map_info *); int Vect_set_organization(struct Map_info *, const char *); -const char *Vect_get_organization(const struct Map_info *); +const char *Vect_get_organization(struct Map_info *); int Vect_set_date(struct Map_info *, const char *); -const char *Vect_get_date(const struct Map_info *); +const char *Vect_get_date(struct Map_info *); int Vect_set_person(struct Map_info *, const char *); -const char *Vect_get_person(const struct Map_info *); +const char *Vect_get_person(struct Map_info *); int Vect_set_map_name(struct Map_info *, const char *); -const char *Vect_get_map_name(const struct Map_info *); +const char *Vect_get_map_name(struct Map_info *); int Vect_set_map_date(struct Map_info *, const char *); -const char *Vect_get_map_date(const struct Map_info *); +const char *Vect_get_map_date(struct Map_info *); int Vect_set_comment(struct Map_info *, const char *); -const char *Vect_get_comment(const struct Map_info *); +const char *Vect_get_comment(struct Map_info *); int Vect_set_scale(struct Map_info *, int); -int Vect_get_scale(const struct Map_info *); +int Vect_get_scale(struct Map_info *); int Vect_set_zone(struct Map_info *, int); -int Vect_get_zone(const struct Map_info *); -int Vect_get_proj(const struct Map_info *); +int Vect_get_zone(struct Map_info *); +int Vect_get_proj(struct Map_info *); int Vect_set_proj(struct Map_info *, int); -const char *Vect_get_proj_name(const struct Map_info *); +const char *Vect_get_proj_name(struct Map_info *); int Vect_set_thresh(struct Map_info *, double); -double Vect_get_thresh(const struct Map_info *); -int Vect_get_constraint_box(const struct Map_info *, struct bound_box *); +double Vect_get_thresh(struct Map_info *); +int Vect_get_constraint_box(struct Map_info *, struct bound_box *); /* Get map information */ -int Vect_level(const struct Map_info *); +int Vect_level(struct Map_info *); /* Get map level 1 information */ int Vect_get_map_box1(struct Map_info *, struct bound_box *); /* Get map level 2 information */ -int Vect_get_line_type(const struct Map_info *, int); -plus_t Vect_get_num_nodes(const struct Map_info *); -plus_t Vect_get_num_primitives(const struct Map_info *, int); -plus_t Vect_get_num_lines(const struct Map_info *); -plus_t Vect_get_num_areas(const struct Map_info *); -plus_t Vect_get_num_faces(const struct Map_info *); -plus_t Vect_get_num_kernels(const struct Map_info *); -plus_t Vect_get_num_volumes(const struct Map_info *); -plus_t Vect_get_num_islands(const struct Map_info *); -plus_t Vect_get_num_holes(const struct Map_info *); -int Vect_get_line_box(const struct Map_info *, int, struct bound_box *); -int Vect_get_area_box(const struct Map_info *, int, struct bound_box *); -int Vect_get_isle_box(const struct Map_info *, int, struct bound_box *); -int Vect_get_map_box(const struct Map_info *, struct bound_box *); +int Vect_get_line_type(struct Map_info *, int); +plus_t Vect_get_num_nodes(struct Map_info *); +plus_t Vect_get_num_primitives(struct Map_info *, int); +plus_t Vect_get_num_lines(struct Map_info *); +plus_t Vect_get_num_areas(struct Map_info *); +plus_t Vect_get_num_faces(struct Map_info *); +plus_t Vect_get_num_kernels(struct Map_info *); +plus_t Vect_get_num_volumes(struct Map_info *); +plus_t Vect_get_num_islands(struct Map_info *); +plus_t Vect_get_num_holes(struct Map_info *); +int Vect_get_line_box(struct Map_info *, int, struct bound_box *); +int Vect_get_area_box(struct Map_info *, int, struct bound_box *); +int Vect_get_isle_box(struct Map_info *, int, struct bound_box *); +int Vect_get_map_box(struct Map_info *, struct bound_box *); int V__map_overlap(struct Map_info *, double, double, double, double); void Vect_set_release_support(struct Map_info *); void Vect_set_category_index_update(struct Map_info *); @@ -243,10 +240,10 @@ int Vect_open_tmp_update(struct Map_info *, const char *, const char *); int Vect_open_update2(struct Map_info *, const char *, const char *, const char *); int Vect_open_update_head(struct Map_info *, const char *, const char *); -int Vect_copy_head_data(const struct Map_info *, struct Map_info *); +int Vect_copy_head_data(struct Map_info *, struct Map_info *); int Vect_build(struct Map_info *); int Vect_topo_check(struct Map_info *, struct Map_info *); -int Vect_get_built(const struct Map_info *); +int Vect_get_built(struct Map_info *); int Vect_build_partial(struct Map_info *, int); int Vect_set_constraint_region(struct Map_info *, double, double, double, double, double, double); @@ -259,8 +256,8 @@ void Vect_set_error_handler_io(struct Map_info *, struct Map_info *); /* Read/write lines, nodes, areas */ /* Level 1 and 2 */ -int Vect_get_next_line_id(const struct Map_info *); -int Vect_read_next_line(const struct Map_info *, struct line_pnts *, +int Vect_get_next_line_id(struct Map_info *); +int Vect_read_next_line(struct Map_info *, struct line_pnts *, struct line_cats *); off_t Vect_write_line(struct Map_info *, int, const struct line_pnts *, const struct line_cats *); @@ -269,55 +266,54 @@ off_t Vect_rewrite_line(struct Map_info *, off_t, int, const struct line_pnts *, int Vect_delete_line(struct Map_info *, off_t); int Vect_restore_line(struct Map_info *, off_t, off_t); -int Vect_get_num_dblinks(const struct Map_info *); +int Vect_get_num_dblinks(struct Map_info *); /* Level 2 only */ -int Vect_read_line(const struct Map_info *, struct line_pnts *, - struct line_cats *, int); - -int Vect_line_alive(const struct Map_info *, int); -int Vect_node_alive(const struct Map_info *, int); -int Vect_area_alive(const struct Map_info *, int); -int Vect_isle_alive(const struct Map_info *, int); -int Vect_get_line_nodes(const struct Map_info *, int, int *, int *); -int Vect_get_line_areas(const struct Map_info *, int, int *, int *); -off_t Vect_get_line_offset(const struct Map_info *, int); - -int Vect_get_node_coor(const struct Map_info *, int, double *, double *, - double *); -int Vect_get_node_n_lines(const struct Map_info *, int); -int Vect_get_node_line(const struct Map_info *, int, int); -float Vect_get_node_line_angle(const struct Map_info *, int, int); - -int Vect_get_area_points(const struct Map_info *, int, struct line_pnts *); -int Vect_get_area_centroid(const struct Map_info *, int); -int Vect_get_area_num_isles(const struct Map_info *, int); -int Vect_get_area_isle(const struct Map_info *, int, int); -double Vect_get_area_perimeter(const struct Map_info *, int); -double Vect_get_area_area(const struct Map_info *, int); -int Vect_get_area_boundaries(const struct Map_info *, int, struct ilist *); - -int Vect_get_isle_points(const struct Map_info *, int, struct line_pnts *); -int Vect_get_isle_area(const struct Map_info *, int); -int Vect_get_isle_boundaries(const struct Map_info *, int, struct ilist *); +int Vect_read_line(struct Map_info *, struct line_pnts *, struct line_cats *, + int); -int Vect_get_centroid_area(const struct Map_info *, int); +int Vect_line_alive(struct Map_info *, int); +int Vect_node_alive(struct Map_info *, int); +int Vect_area_alive(struct Map_info *, int); +int Vect_isle_alive(struct Map_info *, int); +int Vect_get_line_nodes(struct Map_info *, int, int *, int *); +int Vect_get_line_areas(struct Map_info *, int, int *, int *); +off_t Vect_get_line_offset(struct Map_info *, int); + +int Vect_get_node_coor(struct Map_info *, int, double *, double *, double *); +int Vect_get_node_n_lines(struct Map_info *, int); +int Vect_get_node_line(struct Map_info *, int, int); +float Vect_get_node_line_angle(struct Map_info *, int, int); + +int Vect_get_area_points(struct Map_info *, int, struct line_pnts *); +int Vect_get_area_centroid(struct Map_info *, int); +int Vect_get_area_num_isles(struct Map_info *, int); +int Vect_get_area_isle(struct Map_info *, int, int); +double Vect_get_area_perimeter(struct Map_info *, int); +double Vect_get_area_area(struct Map_info *, int); +int Vect_get_area_boundaries(struct Map_info *, int, struct ilist *); + +int Vect_get_isle_points(struct Map_info *, int, struct line_pnts *); +int Vect_get_isle_area(struct Map_info *, int); +int Vect_get_isle_boundaries(struct Map_info *, int, struct ilist *); + +int Vect_get_centroid_area(struct Map_info *, int); /* Level 2 update only */ -int Vect_get_num_updated_lines(const struct Map_info *); -int Vect_get_updated_line(const struct Map_info *, int); -off_t Vect_get_updated_line_offset(const struct Map_info *, int); -int Vect_get_num_updated_nodes(const struct Map_info *); -int Vect_get_updated_node(const struct Map_info *, int); +int Vect_get_num_updated_lines(struct Map_info *); +int Vect_get_updated_line(struct Map_info *, int); +off_t Vect_get_updated_line_offset(struct Map_info *, int); +int Vect_get_num_updated_nodes(struct Map_info *); +int Vect_get_updated_node(struct Map_info *, int); void Vect_set_updated(struct Map_info *, int); void Vect_reset_updated(struct Map_info *); /* History */ int Vect_hist_command(struct Map_info *); int Vect_hist_write(struct Map_info *, const char *); -int Vect_hist_copy(const struct Map_info *, struct Map_info *); +int Vect_hist_copy(struct Map_info *, struct Map_info *); void Vect_hist_rewind(struct Map_info *); -char *Vect_hist_read(char *, int, const struct Map_info *); +char *Vect_hist_read(char *, int, struct Map_info *); /* Selecting features */ int Vect_select_lines_by_box(struct Map_info *, const struct bound_box *, int, @@ -348,16 +344,16 @@ int Vect_tin_get_z(struct Map_info *, double, double, double *, double *, int Vect_find_poly_centroid(const struct line_pnts *, double *, double *); int Vect__intersect_line_with_poly(const struct line_pnts *, double, struct line_pnts *); -int Vect_get_point_in_area(const struct Map_info *, int, double *, double *); +int Vect_get_point_in_area(struct Map_info *, int, double *, double *); int Vect_get_point_in_poly(const struct line_pnts *, double *, double *); int Vect_get_point_in_poly_isl(const struct line_pnts *, const struct line_pnts **, int, double *, double *); -int Vect_point_in_area(double, double, const struct Map_info *, int, +int Vect_point_in_area(double, double, struct Map_info *, int, struct bound_box *); -int Vect_point_in_area_outer_ring(double, double, const struct Map_info *, int, +int Vect_point_in_area_outer_ring(double, double, struct Map_info *, int, struct bound_box *); -int Vect_point_in_island(double, double, const struct Map_info *, int, +int Vect_point_in_island(double, double, struct Map_info *, int, struct bound_box *); int Vect_point_in_poly(double, double, const struct line_pnts *); @@ -414,8 +410,8 @@ int Vect_net_shortest_path(struct Map_info *, int, int, struct ilist *, int Vect_net_ttb_shortest_path(struct Map_info *, int, int, int, int, int, struct ilist *, double *); dglGraph_s *Vect_net_get_graph(struct Map_info *); -int Vect_net_get_line_cost(const struct Map_info *, int, int, double *); -int Vect_net_get_node_cost(const struct Map_info *, int, double *); +int Vect_net_get_line_cost(struct Map_info *, int, int, double *); +int Vect_net_get_node_cost(struct Map_info *, int, double *); int Vect_net_nearest_nodes(struct Map_info *, double, double, double, int, double, int *, int *, int *, double *, double *, struct line_pnts *, struct line_pnts *, double *); @@ -432,7 +428,7 @@ int Vect_net_ttb_shortest_path_coor(struct Map_info *, double, double, double, double *, double *); /* Miscellaneous */ -int Vect_topo_dump(const struct Map_info *, FILE *); +int Vect_topo_dump(struct Map_info *, FILE *); double Vect_points_distance(double, double, double, double, double, double, int); int Vect_option_to_types(const struct Option *); @@ -440,14 +436,13 @@ int Vect_copy_map_lines(struct Map_info *, struct Map_info *); int Vect_copy_map_lines_field(struct Map_info *, int, struct Map_info *); int Vect_copy(const char *, const char *, const char *); int Vect_rename(const char *, const char *); -int Vect_copy_table(const struct Map_info *, struct Map_info *, int, int, +int Vect_copy_table(struct Map_info *, struct Map_info *, int, int, const char *, int); -int Vect_copy_table_by_cat_list(const struct Map_info *, struct Map_info *, int, - int, const char *, int, - const struct cat_list *); -int Vect_copy_table_by_cats(const struct Map_info *, struct Map_info *, int, - int, const char *, int, int *, int); -int Vect_copy_tables(const struct Map_info *, struct Map_info *, int); +int Vect_copy_table_by_cat_list(struct Map_info *, struct Map_info *, int, int, + const char *, int, const struct cat_list *); +int Vect_copy_table_by_cats(struct Map_info *, struct Map_info *, int, int, + const char *, int, int *, int); +int Vect_copy_tables(struct Map_info *, struct Map_info *, int); int Vect_delete(const char *); int Vect_segment_intersection(double, double, double, double, double, double, double, double, double, double, double, double, @@ -467,7 +462,7 @@ int Vect_line_get_intersections(struct line_pnts *, struct line_pnts *, struct line_pnts *, int); int Vect_line_get_intersections2(struct line_pnts *, struct line_pnts *, struct line_pnts *, int); -char *Vect_subst_var(const char *, const struct Map_info *); +char *Vect_subst_var(const char *, struct Map_info *); /* Custom spatial index */ void Vect_spatial_index_init(struct spatial_index *, int); @@ -497,31 +492,31 @@ char *Vect_sfa_line_geometry_type(const struct line_pnts *, int); int Vect_sfa_line_astext(const struct line_pnts *, int, int, int, FILE *); int Vect_sfa_is_line_simple(const struct line_pnts *, int, int); int Vect_sfa_is_line_closed(const struct line_pnts *, int, int); -int Vect_sfa_get_num_features(const struct Map_info *); +int Vect_sfa_get_num_features(struct Map_info *); /* * Internal functions, MUST NOT be used in modules */ -int Vect_print_header(const struct Map_info *); +int Vect_print_header(struct Map_info *); void Vect__init_head(struct Map_info *); /* Open/close/rewind map */ -int Vect_coor_info(const struct Map_info *, struct Coor_info *); -const char *Vect_maptype_info(const struct Map_info *); -int Vect_maptype(const struct Map_info *); +int Vect_coor_info(struct Map_info *, struct Coor_info *); +const char *Vect_maptype_info(struct Map_info *); +int Vect_maptype(struct Map_info *); int Vect_open_topo(struct Map_info *, int); int Vect_save_topo(struct Map_info *); int Vect_open_sidx(struct Map_info *, int); int Vect_save_sidx(struct Map_info *); -int Vect_sidx_dump(const struct Map_info *, FILE *); -int Vect_build_sidx_from_topo(const struct Map_info *); +int Vect_sidx_dump(struct Map_info *, FILE *); +int Vect_build_sidx_from_topo(struct Map_info *); int Vect_build_sidx(struct Map_info *); int Vect_open_fidx(struct Map_info *, struct Format_info_offset *); int Vect_save_fidx(struct Map_info *, struct Format_info_offset *); -int Vect_fidx_dump(const struct Map_info *, FILE *); +int Vect_fidx_dump(struct Map_info *, FILE *); int Vect_save_frmt(struct Map_info *); -int Vect__write_head(const struct Map_info *); +int Vect__write_head(struct Map_info *); int Vect__read_head(struct Map_info *); int V1_open_old_nat(struct Map_info *, int); int V1_open_old_ogr(struct Map_info *, int); @@ -624,9 +619,8 @@ char *Vect_line_to_wkt(const struct line_pnts *, int, int); unsigned char *Vect_line_to_wkb(const struct line_pnts *, int, int, size_t *); char *Vect_read_area_to_wkt(struct Map_info *, int); unsigned char *Vect_read_area_to_wkb(struct Map_info *, int, size_t *); -unsigned char *Vect_read_line_to_wkb(const struct Map_info *, - struct line_pnts *, struct line_cats *, - int, size_t *, int *); +unsigned char *Vect_read_line_to_wkb(struct Map_info *, struct line_pnts *, + struct line_cats *, int, size_t *, int *); #endif /* Raster color tables */ diff --git a/lib/vector/Vlib/area.c b/lib/vector/Vlib/area.c index 8e5ae8d7651..d8fb08c6b64 100644 --- a/lib/vector/Vlib/area.c +++ b/lib/vector/Vlib/area.c @@ -34,7 +34,7 @@ \return number of points \return -1 on error */ -int Vect_get_area_points(const struct Map_info *Map, int area, +int Vect_get_area_points(struct Map_info *Map, int area, struct line_pnts *BPoints) { const struct Plus_head *Plus; @@ -65,7 +65,7 @@ int Vect_get_area_points(const struct Map_info *Map, int area, \return number of points \return -1 on error */ -int Vect_get_isle_points(const struct Map_info *Map, int isle, +int Vect_get_isle_points(struct Map_info *Map, int isle, struct line_pnts *BPoints) { const struct Plus_head *Plus; @@ -107,7 +107,7 @@ int Vect_get_isle_points(const struct Map_info *Map, int isle, \return centroid id of area \return 0 if no centroid found */ -int Vect_get_area_centroid(const struct Map_info *Map, int area) +int Vect_get_area_centroid(struct Map_info *Map, int area) { const struct Plus_head *Plus; struct P_area *Area; @@ -136,8 +136,7 @@ int Vect_get_area_centroid(const struct Map_info *Map, int area) \return number of boundaries */ -int Vect_get_area_boundaries(const struct Map_info *Map, int area, - struct ilist *List) +int Vect_get_area_boundaries(struct Map_info *Map, int area, struct ilist *List) { int i, line; const struct Plus_head *Plus; @@ -173,8 +172,7 @@ int Vect_get_area_boundaries(const struct Map_info *Map, int area, \return number of boundaries */ -int Vect_get_isle_boundaries(const struct Map_info *Map, int isle, - struct ilist *List) +int Vect_get_isle_boundaries(struct Map_info *Map, int isle, struct ilist *List) { int i, line; const struct Plus_head *Plus; @@ -207,7 +205,7 @@ int Vect_get_isle_boundaries(const struct Map_info *Map, int isle, \return number of isles for area \return 0 if area not found */ -int Vect_get_area_num_isles(const struct Map_info *Map, int area) +int Vect_get_area_num_isles(struct Map_info *Map, int area) { const struct Plus_head *Plus; struct P_area *Area; @@ -235,7 +233,7 @@ int Vect_get_area_num_isles(const struct Map_info *Map, int area) \return isle id \return 0 if no isle found */ -int Vect_get_area_isle(const struct Map_info *Map, int area, int isle) +int Vect_get_area_isle(struct Map_info *Map, int area, int isle) { const struct Plus_head *Plus; struct P_area *Area; @@ -262,7 +260,7 @@ int Vect_get_area_isle(const struct Map_info *Map, int area, int isle) \return area id \return 0 area not found */ -int Vect_get_isle_area(const struct Map_info *Map, int isle) +int Vect_get_isle_area(struct Map_info *Map, int isle) { const struct Plus_head *Plus; struct P_isle *Isle; @@ -289,7 +287,7 @@ int Vect_get_isle_area(const struct Map_info *Map, int isle) \return perimeter of area with perimeters of isles in meters */ -double Vect_get_area_perimeter(const struct Map_info *Map, int area) +double Vect_get_area_perimeter(struct Map_info *Map, int area) { const struct Plus_head *Plus; struct P_area *Area; @@ -333,7 +331,7 @@ double Vect_get_area_perimeter(const struct Map_info *Map, int area) \return 1 if point is inside area \return 2 if point is on the area's outer ring */ -int Vect_point_in_area(double x, double y, const struct Map_info *Map, int area, +int Vect_point_in_area(double x, double y, struct Map_info *Map, int area, struct bound_box *box) { int i, isle; @@ -374,7 +372,7 @@ int Vect_point_in_area(double x, double y, const struct Map_info *Map, int area, \return area of area without areas of isles */ -double Vect_get_area_area(const struct Map_info *Map, int area) +double Vect_get_area_area(struct Map_info *Map, int area) { const struct Plus_head *Plus; struct P_area *Area; @@ -422,8 +420,7 @@ double Vect_get_area_area(const struct Map_info *Map, int area) \return 0 centroid found (but may be without categories) \return 1 no centroid found */ -int Vect_get_area_cats(const struct Map_info *Map, int area, - struct line_cats *Cats) +int Vect_get_area_cats(struct Map_info *Map, int area, struct line_cats *Cats) { int centroid; @@ -450,7 +447,7 @@ int Vect_get_area_cats(const struct Map_info *Map, int area, \return first found category of given field \return -1 no centroid or no category found */ -int Vect_get_area_cat(const struct Map_info *Map, int area, int field) +int Vect_get_area_cat(struct Map_info *Map, int area, int field) { int i; static struct line_cats *Cats = NULL; @@ -487,7 +484,7 @@ int Vect_get_area_cat(const struct Map_info *Map, int area, int field) \return number of points \return -1 on error */ -int Vect__get_area_points(const struct Map_info *Map, const plus_t *lines, +int Vect__get_area_points(struct Map_info *Map, const plus_t *lines, int n_lines, struct line_pnts *BPoints) { if (Map->format == GV_FORMAT_POSTGIS && Map->fInfo.pg.toposchema_name && @@ -516,7 +513,7 @@ int Vect__get_area_points(const struct Map_info *Map, const plus_t *lines, \return number of points \return -1 on error */ -int Vect__get_area_points_nat(const struct Map_info *Map, const plus_t *lines, +int Vect__get_area_points_nat(struct Map_info *Map, const plus_t *lines, int n_lines, struct line_pnts *BPoints) { int i, line, aline, dir; diff --git a/lib/vector/Vlib/area_pg.c b/lib/vector/Vlib/area_pg.c index 7d52caa1109..3f452eb118f 100644 --- a/lib/vector/Vlib/area_pg.c +++ b/lib/vector/Vlib/area_pg.c @@ -34,7 +34,7 @@ static PGresult *build_stmt(const struct Plus_head *, \return number of points \return -1 on error */ -int Vect__get_area_points_pg(const struct Map_info *Map, const plus_t *lines, +int Vect__get_area_points_pg(struct Map_info *Map, const plus_t *lines, int n_lines, struct line_pnts *APoints) { int i, direction; diff --git a/lib/vector/Vlib/array.c b/lib/vector/Vlib/array.c index 221391d18b5..f6c74c630fe 100644 --- a/lib/vector/Vlib/array.c +++ b/lib/vector/Vlib/array.c @@ -76,7 +76,7 @@ struct varray *Vect_new_varray(int size) \return number of items set \return -1 on error */ -int Vect_set_varray_from_cat_string(const struct Map_info *Map, int field, +int Vect_set_varray_from_cat_string(struct Map_info *Map, int field, const char *cstring, int type, int value, struct varray *varray) { @@ -121,7 +121,7 @@ int Vect_set_varray_from_cat_string(const struct Map_info *Map, int field, \return number of items set \return -1 on error */ -int Vect_set_varray_from_cat_list(const struct Map_info *Map, int field, +int Vect_set_varray_from_cat_list(struct Map_info *Map, int field, struct cat_list *clist, int type, int value, struct varray *varray) { @@ -239,9 +239,8 @@ static int in_array(int *cats, size_t ncats, int cat) \return number of items set \return -1 on error */ -int Vect_set_varray_from_db(const struct Map_info *Map, int field, - const char *where, int type, int value, - struct varray *varray) +int Vect_set_varray_from_db(struct Map_info *Map, int field, const char *where, + int type, int value, struct varray *varray) { int i, n, c, centr, *cats; int ncats; diff --git a/lib/vector/Vlib/box.c b/lib/vector/Vlib/box.c index 49d90ea2cc2..229de5a2c53 100644 --- a/lib/vector/Vlib/box.c +++ b/lib/vector/Vlib/box.c @@ -232,8 +232,7 @@ int Vect_box_clip(double *x, double *y, double *c_x, double *c_y, \return 0 line is dead \return -1 on error */ -int Vect_get_line_box(const struct Map_info *Map, int line, - struct bound_box *Box) +int Vect_get_line_box(struct Map_info *Map, int line, struct bound_box *Box) { struct Plus_head *Plus; struct P_line *Line; @@ -298,8 +297,7 @@ int Vect_get_line_box(const struct Map_info *Map, int line, \return 0 area is dead \return -1 on error */ -int Vect_get_area_box(const struct Map_info *Map, int area, - struct bound_box *Box) +int Vect_get_area_box(struct Map_info *Map, int area, struct bound_box *Box) { struct Plus_head *Plus; struct P_area *Area; @@ -344,8 +342,7 @@ int Vect_get_area_box(const struct Map_info *Map, int area, \return 0 isle is dead / bounding box not found \return -1 on error */ -int Vect_get_isle_box(const struct Map_info *Map, int isle, - struct bound_box *Box) +int Vect_get_isle_box(struct Map_info *Map, int isle, struct bound_box *Box) { struct Plus_head *Plus; struct P_isle *Isle; @@ -388,7 +385,7 @@ int Vect_get_isle_box(const struct Map_info *Map, int isle, \return 1 on success \return 0 on error */ -int Vect_get_map_box(const struct Map_info *Map, struct bound_box *Box) +int Vect_get_map_box(struct Map_info *Map, struct bound_box *Box) { const struct Plus_head *Plus; diff --git a/lib/vector/Vlib/buffer2.c b/lib/vector/Vlib/buffer2.c index c80cc159c44..119a1ce74a2 100644 --- a/lib/vector/Vlib/buffer2.c +++ b/lib/vector/Vlib/buffer2.c @@ -1071,10 +1071,10 @@ void Vect_line_buffer2(const struct line_pnts *Points, double da, double db, \param[out] inner_count number of holes \param[out] iPoints array of output polygon's holes (cw order) */ -void Vect_area_buffer2(const struct Map_info *Map, int area, double da, - double db, double dalpha, int round, int caps, - double tol, struct line_pnts **oPoints, - struct line_pnts ***iPoints, int *inner_count) +void Vect_area_buffer2(struct Map_info *Map, int area, double da, double db, + double dalpha, int round, int caps, double tol, + struct line_pnts **oPoints, struct line_pnts ***iPoints, + int *inner_count) { struct line_pnts *tPoints, *outer; struct line_pnts **isles; diff --git a/lib/vector/Vlib/build.c b/lib/vector/Vlib/build.c index 83659644c4a..52fc7ba4ca1 100644 --- a/lib/vector/Vlib/build.c +++ b/lib/vector/Vlib/build.c @@ -754,7 +754,7 @@ int Vect_topo_check(struct Map_info *Map, struct Map_info *Err) \return current highest built level */ -int Vect_get_built(const struct Map_info *Map) +int Vect_get_built(struct Map_info *Map) { return Map->plus.built; } @@ -1051,7 +1051,7 @@ int Vect_save_topo(struct Map_info *Map) \return 1 on success \return 0 on error */ -int Vect_topo_dump(const struct Map_info *Map, FILE *out) +int Vect_topo_dump(struct Map_info *Map, FILE *out) { int i, j, line, isle; float angle_deg; @@ -1241,7 +1241,7 @@ int Vect_build_sidx(struct Map_info *Map) \return 1 */ -int Vect_build_sidx_from_topo(const struct Map_info *Map) +int Vect_build_sidx_from_topo(struct Map_info *Map) { G_debug(3, "Vect_build_sidx_from_topo(): name=%s", Vect_get_full_name(Map)); @@ -1312,7 +1312,7 @@ int Vect_save_sidx(struct Map_info *Map) \return 1 on success \return 0 on error */ -int Vect_sidx_dump(const struct Map_info *Map, FILE *out) +int Vect_sidx_dump(struct Map_info *Map, FILE *out) { if (!(Map->plus.Spidx_built)) { Vect_build_sidx_from_topo(Map); diff --git a/lib/vector/Vlib/build_sfa.c b/lib/vector/Vlib/build_sfa.c index ef259e4ad4f..52af99081e9 100644 --- a/lib/vector/Vlib/build_sfa.c +++ b/lib/vector/Vlib/build_sfa.c @@ -747,7 +747,7 @@ int Vect__build_sfa(struct Map_info *Map, int build) \return 1 on success \return 0 on error */ -int Vect_fidx_dump(const struct Map_info *Map, FILE *out) +int Vect_fidx_dump(struct Map_info *Map, FILE *out) { int i; const struct Format_info_offset *offset; diff --git a/lib/vector/Vlib/cindex.c b/lib/vector/Vlib/cindex.c index 4a28849bea2..3664ab74b82 100644 --- a/lib/vector/Vlib/cindex.c +++ b/lib/vector/Vlib/cindex.c @@ -28,13 +28,13 @@ "------------------------------------------------------------------------" \ "------------------\n" -static void check_status(const struct Map_info *Map) +static void check_status(struct Map_info *Map) { if (!Map->plus.cidx_up_to_date) G_fatal_error(_("Category index is not up to date")); } -static void check_index(const struct Map_info *Map, int index) +static void check_index(struct Map_info *Map, int index) { if (index < 0 || index >= Map->plus.n_cidx) G_fatal_error(_("Layer index out of range")); @@ -78,7 +78,7 @@ static int ci_search_cat(struct Cat_index *ci, int first, int cat) \return number of layers */ -int Vect_cidx_get_num_fields(const struct Map_info *Map) +int Vect_cidx_get_num_fields(struct Map_info *Map) { check_status(Map); @@ -95,7 +95,7 @@ int Vect_cidx_get_num_fields(const struct Map_info *Map) \return layer number */ -int Vect_cidx_get_field_number(const struct Map_info *Map, int index) +int Vect_cidx_get_field_number(struct Map_info *Map, int index) { check_status(Map); check_index(Map, index); @@ -112,7 +112,7 @@ int Vect_cidx_get_field_number(const struct Map_info *Map, int index) \return layer index \return -1 if not found */ -int Vect_cidx_get_field_index(const struct Map_info *Map, int field) +int Vect_cidx_get_field_index(struct Map_info *Map, int field) { int i; const struct Plus_head *Plus; @@ -141,8 +141,7 @@ int Vect_cidx_get_field_index(const struct Map_info *Map, int field) \return number of unique categories \return -1 on error */ -int Vect_cidx_get_num_unique_cats_by_index(const struct Map_info *Map, - int index) +int Vect_cidx_get_num_unique_cats_by_index(struct Map_info *Map, int index) { check_status(Map); check_index(Map, index); @@ -159,7 +158,7 @@ int Vect_cidx_get_num_unique_cats_by_index(const struct Map_info *Map, \return number of categories \return -1 on error */ -int Vect_cidx_get_num_cats_by_index(const struct Map_info *Map, int index) +int Vect_cidx_get_num_cats_by_index(struct Map_info *Map, int index) { check_status(Map); check_index(Map, index); @@ -178,8 +177,7 @@ int Vect_cidx_get_num_cats_by_index(const struct Map_info *Map, int index) \return number of feature types \return -1 on error */ -int Vect_cidx_get_num_types_by_index(const struct Map_info *Map, - int field_index) +int Vect_cidx_get_num_types_by_index(struct Map_info *Map, int field_index) { check_status(Map); check_index(Map, field_index); @@ -199,9 +197,8 @@ int Vect_cidx_get_num_types_by_index(const struct Map_info *Map, \return 1 on success \return 0 on error */ -int Vect_cidx_get_type_count_by_index(const struct Map_info *Map, - int field_index, int type_index, - int *type, int *count) +int Vect_cidx_get_type_count_by_index(struct Map_info *Map, int field_index, + int type_index, int *type, int *count) { check_status(Map); check_index(Map, field_index); @@ -223,7 +220,7 @@ int Vect_cidx_get_type_count_by_index(const struct Map_info *Map, \return feature count \return 0 if no features, no such field or no such type in category index */ -int Vect_cidx_get_type_count(const struct Map_info *Map, int field, int type) +int Vect_cidx_get_type_count(struct Map_info *Map, int field, int type) { int i, fi, count = 0; @@ -262,7 +259,7 @@ int Vect_cidx_get_type_count(const struct Map_info *Map, int field, int type) \return 1 on success \return 0 on error */ -int Vect_cidx_get_cat_by_index(const struct Map_info *Map, int field_index, +int Vect_cidx_get_cat_by_index(struct Map_info *Map, int field_index, int cat_index, int *cat, int *type, int *id) { check_status(Map); /* This check is slow ? */ @@ -327,7 +324,7 @@ int Vect_cidx_get_unique_cats_by_index(struct Map_info *Map, int field_index, \return index to array \return -1 not found */ -int Vect_cidx_find_next(const struct Map_info *Map, int field_index, int cat, +int Vect_cidx_find_next(struct Map_info *Map, int field_index, int cat, int type_mask, int start_index, int *type, int *id) { int cat_index; @@ -373,8 +370,8 @@ int Vect_cidx_find_next(const struct Map_info *Map, int field_index, int cat, \param cat category number \param[out] lines array of ids of found lines/points */ -void Vect_cidx_find_all(const struct Map_info *Map, int layer, int type_mask, - int cat, struct ilist *lines) +void Vect_cidx_find_all(struct Map_info *Map, int layer, int type_mask, int cat, + struct ilist *lines) { int type, line; struct Cat_index *ci; @@ -420,7 +417,7 @@ void Vect_cidx_find_all(const struct Map_info *Map, int layer, int type_mask, \return 1 on success \return 0 on error */ -int Vect_cidx_dump(const struct Map_info *Map, FILE *out) +int Vect_cidx_dump(struct Map_info *Map, FILE *out) { int i, field, nfields, ntypes; diff --git a/lib/vector/Vlib/close.c b/lib/vector/Vlib/close.c index 9912eb0492a..573d75068b0 100644 --- a/lib/vector/Vlib/close.c +++ b/lib/vector/Vlib/close.c @@ -59,7 +59,7 @@ static int (*Close_array[][2])(struct Map_info *) = {{clo_dummy, V1_close_nat} #endif }; -static void unlink_file(const struct Map_info *, const char *); +static void unlink_file(struct Map_info *, const char *); /*! \brief Close vector map @@ -317,7 +317,7 @@ void Vect__free_offset(struct Format_info_offset *offset) G_zero(offset, sizeof(struct Format_info_offset)); } -void unlink_file(const struct Map_info *Map, const char *name) +void unlink_file(struct Map_info *Map, const char *name) { char path[GPATH_MAX]; diff --git a/lib/vector/Vlib/constraint.c b/lib/vector/Vlib/constraint.c index b9de9ef57f5..8c0e5290162 100644 --- a/lib/vector/Vlib/constraint.c +++ b/lib/vector/Vlib/constraint.c @@ -76,7 +76,7 @@ int Vect_set_constraint_region(struct Map_info *Map, double n, double s, \return 0 on success \return -1 no region constraint defined */ -int Vect_get_constraint_box(const struct Map_info *Map, struct bound_box *Box) +int Vect_get_constraint_box(struct Map_info *Map, struct bound_box *Box) { if (!Map->constraint.region_flag) return -1; diff --git a/lib/vector/Vlib/copy.c b/lib/vector/Vlib/copy.c index 59877db5ace..bde7e577c8b 100644 --- a/lib/vector/Vlib/copy.c +++ b/lib/vector/Vlib/copy.c @@ -44,11 +44,11 @@ static int copy_lines_1(struct Map_info *, int, struct Map_info *); static int copy_lines_2(struct Map_info *, int, int, struct Map_info *); #if 0 -static int copy_nodes(const struct Map_info *, struct Map_info *); +static int copy_nodes(struct Map_info *, struct Map_info *); #endif -static int copy_line_nodes(const struct Map_info *, int, int, - struct line_pnts *, struct Map_info *); -static int is_isle(const struct Map_info *, int); +static int copy_line_nodes(struct Map_info *, int, int, struct line_pnts *, + struct Map_info *); +static int is_isle(struct Map_info *, int); /*! \brief Copy all alive vector features from input vector map to @@ -392,7 +392,7 @@ int copy_lines_2(struct Map_info *In, int field, int topo, struct Map_info *Out) \return 0 on success \return 1 on error */ -int copy_nodes(const struct Map_info *In, struct Map_info *Out) +int copy_nodes(struct Map_info *In, struct Map_info *Out) { int nnodes, node, with_z; @@ -418,7 +418,7 @@ int copy_nodes(const struct Map_info *In, struct Map_info *Out) } #endif -int copy_line_nodes(const struct Map_info *In, int node, int with_z, +int copy_line_nodes(struct Map_info *In, int node, int with_z, struct line_pnts *Points, struct Map_info *Out NOPG_UNUSED) { double x, y, z; @@ -453,7 +453,7 @@ int copy_line_nodes(const struct Map_info *In, int node, int with_z, \return TRUE if area forms an isle otherwise FALSE */ -int is_isle(const struct Map_info *Map, int area) +int is_isle(struct Map_info *Map, int area) { int i, line, left, right, isle, is_isle; @@ -493,7 +493,7 @@ int is_isle(const struct Map_info *Map, int area) \return 0 on success \return 1 on error */ -int Vect__copy_areas(const struct Map_info *In, int field, struct Map_info *Out) +int Vect__copy_areas(struct Map_info *In, int field, struct Map_info *Out) { int i, area, nareas, cat, isle, nisles, nparts_alloc, nskipped; struct line_pnts **Points; @@ -611,7 +611,7 @@ int Vect__copy_areas(const struct Map_info *In, int field, struct Map_info *Out) \return 0 on success \return -1 on error */ -int Vect_copy_tables(const struct Map_info *In, struct Map_info *Out, int field) +int Vect_copy_tables(struct Map_info *In, struct Map_info *Out, int field) { int i, n, type; struct field_info *Fi; @@ -661,9 +661,8 @@ int Vect_copy_tables(const struct Map_info *In, struct Map_info *Out, int field) \return 0 on success \return -1 on error */ -int Vect_copy_table(const struct Map_info *In, struct Map_info *Out, - int field_in, int field_out, const char *field_name, - int type) +int Vect_copy_table(struct Map_info *In, struct Map_info *Out, int field_in, + int field_out, const char *field_name, int type) { return Vect_copy_table_by_cats(In, Out, field_in, field_out, field_name, type, NULL, 0); @@ -686,7 +685,7 @@ int Vect_copy_table(const struct Map_info *In, struct Map_info *Out, \return 0 on success \return -1 on error */ -int Vect_copy_table_by_cat_list(const struct Map_info *In, struct Map_info *Out, +int Vect_copy_table_by_cat_list(struct Map_info *In, struct Map_info *Out, int field_in, int field_out, const char *field_name, int type, const struct cat_list *cat_list) @@ -726,7 +725,7 @@ int Vect_copy_table_by_cat_list(const struct Map_info *In, struct Map_info *Out, \return 0 on success \return -1 on error */ -int Vect_copy_table_by_cats(const struct Map_info *In, struct Map_info *Out, +int Vect_copy_table_by_cats(struct Map_info *In, struct Map_info *Out, int field_in, int field_out, const char *field_name, int type, int *cats, int ncats) { diff --git a/lib/vector/Vlib/dbcolumns.c b/lib/vector/Vlib/dbcolumns.c index a743c3b781c..e3cf915a9ec 100644 --- a/lib/vector/Vlib/dbcolumns.c +++ b/lib/vector/Vlib/dbcolumns.c @@ -34,7 +34,7 @@ \return list of column(s) names on success \return NULL on error */ -const char *Vect_get_column_names(const struct Map_info *Map, int field) +const char *Vect_get_column_names(struct Map_info *Map, int field) { int num_dblinks, ncols, col; struct field_info *fi; @@ -89,7 +89,7 @@ const char *Vect_get_column_names(const struct Map_info *Map, int field) \return list of column(s) types on success \return NULL on error */ -const char *Vect_get_column_types(const struct Map_info *Map, int field) +const char *Vect_get_column_types(struct Map_info *Map, int field) { int num_dblinks, ncols, col; struct field_info *fi; @@ -146,7 +146,7 @@ const char *Vect_get_column_types(const struct Map_info *Map, int field) \return list of column(s) types on success \return NULL on error */ -const char *Vect_get_column_names_types(const struct Map_info *Map, int field) +const char *Vect_get_column_names_types(struct Map_info *Map, int field) { int num_dblinks, ncols, col; struct field_info *fi; diff --git a/lib/vector/Vlib/field.c b/lib/vector/Vlib/field.c index dafe5533d62..8ee4855d925 100644 --- a/lib/vector/Vlib/field.c +++ b/lib/vector/Vlib/field.c @@ -202,7 +202,7 @@ int Vect_map_del_dblink(struct Map_info *Map, int field) \param first_only TRUE to copy only first link otherwise all DB links are copied */ -void Vect_copy_map_dblinks(const struct Map_info *In, struct Map_info *Out, +void Vect_copy_map_dblinks(struct Map_info *In, struct Map_info *Out, int first_only) { int i, ndblinks; @@ -234,8 +234,7 @@ void Vect_copy_map_dblinks(const struct Map_info *In, struct Map_info *Out, \return 1 dblink for field exists \return 0 dblink does not exist for field */ -int Vect_map_check_dblink(const struct Map_info *Map, int field, - const char *name) +int Vect_map_check_dblink(struct Map_info *Map, int field, const char *name) { return Vect_check_dblink(Map->dblnk, field, name); } @@ -473,7 +472,7 @@ struct field_info *Vect_default_field_info(struct Map_info *Map, int field, \return pointer to new field_info structure */ -struct field_info *Vect_get_dblink(const struct Map_info *Map, int link) +struct field_info *Vect_get_dblink(struct Map_info *Map, int link) { struct field_info *fi; @@ -513,7 +512,7 @@ struct field_info *Vect_get_dblink(const struct Map_info *Map, int link) \return pointer to new field_info structure \return NULL if not found */ -struct field_info *Vect_get_field(const struct Map_info *Map, int field) +struct field_info *Vect_get_field(struct Map_info *Map, int field) { int i; struct field_info *fi = NULL; @@ -539,7 +538,7 @@ struct field_info *Vect_get_field(const struct Map_info *Map, int field) \return pointer to new field_info structure \return NULL if not found */ -struct field_info *Vect_get_field_by_name(const struct Map_info *Map, +struct field_info *Vect_get_field_by_name(struct Map_info *Map, const char *field) { int i; @@ -569,8 +568,7 @@ struct field_info *Vect_get_field_by_name(const struct Map_info *Map, \return pointer to new field_info structure \return NULL if not found */ -struct field_info *Vect_get_field2(const struct Map_info *Map, - const char *field) +struct field_info *Vect_get_field2(struct Map_info *Map, const char *field) { int ifield; struct field_info *fi; @@ -607,7 +605,7 @@ struct field_info *Vect_get_field2(const struct Map_info *Map, \return -1 for all layers \return 0 if layer not found */ -int Vect_get_field_number(const struct Map_info *Map, const char *field) +int Vect_get_field_number(struct Map_info *Map, const char *field) { struct field_info *fi; @@ -1019,7 +1017,7 @@ int Vect_write_dblinks(struct Map_info *Map) \return pointer to new string */ -char *Vect_subst_var(const char *in, const struct Map_info *Map) +char *Vect_subst_var(const char *in, struct Map_info *Map) { char *c; char buf[1000], str[1000]; diff --git a/lib/vector/Vlib/geos_to_wktb.c b/lib/vector/Vlib/geos_to_wktb.c index ed832fbb9a8..5d549eb4a11 100644 --- a/lib/vector/Vlib/geos_to_wktb.c +++ b/lib/vector/Vlib/geos_to_wktb.c @@ -125,7 +125,7 @@ char *Vect_read_area_to_wkt(struct Map_info *Map, int area) \return pointer to unsigned char array \return NULL on error */ -unsigned char *Vect_read_line_to_wkb(const struct Map_info *Map, +unsigned char *Vect_read_line_to_wkb(struct Map_info *Map, struct line_pnts *line_p, struct line_cats *line_c, int line, size_t *size, int *error) diff --git a/lib/vector/Vlib/header.c b/lib/vector/Vlib/header.c index d474b2d3b83..02750855675 100644 --- a/lib/vector/Vlib/header.c +++ b/lib/vector/Vlib/header.c @@ -30,7 +30,7 @@ \return 0 on success */ -int Vect_print_header(const struct Map_info *Map) +int Vect_print_header(struct Map_info *Map) { fprintf(stdout, "\nSelected information from dig header\n"); fprintf(stdout, " Organization: %s\n", Vect_get_organization(Map)); @@ -61,7 +61,7 @@ int Vect_read_header(struct Map_info *Map) \return 0 */ -int Vect_write_header(const struct Map_info *Map) +int Vect_write_header(struct Map_info *Map) { /* do some sanity checking here */ Vect__write_head(Map); @@ -76,7 +76,7 @@ int Vect_write_header(const struct Map_info *Map) \return 0 on success \return -1 on error */ -int Vect__write_head(const struct Map_info *Map) +int Vect__write_head(struct Map_info *Map) { char path[GPATH_MAX]; FILE *head_fp; @@ -189,7 +189,7 @@ int Vect__read_head(struct Map_info *Map) \return string containing name */ -const char *Vect_get_name(const struct Map_info *Map) +const char *Vect_get_name(struct Map_info *Map) { return Map->name; } @@ -201,7 +201,7 @@ const char *Vect_get_name(const struct Map_info *Map) \return string containing mapset name */ -const char *Vect_get_mapset(const struct Map_info *Map) +const char *Vect_get_mapset(struct Map_info *Map) { return Map->mapset; } @@ -218,7 +218,7 @@ const char *Vect_get_mapset(const struct Map_info *Map) \return allocated string "name@mapset" */ -const char *Vect_get_full_name(const struct Map_info *Map) +const char *Vect_get_full_name(struct Map_info *Map) { char *ptr; @@ -252,7 +252,7 @@ const char *Vect_get_full_name(const struct Map_info *Map) \return TRUE vector map is 3D \return FALSE vector map is not 3D */ -int Vect_is_3d(const struct Map_info *Map) +int Vect_is_3d(struct Map_info *Map) { return Map->head.with_z; } @@ -280,7 +280,7 @@ int Vect_set_organization(struct Map_info *Map, const char *str) \return string containing organization name */ -const char *Vect_get_organization(const struct Map_info *Map) +const char *Vect_get_organization(struct Map_info *Map) { return Map->head.organization; } @@ -311,7 +311,7 @@ int Vect_set_date(struct Map_info *Map, const char *str) \return date of digitization string */ -const char *Vect_get_date(const struct Map_info *Map) +const char *Vect_get_date(struct Map_info *Map) { return (Map->head.date); } @@ -339,7 +339,7 @@ int Vect_set_person(struct Map_info *Map, const char *str) \return string containing user name */ -const char *Vect_get_person(const struct Map_info *Map) +const char *Vect_get_person(struct Map_info *Map) { return (Map->head.user_name); } @@ -367,7 +367,7 @@ int Vect_set_map_name(struct Map_info *Map, const char *str) \return string containing map name */ -const char *Vect_get_map_name(const struct Map_info *Map) +const char *Vect_get_map_name(struct Map_info *Map) { return Map->head.map_name; } @@ -395,7 +395,7 @@ int Vect_set_map_date(struct Map_info *Map, const char *str) \return string containing a date */ -const char *Vect_get_map_date(const struct Map_info *Map) +const char *Vect_get_map_date(struct Map_info *Map) { return Map->head.source_date; } @@ -422,7 +422,7 @@ int Vect_set_scale(struct Map_info *Map, int scale) \return map scale */ -int Vect_get_scale(const struct Map_info *Map) +int Vect_get_scale(struct Map_info *Map) { return (int)Map->head.orig_scale; } @@ -450,7 +450,7 @@ int Vect_set_comment(struct Map_info *Map, const char *str) \return comment or other info string */ -const char *Vect_get_comment(const struct Map_info *Map) +const char *Vect_get_comment(struct Map_info *Map) { return (Map->head.comment); } @@ -478,7 +478,7 @@ int Vect_set_zone(struct Map_info *Map, int zone) \return projection zone */ -int Vect_get_zone(const struct Map_info *Map UNUSED) +int Vect_get_zone(struct Map_info *Map UNUSED) { /* return Map->head.plani_zone; */ @@ -516,7 +516,7 @@ int Vect_set_proj(struct Map_info *Map, int proj) \return PROJECTION_UTM 1 - UTM Universal Transverse Mercator, \return PROJECTION_LL 3 - Latitude-Longitude */ -int Vect_get_proj(const struct Map_info *Map) +int Vect_get_proj(struct Map_info *Map) { return (Map->head.proj); } @@ -533,7 +533,7 @@ int Vect_get_proj(const struct Map_info *Map) \return NULL if proj is not a valid projection */ -const char *Vect_get_proj_name(const struct Map_info *Map) +const char *Vect_get_proj_name(struct Map_info *Map) { char name[256]; int n; @@ -582,7 +582,7 @@ int Vect_set_thresh(struct Map_info *Map, double thresh) \return threshold used for digitization */ -double Vect_get_thresh(const struct Map_info *Map) +double Vect_get_thresh(struct Map_info *Map) { return Map->head.digit_thresh; } diff --git a/lib/vector/Vlib/header_finfo.c b/lib/vector/Vlib/header_finfo.c index 469cdfa1dec..f3de08d3e0c 100644 --- a/lib/vector/Vlib/header_finfo.c +++ b/lib/vector/Vlib/header_finfo.c @@ -34,7 +34,7 @@ \return string containing OGR/PostGIS datasource name \return NULL on error (map format is native) */ -const char *Vect_get_finfo_dsn_name(const struct Map_info *Map) +const char *Vect_get_finfo_dsn_name(struct Map_info *Map) { if (Map->format == GV_FORMAT_OGR || Map->format == GV_FORMAT_OGR_DIRECT) { #ifndef HAVE_OGR @@ -70,7 +70,7 @@ const char *Vect_get_finfo_dsn_name(const struct Map_info *Map) \return string containing layer name \return NULL on error (map format is native) */ -char *Vect_get_finfo_layer_name(const struct Map_info *Map) +char *Vect_get_finfo_layer_name(struct Map_info *Map) { char *name; @@ -105,7 +105,7 @@ char *Vect_get_finfo_layer_name(const struct Map_info *Map) \return "PostgreSQL" for PostGIS format (GV_FORMAT_POSTGIS) \return NULL on error (or on missing OGR/PostgreSQL support) */ -const char *Vect_get_finfo_format_info(const struct Map_info *Map) +const char *Vect_get_finfo_format_info(struct Map_info *Map) { if (Map->format == GV_FORMAT_OGR || Map->format == GV_FORMAT_OGR_DIRECT) { #ifndef HAVE_OGR @@ -140,7 +140,7 @@ const char *Vect_get_finfo_format_info(const struct Map_info *Map) (point, linestring, polygon, ...) \return NULL on error (map format is native) */ -const char *Vect_get_finfo_geometry_type(const struct Map_info *Map) +const char *Vect_get_finfo_geometry_type(struct Map_info *Map) { int dim; char *ftype, *ftype_tmp; @@ -221,7 +221,7 @@ const char *Vect_get_finfo_geometry_type(const struct Map_info *Map) \return pointer to Format_info structure \return NULL for native format */ -const struct Format_info *Vect_get_finfo(const struct Map_info *Map) +const struct Format_info *Vect_get_finfo(struct Map_info *Map) { /* do not check Map-format which is native (see * GRASS_VECTOR_EXTERNAL_IMMEDIATE) */ @@ -244,7 +244,7 @@ const struct Format_info *Vect_get_finfo(const struct Map_info *Map) \return GV_TOPO_PSEUDO for pseudo-topology \return GV_TOPO_POSTGIS for PostGIS Topology */ -int Vect_get_finfo_topology_info(const struct Map_info *Map, char **toposchema, +int Vect_get_finfo_topology_info(struct Map_info *Map, char **toposchema, char **topogeom, int *topo_geo_only) { if (Map->format == GV_FORMAT_OGR || Map->format == GV_FORMAT_OGR_DIRECT) { diff --git a/lib/vector/Vlib/hist.c b/lib/vector/Vlib/hist.c index d8e3aab0c71..3bc61ea00c0 100644 --- a/lib/vector/Vlib/hist.c +++ b/lib/vector/Vlib/hist.c @@ -87,7 +87,7 @@ int Vect_hist_write(struct Map_info *Map, const char *str) \return NULL on error \return EOF end of file */ -char *Vect_hist_read(char *s, int size, const struct Map_info *Map) +char *Vect_hist_read(char *s, int size, struct Map_info *Map) { int ret; @@ -128,7 +128,7 @@ void Vect_hist_rewind(struct Map_info *Map) \return 0 on success \return -1 on error */ -int Vect_hist_copy(const struct Map_info *In, struct Map_info *Out) +int Vect_hist_copy(struct Map_info *In, struct Map_info *Out) { size_t red, ret; char buf[1000]; diff --git a/lib/vector/Vlib/init_head.c b/lib/vector/Vlib/init_head.c index 6ee02153a14..7af2be0c781 100644 --- a/lib/vector/Vlib/init_head.c +++ b/lib/vector/Vlib/init_head.c @@ -74,7 +74,7 @@ void Vect__init_head(struct Map_info *Map) \return 0 */ -int Vect_copy_head_data(const struct Map_info *from, struct Map_info *to) +int Vect_copy_head_data(struct Map_info *from, struct Map_info *to) { Vect_set_organization(to, Vect_get_organization(from)); Vect_set_date(to, Vect_get_date(from)); diff --git a/lib/vector/Vlib/level.c b/lib/vector/Vlib/level.c index 34abced90c5..d66434be64a 100644 --- a/lib/vector/Vlib/level.c +++ b/lib/vector/Vlib/level.c @@ -26,7 +26,7 @@ \return open level \return -1 on error */ -int Vect_level(const struct Map_info *Map) +int Vect_level(struct Map_info *Map) { if (Map->open != VECT_OPEN_CODE) { if (Map->open != VECT_CLOSED_CODE) diff --git a/lib/vector/Vlib/level_two.c b/lib/vector/Vlib/level_two.c index 96337d54440..a33ff3e5a2d 100644 --- a/lib/vector/Vlib/level_two.c +++ b/lib/vector/Vlib/level_two.c @@ -17,7 +17,7 @@ #include #include -static void check_level(const struct Map_info *Map) +static void check_level(struct Map_info *Map) { if (Map->level < 2) G_fatal_error(_("Vector map <%s> is not open at topological level"), @@ -31,7 +31,7 @@ static void check_level(const struct Map_info *Map) \return number of nodes */ -plus_t Vect_get_num_nodes(const struct Map_info *Map) +plus_t Vect_get_num_nodes(struct Map_info *Map) { return (Map->plus.n_nodes); } @@ -44,7 +44,7 @@ plus_t Vect_get_num_nodes(const struct Map_info *Map) \return number of primitives */ -plus_t Vect_get_num_primitives(const struct Map_info *Map, int type) +plus_t Vect_get_num_primitives(struct Map_info *Map, int type) { plus_t num = 0; @@ -72,7 +72,7 @@ plus_t Vect_get_num_primitives(const struct Map_info *Map, int type) \return number of features */ -plus_t Vect_get_num_lines(const struct Map_info *Map) +plus_t Vect_get_num_lines(struct Map_info *Map) { return (Map->plus.n_lines); } @@ -84,7 +84,7 @@ plus_t Vect_get_num_lines(const struct Map_info *Map) \return number of areas */ -plus_t Vect_get_num_areas(const struct Map_info *Map) +plus_t Vect_get_num_areas(struct Map_info *Map) { return (Map->plus.n_areas); } @@ -96,7 +96,7 @@ plus_t Vect_get_num_areas(const struct Map_info *Map) \return number of kernels */ -plus_t Vect_get_num_kernels(const struct Map_info *Map) +plus_t Vect_get_num_kernels(struct Map_info *Map) { return (Map->plus.n_klines); } @@ -108,7 +108,7 @@ plus_t Vect_get_num_kernels(const struct Map_info *Map) \return number of faces */ -plus_t Vect_get_num_faces(const struct Map_info *Map) +plus_t Vect_get_num_faces(struct Map_info *Map) { return (Map->plus.n_flines); } @@ -120,7 +120,7 @@ plus_t Vect_get_num_faces(const struct Map_info *Map) \return number of volumes */ -plus_t Vect_get_num_volumes(const struct Map_info *Map) +plus_t Vect_get_num_volumes(struct Map_info *Map) { return (Map->plus.n_volumes); } @@ -132,7 +132,7 @@ plus_t Vect_get_num_volumes(const struct Map_info *Map) \return number of islands */ -plus_t Vect_get_num_islands(const struct Map_info *Map) +plus_t Vect_get_num_islands(struct Map_info *Map) { return (Map->plus.n_isles); } @@ -144,7 +144,7 @@ plus_t Vect_get_num_islands(const struct Map_info *Map) \return number of holes */ -plus_t Vect_get_num_holes(const struct Map_info *Map) +plus_t Vect_get_num_holes(struct Map_info *Map) { return (Map->plus.n_holes); } @@ -156,7 +156,7 @@ plus_t Vect_get_num_holes(const struct Map_info *Map) \return number of dblinks */ -int Vect_get_num_dblinks(const struct Map_info *Map) +int Vect_get_num_dblinks(struct Map_info *Map) { /* available on level 1 ? */ return (Map->dblnk->n_fields); @@ -172,7 +172,7 @@ int Vect_get_num_dblinks(const struct Map_info *Map) \return number of updated features */ -int Vect_get_num_updated_lines(const struct Map_info *Map) +int Vect_get_num_updated_lines(struct Map_info *Map) { return (Map->plus.uplist.n_uplines); } @@ -188,7 +188,7 @@ int Vect_get_num_updated_lines(const struct Map_info *Map) \return updated line */ -int Vect_get_updated_line(const struct Map_info *Map, int idx) +int Vect_get_updated_line(struct Map_info *Map, int idx) { return (Map->plus.uplist.uplines[idx]); } @@ -204,7 +204,7 @@ int Vect_get_updated_line(const struct Map_info *Map, int idx) \return updated line */ -off_t Vect_get_updated_line_offset(const struct Map_info *Map, int idx) +off_t Vect_get_updated_line_offset(struct Map_info *Map, int idx) { return (Map->plus.uplist.uplines_offset[idx]); } @@ -216,7 +216,7 @@ off_t Vect_get_updated_line_offset(const struct Map_info *Map, int idx) \return number of updated nodes */ -int Vect_get_num_updated_nodes(const struct Map_info *Map) +int Vect_get_num_updated_nodes(struct Map_info *Map) { return (Map->plus.uplist.n_upnodes); } @@ -238,7 +238,7 @@ int Vect_get_num_updated_nodes(const struct Map_info *Map) \return id of modified node */ -int Vect_get_updated_node(const struct Map_info *Map, int idx) +int Vect_get_updated_node(struct Map_info *Map, int idx) { return (Map->plus.uplist.upnodes[idx]); } @@ -251,7 +251,7 @@ int Vect_get_updated_node(const struct Map_info *Map, int idx) \return line type */ -int Vect_get_line_type(const struct Map_info *Map, int line) +int Vect_get_line_type(struct Map_info *Map, int line) { check_level(Map); @@ -271,8 +271,8 @@ int Vect_get_line_type(const struct Map_info *Map, int line) \return 0 on success \return -1 on error */ -int Vect_get_node_coor(const struct Map_info *Map, int num, double *x, - double *y, double *z) +int Vect_get_node_coor(struct Map_info *Map, int num, double *x, double *y, + double *z) { struct P_node *Node; @@ -300,7 +300,7 @@ int Vect_get_node_coor(const struct Map_info *Map, int num, double *x, \return 1 */ -int Vect_get_line_nodes(const struct Map_info *Map, int line, int *n1, int *n2) +int Vect_get_line_nodes(struct Map_info *Map, int line, int *n1, int *n2) { char type; @@ -343,8 +343,7 @@ int Vect_get_line_nodes(const struct Map_info *Map, int line, int *n1, int *n2) \return 1 on success \return -1 on failure (topology not available, line is not a boundary) */ -int Vect_get_line_areas(const struct Map_info *Map, int line, int *left, - int *right) +int Vect_get_line_areas(struct Map_info *Map, int line, int *left, int *right) { struct P_topo_b *topo; @@ -378,7 +377,7 @@ int Vect_get_line_areas(const struct Map_info *Map, int line, int *left, \return numbers of lines */ -int Vect_get_node_n_lines(const struct Map_info *Map, int node) +int Vect_get_node_n_lines(struct Map_info *Map, int node) { check_level(Map); @@ -394,7 +393,7 @@ int Vect_get_node_n_lines(const struct Map_info *Map, int node) \return line id */ -int Vect_get_node_line(const struct Map_info *Map, int node, int line) +int Vect_get_node_line(struct Map_info *Map, int node, int line) { check_level(Map); @@ -410,7 +409,7 @@ int Vect_get_node_line(const struct Map_info *Map, int node, int line) \return angle of segment of the line connected to the node */ -float Vect_get_node_line_angle(const struct Map_info *Map, int node, int line) +float Vect_get_node_line_angle(struct Map_info *Map, int node, int line) { check_level(Map); @@ -427,7 +426,7 @@ float Vect_get_node_line_angle(const struct Map_info *Map, int node, int line) \return 0 for not in area \return negative id if centroid is duplicated in the area */ -int Vect_get_centroid_area(const struct Map_info *Map, int centroid) +int Vect_get_centroid_area(struct Map_info *Map, int centroid) { struct P_topo_c *topo; diff --git a/lib/vector/Vlib/line.c b/lib/vector/Vlib/line.c index be74a8af933..eaa27b8b0c2 100644 --- a/lib/vector/Vlib/line.c +++ b/lib/vector/Vlib/line.c @@ -926,7 +926,7 @@ void Vect_line_reverse(struct line_pnts *Points) \return -1 no category \return category number (>=0) */ -int Vect_get_line_cat(const struct Map_info *Map, int line, int field) +int Vect_get_line_cat(struct Map_info *Map, int line, int field) { static struct line_cats *cats = NULL; diff --git a/lib/vector/Vlib/local_proto.h b/lib/vector/Vlib/local_proto.h index 3237c79cf0f..9f2062e3f26 100644 --- a/lib/vector/Vlib/local_proto.h +++ b/lib/vector/Vlib/local_proto.h @@ -19,9 +19,9 @@ API */ /* area.c */ -int Vect__get_area_points(const struct Map_info *, const plus_t *, int, +int Vect__get_area_points(struct Map_info *, const plus_t *, int, struct line_pnts *); -int Vect__get_area_points_nat(const struct Map_info *, const plus_t *, int, +int Vect__get_area_points_nat(struct Map_info *, const plus_t *, int, struct line_pnts *); /* close.c */ @@ -29,7 +29,7 @@ void Vect__free_cache(struct Format_info_cache *); void Vect__free_offset(struct Format_info_offset *); /* copy.c */ -int Vect__copy_areas(const struct Map_info *, int, struct Map_info *); +int Vect__copy_areas(struct Map_info *, int, struct Map_info *); /* map.c */ int Vect__delete(const char *, int); @@ -37,15 +37,14 @@ int Vect__delete(const char *, int); /* open.c */ int Vect__open_old(struct Map_info *, const char *, const char *, const char *, int, int, int); -char *Vect__get_path(char *, const struct Map_info *); -char *Vect__get_element_path(char *, const struct Map_info *, const char *); +char *Vect__get_path(char *, struct Map_info *); +char *Vect__get_element_path(char *, struct Map_info *, const char *); /* write_nat.c */ int V2__add_line_to_topo_nat(struct Map_info *, off_t, int, const struct line_pnts *, const struct line_cats *, int, - int (*external_routine)(const struct Map_info *, - int)); + int (*external_routine)(struct Map_info *, int)); int V2__delete_line_from_topo_nat(struct Map_info *, int, int, const struct line_pnts *, const struct line_cats *); diff --git a/lib/vector/Vlib/net_analyze.c b/lib/vector/Vlib/net_analyze.c index 1e2f5e5916a..c279668c670 100644 --- a/lib/vector/Vlib/net_analyze.c +++ b/lib/vector/Vlib/net_analyze.c @@ -411,7 +411,7 @@ dglGraph_s *Vect_net_get_graph(struct Map_info *Map) \return 1 OK \return 0 does not exist (was not inserted) */ -int Vect_net_get_line_cost(const struct Map_info *Map, int line, int direction, +int Vect_net_get_line_cost(struct Map_info *Map, int line, int direction, double *cost) { /* dglInt32_t *pEdge; */ @@ -465,7 +465,7 @@ int Vect_net_get_line_cost(const struct Map_info *Map, int line, int direction, \return 1 */ -int Vect_net_get_node_cost(const struct Map_info *Map, int node, double *cost) +int Vect_net_get_node_cost(struct Map_info *Map, int node, double *cost) { G_debug(3, "Vect_net_get_node_cost(): node = %d", node); diff --git a/lib/vector/Vlib/open.c b/lib/vector/Vlib/open.c index 8212eb1b757..501b31eb4cb 100644 --- a/lib/vector/Vlib/open.c +++ b/lib/vector/Vlib/open.c @@ -1006,7 +1006,7 @@ int Vect_open_tmp_new(struct Map_info *Map, const char *name, int with_z) \return 1 on success \return 0 on error */ -int Vect_coor_info(const struct Map_info *Map, struct Coor_info *Info) +int Vect_coor_info(struct Map_info *Map, struct Coor_info *Info) { char file_path[GPATH_MAX]; struct stat stat_buf; @@ -1064,7 +1064,7 @@ int Vect_coor_info(const struct Map_info *Map, struct Coor_info *Info) \return maptype string on success (allocated by G_store()) \return error message on error */ -const char *Vect_maptype_info(const struct Map_info *Map) +const char *Vect_maptype_info(struct Map_info *Map) { char maptype[1000]; @@ -1100,7 +1100,7 @@ const char *Vect_maptype_info(const struct Map_info *Map) \return map format code */ -int Vect_maptype(const struct Map_info *Map) +int Vect_maptype(struct Map_info *Map) { if (Map->temporary) { const struct Format_info *finfo; @@ -1489,7 +1489,7 @@ int map_format(struct Map_info *Map) \return buffer containing path */ -char *Vect__get_path(char *path, const struct Map_info *Map) +char *Vect__get_path(char *path, struct Map_info *Map) { if (Map->temporary) { char path_tmp[GPATH_MAX]; @@ -1514,7 +1514,7 @@ char *Vect__get_path(char *path, const struct Map_info *Map) \return allocated buffer containing path */ -char *Vect__get_element_path(char *file_path, const struct Map_info *Map, +char *Vect__get_element_path(char *file_path, struct Map_info *Map, const char *element) { char path[GPATH_MAX]; diff --git a/lib/vector/Vlib/pg_local_proto.h b/lib/vector/Vlib/pg_local_proto.h index 8e272f66a2e..9275a0d97bd 100644 --- a/lib/vector/Vlib/pg_local_proto.h +++ b/lib/vector/Vlib/pg_local_proto.h @@ -57,7 +57,7 @@ struct feat_parts { }; /* area_pg.c */ -int Vect__get_area_points_pg(const struct Map_info *, const plus_t *, int, +int Vect__get_area_points_pg(struct Map_info *, const plus_t *, int, struct line_pnts *); /* build_pg.c */ diff --git a/lib/vector/Vlib/poly.c b/lib/vector/Vlib/poly.c index 0840905ba85..f7100c6a4a9 100644 --- a/lib/vector/Vlib/poly.c +++ b/lib/vector/Vlib/poly.c @@ -52,8 +52,7 @@ static int Vect__divide_and_conquer(struct Slink *, const struct line_pnts *, \return 0 on success \return -1 on error */ -int Vect_get_point_in_area(const struct Map_info *Map, int area, double *X, - double *Y) +int Vect_get_point_in_area(struct Map_info *Map, int area, double *X, double *Y) { static struct line_pnts *Points; static struct line_pnts **IPoints; @@ -852,9 +851,8 @@ int Vect_point_in_poly(double X, double Y, const struct line_pnts *Points) \return 1 - inside \return 2 - on the boundary */ -int Vect_point_in_area_outer_ring(double X, double Y, - const struct Map_info *Map, int area, - struct bound_box *box) +int Vect_point_in_area_outer_ring(double X, double Y, struct Map_info *Map, + int area, struct bound_box *box) { static int first = 1; int n_intersects, inter; @@ -922,8 +920,8 @@ int Vect_point_in_area_outer_ring(double X, double Y, \return 1 - inside \return 2 - on the boundary */ -int Vect_point_in_island(double X, double Y, const struct Map_info *Map, - int isle, struct bound_box *box) +int Vect_point_in_island(double X, double Y, struct Map_info *Map, int isle, + struct bound_box *box) { static int first = 1; int n_intersects, inter; diff --git a/lib/vector/Vlib/read.c b/lib/vector/Vlib/read.c index 27060f869f3..0ddb13272a2 100644 --- a/lib/vector/Vlib/read.c +++ b/lib/vector/Vlib/read.c @@ -19,21 +19,22 @@ #include #include -static int read_dummy() +static int read_dummy(struct Map_info *, struct line_pnts *, struct line_cats *) { G_warning("Vect_read_line() %s", _("for this format/level not supported")); return -1; } #if !defined HAVE_OGR || !defined HAVE_POSTGRES -static int format() +static int format(struct Map_info *, struct line_pnts *, struct line_cats *) { G_fatal_error(_("Requested format is not compiled in this version")); return 0; } #endif -static int (*Read_next_line_array[][3])() = { +static int (*Read_next_line_array[][3])(struct Map_info *, struct line_pnts *, + struct line_cats *) = { {read_dummy, V1_read_next_line_nat, V2_read_next_line_nat} #ifdef HAVE_OGR , @@ -53,20 +54,22 @@ static int (*Read_next_line_array[][3])() = { #endif }; -static int (*Read_line_array[])() = {V2_read_line_nat +static int (*Read_line_array[])(struct Map_info *, struct line_pnts *, + struct line_cats *, int) = {V2_read_line_nat #ifdef HAVE_OGR - , - V2_read_line_sfa, V2_read_line_sfa + , + V2_read_line_sfa, + V2_read_line_sfa #else - , - format, format + , + format, format #endif #ifdef HAVE_POSTGRES - , - V2_read_line_pg + , + V2_read_line_pg #else - , - format + , + format #endif }; @@ -81,7 +84,7 @@ static int (*Read_line_array[])() = {V2_read_line_nat \return feature id \return -1 on error */ -int Vect_get_next_line_id(const struct Map_info *Map) +int Vect_get_next_line_id(struct Map_info *Map) { G_debug(3, "Vect_get_next_line()"); @@ -114,7 +117,7 @@ int Vect_get_next_line_id(const struct Map_info *Map) \return -1 on error \return -2 nothing to read */ -int Vect_read_next_line(const struct Map_info *Map, struct line_pnts *line_p, +int Vect_read_next_line(struct Map_info *Map, struct line_pnts *line_p, struct line_cats *line_c) { int ret; @@ -152,7 +155,7 @@ int Vect_read_next_line(const struct Map_info *Map, struct line_pnts *line_p, \return -1 on failure \return -2 nothing to read */ -int Vect_read_line(const struct Map_info *Map, struct line_pnts *line_p, +int Vect_read_line(struct Map_info *Map, struct line_pnts *line_p, struct line_cats *line_c, int line) { int ret; @@ -189,7 +192,7 @@ int Vect_read_line(const struct Map_info *Map, struct line_pnts *line_p, \return 1 feature alive \return 0 feature is dead or index is out of range */ -int Vect_line_alive(const struct Map_info *Map, int line) +int Vect_line_alive(struct Map_info *Map, int line) { if (line < 1 || line > Map->plus.n_lines) { G_warning(_("Line index is out of range")); @@ -213,7 +216,7 @@ int Vect_line_alive(const struct Map_info *Map, int line) \return 1 node alive \return 0 node is dead or index is out of range */ -int Vect_node_alive(const struct Map_info *Map, int node) +int Vect_node_alive(struct Map_info *Map, int node) { if (node < 1 || node > Map->plus.n_nodes) { G_warning(_("Node index is out of range")); @@ -237,7 +240,7 @@ int Vect_node_alive(const struct Map_info *Map, int node) \return 1 area alive \return 0 area is dead or index is out of range */ -int Vect_area_alive(const struct Map_info *Map, int area) +int Vect_area_alive(struct Map_info *Map, int area) { if (area < 1 || area > Map->plus.n_areas) { G_warning(_("Area index is out of range")); @@ -261,7 +264,7 @@ int Vect_area_alive(const struct Map_info *Map, int area) \return 1 isle alive \return 0 isle is dead or index is out of range */ -int Vect_isle_alive(const struct Map_info *Map, int isle) +int Vect_isle_alive(struct Map_info *Map, int isle) { if (isle < 1 || isle > Map->plus.n_isles) { G_warning(_("Isle index is out of range")); @@ -287,7 +290,7 @@ int Vect_isle_alive(const struct Map_info *Map, int isle) \return feature offset \return -1 on error */ -off_t Vect_get_line_offset(const struct Map_info *Map, int line) +off_t Vect_get_line_offset(struct Map_info *Map, int line) { if (line < 1 || line > Map->plus.n_lines) { return -1; diff --git a/lib/vector/Vlib/read_ogr.c b/lib/vector/Vlib/read_ogr.c index 3cb61cb3243..d1d5b86d24c 100644 --- a/lib/vector/Vlib/read_ogr.c +++ b/lib/vector/Vlib/read_ogr.c @@ -21,9 +21,8 @@ #include static int cache_feature(struct Map_info *, OGRGeometryH, int); -static int read_line(const struct Map_info *, OGRGeometryH, long, - struct line_pnts *); -static int get_line_type(const struct Map_info *, long); +static int read_line(struct Map_info *, OGRGeometryH, long, struct line_pnts *); +static int get_line_type(struct Map_info *, long); static int read_next_line_ogr(struct Map_info *, struct line_pnts *, struct line_cats *, int); #endif @@ -451,7 +450,7 @@ int read_next_line_ogr(struct Map_info *Map, struct line_pnts *line_p, \return feature type \return -1 on error */ -int read_line(const struct Map_info *Map, OGRGeometryH hGeom, long offset, +int read_line(struct Map_info *Map, OGRGeometryH hGeom, long offset, struct line_pnts *Points) { int i, nPoints; @@ -529,7 +528,7 @@ int read_line(const struct Map_info *Map, OGRGeometryH hGeom, long offset, \return feature type \return -1 on error */ -int get_line_type(const struct Map_info *Map, long fid) +int get_line_type(struct Map_info *Map, long fid) { int eType; diff --git a/lib/vector/Vlib/simple_features.c b/lib/vector/Vlib/simple_features.c index a742b854f35..5d4acdf9b41 100644 --- a/lib/vector/Vlib/simple_features.c +++ b/lib/vector/Vlib/simple_features.c @@ -297,7 +297,7 @@ int Vect_sfa_is_line_closed(const struct line_pnts *Points, int type, \return number of features \return -1 on error */ -int Vect_sfa_get_num_features(const struct Map_info *Map) +int Vect_sfa_get_num_features(struct Map_info *Map) { int nfeat; diff --git a/lib/vector/Vlib/write.c b/lib/vector/Vlib/write.c index a0309eddffa..e726840738d 100644 --- a/lib/vector/Vlib/write.c +++ b/lib/vector/Vlib/write.c @@ -174,7 +174,7 @@ static int (*Vect_restore_line_array[][3])(struct Map_info *, off_t, off_t) = { #endif }; -static int check_map(const struct Map_info *); +static int check_map(struct Map_info *); /*! \brief Writes a new feature @@ -329,7 +329,7 @@ int Vect_restore_line(struct Map_info *Map, off_t offset, off_t line) return ret; } -int check_map(const struct Map_info *Map) +int check_map(struct Map_info *Map) { if (!VECT_OPEN(Map)) { G_warning(_("Vector map <%s> is not opened"), Vect_get_name(Map)); diff --git a/lib/vector/Vlib/write_nat.c b/lib/vector/Vlib/write_nat.c index 7bfec7b4083..8f6993b2931 100644 --- a/lib/vector/Vlib/write_nat.c +++ b/lib/vector/Vlib/write_nat.c @@ -907,8 +907,7 @@ int V2__delete_line_from_topo_nat(struct Map_info *Map, int line, int type, int V2__add_line_to_topo_nat(struct Map_info *Map, off_t offset, int type, const struct line_pnts *points, const struct line_cats *cats, int restore_line, - int (*external_routine)(const struct Map_info *, - int)) + int (*external_routine)(struct Map_info *, int)) { int first, s, n, i, line; int node, next_line, area, side, sel_area, new_area[2]; diff --git a/lib/vector/Vlib/write_pg.c b/lib/vector/Vlib/write_pg.c index f3f4298c064..f2072762929 100644 --- a/lib/vector/Vlib/write_pg.c +++ b/lib/vector/Vlib/write_pg.c @@ -65,7 +65,7 @@ static int type_to_topogeom(const struct Format_info_pg *); static int update_next_edge(struct Map_info *, int, int); #if 0 /* unused */ -static int delete_face(const struct Map_info *, int); +static int delete_face(struct Map_info *, int); static int update_topo_edge(struct Map_info *, int); #endif static int update_topo_face(struct Map_info *, int); @@ -2612,7 +2612,7 @@ int Vect__insert_face_pg(struct Map_info *Map, int area) \return 0 on success \return -1 on error */ -int delete_face(const struct Map_info *Map, int area) +int delete_face(struct Map_info *Map, int area) { char stmt[DB_SQL_MAX]; diff --git a/vector/v.colors/local_proto.h b/vector/v.colors/local_proto.h index 38a4ca12c5e..906e5b1a422 100644 --- a/vector/v.colors/local_proto.h +++ b/vector/v.colors/local_proto.h @@ -4,13 +4,12 @@ #define USE_Z 3 /* scan_cats.c */ -void scan_cats(const struct Map_info *, int, const char *, const char *, +void scan_cats(struct Map_info *, int, const char *, const char *, const struct FPRange *, struct Colors *); /* scan_attr.c */ -int scan_attr(const struct Map_info *, int, const char *, const char *, - const char *, const struct FPRange *, struct Colors *, - struct Colors *, int); +int scan_attr(struct Map_info *, int, const char *, const char *, const char *, + const struct FPRange *, struct Colors *, struct Colors *, int); /* scan_z.c */ void scan_z(struct Map_info *, int, const char *, const char *, @@ -23,7 +22,6 @@ void color_rules_to_cats(dbCatValArray *, int, struct Colors *, struct Colors *, int, DCELL, DCELL); /* write_rgb.c */ -void write_rgb_values(const struct Map_info *, int, const char *, - struct Colors *); +void write_rgb_values(struct Map_info *, int, const char *, struct Colors *); /* read_rgb.c */ -void rgb2colr(const struct Map_info *, int, const char *, struct Colors *); +void rgb2colr(struct Map_info *, int, const char *, struct Colors *); diff --git a/vector/v.colors/read_rgb.c b/vector/v.colors/read_rgb.c index d15ea950bf1..99aa054138d 100644 --- a/vector/v.colors/read_rgb.c +++ b/vector/v.colors/read_rgb.c @@ -5,7 +5,7 @@ #include #include -void rgb2colr(const struct Map_info *Map, int layer, const char *rgb_column, +void rgb2colr(struct Map_info *Map, int layer, const char *rgb_column, struct Colors *colors) { int i, ret, nskipped; diff --git a/vector/v.colors/scan_attr.c b/vector/v.colors/scan_attr.c index ab39dfed290..18c51635f81 100644 --- a/vector/v.colors/scan_attr.c +++ b/vector/v.colors/scan_attr.c @@ -5,7 +5,7 @@ #include "local_proto.h" -int scan_attr(const struct Map_info *Map, int layer, const char *column_name, +int scan_attr(struct Map_info *Map, int layer, const char *column_name, const char *style, const char *rules, const struct FPRange *range, struct Colors *colors, struct Colors *rcolors, int invert) { diff --git a/vector/v.colors/scan_cats.c b/vector/v.colors/scan_cats.c index e3e45a121b0..61bf7107a76 100644 --- a/vector/v.colors/scan_cats.c +++ b/vector/v.colors/scan_cats.c @@ -6,7 +6,7 @@ static void scan_layer(int, const struct line_cats *, int *, int *); -void scan_cats(const struct Map_info *Map, int field, const char *style, +void scan_cats(struct Map_info *Map, int field, const char *style, const char *rules, const struct FPRange *range, struct Colors *colors) { diff --git a/vector/v.colors/write_rgb.c b/vector/v.colors/write_rgb.c index 6b06aca0e13..2ef07d6c3eb 100644 --- a/vector/v.colors/write_rgb.c +++ b/vector/v.colors/write_rgb.c @@ -4,8 +4,8 @@ #include #include -void write_rgb_values(const struct Map_info *Map, int layer, - const char *column_name, struct Colors *colors) +void write_rgb_values(struct Map_info *Map, int layer, const char *column_name, + struct Colors *colors) { int ctype, nrec, i; int red, grn, blu; diff --git a/vector/v.decimate/copy_tab.c b/vector/v.decimate/copy_tab.c index 73044125e9e..e286aff5e60 100644 --- a/vector/v.decimate/copy_tab.c +++ b/vector/v.decimate/copy_tab.c @@ -3,7 +3,7 @@ #include #include -void copy_tabs(const struct Map_info *In, struct Map_info *Out) +void copy_tabs(struct Map_info *In, struct Map_info *Out) { int nlines, line, i; int ttype, ntabs; diff --git a/vector/v.decimate/main.c b/vector/v.decimate/main.c index 52c21115bc2..3007093a58a 100644 --- a/vector/v.decimate/main.c +++ b/vector/v.decimate/main.c @@ -22,7 +22,7 @@ #include -void copy_tabs(const struct Map_info *In, struct Map_info *Out); +void copy_tabs(struct Map_info *In, struct Map_info *Out); struct DecimationContext { int use_z; /*!< TRUE or FALSE */ diff --git a/vector/v.distance/distance.c b/vector/v.distance/distance.c index 18479f2f0bf..1e248b333aa 100644 --- a/vector/v.distance/distance.c +++ b/vector/v.distance/distance.c @@ -222,11 +222,11 @@ int line2line(struct line_pnts *FPoints, int ftype, struct line_pnts *TPoints, * return 1 inside area * return 2 inside isle of area * return 3 outside area */ -int line2area(const struct Map_info *To, struct line_pnts *Points, int type, - int area, const struct bound_box *abox, double *fx, double *fy, - double *fz, double *falong, double *fangle, double *tx, - double *ty, double *tz, double *talong, double *tangle, - double *dist, int with_z) +int line2area(struct Map_info *To, struct line_pnts *Points, int type, int area, + const struct bound_box *abox, double *fx, double *fy, double *fz, + double *falong, double *fangle, double *tx, double *ty, + double *tz, double *talong, double *tangle, double *dist, + int with_z) { int i, j; double tmp_dist; diff --git a/vector/v.distance/local_proto.h b/vector/v.distance/local_proto.h index 4555c7b77fc..21afd668d20 100644 --- a/vector/v.distance/local_proto.h +++ b/vector/v.distance/local_proto.h @@ -59,11 +59,11 @@ int line2line(struct line_pnts *FPoints, int ftype, struct line_pnts *TPoints, int ttype, double *fx, double *fy, double *fz, double *falong, double *fangle, double *tx, double *ty, double *tz, double *talong, double *tangle, double *dist, int with_z); -int line2area(const struct Map_info *To, struct line_pnts *Points, int type, - int area, const struct bound_box *abox, double *fx, double *fy, - double *fz, double *falong, double *fangle, double *tx, - double *ty, double *tz, double *talong, double *tangle, - double *dist, int with_z); +int line2area(struct Map_info *To, struct line_pnts *Points, int type, int area, + const struct bound_box *abox, double *fx, double *fy, double *fz, + double *falong, double *fangle, double *tx, double *ty, + double *tz, double *talong, double *tangle, double *dist, + int with_z); /* print.c */ int print_upload(NEAR *, UPLOAD *, int, dbCatValArray *, dbCatVal *, char *); diff --git a/vector/v.extract/copy_tab.c b/vector/v.extract/copy_tab.c index 2db702cc2f8..07e635eed87 100644 --- a/vector/v.extract/copy_tab.c +++ b/vector/v.extract/copy_tab.c @@ -5,7 +5,7 @@ #include "local_proto.h" -void copy_tabs(const struct Map_info *In, int field, int new_cat, +void copy_tabs(struct Map_info *In, int field, int new_cat, struct Map_info *Out) { int nlines, line, i; diff --git a/vector/v.extract/local_proto.h b/vector/v.extract/local_proto.h index bcb63470c1a..73936757a66 100644 --- a/vector/v.extract/local_proto.h +++ b/vector/v.extract/local_proto.h @@ -1,5 +1,5 @@ /* copy_tab.c */ -void copy_tabs(const struct Map_info *, int, int, struct Map_info *); +void copy_tabs(struct Map_info *, int, int, struct Map_info *); /* extract.c */ int cmp(const void *, const void *); diff --git a/vector/v.info/local_proto.h b/vector/v.info/local_proto.h index 5e495d8428f..8d16b41bbe1 100644 --- a/vector/v.info/local_proto.h +++ b/vector/v.info/local_proto.h @@ -13,8 +13,8 @@ void parse_args(int, char **, char **, char **, int *, int *, int *); /* print.c */ void format_double(double, char *); -void print_region(const struct Map_info *); -void print_topo(const struct Map_info *); -void print_columns(const struct Map_info *, const char *, const char *); -void print_info(const struct Map_info *); -void print_shell(const struct Map_info *, const char *); +void print_region(struct Map_info *); +void print_topo(struct Map_info *); +void print_columns(struct Map_info *, const char *, const char *); +void print_info(struct Map_info *); +void print_shell(struct Map_info *, const char *); diff --git a/vector/v.info/print.c b/vector/v.info/print.c index 900983290e9..aa2ab564330 100644 --- a/vector/v.info/print.c +++ b/vector/v.info/print.c @@ -38,7 +38,7 @@ static char *format_zone(int zone_num) return zone_str; } -void print_region(const struct Map_info *Map) +void print_region(struct Map_info *Map) { char tmp1[1024], tmp2[1024]; @@ -59,7 +59,7 @@ void print_region(const struct Map_info *Map) fprintf(stdout, "bottom=%f\n", box.B); } -void print_topo(const struct Map_info *Map) +void print_topo(struct Map_info *Map) { int with_z; long nprimitives; @@ -123,7 +123,7 @@ void print_topo(const struct Map_info *Map) fflush(stdout); } -void print_columns(const struct Map_info *Map, const char *input_opt, +void print_columns(struct Map_info *Map, const char *input_opt, const char *field_opt) { int num_dblinks, col, ncols; @@ -174,7 +174,7 @@ void print_columns(const struct Map_info *Map, const char *input_opt, db_shutdown_driver(driver); } -void print_shell(const struct Map_info *Map, const char *field_opt) +void print_shell(struct Map_info *Map, const char *field_opt) { int map_type; int time_ok, first_time_ok, second_time_ok; @@ -272,7 +272,7 @@ void print_shell(const struct Map_info *Map, const char *field_opt) fprintf(stdout, "comment=%s\n", Vect_get_comment(Map)); } -void print_info(const struct Map_info *Map) +void print_info(struct Map_info *Map) { int i, map_type; char line[1024]; diff --git a/vector/v.out.postgis/local_proto.h b/vector/v.out.postgis/local_proto.h index 28b60c40393..6597f9d0725 100644 --- a/vector/v.out.postgis/local_proto.h +++ b/vector/v.out.postgis/local_proto.h @@ -19,7 +19,6 @@ char *create_pgfile(const char *, const char *, const char *, char **, int, char **, char **); /* table.c */ -void check_columns(const struct Map_info *, const char *, const char *, - const char *); +void check_columns(struct Map_info *, const char *, const char *, const char *); #endif /* __LOCAL_PROTO_V_OUT_POSTGIS__ */ diff --git a/vector/v.out.postgis/table.c b/vector/v.out.postgis/table.c index a320e0c280a..6d7a5eaca31 100644 --- a/vector/v.out.postgis/table.c +++ b/vector/v.out.postgis/table.c @@ -12,7 +12,7 @@ calls G_fatal_error() on error */ -void check_columns(const struct Map_info *Map, const char *layer, +void check_columns(struct Map_info *Map, const char *layer, const char *fid_column, const char *geom_column) { struct field_info *fi; From 8c727591e570a6fc631a3cf611280b3162ffc781 Mon Sep 17 00:00:00 2001 From: Nicklas Larsson Date: Mon, 20 Mar 2023 19:05:40 +0100 Subject: [PATCH 2/2] add missing parameter names and missing functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Māris Nartišs --- lib/vector/Vlib/read.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/vector/Vlib/read.c b/lib/vector/Vlib/read.c index 0ddb13272a2..34cc57bab3f 100644 --- a/lib/vector/Vlib/read.c +++ b/lib/vector/Vlib/read.c @@ -19,14 +19,24 @@ #include #include -static int read_dummy(struct Map_info *, struct line_pnts *, struct line_cats *) +static int read_dummy(struct Map_info *Map UNUSED, + struct line_pnts *line_p UNUSED, + struct line_cats *line_c UNUSED) { G_warning("Vect_read_line() %s", _("for this format/level not supported")); return -1; } #if !defined HAVE_OGR || !defined HAVE_POSTGRES -static int format(struct Map_info *, struct line_pnts *, struct line_cats *) +static int format(struct Map_info *Map UNUSED, struct line_pnts *line_p UNUSED, + struct line_cats *line_c UNUSED) +{ + G_fatal_error(_("Requested format is not compiled in this version")); + return 0; +} + +static int format2(struct Map_info *Map UNUSED, struct line_pnts *line_p UNUSED, + struct line_cats *line_c UNUSED, int line UNUSED) { G_fatal_error(_("Requested format is not compiled in this version")); return 0; @@ -62,14 +72,14 @@ static int (*Read_line_array[])(struct Map_info *, struct line_pnts *, V2_read_line_sfa #else , - format, format + format2, format2 #endif #ifdef HAVE_POSTGRES , V2_read_line_pg #else , - format + format2 #endif };