Commit 5f9af91c authored by Pekka Vuorela's avatar Pekka Vuorela

Fix some compiler warnings

parent 6eff895e
......@@ -517,7 +517,7 @@ void Ssu::storeAuthorizedKeys(QByteArray data)
int uid_min = getdef_num("UID_MIN", -1);
QString homePath;
if (getuid() >= uid_min) {
if (getuid() >= static_cast<uid_t>(uid_min)) {
homePath = dir.homePath();
} else if (getuid() == 0) {
// place authorized_keys in the default users home when run with uid0
......
......@@ -37,6 +37,9 @@ QPair<QString, QString> SsuCoreConfig::credentials(QString scope)
QString SsuCoreConfig::credentialsScope(QString repoName, bool rndRepo)
{
Q_UNUSED(repoName)
Q_UNUSED(rndRepo)
if (contains("credentials-scope"))
return value("credentials-scope").toString();
else
......@@ -158,7 +161,7 @@ QDBusConnection SsuCoreConfig::userSessionBus()
// For calls from valid UID we assume that they are properly logged in users.
// If they are not the call will fail, but it's their fault.
if (getuid() >= uid_min) {
if (getuid() >= static_cast<uid_t>(uid_min)) {
return QDBusConnection::sessionBus();
} else {
// DBus security policy will prevent this beeing used by callers other
......
......@@ -53,9 +53,9 @@ QString SsuDeviceInfo::adaptationVariables(const QString &adaptationName, QHash<
// - export the entry in the adaptation list as %(adaptation)
// - look up variables for that adaptation, and export matching
// adaptation variable
QRegExp regex("adaptation\\\d*", Qt::CaseSensitive, QRegExp::RegExp2);
QRegExp regex("adaptation\\d*", Qt::CaseSensitive, QRegExp::RegExp2);
if (regex.exactMatch(adaptationName)) {
regex.setPattern("\\\d*");
regex.setPattern("\\d*");
regex.lastIndexIn(adaptationName);
int n = regex.cap().toInt();
......
......@@ -34,8 +34,6 @@ SsuFeatureManager::SsuFeatureManager(): QObject()
QStringList SsuFeatureManager::repos(bool rndRepo, int filter)
{
QStringList r;
QStringList keys;
SsuCoreConfig *settings = SsuCoreConfig::instance();
// @TODO features currently can't be blacklisted, but just ignoring user filter
// is still the best way atm
......
......@@ -46,8 +46,6 @@ void SsuSettings::merge(bool keepOld)
bool skipMerge = true;
SsuLog *ssuLog = SsuLog::instance();
QDirIterator it(settingsd, QDir::AllEntries | QDir::NoDot | QDir::NoDotDot, QDirIterator::FollowSymlinks);
QStringList settingsFiles;
......
......@@ -42,7 +42,7 @@ QString SsuVariables::resolveString(QString pattern, QHash<QString, QString> *va
return "maximum-recursion-level-reached";
}
QRegExp regex("%\\\([^%]*\\\)", Qt::CaseSensitive, QRegExp::RegExp2);
QRegExp regex("%\\([^%]*\\)", Qt::CaseSensitive, QRegExp::RegExp2);
regex.setMinimal(true);
int pos = 0;
......@@ -253,6 +253,8 @@ void SsuVariables::readSection(SsuSettings *settings, QString section,
QVariant SsuVariables::readVariable(SsuSettings *settings, QString section, const QString &key,
int recursionDepth, bool logOverride)
{
Q_UNUSED(logOverride)
QVariant value;
if (recursionDepth >= SSU_MAX_RECURSION) {
......
......@@ -529,6 +529,8 @@ void SsuCli::optSet(QStringList opt)
void SsuCli::optStatus(QStringList opt)
{
Q_UNUSED(opt)
QTextStream qout(stdout);
QTextStream qerr(stderr);
SsuDeviceInfo deviceInfo;
......@@ -585,6 +587,8 @@ void SsuCli::optUpdateCredentials(QStringList opt)
void SsuCli::optUpdateRepos(QStringList opt)
{
Q_UNUSED(opt)
QTextStream qerr(stdout);
QDBusPendingReply<> reply = ssuProxy->updateRepos();
......@@ -647,7 +651,7 @@ void SsuCli::run()
bool found = false;
int argc = arguments.count() - 2;
for (int i = 0; i < sizeof(handlers) / sizeof(handlers[0]); i++) {
for (unsigned int i = 0; i < sizeof(handlers) / sizeof(handlers[0]); i++) {
if ((arguments.at(1) != handlers[i].longopt) &&
(arguments.at(1) != handlers[i].shortopt)) {
continue;
......
CONFIG += c++11
isEmpty(TARGET):error("TARGET must be defined before this file is included")
INCLUDEPATH *= $${PWD}
......
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