From c2b343a968267f2a60120fc374f782a007ec90d1 Mon Sep 17 00:00:00 2001 From: Taj Muhammad Khan Date: Fri, 6 Jun 2014 17:52:59 +0200 Subject: [PATCH] Added support for statement extensions --- source/osl2scoplib.c | 3 +-- source/scoplib2osl.c | 13 ++++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/source/osl2scoplib.c b/source/osl2scoplib.c index 26a705e..aebe9f0 100644 --- a/source/osl2scoplib.c +++ b/source/osl2scoplib.c @@ -397,8 +397,7 @@ scoplib_statement_p convert_statement_osl2scoplib(osl_statement_p p, // iterators osl_body_p stmt_body=NULL; - if(p->body) - stmt_body = (osl_body_p)(p->body->data); + stmt_body = (osl_body_p)osl_generic_lookup(p->extension, OSL_URI_BODY); if(stmt_body==NULL) CONVERTER_warning("Statement body not found!!\n"); diff --git a/source/scoplib2osl.c b/source/scoplib2osl.c index 282b13c..e25c555 100644 --- a/source/scoplib2osl.c +++ b/source/scoplib2osl.c @@ -591,6 +591,8 @@ osl_statement_p convert_statement_scoplib2osl( scoplib_statement_p in_stmt, osl_statement_p out_stmt = NULL; osl_statement_p last_stmt = NULL; osl_statement_p tmp_stmt = NULL; + osl_body_p body = NULL; + osl_generic_p gen = NULL; scoplib_statement_p s = in_stmt; for(; s; s= s->next){ @@ -620,8 +622,9 @@ osl_statement_p convert_statement_scoplib2osl( scoplib_statement_p in_stmt, } //body - tmp_stmt->body = convert_body_scoplib2osl(s->nb_iterators, s->iterators, - s->body); + body = convert_body_scoplib2osl(s->nb_iterators, s->iterators, s->body); + gen = osl_generic_shell(body, osl_body_interface()); + osl_generic_add(&tmp_stmt->extension, gen); //usr tmp_stmt->usr = NULL; @@ -722,10 +725,10 @@ int convert_osl_statement_equal(osl_statement_p s1, osl_statement_p s2) { return 0; } - if (!osl_generic_equal(s1->body, s2->body)) { + if (!osl_generic_equal(s1->extension, s2->extension)) { CONVERTER_info("statement bodies are not the same"); - osl_generic_print(stdout, s1->body); - osl_generic_print(stdout, s2->body); + osl_generic_print(stdout, s1->extension); + osl_generic_print(stdout, s2->extension); return 0; } -- 2.11.4.GIT