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

Get this to compile on Windows using MSVC.
type_record_t is already const, so don't add another const;
applying unary - to an unsigned gives a warning, so use bit manipulation
(~x+1) instead.


diffs (53 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
@@ -508,7 +508,7 @@ load_blob(BAT *bat, stream *s, int *eof_
 #ifdef _MSC_VER
 #pragma warning(suppress:4146)
 #endif
-                               allocate += ((-allocate) % 0x100000);   // 
round up to nearest MiB
+                               allocate += ((~allocate + 1) % 0x100000);   // 
round up to nearest MiB
                                assert(allocate >= needed);
                                buffer = GDKmalloc(allocate);
                                if (!buffer) {
@@ -620,7 +620,7 @@ find_type_rec(const char *name)
 }
 
 bool
-can_dump_binary_column(const type_record_t *rec)
+can_dump_binary_column(type_record_t *rec)
 {
        return rec->encoder_trivial || rec->dumper || rec->encoder;
 }
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(type_record_t const *rec);
+extern bool can_dump_binary_column(type_record_t *rec);
 
-extern str dump_binary_column(type_record_t const *rec, BAT *b, BUN start, BUN 
length, bool byteswap, stream *s);
+extern str dump_binary_column(type_record_t *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
@@ -1899,7 +1899,7 @@ align_dump(stream *s, uint64_t pos, unsi
 #ifdef _MSC_VER
 #pragma warning(suppress:4146)
 #endif
-       uint64_t gap = (-pos) % a;
+       uint64_t gap = (~pos + 1) % a;
        return mnstr_write(s, zeroes, 1, (size_t)gap);
 }
 
@@ -2004,4 +2004,3 @@ end:
        mnstr_destroy(countstream);
        return ret;
 }
-
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to