Changeset: f143d82978e5 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f143d82978e5
Modified Files:
        monetdb5/optimizer/opt_centipede.mx
Branch: default
Log Message:

Indent properly + don't use uninitialized variables.
I'm assuming that the last of the return values of the function should
be set to oid_nil, but only if there are at least two return values.


diffs (25 lines):

diff --git a/monetdb5/optimizer/opt_centipede.mx 
b/monetdb5/optimizer/opt_centipede.mx
--- a/monetdb5/optimizer/opt_centipede.mx
+++ b/monetdb5/optimizer/opt_centipede.mx
@@ -1045,13 +1045,15 @@ OPTvectorOid(Client cntxt, MalBlkPtr mb,
        rows = (lng) BATcount(b);
        o= (oid*) getArgReference(stk,pci,0);
        *o = 0;
-       if ( pci->retc > 2 )
-       for ( i= 1; i < pci->retc-1; i++){
-               o= (oid*) getArgReference(stk, pci, i);
-               *o = (rows * i ) / (pci->retc - 1)  + 1; /* last one excluded */
+       if ( pci->retc >= 2 ) {
+               for ( i= 1; i < pci->retc-1; i++){
+                       o= (oid*) getArgReference(stk, pci, i);
+                       *o = (rows * i ) / (pci->retc - 1)  + 1; /* last one 
excluded */
+               }
+               /* i == pci->retc-1 */
+               o= (oid*) getArgReference(stk,pci,i);
+               *o = oid_nil;
        }
-       o= (oid*) getArgReference(stk,pci,i);
-       *o = oid_nil;
        BBPreleaseref(bid);
        return MAL_SUCCEED;
 }
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to