Fix types, improve readability
ClosedPublic

Authored by gladhorn on Jul 12 2018, 3:58 PM.

Details

Reviewers
None
Group Reviewers
Plasma
Commits
R110:20c88fd906dd: Fix types, improve readability
Summary

These changes don't matter in the big picture but hopefully make the code easier to read.
Save a few bits by using the right types.

Diff Detail

Repository
R110 KScreen Library
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 788
Build 801: arc lint + arc unit
gladhorn created this revision.Jul 12 2018, 3:58 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJul 12 2018, 3:58 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
gladhorn requested review of this revision.Jul 12 2018, 3:58 PM

I dont really have a strong opinion on this one

backends/xcbeventlistener.cpp
151

I prefer to keep * and & even for when using auto

gladhorn updated this revision to Diff 37724.Jul 14 2018, 5:58 AM

Added * to auto pointers

zzag added a subscriber: zzag.Jul 14 2018, 7:45 AM
zzag added inline comments.
backends/xcbeventlistener.cpp
135

auto *e

151

Also, keeping * in some cases matter. For example,

int x = 42;

const auto foo = &x; // foo has type of int* const
*foo = 43; // totally fine

const auto *bar = &x; // bar has type of const int*
*bar = 43; // compilation error
gladhorn updated this revision to Diff 37736.Jul 14 2018, 10:58 AM

Fixed placement of *

This revision was not accepted when it landed; it landed in state Needs Review.Jul 15 2018, 7:19 PM
This revision was automatically updated to reflect the committed changes.