d->id_list &= ~(0x1 << id);
}
-static gint call_compare_by_status(gconstpointer a, gconstpointer b)
-{
- const struct ofono_call *call = a;
- int status = GPOINTER_TO_INT(b);
-
- if (status != call->status)
- return 1;
-
- return 0;
-}
-
-static gint call_compare(gconstpointer a, gconstpointer b)
-{
- const struct ofono_call *ca = a;
- const struct ofono_call *cb = b;
-
- if (ca->id < cb->id)
- return -1;
-
- if (ca->id > cb->id)
- return 1;
-
- return 0;
-}
-
static struct ofono_call *create_call(struct voicecall_data *d, int type,
int direction, int status,
const char *num, int num_type, int clip)
call->clip_validity = clip;
- d->calls = g_slist_insert_sorted(d->calls, call, call_compare);
+ d->calls = g_slist_insert_sorted(d->calls, call, at_util_call_compare);
return call;
}
else
call->clip_validity = 2;
- l = g_slist_insert_sorted(l, call, call_compare);
+ l = g_slist_insert_sorted(l, call, at_util_call_compare);
}
return l;
/* See comment in CRING */
if (g_slist_find_custom(vd->calls, GINT_TO_POINTER(5),
- call_compare_by_status))
+ at_util_call_compare_by_status))
return;
/* RING can repeat, ignore if we already have an incoming call */
if (g_slist_find_custom(vd->calls, GINT_TO_POINTER(4),
- call_compare_by_status))
+ at_util_call_compare_by_status))
return;
/* Generate an incoming call of unknown type */
* when a waiting call exists (cannot have waiting + incoming in GSM)
*/
if (g_slist_find_custom(vd->calls, GINT_TO_POINTER(5),
- call_compare_by_status))
+ at_util_call_compare_by_status))
return;
/* CRING can repeat, ignore if we already have an incoming call */
if (g_slist_find_custom(vd->calls, GINT_TO_POINTER(4),
- call_compare_by_status))
+ at_util_call_compare_by_status))
return;
g_at_result_iter_init(&iter, result);
dump_response("clip_notify", TRUE, result);
l = g_slist_find_custom(vd->calls, GINT_TO_POINTER(4),
- call_compare_by_status);
+ at_util_call_compare_by_status);
if (l == NULL) {
ofono_error("CLIP for unknown call");