]> mj.ucw.cz Git - leo.git/commitdiff
Labelling: Getting rid of GCC warnings
authorKarryanna <karry@karryanna.cz>
Wed, 13 May 2015 21:59:45 +0000 (23:59 +0200)
committerKarryanna <karry@karryanna.cz>
Wed, 13 May 2015 21:59:45 +0000 (23:59 +0200)
labeller.c

index e74e4e45759f0c35f92e7639f2081756db958843..3c1a87b90b38ff152f022d53835c77c3342c744b 100644 (file)
@@ -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);