samm-git / btest-opensource

Mikrotik btest (bandwith test) protocol description and opensource implementation
MIT License
143 stars 29 forks source link

Does not compile under osx #4

Closed samm-git closed 7 years ago

samm-git commented 8 years ago
bash-3.2$ clang -Wall btest.c
btest.c:83:6: warning: unused variable 'flags' [-Wunused-variable]
        int flags, opt;
            ^
btest.c:215:7: warning: unused variable 'buffer' [-Wunused-variable]
        char buffer[1024];
             ^
btest.c:297:2: warning: '/*' within block comment [-Wcomment]
        /*loop while connection is live*/
        ^
btest.c:259:6: warning: unused variable 'i' [-Wunused-variable]
        int i;
            ^
btest.c:298:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
btest.c:362:28: warning: passing 'int *' to parameter of type 'unsigned int *' converts between pointers to integer types with different sign [-Wpointer-sign]
        unpackShortLE(&cmdStr[4], &cmd.tx_size);
                                  ^~~~~~~~~~~~
btest.c:324:55: note: passing argument to parameter 'pres' here
void unpackShortLE (unsigned char *buf, unsigned int *pres) {
                                                      ^
btest.c:365:28: warning: passing 'int *' to parameter of type 'unsigned int *' converts between pointers to integer types with different sign [-Wpointer-sign]
        unpackShortLE(&cmdStr[6], &cmd.client_buf_size);
                                  ^~~~~~~~~~~~~~~~~~~~
btest.c:324:55: note: passing argument to parameter 'pres' here
void unpackShortLE (unsigned char *buf, unsigned int *pres) {
                                                      ^
btest.c:353:6: warning: unused variable 'i' [-Wunused-variable]
        int i;
            ^
btest.c:460:2: error: unknown type name 'clockid_t'; did you mean 'clock_t'?
        clockid_t clock_id;
        ^~~~~~~~~
        clock_t
/usr/include/sys/_types/_clock_t.h:30:33: note: 'clock_t' declared here
typedef __darwin_clock_t        clock_t;
                                ^
btest.c:494:2: warning: implicit declaration of function 'clock_gettime' is invalid in C99 [-Wimplicit-function-declaration]
        clock_gettime(CLOCK_REALTIME, &nextPacketTime);
        ^
btest.c:494:16: error: use of undeclared identifier 'CLOCK_REALTIME'
        clock_gettime(CLOCK_REALTIME, &nextPacketTime);
                      ^
btest.c:514:7: warning: implicit declaration of function 'clock_nanosleep' is invalid in C99 [-Wimplicit-function-declaration]
                if (clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, &nextPacketTime, NULL) < 0) {
                    ^
btest.c:514:23: error: use of undeclared identifier 'CLOCK_REALTIME'
                if (clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, &nextPacketTime, NULL) < 0) {
                                    ^
btest.c:514:39: error: use of undeclared identifier 'TIMER_ABSTIME'
                if (clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, &nextPacketTime, NULL) < 0) {
                                                    ^
btest.c:558:18: error: use of undeclared identifier 'CLOCK_REALTIME'
                        clock_gettime(CLOCK_REALTIME, &now);
                                      ^
btest.c:678:16: error: use of undeclared identifier 'CLOCK_REALTIME'
        clock_gettime(CLOCK_REALTIME, &nextStatusTime);
                      ^
btest.c:685:17: error: use of undeclared identifier 'CLOCK_REALTIME'
                clock_gettime(CLOCK_REALTIME, &now);
                              ^
btest.c:703:17: error: use of undeclared identifier 'CLOCK_REALTIME'
                clock_gettime(CLOCK_REALTIME, &now);
                              ^
btest.c:727:6: warning: unused variable 'ret' [-Wunused-variable]
        int ret;
            ^
btest.c:754:14: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
        while(nBytes=recv(cmdsock,buffer,1024,0)){
              ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
btest.c:754:14: note: place parentheses around the assignment to silence this warning
        while(nBytes=recv(cmdsock,buffer,1024,0)){
                    ^
              (                                 )
btest.c:754:14: note: use '==' to turn this assignment into an equality comparison
        while(nBytes=recv(cmdsock,buffer,1024,0)){
                    ^
                    ==
btest.c:743:12: warning: unused variable 'pth_rx' [-Wunused-variable]
        pthread_t pth_rx;
                  ^
13 warnings and 8 errors generated.