Move bitCount from utils to GlxBackend
AbandonedPublic

Authored by graesslin on Jul 19 2017, 5:55 PM.

Details

Reviewers
davidedmundson
Group Reviewers
KWin
Plasma
Summary

Make bitCount constexpr

Diff Detail

Branch
bitcount-constexpr
Lint
No Linters Available
Unit
No Unit Test Coverage
graesslin created this revision.Jul 19 2017, 5:55 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJul 19 2017, 5:55 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
davidedmundson requested changes to this revision.Jul 20 2017, 5:59 AM
davidedmundson added a subscriber: davidedmundson.

From what I can tell this achevies nothing. (not that it'll do any harm)

The constexpr specifier declares that it is possible to evaluate the value of the function or variable at compile time.

The only usage currently:

const xcb_render_directformat_t *direct = XRenderUtils::findPictFormatInfo(format);
const int red_bits   = bitCount(direct->red_mask);

There's no way that can be calculated at compile time.

This revision now requires changes to proceed.Jul 20 2017, 5:59 AM
graesslin abandoned this revision.Aug 2 2017, 3:52 PM