Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


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 :/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/parser/preferences/cmd_line_prefs_reader.cc

    r7261 r8316  
    4343{
    4444  CallbackData * cbd = (CallbackData *)data;
    45  
     45
    4646  switch ( entry.id )
    4747  {
     
    5454      key.erase( 0, key.find(".")+1 );
    5555      //PRINTF(0)("SECTION '%s', KEY '%s'\n", section.c_str(), key.c_str());
    56      
     56
    5757      if ( key == "" || section == "" || argArgs.size() != 1 )
    5858      {
     
    6060        return false;
    6161      }
    62      
     62
    6363      //Preferences::getInstance()->setMultiType( section, key, argArgs[0], true );
    6464      cbd->iniEntries.push_back( IniEntry() );
     
    7272      return true;
    7373  }
    74  
    75   if ( entry.id >= ID_PREFS && entry.id - ID_PREFS < regArgs.size() )
     74
     75  if ( entry.id >= ID_PREFS && entry.id  < regArgs.size() + ID_PREFS)
    7676  {
    7777    if ( regArgs[entry.id - ID_PREFS].value == "%arg%" )
    7878    {
    7979      assert( argArgs.size() == 1 );
    80      
     80
    8181      cbd->iniEntries.push_back( IniEntry() );
    8282      cbd->iniEntries.back().section = regArgs[entry.id - ID_PREFS].section;
     
    9696    assert(false);
    9797  }
    98  
     98
    9999  return true;
    100100}
     
    104104{
    105105  CmdLineParser parser;
    106  
     106
    107107  parser.add( ID_HELP, "help", 'h', 0, "", "Shows this help and exits");
    108  
    109   for ( int i = 0; i<regArgs.size(); i++ )
     108
     109  for (unsigned int i = 0; i<regArgs.size(); i++ )
    110110  {
    111111    if ( regArgs[i].value == "%arg%" )
     
    118118    }
    119119  }
    120  
     120
    121121  parser.add( ID_SET_INI, "set-%", '\0', 1, "value", "Override a configuration element." );
    122  
     122
    123123  CallbackData cbd;
    124  
     124
    125125  cbd.parser = &parser;
    126  
     126
    127127  if ( parser.parse( &callBack, &cbd, argc, argv ) )
    128128  {
     
    137137    exit(EXIT_FAILURE);
    138138  }
    139  
     139
    140140  return true;
    141141}
     
    144144{
    145145  RegistredArgument arg;
    146  
     146
    147147  arg.longOption = longOption;
    148148  while ( arg.longOption.find("_") != std::string::npos )
     
    158158  arg.section = section;
    159159  arg.key = key;
    160  
     160
    161161  regArgs.push_back( arg );
     162  return true;
    162163}
    163164
Note: See TracChangeset for help on using the changeset viewer.