From dbf884c3d3ec62f948715042b68e07bc77e84760 Mon Sep 17 00:00:00 2001 From: Antonov548 Date: Thu, 15 Jun 2023 12:12:11 +0200 Subject: [PATCH 1/2] update `types-RC.yaml` --- src/rinterface.c | 122 +++++++++++++++++------------------ tools/stimulus/types-RC.yaml | 36 +++++++++-- 2 files changed, 91 insertions(+), 67 deletions(-) diff --git a/src/rinterface.c b/src/rinterface.c index 23cbfc212ec..a72f39e9bc0 100644 --- a/src/rinterface.c +++ b/src/rinterface.c @@ -6110,27 +6110,27 @@ SEXP R_igraph_isomorphic_vf2(SEXP graph1, SEXP graph2, SEXP vertex_color1, SEXP R_SEXP_to_igraph(graph1, &c_graph1); R_SEXP_to_igraph(graph2, &c_graph2); if (!Rf_isNull(vertex_color1)) { - R_SEXP_to_vector_int_copy(vertex_color1, &c_vertex_color1); + R_SEXP_to_vector_int_copy(vertex_color1, &c_vertex_color1); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color1, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color1, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_vertex_color1); if (!Rf_isNull(vertex_color2)) { - R_SEXP_to_vector_int_copy(vertex_color2, &c_vertex_color2); + R_SEXP_to_vector_int_copy(vertex_color2, &c_vertex_color2); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color2, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color2, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_vertex_color2); if (!Rf_isNull(edge_color1)) { - R_SEXP_to_vector_int_copy(edge_color1, &c_edge_color1); + R_SEXP_to_vector_int_copy(edge_color1, &c_edge_color1); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color1, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color1, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_edge_color1); if (!Rf_isNull(edge_color2)) { - R_SEXP_to_vector_int_copy(edge_color2, &c_edge_color2); + R_SEXP_to_vector_int_copy(edge_color2, &c_edge_color2); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color2, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color2, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_edge_color2); if (0 != igraph_vector_init(&c_map12, 0)) { @@ -6200,27 +6200,27 @@ SEXP R_igraph_count_isomorphisms_vf2(SEXP graph1, SEXP graph2, SEXP vertex_color R_SEXP_to_igraph(graph1, &c_graph1); R_SEXP_to_igraph(graph2, &c_graph2); if (!Rf_isNull(vertex_color1)) { - R_SEXP_to_vector_int_copy(vertex_color1, &c_vertex_color1); + R_SEXP_to_vector_int_copy(vertex_color1, &c_vertex_color1); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color1, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color1, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_vertex_color1); if (!Rf_isNull(vertex_color2)) { - R_SEXP_to_vector_int_copy(vertex_color2, &c_vertex_color2); + R_SEXP_to_vector_int_copy(vertex_color2, &c_vertex_color2); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color2, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color2, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_vertex_color2); if (!Rf_isNull(edge_color1)) { - R_SEXP_to_vector_int_copy(edge_color1, &c_edge_color1); + R_SEXP_to_vector_int_copy(edge_color1, &c_edge_color1); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color1, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color1, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_edge_color1); if (!Rf_isNull(edge_color2)) { - R_SEXP_to_vector_int_copy(edge_color2, &c_edge_color2); + R_SEXP_to_vector_int_copy(edge_color2, &c_edge_color2); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color2, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color2, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_edge_color2); c_count=0; @@ -6266,27 +6266,27 @@ SEXP R_igraph_get_isomorphisms_vf2(SEXP graph1, SEXP graph2, SEXP vertex_color1, R_SEXP_to_igraph(graph1, &c_graph1); R_SEXP_to_igraph(graph2, &c_graph2); if (!Rf_isNull(vertex_color1)) { - R_SEXP_to_vector_int_copy(vertex_color1, &c_vertex_color1); + R_SEXP_to_vector_int_copy(vertex_color1, &c_vertex_color1); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color1, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color1, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_vertex_color1); if (!Rf_isNull(vertex_color2)) { - R_SEXP_to_vector_int_copy(vertex_color2, &c_vertex_color2); + R_SEXP_to_vector_int_copy(vertex_color2, &c_vertex_color2); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color2, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color2, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_vertex_color2); if (!Rf_isNull(edge_color1)) { - R_SEXP_to_vector_int_copy(edge_color1, &c_edge_color1); + R_SEXP_to_vector_int_copy(edge_color1, &c_edge_color1); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color1, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color1, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_edge_color1); if (!Rf_isNull(edge_color2)) { - R_SEXP_to_vector_int_copy(edge_color2, &c_edge_color2); + R_SEXP_to_vector_int_copy(edge_color2, &c_edge_color2); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color2, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color2, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_edge_color2); if (0 != igraph_vector_ptr_init(&c_maps, 0)) { @@ -6340,27 +6340,27 @@ SEXP R_igraph_subisomorphic_vf2(SEXP graph1, SEXP graph2, SEXP vertex_color1, SE R_SEXP_to_igraph(graph1, &c_graph1); R_SEXP_to_igraph(graph2, &c_graph2); if (!Rf_isNull(vertex_color1)) { - R_SEXP_to_vector_int_copy(vertex_color1, &c_vertex_color1); + R_SEXP_to_vector_int_copy(vertex_color1, &c_vertex_color1); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color1, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color1, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_vertex_color1); if (!Rf_isNull(vertex_color2)) { - R_SEXP_to_vector_int_copy(vertex_color2, &c_vertex_color2); + R_SEXP_to_vector_int_copy(vertex_color2, &c_vertex_color2); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color2, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color2, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_vertex_color2); if (!Rf_isNull(edge_color1)) { - R_SEXP_to_vector_int_copy(edge_color1, &c_edge_color1); + R_SEXP_to_vector_int_copy(edge_color1, &c_edge_color1); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color1, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color1, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_edge_color1); if (!Rf_isNull(edge_color2)) { - R_SEXP_to_vector_int_copy(edge_color2, &c_edge_color2); + R_SEXP_to_vector_int_copy(edge_color2, &c_edge_color2); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color2, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color2, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_edge_color2); if (0 != igraph_vector_init(&c_map12, 0)) { @@ -6430,27 +6430,27 @@ SEXP R_igraph_count_subisomorphisms_vf2(SEXP graph1, SEXP graph2, SEXP vertex_co R_SEXP_to_igraph(graph1, &c_graph1); R_SEXP_to_igraph(graph2, &c_graph2); if (!Rf_isNull(vertex_color1)) { - R_SEXP_to_vector_int_copy(vertex_color1, &c_vertex_color1); + R_SEXP_to_vector_int_copy(vertex_color1, &c_vertex_color1); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color1, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color1, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_vertex_color1); if (!Rf_isNull(vertex_color2)) { - R_SEXP_to_vector_int_copy(vertex_color2, &c_vertex_color2); + R_SEXP_to_vector_int_copy(vertex_color2, &c_vertex_color2); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color2, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color2, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_vertex_color2); if (!Rf_isNull(edge_color1)) { - R_SEXP_to_vector_int_copy(edge_color1, &c_edge_color1); + R_SEXP_to_vector_int_copy(edge_color1, &c_edge_color1); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color1, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color1, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_edge_color1); if (!Rf_isNull(edge_color2)) { - R_SEXP_to_vector_int_copy(edge_color2, &c_edge_color2); + R_SEXP_to_vector_int_copy(edge_color2, &c_edge_color2); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color2, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color2, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_edge_color2); c_count=0; @@ -6496,27 +6496,27 @@ SEXP R_igraph_get_subisomorphisms_vf2(SEXP graph1, SEXP graph2, SEXP vertex_colo R_SEXP_to_igraph(graph1, &c_graph1); R_SEXP_to_igraph(graph2, &c_graph2); if (!Rf_isNull(vertex_color1)) { - R_SEXP_to_vector_int_copy(vertex_color1, &c_vertex_color1); + R_SEXP_to_vector_int_copy(vertex_color1, &c_vertex_color1); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color1, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color1, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_vertex_color1); if (!Rf_isNull(vertex_color2)) { - R_SEXP_to_vector_int_copy(vertex_color2, &c_vertex_color2); + R_SEXP_to_vector_int_copy(vertex_color2, &c_vertex_color2); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color2, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color2, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_vertex_color2); if (!Rf_isNull(edge_color1)) { - R_SEXP_to_vector_int_copy(edge_color1, &c_edge_color1); + R_SEXP_to_vector_int_copy(edge_color1, &c_edge_color1); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color1, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color1, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_edge_color1); if (!Rf_isNull(edge_color2)) { - R_SEXP_to_vector_int_copy(edge_color2, &c_edge_color2); + R_SEXP_to_vector_int_copy(edge_color2, &c_edge_color2); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color2, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color2, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_edge_color2); if (0 != igraph_vector_ptr_init(&c_maps, 0)) { @@ -6587,9 +6587,9 @@ SEXP R_igraph_canonical_permutation(SEXP graph, SEXP colors, SEXP sh) { /* Convert input */ R_SEXP_to_igraph(graph, &c_graph); if (!Rf_isNull(colors)) { - R_SEXP_to_vector_int_copy(colors, &c_colors); + R_SEXP_to_vector_int_copy(colors, &c_colors); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_colors, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_colors, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_colors); if (0 != igraph_vector_init(&c_labeling, 0)) { @@ -6675,15 +6675,15 @@ SEXP R_igraph_isomorphic_bliss(SEXP graph1, SEXP graph2, SEXP colors1, SEXP colo R_SEXP_to_igraph(graph1, &c_graph1); R_SEXP_to_igraph(graph2, &c_graph2); if (!Rf_isNull(colors1)) { - R_SEXP_to_vector_int_copy(colors1, &c_colors1); + R_SEXP_to_vector_int_copy(colors1, &c_colors1); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_colors1, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_colors1, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_colors1); if (!Rf_isNull(colors2)) { - R_SEXP_to_vector_int_copy(colors2, &c_colors2); + R_SEXP_to_vector_int_copy(colors2, &c_colors2); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_colors2, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_colors2, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_colors2); if (0 != igraph_vector_init(&c_map12, 0)) { @@ -6751,9 +6751,9 @@ SEXP R_igraph_automorphisms(SEXP graph, SEXP colors, SEXP sh) { /* Convert input */ R_SEXP_to_igraph(graph, &c_graph); if (!Rf_isNull(colors)) { - R_SEXP_to_vector_int_copy(colors, &c_colors); + R_SEXP_to_vector_int_copy(colors, &c_colors); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_colors, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_colors, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_colors); c_sh = (igraph_bliss_sh_t) Rf_asInteger(sh); @@ -6788,9 +6788,9 @@ SEXP R_igraph_automorphism_group(SEXP graph, SEXP colors, SEXP sh) { /* Convert input */ R_SEXP_to_igraph(graph, &c_graph); if (!Rf_isNull(colors)) { - R_SEXP_to_vector_int_copy(colors, &c_colors); + R_SEXP_to_vector_int_copy(colors, &c_colors); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_colors, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_colors, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_colors); if (0 != igraph_vector_ptr_init(&c_generators, 0)) { @@ -7449,11 +7449,7 @@ SEXP R_igraph_from_prufer(SEXP prufer) { SEXP r_result; /* Convert input */ - if (!Rf_isNull(prufer)) { - R_SEXP_to_vector_int_copy(prufer, &c_prufer); - } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_prufer, 0)); - } + R_SEXP_to_vector_int_copy(prufer, &c_prufer); IGRAPH_FINALLY(igraph_vector_int_destroy, &c_prufer); /* Call igraph */ IGRAPH_R_CHECK(igraph_from_prufer(&c_graph, &c_prufer)); diff --git a/tools/stimulus/types-RC.yaml b/tools/stimulus/types-RC.yaml index a667c96702e..1ca695b6fa0 100644 --- a/tools/stimulus/types-RC.yaml +++ b/tools/stimulus/types-RC.yaml @@ -96,13 +96,18 @@ INDEX_VECTOR: CALL: '&%C%' CTYPE: igraph_vector_int_t INCONV: - IN: R_SEXP_to_vector_int_copy(%I%, &%C%); + IN: |- + R_SEXP_to_vector_int_copy(%I%, &%C%); + IGRAPH_FINALLY(igraph_vector_int_destroy, &%C%); OUT: |- if (0 != igraph_vector_int_init(&%C%, 0)) { igraph_error("", __FILE__, __LINE__, IGRAPH_ENOMEM); } IGRAPH_FINALLY(igraph_vector_int_destroy, &%C%); OUTCONV: + IN: |- + igraph_vector_int_destroy(&%C%); + IGRAPH_FINALLY_CLEAN(1); OUT: |- PROTECT(%I%=R_igraph_vector_int_to_SEXP(&%C%)); igraph_vector_int_destroy(&%C%); @@ -196,13 +201,18 @@ VECTOR_INT: CALL: '&%C%' CTYPE: igraph_vector_int_t INCONV: - IN: R_SEXP_to_vector_int_copy(%I%, &%C%); + IN: |- + R_SEXP_to_vector_int_copy(%I%, &%C%); + IGRAPH_FINALLY(igraph_vector_int_destroy, &%C%); OUT: |- if (0 != igraph_vector_int_init(&%C%, 0)) { igraph_error("", __FILE__, __LINE__, IGRAPH_ENOMEM); } IGRAPH_FINALLY(igraph_vector_int_destroy, &%C%); OUTCONV: + IN: |- + igraph_vector_int_destroy(&%C%); + IGRAPH_FINALLY_CLEAN(1); OUT: |- PROTECT(%I%=R_igraph_vector_int_to_SEXP(&%C%)); igraph_vector_int_destroy(&%C%); @@ -657,13 +667,22 @@ VERTEX_COLOR: OUT: '&%C%' CTYPE: igraph_vector_int_t INCONV: - IN: if (!Rf_isNull(%I%)) { R_SEXP_to_vector_int_copy(%I%, &%C%); } + IN: |- + if (!Rf_isNull(%I%)) { + R_SEXP_to_vector_int_copy(%I%, &%C%); + } else { + IGRAPH_R_CHECK(igraph_vector_int_init(&%C%, 0)); + } + IGRAPH_FINALLY(igraph_vector_int_destroy, &%C%); OUT: |- if (0 != igraph_vector_int_init(&%C%, 0)) { igraph_error("", __FILE__, __LINE__, IGRAPH_ENOMEM); } IGRAPH_FINALLY(igraph_vector_int_destroy, &%C%); OUTCONV: + IN: |- + igraph_vector_int_destroy(&%C%); + IGRAPH_FINALLY_CLEAN(1); OUT: |- PROTECT(%I%=R_igraph_vector_int_to_SEXP(&%C%)); igraph_vector_int_destroy(&%C%); @@ -675,13 +694,22 @@ EDGE_COLOR: OUT: '&%C%' CTYPE: igraph_vector_int_t INCONV: - IN: if (!Rf_isNull(%I%)) { R_SEXP_to_vector_int_copy(%I%, &%C%); } + IN: |- + if (!Rf_isNull(%I%)) { + R_SEXP_to_vector_int_copy(%I%, &%C%); + } else { + IGRAPH_R_CHECK(igraph_vector_int_init(&%C%, 0)); + } + IGRAPH_FINALLY(igraph_vector_int_destroy, &%C%); OUT: |- if (0 != igraph_vector_int_init(&%C%, 0)) { igraph_error("", __FILE__, __LINE__, IGRAPH_ENOMEM); } IGRAPH_FINALLY(igraph_vector_int_destroy, &%C%); OUTCONV: + IN: |- + igraph_vector_int_destroy(&%C%); + IGRAPH_FINALLY_CLEAN(1); OUT: |- PROTECT(%I%=R_igraph_vector_int_to_SEXP(&%C%)); igraph_vector_int_destroy(&%C%); From c1a77d5eb80bc3212867384c55ba3986f6fdced0 Mon Sep 17 00:00:00 2001 From: Antonov548 Date: Thu, 15 Jun 2023 12:16:51 +0200 Subject: [PATCH 2/2] fix indent --- src/rinterface.c | 116 +++++++++++++++++------------------ tools/stimulus/types-RC.yaml | 8 +-- 2 files changed, 62 insertions(+), 62 deletions(-) diff --git a/src/rinterface.c b/src/rinterface.c index a72f39e9bc0..fb11c7515e6 100644 --- a/src/rinterface.c +++ b/src/rinterface.c @@ -6110,27 +6110,27 @@ SEXP R_igraph_isomorphic_vf2(SEXP graph1, SEXP graph2, SEXP vertex_color1, SEXP R_SEXP_to_igraph(graph1, &c_graph1); R_SEXP_to_igraph(graph2, &c_graph2); if (!Rf_isNull(vertex_color1)) { - R_SEXP_to_vector_int_copy(vertex_color1, &c_vertex_color1); + R_SEXP_to_vector_int_copy(vertex_color1, &c_vertex_color1); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color1, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color1, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_vertex_color1); if (!Rf_isNull(vertex_color2)) { - R_SEXP_to_vector_int_copy(vertex_color2, &c_vertex_color2); + R_SEXP_to_vector_int_copy(vertex_color2, &c_vertex_color2); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color2, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color2, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_vertex_color2); if (!Rf_isNull(edge_color1)) { - R_SEXP_to_vector_int_copy(edge_color1, &c_edge_color1); + R_SEXP_to_vector_int_copy(edge_color1, &c_edge_color1); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color1, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color1, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_edge_color1); if (!Rf_isNull(edge_color2)) { - R_SEXP_to_vector_int_copy(edge_color2, &c_edge_color2); + R_SEXP_to_vector_int_copy(edge_color2, &c_edge_color2); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color2, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color2, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_edge_color2); if (0 != igraph_vector_init(&c_map12, 0)) { @@ -6200,27 +6200,27 @@ SEXP R_igraph_count_isomorphisms_vf2(SEXP graph1, SEXP graph2, SEXP vertex_color R_SEXP_to_igraph(graph1, &c_graph1); R_SEXP_to_igraph(graph2, &c_graph2); if (!Rf_isNull(vertex_color1)) { - R_SEXP_to_vector_int_copy(vertex_color1, &c_vertex_color1); + R_SEXP_to_vector_int_copy(vertex_color1, &c_vertex_color1); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color1, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color1, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_vertex_color1); if (!Rf_isNull(vertex_color2)) { - R_SEXP_to_vector_int_copy(vertex_color2, &c_vertex_color2); + R_SEXP_to_vector_int_copy(vertex_color2, &c_vertex_color2); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color2, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color2, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_vertex_color2); if (!Rf_isNull(edge_color1)) { - R_SEXP_to_vector_int_copy(edge_color1, &c_edge_color1); + R_SEXP_to_vector_int_copy(edge_color1, &c_edge_color1); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color1, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color1, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_edge_color1); if (!Rf_isNull(edge_color2)) { - R_SEXP_to_vector_int_copy(edge_color2, &c_edge_color2); + R_SEXP_to_vector_int_copy(edge_color2, &c_edge_color2); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color2, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color2, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_edge_color2); c_count=0; @@ -6266,27 +6266,27 @@ SEXP R_igraph_get_isomorphisms_vf2(SEXP graph1, SEXP graph2, SEXP vertex_color1, R_SEXP_to_igraph(graph1, &c_graph1); R_SEXP_to_igraph(graph2, &c_graph2); if (!Rf_isNull(vertex_color1)) { - R_SEXP_to_vector_int_copy(vertex_color1, &c_vertex_color1); + R_SEXP_to_vector_int_copy(vertex_color1, &c_vertex_color1); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color1, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color1, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_vertex_color1); if (!Rf_isNull(vertex_color2)) { - R_SEXP_to_vector_int_copy(vertex_color2, &c_vertex_color2); + R_SEXP_to_vector_int_copy(vertex_color2, &c_vertex_color2); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color2, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color2, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_vertex_color2); if (!Rf_isNull(edge_color1)) { - R_SEXP_to_vector_int_copy(edge_color1, &c_edge_color1); + R_SEXP_to_vector_int_copy(edge_color1, &c_edge_color1); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color1, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color1, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_edge_color1); if (!Rf_isNull(edge_color2)) { - R_SEXP_to_vector_int_copy(edge_color2, &c_edge_color2); + R_SEXP_to_vector_int_copy(edge_color2, &c_edge_color2); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color2, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color2, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_edge_color2); if (0 != igraph_vector_ptr_init(&c_maps, 0)) { @@ -6340,27 +6340,27 @@ SEXP R_igraph_subisomorphic_vf2(SEXP graph1, SEXP graph2, SEXP vertex_color1, SE R_SEXP_to_igraph(graph1, &c_graph1); R_SEXP_to_igraph(graph2, &c_graph2); if (!Rf_isNull(vertex_color1)) { - R_SEXP_to_vector_int_copy(vertex_color1, &c_vertex_color1); + R_SEXP_to_vector_int_copy(vertex_color1, &c_vertex_color1); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color1, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color1, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_vertex_color1); if (!Rf_isNull(vertex_color2)) { - R_SEXP_to_vector_int_copy(vertex_color2, &c_vertex_color2); + R_SEXP_to_vector_int_copy(vertex_color2, &c_vertex_color2); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color2, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color2, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_vertex_color2); if (!Rf_isNull(edge_color1)) { - R_SEXP_to_vector_int_copy(edge_color1, &c_edge_color1); + R_SEXP_to_vector_int_copy(edge_color1, &c_edge_color1); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color1, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color1, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_edge_color1); if (!Rf_isNull(edge_color2)) { - R_SEXP_to_vector_int_copy(edge_color2, &c_edge_color2); + R_SEXP_to_vector_int_copy(edge_color2, &c_edge_color2); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color2, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color2, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_edge_color2); if (0 != igraph_vector_init(&c_map12, 0)) { @@ -6430,27 +6430,27 @@ SEXP R_igraph_count_subisomorphisms_vf2(SEXP graph1, SEXP graph2, SEXP vertex_co R_SEXP_to_igraph(graph1, &c_graph1); R_SEXP_to_igraph(graph2, &c_graph2); if (!Rf_isNull(vertex_color1)) { - R_SEXP_to_vector_int_copy(vertex_color1, &c_vertex_color1); + R_SEXP_to_vector_int_copy(vertex_color1, &c_vertex_color1); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color1, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color1, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_vertex_color1); if (!Rf_isNull(vertex_color2)) { - R_SEXP_to_vector_int_copy(vertex_color2, &c_vertex_color2); + R_SEXP_to_vector_int_copy(vertex_color2, &c_vertex_color2); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color2, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color2, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_vertex_color2); if (!Rf_isNull(edge_color1)) { - R_SEXP_to_vector_int_copy(edge_color1, &c_edge_color1); + R_SEXP_to_vector_int_copy(edge_color1, &c_edge_color1); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color1, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color1, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_edge_color1); if (!Rf_isNull(edge_color2)) { - R_SEXP_to_vector_int_copy(edge_color2, &c_edge_color2); + R_SEXP_to_vector_int_copy(edge_color2, &c_edge_color2); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color2, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color2, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_edge_color2); c_count=0; @@ -6496,27 +6496,27 @@ SEXP R_igraph_get_subisomorphisms_vf2(SEXP graph1, SEXP graph2, SEXP vertex_colo R_SEXP_to_igraph(graph1, &c_graph1); R_SEXP_to_igraph(graph2, &c_graph2); if (!Rf_isNull(vertex_color1)) { - R_SEXP_to_vector_int_copy(vertex_color1, &c_vertex_color1); + R_SEXP_to_vector_int_copy(vertex_color1, &c_vertex_color1); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color1, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color1, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_vertex_color1); if (!Rf_isNull(vertex_color2)) { - R_SEXP_to_vector_int_copy(vertex_color2, &c_vertex_color2); + R_SEXP_to_vector_int_copy(vertex_color2, &c_vertex_color2); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color2, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_vertex_color2, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_vertex_color2); if (!Rf_isNull(edge_color1)) { - R_SEXP_to_vector_int_copy(edge_color1, &c_edge_color1); + R_SEXP_to_vector_int_copy(edge_color1, &c_edge_color1); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color1, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color1, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_edge_color1); if (!Rf_isNull(edge_color2)) { - R_SEXP_to_vector_int_copy(edge_color2, &c_edge_color2); + R_SEXP_to_vector_int_copy(edge_color2, &c_edge_color2); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color2, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_edge_color2, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_edge_color2); if (0 != igraph_vector_ptr_init(&c_maps, 0)) { @@ -6587,9 +6587,9 @@ SEXP R_igraph_canonical_permutation(SEXP graph, SEXP colors, SEXP sh) { /* Convert input */ R_SEXP_to_igraph(graph, &c_graph); if (!Rf_isNull(colors)) { - R_SEXP_to_vector_int_copy(colors, &c_colors); + R_SEXP_to_vector_int_copy(colors, &c_colors); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_colors, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_colors, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_colors); if (0 != igraph_vector_init(&c_labeling, 0)) { @@ -6675,15 +6675,15 @@ SEXP R_igraph_isomorphic_bliss(SEXP graph1, SEXP graph2, SEXP colors1, SEXP colo R_SEXP_to_igraph(graph1, &c_graph1); R_SEXP_to_igraph(graph2, &c_graph2); if (!Rf_isNull(colors1)) { - R_SEXP_to_vector_int_copy(colors1, &c_colors1); + R_SEXP_to_vector_int_copy(colors1, &c_colors1); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_colors1, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_colors1, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_colors1); if (!Rf_isNull(colors2)) { - R_SEXP_to_vector_int_copy(colors2, &c_colors2); + R_SEXP_to_vector_int_copy(colors2, &c_colors2); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_colors2, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_colors2, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_colors2); if (0 != igraph_vector_init(&c_map12, 0)) { @@ -6751,9 +6751,9 @@ SEXP R_igraph_automorphisms(SEXP graph, SEXP colors, SEXP sh) { /* Convert input */ R_SEXP_to_igraph(graph, &c_graph); if (!Rf_isNull(colors)) { - R_SEXP_to_vector_int_copy(colors, &c_colors); + R_SEXP_to_vector_int_copy(colors, &c_colors); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_colors, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_colors, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_colors); c_sh = (igraph_bliss_sh_t) Rf_asInteger(sh); @@ -6788,9 +6788,9 @@ SEXP R_igraph_automorphism_group(SEXP graph, SEXP colors, SEXP sh) { /* Convert input */ R_SEXP_to_igraph(graph, &c_graph); if (!Rf_isNull(colors)) { - R_SEXP_to_vector_int_copy(colors, &c_colors); + R_SEXP_to_vector_int_copy(colors, &c_colors); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&c_colors, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&c_colors, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &c_colors); if (0 != igraph_vector_ptr_init(&c_generators, 0)) { diff --git a/tools/stimulus/types-RC.yaml b/tools/stimulus/types-RC.yaml index 1ca695b6fa0..b42ec8a6454 100644 --- a/tools/stimulus/types-RC.yaml +++ b/tools/stimulus/types-RC.yaml @@ -669,9 +669,9 @@ VERTEX_COLOR: INCONV: IN: |- if (!Rf_isNull(%I%)) { - R_SEXP_to_vector_int_copy(%I%, &%C%); + R_SEXP_to_vector_int_copy(%I%, &%C%); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&%C%, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&%C%, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &%C%); OUT: |- @@ -696,9 +696,9 @@ EDGE_COLOR: INCONV: IN: |- if (!Rf_isNull(%I%)) { - R_SEXP_to_vector_int_copy(%I%, &%C%); + R_SEXP_to_vector_int_copy(%I%, &%C%); } else { - IGRAPH_R_CHECK(igraph_vector_int_init(&%C%, 0)); + IGRAPH_R_CHECK(igraph_vector_int_init(&%C%, 0)); } IGRAPH_FINALLY(igraph_vector_int_destroy, &%C%); OUT: |-