Compare commits
5 Commits
0304c0d08b
...
74eb17b2dc
Author | SHA1 | Date | |
---|---|---|---|
74eb17b2dc | |||
529b49ee2e | |||
6d31193123 | |||
188c6f5d87 | |||
92e40cb8ca |
@ -90,7 +90,8 @@ int gds_tree_check_cell_references(struct gds_library *lib)
|
||||
* @param cell Cell to check for
|
||||
* @return 0 if cell is not in list. 1 if cell is in list
|
||||
*/
|
||||
static int gds_tree_check_list_contains_cell(GList *list, struct gds_cell *cell) {
|
||||
static int gds_tree_check_list_contains_cell(GList *list, struct gds_cell *cell)
|
||||
{
|
||||
GList *iter;
|
||||
|
||||
for (iter = list; iter != NULL; iter = g_list_next(iter)) {
|
||||
@ -177,12 +178,14 @@ int gds_tree_check_reference_loops(struct gds_library *lib)
|
||||
res = gds_tree_check_iterate_ref_and_check(cell_to_check, &visited_cells);
|
||||
|
||||
if (visited_cells) {
|
||||
/* If cell contains no loop, print error when list not empty.
|
||||
/*
|
||||
* If cell contains no loop, print error when list not empty.
|
||||
* In case of a loop, it is completely normal that the list is not empty,
|
||||
* due to the instant return from gds_tree_check_iterate_ref_and_check()
|
||||
*/
|
||||
if (res == 0)
|
||||
fprintf(stderr, "Visited cell list should be empty. This is a bug. Please report this.\n");
|
||||
fprintf(stderr,
|
||||
"Visited cell list should be empty. This is a bug. Please report this.\n");
|
||||
g_list_free(visited_cells);
|
||||
visited_cells = NULL;
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ void bounding_box_calculate_path_box(GList *vertices, double thickness,
|
||||
GList *vertex_iterator;
|
||||
struct vector_2d pt;
|
||||
|
||||
//printf("Warning! Function bounding_box_calculate_path_box not yet implemented correctly!\n");
|
||||
/* printf("Warning! Function %s not yet implemented correctly!\n", __func__); */
|
||||
|
||||
if (!vertices || !box)
|
||||
return;
|
||||
|
@ -46,6 +46,7 @@ double vector_2d_scalar_multipy(struct vector_2d *a, struct vector_2d *b)
|
||||
void vector_2d_normalize(struct vector_2d *vec)
|
||||
{
|
||||
double len;
|
||||
|
||||
if (!vec)
|
||||
return;
|
||||
len = sqrt(pow(vec->x, 2) + pow(vec->y, 2));
|
||||
@ -97,10 +98,9 @@ struct vector_2d *vector_2d_alloc(void)
|
||||
|
||||
void vector_2d_free(struct vector_2d *vec)
|
||||
{
|
||||
if (vec) {
|
||||
if (vec)
|
||||
free(vec);
|
||||
}
|
||||
}
|
||||
|
||||
void vector_2d_scale(struct vector_2d *vec, double scale)
|
||||
{
|
||||
@ -114,9 +114,9 @@ void vector_2d_scale(struct vector_2d *vec, double scale)
|
||||
double vector_2d_abs(struct vector_2d *vec)
|
||||
{
|
||||
double len = 0.0;
|
||||
if (vec) {
|
||||
|
||||
if (vec)
|
||||
len = sqrt(pow(vec->x, 2) + pow(vec->y, 2));
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user