diff --git a/_include/mdsmsg.h b/_include/mdsmsg.h index 498a0a6465..4faf764be2 100644 --- a/_include/mdsmsg.h +++ b/_include/mdsmsg.h @@ -1,6 +1,8 @@ #include #include +#include +// To activate the MDSDBG() debug messages, uncomment the following line. //#define DEBUG //#undef DEBUG #ifdef MDSDBG @@ -27,7 +29,7 @@ #define __MDSMSGPREFIX(LV) ( \ { \ pos = __FILE__; \ - while (!strncmp(pos, "../", 3)) \ + while (!strncmp(pos, "../", (unsigned long int) 3)) \ pos += 3; \ pos = msg + sprintf(msg, "%c, %u:%lu, %u.%09u: %s:%d ", \ LV, getpid(), CURRENT_THREAD_ID(), \ diff --git a/mdstcpip/mdsipshr/MdsValue.c b/mdstcpip/mdsipshr/MdsValue.c index f770b6e40b..03972d77c0 100644 --- a/mdstcpip/mdsipshr/MdsValue.c +++ b/mdstcpip/mdsipshr/MdsValue.c @@ -77,11 +77,11 @@ EXPORT int MdsIpGetDescriptor(int id, const char *expression, int nargs, strcat(newexp, ",__si($)"); strcat(newexp, "))"); nargs += 2; - MDSDBG(newexp); + MDSDBG("%s", newexp); status = SendArg(id, 0, DTYPE_CSTRING, nargs, strlen(newexp), 0, &dim, (char *)newexp); free(newexp); - MDSDBG(expression); + MDSDBG("%s", expression); struct descriptor_a *arr; status = SendArg(id, 1, DTYPE_CSTRING, nargs, strlen(expression), 0, &dim, (char *)expression); diff --git a/servershr/ServerSendMessage.c b/servershr/ServerSendMessage.c index d75bfbe23c..3b3714a848 100644 --- a/servershr/ServerSendMessage.c +++ b/servershr/ServerSendMessage.c @@ -393,13 +393,14 @@ static void receiver_thread(void *sockptr) FD_ZERO(&fdactive); FD_SET(sock, &fdactive); int rep; + int num = 0; struct timeval readto, timeout = {10, 0}; for (rep = 0; rep < 10; rep++) { for (readfds = fdactive, readto = timeout;; readfds = fdactive, readto = timeout, rep = 0) { - int num = select(FD_SETSIZE, &readfds, NULL, NULL, &readto); + num = select(FD_SETSIZE, &readfds, NULL, NULL, &readto); if (num < 0) break; if (num == 0)