Changeset: d58290891491 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d58290891491
Modified Files:
        monetdb5/modules/atoms/str.c
        monetdb5/modules/atoms/streams.c
        monetdb5/modules/atoms/streams.h
        monetdb5/modules/atoms/url.c
Branch: headless
Log Message:

Moving BAT to COL


diffs (200 lines):

diff --git a/monetdb5/modules/atoms/str.c b/monetdb5/modules/atoms/str.c
--- a/monetdb5/modules/atoms/str.c
+++ b/monetdb5/modules/atoms/str.c
@@ -1096,7 +1096,7 @@
        int UTF8_CONV_v = (A1); \
        HASHfnd_int(UTF8_CONV_r, A2, &UTF8_CONV_v); \
        if (UTF8_CONV_r != BUN_NONE) \
-               (A1) = *(int*) BUNtloc(A2, UTF8_CONV_r); \
+               (A1) = *(int*) BUNloc(A2, UTF8_CONV_r); \
 }
 #define UTF8_GETCHAR(A1,A2) \
        if (*A2 < 0x80) { \
@@ -1129,41 +1129,45 @@
        } else { \
                (A1) = int_nil; \
        }
-#define UTF8_PUTCHAR(A1,A2) \
-       if ((A1) < 0 \
-#if SIZEOF_INT > 4 \
-           || (int) (A1) >= 0x80000000 \
-#endif \
-          ) { \
-               *(A2)++ = chr_nil; \
-       } else if ((A1) < 0x80) { \
-               *(A2)++ = (A1); \
-       } else if ((A1) < 0x800) { \
-               *(A2)++ = 0xC0 | ((A1) >> 6); \
-               *(A2)++ = 0x80 | ((A1) & 0x3F); \
-       } else if ((A1) < 0x10000) { \
-               *(A2)++ = 0xE0 | ((A1) >> 12); \
-               *(A2)++ = 0x80 | (((A1) >> 6) & 0x3F); \
-               *(A2)++ = 0x80 | ((A1) & 0x3F); \
-       } else if ((A1) < 0x200000) { \
-               *(A2)++ = 0xF0 | ((A1) >> 18); \
-               *(A2)++ = 0x80 | (((A1) >> 12) & 0x3F); \
-               *(A2)++ = 0x80 | (((A1) >> 6) & 0x3F); \
-               *(A2)++ = 0x80 | ((A1) & 0x3F); \
-       } else if ((A1) < 0x4000000) { \
-               *(A2)++ = 0xF8 | ((A1) >> 24); \
-               *(A2)++ = 0x80 | (((A1) >> 18) & 0x3F); \
-               *(A2)++ = 0x80 | (((A1) >> 12) & 0x3F); \
-               *(A2)++ = 0x80 | (((A1) >> 6) & 0x3F); \
-               *(A2)++ = 0x80 | ((A1) & 0x3F); \
-       } else /* if ((A1) < 0x80000000) */ { \
-               *(A2)++ = 0xFC | ((A1) >> 30); \
-               *(A2)++ = 0x80 | (((A1) >> 24) & 0x3F); \
-               *(A2)++ = 0x80 | (((A1) >> 18) & 0x3F); \
-               *(A2)++ = 0x80 | (((A1) >> 12) & 0x3F); \
-               *(A2)++ = 0x80 | (((A1) >> 6) & 0x3F); \
-               *(A2)++ = 0x80 | ((A1) & 0x3F); \
+
+unsigned char *UTF8_PUTCHAR( int A1, unsigned char *A2)
+{
+       if ((A1) < 0 
+#if SIZEOF_INT > 4 
+           || (int) (A1) >= 0x80000000 
+#endif 
+          ) { 
+               *(A2)++ = chr_nil; 
+       } else if ((A1) < 0x80) { 
+               *(A2)++ = (A1); 
+       } else if ((A1) < 0x800) { 
+               *(A2)++ = 0xC0 | ((A1) >> 6); 
+               *(A2)++ = 0x80 | ((A1) & 0x3F); 
+       } else if ((A1) < 0x10000) { 
+               *(A2)++ = 0xE0 | ((A1) >> 12); 
+               *(A2)++ = 0x80 | (((A1) >> 6) & 0x3F); 
+               *(A2)++ = 0x80 | ((A1) & 0x3F); 
+       } else if ((A1) < 0x200000) { 
+               *(A2)++ = 0xF0 | ((A1) >> 18); 
+               *(A2)++ = 0x80 | (((A1) >> 12) & 0x3F); 
+               *(A2)++ = 0x80 | (((A1) >> 6) & 0x3F); 
+               *(A2)++ = 0x80 | ((A1) & 0x3F); 
+       } else if ((A1) < 0x4000000) { 
+               *(A2)++ = 0xF8 | ((A1) >> 24); 
+               *(A2)++ = 0x80 | (((A1) >> 18) & 0x3F); 
+               *(A2)++ = 0x80 | (((A1) >> 12) & 0x3F); 
+               *(A2)++ = 0x80 | (((A1) >> 6) & 0x3F); 
+               *(A2)++ = 0x80 | ((A1) & 0x3F); 
+       } else /* if ((A1) < 0x80000000) */ { 
+               *(A2)++ = 0xFC | ((A1) >> 30); 
+               *(A2)++ = 0x80 | (((A1) >> 24) & 0x3F); 
+               *(A2)++ = 0x80 | (((A1) >> 18) & 0x3F); 
+               *(A2)++ = 0x80 | (((A1) >> 12) & 0x3F); 
+               *(A2)++ = 0x80 | (((A1) >> 6) & 0x3F); 
+               *(A2)++ = 0x80 | ((A1) & 0x3F); 
        }
+       return A2;
+}
 
 static COL *UTF8_toupperCol = NULL, *UTF8_tolowerCol;
 
@@ -1345,7 +1349,7 @@
                                l2 = -1; /* indicate nil */
                        else
                                l2 = * (unsigned char *) val;
-                       UTF8_PUTCHAR(l2,p);
+                       p= (char*) UTF8_PUTCHAR(l2, (unsigned char *) p);
                        l2 = (int) (p - buf);
                        val = (ptr) buf;
                } else {
@@ -1450,7 +1454,7 @@
 {
        str s = *res = GDKmalloc(7);
 
-       UTF8_PUTCHAR(*c,s);
+       s= (str)UTF8_PUTCHAR(*c,(unsigned char *)s);
        *s = 0;
        return GDK_SUCCEED;
 }
@@ -1680,7 +1684,7 @@
        char buf[7], *p = buf;
 
        RETURN_NIL_IF(strNil(s) || *c == chr_nil, TYPE_int);
-       UTF8_PUTCHAR(i,p);
+       p= (char *) UTF8_PUTCHAR(i, (unsigned char *)p);
        *p = 0;
        return strStrSearch(res, s, buf);
 }
