iguanaworks / iguanair

Iguanaworks USB IR Project: firmware and software
http://www.iguanaworks.net
23 stars 12 forks source link

BSD fixes + last missing manpage #32

Closed leamas closed 7 years ago

leamas commented 7 years ago

The missing --help for rescan was my bad, now fixed and a manpage generated.

This code builds on BSD, but is not tested. The compiler warningsn below looks valid and should IMHO be fixed.

usr/home/mk/IguanaIR-1.1.2/software/usb_ir/daemon.c:71:20: warning:
      incompatible integer to pointer conversion passing 'int' to parameter of
      type 'pthread_t' (aka 'struct pthread *') [-Wint-conversion]
    triggerCommand(QUIT_TRIGGER);
                   ^~~~~~~~~~~~
/usr/home/mk/IguanaIR-1.1.2/software/usb_ir/daemon.c:59:39: note: passing
      argument to parameter 'cmd' here
static void triggerCommand(THREAD_PTR cmd)
                                      ^
/usr/home/mk/IguanaIR-1.1.2/software/usb_ir/daemon.c:76:20: warning: expression
      which evaluates to zero treated as a null pointer constant of type
      'pthread_t' (aka 'struct pthread *') [-Wnon-literal-null-conversion]
    triggerCommand(SCAN_TRIGGER);
                   ^~~~~~~~~~~~
/usr/home/mk/IguanaIR-1.1.2/software/usb_ir/daemon.c:253:29: warning:
      comparison between pointer and integer ('pthread_t'
      (aka 'struct pthread *') and 'int')
            else if (thread == QUIT_TRIGGER)
                     ~~~~~~ ^  ~~~~~~~~~~~~
3 warnings generated.
leamas commented 7 years ago

hm... some, probably not all, dependencies

jdunn14 commented 7 years ago

I agree we should fix the warnings. Really the approach I used there isn't great, but it looks like those warnings would be fixed by a C-style cast in each place. Just add "(THREAD_PTR)" to the left of the two QUIT_TRIGGERs and one SCAN_TRIGGER.

I'll make a TODO to change the inter-thread signalling more protocol sometime.

leamas commented 7 years ago

hm... "we"... :) I presume you do these fixes after merging, right?

EDIT if/when you do, I can make a rebuild to check if required.

jdunn14 commented 7 years ago

Ha, yes I'll take care of it. I assume once I merge this patch we should build properly on Fedora, Debian, and FreeBDS?

leamas commented 7 years ago

Yup. It builds cleanly on Fedora 25, debian testing and FreeBSD 10.3

jdunn14 commented 7 years ago

Done. I'll also check that cmake is still happy on Windows sometime soon and add conditionals as needed.