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

Commit 754ecb83 authored by Chris Forbes's avatar Chris Forbes Committed by android-build-merger
Browse files

Merge "libutils: Make LightFlattenablePod safe for unaligned ptr" into oc-dev am: ba73a138

am: efa61001

Change-Id: I4ee9ef146141cca446ab93f200c394a5bbd7be6a
parents 02e4d8ea efa61001
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -189,11 +189,11 @@ public:
    }
    inline status_t flatten(void* buffer, size_t size) const {
        if (size < sizeof(T)) return NO_MEMORY;
        *reinterpret_cast<T*>(buffer) = *static_cast<T const*>(this);
        memcpy(buffer, static_cast<T const*>(this), sizeof(T));
        return NO_ERROR;
    }
    inline status_t unflatten(void const* buffer, size_t) {
        *static_cast<T*>(this) = *reinterpret_cast<T const*>(buffer);
        memcpy(static_cast<T*>(this), buffer, sizeof(T));
        return NO_ERROR;
    }
};