Open Source Telephony
 help / color / mirror / Atom feed
* [PATCH 1/6] sim: Drop glib use from sim_efli_format
@ 2024-02-13 15:35 Denis Kenzior
  2024-02-13 15:35 ` [PATCH 2/6] smsutil: Move iso639_2_from_language to util Denis Kenzior
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Denis Kenzior @ 2024-02-13 15:35 UTC (permalink / raw)
  To: ofono; +Cc: Denis Kenzior

Change the return signature to use bool instead of gboolean.
Also, change g_ascii_isalpha use to l_ascii_isalpha.
While here, also update array subscripts to follow the coding style,
item M3
---
 src/sim.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/sim.c b/src/sim.c
index 33d00ac9a615..55ff5f448647 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -2155,15 +2155,15 @@ static void sim_efli_read_cb(int ok, int length, int record,
 }
 
 /* Detect whether the file is in EFli format, as opposed to 51.011 EFlp */
-static gboolean sim_efli_format(const unsigned char *ef, int length)
+static bool sim_efli_format(const unsigned char *ef, int length)
 {
 	int i;
 
 	if (length & 1)
-		return FALSE;
+		return false;
 
 	for (i = 0; i < length; i += 2) {
-		if (ef[i] == 0xff && ef[i+1] == 0xff)
+		if (ef[i] == 0xff && ef[i + 1] == 0xff)
 			continue;
 
 		/*
@@ -2171,14 +2171,14 @@ static gboolean sim_efli_format(const unsigned char *ef, int length)
 		 * characters while CB DCS language codes are in ranges
 		 * (0 - 15) or (32 - 47), so the ranges don't overlap
 		 */
-		if (g_ascii_isalpha(ef[i]) == 0)
-			return FALSE;
+		if (l_ascii_isalpha(ef[i]) == 0)
+			return false;
 
-		if (g_ascii_isalpha(ef[i+1]) == 0)
-			return FALSE;
+		if (l_ascii_isalpha(ef[i + 1]) == 0)
+			return false;
 	}
 
-	return TRUE;
+	return true;
 }
 
 static GSList *parse_language_list(const unsigned char *ef, int length)
@@ -2261,7 +2261,7 @@ static void sim_efpl_read_cb(int ok, int length, int record,
 	struct ofono_sim *sim = userdata;
 	const char *path = __ofono_atom_get_path(sim->atom);
 	DBusConnection *conn = ofono_dbus_get_connection();
-	gboolean efli_format = TRUE;
+	bool efli_format = true;
 	GSList *efli = NULL;
 	GSList *efpl = NULL;
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-02-14 16:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-13 15:35 [PATCH 1/6] sim: Drop glib use from sim_efli_format Denis Kenzior
2024-02-13 15:35 ` [PATCH 2/6] smsutil: Move iso639_2_from_language to util Denis Kenzior
2024-02-13 15:35 ` [PATCH 3/6] sim: Move EFli and EFlp parsers to simutil Denis Kenzior
2024-02-13 15:35 ` [PATCH 4/6] unit: Add unit tests for language list parsers Denis Kenzior
2024-02-13 15:35 ` [PATCH 5/6] common: Convert use of g_ascii* to ell Denis Kenzior
2024-02-13 15:35 ` [PATCH 6/6] voicecall: " Denis Kenzior
2024-02-14 16:20 ` [PATCH 1/6] sim: Drop glib use from sim_efli_format patchwork-bot+ofono

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox