From 14ad2d722b9d3024934c36e03ff8c78d0f093c74 Mon Sep 17 00:00:00 2001 From: Ron Sluiter Date: Tue, 27 May 2003 14:09:10 +0000 Subject: [PATCH] Restore errlogPrintf in debug messages. --- acsApp/src/devMCB4B.cc | 17 +++++------------ acsApp/src/drvMCB4B.cc | 21 ++++++--------------- 2 files changed, 11 insertions(+), 27 deletions(-) diff --git a/acsApp/src/devMCB4B.cc b/acsApp/src/devMCB4B.cc index f6bb69b..e509cdb 100644 --- a/acsApp/src/devMCB4B.cc +++ b/acsApp/src/devMCB4B.cc @@ -29,25 +29,18 @@ extern struct driver_table MCB4B_access; #define NINT(f) (long)((f)>0 ? (f)+0.5 : (f)-0.5) #ifdef __GNUG__ - #ifdef DEBUG + #ifdef DEBUG volatile int devMCB4BDebug = 0; - #define Debug(l, f, args...) { if(l<=devMCB4BDebug) printf(f,## args); } + #define Debug(L, FMT, V...) { if(L <= devMCB4BDebug) \ + { errlogPrintf("%s(%d):",__FILE__,__LINE__); \ + errlogPrintf(FMT,##V); } } #else - #define Debug(l, f, args...) + #define Debug(L, FMT, V...) #endif #else #define Debug() #endif -/* -#ifdef NODEBUG -#define Debug(L,FMT,V) ; -#else -#define Debug(L,FMT,V...) { if(L <= devMCB4BDebug) \ - { errlogPrintf("%s(%d):",__FILE__,__LINE__); \ - errlogPrintf(FMT,##V); } } -#endif -*/ /* Debugging levels: * devMCB4BDebug >= 3 Print new part of command and command string so far diff --git a/acsApp/src/drvMCB4B.cc b/acsApp/src/drvMCB4B.cc index 19618e1..9ee39bc 100644 --- a/acsApp/src/drvMCB4B.cc +++ b/acsApp/src/drvMCB4B.cc @@ -31,26 +31,18 @@ #define BUFF_SIZE 100 /* Maximum length of string to/from MCB4B */ #ifdef __GNUG__ - #ifdef DEBUG + #ifdef DEBUG volatile int drvMCB4BDebug = 0; - #define Debug(l, f, args...) { if(l<=drvMCB4BDebug) printf(f,## args); } + #define Debug(L, FMT, V...) { if(L <= drvMCB4BDebug) \ + { errlogPrintf("%s(%d):",__FILE__,__LINE__); \ + errlogPrintf(FMT,##V); } } #else - #define Debug(l, f, args...) + #define Debug(L, FMT, V...) #endif #else #define Debug() #endif -/* -#ifdef NODEBUG -#define Debug(L,FMT,V) ; -#else -#define Debug(L,FMT,V...) { if(L <= drvMCB4BDebug) \ - { errlogPrintf("%s(%d):",__FILE__,__LINE__); \ - errlogPrintf(FMT,##V); } } -#endif -*/ - /* Debugging notes: * drvMCB4BDebug == 0 No debugging information is printed * drvMCB4BDebug >= 1 Warning information is printed @@ -60,7 +52,6 @@ */ int MCB4B_num_cards = 0; -volatile int drvMCB4BDebug = 0; /* Local data required for every driver; see "motordrvComCode.h" */ #include "motordrvComCode.h" @@ -264,7 +255,7 @@ STATIC int set_status(int card, int signal) { strcpy(buff, nodeptr->postmsgptr); strcat(buff, "\r"); - send_mess(card, buff, NULL); + send_mess(card, buff, (char) NULL); /* The MCB4B always sends back a response, read it and discard */ recv_mess(card, buff, WAIT); nodeptr->postmsgptr = NULL;