city_generator2

Generated conformal 3D meshes representing a city
git clone git://git.meso-star.fr/city_generator2.git
Log | Files | Refs | README | LICENSE

commit f01864cac4e5947885dc199339cef5a98adbf816
parent 6f43c1eb62dd77e8c902ce5b18b1171b5e80634e
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date:   Mon,  9 Jan 2023 16:53:25 +0100

Style: change ++i in i++ in some loops

Diffstat:
Msrc/cg_city.c | 9++++-----
Msrc/cg_constructive_mode_0.c | 2+-
Msrc/cg_constructive_mode_1.c | 16++++++++--------
3 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/src/cg_city.c b/src/cg_city.c @@ -31,7 +31,6 @@ #include <rsys/cstr.h> #include <rsys/logger.h> #include <rsys/mem_allocator.h> -#include <rsys/stretchy_array.h> #include <rsys/double4.h> #include <star/scpr.h> @@ -77,7 +76,7 @@ create_city d4_set(city->ground_extent, parsed_city->ground.extent); /* create buildings depending on their constructive modes */ - for (i = 0; i < city->buildings_count ; ++i) { + for (i = 0; i < city->buildings_count ; i++) { struct parsed_city_building* parsed_data = parsed_city->city_building_list + i; struct building* building = city->buildings + i; switch(parsed_data->cmode_type) { @@ -110,7 +109,7 @@ release_city(struct city* city) if(!city) return; /* iterate on building */ - for (i=0; i<city->buildings_count; ++i) { + for (i = 0; i < city->buildings_count; i++) { struct building* building = city->buildings + i; SCPR(polygon_ref_put(building->pg)); if(building->name_initialized) str_release(&building->name); @@ -135,7 +134,7 @@ city_cad_build(struct city* city) ERR(scad_set_options(&options)); /* iterate on buildings */ - for(i=0; i<city->buildings_count; ++i) { + for(i = 0; i < city->buildings_count; i++) { struct building* building = city->buildings + i; struct data_cad_cmode_0* cad = NULL; /* create building */ @@ -173,7 +172,7 @@ city_ground_build(struct city* city) ERR(scad_set_options(&options)); /* iterate on buildings */ - for(i = 0; i < ground.footprints_count ; ++i) { + for(i = 0; i < ground.footprints_count ; i++) { struct building* building = city->buildings + i; struct scad_geometry** footprint = ground.footprints + i; /* create building footprint */ diff --git a/src/cg_constructive_mode_0.c b/src/cg_constructive_mode_0.c @@ -588,7 +588,7 @@ export_stl_cmode_0 ERR(scad_stl_export(data_cad->cavity, NULL, binary)); /* connection export */ - for (i=0; i<data_cad->n_connection; ++i) { + for (i = 0; i < data_cad->n_connection; i++) { ERR(scad_stl_export(data_cad->connection[i], NULL, binary)); } diff --git a/src/cg_constructive_mode_1.c b/src/cg_constructive_mode_1.c @@ -447,7 +447,7 @@ build_inter_floor h_cavity = height - e_roof - attic - e_roof_ins - (double)floor_n*e_floor; z_floor = h_cavity/(double)(1 + floor_n); d[2] = e_floor; - for (i=0; i< floor_n; ++i) { + for (i = 0; i < floor_n; i++) { struct scad_geometry* floor = NULL; struct scad_geometry* footprint = NULL; @@ -469,7 +469,7 @@ exit: if (is_init) str_release(&name); if (pg_int) SCPR(polygon_ref_put(pg_int)); if (floor_list) { - for (i=0; i< floor_n; ++i) { + for (i = 0; i < floor_n; i++) { SCAD(geometry_delete(floor_list[i])); } sa_release(floor_list); @@ -755,7 +755,7 @@ build_windows ERR(scad_geometry_boundary(NULL, &data_cad->habitable_cavity, 1, &bcavity)); ERR(scad_geometry_explode(bcavity, NULL, &list, &list_n)); - for (i=0; i<list_n; ++i){ + for (i = 0; i < list_n; i++) { double* center = NULL; size_t center_n = 0; @@ -830,13 +830,13 @@ build_windows glass_list+1, sa_size(glass_list) - 1, &data_cad->glass)); exit: - for (i=0 ; i<list_n; ++i) { + for (i = 0 ; i < list_n; i++) { SCAD(geometry_delete(list[i])); } - for (i=0 ; i<sa_size(hole_list); ++i) { + for (i = 0 ; i < sa_size(hole_list); i++) { SCAD(geometry_delete(hole_list[i])); } - for (i=0 ; i<sa_size(glass_list); ++i) { + for (i = 0 ; i < sa_size(glass_list); i++) { SCAD(geometry_delete(glass_list[i])); } if (hole_list) sa_release(hole_list); @@ -1435,12 +1435,12 @@ export_stl_cmode_1 } /* boundary export*/ - for (i=0; i<sa_size(data_cad->boundary); ++i) { + for(i = 0; i < sa_size(data_cad->boundary); i++) { ERR(scad_stl_export(data_cad->boundary[i], NULL, binary)); } /* connections export*/ - for (i=0; i<sa_size(data_cad->connection); ++i) { + for(i = 0; i < sa_size(data_cad->connection); i++) { ERR(scad_stl_export(data_cad->connection[i], NULL, binary)); }