[Spice-devel] [PATCH 1/2] Fix typo: seperator -> separator

Liang Guo bluestonechina at gmail.com
Sun Jul 24 10:52:22 PDT 2011


---
 client/cmd_line_parser.cpp    |   34 +++++++++++++++++-----------------
 client/cmd_line_parser.h      |    8 ++++----
 client/windows/red_window.cpp |    6 +++---
 3 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/client/cmd_line_parser.cpp b/client/cmd_line_parser.cpp
index 2f63c04..f2b3290 100644
--- a/client/cmd_line_parser.cpp
+++ b/client/cmd_line_parser.cpp
@@ -41,7 +41,7 @@ CmdLineParser::Option::Option(int in_id, const std::string& in_name, char in_sho
     , help (in_help)
     , optional (true)
     , is_set (false)
-    , seperator (0)
+    , separator (0)
 {
 }
 
@@ -52,7 +52,7 @@ CmdLineParser::CmdLineParser(std::string description, bool allow_positional_args
     , _argv (NULL)
     , _multi_args (NULL)
     , _multi_next (NULL)
-    , _multi_seperator (0)
+    , _multi_separator (0)
     , _positional_args (allow_positional_args)
     , _done (false)
 {
@@ -136,14 +136,14 @@ void CmdLineParser::add(int id, const std::string& name, const std::string& help
                 arg_name);
 }
 
-void CmdLineParser::set_multi(int id, char seperator)
+void CmdLineParser::set_multi(int id, char separator)
 {
     if (_argv) {
         THROW("unexpected");
     }
 
-    if (!ispunct(seperator)) {
-        THROW("invalid seperator");
+    if (!ispunct(separator)) {
+        THROW("invalid separator");
     }
 
     Option* opt = find(id);
@@ -156,7 +156,7 @@ void CmdLineParser::set_multi(int id, char seperator)
         THROW("can't set multi for option without argument");
     }
 
-    opt->seperator = seperator;
+    opt->separator = separator;
 }
 
 void CmdLineParser::set_required(int id)
@@ -292,15 +292,15 @@ void CmdLineParser::begin(int argc, char** argv)
     build();
 }
 
-char* CmdLineParser::start_multi(char *optarg, char seperator)
+char* CmdLineParser::start_multi(char *optarg, char separator)
 {
     if (!optarg) {
         return NULL;
     }
     _multi_args = new char[strlen(optarg) + 1];
-    _multi_seperator = seperator;
+    _multi_separator = separator;
     strcpy(_multi_args, optarg);
-    if ((_multi_next = strchr(_multi_args, _multi_seperator))) {
+    if ((_multi_next = strchr(_multi_args, _multi_separator))) {
         *(_multi_next++) = 0;
     }
     return _multi_args;
@@ -309,13 +309,13 @@ char* CmdLineParser::start_multi(char *optarg, char seperator)
 char* CmdLineParser::next_multi()
 {
     if (!_multi_next) {
-        _multi_seperator = 0;
+        _multi_separator = 0;
         delete[] _multi_args;
         _multi_args = NULL;
         return NULL;
     }
     char* ret = _multi_next;
-    if ((_multi_next = strchr(_multi_next, _multi_seperator))) {
+    if ((_multi_next = strchr(_multi_next, _multi_separator))) {
         *(_multi_next++) = 0;
     }
 
@@ -360,8 +360,8 @@ int CmdLineParser::get_option(char** val)
         }
 #endif
 
-        if (opt_obj->seperator) {
-            *val = start_multi(optarg, opt_obj->seperator);
+        if (opt_obj->separator) {
+            *val = start_multi(optarg, opt_obj->separator);
         } else {
             *val = optarg;
         }
@@ -409,8 +409,8 @@ int CmdLineParser::get_option(char** val)
             *val = NULL;
             return OPTION_ERROR;
         }
-        if (opt_obj->seperator) {
-            *val = start_multi(optarg, opt_obj->seperator);
+        if (opt_obj->separator) {
+            *val = start_multi(optarg, opt_obj->separator);
         } else {
             *val = optarg;
         }
@@ -466,8 +466,8 @@ void CmdLineParser::show_help()
         }
 
         if (opt->type == OPTIONAL_ARGUMENT || opt->type == REQUIRED_ARGUMENT) {
-            if (opt->seperator) {
-                os << opt->arg_name << opt->seperator << opt->arg_name << "...";
+            if (opt->separator) {
+                os << opt->arg_name << opt->separator << opt->arg_name << "...";
             } else {
                 os << opt->arg_name;
             }
diff --git a/client/cmd_line_parser.h b/client/cmd_line_parser.h
index 37b5660..5faf52b 100644
--- a/client/cmd_line_parser.h
+++ b/client/cmd_line_parser.h
@@ -36,7 +36,7 @@ public:
 
     void add(int id, const std::string& name, const std::string& help,
              const std::string& arg_name, bool required_arg, char short_name = 0);
-    void set_multi(int id, char seperator);
+    void set_multi(int id, char separator);
     void set_required(int id);
 
     void begin(int argc, char** argv);
@@ -64,7 +64,7 @@ private:
 
     void build();
 
-    char* start_multi(char *optarg, char seperator);
+    char* start_multi(char *optarg, char separator);
     char* next_multi();
 
 private:
@@ -83,7 +83,7 @@ private:
         std::string help;
         bool optional;
         bool is_set;
-        char seperator;
+        char separator;
     };
 
     std::string _description;
@@ -96,7 +96,7 @@ private:
     char** _argv;
     char* _multi_args;
     char* _multi_next;
-    char _multi_seperator;
+    char _multi_separator;
     bool _positional_args;
     bool _done;
 };
diff --git a/client/windows/red_window.cpp b/client/windows/red_window.cpp
index dcd35fa..39960dc 100644
--- a/client/windows/red_window.cpp
+++ b/client/windows/red_window.cpp
@@ -899,7 +899,7 @@ void RedWindow::on_pointer_leave()
     }
 }
 
-static void insert_seperator(HMENU menu)
+static void insert_separator(HMENU menu)
 {
     MENUITEMINFO item_info;
     item_info.cbSize = sizeof(item_info);
@@ -1004,7 +1004,7 @@ static void insert_menu(Menu* menu, HMENU native, CommandMap& _commands_map)
             break;
         }
         case Menu::MENU_ITEM_TYPE_SEPARATOR:
-            insert_seperator(native);
+            insert_separator(native);
             break;
         case Menu::MENU_ITEM_TYPE_INVALID:
             return;
@@ -1036,7 +1036,7 @@ void RedWindow::set_menu(Menu* menu)
     }
     _menu = menu->ref();
     _sys_menu = GetSystemMenu(_win, FALSE);
-    insert_seperator(_sys_menu);
+    insert_separator(_sys_menu);
     insert_menu(_menu, _sys_menu, _commands_map);
 }
 
-- 
1.7.5.4



More information about the Spice-devel mailing list