summaryrefslogtreecommitdiffstats
path: root/libs/binder/Parcel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/binder/Parcel.cpp')
-rw-r--r--libs/binder/Parcel.cpp49
1 files changed, 47 insertions, 2 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index 4c15913..c7bdcbc 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -627,11 +627,27 @@ status_t Parcel::writeFloat(float val)
return writeAligned(val);
}
+#if defined(__mips__) && defined(__mips_hard_float)
+
+status_t Parcel::writeDouble(double val)
+{
+ union {
+ double d;
+ unsigned long long ll;
+ } u;
+ u.d = val;
+ return writeAligned(u.ll);
+}
+
+#else
+
status_t Parcel::writeDouble(double val)
{
return writeAligned(val);
}
+#endif
+
status_t Parcel::writeIntPtr(intptr_t val)
{
return writeAligned(val);
@@ -962,17 +978,44 @@ float Parcel::readFloat() const
return readAligned<float>();
}
+#if defined(__mips__) && defined(__mips_hard_float)
+
status_t Parcel::readDouble(double *pArg) const
{
- return readAligned(pArg);
+ union {
+ double d;
+ unsigned long long ll;
+ } u;
+ status_t status;
+ status = readAligned(&u.ll);
+ *pArg = u.d;
+ return status;
+}
+
+double Parcel::readDouble() const
+{
+ union {
+ double d;
+ unsigned long long ll;
+ } u;
+ u.ll = readAligned<unsigned long long>();
+ return u.d;
}
+#else
+
+status_t Parcel::readDouble(double *pArg) const
+{
+ return readAligned(pArg);
+}
double Parcel::readDouble() const
{
return readAligned<double>();
}
+#endif
+
status_t Parcel::readIntPtr(intptr_t *pArg) const
{
return readAligned(pArg);
@@ -1429,6 +1472,8 @@ status_t Parcel::continueWrite(size_t desired)
if (objectsSize) {
objects = (size_t*)malloc(objectsSize*sizeof(size_t));
if (!objects) {
+ free(data);
+
mError = NO_MEMORY;
return NO_MEMORY;
}
@@ -1509,7 +1554,7 @@ status_t Parcel::continueWrite(size_t desired)
mError = NO_MEMORY;
return NO_MEMORY;
}
-
+
if(!(mDataCapacity == 0 && mObjects == NULL
&& mObjectsCapacity == 0)) {
ALOGE("continueWrite: %d/%p/%d/%d", mDataCapacity, mObjects, mObjectsCapacity, desired);