Skip to content

Commit 18b9df3

Browse files
committed
cleanup: remove all "using std" from codebase
1 parent 3b22381 commit 18b9df3

File tree

11 files changed

+18
-32
lines changed

11 files changed

+18
-32
lines changed

libraries/ESPhost/examples/ESP32_TEST/ESP32_TEST.ino

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#include "CNetIf.h"
33
#include <string>
44

5-
using namespace std;
6-
75
/* GPIO_LOCAL C33
86
- 0. P010
97
- 1. P207

libraries/ESPhost/src/CCtrlWrapper.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828

2929
#include <vector>
3030

31-
using namespace std;
32-
3331
#include "esp_hosted_config.pb-c.h"
3432

3533
#include "CMsg.h"
@@ -989,7 +987,7 @@ class CCtrlMsgWrapper {
989987
}
990988

991989
/* ----------------------------------------------------------------------- */
992-
int extractSoftConnectedStationList(vector<WifiConnectedSta_t>& l) {
990+
int extractSoftConnectedStationList(std::vector<WifiConnectedSta_t>& l) {
993991
/* ----------------------------------------------------------------------- */
994992

995993
if(checkResponsePayload<CtrlMsgRespSoftAPConnectedSTA>(answer,
@@ -1113,7 +1111,7 @@ class CCtrlMsgWrapper {
11131111

11141112

11151113
/* ----------------------------------------------------------------------- */
1116-
int extractAccessPointList(vector<AccessPoint_t>& l) {
1114+
int extractAccessPointList(std::vector<AccessPoint_t>& l) {
11171115
/* ----------------------------------------------------------------------- */
11181116

11191117
if(checkResponsePayload<CtrlMsgRespScanResult>(answer,

libraries/ESPhost/src/CEspCommunication.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020

2121
#include "CEspCommunication.h"
2222

23-
queue<CMsg> CEspCom::to_ESP32_queue;
24-
queue<CMsg> CEspCom::from_ESP32_queue;
25-
queue<CMsg> CEspCom::rxStationQueue;
26-
queue<CMsg> CEspCom::rxSoftApQueue;
23+
std::queue<CMsg> CEspCom::to_ESP32_queue;
24+
std::queue<CMsg> CEspCom::from_ESP32_queue;
25+
std::queue<CMsg> CEspCom::rxStationQueue;
26+
std::queue<CMsg> CEspCom::rxSoftApQueue;
2727
/* -------------------------------------------------------------------------- */
2828
bool CEspCom::send_msg_to_esp(CMsg &msg) {
2929
/* -------------------------------------------------------------------------- */

libraries/ESPhost/src/CEspCommunication.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,12 @@
3030
#include <queue>
3131
#include "CMsg.h"
3232

33-
using namespace std;
34-
3533
class CEspCom {
3634
private:
37-
static queue<CMsg> to_ESP32_queue;
38-
static queue<CMsg> from_ESP32_queue;
39-
static queue<CMsg> rxStationQueue;
40-
static queue<CMsg> rxSoftApQueue;
35+
static std::queue<CMsg> to_ESP32_queue;
36+
static std::queue<CMsg> from_ESP32_queue;
37+
static std::queue<CMsg> rxStationQueue;
38+
static std::queue<CMsg> rxSoftApQueue;
4139
public:
4240
/* application layer call this function when wants to send a message to esp*/
4341
static bool send_msg_to_esp(CMsg &msg);

libraries/ESPhost/src/CEspControl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ int CEspControl::setWifiMode(WifiMode_t mode, EspCallback_f cb) {
602602
/* -------------------------------------------------------------------------- */
603603
/* GET ACCESS POINT SCAN LIST: see GENERAL NOTE ABOUT THE REQUEST function structure above*/
604604
/* -------------------------------------------------------------------------- */
605-
int CEspControl::getAccessPointScanList(vector<AccessPoint_t>& l, EspCallback_f cb) {
605+
int CEspControl::getAccessPointScanList(std::vector<AccessPoint_t>& l, EspCallback_f cb) {
606606
#ifdef ESP_HOST_DEBUG_ENABLED
607607
Serial.println("[REQUEST] CEspControl::getAccessPointScanList");
608608
#endif
@@ -828,7 +828,7 @@ int CEspControl::getSoftAccessPointConfig(SoftApCfg_t &sap_cfg, EspCallback_f cb
828828
/* -------------------------------------------------------------------------- */
829829
/* GET SOFT CONNECTED STATION LIST: see GENERAL NOTE ABOUT THE REQUEST function structure above */
830830
/* -------------------------------------------------------------------------- */
831-
int CEspControl::getSoftConnectedStationList(vector<WifiConnectedSta_t>& l, EspCallback_f cb) {
831+
int CEspControl::getSoftConnectedStationList(std::vector<WifiConnectedSta_t>& l, EspCallback_f cb) {
832832
#ifdef ESP_HOST_DEBUG_ENABLED
833833
Serial.println("[REQUEST] CEspControl::getSoftConnectedStationList");
834834
#endif

libraries/ESPhost/src/CEspControl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class CNetUtilities {
6464
}
6565

6666
static void macArray2macStr(char *mac_out, const uint8_t *mac_in) {
67-
string MAC = "";
67+
std::string MAC = "";
6868
for(int i = 0; i < WIFI_MAC_ADDRESS_DIM; i++) {
6969
MAC += std::to_string(*(mac_in + i));
7070
if(i < WIFI_MAC_ADDRESS_DIM - 1) {
@@ -105,14 +105,14 @@ class CEspControl {
105105
int getWifiMode(WifiMode_t &mode, EspCallback_f cb = nullptr);
106106
int setWifiMode(WifiMode_t mode, EspCallback_f cb = nullptr);
107107

108-
int getAccessPointScanList(vector<AccessPoint_t>& l, EspCallback_f cb = nullptr);
108+
int getAccessPointScanList(std::vector<AccessPoint_t>& l, EspCallback_f cb = nullptr);
109109

110110
int connectAccessPoint(WifiApCfg_t &ap_cfg, EspCallback_f cb = nullptr);
111111
int getAccessPointConfig(WifiApCfg_t &ap, EspCallback_f cb = nullptr);
112112
int disconnectAccessPoint(EspCallback_f cb = nullptr);
113113

114114
int getSoftAccessPointConfig(SoftApCfg_t &sap_cfg, EspCallback_f cb = nullptr);
115-
int getSoftConnectedStationList(vector<WifiConnectedSta_t>& l, EspCallback_f cb = nullptr);
115+
int getSoftConnectedStationList(std::vector<WifiConnectedSta_t>& l, EspCallback_f cb = nullptr);
116116
int setSoftAccessPointVndIe(WifiVendorSoftApIe_t &vendor_ie, EspCallback_f cb = nullptr);
117117
int startSoftAccessPoint(SoftApCfg_t &cfg, EspCallback_f cb = nullptr);
118118
int stopSoftAccessPoint(EspCallback_f cb = nullptr);

libraries/WiFiS3/src/Modem.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
#define DO_NOT_CHECK_CMD "NO_CMD_CHECK"
1616

17-
using namespace std;
18-
1917
class ModemClass {
2018

2119
public:

libraries/WiFiS3/src/StringHelpers.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
#include <vector>
66
#include <algorithm>
77

8-
using namespace std;
9-
108
void ltrim(std::string &s);
119

1210
// trim from end (in place)

libraries/WiFiS3/src/WiFi.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
#include "Modem.h"
1010

1111

12-
using namespace std;
13-
1412
#define DEFAULT_IP_AP_ADDRESS IPAddress(192,168,4,1)
1513
#define DEFAULT_GW_AP_ADDRESS IPAddress(192,168,1,1)
1614
#define DEFAULT_NM_AP_ADDRESS IPAddress(255,255,255,0)

libraries/lwIpWrapper/src/CNetIf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ CNetIf* CLwipIf::net_ifs[] = { nullptr };
99
bool CLwipIf::wifi_hw_initialized = false;
1010
bool CLwipIf::connected_to_access_point = false;
1111
WifiStatus_t CLwipIf::wifi_status = WL_IDLE_STATUS;
12-
queue<struct pbuf*> CLwipIf::eth_queue;
12+
std::queue<struct pbuf*> CLwipIf::eth_queue;
1313
bool CLwipIf::pending_eth_rx = false;
1414

1515
FspTimer CLwipIf::timer;

libraries/lwIpWrapper/src/CNetIf.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ typedef enum {
9393
#define MAX_DHCP_TRIES 4
9494
#define TIMEOUT_DNS_REQUEST 10000U
9595

96-
using namespace std;
97-
9896
class CNetIf;
9997

10098
using NetIfRxCb_f = int (*)(CNetIf*);
@@ -276,7 +274,7 @@ class CWifiSoftAp : public CNetIf {
276274
class CLwipIf {
277275
/* -------------------------------------------------------------------------- */
278276
private:
279-
static queue<struct pbuf*> eth_queue;
277+
static std::queue<struct pbuf*> eth_queue;
280278

281279
bool eth_initialized;
282280

@@ -296,7 +294,7 @@ class CLwipIf {
296294
static void timer_cb(timer_callback_args_t* arg);
297295
#endif
298296

299-
vector<AccessPoint_t> access_points;
297+
std::vector<AccessPoint_t> access_points;
300298
WifiApCfg_t access_point_cfg;
301299

302300
SoftApCfg_t soft_ap_cfg;

0 commit comments

Comments
 (0)