Skip to content

BLD: fix inline warnings #17528

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

Merged
merged 3 commits into from
Sep 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas/_libs/parsers.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ cdef extern from "parser/tokenizer.h":

# inline int to_complex(char *item, double *p_real,
# double *p_imag, char sci, char decimal)
inline int to_longlong(char *item, long long *p_value) nogil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually this line doesn't appear to be used anymore, so I think can comment out

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I've got an upcoming PR that this will be appropriate for. Is there a pattern for when to comment out vs delete?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these should all be deleted

int to_longlong(char *item, long long *p_value) nogil
# inline int to_longlong_thousands(char *item, long long *p_value,
# char tsep)
int to_boolean(const char *item, uint8_t *val) nogil
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/src/inference.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ cpdef bint is_interval_array(ndarray[object] values):


cdef extern from "parse_helper.h":
inline int floatify(object, double *result, int *maybe_int) except -1
int floatify(object, double *result, int *maybe_int) except -1

# constants that will be compared to potentially arbitrarily large
# python int
Expand Down
112 changes: 56 additions & 56 deletions pandas/_libs/src/khash.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ cdef extern from "khash_python.h":
PyObject **keys
size_t *vals

inline kh_pymap_t* kh_init_pymap()
inline void kh_destroy_pymap(kh_pymap_t*)
inline void kh_clear_pymap(kh_pymap_t*)
inline khint_t kh_get_pymap(kh_pymap_t*, PyObject*)
inline void kh_resize_pymap(kh_pymap_t*, khint_t)
inline khint_t kh_put_pymap(kh_pymap_t*, PyObject*, int*)
inline void kh_del_pymap(kh_pymap_t*, khint_t)
kh_pymap_t* kh_init_pymap()
void kh_destroy_pymap(kh_pymap_t*)
void kh_clear_pymap(kh_pymap_t*)
khint_t kh_get_pymap(kh_pymap_t*, PyObject*)
void kh_resize_pymap(kh_pymap_t*, khint_t)
khint_t kh_put_pymap(kh_pymap_t*, PyObject*, int*)
void kh_del_pymap(kh_pymap_t*, khint_t)

bint kh_exist_pymap(kh_pymap_t*, khiter_t)

Expand All @@ -27,13 +27,13 @@ cdef extern from "khash_python.h":
PyObject **keys
size_t *vals

inline kh_pyset_t* kh_init_pyset()
inline void kh_destroy_pyset(kh_pyset_t*)
inline void kh_clear_pyset(kh_pyset_t*)
inline khint_t kh_get_pyset(kh_pyset_t*, PyObject*)
inline void kh_resize_pyset(kh_pyset_t*, khint_t)
inline khint_t kh_put_pyset(kh_pyset_t*, PyObject*, int*)
inline void kh_del_pyset(kh_pyset_t*, khint_t)
kh_pyset_t* kh_init_pyset()
void kh_destroy_pyset(kh_pyset_t*)
void kh_clear_pyset(kh_pyset_t*)
khint_t kh_get_pyset(kh_pyset_t*, PyObject*)
void kh_resize_pyset(kh_pyset_t*, khint_t)
khint_t kh_put_pyset(kh_pyset_t*, PyObject*, int*)
void kh_del_pyset(kh_pyset_t*, khint_t)

bint kh_exist_pyset(kh_pyset_t*, khiter_t)

Expand All @@ -45,13 +45,13 @@ cdef extern from "khash_python.h":
kh_cstr_t *keys
size_t *vals

inline kh_str_t* kh_init_str() nogil
inline void kh_destroy_str(kh_str_t*) nogil
inline void kh_clear_str(kh_str_t*) nogil
inline khint_t kh_get_str(kh_str_t*, kh_cstr_t) nogil
inline void kh_resize_str(kh_str_t*, khint_t) nogil
inline khint_t kh_put_str(kh_str_t*, kh_cstr_t, int*) nogil
inline void kh_del_str(kh_str_t*, khint_t) nogil
kh_str_t* kh_init_str() nogil
void kh_destroy_str(kh_str_t*) nogil
void kh_clear_str(kh_str_t*) nogil
khint_t kh_get_str(kh_str_t*, kh_cstr_t) nogil
void kh_resize_str(kh_str_t*, khint_t) nogil
khint_t kh_put_str(kh_str_t*, kh_cstr_t, int*) nogil
void kh_del_str(kh_str_t*, khint_t) nogil

