Openbmc archive at lore.kernel.org
 help / color / Atom feed
* sdbusplus: size/ssize types and 'object_path' type.
@ 2020-09-15 19:02 Patrick Williams
  2020-10-08 16:18 ` Patrick Williams
  0 siblings, 1 reply; 2+ messages in thread
From: Patrick Williams @ 2020-09-15 19:02 UTC (permalink / raw)
  To: OpenBMC List


[-- Attachment #1: Type: text/plain, Size: 1127 bytes --]

Hello,

For the sdbus++ interface YAML files we use in phosphor-dbus-interfaces,
I recently added support for 'size' and 'ssize' types[1].  I did this
because I've seen many cases where there was some discussion on
appropriate integer sizes for countable items (ex. uint8 vs uint32 vs
uint64).  Generally, in C++ we recommend size_t/ssize_t as the most
appropriate type for countable items (and anything else is likely a
premature optimization).  We should now take this same approach in PDI
interfaces.

Another minor change[2] is I added 'object_path' as a type alias to what
was previously just 'path'.  The name 'object_path' is what the DBus
specification calls this type, so I think that name is more obvious for
sdbus++ to also use.  Both 'path' and 'object_path' currently resolve to
the same type, but I'll probably also start switching PDI interfaces
over to the longer 'object_path' type name.

1. https://github.com/openbmc/sdbusplus/commit/4ac7e56e8e18202fad3b2734346c6d4c7a6957fc
2. https://github.com/openbmc/sdbusplus/commit/d5ce346c434705180d0cbe25686d51630681ba4b

-- 
Patrick Williams

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: sdbusplus: size/ssize types and 'object_path' type.
  2020-09-15 19:02 sdbusplus: size/ssize types and 'object_path' type Patrick Williams
@ 2020-10-08 16:18 ` Patrick Williams
  0 siblings, 0 replies; 2+ messages in thread
From: Patrick Williams @ 2020-10-08 16:18 UTC (permalink / raw)
  To: OpenBMC List


[-- Attachment #1: Type: text/plain, Size: 1050 bytes --]

On Tue, Sep 15, 2020 at 02:02:31PM -0500, Patrick Williams wrote:
> For the sdbus++ interface YAML files we use in phosphor-dbus-interfaces,
> I recently added support for 'size' and 'ssize' types[1].  I did this
> because I've seen many cases where there was some discussion on
> appropriate integer sizes for countable items (ex. uint8 vs uint32 vs
> uint64).  Generally, in C++ we recommend size_t/ssize_t as the most
> appropriate type for countable items (and anything else is likely a
> premature optimization).  We should now take this same approach in PDI
> interfaces.
> 
> 1. https://github.com/openbmc/sdbusplus/commit/4ac7e56e8e18202fad3b2734346c6d4c7a6957fc

It was mentioned to me in a code review for PDI that there was some
problem taking advantage of 'size_t/ssize_t' type properties when the
interface already had a 'uint32_t/int32_t' type property.  I've
identified the underlying problem and fixed it with this commit:

    https://gerrit.openbmc-project.xyz/c/openbmc/sdbusplus/+/37227

-- 
Patrick Williams

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-15 19:02 sdbusplus: size/ssize types and 'object_path' type Patrick Williams
2020-10-08 16:18 ` Patrick Williams

Openbmc archive at lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/openbmc/0 openbmc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 openbmc openbmc/ https://lore.kernel.org/openbmc \
		openbmc@lists.ozlabs.org openbmc@ozlabs.org
	public-inbox-index openbmc

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.ozlabs.lists.openbmc


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git