mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Add CodeQL for GitHub code scanning (#1548)
* Create codeql.yml * Addressing codeql findings
This commit is contained in:
@@ -94,8 +94,8 @@ void print_trace()
|
||||
* handler and print_trace functions. */
|
||||
for (int i = 2; i < size; ++i)
|
||||
{
|
||||
std::string line = "\t" + decipher_trace(symbols[i]);
|
||||
Error(log, line.c_str());
|
||||
const std::string line = "\t" + decipher_trace(symbols[i]);
|
||||
Error(log, "%s", line.c_str());
|
||||
}
|
||||
|
||||
free(symbols);
|
||||
@@ -149,8 +149,6 @@ void signal_handler(int signum, siginfo_t * /*info*/, void * /*context*/)
|
||||
default:
|
||||
/* If the signal_handler is hit before the event loop is started,
|
||||
* following call will do nothing. So we queue the call. */
|
||||
|
||||
// QCoreApplication::quit();
|
||||
QMetaObject::invokeMethod(qApp, "quit", Qt::QueuedConnection);
|
||||
|
||||
// Reset signal handler to default (in case this handler is not capable of stopping)
|
||||
|
@@ -59,8 +59,6 @@ namespace JsonUtils {
|
||||
{
|
||||
//remove Comments in data
|
||||
QString cleanData = data;
|
||||
//cleanData .remove(QRegularExpression("([^:]?\\/\\/.*)"));
|
||||
|
||||
QJsonParseError error;
|
||||
doc = QJsonDocument::fromJson(cleanData.toUtf8(), &error);
|
||||
|
||||
@@ -145,7 +143,6 @@ namespace JsonUtils {
|
||||
obj.insert(attribute, resolveRefs(attributeValue.toObject(), obj, log));
|
||||
else
|
||||
{
|
||||
//qDebug() <<"ADD ATTR:VALUE"<<attribute<<attributeValue;
|
||||
obj.insert(attribute, attributeValue);
|
||||
}
|
||||
}
|
||||
|
@@ -125,9 +125,6 @@ Logger::Logger (const QString & name, const QString & subName, LogLevel minLevel
|
||||
|
||||
Logger::~Logger()
|
||||
{
|
||||
//Debug(this, "logger '%s' destroyed", QSTRING_CSTR(_name) );
|
||||
|
||||
|
||||
if (LoggerCount.fetchAndSubOrdered(1) == 0)
|
||||
{
|
||||
#ifndef _WIN32
|
||||
|
@@ -17,7 +17,6 @@ RgbChannelAdjustment::RgbChannelAdjustment(uint8_t adjustR, uint8_t adjustG, uin
|
||||
|
||||
void RgbChannelAdjustment::resetInitialized()
|
||||
{
|
||||
//Debug(_log, "initialize mapping with %d,%d,%d", _adjust[RED], _adjust[GREEN], _adjust[BLUE]);
|
||||
memset(_initialized, false, sizeof(_initialized));
|
||||
}
|
||||
|
||||
|
@@ -61,7 +61,7 @@ int RgbTransform::getBacklightThreshold() const
|
||||
return _backlightThreshold;
|
||||
}
|
||||
|
||||
void RgbTransform::setBacklightThreshold(int backlightThreshold)
|
||||
void RgbTransform::setBacklightThreshold(double backlightThreshold)
|
||||
{
|
||||
_backlightThreshold = backlightThreshold;
|
||||
_sumBrightnessLow = 765.0 * ((qPow(2.0,(_backlightThreshold/100)*2)-1) / 3.0);
|
||||
|
@@ -1,7 +1,7 @@
|
||||
// stdlib includes
|
||||
#include <iterator>
|
||||
#include <algorithm>
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
|
||||
// Utils-Jsonschema includes
|
||||
#include <utils/jsonschema/QJsonSchemaChecker.h>
|
||||
@@ -186,7 +186,14 @@ void QJsonSchemaChecker::checkType(const QJsonValue& value, const QJsonValue& sc
|
||||
else if (type == "integer")
|
||||
{
|
||||
if (value.isDouble()) //check if value type not boolean (true = 1 && false = 0)
|
||||
wrongType = (rint(value.toDouble()) != value.toDouble());
|
||||
{
|
||||
double valueIntegratlPart;
|
||||
double valueFractionalPart = std::modf(value.toDouble(), &valueIntegratlPart);
|
||||
if (valueFractionalPart > std::numeric_limits<double>::epsilon())
|
||||
{
|
||||
wrongType = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
wrongType = true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user