diff options
author | Dan Stoza <stoza@google.com> | 2014-12-01 10:01:10 -0800 |
---|---|---|
committer | Dan Stoza <stoza@google.com> | 2014-12-01 11:13:11 -0800 |
commit | 41a0f2f86c0ca7d2fef50aef6215987f445a7231 (patch) | |
tree | a02857dc77b65467a3260c54d0768c9ae36795ed /libs | |
parent | 104e12594e085bc8dd32eedb96643b774b1508a0 (diff) | |
download | frameworks_native-41a0f2f86c0ca7d2fef50aef6215987f445a7231.zip frameworks_native-41a0f2f86c0ca7d2fef50aef6215987f445a7231.tar.gz frameworks_native-41a0f2f86c0ca7d2fef50aef6215987f445a7231.tar.bz2 |
binder: Add {read,write}Uint32 methods to Parcel
Adds readUint32 and writeUint32 methods to the Parcel class. This
saves a lot of static_casting in anything implementing a Binder
interface on the native side.
Change-Id: Iafc73b0633654a3a4c49767f41806b56906c924f
Diffstat (limited to 'libs')
-rw-r--r-- | libs/binder/Parcel.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index 99e539c..c526399 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -624,6 +624,12 @@ status_t Parcel::writeInt32(int32_t val) { return writeAligned(val); } + +status_t Parcel::writeUint32(uint32_t val) +{ + return writeAligned(val); +} + status_t Parcel::writeInt32Array(size_t len, const int32_t *val) { if (!val) { return writeAligned(-1); @@ -1035,6 +1041,15 @@ int32_t Parcel::readInt32() const return readAligned<int32_t>(); } +status_t Parcel::readUint32(uint32_t *pArg) const +{ + return readAligned(pArg); +} + +uint32_t Parcel::readUint32() const +{ + return readAligned<uint32_t>(); +} status_t Parcel::readInt64(int64_t *pArg) const { |