-
Notifications
You must be signed in to change notification settings - Fork 1
fixes from compiling with warnings #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
9653fe5
47ab51b
37986b0
01829b6
d82d3a0
cb60cf6
ccac6a1
6c3201b
1fa8ee7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -630,7 +630,7 @@ static NPY_INLINE npy_longdouble | |
hpy_string_to_long_double(HPyContext *ctx, HPy op) | ||
{ | ||
const char *s; | ||
const char *end; | ||
char *end; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this caused many warnings, so either my change or all the uses of |
||
npy_longdouble temp; | ||
HPy b; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2331,7 +2331,7 @@ HPyArray_FromAny(HPyContext *ctx, HPy op, HPy newtype, int min_depth, | |
} | ||
|
||
// TODO HPY LABS PORT | ||
PyArrayObject *py_ret = HPy_AsPyObject(ctx, ret); | ||
PyArrayObject *py_ret = (PyArrayObject *)HPy_AsPyObject(ctx, ret); | ||
PyObject *py_op = HPy_AsPyObject(ctx, op); | ||
if (setArrayFromSequence(py_ret, py_op, 0, NULL) < 0) { | ||
Py_DECREF(py_ret); | ||
|
@@ -4986,7 +4986,7 @@ HPyArray_ArangeObj(HPyContext *ctx, HPy start, HPy stop, HPy step, HPy /* PyArra | |
PyObject *new; | ||
PyObject *py_range = HPy_AsPyObject(ctx, range); | ||
CAPI_WARN("calling PyArray_Byteswap"); | ||
new = PyArray_Byteswap(py_range, 1); | ||
new = PyArray_Byteswap((PyArrayObject *)py_range, 1); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we perhaps do There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this was has fewer casts, since most places this is used prefer a |
||
Py_DECREF(py_range); | ||
Py_DECREF(new); | ||
_hpy_set_descr(ctx, range, range_struct, dtype); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1533,7 +1533,7 @@ datetime_as_string_impl(HPyContext *ctx, HPy NPY_UNUSED(ignored), const HPy *arg | |
op_flags[1] = NPY_ITER_WRITEONLY| | ||
NPY_ITER_ALLOCATE; | ||
|
||
iter = NpyIter_MultiNew(2, op, flags, NPY_KEEPORDER, NPY_UNSAFE_CASTING, | ||
iter = HNpyIter_MultiNew(ctx, 2, op, flags, NPY_KEEPORDER, NPY_UNSAFE_CASTING, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, we probably just overlooked that. |
||
op_flags, op_dtypes); | ||
if (iter == NULL) { | ||
goto fail; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2641,6 +2641,7 @@ NPY_NO_EXPORT int | |
array_assign_item_slot_impl(HPyContext *ctx, HPy /* PyArrayObject * */ self, HPy_ssize_t i, HPy op) | ||
{ | ||
npy_index_info indices[2]; | ||
hpy_npy_index_info hpy_indices[2]; | ||
|
||
if (HPy_IsNull(op)) { | ||
HPyErr_SetString(ctx, ctx->h_ValueError, | ||
|
@@ -2664,6 +2665,8 @@ array_assign_item_slot_impl(HPyContext *ctx, HPy /* PyArrayObject * */ self, HPy | |
|
||
indices[0].value = i; | ||
indices[0].type = HAS_INTEGER; | ||
hpy_indices[0].value = i; | ||
hpy_indices[0].type = HAS_INTEGER; | ||
if (PyArray_NDIM(self_struct) == 1) { | ||
char *item; | ||
if (get_item_pointer(self_struct, &item, indices, 1) < 0) { | ||
|
@@ -2677,9 +2680,9 @@ array_assign_item_slot_impl(HPyContext *ctx, HPy /* PyArrayObject * */ self, HPy | |
else { | ||
HPy view; // PyArrayObject * | ||
|
||
indices[1].value = PyArray_NDIM(self_struct) - 1; | ||
indices[1].type = HAS_ELLIPSIS; | ||
if (hpy_get_view_from_index(ctx, self, self_struct, &view, indices, 2, 0) < 0) { | ||
hpy_indices[1].value = PyArray_NDIM(self_struct) - 1; | ||
hpy_indices[1].type = HAS_ELLIPSIS; | ||
if (hpy_get_view_from_index(ctx, self, self_struct, &view, hpy_indices, 2, 0) < 0) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I needed to duplicate the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No. Only |
||
return -1; | ||
} | ||
PyArrayObject *view_struct = PyArrayObject_AsStruct(ctx, view); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,8 +53,8 @@ typedef struct { | |
* while normal object to string casts only accept ASCII, so it ensures | ||
* that that the object array already contains bytes and not strings. | ||
*/ | ||
bool python_byte_converters; | ||
bool c_byte_converters; | ||
npy_bool python_byte_converters; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this change for? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
npy_bool c_byte_converters; | ||
} parser_config; | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -860,7 +860,7 @@ PyUFunc_SimpleUniformOperationTypeResolver( | |
Py_INCREF(out_dtypes[iop]); | ||
} | ||
HPyContext *ctx = npy_get_context(); | ||
HPy *h_out_types = HPy_FromPyObjectArray(ctx, out_dtypes, ufunc->nargs); | ||
HPy *h_out_types = HPy_FromPyObjectArray(ctx, (PyObject **)out_dtypes, ufunc->nargs); | ||
HPy h_ufunc = HPy_FromPyObject(ctx, (PyObject *) ufunc); | ||
hpy_raise_no_loop_found_error(ctx, h_ufunc, h_out_types); | ||
HPy_CloseAndFreeArray(ctx, h_out_types, ufunc->nargs); | ||
|
@@ -2318,7 +2318,7 @@ hpy_linear_search_userloop_type_resolver(HPyContext *ctx, | |
return -1; | ||
} | ||
CAPI_WARN("PyUFunc_Loop1d->arg_dtypes is a (PyArray_Descr **)!"); | ||
HPy *arg_dtypes = HPy_FromPyObjectArray(ctx, funcdata->arg_dtypes, funcdata->nargs); | ||
HPy *arg_dtypes = HPy_FromPyObjectArray(ctx, (PyObject **)(funcdata->arg_dtypes), funcdata->nargs); | ||
for (; funcdata != NULL; funcdata = funcdata->next) { | ||
int *types = funcdata->arg_types; | ||
switch (hpy_ufunc_loop_matches(ctx, self, self_struct, op, | ||
|
@@ -3108,7 +3108,9 @@ hpy_type_tuple_type_resolver(HPyContext *ctx, | |
|
||
ufunc_name = ufunc_get_name_cstr(self_struct); | ||
|
||
use_min_scalar = should_use_min_scalar(nin, op, 0, NULL); | ||
hpy_abort_not_implemented("convert op to PyArrayObject**"); | ||
PyArrayObject ** dummy; | ||
use_min_scalar = should_use_min_scalar(nin, dummy, 0, NULL); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should_use_min_scalar is a legacy interface, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there something preventing us from calling There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That might work, but I would prefer not to add more |
||
|
||
/* Fill in specified_types from the tuple or string */ | ||
const char *bad_type_tup_msg = ( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems wrong? The argument order should be the same as
PyArrayIdentityHash_SetItem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, makes sense. Seems that I was just not consistent in adding the
cache_owner
argument.