Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c2b9017b authored by Colin Cross's avatar Colin Cross
Browse files

Rewrite multicharacter constant using constexpr

Multi character constants are implementation defined behavior, use a
constexpr instead.  The warnings were being hidden by the use of
-isystem to include frameworks/native/include.

Bug: 31752268
Test: m -j
Change-Id: I22435d1f66a073c303202da7a1940cb14b0b9fd8
parent dfd19516
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -35,13 +35,19 @@ namespace android {
class BitTube;
class IDisplayEventConnection;

// ----------------------------------------------------------------------------
static inline constexpr uint32_t fourcc(char c1, char c2, char c3, char c4) {
    return static_cast<uint32_t>(c1) << 24 |
        static_cast<uint32_t>(c2) << 16 |
        static_cast<uint32_t>(c3) << 8 |
        static_cast<uint32_t>(c4);
}

// ----------------------------------------------------------------------------
class DisplayEventReceiver {
public:
    enum {
        DISPLAY_EVENT_VSYNC = 'vsyn',
        DISPLAY_EVENT_HOTPLUG = 'plug'
        DISPLAY_EVENT_VSYNC = fourcc('v', 's', 'y', 'n'),
        DISPLAY_EVENT_HOTPLUG = fourcc('p', 'l', 'u', 'g'),
    };

    struct Event {