diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2014-01-10 17:02:52 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2014-01-10 17:02:52 +0000 |
commit | 5d98b16ffba25edb23be14624f35b0cf5de77566 (patch) | |
tree | c81770ef3c96a8bf4d565ebef5198c67c94af6b5 /src/select/propget.h | |
parent | 54fa7907e366846ce1b79d8249f57d3f0b319736 (diff) | |
download | libcss-5d98b16ffba25edb23be14624f35b0cf5de77566.tar.gz libcss-5d98b16ffba25edb23be14624f35b0cf5de77566.tar.bz2 |
Remove implementation duplication in top/right/bottom/left property getters.
Diffstat (limited to 'src/select/propget.h')
-rw-r--r-- | src/select/propget.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/select/propget.h b/src/select/propget.h index b2cf16b..7fff136 100644 --- a/src/select/propget.h +++ b/src/select/propget.h @@ -603,6 +603,16 @@ static inline uint8_t get_top( return (bits & 0x3); } +static inline uint8_t get_top_bits( + const css_computed_style *style) +{ + uint8_t bits = style->bits[TOP_INDEX]; + bits &= TOP_MASK; + bits >>= TOP_SHIFT; + + /* 6bits: uuuutt : units | type */ + return bits; +} #undef TOP_MASK #undef TOP_SHIFT #undef TOP_INDEX @@ -626,6 +636,16 @@ static inline uint8_t get_right( return (bits & 0x3); } +static inline uint8_t get_right_bits( + const css_computed_style *style) +{ + uint8_t bits = style->bits[RIGHT_INDEX]; + bits &= RIGHT_MASK; + bits >>= RIGHT_SHIFT; + + /* 6bits: uuuutt : units | type */ + return bits; +} #undef RIGHT_MASK #undef RIGHT_SHIFT #undef RIGHT_INDEX @@ -649,6 +669,16 @@ static inline uint8_t get_bottom( return (bits & 0x3); } +static inline uint8_t get_bottom_bits( + const css_computed_style *style) +{ + uint8_t bits = style->bits[BOTTOM_INDEX]; + bits &= BOTTOM_MASK; + bits >>= BOTTOM_SHIFT; + + /* 6bits: uuuutt : units | type */ + return bits; +} #undef BOTTOM_MASK #undef BOTTOM_SHIFT #undef BOTTOM_INDEX @@ -672,6 +702,16 @@ static inline uint8_t get_left( return (bits & 0x3); } +static inline uint8_t get_left_bits( + const css_computed_style *style) +{ + uint8_t bits = style->bits[LEFT_INDEX]; + bits &= LEFT_MASK; + bits >>= LEFT_SHIFT; + + /* 6bits: uuuutt : units | type */ + return bits; +} #undef LEFT_MASK #undef LEFT_SHIFT #undef LEFT_INDEX |