Changeset: e823866e0099 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e823866e0099
Modified Files:
clients/mapilib/mapi.c
common/utils/conversion.c
common/utils/conversion.h
Branch: protocol
Log Message:
Compilation fixes.
diffs (60 lines):
diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -6249,14 +6249,32 @@ mapi_set_compute_column_width(Mapi mid,
static float
STRTOF(const char *restrict str, char **restrict endptr, int base) {
+#ifdef HAVE_STRTOF
(void) base;
return strtof(str, endptr);
+#else
+ float d;
+ (void) base;
+ if (sscanf(str, "%g", &d) != 1) {
+ return 0;
+ }
+ return d;
+#endif
}
static double
STRTOD(const char *restrict str, char **restrict endptr, int base) {
(void) base;
+#ifdef HAVE_STRTOD
return strtod(str, endptr);
+#else
+ double d;
+ (void) base;
+ if (sscanf(str, "%lg", &d) != 1) {
+ return 0;
+ }
+ return d;
+#endif
}
#define NUMERIC_FETCH_FUNCTION(type, typename, MIN_VALUE, MAX_VALUE,
stringconv)
\
diff --git a/common/utils/conversion.c b/common/utils/conversion.c
--- a/common/utils/conversion.c
+++ b/common/utils/conversion.c
@@ -419,7 +419,7 @@ conversion_blob_to_string(char *dst, int
if (nitems == ~(size_t) 0)
expectedlen = 4;
else
- expectedlen = 24 + (nitems * 3);
+ expectedlen = (int)(24 + (nitems * 3));
if (len < expectedlen) return -1;
diff --git a/common/utils/conversion.h b/common/utils/conversion.h
--- a/common/utils/conversion.h
+++ b/common/utils/conversion.h
@@ -60,7 +60,7 @@ numeric_conversion(hge, hge);
// date conversion, *src is days since 01-01-0001
int conversion_date_to_string(char *dst, int len, const int *src, int
null_value);
-void conversion_date_get_data(int date, short *year, unsigned short *month,
unsigned short *day);
+void conversion_date_get_data(const int date, short *out_year, unsigned short
*out_month, unsigned short *out_day);
// time conversion, *src is ms since 00:00:00
int conversion_time_to_string(char *dst, int len, const int *src, int
null_value, int digits);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list