Merge "convert 'Stats stats; memset(&stats, 0, sizeof(Stats));' to 'Stats stats = {};'" am: 30bf98b239 am: d872904d2c am: 166e658c00

Change-Id: I270c321969d85ff5ae97627a6ecdb9c70d668247
This commit is contained in:
Automerger Merge Worker
2020-01-06 15:33:26 +00:00

View File

@@ -150,8 +150,7 @@ static int parseUidStats(const uint32_t uid, Stats* stats) {
} }
static jlong getTotalStat(JNIEnv* env, jclass clazz, jint type, jboolean useBpfStats) { static jlong getTotalStat(JNIEnv* env, jclass clazz, jint type, jboolean useBpfStats) {
Stats stats; Stats stats = {};
memset(&stats, 0, sizeof(Stats));
if (useBpfStats) { if (useBpfStats) {
if (bpfGetIfaceStats(NULL, &stats) == 0) { if (bpfGetIfaceStats(NULL, &stats) == 0) {
@@ -175,8 +174,7 @@ static jlong getIfaceStat(JNIEnv* env, jclass clazz, jstring iface, jint type,
return UNKNOWN; return UNKNOWN;
} }
Stats stats; Stats stats = {};
memset(&stats, 0, sizeof(Stats));
if (useBpfStats) { if (useBpfStats) {
if (bpfGetIfaceStats(iface8.c_str(), &stats) == 0) { 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) { static jlong getUidStat(JNIEnv* env, jclass clazz, jint uid, jint type, jboolean useBpfStats) {
Stats stats; Stats stats = {};
memset(&stats, 0, sizeof(Stats));
if (useBpfStats) { if (useBpfStats) {
if (bpfGetUidStats(uid, &stats) == 0) { if (bpfGetUidStats(uid, &stats) == 0) {