Changeset: d2412dd8e911 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d2412dd8e911
Modified Files:
        sql/backends/monet5/sql_bincopyconvert.c
        sql/backends/monet5/sql_bincopyconvert.h
        sql/backends/monet5/sql_result.c
Branch: binresultset
Log Message:

Attempt to suppress some warnings on MSVC


diffs (72 lines):

diff --git a/sql/backends/monet5/sql_bincopyconvert.c 
b/sql/backends/monet5/sql_bincopyconvert.c
--- a/sql/backends/monet5/sql_bincopyconvert.c
+++ b/sql/backends/monet5/sql_bincopyconvert.c
@@ -505,6 +505,9 @@ load_blob(BAT *bat, stream *s, int *eof_
                                GDKfree(buffer);
                                size_t allocate = needed;
                                allocate += allocate / 16;   // add a little 
margin
+#ifdef _MSC_VER
+#pragma warning(suppress:4146)
+#endif
                                allocate += ((-allocate) % 0x100000);   // 
round up to nearest MiB
                                assert(allocate >= needed);
                                buffer = GDKmalloc(allocate);
diff --git a/sql/backends/monet5/sql_bincopyconvert.h 
b/sql/backends/monet5/sql_bincopyconvert.h
--- a/sql/backends/monet5/sql_bincopyconvert.h
+++ b/sql/backends/monet5/sql_bincopyconvert.h
@@ -61,9 +61,9 @@ typedef const struct type_record_t type_
 
 extern type_record_t *find_type_rec(const char *name);
 
-extern bool can_dump_binary_column(const type_record_t *rec);
+extern bool can_dump_binary_column(type_record_t const *rec);
 
-extern str dump_binary_column(const type_record_t *rec, BAT *b, BUN start, BUN 
length, bool byteswap, stream *s);
+extern str dump_binary_column(type_record_t const *rec, BAT *b, BUN start, BUN 
length, bool byteswap, stream *s);
 
 
 #endif
diff --git a/sql/backends/monet5/sql_result.c b/sql/backends/monet5/sql_result.c
--- a/sql/backends/monet5/sql_result.c
+++ b/sql/backends/monet5/sql_result.c
@@ -1888,7 +1888,7 @@ mvc_export_error(backend *be, stream *s,
 }
 
 static ssize_t
-align_dump(stream *s, uint64_t *pos, unsigned int alignment)
+align_dump(stream *s, uint64_t pos, unsigned int alignment)
 {
        uint64_t a = (uint64_t)alignment;
        // must be a power of two
@@ -1896,8 +1896,11 @@ align_dump(stream *s, uint64_t *pos, uns
        assert((a & (a-1)) == 0);
 
        static char zeroes[32] = { 0 };
-       uint64_t gap = (-*pos) % a;
-       return mnstr_write(s, zeroes, 1, gap);
+#ifdef _MSC_VER
+#pragma warning(suppress:4146)
+#endif
+       uint64_t gap = (-pos) % a;
+       return mnstr_write(s, zeroes, 1, (size_t)gap);
 }
 
 
@@ -1962,7 +1965,7 @@ mvc_export_bin_chunk(backend *b, stream 
        mnstr_printf(countstream, "&6 %d %d " BUNFMT " " BUNFMT "\n", res_id, 
res->nr_cols, end_row - offset, offset);
 
        for (int i = 0; i < res->nr_cols; i++) {
-               align_dump(countstream, &byte_count, 32); // 32 looks nice in 
tcpflow
+               align_dump(countstream, byte_count, 32); // 32 looks nice in 
tcpflow
                struct bindump_record *info = &colinfo[i];
                info->start = byte_count;
                str msg = dump_binary_column(info->type_rec, info->bat, offset, 
end_row - offset, false, countstream);
@@ -1977,7 +1980,7 @@ mvc_export_bin_chunk(backend *b, stream 
 
        assert(byte_count > 0);
 
-       align_dump(countstream, &byte_count, 32);
+       align_dump(countstream, byte_count, 32);
        toc_pos = byte_count;
        for (int i = 0; i < res->nr_cols; i++) {
                struct bindump_record *info = &colinfo[i];
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to