Skip to content

Commit

Permalink
Supress remaining old-style casts we incur from 3rd party headers. Th…
Browse files Browse the repository at this point in the history
…ese should all be system headers but we still get these warnings from macro expansions which is kinda strange...
  • Loading branch information
hacst committed Oct 28, 2015
1 parent 68205b9 commit 1090423
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/mumble/Cert.cpp
Expand Up @@ -552,8 +552,14 @@ QByteArray CertWizard::exportCert(const Settings::KeyPair &kp) {
mem = BIO_new(BIO_s_mem());
i2d_PKCS12_bio(mem, pkcs);
Q_UNUSED(BIO_flush(mem));

#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wold-style-cast"
#endif
size = BIO_get_mem_data(mem, &data);
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

qba = QByteArray(data, static_cast<int>(size));
}
Expand Down
10 changes: 10 additions & 0 deletions src/mumble/GlobalShortcut_unix.cpp
Expand Up @@ -46,6 +46,13 @@ GlobalShortcutEngine *GlobalShortcutEngine::platformInit() {
return new GlobalShortcutX();
}

#if defined(__GNUC__)
// ScreenCount(...) and so on are macros that access the private structure and
// cast their return value using old-style-casts. Hence we suppress these warnings
// for this section of code.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wold-style-cast"
#endif
GlobalShortcutX::GlobalShortcutX() {
iXIopcode = -1;
bRunning = false;
Expand Down Expand Up @@ -122,6 +129,9 @@ GlobalShortcutX::GlobalShortcutX() {
bRunning=true;
start(QThread::TimeCriticalPriority);
}
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

GlobalShortcutX::~GlobalShortcutX() {
bRunning = false;
Expand Down

0 comments on commit 1090423

Please sign in to comment.