[Spice-commits] 3 commits - client/application.cpp client/client_net_socket.h client/cursor_channel.cpp client/display_channel.cpp client/glz_decoded_image.h client/glz_decoder_window.cpp client/glz_decode_tmpl.c client/playback_channel.cpp client/process_loop.cpp client/red_channel.cpp client/tunnel_channel.cpp client/x11 common/canvas_base.c common/gl_canvas.c common/glc.c common/lz.c common/lz_compress_tmpl.c common/lz_decompress_tmpl.c common/lz.h common/mem.h common/quic.c common/quic.h server/glz_encode_match_tmpl.c server/glz_encoder.c server/glz_encoder_dictionary.c server/glz_encoder_dictionary.h server/glz_encoder_dictionary_protected.h server/glz_encoder.h server/glz_encode_tmpl.c server/red_bitmap_utils.h server/red_dispatcher.c server/red_memslots.c server/reds.c server/reds.h server/red_tunnel_worker.c server/red_worker.c server/red_worker.h

Alexander Larsson alexl at kemper.freedesktop.org
Fri May 21 02:17:19 PDT 2010


 client/application.cpp                    |    6 +-
 client/client_net_socket.h                |    2 
 client/cursor_channel.cpp                 |   10 ++--
 client/display_channel.cpp                |   22 ++++----
 client/glz_decode_tmpl.c                  |    6 +-
 client/glz_decoded_image.h                |    2 
 client/glz_decoder_window.cpp             |   10 ++--
 client/playback_channel.cpp               |    2 
 client/process_loop.cpp                   |    2 
 client/red_channel.cpp                    |   12 ++--
 client/tunnel_channel.cpp                 |    4 -
 client/x11/main.cpp                       |    4 -
 client/x11/named_pipe.cpp                 |    2 
 client/x11/platform.cpp                   |    6 +-
 client/x11/red_window.cpp                 |    2 
 common/canvas_base.c                      |    4 -
 common/gl_canvas.c                        |    2 
 common/glc.c                              |    2 
 common/lz.c                               |   12 ++--
 common/lz.h                               |    6 +-
 common/lz_compress_tmpl.c                 |   10 ++--
 common/lz_decompress_tmpl.c               |    2 
 common/mem.h                              |    4 -
 common/quic.c                             |    2 
 common/quic.h                             |    2 
 server/glz_encode_match_tmpl.c            |    4 -
 server/glz_encode_tmpl.c                  |    4 -
 server/glz_encoder.c                      |    4 -
 server/glz_encoder.h                      |    6 +-
 server/glz_encoder_dictionary.c           |    6 +-
 server/glz_encoder_dictionary.h           |   10 ++--
 server/glz_encoder_dictionary_protected.h |   18 +++----
 server/red_bitmap_utils.h                 |    2 
 server/red_dispatcher.c                   |   50 ++++++++++----------
 server/red_memslots.c                     |    2 
 server/red_tunnel_worker.c                |   36 +++++++-------
 server/red_worker.c                       |   74 +++++++++++++++---------------
 server/red_worker.h                       |   10 ++--
 server/reds.c                             |   36 +++++++-------
 server/reds.h                             |    2 
 40 files changed, 201 insertions(+), 201 deletions(-)

New commits:
commit f9da2720ae15536ef31ec3c7cefd7a8332fe41e8
Author: Alexander Larsson <alexl at redhat.com>
Date:   Fri May 21 11:14:29 2010 +0200

    Fix some misspelled identifiers
    
    severty -> severity
    SpiceResorceID -> SpiceResourceID
    SpiceResorceList -> SpiceResourceList
    resorces -> resources
    ped_size -> pad_size
    postition -> position

diff --git a/client/cursor_channel.cpp b/client/cursor_channel.cpp
index cc5d426..44cacd4 100644
--- a/client/cursor_channel.cpp
+++ b/client/cursor_channel.cpp
@@ -580,8 +580,8 @@ void CursorChannel::handle_reset(RedPeer::InMessage *message)
 void CursorChannel::handle_cursor_set(RedPeer::InMessage* message)
 {
     SpiceMsgCursorSet* set = (SpiceMsgCursorSet*)message->data();
-    set_cursor(set->cursor, message->size() - sizeof(SpiceMsgCursorSet), set->postition.x,
-               set->postition.y, set->visible != 0);
+    set_cursor(set->cursor, message->size() - sizeof(SpiceMsgCursorSet), set->position.x,
+               set->position.y, set->visible != 0);
 }
 
 void CursorChannel::handle_cursor_move(RedPeer::InMessage* message)
@@ -594,8 +594,8 @@ void CursorChannel::handle_cursor_move(RedPeer::InMessage* message)
 
     Lock lock(_update_lock);
     _cursor_visible = true;
-    int dx = move->postition.x - _hot_pos.x;
-    int dy = move->postition.y - _hot_pos.y;
+    int dx = move->position.x - _hot_pos.x;
+    int dy = move->position.y - _hot_pos.y;
     _hot_pos.x += dx;
     _hot_pos.y += dy;
     _cursor_rect.left += dx;
diff --git a/client/display_channel.cpp b/client/display_channel.cpp
index 2cdf8ea..abfe636 100644
--- a/client/display_channel.cpp
+++ b/client/display_channel.cpp
@@ -158,7 +158,7 @@ public:
                 SpiceRect* dest, int clip_type, uint32_t num_clip_rects, SpiceRect* clip_rects);
     ~VideoStream();
 
-    void push_data(uint32_t mm_time, uint32_t length, uint8_t* data, uint32_t ped_size);
+    void push_data(uint32_t mm_time, uint32_t length, uint8_t* data, uint32_t pad_size);
     void set_clip(int type, uint32_t num_clip_rects, SpiceRect* clip_rects);
     const SpiceRect& get_dest() {return _dest;}
     void handle_update_mark(uint64_t update_mark);
@@ -445,7 +445,7 @@ uint32_t VideoStream::alloc_frame_slot()
     return frame_slot(_frames_head++);
 }
 
-void VideoStream::push_data(uint32_t mm_time, uint32_t length, uint8_t* data, uint32_t ped_size)
+void VideoStream::push_data(uint32_t mm_time, uint32_t length, uint8_t* data, uint32_t pad_size)
 {
     maintenance();
     uint32_t frame_slot = alloc_frame_slot();
@@ -622,7 +622,7 @@ DisplayChannel::DisplayChannel(RedClient& client, uint32_t id,
 
     handler->set_handler(SPICE_MSG_DISPLAY_INVAL_LIST,
                          &DisplayChannel::handle_inval_list,
-                         sizeof(SpiceResorceList));
+                         sizeof(SpiceResourceList));
     handler->set_handler(SPICE_MSG_DISPLAY_INVAL_ALL_PIXMAPS,
                          &DisplayChannel::handle_inval_all_pixmaps,
                          sizeof(SpiceMsgWaitForChannels));
@@ -1251,19 +1251,19 @@ void DisplayChannel::handle_reset(RedPeer::InMessage *message)
 
 void DisplayChannel::handle_inval_list(RedPeer::InMessage* message)
 {
-    SpiceResorceList *inval_list = (SpiceResorceList *)message->data();
+    SpiceResourceList *inval_list = (SpiceResourceList *)message->data();
 
     if (message->size() <
-                        sizeof(*inval_list) + inval_list->count * sizeof(inval_list->resorces[0])) {
+                        sizeof(*inval_list) + inval_list->count * sizeof(inval_list->resources[0])) {
         THROW("access violation");
     }
 
     for (int i = 0; i < inval_list->count; i++) {
-        if (inval_list->resorces[i].type != SPICE_RES_TYPE_PIXMAP) {
+        if (inval_list->resources[i].type != SPICE_RES_TYPE_PIXMAP) {
             THROW("invalid res type");
         }
 
-        _pixmap_cache.remove(inval_list->resorces[i].id);
+        _pixmap_cache.remove(inval_list->resources[i].id);
     }
 }
 
@@ -1357,12 +1357,12 @@ void DisplayChannel::handle_stream_data(RedPeer::InMessage* message)
         THROW("invalid stream");
     }
 
-    if (message->size() < sizeof(SpiceMsgDisplayStreamData) + stream_data->data_size + stream_data->ped_size) {
+    if (message->size() < sizeof(SpiceMsgDisplayStreamData) + stream_data->data_size + stream_data->pad_size) {
         THROW("access violation");
     }
 
     stream->push_data(stream_data->multi_media_time, stream_data->data_size, stream_data->data,
-                      stream_data->ped_size);
+                      stream_data->pad_size);
 }
 
 void DisplayChannel::handle_stream_clip(RedPeer::InMessage* message)
diff --git a/client/red_channel.cpp b/client/red_channel.cpp
index 6e6190f..475cec4 100644
--- a/client/red_channel.cpp
+++ b/client/red_channel.cpp
@@ -675,10 +675,10 @@ void RedChannel::handle_notify(RedPeer::InMessage* message)
     static const char* visibility_strings[] = {"!", "!!", "!!!"};
 
 
