Skip to content

Commit d59fcb8

Browse files
committed
Fixing warnings (David H. Lynch Jr).
1 parent fe8af70 commit d59fcb8

File tree

6 files changed

+47
-48
lines changed

6 files changed

+47
-48
lines changed

hardware/arduino/cores/arduino/Print.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void Print::write(const uint8_t *buffer, size_t size)
4545

4646
void Print::print(const String &s)
4747
{
48-
for (int i = 0; i < s.length(); i++) {
48+
for (unsigned int i = 0; i < s.length(); i++) {
4949
write(s[i]);
5050
}
5151
}

hardware/arduino/cores/arduino/WString.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class String
6767
int lastIndexOf( char ch, unsigned int fromIndex ) const;
6868
int lastIndexOf( const String &str ) const;
6969
int lastIndexOf( const String &str, unsigned int fromIndex ) const;
70-
const unsigned int length( ) const { return _length; }
70+
unsigned int length( ) const { return _length; }
7171
void setCharAt(unsigned int index, const char ch);
7272
unsigned char startsWith( const String &prefix ) const;
7373
unsigned char startsWith( const String &prefix, unsigned int toffset ) const;

hardware/arduino/cores/arduino/pins_arduino.c

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -81,50 +81,50 @@
8181
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
8282
const uint16_t PROGMEM port_to_mode_PGM[] = {
8383
NOT_A_PORT,
84-
&DDRA,
85-
&DDRB,
86-
&DDRC,
87-
&DDRD,
88-
&DDRE,
89-
&DDRF,
90-
&DDRG,
91-
&DDRH,
84+
(uint16_t) &DDRA,
85+
(uint16_t) &DDRB,
86+
(uint16_t) &DDRC,
87+
(uint16_t) &DDRD,
88+
(uint16_t) &DDRE,
89+
(uint16_t) &DDRF,
90+
(uint16_t) &DDRG,
91+
(uint16_t) &DDRH,
9292
NOT_A_PORT,
93-
&DDRJ,
94-
&DDRK,
95-
&DDRL,
93+
(uint16_t) &DDRJ,
94+
(uint16_t) &DDRK,
95+
(uint16_t) &DDRL,
9696
};
9797

9898
const uint16_t PROGMEM port_to_output_PGM[] = {
9999
NOT_A_PORT,
100-
&PORTA,
101-
&PORTB,
102-
&PORTC,
103-
&PORTD,
104-
&PORTE,
105-
&PORTF,
106-
&PORTG,
107-
&PORTH,
100+
(uint16_t) &PORTA,
101+
(uint16_t) &PORTB,
102+
(uint16_t) &PORTC,
103+
(uint16_t) &PORTD,
104+
(uint16_t) &PORTE,
105+
(uint16_t) &PORTF,
106+
(uint16_t) &PORTG,
107+
(uint16_t) &PORTH,
108108
NOT_A_PORT,
109-
&PORTJ,
110-
&PORTK,
111-
&PORTL,
109+
(uint16_t) &PORTJ,
110+
(uint16_t) &PORTK,
111+
(uint16_t) &PORTL,
112112
};
113113

114114
const uint16_t PROGMEM port_to_input_PGM[] = {
115115
NOT_A_PIN,
116-
&PINA,
117-
&PINB,
118-
&PINC,
119-
&PIND,
120-
&PINE,
121-
&PINF,
122-
&PING,
123-
&PINH,
116+
(uint16_t) &PINA,
117+
(uint16_t) &PINB,
118+
(uint16_t) &PINC,
119+
(uint16_t) &PIND,
120+
(uint16_t) &PINE,
121+
(uint16_t) &PINF,
122+
(uint16_t) &PING,
123+
(uint16_t) &PINH,
124124
NOT_A_PIN,
125-
&PINJ,
126-
&PINK,
127-
&PINL,
125+
(uint16_t) &PINJ,
126+
(uint16_t) &PINK,
127+
(uint16_t) &PINL,
128128
};
129129

130130
const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
@@ -358,25 +358,25 @@ const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
358358
const uint16_t PROGMEM port_to_mode_PGM[] = {
359359
NOT_A_PORT,
360360
NOT_A_PORT,
361-
&DDRB,
362-
&DDRC,
363-
&DDRD,
361+
(uint16_t) &DDRB,
362+
(uint16_t) &DDRC,
363+
(uint16_t) &DDRD,
364364
};
365365

366366
const uint16_t PROGMEM port_to_output_PGM[] = {
367367
NOT_A_PORT,
368368
NOT_A_PORT,
369-
&PORTB,
370-
&PORTC,
371-
&PORTD,
369+
(uint16_t) &PORTB,
370+
(uint16_t) &PORTC,
371+
(uint16_t) &PORTD,
372372
};
373373

374374
const uint16_t PROGMEM port_to_input_PGM[] = {
375375
NOT_A_PORT,
376376
NOT_A_PORT,
377-
&PINB,
378-
&PINC,
379-
&PIND,
377+
(uint16_t) &PINB,
378+
(uint16_t) &PINC,
379+
(uint16_t) &PIND,
380380
};
381381

382382
const uint8_t PROGMEM digital_pin_to_port_PGM[] = {

libraries/Ethernet/utility/socket.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ static uint16_t local_port;
99
*/
1010
uint8_t socket(SOCKET s, uint8_t protocol, uint16_t port, uint8_t flag)
1111
{
12-
uint8_t ret;
1312
if ((protocol == SnMR::TCP) || (protocol == SnMR::UDP) || (protocol == SnMR::IPRAW) || (protocol == SnMR::MACRAW) || (protocol == SnMR::PPPOE))
1413
{
1514
close(s);

libraries/Ethernet/utility/w5100.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ uint8_t W5100Class::write(uint16_t _addr, uint8_t _data)
134134

135135
uint16_t W5100Class::write(uint16_t _addr, uint8_t *_buf, uint16_t _len)
136136
{
137-
for (int i=0; i<_len; i++)
137+
for (uint16_t i=0; i<_len; i++)
138138
{
139139
setSS();
140140
SPI.transfer(0xF0);
@@ -160,7 +160,7 @@ uint8_t W5100Class::read(uint16_t _addr)
160160

161161
uint16_t W5100Class::read(uint16_t _addr, uint8_t *_buf, uint16_t _len)
162162
{
163-
for (int i=0; i<_len; i++)
163+
for (uint16_t i=0; i<_len; i++)
164164
{
165165
setSS();
166166
SPI.transfer(0x0F);

libraries/SD/File.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void File::write(const uint8_t *buf, size_t size) {
2727
}
2828

2929
int File::peek() {
30-
char c = SD.file.read();
30+
int c = SD.file.read();
3131
if (c != -1) SD.file.seekCur(-1);
3232
return c;
3333
}

0 commit comments

Comments
 (0)