Open Source Telephony
 help / color / mirror / Atom feed
From: =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis <frederic.danis@linux.intel.com>
To: ofono@ofono.org
Subject: [PATCH 2/2] emulator: add support of void parameters in CMER
Date: Thu, 24 Feb 2011 18:16:06 +0100	[thread overview]
Message-ID: <1298567766-17745-3-git-send-email-frederic.danis@linux.intel.com> (raw)
In-Reply-To: <1298567766-17745-1-git-send-email-frederic.danis@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 2519 bytes --]

---
 src/emulator.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/emulator.c b/src/emulator.c
index 9cd3252..20a575f 100644
--- a/src/emulator.c
+++ b/src/emulator.c
@@ -312,7 +312,7 @@ static void cmer_cb(GAtServer *server, GAtServerRequestType type,
 	case G_AT_SERVER_REQUEST_TYPE_SET:
 	{
 		GAtResultIter iter;
-		int mode;
+		int mode = em->events_mode;
 		int ind = em->events_ind;
 		int val;
 
@@ -320,15 +320,15 @@ static void cmer_cb(GAtServer *server, GAtServerRequestType type,
 		g_at_result_iter_next(&iter, "");
 
 		/* mode */
-		if (g_at_result_iter_next_number(&iter, &mode) == FALSE)
+		if (!g_at_result_iter_next_number_default(&iter, mode, &mode))
 			goto fail;
 
 		if (mode != 0 && mode != 3)
 			goto fail;
 
 		/* keyp */
-		if (g_at_result_iter_next_number(&iter, &val) == FALSE) {
-			if (g_at_result_iter_skip_next(&iter) == FALSE)
+		if (!g_at_result_iter_next_number_default(&iter, 0, &val)) {
+			if (!g_at_result_iter_skip_next(&iter))
 				goto done;
 			goto fail;
 		}
@@ -337,8 +337,8 @@ static void cmer_cb(GAtServer *server, GAtServerRequestType type,
 			goto fail;
 
 		/* disp */
-		if (g_at_result_iter_next_number(&iter, &val) == FALSE) {
-			if (g_at_result_iter_skip_next(&iter) == FALSE)
+		if (!g_at_result_iter_next_number_default(&iter, 0, &val)) {
+			if (!g_at_result_iter_skip_next(&iter))
 				goto done;
 			goto fail;
 		}
@@ -347,18 +347,18 @@ static void cmer_cb(GAtServer *server, GAtServerRequestType type,
 			goto fail;
 
 		/* ind */
-		if (g_at_result_iter_next_number(&iter, &ind) == FALSE) {
-			if (g_at_result_iter_skip_next(&iter) == FALSE)
+		if (!g_at_result_iter_next_number_default(&iter, ind, &ind)) {
+			if (!g_at_result_iter_skip_next(&iter))
 				goto done;
 			goto fail;
 		}
 
-		if ((ind != 0) && (ind != 1))
+		if (ind != 0 && ind != 1)
 			goto fail;
 
 		/* bfr */
-		if (g_at_result_iter_next_number(&iter, &val) == FALSE) {
-			if (g_at_result_iter_skip_next(&iter) == FALSE)
+		if (!g_at_result_iter_next_number_default(&iter, 0, &val)) {
+			if (!g_at_result_iter_skip_next(&iter))
 				goto done;
 			goto fail;
 		}
@@ -367,7 +367,7 @@ static void cmer_cb(GAtServer *server, GAtServerRequestType type,
 			goto fail;
 
 		/* check that bfr is last parameter */
-		if (g_at_result_iter_skip_next(&iter) == TRUE)
+		if (g_at_result_iter_skip_next(&iter))
 			goto fail;
 
 done:
-- 
1.7.1


  parent reply	other threads:[~2011-02-24 17:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-24 17:16 [PATCH v2 0/2] add support of void parameters in CMER =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-02-24 17:16 ` [PATCH 1/2] gatchat: add g_at_result_iter_next_number_default API =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-02-24 17:16 ` =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis [this message]
2011-02-24 20:02 ` [PATCH v2 0/2] add support of void parameters in CMER Denis Kenzior
  -- strict thread matches above, loose matches on Subject: below --
2011-02-24 15:46 [PATCH " =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-02-24 15:46 ` [PATCH 2/2] emulator: " =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis

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=1298567766-17745-3-git-send-email-frederic.danis@linux.intel.com \
    --to=frederic.danis@linux.intel.com \
    --cc=ofono@ofono.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