aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-11-07 22:16:30 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-11-07 22:26:33 -0800
commit440423ff6476119e090798ae2d59dc59d5253a0a (patch)
tree5a8c32678056583e0cc7cd06682bc123d0584e33
parentbfe24526d35c47c1229a0711882d4e789fb46731 (diff)
parent829f7a2ee264b4e25e8ea926a98199f8049a23d6 (diff)
downloadsubsurface-440423ff6476119e090798ae2d59dc59d5253a0a.tar.gz
Merge branch 'warnings' of github.com:neolit123/subsurface
-rw-r--r--desktop-widgets/btdeviceselectiondialog.cpp3
-rw-r--r--desktop-widgets/divelogimportdialog.cpp4
-rw-r--r--desktop-widgets/diveshareexportdialog.cpp4
-rw-r--r--desktop-widgets/locationinformation.cpp1
-rw-r--r--desktop-widgets/maintab.cpp2
-rw-r--r--desktop-widgets/mainwindow.cpp2
-rw-r--r--desktop-widgets/plugins/facebook/facebook_integration.cpp2
-rw-r--r--desktop-widgets/preferences/abstractpreferenceswidget.cpp2
-rw-r--r--desktop-widgets/preferences/preferences_network.cpp8
-rw-r--r--desktop-widgets/preferences/preferencesdialog.cpp1
-rw-r--r--desktop-widgets/subsurfacewebservices.cpp2
-rw-r--r--profile-widget/profilewidget2.cpp3
-rw-r--r--qt-models/divelocationmodel.cpp8
-rw-r--r--qt-models/divelocationmodel.h2
-rw-r--r--qt-models/diveplannermodel.cpp4
-rw-r--r--qt-models/filtermodels.cpp4
-rw-r--r--subsurface-core/dive.c1
-rw-r--r--subsurface-core/profile.c9
-rw-r--r--subsurface-desktop-main.cpp1
19 files changed, 29 insertions, 34 deletions
diff --git a/desktop-widgets/btdeviceselectiondialog.cpp b/desktop-widgets/btdeviceselectiondialog.cpp
index fb2cbc1f3..546f50ea3 100644
--- a/desktop-widgets/btdeviceselectiondialog.cpp
+++ b/desktop-widgets/btdeviceselectiondialog.cpp
@@ -52,8 +52,7 @@ BtDeviceSelectionDialog::BtDeviceSelectionDialog(QWidget *parent) :
// Initialize WinSock and ask for version 2.2.
ulRetCode = WSAStartup(MAKEWORD(2, 2), &WSAData);
if (ulRetCode != SUCCESS) {
- QMessageBox::StandardButton warningBox;
- warningBox = QMessageBox::critical(this, "Bluetooth",
+ QMessageBox::critical(this, "Bluetooth",
tr("Could not initialize Winsock version 2.2"), QMessageBox::Ok);
return;
}
diff --git a/desktop-widgets/divelogimportdialog.cpp b/desktop-widgets/divelogimportdialog.cpp
index 025d181d1..5747f3652 100644
--- a/desktop-widgets/divelogimportdialog.cpp
+++ b/desktop-widgets/divelogimportdialog.cpp
@@ -22,7 +22,7 @@ const DiveLogImportDialog::CSVAppConfig DiveLogImportDialog::CSVApps[CSVAPPS] =
{ NULL, }
};
-static enum {
+enum Known {
MANUAL,
APD,
APD2,
@@ -30,7 +30,7 @@ static enum {
SENSUS,
SEABEAR,
SUBSURFACE
-} known;
+};
ColumnNameProvider::ColumnNameProvider(QObject *parent) : QAbstractListModel(parent)
{
diff --git a/desktop-widgets/diveshareexportdialog.cpp b/desktop-widgets/diveshareexportdialog.cpp
index 9fe6eefd6..435f5366e 100644
--- a/desktop-widgets/diveshareexportdialog.cpp
+++ b/desktop-widgets/diveshareexportdialog.cpp
@@ -11,8 +11,8 @@
DiveShareExportDialog::DiveShareExportDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::DiveShareExportDialog),
- reply(NULL),
- exportSelected(false)
+ exportSelected(false),
+ reply(NULL)
{
ui->setupUi(this);
}
diff --git a/desktop-widgets/locationinformation.cpp b/desktop-widgets/locationinformation.cpp
index aee0b7328..ab2235120 100644
--- a/desktop-widgets/locationinformation.cpp
+++ b/desktop-widgets/locationinformation.cpp
@@ -540,7 +540,6 @@ void DiveLocationLineEdit::fixPopupPosition()
{
const QRect screen = QApplication::desktop()->availableGeometry(this);
const int maxVisibleItems = 5;
- Qt::LayoutDirection dir = layoutDirection();
QPoint pos;
int rh, w;
int h = (view->sizeHintForRow(0) * qMin(maxVisibleItems, view->model()->rowCount()) + 3) + 3;
diff --git a/desktop-widgets/maintab.cpp b/desktop-widgets/maintab.cpp
index 864c24782..c36c69f20 100644
--- a/desktop-widgets/maintab.cpp
+++ b/desktop-widgets/maintab.cpp
@@ -1642,6 +1642,6 @@ void MainTab::contextMenuEvent(QContextMenuEvent *event)
popup.addSeparator();
popup.addAction(tr("Delete selected images"), this, SLOT(removeSelectedPhotos()));
popup.addAction(tr("Delete all images"), this, SLOT(removeAllPhotos()));
- QAction *actionTaken = popup.exec(event->globalPos());
+ popup.exec(event->globalPos());
event->accept();
}
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index e1f82fdf1..b9112c11a 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -137,8 +137,6 @@ MainWindow::MainWindow() : QMainWindow(),
connect(diveSiteEdit, &LocationInformationWidget::endEditDiveSite,
mainTab, &MainTab::refreshDisplayedDiveSite);
- QWidget *diveSitePictures = new QWidget(); // Placeholder
-
std::pair<QByteArray, QVariant> enabled = std::make_pair("enabled", QVariant(true));
std::pair<QByteArray, QVariant> disabled = std::make_pair("enabled", QVariant(false));
PropertyList enabledList;
diff --git a/desktop-widgets/plugins/facebook/facebook_integration.cpp b/desktop-widgets/plugins/facebook/facebook_integration.cpp
index e9b2297a0..700c8f624 100644
--- a/desktop-widgets/plugins/facebook/facebook_integration.cpp
+++ b/desktop-widgets/plugins/facebook/facebook_integration.cpp
@@ -7,7 +7,7 @@ FacebookPlugin::FacebookPlugin(QObject* parent): QObject(parent)
bool FacebookPlugin::isConnected()
{
-
+ return false;
}
void FacebookPlugin::requestLogin()
diff --git a/desktop-widgets/preferences/abstractpreferenceswidget.cpp b/desktop-widgets/preferences/abstractpreferenceswidget.cpp
index 9334c74ed..54d2417f9 100644
--- a/desktop-widgets/preferences/abstractpreferenceswidget.cpp
+++ b/desktop-widgets/preferences/abstractpreferenceswidget.cpp
@@ -1,7 +1,7 @@
#include "abstractpreferenceswidget.h"
AbstractPreferencesWidget::AbstractPreferencesWidget(const QString& name, const QIcon& icon, float positionHeight)
-: QWidget(), _name(name), _icon(icon), _positionHeight(positionHeight)
+: QWidget(), _icon(icon), _name(name), _positionHeight(positionHeight)
{
}
diff --git a/desktop-widgets/preferences/preferences_network.cpp b/desktop-widgets/preferences/preferences_network.cpp
index 3780a6c91..d812f4ab1 100644
--- a/desktop-widgets/preferences/preferences_network.cpp
+++ b/desktop-widgets/preferences/preferences_network.cpp
@@ -76,7 +76,7 @@ void PreferencesNetwork::syncSettings()
CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this);
connect(cloudAuth, SIGNAL(finishedAuthenticate()), this, SLOT(cloudPinNeeded()));
connect(cloudAuth, SIGNAL(passwordChangeSuccessful()), this, SLOT(passwordUpdateSuccessfull()));
- QNetworkReply *reply = cloudAuth->backend(email, password, "", newpassword);
+ cloudAuth->backend(email, password, "", newpassword);
ui->cloud_storage_new_passwd->setText("");
free(prefs.cloud_storage_newpassword);
prefs.cloud_storage_newpassword = strdup(qPrintable(newpassword));
@@ -97,7 +97,7 @@ void PreferencesNetwork::syncSettings()
} else {
CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this);
connect(cloudAuth, SIGNAL(finishedAuthenticate()), this, SLOT(cloudPinNeeded()));
- QNetworkReply *reply = cloudAuth->backend(email, password);
+ cloudAuth->backend(email, password);
}
}
} else if (prefs.cloud_verification_status == CS_NEED_TO_VERIFY) {
@@ -110,7 +110,7 @@ void PreferencesNetwork::syncSettings()
}
CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this);
connect(cloudAuth, SIGNAL(finishedAuthenticate()), this, SLOT(cloudPinNeeded()));
- QNetworkReply *reply = cloudAuth->backend(email, password, pin);
+ cloudAuth->backend(email, password, pin);
}
}
SAVE_OR_REMOVE("email", default_prefs.cloud_storage_email, email);
@@ -169,4 +169,4 @@ void PreferencesNetwork::proxyType_changed(int idx)
void PreferencesNetwork::passwordUpdateSuccessfull()
{
ui->cloud_storage_password->setText(prefs.cloud_storage_password);
-} \ No newline at end of file
+}
diff --git a/desktop-widgets/preferences/preferencesdialog.cpp b/desktop-widgets/preferences/preferencesdialog.cpp
index 6f3523c0b..6885469c5 100644
--- a/desktop-widgets/preferences/preferencesdialog.cpp
+++ b/desktop-widgets/preferences/preferencesdialog.cpp
@@ -84,6 +84,7 @@ void PreferencesDialog::buttonClicked(QAbstractButton* btn)
case QDialogButtonBox::AcceptRole : applyRequested(true); return;
case QDialogButtonBox::RejectRole : cancelRequested(); return;
case QDialogButtonBox::ResetRole : defaultsRequested(); return;
+ default: return;
}
}
diff --git a/desktop-widgets/subsurfacewebservices.cpp b/desktop-widgets/subsurfacewebservices.cpp
index ee079cc48..d66d3653b 100644
--- a/desktop-widgets/subsurfacewebservices.cpp
+++ b/desktop-widgets/subsurfacewebservices.cpp
@@ -188,7 +188,6 @@ bool DivelogsDeWebServices::prepare_dives_for_divelogs(const QString &tempfile,
int i;
struct dive *dive;
for_each_dive (i, dive) {
- FILE *f;
char filename[PATH_MAX];
int streamsize;
const char *membuf;
@@ -412,6 +411,7 @@ void SubsurfaceWebServices::buttonClicked(QAbstractButton *button)
struct dive *d;
struct dive_site *ds;
bool changed = false;
+ (void)changed;
clear_table(&gps_location_table);
QByteArray url = tr("Webservice").toLocal8Bit();
parse_xml_buffer(url.data(), downloadedData.data(), downloadedData.length(), &gps_location_table, NULL);
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index 177ceab75..ca9eead95 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -1291,7 +1291,7 @@ void ProfileWidget2::contextMenuEvent(QContextMenuEvent *event)
action->setData(event->globalPos());
if (same_string(current_dc->model, "manually added dive"))
- QAction *editProfileAction = m.addAction(tr("Edit the profile"), this, SIGNAL(editCurrentDive()));
+ m.addAction(tr("Edit the profile"), this, SIGNAL(editCurrentDive()));
if (DiveEventItem *item = dynamic_cast<DiveEventItem *>(sceneItem)) {
action = new QAction(&m);
@@ -1621,7 +1621,6 @@ void ProfileWidget2::repositionDiveHandlers()
{
DivePlannerPointsModel *plannerModel = DivePlannerPointsModel::instance();
// Re-position the user generated dive handlers
- struct gasmix mix, lastmix;
for (int i = 0; i < plannerModel->rowCount(); i++) {
struct divedatapoint datapoint = plannerModel->at(i);
if (datapoint.time == 0) // those are the magic entries for tanks
diff --git a/qt-models/divelocationmodel.cpp b/qt-models/divelocationmodel.cpp
index e7c9aa30d..d185de1fe 100644
--- a/qt-models/divelocationmodel.cpp
+++ b/qt-models/divelocationmodel.cpp
@@ -128,7 +128,7 @@ void LocationInformationModel::update()
endResetModel();
}
-int32_t LocationInformationModel::addDiveSite(const QString& name, timestamp_t divetime, int lon, int lat)
+uint32_t LocationInformationModel::addDiveSite(const QString& name, timestamp_t divetime, int lon, int lat)
{
degrees_t latitude, longitude;
latitude.udeg = lat;
@@ -189,10 +189,10 @@ bool filter_same_gps_cb (QAbstractItemModel *model, int sourceRow, const QModelI
{
int ref_lat = displayed_dive_site.latitude.udeg;
int ref_lon = displayed_dive_site.longitude.udeg;
- int ref_uuid = displayed_dive_site.uuid;
+ uint32_t ref_uuid = displayed_dive_site.uuid;
QSortFilterProxyModel *self = (QSortFilterProxyModel*) model;
- int ds_uuid = self->sourceModel()->index(sourceRow, LocationInformationModel::UUID, parent).data().toInt();
+ uint32_t ds_uuid = self->sourceModel()->index(sourceRow, LocationInformationModel::UUID, parent).data().toUInt();
struct dive_site *ds = get_dive_site_by_uuid(ds_uuid);
if (!ds)
@@ -202,4 +202,4 @@ bool filter_same_gps_cb (QAbstractItemModel *model, int sourceRow, const QModelI
return false;
return (ds->latitude.udeg == ref_lat && ds->longitude.udeg == ref_lon && ds->uuid != ref_uuid);
-} \ No newline at end of file
+}
diff --git a/qt-models/divelocationmodel.h b/qt-models/divelocationmodel.h
index d5b8705ce..f3e9cac1f 100644
--- a/qt-models/divelocationmodel.h
+++ b/qt-models/divelocationmodel.h
@@ -22,7 +22,7 @@ public:
int columnCount(const QModelIndex &parent) const;
int rowCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index = QModelIndex(), int role = Qt::DisplayRole) const;
- int32_t addDiveSite(const QString& name, timestamp_t divetime, int lat = 0, int lon = 0);
+ uint32_t addDiveSite(const QString& name, timestamp_t divetime, int lat = 0, int lon = 0);
bool setData(const QModelIndex &index, const QVariant &value, int role);
bool removeRows(int row, int count, const QModelIndex & parent = QModelIndex());
void setFirstRowTextField(QLineEdit *textField);
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp
index 70a7c6f62..5e2315318 100644
--- a/qt-models/diveplannermodel.cpp
+++ b/qt-models/diveplannermodel.cpp
@@ -691,8 +691,6 @@ divedatapoint DivePlannerPointsModel::at(int row)
void DivePlannerPointsModel::remove(const QModelIndex &index)
{
- int i;
- int rows = rowCount();
if (index.column() != REMOVE || rowCount() == 1)
return;
@@ -707,6 +705,8 @@ void DivePlannerPointsModel::remove(const QModelIndex &index)
* remove method that will pass the first and last index of the
* removed rows, and remove those in a go.
*/
+// int i;
+// int rows = rowCount();
// if (QApplication::keyboardModifiers() & Qt::ControlModifier) {
// beginRemoveRows(QModelIndex(), index.row(), rows - 1);
// for (i = rows - 1; i >= index.row(); i--)
diff --git a/qt-models/filtermodels.cpp b/qt-models/filtermodels.cpp
index f56f4be1c..cbb83d06f 100644
--- a/qt-models/filtermodels.cpp
+++ b/qt-models/filtermodels.cpp
@@ -295,9 +295,9 @@ void LocationFilterModel::repopulate()
MultiFilterSortModel::MultiFilterSortModel(QObject *parent) :
QSortFilterProxyModel(parent),
+ divesDisplayed(0),
justCleared(false),
- curr_dive_site(NULL),
- divesDisplayed(0)
+ curr_dive_site(NULL)
{
}
diff --git a/subsurface-core/dive.c b/subsurface-core/dive.c
index 2ae84ca1e..82012fa25 100644
--- a/subsurface-core/dive.c
+++ b/subsurface-core/dive.c
@@ -2878,7 +2878,6 @@ static struct dive *create_new_copy(struct dive *from)
static void force_fixup_dive(struct dive *d)
{
struct divecomputer *dc = &d->dc;
- int old_maxdepth = dc->maxdepth.mm;
int old_temp = dc->watertemp.mkelvin;
int old_mintemp = d->mintemp.mkelvin;
int old_maxtemp = d->maxtemp.mkelvin;
diff --git a/subsurface-core/profile.c b/subsurface-core/profile.c
index edba51ebd..1969a6fac 100644
--- a/subsurface-core/profile.c
+++ b/subsurface-core/profile.c
@@ -157,6 +157,9 @@ void remember_event(const char *eventname)
evn_used++;
}
+/* UNUSED! */
+static int get_local_sac(struct plot_data *entry1, struct plot_data *entry2, struct dive *dive) __attribute__((unused));
+
/* Get local sac-rate (in ml/min) between entry1 and entry2 */
static int get_local_sac(struct plot_data *entry1, struct plot_data *entry2, struct dive *dive)
{
@@ -720,7 +723,6 @@ static int sac_between(struct dive *dive, struct plot_data *first, struct plot_d
double pressuretime;
pressure_t a, b;
cylinder_t *cyl;
- int duration;
if (first == last)
return 0;
@@ -808,10 +810,7 @@ static void fill_sac(struct dive *dive, struct plot_info *pi, int idx)
static void calculate_sac(struct dive *dive, struct plot_info *pi)
{
- int i = 0, last = 0;
- struct plot_data *last_entry = NULL;
-
- for (i = 0; i < pi->nr; i++)
+ for (int i = 0; i < pi->nr; i++)
fill_sac(dive, pi, i);
}
diff --git a/subsurface-desktop-main.cpp b/subsurface-desktop-main.cpp
index 0a578892b..69fcb572b 100644
--- a/subsurface-desktop-main.cpp
+++ b/subsurface-desktop-main.cpp
@@ -31,6 +31,7 @@ int main(int argc, char **argv)
bool no_filenames = true;
QLoggingCategory::setFilterRules(QStringLiteral("qt.bluetooth* = true"));
QApplication *application = new QApplication(argc, argv);
+ (void)application;
QStringList files;
QStringList importedFiles;
QStringList arguments = QCoreApplication::arguments();