Skip to content

Commit e4d4308

Browse files
committed
Make inlines static
1 parent 4be1376 commit e4d4308

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/sonyflake_turbo/machine_ids.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ extern PyType_Spec machine_id_lcg_spec;
1313
void sort_machine_ids(uint16_t *machine_ids, size_t machine_ids_len);
1414
bool has_machine_id_dupes(const uint16_t *machine_ids, size_t machine_ids_len);
1515

16-
inline uint16_t machine_id_lcg(uint32_t x) {
16+
static inline uint16_t machine_id_lcg(uint32_t x) {
1717
return (32309 * x + 13799) % 65536;
1818
}
1919

20-
inline uint16_t machine_id_lcg_atomic(atomic_uint *x) {
20+
static inline uint16_t machine_id_lcg_atomic(atomic_uint *x) {
2121
uint32_t old, new;
2222
do {
2323
old = atomic_load_explicit(x, memory_order_relaxed);

src/sonyflake_turbo/sonyflake.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ const static struct timespec default_start_time = {
2525
.tv_nsec = 0
2626
};
2727

28-
inline sonyflake_time to_sonyflake_time(const struct timespec *ts) {
28+
static inline sonyflake_time to_sonyflake_time(const struct timespec *ts) {
2929
return ts->tv_sec * 100 + ts->tv_nsec / 10000000;
3030
}
3131

32-
inline void from_sonyflake_time(sonyflake_time sf_time, struct timespec *ts) {
32+
static inline void from_sonyflake_time(sonyflake_time sf_time, struct timespec *ts) {
3333
ts->tv_sec = sf_time / 100;
3434
ts->tv_nsec = (sf_time % 100) * 10000000;
3535
}
3636

37-
inline void sub_diff(struct timespec *a, const struct timespec *b) {
37+
static inline void sub_diff(struct timespec *a, const struct timespec *b) {
3838
a->tv_sec -= b->tv_sec;
3939
a->tv_nsec -= b->tv_nsec;
4040

@@ -44,7 +44,7 @@ inline void sub_diff(struct timespec *a, const struct timespec *b) {
4444
}
4545
}
4646

47-
inline uint64_t get_time_to_usleep(const struct timespec *diff) {
47+
static inline uint64_t get_time_to_usleep(const struct timespec *diff) {
4848
return diff->tv_sec * 1000000 + diff->tv_nsec / 1000;
4949
}
5050

0 commit comments

Comments
 (0)