Changeset: 106a0b0a5ff2 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=106a0b0a5ff2
Modified Files:
        gdk/gdk.h
        monetdb5/mal/mal_authorize.c
        monetdb5/modules/kernel/algebra.c.mx
        monetdb5/modules/kernel/colcalc.c.mx
        monetdb5/modules/kernel/colcast.c.mx
        monetdb5/modules/kernel/colifthen.c.mx
        monetdb5/modules/kernel/colstr.c
        monetdb5/modules/kernel/column.c.mx
        monetdb5/modules/mal/pcrelib.c
        monetdb5/modules/mal/tablet.c
        monetdb5/optimizer/opt_mapreduce.c
Branch: headless
Log Message:

Convert to _type convention.
Beware COLget_str point into the vheap


diffs (truncated from 650 to 300 lines):

diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -2954,7 +2954,7 @@
        for(q = COLlast(r), p = COLfirst(r);p < q; p++)
 
 #define COLforloop(b,o) for( o = 0; o < b->count; o++)
-#define COLgetString(b,o)      (str)((char *) (b)->vheap->base + ((size_t) 
VarHeapValRaw(b,o,b->width)  << GDK_VARSHIFT))
+#define COLget_str(b,o)        (str)((char *) (b)->vheap->base + ((size_t) 
VarHeapValRaw(b,o,b->width)  << GDK_VARSHIFT))
 gdk_export str COLputString(COL *b, oid o, str v);
 
 /*
diff --git a/monetdb5/mal/mal_authorize.c b/monetdb5/mal/mal_authorize.c
--- a/monetdb5/mal/mal_authorize.c
+++ b/monetdb5/mal/mal_authorize.c
@@ -274,7 +274,7 @@
        }
 
        /* find the corresponding password to the user */
-       tmp = COLgetString(pass,id);
+       tmp = COLget_str(pass,id);
        assert (tmp != NULL);
        /* decypher the password (we lose the original tmp here) */
        rethrow("checkCredentials", tmp, AUTHdecypherValue(&pwd, &tmp));
