Skip to content

Commit 2136fda

Browse files
cmagliefacchinm
authored andcommitted
Fixed warning about namespace
1 parent 30e4397 commit 2136fda

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

api/String.cpp

+14-12
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
/* Constructors */
2828
/*********************************************/
2929

30-
using namespace arduino;
30+
namespace arduino {
3131

3232
String::String(const char *cstr)
3333
{
@@ -354,77 +354,77 @@ unsigned char String::concat(const __FlashStringHelper * str)
354354
/* Concatenate */
355355
/*********************************************/
356356

357-
StringSumHelper & arduino::operator + (const StringSumHelper &lhs, const String &rhs)
357+
StringSumHelper & operator + (const StringSumHelper &lhs, const String &rhs)
358358
{
359359
StringSumHelper &a = const_cast<StringSumHelper&>(lhs);
360360
if (!a.concat(rhs.buffer, rhs.len)) a.invalidate();
361361
return a;
362362
}
363363

364-
StringSumHelper & arduino::operator + (const StringSumHelper &lhs, const char *cstr)
364+
StringSumHelper & operator + (const StringSumHelper &lhs, const char *cstr)
365365
{
366366
StringSumHelper &a = const_cast<StringSumHelper&>(lhs);
367367
if (!cstr || !a.concat(cstr, strlen(cstr))) a.invalidate();
368368
return a;
369369
}
370370

371-
StringSumHelper & arduino::operator + (const StringSumHelper &lhs, char c)
371+
StringSumHelper & operator + (const StringSumHelper &lhs, char c)
372372
{
373373
StringSumHelper &a = const_cast<StringSumHelper&>(lhs);
374374
if (!a.concat(c)) a.invalidate();
375375
return a;
376376
}
377377

378-
StringSumHelper & arduino::operator + (const StringSumHelper &lhs, unsigned char num)
378+
StringSumHelper & operator + (const StringSumHelper &lhs, unsigned char num)
379379
{
380380
StringSumHelper &a = const_cast<StringSumHelper&>(lhs);
381381
if (!a.concat(num)) a.invalidate();
382382
return a;
383383
}
384384

385-
StringSumHelper & arduino::operator + (const StringSumHelper &lhs, int num)
385+
StringSumHelper & operator + (const StringSumHelper &lhs, int num)
386386
{
387387
StringSumHelper &a = const_cast<StringSumHelper&>(lhs);
388388
if (!a.concat(num)) a.invalidate();
389389
return a;
390390
}
391391

392-
StringSumHelper & arduino::operator + (const StringSumHelper &lhs, unsigned int num)
392+
StringSumHelper & operator + (const StringSumHelper &lhs, unsigned int num)
393393
{
394394
StringSumHelper &a = const_cast<StringSumHelper&>(lhs);
395395
if (!a.concat(num)) a.invalidate();
396396
return a;
397397
}
398398

399-
StringSumHelper & arduino::operator + (const StringSumHelper &lhs, long num)
399+
StringSumHelper & operator + (const StringSumHelper &lhs, long num)
400400
{
401401
StringSumHelper &a = const_cast<StringSumHelper&>(lhs);
402402
if (!a.concat(num)) a.invalidate();
403403
return a;
404404
}
405405

406-
StringSumHelper & arduino::operator + (const StringSumHelper &lhs, unsigned long num)
406+
StringSumHelper & operator + (const StringSumHelper &lhs, unsigned long num)
407407
{
408408
StringSumHelper &a = const_cast<StringSumHelper&>(lhs);
409409
if (!a.concat(num)) a.invalidate();
410410
return a;
411411
}
412412

413-
StringSumHelper & arduino::operator + (const StringSumHelper &lhs, float num)
413+
StringSumHelper & operator + (const StringSumHelper &lhs, float num)
414414
{
415415
StringSumHelper &a = const_cast<StringSumHelper&>(lhs);
416416
if (!a.concat(num)) a.invalidate();
417417
return a;
418418
}
419419

420-
StringSumHelper & arduino::operator + (const StringSumHelper &lhs, double num)
420+
StringSumHelper & operator + (const StringSumHelper &lhs, double num)
421421
{
422422
StringSumHelper &a = const_cast<StringSumHelper&>(lhs);
423423
if (!a.concat(num)) a.invalidate();
424424
return a;
425425
}
426426

427-
StringSumHelper & arduino::operator + (const StringSumHelper &lhs, const __FlashStringHelper *rhs)
427+
StringSumHelper & operator + (const StringSumHelper &lhs, const __FlashStringHelper *rhs)
428428
{
429429
StringSumHelper &a = const_cast<StringSumHelper&>(lhs);
430430
if (!a.concat(rhs)) a.invalidate();
@@ -742,3 +742,5 @@ double String::toDouble(void) const
742742
if (buffer) return atof(buffer);
743743
return 0;
744744
}
745+
746+
} // namespace arduino

api/String.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#endif
3535

3636
namespace arduino {
37+
3738
// When compiling programs with this class, the following gcc parameters
3839
// dramatically increase performance and memory (RAM) efficiency, typically
3940
// with little or no increase in code size.
@@ -246,6 +247,7 @@ class StringSumHelper : public String
246247
StringSumHelper(double num) : String(num) {}
247248
};
248249

249-
}
250+
} // namespace arduino
251+
250252
#endif // __cplusplus
251253
#endif // __ARDUINO_STRINGS__

0 commit comments

Comments
 (0)