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

Commit 1474f886 authored by Dan Albert's avatar Dan Albert
Browse files

Don't check if this == NULL.

Entering a method with this == NULL is undefined behavior. Clang whines
about this.

Change-Id: Ibde628395ca10dfef0d2f59e81280576f104b83c
parent 86aeb9ef
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -29,12 +29,12 @@ IInterface::~IInterface() {


sp<IBinder> IInterface::asBinder()
sp<IBinder> IInterface::asBinder()
{
{
    return this ? onAsBinder() : NULL;
    return onAsBinder();
}
}


sp<const IBinder> IInterface::asBinder() const
sp<const IBinder> IInterface::asBinder() const
{
{
    return this ? const_cast<IInterface*>(this)->onAsBinder() : NULL;
    return const_cast<IInterface*>(this)->onAsBinder();
}
}


// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
+1 −1
Original line number Original line Diff line number Diff line
@@ -75,7 +75,7 @@ status_t ComposerState::read(const Parcel& input) {


status_t DisplayState::write(Parcel& output) const {
status_t DisplayState::write(Parcel& output) const {
    output.writeStrongBinder(token);
    output.writeStrongBinder(token);
    output.writeStrongBinder(surface->asBinder());
    output.writeStrongBinder(surface != NULL ? surface->asBinder() : NULL);
    output.writeInt32(what);
    output.writeInt32(what);
    output.writeInt32(layerStack);
    output.writeInt32(layerStack);
    output.writeInt32(orientation);
    output.writeInt32(orientation);
+5 −1
Original line number Original line Diff line number Diff line
@@ -1110,7 +1110,11 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags)
                    // this display is in both lists. see if something changed.
                    // this display is in both lists. see if something changed.
                    const DisplayDeviceState& state(curr[j]);
                    const DisplayDeviceState& state(curr[j]);
                    const wp<IBinder>& display(curr.keyAt(j));
                    const wp<IBinder>& display(curr.keyAt(j));
                    if (state.surface->asBinder() != draw[i].surface->asBinder()) {
                    const sp<IBinder> state_binder =
                        state.surface != NULL ? state.surface->asBinder() : NULL;
                    const sp<IBinder> draw_binder =
                        draw[i].surface != NULL ? draw[i].surface->asBinder() : NULL;
                    if (state_binder != draw_binder) {
                        // changing the surface is like destroying and
                        // changing the surface is like destroying and
                        // recreating the DisplayDevice, so we just remove it
                        // recreating the DisplayDevice, so we just remove it
                        // from the drawing state, so that it get re-added
                        // from the drawing state, so that it get re-added