bint kh_exist_str(kh_str_t*, khiter_t) nogil

Expand All @@ -61,13 +61,13 @@ cdef extern from "khash_python.h":
int64_t *keys
size_t *vals

inline kh_int64_t* kh_init_int64() nogil
inline void kh_destroy_int64(kh_int64_t*) nogil
inline void kh_clear_int64(kh_int64_t*) nogil
inline khint_t kh_get_int64(kh_int64_t*, int64_t) nogil
inline void kh_resize_int64(kh_int64_t*, khint_t) nogil
inline khint_t kh_put_int64(kh_int64_t*, int64_t, int*) nogil
inline void kh_del_int64(kh_int64_t*, khint_t) nogil
kh_int64_t* kh_init_int64() nogil
void kh_destroy_int64(kh_int64_t*) nogil
void kh_clear_int64(kh_int64_t*) nogil
khint_t kh_get_int64(kh_int64_t*, int64_t) nogil
void kh_resize_int64(kh_int64_t*, khint_t) nogil
khint_t kh_put_int64(kh_int64_t*, int64_t, int*) nogil
void kh_del_int64(kh_int64_t*, khint_t) nogil

bint kh_exist_int64(kh_int64_t*, khiter_t) nogil

Expand All @@ -79,13 +79,13 @@ cdef extern from "khash_python.h":
khuint64_t *keys
size_t *vals

inline kh_uint64_t* kh_init_uint64() nogil
inline void kh_destroy_uint64(kh_uint64_t*) nogil
inline void kh_clear_uint64(kh_uint64_t*) nogil
inline khint_t kh_get_uint64(kh_uint64_t*, int64_t) nogil
inline void kh_resize_uint64(kh_uint64_t*, khint_t) nogil
inline khint_t kh_put_uint64(kh_uint64_t*, int64_t, int*) nogil
inline void kh_del_uint64(kh_uint64_t*, khint_t) nogil
kh_uint64_t* kh_init_uint64() nogil
void kh_destroy_uint64(kh_uint64_t*) nogil
void kh_clear_uint64(kh_uint64_t*) nogil
khint_t kh_get_uint64(kh_uint64_t*, int64_t) nogil
void kh_resize_uint64(kh_uint64_t*, khint_t) nogil
khint_t kh_put_uint64(kh_uint64_t*, int64_t, int*) nogil
void kh_del_uint64(kh_uint64_t*, khint_t) nogil

bint kh_exist_uint64(kh_uint64_t*, khiter_t) nogil

Expand All @@ -95,13 +95,13 @@ cdef extern from "khash_python.h":
float64_t *keys
size_t *vals

inline kh_float64_t* kh_init_float64() nogil
inline void kh_destroy_float64(kh_float64_t*) nogil
inline void kh_clear_float64(kh_float64_t*) nogil
inline khint_t kh_get_float64(kh_float64_t*, float64_t) nogil
inline void kh_resize_float64(kh_float64_t*, khint_t) nogil
inline khint_t kh_put_float64(kh_float64_t*, float64_t, int*) nogil
inline void kh_del_float64(kh_float64_t*, khint_t) nogil
kh_float64_t* kh_init_float64() nogil
void kh_destroy_float64(kh_float64_t*) nogil
void kh_clear_float64(kh_float64_t*) nogil
khint_t kh_get_float64(kh_float64_t*, float64_t) nogil
void kh_resize_float64(kh_float64_t*, khint_t) nogil
khint_t kh_put_float64(kh_float64_t*, float64_t, int*) nogil
void kh_del_float64(kh_float64_t*, khint_t) nogil

bint kh_exist_float64(kh_float64_t*, khiter_t) nogil

Expand All @@ -111,13 +111,13 @@ cdef extern from "khash_python.h":
int32_t *keys
size_t *vals

