Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hasenradball opened this issue Jan 22, 2022 · 0 comments

Comments

@hasenradball
Copy link

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++)'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant