@@ -27,8 +27,8 @@ class Network : public ALabel {
27
27
auto update () -> void override ;
28
28
29
29
private:
30
- static const uint8_t MAX_RETRY = 5 ;
31
- static const uint8_t EPOLL_MAX = 200 ;
30
+ static const uint8_t MAX_RETRY{ 5 } ;
31
+ static const uint8_t EPOLL_MAX{ 200 } ;
32
32
33
33
static int handleEvents (struct nl_msg *, void *);
34
34
static int handleEventsDone (struct nl_msg *, void *);
@@ -51,37 +51,37 @@ class Network : public ALabel {
51
51
bool wildcardMatch (const std::string& pattern, const std::string& text) const ;
52
52
std::optional<std::pair<unsigned long long , unsigned long long >> readBandwidthUsage ();
53
53
54
- int ifid_;
55
- ip_addr_pref addr_pref_;
56
- struct sockaddr_nl nladdr_ = {0 };
57
- struct nl_sock * sock_ = nullptr ;
58
- struct nl_sock * ev_sock_ = nullptr ;
59
- int efd_;
60
- int ev_fd_;
61
- int nl80211_id_;
54
+ int ifid_{- 1 } ;
55
+ ip_addr_pref addr_pref_{ip_addr_pref::IPV4} ;
56
+ struct sockaddr_nl nladdr_{0 };
57
+ struct nl_sock * sock_{ nullptr } ;
58
+ struct nl_sock * ev_sock_{ nullptr } ;
59
+ int efd_{- 1 } ;
60
+ int ev_fd_{- 1 } ;
61
+ int nl80211_id_{- 1 } ;
62
62
std::mutex mutex_;
63
63
64
- bool want_route_dump_;
65
- bool want_link_dump_;
66
- bool want_addr_dump_;
67
- bool dump_in_progress_;
68
- bool is_p2p_;
64
+ bool want_route_dump_{ false } ;
65
+ bool want_link_dump_{ false } ;
66
+ bool want_addr_dump_{ false } ;
67
+ bool dump_in_progress_{ false } ;
68
+ bool is_p2p_{ false } ;
69
69
70
- unsigned long long bandwidth_down_total_;
71
- unsigned long long bandwidth_up_total_;
70
+ unsigned long long bandwidth_down_total_{ 0 } ;
71
+ unsigned long long bandwidth_up_total_{ 0 } ;
72
72
73
73
std::string state_;
74
74
std::string essid_;
75
75
std::string bssid_;
76
- bool carrier_;
76
+ bool carrier_{ false } ;
77
77
std::string ifname_;
78
78
std::string ipaddr_;
79
79
std::string ipaddr6_;
80
80
std::string gwaddr_;
81
81
std::string netmask_;
82
82
std::string netmask6_;
83
- int cidr_;
84
- int cidr6_;
83
+ int cidr_{ 0 } ;
84
+ int cidr6_{ 0 } ;
85
85
int32_t signal_strength_dbm_;
86
86
uint8_t signal_strength_;
87
87
std::string signal_strength_app_;
@@ -90,9 +90,9 @@ class Network : public ALabel {
90
90
util::SleeperThread thread_;
91
91
util::SleeperThread thread_timer_;
92
92
#ifdef WANT_RFKILL
93
- util::Rfkill rfkill_;
93
+ util::Rfkill rfkill_{RFKILL_TYPE_WLAN} ;
94
94
#endif
95
- float frequency_;
95
+ float frequency_{ 0 } ;
96
96
};
97
97
98
98
} // namespace waybar::modules
0 commit comments