diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2015-04-06 11:09:00 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2015-04-06 11:09:00 (GMT) |
commit | 944225261e872785366d1df5377f59ea917a2195 (patch) | |
tree | fb6d2c12e22f368808bfb92557d647b1e5688a8a /src/analysis/blocks/flow.c | |
parent | e108e192582aa1dbe020dfbc09bee5e6ab2cc534 (diff) |
Done some refactoring in order to make the code more GObject-friendly.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@506 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis/blocks/flow.c')
-rw-r--r-- | src/analysis/blocks/flow.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/analysis/blocks/flow.c b/src/analysis/blocks/flow.c index 305dad0..99d4553 100644 --- a/src/analysis/blocks/flow.c +++ b/src/analysis/blocks/flow.c @@ -111,12 +111,20 @@ G_DEFINE_TYPE(GFlowBlock, g_flow_block, G_TYPE_INSTR_BLOCK); static void g_flow_block_class_init(GFlowBlockClass *class) { GObjectClass *object; /* Autre version de la classe */ + GInstrBlockClass *block_class; /* Version parente du la classe*/ object = G_OBJECT_CLASS(class); + block_class = G_INSTR_BLOCK_CLASS(class); object->dispose = (GObjectFinalizeFunc/* ! */)g_flow_block_dispose; object->finalize = (GObjectFinalizeFunc)g_flow_block_finalize; + block_class->find_by_addr = (find_by_addr_fc)g_flow_block_find_by_addr; + block_class->visit_blocks = (visit_all_blocks_fc)g_flow_block_visit; + block_class->list_blocks = (list_all_blocks_fc)g_flow_block_list_all_blocks; + block_class->list_leafs = (list_leafs_blocks_fc)g_flow_block_list_leafs_blocks; + //block_class->list_regs = (list_regs_accesses_fc)g_flow_block_list_regs_accesses; + } @@ -134,16 +142,6 @@ static void g_flow_block_class_init(GFlowBlockClass *class) static void g_flow_block_init(GFlowBlock *block) { - GInstrBlock *parent; /* Instance parente */ - - parent = G_INSTR_BLOCK(block); - - parent->find_by_addr = (find_by_addr_fc)g_flow_block_find_by_addr; - parent->visit_blocks = (visit_all_blocks_fc)g_flow_block_visit; - parent->list_blocks = (list_all_blocks_fc)g_flow_block_list_all_blocks; - parent->list_leafs = (list_leafs_blocks_fc)g_flow_block_list_leafs_blocks; - //parent->list_regs = (list_regs_accesses_fc)g_flow_block_list_regs_accesses; - g_flow_block_set_rank(block, 0); block->regs = g_raccess_list_new(); |