Skip to content

Commit ffeca15

Browse files
authored
Merge pull request #95 from jrowberg/master
Cast pins to signed integers to avoid Wtype-limits compile warning
2 parents cc8daac + c270eaa commit ffeca15

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: cores/arduino/WString.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ String::String(double value, unsigned char decimalPlaces)
121121

122122
String::~String()
123123
{
124-
free(buffer);
124+
if (buffer) free(buffer);
125125
}
126126

127127
/*********************************************/

Diff for: libraries/SoftwareSerial/src/SoftwareSerial.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ void SoftwareSerial::begin(long speed)
316316
_tx_delay = subtract_cap(bit_delay, 15 / 4);
317317

318318
// Only setup rx when we have a valid PCINT for this pin
319-
if (digitalPinToPCICR(_receivePin)) {
319+
if (digitalPinToPCICR((int8_t)_receivePin)) {
320320
#if GCC_VERSION > 40800
321321
// Timings counted from gcc 4.8.2 output. This works up to 115200 on
322322
// 16Mhz and 57600 on 8Mhz.
@@ -357,7 +357,7 @@ void SoftwareSerial::begin(long speed)
357357
// Enable the PCINT for the entire port here, but never disable it
358358
// (others might also need it, so we disable the interrupt by using
359359
// the per-pin PCMSK register).
360-
*digitalPinToPCICR(_receivePin) |= _BV(digitalPinToPCICRbit(_receivePin));
360+
*digitalPinToPCICR((int8_t)_receivePin) |= _BV(digitalPinToPCICRbit(_receivePin));
361361
// Precalculate the pcint mask register and value, so setRxIntMask
362362
// can be used inside the ISR without costing too much time.
363363
_pcint_maskreg = digitalPinToPCMSK(_receivePin);

0 commit comments

Comments
 (0)