Skip to content

Commit 2a22b5b

Browse files
committed
BUG: remove inlining for some functions to maintain clang compatibility #2188
1 parent 0230bbf commit 2a22b5b

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

pandas/src/numpy_helper.h

+5-13
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,7 @@ char_to_string(char* data) {
136136
#include <errno.h>
137137
#include <float.h>
138138

139-
PANDAS_INLINE double
140-
xstrtod(const char *p, char **q, char decimal, char sci, int skip_trailing);
139+
double xstrtod(const char *p, char **q, char decimal, char sci, int skip_trailing);
141140

142141
int to_double(char *item, double *p_value, char sci, char decimal)
143142
{
@@ -153,7 +152,7 @@ int to_double(char *item, double *p_value, char sci, char decimal)
153152
#define PyBytes_AS_STRING PyString_AS_STRING
154153
#endif
155154

156-
PANDAS_INLINE int floatify(PyObject* str, double *result) {
155+
int floatify(PyObject* str, double *result) {
157156
int status;
158157
char *data;
159158
PyObject* tmp = NULL;
@@ -242,17 +241,11 @@ PANDAS_INLINE int floatify(PyObject* str, double *result) {
242241
// * Commented out the other functions.
243242
//
244243

245-
PANDAS_INLINE void lowercase(char *p) {
246-
for ( ; *p; ++p) *p = tolower(*p);
247-
}
248-
249-
PANDAS_INLINE void uppercase(char *p) {
250-
for ( ; *p; ++p) *p = toupper(*p);
251-
}
252244

253245

254-
PANDAS_INLINE double xstrtod(const char *str, char **endptr, char decimal,
255-
char sci, int skip_trailing)
246+
double
247+
xstrtod(const char *str, char **endptr, char decimal,
248+
char sci, int skip_trailing)
256249
{
257250
double number;
258251
int exponent;
@@ -401,4 +394,3 @@ void set_array_owndata(PyArrayObject *ao) {
401394
// }
402395
// return ap;
403396
// }
404-

pandas/src/util.pxd

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ cdef extern from "numpy_helper.h":
1414
inline int assign_value_1d(ndarray, Py_ssize_t, object) except -1
1515
inline cnp.int64_t get_nat()
1616
inline object get_value_1d(ndarray, Py_ssize_t)
17+
inline int floatify(object, double*) except -1
1718
inline char *get_c_string(object)
18-
inline int floatify(object, double *result) except -1
1919
inline object char_to_string(char*)
2020

2121
cdef inline object get_value_at(ndarray arr, object loc):

0 commit comments

Comments
 (0)