@@ -1693,7 +1697,7 @@
        char buf[7], *p = buf;
 
        RETURN_NIL_IF(strNil(s) || *c == chr_nil, TYPE_int);
-       UTF8_PUTCHAR(i,p);
+       p=  (char *)UTF8_PUTCHAR(i,(unsigned char *)p);
        *p = 0;
        return strReverseStrSearch(res, s, buf);
 }
@@ -1863,7 +1867,6 @@
        size_t seplen = strlen(sep);
        char *d, *x;
        COL *res;
-       oid n = oid_nil;
 
        if (seplen == 0) {
                return GDK_FAIL;
@@ -1903,7 +1906,6 @@
 chrSplit(COL **Res, str s)
 {
        char * d = s;
-       oid n = oid_nil;
        COL *res = COLnew( TYPE_chr, (BUN) strlen(s));
        if (res == NULL)
                return GDK_FAIL;
diff --git a/monetdb5/modules/atoms/streams.c b/monetdb5/modules/atoms/streams.c
--- a/monetdb5/modules/atoms/streams.c
+++ b/monetdb5/modules/atoms/streams.c
@@ -25,6 +25,7 @@
  * encapsulates the corresponding library managed in common/stream.
 */
 
+#include "streams.h"
 #include "mal_exception.h"
 
 str mnstr_open_rstreamwrap(Stream *S, str *filename)
diff --git a/monetdb5/modules/atoms/streams.h b/monetdb5/modules/atoms/streams.h
--- a/monetdb5/modules/atoms/streams.h
+++ b/monetdb5/modules/atoms/streams.h
@@ -20,15 +20,14 @@
 #ifndef _STREAMS_H_
 #define _STREAMS_H_
 
+#include "monetdb_config.h"
+#include <mal.h>
+#include <stdio.h>
+#include <stream_socket.h>
+
 typedef ptr Stream;
 typedef ptr Bstream;
 
-#include "monetdb_config.h"
-#include <mal.h>
-#include "streams.h"
-#include <stdio.h>
-#include <stream_socket.h>
-
 #ifdef WIN32
 #if !defined(LIBMAL) && !defined(LIBATOMS) && !defined(LIBKERNEL) && 
!defined(LIBMAL) && !defined(LIBOPTIMIZER) && !defined(LIBSCHEDULER) && 
!defined(LIBMONETDB5)
 #define streams_export extern __declspec(dllimport)
diff --git a/monetdb5/modules/atoms/url.c b/monetdb5/modules/atoms/url.c
--- a/monetdb5/modules/atoms/url.c
+++ b/monetdb5/modules/atoms/url.c
@@ -862,15 +862,9 @@
 }
 
 str
-URLgetQueryArg(int *ret, str *tv)
+URLgetQueryArg(int *ret, int *ret2, str *tv)
 {
-       (void) ret;
-       (void) tv;
-       throw(MAL, "url.getQueryArg", "Not yet implemented");
-/*
-       url_getQueryArg(ret,*tv);
-       return MAL_SUCCEED;
-*/
+       return url_getQueryArg(ret,ret2,*tv);
 }
 
 str
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to