@@ -55,8 +55,8 @@ protocol_t* PiCode::findProtocol(const char* name) {
5555 return nullptr ;
5656}
5757
58- /* Convert from array of pulses and lenght to pilight string format. Must be free() after use */
59- char * PiCode::pulseTrainToString (const uint32_t * pulses, unsigned int length, uint8_t repeats){
58+ /* Convert from array of pulses and length to pilight string format. Must be free() after use */
59+ char * PiCode::pulseTrainToString (const uint32_t * pulses, uint16_t length, uint8_t repeats){
6060
6161 bool match = false ;
6262 int diff = 0 ;
@@ -77,7 +77,7 @@ char* PiCode::pulseTrainToString(const uint32_t* pulses, unsigned int length, ui
7777 strcpy (data," c:" );
7878 }
7979
80- for (unsigned int i = 0 ; i < length; i++) {
80+ for (uint16_t i = 0 ; i < length; i++) {
8181 match = false ;
8282 for (uint8_t j = 0 ; j < MAX_PULSE_TYPES; j++) {
8383 // We device these numbers by 10 to normalize them a bit
@@ -186,7 +186,7 @@ static int indexOf(const char* data, char ch, unsigned int fromIndex = 0) {
186186int PiCode::stringToPulseTrain (const char * data, uint32_t * pulses, size_t maxlength){
187187
188188 int length = 0 ; // length of pulse train
189- unsigned int nrpulses = 0 ; // number of pulse types
189+ uint8_t nrpulses = 0 ; // number of pulse types
190190 uint32_t plstypes[MAX_PULSE_TYPES] = {0 }; // array to store pulse types
191191
192192 // Aux string to compose data string //
@@ -351,7 +351,7 @@ char* PiCode::encodeToString(const char* protocol_name, const char* json_data, u
351351 if (protocol->createCode != nullptr ){
352352 n_pulses = encodeToPulseTrain (pulses, protocol, json_data);
353353 if (n_pulses > 0 ){
354- result = pulseTrainToString (pulses,(unsigned int )n_pulses, repeats);
354+ result = pulseTrainToString (pulses,(uint16_t )n_pulses, repeats);
355355 }
356356 }
357357 }
0 commit comments