Fix coding error in send loops (specify bit size of literal)

This commit is contained in:
Bluechip
2015-07-01 20:06:51 +01:00
parent 4e5608f25f
commit ec5e1bd5f9
12 changed files with 14 additions and 14 deletions

View File

@@ -64,7 +64,7 @@ void IRsend::sendRC5 (unsigned long data, int nbits)
mark(RC5_T1);
// Data
for (unsigned long mask = 1 << (nbits - 1); mask; mask >>= 1) {
for (unsigned long mask = 1UL << (nbits - 1); mask; mask >>= 1) {
if (data & mask) {
space(RC5_T1); // 1 is space, then mark
mark(RC5_T1);
@@ -141,7 +141,7 @@ void IRsend::sendRC6 (unsigned long data, int nbits)
space(RC6_T1);
// Data
for (unsigned long i = 1, mask = 1 << (nbits - 1); mask; i++, mask >>= 1) {
for (unsigned long i = 1, mask = 1UL << (nbits - 1); mask; i++, mask >>= 1) {
// The fourth bit we send is a "double width trailer bit"
int t = (i == 4) ? (RC6_T1 * 2) : (RC6_T1) ;
if (data & mask) {