Skip to content

Commit 9e8d29e

Browse files
committed
Add new type annotations for RzGraph and HtPP
1 parent 63b64b7 commit 9e8d29e

20 files changed

Lines changed: 235 additions & 235 deletions

librz/arch/class.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,7 @@ RZ_API RzAnalysisClassErr rz_analysis_class_vtable_delete(RzAnalysis *analysis,
12691269
* \param analysis
12701270
* \return RzGraph* NULL if failure
12711271
*/
1272-
RZ_API RzGraph /*<RzGraphNodeInfo *>*/ *rz_analysis_class_get_inheritance_graph(RzAnalysis *analysis) {
1272+
RZ_API RzGraph /*<RzGraphNodeInfo *, None *>*/ *rz_analysis_class_get_inheritance_graph(RzAnalysis *analysis) {
12731273
rz_return_val_if_fail(analysis, NULL);
12741274
RzGraph *class_graph = rz_graph_new(RZ_GRAPH_IMPL_LIST, NULL, rz_graph_free_node_info, NULL);
12751275
if (!class_graph) {

librz/bin/format/le/le.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ typedef struct rz_bin_le_obj_s {
9494
RzList /*<RzBinSymbol *>*/ *symbols;
9595
RzVector /*<LE_entry>*/ *le_entries;
9696
RzPVector /*<RzBinImport *>*/ *imports;
97-
HtPP /*<LE_import *, NULL>*/ *le_import_ht;
97+
HtPP /*<LE_import *, NULL *>*/ *le_import_ht;
9898
RzList /*<LE_reloc *>*/ *le_relocs;
9999
ut32 reloc_target_map_base;
100100
ut32 reloc_targets_count;

librz/bin/format/mach0/mach0.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ struct MACH0_(obj_t) {
170170
*/
171171
RzPVector /*<RzBinImport *>*/ imports_by_ord;
172172

173-
HtPP *imports_by_name; ///< other imports created only by name
173+
HtPP /*<char *, RzBinImport *>*/ *imports_by_name; ///< other imports created only by name
174174

175175
struct dysymtab_command dysymtab;
176176
struct load_command main_cmd;

librz/bin/p/bin_mach0.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ static RzPVector /*<RzBinSymbol *>*/ *mach0_symbols(RzBinFile *bf) {
273273
return ret;
274274
}
275275

276-
static RzBinImport *import_from_name(RzBin *rbin, const char *orig_name, HtPP *imports_by_name) {
276+
static RzBinImport *import_from_name(RzBin *rbin, const char *orig_name, HtPP /*<char *, RzBinImport *>*/ *imports_by_name) {
277277
if (imports_by_name) {
278278
bool found = false;
279279
RzBinImport *ptr = ht_pp_find(imports_by_name, orig_name, &found);

librz/core/agraph.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,7 +1493,7 @@ static void fini_vertical_nodes_kv(HtPPKv *kv, RZ_UNUSED void *user) {
14931493
/* if v is an original node, L(v) = { v }
14941494
* if v is a dummy node, L(v) is the set of all the dummies node that belongs
14951495
* to the same long edge */
1496-
static HtPP *compute_vertical_nodes(const RzAGraph *g) {
1496+
static HtPP /*<RzGraphNode *, RzList *>*/ *compute_vertical_nodes(const RzAGraph *g) {
14971497
HtPPOptions ht_opt = { 0 };
14981498
ht_opt.finiKV = fini_vertical_nodes_kv;
14991499
HtPP *res = ht_pp_new_opt(&ht_opt);
@@ -1536,7 +1536,7 @@ static HtPP *compute_vertical_nodes(const RzAGraph *g) {
15361536
* - v E C
15371537
* - w E C => L(v) is a subset of C
15381538
* - w E C, the s+(w) exists and is not in any class yet => s+(w) E C */
1539-
static RzList /*<RzGraphNode *>*/ **compute_classes(const RzAGraph *g, HtPP *v_nodes, int is_left, int *n_classes) {
1539+
static RzList /*<RzGraphNode *>*/ **compute_classes(const RzAGraph *g, HtPP /*<RzGraphNode *, RzList *>*/ *v_nodes, int is_left, int *n_classes) {
15401540
int i, j, c;
15411541
RzList **res = RZ_NEWS0(RzList *, g->n_layers);
15421542
RzGraphNode *gn;
@@ -1736,7 +1736,7 @@ static int place_nodes_sel_p(int newval, int oldval, int is_first, int is_left)
17361736
}
17371737

17381738
/* places left/right the nodes of a class */
1739-
static void place_nodes(const RzAGraph *g, const RzGraphNode *gn, int is_left, HtPP *v_nodes, HtPU *res, RzSetU *placed) {
1739+
static void place_nodes(const RzAGraph *g, const RzGraphNode *gn, int is_left, HtPP /*<RzGraphNode *, RzList *>*/ *v_nodes, HtPU *res, RzSetU *placed) {
17401740
const RzList *lv = ht_pp_find(v_nodes, gn, NULL);
17411741
int p = 0, v, is_first = true;
17421742
const RzGraphNode *gk;
@@ -1780,7 +1780,7 @@ static void place_nodes(const RzAGraph *g, const RzGraphNode *gn, int is_left, H
17801780
}
17811781

17821782
/* computes the position to the left/right of all the nodes */
1783-
static HtPU *compute_pos(const RzAGraph *g, int is_left, HtPP *v_nodes) {
1783+
static HtPU *compute_pos(const RzAGraph *g, int is_left, HtPP /*<RzGraphNode *, RzList *>*/ *v_nodes) {
17841784
int n_classes, i;
17851785

17861786
RzList **classes = compute_classes(g, v_nodes, is_left, &n_classes);
@@ -5869,7 +5869,7 @@ RZ_IPI int rz_core_visual_graph(RzCore *core, RzAGraph *g, RzAnalysisFunction *_
58695869
* \return true In case of success.
58705870
* \return false In case of failure.
58715871
*/
5872-
RZ_API bool create_agraph_from_graph_at(RZ_NONNULL RzAGraph *ag, RZ_NONNULL const RzGraph /*<RzGraphNodeInfo *>*/ *g, bool free_on_fail, bool utf8) {
5872+
RZ_API bool create_agraph_from_graph_at(RZ_NONNULL RzAGraph *ag, RZ_NONNULL const RzGraph /*<RzGraphNodeInfo *, None *>*/ *g, bool free_on_fail, bool utf8) {
58735873
rz_return_val_if_fail(ag && g, false);
58745874
ag->need_reload_nodes = false;
58755875
// Cache lookup to build edges
@@ -5982,7 +5982,7 @@ RZ_API bool create_agraph_from_graph_at(RZ_NONNULL RzAGraph *ag, RZ_NONNULL cons
59825982
*
59835983
* \return RzAGraph* The agraph or NULL in case of failure
59845984
*/
5985-
RZ_API RZ_OWN RzAGraph *create_agraph_from_graph(RZ_NONNULL const RzGraph /*<RzGraphNodeInfo *>*/ *graph, bool utf8) {
5985+
RZ_API RZ_OWN RzAGraph *create_agraph_from_graph(RZ_NONNULL const RzGraph /*<RzGraphNodeInfo *, None *>*/ *graph, bool utf8) {
59865986
rz_return_val_if_fail(graph, NULL);
59875987

59885988
RzAGraph *result_agraph = rz_agraph_new(rz_cons_canvas_new(1, 1));

librz/core/cgraph.c

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ static inline char *core_flag_name(const RzCore *core, ut64 addr) {
2525
return item ? rz_str_dup(item->name) : rz_str_newf("0x%08" PFMT64x, addr);
2626
}
2727

28-
static inline void core_graph_dataref(RzCore *core, RzAnalysisFunction *fcn, RzGraph /*<RzGraphNodeInfo *>*/ *graph) {
28+
static inline void core_graph_dataref(RzCore *core, RzAnalysisFunction *fcn, RzGraph /*<RzGraphNodeInfo *, None *>*/ *graph) {
2929
if (!fcn) {
3030
return;
3131
}
@@ -54,7 +54,7 @@ static inline void core_graph_dataref(RzCore *core, RzAnalysisFunction *fcn, RzG
5454
/**
5555
* \brief Get the graph of the data references from \p addr (UT64_MAX for all).
5656
*/
57-
RZ_API RZ_OWN RzGraph /*<RzGraphNodeInfo *>*/ *rz_core_graph_datarefs(RZ_NONNULL RzCore *core, ut64 addr) {
57+
RZ_API RZ_OWN RzGraph /*<RzGraphNodeInfo *, None *>*/ *rz_core_graph_datarefs(RZ_NONNULL RzCore *core, ut64 addr) {
5858
rz_return_val_if_fail(core && core->analysis, NULL);
5959
RzGraph *graph = rz_graph_new(RZ_GRAPH_IMPL_LIST, NULL, rz_graph_free_node_info, NULL);
6060
if (!graph) {
@@ -79,7 +79,7 @@ RZ_API RZ_OWN RzGraph /*<RzGraphNodeInfo *>*/ *rz_core_graph_datarefs(RZ_NONNULL
7979
return graph;
8080
}
8181

82-
static void core_graph_coderef(RzCore *core, RzAnalysisFunction *fcn, RzGraph /*<RzGraphNodeInfo *>*/ *graph) {
82+
static void core_graph_coderef(RzCore *core, RzAnalysisFunction *fcn, RzGraph /*<RzGraphNodeInfo *, None *>*/ *graph) {
8383
if (!fcn) {
8484
return;
8585
}
@@ -104,7 +104,7 @@ static void core_graph_coderef(RzCore *core, RzAnalysisFunction *fcn, RzGraph /*
104104
/**
105105
* \brief Get the graph of the function references from \p addr (UT64_MAX for all).
106106
*/
107-
RZ_API RZ_OWN RzGraph /*<RzGraphNodeInfo *>*/ *rz_core_graph_coderefs(RZ_NONNULL RzCore *core, ut64 addr) {
107+
RZ_API RZ_OWN RzGraph /*<RzGraphNodeInfo *, None *>*/ *rz_core_graph_coderefs(RZ_NONNULL RzCore *core, ut64 addr) {
108108
rz_return_val_if_fail(core && core->analysis, NULL);
109109
RzGraph *graph = rz_graph_new(RZ_GRAPH_IMPL_LIST, NULL, rz_graph_free_node_info, NULL);
110110
if (!graph) {
@@ -129,7 +129,7 @@ RZ_API RZ_OWN RzGraph /*<RzGraphNodeInfo *>*/ *rz_core_graph_coderefs(RZ_NONNULL
129129
return graph;
130130
}
131131

132-
static void add_single_addr_xrefs(RzCore *core, ut64 addr, RzGraph /*<RzGraphNodeInfo *>*/ *graph) {
132+
static void add_single_addr_xrefs(RzCore *core, ut64 addr, RzGraph /*<RzGraphNodeInfo *, None *>*/ *graph) {
133133
char *me = core_flag_name(core, addr);
134134
RzGraphNode *curr_node = rz_graph_add_node_info(graph, me, NULL, addr);
135135
RZ_FREE(me);
@@ -151,7 +151,7 @@ static void add_single_addr_xrefs(RzCore *core, ut64 addr, RzGraph /*<RzGraphNod
151151
/**
152152
* \brief Get the graph of all import symbols references.
153153
*/
154-
RZ_API RZ_OWN RzGraph /*<RzGraphNodeInfo *>*/ *rz_core_graph_importxrefs(RZ_NONNULL RzCore *core) {
154+
RZ_API RZ_OWN RzGraph /*<RzGraphNodeInfo *, None *>*/ *rz_core_graph_importxrefs(RZ_NONNULL RzCore *core) {
155155
rz_return_val_if_fail(core && core->analysis, NULL);
156156
RzBinObject *obj = rz_bin_cur_object(core->bin);
157157
if (!obj) {
@@ -181,7 +181,7 @@ RZ_API RZ_OWN RzGraph /*<RzGraphNodeInfo *>*/ *rz_core_graph_importxrefs(RZ_NONN
181181
/**
182182
* \brief Get the graph of code cross references to \p addr.
183183
*/
184-
RZ_API RZ_OWN RzGraph /*<RzGraphNodeInfo *>*/ *rz_core_graph_codexrefs(RZ_NONNULL RzCore *core, ut64 addr) {
184+
RZ_API RZ_OWN RzGraph /*<RzGraphNodeInfo *, None *>*/ *rz_core_graph_codexrefs(RZ_NONNULL RzCore *core, ut64 addr) {
185185
rz_return_val_if_fail(core && core->analysis, NULL);
186186
RzGraph *graph = rz_graph_new(RZ_GRAPH_IMPL_LIST, NULL, rz_graph_free_node_info, NULL);
187187
if (!graph) {
@@ -191,7 +191,7 @@ RZ_API RZ_OWN RzGraph /*<RzGraphNodeInfo *>*/ *rz_core_graph_codexrefs(RZ_NONNUL
191191
return graph;
192192
}
193193

194-
static void core_graph_fn_call(RzCore *core, RzAnalysisFunction *fcn, RzGraph /*<RzGraphNodeInfo *>*/ *graph) {
194+
static void core_graph_fn_call(RzCore *core, RzAnalysisFunction *fcn, RzGraph /*<RzGraphNodeInfo *, None *>*/ *graph) {
195195
if (!fcn) {
196196
return;
197197
}
@@ -216,7 +216,7 @@ static void core_graph_fn_call(RzCore *core, RzAnalysisFunction *fcn, RzGraph /*
216216
/**
217217
* \brief Get the graph of the function call references from \p addr (UT64_MAX for all).
218218
*/
219-
RZ_API RZ_OWN RzGraph /*<RzGraphNodeInfo *>*/ *rz_core_graph_callgraph(RZ_NONNULL RzCore *core, ut64 addr) {
219+
RZ_API RZ_OWN RzGraph /*<RzGraphNodeInfo *, None *>*/ *rz_core_graph_callgraph(RZ_NONNULL RzCore *core, ut64 addr) {
220220
rz_return_val_if_fail(core && core->analysis, NULL);
221221
RzGraph *graph = rz_graph_new(RZ_GRAPH_IMPL_LIST, NULL, rz_graph_free_node_info, NULL);
222222
if (!graph) {
@@ -269,7 +269,7 @@ static inline char *block_disasm(RzCore *core, ut64 addr, RzAnalysisBlock *bb) {
269269
return opcodes;
270270
}
271271

272-
static inline RzGraphNode *graph_add_cached(RzCore *core, HtUP *cache, RzAnalysisBlock *bb, ut64 offset, RzGraph /*<RzGraphNodeInfo *>*/ *graph, GraphBodyFn body_fn) {
272+
static inline RzGraphNode *graph_add_cached(RzCore *core, HtUP *cache, RzAnalysisBlock *bb, ut64 offset, RzGraph /*<RzGraphNodeInfo *, None *>*/ *graph, GraphBodyFn body_fn) {
273273
RzGraphNode *node = (RzGraphNode *)ht_up_find(cache, offset, NULL);
274274
if (node) {
275275
return node;
@@ -284,7 +284,7 @@ static inline RzGraphNode *graph_add_cached(RzCore *core, HtUP *cache, RzAnalysi
284284
return node;
285285
}
286286

287-
static void core_graph_fn_bbs(RzCore *core, RzAnalysisFunction *fcn, RzGraph /*<RzGraphNodeInfo *>*/ *graph, HtUP *cache, GraphBodyFn body_fn) {
287+
static void core_graph_fn_bbs(RzCore *core, RzAnalysisFunction *fcn, RzGraph /*<RzGraphNodeInfo *, None *>*/ *graph, HtUP *cache, GraphBodyFn body_fn) {
288288
if (!(fcn && fcn->bbs)) {
289289
return;
290290
}
@@ -342,7 +342,7 @@ static void core_graph_fn_bbs(RzCore *core, RzAnalysisFunction *fcn, RzGraph /*<
342342
* \param body_fn Callback Function to use to get the body from RzAnalysisBlock or address
343343
* \return RzGraph*
344344
*/
345-
static RZ_OWN RzGraph /*<RzGraphNodeInfo *>*/ *rz_core_graph_function_bbs(RZ_NONNULL RzCore *core, ut64 addr, RZ_NULLABLE GraphBodyFn body_fn) {
345+
static RZ_OWN RzGraph /*<RzGraphNodeInfo *, None *>*/ *rz_core_graph_function_bbs(RZ_NONNULL RzCore *core, ut64 addr, RZ_NULLABLE GraphBodyFn body_fn) {
346346
rz_return_val_if_fail(core && core->analysis, NULL);
347347

348348
if (rz_analysis_function_list_size(core->analysis) < 1) {
@@ -407,7 +407,7 @@ static RZ_OWN RzGraph /*<RzGraphNodeInfo *>*/ *rz_core_graph_function_bbs(RZ_NON
407407
/**
408408
* \brief Get a graph of the function blocks at \p addr.
409409
*/
410-
RZ_API RZ_OWN RzGraph /*<RzGraphNodeInfo *>*/ *rz_core_graph_function(RzCore *core, ut64 addr) {
410+
RZ_API RZ_OWN RzGraph /*<RzGraphNodeInfo *, None *>*/ *rz_core_graph_function(RzCore *core, ut64 addr) {
411411
return rz_core_graph_function_bbs(core, addr, block_disasm);
412412
}
413413

@@ -457,21 +457,21 @@ static char *block_line(RzCore *core, ut64 addr, RzAnalysisBlock *bb) {
457457
/**
458458
* \brief Get a line graph of the function blocks at \p addr.
459459
*/
460-
RZ_API RZ_OWN RzGraph /*<RzGraphNodeInfo *>*/ *rz_core_graph_line(RzCore *core, ut64 addr) {
460+
RZ_API RZ_OWN RzGraph /*<RzGraphNodeInfo *, None *>*/ *rz_core_graph_line(RzCore *core, ut64 addr) {
461461
return rz_core_graph_function_bbs(core, addr, block_line);
462462
}
463463

464464
/**
465465
* \brief Get a normal graph of the function blocks at \p addr.
466466
*/
467-
RZ_API RZ_OWN RzGraph /*<RzGraphNodeInfo *>*/ *rz_core_graph_normal(RzCore *core, ut64 addr) {
467+
RZ_API RZ_OWN RzGraph /*<RzGraphNodeInfo *, None *>*/ *rz_core_graph_normal(RzCore *core, ut64 addr) {
468468
return rz_core_graph_function_bbs(core, addr, NULL);
469469
}
470470

471471
/**
472472
* \brief Get a graph of specific type (\p type) at \p addr.
473473
*/
474-
RZ_API RZ_OWN RzGraph /*<RzGraphNodeInfo *>*/ *rz_core_graph(RzCore *core, RzCoreGraphType type, ut64 addr) {
474+
RZ_API RZ_OWN RzGraph /*<RzGraphNodeInfo *, None *>*/ *rz_core_graph(RzCore *core, RzCoreGraphType type, ut64 addr) {
475475
rz_return_val_if_fail(core && core->analysis, NULL);
476476
RzGraph *graph = NULL;
477477
switch (type) {
@@ -575,7 +575,7 @@ RZ_API RzCoreGraphType rz_core_graph_type_from_string(RZ_NULLABLE const char *x)
575575
return RZ_CORE_GRAPH_TYPE_UNK;
576576
}
577577

578-
RZ_IPI bool rz_core_graph_print_graph(RZ_NONNULL RzCore *core, RZ_NONNULL RzGraph /*<RzGraphNodeInfo *>*/ *graph, RzCoreGraphFormat format, bool use_offset) {
578+
RZ_IPI bool rz_core_graph_print_graph(RZ_NONNULL RzCore *core, RZ_NONNULL RzGraph /*<RzGraphNodeInfo *, None *>*/ *graph, RzCoreGraphFormat format, bool use_offset) {
579579
rz_return_val_if_fail(core && graph, false);
580580
char *string = NULL;
581581
switch (format) {
@@ -724,7 +724,7 @@ static bool convert_dot_str_to_image(RzCore *core, char *str, const char *save_p
724724
/**
725725
* \brief Convert \p graph to Graphviz dot string.
726726
*/
727-
RZ_API RZ_OWN char *rz_core_graph_to_dot_str(RZ_NONNULL RzCore *core, RZ_NONNULL RzGraph /*<RzGraphNodeInfo *>*/ *graph) {
727+
RZ_API RZ_OWN char *rz_core_graph_to_dot_str(RZ_NONNULL RzCore *core, RZ_NONNULL RzGraph /*<RzGraphNodeInfo *, None *>*/ *graph) {
728728
rz_return_val_if_fail(core && graph, NULL);
729729
const char *font = rz_config_get(core->config, "graph.font");
730730
char *node_properties = rz_str_newf("fontname=\"%s\"", font);
@@ -736,7 +736,7 @@ RZ_API RZ_OWN char *rz_core_graph_to_dot_str(RZ_NONNULL RzCore *core, RZ_NONNULL
736736
/**
737737
* \brief Convert \p graph to sdb string.
738738
*/
739-
RZ_API RZ_OWN char *rz_core_graph_to_sdb_str(RZ_NONNULL RzCore *core, RZ_NONNULL RzGraph /*<RzGraphNodeInfo *>*/ *graph) {
739+
RZ_API RZ_OWN char *rz_core_graph_to_sdb_str(RZ_NONNULL RzCore *core, RZ_NONNULL RzGraph /*<RzGraphNodeInfo *, None *>*/ *graph) {
740740
rz_return_val_if_fail(core && graph, NULL);
741741
rz_core_agraph_reset(core);
742742
rz_core_agraph_apply(core, graph);
@@ -747,7 +747,7 @@ RZ_API RZ_OWN char *rz_core_graph_to_sdb_str(RZ_NONNULL RzCore *core, RZ_NONNULL
747747
/**
748748
* \brief Convert \p graph to an image, and write it to \p filename.
749749
*/
750-
RZ_API bool rz_core_graph_write_graph(RZ_NONNULL RzCore *core, RZ_NONNULL RzGraph /*<RzGraphNodeInfo *>*/ *graph, RZ_NONNULL const char *filename) {
750+
RZ_API bool rz_core_graph_write_graph(RZ_NONNULL RzCore *core, RZ_NONNULL RzGraph /*<RzGraphNodeInfo *, None *>*/ *graph, RZ_NONNULL const char *filename) {
751751
rz_return_val_if_fail(core && graph && filename, false);
752752
char *dot_text = rz_core_graph_to_dot_str(core, graph);
753753
if (!dot_text) {
@@ -775,7 +775,7 @@ RZ_API bool rz_core_graph_write(RZ_NONNULL RzCore *core, ut64 addr, RzCoreGraphT
775775
/**
776776
* \brief Get the graph of the function references from \p addr (UT64_MAX for all).
777777
*/
778-
RZ_API RZ_OWN RzGraph /*<RzGraphNodeInfo *>*/ *rz_core_graph_il(RZ_NONNULL RzCore *core, ut64 addr) {
778+
RZ_API RZ_OWN RzGraph /*<RzGraphNodeInfo *, None *>*/ *rz_core_graph_il(RZ_NONNULL RzCore *core, ut64 addr) {
779779
rz_return_val_if_fail(core && core->analysis, NULL);
780780

781781
RzAnalysisOp op = { 0 };
@@ -798,7 +798,7 @@ RZ_API RZ_OWN RzGraph /*<RzGraphNodeInfo *>*/ *rz_core_graph_il(RZ_NONNULL RzCor
798798
return graph;
799799
}
800800

801-
static RzGraphNode *rz_graph_add_node_info_icfg(RzGraph /*<RzGraphNodeInfo *>*/ *graph, const RzAnalysisFunction *fcn) {
801+
static RzGraphNode *rz_graph_add_node_info_icfg(RzGraph /*<RzGraphNodeInfo *, None *>*/ *graph, const RzAnalysisFunction *fcn) {
802802
rz_return_val_if_fail(graph, NULL);
803803
RzGraphNodeInfo *data = NULL;
804804
if (rz_analysis_function_is_malloc(fcn)) {
@@ -828,7 +828,7 @@ static RzGraphNode *rz_graph_add_node_info_icfg(RzGraph /*<RzGraphNodeInfo *>*/
828828
*
829829
* \return The GraphNode.
830830
*/
831-
static RZ_OWN RzGraphNode *get_graph_node_of_fcn(RZ_BORROW RzGraph /*<RzGraphNodeInfo *>*/ *icfg, RZ_BORROW HtUU *graph_idx, const RzAnalysisFunction *fcn) {
831+
static RZ_OWN RzGraphNode *get_graph_node_of_fcn(RZ_BORROW RzGraph /*<RzGraphNodeInfo *, None *>*/ *icfg, RZ_BORROW HtUU *graph_idx, const RzAnalysisFunction *fcn) {
832832
rz_return_val_if_fail(icfg && graph_idx && fcn, NULL);
833833
bool found = false;
834834
// TODO: refactor with identifier ? keep collecting hash id now
@@ -851,7 +851,7 @@ static RZ_OWN RzGraphNode *get_graph_node_of_fcn(RZ_BORROW RzGraph /*<RzGraphNod
851851
* \param graph_idx Hash table to track the graph node indices for each function address.
852852
* \param fcn The function to add.
853853
*/
854-
static void extend_icfg(const RzAnalysis *analysis, RZ_BORROW RzGraph /*<RzGraphNodeInfo *>*/ *icfg, RZ_BORROW HtUU *graph_idx, const RzAnalysisFunction *fcn) {
854+
static void extend_icfg(const RzAnalysis *analysis, RZ_BORROW RzGraph /*<RzGraphNodeInfo *, None *>*/ *icfg, RZ_BORROW HtUU *graph_idx, const RzAnalysisFunction *fcn) {
855855
rz_return_if_fail(analysis && icfg && graph_idx && fcn);
856856
RzGraphNode *from_node = get_graph_node_of_fcn(icfg, graph_idx, fcn);
857857
RzListIter *it;
@@ -884,7 +884,7 @@ static void extend_icfg(const RzAnalysis *analysis, RZ_BORROW RzGraph /*<RzGraph
884884
*
885885
* \return The iCFG of the binary or NULL in case of failure.
886886
*/
887-
RZ_API RZ_OWN RzGraph /*<RzGraphNodeInfo *>*/ *rz_core_graph_icfg(RZ_NONNULL RzCore *core) {
887+
RZ_API RZ_OWN RzGraph /*<RzGraphNodeInfo *, None *>*/ *rz_core_graph_icfg(RZ_NONNULL RzCore *core) {
888888
rz_return_val_if_fail(core && core->analysis, NULL);
889889
const RzList *fcns = rz_analysis_function_list(core->analysis);
890890
RzGraph *graph = rz_graph_new(RZ_GRAPH_IMPL_LIST, NULL, rz_graph_free_node_info, NULL);
@@ -956,7 +956,7 @@ static RzGraphNodeSubType get_cfg_node_flags(const RzAnalysisOp *op) {
956956
return subtype;
957957
}
958958

959-
static RzGraphNode *add_node_info_cfg(RzGraph /*<RzGraphNodeInfo *>*/ *cfg, const RzAnalysisOp *op, bool is_entry) {
959+
static RzGraphNode *add_node_info_cfg(RzGraph /*<RzGraphNodeInfo *, None *>*/ *cfg, const RzAnalysisOp *op, bool is_entry) {
960960
rz_return_val_if_fail(cfg, NULL);
961961
RzGraphNodeSubType subtype = get_cfg_node_flags(op);
962962
if (is_entry) {
@@ -986,7 +986,7 @@ static RzGraphNode *add_node_info_cfg(RzGraph /*<RzGraphNodeInfo *>*/ *cfg, cons
986986
* \return true On success.
987987
* \return false On failure.
988988
*/
989-
static bool add_edge_to_cfg(RZ_NONNULL RzGraph /*<RzGraphNodeInfo *>*/ *graph,
989+
static bool add_edge_to_cfg(RZ_NONNULL RzGraph /*<RzGraphNodeInfo *, None *>*/ *graph,
990990
RZ_NONNULL RzVector /*<ut64>*/ *to_visit,
991991
RZ_NONNULL HtUU *nodes_visited,
992992
const RzAnalysisOp *op_from,
@@ -1038,7 +1038,7 @@ static bool add_edge_to_cfg(RZ_NONNULL RzGraph /*<RzGraphNodeInfo *>*/ *graph,
10381038
*
10391039
* \return The CFG at address \p addr or NULL in case of failure.
10401040
*/
1041-
RZ_API RZ_OWN RzGraph /*<RzGraphNodeInfo *>*/ *rz_core_graph_cfg(RZ_NONNULL RzCore *core, ut64 addr) {
1041+
RZ_API RZ_OWN RzGraph /*<RzGraphNodeInfo *, None *>*/ *rz_core_graph_cfg(RZ_NONNULL RzCore *core, ut64 addr) {
10421042
rz_return_val_if_fail(core && core->analysis && core->io, NULL);
10431043
RzGraph *graph = rz_graph_new(RZ_GRAPH_IMPL_LIST, NULL, rz_graph_free_node_info, NULL);
10441044
if (!graph) {

librz/core/cmd/cmd_debug.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
} while (0)
2727

2828
struct dot_trace_ght {
29-
RzGraph /*<struct trace_node *>*/ *graph;
29+
RzGraph /*<struct trace_node *, None *>*/ *graph;
3030
Sdb *graphnodes;
3131
};
3232

@@ -86,7 +86,7 @@ static void cmd_debug_cont_syscall(RzCore *core, const char *_str) {
8686
free(syscalls);
8787
}
8888

89-
static RzGraphNode *get_graphtrace_node(RzGraph /*<struct trace_node *>*/ *g, Sdb *nodes, struct trace_node *tn) {
89+
static RzGraphNode *get_graphtrace_node(RzGraph /*<struct trace_node *, None *>*/ *g, Sdb *nodes, struct trace_node *tn) {
9090
RzGraphNode *gn;
9191
char tn_key[TN_KEY_LEN];
9292

0 commit comments

Comments
 (0)