From: Karryanna Date: Wed, 13 May 2015 21:59:45 +0000 (+0200) Subject: Labelling: Getting rid of GCC warnings X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=a8223004ca3e83fbe801329089401e05b975b885;p=leo.git Labelling: Getting rid of GCC warnings --- diff --git a/labeller.c b/labeller.c index e74e4e4..3c1a87b 100644 --- a/labeller.c +++ b/labeller.c @@ -108,9 +108,9 @@ int num_placements = 0; int conf_map_part_width = 5; int conf_map_part_height = 5; -int num_map_parts_row; -int num_map_parts_col; -int num_map_parts; +uns num_map_parts_row; +uns num_map_parts_col; +uns num_map_parts; void make_graph(void); void label_graph(void); @@ -122,6 +122,9 @@ int overlaps(struct placement *p1, struct placement *p2); int get_overlap(struct placement *p); int individual_overlap(struct individual *individual); +double get_distance(struct placement *p); +double individual_distances(struct individual *individual); + void make_population(void); bool shall_terminate(void); void breed(void); @@ -1419,16 +1422,16 @@ double get_distance(struct placement *p) { case REQUEST_POINT: ; struct request_point *rp = (struct request_point *) p->request; - dx = rp->x + p->request->variants[p->variant_used].offset_x - p->x; - dy = rp->y + p->request->variants[p->variant_used].offset_y - p->y; + dx = rp->x + v->offset_x - p->x; + dy = rp->y + v->offset_y - p->y; distance = sqrt(dx*dx + dy*dy); if (dbg_rank >= VERBOSITY_PLACEMENT) printf("Point placed at [%.2f; %.2f], expected at [%.2f; %.2f]\n", p->x, p->y, rp->x, rp->y); break; case REQUEST_AREA: ; struct request_area *ra = (struct request_area *) p->request; - dx = ra->cx + p->request->variants[p->variant_used].offset_x - p->x; - dy = ra->cy + p->request->variants[p->variant_used].offset_y - p->y; + dx = ra->cx + v->offset_x - p->x; + dy = ra->cy + v->offset_y - p->y; distance = sqrt(dx*dx + dy*dy); if (dbg_rank >= VERBOSITY_PLACEMENT) printf("Area placed at [%.2f; %.2f], expected at [%.2f; %.2f]\n", p->x, p->y, ra->cx, ra->cy);