inline kh_int32_t* kh_init_int32() nogil
inline void kh_destroy_int32(kh_int32_t*) nogil
inline void kh_clear_int32(kh_int32_t*) nogil
inline khint_t kh_get_int32(kh_int32_t*, int32_t) nogil
inline void kh_resize_int32(kh_int32_t*, khint_t) nogil
inline khint_t kh_put_int32(kh_int32_t*, int32_t, int*) nogil
inline void kh_del_int32(kh_int32_t*, khint_t) nogil
kh_int32_t* kh_init_int32() nogil
void kh_destroy_int32(kh_int32_t*) nogil
void kh_clear_int32(kh_int32_t*) nogil
khint_t kh_get_int32(kh_int32_t*, int32_t) nogil
void kh_resize_int32(kh_int32_t*, khint_t) nogil
khint_t kh_put_int32(kh_int32_t*, int32_t, int*) nogil
void kh_del_int32(kh_int32_t*, khint_t) nogil

bint kh_exist_int32(kh_int32_t*, khiter_t) nogil

Expand All @@ -129,12 +129,12 @@ cdef extern from "khash_python.h":
kh_cstr_t *keys
PyObject **vals

inline kh_strbox_t* kh_init_strbox() nogil
inline void kh_destroy_strbox(kh_strbox_t*) nogil
inline void kh_clear_strbox(kh_strbox_t*) nogil
inline khint_t kh_get_strbox(kh_strbox_t*, kh_cstr_t) nogil
inline void kh_resize_strbox(kh_strbox_t*, khint_t) nogil
inline khint_t kh_put_strbox(kh_strbox_t*, kh_cstr_t, int*) nogil
inline void kh_del_strbox(kh_strbox_t*, khint_t) nogil
kh_strbox_t* kh_init_strbox() nogil
void kh_destroy_strbox(kh_strbox_t*) nogil
void kh_clear_strbox(kh_strbox_t*) nogil
khint_t kh_get_strbox(kh_strbox_t*, kh_cstr_t) nogil
void kh_resize_strbox(kh_strbox_t*, khint_t) nogil
khint_t kh_put_strbox(kh_strbox_t*, kh_cstr_t, int*) nogil
void kh_del_strbox(kh_strbox_t*, khint_t) nogil

bint kh_exist_strbox(kh_strbox_t*, khiter_t) nogil
10 changes: 5 additions & 5 deletions pandas/_libs/src/skiplist.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ cdef extern from "skiplist.h":
int size
int maxlevels

inline skiplist_t* skiplist_init(int) nogil
inline void skiplist_destroy(skiplist_t*) nogil
inline double skiplist_get(skiplist_t*, int, int*) nogil
inline int skiplist_insert(skiplist_t*, double) nogil
inline int skiplist_remove(skiplist_t*, double) nogil
skiplist_t* skiplist_init(int) nogil
void skiplist_destroy(skiplist_t*) nogil
double skiplist_get(skiplist_t*, int, int*) nogil
int skiplist_insert(skiplist_t*, double) nogil
int skiplist_remove(skiplist_t*, double) nogil

36 changes: 18 additions & 18 deletions pandas/_libs/src/util.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ cimport numpy as cnp
cimport cpython

cdef extern from "numpy_helper.h":
inline void set_array_owndata(ndarray ao)
inline void set_array_not_contiguous(ndarray ao)

inline int is_integer_object(object)
inline int is_float_object(object)
inline int is_complex_object(object)
inline int is_bool_object(object)
inline int is_string_object(object)
inline int is_datetime64_object(object)
inline int is_timedelta64_object(object)
inline int assign_value_1d(ndarray, Py_ssize_t, object) except -1
inline cnp.int64_t get_nat()
inline object get_value_1d(ndarray, Py_ssize_t)
inline int floatify(object, double*) except -1
inline char *get_c_string(object) except NULL
inline object char_to_string(char*)
inline void transfer_object_column(char *dst, char *src, size_t stride,
void set_array_owndata(ndarray ao)
void set_array_not_contiguous(ndarray ao)

int is_integer_object(object)
int is_float_object(object)
int is_complex_object(object)
int is_bool_object(object)
int is_string_object(object)
int is_datetime64_object(object)
int is_timedelta64_object(object)
int assign_value_1d(ndarray, Py_ssize_t, object) except -1
cnp.int64_t get_nat()
object get_value_1d(ndarray, Py_ssize_t)
int floatify(object, double*) except -1
char *get_c_string(object) except NULL
object char_to_string(char*)
void transfer_object_column(char *dst, char *src, size_t stride,
size_t length)
object sarr_from_data(cnp.dtype, int length, void* data)
inline object unbox_if_zerodim(object arr)
object unbox_if_zerodim(object arr)

ctypedef fused numeric:
cnp.int8_t
Expand Down