Skip to content

Commit 0755c64

Browse files
anmyachevvnlitvinov
authored andcommitted
Use PANDAS_INLINE instead of plain "static inline"
1 parent 16b5922 commit 0755c64

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

pandas/_libs/src/klib/khash_python.h

+7-5
Original file line numberDiff line numberDiff line change
@@ -90,33 +90,35 @@ typedef struct {
9090
int starts[256];
9191
} kh_str_starts_t;
9292

93-
inline static kh_str_starts_t* kh_init_str_starts(void) {
93+
typedef kh_str_starts_t* p_kh_str_starts_t;
94+
95+
p_kh_str_starts_t PANDAS_INLINE kh_init_str_starts(void) {
9496
kh_str_starts_t *result = (kh_str_starts_t*)calloc(1, sizeof(kh_str_starts_t));
9597
result->table = kh_init_str();
9698
return result;
9799
}
98100

99-
inline static khint_t kh_put_str_starts_item(kh_str_starts_t* table, char* key, int* ret) {
101+
khint_t PANDAS_INLINE kh_put_str_starts_item(kh_str_starts_t* table, char* key, int* ret) {
100102
khint_t result = kh_put_str(table->table, key, ret);
101103
if (*ret != 0) {
102104
table->starts[(unsigned char)key[0]] = 1;
103105
}
104106
return result;
105107
}
106108

107-
inline static khint_t kh_get_str_starts_item(kh_str_starts_t* table, char* key) {
109+
khint_t PANDAS_INLINE kh_get_str_starts_item(kh_str_starts_t* table, char* key) {
108110
unsigned char ch = *key;
109111
if (table->starts[ch]) {
110112
if (ch == '\0' || kh_get_str(table->table, key) != table->table->n_buckets) return 1;
111113
}
112114
return 0;
113115
}
114116

115-
inline static void kh_destroy_str_starts(kh_str_starts_t* table) {
117+
void PANDAS_INLINE kh_destroy_str_starts(kh_str_starts_t* table) {
116118
kh_destroy_str(table->table);
117119
free(table);
118120
}
119121

120-
inline static void kh_resize_str_starts(kh_str_starts_t* table, khint_t val) {
122+
void PANDAS_INLINE kh_resize_str_starts(kh_str_starts_t* table, khint_t val) {
121123
kh_resize_str(table->table, val);
122124
}

0 commit comments

Comments
 (0)