{
check_offsets_in_body_for_adding (writer);
- if (*writer->u.root.last_offset != 0)
+ if (*writer->u.root.last_offset != GVARIANT_LAST_OFFSET_NOT_SET)
{
write_offset (writer->value_str,
*writer->u.root.last_offset,
if (!fixed)
*writer->u.root.last_offset = writer->value_pos - writer->value_start;
else
- *writer->u.root.last_offset = 0;
+ *writer->u.root.last_offset = GVARIANT_LAST_OFFSET_NOT_SET;
}
else if (DBUS_TYPE_STRUCT == writer->container_type ||
DBUS_TYPE_DICT_ENTRY == writer->container_type)
{
check_offsets_for_adding (writer);
- if (writer->u.struct_or_dict.last_offset != 0)
+ if (writer->u.struct_or_dict.last_offset != GVARIANT_LAST_OFFSET_NOT_SET)
{
prepend_offset (writer->offsets,
writer->u.struct_or_dict.last_offset,
if (!fixed)
writer->u.struct_or_dict.last_offset = writer->value_pos - writer->value_start;
else
- writer->u.struct_or_dict.last_offset = 0;
+ writer->u.struct_or_dict.last_offset = GVARIANT_LAST_OFFSET_NOT_SET;
}
else if (DBUS_TYPE_ARRAY == writer->container_type)
{
const DBusString *_dbus_get_gvariant_header_signature_str (void);
+#define GVARIANT_LAST_OFFSET_NOT_SET ((size_t)-1)
+
dbus_bool_t _dbus_header_gvariant_create (DBusHeader *header,
int byte_order,
int type,
if (NULL == sub->value_str || !_dbus_string_init (sub->value_str))
return FALSE;
sub->value_start = sub->value_pos = 0;
- sub->u.struct_or_dict.last_offset = 0;
+ sub->u.struct_or_dict.last_offset = GVARIANT_LAST_OFFSET_NOT_SET;
sub->offsets_size = 1;
sub->is_fixed = TRUE;
sub->offsets = dbus_new (DBusString, 1);
message->signature = NULL;
message->unique_sender = NULL;
- message->gvariant_body_last_offset = 0;
+ message->gvariant_body_last_offset = GVARIANT_LAST_OFFSET_NOT_SET;
message->gvariant_body_last_pos = 0;
return message;