[PATCH 1/4] plugins/policy: Fix clang compile error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch fixes the following error when bluez is compiled with clang:

plugins/policy.c:780:6: error: cast from 'int *' to 'size_t *' (aka 'unsigned long *') increases required alignment from 4 to 8 [-Werror,-Wcast-align]
(size_t *) &reconnect_intervals_len,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
 plugins/policy.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/plugins/policy.c b/plugins/policy.c
index 8098689..7687203 100644
--- a/plugins/policy.c
+++ b/plugins/policy.c
@@ -61,19 +61,19 @@ struct reconnect_data {
 	GSList *services;
 	guint timer;
 	bool active;
-	int attempt;
+	unsigned int attempt;
 };
 
 static const char *default_reconnect[] = {
 			HSP_AG_UUID, HFP_AG_UUID, A2DP_SOURCE_UUID, NULL };
 static char **reconnect_uuids = NULL;
 
-static const int default_attempts = 7;
-static int reconnect_attempts = 0;
+static const size_t default_attempts = 7;
+static size_t reconnect_attempts = 0;
 
 static const int default_intervals[] = { 1, 2, 4, 8, 16, 32, 64 };
 static int *reconnect_intervals = NULL;
-static int reconnect_intervals_len = 0;
+static size_t reconnect_intervals_len = 0;
 
 static GSList *reconnects = NULL;
 
-- 
2.2.0.rc0.207.ga3a616c

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux