diff options
-rw-r--r-- | src/include/cctki_Schedule.h | 2 | ||||
-rw-r--r-- | src/main/ScheduleInterface.c | 48 | ||||
-rw-r--r-- | src/schedule/ScheduleTraverse.c | 20 |
3 files changed, 27 insertions, 43 deletions
diff --git a/src/include/cctki_Schedule.h b/src/include/cctki_Schedule.h index dac4778f..9361053d 100644 --- a/src/include/cctki_Schedule.h +++ b/src/include/cctki_Schedule.h @@ -63,7 +63,7 @@ int CCTKi_DoScheduleTraverse(const char *group_name, int (*item_entry)(void *, void *), int (*item_exit)(void *, void *), int (*while_check)(int, char **, void *, void *, int), - int (*if_check)(int, char **, void *, void *, int), + int (*if_check)(int, char **, void *, void *), int (*function_process)(void *, void *, void *), void *data); diff --git a/src/main/ScheduleInterface.c b/src/main/ScheduleInterface.c index 68264f77..be021bd4 100644 --- a/src/main/ScheduleInterface.c +++ b/src/main/ScheduleInterface.c @@ -153,8 +153,7 @@ static int CCTKi_SchedulePrintWhile(int n_whiles, static int CCTKi_SchedulePrintIf(int n_if, char **ifs, t_attribute *attribute, - t_sched_data *data, - int first); + t_sched_data *data); static int CCTKi_SchedulePrintFunction(void *function, t_attribute *attribute, t_sched_data *data); static int CCTKi_ScheduleCallEntry(t_attribute *attribute, t_sched_data *data); @@ -1961,11 +1960,11 @@ static int SchedulePrint(const char *where) if(where) { retcode = CCTKi_DoScheduleTraverse(where, - (int (*)(void *, void *)) CCTKi_SchedulePrintEntry, - (int (*)(void *, void *)) CCTKi_SchedulePrintExit, - (int (*)(int, char **, void *, void *, int))CCTKi_SchedulePrintWhile, - (int (*)(int, char **, void *, void *, int))CCTKi_SchedulePrintIf, - (int (*)(void *, void *, void *)) CCTKi_SchedulePrintFunction, + (int (*)(void *, void *)) CCTKi_SchedulePrintEntry, + (int (*)(void *, void *)) CCTKi_SchedulePrintExit, + (int (*)(int, char **, void *, void *, int)) CCTKi_SchedulePrintWhile, + (int (*)(int, char **, void *, void *)) CCTKi_SchedulePrintIf, + (int (*)(void *, void *, void *)) CCTKi_SchedulePrintFunction, (void *)&data); } else @@ -2237,11 +2236,6 @@ static int CCTKi_SchedulePrintWhile(int n_whiles, @vtype t_sched_data @vio in @endvar - @var first - @vdesc flag - is this the first time we are checking if on this schedule item - @vtype int - @vio in - @endvar @returntype int @returndesc @@ -2252,8 +2246,7 @@ static int CCTKi_SchedulePrintWhile(int n_whiles, static int CCTKi_SchedulePrintIf(int n_ifs, char **ifs, t_attribute *attribute, - t_sched_data *data, - int first) + t_sched_data *data) { int i; @@ -2261,29 +2254,20 @@ static int CCTKi_SchedulePrintIf(int n_ifs, attribute = attribute; data = data; - if(first) - { - printf("%*s", indent_level + 2 + 7, "if ("); + printf("%*s", indent_level + 2 + 7, "if ("); - for(i = 0; i < n_ifs; i++) + for(i = 0; i < n_ifs; i++) + { + if(i > 0) { - if(i > 0) - { - printf(" && "); - } - - printf(ifs[i]); + printf(" && "); } - printf(")\n"); - indent_level += 2; - } - else - { - indent_level -= 2; - printf("%*s\n", indent_level + 9, "end if"); + + printf(ifs[i]); } + printf(")\n"); - return first; + return 1; } /*@@ diff --git a/src/schedule/ScheduleTraverse.c b/src/schedule/ScheduleTraverse.c index 37456b26..913866ac 100644 --- a/src/schedule/ScheduleTraverse.c +++ b/src/schedule/ScheduleTraverse.c @@ -39,7 +39,7 @@ static int ScheduleTraverseGroup(cHandledData *schedule_groups, int (*item_entry)(void *, void *), int (*item_exit)(void *, void *), int (*while_check)(int, char **, void *, void *, int), - int (*if_check)(int, char **, void *, void *, int), + int (*if_check)(int, char **, void *, void *), int (*function_process)(void *, void *, void *), void *data); @@ -52,7 +52,7 @@ static int ScheduleTraverseFunction(void *function, int (*item_entry)(void *, void *), int (*item_exit)(void *, void *), int (*while_check)(int, char **, void *, void *, int), - int (*if_check)(int, char **, void *, void *, int), + int (*if_check)(int, char **, void *, void *), int (*function_process)(void *, void *, void *), void *data); @@ -110,7 +110,7 @@ static int ScheduleTraverseFunction(void *function, @endvar @var if_check @vdesc function to be called to check an if statement - @vtype int (*)(int, char **, void *, void *, int) + @vtype int (*)(int, char **, void *, void *) @vio in @vcomment @@ -140,7 +140,7 @@ int CCTKi_DoScheduleTraverse(const char *group_name, int (*item_entry)(void *, void *), int (*item_exit)(void *, void *), int (*while_check)(int, char **, void *, void *, int), - int (*if_check)(int, char **, void *, void *, int), + int (*if_check)(int, char **, void *, void *), int (*function_process)(void *, void *, void *), void *data) { @@ -265,7 +265,7 @@ int CCTKi_DoScheduleTraverse(const char *group_name, @endvar @var if_check @vdesc function to be called to check a if statement - @vtype int (*)(int, char **, void *, void *, int) + @vtype int (*)(int, char **, void *, void *) @vio in @vcomment @@ -300,7 +300,7 @@ static int ScheduleTraverseGroup(cHandledData *schedule_groups, int (*item_entry)(void *, void *), int (*item_exit)(void *, void *), int (*while_check)(int, char **, void *, void *, int), - int (*if_check)(int, char **, void *, void *, int), + int (*if_check)(int, char **, void *, void *), int (*function_process)(void *, void *, void *), void *data) { @@ -317,7 +317,7 @@ static int ScheduleTraverseGroup(cHandledData *schedule_groups, if(n_ifs > 0 && if_check) { - doit = doit && if_check(n_ifs, ifs, attributes, data, 1); + doit = doit && if_check(n_ifs, ifs, attributes, data); } /* If there is a while-list associated with this item, check if the @@ -500,7 +500,7 @@ static int ScheduleTraverseGroup(cHandledData *schedule_groups, @endvar @var if_check @vdesc function to be called to check a if statement - @vtype int (*)(int, char **, void *, void *, int) + @vtype int (*)(int, char **, void *, void *) @vio in @vcomment @@ -534,7 +534,7 @@ static int ScheduleTraverseFunction(void *function, int (*item_entry)(void *, void *), int (*item_exit)(void *, void *), int (*while_check)(int, char **, void *, void *, int), - int (*if_check)(int, char **, void *, void *, int), + int (*if_check)(int, char **, void *, void *), int (*function_process)(void *, void *, void *), void *data) { @@ -549,7 +549,7 @@ static int ScheduleTraverseFunction(void *function, if(n_ifs > 0 && if_check) { - doit = doit && if_check(n_ifs, ifs, attributes, data, 1); + doit = doit && if_check(n_ifs, ifs, attributes, data); } /* If there is a while-list associated with this function, check if |