mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-24 01:08:10 +02:00
Remove inline from .c files
It is ignored by compilers and hides unused static functions
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
#ifdef ISWINDOWS
|
||||
#include <io.h>
|
||||
#define STDOUT_FILENO 1
|
||||
static inline ssize_t ms_write(int fd, const void* buf, size_t count) { return _write(fd, buf, (unsigned int)count); }
|
||||
static ssize_t ms_write(int fd, const void* buf, size_t count) { return _write(fd, buf, (unsigned int)count); }
|
||||
#define write ms_write
|
||||
#else
|
||||
#include <unistd.h>
|
||||
@@ -24,7 +24,7 @@ static inline ssize_t ms_write(int fd, const void* buf, size_t count) { return _
|
||||
|
||||
#define FIELD(x, which) (((Candidate*)(x))->which)
|
||||
|
||||
static inline bool
|
||||
static bool
|
||||
ensure_space(GlobalData *global, size_t sz) {
|
||||
if (global->output_sz < sz + global->output_pos || !global->output) {
|
||||
size_t before = global->output_sz;
|
||||
@@ -38,7 +38,7 @@ ensure_space(GlobalData *global, size_t sz) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline void
|
||||
static void
|
||||
output_text(GlobalData *global, const text_t *data, size_t sz) {
|
||||
if (ensure_space(global, sz)) {
|
||||
memcpy(global->output + global->output_pos, data, sizeof(text_t) * sz);
|
||||
|
||||
@@ -59,7 +59,7 @@ free_workspace(void *v) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
static bool
|
||||
has_char(text_t *text, len_t sz, text_t ch) {
|
||||
for(len_t i = 0; i < sz; i++) {
|
||||
if(text[i] == ch) return true;
|
||||
@@ -67,7 +67,7 @@ has_char(text_t *text, len_t sz, text_t ch) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline uint8_t
|
||||
static uint8_t
|
||||
level_factor_for(text_t current, text_t last, WorkSpace *w) {
|
||||
text_t lch = LOWERCASE(last);
|
||||
if (has_char(w->level1, w->level1_len, lch)) return 90;
|
||||
@@ -101,7 +101,7 @@ init_workspace(WorkSpace *w, text_t *haystack, len_t haystack_len) {
|
||||
}
|
||||
|
||||
|
||||
static inline bool
|
||||
static bool
|
||||
has_atleast_one_match(WorkSpace *w) {
|
||||
int p = -1;
|
||||
bool found;
|
||||
@@ -118,7 +118,7 @@ has_atleast_one_match(WorkSpace *w) {
|
||||
|
||||
#define POSITION(x) w->positions[x][w->address[x]]
|
||||
|
||||
static inline bool
|
||||
static bool
|
||||
increment_address(WorkSpace *w) {
|
||||
len_t pos = w->needle_len - 1;
|
||||
while(true) {
|
||||
@@ -130,7 +130,7 @@ increment_address(WorkSpace *w) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
static bool
|
||||
address_is_monotonic(WorkSpace *w) {
|
||||
// Check if the character positions pointed to by the current address are monotonic
|
||||
for (len_t i = 1; i < w->needle_len; i++) {
|
||||
@@ -139,7 +139,7 @@ address_is_monotonic(WorkSpace *w) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline double
|
||||
static double
|
||||
calc_score(WorkSpace *w) {
|
||||
double ans = 0;
|
||||
len_t distance, pos;
|
||||
|
||||
Reference in New Issue
Block a user