Index: trunk/src/lib/parser/cmdline_parser/cmdline_parser.cc
===================================================================
--- trunk/src/lib/parser/cmdline_parser/cmdline_parser.cc	(revision 7729)
+++ trunk/src/lib/parser/cmdline_parser/cmdline_parser.cc	(revision 8316)
@@ -52,4 +52,5 @@
   else
     argTable.push_front( entry );
+  return true;
 }
 
@@ -70,5 +71,5 @@
       if ( s.length() > 2 && s[0] == '-' && s[1] != '-' )
       {
-        for ( int j = 1; j < s.length(); j++ )
+        for (unsigned int j = 1; j < s.length(); j++ )
         {
           std::string t = "-";
@@ -95,5 +96,5 @@
   }
 
-  int i = 0;
+  unsigned int i = 0;
 
   ArgTable::iterator it;
@@ -110,5 +111,5 @@
         found = true;
 
-        int posArgs = 1;
+        unsigned int posArgs = 1;
 
         while ( i + posArgs < args.size() )
@@ -130,5 +131,5 @@
         std::vector<MultiType> argArgs;
 
-        for ( int j = 1; j <= it->numArgs; j++ )
+        for (unsigned int j = 1; j <= it->numArgs; j++ )
           argArgs.push_back( args[i+j] );
 
@@ -219,5 +220,5 @@
     assert( it->numArgs == substr.size() );
 
-    for ( int i = 0; i<it->numArgs; i++ )
+    for (unsigned int i = 0; i<it->numArgs; i++ )
     {
       args += " [" + substr[i] + "]";
@@ -251,6 +252,6 @@
   output.reverse();
 
-  int maxShort = 0;
-  int maxLong = 0;
+  unsigned int maxShort = 0;
+  unsigned int maxLong = 0;
 
   std::list<std::vector<std::string> >::const_iterator it;
@@ -269,10 +270,10 @@
     printf("%s ", (*it)[0].c_str());
 
-    for ( int i = 0; i<maxShort-(*it)[0].length(); i++ )
+    for (unsigned  int i = 0; i<maxShort-(*it)[0].length(); i++ )
       printf(" ");
 
     printf("%s ", (*it)[1].c_str());
 
-    for ( int i = 0; i<maxLong-(*it)[1].length(); i++ )
+    for (unsigned int i = 0; i<maxLong-(*it)[1].length(); i++ )
       printf(" ");
 
Index: trunk/src/lib/parser/cmdline_parser/cmdline_parser.h
===================================================================
--- trunk/src/lib/parser/cmdline_parser/cmdline_parser.h	(revision 7729)
+++ trunk/src/lib/parser/cmdline_parser/cmdline_parser.h	(revision 8316)
@@ -17,10 +17,10 @@
 struct ArgTableEntry
 {
-  int         id;
-  std::string longOption;
-  char        shortOption;
-  int         numArgs;
-  std::string argNames;
-  std::string help;
+  unsigned int    id;
+  std::string     longOption;
+  char            shortOption;
+  unsigned int    numArgs;
+  std::string     argNames;
+  std::string     help;
 };
 
@@ -36,15 +36,15 @@
     CmdLineParser();
     virtual ~CmdLineParser();
-    
+
     bool add( int id, const std::string& longOption, char shortOption, int numArgs, const std::string & argNames, const std::string& help, bool back=false );
 
     bool parse( ArgParserCallback cb, void* data, int argc, char** argv );
-    
+
     void showHelp();
-    
+
   private:
     ArgTable argTable;
     std::string exeName;
-    
+
     inline bool matches( ArgTableEntry entry, std::string arg, bool & finish );
 
Index: trunk/src/lib/parser/preferences/cmd_line_prefs_reader.cc
===================================================================
--- trunk/src/lib/parser/preferences/cmd_line_prefs_reader.cc	(revision 7729)
+++ trunk/src/lib/parser/preferences/cmd_line_prefs_reader.cc	(revision 8316)
@@ -43,5 +43,5 @@
 {
   CallbackData * cbd = (CallbackData *)data;
-  
+
   switch ( entry.id )
   {
@@ -54,5 +54,5 @@
       key.erase( 0, key.find(".")+1 );
       //PRINTF(0)("SECTION '%s', KEY '%s'\n", section.c_str(), key.c_str());
-      
+
       if ( key == "" || section == "" || argArgs.size() != 1 )
       {
@@ -60,5 +60,5 @@
         return false;
       }
-      
+
       //Preferences::getInstance()->setMultiType( section, key, argArgs[0], true );
       cbd->iniEntries.push_back( IniEntry() );
@@ -72,11 +72,11 @@
       return true;
   }
-  
-  if ( entry.id >= ID_PREFS && entry.id - ID_PREFS < regArgs.size() )
+
+  if ( entry.id >= ID_PREFS && entry.id  < regArgs.size() + ID_PREFS)
   {
     if ( regArgs[entry.id - ID_PREFS].value == "%arg%" )
     {
       assert( argArgs.size() == 1 );
-      
+
       cbd->iniEntries.push_back( IniEntry() );
       cbd->iniEntries.back().section = regArgs[entry.id - ID_PREFS].section;
@@ -96,5 +96,5 @@
     assert(false);
   }
-  
+
   return true;
 }
@@ -104,8 +104,8 @@
 {
   CmdLineParser parser;
-  
+
   parser.add( ID_HELP, "help", 'h', 0, "", "Shows this help and exits");
-  
-  for ( int i = 0; i<regArgs.size(); i++ )
+
+  for (unsigned int i = 0; i<regArgs.size(); i++ )
   {
     if ( regArgs[i].value == "%arg%" )
@@ -118,11 +118,11 @@
     }
   }
-  
+
   parser.add( ID_SET_INI, "set-%", '\0', 1, "value", "Override a configuration element." );
-  
+
   CallbackData cbd;
-  
+
   cbd.parser = &parser;
-  
+
   if ( parser.parse( &callBack, &cbd, argc, argv ) )
   {
@@ -137,5 +137,5 @@
     exit(EXIT_FAILURE);
   }
-  
+
   return true;
 }
@@ -144,5 +144,5 @@
 {
   RegistredArgument arg;
-  
+
   arg.longOption = longOption;
   while ( arg.longOption.find("_") != std::string::npos )
@@ -158,6 +158,7 @@
   arg.section = section;
   arg.key = key;
-  
+
   regArgs.push_back( arg );
+  return true;
 }
 
