Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix some compiler warnings
  • Loading branch information
pvuorela committed Oct 10, 2016
1 parent 6eff895 commit 5f9af91
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion libssu/ssu.cpp
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion libssu/ssucoreconfig.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions libssu/ssudeviceinfo.cpp
Expand Up @@ -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();

Expand Down
2 changes: 0 additions & 2 deletions libssu/ssufeaturemanager.cpp
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions libssu/ssusettings.cpp
Expand Up @@ -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;

Expand Down
4 changes: 3 additions & 1 deletion libssu/ssuvariables.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
6 changes: 5 additions & 1 deletion ssucli/ssucli.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -585,6 +587,8 @@ void SsuCli::optUpdateCredentials(QStringList opt)

void SsuCli::optUpdateRepos(QStringList opt)
{
Q_UNUSED(opt)

QTextStream qerr(stdout);

QDBusPendingReply<> reply = ssuProxy->updateRepos();
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions tests/tests_common.pri
@@ -1,3 +1,5 @@
CONFIG += c++11

isEmpty(TARGET):error("TARGET must be defined before this file is included")

INCLUDEPATH *= $${PWD}
Expand Down

0 comments on commit 5f9af91

Please sign in to comment.