@@ -308,7 +308,7 @@
 
                /* ok, there are some tuples that we have to consider */
                COLforloop(b, o) {
-                       if (strcmp(*scenario, COLgetString(name,lbase[o])) == 
0) {
+                       if (strcmp(*scenario, COLget_str(name,lbase[o])) == 0) {
                                /* YAY!  fun!  party!  We are granted access! */
                                *uid = id;
                                CBPreleaseref(b);
@@ -389,7 +389,7 @@
                        COLforloop(b, o) {
                                /* needs force, as sql makes a view over it */
                                BUNappend(scen, &id, TRUE);
-                               BUNappend(name, COLgetString(b, o), TRUE);
+                               BUNappend(name, COLget_str(b, o), TRUE);
                        }
                }
                CBPreleaseref(b);
@@ -500,7 +500,7 @@
 
        /* check the old password */
        id = (*c)->user;
-       tmp = COLgetString(pass,id);
+       tmp = COLget_str(pass,id);
        /* decypher the password */
        msg= AUTHdecypherValue(&hash, &tmp);
        if ( msg){
@@ -550,7 +550,7 @@
        rethrow("setPassword", tmp, AUTHverifyPassword(NULL, passwd));
 
        /* find the name of the administrator and see if it equals username */
-       tmp = COLgetString(user,(*c)->user);
+       tmp = COLget_str(user,(*c)->user);
        assert (tmp != NULL);
        if (strcmp(tmp, *username) == 0)
                throw(INVCRED, "setPassword", "The administrator cannot set its 
own password, use changePassword instead");
@@ -600,7 +600,7 @@
        b = COLselect(scen, &id, &id);
        lbase = (oid*) COLbase(b);
        COLforloop(b,p){
-               if ( strcmp(COLgetString(name,lbase[p]), *scenario) == 0)
+               if ( strcmp(COLget_str(name,lbase[p]), *scenario) == 0)
                        throw(MAL, "addScenario", "scenario '%s' already exists 
for user '%s'", *scenario, *username);
        }
 
@@ -645,7 +645,7 @@
 
        lbase = (oid*) COLbase(b);
        COLforloop(b,p){
-               if ( strcmp(COLgetString(name,lbase[p]), *scenario) == 0){
+               if ( strcmp(COLget_str(name,lbase[p]), *scenario) == 0){
                        fnd = p;
                        break;
                }
@@ -680,9 +680,9 @@
        assert (username != NULL);
 
        if (*username == NULL)
-               *username = GDKstrdup(COLgetString(user, *uid));
+               *username = GDKstrdup(COLget_str(user, *uid));
        else 
-               snprintf(*username, BUFSIZ, "%s", COLgetString(user, *uid));
+               snprintf(*username, BUFSIZ, "%s", COLget_str(user, *uid));
 
        return(MAL_SUCCEED);
 }
@@ -703,7 +703,7 @@
        if (id > COLcount(user) )
                GDKfatal("Internal error: user id that doesn't exist: " OIDFMT, 
id);
 
-       *username = COLgetString(user,id);
+       *username = COLget_str(user,id);
        return(MAL_SUCCEED);
 }
 
@@ -745,7 +745,7 @@
        id = BUNfnd(user, *username);
        if (id == BUN_NONE)
                throw(MAL, "getPasswordHash", "user '%s' does not exist", 
*username);
-       tmp = COLgetString(pass, id);
+       tmp = COLget_str(pass, id);
        assert (tmp != NULL);
        /* decypher the password */
        rethrow("changePassword", tmp, AUTHdecypherValue(&passwd, &tmp));
diff --git a/monetdb5/modules/kernel/algebra.c.mx 
b/monetdb5/modules/kernel/algebra.c.mx
--- a/monetdb5/modules/kernel/algebra.c.mx
+++ b/monetdb5/modules/kernel/algebra.c.mx
@@ -144,16 +144,16 @@
                minloop(lng,lng_nil);
                break;
        case TYPE_str:
-               v = (ptr) COLgetString(b,o);
+               v = (ptr) COLget_str(b,o);
                if (b->nonil)
                        COLforloop(b,o) {
-                               s= COLgetString(b,o);
+                               s= COLget_str(b,o);
                                if ( strcmp(s,(str) v) < 0) 
                                        v = s;
                        }
                else 
                        COLforloop(b,o) {
-                               s= COLgetString(b,o);
+                               s= COLget_str(b,o);
                                if ( strcmp(s,str_nil) == 0){
                                        v = (ptr) str_nil;
                                        break;
@@ -230,16 +230,16 @@
                maxloop(lng,lng_nil);
                break;
        case TYPE_str:
-               v = (ptr) COLgetString(b,o);
+               v = (ptr) COLget_str(b,o);
                if (b->nonil)
                        COLforloop(b,o) {
-                               s= COLgetString(b,o);
+                               s= COLget_str(b,o);
                                if ( strcmp(s,(str) v) > 0) 
                                        v = (ptr) s;
                        }
                else 
                        COLforloop(b,o) {
-                               s= COLgetString(b,o);
+                               s= COLget_str(b,o);
                                if ( strcmp(s,nil) == 0){
                                        v = (ptr) nil;
                                        break;
diff --git a/monetdb5/modules/kernel/colcalc.c.mx 
b/monetdb5/modules/kernel/colcalc.c.mx
--- a/monetdb5/modules/kernel/colcalc.c.mx
+++ b/monetdb5/modules/kernel/colcalc.c.mx
@@ -542,7 +542,7 @@
                                        nbase[o] = FALSE;
                        } else
                                COLforloop(bl,o) {
-                                       str t = COLgetString(bl,o);
+                                       str t = COLget_str(bl,o);
                                        nbase[o] = strcmp(t, str_nil) == 0;
                                }
                        COLaccessEnd(bl, USE_HEAP, MMAP_SEQUENTIAL);
diff --git a/monetdb5/modules/kernel/colcast.c.mx 
b/monetdb5/modules/kernel/colcast.c.mx
--- a/monetdb5/modules/kernel/colcast.c.mx
+++ b/monetdb5/modules/kernel/colcast.c.mx
@@ -158,7 +158,7 @@
 
        COLaccessBegin(bl, USE_HEAP, MMAP_SEQUENTIAL);
        COLforloop(bl,o){
-               ATOMfromstr(TYPE_@1, &v, &len, (char *) COLgetString(bl, o));
+               ATOMfromstr(TYPE_@1, &v, &len, (char *) COLget_str(bl, o));
                nbase[o] = *(@1*)v;
        }
        COLaccessEnd(bl, USE_HEAP, MMAP_SEQUENTIAL);
diff --git a/monetdb5/modules/kernel/colifthen.c.mx 
b/monetdb5/modules/kernel/colifthen.c.mx
--- a/monetdb5/modules/kernel/colifthen.c.mx
+++ b/monetdb5/modules/kernel/colifthen.c.mx
@@ -66,7 +66,7 @@
                        if (lbase[o] == bit_nil) 
                                nbase[o] = nilval;
                        else if (lbase[o]) 
-                               putvalue(bn, o, COLgetString(tb,o));
+                               putvalue(bn, o, COLget_str(tb,o));
        } else
        COLforloop(bl,o){
                if (lbase[o] == bit_nil)
@@ -220,9 +220,9 @@
                        if (lbase[o] == bit_nil) 
                                nbase[o] = nilval;
                        else if (lbase[o]) 
-                               putvalue(bn, o, COLgetString(tb,o));
+                               putvalue(bn, o, COLget_str(tb,o));
                        else
-                               putvalue(bn, o, COLgetString(eb,o));
+                               putvalue(bn, o, COLget_str(eb,o));
                }
        } else
                COLforloop(bl,o){
@@ -283,7 +283,7 @@
                        else if (lbase[o]) 
                                nbase[o] = **val;
                        else
-                               putvalue(bn, o, COLgetString(eb,o));
+                               putvalue(bn, o, COLget_str(eb,o));
                }
        } else
                COLforloop(bl,o){
@@ -341,7 +341,7 @@
                        if (lbase[o] == bit_nil) 
                                nbase[o] = nilval;
                        else if (lbase[o]) 
-                               putvalue(bn, o, COLgetString(tb,o));
+                               putvalue(bn, o, COLget_str(tb,o));
                        else
                                nbase[o] = **val;
                }
diff --git a/monetdb5/modules/kernel/colstr.c b/monetdb5/modules/kernel/colstr.c
--- a/monetdb5/modules/kernel/colstr.c
+++ b/monetdb5/modules/kernel/colstr.c
@@ -44,7 +44,7 @@
 
        COLaccessBegin(bl, USE_HEAP, MMAP_SEQUENTIAL);
        COLforloop(bl, o) {
-               x=  COLgetString(bl,o);
+               x=  COLget_str(bl,o);
                if (x== 0 || strcmp(x, str_nil)== 0) {
                        nbase[o] = int_nil;
                        bn->nonil = 0;
@@ -81,7 +81,7 @@
 
        COLaccessBegin(bl, USE_HEAP, MMAP_SEQUENTIAL);
        COLforloop(bl, o) {
-               x=  COLgetString(bl,o);
+               x=  COLget_str(bl,o);
                if (x== 0 || strcmp(x, str_nil)== 0) {
                        nbase[o] = int_nil;
                        bn->nonil = 0;
@@ -119,7 +119,7 @@
 
        COLaccessBegin(bl, USE_HEAP, MMAP_SEQUENTIAL);
        COLforloop(bl, o) {
-               x=  COLgetString(bl,o);
+               x=  COLget_str(bl,o);
                if (x== 0 || strcmp(x, str_nil)== 0) {
                        nbase[o] = int_nil;
                        bn->nonil = 0;
@@ -161,7 +161,7 @@
        COLforloop(bl,o){
                str y = 0, *yp = &y;
 
-               x=  COLgetString(bl,o);
+               x=  COLget_str(bl,o);
                if (x != 0 && strcmp(x,str_nil) != 0) 
                        strLower(yp,x);
                        COLputString(bn,o,y);
@@ -199,7 +199,7 @@
        COLforloop(bl,o){
                str y = 0, *yp = &y;
 
-               x=  COLgetString(bl,o);
+               x=  COLget_str(bl,o);
                if (x != 0 && strcmp(x,str_nil) != 0) 
                        strUpper(yp,x);
                        COLputString(bn,o,y);
@@ -238,7 +238,7 @@
        COLforloop(bl,o){
                str y = 0, *yp = &y;
 
-               x=  COLgetString(bl,o);
+               x=  COLget_str(bl,o);
                if (x != 0 && strcmp(x,str_nil) != 0) 
                        strStrip(yp,x);
                        COLputString(bn,o,y);
@@ -277,7 +277,7 @@
        COLforloop(bl,o){
                str y = 0, *yp = &y;
 
-               x=  COLgetString(bl,o);
+               x=  COLget_str(bl,o);
                if (x != 0 && strcmp(x,str_nil) != 0) 
                        strLtrim(yp,x);
                        COLputString(bn,o,y);
@@ -316,7 +316,7 @@
        COLforloop(bl,o){
                str y = 0, *yp = &y;
 
-               x=  COLgetString(bl,o);
+               x=  COLget_str(bl,o);
                if (x != 0 && strcmp(x,str_nil) != 0) 
                        strRtrim(yp,x);
                        COLputString(bn,o,y);
@@ -356,11 +356,11 @@
                isnil = 1;
        COLaccessBegin(bl, USE_HEAP, MMAP_SEQUENTIAL);
        COLforloop(bl,o){
-               if (isnil || lbase[o] == 0 || strcmp(COLgetString(bl,o), 
str_nil) == 0) {
+               if (isnil || lbase[o] == 0 || strcmp(COLget_str(bl,o), str_nil) 
== 0) {
                        nbase[o] = bit_nil;
                        bn->nonil = 0;
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to