Fix some compiler warnings

This commit is contained in:
Thorvald Natvig 2011-05-15 15:31:12 -07:00
parent b99c639be2
commit f57f81248f
15 changed files with 32 additions and 25 deletions

View File

@ -476,7 +476,7 @@ void AudioInput::addEcho(const void *data, unsigned int nsamp) {
}
}
bool AudioInput::preferCELT(int bitrate, int frames) {
bool AudioInput::preferCELT(int, int) {
return true;
}

View File

@ -455,7 +455,7 @@ Settings::KeyPair CertWizard::importCert(QByteArray data, const QString &pw) {
int ret = 0;
mem = BIO_new_mem_buf(data.data(), data.size());
BIO_set_close(mem, BIO_NOCLOSE);
Q_UNUSED(BIO_set_close(mem, BIO_NOCLOSE));
pkcs = d2i_PKCS12_bio(mem, NULL);
if (pkcs) {
ret = PKCS12_parse(pkcs, NULL, &pkey, &x509, &certs);
@ -580,7 +580,7 @@ QByteArray CertWizard::exportCert(const Settings::KeyPair &kp) {
long size;
mem = BIO_new(BIO_s_mem());
i2d_PKCS12_bio(mem, pkcs);
BIO_flush(mem);
Q_UNUSED(BIO_flush(mem));
size = BIO_get_mem_data(mem, &data);

View File

@ -41,13 +41,13 @@ QReadWriteLock ClientUser::c_qrwlTalking;
ClientUser::ClientUser(QObject *p) : QObject(p),
tsState(Settings::Passive),
tLastTalkStateChange(false),
bLocalMute(false),
fPowerMin(0.0f),
fPowerMax(0.0f),
fAverageAvailable(0.0f),
iFrames(0),
iSequence(0),
tLastTalkStateChange(false) {
iSequence(0) {
}
ClientUser *ClientUser::get(unsigned int uiSession) {
@ -300,7 +300,7 @@ bool ClientUser::isActive() {
if (!tLastTalkStateChange.isStarted())
return false;
return tLastTalkStateChange.elapsed() < g.s.os.iActiveTime * 1000000;
return tLastTalkStateChange.elapsed() < g.s.os.uiActiveTime * 1000000U;
}
/* From Channel.h

View File

@ -69,7 +69,7 @@ class ClientUser : public QObject, public User {
/*! Determines whether a user is active or not
* A user is active when it is currently speaking or when the user has
* spoken within Settings::iActiveTime amount of seconds.
* spoken within Settings::uiActiveTime amount of seconds.
*/
bool isActive();

View File

@ -1486,7 +1486,7 @@ void ConnectDialog::udpReply() {
}
}
void ConnectDialog::fetched(QByteArray data, QUrl url, QMap<QString, QString> headers) {
void ConnectDialog::fetched(QByteArray data, QUrl, QMap<QString, QString> headers) {
if (data.isNull()) {
QMessageBox::warning(this, QLatin1String("Mumble"), tr("Failed to fetch server list"), QMessageBox::Ok);
return;

View File

@ -1767,7 +1767,7 @@ void MainWindow::updateMenuPermissions() {
c = pmModel->getChannel(qtvUsers->currentIndex());
}
ChanACL::Permissions p = static_cast<ChanACL::Permissions>(c ? c->uiPermissions : ChanACL::None);
ChanACL::Permissions p = c ? static_cast<ChanACL::Permissions>(c->uiPermissions) : ChanACL::None;
if (c && ! p) {
g.sh->requestChannelPermissions(c->iId);
@ -1780,7 +1780,7 @@ void MainWindow::updateMenuPermissions() {
}
Channel *cparent = c ? c->cParent : NULL;
ChanACL::Permissions pparent = static_cast<ChanACL::Permissions>(cparent ? cparent->uiPermissions : ChanACL::None);
ChanACL::Permissions pparent = cparent ? static_cast<ChanACL::Permissions>(cparent->uiPermissions) : ChanACL::None;
if (cparent && ! pparent) {
g.sh->requestChannelPermissions(cparent->iId);
@ -1794,7 +1794,7 @@ void MainWindow::updateMenuPermissions() {
ClientUser *user = g.uiSession ? ClientUser::get(g.uiSession) : NULL;
Channel *homec = user ? user->cChannel : NULL;
ChanACL::Permissions homep = static_cast<ChanACL::Permissions>(homec ? homec->uiPermissions : ChanACL::None);
ChanACL::Permissions homep = homec ? static_cast<ChanACL::Permissions>(homec->uiPermissions) : ChanACL::None;
if (homec && ! homep) {
g.sh->requestChannelPermissions(homec->iId);

View File

@ -700,7 +700,7 @@ void MainWindow::msgPermissionQuery(const MumbleProto::PermissionQuery &msg) {
c->uiPermissions = 0;
// We always need the permissions of the current focus channel
if (current && current->iId != msg.channel_id()) {
if (current && current->iId != static_cast<int>(msg.channel_id())) {
g.sh->requestChannelPermissions(current->iId);
current->uiPermissions = ChanACL::All;

View File

@ -355,7 +355,11 @@ void OSSOutput::run() {
} else {
while (! mix(mbuffer, iOutputBlock) && bRunning)
this->msleep(20);
write(fd, mbuffer, blocklen);
ssize_t l = write(fd, mbuffer, blocklen);
if (l != blocklen) {
qWarning("OSSOutput: Write %ld != %ld", l, blocklen);
break;
}
}
}
qWarning("OSSOutput: Releasing device");

View File

@ -200,7 +200,7 @@ void Overlay::verifyTexture(ClientUser *cp, bool allowupdate) {
if (! cp->qbaTexture.isEmpty()) {
bool valid = true;
if (cp->qbaTexture.length() < sizeof(unsigned int)) {
if (cp->qbaTexture.length() < static_cast<int>(sizeof(unsigned int))) {
valid = false;
} else if (qFromBigEndian<unsigned int>(reinterpret_cast<const unsigned char *>(cp->qbaTexture.constData())) == 600 * 60 * 4) {
QByteArray qba = qUncompress(cp->qbaTexture);

View File

@ -377,14 +377,14 @@ void OverlayClient::scheduleDelete() {
void OverlayClient::readyRead() {
while (1) {
int ready = qlsSocket->bytesAvailable();
unsigned int ready = qlsSocket->bytesAvailable();
if (omMsg.omh.iLength == -1) {
if (ready < sizeof(OverlayMsgHeader))
break;
else {
qlsSocket->read(omMsg.headerbuffer, sizeof(OverlayMsgHeader));
if ((omMsg.omh.uiMagic != OVERLAY_MAGIC_NUMBER) || (omMsg.omh.iLength < 0) || (omMsg.omh.iLength > sizeof(OverlayMsgShmem))) {
if ((omMsg.omh.uiMagic != OVERLAY_MAGIC_NUMBER) || (omMsg.omh.iLength < 0) || (omMsg.omh.iLength > static_cast<int>(sizeof(OverlayMsgShmem)))) {
disconnect();
return;
}
@ -392,7 +392,7 @@ void OverlayClient::readyRead() {
}
}
if (ready >= omMsg.omh.iLength) {
if (ready >= static_cast<unsigned int>(omMsg.omh.iLength)) {
int length = qlsSocket->read(omMsg.msgbuffer, omMsg.omh.iLength);
if (length != omMsg.omh.iLength) {

View File

@ -466,6 +466,9 @@ void OverlayEditorScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
orig.setBottomRight(orig.topLeft() + sz);
}
break;
case Qt::NoSection:
// Handled above, but this makes the compiler happy.
return;
}
qgriSelected->setRect(orig);

View File

@ -124,7 +124,7 @@ void OverlayUserGroup::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) {
qmShow->addSeparator();
QAction *qaConfigureRecentlyActiveTime = qmShow->addAction(OverlayClient::tr("Configure recently active time (%1 seconds)...").arg(os->iActiveTime));
QAction *qaConfigureRecentlyActiveTime = qmShow->addAction(OverlayClient::tr("Configure recently active time (%1 seconds)...").arg(os->uiActiveTime));
qaConfigureRecentlyActiveTime->setEnabled(os->osShow == OverlaySettings::Active);
QMenu *qmColumns = qm.addMenu(OverlayClient::tr("Columns"));
@ -191,9 +191,9 @@ void OverlayUserGroup::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) {
qm.parentWidget(),
OverlayClient::tr("Configure recently active time"),
OverlayClient::tr("Amount of seconds users remain active after talking:"),
os->iActiveTime, 1, 2147483647, 1, &ok);
os->uiActiveTime, 1, 2147483647, 1, &ok);
if (ok) {
os->iActiveTime = newValue;
os->uiActiveTime = newValue;
}
updateUsers();
} else if (act == qaSortAlphabetically) {

View File

@ -128,7 +128,7 @@ OverlaySettings::OverlaySettings() {
osShow = LinkedChannels;
bAlwaysSelf = true;
iActiveTime = 5;
uiActiveTime = 5;
osSort = Alphabetical;
qcUserName[Settings::Passive] = QColor(170, 170, 170);
@ -451,7 +451,7 @@ void OverlaySettings::load(QSettings* settings_ptr) {
LOADENUM(osShow, "show");
SAVELOAD(bAlwaysSelf, "alwaysself");
SAVELOAD(iActiveTime, "activetime");
SAVELOAD(uiActiveTime, "activetime");
LOADENUM(osSort, "sort");
SAVELOAD(fX, "x");
@ -712,7 +712,7 @@ void OverlaySettings::save(QSettings* settings_ptr) {
SAVELOAD(osShow, "show");
SAVELOAD(bAlwaysSelf, "alwaysself");
SAVELOAD(iActiveTime, "activetime");
SAVELOAD(uiActiveTime, "activetime");
SAVELOAD(osSort, "sort");
SAVELOAD(fX, "x");
SAVELOAD(fY, "y");

View File

@ -86,7 +86,7 @@ struct OverlaySettings {
OverlayShow osShow;
bool bAlwaysSelf;
int iActiveTime; // Time in seconds for a user to stay active after talking
int uiActiveTime; // Time in seconds for a user to stay active after talking
OverlaySort osSort;
float fX;

View File

@ -73,7 +73,7 @@ VersionCheck::VersionCheck(bool autocheck, QObject *p, bool focus) : QObject(p)
WebFetch::fetch(url, this, SLOT(fetched(QByteArray,QUrl)));
}
void VersionCheck::fetched(QByteArray a, QUrl url) {
void VersionCheck::fetched(QByteArray a, QUrl) {
if (! a.isNull()) {
if (! a.isEmpty()) {
#ifdef SNAPSHOT_BUILD