MonetDB: protocol - More compilation fixes.

2017-03-30 Thread Mark Raasveldt
Changeset: ac467888e1df for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ac467888e1df
Modified Files:
sql/backends/monet5/sql_result.c
Branch: protocol
Log Message:

More compilation fixes.


diffs (20 lines):

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
@@ -1382,6 +1382,7 @@ mvc_export_table_prot10(backend *b, stre
row = srow = offset;
count = nr;
while (row < (size_t) count) {
+   char* message_header;
char *buf = bs2_buffer(s).buf;
size_t crow = 0;
size_t bytes_left = bsize - sizeof(lng) - 2 * sizeof(char) - 1;
@@ -1459,7 +1460,7 @@ mvc_export_table_prot10(backend *b, stre
assert(bs2_buffer(s).pos == 0);
 
// continuation message
-   char* message_header = "+\n";
+   message_header = "+\n";
if (row >= (size_t) count) {
// final message
message_header = "-\n";
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: protocol - More compilation fixes.

2016-11-11 Thread Mark Raasveldt
Changeset: fd98db452269 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fd98db452269
Modified Files:
sql/backends/monet5/sql_result.c
Branch: protocol
Log Message:

More compilation fixes.


diffs (12 lines):

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
@@ -2172,7 +2172,7 @@ int mvc_export_resultset_prot10(mvc *m, 
goto cleanup;
}
buf = bs2_buffer(s).buf;
-   bsize = new_size;
+   bsize = (size_t) new_size;
}
}
 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: protocol - More compilation fixes.

2016-11-02 Thread Mark Raasveldt
Changeset: 521dd083f21f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=521dd083f21f
Modified Files:
clients/mapilib/mapi.c
Branch: protocol
Log Message:

More compilation fixes.


diffs (34 lines):

diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -5791,7 +5791,7 @@ mapi_fetch_row(MapiHdl hdl)
}
result->cur_row++;
result->rows_read++;
-   mapi_store_bind(result, result->cur_row);
+   mapi_store_bind(result, (int) result->cur_row);
return result->fieldcnt;
}
 
@@ -6234,17 +6234,17 @@ mapi_set_compute_column_width(Mapi mid, 
mid->compute_column_widths = compute_column_width ? 1 : 0;
 }
 
-#define NUMERIC_CONVERSION(fromtpe, totpe, fromname, toname, MIN_VALUE, 
MAX_VALUE) \
+#define NUMERIC_CONVERSION(totpe, fromtpe, fromname, toname, MIN_VALUE, 
MAX_VALUE) \
case SQL_BINARY_##fromname: {   

\
*retval = (totpe) (*((fromtpe*)col->buffer_ptr));   

\
return MOK; 

\
}
 
 #ifdef HAVE_HGE
-#define HGE_CONVERSION(fromtpe, totpe, fromname, toname, MIN_VALUE, MAX_VALUE) 
\
-   NUMERIC_CONVERSION(fromtpe, totpe, fromname, toname, MIN_VALUE, 
MAX_VALUE)
+#define HGE_CONVERSION(totpe, fromtpe, fromname, toname, MIN_VALUE, MAX_VALUE) 
\
+   NUMERIC_CONVERSION(totpe, fromtpe, fromname, toname, MIN_VALUE, 
MAX_VALUE)
 #else
-#define HGE_CONVERSION(fromtpe, totpe, fromname, toname, MIN_VALUE, MAX_VALUE)
+#define HGE_CONVERSION(totpe, fromtpe, fromname, toname, MIN_VALUE, MAX_VALUE)
 #endif
 
 static float 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: protocol - More compilation fixes.

2016-10-13 Thread Mark Raasveldt
Changeset: 0abdc0eae432 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0abdc0eae432
Modified Files:
clients/mapilib/mapi.c
monetdb5/modules/atoms/Makefile.ag
sql/backends/monet5/sql_result.c
Branch: protocol
Log Message:

More compilation fixes.


diffs (37 lines):

diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -5595,7 +5595,7 @@ mapi_fetch_row(MapiHdl hdl)
if (!mnstr_readLng(hdl->mid->from, 
&new_size)) {
return hdl->mid->error;
}
-   if (new_size < hdl->mid->blocksize) {
+   if ((size_t) new_size < 
hdl->mid->blocksize) {
return mapi_setError(hdl->mid, 
"Request for buffer resize, but new size smaller than old size.", 
"mapi_fetch_row", MERROR);
}
// consume flush
diff --git a/monetdb5/modules/atoms/Makefile.ag 
b/monetdb5/modules/atoms/Makefile.ag
--- a/monetdb5/modules/atoms/Makefile.ag
+++ b/monetdb5/modules/atoms/Makefile.ag
@@ -28,6 +28,7 @@ lib_atoms = {
url.c url.h \
uuid.c \
xml.c xml.h
+   LIBS = ../../../common/utils/libconversion
 }
 
 headers_mal = {
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
@@ -1911,8 +1911,9 @@ static int mvc_export_resultset_prot10(m
int nil_len = -1;
int retval = -1;
int convert_to_string = 
!type_supports_binary_transfer(c->type.type);
+   sql_type *type = c->type.type;
+   
iterators[i] = bat_iterator(b);
-   sql_type *type = c->type.type;
 
if (type->eclass == EC_TIMESTAMP) {
// timestamps are converted to Unix Timestamps
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: protocol - More compilation fixes.

2016-09-27 Thread Mark Raasveldt
Changeset: ce691262be09 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ce691262be09
Modified Files:
common/utils/conversion.c
monetdb5/modules/atoms/mtime.c
Branch: protocol
Log Message:

More compilation fixes.


diffs (80 lines):

diff --git a/common/utils/conversion.c b/common/utils/conversion.c
--- a/common/utils/conversion.c
+++ b/common/utils/conversion.c
@@ -130,13 +130,14 @@ conversion_hge_to_string(char *dst, int 
 #endif
 
 
-#define DEC_TOSTR(TYPE)
\
+#define DEC_TOSTR(TYPE,TYPESTRLEN) 
\
do {\
char buf[64];   \
TYPE v = *(const TYPE *) value; \
int cur = 63, i, done = 0;  \
int neg = v < 0;\
int l;  \
+   if (buflen < TYPESTRLEN) return -1; \
if (v == *((TYPE*)null_value)) {
\
strcpy(buffer, NULL_STRING);
\
return 4;   \
@@ -169,16 +170,16 @@ int
 conversion_decimal_to_string(const void *value, char *buffer, int buflen, int 
scale, int typelen, const void *null_value) {
/* support dec map to bte, sht, int and lng */
if (typelen == 1) {
-   DEC_TOSTR(bte);
+   DEC_TOSTR(bte, bteStrlen + 1);
} else if (typelen == 2) {
-   DEC_TOSTR(sht);
+   DEC_TOSTR(sht, shtStrlen + 1);
} else if (typelen == 4) {
-   DEC_TOSTR(int);
+   DEC_TOSTR(int, intStrlen + 1);
} else if (typelen == 8) {
-   DEC_TOSTR(lng);
+   DEC_TOSTR(lng, lngStrlen + 1);
 #ifdef HAVE_HGE
} else if (typelen == 16) {
-   DEC_TOSTR(hge);
+   DEC_TOSTR(hge, hgeStrlen + 1);
 #endif
} else {
return -1;
@@ -261,7 +262,8 @@ conversion_date_to_string(char *dst, int
 
 int 
 conversion_time_to_string(char *dst, int len, const int *src, int null_value, 
int timezone_diff) {
-   int ms, sec, min, hour;
+   int sec, min, hour;
+   //int ms;
int time = *src;
if (len < daytimeStrlen) return -1;
if (*src == null_value) {
@@ -289,6 +291,7 @@ conversion_epoch_to_string(char *dst, in
int ms, sec, min, hour;
int days = 0;
lng time = *src;
+   int offset;
 
if (*src == null_value) {
strcpy(dst, NULL_STRING);
@@ -309,7 +312,7 @@ conversion_epoch_to_string(char *dst, in
// then we can use our conversion_date_to_string function
days = (int)(time + days_between_zero_and_epoch);
 
-   int offset = conversion_date_to_string(dst, len, &days, -2147483647);
+   offset = conversion_date_to_string(dst, len, &days, -2147483647);
if (offset < 0) return -1;
return snprintf(dst + offset, len - offset, " %02d:%02d:%02d.%06d", 
hour, min, sec, ms);
 }
diff --git a/monetdb5/modules/atoms/mtime.c b/monetdb5/modules/atoms/mtime.c
--- a/monetdb5/modules/atoms/mtime.c
+++ b/monetdb5/modules/atoms/mtime.c
@@ -630,8 +630,6 @@ date_fromstr(const char *buf, int *len, 
 int
 date_tostr(str *buf, int *len, const date *val)
 {
-   int day, month, year;
-
/* longest possible string: "-5867411-01-01" i.e. 14 chars
   without NUL (see definition of YEAR_MIN/YEAR_MAX above) */
if (*len < dateStrlen) {
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: protocol - more compilation fixes

2016-08-10 Thread Hannes Muehleisen
Changeset: ddde0b605379 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ddde0b605379
Modified Files:
clients/mapilib/mapi.c
sql/backends/monet5/sql_result.c
Branch: protocol
Log Message:

more compilation fixes


diffs (55 lines):

diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -4000,14 +4000,16 @@ static char* mapi_convert_varchar(struct
 }
 
 // classic stackoverflow programming
-static char* itoa(int i, char b[]){
+static void itoa(int i, char b[]){
 char const digit[] = "0123456789";
+int shifter;
 char* p = b;
+
 if(i<0){
 *p++ = '-';
 i *= -1;
 }
-int shifter = i;
+shifter = i;
 do{ //Move to where representation ends
 ++p;
 shifter = shifter/10;
@@ -4017,7 +4019,6 @@ static char* itoa(int i, char b[]){
 *--p = digit[i%10];
 i = i/10;
 }while(i);
-return b;
 }
 
 static char* mapi_convert_int(struct MapiColumn *col) {
@@ -4045,9 +4046,11 @@ static char* mapi_convert_tinyint(struct
 }
 
 static char* mapi_convert_double(struct MapiColumn *col) {
+   char *dummy = NULL;
if (*((double*) col->buffer_ptr) == *((double*)col->null_value)) return 
NULL;
//sprintf(col->write_buf, "%g", *((double*) col->buffer_ptr));
-   gcvt(*((double*) col->buffer_ptr), 2, col->write_buf);
+   dummy = gcvt(*((double*) col->buffer_ptr), 2, col->write_buf);
+   (void) dummy;
return (char*) col->write_buf;
 }
 
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
@@ -1967,7 +1967,7 @@ static int mvc_export_resultset_prot10(r
switch(ATOMstorage(mtype)) {
case TYPE_str:
retval = 1;
-   for(j = 0; j < nil_len; j++) {
+   for(j = 0; j < (size_t) nil_len; j++) {
retval = retval && mnstr_writeBte(s, 
str_nil[j]);
}
break;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list