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

Fix compilation errors #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dwrobel
Copy link

@dwrobel dwrobel commented Aug 14, 2024

Fixes the following compilation errors:

discover_fake_DS18B20.ino: In function 'void setup()': discover_fake_DS18B20.ino:94:18: error: ISO C++ forbids
converting a string constant to 'char*' [-Werror=write-strings]
94 | char *file = FILE;
| ^~~~~~~~
discover_fake_DS18B20.ino: In function 'void loop()':
discover_fake_DS18B20.ino:277:23: error: comparison is always true
due to limited range of data type [-Werror=type-limits]
277 | ((buffer2[6] >= 0x00) && (buffer2[6] <= 0x10)) ){
| ~~~~~~~~~~~^~~~~~~

classify_fake_DS18B20.ino:328:38: error: comparison of promoted
bitwise complement of an unsigned value with unsigned
[-Werror=sign-compare]
328 | if ((sp21b == ~sp21) && (sp22b == ~sp22)) {
| ~~~~~~^~~~~~~~
328 | if ((sp21b == ~sp21) && (sp22b == ~sp22)) {
| ~~~~~~^~~~~~~~

Fixes the following compilation errors:

discover_fake_DS18B20.ino: In function 'void setup()':
discover_fake_DS18B20.ino:94:18: error: ISO C++ forbids
  converting a string constant to 'char*' [-Werror=write-strings]
   94 |     char *file = __FILE__;
      |                  ^~~~~~~~
discover_fake_DS18B20.ino: In function 'void loop()':
discover_fake_DS18B20.ino:277:23: error: comparison is always true
  due to limited range of data type [-Werror=type-limits]
  277 |          ((buffer2[6] >= 0x00) && (buffer2[6] <= 0x10)) ){
      |            ~~~~~~~~~~~^~~~~~~

classify_fake_DS18B20.ino:328:38: error: comparison of promoted
  bitwise complement of an unsigned value with unsigned
    [-Werror=sign-compare]
  328 |       if ((sp21b == ~sp21) && (sp22b == ~sp22)) {
      |            ~~~~~~^~~~~~~~
  328 |       if ((sp21b == ~sp21) && (sp22b == ~sp22)) {
      |                                ~~~~~~^~~~~~~~

Signed-off-by: Damian Wrobel <[email protected]>
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

Successfully merging this pull request may close these issues.

1 participant