[Spice-commits] 3 commits - client/cmd_line_parser.cpp client/cmd_line_parser.h client/windows client/x11 server/mjpeg_encoder.c

Christophe Fergau teuf at kemper.freedesktop.org
Tue Aug 2 02:15:34 PDT 2011


 client/cmd_line_parser.cpp    |   34 +++++++++++++++++-----------------
 client/cmd_line_parser.h      |    8 ++++----
 client/windows/red_window.cpp |    6 +++---
 client/x11/record.cpp         |    2 +-
 server/mjpeg_encoder.c        |    1 +
 5 files changed, 26 insertions(+), 25 deletions(-)

New commits:
commit 3582adb989cdb6e1e75bf9341ffcebf35e58b737
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Fri Jul 29 18:52:15 2011 +0200

    mjpeg: add missing SPICE_BITMAP_FMT_RGBA
    
    I forgot to handle SPICE_BITMAP_FMT_RGBA when mapping from
    spice image formats to libjpeg-turbo colorspaces.

diff --git a/server/mjpeg_encoder.c b/server/mjpeg_encoder.c
index ea2e15f..4b1023a 100644
--- a/server/mjpeg_encoder.c
+++ b/server/mjpeg_encoder.c
@@ -207,6 +207,7 @@ int mjpeg_encoder_start_frame(MJpegEncoder *encoder, SpiceBitmapFmt format,
     encoder->cinfo.input_components = 3;
     switch (format) {
     case SPICE_BITMAP_FMT_32BIT:
+    case SPICE_BITMAP_FMT_RGBA:
         encoder->bytes_per_pixel = 4;
 #ifdef JCS_EXTENSIONS
         encoder->cinfo.in_color_space   = JCS_EXT_BGRX;
commit 39867cb4df4bdc929144953898c60b479f3901cc
Author: Liang Guo <bluestonechina at gmail.com>
Date:   Mon Jul 25 01:52:23 2011 +0800

    Fix typo: treshold -> threshold

diff --git a/client/x11/record.cpp b/client/x11/record.cpp
index d799e5a..017a94d 100644
--- a/client/x11/record.cpp
+++ b/client/x11/record.cpp
@@ -182,7 +182,7 @@ bool WaveRecorder::init(uint32_t sampels_per_sec,
     }
 
     if ((err = snd_pcm_sw_params_set_start_threshold(_pcm, _sw_params, frame_size)) < 0) {
-        LOG_ERROR("cannot set start treshold %s", snd_strerror(err));
+        LOG_ERROR("cannot set start threshold %s", snd_strerror(err));
         return false;
     }
 
commit a2433172c81d234f4f6e00909f0c992d4e83a138
Author: Liang Guo <bluestonechina at gmail.com>
Date:   Mon Jul 25 01:52:22 2011 +0800

    Fix typo: seperator -> separator

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);
 }
 


More information about the Spice-commits mailing list