Changeset 27


Ignore:
Timestamp:
04/01/09 14:39:16 (16 years ago)
Author:
ogrimm
Message:
Changed 'char *' to 'const char *'
Location:
drsdaq
Files:
5 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];
  • drsdaq/DAQReadout.h

    r22 r27  
    44#include <stdlib.h>
    55#include <stdarg.h>
     6#include <ctype.h>
    67#include <time.h>
    78#include <errno.h>
     
    6061    // Status variables   
    6162    int NParam;                 // Number of parameters
    62     char *Param[MAX_NUM_TOKEN]; // Pointers to parameters
     63    const char *Param[MAX_NUM_TOKEN]; // Pointers to parameters
    6364    bool CmdFromSocket;         // Current command issued via socket
    6465    int NumCMCBoards;
     
    121122    void ReadCalibratedDRSData();
    122123    void ReadandPrintDRSData(int, int, int);
    123     void PrintMessage(int, char*, ...);
    124     void PrintMessage(char*, ...);
    125     void PrintMessage(int, char*, va_list);
     124    void PrintMessage(int, const char*, ...);
     125    void PrintMessage(const char*, ...);
     126    void PrintMessage(int, const char*, va_list);
    126127    bool OpenRawFile(int);
    127128    void WriteRunHeader();
     
    131132
    132133void DAQ(DAQReadout *);
    133 int Match(char*, char*);
    134 int ParseInput(char*, char *Param[]);
     134bool Match(const char*, const char*);
     135int ParseInput(char*, const char *Param[]);
    135136int CheckDisk(char*);
    136 int ReadCard(char *, void *, char, FILE *);
     137int ReadCard(const char *, void *, char, FILE *);
    137138
    138139#endif
  • drsdaq/HVFeedback.cc

    r22 r27  
    256256
    257257// Write commmand to socket
    258 bool HVFeedback::WriteHVCommand(char *Format, ...) {
     258bool HVFeedback::WriteHVCommand(const char *Format, ...) {
    259259  char Textbuffer[MAX_COM_SIZE];
    260260  fd_set SelectDescriptor;
  • drsdaq/HVFeedback.h

    r22 r27  
    5959    void GetResponse();
    6060    void ClearAverages();
    61     bool WriteHVCommand(char *, ...);
     61    bool WriteHVCommand(const char *, ...);
    6262    void PrintConfig();
    6363};
  • drsdaq/History.txt

    r22 r27  
    9926/3/2009   Added PixelMap translation to communication with HV control.
    101030/3/2009   Added feedback gain. Checked into repository.
     111/4/2009    Changes many 'char *' to 'const char *' to honour compiler warning
     12            on ihp-pc26 (newer version of g++ than on eth-vme02)
Note: See TracChangeset for help on using the changeset viewer.