Array length and element padding.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Array length and element padding.

Jakub Piotr Cłapa-2
The padding of the first element is not counted to the length of the
whole array...

I really don't care much if it's a mistake or if it should be like this
but after spending whole night trying to find why the messages raise
error code 35 in the bus I think it would be really cool to mention it
somewhere in the specification... ;-)

Btw. The AddMatch method is also not documented, isn't it?

--
Regards,
Jakub Piotr Cłapa
--
dbus mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/dbus
Reply | Threaded
Open this post in threaded view
|

Re: Array length and element padding.

Havoc Pennington
On Wed, 2005-08-10 at 13:00 +0200, Jakub Piotr Cłapa wrote:
> The padding of the first element is not counted to the length of the
> whole array...
>
> I really don't care much if it's a mistake or if it should be like this
> but after spending whole night trying to find why the messages raise
> error code 35 in the bus I think it would be really cool to mention it
> somewhere in the specification... ;-)
>

It is in there:


        A <literal>UINT32</literal> giving the length of the array data
in bytes, followed by
                  alignment padding to the alignment boundary of the
array element type,
                  followed by each array element. The array length is
from the
                  end of the alignment padding to the end of the last
element,
                  i.e. it does not include the padding after the length,
                  or any padding after the last element.
                  Arrays have a maximum length defined to be 2 to the
26th power or
                  67108864. Implementations must not send or accept
arrays exceeding this
                  length.

> Btw. The AddMatch method is also not documented, isn't it?

It is not. There's some documentation in the Doxygen docs though and a
TODO note to document it in the spec.

Havoc


--
dbus mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/dbus
Reply | Threaded
Open this post in threaded view
|

Re: Array length and element padding.

Jakub Piotr Cłapa-2
Havoc Pennington wrote:

> On Wed, 2005-08-10 at 13:00 +0200, Jakub Piotr Cłapa wrote:
>
>>The padding of the first element is not counted to the length of the
>>whole array...
>>
>>I really don't care much if it's a mistake or if it should be like this
>>but after spending whole night trying to find why the messages raise
>>error code 35 in the bus I think it would be really cool to mention it
>>somewhere in the specification... ;-)
>
> It is in there:
>
>         A <literal>UINT32</literal> giving the length of the array data
> in bytes, followed by
>                   alignment padding to the alignment boundary of the
> array element type,
>                   followed by each array element. The array length is
> from the
>                   end of the alignment padding to the end of the last
> element,
>                   i.e. it does not include the padding after the length,
>                   or any padding after the last element.
>                   Arrays have a maximum length defined to be 2 to the
> 26th power or
>                   67108864. Implementations must not send or accept
> arrays exceeding this
>                   length.

So it's only me. :( I've read it several times and still... Whatever,
thanks. (and sorry for the rant) :)

>>Btw. The AddMatch method is also not documented, isn't it?
>
> It is not. There's some documentation in the Doxygen docs though and a
> TODO note to document it in the spec.

Maybe I could think about writing about it but only after Google SoC ends...

--
Regards,
Jakub Piotr Cłapa
--
dbus mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/dbus