Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a271dfa6 authored by Elliott Hughes's avatar Elliott Hughes Committed by Automerger Merge Worker
Browse files

Merge "Use static_assert directly." am: b219f6ed

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1402757

Change-Id: Iaf9eb2db2ecb3f7775b9514c94b1404aa7588f12
parents e56ec047 b219f6ed
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@
#include <binder/TextOutput.h>

#include <cutils/ashmem.h>
#include <utils/Debug.h>
#include <utils/Flattenable.h>
#include <utils/Log.h>
#include <utils/misc.h>
@@ -1516,7 +1515,7 @@ const void* Parcel::readInplace(size_t len) const

template<class T>
status_t Parcel::readAligned(T *pArg) const {
    COMPILE_TIME_ASSERT_FUNCTION_SCOPE(PAD_SIZE_UNSAFE(sizeof(T)) == sizeof(T));
    static_assert(PAD_SIZE_UNSAFE(sizeof(T)) == sizeof(T));

    if ((mDataPos+sizeof(T)) <= mDataSize) {
        if (mObjectsSize > 0) {
@@ -1549,7 +1548,7 @@ T Parcel::readAligned() const {

template<class T>
status_t Parcel::writeAligned(T val) {
    COMPILE_TIME_ASSERT_FUNCTION_SCOPE(PAD_SIZE_UNSAFE(sizeof(T)) == sizeof(T));
    static_assert(PAD_SIZE_UNSAFE(sizeof(T)) == sizeof(T));

    if ((mDataPos+sizeof(val)) <= mDataCapacity) {
restart_write: