From 1a5ec9829a30455b3290608645208a0fe4cfdb20 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Date: Sun, 6 Mar 2016 21:55:15 -0300
Subject: [PATCH 07/10] Silence unused variable warnings

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
---
 subsurface-core/git-access.c | 23 +++++++++++++++++++++++
 subsurface-core/macos.c      | 13 +++++++++----
 subsurface-core/profile.c    |  7 +++++--
 3 files changed, 37 insertions(+), 6 deletions(-)

diff --git a/subsurface-core/git-access.c b/subsurface-core/git-access.c
index 7149180..cdfac6f 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/macos.c b/subsurface-core/macos.c
index 9209c65..8ca2c1c 100644
--- a/subsurface-core/macos.c
+++ b/subsurface-core/macos.c
@@ -15,8 +15,11 @@
 #include <fcntl.h>
 #include <unistd.h>
 
-void subsurface_user_info(struct user_info *)
-{ /* Nothing, let's use libgit2-20 on MacOS */ }
+void subsurface_user_info(struct user_info *info)
+{
+	(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
@@ -39,8 +42,9 @@ void subsurface_OS_pref_setup(void)
 	// nothing
 }
 
-bool subsurface_ignore_font(const char *)
+bool subsurface_ignore_font(const char *font)
 {
+	(void) font;
 	// there are no old default fonts to ignore
 	return false;
 }
@@ -197,8 +201,9 @@ int subsurface_zip_close(struct zip *zip)
 }
 
 /* win32 console */
-void subsurface_console_init(bool)
+void subsurface_console_init(bool dedicated)
 {
+	(void) dedicated;
 	/* NOP */
 }
 
diff --git a/subsurface-core/profile.c b/subsurface-core/profile.c
index 8d5cebd..4d9a844 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 */
 }
 
-- 
2.5.4 (Apple Git-61)

