Changeset: 5e33a1d56db7 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/5e33a1d56db7
Modified Files:
        gdk/gdk.h
        sql/test/cte/Tests/test_correlated_recursive_cte.test
Branch: clean_parser
Log Message:

merged with recursive cte


diffs (truncated from 1801 to 300 lines):

diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -527,15 +527,15 @@ int dlclose(void *handle);
 char *dlerror(void);
 void *dlopen(const char *file, int mode);
 void *dlsym(void *handle, const char *name);
-_Noreturn void eb_error(exception_buffer *eb, char *msg, int val);
+_Noreturn void eb_error(exception_buffer *eb, const char *msg, int val);
 exception_buffer *eb_init(exception_buffer *eb) 
__attribute__((__access__(write_only, 1)));
 size_t escapedStr(char *restrict dst, const char *restrict src, size_t dstlen, 
const char *sep1, const char *sep2, int quote);
 size_t escapedStrlen(const char *restrict src, const char *sep1, const char 
*sep2, int quote);
 ssize_t fltFromStr(const char *src, size_t *len, flt **dst, bool external);
 ssize_t fltToStr(str *dst, size_t *len, const flt *src, bool external);
 const flt flt_nil;
-gdk_return gdk_add_callback(char *name, gdk_callback_func *f, int argc, void 
*argv[], int interval);
-gdk_return gdk_remove_callback(char *, gdk_callback_func *f);
+gdk_return gdk_add_callback(const char *name, gdk_callback_func *f, int argc, 
void *argv[], int interval);
+gdk_return gdk_remove_callback(const char *, gdk_callback_func *f);
 bat getBBPsize(void);
 char *get_bin_path(void);
 int gettimeofday(struct timeval *tv, int *ignore_zone);
diff --git a/common/utils/mstring.h b/common/utils/mstring.h
--- a/common/utils/mstring.h
+++ b/common/utils/mstring.h
@@ -24,7 +24,7 @@
 #endif
 
 #if defined(__has_attribute)
-#if ! __has_attribute(access)
+#if ! __has_attribute(__access__)
 #define __access__(...)
 #endif
 #else
@@ -33,7 +33,8 @@
 
 /* copy at most (n-1) bytes from src to dst and add a terminating NULL
  * byte; return length of src (i.e. can be more than what is copied) */
