From 41a0f2f86c0ca7d2fef50aef6215987f445a7231 Mon Sep 17 00:00:00 2001 From: Dan Stoza Date: Mon, 1 Dec 2014 10:01:10 -0800 Subject: 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 --- libs/binder/Parcel.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libs') 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(); } +status_t Parcel::readUint32(uint32_t *pArg) const +{ + return readAligned(pArg); +} + +uint32_t Parcel::readUint32() const +{ + return readAligned(); +} status_t Parcel::readInt64(int64_t *pArg) const { -- cgit v1.1