linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anderson Lizardo <anderson.lizardo@openbossa.org>
To: linux-bluetooth@vger.kernel.org
Cc: Anderson Lizardo <anderson.lizardo@openbossa.org>
Subject: [PATCH BlueZ 2/2] core: Avoid unnecessary gboolean on pincode callback API
Date: Tue, 21 May 2013 09:06:44 -0400	[thread overview]
Message-ID: <1369141604-1129-2-git-send-email-anderson.lizardo@openbossa.org> (raw)
In-Reply-To: <1369141604-1129-1-git-send-email-anderson.lizardo@openbossa.org>

Use standard "bool" type instead. Callers in plugins/* are fixed on the
same commit to avoid compilation errors.
---
 plugins/autopair.c |    8 ++++----
 plugins/wiimote.c  |    3 ++-
 src/adapter.c      |    5 ++---
 src/adapter.h      |    2 +-
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/plugins/autopair.c b/plugins/autopair.c
index 5aa80df..e6e5035 100644
--- a/plugins/autopair.c
+++ b/plugins/autopair.c
@@ -51,9 +51,9 @@
  */
 
 static ssize_t autopair_pincb(struct btd_adapter *adapter,
-					struct btd_device *device,
-					char *pinbuf, gboolean *display,
-					unsigned int attempt)
+						struct btd_device *device,
+						char *pinbuf, bool *display,
+						unsigned int attempt)
 {
 	char addr[18];
 	char pinstr[7];
@@ -109,7 +109,7 @@ static ssize_t autopair_pincb(struct btd_adapter *adapter,
 
 			snprintf(pinstr, sizeof(pinstr), "%06d",
 						rand() % 1000000);
-			*display = TRUE;
+			*display = true;
 			memcpy(pinbuf, pinstr, 6);
 			return 6;
 
diff --git a/plugins/wiimote.c b/plugins/wiimote.c
index 12312b6..beda307 100644
--- a/plugins/wiimote.c
+++ b/plugins/wiimote.c
@@ -70,7 +70,8 @@ static const char *wii_names[] = {
 };
 
 static ssize_t wii_pincb(struct btd_adapter *adapter, struct btd_device *device,
-			char *pinbuf, gboolean *display, unsigned int attempt)
+						char *pinbuf, bool *display,
+						unsigned int attempt)
 {
 	uint16_t vendor, product;
 	char addr[18], name[25];
diff --git a/src/adapter.c b/src/adapter.c
index adb2a17..73e75a2 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -4810,8 +4810,7 @@ static ssize_t btd_adapter_pin_cb_iter_next(
 					struct btd_adapter_pin_cb_iter *iter,
 					struct btd_adapter *adapter,
 					struct btd_device *device,
-					char *pin_buf,
-					gboolean *display)
+					char *pin_buf, bool *display)
 {
 	btd_adapter_pin_cb_t cb;
 	ssize_t ret;
@@ -4836,7 +4835,7 @@ static void pin_code_request_callback(uint16_t index, uint16_t length,
 	const struct mgmt_ev_pin_code_request *ev = param;
 	struct btd_adapter *adapter = user_data;
 	struct btd_device *device;
-	gboolean display = FALSE;
+	bool display = false;
 	char pin[17];
 	ssize_t pinlen;
 	char addr[18];
diff --git a/src/adapter.h b/src/adapter.h
index 2de8730..32b12c0 100644
--- a/src/adapter.h
+++ b/src/adapter.h
@@ -132,7 +132,7 @@ int btd_cancel_authorization(guint id);
 int btd_adapter_restore_powered(struct btd_adapter *adapter);
 
 typedef ssize_t (*btd_adapter_pin_cb_t) (struct btd_adapter *adapter,
-			struct btd_device *dev, char *out, gboolean *display,
+			struct btd_device *dev, char *out, bool *display,
 							unsigned int attempt);
 void btd_adapter_register_pin_cb(struct btd_adapter *adapter,
 						btd_adapter_pin_cb_t cb);
-- 
1.7.9.5


  reply	other threads:[~2013-05-21 13:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-16 16:25 [PATCH BlueZ 1/2] plugins: Use open()/read() instead of fopen()/fread() on autopair Anderson Lizardo
2013-05-16 16:25 ` [PATCH BlueZ 2/2] core: Avoid unnecessary gboolean on pincode callback API Anderson Lizardo
2013-05-17  5:14 ` [PATCH BlueZ 1/2] plugins: Use open()/read() instead of fopen()/fread() on autopair Marcel Holtmann
2013-05-17 11:05   ` Anderson Lizardo
2013-05-17 12:07     ` Luiz Augusto von Dentz
2013-05-17 14:31 ` [PATCH BlueZ v2 " Anderson Lizardo
2013-05-17 14:31   ` [PATCH BlueZ 2/2] core: Avoid unnecessary gboolean on pincode callback API Anderson Lizardo
2013-05-20 23:51   ` [PATCH BlueZ v2 1/2] plugins: Use open()/read() instead of fopen()/fread() on autopair Johan Hedberg
2013-05-21  6:10     ` Marcel Holtmann
2013-05-21 11:02     ` Anderson Lizardo
2013-05-21 13:06 ` [PATCH BlueZ v3 " Anderson Lizardo
2013-05-21 13:06   ` Anderson Lizardo [this message]
2013-05-28 13:25   ` Anderson Lizardo
2013-06-13 14:26     ` Johan Hedberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1369141604-1129-2-git-send-email-anderson.lizardo@openbossa.org \
    --to=anderson.lizardo@openbossa.org \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).