Commit 7a677eda authored by Fabian Kosmale's avatar Fabian Kosmale
Browse files

fix build warnings, remove obsolete if causing undefined behaviour

parent 20c2da86
......@@ -19,6 +19,7 @@ configure_file(
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}")
add_definitions(-Wall -Werror)
include_directories(BEFORE SYSTEM
${QT_INCLUDES}
......
......@@ -74,17 +74,17 @@ QString ProgressBar::line() //FIXME: Make all the magic numbers here variables
int maxToBeUsed = hashlen - 8; //- 8 for percentage
if (maxToBeUsed > (length + longDetails.length())) {
if (maxToBeUsed > static_cast<int>(length + longDetails.length())) {
line.append(longDetails);
length += longDetails.length();
} else if (maxToBeUsed > (length + details.length())) {
} else if (maxToBeUsed > static_cast<int>(length + details.length())) {
line.append(details);
length += details.length();
}
line.append(progress);
if (maxToBeUsed > (length + eta.length())) {
if (maxToBeUsed > static_cast<int>(length + eta.length())) {
line.append(eta);
length += eta.length();
}
......
......@@ -143,21 +143,19 @@ void listKeys(gpgme_ctx_t ctx)
gpgme_key_t key;
gpgme_error_t error;
QTextStream err( stderr );
if (!error) {
error = gpgme_op_keylist_start(ctx, "", 0);
QTextStream out(stdout);
while (!error) {
error = gpgme_op_keylist_next(ctx, &key);
if (error) {
break;
}
out << "- " << key->subkeys->keyid << " " << key->uids->name << " " << key->uids->email << endl;
gpgme_key_release(key);
}
error = gpgme_op_keylist_start(ctx, "", 0);
QTextStream out(stdout);
while (!error) {
error = gpgme_op_keylist_next(ctx, &key);
if (error) {
break;
}
out << "- " << key->subkeys->keyid << " " << key->uids->name << " " << key->uids->email << endl;
gpgme_key_release(key);
}
if (gpgme_err_code(error) != GPG_ERR_EOF) {
......@@ -407,4 +405,4 @@ int main(int argc, char **argv)
gpgme_release(ctx);
return 0;
}
\ No newline at end of file
}
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