dbus_message_iter_recurse (&iter, &iter_array);
while (dbus_message_iter_get_arg_type (&iter_array) != DBUS_TYPE_INVALID)
{
- GArray *new_array;
AtspiRelation *relation;
relation = _atspi_relation_new_from_iter (&iter_array);
- new_array = g_array_append_val (ret, relation);
- if (new_array)
- ret = new_array;
+ ret = g_array_append_val (ret, relation);
dbus_message_iter_next (&iter_array);
}
dbus_message_unref (reply);
return NULL;
return g_strdup (ret);
}
+
/**
* atspi_accessible_get_toolkit_version:
* @obj: a pointer to the #AtspiAccessible object on which to operate.
{
GArray *ret = g_array_new (TRUE, TRUE, sizeof (gchar *));
- if (!ret)
- return NULL;
-
g_return_val_if_fail (obj != NULL, NULL);
append_const_val (ret, "Accessible");
atspi_rect_copy (AtspiRect *src)
{
AtspiRect *dst = g_new (AtspiRect, 1);
- if (dst)
- {
- dst->x = src->x;
- dst->y = src->y;
- dst->height = src->height;
- dst->width = src->width;
- }
+ dst->x = src->x;
+ dst->y = src->y;
+ dst->height = src->height;
+ dst->width = src->width;
return dst;
}
atspi_point_copy (AtspiPoint *src)
{
AtspiPoint *dst = g_new (AtspiPoint, 1);
- if (dst)
- {
- dst->x = src->x;
- dst->y = src->y;
- }
+ dst->x = src->x;
+ dst->y = src->y;
return dst;
}
atspi_device_event_copy (AtspiDeviceEvent *src)
{
AtspiDeviceEvent *dst = g_new0 (AtspiDeviceEvent, 1);
- if (!dst)
- return NULL;
dst->type = src->type;
dst->id = src->id;
dst->hw_code = src->hw_code;
if (!info)
{
info = g_new (CallbackInfo, 1);
- if (!info)
- return;
info->callback = callback;
info->callback_destroyed = callback_destroyed;
info->ref_count = 1;
if (name && name [0])
{
gchar *new_str = g_strconcat (*matchrule, ",member='", name, "'", NULL);
- if (new_str)
- {
- g_free (*matchrule);
- *matchrule = new_str;
- }
+ g_free (*matchrule);
+ *matchrule = new_str;
}
if (detail && detail [0])
{
gchar *new_str = g_strconcat (*matchrule, ",arg0='", detail, "'", NULL);
- if (new_str)
- {
- g_free (*matchrule);
- *matchrule = new_str;
- }
+ g_free (*matchrule);
+ *matchrule = new_str;
}
}
if (categoryp) *categoryp = category;
}
e = g_new (EventListenerEntry, 1);
- if (!e) return FALSE;
e->callback = callback;
e->user_data = user_data;
e->callback_destroyed = callback_destroyed;
if (strcasecmp (category, name) != 0)
{
p = g_strconcat (converted_type, ":", name, NULL);
- if (p)
- {
- g_free (converted_type);
- converted_type = p;
- }
+ g_free (converted_type);
+ converted_type = p;
}
else if (detail [0] == '\0')
{
p = g_strconcat (converted_type, ":", NULL);
- if (p)
- {
- g_free (converted_type);
- converted_type = p;
- }
+ g_free (converted_type);
+ converted_type = p;
}
if (detail[0] != '\0')
{
p = g_strconcat (converted_type, ":", detail, NULL);
- if (p)
- {
- g_free (converted_type);
- converted_type = p;
- }
+ g_free (converted_type);
+ converted_type = p;
}
e.type = converted_type;
e.source = _atspi_ref_accessible (dbus_message_get_sender(message), dbus_message_get_path(message));
dbus_int32_t d_start_offset, d_end_offset;
AtspiRange *ret = g_new (AtspiRange, 1);
- if (ret)
- ret->start_offset = ret->end_offset = -1;
+ ret->start_offset = ret->end_offset = -1;
- if (!obj || !ret)
+ if (!obj)
return ret;
_atspi_dbus_call (obj, atspi_interface_hyperlink, "GetIndexRange", error, "=>ii", &d_start_offset, &d_end_offset);
BusDataClosure *closure = g_new (BusDataClosure, 1);
GList *new_list;
- if (!closure)
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
closure->bus = dbus_connection_ref (bus);
closure->message = dbus_message_ref (message);
closure->data = user_data;
AtspiKeyDefinition *dst;
dst = g_new0 (AtspiKeyDefinition, 1);
- if (!dst)
- return NULL;
dst->keycode = src->keycode;
dst->keysym = src->keysym;
if (src->keystring)
{
AtspiRange *dst = g_new (AtspiRange, 1);
- if (dst)
- {
- dst->start_offset = src->start_offset;
- dst->end_offset = src->end_offset;
- }
+ dst->start_offset = src->start_offset;
+ dst->end_offset = src->end_offset;
return dst;
}
{
AtspiTextRange *dst = g_new (AtspiTextRange, 1);
- if (dst)
- {
- dst->content = g_strdup (src->content);
- dst->start_offset = src->start_offset;
- dst->end_offset = src->end_offset;
- }
+ dst->content = g_strdup (src->content);
+ dst->start_offset = src->start_offset;
+ dst->end_offset = src->end_offset;
return dst;
}
dbus_int32_t d_start_offset = -1, d_end_offset = -1;
AtspiTextRange *range = g_new0 (AtspiTextRange, 1);
- if (range)
- range->start_offset = range->end_offset = -1;
- if (!obj || !range)
+ range->start_offset = range->end_offset = -1;
+ if (!obj)
return range;
_atspi_dbus_call (obj, atspi_interface_text, "GetTextBeforeOffset", error,
dbus_int32_t d_start_offset = -1, d_end_offset = -1;
AtspiTextRange *range = g_new0 (AtspiTextRange, 1);
- if (range)
- range->start_offset = range->end_offset = -1;
- if (!obj || !range)
+ range->start_offset = range->end_offset = -1;
+ if (!obj)
return range;
_atspi_dbus_call (obj, atspi_interface_text, "GetTextAtOffset", error,
dbus_int32_t d_start_offset = -1, d_end_offset = -1;
AtspiTextRange *range = g_new0 (AtspiTextRange, 1);
- if (range)
- range->start_offset = range->end_offset = -1;
- if (!obj || !range)
+ range->start_offset = range->end_offset = -1;
+ if (!obj)
return range;
_atspi_dbus_call (obj, atspi_interface_text, "GetTextAfterOffset", error,
dbus_int32_t d_start_offset, d_end_offset;
AtspiRange *ret = g_new (AtspiRange, 1);
- if (ret)
- ret->start_offset = ret->end_offset = -1;
+ ret->start_offset = ret->end_offset = -1;
- if (!obj || !ret)
+ if (!obj)
return ret;
_atspi_dbus_call (obj, atspi_interface_text, "GetSelection", error, "i=>ii", d_selection_num, &d_start_offset, &d_end_offset);