Skip to content

Commit c86eed9

Browse files
committed
Fixed String class regression after f80c6c5
This should make explicit String-from-integer constructor working again: int a = 10; String(a, 4);
1 parent 2ebd47a commit c86eed9

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

hardware/arduino/avr/cores/arduino/WString.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ String::String(unsigned long value, unsigned char base)
106106
*this = buf;
107107
}
108108

109-
String::String(float value, int decimalPlaces)
109+
String::String(float value, unsigned char decimalPlaces)
110110
{
111111
init();
112112
char buf[33];
113113
*this = dtostrf(value, (decimalPlaces + 2), decimalPlaces, buf);
114114
}
115115

116-
String::String(double value, int decimalPlaces)
116+
String::String(double value, unsigned char decimalPlaces)
117117
{
118118
init();
119119
char buf[33];

hardware/arduino/avr/cores/arduino/WString.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ class String
6969
explicit String(unsigned int, unsigned char base=10);
7070
explicit String(long, unsigned char base=10);
7171
explicit String(unsigned long, unsigned char base=10);
72-
explicit String(float, int decimalPlaces=2);
73-
explicit String(double, int decimalPlaces=2);
72+
explicit String(float, unsigned char decimalPlaces=2);
73+
explicit String(double, unsigned char decimalPlaces=2);
7474
~String(void);
7575

7676
// memory management
@@ -113,7 +113,7 @@ class String
113113
String & operator += (const String &rhs) {concat(rhs); return (*this);}
114114
String & operator += (const char *cstr) {concat(cstr); return (*this);}
115115
String & operator += (char c) {concat(c); return (*this);}
116-
String & operator += (unsigned char num) {concat(num); return (*this);}
116+
String & operator += (unsigned char num) {concat(num); return (*this);}
117117
String & operator += (int num) {concat(num); return (*this);}
118118
String & operator += (unsigned int num) {concat(num); return (*this);}
119119
String & operator += (long num) {concat(num); return (*this);}

hardware/arduino/sam/cores/arduino/WString.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,14 @@ String::String(unsigned long value, unsigned char base)
107107
*this = buf;
108108
}
109109

110-
String::String(float value, int decimalPlaces)
110+
String::String(float value, unsigned char decimalPlaces)
111111
{
112112
init();
113113
char buf[33];
114114
*this = dtostrf(value, (decimalPlaces + 2), decimalPlaces, buf);
115115
}
116116

117-
String::String(double value, int decimalPlaces)
117+
String::String(double value, unsigned char decimalPlaces)
118118
{
119119
init();
120120
char buf[33];

hardware/arduino/sam/cores/arduino/WString.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ class String
6969
explicit String(unsigned int, unsigned char base=10);
7070
explicit String(long, unsigned char base=10);
7171
explicit String(unsigned long, unsigned char base=10);
72-
explicit String(float, int decimalPlaces=2);
73-
explicit String(double, int decimalPlaces=2);
72+
explicit String(float, unsigned char decimalPlaces=2);
73+
explicit String(double, unsigned char decimalPlaces=2);
7474
~String(void);
7575

7676
// memory management

0 commit comments

Comments
 (0)