diff --git a/ir_Aiwa.cpp b/ir_Aiwa.cpp index f56aa99..bd5ba89 100644 --- a/ir_Aiwa.cpp +++ b/ir_Aiwa.cpp @@ -38,7 +38,7 @@ void IRsend::sendAiwaRCT501 (int code) space(AIWA_RC_T501_HDR_SPACE); // Send "pre" data - for (unsigned long mask = 1 << (26 - 1); mask; mask >>= 1) { + for (unsigned long mask = 1UL << (26 - 1); mask; mask >>= 1) { mark(AIWA_RC_T501_BIT_MARK); if (pre & mask) space(AIWA_RC_T501_ONE_SPACE) ; else space(AIWA_RC_T501_ZERO_SPACE) ; diff --git a/ir_Denon.cpp b/ir_Denon.cpp index 7c9b075..c54e286 100644 --- a/ir_Denon.cpp +++ b/ir_Denon.cpp @@ -41,7 +41,7 @@ void IRsend::sendDenon (unsigned long data, int nbits) space(HDR_SPACE); // Data - for (unsigned long mask = 1 << (nbits - 1); mask; mask >>= 1) { + for (unsigned long mask = 1UL << (nbits - 1); mask; mask >>= 1) { if (data & mask) { mark (BIT_MARK); space(ONE_SPACE); diff --git a/ir_Dish.cpp b/ir_Dish.cpp index 387b163..3dad813 100644 --- a/ir_Dish.cpp +++ b/ir_Dish.cpp @@ -39,7 +39,7 @@ void IRsend::sendDISH (unsigned long data, int nbits) mark(DISH_HDR_MARK); space(DISH_HDR_SPACE); - for (unsigned long mask = 1 << (nbits - 1); mask; mask >>= 1) { + for (unsigned long mask = 1UL << (nbits - 1); mask; mask >>= 1) { if (data & mask) { mark(DISH_BIT_MARK); space(DISH_ONE_SPACE); diff --git a/ir_JVC.cpp b/ir_JVC.cpp index 123c20e..eeec20f 100644 --- a/ir_JVC.cpp +++ b/ir_JVC.cpp @@ -36,7 +36,7 @@ void IRsend::sendJVC (unsigned long data, int nbits, bool repeat) } // Data - for (unsigned long mask = 1 << (nbits - 1); mask; mask >>= 1) { + for (unsigned long mask = 1UL << (nbits - 1); mask; mask >>= 1) { if (data & mask) { mark(JVC_BIT_MARK); space(JVC_ONE_SPACE); diff --git a/ir_NEC.cpp b/ir_NEC.cpp index 8da46e8..3b49321 100644 --- a/ir_NEC.cpp +++ b/ir_NEC.cpp @@ -29,7 +29,7 @@ void IRsend::sendNEC (unsigned long data, int nbits) space(NEC_HDR_SPACE); // Data - for (unsigned long mask = 1 << (nbits - 1); mask; mask >>= 1) { + for (unsigned long mask = 1UL << (nbits - 1); mask; mask >>= 1) { if (data & mask) { mark(NEC_BIT_MARK); space(NEC_ONE_SPACE); diff --git a/ir_Panasonic.cpp b/ir_Panasonic.cpp index d3b471a..dc0dd73 100644 --- a/ir_Panasonic.cpp +++ b/ir_Panasonic.cpp @@ -28,14 +28,14 @@ void IRsend::sendPanasonic (unsigned int address, unsigned long data) space(PANASONIC_HDR_SPACE); // Address - for (unsigned long mask = 1 << (16 - 1); mask; mask >>= 1) { + for (unsigned long mask = 1UL << (16 - 1); mask; mask >>= 1) { mark(PANASONIC_BIT_MARK); if (address & mask) space(PANASONIC_ONE_SPACE) ; else space(PANASONIC_ZERO_SPACE) ; } // Data - for (unsigned long mask = 1 << (32 - 1); mask; mask >>= 1) { + for (unsigned long mask = 1UL << (32 - 1); mask; mask >>= 1) { mark(PANASONIC_BIT_MARK); if (data & mask) space(PANASONIC_ONE_SPACE) ; else space(PANASONIC_ZERO_SPACE) ; diff --git a/ir_RC5_RC6.cpp b/ir_RC5_RC6.cpp index 1a9576d..e59e3c0 100644 --- a/ir_RC5_RC6.cpp +++ b/ir_RC5_RC6.cpp @@ -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) { diff --git a/ir_Samsung.cpp b/ir_Samsung.cpp index 65452f2..224487d 100644 --- a/ir_Samsung.cpp +++ b/ir_Samsung.cpp @@ -29,7 +29,7 @@ void IRsend::sendSAMSUNG (unsigned long data, int nbits) space(SAMSUNG_HDR_SPACE); // Data - for (unsigned long mask = 1 << (nbits - 1); mask; mask >>= 1) { + for (unsigned long mask = 1UL << (nbits - 1); mask; mask >>= 1) { if (data & mask) { mark(SAMSUNG_BIT_MARK); space(SAMSUNG_ONE_SPACE); diff --git a/ir_Sharp.cpp b/ir_Sharp.cpp index 13f8a53..73462c5 100644 --- a/ir_Sharp.cpp +++ b/ir_Sharp.cpp @@ -40,7 +40,7 @@ void IRsend::sendSharpRaw (unsigned long data, int nbits) // Sending codes in bursts of 3 (normal, inverted, normal) makes transmission // much more reliable. That's the exact behaviour of CD-S6470 remote control. for (int n = 0; n < 3; n++) { - for (unsigned long mask = 1 << (nbits - 1); mask; mask >>= 1) { + for (unsigned long mask = 1UL << (nbits - 1); mask; mask >>= 1) { if (data & mask) { mark(SHARP_BIT_MARK); space(SHARP_ONE_SPACE); diff --git a/ir_Sony.cpp b/ir_Sony.cpp index e01df55..31e67cf 100644 --- a/ir_Sony.cpp +++ b/ir_Sony.cpp @@ -29,7 +29,7 @@ void IRsend::sendSony (unsigned long data, int nbits) space(SONY_HDR_SPACE); // Data - for (unsigned long mask = 1 << (nbits - 1); mask; mask >>= 1) { + for (unsigned long mask = 1UL << (nbits - 1); mask; mask >>= 1) { if (data & mask) { mark(SONY_ONE_MARK); space(SONY_HDR_SPACE); diff --git a/ir_Template.cpp b/ir_Template.cpp index 474d777..eee2b0b 100644 --- a/ir_Template.cpp +++ b/ir_Template.cpp @@ -126,7 +126,7 @@ void IRsend::sendShuzu (unsigned long data, int nbits) space(HDR_SPACE); // Data - for (unsigned long mask = 1 << (nbits - 1); mask; mask >>= 1) { + for (unsigned long mask = 1UL << (nbits - 1); mask; mask >>= 1) { if (data & mask) { mark (BIT_MARK); space(ONE_SPACE); diff --git a/ir_Whynter.cpp b/ir_Whynter.cpp index 2165cb7..a830562 100644 --- a/ir_Whynter.cpp +++ b/ir_Whynter.cpp @@ -34,7 +34,7 @@ void IRsend::sendWhynter (unsigned long data, int nbits) space(WHYNTER_HDR_SPACE); // Data - for (unsigned long mask = 1 << (nbits - 1); mask; mask >>= 1) { + for (unsigned long mask = 1UL << (nbits - 1); mask; mask >>= 1) { if (data & mask) { mark(WHYNTER_ONE_MARK); space(WHYNTER_ONE_SPACE);