aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@gmail.com>2016-03-06 21:39:19 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-03-07 11:21:44 -0800
commitd7d8660bbb7fd0e5a8f3da6631ec02512f0cb49a (patch)
treed5546bd47da8640c9c285eadd648a8af01bf4377
parent5bf0e48700004c093f9f755d36ae1bec2ebb85d3 (diff)
downloadsubsurface-d7d8660bbb7fd0e5a8f3da6631ec02512f0cb49a.tar.gz
Clean up more unused variables
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--subsurface-core/git-access.c23
-rw-r--r--subsurface-core/isocialnetworkintegration.cpp2
-rw-r--r--subsurface-core/macos.c7
-rw-r--r--subsurface-core/metrics.cpp11
-rw-r--r--subsurface-core/metrics.h1
-rw-r--r--subsurface-core/profile.c7
6 files changed, 46 insertions, 5 deletions
diff --git a/subsurface-core/git-access.c b/subsurface-core/git-access.c
index 71491805c..cdfac6fca 100644
--- a/subsurface-core/git-access.c
+++ b/subsurface-core/git-access.c
@@ -42,6 +42,9 @@ static int update_progress(int percent)
// the checkout_progress_cb doesn't allow canceling of the operation
static void progress_cb(const char *path, size_t completed_steps, size_t total_steps, void *payload)
{
+ (void) path;
+ (void) payload;
+
int percent = 0;
if (total_steps)
percent = 100 * completed_steps / total_steps;
@@ -52,6 +55,8 @@ static void progress_cb(const char *path, size_t completed_steps, size_t total_s
// if the user cancels the dialog this is passed back to libgit2
static int transfer_progress_cb(const git_transfer_progress *stats, void *payload)
{
+ (void) payload;
+
int percent = 0;
if (stats->total_objects)
percent = 80 * stats->received_objects / stats->total_objects;
@@ -62,6 +67,9 @@ static int transfer_progress_cb(const git_transfer_progress *stats, void *payloa
static int push_transfer_progress_cb(unsigned int current, unsigned int total, size_t bytes, void *payload)
{
+ (void) bytes;
+ (void) payload;
+
int percent = 0;
if (total != 0)
percent = 100 * current / total;
@@ -95,6 +103,7 @@ static char *move_local_cache(const char *remote, const char *branch)
static int check_clean(const char *path, unsigned int status, void *payload)
{
+ (void) payload;
status &= ~GIT_STATUS_CURRENT | GIT_STATUS_IGNORED;
if (!status)
return 0;
@@ -159,6 +168,10 @@ int credential_ssh_cb(git_cred **out,
unsigned int allowed_types,
void *payload)
{
+ (void) url;
+ (void) allowed_types;
+ (void) payload;
+
const char *priv_key = format_string("%s/%s", system_default_directory(), "ssrf_remote.key");
const char *passphrase = prefs.cloud_storage_password ? strdup(prefs.cloud_storage_password) : strdup("");
return git_cred_ssh_key_new(out, username_from_url, NULL, priv_key, passphrase);
@@ -170,6 +183,10 @@ int credential_https_cb(git_cred **out,
unsigned int allowed_types,
void *payload)
{
+ (void) url;
+ (void) username_from_url;
+ (void) payload;
+
const char *username = prefs.cloud_storage_email_encoded;
const char *password = prefs.cloud_storage_password ? strdup(prefs.cloud_storage_password) : strdup("");
return git_cred_userpass_plaintext_new(out, username, password);
@@ -178,6 +195,7 @@ int credential_https_cb(git_cred **out,
#define KNOWN_CERT "\xfd\xb8\xf7\x73\x76\xe2\x75\x53\x93\x37\xdc\xfe\x1e\x55\x43\x3d\xf2\x2c\x18\x2c"
int certificate_check_cb(git_cert *cert, int valid, const char *host, void *payload)
{
+ (void) payload;
if (same_string(host, "cloud.subsurface-divelog.org") && cert->cert_type == GIT_CERT_X509) {
SHA_CTX ctx;
unsigned char hash[21];
@@ -198,6 +216,9 @@ int certificate_check_cb(git_cert *cert, int valid, const char *host, void *payl
static int update_remote(git_repository *repo, git_remote *origin, git_reference *local, git_reference *remote, enum remote_transport rt)
{
+ (void) repo;
+ (void) remote;
+
git_push_options opts = GIT_PUSH_OPTIONS_INIT;
git_strarray refspec;
const char *name = git_reference_name(local);
@@ -228,6 +249,7 @@ extern int update_git_checkout(git_repository *repo, git_object *parent, git_tre
static int try_to_git_merge(git_repository *repo, git_reference *local, git_reference *remote, git_oid *base, const git_oid *local_id, const git_oid *remote_id)
{
+ (void) remote;
git_tree *local_tree, *remote_tree, *base_tree;
git_commit *local_commit, *remote_commit, *base_commit;
git_index *merged_index;
@@ -546,6 +568,7 @@ static git_repository *update_local_repo(const char *localdir, const char *remot
static int repository_create_cb(git_repository **out, const char *path, int bare, void *payload)
{
+ (void) payload;
char *proxy_string;
git_config *conf;
diff --git a/subsurface-core/isocialnetworkintegration.cpp b/subsurface-core/isocialnetworkintegration.cpp
index 4a2ccdf71..eb1e82a49 100644
--- a/subsurface-core/isocialnetworkintegration.cpp
+++ b/subsurface-core/isocialnetworkintegration.cpp
@@ -1,6 +1,6 @@
#include "isocialnetworkintegration.h"
//Hack for moc.
-ISocialNetworkIntegration::ISocialNetworkIntegration(QObject* parent)
+ISocialNetworkIntegration::ISocialNetworkIntegration(QObject* parent) : QObject(parent)
{
}
diff --git a/subsurface-core/macos.c b/subsurface-core/macos.c
index fdfcebbde..8ca2c1c6f 100644
--- a/subsurface-core/macos.c
+++ b/subsurface-core/macos.c
@@ -16,7 +16,10 @@
#include <unistd.h>
void subsurface_user_info(struct user_info *info)
-{ /* Nothing, let's use libgit2-20 on MacOS */ }
+{
+ (void) info;
+ /* Nothing, let's use libgit2-20 on MacOS */
+}
/* macos defines CFSTR to create a CFString object from a constant,
* but no similar macros if a C string variable is supposed to be
@@ -41,6 +44,7 @@ void subsurface_OS_pref_setup(void)
bool subsurface_ignore_font(const char *font)
{
+ (void) font;
// there are no old default fonts to ignore
return false;
}
@@ -199,6 +203,7 @@ int subsurface_zip_close(struct zip *zip)
/* win32 console */
void subsurface_console_init(bool dedicated)
{
+ (void) dedicated;
/* NOP */
}
diff --git a/subsurface-core/metrics.cpp b/subsurface-core/metrics.cpp
index 203c2e5e2..db636794d 100644
--- a/subsurface-core/metrics.cpp
+++ b/subsurface-core/metrics.cpp
@@ -8,7 +8,16 @@
#include "metrics.h"
-static IconMetrics dfltIconMetrics = { -1 };
+static IconMetrics dfltIconMetrics;
+
+IconMetrics::IconMetrics() :
+ sz_small(-1),
+ sz_med(-1),
+ sz_big(-1),
+ sz_pic(-1),
+ spacing(-1)
+{
+}
QFont defaultModelFont()
{
diff --git a/subsurface-core/metrics.h b/subsurface-core/metrics.h
index 30295a3d8..03d6b22e2 100644
--- a/subsurface-core/metrics.h
+++ b/subsurface-core/metrics.h
@@ -25,6 +25,7 @@ struct IconMetrics {
int sz_pic; // ex 128px
// icon spacing
int spacing; // ex 2px
+ IconMetrics();
};
const IconMetrics & defaultIconMetrics();
diff --git a/subsurface-core/profile.c b/subsurface-core/profile.c
index 8d5cebdba..4d9a8444f 100644
--- a/subsurface-core/profile.c
+++ b/subsurface-core/profile.c
@@ -442,7 +442,7 @@ static void check_setpoint_events(struct dive *dive, struct divecomputer *dc, st
{
int i = 0;
pressure_t setpoint;
-
+ (void) dive;
setpoint.mbar = 0;
struct event *ev = get_next_event(dc->events, "SP change");
@@ -557,11 +557,12 @@ struct plot_info calculate_max_limits_new(struct dive *dive, struct divecomputer
struct plot_data *populate_plot_entries(struct dive *dive, struct divecomputer *dc, struct plot_info *pi)
{
+
int idx, maxtime, nr, i;
int lastdepth, lasttime, lasttemp = 0;
struct plot_data *plot_data;
struct event *ev = dc->events;
-
+ (void) dive;
maxtime = pi->maxtime;
/*
@@ -821,6 +822,8 @@ static void calculate_sac(struct dive *dive, struct plot_info *pi)
static void populate_secondary_sensor_data(struct divecomputer *dc, struct plot_info *pi)
{
+ (void) dc;
+ (void) pi;
/* We should try to see if it has interesting pressure data here */
}