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

Commit 12a638d9 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "convert 'Stats stats; memset(&stats, 0, sizeof(Stats));' to 'Stats stats = {};'"

parents 34ad9039 e02e9cd2
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -150,8 +150,7 @@ static int parseUidStats(const uint32_t uid, Stats* stats) {
}

static jlong getTotalStat(JNIEnv* env, jclass clazz, jint type, jboolean useBpfStats) {
    Stats stats;
    memset(&stats, 0, sizeof(Stats));
    Stats stats = {};

    if (useBpfStats) {
        if (bpfGetIfaceStats(NULL, &stats) == 0) {
@@ -175,8 +174,7 @@ static jlong getIfaceStat(JNIEnv* env, jclass clazz, jstring iface, jint type,
        return UNKNOWN;
    }

    Stats stats;
    memset(&stats, 0, sizeof(Stats));
    Stats stats = {};

    if (useBpfStats) {
        if (bpfGetIfaceStats(iface8.c_str(), &stats) == 0) {
@@ -194,8 +192,7 @@ static jlong getIfaceStat(JNIEnv* env, jclass clazz, jstring iface, jint type,
}

static jlong getUidStat(JNIEnv* env, jclass clazz, jint uid, jint type, jboolean useBpfStats) {
    Stats stats;
    memset(&stats, 0, sizeof(Stats));
    Stats stats = {};

    if (useBpfStats) {
        if (bpfGetUidStats(uid, &stats) == 0) {