Changes in src/config.cpp [112b09:68f03d]
- File:
-
- 1 edited
-
src/config.cpp (modified) (37 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/config.cpp
r112b09 r68f03d 4 4 * 5 5 */ 6 7 #include "Helpers/MemDebug.hpp"8 6 9 7 #include <stdio.h> … … 16 14 #include "element.hpp" 17 15 #include "helpers.hpp" 18 #include "info.hpp"19 16 #include "lists.hpp" 20 17 #include "log.hpp" … … 96 93 return; 97 94 } else 98 buffer = new char *[NoLines];95 buffer = Malloc<char*>(NoLines, "ConfigFileBuffer::ConfigFileBuffer: **buffer"); 99 96 100 97 // scan each line and put into buffer … … 102 99 int i; 103 100 do { 104 buffer[lines] = new char[MAXSTRINGSIZE];101 buffer[lines] = Malloc<char>(MAXSTRINGSIZE, "ConfigFileBuffer::ConfigFileBuffer: *buffer[]"); 105 102 file->getline(buffer[lines], MAXSTRINGSIZE-1); 106 103 i = strlen(buffer[lines]); … … 122 119 { 123 120 for(int i=0;i<NoLines;++i) 124 delete[](buffer[i]);125 delete[](buffer);126 delete[](LineMapping);121 Free(&buffer[i]); 122 Free(&buffer); 123 Free(&LineMapping); 127 124 } 128 125 … … 132 129 void ConfigFileBuffer::InitMapping() 133 130 { 134 LineMapping = new int[NoLines];131 LineMapping = Malloc<int>(NoLines, "ConfigFileBuffer::InitMapping: *LineMapping"); 135 132 for (int i=0;i<NoLines;i++) 136 133 LineMapping[i] = i; … … 182 179 MaxLevel(5), RiemannTensor(0), LevRFactor(0), RiemannLevel(0), Lev0Factor(2), RTActualUse(0), AddPsis(0), RCut(20.), StructOpt(0), IsAngstroem(1), RelativeCoord(0), 183 180 MaxTypes(0) { 184 mainname = new char[MAXSTRINGSIZE];185 defaultpath = new char[MAXSTRINGSIZE];186 pseudopotpath = new char[MAXSTRINGSIZE];187 databasepath = new char[MAXSTRINGSIZE];188 configpath = new char[MAXSTRINGSIZE];189 configname = new char[MAXSTRINGSIZE];181 mainname = Malloc<char>(MAXSTRINGSIZE,"config constructor: mainname"); 182 defaultpath = Malloc<char>(MAXSTRINGSIZE,"config constructor: defaultpath"); 183 pseudopotpath = Malloc<char>(MAXSTRINGSIZE,"config constructor: pseudopotpath"); 184 databasepath = Malloc<char>(MAXSTRINGSIZE,"config constructor: databasepath"); 185 configpath = Malloc<char>(MAXSTRINGSIZE,"config constructor: configpath"); 186 configname = Malloc<char>(MAXSTRINGSIZE,"config constructor: configname"); 190 187 strcpy(mainname,"pcp"); 191 188 strcpy(defaultpath,"not specified"); … … 202 199 config::~config() 203 200 { 204 delete[](mainname);205 delete[](defaultpath);206 delete[](pseudopotpath);207 delete[](databasepath);208 delete[](configpath);209 delete[](configname);210 delete[](ThermostatImplemented);201 Free(&mainname); 202 Free(&defaultpath); 203 Free(&pseudopotpath); 204 Free(&databasepath); 205 Free(&configpath); 206 Free(&configname); 207 Free(&ThermostatImplemented); 211 208 for (int j=0;j<MaxThermostats;j++) 212 delete[](ThermostatNames[j]);213 delete[](ThermostatNames);209 Free(&ThermostatNames[j]); 210 Free(&ThermostatNames); 214 211 215 212 if (BG != NULL) … … 221 218 void config::InitThermostats() 222 219 { 223 ThermostatImplemented = new int[MaxThermostats];224 ThermostatNames = new char *[MaxThermostats];220 ThermostatImplemented = Malloc<int>(MaxThermostats, "config constructor: *ThermostatImplemented"); 221 ThermostatNames = Malloc<char*>(MaxThermostats, "config constructor: *ThermostatNames"); 225 222 for (int j=0;j<MaxThermostats;j++) 226 ThermostatNames[j] = new char[12];223 ThermostatNames[j] = Malloc<char>(12, "config constructor: ThermostatNames[]"); 227 224 228 225 strcpy(ThermostatNames[0],"None"); … … 245 242 void config::ParseThermostats(class ConfigFileBuffer * const fb) 246 243 { 247 char * const thermo = new char[12];244 char * const thermo = Malloc<char>(12, "IonsInitRead: thermo"); 248 245 const int verbose = 0; 249 246 … … 312 309 Thermostat = None; 313 310 } 314 delete[](thermo);311 Free(thermo); 315 312 }; 316 313 … … 1550 1547 int AtomNo = -1; 1551 1548 int MolNo = 0; 1549 atom *Walker = NULL; 1552 1550 FILE *f = NULL; 1553 1551 … … 1562 1560 fprintf(f, "# Created by MoleCuilder\n"); 1563 1561 1564 for (MoleculeList::const_iterator MolRunner = MolList->ListOfMolecules.begin(); MolRunner != MolList->ListOfMolecules.end(); MolRunner++) { 1565 int *elementNo = new int[MAX_ELEMENTS]; 1566 for (int i=0;i<MAX_ELEMENTS;i++) 1567 elementNo[i] = 0; 1562 for (MoleculeList::const_iterator Runner = MolList->ListOfMolecules.begin(); Runner != MolList->ListOfMolecules.end(); Runner++) { 1563 Walker = (*Runner)->start; 1564 int *elementNo = Calloc<int>(MAX_ELEMENTS, "config::SavePDB - elementNo"); 1568 1565 AtomNo = 0; 1569 for (molecule::const_iterator iter = (*MolRunner)->begin(); iter != (*MolRunner)->end(); ++iter) { 1570 sprintf(name, "%2s%2d",(*iter)->type->symbol, elementNo[(*iter)->type->Z]); 1571 elementNo[(*iter)->type->Z] = (elementNo[(*iter)->type->Z]+1) % 100; // confine to two digits 1566 while (Walker->next != (*Runner)->end) { 1567 Walker = Walker->next; 1568 sprintf(name, "%2s%2d",Walker->type->symbol, elementNo[Walker->type->Z]); 1569 elementNo[Walker->type->Z] = (elementNo[Walker->type->Z]+1) % 100; // confine to two digits 1572 1570 fprintf(f, 1573 1571 "ATOM %6u %-4s %4s%c%4u %8.3f%8.3f%8.3f%6.2f%6.2f %4s%2s%2s\n", 1574 (*iter)->nr, /* atom serial number */1572 Walker->nr, /* atom serial number */ 1575 1573 name, /* atom name */ 1576 (* MolRunner)->name, /* residue name */1574 (*Runner)->name, /* residue name */ 1577 1575 'a'+(unsigned char)(AtomNo % 26), /* letter for chain */ 1578 1576 MolNo, /* residue sequence number */ 1579 (*iter)->node->at(0), /* position X in Angstroem */1580 (*iter)->node->at(1), /* position Y in Angstroem */1581 (*iter)->node->at(2), /* position Z in Angstroem */1582 (double) (*iter)->type->Valence, /* occupancy */1583 (double) (*iter)->type->NoValenceOrbitals, /* temperature factor */1577 Walker->node->at(0), /* position X in Angstroem */ 1578 Walker->node->at(1), /* position Y in Angstroem */ 1579 Walker->node->at(2), /* position Z in Angstroem */ 1580 (double)Walker->type->Valence, /* occupancy */ 1581 (double)Walker->type->NoValenceOrbitals, /* temperature factor */ 1584 1582 "0", /* segment identifier */ 1585 (*iter)->type->symbol, /* element symbol */1583 Walker->type->symbol, /* element symbol */ 1586 1584 "0"); /* charge */ 1587 1585 AtomNo++; 1588 1586 } 1589 delete[](elementNo);1587 Free(&elementNo); 1590 1588 MolNo++; 1591 1589 } … … 1603 1601 { 1604 1602 int AtomNo = -1; 1603 atom *Walker = NULL; 1605 1604 FILE *f = NULL; 1606 1605 1607 int *elementNo = new int[MAX_ELEMENTS]; 1608 for (int i=0;i<MAX_ELEMENTS;i++) 1609 elementNo[i] = 0; 1606 int *elementNo = Calloc<int>(MAX_ELEMENTS, "config::SavePDB - elementNo"); 1610 1607 char name[MAXSTRINGSIZE]; 1611 1608 strncpy(name, filename, MAXSTRINGSIZE-1); … … 1614 1611 if (f == NULL) { 1615 1612 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open pdb output file:" << name << endl); 1616 delete[](elementNo);1613 Free(&elementNo); 1617 1614 return false; 1618 1615 } 1619 1616 fprintf(f, "# Created by MoleCuilder\n"); 1620 1617 1618 Walker = mol->start; 1621 1619 AtomNo = 0; 1622 for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 1623 sprintf(name, "%2s%2d",(*iter)->type->symbol, elementNo[(*iter)->type->Z]); 1624 elementNo[(*iter)->type->Z] = (elementNo[(*iter)->type->Z]+1) % 100; // confine to two digits 1620 while (Walker->next != mol->end) { 1621 Walker = Walker->next; 1622 sprintf(name, "%2s%2d",Walker->type->symbol, elementNo[Walker->type->Z]); 1623 elementNo[Walker->type->Z] = (elementNo[Walker->type->Z]+1) % 100; // confine to two digits 1625 1624 fprintf(f, 1626 1625 "ATOM %6u %-4s %4s%c%4u %8.3f%8.3f%8.3f%6.2f%6.2f %4s%2s%2s\n", 1627 (*iter)->nr, /* atom serial number */1626 Walker->nr, /* atom serial number */ 1628 1627 name, /* atom name */ 1629 1628 mol->name, /* residue name */ 1630 1629 'a'+(unsigned char)(AtomNo % 26), /* letter for chain */ 1631 1630 0, /* residue sequence number */ 1632 (*iter)->node->at(0), /* position X in Angstroem */1633 (*iter)->node->at(1), /* position Y in Angstroem */1634 (*iter)->node->at(2), /* position Z in Angstroem */1635 (double) (*iter)->type->Valence, /* occupancy */1636 (double) (*iter)->type->NoValenceOrbitals, /* temperature factor */1631 Walker->node->at(0), /* position X in Angstroem */ 1632 Walker->node->at(1), /* position Y in Angstroem */ 1633 Walker->node->at(2), /* position Z in Angstroem */ 1634 (double)Walker->type->Valence, /* occupancy */ 1635 (double)Walker->type->NoValenceOrbitals, /* temperature factor */ 1637 1636 "0", /* segment identifier */ 1638 (*iter)->type->symbol, /* element symbol */1637 Walker->type->symbol, /* element symbol */ 1639 1638 "0"); /* charge */ 1640 1639 AtomNo++; 1641 1640 } 1642 1641 fclose(f); 1643 delete[](elementNo);1642 Free(&elementNo); 1644 1643 1645 1644 return true; … … 1654 1653 bool config::SaveTREMOLO(const char * const filename, const molecule * const mol) const 1655 1654 { 1655 atom *Walker = NULL; 1656 1656 ofstream *output = NULL; 1657 1657 stringstream * const fname = new stringstream; … … 1666 1666 1667 1667 // scan maximum number of neighbours 1668 Walker = mol->start; 1668 1669 int MaxNeighbours = 0; 1669 for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 1670 const int count = (*iter)->ListOfBonds.size(); 1670 while (Walker->next != mol->end) { 1671 Walker = Walker->next; 1672 const int count = Walker->ListOfBonds.size(); 1671 1673 if (MaxNeighbours < count) 1672 1674 MaxNeighbours = count; 1673 1675 } 1674 *output << "# ATOMDATA Id name resName resSeq x=3 Charge type neighbors=" << MaxNeighbours << endl; 1675 1676 for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 1677 *output << (*iter)->nr << "\t"; 1678 *output << (*iter)->getName() << "\t"; 1676 *output << "# ATOMDATA Id name resName resSeq x=3 charge type neighbors=" << MaxNeighbours << endl; 1677 1678 Walker = mol->start; 1679 while (Walker->next != mol->end) { 1680 Walker = Walker->next; 1681 *output << Walker->nr << "\t"; 1682 *output << Walker->getName() << "\t"; 1679 1683 *output << mol->name << "\t"; 1680 1684 *output << 0 << "\t"; 1681 *output << (*iter)->node->at(0) << "\t" << (*iter)->node->at(1) << "\t" << (*iter)->node->at(2) << "\t";1682 *output << static_cast<double>( (*iter)->type->Valence) << "\t";1683 *output << (*iter)->type->symbol << "\t";1684 for (BondList::iterator runner = (*iter)->ListOfBonds.begin(); runner != (*iter)->ListOfBonds.end(); runner++)1685 *output << (*runner)->GetOtherAtom( *iter)->nr << "\t";1686 for(int i= (*iter)->ListOfBonds.size(); i < MaxNeighbours; i++)1685 *output << Walker->node->at(0) << "\t" << Walker->node->at(1) << "\t" << Walker->node->at(2) << "\t"; 1686 *output << static_cast<double>(Walker->type->Valence) << "\t"; 1687 *output << Walker->type->symbol << "\t"; 1688 for (BondList::iterator runner = Walker->ListOfBonds.begin(); runner != Walker->ListOfBonds.end(); runner++) 1689 *output << (*runner)->GetOtherAtom(Walker)->nr << "\t"; 1690 for(int i=Walker->ListOfBonds.size(); i < MaxNeighbours; i++) 1687 1691 *output << "-\t"; 1688 1692 *output << endl; … … 1704 1708 bool config::SaveTREMOLO(const char * const filename, const MoleculeListClass * const MolList) const 1705 1709 { 1706 Info FunctionInfo(__func__);1710 atom *Walker = NULL; 1707 1711 ofstream *output = NULL; 1708 1712 stringstream * const fname = new stringstream; … … 1719 1723 int MaxNeighbours = 0; 1720 1724 for (MoleculeList::const_iterator MolWalker = MolList->ListOfMolecules.begin(); MolWalker != MolList->ListOfMolecules.end(); MolWalker++) { 1721 for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) { 1722 const int count = (*iter)->ListOfBonds.size(); 1725 Walker = (*MolWalker)->start; 1726 while (Walker->next != (*MolWalker)->end) { 1727 Walker = Walker->next; 1728 const int count = Walker->ListOfBonds.size(); 1723 1729 if (MaxNeighbours < count) 1724 1730 MaxNeighbours = count; 1725 1731 } 1726 1732 } 1727 *output << "# ATOMDATA Id name resName resSeq x=3 Charge type neighbors=" << MaxNeighbours << endl;1733 *output << "# ATOMDATA Id name resName resSeq x=3 charge type neighbors=" << MaxNeighbours << endl; 1728 1734 1729 1735 // create global to local id map 1730 map<int, int> LocalNotoGlobalNoMap;1736 int **LocalNotoGlobalNoMap = Calloc<int *>(MolList->ListOfMolecules.size(), "config::SaveTREMOLO - **LocalNotoGlobalNoMap"); 1731 1737 { 1732 unsignedint MolCounter = 0;1733 int AtomNo = 1;1738 int MolCounter = 0; 1739 int AtomNo = 0; 1734 1740 for (MoleculeList::const_iterator MolWalker = MolList->ListOfMolecules.begin(); MolWalker != MolList->ListOfMolecules.end(); MolWalker++) { 1735 for(molecule::iterator AtomRunner = (*MolWalker)->begin(); AtomRunner != (*MolWalker)->end(); ++AtomRunner) { 1736 LocalNotoGlobalNoMap.insert( pair<int,int>((*AtomRunner)->getId(), AtomNo++) ); 1737 } 1741 LocalNotoGlobalNoMap[MolCounter] = Calloc<int>(MolList->CountAllAtoms(), "config::SaveTREMOLO - *LocalNotoGlobalNoMap[]"); 1742 1743 (*MolWalker)->SetIndexedArrayForEachAtomTo( LocalNotoGlobalNoMap[MolCounter], &atom::nr, IncrementalAbsoluteValue, &AtomNo); 1744 1738 1745 MolCounter++; 1739 1746 } 1740 ASSERT(MolCounter == MolList->ListOfMolecules.size(), "SaveTREMOLO: LocalNotoGlobalNoMap[] has not been correctly initialized for each molecule");1741 1747 } 1742 1748 … … 1746 1752 int AtomNo = 0; 1747 1753 for (MoleculeList::const_iterator MolWalker = MolList->ListOfMolecules.begin(); MolWalker != MolList->ListOfMolecules.end(); MolWalker++) { 1748 for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) { 1749 *output << LocalNotoGlobalNoMap[ (*iter)->getId() ] << "\t"; 1750 *output << (*iter)->getName() << "\t"; 1754 Walker = (*MolWalker)->start; 1755 while (Walker->next != (*MolWalker)->end) { 1756 Walker = Walker->next; 1757 *output << AtomNo+1 << "\t"; 1758 *output << Walker->getName() << "\t"; 1751 1759 *output << (*MolWalker)->name << "\t"; 1752 1760 *output << MolCounter+1 << "\t"; 1753 *output << (*iter)->node->at(0) << "\t" << (*iter)->node->at(1) << "\t" << (*iter)->node->at(2) << "\t";1754 *output << (double) (*iter)->type->Valence << "\t";1755 *output << (*iter)->type->symbol << "\t";1756 for (BondList::iterator runner = (*iter)->ListOfBonds.begin(); runner != (*iter)->ListOfBonds.end(); runner++)1757 *output << LocalNotoGlobalNoMap[ (*runner)->GetOtherAtom((*iter))->getId() ]<< "\t";1758 for(int i= (*iter)->ListOfBonds.size(); i < MaxNeighbours; i++)1761 *output << Walker->node->at(0) << "\t" << Walker->node->at(1) << "\t" << Walker->node->at(2) << "\t"; 1762 *output << (double)Walker->type->Valence << "\t"; 1763 *output << Walker->type->symbol << "\t"; 1764 for (BondList::iterator runner = Walker->ListOfBonds.begin(); runner != Walker->ListOfBonds.end(); runner++) 1765 *output << LocalNotoGlobalNoMap[MolCounter][ (*runner)->GetOtherAtom(Walker)->nr ]+1 << "\t"; 1766 for(int i=Walker->ListOfBonds.size(); i < MaxNeighbours; i++) 1759 1767 *output << "-\t"; 1760 1768 *output << endl; … … 1770 1778 delete(output); 1771 1779 delete(fname); 1780 for(size_t i=0;i<MolList->ListOfMolecules.size(); i++) 1781 Free(&LocalNotoGlobalNoMap[i]); 1782 Free(&LocalNotoGlobalNoMap); 1772 1783 1773 1784 return true; … … 1797 1808 if (output == NULL) 1798 1809 strcpy(filename,"main_pcp_linux"); 1799 Log() << Verbose(0) << "Saving as pdb input ... " << endl;1810 Log() << Verbose(0) << "Saving as pdb input "; 1800 1811 if (SavePDB(filename, molecules)) 1801 Log() << Verbose(0) << " \t...done." << endl;1812 Log() << Verbose(0) << "done." << endl; 1802 1813 else 1803 Log() << Verbose(0) << " \t...failed." << endl;1814 Log() << Verbose(0) << "failed." << endl; 1804 1815 1805 1816 // then save as tremolo data file … … 1808 1819 if (output == NULL) 1809 1820 strcpy(filename,"main_pcp_linux"); 1810 Log() << Verbose(0) << "Saving as tremolo data input ... " << endl;1821 Log() << Verbose(0) << "Saving as tremolo data input "; 1811 1822 if (SaveTREMOLO(filename, molecules)) 1812 Log() << Verbose(0) << " \t...done." << endl;1823 Log() << Verbose(0) << "done." << endl; 1813 1824 else 1814 Log() << Verbose(0) << " \t...failed." << endl;1825 Log() << Verbose(0) << "failed." << endl; 1815 1826 1816 1827 // translate each to its center and merge all molecules in MoleculeListClass into this molecule … … 1848 1859 output.close(); 1849 1860 output.clear(); 1850 Log() << Verbose(0) << "Saving of config file ... " << endl;1861 Log() << Verbose(0) << "Saving of config file "; 1851 1862 if (Save(filename, periode, mol)) 1852 Log() << Verbose(0) << " \t...successful." << endl;1863 Log() << Verbose(0) << "successful." << endl; 1853 1864 else 1854 Log() << Verbose(0) << " \t...failed." << endl;1865 Log() << Verbose(0) << "failed." << endl; 1855 1866 1856 1867 // and save to xyz file … … 1865 1876 output.open(filename, ios::trunc); 1866 1877 } 1867 Log() << Verbose(0) << "Saving of XYZ file ... " << endl;1878 Log() << Verbose(0) << "Saving of XYZ file "; 1868 1879 if (mol->MDSteps <= 1) { 1869 1880 if (mol->OutputXYZ(&output)) 1870 Log() << Verbose(0) << " \t...successful." << endl;1881 Log() << Verbose(0) << "successful." << endl; 1871 1882 else 1872 Log() << Verbose(0) << " \t...failed." << endl;1883 Log() << Verbose(0) << "failed." << endl; 1873 1884 } else { 1874 1885 if (mol->OutputTrajectoriesXYZ(&output)) 1875 Log() << Verbose(0) << " \t...successful." << endl;1886 Log() << Verbose(0) << "successful." << endl; 1876 1887 else 1877 Log() << Verbose(0) << " \t...failed." << endl;1888 Log() << Verbose(0) << "failed." << endl; 1878 1889 } 1879 1890 output.close(); … … 1885 1896 if (output == NULL) 1886 1897 strcpy(filename,"main_pcp_linux"); 1887 Log() << Verbose(0) << "Saving as mpqc input .. " << endl;1898 Log() << Verbose(0) << "Saving as mpqc input "; 1888 1899 if (SaveMPQC(filename, mol)) 1889 Log() << Verbose(0) << " \t...done." << endl;1900 Log() << Verbose(0) << "done." << endl; 1890 1901 else 1891 Log() << Verbose(0) << " \t...failed." << endl;1902 Log() << Verbose(0) << "failed." << endl; 1892 1903 1893 1904 if (!strcmp(configpath, GetDefaultPath())) { … … 1927 1938 char *dummy1 = NULL; 1928 1939 char *dummy = NULL; 1929 char free_dummy[MAXSTRINGSIZE]; // pointers in the line that is read in per step1940 char * const free_dummy = Malloc<char>(256, "config::ParseForParameter: *free_dummy"); // pointers in the line that is read in per step 1930 1941 dummy1 = free_dummy; 1931 1942 … … 1943 1954 if (file->eof()) { 1944 1955 if ((critical) && (found == 0)) { 1956 Free(free_dummy); 1945 1957 //Error(InitReading, name); 1946 1958 fprintf(stderr,"Error:InitReading, critical %s not found\n", name); … … 1950 1962 file->clear(); 1951 1963 file->seekg(file_position, ios::beg); // rewind to start position 1964 Free(free_dummy); 1952 1965 return 0; 1953 1966 } … … 1980 1993 dummy = strchr(dummy1, '\n'); // set on line end then (whole line = keyword) 1981 1994 //fprintf(stderr,"Error: Cannot find tabs or spaces on line %i in search for %s\n", line, name); 1995 //Free((void **)&free_dummy); 1982 1996 //Error(FileOpenParams, NULL); 1983 1997 } else { … … 2000 2014 if (file->eof()) { 2001 2015 if ((critical) && (found == 0)) { 2016 Free(free_dummy); 2002 2017 //Error(InitReading, name); 2003 2018 fprintf(stderr,"Error:InitReading, critical %s not found\n", name); … … 2007 2022 file->clear(); 2008 2023 file->seekg(file_position, ios::beg); // rewind to start position 2024 Free(free_dummy); 2009 2025 return 0; 2010 2026 } … … 2047 2063 if (critical) { 2048 2064 if (verbose) fprintf(stderr,"Error: EoL at %i and still missing %i value(s) for parameter %s\n", line, yth-j, name); 2065 Free(free_dummy); 2049 2066 //return 0; 2050 2067 exit(255); … … 2054 2071 file->clear(); 2055 2072 file->seekg(file_position, ios::beg); // rewind to start position 2073 Free(free_dummy); 2056 2074 return 0; 2057 2075 } … … 2066 2084 file->seekg(file_position, ios::beg); // rewind to start position 2067 2085 } 2086 Free(free_dummy); 2068 2087 return 0; 2069 2088 } … … 2121 2140 if ((type >= row_int) && (verbose)) 2122 2141 fprintf(stderr,"\n"); 2142 Free(free_dummy); 2123 2143 if (!sequential) { 2124 2144 file->clear(); … … 2201 2221 dummy = strchr(dummy1, '\n'); // set on line end then (whole line = keyword) 2202 2222 //fprintf(stderr,"Error: Cannot find tabs or spaces on line %i in search for %s\n", line, name); 2223 //Free(&free_dummy); 2203 2224 //Error(FileOpenParams, NULL); 2204 2225 } else {
Note:
See TracChangeset
for help on using the changeset viewer.
