summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Röjfors <richard@puffinpack.se>2020-12-20 11:18:27 +0000
committerDenis Kenzior <denkenz@gmail.com>2020-12-22 09:45:05 -0600
commit429a5a57dadfe4dabd366ad89461f1c5cde300d5 (patch)
tree30cda00b02fdabe090178cbfed60457ad9f3c629
parent66cd5df5d754ffa30f4d9a189d62c71658fb86b0 (diff)
downloadofono-429a5a57dadfe4dabd366ad89461f1c5cde300d5.tar.gz
util: Fix implicit enum conversion
GCC10 complains about the following: src/smsutil.c: In function ‘sms_text_prepare_with_alphabet’: src/smsutil.c:3594:8: error: implicit conversion from ‘enum sms_alphabet’ to ‘enum gsm_dialect’ [-Werror=enum-conversion] 3594 | alphabet, &used_locking, smsutil and util has an enum each for representing the same thing; The SMS alphabet. They share the same values, so an explicit type cast makes GCC happy.
-rw-r--r--src/smsutil.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/smsutil.c b/src/smsutil.c
index 450a1d38..e6556df6 100644
--- a/src/smsutil.c
+++ b/src/smsutil.c
@@ -3575,6 +3575,7 @@ GSList *sms_text_prepare_with_alphabet(const char *to, const char *utf8,
GSList *r = NULL;
enum gsm_dialect used_locking;
enum gsm_dialect used_single;
+ enum gsm_dialect dialect;
memset(&template, 0, sizeof(struct sms));
template.type = SMS_TYPE_SUBMIT;
@@ -3586,12 +3587,14 @@ GSList *sms_text_prepare_with_alphabet(const char *to, const char *utf8,
template.submit.vp.relative = 0xA7; /* 24 Hours */
sms_address_from_string(&template.submit.daddr, to);
+ /* There are two enums for the same thing */
+ dialect = (enum gsm_dialect)alphabet;
/*
* UDHI, UDL, UD and DCS actually depend on the contents of
* the text, and also on the GSM dialect we use to encode it.
*/
gsm_encoded = convert_utf8_to_gsm_best_lang(utf8, -1, NULL, &written, 0,
- alphabet, &used_locking,
+ dialect, &used_locking,
&used_single);
if (!gsm_encoded) {
size_t converted;