-    if (notify->severty > SPICE_NOTIFY_SEVERITY_ERROR) {
+    if (notify->severity > SPICE_NOTIFY_SEVERITY_ERROR) {
         THROW("bad severity");
     }
-    sevirity = sevirity_strings[notify->severty];
+    sevirity = sevirity_strings[notify->severity];
 
     if (notify->visibilty > SPICE_NOTIFY_VISIBILITY_HIGH) {
         THROW("bad visibility");
diff --git a/server/red_worker.c b/server/red_worker.c
index e31c304..33ff373 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -521,7 +521,7 @@ typedef struct WaitForChannels {
 
 typedef struct FreeList {
     int res_size;
-    SpiceResorceList *res;
+    SpiceResourceList *res;
     uint64_t sync[MAX_CACHE_CLIENTS];
     WaitForChannels wait;
 } FreeList;
@@ -6807,17 +6807,17 @@ static void display_channel_push_release(DisplayChannel *channel, uint8_t type,
     }
 
     if (free_list->res->count == free_list->res_size) {
-        SpiceResorceList *new_list;
-        new_list = spice_malloc(sizeof(*new_list) + free_list->res_size * sizeof(SpiceResorceID) * 2);
+        SpiceResourceList *new_list;
+        new_list = spice_malloc(sizeof(*new_list) + free_list->res_size * sizeof(SpiceResourceID) * 2);
         new_list->count = free_list->res->count;
-        memcpy(new_list->resorces, free_list->res->resorces,
-               new_list->count * sizeof(SpiceResorceID));
+        memcpy(new_list->resources, free_list->res->resources,
+               new_list->count * sizeof(SpiceResourceID));
         free(free_list->res);
         free_list->res = new_list;
         free_list->res_size *= 2;
     }
-    free_list->res->resorces[free_list->res->count].type = type;
-    free_list->res->resorces[free_list->res->count++].id = id;
+    free_list->res->resources[free_list->res->count].type = type;
+    free_list->res->resources[free_list->res->count++].id = id;
 }
 
 static inline void red_begin_send_massage(RedChannel *channel, void *item)
@@ -6869,7 +6869,7 @@ static inline void display_begin_send_massage(DisplayChannel *channel, void *ite
         }
         sub_header[sub_index].type = SPICE_MSG_DISPLAY_INVAL_LIST;
         sub_header[sub_index].size = sizeof(*free_list->res) + free_list->res->count *
-                                     sizeof(free_list->res->resorces[0]);
+                                     sizeof(free_list->res->resources[0]);
         add_buf((RedChannel*)channel, BUF_TYPE_RAW, &sub_header[sub_index], sizeof(*sub_header), 0,
                 0);
         add_buf((RedChannel*)channel, BUF_TYPE_RAW, free_list->res, sub_header[sub_index].size, 0,
@@ -7169,7 +7169,7 @@ static inline int red_send_stream_data(DisplayChannel *display_channel, Drawable
     stream_data->id = stream - worker->streams_buf;
     stream_data->multi_media_time = drawable->qxl_drawable->mm_time;
     stream_data->data_size = n;
-    stream_data->ped_size = PADDING;
+    stream_data->pad_size = PADDING;
     display_begin_send_massage(display_channel, NULL);
     agent->lats_send_time = time_now;
     return TRUE;
@@ -7520,7 +7520,7 @@ static void red_send_local_cursor(CursorChannel *cursor_channel, LocalCursor *cu
 
     channel = &cursor_channel->base;
     channel->send_data.header.type = SPICE_MSG_CURSOR_SET;
-    cursor_channel->send_data.u.cursor_set.postition = cursor->position;
+    cursor_channel->send_data.u.cursor_set.position = cursor->position;
     cursor_channel->send_data.u.cursor_set.visible = channel->worker->cursor_visible;
     add_buf(channel, BUF_TYPE_RAW, &cursor_channel->send_data.u.cursor_set,
             sizeof(SpiceMsgCursorSet), 0, 0);
@@ -7553,13 +7553,13 @@ static void red_send_cursor(CursorChannel *cursor_channel, CursorItem *cursor)
     switch (cmd->type) {
     case QXL_CURSOR_MOVE:
         channel->send_data.header.type = SPICE_MSG_CURSOR_MOVE;
-        cursor_channel->send_data.u.cursor_move.postition = cmd->u.position;
+        cursor_channel->send_data.u.cursor_move.position = cmd->u.position;
         add_buf(channel, BUF_TYPE_RAW, &cursor_channel->send_data.u.cursor_move,
                 sizeof(SpiceMsgCursorMove), 0, 0);
         break;
     case QXL_CURSOR_SET:
         channel->send_data.header.type = SPICE_MSG_CURSOR_SET;
-        cursor_channel->send_data.u.cursor_set.postition = cmd->u.set.position;
+        cursor_channel->send_data.u.cursor_set.position = cmd->u.set.position;
         cursor_channel->send_data.u.cursor_set.visible = channel->worker->cursor_visible;
         add_buf(channel, BUF_TYPE_RAW, &cursor_channel->send_data.u.cursor_set,
                 sizeof(SpiceMsgCursorSet), 0, 0);
@@ -8763,8 +8763,8 @@ static void handle_new_display_channel(RedWorker *worker, RedsStreamContext *pee
 
 
     display_channel->send_data.free_list.res =
-        spice_malloc(sizeof(SpiceResorceList) +
-                     DISPLAY_FREE_LIST_DEFAULT_SIZE * sizeof(SpiceResorceID));
+        spice_malloc(sizeof(SpiceResourceList) +
+                     DISPLAY_FREE_LIST_DEFAULT_SIZE * sizeof(SpiceResourceID));
     display_channel->send_data.free_list.res_size = DISPLAY_FREE_LIST_DEFAULT_SIZE;
     red_ref_channel((RedChannel*)display_channel);
     on_new_display_channel(worker);
diff --git a/server/reds.c b/server/reds.c
index 189e812..051fc30 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -2527,7 +2527,7 @@ static void reds_handle_other_links(RedLinkInfo *link)
 
         notify = (SpiceMsgNotify *)item->data;
         notify->time_stamp = get_time_stamp();
-        notify->severty = SPICE_NOTIFY_SEVERITY_WARN;
+        notify->severity = SPICE_NOTIFY_SEVERITY_WARN;
         notify->visibilty = SPICE_NOTIFY_VISIBILITY_HIGH;
         notify->what = SPICE_WARN_GENERAL;
         notify->message_len = mess_len;
commit d69b0829a6eea44939514ddef6aec62649e5b7eb
Author: Alexander Larsson <alexl at redhat.com>
Date:   Fri May 21 10:56:05 2010 +0200

    RedWorkeMessage -> RedWorkerMessage

diff --git a/server/red_dispatcher.c b/server/red_dispatcher.c
index 735d6c0..4368cf6 100644
--- a/server/red_dispatcher.c
+++ b/server/red_dispatcher.c
@@ -74,7 +74,7 @@ static void red_dispatcher_set_peer(Channel *channel, RedsStreamContext *peer, i
 
     red_printf("");
     dispatcher = (RedDispatcher *)channel->data;
-    RedWorkeMessage message = RED_WORKER_MESSAGE_DISPLAY_CONNECT;
+    RedWorkerMessage message = RED_WORKER_MESSAGE_DISPLAY_CONNECT;
     write_message(dispatcher->channel, &message);
     send_data(dispatcher->channel, &peer, sizeof(RedsStreamContext *));
     send_data(dispatcher->channel, &migration, sizeof(int));
@@ -84,7 +84,7 @@ static void red_dispatcher_shutdown_peer(Channel *channel)
 {
     RedDispatcher *dispatcher = (RedDispatcher *)channel->data;
     red_printf("");
-    RedWorkeMessage message = RED_WORKER_MESSAGE_DISPLAY_DISCONNECT;
+    RedWorkerMessage message = RED_WORKER_MESSAGE_DISPLAY_DISCONNECT;
     write_message(dispatcher->channel, &message);
 }
 
@@ -92,7 +92,7 @@ static void red_dispatcher_migrate(Channel *channel)
 {
     RedDispatcher *dispatcher = (RedDispatcher *)channel->data;
     red_printf("channel type %u id %u", channel->type, channel->id);
-    RedWorkeMessage message = RED_WORKER_MESSAGE_DISPLAY_MIGRATE;
+    RedWorkerMessage message = RED_WORKER_MESSAGE_DISPLAY_MIGRATE;
     write_message(dispatcher->channel, &message);
 }
 
@@ -103,7 +103,7 @@ static void red_dispatcher_set_cursor_peer(Channel *channel, RedsStreamContext *
 {
     RedDispatcher *dispatcher = (RedDispatcher *)channel->data;
     red_printf("");
-    RedWorkeMessage message = RED_WORKER_MESSAGE_CURSOR_CONNECT;
+    RedWorkerMessage message = RED_WORKER_MESSAGE_CURSOR_CONNECT;
     write_message(dispatcher->channel, &message);
     send_data(dispatcher->channel, &peer, sizeof(RedsStreamContext *));
     send_data(dispatcher->channel, &migration, sizeof(int));
@@ -113,7 +113,7 @@ static void red_dispatcher_shutdown_cursor_peer(Channel *channel)
 {
     RedDispatcher *dispatcher = (RedDispatcher *)channel->data;
     red_printf("");
-    RedWorkeMessage message = RED_WORKER_MESSAGE_CURSOR_DISCONNECT;
+    RedWorkerMessage message = RED_WORKER_MESSAGE_CURSOR_DISCONNECT;
     write_message(dispatcher->channel, &message);
 }
 
@@ -121,7 +121,7 @@ static void red_dispatcher_cursor_migrate(Channel *channel)
 {
     RedDispatcher *dispatcher = (RedDispatcher *)channel->data;
     red_printf("channel type %u id %u", channel->type, channel->id);
-    RedWorkeMessage message = RED_WORKER_MESSAGE_CURSOR_MIGRATE;
+    RedWorkerMessage message = RED_WORKER_MESSAGE_CURSOR_MIGRATE;
     write_message(dispatcher->channel, &message);
 }
 
@@ -204,7 +204,7 @@ static void qxl_worker_update_area(QXLWorker *qxl_worker, uint32_t surface_id,
                                    uint32_t num_dirty_rects, uint32_t clear_dirty_region)
 {
     RedDispatcher *dispatcher = (RedDispatcher *)qxl_worker;
-    RedWorkeMessage message = RED_WORKER_MESSAGE_UPDATE;
+    RedWorkerMessage message = RED_WORKER_MESSAGE_UPDATE;
 
     write_message(dispatcher->channel, &message);
     send_data(dispatcher->channel, &surface_id, sizeof(uint32_t));
@@ -219,7 +219,7 @@ static void qxl_worker_update_area(QXLWorker *qxl_worker, uint32_t surface_id,
 static void qxl_worker_add_memslot(QXLWorker *qxl_worker, QXLDevMemSlot *mem_slot)
 {
     RedDispatcher *dispatcher = (RedDispatcher *)qxl_worker;
-    RedWorkeMessage message = RED_WORKER_MESSAGE_ADD_MEMSLOT;
+    RedWorkerMessage message = RED_WORKER_MESSAGE_ADD_MEMSLOT;
 
     write_message(dispatcher->channel, &message);
     send_data(dispatcher->channel, mem_slot, sizeof(QXLDevMemSlot));
@@ -230,7 +230,7 @@ static void qxl_worker_add_memslot(QXLWorker *qxl_worker, QXLDevMemSlot *mem_slo
 static void qxl_worker_del_memslot(QXLWorker *qxl_worker, uint32_t slot_group_id, uint32_t slot_id)
 {
     RedDispatcher *dispatcher = (RedDispatcher *)qxl_worker;
-    RedWorkeMessage message = RED_WORKER_MESSAGE_DEL_MEMSLOT;
+    RedWorkerMessage message = RED_WORKER_MESSAGE_DEL_MEMSLOT;
 
     write_message(dispatcher->channel, &message);
     send_data(dispatcher->channel, &slot_group_id, sizeof(uint32_t));
@@ -240,7 +240,7 @@ static void qxl_worker_del_memslot(QXLWorker *qxl_worker, uint32_t slot_group_id
 static void qxl_worker_destroy_surfaces(QXLWorker *qxl_worker)
 {
     RedDispatcher *dispatcher = (RedDispatcher *)qxl_worker;
-    RedWorkeMessage message = RED_WORKER_MESSAGE_DESTROY_SURFACES;
+    RedWorkerMessage message = RED_WORKER_MESSAGE_DESTROY_SURFACES;
 
     write_message(dispatcher->channel, &message);
     read_message(dispatcher->channel, &message);
@@ -250,7 +250,7 @@ static void qxl_worker_destroy_surfaces(QXLWorker *qxl_worker)
 static void qxl_worker_destroy_primary(QXLWorker *qxl_worker, uint32_t surface_id)
 {
     RedDispatcher *dispatcher = (RedDispatcher *)qxl_worker;
-    RedWorkeMessage message = RED_WORKER_MESSAGE_DESTROY_PRIMARY_SURFACE;
+    RedWorkerMessage message = RED_WORKER_MESSAGE_DESTROY_PRIMARY_SURFACE;
 
     write_message(dispatcher->channel, &message);
     send_data(dispatcher->channel, &surface_id, sizeof(uint32_t));
@@ -269,7 +269,7 @@ static void qxl_worker_create_primary(QXLWorker *qxl_worker, uint32_t surface_id
                                       QXLDevSurfaceCreate *surface)
 {
     RedDispatcher *dispatcher = (RedDispatcher *)qxl_worker;
-    RedWorkeMessage message = RED_WORKER_MESSAGE_CREATE_PRIMARY_SURFACE;
+    RedWorkerMessage message = RED_WORKER_MESSAGE_CREATE_PRIMARY_SURFACE;
 
     dispatcher->x_res = surface->width;
     dispatcher->y_res = surface->height;
@@ -288,7 +288,7 @@ static void qxl_worker_create_primary(QXLWorker *qxl_worker, uint32_t surface_id
 static void qxl_worker_reset_image_cache(QXLWorker *qxl_worker)
 {
     RedDispatcher *dispatcher = (RedDispatcher *)qxl_worker;
-    RedWorkeMessage message = RED_WORKER_MESSAGE_RESET_IMAGE_CACHE;
+    RedWorkerMessage message = RED_WORKER_MESSAGE_RESET_IMAGE_CACHE;
 
     write_message(dispatcher->channel, &message);
     read_message(dispatcher->channel, &message);
@@ -298,7 +298,7 @@ static void qxl_worker_reset_image_cache(QXLWorker *qxl_worker)
 static void qxl_worker_reset_cursor(QXLWorker *qxl_worker)
 {
     RedDispatcher *dispatcher = (RedDispatcher *)qxl_worker;
-    RedWorkeMessage message = RED_WORKER_MESSAGE_RESET_CURSOR;
+    RedWorkerMessage message = RED_WORKER_MESSAGE_RESET_CURSOR;
 
     write_message(dispatcher->channel, &message);
     read_message(dispatcher->channel, &message);
@@ -308,7 +308,7 @@ static void qxl_worker_reset_cursor(QXLWorker *qxl_worker)
 static void qxl_worker_destroy_surface_wait(QXLWorker *qxl_worker, uint32_t surface_id)
 {
     RedDispatcher *dispatcher = (RedDispatcher *)qxl_worker;
-    RedWorkeMessage message = RED_WORKER_MESSAGE_DESTROY_SURFACE_WAIT;
+    RedWorkerMessage message = RED_WORKER_MESSAGE_DESTROY_SURFACE_WAIT;
 
     write_message(dispatcher->channel, &message);
     send_data(dispatcher->channel, &surface_id, sizeof(uint32_t));
@@ -319,7 +319,7 @@ static void qxl_worker_destroy_surface_wait(QXLWorker *qxl_worker, uint32_t surf
 static void qxl_worker_reset_memslots(QXLWorker *qxl_worker)
 {
     RedDispatcher *dispatcher = (RedDispatcher *)qxl_worker;
-    RedWorkeMessage message = RED_WORKER_MESSAGE_RESET_MEMSLOTS;
+    RedWorkerMessage message = RED_WORKER_MESSAGE_RESET_MEMSLOTS;
 
     write_message(dispatcher->channel, &message);
 }
@@ -329,7 +329,7 @@ static void qxl_worker_wakeup(QXLWorker *qxl_worker)
     RedDispatcher *dispatcher = (RedDispatcher *)qxl_worker;
 
     if (!test_bit(RED_WORKER_PENDING_WAKEUP, dispatcher->pending)) {
-        RedWorkeMessage message = RED_WORKER_MESSAGE_WAKEUP;
+        RedWorkerMessage message = RED_WORKER_MESSAGE_WAKEUP;
         set_bit(RED_WORKER_PENDING_WAKEUP, &dispatcher->pending);
         write_message(dispatcher->channel, &message);
     }
@@ -339,7 +339,7 @@ static void qxl_worker_oom(QXLWorker *qxl_worker)
 {
     RedDispatcher *dispatcher = (RedDispatcher *)qxl_worker;
     if (!test_bit(RED_WORKER_PENDING_OOM, dispatcher->pending)) {
-        RedWorkeMessage message = RED_WORKER_MESSAGE_OOM;
+        RedWorkerMessage message = RED_WORKER_MESSAGE_OOM;
         set_bit(RED_WORKER_PENDING_OOM, &dispatcher->pending);
         write_message(dispatcher->channel, &message);
     }
@@ -348,7 +348,7 @@ static void qxl_worker_oom(QXLWorker *qxl_worker)
 static void qxl_worker_start(QXLWorker *qxl_worker)
 {
     RedDispatcher *dispatcher = (RedDispatcher *)qxl_worker;
-    RedWorkeMessage message = RED_WORKER_MESSAGE_START;
+    RedWorkerMessage message = RED_WORKER_MESSAGE_START;
 
     write_message(dispatcher->channel, &message);
 }
@@ -356,7 +356,7 @@ static void qxl_worker_start(QXLWorker *qxl_worker)
 static void qxl_worker_stop(QXLWorker *qxl_worker)
 {
     RedDispatcher *dispatcher = (RedDispatcher *)qxl_worker;
-    RedWorkeMessage message = RED_WORKER_MESSAGE_STOP;
+    RedWorkerMessage message = RED_WORKER_MESSAGE_STOP;
 
     write_message(dispatcher->channel, &message);
     read_message(dispatcher->channel, &message);
@@ -367,7 +367,7 @@ void qxl_worker_loadvm_commands(QXLWorker *qxl_worker,
                                 struct QXLCommandExt *ext, uint32_t count)
 {
     RedDispatcher *dispatcher = (RedDispatcher *)qxl_worker;
-    RedWorkeMessage message = RED_WORKER_MESSAGE_LOADVM_COMMANDS;
+    RedWorkerMessage message = RED_WORKER_MESSAGE_LOADVM_COMMANDS;
 
     red_printf("");
     write_message(dispatcher->channel, &message);
@@ -402,7 +402,7 @@ void red_dispatcher_on_ic_change()
     int compression_level = calc_compression_level();
     RedDispatcher *now = dispatchers;
     while (now) {
-        RedWorkeMessage message = RED_WORKER_MESSAGE_SET_COMPRESSION;
+        RedWorkerMessage message = RED_WORKER_MESSAGE_SET_COMPRESSION;
         now->qxl->st->qif->set_compression_level(now->qxl, compression_level);
         write_message(now->channel, &message);
         send_data(now->channel, &image_compression, sizeof(spice_image_compression_t));
@@ -415,7 +415,7 @@ void red_dispatcher_on_sv_change()
     int compression_level = calc_compression_level();
     RedDispatcher *now = dispatchers;
     while (now) {
-        RedWorkeMessage message = RED_WORKER_MESSAGE_SET_STREAMING_VIDEO;
+        RedWorkerMessage message = RED_WORKER_MESSAGE_SET_STREAMING_VIDEO;
         now->qxl->st->qif->set_compression_level(now->qxl, compression_level);
         write_message(now->channel, &message);
         send_data(now->channel, &streaming_video, sizeof(uint32_t));
@@ -427,7 +427,7 @@ void red_dispatcher_set_mouse_mode(uint32_t mode)
 {
     RedDispatcher *now = dispatchers;
     while (now) {
-        RedWorkeMessage message = RED_WORKER_MESSAGE_SET_MOUSE_MODE;
+        RedWorkerMessage message = RED_WORKER_MESSAGE_SET_MOUSE_MODE;
         write_message(now->channel, &message);
         send_data(now->channel, &mode, sizeof(uint32_t));
         now = now->next;
@@ -460,7 +460,7 @@ RedDispatcher *red_dispatcher_init(QXLInstance *qxl)
 {
     RedDispatcher *dispatcher;
     int channels[2];
-    RedWorkeMessage message;
+    RedWorkerMessage message;
     WorkerInitData init_data;
     QXLDevInitInfo init_info;
     int r;
diff --git a/server/red_worker.c b/server/red_worker.c
index c89adf1..e31c304 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -8940,7 +8940,7 @@ static void red_wait_outgoiong_item(RedChannel *channel)
 
 static inline void handle_dev_update(RedWorker *worker)
 {
-    RedWorkeMessage message;
+    RedWorkerMessage message;
     const SpiceRect *rect;
     SpiceRect *dirty_rects;
     RedSurface *surface;
@@ -8975,7 +8975,7 @@ static inline void handle_dev_update(RedWorker *worker)
 
 static inline void handle_dev_add_memslot(RedWorker *worker)
 {
-    RedWorkeMessage message;
+    RedWorkerMessage message;
     QXLDevMemSlot dev_slot;
 
     receive_data(worker->channel, &dev_slot, sizeof(QXLDevMemSlot));
@@ -9016,7 +9016,7 @@ static inline void destroy_surface_wait(RedWorker *worker, int surface_id)
 
 static inline void handle_dev_destroy_surface_wait(RedWorker *worker)
 {
-    RedWorkeMessage message;
+    RedWorkerMessage message;
     uint32_t surface_id;
 
     receive_data(worker->channel, &surface_id, sizeof(uint32_t));
@@ -9035,7 +9035,7 @@ static inline void handle_dev_destroy_surface_wait(RedWorker *worker)
 static inline void handle_dev_destroy_surfaces(RedWorker *worker)
 {
     int i;
-    RedWorkeMessage message;
+    RedWorkerMessage message;
 
     flush_display_commands(worker);
     //to handle better
@@ -9084,7 +9084,7 @@ static inline void handle_dev_destroy_surfaces(RedWorker *worker)
 
 static inline void handle_dev_create_primary_surface(RedWorker *worker)
 {
-    RedWorkeMessage message;
+    RedWorkerMessage message;
     uint32_t surface_id;
     QXLDevSurfaceCreate surface;
     uint8_t *line_0;
@@ -9121,7 +9121,7 @@ static inline void handle_dev_create_primary_surface(RedWorker *worker)
 
 static inline void handle_dev_destroy_primary_surface(RedWorker *worker)
 {
-    RedWorkeMessage message;
+    RedWorkerMessage message;
     uint32_t surface_id;
 
     receive_data(worker->channel, &surface_id, sizeof(uint32_t));
@@ -9161,7 +9161,7 @@ static inline void handle_dev_destroy_primary_surface(RedWorker *worker)
 static void handle_dev_input(EventListener *listener, uint32_t events)
 {
     RedWorker *worker = SPICE_CONTAINEROF(listener, RedWorker, dev_listener);
-    RedWorkeMessage message;
+    RedWorkerMessage message;
 
     read_message(worker->channel, &message);
 
@@ -9397,7 +9397,7 @@ static void handle_dev_input(EventListener *listener, uint32_t events)
 static void red_init(RedWorker *worker, WorkerInitData *init_data)
 {
     struct epoll_event event;
-    RedWorkeMessage message;
+    RedWorkerMessage message;
     int epoll;
     static SpiceVirtMappingOps preload_group_virt_mapping_ops = {
         op_get_virt_preload_group,
diff --git a/server/red_worker.h b/server/red_worker.h
index 88c1e90..6f87471 100644
--- a/server/red_worker.h
+++ b/server/red_worker.h
@@ -70,7 +70,7 @@ enum {
     RED_WORKER_MESSAGE_LOADVM_COMMANDS,
 };
 
-typedef uint32_t RedWorkeMessage;
+typedef uint32_t RedWorkerMessage;
 
 #define RED_MAX_RENDERERS 4
 
@@ -116,9 +116,9 @@ static inline void send_data(int fd, void *in_buf, int n)
     } while (n);
 }
 
-static inline void write_message(int fd, RedWorkeMessage *message)
+static inline void write_message(int fd, RedWorkerMessage *message)
 {
-    send_data(fd, message, sizeof(RedWorkeMessage));
+    send_data(fd, message, sizeof(RedWorkerMessage));
 }
 
 static inline void receive_data(int fd, void *in_buf, int n)
@@ -137,9 +137,9 @@ static inline void receive_data(int fd, void *in_buf, int n)
     } while (n);
 }
 
-static inline void read_message(int fd, RedWorkeMessage *message)
+static inline void read_message(int fd, RedWorkerMessage *message)
 {
-    receive_data(fd, message, sizeof(RedWorkeMessage));
+    receive_data(fd, message, sizeof(RedWorkerMessage));
 }
 
 #endif
commit 012bd2577975b902aa5ce0cdd0eb43ef57c948fb
Author: Alexander Larsson <alexl at redhat.com>
Date:   Fri May 21 10:51:03 2010 +0200

    Fix spelling errors in comments and strings

diff --git a/client/application.cpp b/client/application.cpp
index 4eb8ac8..f32943e 100644
--- a/client/application.cpp
+++ b/client/application.cpp
@@ -1157,7 +1157,7 @@ void Application::on_key_down(RedKey key)
         }
 
         if (!_sticky_info.sticky_mode) {
-            // during tracing (traced key was pressed and no keyboard event has occured till now)
+            // during tracing (traced key was pressed and no keyboard event has occurred till now)
             if (_sticky_info.key_first_down) {
                 ASSERT(_sticky_info.key != REDKEY_INVALID);
                 if (key != _sticky_info.key) {
@@ -1939,8 +1939,8 @@ bool Application::process_cmd_line(int argc, char** argv)
     parser.add(SPICE_OPT_CA_FILE, "ca-file", "truststore file for secure connections",
                "ca-file", true);
     parser.add(SPICE_OPT_HOST_SUBJECT, "host-subject",
-               "subject of the host certifcate. Format: field=value pairs separated"
-               " by commmas. Commas and backslashes within values must be preceded by"
+               "subject of the host certificate. Format: field=value pairs separated"
+               " by commas. Commas and backslashes within values must be preceded by"
                " a backslash", "host-subject", true);
     parser.add(SPICE_OPT_PASSWORD, "password", "server password", "password", true, 'w');
     parser.add(SPICE_OPT_FULL_SCREEN, "full-screen", "open in full screen mode", "auto-conf",
diff --git a/client/client_net_socket.h b/client/client_net_socket.h
index 35d23b0..bc9bdd1 100644
--- a/client/client_net_socket.h
+++ b/client/client_net_socket.h
@@ -25,7 +25,7 @@
 #include "common.h"
 #include "process_loop.h"
 
-/* intterface for connenctions inside client LAN */
+/* interface for connections inside client LAN */
 
 typedef enum {
     SOCKET_STATUS_OPEN,
diff --git a/client/cursor_channel.cpp b/client/cursor_channel.cpp
index 402d69f..cc5d426 100644
--- a/client/cursor_channel.cpp
+++ b/client/cursor_channel.cpp
@@ -486,7 +486,7 @@ void CursorChannel::create_native_cursor(CursorData* cursor)
         native_cursor = new UnsupportedCursor(cursor->header());
         break;
     default:
-        THROW("invalid curosr type");
+        THROW("invalid cursor type");
     }
     cursor->set_opaque(native_cursor);
 }
diff --git a/client/display_channel.cpp b/client/display_channel.cpp
index bffd539..2cdf8ea 100644
--- a/client/display_channel.cpp
+++ b/client/display_channel.cpp
@@ -275,7 +275,7 @@ VideoStream::VideoStream(RedClient& client, Canvas& canvas, DisplayChannel& chan
     memset(_frames, 0, sizeof(_frames));
     region_init(&_clip_region);
     if (codec_type != SPICE_VIDEO_CODEC_TYPE_MJPEG) {
-      THROW("invalid vide codec type %u", codec_type);
+      THROW("invalid video codec type %u", codec_type);
     }
 
     try {
@@ -1398,7 +1398,7 @@ void DisplayChannel::handle_stream_destroy(RedPeer::InMessage* message)
     VideoStream **active_stream = &_active_streams;
     for (;;) {
         if (!*active_stream) {
-            THROW("not in actibe streams");
+            THROW("not in active streams");
         }
 
         if (*active_stream == _streams[stream_destroy->id]) {
diff --git a/client/glz_decode_tmpl.c b/client/glz_decode_tmpl.c
index 32ed9d4..2c47571 100644
--- a/client/glz_decode_tmpl.c
+++ b/client/glz_decode_tmpl.c
@@ -22,7 +22,7 @@
 /*
     For each output pixel type the following macros are defined:
     OUT_PIXEL                      - the output pixel type
-    COPY_PIXEL(p, out)              - assignes the pixel to the place pointed by out and
+    COPY_PIXEL(p, out)              - assigns the pixel to the place pointed by out and
                                       increases out. Used in RLE.
                                       Need special handling because in alpha we copy only
                                       the pad byte.
@@ -168,8 +168,8 @@
 #define COPY_COMP_PIXEL(in, out) {out->pad = *(in++); out++;}
 #endif
 
-// TODO: seperate into routines that decode to dist,len. and to a routine that
-// actualy copies the data.
+// TODO: separate into routines that decode to dist,len. and to a routine that
+// actually copies the data.
 
 /* returns num of bytes read from in buf.
    size should be in PIXEL */
diff --git a/client/glz_decoded_image.h b/client/glz_decoded_image.h
index ddc2d77..6827d6d 100644
--- a/client/glz_decoded_image.h
+++ b/client/glz_decoded_image.h
@@ -39,7 +39,7 @@ public:
 
     virtual ~GlzDecodedImage() {}
     uint8_t *get_data() {return _data;}
-    uint8_t *get_pixel_ref(int offset); // pallete pix_id = byte count
+    uint8_t *get_pixel_ref(int offset); // palette pix_id = byte count
     uint64_t get_id() {return _id;}
     uint64_t get_window_head_id() {return _win_head_id;}
     int      get_size() {return _size;}
diff --git a/client/glz_decoder_window.cpp b/client/glz_decoder_window.cpp
index 2cdad58..24dfce3 100644
--- a/client/glz_decoder_window.cpp
+++ b/client/glz_decoder_window.cpp
@@ -68,14 +68,14 @@ void GlzDecoderWindow::post_decode(GlzDecodedImage *image)
 
 /* index: the physical index in the images array. Note that it can't change between waits since
    the realloc mutex should be read locked.
-   No starvation for the realloc mutex can occure, since the image we wait for is located before us,
+   No starvation for the realloc mutex can occur, since the image we wait for is located before us,
    hence, when it arrives - no realloc is needed. */
 void GlzDecoderWindow::wait_for_image(int index)
 {
     Lock lock(_new_image_mutex);
     GlzDecodedImage *image = _images[index]; // can be performed without locking the _win_mutex,
-                                             // since it is called after pre and the rw mutex is                                                 // locked, hence, physical chnages to the window are
-                                             // not allowed. In addtion the reading of the image ptr
+                                             // since it is called after pre and the rw mutex is                                                 // locked, hence, physical changes to the window are
+                                             // not allowed. In addition the reading of the image ptr
                                              // is atomic, thus, even if the value changes we are
                                              // not affected.
 
@@ -146,7 +146,7 @@ inline bool GlzDecoderWindow::is_empty()
     return (!_n_images);
 }
 
-/* aprroximated overflow. Considers only the size that currently occupies the window and
+/* approximated overflow. Considers only the size that currently occupies the window and
    not the size of the missing images. TODO: consider other measures */
 inline bool GlzDecoderWindow::will_overflow(uint64_t image_id, uint64_t relative_head_id)
 {
@@ -302,7 +302,7 @@ void GlzDecoderWindow::narrow_window(GlzDecodedImage *last_added)
 
     _missing_list.pop_front();  // removing the last added image from the missing list
 
-    /* maintaing the missing list: removing front images that already arrived */
+    /* maintaining the missing list: removing front images that already arrived */
     while (!_missing_list.empty()) {
         int front_win_idx = calc_image_win_idx(_missing_list.front());
         if (_images[front_win_idx] == NULL) { // still missing
diff --git a/client/playback_channel.cpp b/client/playback_channel.cpp
index b943b34..e1aa065 100644
--- a/client/playback_channel.cpp
+++ b/client/playback_channel.cpp
@@ -262,7 +262,7 @@ void PlaybackChannel::handle_start(RedPeer::InMessage* message)
                                                    start->channels);
         } catch (...) {
             LOG_WARN("create player failed");
-            //todo: support disconnecting singel channel
+            //todo: support disconnecting single channel
             disable();
             return;
         }
diff --git a/client/process_loop.cpp b/client/process_loop.cpp
index d8c6334..5337c36 100644
--- a/client/process_loop.cpp
+++ b/client/process_loop.cpp
@@ -36,7 +36,7 @@ void SyncEvent::response(AbstractProcessLoop& events_loop)
     try {
         do_response(events_loop);
     } catch (Exception& e) {
-        LOG_WARN("unhandle exception: %s", e.what());
+        LOG_WARN("unhandled exception: %s", e.what());
         _err = true;
     } catch (...) {
         _err = true;
diff --git a/client/red_channel.cpp b/client/red_channel.cpp
index c4c719a..6e6190f 100644
--- a/client/red_channel.cpp
+++ b/client/red_channel.cpp
@@ -273,9 +273,9 @@ void* RedChannel::worker_main(void *data)
         Platform::set_thread_priority(NULL, channel->get_worker_priority());
         channel->run();
     } catch (Exception& e) {
-        LOG_ERROR("unhandle exception: %s", e.what());
+        LOG_ERROR("unhandled exception: %s", e.what());
     } catch (std::exception& e) {
-        LOG_ERROR("unhandle exception: %s", e.what());
+        LOG_ERROR("unhandled exception: %s", e.what());
     } catch (...) {
         LOG_ERROR("unhandled exception");
     }
@@ -676,12 +676,12 @@ void RedChannel::handle_notify(RedPeer::InMessage* message)
 
 
     if (notify->severty > SPICE_NOTIFY_SEVERITY_ERROR) {
-        THROW("bad sevirity");
+        THROW("bad severity");
     }
     sevirity = sevirity_strings[notify->severty];
 
     if (notify->visibilty > SPICE_NOTIFY_VISIBILITY_HIGH) {
-        THROW("bad visibilty");
+        THROW("bad visibility");
     }
     visibility = visibility_strings[notify->visibilty];
 
diff --git a/client/tunnel_channel.cpp b/client/tunnel_channel.cpp
index 5223550..1b7d7cb 100644
--- a/client/tunnel_channel.cpp
+++ b/client/tunnel_channel.cpp
@@ -409,7 +409,7 @@ void TunnelChannel::handle_socket_close(RedPeer::InMessage* message)
     if (sckt->is_connected()) {
         sckt->push_disconnect();
     } else {
-        // close happend in the server side before it received the client
+        // close happened in the server side before it received the client
         // close msg. we should ack the server and free the socket
         on_socket_disconnect(*sckt);
     }
@@ -502,7 +502,7 @@ void TunnelChannel::on_socket_disconnect(ClientNetSocket& sckt)
 {
     TunnelChannel::TunnelSocket* tunnel_sckt = static_cast<TunnelChannel::TunnelSocket*>(&sckt);
     Message* out_msg;
-    // close intiated by server -> needs ack
+    // close initiated by server -> needs ack
     if (tunnel_sckt->get_guest_closed()) {
         DBG(0, "send close ack connection_id=%d", tunnel_sckt->id());
         out_msg = new Message(SPICE_MSGC_TUNNEL_SOCKET_CLOSED_ACK, sizeof(SpiceMsgcTunnelSocketClosedAck));
diff --git a/client/x11/main.cpp b/client/x11/main.cpp
index 3ee6428..1b9bb89 100644
--- a/client/x11/main.cpp
+++ b/client/x11/main.cpp
@@ -35,10 +35,10 @@ int main(int argc, char** argv)
         exit_val = Application::main(argc, argv, version_str);
         LOG_INFO("Spice client terminated (exitcode = %d)", exit_val);
     } catch (Exception& e) {
-        LOG_ERROR("unhandle exception: %s", e.what());
+        LOG_ERROR("unhandled exception: %s", e.what());
         exit_val = e.get_error_code();
     } catch (std::exception& e) {
-        LOG_ERROR("unhandle exception: %s", e.what());
+        LOG_ERROR("unhandled exception: %s", e.what());
         exit_val = SPICEC_ERROR_CODE_ERROR;
     } catch (...) {
         LOG_ERROR("unhandled exception");
diff --git a/client/x11/named_pipe.cpp b/client/x11/named_pipe.cpp
index 3043ba2..c6f38da 100644
--- a/client/x11/named_pipe.cpp
+++ b/client/x11/named_pipe.cpp
@@ -75,7 +75,7 @@ int32_t Session::read(uint8_t *buf, int32_t size)
         int now;
         if ((now = recv(_fd_client, (char *)pos, size, 0)) <= 0) {
             if (now == 0) {
-                DBG(0, "read error, connetion shutdown");
+                DBG(0, "read error, connection shutdown");
                 return -1;
             }
             if (errno == EAGAIN) {
diff --git a/client/x11/platform.cpp b/client/x11/platform.cpp
index ea492ed..fecfb13 100644
--- a/client/x11/platform.cpp
+++ b/client/x11/platform.cpp
@@ -337,7 +337,7 @@ XIC XPlatform::get_input_context()
 void XPlatform::set_win_proc(Window win, win_proc_t proc)
 {
     if (XSaveContext(x_display, win, win_proc_context, (XPointer)proc)) {
-        THROW("set win proc pailed");
+        THROW("set win proc failed");
     }
 }
 
@@ -775,7 +775,7 @@ bool DynamicScreen::set_screen_size(int size_index)
     XRRScreenConfiguration* config;
 
     if (!(config = XRRGetScreenInfo(get_display(), root_window))) {
-        LOG_WARN("get scren info failed");
+        LOG_WARN("get screen info failed");
         return false;
     }
     Rotation rotation;
@@ -2592,7 +2592,7 @@ XLocalCursor::XLocalCursor(CursorData* cursor_data)
     int size;
 
     if (!get_size_bits(header, size)) {
-        THROW("invalid curosr type");
+        THROW("invalid cursor type");
     }
 
     uint32_t* cur_data = new uint32_t[cur_size];
diff --git a/client/x11/red_window.cpp b/client/x11/red_window.cpp
index c9a16ec..7e69b42 100644
--- a/client/x11/red_window.cpp
+++ b/client/x11/red_window.cpp
@@ -1875,7 +1875,7 @@ bool RedWindow::get_mouse_anchor_point(SpicePoint& pt)
 
     while (!(vis_region = get_visibale_region(_win))) {
         if (!vis_region_retries) {
-            THROW("get visibale region failed");
+            THROW("get visible region failed");
         }
         --vis_region_retries;
         usleep(X_RETRY_DELAY_MICRO);
diff --git a/common/canvas_base.c b/common/canvas_base.c
index 9fd2ae2..9d9c977 100644
--- a/common/canvas_base.c
+++ b/common/canvas_base.c
@@ -761,7 +761,7 @@ static pixman_image_t *canvas_get_lz(CanvasBase *canvas, LZImage *image, int inv
     return lz_data->decode_data.out_surface;
 }
 
-// don't handle plts since bitmaps with plt can be decoded globaly to RGB32 (because
+// don't handle plts since bitmaps with plt can be decoded globally to RGB32 (because
 // same byte sequence can be transformed to different RGB pixels by different plts)
 static pixman_image_t *canvas_get_glz(CanvasBase *canvas, LZImage *image,
                                       int want_original)
@@ -1760,7 +1760,7 @@ static void canvas_base_destroy(CanvasBase *canvas)
     }
 }
 
-/* This is kind of lame, but it protects against muliple
+/* This is kind of lame, but it protects against multiple
    instances of these functions. We really should stop including
    canvas_base.c and build it separately instead */
 #ifdef  CANVAS_SINGLE_INSTANCE
diff --git a/common/gl_canvas.c b/common/gl_canvas.c
index 82c846e..ea10c96 100644
--- a/common/gl_canvas.c
+++ b/common/gl_canvas.c
@@ -378,7 +378,7 @@ static void gl_canvas_draw_copy(SpiceCanvas *spice_canvas, SpiceRect *bbox, Spic
     set_mask(canvas, &copy->mask, bbox->left, bbox->top);
     set_op(canvas, copy->rop_decriptor);
 
-    //todo: optimize get_imag (use ogl conversion + remove unnecessary copy of 32bpp)
+    //todo: optimize get_image (use ogl conversion + remove unnecessary copy of 32bpp)
     surface = canvas_get_image(&canvas->base, copy->src_bitmap, FALSE);
     surface_to_image(canvas, surface, &image, 0);
     SET_GLC_RECT(&dest, bbox);
diff --git a/common/glc.c b/common/glc.c
index 2972b39..e4263cd 100644
--- a/common/glc.c
+++ b/common/glc.c
@@ -228,7 +228,7 @@ static void free_tass_vertex_bufs(InternaCtx *ctx)
     }
 }
 
-//naiev bezier flattener
+//naive bezier flattener
 static TassVertex *bezier_flattener(InternaCtx *ctx, PathPoint *points)
 {
     double ax, bx, cx;
diff --git a/common/lz.c b/common/lz.c
index f98982a..73a797c 100644
--- a/common/lz.c
+++ b/common/lz.c
@@ -95,7 +95,7 @@ typedef struct Encoder {
     LzImageSegment *tail_image_segs;
     LzImageSegment *free_image_segs;
 
-    // the dicitionary hash table is composed (1) a pointer to the segment the word was found in
+    // the dictionary hash table is composed (1) a pointer to the segment the word was found in
     // (2) a pointer to the first byte in the segment that matches the word
     HashEntry htab[HASH_SIZE];
 
@@ -116,7 +116,7 @@ static int lz_read_image_segments(Encoder *encoder, uint8_t *first_lines,
                                   unsigned int num_first_lines);
 
 
-// return a free image segement if one exists. Make allocation if needed. adds it to the
+// return a free image segment if one exists. Make allocation if needed. adds it to the
 // tail of the image segments lists
 static INLINE LzImageSegment *lz_alloc_image_seg(Encoder *encoder)
 {
@@ -367,7 +367,7 @@ void lz_destroy(LzContext *lz)
     }
 
     if (encoder->head_image_segs) {
-        encoder->usr->error(encoder->usr, "%s: used_image_segements not empty\n", __FUNCTION__);
+        encoder->usr->error(encoder->usr, "%s: used_image_segments not empty\n", __FUNCTION__);
         lz_reset_image_seg(encoder);
     }
     lz_dealloc_free_segments(encoder);
@@ -517,12 +517,12 @@ int lz_encode(LzContext *lz, LzImageType type, int width, int height, int top_do
         if (encoder->stride > (width / PLT_PIXELS_PER_BYTE[encoder->type])) {
             if (((width % PLT_PIXELS_PER_BYTE[encoder->type]) == 0) || (
                     (encoder->stride - (width / PLT_PIXELS_PER_BYTE[encoder->type])) > 1)) {
-                encoder->usr->error(encoder->usr, "sride overflows (plt)\n");
+                encoder->usr->error(encoder->usr, "stride overflows (plt)\n");
             }
         }
     } else {
         if (encoder->stride != width * RGB_BYTES_PER_PIXEL[encoder->type]) {
-            encoder->usr->error(encoder->usr, "sride != width*bytes_per_pixel (rgb)\n");
+            encoder->usr->error(encoder->usr, "stride != width*bytes_per_pixel (rgb)\n");
         }
     }
 
@@ -616,7 +616,7 @@ void lz_decode_begin(LzContext *lz, uint8_t *io_ptr, unsigned int num_io_bytes,
     *out_type = encoder->type;
 
     // TODO: maybe instead of stride we can encode out_n_pixels
-    //       (if stride is not necssary in decoding).
+    //       (if stride is not necessary in decoding).
     if (IS_IMAGE_TYPE_PLT[encoder->type]) {
         encoder->palette = palette;
         *out_n_pixels = encoder->stride * PLT_PIXELS_PER_BYTE[encoder->type] * encoder->height;
diff --git a/common/lz.h b/common/lz.h
index 1c80df7..6f796f1 100644
--- a/common/lz.h
+++ b/common/lz.h
@@ -37,7 +37,7 @@ struct LzUsrContext {
         TODO :	determine size limit for the first segment and each chunk. check validity
                         of the segment or go to literal copy.
         TODO :	currently support only rgb images in which width*bytes_per_pixel = stride OR
-                        paletter images in which stride eqauls the min number of bytes to
+                        palette images in which stride equals the min number of bytes to
                         hold a line. stride is not necessary for now. just for sanity check.
                         stride should be > 0
 */
@@ -59,9 +59,9 @@ void lz_decode_begin(LzContext *lz, uint8_t *io_ptr, unsigned int num_io_bytes,
         to_type = the image output type.
         We assume the buffer is consecutive. i.e. width = stride
 
-        Improtant: if the image is plt1/4 and to_type is rgb32, the image
+        Important: if the image is plt1/4 and to_type is rgb32, the image
         will decompressed including the last bits in each line. This means buffer should be
-        larger than width*height if neede and you shoud use stride to fix it.
+        larger than width*height if needed and you should use stride to fix it.
         Note: If the image is down to top, set the stride in the sw surface to negative.
         use alloc_lz_image_surface create the surface.
 */
diff --git a/common/lz_compress_tmpl.c b/common/lz_compress_tmpl.c
index c57cf8d..18d6697 100644
--- a/common/lz_compress_tmpl.c
+++ b/common/lz_compress_tmpl.c
@@ -146,8 +146,8 @@
 
 // when encoding, the ref can be in previous segment, and we should check that it doesn't
 // exceeds its bounds.
-// TODO: optimization: when only one chunk exists or when the reference is in the same segement,
-//       don't make checks if we reach end of segements
+// TODO: optimization: when only one chunk exists or when the reference is in the same segment,
+//       don't make checks if we reach end of segments
 // TODO: optimize to continue match between segments?
 // TODO: check hash function
 // TODO: check times
@@ -286,7 +286,7 @@ match:        // RLE or dictionary (both are encoded by distance from ref (-1) a
         distance--;
 
         // ip is located now at the position of the second mismatch.
-        // later it will be substracted by 3
+        // later it will be subtracted by 3
 
         if (!distance) {
             /* zero distance means a run */
@@ -346,7 +346,7 @@ match:        // RLE or dictionary (both are encoded by distance from ref (-1) a
 #endif
         /* encode the match (like fastlz level 2)*/
         if (distance < MAX_DISTANCE) { // MAX_DISTANCE is 2^13 - 1
-            // when copy is pefrformed, the byte that holds the copy count is smaller than 32.
+            // when copy is performed, the byte that holds the copy count is smaller than 32.
             // When there is a reference, the first byte is always larger then 32
 
             // 3 bits = length, 5 bits = 5 MSB of distance, 8 bits = 8 LSB of distance
@@ -355,7 +355,7 @@ match:        // RLE or dictionary (both are encoded by distance from ref (-1) a
                 encode(encoder, (uint8_t)(distance & 255));
             } else { // more than 3 bits are needed for length
                     // 3 bits 7, 5 bits = 5 MSB of distance, next bytes are 255 till we
-                    // recieve a smaller number, last byte = 8 LSB of distance
+                    // receive a smaller number, last byte = 8 LSB of distance
                 encode(encoder, (uint8_t)((7 << 5) + (distance >> 8)));
                 for (len -= 7; len >= 255; len -= 255) {
                     encode(encoder, 255);
diff --git a/common/lz_decompress_tmpl.c b/common/lz_decompress_tmpl.c
index deb4665..aa403f6 100644
--- a/common/lz_decompress_tmpl.c
+++ b/common/lz_decompress_tmpl.c
@@ -51,7 +51,7 @@
 /*
     For each output pixel type the following macros are defined:
     OUT_PIXEL                      - the output pixel type
-    COPY_PIXEL(p, out)              - assignes the pixel to the place pointed by out and increases
+    COPY_PIXEL(p, out)              - assigns the pixel to the place pointed by out and increases
                                       out. Used in RLE. Need special handling because in alpha we
                                       copy only the pad byte.
     COPY_REF_PIXEL(ref, out)      - copies the pixel pointed by ref to the pixel pointed by out.
diff --git a/common/mem.h b/common/mem.h
index 83fbeb3..2087760 100644
--- a/common/mem.h
+++ b/common/mem.h
@@ -33,7 +33,7 @@ void *spice_malloc_n_m(size_t n_blocks, size_t n_block_bytes, size_t extra_size)
 void *spice_malloc0_n(size_t n_blocks, size_t n_block_bytes) SPICE_GNUC_MALLOC SPICE_GNUC_ALLOC_SIZE2(1,2);
 void *spice_realloc_n(void *mem, size_t n_blocks, size_t n_block_bytes) SPICE_GNUC_WARN_UNUSED_RESULT;
 
-/* Optimise: avoid the call to the (slower) _n function if we can
+/* Optimize: avoid the call to the (slower) _n function if we can
  * determine at compile-time that no overflow happens.
  */
 #if defined (__GNUC__) && (__GNUC__ >= 2) && defined (__OPTIMIZE__)
@@ -67,7 +67,7 @@ void *spice_realloc_n(void *mem, size_t n_blocks, size_t n_block_bytes) SPICE_GN
     }))
 #else
 
-/* Unoptimised version: always call the _n() function. */
+/* Unoptimized version: always call the _n() function. */
 
 #define _SPICE_NEW(struct_type, n_structs, func)                        \
     ((struct_type *) spice_##func##_n ((n_structs), sizeof (struct_type)))
diff --git a/common/quic.c b/common/quic.c
index 6b2ce01..e2c211d 100644
--- a/common/quic.c
+++ b/common/quic.c
@@ -75,7 +75,7 @@ typedef uint8_t BYTE;
 
 typedef struct QuicFamily {
     unsigned int nGRcodewords[MAXNUMCODES];      /* indexed by code number, contains number of
-                                                    unmodofied GR codewords in the code */
+                                                    unmodified GR codewords in the code */
     unsigned int notGRcwlen[MAXNUMCODES];        /* indexed by code number, contains codeword
                                                     length of the not-GR codeword */
     unsigned int notGRprefixmask[MAXNUMCODES];   /* indexed by code number, contains mask to
diff --git a/common/quic.h b/common/quic.h
index 830a4c9..f4ef854 100644
--- a/common/quic.h
+++ b/common/quic.h
@@ -44,7 +44,7 @@ struct QuicUsrContext {
     void (*free)(QuicUsrContext *usr, void *ptr);
     int (*more_space)(QuicUsrContext *usr, uint32_t **io_ptr, int rows_completed);
     int (*more_lines)(QuicUsrContext *usr, uint8_t **lines); // on return the last line of previous
-                                                             // lines bunch must stil be valid
+                                                             // lines bunch must still be valid
 };
 
 int quic_encode(QuicContext *quic, QuicImageType type, int width, int height,
diff --git a/server/glz_encode_match_tmpl.c b/server/glz_encode_match_tmpl.c
index e72a6c2..bba44dc 100644
--- a/server/glz_encode_match_tmpl.c
+++ b/server/glz_encode_match_tmpl.c
@@ -24,7 +24,7 @@
 
 /* if image_distance = 0, pixel_distance is the distance between the matching pixels.
   Otherwise, it is the offset from the beginning of the referred image */
-#if defined(GLZ_ENCODE_MATCH) /* actually perfroming the encoding */
+#if defined(GLZ_ENCODE_MATCH) /* actually performing the encoding */
 static INLINE void encode_match(Encoder *encoder, uint32_t image_distance,
                                 size_t pixel_distance, size_t len)
 #elif defined(GLZ_ENCODE_SIZE) /* compute the size of the encoding except for the match length*/
@@ -59,7 +59,7 @@ static INLINE int get_encode_ref_size(uint32_t image_distance, size_t pixel_dist
 #endif
 
 
-    /* encoding the rest of the pixel ditsance and the image_dist and its 2 control bits */
+    /* encoding the rest of the pixel distance and the image_dist and its 2 control bits */
 
     /* The first 2 MSB bits indicate how many more bytes should be read for image dist */
     if (pixel_distance < MAX_PIXEL_SHORT_DISTANCE) {
diff --git a/server/glz_encode_tmpl.c b/server/glz_encode_tmpl.c
index 5d73df7..359a25b 100644
--- a/server/glz_encode_tmpl.c
+++ b/server/glz_encode_tmpl.c
@@ -156,11 +156,11 @@ static INLINE size_t FNAME(do_match)(SharedDictionary *dict,
     const PIXEL *tmp_ref = ref;
 
     if (ref > (ref_limit - MIN_REF_ENCODE_SIZE)) {
-        return 0; // in case the hash entry is not relvant
+        return 0; // in case the hash entry is not relevant
     }
 
 
-    /* min match lenght == MIN_REF_ENCODE_SIZE (depends on pixel type) */
+    /* min match length == MIN_REF_ENCODE_SIZE (depends on pixel type) */
 
     if (!SAME_PIXEL(*tmp_ref, *tmp_ip)) {
         return 0;
diff --git a/server/glz_encoder.c b/server/glz_encoder.c
index f745f2a..89b759c 100644
--- a/server/glz_encoder.c
+++ b/server/glz_encoder.c
@@ -234,12 +234,12 @@ int glz_encode(GlzEncoderContext *opaque_encoder,
         if (stride > (width / PLT_PIXELS_PER_BYTE[type])) {
             if (((width % PLT_PIXELS_PER_BYTE[type]) == 0) || (
                     (stride - (width / PLT_PIXELS_PER_BYTE[type])) > 1)) {
-                encoder->usr->error(encoder->usr, "sride overflows (plt)\n");
+                encoder->usr->error(encoder->usr, "stride overflows (plt)\n");
             }
         }
     } else {
         if (stride != width * RGB_BYTES_PER_PIXEL[type]) {
-            encoder->usr->error(encoder->usr, "sride != width*bytes_per_pixel (rgb)\n");
+            encoder->usr->error(encoder->usr, "stride != width*bytes_per_pixel (rgb)\n");
         }
     }
 
diff --git a/server/glz_encoder.h b/server/glz_encoder.h
index 0fd34d7..6c4d2b3 100644
--- a/server/glz_encoder.h
+++ b/server/glz_encoder.h
@@ -34,8 +34,8 @@ void glz_encoder_destroy(GlzEncoderContext *opaque_encoder);
 
 /*
         assumes width is in pixels and stride is in bytes
-    usr_context       : when an image is released from the window due to capicity overflow,
-                        usr_context is given as a parmater to the free_image callback.
+    usr_context       : when an image is released from the window due to capacity overflow,
+                        usr_context is given as a parameter to the free_image callback.
     o_enc_dict_context: if glz_enc_dictionary_remove_image is called, it should be
                         called with the o_enc_dict_context that is associated with
                         the image.
@@ -43,7 +43,7 @@ void glz_encoder_destroy(GlzEncoderContext *opaque_encoder);
         return: the number of bytes in the compressed data and sets o_enc_dict_context
 
         NOTE  :	currently supports only rgb images in which width*bytes_per_pixel = stride OR
-                palette images in which stride eqauls the min number of bytes to hold a line.
+                palette images in which stride equals the min number of bytes to hold a line.
                 The stride should be > 0
 */
 int glz_encode(GlzEncoderContext *opaque_encoder, LzImageType type, int width, int height,
diff --git a/server/glz_encoder_dictionary.c b/server/glz_encoder_dictionary.c
index 9489880..de8963d 100644
--- a/server/glz_encoder_dictionary.c
+++ b/server/glz_encoder_dictionary.c
@@ -363,7 +363,7 @@ static INLINE void __glz_dictionary_window_free_image(SharedDictionary *dict, Wi
     dict->window.free_images = image;
 }
 
-/* moves all the segments that were associaed with the images to the free segments */
+/* moves all the segments that were associated with the images to the free segments */
 static INLINE void __glz_dictionary_window_free_image_segs(SharedDictionary *dict,
                                                            WindowImage *image)
 {
@@ -436,7 +436,7 @@ static INLINE int glz_dictionary_is_in_use(SharedDictionary *dict)
 static void glz_dictionary_window_remove_head(SharedDictionary *dict, uint32_t encoder_id,
                                               WindowImage *end_image)
 {
-    // note that the segs list heads (one per econder) may be different than the
+    // note that the segs list heads (one per encoder) may be different than the
     // used_segs_head and it is updated somewhere else
     while (dict->window.used_images_head != end_image) {
         WindowImage *image = dict->window.used_images_head;
@@ -532,7 +532,7 @@ static WindowImage *glz_dictionary_window_add_image(SharedDictionary *dict, LzIm
         // see glz_encode_tmpl::compress).
         // Thus, the 'next' field of the list's tail can be accessed only
         // after all the new tail's data was set. Note that we are relying on
-        // an atomic assignment (32 bit varaible).
+        // an atomic assignment (32 bit variable).
         // For the other thread that may read 'next' of the old tail, NULL_IMAGE_SEG_ID
         // is equivalent to a segment with an image id that is different
         // from the image id of the tail, so we don't need to further protect this field.
diff --git a/server/glz_encoder_dictionary.h b/server/glz_encoder_dictionary.h
index ff4b96e..a85db6e 100644
--- a/server/glz_encoder_dictionary.h
+++ b/server/glz_encoder_dictionary.h
@@ -24,7 +24,7 @@
 /*
     Interface for maintaining lz dictionary that is shared among several encoders.
     The interface for accessing the dictionary for encoding purposes is located in
-    glz_encoder_diciotnary_protected.h
+    glz_encoder_dictionary_protected.h
 */
 
 typedef void GlzEncDictContext;
@@ -38,7 +38,7 @@ typedef struct GlzEncDictRestoreData {
 } GlzEncDictRestoreData;
 
 /* size        : maximal number of pixels occupying the window
-   max_encoders: maximal number of encoders that use the dicitionary
+   max_encoders: maximal number of encoders that use the dictionary
    usr         : callbacks */
 GlzEncDictContext *glz_enc_dictionary_create(uint32_t size, uint32_t max_encoders,
                                              GlzEncoderUsrContext *usr);
@@ -49,7 +49,7 @@ void glz_enc_dictionary_destroy(GlzEncDictContext *opaque_dict, GlzEncoderUsrCon
 uint32_t glz_enc_dictionary_get_size(GlzEncDictContext *);
 
 /* returns the current state of the dictionary.
-   NOTE - you should use it only when no encoder uses the dicitonary. */
+   NOTE - you should use it only when no encoder uses the dictionary. */
 void glz_enc_dictionary_get_restore_data(GlzEncDictContext *opaque_dict,
                                          GlzEncDictRestoreData *out_data,
                                          GlzEncoderUsrContext *usr);
@@ -58,11 +58,11 @@ void glz_enc_dictionary_get_restore_data(GlzEncDictContext *opaque_dict,
 GlzEncDictContext *glz_enc_dictionary_restore(GlzEncDictRestoreData *restore_data,
                                               GlzEncoderUsrContext *usr);
 
-/*  NOTE - you should use this routine only when no encoder uses the dicitonary. */
+/*  NOTE - you should use this routine only when no encoder uses the dictionary. */
 void glz_enc_dictionary_reset(GlzEncDictContext *opaque_dict, GlzEncoderUsrContext *usr);
 
 /* image: the context returned by the encoder when the image was encoded.
-   NOTE - you should use this routine only when no encoder uses the dicitonary.*/
+   NOTE - you should use this routine only when no encoder uses the dictionary.*/
 void glz_enc_dictionary_remove_image(GlzEncDictContext *opaque_dict,
                                      GlzEncDictImageContext *image, GlzEncoderUsrContext *usr);
 
diff --git a/server/glz_encoder_dictionary_protected.h b/server/glz_encoder_dictionary_protected.h
index 812468b..a594c5f 100644
--- a/server/glz_encoder_dictionary_protected.h
+++ b/server/glz_encoder_dictionary_protected.h
@@ -56,7 +56,7 @@ struct WindowImage {
 #define NULL_IMAGE_SEG_ID MAX_IMAGE_SEGS_NUM
 #define INIT_IMAGE_SEGS_NUM 1000
 
-/* Images can be seperated into several chunks. The basic unit of the
+/* Images can be separated into several chunks. The basic unit of the
    dictionary window is one image segment. Each segment is encoded separately.
    An encoded match can refer to only one segment.*/
 struct WindowImageSegment {
@@ -66,7 +66,7 @@ struct WindowImageSegment {
     uint32_t pixels_num;            // Number of pixels in the segment
     uint64_t pixels_so_far;         // Total no. pixels passed through the window till this segment.
                                     // NOTE - never use size delta independently. It should
-                                    // always be used with respect to a previouse size delta
+                                    // always be used with respect to a previous size delta
     uint32_t next;
 };
 
@@ -80,7 +80,7 @@ struct  __attribute__ ((__packed__)) HashEntry {
 struct SharedDictionary {
     struct {
         /* The segments storage. A dynamic array.
-           By reffering to a segment by its index, insetad of address,
+           By referring to a segment by its index, instead of address,
            we save space in the hash entries (32bit instead of 64bit) */
         WindowImageSegment  *segs;
         uint32_t segs_quota;
@@ -89,8 +89,8 @@ struct SharedDictionary {
            array in order to keep the indices of the segments consistent
            after reallocation */
 
-        /* the window in a resultion of image segments */
-        uint32_t used_segs_head;             // the lateset head
+        /* the window in a resolution of image segments */
+        uint32_t used_segs_head;             // the latest head
         uint32_t used_segs_tail;
         uint32_t free_segs_head;
 
@@ -99,7 +99,7 @@ struct SharedDictionary {
                                              // The head is NULL_IMAGE_SEG_ID when the encoder is
                                              // not encoding.
 
-        /* the window in a resultion of images. But here the head contains the oldest head*/
+        /* the window in a resolution of images. But here the head contains the oldest head*/
         WindowImage*        used_images_tail;
         WindowImage*        used_images_head;
         WindowImage*        free_images;
@@ -108,7 +108,7 @@ struct SharedDictionary {
         uint32_t size_limit;                 // max number of pixels in a window (per encoder)
     } window;
 
-    /* Concurrency issues: the reading/wrting of each entry field should be atomic.
+    /* Concurrency issues: the reading/writing of each entry field should be atomic.
        It is allowed that the reading/writing of the whole entry won't be atomic,
        since before we access a reference we check its validity*/
 #ifdef CHAINED_HASH
@@ -130,8 +130,8 @@ struct SharedDictionary {
     If possible, release images from the head of the window.
     Also perform concurrency related operations.
 
-    usr_image_context: when an image is released from the window due to capicity overflow,
-                       usr_image_context is given as a parmater to the free_image callback.
+    usr_image_context: when an image is released from the window due to capacity overflow,
+                       usr_image_context is given as a parameter to the free_image callback.
 
     image_head_dist  : the number of images between the current image and the head of the
                        window that is associated with the encoder.
diff --git a/server/red_bitmap_utils.h b/server/red_bitmap_utils.h
index 7ae3d88..1f26eb4 100644
--- a/server/red_bitmap_utils.h
+++ b/server/red_bitmap_utils.h
@@ -108,7 +108,7 @@ static inline double FNAME(pixels_square_score)(PIXEL *line1, PIXEL *line2)
     all_ident = all_ident && (!cmp_res);
     ret += FNAME(PIX_PAIR_SCORE)[cmp_res];
 
-    // ignore squares where al pixels are identical
+    // ignore squares where all pixels are identical
     if (all_ident) {
         ret -= (FNAME(PIX_PAIR_SCORE)[0]) * 3;
     }
diff --git a/server/red_memslots.c b/server/red_memslots.c
index d660ef4..bc428d5 100644
--- a/server/red_memslots.c
+++ b/server/red_memslots.c
@@ -55,7 +55,7 @@ unsigned long get_virt_delta(RedMemSlotInfo *info, unsigned long addr, int group
 
     slot_id = get_memslot_id(info, addr);
     if (slot_id > info->num_memslots) {
-        PANIC("slod_id %d too big", slot_id);
+        PANIC("slot_id %d too big", slot_id);
     }
 
     slot = &info->mem_slots[group_id][slot_id];
diff --git a/server/red_tunnel_worker.c b/server/red_tunnel_worker.c
index 210de9d..e331a1a 100644
--- a/server/red_tunnel_worker.c
+++ b/server/red_tunnel_worker.c
@@ -226,7 +226,7 @@ typedef struct RedSocketInData {
 
     uint32_t num_buffers;
 
-    int32_t num_tokens;   // No. tokens conusmed by slirp since the last token msg sent to the
+    int32_t num_tokens;   // No. tokens consumed by slirp since the last token msg sent to the
                           // client. can be negative if we loaned some to the client (when the
                           // ready queue is empty)
     uint32_t client_total_num_tokens;
@@ -474,13 +474,13 @@ static inline void tunnel_channel_activate_migrated_sockets(TunnelChannel *chann
 /*******************************************************************************************/
 
 /* use for signaling that 1) subroutines failed 2)routines in the interface for slirp
-   failed (which triggred from a call to slirp) */
+   failed (which triggered from a call to slirp) */
 #define SET_TUNNEL_ERROR(channel,format, ...) {   \
     channel->tunnel_error = TRUE;                 \
     red_printf(format, ## __VA_ARGS__);           \
 }
 
-/* should be checked after each subroutine that may cause error or fter calls to slirp routines */
+/* should be checked after each subroutine that may cause error or after calls to slirp routines */
 #define CHECK_TUNNEL_ERROR(channel) (channel->tunnel_error)
 
 struct TunnelChannel {
@@ -1542,7 +1542,7 @@ static int tunnel_channel_handle_socket_closed(TunnelChannel *channel, RedSocket
         net_slirp_socket_abort(sckt->slirp_sckt);
     } else if ((sckt->slirp_status != SLIRP_SCKT_STATUS_WAIT_CLOSE) ||
                (prev_client_status != CLIENT_SCKT_STATUS_SHUTDOWN_SEND)) {
-        // slirp can be in wait close if both slirp and client sent fin perviously
+        // slirp can be in wait close if both slirp and client sent fin previously
         // otherwise, the prev client status would also have been wait close, and this
         // case was handled above
         red_printf("unexpected slirp_status=%d", sckt->slirp_status);
@@ -1570,7 +1570,7 @@ static int tunnel_channel_handle_socket_closed_ack(TunnelChannel *channel, RedSo
     }
 
     if (sckt->slirp_status != SLIRP_SCKT_STATUS_CLOSED) {
-        red_printf("unexcpected SPICE_MSGC_TUNNEL_SOCKET_CLOSED_ACK slirp_status=%d",
+        red_printf("unexpected SPICE_MSGC_TUNNEL_SOCKET_CLOSED_ACK slirp_status=%d",
                    sckt->slirp_status);
         return FALSE;
     }
@@ -1584,12 +1584,12 @@ static int tunnel_channel_handle_socket_receive_data(TunnelChannel *channel, Red
 {
     if ((sckt->client_status == CLIENT_SCKT_STATUS_SHUTDOWN_SEND) ||
         (sckt->client_status == CLIENT_SCKT_STATUS_CLOSED)) {
-        red_printf("unexcpected SPICE_MSGC_TUNNEL_SOCKET_DATA clinet_status=%d",
+        red_printf("unexpected SPICE_MSGC_TUNNEL_SOCKET_DATA client_status=%d",
                    sckt->client_status);
         return FALSE;
     }
 
-    // handling a case where the client sent data before it recieved the close msg
+    // handling a case where the client sent data before it received the close msg
     if ((sckt->slirp_status != SLIRP_SCKT_STATUS_OPEN) &&
             (sckt->slirp_status != SLIRP_SCKT_STATUS_SHUTDOWN_SEND)) {
         __tunnel_worker_free_socket_rcv_buf(sckt->worker, recv_data);
@@ -1606,7 +1606,7 @@ static int tunnel_channel_handle_socket_receive_data(TunnelChannel *channel, Red
 
     tunnel_socket_assign_rcv_buf(sckt, recv_data, buf_size);
     if (!sckt->in_data.client_total_num_tokens) {
-        red_printf("token vailoation");
+        red_printf("token violation");
         return FALSE;
     }
 
@@ -1915,7 +1915,7 @@ static void __restore_ready_chunks_queue(RedSocket *sckt, ReadyTunneledChunkQueu
 }
 
 // not using the alloc_buf cb of the queue, since we may want to create the migrated buffers
-// with other properties (e.g., not releasing tokent)
+// with other properties (e.g., not releasing token)
 static void __restore_process_queue(RedSocket *sckt, TunneledBufferProcessQueue *queue,
                                     uint8_t *data, int size,
                                     socket_alloc_buffer_proc_t alloc_buf)
@@ -2711,7 +2711,7 @@ static void tunnel_channel_send_socket_out_data(TunnelChannel *channel, PipeItem
     }
 
     if (!sckt->out_data.num_tokens) {
-        return; // only when an we will recieve tokens, data will be sent again.
+        return; // only when an we will receive tokens, data will be sent again.
     }
 
     ASSERT(sckt->out_data.ready_chunks_queue.head);
@@ -2767,7 +2767,7 @@ static void tunnel_worker_release_socket_out_data(TunnelWorker *worker, PipeItem
 
     sckt_out_data->data_size -= sckt_out_data->push_tail_size;
 
-    // compansation. was substructed in the previous lines
+    // compensation. was subtracted in the previous lines
     sckt_out_data->data_size += sckt_out_data->ready_chunks_queue.offset;
 
     if (sckt_out_data->push_tail_size == sckt_out_data->push_tail->size) {
@@ -2784,8 +2784,8 @@ static void tunnel_worker_release_socket_out_data(TunnelWorker *worker, PipeItem
         // can still send data to socket
         if (__client_socket_can_receive(sckt)) {
             if (sckt_out_data->ready_chunks_queue.head) {
-                // the pipe item may alreay be linked, if for example the send was
-                // blocked and before it finshed and called release, tunnel_socket_send was called
+                // the pipe item may already be linked, if for example the send was
+                // blocked and before it finished and called release, tunnel_socket_send was called
                 if (!red_channel_pipe_item_is_linked(
                         &worker->channel->base, &sckt_out_data->data_pipe_item)) {
                     sckt_out_data->data_pipe_item.type = PIPE_ITEM_TYPE_SOCKET_DATA;
@@ -3097,7 +3097,7 @@ static int tunnel_socket_recv(SlirpUsrNetworkInterface *usr_interface, UserSocke
 
     if ((sckt->slirp_status == SLIRP_SCKT_STATUS_SHUTDOWN_RECV) ||
         (sckt->slirp_status == SLIRP_SCKT_STATUS_WAIT_CLOSE)) {
-        SET_TUNNEL_ERROR(worker->channel, "recieve was shutdown");
+        SET_TUNNEL_ERROR(worker->channel, "receive was shutdown");
         tunnel_shutdown(worker);
         errno = ECONNRESET;
         return -1;
@@ -3155,8 +3155,8 @@ static void null_tunnel_socket_shutdown_send(SlirpUsrNetworkInterface *usr_inter
 {
 }
 
-// can be called : 1) when a FIN is reqested from the guset 2) after shutdown rcv that was called
-//                  after recieved failed because the client socket was sent FIN
+// can be called : 1) when a FIN is requested from the guest 2) after shutdown rcv that was called
+//                  after received failed because the client socket was sent FIN
 static void tunnel_socket_shutdown_send(SlirpUsrNetworkInterface *usr_interface, UserSocket *opaque)
 {
     TunnelWorker *worker;
@@ -3269,7 +3269,7 @@ static void null_tunnel_socket_close(SlirpUsrNetworkInterface *usr_interface, Us
       // was caused by an error
 }
 
-// can be called during migration due to the channel diconnect. But it does not affect the
+// can be called during migration due to the channel disconnect. But it does not affect the
 // migrate data
 static void tunnel_socket_close(SlirpUsrNetworkInterface *usr_interface, UserSocket *opaque)
 {
@@ -3289,7 +3289,7 @@ static void tunnel_socket_close(SlirpUsrNetworkInterface *usr_interface, UserSoc
 
     sckt->slirp_status = SLIRP_SCKT_STATUS_CLOSED;
 
-    // if sckt is not opened yet, close will be sent when we recieve connect ack
+    // if sckt is not opened yet, close will be sent when we receive connect ack
     if ((sckt->client_status == CLIENT_SCKT_STATUS_OPEN) ||
         (sckt->client_status == CLIENT_SCKT_STATUS_SHUTDOWN_SEND)) {
         // check if there is still data to send. the close will be sent after data is released.
diff --git a/server/red_worker.c b/server/red_worker.c
index f509ea2..c89adf1 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -584,7 +584,7 @@ typedef struct {
 
 typedef struct RedGlzDrawable RedGlzDrawable;
 
-/* for each qxl drawable, there may be serveral instances of lz drawables */
+/* for each qxl drawable, there may be several instances of lz drawables */
 typedef struct GlzDrawableInstanceItem {
     RingItem glz_link;
     RingItem free_link;
@@ -1185,7 +1185,7 @@ static void show_qxl_drawable(RedWorker *worker, QXLDrawable *drawable, const ch
     case QXL_DRAW_TEXT:
         break;
     default:
-        red_error("bad rawable type");
+        red_error("bad drawable type");
     }
     printf("\n");
 }
@@ -1601,7 +1601,7 @@ static inline void release_drawable(RedWorker *worker, Drawable *item)
 
         if (item->red_glz_drawable) {
             item->red_glz_drawable->drawable = NULL;
-        } else { // no refernce to the qxl drawable left
+        } else { // no reference to the qxl drawable left
             free_qxl_drawable(worker, item->qxl_drawable, item->group_id, item->self_bitmap,
                               item->surface_id);
         }
@@ -3837,7 +3837,7 @@ static inline void red_process_drawable(RedWorker *worker, QXLDrawable *drawable
     /*
         surface->refs is affected by a drawable (that is
         dependent on the surface) as long as the drawable is alive.
-        However, surfce->depend_on_me is affected by a drawable only
+        However, surface->depend_on_me is affected by a drawable only
         as long as it is in the current tree (hasn't been rendered yet).
     */
     red_inc_surfaces_drawable_dependencies(worker, item);
@@ -4521,7 +4521,7 @@ static void red_draw_qxl_drawable(RedWorker *worker, Drawable *drawable)
         break;
     }
     default:
-        red_printf("invlaid type");
+        red_printf("invalid type");
     }
     unlocalize_clip(&clip);
 }
@@ -5225,7 +5225,7 @@ static RedGlzDrawable *red_display_get_glz_drawable(DisplayChannel *channel, Dra
 static GlzDrawableInstanceItem *red_display_add_glz_drawable_instance(RedGlzDrawable *glz_drawable)
 {
     ASSERT(glz_drawable->instances_count < MAX_GLZ_DRAWABLE_INSTANCES);
-    // NOTE: We assume the addtions are performed consecutively, without removals in the middle
+    // NOTE: We assume the additions are performed consecutively, without removals in the middle
     GlzDrawableInstanceItem *ret = glz_drawable->instances_pool + glz_drawable->instances_count;
     glz_drawable->instances_count++;
 
@@ -5239,10 +5239,10 @@ static GlzDrawableInstanceItem *red_display_add_glz_drawable_instance(RedGlzDraw
 }
 
 /* Remove from the to_free list and the instances_list.
-   When no instance is left - the RedGlzDrawable is released too. (and the qxl drawblae too, if
+   When no instance is left - the RedGlzDrawable is released too. (and the qxl drawable too, if
    it is not used by Drawable).
    NOTE - 1) can be called only by the display channel that created the drawable
-          2) it is assumed that the instance was already removed from the dicitonary*/
+          2) it is assumed that the instance was already removed from the dictionary*/
 static void red_display_free_glz_drawable_instance(DisplayChannel *channel,
                                                    GlzDrawableInstanceItem *glz_drawable_instance)
 {
@@ -5258,7 +5258,7 @@ static void red_display_free_glz_drawable_instance(DisplayChannel *channel,
 
     ring_remove(&glz_drawable_instance->glz_link);
     glz_drawable->instances_count--;
-    // whan the remove callback is performed from the channel that the
+    // when the remove callback is performed from the channel that the
     // drawable belongs to, the instance is not added to the 'to_free' list
     if (ring_item_is_linked(&glz_drawable_instance->free_link)) {
         ring_remove(&glz_drawable_instance->free_link);
@@ -5303,7 +5303,7 @@ static void red_display_handle_glz_drawables_to_free(DisplayChannel* channel)
 /* releases all the instances of the drawable from the dictionary and the display channel.
    The release of the last instance will also release the drawable itself and the qxl drawable
    if possible.
-   NOTE - the caller should prevent encoding using the dicitonary during this operation*/
+   NOTE - the caller should prevent encoding using the dictionary during this operation*/
 static void red_display_free_glz_drawable(DisplayChannel *channel, RedGlzDrawable *drawable)
 {
     RingItem *head_instance = ring_get_head(&drawable->instances);
@@ -5332,7 +5332,7 @@ static void red_display_free_glz_drawable(DisplayChannel *channel, RedGlzDrawabl
 }
 
 /* Clear all lz drawables - enforce their removal from the global dictionary.
-   NOTE - prevents encoding using the dicitonary during the operation*/
+   NOTE - prevents encoding using the dictionary during the operation*/
 static void red_display_clear_glz_drawables(DisplayChannel *channel)
 {
     RingItem *ring_link;
@@ -5356,7 +5356,7 @@ static void red_display_clear_glz_drawables(DisplayChannel *channel)
 
 /* Remove from the global lz dictionary some glz_drawables that have no reference to
    Drawable (their qxl drawables are released too).
-   NOTE - the caller should prevent encoding using the dicitonary during the operation*/
+   NOTE - the caller should prevent encoding using the dictionary during the operation*/
 static int red_display_free_some_independent_glz_drawables(DisplayChannel *channel)
 {
     int n = 0;
@@ -6916,7 +6916,7 @@ static inline uint8_t *red_get_image_line(RedWorker *worker, QXLDataChunk **chun
     }
 
     if (data_size - *offset < stride) {
-        red_printf("bad chunk aligment");
+        red_printf("bad chunk alignment");
         return NULL;
     }
     ret = (*chunk)->data + *offset;
@@ -8126,7 +8126,7 @@ static inline void flush_display_commands(RedWorker *worker)
             red_receive(channel);
             red_send_data(channel, NULL);
             if (red_now() >= end_time) {
-                red_printf("update timout");
+                red_printf("update timeout");
                 red_disconnect_display((RedChannel *)worker->display_channel);
             } else {
                 sleep_count++;
@@ -9497,7 +9497,7 @@ void *red_worker_main(void *arg)
         if (worker.display_channel && worker.display_channel->glz_dict) {
             /* during migration, in the dest, the display channel can be initialized
                while the global lz data not since migrate data msg hasn't been
-               recieved yet */
+               received yet */
             red_display_handle_glz_drawables_to_free(worker.display_channel);
         }
 
diff --git a/server/reds.c b/server/reds.c
index bf66a0b..189e812 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -99,7 +99,7 @@ static void openssl_init();
 #define MM_TIMER_GRANULARITY_MS (1000 / 30)
 #define MM_TIME_DELTA 400 /*ms*/
 
-// approximate max recive message size
+// approximate max receive message size
 #define RECIVE_BUF_SIZE \
     (4096 + (REDS_AGENT_WINDOW_SIZE + REDS_NUM_INTERNAL_AGENT_MESSAGES) * SPICE_AGENT_MAX_DATA_SIZE)
 
@@ -1467,7 +1467,7 @@ static int main_channel_restore_vdi_read_state(MainMigrateData *data, uint8_t **
     switch (state->read_state) {
     case VDI_PORT_READ_STATE_READ_HADER:
         if (data->read_buf_len) {
-            red_printf("unexpected recive buf");
+            red_printf("unexpected receive buf");
             reds_disconnect();
             return FALSE;
         }
@@ -1475,13 +1475,13 @@ static int main_channel_restore_vdi_read_state(MainMigrateData *data, uint8_t **
         break;
     case VDI_PORT_READ_STATE_GET_BUFF:
         if (state->message_recive_len > state->vdi_chunk_header.size) {
-            red_printf("invalid message recive len");
+            red_printf("invalid message receive len");
             reds_disconnect();
             return FALSE;
         }
 
         if (data->read_buf_len) {
-            red_printf("unexpected recive buf");
+            red_printf("unexpected receive buf");
             reds_disconnect();
             return FALSE;
         }
@@ -1497,7 +1497,7 @@ static int main_channel_restore_vdi_read_state(MainMigrateData *data, uint8_t **
         }
 
         if (state->message_recive_len > state->vdi_chunk_header.size) {
-            red_printf("invalid message recive len");
+            red_printf("invalid message receive len");
             reds_disconnect();
             return FALSE;
         }
@@ -1680,7 +1680,7 @@ static void reds_main_handle_message(void *opaque, SpiceDataHeader *message)
         VDAgentExtBuf *buf;
 
         if (!reds->agent_state.num_client_tokens) {
-            red_printf("token vailoation");
+            red_printf("token violation");
             reds_disconnect();
             break;
         }
@@ -1788,7 +1788,7 @@ static void reds_main_handle_message(void *opaque, SpiceDataHeader *message)
                     // probably high load on client or server result with incorrect values
                     letancy = 0;
                     red_printf("net test: invalid values, letancy %lu roundtrip %lu. assuming high"
-                               "bendwidth", letancy, roundtrip);
+                               "bandwidth", letancy, roundtrip);
                     break;
                 }
                 bitrate_per_sec = (uint64_t)(NET_TEST_BYTES * 8) * 1000000 / (roundtrip - letancy);
@@ -1991,7 +1991,7 @@ static int reds_send_link_error(RedLinkInfo *link, uint32_t error)
 
 static void reds_show_new_channel(RedLinkInfo *link)
 {
-    red_printf("channel %d:%d, connected sucessfully, over %s link",
+    red_printf("channel %d:%d, connected successfully, over %s link",
                link->link_mess->channel_type,
                link->link_mess->channel_id,
                link->peer->ssl == NULL ? "Non Secure" : "Secure");
@@ -2516,7 +2516,7 @@ static void reds_handle_other_links(RedLinkInfo *link)
     if (link_mess->channel_type == SPICE_CHANNEL_INPUTS && !link->peer->ssl) {
         SimpleOutItem *item;
         SpiceMsgNotify *notify;
-        char *mess = "keybord channel is unsecure";
+        char *mess = "keyboard channel is insecure";
         const int mess_len = strlen(mess);
 
         if (!(item = new_simple_out_item(SPICE_MSG_NOTIFY, sizeof(SpiceMsgNotify) + mess_len + 1))) {
@@ -3419,7 +3419,7 @@ __visible__ int spice_server_add_interface(SpiceServer *s,
         }
         if (interface->major_version != SPICE_INTERFACE_KEYBOARD_MAJOR ||
             interface->minor_version < SPICE_INTERFACE_KEYBOARD_MINOR) {
-            red_printf("unsuported keyboard interface");
+            red_printf("unsupported keyboard interface");
             return -1;
         }
         keyboard = SPICE_CONTAINEROF(sin, SpiceKbdInstance, base);
@@ -3433,7 +3433,7 @@ __visible__ int spice_server_add_interface(SpiceServer *s,
         }
         if (interface->major_version != SPICE_INTERFACE_MOUSE_MAJOR ||
             interface->minor_version < SPICE_INTERFACE_MOUSE_MINOR) {
-            red_printf("unsuported mouse interface");
+            red_printf("unsupported mouse interface");
             return -1;
         }
         mouse = SPICE_CONTAINEROF(sin, SpiceMouseInstance, base);
@@ -3445,7 +3445,7 @@ __visible__ int spice_server_add_interface(SpiceServer *s,
         red_printf("SPICE_INTERFACE_QXL");
         if (interface->major_version != SPICE_INTERFACE_QXL_MAJOR ||
             interface->minor_version < SPICE_INTERFACE_QXL_MINOR) {
-            red_printf("unsuported qxl interface");
+            red_printf("unsupported qxl interface");
             return -1;
         }
 
@@ -3462,7 +3462,7 @@ __visible__ int spice_server_add_interface(SpiceServer *s,
         }
         if (interface->major_version != SPICE_INTERFACE_TABLET_MAJOR ||
             interface->minor_version < SPICE_INTERFACE_TABLET_MINOR) {
-            red_printf("unsuported tablet interface");
+            red_printf("unsupported tablet interface");
             return -1;
         }
         tablet = SPICE_CONTAINEROF(sin, SpiceTabletInstance, base);
@@ -3479,7 +3479,7 @@ __visible__ int spice_server_add_interface(SpiceServer *s,
         red_printf("SPICE_INTERFACE_PLAYBACK");
         if (interface->major_version != SPICE_INTERFACE_PLAYBACK_MAJOR ||
             interface->minor_version < SPICE_INTERFACE_PLAYBACK_MINOR) {
-            red_printf("unsuported playback interface");
+            red_printf("unsupported playback interface");
             return -1;
         }
         snd_attach_playback(SPICE_CONTAINEROF(sin, SpicePlaybackInstance, base));
@@ -3488,7 +3488,7 @@ __visible__ int spice_server_add_interface(SpiceServer *s,
         red_printf("SPICE_INTERFACE_RECORD");
         if (interface->major_version != SPICE_INTERFACE_RECORD_MAJOR ||
             interface->minor_version < SPICE_INTERFACE_RECORD_MINOR) {
-            red_printf("unsuported record interface");
+            red_printf("unsupported record interface");
             return -1;
         }
         snd_attach_record(SPICE_CONTAINEROF(sin, SpiceRecordInstance, base));
@@ -3501,7 +3501,7 @@ __visible__ int spice_server_add_interface(SpiceServer *s,
         }
         if (interface->major_version != SPICE_INTERFACE_VDI_PORT_MAJOR ||
             interface->minor_version < SPICE_INTERFACE_VDI_PORT_MINOR) {
-            red_printf("unsuported vdi port interface");
+            red_printf("unsupported vdi port interface");
             return -1;
         }
         attach_to_red_agent(SPICE_CONTAINEROF(sin, SpiceVDIPortInstance, base));
@@ -3516,7 +3516,7 @@ __visible__ int spice_server_add_interface(SpiceServer *s,
         }
         if (interface->major_version != SPICE_INTERFACE_NET_WIRE_MAJOR ||
             interface->minor_version < SPICE_INTERFACE_NET_WIRE_MINOR) {
-            red_printf("unsuported net wire interface");
+            red_printf("unsupported net wire interface");
             return -1;
         }
         net = SPICE_CONTAINEROF(sin, SpiceNetWireInstance, base);
diff --git a/server/reds.h b/server/reds.h
index b9d5336..6eed02b 100644
--- a/server/reds.h
+++ b/server/reds.h
@@ -31,7 +31,7 @@ typedef struct RedsStreamContext {
     SpiceWatch *watch;
 
     /* set it to TRUE if you shutdown the socket. shutdown read doesn't work as accepted -
-       receive may return data afterwards. check the flag before calling receive*/
+       receive may return data afterward. check the flag before calling receive*/
     int shutdown;
     SSL *ssl;
 


More information about the Spice-commits mailing list