-static inline size_t __attribute__((__access__(write_only, 1, 3)))
+__attribute__((__access__(write_only, 1, 3)))
+static inline size_t
 strcpy_len(char *restrict dst, const char *restrict src, size_t n)
 {
        if (dst != NULL && n != 0) {
@@ -71,7 +72,9 @@ GCC_Pragma("GCC diagnostic pop")
 
 /* copy the NULL terminated list of src strings with a maximum of n
  * bytes to dst; return the combined length of the src strings */
-static inline size_t __attribute__((__access__(write_only, 1, 2)))
+__attribute__((__access__(write_only, 1, 2)))
+__attribute__((__sentinel__))
+static inline size_t
 strconcat_len(char *restrict dst, size_t n, const char *restrict src, ...)
 {
        va_list ap;
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -2532,7 +2532,7 @@ TIMEOUT_TEST(QryCtx *qc)
        } while (0)
 
 typedef struct gdk_callback {
-       char *name;
+       const char *name;
        int argc;
        int interval;  // units sec
        lng last_called; // timestamp GDKusec
@@ -2543,9 +2543,9 @@ typedef struct gdk_callback {
 
 typedef gdk_return gdk_callback_func(int argc, void *argv[]);
 
-gdk_export gdk_return gdk_add_callback(char *name, gdk_callback_func *f, int 
argc, void
-               *argv[], int interval);
-gdk_export gdk_return gdk_remove_callback(char *, gdk_callback_func *f);
+gdk_export gdk_return gdk_add_callback(const char *name, gdk_callback_func *f,
+                                      int argc, void *argv[], int interval);
+gdk_export gdk_return gdk_remove_callback(const char *, gdk_callback_func *f);
 
 
 #define SQLSTATE(sqlstate)     #sqlstate "!"
@@ -2560,7 +2560,7 @@ typedef struct exception_buffer {
        jmp_buf state;
 #endif
        int code;
-       char *msg;
+       const char *msg;
        int enabled;
 } exception_buffer;
 
@@ -2573,7 +2573,7 @@ gdk_export exception_buffer *eb_init(exc
 #else
 #define eb_savepoint(eb) ((eb)->enabled = 1, setjmp((eb)->state))
 #endif
-gdk_export _Noreturn void eb_error(exception_buffer *eb, char *msg, int val);
+gdk_export _Noreturn void eb_error(exception_buffer *eb, const char *msg, int 
val);
 
 typedef struct allocator {
        struct allocator *pa;
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -4457,7 +4457,7 @@ static struct {
  * Adds new callback to the callback list.
  */
 gdk_return
-gdk_add_callback(char *name, gdk_callback_func *f, int argc, void *argv[], int
+gdk_add_callback(const char *name, gdk_callback_func *f, int argc, void 
*argv[], int
                interval)
 {
 
@@ -4512,7 +4512,7 @@ gdk_add_callback(char *name, gdk_callbac
  * Removes a callback from the callback list with a given name as an argument.
  */
 gdk_return
-gdk_remove_callback(char *cb_name, gdk_callback_func *argsfree)
+gdk_remove_callback(const char *cb_name, gdk_callback_func *argsfree)
 {
        gdk_callback *prev = NULL;
        gdk_return res = GDK_FAIL;
diff --git a/gdk/gdk_private.h b/gdk/gdk_private.h
--- a/gdk/gdk_private.h
+++ b/gdk/gdk_private.h
@@ -135,9 +135,13 @@ gdk_return GDKextendf(int fd, size_t siz
 int GDKfdlocate(int farmid, const char *nme, const char *mode, const char *ext)
        __attribute__((__visibility__("hidden")));
 FILE *GDKfilelocate(int farmid, const char *nme, const char *mode, const char 
*ext)
-       __attribute__((__visibility__("hidden")));
+       __attribute__((__visibility__("hidden")))
+       __attribute__((__malloc__))
+       __attribute__((__malloc__(fclose, 1)));
 FILE *GDKfileopen(int farmid, const char *dir, const char *name, const char 
*extension, const char *mode)
-       __attribute__((__visibility__("hidden")));
+       __attribute__((__visibility__("hidden")))
+       __attribute__((__malloc__))
+       __attribute__((__malloc__(fclose, 1)));
 char *GDKload(int farmid, const char *nme, const char *ext, size_t size, 
size_t *maxsize, storage_t mode)
        __attribute__((__visibility__("hidden")));
 gdk_return GDKmove(int farmid, const char *dir1, const char *nme1, const char 
*ext1, const char *dir2, const char *nme2, const char *ext2, bool report)
@@ -264,6 +268,7 @@ BAT *virtualize(BAT *bn)
 /* calculate the integer 2 logarithm (i.e. position of highest set
  * bit) of the argument (with a slight twist: 0 gives 0, 1 gives 1,
  * 0x8 to 0xF give 4, etc.) */
+__attribute__((__const__))
 static inline unsigned
 ilog2(BUN x)
 {
diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c
--- a/gdk/gdk_utils.c
+++ b/gdk/gdk_utils.c
@@ -339,7 +339,8 @@ GDKcopyenv(BAT **key, BAT **val, bool wr
  * Single-lined comments can now be logged safely, together with
  * process, thread and user ID, and the current time.
  */
-static void __attribute__((__format__(__printf__, 2, 3)))
+__attribute__((__format__(__printf__, 2, 3)))
+static void
 GDKlog(FILE *lockFile, const char *format, ...)
 {
        va_list ap;
@@ -2056,7 +2057,7 @@ eb_init(exception_buffer *eb)
 }
 
 void
-eb_error( exception_buffer *eb, char *msg, int val )
+eb_error(exception_buffer *eb, const char *msg, int val)
 {
        eb->code = val;
        eb->msg = msg;
@@ -2076,7 +2077,7 @@ typedef struct freed_t {
 } freed_t;
 
 static void
-sa_destroy_freelist( freed_t *f )
+sa_destroy_freelist(freed_t *f)
 {
        while(f) {
                freed_t *n = f->n;
@@ -2152,7 +2153,8 @@ sa_create(allocator *pa)
        return sa;
 }
 
-allocator *sa_reset( allocator *sa )
+allocator *
+sa_reset(allocator *sa)
 {
        size_t i ;
 
@@ -2171,7 +2173,7 @@ allocator *sa_reset( allocator *sa )
 #undef sa_realloc
 #undef sa_alloc
 void *
-sa_realloc( allocator *sa, void *p, size_t sz, size_t oldsz )
+sa_realloc(allocator *sa, void *p, size_t sz, size_t oldsz)
 {
        void *r = sa_alloc(sa, sz);
 
@@ -2182,7 +2184,7 @@ sa_realloc( allocator *sa, void *p, size
 
 #define round16(sz) ((sz+15)&~15)
 void *
-sa_alloc( allocator *sa, size_t sz )
+sa_alloc(allocator *sa, size_t sz)
 {
        char *r;
        sz = round16(sz);
@@ -2235,7 +2237,8 @@ sa_alloc( allocator *sa, size_t sz )
 }
 
 #undef sa_zalloc
-void *sa_zalloc( allocator *sa, size_t sz )
+void *
+sa_zalloc(allocator *sa, size_t sz)
 {
        void *r = sa_alloc(sa, sz);
 
@@ -2244,7 +2247,8 @@ void *sa_zalloc( allocator *sa, size_t s
        return r;
 }
 
-void sa_destroy( allocator *sa )
+void
+sa_destroy(allocator *sa)
 {
        if (sa->pa) {
                sa_reset(sa);
@@ -2261,7 +2265,8 @@ void sa_destroy( allocator *sa )
 }
 
 #undef sa_strndup
-char *sa_strndup( allocator *sa, const char *s, size_t l)
+char *
+sa_strndup(allocator *sa, const char *s, size_t l)
 {
        char *r = sa_alloc(sa, l+1);
 
@@ -2273,12 +2278,14 @@ char *sa_strndup( allocator *sa, const c
 }
 
 #undef sa_strdup
-char *sa_strdup( allocator *sa, const char *s )
+char *
+sa_strdup(allocator *sa, const char *s)
 {
-       return sa_strndup( sa, s, strlen(s));
+       return sa_strndup(sa, s, strlen(s));
 }
 
-char *sa_strconcat( allocator *sa, const char *s1, const char *s2 )
+char *
+sa_strconcat(allocator *sa, const char *s1, const char *s2)
 {
        size_t l1 = strlen(s1);
        size_t l2 = strlen(s2);
@@ -2292,7 +2299,8 @@ char *sa_strconcat( allocator *sa, const
        return r;
 }
 
-size_t sa_size( allocator *sa )
+size_t
+sa_size(allocator *sa)
 {
        return sa->usedmem;
 }
diff --git a/geom/lib/libgeom.c b/geom/lib/libgeom.c
--- a/geom/lib/libgeom.c
+++ b/geom/lib/libgeom.c
@@ -20,7 +20,8 @@
 #include "monetdb_config.h"
 #include "libgeom.h"
 
-static void __attribute__((__format__(__printf__, 1, 2)))
+__attribute__((__format__(__printf__, 1, 2)))
+static void
 geomerror(_In_z_ _Printf_format_string_ const char *fmt, ...)
 {
        va_list va;
diff --git a/monetdb5/mal/mal_exception.c b/monetdb5/mal/mal_exception.c
--- a/monetdb5/mal/mal_exception.c
+++ b/monetdb5/mal/mal_exception.c
@@ -77,7 +77,8 @@ concatErrors(char *err1, const char *err
  * showException such that they share the same code, because reuse
  * is good.
  */
-static str __attribute__((__format__(__printf__, 3, 0), __returns_nonnull__))
+__attribute__((__format__(__printf__, 3, 0), __returns_nonnull__))
+static str
 createExceptionInternal(enum malexception type, const char *fcn,
                                                const char *format, va_list ap)
 {
@@ -192,7 +193,8 @@ freeException(str msg)
  * showScriptException such that they share the same code, because reuse
  * is good.
  */
-static str __attribute__((__format__(__printf__, 5, 0), __returns_nonnull__))
+__attribute__((__format__(__printf__, 5, 0), __returns_nonnull__))
+static str
 createMalExceptionInternal(MalBlkPtr mb, int pc, enum malexception type,
                                                   char *prev, const char 
*format, va_list ap)
 {
diff --git a/monetdb5/optimizer/opt_commonTerms.c 
b/monetdb5/optimizer/opt_commonTerms.c
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to