Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8316 in orxonox.OLD for trunk/src/lib/parser/cmdline_parser


Ignore:
Timestamp:
Jun 11, 2006, 1:57:27 PM (19 years ago)
Author:
bensch
Message:

trunk: fixed most -Wall warnings… but there are still many missing :/

Location:
trunk/src/lib/parser/cmdline_parser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/parser/cmdline_parser/cmdline_parser.cc

    r7319 r8316  
    5252  else
    5353    argTable.push_front( entry );
     54  return true;
    5455}
    5556
     
    7071      if ( s.length() > 2 && s[0] == '-' && s[1] != '-' )
    7172      {
    72         for ( int j = 1; j < s.length(); j++ )
     73        for (unsigned int j = 1; j < s.length(); j++ )
    7374        {
    7475          std::string t = "-";
     
    9596  }
    9697
    97   int i = 0;
     98  unsigned int i = 0;
    9899
    99100  ArgTable::iterator it;
     
    110111        found = true;
    111112
    112         int posArgs = 1;
     113        unsigned int posArgs = 1;
    113114
    114115        while ( i + posArgs < args.size() )
     
    130131        std::vector<MultiType> argArgs;
    131132
    132         for ( int j = 1; j <= it->numArgs; j++ )
     133        for (unsigned int j = 1; j <= it->numArgs; j++ )
    133134          argArgs.push_back( args[i+j] );
    134135
     
    219220    assert( it->numArgs == substr.size() );
    220221
    221     for ( int i = 0; i<it->numArgs; i++ )
     222    for (unsigned int i = 0; i<it->numArgs; i++ )
    222223    {
    223224      args += " [" + substr[i] + "]";
     
    251252  output.reverse();
    252253
    253   int maxShort = 0;
    254   int maxLong = 0;
     254  unsigned int maxShort = 0;
     255  unsigned int maxLong = 0;
    255256
    256257  std::list<std::vector<std::string> >::const_iterator it;
     
    269270    printf("%s ", (*it)[0].c_str());
    270271
    271     for ( int i = 0; i<maxShort-(*it)[0].length(); i++ )
     272    for (unsigned int i = 0; i<maxShort-(*it)[0].length(); i++ )
    272273      printf(" ");
    273274
    274275    printf("%s ", (*it)[1].c_str());
    275276
    276     for ( int i = 0; i<maxLong-(*it)[1].length(); i++ )
     277    for (unsigned int i = 0; i<maxLong-(*it)[1].length(); i++ )
    277278      printf(" ");
    278279
  • trunk/src/lib/parser/cmdline_parser/cmdline_parser.h

    r7256 r8316  
    1717struct ArgTableEntry
    1818{
    19   int         id;
    20   std::string longOption;
    21   char        shortOption;
    22   int         numArgs;
    23   std::string argNames;
    24   std::string help;
     19  unsigned int    id;
     20  std::string     longOption;
     21  char            shortOption;
     22  unsigned int    numArgs;
     23  std::string     argNames;
     24  std::string     help;
    2525};
    2626
     
    3636    CmdLineParser();
    3737    virtual ~CmdLineParser();
    38    
     38
    3939    bool add( int id, const std::string& longOption, char shortOption, int numArgs, const std::string & argNames, const std::string& help, bool back=false );
    4040
    4141    bool parse( ArgParserCallback cb, void* data, int argc, char** argv );
    42    
     42
    4343    void showHelp();
    44    
     44
    4545  private:
    4646    ArgTable argTable;
    4747    std::string exeName;
    48    
     48
    4949    inline bool matches( ArgTableEntry entry, std::string arg, bool & finish );
    5050
Note: See TracChangeset for help on using the changeset viewer.