Hi Denis,

>> +
>> +    if (!g_at_result_iter_next_number(&iter, &total_cnt))
>> +            return;
>> +
>> +    if (!g_at_result_iter_next_string(&iter, &number))
>> +            return;
>> +
>> +    /* Skip the category, valid in simpresent and mcc fields */
>
> What is this comment referring to?

Following fields like category, valid in sim present state and mcc are
skipped as we are not going to use it. Just for information purpose.
I'll remove the comment.

>
>> +
>> +    if (vd->en_list == NULL)
>> +            vd->en_list = g_new0(char *, total_cnt + 1);
>> +
>> +    vd->en_list[count] = g_strdup(number);
>> +
>> +    if (index != total_cnt)
>> +            return;
>> +
>> +    ofono_voicecall_en_list_notify(vc, vd->en_list);
>> +
>> +    g_strfreev(vd->en_list);
>> +    vd->en_list = NULL;
>> +}
>> +
>> +static void xlema_read(gboolean ok, GAtResult *result, gpointer
>> user_data)
>> +{
>> +    struct ofono_voicecall *vc = user_data;
>> +    struct voicecall_data *vd = ofono_voicecall_get_data(vc);
>> +    GAtResultIter iter;
>> +    int num = 0;
>> +    int index, total_cnt;
>> +    const char *number;
>> +
>> +    if (!ok) {
>> +            DBG("Emergency number list read failed");
>> +            return;
>> +    }
>> +
>> +    g_at_result_iter_init(&iter, result);
>> +
>> +    while (g_at_result_iter_next(&iter, "+XLEMA:"))
>> +            num += 1;
>> +
>> +    vd->en_list = g_new0(char *, num + 1);
>> +
>> +    num = 0;
>> +    g_at_result_iter_init(&iter, result);
>> +
>> +    while (g_at_result_iter_next(&iter, "+XLEMA:")) {
>> +            if (!g_at_result_iter_next_number(&iter, &index))
>> +                    continue;
>> +
>> +            if (!g_at_result_iter_next_number(&iter, &total_cnt))
>> +                    continue;
>> +
>> +            if (!g_at_result_iter_next_string(&iter, &number))
>> +                    continue;
>> +
>> +            /* Skip the category, valid in simpresent and mcc fields */
>> +            g_at_result_iter_skip_next(&iter);
>> +            g_at_result_iter_skip_next(&iter);
>> +            g_at_result_iter_skip_next(&iter);
>
> What are you trying to achieve here?  Since you're not checking the
> result, it doesn't look like this code serves any purpose.

Agreed no pointing in having this as we are not going to make use of the
fields. Will be removed.

Regards,
Jeevaka
_______________________________________________
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono

Reply via email to