Skip to content

Commit 04790ce

Browse files
committed
Revert "ATCmdParser: Added namespace std for va_list"
This reverts commit 6775c9f. Going to 5.11
1 parent 894b0df commit 04790ce

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

platform/ATCmdParser.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121
#include "ATCmdParser.h"
2222
#include "mbed_poll.h"
2323
#include "mbed_debug.h"
24-
#include <stdio.h>
25-
#include <stdlib.h>
26-
#include <string.h>
2724

2825
#ifdef LF
2926
#undef LF
@@ -105,7 +102,7 @@ int ATCmdParser::read(char *data, int size)
105102

106103

107104
// printf/scanf handling
108-
int ATCmdParser::vprintf(const char *format, std::va_list args)
105+
int ATCmdParser::vprintf(const char *format, va_list args)
109106
{
110107

111108
if (vsprintf(_buffer, format, args) < 0) {
@@ -121,7 +118,7 @@ int ATCmdParser::vprintf(const char *format, std::va_list args)
121118
return i;
122119
}
123120

124-
int ATCmdParser::vscanf(const char *format, std::va_list args)
121+
int ATCmdParser::vscanf(const char *format, va_list args)
125122
{
126123
// Since format is const, we need to copy it into our buffer to
127124
// add the line's null terminator and clobber value-matches with asterisks.
@@ -184,7 +181,7 @@ int ATCmdParser::vscanf(const char *format, std::va_list args)
184181

185182

186183
// Command parsing with line handling
187-
bool ATCmdParser::vsend(const char *command, std::va_list args)
184+
bool ATCmdParser::vsend(const char *command, va_list args)
188185
{
189186
// Create and send command
190187
if (vsprintf(_buffer, command, args) < 0) {
@@ -208,7 +205,7 @@ bool ATCmdParser::vsend(const char *command, std::va_list args)
208205
return true;
209206
}
210207

211-
bool ATCmdParser::vrecv(const char *response, std::va_list args)
208+
bool ATCmdParser::vrecv(const char *response, va_list args)
212209
{
213210
restart:
214211
_aborted = false;
@@ -341,7 +338,7 @@ bool ATCmdParser::vrecv(const char *response, std::va_list args)
341338
// Mapping to vararg functions
342339
int ATCmdParser::printf(const char *format, ...)
343340
{
344-
std::va_list args;
341+
va_list args;
345342
va_start(args, format);
346343
int res = vprintf(format, args);
347344
va_end(args);
@@ -350,7 +347,7 @@ int ATCmdParser::printf(const char *format, ...)
350347

351348
int ATCmdParser::scanf(const char *format, ...)
352349
{
353-
std::va_list args;
350+
va_list args;
354351
va_start(args, format);
355352
int res = vscanf(format, args);
356353
va_end(args);
@@ -359,7 +356,7 @@ int ATCmdParser::scanf(const char *format, ...)
359356

360357
bool ATCmdParser::send(const char *command, ...)
361358
{
362-
std::va_list args;
359+
va_list args;
363360
va_start(args, command);
364361
bool res = vsend(command, args);
365362
va_end(args);
@@ -368,7 +365,7 @@ bool ATCmdParser::send(const char *command, ...)
368365

369366
bool ATCmdParser::recv(const char *response, ...)
370367
{
371-
std::va_list args;
368+
va_list args;
372369
va_start(args, response);
373370
bool res = vrecv(response, args);
374371
va_end(args);

platform/ATCmdParser.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ class ATCmdParser : private NonCopyable<ATCmdParser> {
203203
*/
204204
bool send(const char *command, ...) MBED_PRINTF_METHOD(1, 2);
205205

206-
bool vsend(const char *command, std::va_list args);
206+
bool vsend(const char *command, va_list args);
207207

208208
/**
209209
* Receive an AT response
@@ -221,7 +221,7 @@ class ATCmdParser : private NonCopyable<ATCmdParser> {
221221
*/
222222
bool recv(const char *response, ...) MBED_SCANF_METHOD(1, 2);
223223

224-
bool vrecv(const char *response, std::va_list args);
224+
bool vrecv(const char *response, va_list args);
225225

226226
/**
227227
* Write a single byte to the underlying stream
@@ -266,7 +266,7 @@ class ATCmdParser : private NonCopyable<ATCmdParser> {
266266
*/
267267
int printf(const char *format, ...) MBED_PRINTF_METHOD(1, 2);
268268

269-
int vprintf(const char *format, std::va_list args);
269+
int vprintf(const char *format, va_list args);
270270

271271
/**
272272
* Direct scanf on underlying stream
@@ -278,7 +278,7 @@ class ATCmdParser : private NonCopyable<ATCmdParser> {
278278
*/
279279
int scanf(const char *format, ...) MBED_SCANF_METHOD(1, 2);
280280

281-
int vscanf(const char *format, std::va_list args);
281+
int vscanf(const char *format, va_list args);
282282

283283
/**
284284
* Attach a callback for out-of-band data

0 commit comments

Comments
 (0)