mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Clean up more unused variables
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
5bf0e48700
commit
d7d8660bbb
6 changed files with 46 additions and 5 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "isocialnetworkintegration.h"
|
||||
|
||||
//Hack for moc.
|
||||
ISocialNetworkIntegration::ISocialNetworkIntegration(QObject* parent)
|
||||
ISocialNetworkIntegration::ISocialNetworkIntegration(QObject* parent) : QObject(parent)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -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 */
|
||||
}
|
||||
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -25,6 +25,7 @@ struct IconMetrics {
|
|||
int sz_pic; // ex 128px
|
||||
// icon spacing
|
||||
int spacing; // ex 2px
|
||||
IconMetrics();
|
||||
};
|
||||
|
||||
const IconMetrics & defaultIconMetrics();
|
||||
|
|
|
@ -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 */
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue