Skip to content

Commit af6e5d3

Browse files
committed
Resolved various compiler warnings
This should make Jenkins happy.
1 parent 7f9fd84 commit af6e5d3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+123
-87
lines changed

libraries/Bounce2/Bounce2.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Bounce::Bounce() {
1818
void Bounce::attach(int pin) {
1919
this->pin = pin;
2020
debouncedState = unstableState = digitalRead(pin);
21-
#ifdef BOUNCE_LOCK-OUT
21+
#ifdef BOUNCE_LOCK_OUT
2222
previous_millis = 0;
2323
#else
2424
previous_millis = millis();
@@ -37,7 +37,7 @@ void Bounce::interval(unsigned long interval_millis)
3737
bool Bounce::update()
3838
{
3939

40-
#ifdef BOUNCE_LOCK-OUT
40+
#ifdef BOUNCE_LOCK_OUT
4141
stateChanged = false;
4242
// Ignore everything if we are locked out
4343
if (millis() - previous_millis >= interval_millis) {

libraries/Bounce2/Bounce2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2525

2626
// Uncomment the following line for "LOCK-OUT" debounce method
27-
//#define BOUNCE_LOCK-OUT
27+
//#define BOUNCE_LOCK_OUT
2828

2929

3030
#ifndef Bounce2_h

libraries/DHT/DHT.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ void DHT::readSensor()
142142
// - Then 40 bits: RISING and then a FALLING edge per bit
143143
// To keep our code simple, we accept any HIGH or LOW reading if it's max 85 usecs long
144144

145-
word rawHumidity;
146-
word rawTemperature;
147-
word data;
145+
word rawHumidity = 0;
146+
word rawTemperature = 0;
147+
word data = 0;
148148

149149
for ( int8_t i = -3 ; i < 2 * 40; i++ ) {
150150
byte age;

libraries/DallasTemperature/DallasTemperature.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,7 @@ void DallasTemperature::setAlarmHandler(AlarmHandler *handler)
700700
// The default alarm handler
701701
void DallasTemperature::defaultAlarmHandler(const uint8_t* deviceAddress)
702702
{
703+
(void)deviceAddress;
703704
}
704705

705706
#endif

libraries/DigitalIO/SoftI2cMaster.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
*/
5151
bool I2cMasterBase::transfer(uint8_t addrRW,
5252
void *buf, size_t nbytes, uint8_t option) {
53-
uint8_t* p = reinterpret_cast<uint8_t*>(buf);
5453
if (_state != STATE_REP_START) {
5554
start();
5655
}

libraries/DigitalIO/SoftI2cMaster.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class SoftI2cMaster : public I2cMasterBase {
132132
//----------------------------------------------------------------------------
133133
void sclDelay(uint8_t n) {_delay_loop_1(n);}
134134
//----------------------------------------------------------------------------
135-
bool writeScl(bool value) {
135+
void writeScl(bool value) {
136136
uint8_t s = SREG;
137137
noInterrupts();
138138
if (value == LOW) {
@@ -145,7 +145,7 @@ class SoftI2cMaster : public I2cMasterBase {
145145
SREG = s;
146146
}
147147
//----------------------------------------------------------------------------
148-
bool writeSda(bool value) {
148+
void writeSda(bool value) {
149149
uint8_t s = SREG;
150150
noInterrupts();
151151
if (value == LOW) {

libraries/IRLib/IRLib.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ bool IRdecodeRC6::decode(void) {
649649
* Hopefully this code is unique for each button.
650650
*/
651651
#define FNV_PRIME_32 16777619
652-
#define FNV_BASIS_32 2166136261
652+
#define FNV_BASIS_32 2166136261UL
653653
// Compare two tick values, returning 0 if newval is shorter,
654654
// 1 if newval is equal, and 2 if newval is longer
655655
int IRdecodeHash::compare(unsigned int oldval, unsigned int newval) {
@@ -730,12 +730,12 @@ void IRrecvBase::resume() {
730730
bool IRrecvLoop::GetResults(IRdecodeBase *decoder) {
731731
bool Finished=false;
732732
byte OldState=HIGH;byte NewState;
733-
unsigned long StartTime, DeltaTime, EndTime;
733+
unsigned long StartTime, DeltaTime=0, EndTime=0;
734734
StartTime=micros();
735735
while(irparams.rawlen<RAWBUF) { //While the buffer not overflowing
736736
while(OldState==(NewState=digitalRead(irparams.recvpin))) { //While the pin hasn't changed
737737
if( (DeltaTime = (EndTime=micros()) - StartTime) > 10000) { //If it's a very long wait
738-
if(Finished=irparams.rawlen) break; //finished unless it's the opening gap
738+
if((Finished=irparams.rawlen)) break; //finished unless it's the opening gap
739739
}
740740
}
741741
if(Finished) break;
@@ -798,6 +798,9 @@ void IRrecvPCI_Handler(){
798798
case STATE_IDLE:
799799
if(digitalRead(irparams.recvpin)) return; else irparams.rcvstate=STATE_RUNNING;
800800
break;
801+
default:
802+
// what of STATE_UNKNOWN, STATE_MARK and STATE_SPACE?
803+
break;
801804
};
802805
irparams.rawbuf[irparams.rawlen]=DeltaTime;
803806
irparams.timer=ChangeTime;
@@ -982,6 +985,9 @@ ISR(TIMER_INTR_NAME)
982985
irparams.timer = 0;
983986
}
984987
break;
988+
default:
989+
// what of STATE_UNKNOWN and STATE_RUNNING?
990+
break;
985991
}
986992
do_Blink();
987993
}

libraries/IRLib/IRLib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
#define RAWBUF 100 // Length of raw duration buffer (cannot exceed 255)
5050

51-
typedef char IRTYPES; //formerly was an enum
51+
typedef unsigned char IRTYPES; //formerly was an enum
5252
#define UNKNOWN 0
5353
#define NEC 1
5454
#define SONY 2

libraries/LiquidCrystal/LCD.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ inline static void waitUsec ( uint16_t uSec )
9090
{
9191
#ifndef FAST_MODE
9292
delayMicroseconds ( uSec );
93+
#else
94+
(void)uSec;
9395
#endif // FAST_MODE
9496
}
9597

@@ -481,7 +483,7 @@ class LCD : public Print
481483
@param value: pin associated to backlight control.
482484
@param pol: backlight polarity control (POSITIVE, NEGATIVE)
483485
*/
484-
virtual void setBacklightPin ( uint8_t value, t_backlighPol pol ) { };
486+
virtual void setBacklightPin ( uint8_t /*value*/, t_backlighPol /*pol*/ ) { };
485487

486488
/*!
487489
@function
@@ -500,7 +502,7 @@ class LCD : public Print
500502
BACKLIGHT_OFF will be interpreted as off and BACKLIGHT_ON will drive the
501503
backlight on.
502504
*/
503-
virtual void setBacklight ( uint8_t value ) { };
505+
virtual void setBacklight ( uint8_t /*value*/ ) { };
504506

505507
/*!
506508
@function
@@ -514,9 +516,9 @@ class LCD : public Print
514516
@param value[in] Value to write to the LCD.
515517
*/
516518
#if (ARDUINO < 100)
517-
virtual void write(uint8_t value);
519+
virtual void write(uint8_t /*value*/);
518520
#else
519-
virtual size_t write(uint8_t value);
521+
virtual size_t write(uint8_t /*value*/);
520522
#endif
521523

522524
#if (ARDUINO < 100)
@@ -566,9 +568,9 @@ class LCD : public Print
566568
the LCD.
567569
*/
568570
#if (ARDUINO < 100)
569-
virtual void send(uint8_t value, uint8_t mode) { };
571+
virtual void send(uint8_t /*value*/, uint8_t /*mode*/) { };
570572
#else
571-
virtual void send(uint8_t value, uint8_t mode) = 0;
573+
virtual void send(uint8_t /*value*/, uint8_t /*mode*/) = 0;
572574
#endif
573575

574576
};

libraries/LiquidCrystal/LiquidCrystal_I2C_ByVac.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
LiquidCrystal_I2C_ByVac::LiquidCrystal_I2C_ByVac( uint8_t lcd_Addr )
3939
{
4040
_Addr = lcd_Addr;
41-
_polarity == NEGATIVE;
41+
_polarity = NEGATIVE;
4242
}
4343

4444
// PUBLIC METHODS

0 commit comments

Comments
 (0)