Replace a couple more #defines with inline functions.

My trawl of all the vtable systems in the code spotted a couple of
other function-like macros in passing, which might as well be
rewritten as inline functions too for the same reasons.
This commit is contained in:
Simon Tatham 2019-02-27 19:47:12 +00:00
Родитель 1b4a08a953
Коммит 1db5001260
2 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -330,6 +330,9 @@ struct terminal_tag {
int mouse_paste_clipboard; int mouse_paste_clipboard;
}; };
#define in_utf(term) ((term)->utf || (term)->ucsdata->line_codepage==CP_UTF8) static inline bool in_utf(Terminal *term)
{
return term->utf || term->ucsdata->line_codepage == CP_UTF8;
}
#endif #endif

Просмотреть файл

@ -41,7 +41,11 @@
struct Filename { struct Filename {
char *path; char *path;
}; };
#define f_open(filename, mode, isprivate) ( fopen((filename)->path, (mode)) ) static inline FILE *f_open(const Filename *filename, const char *mode,
bool isprivate)
{
return fopen(filename->path, mode);
}
struct FontSpec { struct FontSpec {
char *name; char *name;