Changeset: 1b4649cd71c3 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1b4649cd71c3
Modified Files:
        monetdb5/modules/mal/remote.mx
Branch: Aug2011
Log Message:

batbincopyfrom: use more GDK macros and correct types


diffs (65 lines):

diff --git a/monetdb5/modules/mal/remote.mx b/monetdb5/modules/mal/remote.mx
--- a/monetdb5/modules/mal/remote.mx
+++ b/monetdb5/modules/mal/remote.mx
@@ -1208,7 +1208,6 @@
        BAT *b = BBPquickdesc(ABS(bid), FALSE);
        char sendhead = 0;
        char sendtheap = 0;
-       oid Hseqbase = 0;
 
        (void)mb;
        (void)stk;
@@ -1221,16 +1220,9 @@
 
        BBPincref(bid, FALSE);
 
-       sendhead = b->htype != TYPE_void && (b->htype != TYPE_oid || 
!b->H->dense);
+       sendhead = !BAThvoid(b);
        sendtheap = b->ttype != TYPE_void && b->tvarsized;
 
-       if (b->htype == TYPE_oid && b->H->dense) {
-               BATiter bi = bat_iterator(b);
-               Hseqbase = *(oid *)BUNhead(bi, BUNfirst(b));
-       } else {
-               Hseqbase = b->hseqbase;
-       }
-
        mnstr_printf(cntxt->fdout, /*JSON*/"{"
                        "\"version\":1,"
                        "\"htype\":%d,"
@@ -1250,7 +1242,7 @@
                        "\"theapsize\":" SZFMT
                        "}\n",
                        sendhead ? b->htype : TYPE_void, b->ttype,
-                       Hseqbase, b->tseqbase,
+                       b->hseqbase, b->tseqbase,
                        b->hsorted, b->tsorted,
                        b->hkey, b->tkey,
                        b->H->nonil, b->T->nonil,
@@ -1294,7 +1286,7 @@
                Hnonil:1,
                Tnonil:1,
                Tdense:1;
-       size_t size;
+       BUN size;
        size_t headsize;
        size_t tailsize;
        size_t theapsize;
@@ -1366,7 +1358,7 @@
                                } else if (strcmp(nme, "tdense") == 0) {
                                        bb.Tdense = *val != '0';
                                } else if (strcmp(nme, "size") == 0) {
-                                       bb.size = atol(val);
+                                       bb.size = (BUN)atol(val);
                                } else if (strcmp(nme, "headsize") == 0) {
                                        bb.headsize = atol(val);
                                } else if (strcmp(nme, "tailsize") == 0) {
@@ -1424,7 +1416,7 @@
        b->tdense = bb.Tdense;
        if (bb.Ttype == TYPE_str && bb.size)
                BATsetcapacity(b, bb.tailsize >> b->T->shift);
-       BATsetcount(b, (oid)bb.size);
+       BATsetcount(b, bb.size);
        b->batDirty = TRUE;
 
        /* read blockmode flush */
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to