Changeset 114
- Timestamp:
- 09/24/09 15:28:55 (15 years ago)
- Location:
- drsdaq
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
drsdaq/DAQReadout.cc
r110 r114 1047 1047 va_list ArgumentPointer; 1048 1048 va_start(ArgumentPointer, Format); 1049 PrintMessage(Format, ArgumentPointer, Target);1049 DoPrintMessage(Format, ArgumentPointer, Target); 1050 1050 va_end(ArgumentPointer); 1051 1051 } … … 1055 1055 va_list ArgumentPointer; 1056 1056 va_start(ArgumentPointer, Format); 1057 if(CmdFromSocket) PrintMessage(Format, ArgumentPointer, MsgToSocket|MsgToLog);1058 else PrintMessage(Format, ArgumentPointer, MsgToConsole|MsgToLog);1057 if(CmdFromSocket) DoPrintMessage(Format, ArgumentPointer, MsgToSocket|MsgToLog); 1058 else DoPrintMessage(Format, ArgumentPointer, MsgToConsole|MsgToLog); 1059 1059 va_end(ArgumentPointer); 1060 1060 } 1061 1061 1062 1062 // Function doing the actual printing work 1063 // It is important that Target is here the last argument, otherwise 1064 // there can be confusion with the variadic versions (this function is 1065 // called instead of PrintMessage(int, const char *, ...) 1066 void DAQReadout::PrintMessage(const char *Format, va_list ArgumentPointer, int Target) { 1063 // Note: Be careful when overloading variadic functions. va_list is 1064 // in gcc an int, which can be interpreted as char *... 1065 void DAQReadout::DoPrintMessage(const char *Format, va_list ArgumentPointer, int Target) { 1067 1066 1068 1067 static char Textbuffer[MAX_COM_SIZE]; // static: it is only allocated once -
drsdaq/DAQReadout.h
r110 r114 131 131 void PrintMessage(int, const char*, ...); 132 132 void PrintMessage(const char*, ...); 133 void PrintMessage(const char*, va_list, int);133 void DoPrintMessage(const char*, va_list, int); 134 134 bool OpenRawFile(); 135 135 bool WriteRunHeader();
Note:
See TracChangeset
for help on using the changeset viewer.