Ignore:
Timestamp:
Oct 27, 2009, 5:16:31 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
6d7651
Parents:
a9b2a0a
git-author:
Frederik Heber <heber@…> (10/27/09 16:42:42)
git-committer:
Frederik Heber <heber@…> (10/27/09 17:16:31)
Message:

class config, ConfigFileBuffer, periodentafel and Vector are refactored with respect to ticket #38, #4 and #39.

  • <type> * const ptr ... means the pointer itself is const (not its contents that he points at).
  • const <type> * ptr ... means the pointer's content is const.
  • "ofstream *out" ... can be changed to "ofstream * const out" (pointer is constant, not output).

Signed-off-by: Frederik Heber <heber@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/config.cpp

    ra9b2a0a r069034  
    5252/** Constructor for ConfigFileBuffer class.
    5353 */
    54 ConfigFileBuffer::ConfigFileBuffer()
     54ConfigFileBuffer::ConfigFileBuffer() : buffer(NULL), LineMapping(NULL), CurrentLine(0), NoLines(0)
    5555{
    56   NoLines = 0;
    57   CurrentLine = 0;
    58   buffer = NULL;
    59   LineMapping = NULL;
    60 }
     56};
    6157
    6258/** Constructor for ConfigFileBuffer class with filename to be parsed.
    6359 * \param *filename file name
    6460 */
    65 ConfigFileBuffer::ConfigFileBuffer(char *filename)
     61ConfigFileBuffer::ConfigFileBuffer(const char * const filename) : buffer(NULL), LineMapping(NULL), CurrentLine(0), NoLines(0)
    6662{
    67   NoLines = 0;
    68   CurrentLine = 0;
    69   buffer = NULL;
    70   LineMapping = NULL;
    7163  ifstream *file = NULL;
    7264  char line[MAXSTRINGSIZE];
     
    141133 * \param NoAtoms of subsequent lines to look at
    142134 */
    143 void ConfigFileBuffer::MapIonTypesInBuffer(int NoAtoms)
     135void ConfigFileBuffer::MapIonTypesInBuffer(const int NoAtoms)
    144136{
    145137  map<const char *, int, IonTypeCompare> LineList;
     
    168160/** Constructor for config file class.
    169161 */
    170 config::config()
    171 {
     162config::config() : PsiType(0), MaxPsiDouble(0), PsiMaxNoUp(0), PsiMaxNoDown(0), MaxMinStopStep(1), InitMaxMinStopStep(1), ProcPEGamma(8), ProcPEPsi(1), configpath(NULL),
     163    configname(NULL), FastParsing(false), Deltat(0.01), basis(""), databasepath(NULL), DoConstrainedMD(0), MaxOuterStep(0), Thermostat(4), ThermostatImplemented(NULL),
     164    ThermostatNames(NULL), TempFrequency(2.5), alpha(0.), HooverMass(0.), TargetTemp(0.00095004455), ScaleTempStep(25),  mainname(NULL), defaultpath(NULL), pseudopotpath(NULL),
     165    DoOutVis(0), DoOutMes(1), DoOutNICS(0), DoOutOrbitals(0), DoOutCurrent(0), DoFullCurrent(0), DoPerturbation(0), DoWannier(0), CommonWannier(0), SawtoothStart(0.01),
     166    VectorPlane(0), VectorCut(0.), UseAddGramSch(1), Seed(1), OutVisStep(10), OutSrcStep(5), MaxPsiStep(0), EpsWannier(1e-7), MaxMinStep(100), RelEpsTotalEnergy(1e-7),
     167    RelEpsKineticEnergy(1e-5), MaxMinGapStopStep(0), MaxInitMinStep(100), InitRelEpsTotalEnergy(1e-5), InitRelEpsKineticEnergy(1e-4), InitMaxMinGapStopStep(0), ECut(128.),
     168    MaxLevel(5), RiemannTensor(0), LevRFactor(0), RiemannLevel(0), Lev0Factor(2), RTActualUse(0), AddPsis(0), RCut(20.), StructOpt(0), IsAngstroem(1), RelativeCoord(0),
     169    MaxTypes(0) {
    172170  mainname = Malloc<char>(MAXSTRINGSIZE,"config constructor: mainname");
    173171  defaultpath = Malloc<char>(MAXSTRINGSIZE,"config constructor: defaultpath");
     
    176174  configpath = Malloc<char>(MAXSTRINGSIZE,"config constructor: configpath");
    177175  configname = Malloc<char>(MAXSTRINGSIZE,"config constructor: configname");
    178   ThermostatImplemented = Malloc<int>(MaxThermostats, "config constructor: *ThermostatImplemented");
    179   ThermostatNames = Malloc<char*>(MaxThermostats, "config constructor: *ThermostatNames");
    180   for (int j=0;j<MaxThermostats;j++)
    181     ThermostatNames[j] = Malloc<char>(12, "config constructor: ThermostatNames[]");
    182   Thermostat = 4;
    183   alpha = 0.;
    184   ScaleTempStep = 25;
    185   TempFrequency = 2.5;
    186176  strcpy(mainname,"pcp");
    187177  strcpy(defaultpath,"not specified");
     
    191181  basis = "3-21G";
    192182
    193   strcpy(ThermostatNames[0],"None");
    194   ThermostatImplemented[0] = 1;
    195   strcpy(ThermostatNames[1],"Woodcock");
    196   ThermostatImplemented[1] = 1;
    197   strcpy(ThermostatNames[2],"Gaussian");
    198   ThermostatImplemented[2] = 1;
    199   strcpy(ThermostatNames[3],"Langevin");
    200   ThermostatImplemented[3] = 1;
    201   strcpy(ThermostatNames[4],"Berendsen");
    202   ThermostatImplemented[4] = 1;
    203   strcpy(ThermostatNames[5],"NoseHoover");
    204   ThermostatImplemented[5] = 1;
    205 
    206   FastParsing = false;
    207   ProcPEGamma=8;
    208   ProcPEPsi=1;
    209   DoOutVis=0;
    210   DoOutMes=1;
    211   DoOutNICS=0;
    212   DoOutOrbitals=0;
    213   DoOutCurrent=0;
    214   DoPerturbation=0;
    215   DoFullCurrent=0;
    216   DoWannier=0;
    217   DoConstrainedMD=0;
    218   CommonWannier=0;
    219   SawtoothStart=0.01;
    220   VectorPlane=0;
    221   VectorCut=0;
    222   UseAddGramSch=1;
    223   Seed=1;
    224 
    225   MaxOuterStep=0;
    226   Deltat=0.01;
    227   OutVisStep=10;
    228   OutSrcStep=5;
    229   TargetTemp=0.00095004455;
    230   ScaleTempStep=25;
    231   MaxPsiStep=0;
    232   EpsWannier=1e-7;
    233 
    234   MaxMinStep=100;
    235   RelEpsTotalEnergy=1e-7;
    236   RelEpsKineticEnergy=1e-5;
    237   MaxMinStopStep=1;
    238   MaxMinGapStopStep=0;
    239   MaxInitMinStep=100;
    240   InitRelEpsTotalEnergy=1e-5;
    241   InitRelEpsKineticEnergy=1e-4;
    242   InitMaxMinStopStep=1;
    243   InitMaxMinGapStopStep=0;
    244 
    245   //BoxLength[NDIM*NDIM];
    246 
    247   ECut=128.;
    248   MaxLevel=5;
    249   RiemannTensor=0;
    250   LevRFactor=0;
    251   RiemannLevel=0;
    252   Lev0Factor=2;
    253   RTActualUse=0;
    254   PsiType=0;
    255   MaxPsiDouble=0;
    256   PsiMaxNoUp=0;
    257   PsiMaxNoDown=0;
    258   AddPsis=0;
    259 
    260   RCut=20.;
    261   StructOpt=0;
    262   IsAngstroem=1;
    263   RelativeCoord=0;
    264   MaxTypes=0;
     183  InitThermostats();
    265184};
    266 
    267185
    268186/** Destructor for config file class.
     
    282200};
    283201
     202/** Initialises variables in class config for Thermostats.
     203 */
     204void config::InitThermostats()
     205{
     206  ThermostatImplemented = Malloc<int>(MaxThermostats, "config constructor: *ThermostatImplemented");
     207  ThermostatNames = Malloc<char*>(MaxThermostats, "config constructor: *ThermostatNames");
     208  for (int j=0;j<MaxThermostats;j++)
     209    ThermostatNames[j] = Malloc<char>(12, "config constructor: ThermostatNames[]");
     210
     211  strcpy(ThermostatNames[0],"None");
     212  ThermostatImplemented[0] = 1;
     213  strcpy(ThermostatNames[1],"Woodcock");
     214  ThermostatImplemented[1] = 1;
     215  strcpy(ThermostatNames[2],"Gaussian");
     216  ThermostatImplemented[2] = 1;
     217  strcpy(ThermostatNames[3],"Langevin");
     218  ThermostatImplemented[3] = 1;
     219  strcpy(ThermostatNames[4],"Berendsen");
     220  ThermostatImplemented[4] = 1;
     221  strcpy(ThermostatNames[5],"NoseHoover");
     222  ThermostatImplemented[5] = 1;
     223};
     224
    284225/** Readin of Thermostat related values from parameter file.
    285226 * \param *fb file buffer containing the config file
    286227 */
    287 void config::InitThermostats(class ConfigFileBuffer *fb)
     228void config::ParseThermostats(class ConfigFileBuffer * const fb)
    288229{
    289   char *thermo = Malloc<char>(12, "IonsInitRead: thermo");
    290   int verbose = 0;
     230  char * const thermo = Malloc<char>(12, "IonsInitRead: thermo");
     231  const int verbose = 0;
    291232
    292233  // read desired Thermostat from file along with needed additional parameters
     
    354295    Thermostat = None;
    355296  }
    356   Free(&thermo);
     297  Free(thermo);
    357298};
    358299
     
    627568 * \return 0 - old syntax, 1 - new syntax, -1 - unknown syntax
    628569 */
    629 int config::TestSyntax(char *filename, periodentafel *periode, molecule *mol)
     570int config::TestSyntax(const char * const filename, const periodentafel * const periode, const molecule * const mol) const
    630571{
    631572  int test;
     
    666607 * \return *defaultpath
    667608 */
    668 void config::SetDefaultPath(const char *path)
     609void config::SetDefaultPath(const char * const path)
    669610{
    670611  strcpy(defaultpath, path);
     
    674615 * \param filename config file string
    675616 */
    676 void config::RetrieveConfigPathAndName(string filename)
     617void config::RetrieveConfigPathAndName(const string filename)
    677618{
    678619  char *ptr = NULL;
     
    702643 * \param *FileBuffer pointer to FileBuffer on return, should point to NULL
    703644 */
    704 void PrepareFileBuffer(char *filename, struct ConfigFileBuffer *&FileBuffer)
     645void PrepareFileBuffer(const char * const filename, struct ConfigFileBuffer *&FileBuffer)
    705646{
    706647  if (FileBuffer != NULL) {
     
    719660 * \param FastParsing whether to parse trajectories or not
    720661 */
    721 void LoadMolecule(molecule *&mol, struct ConfigFileBuffer *&FileBuffer, periodentafel *periode, bool FastParsing)
     662void LoadMolecule(molecule * const &mol, struct ConfigFileBuffer * const &FileBuffer, const periodentafel * const periode, const bool FastParsing)
    722663{
    723664  int MaxTypes = 0;
     
    893834 * \param *mol pointer to molecule containing all atoms of the molecule
    894835 */
    895 void config::Load(char *filename, periodentafel *periode, molecule *mol)
     836void config::Load(const char * const filename, const periodentafel * const periode, molecule * const &mol)
    896837{
    897838  ifstream *file = new ifstream(filename);
     
    909850
    910851  /* Oeffne Hauptparameterdatei */
    911   int di;
     852  int di = 0;
    912853  double BoxLength[9];
    913854  string zeile;
     
    915856  int verbose = 0;
    916857 
    917   InitThermostats(FileBuffer);
     858  ParseThermostats(FileBuffer);
    918859 
    919860  /* Namen einlesen */
     
    11091050 * \param *mol pointer to molecule containing all atoms of the molecule
    11101051 */
    1111 void config::LoadOld(char *filename, periodentafel *periode, molecule *mol)
     1052void config::LoadOld(const char * const filename, const periodentafel * const periode, molecule * const &mol)
    11121053{
    11131054  ifstream *file = new ifstream(filename);
     
    11201061
    11211062  /* Oeffne Hauptparameterdatei */
    1122   int l, i, di;
    1123   double a,b;
     1063  int l = 0;
     1064  int i = 0;
     1065  int di = 0;
     1066  double a = 0.;
     1067  double b = 0.;
    11241068  double BoxLength[9];
    11251069  string zeile;
    11261070  string dummy;
    11271071  element *elementhash[128];
    1128   int Z, No, AtomNo, found;
     1072  int Z = -1;
     1073  int No = -1;
     1074  int AtomNo = -1;
     1075  int found = 0;
    11291076  int verbose = 0;
    11301077
     
    13131260 * \param *mol pointer to molecule containing all atoms of the molecule
    13141261 */
    1315 bool config::Save(const char *filename, periodentafel *periode, molecule *mol) const
     1262bool config::Save(const char * const filename, const periodentafel * const periode, molecule * const mol) const
    13161263{
    13171264  bool result = true;
    13181265  // bring MaxTypes up to date
    13191266  mol->CountElements();
    1320   ofstream *output = NULL;
    1321   output = new ofstream(filename, ios::out);
     1267  ofstream * const output = new ofstream(filename, ios::out);
    13221268  if (output != NULL) {
    13231269    *output << "# ParallelCarParinello - main configuration file - created with molecuilder" << endl;
     
    14431389 * \param *mol pointer to molecule containing all atoms of the molecule
    14441390 */
    1445 bool config::SaveMPQC(const char *filename, molecule *mol) const
     1391bool config::SaveMPQC(const char * const filename, const molecule * const mol) const
    14461392{
    1447   int AtomNo;
     1393  int AtomNo = -1;
    14481394  Vector *center = NULL;
    14491395  ofstream *output = NULL;
    1450   stringstream *fname = NULL;
    14511396
    14521397  // first without hessian
    1453   fname = new stringstream;
    1454   *fname << filename << ".in";
    1455   output = new ofstream(fname->str().c_str(), ios::out);
    1456   *output << "% Created by MoleCuilder" << endl;
    1457   *output << "mpqc: (" << endl;
    1458   *output << "\tsavestate = no" << endl;
    1459   *output << "\tdo_gradient = yes" << endl;
    1460   *output << "\tmole<MBPT2>: (" << endl;
    1461   *output << "\t\tmaxiter = 200" << endl;
    1462   *output << "\t\tbasis = $:basis" << endl;
    1463   *output << "\t\tmolecule = $:molecule" << endl;
    1464   *output << "\t\treference<CLHF>: (" << endl;
    1465   *output << "\t\t\tbasis = $:basis" << endl;
    1466   *output << "\t\t\tmolecule = $:molecule" << endl;
    1467   *output << "\t\t)" << endl;
    1468   *output << "\t)" << endl;
    1469   *output << ")" << endl;
    1470   *output << "molecule<Molecule>: (" << endl;
    1471   *output << "\tunit = " << (IsAngstroem ? "angstrom" : "bohr" ) << endl;
    1472   *output << "\t{ atoms geometry } = {" << endl;
    1473   center = mol->DetermineCenterOfAll(output);
    1474   // output of atoms
    1475   AtomNo = 0;
    1476   mol->ActOnAllAtoms( &atom::OutputMPQCLine, output, (const Vector *)center, &AtomNo );
    1477   delete(center);
    1478   *output << "\t}" << endl;
    1479   *output << ")" << endl;
    1480   *output << "basis<GaussianBasisSet>: (" << endl;
    1481   *output << "\tname = \"" << basis << "\"" << endl;
    1482   *output << "\tmolecule = $:molecule" << endl;
    1483   *output << ")" << endl;
    1484   output->close();
    1485   delete(output);
    1486   delete(fname);
     1398  {
     1399    stringstream * const fname = new stringstream;;
     1400    *fname << filename << ".in";
     1401    output = new ofstream(fname->str().c_str(), ios::out);
     1402    *output << "% Created by MoleCuilder" << endl;
     1403    *output << "mpqc: (" << endl;
     1404    *output << "\tsavestate = no" << endl;
     1405    *output << "\tdo_gradient = yes" << endl;
     1406    *output << "\tmole<MBPT2>: (" << endl;
     1407    *output << "\t\tmaxiter = 200" << endl;
     1408    *output << "\t\tbasis = $:basis" << endl;
     1409    *output << "\t\tmolecule = $:molecule" << endl;
     1410    *output << "\t\treference<CLHF>: (" << endl;
     1411    *output << "\t\t\tbasis = $:basis" << endl;
     1412    *output << "\t\t\tmolecule = $:molecule" << endl;
     1413    *output << "\t\t)" << endl;
     1414    *output << "\t)" << endl;
     1415    *output << ")" << endl;
     1416    *output << "molecule<Molecule>: (" << endl;
     1417    *output << "\tunit = " << (IsAngstroem ? "angstrom" : "bohr" ) << endl;
     1418    *output << "\t{ atoms geometry } = {" << endl;
     1419    center = mol->DetermineCenterOfAll(output);
     1420    // output of atoms
     1421    AtomNo = 0;
     1422    mol->ActOnAllAtoms( &atom::OutputMPQCLine, output, (const Vector *)center, &AtomNo );
     1423    delete(center);
     1424    *output << "\t}" << endl;
     1425    *output << ")" << endl;
     1426    *output << "basis<GaussianBasisSet>: (" << endl;
     1427    *output << "\tname = \"" << basis << "\"" << endl;
     1428    *output << "\tmolecule = $:molecule" << endl;
     1429    *output << ")" << endl;
     1430    output->close();
     1431    delete(output);
     1432    delete(fname);
     1433  }
    14871434
    14881435  // second with hessian
    1489   fname = new stringstream;
    1490   *fname << filename << ".hess.in";
    1491   output = new ofstream(fname->str().c_str(), ios::out);
    1492   *output << "% Created by MoleCuilder" << endl;
    1493   *output << "mpqc: (" << endl;
    1494   *output << "\tsavestate = no" << endl;
    1495   *output << "\tdo_gradient = yes" << endl;
    1496   *output << "\tmole<CLHF>: (" << endl;
    1497   *output << "\t\tmaxiter = 200" << endl;
    1498   *output << "\t\tbasis = $:basis" << endl;
    1499   *output << "\t\tmolecule = $:molecule" << endl;
    1500   *output << "\t)" << endl;
    1501   *output << "\tfreq<MolecularFrequencies>: (" << endl;
    1502   *output << "\t\tmolecule=$:molecule" << endl;
    1503   *output << "\t)" << endl;
    1504   *output << ")" << endl;
    1505   *output << "molecule<Molecule>: (" << endl;
    1506   *output << "\tunit = " << (IsAngstroem ? "angstrom" : "bohr" ) << endl;
    1507   *output << "\t{ atoms geometry } = {" << endl;
    1508   center = mol->DetermineCenterOfAll(output);
    1509   // output of atoms
    1510   AtomNo = 0;
    1511   mol->ActOnAllAtoms( &atom::OutputMPQCLine, output, (const Vector *)center, &AtomNo );
    1512   delete(center);
    1513   *output << "\t}" << endl;
    1514   *output << ")" << endl;
    1515   *output << "basis<GaussianBasisSet>: (" << endl;
    1516   *output << "\tname = \"3-21G\"" << endl;
    1517   *output << "\tmolecule = $:molecule" << endl;
    1518   *output << ")" << endl;
    1519   output->close();
    1520   delete(output);
    1521   delete(fname);
     1436  {
     1437    stringstream * const fname = new stringstream;
     1438    *fname << filename << ".hess.in";
     1439    output = new ofstream(fname->str().c_str(), ios::out);
     1440    *output << "% Created by MoleCuilder" << endl;
     1441    *output << "mpqc: (" << endl;
     1442    *output << "\tsavestate = no" << endl;
     1443    *output << "\tdo_gradient = yes" << endl;
     1444    *output << "\tmole<CLHF>: (" << endl;
     1445    *output << "\t\tmaxiter = 200" << endl;
     1446    *output << "\t\tbasis = $:basis" << endl;
     1447    *output << "\t\tmolecule = $:molecule" << endl;
     1448    *output << "\t)" << endl;
     1449    *output << "\tfreq<MolecularFrequencies>: (" << endl;
     1450    *output << "\t\tmolecule=$:molecule" << endl;
     1451    *output << "\t)" << endl;
     1452    *output << ")" << endl;
     1453    *output << "molecule<Molecule>: (" << endl;
     1454    *output << "\tunit = " << (IsAngstroem ? "angstrom" : "bohr" ) << endl;
     1455    *output << "\t{ atoms geometry } = {" << endl;
     1456    center = mol->DetermineCenterOfAll(output);
     1457    // output of atoms
     1458    AtomNo = 0;
     1459    mol->ActOnAllAtoms( &atom::OutputMPQCLine, output, (const Vector *)center, &AtomNo );
     1460    delete(center);
     1461    *output << "\t}" << endl;
     1462    *output << ")" << endl;
     1463    *output << "basis<GaussianBasisSet>: (" << endl;
     1464    *output << "\tname = \"3-21G\"" << endl;
     1465    *output << "\tmolecule = $:molecule" << endl;
     1466    *output << ")" << endl;
     1467    output->close();
     1468    delete(output);
     1469    delete(fname);
     1470  }
    15221471
    15231472  return true;
     
    15451494 * \note Routine is taken from the pcp project and hack-a-slack adapted to C++
    15461495 */
    1547 int ParseForParameter(int verbose, ifstream *file, const char *name, int sequential, int const xth, int const yth, int type, void *value, int repetition, int critical) {
    1548   int i,j;  // loop variables
    1549   int length = 0, maxlength = -1;
     1496int ParseForParameter(const int verbose, ifstream * const file, const char * const name, const int sequential, const int xth, const int yth, const int type, void * value, const int repetition, const int critical) {
     1497  int i = 0;
     1498  int j = 0;  // loop variables
     1499  int length = 0;
     1500  int maxlength = -1;
    15501501  long file_position = file->tellg(); // mark current position
    1551   char *dummy1, *dummy, *free_dummy;    // pointers in the line that is read in per step
    1552   dummy1 = free_dummy = Malloc<char>(256, "config::ParseForParameter: *free_dummy");
     1502  char *dummy1 = NULL;
     1503  char *dummy = NULL;
     1504  char * const free_dummy = Malloc<char>(256, "config::ParseForParameter: *free_dummy");    // pointers in the line that is read in per step
     1505  dummy1 = free_dummy;
    15531506
    15541507  //fprintf(stderr,"Parsing for %s\n",name);
     
    15651518      if (file->eof()) {
    15661519        if ((critical) && (found == 0)) {
    1567           Free(&free_dummy);
     1520          Free(free_dummy);
    15681521          //Error(InitReading, name);
    15691522          fprintf(stderr,"Error:InitReading, critical %s not found\n", name);
     
    15731526          file->clear();
    15741527          file->seekg(file_position, ios::beg);  // rewind to start position
    1575           Free(&free_dummy);
     1528          Free(free_dummy);
    15761529          return 0;
    15771530        }
     
    16251578              if (file->eof()) {
    16261579                if ((critical) && (found == 0)) {
    1627                   Free(&free_dummy);
     1580                  Free(free_dummy);
    16281581                  //Error(InitReading, name);
    16291582                  fprintf(stderr,"Error:InitReading, critical %s not found\n", name);
     
    16331586                  file->clear();
    16341587                  file->seekg(file_position, ios::beg);  // rewind to start position
    1635                   Free(&free_dummy);
     1588                  Free(free_dummy);
    16361589                  return 0;
    16371590                }
     
    16741627                  if (critical) {
    16751628                    if (verbose) fprintf(stderr,"Error: EoL at %i and still missing %i value(s) for parameter %s\n", line, yth-j, name);
    1676                     Free(&free_dummy);
     1629                    Free(free_dummy);
    16771630                    //return 0;
    16781631                    exit(255);
     
    16821635                    file->clear();
    16831636                    file->seekg(file_position, ios::beg);  // rewind to start position
    1684                     Free(&free_dummy);
     1637                    Free(free_dummy);
    16851638                    return 0;
    16861639                  }
     
    16951648                  file->seekg(file_position, ios::beg);  // rewind to start position
    16961649                }
    1697                 Free(&free_dummy);
     1650                Free(free_dummy);
    16981651                return 0;
    16991652              }
     
    17511704  if ((type >= row_int) && (verbose))
    17521705    fprintf(stderr,"\n");
    1753   Free(&free_dummy);
     1706  Free(free_dummy);
    17541707  if (!sequential) {
    17551708    file->clear();
     
    17831736 * \note Routine is taken from the pcp project and hack-a-slack adapted to C++
    17841737 */
    1785 int ParseForParameter(int verbose, struct ConfigFileBuffer *FileBuffer, const char *name, int sequential, int const xth, int const yth, int type, void *value, int repetition, int critical) {
    1786   int i,j;  // loop variables
    1787   int length = 0, maxlength = -1;
     1738int ParseForParameter(const int verbose, struct ConfigFileBuffer * const FileBuffer, const char * const name, const int sequential, const int xth, const int yth, const int type, void * value, const int repetition, const int critical) {
     1739  int i = 0;
     1740  int j = 0;  // loop variables
     1741  int length = 0;
     1742  int maxlength = -1;
    17881743  int OldCurrentLine = FileBuffer->CurrentLine;
    1789   char *dummy1, *dummy;    // pointers in the line that is read in per step
     1744  char *dummy1 = NULL;
     1745  char *dummy = NULL;    // pointers in the line that is read in per step
    17901746
    17911747  //fprintf(stderr,"Parsing for %s\n",name);
Note: See TracChangeset for help on using the changeset viewer.