From 5e1a2e2a93cb8501c4990b38bc7b2f4b5e86ac70 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 23 Jul 2020 16:21:13 +0200 Subject: [PATCH] lib/dbus/Values: add `uint32_t` and `uint64_t` support --- src/lib/dbus/AppendIter.hxx | 4 ++++ src/lib/dbus/Types.hxx | 4 ++++ src/lib/dbus/Values.hxx | 3 +++ 3 files changed, 11 insertions(+) diff --git a/src/lib/dbus/AppendIter.hxx b/src/lib/dbus/AppendIter.hxx index a6bdc595f..183f24537 100644 --- a/src/lib/dbus/AppendIter.hxx +++ b/src/lib/dbus/AppendIter.hxx @@ -74,6 +74,10 @@ public: return AppendBasic(DBUS_TYPE_UINT32, &value); } + AppendMessageIter &Append(const uint64_t &value) { + return AppendBasic(DBUS_TYPE_UINT64, &value); + } + AppendMessageIter &AppendFixedArray(int element_type, const void *value, int n_elements) { diff --git a/src/lib/dbus/Types.hxx b/src/lib/dbus/Types.hxx index b5ddd9241..72b3d5682 100644 --- a/src/lib/dbus/Types.hxx +++ b/src/lib/dbus/Types.hxx @@ -62,6 +62,10 @@ template<> struct TypeTraits : BasicTypeTraits { }; +template<> +struct TypeTraits : BasicTypeTraits { +}; + using BooleanTypeTraits = BasicTypeTraits; template diff --git a/src/lib/dbus/Values.hxx b/src/lib/dbus/Values.hxx index 45223cc22..5511400f5 100644 --- a/src/lib/dbus/Values.hxx +++ b/src/lib/dbus/Values.hxx @@ -64,6 +64,9 @@ struct Boolean { :value(_value) {} }; +using Uint32 = BasicValue; +using Uint64 = BasicValue; + template class WrapTraits> struct WrapValue { typedef typename T::Traits ContainedTraits;