Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 15aa08f3 authored by Frederik Gladhorn's avatar Frederik Gladhorn

Let edidDecodeFraction return float

Summary:
All uses of the function are QQuaternion setters which take floats.
This saves a bunch of conversions and should thus be faster. The edid
test shows that the result is unchanged in all digits.

Reviewers: romangg

Reviewed By: romangg

Subscribers: romangg, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D14368
parent b80bbeb2
......@@ -76,7 +76,7 @@ class Q_DECL_HIDDEN Edid::Private
bool parse(const QByteArray &data);
int edidGetBit(int in, int bit) const;
int edidGetBits(int in, int begin, int end) const;
double edidDecodeFraction(int high, int low) const;
float edidDecodeFraction(int high, int low) const;
QString edidParseString(const quint8 *data) const;
bool valid;
......@@ -392,13 +392,12 @@ int Edid::Private::edidGetBits(int in, int begin, int end) const
return (in >> begin) & mask;
}
double Edid::Private::edidDecodeFraction(int high, int low) const
float Edid::Private::edidDecodeFraction(int high, int low) const
{
double result = 0.0;
int i;
float result = 0.0;
high = (high << 2) | low;
for (i = 0; i < 10; ++i) {
for (int i = 0; i < 10; ++i) {
result += edidGetBit(high, i) * pow(2, i - 10);
}
return result;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment