Changeset: 61dc94ad4110 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=61dc94ad4110 Modified Files: monetdb5/extras/pyapi/pyapi.c monetdb5/extras/pyapi/pytypes.h monetdb5/extras/pyapi/unicode.c Branch: pythonudf Log Message:
Explicit typecasts for windows compiler. diffs (86 lines): diff --git a/monetdb5/extras/pyapi/pyapi.c b/monetdb5/extras/pyapi/pyapi.c --- a/monetdb5/extras/pyapi/pyapi.c +++ b/monetdb5/extras/pyapi/pyapi.c @@ -1157,8 +1157,8 @@ str PyAPIeval(Client cntxt, MalBlkPtr mb params->function = &pFunc; params->connection = &pConnection; params->pycall = &pycall; - params->group_start = floor(current); - params->group_end = floor(current += increment); + params->group_start = (size_t)floor(current); + params->group_end = (size_t)floor(current += increment); params->args = &args; params->msg = NULL; #ifdef HAVE_PTHREAD_H @@ -1280,7 +1280,7 @@ aggrwrapup: } else { // If there are a variable number of return types, we take the column names from the dictionary PyObject *keys = PyDict_Keys(pResult); - retcols = PyList_Size(keys); + retcols = (int)PyList_Size(keys); retnames = GDKzalloc(sizeof(char*) * retcols); for(i = 0; i < retcols; i++) { PyObject *colname = PyList_GetItem(keys, i); @@ -2239,8 +2239,8 @@ PyObject *PyObject_CheckForConversion(Py else { //the return value is an array of arrays, all we need to do is check if it is the correct size int results = 0; - if (PyList_Check(data)) results = PyList_Size(data); - else results = PyArray_DIMS((PyArrayObject*)data)[0]; + if (PyList_Check(data)) results = (int)PyList_Size(data); + else results = (int)PyArray_DIMS((PyArrayObject*)data)[0]; columns = results; if (results != expected_columns && expected_columns > 0) { //wrong return size, we expect pci->retc arrays @@ -2712,7 +2712,7 @@ str ConvertToSQLType(Client cntxt, BAT *b, enum _sqltype sqltype, sql_subtype *sql_subtype, BAT **ret_bat, int *ret_type) { str res = MAL_SUCCEED; - bat result_bat; + bat result_bat = 0; int digits = sql_subtype->digits; int scale = sql_subtype->scale; (void) cntxt; diff --git a/monetdb5/extras/pyapi/pytypes.h b/monetdb5/extras/pyapi/pytypes.h --- a/monetdb5/extras/pyapi/pytypes.h +++ b/monetdb5/extras/pyapi/pytypes.h @@ -39,9 +39,7 @@ struct _PyReturn{ bool *mask_data; //bool* pointer to mask data size_t count; //amount of return elements size_t memory_size; //memory size of each element -#ifdef HAVE_FORK lng mmap_id; -#endif int result_type; //result type as NPY_<TYPE> bool multidimensional; //whether or not the result is multidimensional }; diff --git a/monetdb5/extras/pyapi/unicode.c b/monetdb5/extras/pyapi/unicode.c --- a/monetdb5/extras/pyapi/unicode.c +++ b/monetdb5/extras/pyapi/unicode.c @@ -30,7 +30,7 @@ int utf8_strlen(const char *utf8_str, bo int utf32_strlen(const Py_UNICODE *utf32_str) { - size_t i = 0; + int i = 0; while(utf32_str[i] != 0) i++; return (i - 1); @@ -74,7 +74,7 @@ int utf32_char_to_utf8_char(size_t posit utf8_storage[position] = (utf32_char | 0xc0); return utf8_size; default: - utf8_storage[position] = utf32_char; + utf8_storage[position] = (char)utf32_char; return utf8_size; } } @@ -171,7 +171,7 @@ bool utf8_to_utf32(size_t offset, size_t return true; } - shift = utf8_char_to_utf32_char(i, utf32_storage, offset + position, utf8); + shift = utf8_char_to_utf32_char((int)i, utf32_storage, (int)(offset + position), utf8); if (shift < 0) return false; position += shift; } _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list