From 5d98b16ffba25edb23be14624f35b0cf5de77566 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Fri, 10 Jan 2014 17:02:52 +0000 Subject: Remove implementation duplication in top/right/bottom/left property getters. --- src/select/propget.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'src/select/propget.h') 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 -- cgit v1.2.3