Changeset: cefeb0cbcb44 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cefeb0cbcb44
Modified Files:
        monetdb5/scheduler/Makefile.ag
Branch: headless
Log Message:

merge


diffs (truncated from 1921 to 300 lines):

diff --git a/Makefile.ag b/Makefile.ag
--- a/Makefile.ag
+++ b/Makefile.ag
@@ -15,7 +15,9 @@
 # Copyright August 2008-2011 MonetDB B.V.
 # All Rights Reserved.
 
-SUBDIRS = buildtools common clients gdk monetdb5 \
+SUBDIRS = buildtools common clients \
+       HAVE_GDK?gdk \
+       HAVE_MONETDB5?monetdb5 \
 #      HAVE_SQL?sql \
 #      HAVE_GEOM?geom \
        tools \
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -132,12 +132,27 @@
 
 AC_DEFINE(MONETDB_RELEASE, "unreleased", [Release name or "unreleased"])
 
+dft_gdk=auto
+AC_ARG_ENABLE(gdk,
+       AS_HELP_STRING([--enable-gdk],
+               [enable support for GDK (default=auto)]),
+       enable_gdk=$enableval,
+       enable_gdk=$dft_gdk)
+
 dft_monetdb5=auto
 AC_ARG_ENABLE(monetdb5,
        AS_HELP_STRING([--enable-monetdb5],
                [enable support for MonetDB5 (default=auto)]),
        enable_monetdb5=$enableval,
        enable_monetdb5=$dft_monetdb5)
+case "$enable_gdk-$enable_monetdb5" in
+no-yes)
+       AC_MSG_ERROR([MonetDB5 requires GDK.])
+       ;;
+no-auto)
+       enable_monetdb5=no
+       ;;
+esac
 
 dft_rdf=no
 AC_ARG_ENABLE(rdf,
@@ -178,7 +193,7 @@
 no-yes)
        AC_MSG_ERROR([geom module requires MonetDB5])
        ;;
-no-no-auto)
+no-auto)
        enable_geom=no
        ;;
 esac
@@ -2824,6 +2839,7 @@
 fi
 
 dnl     output
+AM_CONDITIONAL(HAVE_GDK, test "x$enable_gdk" = xyes -o "x$enable_gdk" = xauto)
 AM_CONDITIONAL(HAVE_MONETDB5, test "x$enable_monetdb5" = xyes -o 
"x$enable_monetdb5" = xauto)
 AM_CONDITIONAL(HAVE_SQL, test "x$enable_sql" = xyes -o "x$enable_sql" = xauto)
 AM_CONDITIONAL(HAVE_GEOM, test "x$enable_geom" = xyes -o "x$enable_geom" = 
xauto)
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -1021,7 +1021,6 @@
 gdk_export COL *COLnewdensecol(oid size);
 
 /* internal */
-gdk_export COL *COLcreatedesc(int tp, int heapnames);
 gdk_export chr ATOMelmshift(int sz);
 
 /*
@@ -1435,7 +1434,7 @@
 /* new semantics ! */
 #define headsize(b,p)  ((b)->type?((size_t)(p))<<(b)->shift:0)
 
-#define COLelement(b, p)       ((char*)(b)->heap.base+((p)<<(b)->shift))
+#define COLelement(b, p)       
((void*)((char*)(b)->heap.base+((p)<<(b)->shift)))
 
 #if SIZEOF_VAR_T < SIZEOF_VOID_P
 /* NEW 11/4/2009: when compiled with 32-bits oids/var_t on 64-bits
@@ -1586,11 +1585,11 @@
 gdk_export void COLsetcapacity(COL *b, oid cnt);
 gdk_export void COLsetcount(COL *b, oid cnt);
 gdk_export oid COLgrows(COL *b);
-gdk_export COL *COLkey(COL *b, int onoff);
-gdk_export COL *COLmode(COL *b, int onoff);
-gdk_export COL *COLcol_name(COL *b, const char *nme);
+gdk_export int COLkey(COL *b, int onoff);
+gdk_export int COLmode(COL *b, int onoff);
+gdk_export int COLcol_name(COL *b, const char *nme);
 gdk_export int COLname(COL *b, const char *nme);
-gdk_export COL *COLseqbase(COL *b, oid o);
+gdk_export int COLseqbase(COL *b, oid o);
 gdk_export COL *COLsetaccess(COL *b, int mode);
 gdk_export void COLsetreadonly(COL *b);
 gdk_export int COLgetaccess(COL *b);
@@ -2849,7 +2848,7 @@
  */
 gdk_export int ALIGNsynced(COL *b1, COL *b2);
 
