OSDN Git Service
(root)
/
kde
/
Katie.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
705d365
)
replace inline if with switch in QColormap::size() statement
author
Ivailo Monev
<xakepa10@laimg.moc>
Wed, 25 Mar 2020 18:51:28 +0000
(18:51 +0000)
committer
Ivailo Monev
<xakepa10@laimg.moc>
Wed, 25 Mar 2020 21:05:33 +0000
(21:05 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
src/gui/painting/qcolormap_x11.cpp
patch
|
blob
|
history
diff --git
a/src/gui/painting/qcolormap_x11.cpp
b/src/gui/painting/qcolormap_x11.cpp
index
752c3ac
..
4ede583
100644
(file)
--- a/
src/gui/painting/qcolormap_x11.cpp
+++ b/
src/gui/painting/qcolormap_x11.cpp
@@
-599,11
+599,15
@@
int QColormap::depth() const
int QColormap::size() const
{
- return (d->mode == Gray
- ? d->r_max
- : (d->mode == Indexed
- ? d->r_max * d->g_max * d->b_max
- : -1));
+ switch (d->mode) {
+ case Gray:
+ return d->r_max;
+ case Indexed:
+ return d->r_max * d->g_max * d->b_max;
+ case Direct:
+ return -1;
+ }
+ Q_UNREACHABLE();
}
uint QColormap::pixel(const QColor &color) const