Changeset 27 for drsdaq/DAQReadout.cc


Ignore:
Timestamp:
04/01/09 14:39:16 (16 years ago)
Author:
ogrimm
Message:
Changed 'char *' to 'const char *'
File:
1 edited

Legend:

Unmodified
Added
Removed
  • drsdaq/DAQReadout.cc

    r22 r27  
    1111#include "DAQReadout.h"
    1212
    13 static char* daq_state_str[] = {"active", "stopped"};
    14 static char* daq_runtype_str[] = {"data", "pedestal", "test"};
    15 
    16 static struct CL_Struct { char *Name;   
     13static const char* daq_state_str[] = {"active", "stopped"};
     14static const char* daq_runtype_str[] = {"data", "pedestal", "test"};
     15
     16static const struct CL_Struct { const char *Name;   
    1717                          void (DAQReadout::*CommandPointer)();
    1818                          bool NeedNotBusy;
    19                           char *Parameters;
    20                           char *Help;
     19                          const char *Parameters;
     20                          const char *Help;
    2121  } CommandList[] =
    2222  {{"board", &DAQReadout::cmd_board, true, "<i> [j] | <all>" ,"Address board i, boards i-j, all boards"},
     
    379379void DAQReadout::cmd_calib() {
    380380  if (NParam==4 && atof(Param[1]) && atof(Param[2]))
    381     CalibrateDRS(Param[3],atof(Param[1]),atof(Param[2]));
     381    CalibrateDRS((char *) Param[3],atof(Param[1]),atof(Param[2]));
    382382  else if (NParam==3 && atof(Param[1]) && atof(Param[2]))
    383383    CalibrateDRS(NULL,atof(Param[1]),atof(Param[2]));
     
    10591059         
    10601060// Print message to selected target
    1061 void DAQReadout::PrintMessage(int Target, char *Format, ...) {
     1061void DAQReadout::PrintMessage(int Target, const char *Format, ...) {
    10621062  va_list ArgumentPointer;
    10631063  va_start(ArgumentPointer, Format);
     
    10671067
    10681068// Print message to screen, log file and socket
    1069 void DAQReadout::PrintMessage(char *Format, ...) {
     1069void DAQReadout::PrintMessage(const char *Format, ...) {
    10701070  va_list ArgumentPointer;
    10711071  va_start(ArgumentPointer, Format);
     
    10751075
    10761076// Function doing the actual printing work
    1077 void DAQReadout::PrintMessage(int Target, char *Format, va_list ArgumentPointer) {
     1077void DAQReadout::PrintMessage(int Target, const char *Format, va_list ArgumentPointer) {
    10781078
    10791079  char Textbuffer[MAX_COM_SIZE];
     
    11121112
    11131113// Check if two strings match (min 1 character must match)
    1114 int Match(char *str, char *cmd) {
    1115   return strncasecmp(str,cmd,strlen(str)==0 ? 1:strlen(str)) ? 0:1;
     1114bool Match(const char *str, const char *cmd) {
     1115  return strncasecmp(str,cmd,strlen(str)==0 ? 1:strlen(str)) ? false:true;
    11161116}
    11171117
     
    11251125
    11261126// Parse command line for white space and double-quote separated tokens
    1127 int ParseInput(char* Command, char *Param[]) {
     1127int ParseInput(char* Command, const char *Param[]) {
    11281128  int Count=0;
    11291129   
     
    11461146
    11471147// ReadCard function by F. Goebel
    1148 int ReadCard(char *card_flag, void *store, char type, FILE *fptr) {
     1148int ReadCard(const char *card_flag, void *store, char type, FILE *fptr) {
    11491149 
    11501150  char *card_name, *card_val, line[160];
Note: See TracChangeset for help on using the changeset viewer.