From: Marcus Fritzsch Date: Tue, 29 Aug 2017 13:01:08 +0000 (+0200) Subject: app: use id_shift of 22, just like in Qt X-Git-Tag: 4.99.1~153 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=staging%2Fwindowmanager.git;a=commitdiff_plain;h=00b37194da1eb8c39710cf9545f00d5f52b40791 app: use id_shift of 22, just like in Qt Signed-off-by: Marcus Fritzsch --- diff --git a/src/app.cpp b/src/app.cpp index 53a1a86..78dc7d9 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -413,7 +413,7 @@ void App::execute_pending() { // | .__/|_| \___/_/\_\_|\___|\__,_| |_____| \_/ \___|_| |_|\__|___/ // |_| void App::surface_created(uint32_t surface_id) { - surface_id &= id_allocator::id_mask; + surface_id >>= id_allocator::id_shift; logdebug("surface_id is %u", surface_id); @@ -423,7 +423,7 @@ void App::surface_created(uint32_t surface_id) { } void App::surface_removed(uint32_t surface_id) { - surface_id &= id_allocator::id_mask; + surface_id >>= id_allocator::id_shift; logdebug("surface_id is %u", surface_id); diff --git a/src/app.hpp b/src/app.hpp index da614a0..2995ca4 100644 --- a/src/app.hpp +++ b/src/app.hpp @@ -42,8 +42,8 @@ struct controller; namespace wm { struct id_allocator { - constexpr static unsigned id_shift = 20; - constexpr static unsigned id_mask = (1 << id_shift) - 1; + constexpr static const unsigned id_shift = 22; + constexpr static const unsigned id_mask = (1 << id_shift) - 1; unsigned next = 1;