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

Commit f33fd94d authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

Dedupe RETURN_STATUS_IF_ERROR macro

Move the definition to 'AidlConversionUtil.h' and
get rid of the copies.

Bug: 198812639
Test: m
Change-Id: I373c4449721b69aa104d45a599ba1aa1304bcb4d
parent c03e43f8
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -24,9 +24,6 @@
#include <media/AudioAttributes.h>
#include <media/PolicyAidlConversion.h>

#define RETURN_STATUS_IF_ERROR(x) \
    { auto _tmp = (x); if (_tmp != OK) return _tmp; }

namespace android {

status_t AudioAttributes::readFromParcel(const Parcel* parcel) {
+0 −6
Original line number Diff line number Diff line
@@ -32,12 +32,6 @@
#include <private/media/AudioEffectShared.h>
#include <utils/Log.h>

#define RETURN_STATUS_IF_ERROR(x)    \
    {                                \
        auto _tmp = (x);             \
        if (_tmp != OK) return _tmp; \
    }

namespace android {
using aidl_utils::statusTFromBinderStatus;
using binder::Status;
+0 −3
Original line number Diff line number Diff line
@@ -21,9 +21,6 @@
#include <media/AudioAttributes.h>
#include <media/PolicyAidlConversion.h>

#define RETURN_STATUS_IF_ERROR(x) \
    { auto _tmp = (x); if (_tmp != OK) return _tmp; }

namespace android {

status_t AudioProductStrategy::readFromParcel(const Parcel* parcel) {
+0 −6
Original line number Diff line number Diff line
@@ -40,12 +40,6 @@
       if (!_tmp.ok()) return aidl_utils::binderStatusFromStatusT(_tmp.error()); \
       std::move(_tmp.value()); })

#define RETURN_STATUS_IF_ERROR(x)    \
    {                                \
        auto _tmp = (x);             \
        if (_tmp != OK) return _tmp; \
    }

// ----------------------------------------------------------------------------

namespace android {
+0 −3
Original line number Diff line number Diff line
@@ -26,9 +26,6 @@
#include <media/AudioAttributes.h>
#include <media/PolicyAidlConversion.h>

#define RETURN_STATUS_IF_ERROR(x) \
    { auto _tmp = (x); if (_tmp != OK) return _tmp; }

namespace android {

using media::audio::common::AudioStreamType;
Loading