mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
config: pt_or_px cannot be a union
This commit is contained in:
parent
deaff095c6
commit
dce402ae42
3 changed files with 7 additions and 7 deletions
2
config.c
2
config.c
|
|
@ -410,7 +410,7 @@ str_to_color(const char *s, uint32_t *color, bool allow_alpha,
|
|||
}
|
||||
|
||||
static bool
|
||||
str_to_pt_or_px(const char *s, union pt_or_px *res, struct config *conf,
|
||||
str_to_pt_or_px(const char *s, struct pt_or_px *res, struct config *conf,
|
||||
const char *path, int lineno, const char *section, const char *key)
|
||||
{
|
||||
size_t len = s != NULL ? strlen(s) : 0;
|
||||
|
|
|
|||
10
config.h
10
config.h
|
|
@ -55,7 +55,7 @@ struct config_mouse_binding {
|
|||
};
|
||||
|
||||
/* If px != 0 then px is valid, otherwise pt is valid */
|
||||
union pt_or_px {
|
||||
struct pt_or_px {
|
||||
int16_t px;
|
||||
float pt;
|
||||
};
|
||||
|
|
@ -91,12 +91,12 @@ struct config {
|
|||
config_font_list_t fonts[4];
|
||||
|
||||
/* Custom font metrics (-1 = use real font metrics) */
|
||||
union pt_or_px line_height;
|
||||
union pt_or_px letter_spacing;
|
||||
struct pt_or_px line_height;
|
||||
struct pt_or_px letter_spacing;
|
||||
|
||||
/* Adjusted letter x/y offsets */
|
||||
union pt_or_px horizontal_letter_offset;
|
||||
union pt_or_px vertical_letter_offset;
|
||||
struct pt_or_px horizontal_letter_offset;
|
||||
struct pt_or_px vertical_letter_offset;
|
||||
|
||||
struct {
|
||||
int lines;
|
||||
|
|
|
|||
|
|
@ -610,7 +610,7 @@ err_sem_destroy:
|
|||
|
||||
static int
|
||||
pt_or_px_as_pixels(const struct terminal *term,
|
||||
const union pt_or_px *pt_or_px)
|
||||
const struct pt_or_px *pt_or_px)
|
||||
{
|
||||
return pt_or_px->px == 0
|
||||
? pt_or_px->pt * term->font_dpi / 72
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue