diff options
Diffstat (limited to 'dbus/property.cc')
-rw-r--r-- | dbus/property.cc | 97 |
1 files changed, 49 insertions, 48 deletions
diff --git a/dbus/property.cc b/dbus/property.cc index 234036c..66af866 100644 --- a/dbus/property.cc +++ b/dbus/property.cc @@ -4,7 +4,8 @@ #include "dbus/property.h" -#include "base/basictypes.h" +#include <stddef.h> + #include "base/bind.h" #include "base/logging.h" @@ -302,16 +303,16 @@ void PropertySet::NotifyPropertyChanged(const std::string& name) { // template <> -Property<uint8>::Property() : value_(0) { -} +Property<uint8_t>::Property() + : value_(0) {} template <> -bool Property<uint8>::PopValueFromReader(MessageReader* reader) { +bool Property<uint8_t>::PopValueFromReader(MessageReader* reader) { return reader->PopVariantOfByte(&value_); } template <> -void Property<uint8>::AppendSetValueToWriter(MessageWriter* writer) { +void Property<uint8_t>::AppendSetValueToWriter(MessageWriter* writer) { writer->AppendVariantOfByte(set_value_); } @@ -334,110 +335,110 @@ void Property<bool>::AppendSetValueToWriter(MessageWriter* writer) { } // -// Property<int16> specialization. +// Property<int16_t> specialization. // template <> -Property<int16>::Property() : value_(0) { -} +Property<int16_t>::Property() + : value_(0) {} template <> -bool Property<int16>::PopValueFromReader(MessageReader* reader) { +bool Property<int16_t>::PopValueFromReader(MessageReader* reader) { return reader->PopVariantOfInt16(&value_); } template <> -void Property<int16>::AppendSetValueToWriter(MessageWriter* writer) { +void Property<int16_t>::AppendSetValueToWriter(MessageWriter* writer) { writer->AppendVariantOfInt16(set_value_); } // -// Property<uint16> specialization. +// Property<uint16_t> specialization. // template <> -Property<uint16>::Property() : value_(0) { -} +Property<uint16_t>::Property() + : value_(0) {} template <> -bool Property<uint16>::PopValueFromReader(MessageReader* reader) { +bool Property<uint16_t>::PopValueFromReader(MessageReader* reader) { return reader->PopVariantOfUint16(&value_); } template <> -void Property<uint16>::AppendSetValueToWriter(MessageWriter* writer) { +void Property<uint16_t>::AppendSetValueToWriter(MessageWriter* writer) { writer->AppendVariantOfUint16(set_value_); } // -// Property<int32> specialization. +// Property<int32_t> specialization. // template <> -Property<int32>::Property() : value_(0) { -} +Property<int32_t>::Property() + : value_(0) {} template <> -bool Property<int32>::PopValueFromReader(MessageReader* reader) { +bool Property<int32_t>::PopValueFromReader(MessageReader* reader) { return reader->PopVariantOfInt32(&value_); } template <> -void Property<int32>::AppendSetValueToWriter(MessageWriter* writer) { +void Property<int32_t>::AppendSetValueToWriter(MessageWriter* writer) { writer->AppendVariantOfInt32(set_value_); } // -// Property<uint32> specialization. +// Property<uint32_t> specialization. // template <> -Property<uint32>::Property() : value_(0) { -} +Property<uint32_t>::Property() + : value_(0) {} template <> -bool Property<uint32>::PopValueFromReader(MessageReader* reader) { +bool Property<uint32_t>::PopValueFromReader(MessageReader* reader) { return reader->PopVariantOfUint32(&value_); } template <> -void Property<uint32>::AppendSetValueToWriter(MessageWriter* writer) { +void Property<uint32_t>::AppendSetValueToWriter(MessageWriter* writer) { writer->AppendVariantOfUint32(set_value_); } // -// Property<int64> specialization. +// Property<int64_t> specialization. // template <> -Property<int64>::Property() : value_(0), set_value_(0) { -} +Property<int64_t>::Property() + : value_(0), set_value_(0) {} template <> -bool Property<int64>::PopValueFromReader(MessageReader* reader) { +bool Property<int64_t>::PopValueFromReader(MessageReader* reader) { return reader->PopVariantOfInt64(&value_); } template <> -void Property<int64>::AppendSetValueToWriter(MessageWriter* writer) { +void Property<int64_t>::AppendSetValueToWriter(MessageWriter* writer) { writer->AppendVariantOfInt64(set_value_); } // -// Property<uint64> specialization. +// Property<uint64_t> specialization. // template <> -Property<uint64>::Property() : value_(0) { -} +Property<uint64_t>::Property() + : value_(0) {} template <> -bool Property<uint64>::PopValueFromReader(MessageReader* reader) { +bool Property<uint64_t>::PopValueFromReader(MessageReader* reader) { return reader->PopVariantOfUint64(&value_); } template <> -void Property<uint64>::AppendSetValueToWriter(MessageWriter* writer) { +void Property<uint64_t>::AppendSetValueToWriter(MessageWriter* writer) { writer->AppendVariantOfUint64(set_value_); } @@ -536,17 +537,17 @@ void Property<std::vector<ObjectPath> >::AppendSetValueToWriter( } // -// Property<std::vector<uint8> > specialization. +// Property<std::vector<uint8_t> > specialization. // template <> -bool Property<std::vector<uint8> >::PopValueFromReader(MessageReader* reader) { +bool Property<std::vector<uint8_t>>::PopValueFromReader(MessageReader* reader) { MessageReader variant_reader(NULL); if (!reader->PopVariant(&variant_reader)) return false; value_.clear(); - const uint8* bytes = NULL; + const uint8_t* bytes = NULL; size_t length = 0; if (!variant_reader.PopArrayOfBytes(&bytes, &length)) return false; @@ -555,7 +556,7 @@ bool Property<std::vector<uint8> >::PopValueFromReader(MessageReader* reader) { } template <> -void Property<std::vector<uint8> >::AppendSetValueToWriter( +void Property<std::vector<uint8_t>>::AppendSetValueToWriter( MessageWriter* writer) { MessageWriter variant_writer(NULL); writer->OpenVariant("ay", &variant_writer); @@ -629,7 +630,7 @@ bool Property<std::vector<std::pair<std::vector<uint8_t>, uint16_t>>>:: return false; std::pair<std::vector<uint8_t>, uint16_t> entry; - const uint8* bytes = NULL; + const uint8_t* bytes = NULL; size_t length = 0; if (!struct_reader.PopArrayOfBytes(&bytes, &length)) return false; @@ -660,20 +661,20 @@ void Property<std::vector<std::pair<std::vector<uint8_t>, uint16_t>>>:: writer->CloseContainer(&variant_writer); } -template class Property<uint8>; +template class Property<uint8_t>; template class Property<bool>; -template class Property<int16>; -template class Property<uint16>; -template class Property<int32>; -template class Property<uint32>; -template class Property<int64>; -template class Property<uint64>; +template class Property<int16_t>; +template class Property<uint16_t>; +template class Property<int32_t>; +template class Property<uint32_t>; +template class Property<int64_t>; +template class Property<uint64_t>; template class Property<double>; template class Property<std::string>; template class Property<ObjectPath>; template class Property<std::vector<std::string> >; template class Property<std::vector<ObjectPath> >; -template class Property<std::vector<uint8> >; +template class Property<std::vector<uint8_t>>; template class Property<std::map<std::string, std::string>>; template class Property<std::vector<std::pair<std::vector<uint8_t>, uint16_t>>>; |