Changeset: 8f52e55183fa for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8f52e55183fa
Modified Files:
        clients/mapiclient/tachograph.c
Branch: default
Log Message:

Deal with (duplicate) prerequisites


diffs (34 lines):

diff --git a/clients/mapiclient/tachograph.c b/clients/mapiclient/tachograph.c
--- a/clients/mapiclient/tachograph.c
+++ b/clients/mapiclient/tachograph.c
@@ -567,7 +567,7 @@ static void
 update(EventRecord *ev)
 {
        int progress=0;
-       int i,j;
+       int i,j,k;
        char *v, *s;
        int uid = 0,qid = 0;
        char line[BUFSIZ];
@@ -717,16 +717,15 @@ update(EventRecord *ev)
 
                // collect all input producing PCs
                fprintf(tachojson,"\"prereq\":[");
-               for( i=0; i < malvartop; i++){
+               for( k=0, i=0; i < malvartop; i++){
                        // remove duplicates
                        for(j= ev->pc-1; j>=0;j --){
-                               //if(debug)
-                                       //fprintf(stderr,"locate %s in 
%s\n",malvariables[i], events[j].stmt);
                                if(events[j].stmt && (v = 
strstr(events[j].stmt, malvariables[i])) && v < strstr(events[j].stmt,":=")){
-                                       snprintf(number,BUFSIZ,"%d",j);
+                                       snprintf(number,BUFSIZ," %d ",j);
+                                       //avoid duplicate prerequisites
                                        if( strstr(prereq,number) == 0)
-                                               snprintf(prereq + 
strlen(prereq), BUFSIZ-1-strlen(prereq), "%s%d",(i?", ":""), j);
-                                       //fprintf(tachojson,"%s%d",(i?", ":""), 
j);
+                                               snprintf(prereq + 
strlen(prereq), BUFSIZ-1-strlen(prereq), "%s %d ",(k?", ":""), j);
+                                       k++;
                                        break;
                                }
                        }
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to