-gdk_export COL *COLpropcheck(COL *b, int mode);
+gdk_export int COLpropcheck(COL *b, int mode);
 
 #define COLPROPS_QUICK  0      /* only derive easy (non-resource consuming) 
properties */
 #define COLPROPS_ALL   1       /* derive all possible properties; no matter 
what cost (key=hash) */
diff --git a/gdk/gdk_cbp.c b/gdk/gdk_cbp.c
--- a/gdk/gdk_cbp.c
+++ b/gdk/gdk_cbp.c
@@ -290,13 +290,13 @@
 void
 CBPextend(dbl factor, int buildhash)
 {
-       int newsize;
+       bat newsize;
        size_t maxsize;
 
        /* make sure the new size is at least CBPsize large */
-       newsize = (int) (CBPlimit * factor);
+       newsize = (bat) (CBPlimit * factor);
        while (newsize < CBPsize)
-               newsize = (int) (newsize * factor);
+               newsize = (bat) (newsize * factor);
        maxsize = MAX(newsize * 2, CBPmaxsize) * sizeof(CBPrec);
 
        CBP_notrim = MT_getpid();
@@ -306,7 +306,7 @@
 
        memset(CBP + CBPlimit, 0, (newsize - CBPlimit) * sizeof(CBPrec));
        CBPlimit = newsize;
-       CBPmaxsize = (int) (maxsize / sizeof(CBPrec));
+       CBPmaxsize = (bat) (maxsize / sizeof(CBPrec));
 
        if (buildhash) {
                int i;
@@ -338,18 +338,12 @@
 static inline str
 CBPtmpname(str s, int len, bat i)
 {
-       int reverse = i < 0;
-
-       if (reverse)
-               i = -i;
        s[--len] = 0;
        while (i > 0) {
                s[--len] = '0' + (i & 7);
                i >>= 3;
        }
        s[--len] = '_';
-       if (reverse)
-               s[--len] = 'r';
        s[--len] = 'p';
        s[--len] = 'm';
        s[--len] = 't';
@@ -386,7 +380,7 @@
  * The default src=0 is to read the full CBPdir file.
  */
 static COL *
-CBPreadEntries(FILE *fp, char *src, int bbpversion, int *min_stamp, int 
*max_stamp)
+CBPreadEntries(FILE *fp, char *src, int cbpversion, int *min_stamp, int 
*max_stamp)
 {
        bat bid = 0;
        char buf[4096];
@@ -423,7 +417,7 @@
                unsigned short storage;
                int n;
 
-               if (bbpversion == GDKLIBRARY_HEADED ?
+               if (cbpversion == GDKLIBRARY_HEADED ?
                    sscanf(buf,
                           "%lld %hu %128s %128s %128s %d %u %lld %lld %lld 
%lld %lld %hu %hu %hu %hu"
                           "%n",
@@ -468,7 +462,7 @@
                bs->map_buns = (char) map_head;
                bs->map_heap = (char) map_hheap;
 
-               if (bbpversion == GDKLIBRARY_HEADED) {
+               if (cbpversion == GDKLIBRARY_HEADED) {
                        if (sscanf(buf + nread,
                                   " %10s %hu %hu %hu %lld %lld %lld %lld %lld 
%lld %lld %hu"
                                   "%n",
@@ -592,10 +586,11 @@
 }
 
 static int
-CBPheader(FILE *fp, int *CBPlimit, oid *CBPoid, int silent)
+CBPheader(FILE *fp, bat *CBPlimit, oid *CBPoid, int silent)
 {
        char buf[BUFSIZ];
-       int sz, bbpversion, ptrsize, oidsize;
+       bat sz;
+       int cbpversion, ptrsize, oidsize;
        char *s;
 
        if (fgets(buf, sizeof(buf), fp) == NULL) {
@@ -605,7 +600,7 @@
                }
                GDKfatal("CBPinit: CBP.dir is empty");
        }
-       if (sscanf(buf, "CBP.dir, GDKversion %d\n", &bbpversion) != 1) {
+       if (sscanf(buf, "CBP.dir, GDKversion %d\n", &cbpversion) != 1) {
                GDKerror("CBPinit: old CBP without version number");
                GDKerror("dump the database using a compatible version,");
                GDKerror("then restore into new database using this 
version.\n");
@@ -613,15 +608,15 @@
                        return -1;
                exit(1);
        }
-       if (bbpversion != GDKLIBRARY && bbpversion != GDKLIBRARY_HEADED) {
+       if (cbpversion != GDKLIBRARY && cbpversion != GDKLIBRARY_HEADED) {
                if (silent) {
                        GDKerror("CBPinit: incompatible CBP version: "
                                 "expected 0%o, got 0%o.",
-                                GDKLIBRARY, bbpversion);
+                                GDKLIBRARY, cbpversion);
                        return -1;
                }
                GDKfatal("CBPinit: incompatible CBP version: "
-                        "expected 0%o, got 0%o.", GDKLIBRARY, bbpversion);
+                        "expected 0%o, got 0%o.", GDKLIBRARY, cbpversion);
        }
        if (fgets(buf, sizeof(buf), fp) == NULL) {
                if (silent) {
@@ -661,12 +656,12 @@
        }
        *CBPoid = OIDread(buf);
        if ((s = strstr(buf, "CBPsize")) != NULL) {
-               sscanf(s, "CBPsize=%d", &sz);
-               sz = (int) (sz * COLMARGIN);
+               sscanf(s, "CBPsize=%u", &sz);
+               sz = (bat) (sz * COLMARGIN);
                if (sz > *CBPlimit)
                        *CBPlimit = sz;
        }
-       return bbpversion;
+       return cbpversion;
 }
 
 /*
@@ -686,39 +681,39 @@
        char *s;
        FILE *fd;
        int min_stamp = 0x7fffffff, max_stamp = 0;
-       int bbpversion;
+       int cbpversion;
        COL *bs;
-       char bbpdir[BUFSIZ];
+       char cbpdir[BUFSIZ];
        char bufhead[BUFSIZ];
        char bufhheap[BUFSIZ];
        char path[BUFSIZ];
        struct stat st;
        oid CBPoid;
-       int CBPlimit;
+       bat limit;
 
        IODEBUG mnstr_printf(GDKerr, "#importEntry %s\n", nme);
-       strcpy(bbpdir, nme);
-       s = strstr(bbpdir, COLDIR);
+       strcpy(cbpdir, nme);
+       s = strstr(cbpdir, COLDIR);
        if (s == 0)
                return 0;
        *s = 0;
        nme = s + strlen(COLDIR) + 1;
-       snprintf(path, BUFSIZ, "%s%c%s/CBP.dir", bbpdir, DIR_SEP, COLDIR);
+       snprintf(path, BUFSIZ, "%s%c%s/CBP.dir", cbpdir, DIR_SEP, COLDIR);
        fd = fopen(path, "r");
        if (fd == 0) {
-               snprintf(path, BUFSIZ, "%s%c%s%c/CBP.bak", bbpdir, DIR_SEP, 
COLDIR, DIR_SEP);
+               snprintf(path, BUFSIZ, "%s%c%s%c/CBP.bak", cbpdir, DIR_SEP, 
COLDIR, DIR_SEP);
                fd = fopen(path, "r");
                if (fd == 0) {
-                       snprintf(path, BUFSIZ, "%s%c%s%cBACKUP/CBP.dir", 
bbpdir, DIR_SEP, COLDIR, DIR_SEP);
+                       snprintf(path, BUFSIZ, "%s%c%s%cBACKUP/CBP.dir", 
cbpdir, DIR_SEP, COLDIR, DIR_SEP);
                        fd = fopen(path, "r");
                        if (fd == 0)
                                return 0;
                }
        }
 
-       if ((bbpversion = CBPheader(fd, &CBPlimit, &CBPoid, TRUE)) < 0)
+       if ((cbpversion = CBPheader(fd, &limit, &CBPoid, TRUE)) < 0)
                return 0;
-       bs = CBPreadEntries(fd, nme, bbpversion, &min_stamp, &max_stamp);
+       bs = CBPreadEntries(fd, nme, cbpversion, &min_stamp, &max_stamp);
        fclose(fd);
        if (bs == 0)
                return 0;
@@ -730,8 +725,8 @@
        CBP_lrefs(bs->cacheid)++;
 
        /* re-adjust the files to become symbolic links */
-       snprintf(bufhead, BUFSIZ, "%s%c%s%c%s.tail", bbpdir, DIR_SEP, COLDIR, 
DIR_SEP, nme);
-       snprintf(bufhheap, BUFSIZ, "%s%c%s%c%s.theap", bbpdir, DIR_SEP, COLDIR, 
DIR_SEP, nme);
+       snprintf(bufhead, BUFSIZ, "%s%c%s%c%s.tail", cbpdir, DIR_SEP, COLDIR, 
DIR_SEP, nme);
+       snprintf(bufhheap, BUFSIZ, "%s%c%s%c%s.theap", cbpdir, DIR_SEP, COLDIR, 
DIR_SEP, nme);
 
        COLmode(bs, TRANSIENT);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to