Changeset: 2928a54dd0f1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/2928a54dd0f1
Modified Files:
        common/utils/mstring.h
        gdk/gdk_utils.c
        geom/lib/libgeom.c
        monetdb5/mal/mal_exception.c
        monetdb5/optimizer/opt_commonTerms.c
        sql/storage/bat/bat_logger.c
        sql/storage/store.c
Branch: default
Log Message:

Layout.


diffs (288 lines):

diff --git a/common/utils/mstring.h b/common/utils/mstring.h
--- a/common/utils/mstring.h
+++ b/common/utils/mstring.h
@@ -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,8 @@ 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)))
+static inline size_t
 strconcat_len(char *restrict dst, size_t n, const char *restrict src, ...)
 {
        va_list ap;
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;
@@ -2152,7 +2153,8 @@ sa_create(allocator *pa)
        return sa;
 }
 
-allocator *sa_reset(allocator *sa)
+allocator *
+sa_reset(allocator *sa)
 {
        size_t i ;
 
@@ -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 sz
        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 ch
 }
 
 #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));
 }
 
-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
--- a/monetdb5/optimizer/opt_commonTerms.c
+++ b/monetdb5/optimizer/opt_commonTerms.c
@@ -33,7 +33,8 @@ isProjectConst(const InstrRecord *p)
        return (getModuleId(p) == algebraRef && getFunctionId(p) == projectRef);
 }
 
-static int __attribute__((__pure__))
+__attribute__((__pure__))
+static int
 hashInstruction(const MalBlkRecord *mb, const InstrRecord *p)
 {
        int i;
diff --git a/sql/storage/bat/bat_logger.c b/sql/storage/bat/bat_logger.c
--- a/sql/storage/bat/bat_logger.c
+++ b/sql/storage/bat/bat_logger.c
@@ -971,7 +971,8 @@ bl_sequence(sqlstore *store, int seq, ln
 /* Write a plan entry to copy part of the given file.
  * That part of the file must remain unchanged until the plan is executed.
  */
-static gdk_return __attribute__((__warn_unused_result__))
+__attribute__((__warn_unused_result__))
+static gdk_return
 snapshot_lazy_copy_file(stream *plan, const char *name, uint64_t extent)
 {
        if (mnstr_printf(plan, "c %" PRIu64 " %s\n", extent, name) < 0) {
@@ -985,7 +986,8 @@ snapshot_lazy_copy_file(stream *plan, co
  * The contents are included in the plan so the source file is allowed to
  * change in the mean time.
  */
-static gdk_return __attribute__((__warn_unused_result__))
+__attribute__((__warn_unused_result__))
+static gdk_return
 snapshot_immediate_copy_file(stream *plan, const char *path, const char *name)
 {
        gdk_return ret = GDK_FAIL;
@@ -1049,7 +1051,8 @@ end:
 }
 
 /* Add plan entries for all relevant files in the Write Ahead Log */
-static gdk_return __attribute__((__warn_unused_result__))
+__attribute__((__warn_unused_result__))
+static gdk_return
 snapshot_wal(logger *bat_logger, stream *plan, const char *db_dir)
 {
        char log_file[FILENAME_MAX];
@@ -1082,7 +1085,8 @@ snapshot_wal(logger *bat_logger, stream 
        return GDK_SUCCEED;
 }
 
-static gdk_return __attribute__((__warn_unused_result__))
+__attribute__((__warn_unused_result__))
+static gdk_return
 snapshot_heap(stream *plan, const char *db_dir, bat batid, const char 
*filename, const char *suffix, uint64_t extent)
 {
        char path1[FILENAME_MAX];
@@ -1132,7 +1136,8 @@ snapshot_heap(stream *plan, const char *
 /* Add plan entries for all persistent BATs by looping over the BBP.dir.
  * Also include the BBP.dir itself.
  */
-static gdk_return __attribute__((__warn_unused_result__))
+__attribute__((__warn_unused_result__))
+static gdk_return
 snapshot_bats(stream *plan, const char *db_dir)
 {
        char bbpdir[FILENAME_MAX];
@@ -1219,7 +1224,8 @@ end:
        return ret;
 }
 
-static gdk_return __attribute__((__warn_unused_result__))
+__attribute__((__warn_unused_result__))
+static gdk_return
 snapshot_vaultkey(stream *plan, const char *db_dir)
 {
        char path[FILENAME_MAX];
diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -2536,7 +2536,8 @@ store_readonly(sqlstore *store)
 
 // Helper function for tar_write_header.
 // Our stream.h makes sure __attribute__ exists.
-static void __attribute__((__format__(__printf__, 3, 4)))
+__attribute__((__format__(__printf__, 3, 4)))
+static void
 tar_write_header_field(char **cursor_ptr, size_t size, const char *fmt, ...)
 {
        va_list ap;
@@ -2556,7 +2557,8 @@ tar_write_header_field(char **cursor_ptr
 #define TAR_BLOCK_SIZE (512)
 
 // Write a tar header to the given stream.
-static gdk_return __attribute__((__warn_unused_result__))
+__attribute__((__warn_unused_result__))
+static gdk_return
 tar_write_header(stream *tarfile, const char *path, time_t mtime, int64_t size)
 {
        char buf[TAR_BLOCK_SIZE] = {0};
@@ -2623,7 +2625,8 @@ tar_write_header(stream *tarfile, const 
  * multiple of TAR_BLOCK_SIZE.  Make sure all writes are in multiples
  * of TAR_BLOCK_SIZE.
  */
-static gdk_return __attribute__((__warn_unused_result__))
+__attribute__((__warn_unused_result__))
+static gdk_return
 tar_write(stream *outfile, const char *path,  const char *data, size_t size)
 {
        const size_t tail = size % TAR_BLOCK_SIZE;
@@ -2650,7 +2653,8 @@ tar_write(stream *outfile, const char *p
        return GDK_SUCCEED;
 }
 
-static gdk_return __attribute__((__warn_unused_result__))
+__attribute__((__warn_unused_result__))
+static gdk_return
 tar_write_data(stream *tarfile, const char *path, time_t mtime, const char 
*data, size_t size)
 {
        gdk_return res;
@@ -2662,7 +2666,8 @@ tar_write_data(stream *tarfile, const ch
        return tar_write(tarfile, path, data, size);
 }
 
-static gdk_return __attribute__((__warn_unused_result__))
+__attribute__((__warn_unused_result__))
+static gdk_return
 tar_copy_stream(stream *tarfile, const char *path, time_t mtime, stream 
*contents, int64_t size, char *buf, size_t bufsize)
 {
        assert( (bufsize % TAR_BLOCK_SIZE) == 0);
@@ -2696,7 +2701,8 @@ tar_copy_stream(stream *tarfile, const c
        return GDK_SUCCEED;
 }
 
-static gdk_return __attribute__((__warn_unused_result__))
+__attribute__((__warn_unused_result__))
+static gdk_return
 hot_snapshot_write_tar(stream *out, const char *prefix, const char *plan)
 {
        if (plan == NULL)
@@ -2798,7 +2804,8 @@ end:
  *
  * This function is not entirely safe as compared to for example mkstemp.
  */
-static str __attribute__((__warn_unused_result__))
+__attribute__((__warn_unused_result__))
+static str
 pick_tmp_name(str filename)
 {
        str name = GDKmalloc(strlen(filename) + 10);
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to