2dom/PxMatrix

[Compiler Warning]: Warning: Comparison of Integer Expressions of Different Signedness

hasenradball opened this issue · 0 comments

Issue

'''
X:\libraries\PxMatrix_LED_MATRIX_library/PxMatrix.h: In member function 'void PxMATRIX::writeRegister(uint16_t, uint8_t)':
X:\libraries\PxMatrix_LED_MATRIX_library/PxMatrix.h:469:24: warning: comparison of integer expressions of different signedness: 'uint32_t' {aka 'unsigned int'} and 'int' [-Wsign-compare]
469 | if ((bit_counter == (_send_buffer_size*8 - reg_position-1)))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'''

Explanation

in short, was is checked:
' if ((uint32_t bit_counter == (uint16_t _send_buffer_size*8 - uint8_t reg_position-1)))'

Proposed Solution

Line 459:
'for (uint16_t bit_counter=0; bit_counter < _send_buffer_size*8; bit_counter++)'