Ignore:
Timestamp:
May 17, 2010, 5:31:35 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
5fa7c5
Parents:
65a563
Message:

FIX: list of arguments passed to ParseCommandLineOptions() should be unique.

  • converted list<> to set<> such that argument counters are unique.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/builder.cpp

    r65a563 rc1e0da  
    14941494 */
    14951495static int ParseCommandLineOptions(int argc, char **argv, MoleculeListClass *&molecules, periodentafel *&periode,
    1496                                    config& configuration, char *&ConfigFileName, list<int> &ArgcList)
     1496                                   config& configuration, char *&ConfigFileName, set<int> &ArgcList)
    14971497{
    14981498  Vector x,y,z,n;  // coordinates for absolute point in cell volume
     
    15251525          case 'H':
    15261526          case '?':
    1527             ArgcList.push_back(argptr-1);
     1527            ArgcList.insert(argptr-1);
    15281528            return(1);
    15291529            break;
    15301530          case 'v':
    1531             ArgcList.push_back(argptr-1);
     1531            ArgcList.insert(argptr-1);
    15321532            return(1);
    15331533            break;
    15341534          case 'V':
    1535             ArgcList.push_back(argptr-1);
    1536             ArgcList.push_back(argptr);
     1535            ArgcList.insert(argptr-1);
     1536            ArgcList.insert(argptr);
    15371537            argptr++;
    15381538            break;
     
    25092509    // Parse command line options and if present create respective UI
    25102510    {
    2511       list<int> ArgcList;
    2512       ArgcList.push_back(0); // push back program!
    2513       ArgcList.push_back(1); // push back config file name
     2511      set<int> ArgcList;
     2512      ArgcList.insert(0); // push back program!
     2513      ArgcList.insert(1); // push back config file name
    25142514      char ConfigFileName[MAXSTRINGSIZE];
    25152515      // handle arguments by ParseCommandLineOptions()
     
    25182518      Arguments = Malloc<char *>(ArgcList.size(), "main - **Arguments");
    25192519      cout << "The following arguments are handled by CommandLineParser: ";
    2520       for (list<int>::iterator ArgcRunner = ArgcList.begin(); ArgcRunner != ArgcList.end(); ++ArgcRunner) {
     2520      for (set<int>::iterator ArgcRunner = ArgcList.begin(); ArgcRunner != ArgcList.end(); ++ArgcRunner) {
    25212521        Arguments[ArgcSize] = Malloc<char>(strlen(argv[*ArgcRunner])+2, "main - *Arguments[]");
    25222522        strcpy(Arguments[ArgcSize], argv[*ArgcRunner]);
Note: See TracChangeset for help on using the changeset viewer.